flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject [2/4] flink git commit: [FLINK-8105] Remove "unnecessary 'null' check before 'instanceof' expression"
Date Tue, 28 Nov 2017 03:32:03 GMT
[FLINK-8105] Remove "unnecessary 'null' check before 'instanceof' expression"

This closes #5034


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/3561222c
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/3561222c
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/3561222c

Branch: refs/heads/master
Commit: 3561222c5d6c7cee79f8c5872f32227632135c48
Parents: f2b804a
Author: yew1eb <yew1eb@gmail.com>
Authored: Mon Nov 20 00:50:57 2017 +0800
Committer: Greg Hogan <code@greghogan.com>
Committed: Mon Nov 27 15:27:20 2017 -0500

----------------------------------------------------------------------
 .../flink/api/java/hadoop/mapred/HadoopInputFormatBase.java    | 2 +-
 .../flink/api/java/hadoop/mapreduce/HadoopInputFormatBase.java | 2 +-
 .../java/org/apache/flink/storm/api/FlinkLocalCluster.java     | 2 +-
 .../java/org/apache/flink/api/common/io/BinaryInputFormat.java | 2 +-
 .../org/apache/flink/api/common/io/DelimitedInputFormat.java   | 2 +-
 .../java/org/apache/flink/api/common/io/FileInputFormat.java   | 2 +-
 .../api/java/typeutils/runtime/RuntimeSerializerFactory.java   | 2 +-
 .../src/main/java/org/apache/flink/core/fs/FileInputSplit.java | 2 +-
 .../main/java/org/apache/flink/core/io/GenericInputSplit.java  | 2 +-
 .../java/org/apache/flink/core/io/LocatableInputSplit.java     | 2 +-
 .../main/java/org/apache/flink/api/java/sca/UdfAnalyzer.java   | 2 +-
 .../java/org/apache/flink/api/java/sca/UdfAnalyzerUtils.java   | 2 +-
 .../apache/flink/api/java/io/CollectionInputFormatTest.java    | 2 +-
 .../flink/optimizer/dataproperties/GlobalProperties.java       | 2 +-
 .../flink/optimizer/dataproperties/InterestingProperties.java  | 2 +-
 .../optimizer/dataproperties/RequestedGlobalProperties.java    | 2 +-
 .../flink/optimizer/plantranslate/JobGraphGenerator.java       | 5 ++---
 .../org/apache/flink/optimizer/traversals/PlanFinalizer.java   | 6 +++---
 .../flink/runtime/taskmanager/TaskManagerRegistrationTest.java | 2 +-
 .../api/functions/source/TimestampedFileInputSplit.java        | 2 +-
 .../streaming/runtime/operators/GenericWriteAheadSink.java     | 2 +-
 21 files changed, 24 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapred/HadoopInputFormatBase.java
----------------------------------------------------------------------
diff --git a/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapred/HadoopInputFormatBase.java
b/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapred/HadoopInputFormatBase.java
index 27a477c..5c26a58 100644
--- a/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapred/HadoopInputFormatBase.java
+++ b/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapred/HadoopInputFormatBase.java
@@ -121,7 +121,7 @@ public abstract class HadoopInputFormatBase<K, V, T> extends HadoopInputFormatCo
 			return null;
 		}
 
