Skip to content

Commit 7edfbb3

Browse files
authored
Merge pull request #46 from dwalluck/fix-build-on-recent-jdks
Fix build on JDKs greater than 8
2 parents 5cb88bf + 24f282d commit 7edfbb3

File tree

4 files changed

+10
-11
lines changed

4 files changed

+10
-11
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
<dependency>
6565
<groupId>org.codehaus.groovy</groupId>
6666
<artifactId>groovy-templates</artifactId>
67-
<version>2.1.3</version>
67+
<version>2.4.6</version>
6868
</dependency>
6969
<dependency>
7070
<groupId>commons-io</groupId>

rwx-test/pom.xml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,8 @@
3939
<plugin>
4040
<groupId>org.apache.maven.plugins</groupId>
4141
<artifactId>maven-compiler-plugin</artifactId>
42-
<version>3.5.1</version>
4342
<configuration>
44-
<source>1.8</source>
45-
<target>1.8</target>
46-
<encoding>UTF-8</encoding>
47-
<generatedSourcesDirectory>${project.build.directory}/generated-sources/</generatedSourcesDirectory>
43+
<generatedSourcesDirectory>${project.build.directory}/generated-sources</generatedSourcesDirectory>
4844
<annotationProcessors>
4945
<annotationProcessor>
5046
org.commonjava.rwx.core.AnnoProcessor
@@ -55,4 +51,4 @@
5551
</plugins>
5652
</build>
5753

58-
</project>
54+
</project>

rwx/src/main/java/org/commonjava/rwx/core/AnnoProcessor.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,15 @@
2525

2626
import javax.annotation.processing.AbstractProcessor;
2727
import javax.annotation.processing.Filer;
28-
import javax.annotation.processing.ProcessingEnvironment;
2928
import javax.annotation.processing.RoundEnvironment;
3029
import javax.annotation.processing.SupportedAnnotationTypes;
30+
import javax.lang.model.SourceVersion;
3131
import javax.lang.model.element.Element;
32-
import javax.lang.model.element.ElementKind;
3332
import javax.lang.model.element.TypeElement;
3433
import javax.lang.model.type.MirroredTypeException;
3534
import javax.lang.model.type.TypeKind;
3635
import javax.lang.model.type.TypeMirror;
3736
import javax.lang.model.util.Elements;
38-
import javax.lang.model.util.Types;
3937
import javax.tools.Diagnostic;
4038
import javax.tools.FileObject;
4139
import javax.tools.StandardLocation;
@@ -80,6 +78,11 @@ private void debug( String message )
8078

8179
final GStringTemplateEngine engine = new GStringTemplateEngine();
8280

81+
public SourceVersion getSupportedSourceVersion()
82+
{
83+
return SourceVersion.latest();
84+
}
85+
8386
@Override
8487
public boolean process( Set<? extends TypeElement> annotations, RoundEnvironment roundEnv )
8588
{

rwx/src/main/java/org/commonjava/rwx/vocab/ValueType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public Object upgradeCast( Object value )
117117
}
118118
else if ( value instanceof Integer )
119119
{
120-
return new Long( (Integer) value );
120+
return Long.valueOf( (Integer) value );
121121
}
122122
throw new ClassCastException( "Can not cast " + value.getClass() + " to Long" );
123123
}

0 commit comments

Comments
 (0)