Skip to content
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

NPE in DocumentElementNode.writeXMLContent #1491

Open
laeubi opened this issue Nov 23, 2024 · 1 comment
Open

NPE in DocumentElementNode.writeXMLContent #1491

laeubi opened this issue Nov 23, 2024 · 1 comment

Comments

@laeubi
Copy link
Contributor

laeubi commented Nov 23, 2024

I just updated to the new RC1 release

Version: 2024-12 RC1 (4.34.0 RC1)
Build id: 20241121-0709

and now getting

java.lang.RuntimeException: Error on /MyJavaSourceFile.java
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:1051)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:728)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver$ECJCompilationUnitResolver.resolve(CompilationUnitResolver.java:100)
	at org.eclipse.jdt.core.dom.ASTParser.createASTs(ASTParser.java:1004)
	at org.eclipse.pde.ds.internal.annotations.DSAnnotationCompilationParticipant.processAnnotations(DSAnnotationCompilationParticipant.java:717)
	at org.eclipse.pde.ds.internal.annotations.DSAnnotationCompilationParticipant.processAnnotations(DSAnnotationCompilationParticipant.java:653)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.processAnnotations(AbstractImageBuilder.java:797)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:410)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:118)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:314)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:226)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1077)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:296)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:352)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:441)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:444)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:555)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:503)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:585)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:207)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:300)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.pde.internal.core.text.IDocumentTextNode.write()" because "this.fTextNode" is null
	at org.eclipse.pde.internal.core.text.DocumentElementNode.writeXMLContent(DocumentElementNode.java:193)
	at org.eclipse.pde.internal.core.text.DocumentElementNode.write(DocumentElementNode.java:170)
	at org.eclipse.pde.internal.core.text.DocumentElementNode.write(DocumentElementNode.java:165)
	at org.eclipse.pde.internal.core.text.DocumentObject.write(DocumentObject.java:232)
	at org.eclipse.pde.internal.core.text.XMLEditingModel.save(XMLEditingModel.java:156)
	at org.eclipse.pde.internal.core.text.XMLEditingModel.getContents(XMLEditingModel.java:149)
	at org.eclipse.pde.ds.internal.annotations.AnnotationVisitor$1.getTextOperations(AnnotationVisitor.java:430)
	at org.eclipse.pde.ds.internal.annotations.AnnotationVisitor.processComponent(AnnotationVisitor.java:444)
	at org.eclipse.pde.ds.internal.annotations.AnnotationVisitor.visit(AnnotationVisitor.java:285)
	at org.eclipse.jdt.core.dom.TypeDeclaration.accept0(TypeDeclaration.java:480)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3312)
	at org.eclipse.jdt.core.dom.ASTNode.acceptChildren(ASTNode.java:3383)
	at org.eclipse.jdt.core.dom.CompilationUnit.accept0(CompilationUnit.java:257)
	at org.eclipse.jdt.core.dom.ASTNode.accept(ASTNode.java:3312)
	at org.eclipse.pde.ds.internal.annotations.AnnotationProcessor.acceptAST(AnnotationProcessor.java:74)
	at org.eclipse.jdt.core.dom.CompilationUnitResolver.resolve(CompilationUnitResolver.java:1049)
	... 23 more

in one of my projects, I'm currently not able to isolate this as a test-case.

@laeubi
Copy link
Contributor Author

laeubi commented Nov 23, 2024

It seems to be triggered by the usage of the following component property type:

@Retention(CLASS)
@Target(TYPE)
@ComponentPropertyType
public @interface HttpMethod {

	Verb value();
}

With this enum

public enum Verb {
	GET, POST;
}

then used in a component:

@HttpMethod(Verb.GET)
@Component
public class MyComponent {

}

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