Skip to content

Commit

Permalink
Fallback to resolving compilation unit from filename as previously
Browse files Browse the repository at this point in the history
  • Loading branch information
Strum355 committed Aug 27, 2020
1 parent 5ff8503 commit 9567ad5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ maven-eclipse.xml
!.idea/codeStyleSettings.xml
*.iml

# VSCode
.vscode

# Spoon
spooned-classes/
spooned/
Expand All @@ -31,3 +34,6 @@ doc/_jekyll/_site/

# Nodejs
node_modules/

# Gradle
.gradle
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<artifactId>spoon-core</artifactId>
<packaging>jar</packaging>
<version>8.3.0-SNAPSHOT</version>
<version>8.4.0-SNAPSHOT</version>
<name>Spoon Core</name>
<description>Spoon is a tool for meta-programming, analysis and transformation of Java programs.</description>
<url>http://spoon.gforge.inria.fr/</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,14 @@ public CompilationUnit[] getCompilationUnits() {
} else {
lastSlash += 1;
}
compilationUnit.module = this.module.name();

if (this.module == null) {
compilationUnit.module = CharOperation.subarray(modulePath, lastSlash, modulePath.length);
} else {
//TODO the module name parsed by JDK compiler is in `this.modNames`, consider using that instead?
compilationUnit.module = this.module.name();
}

pathToModName.put(String.valueOf(modulePath), compilationUnit.module);
}
} else {
Expand Down

0 comments on commit 9567ad5

Please sign in to comment.