Skip to content

Commit de93142

Browse files
committed
Reduce minimal JDK version of ASMX provider to 1.6
1 parent dd719e3 commit de93142

File tree

5 files changed

+14
-18
lines changed

5 files changed

+14
-18
lines changed

net.tascalate.javaflow.providers.asmx/pom.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@
4040
<plugin>
4141
<groupId>org.apache.maven.plugins</groupId>
4242
<artifactId>maven-compiler-plugin</artifactId>
43-
<configuration>
44-
<source>1.8</source>
45-
<target>1.8</target>
46-
</configuration>
4743
</plugin>
4844
<plugin>
4945
<groupId>org.moditect</groupId>

net.tascalate.javaflow.providers.asmx/src/main/java/org/apache/commons/javaflow/providers/asmx/CallSiteFinder.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public String toString() {
6565
}
6666

6767
List<Result> findMatchingCallSites(InsnList instructions, List<LocalVariableAnnotationNode> varAnnotations, Map<Integer, List<AnnotationNode>> paramAnnotations) {
68-
List<Result> result = new ArrayList<>();
68+
List<Result> result = new ArrayList<Result>();
6969
for (Iterator<AbstractInsnNode> i = instructions.iterator(); i.hasNext(); ) {
7070
AbstractInsnNode ins = i.next();
7171
if (ins instanceof MethodInsnNode) {
@@ -82,14 +82,14 @@ List<Result> findMatchingCallSites(InsnList instructions, List<LocalVariableAnno
8282

8383
@SuppressWarnings("unchecked")
8484
static List<LocalVariableAnnotationNode> annotationsList(List<?> v) {
85-
return null == v ? Collections.emptyList() : (List<LocalVariableAnnotationNode>)v;
85+
return null == v ? Collections.<LocalVariableAnnotationNode>emptyList() : (List<LocalVariableAnnotationNode>)v;
8686
}
8787

8888
static Map<Integer, List<AnnotationNode>> annotationsList(List<?>[] v) {
8989
if (v == null) {
9090
return Collections.emptyMap();
9191
}
92-
Map<Integer, List<AnnotationNode>> result = new HashMap<>();
92+
Map<Integer, List<AnnotationNode>> result = new HashMap<Integer, List<AnnotationNode>>();
9393
int i = 0;
9494
for (List<?> list : v) {
9595
@SuppressWarnings("unchecked")
@@ -126,7 +126,7 @@ private Result findMatchingCallSite(MethodInsnNode m, List<LocalVariableAnnotati
126126
return new Result(v, m, annotations);
127127
} else if (n instanceof FieldInsnNode) {
128128
// static/instance field
129-
return new Result(n, m, Collections.emptySet());
129+
return new Result(n, m, Collections.<String>emptySet());
130130
} else {
131131
// Not interested in other types like directly reused return value from chained calls
132132
break;
@@ -139,7 +139,7 @@ private Result findMatchingCallSite(MethodInsnNode m, List<LocalVariableAnnotati
139139
}
140140

141141
private Set<String> getVarAnnotations(List<LocalVariableAnnotationNode> varAnnotations, VarInsnNode v) {
142-
Set<String> result = new TreeSet<>();
142+
Set<String> result = new TreeSet<String>();
143143
for (LocalVariableAnnotationNode n : varAnnotations) {
144144
int idx = n.index.indexOf(v.var);
145145
if (idx < 0) {
@@ -173,7 +173,7 @@ private boolean isVarBetweenBounds(AbstractInsnNode var, LabelNode lo, LabelNode
173173
}
174174

175175
private Set<String> getParamAnnotations(Map<Integer, List<AnnotationNode>> paramAnnotations, int varIdx) {
176-
Set<String> result = new TreeSet<>();
176+
Set<String> result = new TreeSet<String>();
177177
List<AnnotationNode> annos = paramAnnotations.get(varIdx);
178178
if (null != annos) {
179179
for (AnnotationNode n : annos) {

net.tascalate.javaflow.providers.asmx/src/main/java/org/apache/commons/javaflow/providers/asmx/ClassNameResolver.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static Result resolveClassName(String className, Class<?> classBeingRedef
4242
String resolvedClassName = className != null ? className :
4343
classBeingRedefined != null ? classBeingRedefined.getName().replace('.', '/') : null;
4444

45-
String[] classNameFromBytes = {null};
45+
final String[] classNameFromBytes = {null};
4646
if (null == resolvedClassName) {
4747
try {
4848
ClassReader cv = new ClassReader(classfileBuffer);

net.tascalate.javaflow.providers.asmx/src/main/java/org/apache/commons/javaflow/providers/asmx/ContinuableMethodNode.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public void visitEnd() {
149149
analyzer = new Analyzer<BasicValue>(new FastClassVerifier(inheritanceLookup)) {
150150
@Override
151151
protected Frame<BasicValue> newFrame(int nLocals, int nStack) {
152-
return new MonitoringFrame<>(nLocals, nStack);
152+
return new MonitoringFrame<BasicValue>(nLocals, nStack);
153153
}
154154

155155
@Override
@@ -167,8 +167,8 @@ protected Frame<BasicValue> newFrame(Frame<? extends BasicValue> src) {
167167
}
168168

169169
private void checkCallSites() {
170-
List<LocalVariableAnnotationNode> varAnnotations = new ArrayList<>();
171-
Map<Integer, List<AnnotationNode>> paramAnnotations = new HashMap<>();
170+
List<LocalVariableAnnotationNode> varAnnotations = new ArrayList<LocalVariableAnnotationNode>();
171+
Map<Integer, List<AnnotationNode>> paramAnnotations = new HashMap<Integer, List<AnnotationNode>>();
172172

173173
varAnnotations.addAll(CallSiteFinder.annotationsList(visibleLocalVariableAnnotations));
174174
varAnnotations.addAll(CallSiteFinder.annotationsList(invisibleLocalVariableAnnotations));
@@ -215,7 +215,7 @@ private int findCallSiteInvocationInsertionIndex(MethodInsnNode mnode) {
215215

216216
private void moveNew() throws AnalyzerException {
217217
SourceInterpreter i = new SourceInterpreter();
218-
Analyzer<SourceValue> a = new Analyzer<>(i);
218+
Analyzer<SourceValue> a = new Analyzer<SourceValue>(i);
219219
a.analyze(className, this);
220220

221221
HashMap<AbstractInsnNode, MethodInsnNode> movable = new HashMap<AbstractInsnNode, MethodInsnNode>();

net.tascalate.javaflow.providers.asmx/src/main/java/org/apache/commons/javaflow/providers/asmx/MaybeContinuableClassVisitor.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,16 @@ public void visitOuterClass(String owner, String name, String desc) {
7474
}
7575

7676
@Override
77-
public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) {
77+
public MethodVisitor visitMethod(int access, final String name, final String desc, String signature, String[] exceptions) {
7878
if (isAnnotation) {
7979
return null;
8080
}
8181

8282
boolean isSynthetic = (access & Opcodes.ACC_SYNTHETIC) != 0;
8383
boolean isPackagePrivate = (access & (Opcodes.ACC_PRIVATE | Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED)) == 0;
8484
if (isSynthetic) {
85-
boolean isAccessor = isPackagePrivate && name.startsWith("access$") && (access & Opcodes.ACC_STATIC) != 0;
86-
boolean isBridge = (access & Opcodes.ACC_BRIDGE) != 0;
85+
final boolean isAccessor = isPackagePrivate && name.startsWith("access$") && (access & Opcodes.ACC_STATIC) != 0;
86+
final boolean isBridge = (access & Opcodes.ACC_BRIDGE) != 0;
8787
if (isAccessor || isBridge) {
8888
return new MethodVisitor(this.api) {
8989
@Override

0 commit comments

Comments
 (0)