Ver código fonte

Remove redundant explicit types in Godot Java code

(cherry picked from commit 3f95bbed736a2d709f63eaac03d40252ba7dbdf4)
Marcel Admiraal 4 anos atrás
pai
commit
ab1162e918

+ 1 - 1
platform/android/java/lib/src/org/godotengine/godot/Godot.java

@@ -636,7 +636,7 @@ public class Godot extends Fragment implements SensorEventListener, IDownloaderC
 		String main_pack_md5 = null;
 		String main_pack_key = null;
 
-		List<String> new_args = new LinkedList<String>();
+		List<String> new_args = new LinkedList<>();
 
 		for (int i = 0; i < command_line.length; i++) {
 			boolean has_extra = i < command_line.length - 1;

+ 2 - 2
platform/android/java/lib/src/org/godotengine/godot/GodotIO.java

@@ -324,8 +324,8 @@ public class GodotIO {
 		am = p_activity.getAssets();
 		activity = p_activity;
 		//streams = new HashMap<Integer, AssetData>();
-		streams = new SparseArray<AssetData>();
-		dirs = new SparseArray<AssetDir>();
+		streams = new SparseArray<>();
+		dirs = new SparseArray<>();
 	}
 
 	/////////////////////////

+ 2 - 2
platform/android/java/lib/src/org/godotengine/godot/input/GodotInputHandler.java

@@ -57,7 +57,7 @@ public class GodotInputHandler implements InputDeviceListener {
 	private final String tag = this.getClass().getSimpleName();
 
 	private final SparseIntArray mJoystickIds = new SparseIntArray(4);
-	private final SparseArray<Joystick> mJoysticksDevices = new SparseArray<Joystick>(4);
+	private final SparseArray<Joystick> mJoysticksDevices = new SparseArray<>(4);
 
 	private final GodotView godotView;
 	private final InputManagerCompat inputManager;
@@ -328,7 +328,7 @@ public class GodotInputHandler implements InputDeviceListener {
 		//Helps with creating new joypad mappings.
 		Log.i(tag, "=== New Input Device: " + joystick.name);
 
-		Set<Integer> already = new HashSet<Integer>();
+		Set<Integer> already = new HashSet<>();
 		for (InputDevice.MotionRange range : device.getMotionRanges()) {
 			boolean isJoystick = range.isFromSource(InputDevice.SOURCE_JOYSTICK);
 			boolean isGamepad = range.isFromSource(InputDevice.SOURCE_GAMEPAD);

+ 1 - 1
platform/android/java/lib/src/org/godotengine/godot/input/InputManagerV16.java

@@ -34,7 +34,7 @@ public class InputManagerV16 implements InputManagerCompat {
 
 	public InputManagerV16(Context context) {
 		mInputManager = (InputManager)context.getSystemService(Context.INPUT_SERVICE);
-		mListeners = new HashMap<InputManagerCompat.InputDeviceListener, V16InputDeviceListener>();
+		mListeners = new HashMap<>();
 	}
 
 	@Override

+ 2 - 2
platform/android/java/lib/src/org/godotengine/godot/input/Joystick.java

@@ -41,12 +41,12 @@ import java.util.List;
 class Joystick {
 	int device_id;
 	String name;
-	List<Integer> axes = new ArrayList<Integer>();
+	List<Integer> axes = new ArrayList<>();
 	protected boolean hasAxisHat = false;
 	/*
 	 * Keep track of values so we can prevent flooding the engine with useless events.
 	 */
-	protected final SparseArray<Float> axesValues = new SparseArray<Float>(4);
+	protected final SparseArray<Float> axesValues = new SparseArray<>(4);
 	protected int hatX;
 	protected int hatY;
 }