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

Null pointer when copying aspect #62

Closed
dvojtise opened this issue Sep 29, 2016 · 1 comment
Closed

Null pointer when copying aspect #62

dvojtise opened this issue Sep 29, 2016 · 1 comment
Labels

Comments

@dvojtise
Copy link
Contributor

on my project I regularly have this exception
java.lang.NullPointerException
at fr.inria.diverse.commons.asm.shade.DirectoryShader.shadeFolder(DirectoryShader.java:64)
at fr.inria.diverse.commons.asm.shade.DirectoryShader.shade(DirectoryShader.java:36)
at fr.inria.diverse.melange.utils.AspectCopier.copy(AspectCopier.java:405)
at fr.inria.diverse.melange.ast.LanguageExtensions$25.accept(LanguageExtensions.java:1240)
at fr.inria.diverse.melange.ast.LanguageExtensions$25.accept(LanguageExtensions.java:1)
at java.lang.Iterable.forEach(Unknown Source)
at fr.inria.diverse.melange.ast.LanguageExtensions.copyAspects(LanguageExtensions.java:1244)
at fr.inria.diverse.melange.ast.LanguageExtensions.createExternalAspects(LanguageExtensions.java:945)
at fr.inria.diverse.melange.ui.builder.MelangeBuilder$4.accept(MelangeBuilder.java:236)
at fr.inria.diverse.melange.ui.builder.MelangeBuilder$4.accept(MelangeBuilder.java:1)
at java.lang.Iterable.forEach(Unknown Source)
at fr.inria.diverse.melange.ui.builder.MelangeBuilder.generateLanguages(MelangeBuilder.java:248)
at fr.inria.diverse.melange.ui.menu.GenerateLanguages$1.run(GenerateLanguages.java:58)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:119)

whe crashed like this, the aspect are not copied and some other stuff not generated (if I have used "generate all")

It should at least report a cleaner message indicating which aspect wasn't copied and not crash in order to continue the processing

I'm currently not sure about the exact reason of the crash itself. (maybe dependencies to classes that aren't copied ?)

@dvojtise dvojtise added the bug label Sep 29, 2016
@dvojtise
Copy link
Contributor Author

OK, I found out the cause

I usually import in my worpspace a root project that helps me deal with git (for example renaming folder/projects)
unfortunatly, in this case the

ws.accept(new IResourceVisitor {
                override visit(IResource resource) throws CoreException {
                    if (resource instanceof IFile) {
                        val firstMatch = request.aspectRefs.findFirst

will also find the aspect in this project and add it to the input folders that need to be copied

obviously, the search scheme looking for a src-gen folder at the root of the root project will fail

dvojtise added a commit that referenced this issue Sep 29, 2016
/src-gen at the root of the project

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

No branches or pull requests

1 participant