Skip to content

Commit 28e7351

Browse files
committed
r optimize imports
1 parent 76f942b commit 28e7351

File tree

279 files changed

+842
-999
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

279 files changed

+842
-999
lines changed

approvaltests-hadoop/src/main/java/org/approvaltests/hadoop/WritableUtils.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55

66
public class WritableUtils
77
{
8-
9-
public static <T> T createWritable(Object value, Class<T> writableType) throws InstantiationException,
10-
IllegalAccessException, InvocationTargetException, NoSuchMethodException
8+
public static <T> T createWritable(Object value, Class<T> writableType)
9+
throws InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException
1110
{
12-
if (writableType.isInstance(value)) { return (T) value; }
11+
if (writableType.isInstance(value))
12+
{ return (T) value; }
1313
Object writable = writableType.newInstance();
1414
try
1515
{
@@ -31,8 +31,8 @@ public static <T> T createWritable(Object value, Class<T> writableType) throws I
3131
}
3232
catch (Exception e)
3333
{
34-
throw new RuntimeException(String.format("Could not convert %s => %s", value.getClass().getName(),
35-
writableType.getName()), e);
34+
throw new RuntimeException(
35+
String.format("Could not convert %s => %s", value.getClass().getName(), writableType.getName()), e);
3636
}
3737
}
3838
}

approvaltests-hadoop/src/main/java/org/approvaltests/hadoop/version1/SmartMapper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
public abstract class SmartMapper<KeyIn, ValueIn, KeyOut, ValueOut>
77
extends
8-
Mapper<KeyIn, ValueIn, KeyOut, ValueOut> implements Transform<KeyIn, ValueIn, KeyOut, ValueOut>
8+
Mapper<KeyIn, ValueIn, KeyOut, ValueOut>
9+
implements
10+
Transform<KeyIn, ValueIn, KeyOut, ValueOut>
911
{
1012
}

approvaltests-hadoop/src/main/java/org/approvaltests/hadoop/version1/SmartReducer.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
public abstract class SmartReducer<KeyIn, ValueIn, KeyOut, ValueOut>
77
extends
8-
Reducer<KeyIn, ValueIn, KeyOut, ValueOut> implements Transform<KeyIn, ValueIn, KeyOut, ValueOut>
8+
Reducer<KeyIn, ValueIn, KeyOut, ValueOut>
9+
implements
10+
Transform<KeyIn, ValueIn, KeyOut, ValueOut>
911
{
10-
}
12+
}

