Skip to content

Commit

Permalink
Use progress monitor when finding types in project
Browse files Browse the repository at this point in the history
This allows for nested types to be resolved. Without a progress monitor,
JDT doesn't resolve nested types.

Signed-off-by: David Thompson <[email protected]>
  • Loading branch information
datho7561 committed Dec 5, 2024
1 parent b8f2366 commit f8561ef
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.logging.Logger;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.IField;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IMember;
Expand Down Expand Up @@ -48,7 +49,7 @@ public static String getSimpleClassName(String className) {

public static IType findType(IJavaProject project, String className) {
try {
return project.findType(className);
return project.findType(className, new NullProgressMonitor());
} catch (JavaModelException e) {
LOGGER.log(Level.SEVERE, "Error while finding type for '" + className + "'.", e);
return null;
Expand Down

0 comments on commit f8561ef

Please sign in to comment.