Browse Source

JavaNativeModule: Added some suppress statements for raw use of types

It's unavoidable at times
kindlich 4 years ago
parent
commit
0880bc8dc2
No known key found for this signature in database

+ 15
- 8
JavaIntegration/src/main/java/org/openzen/zencode/java/JavaNativeModule.java View File

384
 
384
 
385
 		boolean hasConstructor = false;
385
 		boolean hasConstructor = false;
386
 		for (java.lang.reflect.Constructor<?> constructor : cls.getConstructors()) {
386
 		for (java.lang.reflect.Constructor<?> constructor : cls.getConstructors()) {
387
-			ZenCodeType.Constructor constructorAnnotation = (ZenCodeType.Constructor) constructor.getAnnotation(ZenCodeType.Constructor.class);
387
+			ZenCodeType.Constructor constructorAnnotation = constructor.getAnnotation(ZenCodeType.Constructor.class);
388
 			if (constructorAnnotation != null) {
388
 			if (constructorAnnotation != null) {
389
 				ConstructorMember member = asConstructor(context, definition, constructor);
389
 				ConstructorMember member = asConstructor(context, definition, constructor);
390
 				definition.addMember(member);
390
 				definition.addMember(member);
663
 		return name;
663
 		return name;
664
 	}
664
 	}
665
 
665
 
666
-	private ConstructorMember asConstructor(TypeVariableContext context, HighLevelDefinition definition, java.lang.reflect.Constructor method) {
666
+	@SuppressWarnings("rawtypes")
667
+    private ConstructorMember asConstructor(TypeVariableContext context, HighLevelDefinition definition, java.lang.reflect.Constructor method) {
667
 		FunctionHeader header = getHeader(context, method);
668
 		FunctionHeader header = getHeader(context, method);
668
 		return new ConstructorMember(
669
 		return new ConstructorMember(
669
 				CodePosition.NATIVE,
670
 				CodePosition.NATIVE,
737
 		return new CasterMember(CodePosition.NATIVE, definition, modifiers, toType, null);
738
 		return new CasterMember(CodePosition.NATIVE, definition, modifiers, toType, null);
738
 	}
739
 	}
739
 
740
 
740
-	private FunctionHeader getHeader(TypeVariableContext context, java.lang.reflect.Constructor constructor) {
741
+	@SuppressWarnings({"rawtypes", "unchecked"})
742
+    private FunctionHeader getHeader(TypeVariableContext context, java.lang.reflect.Constructor constructor) {
741
 		return getHeader(
743
 		return getHeader(
742
 				context,
744
 				context,
743
 				null,
745
 				null,
1077
 		return org.objectweb.asm.Type.getDescriptor(cls);
1079
 		return org.objectweb.asm.Type.getDescriptor(cls);
1078
 	}
1080
 	}
1079
 
1081
 
1080
-	private static String getMethodDescriptor(java.lang.reflect.Constructor constructor) {
1082
+	@SuppressWarnings("rawtypes")
1083
+    private static String getMethodDescriptor(java.lang.reflect.Constructor constructor) {
1081
 		return org.objectweb.asm.Type.getConstructorDescriptor(constructor);
1084
 		return org.objectweb.asm.Type.getConstructorDescriptor(constructor);
1082
 	}
1085
 	}
1083
 
1086
 
1085
 		return org.objectweb.asm.Type.getMethodDescriptor(method);
1088
 		return org.objectweb.asm.Type.getMethodDescriptor(method);
1086
 	}
1089
 	}
1087
 
1090
 
1088
-	private static JavaMethod getMethod(JavaClass cls, java.lang.reflect.Constructor constructor) {
1091
+	@SuppressWarnings("rawtypes")
1092
+    private static JavaMethod getMethod(JavaClass cls, java.lang.reflect.Constructor constructor) {
1089
 		return new JavaMethod(
1093
 		return new JavaMethod(
1090
 				cls,
1094
 				cls,
1091
 				JavaMethod.Kind.CONSTRUCTOR,
1095
 				JavaMethod.Kind.CONSTRUCTOR,
1115
 	}
1119
 	}
1116
 
1120
 
1117
 	private static class TypeVariableContext {
1121
 	private static class TypeVariableContext {
1118
-		private final Map<TypeVariable, TypeParameter> typeVariables = new HashMap<>();
1122
+		@SuppressWarnings("rawtypes")
1123
+        private final Map<TypeVariable, TypeParameter> typeVariables = new HashMap<>();
1119
 
1124
 
1120
-		public void put(TypeVariable variable, TypeParameter parameter) {
1125
+		@SuppressWarnings("rawtypes")
1126
+        public void put(TypeVariable variable, TypeParameter parameter) {
1121
 			typeVariables.put(variable, parameter);
1127
 			typeVariables.put(variable, parameter);
1122
 		}
1128
 		}
1123
 
1129
 
1124
-		public TypeParameter get(TypeVariable variable) {
1130
+		@SuppressWarnings("rawtypes")
1131
+        public TypeParameter get(TypeVariable variable) {
1125
 			if (!typeVariables.containsKey(variable))
1132
 			if (!typeVariables.containsKey(variable))
1126
 				throw new IllegalStateException("Could not find type variable " + variable.getName());
1133
 				throw new IllegalStateException("Could not find type variable " + variable.getName());
1127
 
1134
 

Loading…
Cancel
Save