Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package org.pitest.pitclipse.core;

import static org.eclipse.core.runtime.FileLocator.getBundleFile;
import static org.pitest.pitclipse.core.preferences.PitPreferences.AVOID_CALLS_TO;
import static org.pitest.pitclipse.core.preferences.PitPreferences.EXCLUDED_CLASSES;
import static org.pitest.pitclipse.core.preferences.PitPreferences.EXCLUDED_METHODS;
Expand All @@ -37,6 +36,7 @@
import java.util.Collections;
import java.util.List;

import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
Expand Down Expand Up @@ -158,7 +158,9 @@ private void addOurBundleToClasspath(List<String> classpath, String bundleName)
}

private String getBundleCanonicalPath(String bundleName) throws IOException {
return getBundleFile(Platform.getBundle(bundleName)).getCanonicalPath();
return FileLocator.getBundleFileLocation(Platform.getBundle(bundleName))
.orElseThrow(() -> new IOException("Unable to locate the bundle file: " + bundleName))
.getCanonicalPath();
}

private void setupStateDirectories() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IOrdinaryClassFile;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.ITypeRoot;
import org.eclipse.jface.dialogs.MessageDialog;
Expand Down Expand Up @@ -364,7 +365,10 @@ private Optional<IJavaElement> getLaunchElementFor(IJavaElement element) {
case METHOD:
return Optional.of(element);
case CLASS_FILE:
return Optional.ofNullable(((IClassFile) element).getType());
IClassFile classFile = (IClassFile) element;
if (classFile instanceof IOrdinaryClassFile) {
return Optional.ofNullable(((IOrdinaryClassFile)classFile).getType());
}
case COMPILATION_UNIT:
return Optional.ofNullable(((ICompilationUnit) element).findPrimaryType());
default:
Expand Down