mirror of https://github.com/apache/druid.git
Run IntelliJ inspections on Travis (#9179)
* Run IntelliJ inspections on Travis Running IntelliJ inspections currently takes about 90 minutes, but they can be run in about 30 minutes on Travis. * Restore assert statements
This commit is contained in:
parent
73a0181e34
commit
e7eb45e648
|
@ -0,0 +1,3 @@
|
|||
<component name="DependencyValidationManager">
|
||||
<scope name="JavaInspectionsScope" pattern="file:*.java||file:pom.xml" />
|
||||
</component>
|
11
.travis.yml
11
.travis.yml
|
@ -120,6 +120,17 @@ jobs:
|
|||
|
||||
" && false; }
|
||||
|
||||
- name: "intellij inspections"
|
||||
script: >
|
||||
docker run --rm
|
||||
-v $(pwd):/project
|
||||
-v ~/.m2:/home/inspect/.m2
|
||||
ccaominh/intellij-inspect:1.0.0
|
||||
/project/pom.xml
|
||||
/project/.idea/inspectionProfiles/Druid.xml
|
||||
--levels ERROR
|
||||
--scope JavaInspectionsScope
|
||||
|
||||
- &package
|
||||
name: "(openjdk8) packaging check"
|
||||
install: skip
|
||||
|
|
|
@ -33,7 +33,7 @@ public abstract class ThreadRenamingCallable<T> implements Callable<T>
|
|||
}
|
||||
|
||||
@Override
|
||||
public final T call() throws Exception
|
||||
public final T call()
|
||||
{
|
||||
final Thread currThread = Thread.currentThread();
|
||||
String currName = currThread.getName();
|
||||
|
|
|
@ -164,7 +164,7 @@ public abstract class IntermediateRowParsingReader<T> implements InputEntityRead
|
|||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException
|
||||
public void close()
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
|
|
|
@ -185,7 +185,7 @@ public class InfluxdbEmitter implements Emitter
|
|||
}
|
||||
|
||||
@Override
|
||||
public void flush() throws IOException
|
||||
public void flush()
|
||||
{
|
||||
if (started.get()) {
|
||||
transformAndSendToInfluxdb(eventsQueue);
|
||||
|
@ -193,7 +193,7 @@ public class InfluxdbEmitter implements Emitter
|
|||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException
|
||||
public void close()
|
||||
{
|
||||
flush();
|
||||
log.info("Closing [%s]", this.getClass().getName());
|
||||
|
|
|
@ -27,7 +27,6 @@ import org.junit.Assert;
|
|||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class InfluxdbEmitterConfigTest
|
||||
|
@ -57,7 +56,7 @@ public class InfluxdbEmitterConfigTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testInfluxdbEmitterConfigObjectsAreDifferent() throws IOException
|
||||
public void testInfluxdbEmitterConfigObjectsAreDifferent()
|
||||
{
|
||||
InfluxdbEmitterConfig influxdbEmitterConfigComparison = new InfluxdbEmitterConfig(
|
||||
"localhost",
|
||||
|
@ -74,7 +73,7 @@ public class InfluxdbEmitterConfigTest
|
|||
}
|
||||
|
||||
@Test(expected = NullPointerException.class)
|
||||
public void testConfigWithNullHostname() throws IOException
|
||||
public void testConfigWithNullHostname()
|
||||
{
|
||||
InfluxdbEmitterConfig influxdbEmitterConfigWithNullHostname = new InfluxdbEmitterConfig(
|
||||
null,
|
||||
|
@ -90,7 +89,7 @@ public class InfluxdbEmitterConfigTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testConfigWithNullPort() throws IOException
|
||||
public void testConfigWithNullPort()
|
||||
{
|
||||
InfluxdbEmitterConfig influxdbEmitterConfigWithNullPort = new InfluxdbEmitterConfig(
|
||||
"localhost",
|
||||
|
@ -142,7 +141,7 @@ public class InfluxdbEmitterConfigTest
|
|||
}
|
||||
|
||||
@Test(expected = NullPointerException.class)
|
||||
public void testConfigWithNullInfluxdbUserName() throws IOException
|
||||
public void testConfigWithNullInfluxdbUserName()
|
||||
{
|
||||
InfluxdbEmitterConfig influxdbEmitterConfigWithNullHostname = new InfluxdbEmitterConfig(
|
||||
"localhost",
|
||||
|
@ -158,7 +157,7 @@ public class InfluxdbEmitterConfigTest
|
|||
}
|
||||
|
||||
@Test(expected = NullPointerException.class)
|
||||
public void testConfigWithNullInfluxdbPassword() throws IOException
|
||||
public void testConfigWithNullInfluxdbPassword()
|
||||
{
|
||||
InfluxdbEmitterConfig influxdbEmitterConfigWithNullHostname = new InfluxdbEmitterConfig(
|
||||
"localhost",
|
||||
|
|
|
@ -29,7 +29,7 @@ public class DoubleSumAveragerTest
|
|||
{
|
||||
|
||||
@Test
|
||||
public void testComputeResult() throws Exception
|
||||
public void testComputeResult()
|
||||
{
|
||||
BaseAverager<Number, Double> avg = new DoubleSumAverager(3, "test", "field", 1);
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ public class DecimalParquetInputTest extends BaseParquetInputTest
|
|||
|
||||
private final String parserType;
|
||||
|
||||
public DecimalParquetInputTest(String parserType) throws IOException
|
||||
public DecimalParquetInputTest(String parserType)
|
||||
{
|
||||
this.parserType = parserType;
|
||||
}
|
||||
|
|
|
@ -45,6 +45,8 @@ public interface GroupByVectorColumnSelector
|
|||
* @param startRow starting row (inclusive) within the current vector
|
||||
* @param endRow ending row (exclusive) within the current vector
|
||||
*/
|
||||
// False positive unused inspection warning for "keySize": https://youtrack.jetbrains.com/issue/IDEA-231034
|
||||
@SuppressWarnings("unused")
|
||||
void writeKeys(WritableMemory keySpace, int keySize, int keyOffset, int startRow, int endRow);
|
||||
|
||||
/**
|
||||
|
|
|
@ -99,7 +99,7 @@ public class ColumnSelectorBitmapIndexSelector implements BitmapIndexSelector
|
|||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException
|
||||
public void close()
|
||||
{
|
||||
|
||||
}
|
||||
|
|
|
@ -121,6 +121,7 @@ public interface ColumnarDoubles extends Closeable
|
|||
@Override
|
||||
public double getDouble()
|
||||
{
|
||||
//noinspection AssertWithSideEffects (ignore null handling test initialization check side effect)
|
||||
assert NullHandling.replaceWithDefault() || !isNull();
|
||||
return ColumnarDoubles.this.get(offset.getOffset());
|
||||
}
|
||||
|
|
|
@ -121,6 +121,7 @@ public interface ColumnarFloats extends Closeable
|
|||
@Override
|
||||
public float getFloat()
|
||||
{
|
||||
//noinspection AssertWithSideEffects (ignore null handling test initialization check side effect)
|
||||
assert NullHandling.replaceWithDefault() || !isNull();
|
||||
return ColumnarFloats.this.get(offset.getOffset());
|
||||
}
|
||||
|
|
|
@ -121,6 +121,7 @@ public interface ColumnarLongs extends Closeable
|
|||
@Override
|
||||
public long getLong()
|
||||
{
|
||||
//noinspection AssertWithSideEffects (ignore null handling test initialization check side effect)
|
||||
assert NullHandling.replaceWithDefault() || !isNull();
|
||||
return ColumnarLongs.this.get(offset.getOffset());
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ public class StringColumnAggregationTest
|
|||
}
|
||||
|
||||
@After
|
||||
public void tearDown() throws Exception
|
||||
public void tearDown()
|
||||
{
|
||||
if (segments != null) {
|
||||
for (Segment seg : segments) {
|
||||
|
|
|
@ -56,7 +56,7 @@ public class DoubleMeanAggregationTest
|
|||
|
||||
private final List<Segment> segments;
|
||||
|
||||
public DoubleMeanAggregationTest() throws Exception
|
||||
public DoubleMeanAggregationTest()
|
||||
{
|
||||
|
||||
groupByQueryTestHelper = AggregationTestHelper.createGroupByQueryAggregationTestHelper(
|
||||
|
|
|
@ -61,7 +61,6 @@ import org.junit.Test;
|
|||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
@ -101,7 +100,7 @@ public class ScanQueryRunnerTest extends InitializedNullHandlingTest
|
|||
int count = 0;
|
||||
|
||||
@Override
|
||||
public boolean processLine(String line) throws IOException
|
||||
public boolean processLine(String line)
|
||||
{
|
||||
if (count >= startLineNum && count < endLineNum) {
|
||||
lines.add(line);
|
||||
|
|
|
@ -173,7 +173,7 @@ public class CaffeineCacheTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSizeEviction() throws Exception
|
||||
public void testSizeEviction()
|
||||
{
|
||||
final CaffeineCacheConfig config = new CaffeineCacheConfig()
|
||||
{
|
||||
|
|
|
@ -48,7 +48,7 @@ public class SqlSegmentsMetadataManagerEmptyTest
|
|||
private final ObjectMapper jsonMapper = TestHelper.makeJsonMapper();
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception
|
||||
public void setUp()
|
||||
{
|
||||
TestDerbyConnector connector = derbyConnectorRule.getConnector();
|
||||
SegmentsMetadataManagerConfig config = new SegmentsMetadataManagerConfig();
|
||||
|
|
|
@ -35,7 +35,7 @@ public class RequestLogLineTest
|
|||
private Query query;
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception
|
||||
public void setUp()
|
||||
{
|
||||
query = new TimeBoundaryQuery(
|
||||
new TableDataSource("test"),
|
||||
|
@ -47,7 +47,7 @@ public class RequestLogLineTest
|
|||
}
|
||||
|
||||
@Test(expected = NullPointerException.class)
|
||||
public void nullTimestamp() throws JsonProcessingException
|
||||
public void nullTimestamp()
|
||||
{
|
||||
RequestLogLine requestLogLine = RequestLogLine.forNative(
|
||||
query,
|
||||
|
@ -58,7 +58,7 @@ public class RequestLogLineTest
|
|||
}
|
||||
|
||||
@Test(expected = NullPointerException.class)
|
||||
public void nullQueryStats() throws JsonProcessingException
|
||||
public void nullQueryStats()
|
||||
{
|
||||
RequestLogLine requestLogLine = RequestLogLine.forNative(
|
||||
query,
|
||||
|
|
Loading…
Reference in New Issue