Code Duplication    Length = 27-27 lines in 2 locations

src/main/java/it/cnr/istc/pst/platinum/ai/framework/microkernel/resolver/timeline/behavior/planning/TimelineBehaviorPlanningResolver.java 2 locations

@@ 406-432 (lines=27) @@
403
								transition.add(solution.getLeftDecision());
404
									
405
								// intermediate values and related relations can be activated since no synchronization is entailed
406
								for (ComponentValue value : solution.getPath()) 
407
								{
408
									// create parameters' labels
409
									String[] labels = new String[value.getNumberOfParameterPlaceHolders()];
410
									for (int index = 0; index < labels.length; index++) {
411
										// set parameter label
412
										labels[index] = "label-" + index;
413
									}
414
									
415
									// create pending decision
416
									Decision dec = this.component.create(value, labels);
417
									// these decisions can be set as mandatory expansion
418
									dec.setMandatoryExpansion();
419
									// add created decision to transition
420
									transition.add(dec);
421
									// add pending decision
422
									solution.addCreatedDecision(dec);
423
424
									// activate the decision if possible
425
									if (!value.isComplex()) {
426
										
427
										// activated decision
428
										Set<Relation> list = this.component.activate(dec);
429
										// add activated decisions
430
										solution.addActivatedDecision(dec);
431
										// add activated relations
432
										solution.addActivatedRelations(list);
433
									}
434
								}
435
									
@@ 143-169 (lines=27) @@
140
			try {
141
				
142
				// intermediate values and related relations can be activated since no synchronization is entailed
143
				for (ComponentValue value : completion.getPath()) 
144
				{
145
					// create parameters' labels
146
					String[] labels = new String[value.getNumberOfParameterPlaceHolders()];
147
					for (int index = 0; index < labels.length; index++) {
148
						// set parameter label
149
						labels[index] = "label-" + index;
150
					}
151
					
152
					// create pending decision
153
					Decision dec = this.component.create(value, labels);
154
					// these decisions can be set as mandatory expansion
155
					dec.setMandatoryExpansion();
156
					// add created decision to transition
157
					transition.add(dec);
158
					// add pending decision
159
					solution.addCreatedDecision(dec);
160
161
					// activate the decision if possible
162
					if (!value.isComplex()) {
163
						
164
						// activated decision
165
						Set<Relation> list = this.component.activate(dec);
166
						// add activated decisions
167
						solution.addActivatedDecision(dec);
168
						// add activated relations
169
						solution.addActivatedRelations(list);
170
					}
171
				}
172