Browse Source

Add 'isNull' (#2172)

Rene Beckmann 7 years ago
parent
commit
4ce8739ddf

+ 6 - 2
plugins/org.yakindu.base.types/src/org/yakindu/base/types/validation/TypeValidator.java

@@ -6,7 +6,7 @@
  * http://www.eclipse.org/legal/epl-v10.html
  * Contributors:
  * 	committers of YAKINDU - initial API and implementation
- * 
+ *
  */
 package org.yakindu.base.types.validation;
 
@@ -118,7 +118,11 @@ public class TypeValidator {
 
 	public boolean isNullOnComplexType(InferenceResult result1, InferenceResult result2) {
 		return result1.getType() instanceof ComplexType
-				&& registry.isSame(result2.getType(), registry.getType(ITypeSystem.NULL));
+				&& isNull(result2);
+	}
+
+	protected boolean isNull(InferenceResult result) {
+		return registry.isSame(result.getType(), registry.getType(ITypeSystem.NULL));
 	}
 
 	protected boolean isAnyType(Type type) {