Skip to content

Commit

Permalink
Fix incorrect indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
gaul committed Sep 14, 2023
1 parent 46c223a commit 80f4a45
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public Collection<ViolationOccurrence> check(ClassReader classReader)
}

public Collection<ViolationOccurrence> check(InputStream is)
throws IOException {
throws IOException {
return check(new ClassReader(is));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import static java.lang.String.format;
import static java.util.Collections.emptyList;

import static org.gaul.modernizer_maven_plugin.Utils.checkArgument;

import java.io.File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,23 +151,23 @@ public void testConstructorCurrentApi() throws Exception {
assertThat(occurrences).hasSize(0);
}

@Test
public void testStackConstructorLegacyApiLegacyJava() throws Exception {
ClassReader cr = new ClassReader(StackTestClass.class.getName());
Collection<ViolationOccurrence> occurrences =
createModernizer("1.0").check(cr);
assertThat(occurrences).hasSize(0);
}

@Test
public void testStackConstructorLegacyApiCurrentJava() throws Exception {
ClassReader cr = new ClassReader(StackTestClass.class.getName());
Collection<ViolationOccurrence> occurrences =
createModernizer("1.6").check(cr);
assertThat(occurrences).hasSize(1);
assertThat(occurrences.iterator().next().getViolation().getName())
.isEqualTo("java/util/Stack.\"<init>\":()V");
}
@Test
public void testStackConstructorLegacyApiLegacyJava() throws Exception {
ClassReader cr = new ClassReader(StackTestClass.class.getName());
Collection<ViolationOccurrence> occurrences =
createModernizer("1.0").check(cr);
assertThat(occurrences).hasSize(0);
}

@Test
public void testStackConstructorLegacyApiCurrentJava() throws Exception {
ClassReader cr = new ClassReader(StackTestClass.class.getName());
Collection<ViolationOccurrence> occurrences =
createModernizer("1.6").check(cr);
assertThat(occurrences).hasSize(1);
assertThat(occurrences.iterator().next().getViolation().getName())
.isEqualTo("java/util/Stack.\"<init>\":()V");
}

@Test
public void testVectorConstructorLegacyApiLegacyJava() throws Exception {
Expand Down Expand Up @@ -358,16 +358,16 @@ public void testHandlingOfDefaultPackageClass() throws Exception {
assertThat(occurrences).hasSize(0);
}

@Test
public void testStackConstructorLegacyApiCurrentJavaWithVersionShorthand()
throws Exception {
ClassReader cr = new ClassReader(StackTestClass.class.getName());
Collection<ViolationOccurrence> occurrences =
createModernizer("6").check(cr);
assertThat(occurrences).hasSize(1);
assertThat(occurrences.iterator().next().getViolation().getName())
.isEqualTo("java/util/Stack.\"<init>\":()V");
}
@Test
public void testStackConstructorLegacyApiCurrentJavaWithVersionShorthand()
throws Exception {
ClassReader cr = new ClassReader(StackTestClass.class.getName());
Collection<ViolationOccurrence> occurrences =
createModernizer("6").check(cr);
assertThat(occurrences).hasSize(1);
assertThat(occurrences.iterator().next().getViolation().getName())
.isEqualTo("java/util/Stack.\"<init>\":()V");
}

@Test
public void testVectorConstructorLegacyApiCurrentJavaWithVersionShorthand()
Expand Down Expand Up @@ -500,8 +500,8 @@ private static class ArrayListTestClass {
}

private static class StackTestClass {
@SuppressWarnings("JdkObsolete")
private final Object object = new Stack<Object>();
@SuppressWarnings("JdkObsolete")
private final Object object = new Stack<Object>();
}

private static class VectorTestClass {
Expand All @@ -521,10 +521,14 @@ private static class StringGetBytesCharset {

private static class EnumerationTestClass implements Enumeration<Object> {
@Override
public boolean hasMoreElements() { return false; }
public boolean hasMoreElements() {
return false;
}

@Override
public Object nextElement() { return null; }
public Object nextElement() {
return null;
}
}

private static class VoidFunction implements Function<Void, Void> {
Expand Down Expand Up @@ -579,8 +583,11 @@ public Object get() {
}

private static class AllViolations {
@SuppressWarnings(value = {"BoxedPrimitiveConstructor",
"CheckReturnValue", "deprecation", "JdkObsolete"})
@SuppressWarnings(value = {
"BoxedPrimitiveConstructor",
"CheckReturnValue",
"deprecation",
"JdkObsolete"})
private static void method() throws Exception {
Object object;
object = Charsets.ISO_8859_1;
Expand Down

0 comments on commit 80f4a45

Please sign in to comment.