Skip to content

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

Open
@robstryker

Description

@robstryker

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions