Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
430f4d3
Various changes about druid-services module
asdf2014 Jul 9, 2018
6d6ed05
Patch improvements from reviewer
asdf2014 Jul 10, 2018
5688fa2
Add ToArrayCallWithZeroLengthArrayArgument & ArraysAsListWithZeroOrOn…
asdf2014 Jul 11, 2018
54e0295
Fix ArraysAsListWithZeroOrOneArgument
asdf2014 Jul 11, 2018
b3f1c81
Fix conflict
asdf2014 Jul 11, 2018
1b83c32
Fix ToArrayCallWithZeroLengthArrayArgument
asdf2014 Jul 11, 2018
6d0d661
Fix AliEqualsAvoidNull
asdf2014 Jul 11, 2018
0b69188
Remove blank line
asdf2014 Jul 11, 2018
e26fdad
Remove unused import clauses
asdf2014 Jul 11, 2018
9a8de71
Fix code style in TopNQueryRunnerTest
asdf2014 Jul 11, 2018
9df56bd
Fix conflict
asdf2014 Jul 11, 2018
def98c9
Don't use Collections.singletonList when converting the type of array…
asdf2014 Jul 11, 2018
fcaf47d
Add argLine into maven-surefire-plugin in druid-process module & incr…
asdf2014 Jul 11, 2018
07cca25
Roll back the latest commit
asdf2014 Jul 12, 2018
ac85038
Add java.io.File#toURL() into druid-forbidden-apis
asdf2014 Jul 16, 2018
d80623c
Using Boolean.parseBoolean instead of Boolean.valueOf for CliCoordina…
asdf2014 Jul 16, 2018
52d2d5a
Add a new regexp element into stylecode xml file
asdf2014 Jul 16, 2018
e2ce28c
Merge branch 'master' into various_changes
asdf2014 Jul 16, 2018
7ffbe18
Fix style error for new regexp
asdf2014 Jul 16, 2018
736c715
Set the level of ArraysAsListWithZeroOrOneArgument as WARNING
asdf2014 Jul 16, 2018
d3a2d96
Fix style error for new regexp
asdf2014 Jul 16, 2018
47a468d
Add option BY_LEVEL for ToArrayCallWithZeroLengthArrayArgument in ins…
asdf2014 Jul 17, 2018
e479086
Roll back the level as ToArrayCallWithZeroLengthArrayArgument as ERROR
asdf2014 Jul 18, 2018
3af0a82
Add toArray(new Object[0]) regexp into checkstyle config file & fix them
asdf2014 Jul 18, 2018
32c39b8
Set the level of ArraysAsListWithZeroOrOneArgument as ERROR & Roll ba…
asdf2014 Jul 18, 2018
2e55e7a
Add a comment for string equals regexp in checkstyle config
asdf2014 Jul 21, 2018
ff5079c
Fix code format
asdf2014 Jul 21, 2018
4027b9c
Add RedundantTypeArguments as ERROR level inspection
asdf2014 Jul 21, 2018
681ccf5
Merge branch 'master' into various_changes
asdf2014 Jul 25, 2018
baa47dc
Fix cannot resolve symbol datasource
asdf2014 Jul 25, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 6 additions & 1 deletion .idea/inspectionProfiles/Druid.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ public DimensionsSpec(
)
{
this.dimensions = dimensions == null
? Lists.<DimensionSchema>newArrayList()
? Lists.newArrayList()
: Lists.newArrayList(dimensions);

this.dimensionExclusions = (dimensionExclusions == null)
? Sets.<String>newHashSet()
? Sets.newHashSet()
: Sets.newHashSet(dimensionExclusions);

List<SpatialDimensionSchema> spatialDims = (spatialDimensions == null)
? Lists.<SpatialDimensionSchema>newArrayList()
? Lists.newArrayList()
: spatialDimensions;

verify(spatialDims);
Expand Down
8 changes: 4 additions & 4 deletions api/src/main/java/io/druid/guice/ConditionalMultibind.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class ConditionalMultibind<T>
*/
public static <T> ConditionalMultibind<T> create(Properties properties, Binder binder, Class<T> type)
{
return new ConditionalMultibind<T>(properties, Multibinder.<T>newSetBinder(binder, type));
return new ConditionalMultibind<T>(properties, Multibinder.newSetBinder(binder, type));
}

/**
Expand All @@ -81,7 +81,7 @@ public static <T> ConditionalMultibind<T> create(
Class<? extends Annotation> annotationType
)
{
return new ConditionalMultibind<T>(properties, Multibinder.<T>newSetBinder(binder, type, annotationType));
return new ConditionalMultibind<T>(properties, Multibinder.newSetBinder(binder, type, annotationType));
}

/**
Expand All @@ -96,7 +96,7 @@ public static <T> ConditionalMultibind<T> create(
*/
public static <T> ConditionalMultibind<T> create(Properties properties, Binder binder, TypeLiteral<T> type)
{
return new ConditionalMultibind<T>(properties, Multibinder.<T>newSetBinder(binder, type));
return new ConditionalMultibind<T>(properties, Multibinder.newSetBinder(binder, type));
}

/**
Expand All @@ -117,7 +117,7 @@ public static <T> ConditionalMultibind<T> create(
Class<? extends Annotation> annotationType
)
{
return new ConditionalMultibind<T>(properties, Multibinder.<T>newSetBinder(binder, type, annotationType));
return new ConditionalMultibind<T>(properties, Multibinder.newSetBinder(binder, type, annotationType));
}


Expand Down
2 changes: 1 addition & 1 deletion api/src/main/java/io/druid/guice/JsonConfigProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public static <T> void bindInstance(
supplierKey = Key.get(supType);
}

binder.bind(supplierKey).toInstance(Suppliers.<T>ofInstance(instance));
binder.bind(supplierKey).toInstance(Suppliers.ofInstance(instance));
}

public static <T> JsonConfigProvider<T> of(String propertyBase, Class<T> classToProvide)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public void testColumnMissing()
),
new DimensionsSpec(
DimensionsSpec.getDefaultSchemas(Arrays.asList("a", "b")),
Lists.<String>newArrayList(),
Lists.<SpatialDimensionSchema>newArrayList()
Lists.newArrayList(),
Lists.newArrayList()
),
",",
Collections.singletonList("a"),
Expand All @@ -61,8 +61,8 @@ public void testComma()
),
new DimensionsSpec(
DimensionsSpec.getDefaultSchemas(Arrays.asList("a,", "b")),
Lists.<String>newArrayList(),
Lists.<SpatialDimensionSchema>newArrayList()
Lists.newArrayList(),
Lists.newArrayList()
),
",",
Collections.singletonList("a"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ public void testColumnMissing()
),
new DimensionsSpec(
DimensionsSpec.getDefaultSchemas(Arrays.asList("a", "b")),
Lists.<String>newArrayList(),
Lists.<SpatialDimensionSchema>newArrayList()
Lists.newArrayList(),
Lists.newArrayList()
),
",",
" ",
Expand All @@ -93,8 +93,8 @@ public void testComma()
),
new DimensionsSpec(
DimensionsSpec.getDefaultSchemas(Arrays.asList("a,", "b")),
Lists.<String>newArrayList(),
Lists.<SpatialDimensionSchema>newArrayList()
Lists.newArrayList(),
Lists.newArrayList()
),
",",
null,
Expand All @@ -116,8 +116,8 @@ public void testDefaultColumnList()
),
new DimensionsSpec(
DimensionsSpec.getDefaultSchemas(Arrays.asList("a", "b")),
Lists.<String>newArrayList(),
Lists.<SpatialDimensionSchema>newArrayList()
Lists.newArrayList(),
Lists.newArrayList()
),
",",
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public void testMapInputRowParserSerde() throws Exception
InputRowParser.class
);
final InputRow parsed = parser2.parseBatch(
ImmutableMap.<String, Object>of(
ImmutableMap.of(
"foo", "x",
"bar", "y",
"qux", "z",
Expand Down Expand Up @@ -139,7 +139,7 @@ public void testMapInputRowParserNumbersSerde() throws Exception
InputRowParser.class
);
final InputRow parsed = parser2.parseBatch(
ImmutableMap.<String, Object>of(
ImmutableMap.of(
"timemillis", 1412705931123L,
"toobig", 123E64,
"value", 123.456,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public void testLowercasing()
),
new DimensionsSpec(
DimensionsSpec.getDefaultSchemas(Arrays.asList("A", "B")),
Lists.<String>newArrayList(),
Lists.<SpatialDimensionSchema>newArrayList()
Lists.newArrayList(),
Lists.newArrayList()
)
);
Parser parser = spec.makeParser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

Expand Down Expand Up @@ -98,7 +99,7 @@ public void testParseRowWithConditional()

final Map<String, Object> expected = new HashMap<>();
expected.put("foo", new ArrayList());
expected.put("bar", Arrays.asList("test"));
expected.put("bar", Collections.singletonList("test"));

final Parser<String, Object> parser = parseSpec.makeParser();
final Map<String, Object> parsedRow = parser.parseToMap("{\"something_else\": {\"foo\": \"test\"}}");
Expand Down
10 changes: 5 additions & 5 deletions api/src/test/java/io/druid/data/input/impl/ParseSpecTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public void testDuplicateNames()
),
new DimensionsSpec(
DimensionsSpec.getDefaultSchemas(Arrays.asList("a", "b", "a")),
Lists.<String>newArrayList(),
Lists.<SpatialDimensionSchema>newArrayList()
Lists.newArrayList(),
Lists.newArrayList()
),
",",
" ",
Expand All @@ -69,7 +69,7 @@ public void testDimAndDimExcluOverlap()
new DimensionsSpec(
DimensionsSpec.getDefaultSchemas(Arrays.asList("a", "B")),
Lists.newArrayList("B"),
Lists.<SpatialDimensionSchema>newArrayList()
Lists.newArrayList()
),
",",
null,
Expand All @@ -92,7 +92,7 @@ public void testDimExclusionDuplicate()
new DimensionsSpec(
DimensionsSpec.getDefaultSchemas(Collections.singletonList("a")),
Lists.newArrayList("B", "B"),
Lists.<SpatialDimensionSchema>newArrayList()
Lists.newArrayList()
),
",",
null,
Expand All @@ -113,7 +113,7 @@ public void testDefaultTimestampSpec()
new DimensionsSpec(
DimensionsSpec.getDefaultSchemas(Collections.singletonList("a")),
Lists.newArrayList("B", "B"),
Lists.<SpatialDimensionSchema>newArrayList()
Lists.newArrayList()
),
",",
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void testExtractTimestamp()
TimestampSpec spec = new TimestampSpec("TIMEstamp", "yyyy-MM-dd", null);
Assert.assertEquals(
DateTimes.of("2014-03-01"),
spec.extractTimestamp(ImmutableMap.<String, Object>of("TIMEstamp", "2014-03-01"))
spec.extractTimestamp(ImmutableMap.of("TIMEstamp", "2014-03-01"))
);
}

Expand All @@ -44,7 +44,7 @@ public void testExtractTimestampWithMissingTimestampColumn()
TimestampSpec spec = new TimestampSpec(null, null, DateTimes.EPOCH);
Assert.assertEquals(
DateTimes.of("1970-01-01"),
spec.extractTimestamp(ImmutableMap.<String, Object>of("dim", "foo"))
spec.extractTimestamp(ImmutableMap.of("dim", "foo"))
);
}

Expand All @@ -64,7 +64,7 @@ public void testContextualTimestampList()
DateTimes.UtcFormatter formatter = DateTimes.wrapFormatter(ISODateTimeFormat.dateHourMinuteSecond());

for (String date : dates) {
DateTime dateTime = spec.extractTimestamp(ImmutableMap.<String, Object>of("TIMEstamp", date));
DateTime dateTime = spec.extractTimestamp(ImmutableMap.of("TIMEstamp", date));
DateTime expectedDateTime = formatter.parse(date);
Assert.assertEquals(expectedDateTime, dateTime);
}
Expand Down
16 changes: 8 additions & 8 deletions api/src/test/java/io/druid/guice/ConditionalMultibindTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void configure(Binder binder)
}));

Assert.assertEquals(2, animalSet.size());
Assert.assertEquals(animalSet, ImmutableSet.<Animal>of(new Cat(), new Dog()));
Assert.assertEquals(animalSet, ImmutableSet.of(new Cat(), new Dog()));
}

@Test
Expand All @@ -128,7 +128,7 @@ public void configure(Binder binder)
}));

Assert.assertEquals(2, animalSet.size());
Assert.assertEquals(animalSet, ImmutableSet.<Animal>of(new Cat(), new Dog()));
Assert.assertEquals(animalSet, ImmutableSet.of(new Cat(), new Dog()));
}

@Test
Expand Down Expand Up @@ -164,7 +164,7 @@ public void configure(Binder binder)
}));

Assert.assertEquals(3, animalSet.size());
Assert.assertEquals(animalSet, ImmutableSet.<Animal>of(new Cat(), new Dog(), new Fish()));
Assert.assertEquals(animalSet, ImmutableSet.of(new Cat(), new Dog(), new Fish()));
}

@Test
Expand Down Expand Up @@ -202,7 +202,7 @@ public void configure(Binder binder)
{
}, SanDiego.class));
Assert.assertEquals(4, animalSet_1.size());
Assert.assertEquals(animalSet_1, ImmutableSet.<Animal>of(new Bird(), new Cat(), new Dog(), new Tiger()));
Assert.assertEquals(animalSet_1, ImmutableSet.of(new Bird(), new Cat(), new Dog(), new Tiger()));

Set<Animal> animalSet_2 = injector.getInstance(Key.get(new TypeLiteral<Set<Animal>>()
{
Expand Down Expand Up @@ -244,17 +244,17 @@ public void configure(Binder binder)
injector.injectMembers(shop);

Assert.assertEquals(4, shop.animals.size());
Assert.assertEquals(shop.animals, ImmutableSet.<Animal>of(new Bird(), new Cat(), new Dog(), new Fish()));
Assert.assertEquals(shop.animals, ImmutableSet.of(new Bird(), new Cat(), new Dog(), new Fish()));
}

@Test
public void testMultiConditionalBind_typeLiteral()
{
props.setProperty("animal.type", "pets");

final Set<Animal> set1 = ImmutableSet.<Animal>of(new Dog(), new Tiger());
final Set<Animal> set2 = ImmutableSet.<Animal>of(new Cat(), new Fish());
final Set<Animal> set3 = ImmutableSet.<Animal>of(new Cat());
final Set<Animal> set1 = ImmutableSet.of(new Dog(), new Tiger());
final Set<Animal> set2 = ImmutableSet.of(new Cat(), new Fish());
final Set<Animal> set3 = ImmutableSet.of(new Cat());
final Set<Animal> union = new HashSet<>();
union.addAll(set1);
union.addAll(set2);
Expand Down
8 changes: 4 additions & 4 deletions api/src/test/java/io/druid/guice/JsonConfiguratorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ public ExecutableValidator forExecutables()
public void testTest()
{
Assert.assertEquals(
new MappableObject("p1", ImmutableList.<String>of("p2"), "p2"),
new MappableObject("p1", ImmutableList.<String>of("p2"), "p2")
new MappableObject("p1", ImmutableList.of("p2"), "p2"),
new MappableObject("p1", ImmutableList.of("p2"), "p2")
);
Assert.assertEquals(
new MappableObject("p1", null, null),
new MappableObject("p1", ImmutableList.<String>of(), null)
new MappableObject("p1", ImmutableList.of(), null)
);
}

Expand Down Expand Up @@ -175,7 +175,7 @@ protected MappableObject(
)
{
this.prop1 = prop1;
this.prop1List = prop1List == null ? ImmutableList.<String>of() : prop1List;
this.prop1List = prop1List == null ? ImmutableList.of() : prop1List;
this.prop2 = prop2;
}

Expand Down
2 changes: 1 addition & 1 deletion api/src/test/java/io/druid/timeline/DataSegmentTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void testV1Serialization() throws Exception
{

final Interval interval = Intervals.of("2011-10-01/2011-10-02");
final ImmutableMap<String, Object> loadSpec = ImmutableMap.<String, Object>of("something", "or_other");
final ImmutableMap<String, Object> loadSpec = ImmutableMap.of("something", "or_other");

DataSegment segment = new DataSegment(
"something",
Expand Down
Loading