style: do not suppress this-escape (#5166)

This commit is contained in:
Piotr Idzik
2024-05-20 18:09:23 +02:00
committed by GitHub
parent 324969fc4e
commit 8be8b953ab
6 changed files with 5 additions and 6 deletions

View File

@ -82,7 +82,6 @@
<arg>-Xlint:-try</arg> <arg>-Xlint:-try</arg>
<arg>-Xlint:-unchecked</arg> <arg>-Xlint:-unchecked</arg>
<arg>-Xlint:-lossy-conversions</arg> <arg>-Xlint:-lossy-conversions</arg>
<arg>-Xlint:-this-escape</arg>
<arg>-Werror</arg> <arg>-Werror</arg>
</compilerArgs> </compilerArgs>
</configuration> </configuration>

View File

@ -47,7 +47,7 @@ public class RSA {
/** /**
* Generate a new public and private key set. * Generate a new public and private key set.
*/ */
public synchronized void generateKeys(int bits) { public final synchronized void generateKeys(int bits) {
SecureRandom r = new SecureRandom(); SecureRandom r = new SecureRandom();
BigInteger p = new BigInteger(bits / 2, 100, r); BigInteger p = new BigInteger(bits / 2, 100, r);
BigInteger q = new BigInteger(bits / 2, 100, r); BigInteger q = new BigInteger(bits / 2, 100, r);

View File

@ -91,7 +91,7 @@ public class MaxHeap implements Heap {
} }
@Override @Override
public void insertElement(HeapElement element) { public final void insertElement(HeapElement element) {
maxHeap.add(element); maxHeap.add(element);
toggleUp(maxHeap.size()); toggleUp(maxHeap.size());
} }

View File

@ -85,7 +85,7 @@ public class MinHeap implements Heap {
} }
@Override @Override
public void insertElement(HeapElement element) { public final void insertElement(HeapElement element) {
minHeap.add(element); minHeap.add(element);
toggleUp(minHeap.size()); toggleUp(minHeap.size());
} }

View File

@ -13,7 +13,7 @@ package com.thealgorithms.datastructures.lists;
* *
* @author Unknown * @author Unknown
*/ */
public class DoublyLinkedList { public final class DoublyLinkedList {
/** /**
* Head refers to the front of the list * Head refers to the front of the list

View File

@ -19,7 +19,7 @@ public class SegmentTree {
} }
/* A function which will create the segment tree*/ /* A function which will create the segment tree*/
public int constructTree(int[] arr, int start, int end, int index) { public final int constructTree(int[] arr, int start, int end, int index) {
if (start == end) { if (start == end) {
this.seg_t[index] = arr[start]; this.seg_t[index] = arr[start];
return arr[start]; return arr[start];