Skip to content
Permalink
Browse files

[#1280] Fix some inspection warnings (#1282)

fixes #1280
  • Loading branch information...
timo95 authored and galpha committed May 24, 2019
1 parent 294e941 commit b77d24305fa3df1c01e0b6bfae1d84d0c7c1b843
Showing with 81 additions and 99 deletions.
  1. +2 −1 gradoop-common/src/main/java/org/gradoop/common/model/impl/pojo/Element.java
  2. +1 −2 gradoop-common/src/main/java/org/gradoop/common/model/impl/properties/Properties.java
  3. +2 −2 ...gration/src/test/java/org/gradoop/dataintegration/importer/impl/json/MinimalJSONImporterTest.java
  4. +1 −1 ...ion/src/test/java/org/gradoop/dataintegration/transformation/PropagatePropertyToNeighborTest.java
  5. +1 −1 ...ion/src/test/java/org/gradoop/dataintegration/transformation/impl/PropertyTransformationTest.java
  6. +1 −1 gradoop-flink/src/main/java/org/gradoop/flink/algorithms/fsm/dimspan/config/DIMSpanConfig.java
  7. +1 −1 gradoop-flink/src/main/java/org/gradoop/flink/algorithms/gelly/randomjump/KRandomJumpGellyVCI.java
  8. +1 −1 gradoop-flink/src/main/java/org/gradoop/flink/io/impl/edgelist/VertexLabeledEdgeListDataSource.java
  9. +1 −1 gradoop-flink/src/main/java/org/gradoop/flink/io/impl/tlf/functions/Dictionary.java
  10. +2 −3 gradoop-flink/src/main/java/org/gradoop/flink/model/impl/epgm/GraphCollection.java
  11. +1 −3 gradoop-flink/src/main/java/org/gradoop/flink/model/impl/functions/epgm/ByProperty.java
  12. +1 −1 gradoop-flink/src/main/java/org/gradoop/flink/model/impl/functions/graphcontainment/AddToGraph.java
  13. +1 −1 gradoop-flink/src/main/java/org/gradoop/flink/model/impl/functions/utils/AddCount.java
  14. +0 −3 ...ain/java/org/gradoop/flink/model/impl/operators/aggregation/functions/ApplyAggregateElements.java
  15. +1 −3 ...c/main/java/org/gradoop/flink/model/impl/operators/cypher/capf/result/functions/AddNewGraphs.java
  16. +1 −1 ...ain/java/org/gradoop/flink/model/impl/operators/cypher/capf/result/functions/AggregateGraphs.java
  17. +1 −1 ...p-flink/src/main/java/org/gradoop/flink/model/impl/operators/fusion/AddNewIdToDuplicatedEdge.java
  18. +1 −2 gradoop-flink/src/main/java/org/gradoop/flink/model/impl/operators/grouping/tuples/LabelGroup.java
  19. +1 −1 ...a/org/gradoop/flink/model/impl/operators/matching/common/functions/AddGraphElementToNewGraph.java
  20. +1 −2 ...link/src/main/java/org/gradoop/flink/model/impl/operators/matching/common/query/DFSTraverser.java
  21. +2 −2 ...link/src/main/java/org/gradoop/flink/model/impl/operators/matching/common/query/QueryHandler.java
  22. +3 −1 gradoop-flink/src/main/java/org/gradoop/flink/model/impl/operators/matching/common/query/Triple.java
  23. +2 −2 .../org/gradoop/flink/model/impl/operators/matching/common/query/predicates/PredicateCollection.java
  24. +3 −1 ...rg/gradoop/flink/model/impl/operators/matching/common/query/predicates/booleans/AndPredicate.java
  25. +3 −2 ...rg/gradoop/flink/model/impl/operators/matching/common/query/predicates/booleans/NotPredicate.java
  26. +3 −1 ...org/gradoop/flink/model/impl/operators/matching/common/query/predicates/booleans/OrPredicate.java
  27. +3 −2 ...rg/gradoop/flink/model/impl/operators/matching/common/query/predicates/booleans/XorPredicate.java
  28. +2 −3 .../model/impl/operators/matching/common/query/predicates/comparables/ElementSelectorComparable.java
  29. +2 −2 ...op/flink/model/impl/operators/matching/common/query/predicates/comparables/LiteralComparable.java
  30. +2 −3 ...model/impl/operators/matching/common/query/predicates/comparables/PropertySelectorComparable.java
  31. +2 −1 ...flink/model/impl/operators/matching/common/query/predicates/expressions/ComparisonExpression.java
  32. +1 −1 ...ink/model/impl/operators/matching/single/cypher/operators/add/functions/AddEmbeddingElements.java
  33. +1 −1 ...flink/model/impl/operators/matching/single/cypher/operators/expand/functions/AdoptEmptyPaths.java
  34. +1 −2 ...a/org/gradoop/flink/model/impl/operators/matching/single/cypher/planning/plantable/PlanTable.java
  35. +2 −2 ...k/model/impl/operators/matching/single/cypher/planning/queryplan/binary/ExpandEmbeddingsNode.java
  36. +1 −5 .../src/main/java/org/gradoop/flink/model/impl/operators/matching/single/cypher/pojos/Embedding.java
  37. +1 −1 ...del/impl/operators/matching/single/preserving/explorative/functions/BuildEmbeddingFromVertex.java
  38. +3 −9 .../org/gradoop/flink/model/impl/operators/matching/transactional/algorithm/DepthSearchMatching.java
  39. +1 −1 ...rg/gradoop/flink/model/impl/operators/matching/transactional/function/AddMatchesToProperties.java
  40. +1 −1 ...rc/main/java/org/gradoop/flink/model/impl/operators/neighborhood/functions/VertexIdsWithEdge.java
  41. +1 −1 ...src/main/java/org/gradoop/flink/model/impl/operators/neighborhood/functions/VertexToFieldOne.java
  42. +1 −1 ...rc/main/java/org/gradoop/flink/model/impl/operators/neighborhood/functions/VertexToFieldZero.java
  43. +1 −1 .../org/gradoop/flink/model/impl/operators/statistics/functions/AddAverageCCValueToGraphHeadMap.java
  44. +1 −1 ...in/java/org/gradoop/flink/model/impl/operators/subgraph/functions/AddGraphsToElementsCoGroup.java
  45. +3 −3 ...t/java/org/gradoop/flink/model/impl/functions/filters/AbstractRichCombinedFilterFunctionTest.java
  46. +3 −3 gradoop-flink/src/test/java/org/gradoop/flink/model/impl/functions/filters/CombinableFilterTest.java
  47. +1 −2 gradoop-flink/src/test/java/org/gradoop/flink/model/impl/operators/exclusion/ExclusionTest.java
  48. +1 −1 .../src/test/java/org/gradoop/flink/model/impl/operators/matching/common/query/QueryHandlerTest.java
  49. +1 −2 gradoop-flink/src/test/java/org/gradoop/flink/model/impl/operators/overlap/OverlapTest.java
  50. +1 −3 gradoop-flink/src/test/java/org/gradoop/flink/model/impl/operators/subgraph/SubgraphTest.java
  51. +2 −2 ...oop-accumulo/src/main/java/org/gradoop/storage/impl/accumulo/io/inputformats/BaseInputFormat.java
  52. +1 −1 ...p-accumulo/src/test/java/org/gradoop/storage/impl/accumulo/predicate/StoreBasicPredicateTest.java
  53. +1 −1 ...op-accumulo/src/test/java/org/gradoop/storage/impl/accumulo/predicate/StorePropPredicateTest.java
  54. +2 −2 gradoop-store/gradoop-hbase/src/test/java/org/gradoop/storage/impl/hbase/HBaseEPGMStoreTest.java
@@ -23,6 +23,7 @@
import org.gradoop.common.model.impl.properties.PropertyValue;

import javax.annotation.Nullable;
import java.util.Objects;

/**
* Abstract base class for graphs, vertices and edges.
@@ -151,7 +152,7 @@ public boolean equals(Object o) {

Element that = (Element) o;

return !(id != null ? !id.equals(that.id) : that.id != null);
return Objects.equals(id, that.id);
}

@Override
@@ -243,8 +243,7 @@ public boolean equals(Object o) {

Properties that = (Properties) o;

return !(properties != null ? !properties.equals(that.properties) :
that.properties != null);
return Objects.equals(properties, that.properties);
}

/**
@@ -30,12 +30,12 @@
/**
* The path of the test JSON data.
*/
private String dirPath = MinimalJSONImporter.class.getResource("/json/testdata.json").getFile();
private final String dirPath = MinimalJSONImporter.class.getResource("/json/testdata.json").getFile();

/**
* The path of a single file of the test JSON data.
*/
private String filePath = MinimalJSONImporter.class.getResource("/json/testdata.json/2").getFile();
private final String filePath = MinimalJSONImporter.class.getResource("/json/testdata.json/2").getFile();

/**
* The loader used to load the expected graph.
@@ -39,7 +39,7 @@
* Whether this order makes any sense is not relevant for this test, it is just used to make sure
* that two list-typed properties have the same order.
*/
private static Comparator<PropertyValue> byTypeFirst = Comparator
private static final Comparator<PropertyValue> byTypeFirst = Comparator
.comparing((PropertyValue pv) -> pv.getType().getSimpleName())
.thenComparing(Comparator.naturalOrder());

@@ -69,7 +69,7 @@
/**
* Simple property transformation that divides a value by 1000.
*/
protected static PropertyTransformationFunction DIVISION = new DivideBy(1000L);
protected static final PropertyTransformationFunction DIVISION = new DivideBy(1000L);
/**
* Executes a property transformation on graphHeads, vertices and edges and checks if the result
* is correct.
@@ -80,7 +80,7 @@ public DIMSpanConfig(float minSupport, boolean directed) {
public String toString() {
List<String> parameters = Lists.newArrayList();

parameters.add("s_min : " + String.valueOf(minSupport));
parameters.add("s_min : " + minSupport);
parameters.add((directed ? "directed" : "undirected") + " mode");
parameters.add("dictionary type : " + dictionaryType.toString());

@@ -153,7 +153,7 @@ public KRandomJumpGellyVCI(int numberOfStartVertices, int maxIterations, double
public LogicalGraph executeInGelly(Graph<Long, VCIVertexValue, Long> gellyGraph)
throws Exception {

Long vertexCount = gellyGraph.numberOfVertices();
long vertexCount = gellyGraph.numberOfVertices();

//--------------------------------------------------------------------------
// pre compute
@@ -99,7 +99,7 @@ public GraphCollection getGraphCollection() throws IOException {

DataSet<ImportVertex<Long>> importVertices = lineTuples
.<Tuple2<Long, String>>project(0, 1)
.union(lineTuples.<Tuple2<Long, String>>project(2, 3))
.union(lineTuples.project(2, 3))
.distinct(0)
.map(new CreateLabeledImportVertex<>(propertyKey));

@@ -43,7 +43,7 @@ public void reduce(
Map<Integer, String> dictionary = Maps.newHashMap();
for (Tuple2<Integer, String> tuple : iterable) {
dictionary.put(
(Integer) tuple.getField(0), (String) tuple.getField(1));
tuple.getField(0), tuple.getField(1));
}
collector.collect(dictionary);
}
@@ -66,6 +66,7 @@
import org.gradoop.flink.util.GradoopFlinkConfig;

import java.io.IOException;
import java.util.Arrays;
import java.util.Objects;

/**
@@ -185,9 +186,7 @@ public GraphCollection getGraphs(final GradoopId... identifiers) {

GradoopIdSet graphIds = new GradoopIdSet();

for (GradoopId id : identifiers) {
graphIds.add(id);
}
graphIds.addAll(Arrays.asList(identifiers));

return getGraphs(graphIds);
}
@@ -70,9 +70,7 @@ public ByProperty(String key, PropertyValue value) {
public boolean filter(E e) throws Exception {
if (e.hasProperty(key)) {
if (value != null) {
if (e.getPropertyValue(key).equals(value)) {
return true;
}
return e.getPropertyValue(key).equals(value);
} else {
return true;
}
@@ -43,7 +43,7 @@ public AddToGraph(GraphHead graphHead) {
}

@Override
public GE map(GE graphElement) throws Exception {
public GE map(GE graphElement) {
graphElement.addGraphId(graphHeadId);
return graphElement;
}
@@ -26,7 +26,7 @@
public class AddCount<T> implements MapFunction<T, WithCount<T>> {

@Override
public WithCount<T> map(T object) throws Exception {
public WithCount<T> map(T object) {
return new WithCount<>(object);
}
}
@@ -13,9 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* (graphId,vertex),.. => (graphId,aggregateValue),..
*/
package org.gradoop.flink.model.impl.operators.aggregation.functions;

import org.apache.flink.api.common.functions.GroupCombineFunction;
@@ -35,9 +35,7 @@
implements JoinFunction<Tuple2<Long, GradoopIdSet>, Tuple2<Long, E>, E> {

@Override
public E join(
Tuple2<Long, GradoopIdSet> idTuple,
Tuple2<Long, E> elementTuple) throws Exception {
public E join(Tuple2<Long, GradoopIdSet> idTuple, Tuple2<Long, E> elementTuple) {

E element = elementTuple.f1;
for (GradoopId id : idTuple.f1) {
@@ -42,7 +42,7 @@

@Override
public void reduce(Iterable<Tuple2<T, GradoopId>> iterable,
Collector<Tuple2<T, GradoopIdSet>> collector) throws Exception {
Collector<Tuple2<T, GradoopIdSet>> collector) {

if (returnTuple.f1 == null) {
returnTuple.f1 = new GradoopIdSet();
@@ -31,7 +31,7 @@
* @see org.apache.flink.api.common.functions.GroupReduceFunction#reduce(java.lang.Iterable, org.apache.flink.util.Collector)
*/
@Override
public void reduce(Iterable<Edge> values, Collector<Edge> out) throws Exception {
public void reduce(Iterable<Edge> values, Collector<Edge> out) {
boolean sawFirst = false;
for (Edge edge: values) {
if (sawFirst) {
@@ -19,7 +19,6 @@
import org.gradoop.common.model.api.entities.EPGMEdge;
import org.gradoop.common.model.api.entities.EPGMElement;
import org.gradoop.common.model.api.entities.EPGMVertex;
import org.gradoop.common.model.impl.pojo.Element;
import org.gradoop.common.model.impl.properties.PropertyValue;
import org.gradoop.common.model.impl.properties.PropertyValueList;
import org.gradoop.flink.model.api.functions.AggregateFunction;
@@ -276,7 +275,7 @@ private static PropertyValue getIncrement(AggregateFunction aggregateFunction,
PropertyValue increment = null;
if ((element instanceof EPGMVertex && aggregateFunction.isVertexAggregation()) ||
(element instanceof EPGMEdge && aggregateFunction.isEdgeAggregation())) {
increment = aggregateFunction.getIncrement((Element) element);
increment = aggregateFunction.getIncrement(element);
}
return increment == null ? AggregateUtil.getDefaultAggregate(aggregateFunction) : increment;
}
@@ -70,7 +70,7 @@ public AddGraphElementToNewGraph(EPGMGraphHeadFactory<GraphHead> graphHeadFactor
}

@Override
public Tuple2<GE, GraphHead> map(GE value) throws Exception {
public Tuple2<GE, GraphHead> map(GE value) {
reuseVariableMapping.clear();
reuseVariableMapping.put(
PropertyValue.create(this.variable),
@@ -57,8 +57,7 @@ public TraversalCode traverse(long rootVertex) {
long current = rootVertex;

vertexVisited.add(current);
Deque<Edge> edgeStack = new ArrayDeque<>();
edgeStack.addAll(queryHandler.getEdgesByVertexId(current));
Deque<Edge> edgeStack = new ArrayDeque<>(queryHandler.getEdgesByVertexId(current));

while (!edgeStack.isEmpty()) {
Edge edge = edgeStack.removeLast();
@@ -405,7 +405,7 @@ public Edge getEdgeByVariable(String variable) {
Collection<Edge> predecessors =
getEdgesByTargetVertexId(getEdgeById(edgeId).getSourceVertexId());
return predecessors != null ?
Lists.newArrayList(predecessors) : Lists.<Edge>newArrayList();
Lists.newArrayList(predecessors) : Lists.newArrayList();
}

/**
@@ -419,7 +419,7 @@ public Edge getEdgeByVariable(String variable) {
Collection<Edge> successors =
getEdgesBySourceVertexId(getEdgeById(edgeId).getTargetVertexId());
return successors != null ?
Lists.newArrayList(successors) : Lists.<Edge>newArrayList();
Lists.newArrayList(successors) : Lists.newArrayList();
}

/**
@@ -18,6 +18,8 @@
import org.s1ck.gdl.model.Edge;
import org.s1ck.gdl.model.Vertex;

import java.util.Objects;

/**
* A triple representation of a query edge.
*/
@@ -71,7 +73,7 @@ public boolean equals(Object o) {

Triple triple = (Triple) o;

return edge != null ? edge.equals(triple.edge) : triple.edge == null;
return Objects.equals(edge, triple.edge);
}

@Override
@@ -22,6 +22,7 @@
import java.io.Serializable;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.Set;

import static java.util.stream.Collectors.joining;
@@ -142,8 +143,7 @@ public boolean equals(Object o) {

PredicateCollection predicateCollection = (PredicateCollection) o;

return predicates != null ?
predicates.equals(predicateCollection.predicates) : predicateCollection.predicates == null;
return Objects.equals(predicates, predicateCollection.predicates);
}

@Override
@@ -19,6 +19,8 @@
import org.gradoop.flink.model.impl.operators.matching.common.query.predicates.QueryPredicate;
import org.s1ck.gdl.model.predicates.booleans.And;

import java.util.Objects;

/**
* Wraps an {@link org.s1ck.gdl.model.predicates.booleans.And} predicate
*/
@@ -72,7 +74,7 @@ public boolean equals(Object o) {

AndPredicate that = (AndPredicate) o;

return and != null ? and.equals(that.and) : that.and == null;
return Objects.equals(and, that.and);
}

@Override
@@ -27,6 +27,8 @@
import org.s1ck.gdl.model.predicates.expressions.Comparison;
import org.s1ck.gdl.utils.Comparator;

import java.util.Objects;

/**
* Wraps a {@link org.s1ck.gdl.model.predicates.booleans.Not} predicate
*/
@@ -124,8 +126,7 @@ public boolean equals(Object o) {

NotPredicate that = (NotPredicate) o;

return not != null ? not.equals(that.not) : that.not == null;

return Objects.equals(not, that.not);
}

@Override
@@ -19,6 +19,8 @@
import org.gradoop.flink.model.impl.operators.matching.common.query.predicates.QueryPredicate;
import org.s1ck.gdl.model.predicates.booleans.Or;

import java.util.Objects;

/**
* Wraps an {@link org.s1ck.gdl.model.predicates.booleans.Or} predicate
*/
@@ -71,7 +73,7 @@ public boolean equals(Object o) {

OrPredicate orPredicateWrapper = (OrPredicate) o;

return or != null ? or.equals(orPredicateWrapper.or) : orPredicateWrapper.or == null;
return Objects.equals(or, orPredicateWrapper.or);
}

@Override
@@ -23,6 +23,8 @@
import org.s1ck.gdl.model.predicates.booleans.Or;
import org.s1ck.gdl.model.predicates.booleans.Xor;

import java.util.Objects;

/**
* Wraps a {@link org.s1ck.gdl.model.predicates.booleans.Xor} predicate
*/
@@ -84,8 +86,7 @@ public boolean equals(Object o) {

XorPredicate that = (XorPredicate) o;

return xor != null ? xor.equals(that.xor) : that.xor == null;

return Objects.equals(xor, that.xor);
}

@Override
@@ -23,6 +23,7 @@
import org.s1ck.gdl.model.comparables.ElementSelector;

import java.util.HashSet;
import java.util.Objects;
import java.util.Set;

/**
@@ -77,9 +78,7 @@ public boolean equals(Object o) {

ElementSelectorComparable that = (ElementSelectorComparable) o;

return elementSelector != null ? elementSelector.equals(that.elementSelector) :
that.elementSelector == null;

return Objects.equals(elementSelector, that.elementSelector);
}

@Override
@@ -23,6 +23,7 @@
import org.s1ck.gdl.model.comparables.Literal;

import java.util.HashSet;
import java.util.Objects;
import java.util.Set;

/**
@@ -85,8 +86,7 @@ public boolean equals(Object o) {

LiteralComparable that = (LiteralComparable) o;

return literal != null ? literal.equals(that.literal) : that.literal == null;

return Objects.equals(literal, that.literal);
}

@Override

0 comments on commit b77d243

Please sign in to comment.
You can’t perform that action at this time.