Community
Participate
Working Groups
Below code uses spring classes to import a resources. I The exception is shown @Conditional. import org.springframework.context.annotation.ConditionContext; import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ConfigurationCondition; import org.springframework.context.annotation.ImportResource; import org.springframework.core.type.AnnotatedTypeMetadata; @Configuration @Conditional(ConditionalConfiguration.Condition) @ImportResource("/com/example/context-fragment.xml") public class ConditionalConfiguration { static class Condition implements ConfigurationCondition { @Override public ConfigurationPhase getConfigurationPhase() { return ConfigurationPhase.PARSE_CONFIGURATION; } @Override public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { // only load context-fragment.xml if the system property is defined return System.getProperty("com.example.context-fragment") != null; } } } The error is shown as: org.aspectj.weaver.BCException at org.aspectj.ajdt.internal.core.builder.AjState.recordClassFile(AjState.java:1519) at org.aspectj.ajdt.internal.core.builder.AjState.noteResult(AjState.java:1325) at org.aspectj.ajdt.internal.core.builder.AjBuildManager$3.acceptResult(AjBuildManager.java:1061) at org.aspectj.ajdt.internal.compiler.AjPipeliningCompilerAdapter.afterProcessing(AjPipeliningCompilerAdapter.java:426) at org.aspectj.ajdt.intern ... .0_21-64\jre\lib\ext\sunmscapi.jar;E:\jdk1.7.0_21-64\jre\lib\ext\zipfs.jar;D:\eclipse\\plugins/org.eclipse.equinox.launcher_1.3.0.v20140415-2008.jar; The Condition anotation is as below: @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE, ElementType.METHOD}) public @interface Conditional { /** * All {@link Condition}s that must {@linkplain Condition#matches match} * in order for the component to be registered. */ Class<? extends Condition>[] value(); }
Actually I think this is the same as bug 455608 (I think you were the person asking about this on SO weren't you?). Both of which are a JDT problem. The JDT bug I've raised is referenced in bug 455608. Once fixed I'll pick up that fix in AJ. *** This bug has been marked as a duplicate of bug 455608 ***
setting resolved version.