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

Koloboke Compile: NullPointerException at compile time #60

Open
Neiko2002 opened this issue Oct 17, 2017 · 0 comments
Open

Koloboke Compile: NullPointerException at compile time #60

Neiko2002 opened this issue Oct 17, 2017 · 0 comments

Comments

@Neiko2002
Copy link

Reproduce:

  • clean install of Eclipse Oxygen Java JDK 1.8.0_144 on Windows 10 Build 1703
  • add a new Java project to eclipse
  • download the koloboke-compile-0.5.1.jar and koloboke-impl-common-jdk-1.0.0.jar into a "lib" directory inside the project
  • add both libraries to the build path of the project (Java Build Path->Libraries->Add JARs)
  • activate annotation process in the project settings (Java Compiler->Annotation Processing)
  • add the annotation compiler to the project settings (Java Compiler->Annotation Processing->Factory Path)
  • create a new file called MyMap.java and enter the example code:
import java.util.Map;

@KolobokeMap
abstract class MyMap<K, V> implements Map<K, V> {
    static <K, V> Map<K, V> withExpectedSize(int expectedSize) {
        return new KolobokeMyMap<K, V>(expectedSize);
    }
}

Afterwards Eclipse shows an error at the MyMap class name and presents the following exception:

please report this on https://github.com/leventov/Koloboke/issues:
java.lang.NullPointerException
	at com.koloboke.compile.processor.ExtensionChains$replaceTypeParam$1.visitCtExecutableReference(ExtensionChains.kt:135)
	at zzz_koloboke_compile.shaded.$spoon$.support.reflect.reference.CtExecutableReferenceImpl.accept(CtExecutableReferenceImpl.java:66)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.scan(CtScanner.java:147)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.visitCtInvocation(CtScanner.java:490)
	at zzz_koloboke_compile.shaded.$spoon$.support.reflect.code.CtInvocationImpl.accept(CtInvocationImpl.java:48)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.scan(CtScanner.java:147)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.visitCtBinaryOperator(CtScanner.java:277)
	at zzz_koloboke_compile.shaded.$spoon$.support.reflect.code.CtBinaryOperatorImpl.accept(CtBinaryOperatorImpl.java:35)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.scan(CtScanner.java:147)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.visitCtIf(CtScanner.java:466)
	at zzz_koloboke_compile.shaded.$spoon$.support.reflect.code.CtIfImpl.accept(CtIfImpl.java:37)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.scan(CtScanner.java:147)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.scan(CtScanner.java:136)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.visitCtBlock(CtScanner.java:286)
	at zzz_koloboke_compile.shaded.$spoon$.support.reflect.code.CtBlockImpl.accept(CtBlockImpl.java:47)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.scan(CtScanner.java:147)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.visitCtIf(CtScanner.java:467)
	at zzz_koloboke_compile.shaded.$spoon$.support.reflect.code.CtIfImpl.accept(CtIfImpl.java:37)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.scan(CtScanner.java:147)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.scan(CtScanner.java:136)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.visitCtBlock(CtScanner.java:286)
	at zzz_koloboke_compile.shaded.$spoon$.support.reflect.code.CtBlockImpl.accept(CtBlockImpl.java:47)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.scan(CtScanner.java:147)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.visitCtMethod(CtScanner.java:545)
	at zzz_koloboke_compile.shaded.$spoon$.support.reflect.declaration.CtMethodImpl.accept(CtMethodImpl.java:60)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.scan(CtScanner.java:147)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.scan(CtScanner.java:136)
	at zzz_koloboke_compile.shaded.$spoon$.reflect.visitor.CtScanner.visitCtClass(CtScanner.java:326)
	at zzz_koloboke_compile.shaded.$spoon$.support.reflect.declaration.CtClassImpl.accept(CtClassImpl.java:57)
	at com.koloboke.compile.processor.ExtensionChains.replaceTypeParam(ExtensionChains.kt:132)
	at com.koloboke.compile.processor.ExtensionChains.replaceInstantiatedTypeParams(ExtensionChains.kt:108)
	at com.koloboke.compile.processor.ExtensionChains.replaceInstantiatedTypeParams(ExtensionChains.kt:100)
	at com.koloboke.compile.processor.ExtensionChains.mergeStagedChainInner(ExtensionChains.kt:64)
	at com.koloboke.compile.processor.ExtensionChains.mergeStagedChain(ExtensionChains.kt:52)
	at com.koloboke.compile.processor.ExtensionChains.mergeSuperClasses(ExtensionChains.kt:35)
	at com.koloboke.compile.processor.KolobokeCollectionProcessor$ProcessingCxt$GenerationCxt.postParallelProcess(KolobokeCollectionProcessor.kt:748)
	at com.koloboke.compile.processor.KolobokeCollectionProcessor$ProcessingCxt.postParallelProcess(KolobokeCollectionProcessor.kt:362)
	at com.koloboke.compile.processor.KolobokeCollectionProcessor$process$3$1.invoke(KolobokeCollectionProcessor.kt:225)
	at com.koloboke.compile.processor.KolobokeCollectionProcessor$process$3$1.invoke(KolobokeCollectionProcessor.kt:79)
	at com.koloboke.compile.processor.KolobokeCollectionProcessor.safeTypeProcess(KolobokeCollectionProcessor.kt:232)
	at com.koloboke.compile.processor.KolobokeCollectionProcessor.process(KolobokeCollectionProcessor.kt:225)
	at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:139)
	at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:121)
	at org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:159)
	at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:135)
	at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:933)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:443)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:419)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:372)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:187)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:305)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:61)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:256)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:175)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:263)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:403)
	at org.eclipse.core.internal.resources.Project$1.run(Project.java:566)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2240)
	at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:544)
	at org.eclipse.core.internal.resources.Project.build(Project.java:112)
	at org.eclipse.jdt.internal.ui.util.CoreUtility$BuildJob.run(CoreUtility.java:159)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)

Do you have any idea what this could be? I did not use maven or gradle to make this example simple and reproduceable. Other annotation processors work (like AutoValue) using the same steps.

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