Skip to content

Commit

Permalink
Remove sun.misc Base64 references
Browse files Browse the repository at this point in the history
Modern JDKs have removed these which makes testing difficult.
  • Loading branch information
gaul committed Mar 17, 2021
1 parent f53bb4e commit 0dd1c5a
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@
import org.objectweb.asm.ClassReader;
import org.springframework.beans.factory.annotation.Autowired;

import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

public final class ModernizerTest {
private Map<String, Violation> violations;
private static final Collection<String> NO_EXCLUSIONS =
Expand Down Expand Up @@ -417,6 +414,13 @@ public void testAllViolations() throws Exception {
for (ViolationOccurrence occurrence : occurrences) {
actualViolations.add(occurrence.getViolation());
}

// Not testing these since modern JDK have removed them.
violations.remove(
"sun/misc/BASE64Decoder.decodeBuffer:(Ljava/lang/String;)[B");
violations.remove(
"sun/misc/BASE64Encoder.encode:([B)Ljava/lang/String;");

assertThat(actualViolations).containsAll(violations.values());
}

Expand Down Expand Up @@ -695,8 +699,6 @@ private static void method() throws Exception {
FileUtils.readLines((File) null);
FileUtils.readLines((File) null, (Charset) null);
FileUtils.readLines((File) null, "");
new BASE64Decoder().decodeBuffer("");
new BASE64Encoder().encode((byte[]) null);
Preconditions.checkNotNull(new Object());
Preconditions.checkNotNull(new Object(), new Object());
Preconditions.checkElementIndex(0, 0);
Expand Down

0 comments on commit 0dd1c5a

Please sign in to comment.