Code Duplication    Length = 21-22 lines in 2 locations

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

@@ 1030-1051 (lines=22) @@
1027
	 * @param end
1028
	 * @throws TemporalConstraintPropagationException
1029
	 */
1030
	public void scheduleEndTime(ExecutionNode node, long time) 
1031
			throws TemporalConstraintPropagationException {
1032
		
1033
		// create constraint
1034
		FixTimePointConstraint fix = this.facade.
1035
				createTemporalConstraint(TemporalConstraintType.FIX_TIME_POINT);
1036
		// set time point
1037
		fix.setReference(node.getInterval().getEndTime());
1038
		// set time
1039
		fix.setTime(time);
1040
		// propagate constraint
1041
		this.facade.propagate(fix);
1042
		try {
1043
			
1044
			// check consistency of the resulting network
1045
			this.facade.verifyTemporalConsistency();
1046
			
1047
		} catch (TemporalConsistencyException ex) {
1048
			// retract propagated constraint and throw exception
1049
			this.facade.retract(fix);
1050
			throw new TemporalConstraintPropagationException("Error while propagating end constraint for node\n"
1051
					+ "- time= " + time+ "\n- node= " + node + "\n");
1052
		}
1053
	}
1054
	
@@ 1000-1020 (lines=21) @@
997
	 * @param time
998
	 * @throws TemporalConstraintPropagationException
999
	 */
1000
	public final void scheduleStartTime(ExecutionNode node, long time) 
1001
			throws TemporalConstraintPropagationException {
1002
		
1003
		// create constraint
1004
		FixTimePointConstraint fix = this.facade.
1005
				createTemporalConstraint(TemporalConstraintType.FIX_TIME_POINT);
1006
		// set time point
1007
		fix.setReference(node.getInterval().getStartTime());
1008
		fix.setTime(time);
1009
		// propagate constraint
1010
		this.facade.propagate(fix);
1011
		try {
1012
			
1013
			// check consistency of the resulting network
1014
			this.facade.verifyTemporalConsistency();
1015
			
1016
		} catch (TemporalConsistencyException ex) {
1017
			// retract propagated constraint and throw exception
1018
			this.facade.retract(fix);
1019
			throw new TemporalConstraintPropagationException("Error while propagating start constraint for node\n- "
1020
					+ "time= " + time+ "\n- node= " + node + "\n");
1021
		}
1022
	}
1023