Remove redundant explicit types in Godot Java code

This commit is contained in:
Marcel Admiraal 2021-07-02 17:45:30 +01:00
parent 710effdaad
commit 3f95bbed73
5 changed files with 8 additions and 8 deletions

View file

@ -532,7 +532,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;

View file

@ -321,8 +321,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<>();
}
/////////////////////////

View file

@ -60,7 +60,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);
public GodotInputHandler(GodotRenderView godotView) {
mRenderView = godotView;
@ -329,7 +329,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);

View file

@ -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

View file

@ -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;
}