Code Duplication    Length = 21-22 lines in 2 locations

src/main/java/it/cnr/istc/pst/platinum/ai/executive/pdb/ExecutivePlanDataBase.java 2 locations

@@ 941-962 (lines=22) @@
938
	 * @param end
939
	 * @throws TemporalConstraintPropagationException
940
	 */
941
	public void scheduleEndTime(ExecutionNode node, long time) 
942
			throws TemporalConstraintPropagationException {
943
		
944
		// create constraint
945
		FixTimePointConstraint fix = this.facade.
946
				createTemporalConstraint(TemporalConstraintType.FIX_TIME_POINT);
947
		// set time point
948
		fix.setReference(node.getInterval().getEndTime());
949
		// set time
950
		fix.setTime(time);
951
		// propagate constraint
952
		this.facade.propagate(fix);
953
		try {
954
			
955
			// check consistency of the resulting network
956
			this.facade.verifyTemporalConsistency();
957
			
958
		} catch (TemporalConsistencyException ex) {
959
			// retract propagated constraint and throw exception
960
			this.facade.retract(fix);
961
			throw new TemporalConstraintPropagationException("Error while propagating end constraint for node\n"
962
					+ "- time= " + time+ "\n- node= " + node + "\n");
963
		}
964
	}
965
	
@@ 911-931 (lines=21) @@
908
	 * @param time
909
	 * @throws TemporalConstraintPropagationException
910
	 */
911
	public final void scheduleStartTime(ExecutionNode node, long time) 
912
			throws TemporalConstraintPropagationException {
913
		
914
		// create constraint
915
		FixTimePointConstraint fix = this.facade.
916
				createTemporalConstraint(TemporalConstraintType.FIX_TIME_POINT);
917
		// set time point
918
		fix.setReference(node.getInterval().getStartTime());
919
		fix.setTime(time);
920
		// propagate constraint
921
		this.facade.propagate(fix);
922
		try {
923
			
924
			// check consistency of the resulting network
925
			this.facade.verifyTemporalConsistency();
926
			
927
		} catch (TemporalConsistencyException ex) {
928
			// retract propagated constraint and throw exception
929
			this.facade.retract(fix);
930
			throw new TemporalConstraintPropagationException("Error while propagating start constraint for node\n- "
931
					+ "time= " + time+ "\n- node= " + node + "\n");
932
		}
933
	}
934