Code Duplication    Length = 21-22 lines in 2 locations

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

@@ 1049-1070 (lines=22) @@
1046
	 * @param end
1047
	 * @throws TemporalConstraintPropagationException
1048
	 */
1049
	public void scheduleEndTime(ExecutionNode node, long time) 
1050
			throws TemporalConstraintPropagationException {
1051
		
1052
		// create constraint
1053
		FixTimePointConstraint fix = this.facade.
1054
				createTemporalConstraint(TemporalConstraintType.FIX_TIME_POINT);
1055
		// set time point
1056
		fix.setReference(node.getInterval().getEndTime());
1057
		// set time
1058
		fix.setTime(time);
1059
		// propagate constraint
1060
		this.facade.propagate(fix);
1061
		try {
1062
			
1063
			// check consistency of the resulting network
1064
			this.facade.verifyTemporalConsistency();
1065
			
1066
		} catch (TemporalConsistencyException ex) {
1067
			// retract propagated constraint and throw exception
1068
			this.facade.retract(fix);
1069
			throw new TemporalConstraintPropagationException("Error while propagating end constraint for node\n"
1070
					+ "- time= " + time+ "\n- node= " + node + "\n");
1071
		}
1072
	}
1073
	
@@ 1019-1039 (lines=21) @@
1016
	 * @param time
1017
	 * @throws TemporalConstraintPropagationException
1018
	 */
1019
	public final void scheduleStartTime(ExecutionNode node, long time) 
1020
			throws TemporalConstraintPropagationException {
1021
		
1022
		// create constraint
1023
		FixTimePointConstraint fix = this.facade.
1024
				createTemporalConstraint(TemporalConstraintType.FIX_TIME_POINT);
1025
		// set time point
1026
		fix.setReference(node.getInterval().getStartTime());
1027
		fix.setTime(time);
1028
		// propagate constraint
1029
		this.facade.propagate(fix);
1030
		try {
1031
			
1032
			// check consistency of the resulting network
1033
			this.facade.verifyTemporalConsistency();
1034
			
1035
		} catch (TemporalConsistencyException ex) {
1036
			// retract propagated constraint and throw exception
1037
			this.facade.retract(fix);
1038
			throw new TemporalConstraintPropagationException("Error while propagating start constraint for node\n- "
1039
					+ "time= " + time+ "\n- node= " + node + "\n");
1040
		}
1041
	}
1042