approvaltests-hadoop/src/main/java/org/approvaltests/hadoop/version2/MapperWrapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public class MapperWrapper<KeyIn, ValueIn, KeyOut, ValueOut>
1616
private final Class<KeyOut> keyOut;
1717
private final Class<ValueOut> valueOut;
1818
private final Mapper<KeyIn, ValueIn, KeyOut, ValueOut> mapper;
19-
public MapperWrapper(Mapper<KeyIn, ValueIn, KeyOut, ValueOut> mapper, Class<KeyIn> keyIn,
20-
Class<ValueIn> valueIn, Class<KeyOut> keyOut, Class<ValueOut> valueOut)
19+
public MapperWrapper(Mapper<KeyIn, ValueIn, KeyOut, ValueOut> mapper, Class<KeyIn> keyIn, Class<ValueIn> valueIn,
20+
Class<KeyOut> keyOut, Class<ValueOut> valueOut)
2121
{
2222
this.mapper = mapper;
2323
this.keyIn = keyIn;

approvaltests-hadoop/src/test/java/org/approvaltests/hadoop/version2/tests/HadoopApprovalsTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@ public class HadoopApprovalsTest extends TestCase
2727
{
2828
public void testMap() throws Exception
2929
{
30-
SmartMapper<LongWritable, Text, Text, LongWritable> mapper = new MapperWrapper<>(new WordCountMap(), LongWritable.class, Text.class, Text.class,
31-
LongWritable.class);
30+
SmartMapper<LongWritable, Text, Text, LongWritable> mapper = new MapperWrapper<>(new WordCountMap(),
31+
LongWritable.class, Text.class, Text.class, LongWritable.class);
3232
HadoopApprovals.verifyMapping(mapper, 0, "llew gen llew");
3333
}
3434
public void testReduce() throws Exception
3535
{
36-
SmartReducer<Text, LongWritable, Text, LongWritable> reducer = new ReducerWrapper<>(new WordCountReduce(), Text.class, LongWritable.class, Text.class,
37-
LongWritable.class);
36+
SmartReducer<Text, LongWritable, Text, LongWritable> reducer = new ReducerWrapper<>(new WordCountReduce(),
37+
Text.class, LongWritable.class, Text.class, LongWritable.class);
3838
HadoopApprovals.verifyReducer(reducer, "life", 7, 35);
3939
}
4040
public void testMapReducer() throws Exception
4141
{
42-
SmartMapper<LongWritable, Text, Text, LongWritable> mapper = new MapperWrapper<>(new WordCountMap(), LongWritable.class, Text.class, Text.class,
43-
LongWritable.class);
44-
SmartReducer<Text, LongWritable, Text, LongWritable> reducer = new ReducerWrapper<>(new WordCountReduce(), Text.class, LongWritable.class, Text.class,
45-
LongWritable.class);
42+
SmartMapper<LongWritable, Text, Text, LongWritable> mapper = new MapperWrapper<>(new WordCountMap(),
43+
LongWritable.class, Text.class, Text.class, LongWritable.class);
44+
SmartReducer<Text, LongWritable, Text, LongWritable> reducer = new ReducerWrapper<>(new WordCountReduce(),
45+
Text.class, LongWritable.class, Text.class, LongWritable.class);
4646
HadoopApprovals.verifyMapReduce(mapper, reducer, 0, "one fish two fish red fish blue fish");
4747
}
4848
public static class WordCountReduce extends MapReduceBase

approvaltests-tests/src/main/java/org/approvaltests/machine_specific_tests/MachineSpecific.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package org.approvaltests.machine_specific_tests;
22

3+
import com.spun.util.SystemUtils;
4+
35
import java.util.Arrays;
46
import java.util.List;
57

6-
import com.spun.util.SystemUtils;
7-
88
public class MachineSpecific
99
{
1010
public static boolean FORCE_RUN = false;

approvaltests-tests/src/main/java/org/approvaltests/machine_specific_tests/MachineSpecificTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
package org.approvaltests.machine_specific_tests;
22

3-
import static org.junit.jupiter.api.Assumptions.assumeTrue;
4-
3+
import com.spun.util.SystemUtils;
54
import org.junit.jupiter.api.BeforeEach;
65

7-
import com.spun.util.SystemUtils;
6+
import static org.junit.jupiter.api.Assumptions.assumeTrue;
87

98
public class MachineSpecificTest
109
{

approvaltests-tests/src/test/java/org/approvaltests/ApprovalsTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package org.approvaltests;
22

3-
import java.awt.Dimension;
4-
import java.awt.Rectangle;
5-
63
import org.approvaltests.core.Options;
74
import org.approvaltests.reporters.ClipboardReporter;
85
import org.approvaltests.reporters.DiffReporter;
@@ -11,6 +8,8 @@
118
import org.junit.jupiter.api.Test;
129

1310
import javax.swing.JButton;
11+
import java.awt.Dimension;
12+
import java.awt.Rectangle;
1413

1514
@UseReporter({DiffReporter.class, ClipboardReporter.class})
1615
public class ApprovalsTest

approvaltests-tests/src/test/java/org/approvaltests/CheckedExceptionsTest.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44
import com.spun.util.io.FileUtils;
55
import com.spun.util.logger.SimpleLogger;
66
import org.approvaltests.core.Options;
7-
import org.approvaltests.reporters.GenericDiffReporter;
8-
import org.approvaltests.reporters.JunitReporter;
9-
import org.approvaltests.reporters.intellij.IntelliJReporter;
107
import org.junit.jupiter.api.Test;
11-
import org.junit.platform.commons.support.ModifierSupport;
128
import org.lambda.functions.Functions;
139
import org.lambda.query.Query;
1410
import org.lambda.query.Queryable;

approvaltests-tests/src/test/java/org/approvaltests/DirectoryOutputTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
package org.approvaltests;
22

3-
import java.io.File;
4-
3+
import com.spun.util.io.FileUtils;
54
import org.approvaltests.reporters.DiffReporter;
65
import org.approvaltests.reporters.UseReporter;
76
import org.junit.jupiter.api.Test;
87

9-
import com.spun.util.io.FileUtils;
8+
import java.io.File;
109

1110
@UseReporter(DiffReporter.class)
1211
public class DirectoryOutputTest

0 commit comments

Comments
 (0)