Skip to content

Commit

Permalink
do nothing instead of throwing an error when trying to add an import …
Browse files Browse the repository at this point in the history
…to a class without a compilation unit
  • Loading branch information
Jan Wittler authored and tsaglam committed Feb 25, 2021
1 parent bff5bd0 commit 4ebb8d0
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class JavaTypeUtil {

def static ClassifierImport addJavaImport(CompilationUnit compUnit, ConcreteClassifier jType) {
if (compUnit === null) {
throw new IllegalStateException("Tried to add a java import without passing a CompilationUnit.")
return null
}
if (jType === null || jType instanceof PrimitiveType) {
return null // nothing to do
Expand Down

0 comments on commit 4ebb8d0

Please sign in to comment.