Fix java errors that used to be disabled.

This is https://chromium-review.googlesource.com/c/chromium/src/+/5901711 hitting WebRTC.

Change-Id: Ifedd949965a85b29364455a244edab1352f4fcea
Bug: None
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364940
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Jeremy Leconte <jleconte@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#43193}
diff --git a/examples/androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java b/examples/androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java
index e9077d8..1415f47 100644
--- a/examples/androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java
+++ b/examples/androidapp/src/org/appspot/apprtc/AppRTCBluetoothManager.java
@@ -111,7 +111,7 @@
     }
 
     @Override
-    /** Notifies the client when the proxy object has been disconnected from the service. */
+    // Notifies the client when the proxy object has been disconnected from the service.
     public void onServiceDisconnected(int profile) {
       if (profile != BluetoothProfile.HEADSET || bluetoothState == State.UNINITIALIZED) {
         return;
diff --git a/sdk/android/api/org/webrtc/CallSessionFileRotatingLogSink.java b/sdk/android/api/org/webrtc/CallSessionFileRotatingLogSink.java
index f4edb58..6683fc9 100644
--- a/sdk/android/api/org/webrtc/CallSessionFileRotatingLogSink.java
+++ b/sdk/android/api/org/webrtc/CallSessionFileRotatingLogSink.java
@@ -20,6 +20,7 @@
     return nativeGetLogData(dirPath);
   }
 
+  @SuppressWarnings("EnumOrdinal")
   public CallSessionFileRotatingLogSink(
       String dirPath, int maxFileSize, Logging.Severity severity) {
     if (dirPath == null) {
diff --git a/sdk/android/api/org/webrtc/PeerConnectionFactory.java b/sdk/android/api/org/webrtc/PeerConnectionFactory.java
index c46718f..7f360eb 100644
--- a/sdk/android/api/org/webrtc/PeerConnectionFactory.java
+++ b/sdk/android/api/org/webrtc/PeerConnectionFactory.java
@@ -291,6 +291,7 @@
    * PeerConnectionFactory. Replaces all the old initialization methods. Must not be called while
    * a PeerConnectionFactory is alive.
    */
+  @SuppressWarnings("EnumOrdinal")
   public static void initialize(InitializationOptions options) {
     ContextUtils.initialize(options.applicationContext);
     NativeLibrary.initialize(options.nativeLibraryLoader, options.nativeLibraryName);
diff --git a/sdk/android/instrumentationtests/src/org/webrtc/DefaultVideoEncoderFactoryTest.java b/sdk/android/instrumentationtests/src/org/webrtc/DefaultVideoEncoderFactoryTest.java
index fe608c7..86978c9 100644
--- a/sdk/android/instrumentationtests/src/org/webrtc/DefaultVideoEncoderFactoryTest.java
+++ b/sdk/android/instrumentationtests/src/org/webrtc/DefaultVideoEncoderFactoryTest.java
@@ -60,9 +60,9 @@
   @SmallTest
   @Test
   public void getSupportedCodecs_hwVp8WithDifferentParams_twoVp8() {
-    VideoCodecInfo hwVp8Encoder = new VideoCodecInfo("VP8", new HashMap<String, String>() {
-      { put("param", "value"); }
-    });
+    HashMap<String, String> hwVp8EncoderParams = new HashMap<String, String>(1);
+    hwVp8EncoderParams.put("param", "value");
+    VideoCodecInfo hwVp8Encoder = new VideoCodecInfo("VP8", hwVp8EncoderParams);
     VideoEncoderFactory hwFactory = new CustomHardwareVideoEncoderFactory(hwVp8Encoder);
     DefaultVideoEncoderFactory defFactory = new DefaultVideoEncoderFactory(hwFactory);
     VideoCodecInfo[] supportedCodecs = defFactory.getSupportedCodecs();
diff --git a/sdk/android/instrumentationtests/src/org/webrtc/GlRectDrawerTest.java b/sdk/android/instrumentationtests/src/org/webrtc/GlRectDrawerTest.java
index b067909..a9d9d7b 100644
--- a/sdk/android/instrumentationtests/src/org/webrtc/GlRectDrawerTest.java
+++ b/sdk/android/instrumentationtests/src/org/webrtc/GlRectDrawerTest.java
@@ -227,9 +227,7 @@
   @Test
   @MediumTest
   public void testOesRendering() throws InterruptedException {
-    /**
-     * Stub class to convert RGB ByteBuffers to OES textures by drawing onto a SurfaceTexture.
-     */
+    // Stub class to convert RGB ByteBuffers to OES textures by drawing onto a SurfaceTexture.
     class StubOesTextureProducer {
       private final EglBase eglBase;
       private final GlRectDrawer drawer;
diff --git a/sdk/android/instrumentationtests/src/org/webrtc/SurfaceViewRendererOnMeasureTest.java b/sdk/android/instrumentationtests/src/org/webrtc/SurfaceViewRendererOnMeasureTest.java
index 2e3ab40..b4a645e 100644
--- a/sdk/android/instrumentationtests/src/org/webrtc/SurfaceViewRendererOnMeasureTest.java
+++ b/sdk/android/instrumentationtests/src/org/webrtc/SurfaceViewRendererOnMeasureTest.java
@@ -126,9 +126,8 @@
   public void testFrame1280x720() throws InterruptedException {
     final SurfaceViewRenderer surfaceViewRenderer =
         new SurfaceViewRenderer(InstrumentationRegistry.getContext());
-    /**
-     * Mock renderer events with blocking wait functionality for frame size changes.
-     */
+
+     // Mock renderer events with blocking wait functionality for frame size changes.
     class MockRendererEvents implements RendererCommon.RendererEvents {
       private int frameWidth;
       private int frameHeight;
diff --git a/sdk/android/instrumentationtests/src/org/webrtc/VideoFrameBufferTest.java b/sdk/android/instrumentationtests/src/org/webrtc/VideoFrameBufferTest.java
index 43f5ace..a29e358 100644
--- a/sdk/android/instrumentationtests/src/org/webrtc/VideoFrameBufferTest.java
+++ b/sdk/android/instrumentationtests/src/org/webrtc/VideoFrameBufferTest.java
@@ -460,7 +460,7 @@
 
   @Test
   @SmallTest
-  /** Test calling toI420() and comparing pixel content against I420 reference. */
+  // Test calling toI420() and comparing pixel content against I420 reference.
   public void testToI420() {
     final VideoFrame.I420Buffer referenceI420Buffer = createTestI420Buffer();
     final VideoFrame.Buffer bufferToTest = createBufferToTest(referenceI420Buffer);
@@ -476,7 +476,7 @@
 
   @Test
   @SmallTest
-  /** Pure 2x scaling with no cropping. */
+  // Pure 2x scaling with no cropping.
   public void testScale2x() {
     testCropAndScale(0 /* cropX= */, 0 /* cropY= */, /* cropWidth= */ 16, /* cropHeight= */ 16,
         /* scaleWidth= */ 8, /* scaleHeight= */ 8);
@@ -484,7 +484,7 @@
 
   @Test
   @SmallTest
-  /** Test cropping only X direction, with no scaling. */
+  // Test cropping only X direction, with no scaling.
   public void testCropX() {
     testCropAndScale(8 /* cropX= */, 0 /* cropY= */, /* cropWidth= */ 8, /* cropHeight= */ 16,
         /* scaleWidth= */ 8, /* scaleHeight= */ 16);
@@ -492,7 +492,7 @@
 
   @Test
   @SmallTest
-  /** Test cropping only Y direction, with no scaling. */
+  // Test cropping only Y direction, with no scaling.
   public void testCropY() {
     testCropAndScale(0 /* cropX= */, 8 /* cropY= */, /* cropWidth= */ 16, /* cropHeight= */ 8,
         /* scaleWidth= */ 16, /* scaleHeight= */ 8);
@@ -500,7 +500,7 @@
 
   @Test
   @SmallTest
-  /** Test center crop, with no scaling. */
+  // Test center crop, with no scaling.
   public void testCenterCrop() {
     testCropAndScale(4 /* cropX= */, 4 /* cropY= */, /* cropWidth= */ 8, /* cropHeight= */ 8,
         /* scaleWidth= */ 8, /* scaleHeight= */ 8);
@@ -508,7 +508,7 @@
 
   @Test
   @SmallTest
-  /** Test non-center crop for right bottom corner, with no scaling. */
+  // Test non-center crop for right bottom corner, with no scaling.
   public void testRightBottomCornerCrop() {
     testCropAndScale(8 /* cropX= */, 8 /* cropY= */, /* cropWidth= */ 8, /* cropHeight= */ 8,
         /* scaleWidth= */ 8, /* scaleHeight= */ 8);
@@ -516,7 +516,7 @@
 
   @Test
   @SmallTest
-  /** Test combined cropping and scaling. */
+  // Test combined cropping and scaling.
   public void testCropAndScale() {
     testCropAndScale(4 /* cropX= */, 4 /* cropY= */, /* cropWidth= */ 12, /* cropHeight= */ 12,
         /* scaleWidth= */ 8, /* scaleHeight= */ 8);