test_class.file: flink-java/src/test/java/org/apache/flink/api/java/sca/UdfAnalyzerTest.java
test_class.identifier: UdfAnalyzerTest
test_case.body: @Test
  	public void testFilterModificationException1() {
  		try {
  			final UdfAnalyzer ua = new UdfAnalyzer(FilterFunction.class, FilterMod1.class, "operator",
  					TypeInfoParser.parse("Tuple2<String, String>"), null, null, null, null, true);
  			ua.analyze();
  			Assert.fail();
  		}
  		catch (CodeErrorException e) {
  			// ok
  		}
  	}
test_case.class_method_signature: UdfAnalyzerTest.testFilterModificationException1()
test_case.full_signature: @Test public void testFilterModificationException1()
test_case.identifier: testFilterModificationException1
test_case.invocations: parse analyze fail
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFilterModificationException1()
focal_class.declarator: MAX_NESTING = 20
focal_class.modifier: private static final
focal_class.original_string: private static final int MAX_NESTING = 20;
focal_class.type: int
focal_class.var_name: MAX_NESTING
focal_class.declarator: baseClassMethod
focal_class.modifier: private final
focal_class.original_string: private final Method baseClassMethod;
focal_class.type: Method
focal_class.var_name: baseClassMethod
focal_class.declarator: hasCollector
focal_class.modifier: private final
focal_class.original_string: private final boolean hasCollector;
focal_class.type: boolean
focal_class.var_name: hasCollector
focal_class.declarator: isBinary
focal_class.modifier: private final
focal_class.original_string: private final boolean isBinary;
focal_class.type: boolean
focal_class.var_name: isBinary
focal_class.declarator: isIterableInput
focal_class.modifier: private final
focal_class.original_string: private final boolean isIterableInput;
focal_class.type: boolean
focal_class.var_name: isIterableInput
focal_class.declarator: isReduceFunction
focal_class.modifier: private final
focal_class.original_string: private final boolean isReduceFunction;
focal_class.type: boolean
focal_class.var_name: isReduceFunction
focal_class.declarator: isFilterFunction
focal_class.modifier: private final
focal_class.original_string: private final boolean isFilterFunction;
focal_class.type: boolean
focal_class.var_name: isFilterFunction
focal_class.declarator: udfClass
focal_class.modifier: private final
focal_class.original_string: private final Class<?> udfClass;
focal_class.type: Class<?>
focal_class.var_name: udfClass
focal_class.declarator: externalUdfName
focal_class.modifier: private final
focal_class.original_string: private final String externalUdfName;
focal_class.type: String
focal_class.var_name: externalUdfName
focal_class.declarator: internalUdfClassName
focal_class.modifier: private final
focal_class.original_string: private final String internalUdfClassName;
focal_class.type: String
focal_class.var_name: internalUdfClassName
focal_class.declarator: in1Type
focal_class.modifier: private final
focal_class.original_string: private final TypeInformation<?> in1Type;
focal_class.type: TypeInformation<?>
focal_class.var_name: in1Type
focal_class.declarator: in2Type
focal_class.modifier: private final
focal_class.original_string: private final TypeInformation<?> in2Type;
focal_class.type: TypeInformation<?>
focal_class.var_name: in2Type
focal_class.declarator: outType
focal_class.modifier: private final
focal_class.original_string: private final TypeInformation<?> outType;
focal_class.type: TypeInformation<?>
focal_class.var_name: outType
focal_class.declarator: keys1
focal_class.modifier: private final
focal_class.original_string: private final Keys<?> keys1;
focal_class.type: Keys<?>
focal_class.var_name: keys1
focal_class.declarator: keys2
focal_class.modifier: private final
focal_class.original_string: private final Keys<?> keys2;
focal_class.type: Keys<?>
focal_class.var_name: keys2
focal_class.declarator: throwErrorExceptions
focal_class.modifier: private final
focal_class.original_string: private final boolean throwErrorExceptions;
focal_class.type: boolean
focal_class.var_name: throwErrorExceptions
focal_class.declarator: collectorValues
focal_class.modifier: private final
focal_class.original_string: private final List<TaggedValue> collectorValues;
focal_class.type: List<TaggedValue>
focal_class.var_name: collectorValues
focal_class.declarator: hints
focal_class.modifier: private final
focal_class.original_string: private final List<String> hints;
focal_class.type: List<String>
focal_class.var_name: hints
focal_class.declarator: warning = false
focal_class.modifier: private
focal_class.original_string: private boolean warning = false;
focal_class.type: boolean
focal_class.var_name: warning
focal_class.declarator: state = STATE_CAPTURE_RETURN
focal_class.modifier: private
focal_class.original_string: private int state = STATE_CAPTURE_RETURN;
focal_class.type: int
focal_class.var_name: state
focal_class.declarator: STATE_CAPTURE_RETURN = 0
focal_class.modifier: static final
focal_class.original_string: static final int STATE_CAPTURE_RETURN = 0;
focal_class.type: int
focal_class.var_name: STATE_CAPTURE_RETURN
focal_class.declarator: STATE_CAPTURE_THIS = 1
focal_class.modifier: static final
focal_class.original_string: static final int STATE_CAPTURE_THIS = 1;
focal_class.type: int
focal_class.var_name: STATE_CAPTURE_THIS
focal_class.declarator: STATE_CAPTURE_INPUT1 = 2
focal_class.modifier: static final
focal_class.original_string: static final int STATE_CAPTURE_INPUT1 = 2;
focal_class.type: int
focal_class.var_name: STATE_CAPTURE_INPUT1
focal_class.declarator: STATE_CAPTURE_INPUT2 = 3
focal_class.modifier: static final
focal_class.original_string: static final int STATE_CAPTURE_INPUT2 = 3;
focal_class.type: int
focal_class.var_name: STATE_CAPTURE_INPUT2
focal_class.declarator: STATE_CAPTURE_COLLECTOR = 4
focal_class.modifier: static final
focal_class.original_string: static final int STATE_CAPTURE_COLLECTOR = 4;
focal_class.type: int
focal_class.var_name: STATE_CAPTURE_COLLECTOR
focal_class.declarator: STATE_END_OF_CAPTURING = 5
focal_class.modifier: static final
focal_class.original_string: static final int STATE_END_OF_CAPTURING = 5;
focal_class.type: int
focal_class.var_name: STATE_END_OF_CAPTURING
focal_class.declarator: STATE_END_OF_ANALYZING = 6
focal_class.modifier: static final
focal_class.original_string: static final int STATE_END_OF_ANALYZING = 6;
focal_class.type: int
focal_class.var_name: STATE_END_OF_ANALYZING
focal_class.declarator: iteratorTrueAssumptionApplied
focal_class.modifier: private
focal_class.original_string: private boolean iteratorTrueAssumptionApplied;
focal_class.type: boolean
focal_class.var_name: iteratorTrueAssumptionApplied
focal_class.declarator: returnValue
focal_class.modifier: private
focal_class.original_string: private TaggedValue returnValue;
focal_class.type: TaggedValue
focal_class.var_name: returnValue
focal_class.declarator: newOperationCounterOverall
focal_class.modifier: private
focal_class.original_string: private int newOperationCounterOverall;
focal_class.type: int
focal_class.var_name: newOperationCounterOverall
focal_class.declarator: newOperationCounterTopLevel
focal_class.modifier: private
focal_class.original_string: private int newOperationCounterTopLevel;
focal_class.type: int
focal_class.var_name: newOperationCounterTopLevel
focal_class.declarator: filterInputCopy
focal_class.modifier: private
focal_class.original_string: private TaggedValue filterInputCopy;
focal_class.type: TaggedValue
focal_class.var_name: filterInputCopy
focal_class.declarator: filterInputRef
focal_class.modifier: private
focal_class.original_string: private TaggedValue filterInputRef;
focal_class.type: TaggedValue
focal_class.var_name: filterInputRef
focal_class.file: flink-java/src/main/java/org/apache/flink/api/java/sca/UdfAnalyzer.java
focal_class.identifier: UdfAnalyzer
focal_class.class_method_signature: UdfAnalyzer.UdfAnalyzer(Class<?> baseClass, Class<?> udfClass, String externalUdfName,
  			TypeInformation<?> in1Type, TypeInformation<?> in2Type,
  			TypeInformation<?> outType, Keys<?> keys1, Keys<?> keys2,
  			boolean throwErrorExceptions)