-		final FileBaseStatistics cachedFileStats = (cachedStats != null && cachedStats
instanceof FileBaseStatistics) ?
+		final FileBaseStatistics cachedFileStats = (cachedStats instanceof FileBaseStatistics)
?
 				(FileBaseStatistics) cachedStats : null;
 
 		try {

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/HadoopInputFormatBase.java
----------------------------------------------------------------------
diff --git a/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/HadoopInputFormatBase.java
b/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/HadoopInputFormatBase.java
index 06205e9..6734d5f 100644
--- a/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/HadoopInputFormatBase.java
+++ b/flink-connectors/flink-hadoop-compatibility/src/main/java/org/apache/flink/api/java/hadoop/mapreduce/HadoopInputFormatBase.java
@@ -119,7 +119,7 @@ public abstract class HadoopInputFormatBase<K, V, T> extends HadoopInputFormatCo
 
 		JobContext jobContext = new JobContextImpl(configuration, null);
 
-		final FileBaseStatistics cachedFileStats = (cachedStats != null && cachedStats
instanceof FileBaseStatistics) ?
+		final FileBaseStatistics cachedFileStats = (cachedStats instanceof FileBaseStatistics)
?
 				(FileBaseStatistics) cachedStats : null;
 
 		try {

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-contrib/flink-storm/src/main/java/org/apache/flink/storm/api/FlinkLocalCluster.java
----------------------------------------------------------------------
diff --git a/flink-contrib/flink-storm/src/main/java/org/apache/flink/storm/api/FlinkLocalCluster.java
b/flink-contrib/flink-storm/src/main/java/org/apache/flink/storm/api/FlinkLocalCluster.java
index 364c4d5..bff8c80 100644
--- a/flink-contrib/flink-storm/src/main/java/org/apache/flink/storm/api/FlinkLocalCluster.java
+++ b/flink-contrib/flink-storm/src/main/java/org/apache/flink/storm/api/FlinkLocalCluster.java
@@ -73,7 +73,7 @@ public class FlinkLocalCluster {
 		boolean submitBlocking = false;
 		if (conf != null) {
 			Object blockingFlag = conf.get(SUBMIT_BLOCKING);
-			if (blockingFlag != null && blockingFlag instanceof Boolean) {
+			if (blockingFlag instanceof Boolean) {
 				submitBlocking = ((Boolean) blockingFlag).booleanValue();
 			}
 		}

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-core/src/main/java/org/apache/flink/api/common/io/BinaryInputFormat.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/io/BinaryInputFormat.java
b/flink-core/src/main/java/org/apache/flink/api/common/io/BinaryInputFormat.java
index d45a767..7301b91 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/io/BinaryInputFormat.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/io/BinaryInputFormat.java
@@ -169,7 +169,7 @@ public abstract class BinaryInputFormat<T> extends FileInputFormat<T>
 	@Override
 	public SequentialStatistics getStatistics(BaseStatistics cachedStats) {
 
-		final FileBaseStatistics cachedFileStats = (cachedStats != null && cachedStats
instanceof FileBaseStatistics) ?
+		final FileBaseStatistics cachedFileStats = cachedStats instanceof FileBaseStatistics ?
 			(FileBaseStatistics) cachedStats : null;
 
 		try {

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-core/src/main/java/org/apache/flink/api/common/io/DelimitedInputFormat.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/io/DelimitedInputFormat.java
b/flink-core/src/main/java/org/apache/flink/api/common/io/DelimitedInputFormat.java
index 4d715e7..1d344b9 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/io/DelimitedInputFormat.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/io/DelimitedInputFormat.java
@@ -345,7 +345,7 @@ public abstract class DelimitedInputFormat<OT> extends FileInputFormat<OT>
imple
 	@Override
 	public FileBaseStatistics getStatistics(BaseStatistics cachedStats) throws IOException {
 		
-		final FileBaseStatistics cachedFileStats = (cachedStats != null && cachedStats
instanceof FileBaseStatistics) ?
+		final FileBaseStatistics cachedFileStats = cachedStats instanceof FileBaseStatistics ?
 				(FileBaseStatistics) cachedStats : null;
 		
 		// store properties

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-core/src/main/java/org/apache/flink/api/common/io/FileInputFormat.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/common/io/FileInputFormat.java
b/flink-core/src/main/java/org/apache/flink/api/common/io/FileInputFormat.java
index 1c8e7ff..f43bd22 100644
--- a/flink-core/src/main/java/org/apache/flink/api/common/io/FileInputFormat.java
+++ b/flink-core/src/main/java/org/apache/flink/api/common/io/FileInputFormat.java
@@ -379,7 +379,7 @@ public abstract class FileInputFormat<OT> extends RichInputFormat<OT,
FileInputS
 	@Override
 	public FileBaseStatistics getStatistics(BaseStatistics cachedStats) throws IOException {
 		
-		final FileBaseStatistics cachedFileStats = (cachedStats != null && cachedStats
instanceof FileBaseStatistics) ?
+		final FileBaseStatistics cachedFileStats = cachedStats instanceof FileBaseStatistics ?
 			(FileBaseStatistics) cachedStats : null;
 				
 		try {

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/RuntimeSerializerFactory.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/RuntimeSerializerFactory.java
b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/RuntimeSerializerFactory.java
index f03a7ab..dfb9ea8 100644
--- a/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/RuntimeSerializerFactory.java
+++ b/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/RuntimeSerializerFactory.java
@@ -114,7 +114,7 @@ public final class RuntimeSerializerFactory<T> implements TypeSerializerFactory<
 	
 	@Override
 	public boolean equals(Object obj) {
-		if (obj != null && obj instanceof RuntimeSerializerFactory) {
+		if (obj instanceof RuntimeSerializerFactory) {
 			RuntimeSerializerFactory<?> other = (RuntimeSerializerFactory<?>) obj;
 			
 			return this.clazz == other.clazz &&

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-core/src/main/java/org/apache/flink/core/fs/FileInputSplit.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/core/fs/FileInputSplit.java b/flink-core/src/main/java/org/apache/flink/core/fs/FileInputSplit.java
index bef13fa..b53ac4b 100644
--- a/flink-core/src/main/java/org/apache/flink/core/fs/FileInputSplit.java
+++ b/flink-core/src/main/java/org/apache/flink/core/fs/FileInputSplit.java
@@ -104,7 +104,7 @@ public class FileInputSplit extends LocatableInputSplit {
 		if (obj == this) {
 			return true;
 		}
-		else if (obj != null && obj instanceof FileInputSplit && super.equals(obj))
{
+		else if (obj instanceof FileInputSplit && super.equals(obj)) {
 			FileInputSplit other = (FileInputSplit) obj;
 
 			return this.start == other.start &&

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-core/src/main/java/org/apache/flink/core/io/GenericInputSplit.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/core/io/GenericInputSplit.java b/flink-core/src/main/java/org/apache/flink/core/io/GenericInputSplit.java
index 5c7bd00..fdc6406 100644
--- a/flink-core/src/main/java/org/apache/flink/core/io/GenericInputSplit.java
+++ b/flink-core/src/main/java/org/apache/flink/core/io/GenericInputSplit.java
@@ -67,7 +67,7 @@ public class GenericInputSplit implements InputSplit, java.io.Serializable
{
 	
 	@Override
 	public boolean equals(Object obj) {
-		if (obj != null && obj instanceof GenericInputSplit) {
+		if (obj instanceof GenericInputSplit) {
 			GenericInputSplit other = (GenericInputSplit) obj;
 			return this.partitionNumber == other.partitionNumber &&
 					this.totalNumberOfPartitions == other.totalNumberOfPartitions;

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-core/src/main/java/org/apache/flink/core/io/LocatableInputSplit.java
----------------------------------------------------------------------
diff --git a/flink-core/src/main/java/org/apache/flink/core/io/LocatableInputSplit.java b/flink-core/src/main/java/org/apache/flink/core/io/LocatableInputSplit.java
index 21a5093..b71521c 100644
--- a/flink-core/src/main/java/org/apache/flink/core/io/LocatableInputSplit.java
+++ b/flink-core/src/main/java/org/apache/flink/core/io/LocatableInputSplit.java
@@ -90,7 +90,7 @@ public class LocatableInputSplit implements InputSplit, java.io.Serializable
{
 		if (obj == this) {
 			return true;
 		}
-		else if (obj != null && obj instanceof LocatableInputSplit) {
+		else if (obj instanceof LocatableInputSplit) {
 			LocatableInputSplit other = (LocatableInputSplit) obj;
 			return other.splitNumber == this.splitNumber && Arrays.deepEquals(other.hostnames,
this.hostnames);
 		}

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzer.java
----------------------------------------------------------------------
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzer.java b/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzer.java
index 0a0f0f9..e485801 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzer.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzer.java
@@ -331,7 +331,7 @@ public class UdfAnalyzer {
 			while (cause != null && !(cause instanceof CodeErrorException)) {
 				cause = cause.getCause();
 			}
-			if ((cause != null && cause instanceof CodeErrorException) || e instanceof CodeErrorException)
{
+			if (cause instanceof CodeErrorException || e instanceof CodeErrorException) {
 				throw new CodeErrorException("Function code contains obvious errors. " +
 						"If you think the code analysis is wrong at this point you can " +
 						"disable the entire code analyzer in ExecutionConfig or add" +

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzerUtils.java
----------------------------------------------------------------------
diff --git a/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzerUtils.java
b/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzerUtils.java
index 8a76ed2..1c0af81 100644
--- a/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzerUtils.java
+++ b/flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzerUtils.java
@@ -155,7 +155,7 @@ public final class UdfAnalyzerUtils {
 	}
 
 	public static boolean isTagged(Value value) {
-		return value != null && value instanceof TaggedValue;
+		return value instanceof TaggedValue;
 	}
 
 	public static TaggedValue tagged(Value value) {

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-java/src/test/java/org/apache/flink/api/java/io/CollectionInputFormatTest.java
----------------------------------------------------------------------
diff --git a/flink-java/src/test/java/org/apache/flink/api/java/io/CollectionInputFormatTest.java
b/flink-java/src/test/java/org/apache/flink/api/java/io/CollectionInputFormatTest.java
index 77945cc..579e761 100644
--- a/flink-java/src/test/java/org/apache/flink/api/java/io/CollectionInputFormatTest.java
+++ b/flink-java/src/test/java/org/apache/flink/api/java/io/CollectionInputFormatTest.java
@@ -70,7 +70,7 @@ public class CollectionInputFormatTest {
 
 		@Override
 		public boolean equals(Object obj) {
-			if (obj != null && obj instanceof ElementType) {
+			if (obj instanceof ElementType) {
 				ElementType et = (ElementType) obj;
 				return et.getId() == this.getId();
 			} else {

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/GlobalProperties.java
----------------------------------------------------------------------
diff --git a/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/GlobalProperties.java
b/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/GlobalProperties.java
index 654b054..dffea8e 100644
--- a/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/GlobalProperties.java
+++ b/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/GlobalProperties.java
@@ -456,7 +456,7 @@ public class GlobalProperties implements Cloneable {
 
 	@Override
 	public boolean equals(Object obj) {
-		if (obj != null && obj instanceof GlobalProperties) {
+		if (obj instanceof GlobalProperties) {
 			final GlobalProperties other = (GlobalProperties) obj;
 			return (this.partitioning == other.partitioning)
 				&& (this.ordering == other.ordering || (this.ordering != null && this.ordering.equals(other.ordering)))

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/InterestingProperties.java
----------------------------------------------------------------------
diff --git a/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/InterestingProperties.java
b/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/InterestingProperties.java
index 6946641..1bd0e2f 100644
--- a/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/InterestingProperties.java
+++ b/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/InterestingProperties.java
@@ -148,7 +148,7 @@ public class InterestingProperties implements Cloneable  {
 
 	@Override
 	public boolean equals(Object obj) {
-		if (obj != null && obj instanceof InterestingProperties) {
+		if (obj instanceof InterestingProperties) {
 			InterestingProperties other = (InterestingProperties) obj;
 			return this.globalProps.equals(other.globalProps) &&
 					this.localProps.equals(other.localProps);

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/RequestedGlobalProperties.java
----------------------------------------------------------------------
diff --git a/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/RequestedGlobalProperties.java
b/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/RequestedGlobalProperties.java
index 3646d74..5adeb19 100644
--- a/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/RequestedGlobalProperties.java
+++ b/flink-optimizer/src/main/java/org/apache/flink/optimizer/dataproperties/RequestedGlobalProperties.java
@@ -448,7 +448,7 @@ public final class RequestedGlobalProperties implements Cloneable {
 
 	@Override
 	public boolean equals(Object obj) {
-		if (obj != null && obj instanceof RequestedGlobalProperties) {
+		if (obj instanceof RequestedGlobalProperties) {
 			RequestedGlobalProperties other = (RequestedGlobalProperties) obj;
 			return (ordering == other.getOrdering() || (ordering != null && ordering.equals(other.getOrdering())))
 					&& (partitioning == other.getPartitioning())

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-optimizer/src/main/java/org/apache/flink/optimizer/plantranslate/JobGraphGenerator.java
----------------------------------------------------------------------
diff --git a/flink-optimizer/src/main/java/org/apache/flink/optimizer/plantranslate/JobGraphGenerator.java
b/flink-optimizer/src/main/java/org/apache/flink/optimizer/plantranslate/JobGraphGenerator.java
index f7f9314..e3dcfad 100644
--- a/flink-optimizer/src/main/java/org/apache/flink/optimizer/plantranslate/JobGraphGenerator.java
+++ b/flink-optimizer/src/main/java/org/apache/flink/optimizer/plantranslate/JobGraphGenerator.java
@@ -810,8 +810,7 @@ public class JobGraphGenerator implements Visitor<PlanNode> {
 			
 			// cannot chain the nodes that produce the next workset or the next solution set, if they
are not the
 			// in a tail 
-			if (this.currentIteration != null && this.currentIteration instanceof WorksetIterationPlanNode
&&
-					node.getOutgoingChannels().size() > 0)
+			if (this.currentIteration instanceof WorksetIterationPlanNode && node.getOutgoingChannels().size()
> 0)
 			{
 				WorksetIterationPlanNode wspn = (WorksetIterationPlanNode) this.currentIteration;
 				if (wspn.getSolutionSetDeltaPlanNode() == pred || wspn.getNextWorkSetPlanNode() == pred)
{
@@ -819,7 +818,7 @@ public class JobGraphGenerator implements Visitor<PlanNode> {
 				}
 			}
 			// cannot chain the nodes that produce the next workset in a bulk iteration if a termination
criterion follows
-			if (this.currentIteration != null && this.currentIteration instanceof BulkIterationPlanNode)
+			if (this.currentIteration instanceof BulkIterationPlanNode)
 			{
 				BulkIterationPlanNode wspn = (BulkIterationPlanNode) this.currentIteration;
 				if (node == wspn.getRootOfTerminationCriterion() && wspn.getRootOfStepFunction()
== pred){

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-optimizer/src/main/java/org/apache/flink/optimizer/traversals/PlanFinalizer.java
----------------------------------------------------------------------
diff --git a/flink-optimizer/src/main/java/org/apache/flink/optimizer/traversals/PlanFinalizer.java
b/flink-optimizer/src/main/java/org/apache/flink/optimizer/traversals/PlanFinalizer.java
index 58aa3c1..b3b7cf9 100644
--- a/flink-optimizer/src/main/java/org/apache/flink/optimizer/traversals/PlanFinalizer.java
+++ b/flink-optimizer/src/main/java/org/apache/flink/optimizer/traversals/PlanFinalizer.java
@@ -147,7 +147,7 @@ public class PlanFinalizer implements Visitor<PlanNode> {
 			final IterationPlanNode iteration = this.stackOfIterationNodes.peekLast();
 
 			// sanity check!
-			if (iteration == null || !(iteration instanceof BulkIterationPlanNode)) {
+			if (!(iteration instanceof BulkIterationPlanNode)) {
 				throw new CompilerException("Bug: Error finalizing the plan. " +
 						"Cannot associate the node for a partial solutions with its containing iteration.");
 			}
@@ -159,7 +159,7 @@ public class PlanFinalizer implements Visitor<PlanNode> {
 			final IterationPlanNode iteration = this.stackOfIterationNodes.peekLast();
 
 			// sanity check!
-			if (iteration == null || !(iteration instanceof WorksetIterationPlanNode)) {
+			if (!(iteration instanceof WorksetIterationPlanNode)) {
 				throw new CompilerException("Bug: Error finalizing the plan. " +
 						"Cannot associate the node for a partial solutions with its containing iteration.");
 			}
@@ -171,7 +171,7 @@ public class PlanFinalizer implements Visitor<PlanNode> {
 			final IterationPlanNode iteration = this.stackOfIterationNodes.peekLast();
 
 			// sanity check!
-			if (iteration == null || !(iteration instanceof WorksetIterationPlanNode)) {
+			if (!(iteration instanceof WorksetIterationPlanNode)) {
 				throw new CompilerException("Bug: Error finalizing the plan. " +
 						"Cannot associate the node for a partial solutions with its containing iteration.");
 			}

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskManagerRegistrationTest.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskManagerRegistrationTest.java
b/flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskManagerRegistrationTest.java
index 3953072..986f3fa 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskManagerRegistrationTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/taskmanager/TaskManagerRegistrationTest.java
@@ -545,7 +545,7 @@ public class TaskManagerRegistrationTest extends TestLogger {
 
 						// we might also receive RegisterTaskManager and Heartbeat messages which
 						// are queued up in the testing actor's mailbox
-						while(message == null || !(message instanceof Terminated)) {
+						while(!(message instanceof Terminated)) {
 							message = receiveOne(timeout);
 						}
 

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/TimestampedFileInputSplit.java
----------------------------------------------------------------------
diff --git a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/TimestampedFileInputSplit.java
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/TimestampedFileInputSplit.java
index 4111d91..201533c 100644
--- a/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/TimestampedFileInputSplit.java
+++ b/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/functions/source/TimestampedFileInputSplit.java
@@ -119,7 +119,7 @@ public class TimestampedFileInputSplit extends FileInputSplit implements
Compara
 	public boolean equals(Object o) {
 		if (this == o) {
 			return true;
-		} else if (o != null && o instanceof TimestampedFileInputSplit && super.equals(o))
{
+		} else if (o instanceof TimestampedFileInputSplit && super.equals(o)) {
 			TimestampedFileInputSplit that = (TimestampedFileInputSplit) o;
 			return this.modificationTime == that.modificationTime;
 		}

http://git-wip-us.apache.org/repos/asf/flink/blob/3561222c/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/GenericWriteAheadSink.java
----------------------------------------------------------------------
diff --git a/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/GenericWriteAheadSink.java
b/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/GenericWriteAheadSink.java
index 370d021..291f892 100644
--- a/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/GenericWriteAheadSink.java
+++ b/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/GenericWriteAheadSink.java
@@ -303,7 +303,7 @@ public abstract class GenericWriteAheadSink<IN> extends AbstractStreamOperator<I
 
 		@Override
 		public boolean equals(Object o) {
-			if (o == null || !(o instanceof GenericWriteAheadSink.PendingCheckpoint)) {
+			if (!(o instanceof GenericWriteAheadSink.PendingCheckpoint)) {
 				return false;
 			}
 			PendingCheckpoint other = (PendingCheckpoint) o;


Mime
View raw message