Skip to content

Unexpected Type error message due to not all required sources being compiled #1191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
robstryker opened this issue Jan 29, 2025 · 0 comments

Comments

@robstryker
Copy link

Problem being created in pde/eclipse.pde/ui/org.eclipse.pde.runtime/src/org/eclipse/pde/internal/runtime/registry/RegistryBrowser.java

Problematic code is:

private void hookDoubleClickAction() {
	fTreeViewer.addDoubleClickListener(event -> {
		IStructuredSelection selection = fTreeViewer.getStructuredSelection();
		if (selection.size() == 1) {
			Object obj = selection.getFirstElement();
			if (obj instanceof Bundle)
				ManifestEditor.openPluginEditor(((Bundle) obj).getSymbolicName());
		}
	});
}

The problem is that ManifestEditor is not one of the files passed in to be compiled.

In the call to JavacTask task = ((JavacTool)tool).getTask(null, fileManager, null /* already added to context */, List.of(), List.of() /* already set */, sourceFiles, javacContext);, the sourceFiles do not include files from other projects., apparently?

Most of a trace below, with the messy middle deleted:

JavacProblem(DefaultProblem).(char[], String, int, String[], int, int, int, int, int) line: 49
JavacProblem.(char[], String, String, int, String[], int, int, int, int, int) line: 23
JavacProblemConverter.createJavacProblem(Diagnostic) line: 138
JavacCompiler.lambda$8(Set, JavacProblemConverter, Map, Diagnostic) line: 127
0x00007f6813ba4430.report(Diagnostic) line: not available
Log.writeDiagnostic(JCDiagnostic) line: 741
Log$DefaultDiagnosticHandler.report(JCDiagnostic) line: 722
Log.report(JCDiagnostic) line: 675
Log(AbstractLog).error(JCDiagnostic$DiagnosticPosition, JCDiagnostic$Error) line: 116
Attr.check(JCTree, Type, Kinds$KindSelector, Attr$ResultInfo) line: 236

... etc etc ...

ProceedOnErrorGen(Gen).genClass(Env, JCClassDecl) line: 2494
JavacCompiler$2(JavaCompiler).genCode(Env, JCClassDecl) line: 770
JavacCompiler$2(JavaCompiler).generate(Queue<Pair<Env,JCClassDecl>>, Queue) line: 1700
JavacCompiler$2.generate(Queue<Pair<Env,JCClassDecl>>, Queue) line: 166
JavacTaskImpl.generate(Iterable) line: 468
JavacTaskImpl.lambda$generate$2() line: 445
0x00007f6813af54b0.call() line: not available
JavacTaskImpl.invocationHelper(Callable) line: 152
JavacTaskImpl.generate() line: 445
JavacCompiler.compile(ICompilationUnit[]) line: 215
BatchImageBuilder(AbstractImageBuilder).compile(SourceFile[], SourceFile[], boolean) line: 441
BatchImageBuilder.compile(SourceFile[], SourceFile[], boolean) line: 250
BatchImageBuilder(AbstractImageBuilder).compile(SourceFile[]) line: 372
BatchImageBuilder.build() line: 118
JavaBuilder.buildAll() line: 311

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant