mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-10 21:43:15 +08:00
style: do not suppress this-escape
(#5166)
This commit is contained in:
1
pom.xml
1
pom.xml
@ -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>
|
||||||
|
@ -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);
|
||||||
|
@ -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());
|
||||||
}
|
}
|
||||||
|
@ -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());
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
|
@ -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];
|
||||||
|
Reference in New Issue
Block a user