Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/main/java/org/codehaus/plexus/util/Base64.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* @since 1.0-dev
*
*/
@Deprecated
public class Base64 {

//
Expand Down Expand Up @@ -283,9 +284,6 @@ public static byte[] encodeBase64(byte[] binaryData, boolean isChunked) {
byte val3 = ((b3 & SIGN) == 0) ? (byte) (b3 >> 6) : (byte) ((b3) >> 6 ^ 0xfc);

encodedData[encodedIndex] = lookUpBase64Alphabet[val1];
// log.debug( "val2 = " + val2 );
// log.debug( "k4 = " + (k<<4) );
// log.debug( "vak = " + (val2 | (k<<4)) );
encodedData[encodedIndex + 1] = lookUpBase64Alphabet[val2 | (k << 4)];
encodedData[encodedIndex + 2] = lookUpBase64Alphabet[(l << 2) | val3];
encodedData[encodedIndex + 3] = lookUpBase64Alphabet[b3 & 0x3f];
Expand All @@ -310,8 +308,6 @@ public static byte[] encodeBase64(byte[] binaryData, boolean isChunked) {
if (fewerThan24bits == EIGHTBIT) {
b1 = binaryData[dataIndex];
k = (byte) (b1 & 0x03);
// log.debug("b1=" + b1);
// log.debug("b1<<2 = " + (b1>>2) );
byte val1 = ((b1 & SIGN) == 0) ? (byte) (b1 >> 2) : (byte) ((b1) >> 2 ^ 0xc0);
encodedData[encodedIndex] = lookUpBase64Alphabet[val1];
encodedData[encodedIndex + 1] = lookUpBase64Alphabet[k << 4];
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/org/codehaus/plexus/util/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -1921,7 +1921,9 @@ public static void copyFile(File from, File to, String encoding, FilterWrapper[]
fileReader.close();
fileReader = null;
} finally {
//noinspection deprecation
IOUtil.close(fileReader);
//noinspection deprecation
IOUtil.close(fileWriter);
}
} else {
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/codehaus/plexus/util/NioFiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
/**
* Encapsulates use of java7 features, exposing mostly backward compatible types
*/
@SuppressWarnings("Since15")
public class NioFiles {
public static boolean isSymbolicLink(File file) {
return Files.isSymbolicLink(file.toPath());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ public static String[] translateCommandline(String toProcess) throws Exception {
* {@link StringUtils#quoteAndEscape(String, char)} instead.
*/
@Deprecated
@SuppressWarnings({"JavaDoc", "deprecation"})
@SuppressWarnings({"JavaDoc"})
public static String quote(String argument) throws CommandLineException {
return quote(argument, false, false, true);
}
Expand All @@ -445,7 +445,7 @@ public static String quote(String argument) throws CommandLineException {
* {@link StringUtils#quoteAndEscape(String, char)} instead.
*/
@Deprecated
@SuppressWarnings({"JavaDoc", "UnusedDeclaration", "deprecation"})
@SuppressWarnings({"JavaDoc", "UnusedDeclaration"})
public static String quote(String argument, boolean wrapExistingQuotes) throws CommandLineException {
return quote(argument, false, false, wrapExistingQuotes);
}
Expand Down
66 changes: 4 additions & 62 deletions src/test/java/org/codehaus/plexus/util/AbstractTestThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@
* </p>
*
* @author <a href="mailto:[email protected]">Bert van Brakel</a>
* @version $Id: $Id
* @since 3.4.0
*/
public abstract class AbstractTestThread implements Runnable {
// ~ Instance fields ----------------------------------------------------------------------------

private String name;

/** Constant <code>DEBUG=true</code> */
public static final boolean DEBUG = true;

private boolean isRunning = false;
Expand All @@ -56,8 +54,6 @@ public abstract class AbstractTestThread implements Runnable {
*/
private boolean passed = false;

// ~ Constructors -------------------------------------------------------------------------------

/**
* Constructor
* <p>
Expand All @@ -77,13 +73,6 @@ public AbstractTestThread(TestThreadManager registry) {
setThreadRegistry(registry);
}

// ~ Methods ------------------------------------------------------------------------------------

/**
* <p>Getter for the field <code>error</code>.</p>
*
* @return a {@link java.lang.Throwable} object.
*/
public Throwable getError() {
return error;
}
Expand All @@ -98,8 +87,7 @@ public void reset() {
while (isRunning) {
try {
wait();
} catch (InterruptedException e) {

} catch (InterruptedException ignored) {
}
}
errorMsg = null;
Expand All @@ -115,37 +103,22 @@ public void reset() {
public final void start() {
// shouldn't have multiple threads running this test at the same time
synchronized (this) {
if (isRunning == false) {
if (!isRunning) {
isRunning = true;
Thread t = new Thread(this);
t.start();
}
}
}

/**
* <p>Getter for the field <code>errorMsg</code>.</p>
*
* @return a {@link java.lang.String} object.
*/
public String getErrorMsg() {
return errorMsg;
}

/**
* <p>hasFailed.</p>
*
* @return a boolean.
*/
public boolean hasFailed() {
return !passed;
}

/**
* DOCUMENT ME!
*
* @return DOCUMENT ME!
*/
public boolean hasPassed() {
return passed;
}
Expand Down Expand Up @@ -177,11 +150,6 @@ public final void run() {
}
}

/**
* Override this to run your custom test
*
* @throws java.lang.Throwable
*/
public abstract void doRun() throws Throwable;

/**
Expand All @@ -190,7 +158,6 @@ public final void run() {
* @param registry a {@link org.codehaus.plexus.util.TestThreadManager} object.
*/
public void setThreadRegistry(TestThreadManager registry) {

this.registry = registry;
}

Expand All @@ -203,52 +170,27 @@ public boolean hasRun() {
return hasRun;
}

/**
* <p>Setter for the field <code>error</code>.</p>
*
* @param throwable a {@link java.lang.Throwable} object.
*/
public void setError(Throwable throwable) {
error = throwable;
}

/**
* <p>Setter for the field <code>errorMsg</code>.</p>
*
* @param string a {@link java.lang.String} object.
*/
public void setErrorMsg(String string) {
errorMsg = string;
}

/**
* <p>Setter for the field <code>passed</code>.</p>
*
* @param b a boolean.
*/
public void setPassed(boolean b) {
passed = b;
}

/**
* <p>Getter for the field <code>name</code>.</p>
*
* @return a {@link java.lang.String} object.
*/
public String getName() {
return name;
}

/**
* <p>Setter for the field <code>name</code>.</p>
*
* @param string a {@link java.lang.String} object.
*/
public void setName(String string) {
name = string;
}

private final void debug(String msg) {
private void debug(String msg) {
if (DEBUG) {
System.out.println(this + ":" + msg);
}
Expand Down
17 changes: 1 addition & 16 deletions src/test/java/org/codehaus/plexus/util/CollectionUtilsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,10 @@
* <p>CollectionUtilsTest class.</p>
*
* @author herve
* @version $Id: $Id
* @since 3.4.0
*/
class CollectionUtilsTest {
/**
* <p>testMergeMaps.</p>
*/

@Test
void mergeMaps() {
Map<String, String> dominantMap = new HashMap<>();
Expand Down Expand Up @@ -74,9 +71,6 @@ void mergeMaps() {
assertEquals("z", result.get("z"));
}

/**
* <p>testMergeMapArray.</p>
*/
@SuppressWarnings("unchecked")
@Test
void mergeMapArray() {
Expand Down Expand Up @@ -129,9 +123,6 @@ void mergeMapArray() {
assertEquals("ccc", result5.get("c"));
}

/**
* <p>testMavenPropertiesLoading.</p>
*/
@Test
void mavenPropertiesLoading() {
// Mimic MavenSession properties loading. Properties listed
Expand Down Expand Up @@ -189,9 +180,6 @@ void mavenPropertiesLoading() {
assertEquals(mavenRepoRemote, result.get("maven.repo.remote"));
}

/**
* <p>testIteratorToListWithAPopulatedList.</p>
*/
@Test
void iteratorToListWithAPopulatedList() {
List<String> original = new ArrayList<>();
Expand All @@ -211,9 +199,6 @@ void iteratorToListWithAPopulatedList() {
assertEquals("tre", copy.get(2));
}

/**
* <p>testIteratorToListWithAEmptyList.</p>
*/
@Test
void iteratorToListWithAEmptyList() {
List<String> original = new ArrayList<>();
Expand Down
Loading