Hey list,
I updated my project to include the long anticipated SPIN 1.3.0 API as a Maven dependency. It compiles fine, but when I try to run it, I get:
java.lang.Error: Unresolved compilation problem:
The method create(Function) of type SPINFunctionDrivers must override a superclass method
at org.topbraid.spin.arq.SPINFunctionDrivers.create(SPINFunctionDrivers.java:47)
at org.topbraid.spin.system.SPINModuleRegistry.registerARQFunction(SPINModuleRegistry.java:250)
at org.topbraid.spin.system.SPINModuleRegistry.register(SPINModuleRegistry.java:204)
....
Never seen this before, but from StackOverflow I get the impression that this is related to Java versions:
http://stackoverflow.com/questions/1678122/must-override-a-superclass-method-errors-after-importing-a-project-into-eclipsSeems that in Java 1.6 @Override is allowed on both interfaces and superclasses, while 1.5 only allows it on superclasses. SPINFunctionDrivers seems to override interface method:
public interface SPINFunctionDriver {
SPINFunctionFactory create(Function function);
}
public class SPINFunctionDrivers implements SPINFunctionDriver {
...
@Override
public SPINFunctionFactory create(Function function) {
...
However spin-1.3.0.pom seems to specify Java version as 1.5:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<debug>true</debug>
<debuglevel>source,lines,vars</debuglevel>
<optimize>true</optimize>
<source>1.5</source>
<target>1.5</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
Could that be the source of the problem? My own project uses <source>1.7</source><target>1.7</target> to take advantage of the improvements in Locale.
Does anyone know a solution to this problem? Hopefully it takes no more than a change in POM...
Martynas
graphity.org