focal_class.full_signature: public  UdfAnalyzer(Class<?> baseClass, Class<?> udfClass, String externalUdfName,
  			TypeInformation<?> in1Type, TypeInformation<?> in2Type,
  			TypeInformation<?> outType, Keys<?> keys1, Keys<?> keys2,
  			boolean throwErrorExceptions)
focal_class.identifier: UdfAnalyzer
focal_class.modifiers: public
focal_class.parameters: (Class<?> baseClass, Class<?> udfClass, String externalUdfName,
  			TypeInformation<?> in1Type, TypeInformation<?> in2Type,
  			TypeInformation<?> outType, Keys<?> keys1, Keys<?> keys2,
  			boolean throwErrorExceptions)
focal_class.signature:  UdfAnalyzer(Class<?> baseClass, Class<?> udfClass, String externalUdfName,
  			TypeInformation<?> in1Type, TypeInformation<?> in2Type,
  			TypeInformation<?> outType, Keys<?> keys1, Keys<?> keys2,
  			boolean throwErrorExceptions)
focal_class.class_method_signature: UdfAnalyzer.getState()
focal_class.full_signature: public int getState()
focal_class.identifier: getState
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getState()
focal_class.class_method_signature: UdfAnalyzer.setState(int state)
focal_class.full_signature: public void setState(int state)
focal_class.identifier: setState
focal_class.modifiers: public
focal_class.parameters: (int state)
focal_class.return: void
focal_class.signature: void setState(int state)
focal_class.class_method_signature: UdfAnalyzer.isUdfBinary()
focal_class.full_signature: public boolean isUdfBinary()
focal_class.identifier: isUdfBinary
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isUdfBinary()
focal_class.class_method_signature: UdfAnalyzer.isIteratorTrueAssumptionApplied()
focal_class.full_signature: public boolean isIteratorTrueAssumptionApplied()
focal_class.identifier: isIteratorTrueAssumptionApplied
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isIteratorTrueAssumptionApplied()
focal_class.class_method_signature: UdfAnalyzer.applyIteratorTrueAssumption()
focal_class.full_signature: public void applyIteratorTrueAssumption()
focal_class.identifier: applyIteratorTrueAssumption
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void applyIteratorTrueAssumption()
focal_class.class_method_signature: UdfAnalyzer.incrNewOperationCounters(boolean topLevel)
focal_class.full_signature: public void incrNewOperationCounters(boolean topLevel)
focal_class.identifier: incrNewOperationCounters
focal_class.modifiers: public
focal_class.parameters: (boolean topLevel)
focal_class.return: void
focal_class.signature: void incrNewOperationCounters(boolean topLevel)
focal_class.class_method_signature: UdfAnalyzer.hasUdfCollector()
focal_class.full_signature: public boolean hasUdfCollector()
focal_class.identifier: hasUdfCollector
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean hasUdfCollector()
focal_class.class_method_signature: UdfAnalyzer.hasUdfIterableInput()
focal_class.full_signature: public boolean hasUdfIterableInput()
focal_class.identifier: hasUdfIterableInput
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean hasUdfIterableInput()
focal_class.class_method_signature: UdfAnalyzer.isUdfReduceFunction()
focal_class.full_signature: public boolean isUdfReduceFunction()
focal_class.identifier: isUdfReduceFunction
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean isUdfReduceFunction()
focal_class.class_method_signature: UdfAnalyzer.getInternalUdfClassName()
focal_class.full_signature: public String getInternalUdfClassName()
focal_class.identifier: getInternalUdfClassName
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getInternalUdfClassName()
focal_class.class_method_signature: UdfAnalyzer.getCollectorValues()
focal_class.full_signature: public List<TaggedValue> getCollectorValues()
focal_class.identifier: getCollectorValues
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<TaggedValue>
focal_class.signature: List<TaggedValue> getCollectorValues()
focal_class.class_method_signature: UdfAnalyzer.analyze()
focal_class.full_signature: public boolean analyze()
focal_class.identifier: analyze
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean analyze()
focal_class.class_method_signature: UdfAnalyzer.getSemanticProperties()
focal_class.full_signature: public SemanticProperties getSemanticProperties()
focal_class.identifier: getSemanticProperties
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: SemanticProperties
focal_class.signature: SemanticProperties getSemanticProperties()
focal_class.class_method_signature: UdfAnalyzer.addSemanticPropertiesHints()
focal_class.full_signature: public void addSemanticPropertiesHints()
focal_class.identifier: addSemanticPropertiesHints
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void addSemanticPropertiesHints()
focal_class.class_method_signature: UdfAnalyzer.printToLogger(Logger log)
focal_class.full_signature: public void printToLogger(Logger log)
focal_class.identifier: printToLogger
focal_class.modifiers: public
focal_class.parameters: (Logger log)
focal_class.return: void
focal_class.signature: void printToLogger(Logger log)
focal_class.class_method_signature: UdfAnalyzer.getInput1AsTaggedValue()
focal_class.full_signature: public TaggedValue getInput1AsTaggedValue()
focal_class.identifier: getInput1AsTaggedValue
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: TaggedValue
focal_class.signature: TaggedValue getInput1AsTaggedValue()
focal_class.class_method_signature: UdfAnalyzer.getInput2AsTaggedValue()
focal_class.full_signature: public TaggedValue getInput2AsTaggedValue()
focal_class.identifier: getInput2AsTaggedValue
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: TaggedValue
focal_class.signature: TaggedValue getInput2AsTaggedValue()
focal_class.class_method_signature: UdfAnalyzer.addHintOrThrowException(String msg)
focal_class.full_signature: private void addHintOrThrowException(String msg)
focal_class.identifier: addHintOrThrowException
focal_class.modifiers: private
focal_class.parameters: (String msg)
focal_class.return: void
focal_class.signature: void addHintOrThrowException(String msg)
focal_class.class_method_signature: UdfAnalyzer.handleNullReturn()
focal_class.full_signature: public void handleNullReturn()
focal_class.identifier: handleNullReturn
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void handleNullReturn()
focal_class.class_method_signature: UdfAnalyzer.handlePutStatic()
focal_class.full_signature: public void handlePutStatic()
focal_class.identifier: handlePutStatic
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void handlePutStatic()
focal_class.class_method_signature: UdfAnalyzer.handleInvalidTupleAccess()
focal_class.full_signature: public void handleInvalidTupleAccess()
focal_class.identifier: handleInvalidTupleAccess
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void handleInvalidTupleAccess()
focal_method.body: public boolean analyze() throws CodeAnalyzerException {
  		if (state == STATE_END_OF_ANALYZING) {
  			throw new IllegalStateException("Analyzing is already done.");
  		}
  		
  		boolean discardReturnValues = false;
  
  		if (isIterableInput) {
  			if (keys1 == null || (keys2 == null && isBinary)) {
  				throw new IllegalArgumentException("This type of function requires key information for analysis.");
  			}
  			else if (!(keys1 instanceof ExpressionKeys) || (!(keys2 instanceof ExpressionKeys) && isBinary)) {
  				// TODO currently only ExpressionKeys are supported as keys
  				discardReturnValues = true;
  			}
  		}
  
  		try {
  			final Object[] mn = findMethodNode(internalUdfClassName, baseClassMethod);
  			final NestedMethodAnalyzer nma = new NestedMethodAnalyzer(this, (String) mn[1],
  					(MethodNode) mn[0], null, MAX_NESTING, true);
  			final TaggedValue result = nma.analyze();
  			setState(STATE_END_OF_ANALYZING);
  
  			// special case: FilterFunction
  			if (isFilterFunction) {
  				discardReturnValues = true;
  				// check for input modification
  				if (!filterInputCopy.equals(filterInputRef)) {
  					addHintOrThrowException("Function modifies the input. This can lead to unexpected behaviour during runtime.");
  				}
  			}
  
  			if (!discardReturnValues) {
  				// merge return values of a collector
  				if (hasCollector) {
  					returnValue = mergeReturnValues(collectorValues);
  				}
  				else {
  					returnValue = result;
  				}
  				// remove ungrouped inputs from result if UDF has iterators
  				// or is a reduce function
  				if ((isIterableInput || isReduceFunction) && returnValue != null) {
  					if (returnValue.canContainFields()) {
  						removeUngroupedInputsFromContainer(returnValue);
  					}
  					else if (returnValue.isInput() && !returnValue.isGrouped()) {
  						returnValue = null;
  					}
  				}
  			}
  			// any return value is invalid
  			else {
  				returnValue = null;
  			}
  		}
  		catch (Exception e) {
  			Throwable cause = e.getCause();
  			while (cause != null && !(cause instanceof CodeErrorException)) {
  				cause = cause.getCause();
  			}
  			if ((cause != null && 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" +
  						" @SkipCodeAnalysis to your function to disable the analysis.",
  						(cause != null)? cause : e);
  			}
  			throw new CodeAnalyzerException("Exception occurred during code analysis.", e);
  		}
  		return true;
  	}
focal_method.class_method_signature: UdfAnalyzer.analyze()
focal_method.full_signature: public boolean analyze()
focal_method.identifier: analyze
focal_method.invocations: findMethodNode analyze setState equals addHintOrThrowException mergeReturnValues canContainFields removeUngroupedInputsFromContainer isInput isGrouped getCause getCause
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: boolean
focal_method.signature: boolean analyze()