Skip to content

fix: Remove lineSeparatorPositions check#2823

Closed
Egor18 wants to merge 2 commits intoINRIA:masterfrom
Egor18:fixUnexpectedLineSeparatorPositions
Closed

fix: Remove lineSeparatorPositions check#2823
Egor18 wants to merge 2 commits intoINRIA:masterfrom
Egor18:fixUnexpectedLineSeparatorPositions

Conversation

@Egor18
Copy link
Copy Markdown
Contributor

@Egor18 Egor18 commented Dec 6, 2018

Hello.
I was trying to migrate from spoon 7.0 to 7.2, and encountered some mode build failures due to the recent changes. (We have a large test base with ~80 open-source projects).

Spoon 7.2. fails to build a model with spoon.SpoonException: Unexpected lineSeparatorPositions for the file with commented out class (the code is from jmonkeyengine project):

package com.jme3.bounding;

//public class OrientedBoundingBox {
// ...
//}

However, that file compiles successfully, and spoon 7.0 was able to handle it.
I think this issue is related to that commit: f68c62c

So I'd like commented out classes not to fail an entire model build.

@Egor18
Copy link
Copy Markdown
Contributor Author

Egor18 commented Dec 6, 2018

It seems like SpoonArchitectureEnforcerTest.testGoodTestClassNames fails to build a model for a commented out class:

java.lang.NullPointerException
	at spoon.support.compiler.jdt.JDTTreeBuilderQuery.searchTypeBinding(JDTTreeBuilderQuery.java:85)
	at spoon.support.compiler.jdt.ReferenceBuilder.getQualifiedTypeReference(ReferenceBuilder.java:283)
	at spoon.support.compiler.jdt.JDTTreeBuilderHelper.createTypeAccess(JDTTreeBuilderHelper.java:438)
	at spoon.support.compiler.jdt.JDTTreeBuilderHelper.createTargetFieldAccess(JDTTreeBuilderHelper.java:538)
	at spoon.support.compiler.jdt.JDTTreeBuilderHelper.createVariableAccess(JDTTreeBuilderHelper.java:271)

Other tests are ok. I can remove the test case, but leave the change. WDYT?

@pvojtechovsky
Copy link
Copy Markdown
Collaborator

I am having a look at this.

@monperrus
Copy link
Copy Markdown
Collaborator

Thanks a lot @Egor18 for the failing test case. Closed by #2824.

@monperrus monperrus closed this Dec 8, 2018
@Egor18 Egor18 deleted the fixUnexpectedLineSeparatorPositions branch June 15, 2019 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants