-
Bug
-
Resolution: Done
-
Blocker
-
2.0.0.Beta1
-
None
When running Windup against application source, got this exception, which halts the execution.
UI output:
***INFO*** Executing Rules: :POST_DISCOVERY - org.jboss.windup.rules.apps:rules-java.DiscoverJavaFilesRuleProvider [Uncategorized] [15/1084] ... ***ERROR*** Error while executing 'Windup Migrate App' ***ERROR*** Error encountered while evaluating rule: .addRule().when(org.jboss.windup.config.query.Query@5a82f01c).perform(org.jboss.windup.config.operation.Iteration@4a61ecb0) From: org.jboss.windup.rules.apps.java.scan.provider.DiscoverJavaFilesRuleProvider Defined in: org.jboss.windup.rules.apps.java.scan.provider.DiscoverJavaFilesRuleProvider.getConfiguration(DiscoverJavaFilesRuleProvider.java:59) ***INFO*** (type "export VERBOSE=true" to enable stack traces) ***ERROR*** Error encountered while evaluating rule: .addRule().when(org.jboss.windup.config.query.Query@5a82f01c).perform(org.jboss.windup.config.operation.Iteration@4a61ecb0) From: org.jboss.windup.rules.apps.java.scan.provider.DiscoverJavaFilesRuleProvider Defined in: org.jboss.windup.rules.apps.java.scan.provider.DiscoverJavaFilesRuleProvider.getConfiguration(DiscoverJavaFilesRuleProvider.java:59)
Forge log:
Caused by: org.jboss.forge.roaster.ParserException: Source does not represent a [JavaClassSource], instead was [JavaInterfaceImpl] - Cannot convert. at org.jboss.forge.roaster.Roaster.parse(Roaster.java:166) [roaster-api-2.8.0.Final.jar:2.8.0.Final] at org.jboss.windup.rules.apps.java.scan.provider.DiscoverJavaFilesRuleProvider$IndexJavaFileIterationOperator.addParsedClassToFile(DiscoverJavaFilesRuleProvider.java:129) at org.jboss.windup.rules.apps.java.scan.provider.DiscoverJavaFilesRuleProvider$IndexJavaFileIterationOperator.perform(DiscoverJavaFilesRuleProvider.java:115) at org.jboss.windup.rules.apps.java.scan.provider.DiscoverJavaFilesRuleProvider$IndexJavaFileIterationOperator.perform(DiscoverJavaFilesRuleProvider.java:66) at org.jboss.windup.config.operation.ruleelement.AbstractIterationOperation.perform(AbstractIterationOperation.java:66) at org.jboss.windup.config.operation.GraphOperation.perform(GraphOperation.java:24) at org.jboss.windup.config.operation.Iteration.perform(Iteration.java:230) at org.jboss.windup.config.operation.Iteration.perform(Iteration.java:200) at org.ocpsoft.rewrite.config.RuleBuilder.perform(RuleBuilder.java:168) at org.jboss.windup.config.RuleSubset.perform(RuleSubset.java:224) ... 26 more
Two things need to happen here:
1. The code should not assume that all .java files are classes
2. If the file fails to parse for some other reason (eg, invalid code), it should be classified as unparseable and execution should continue otherwise.