Projects >> JDEECo >>09ebe8558c52bfb1775bce2df75e9073a2f235b3

Chunk
Conflicting content
			throws KnowledgeNotFoundException {
		final ValueSet result = new ValueSet();
		Object value;
<<<<<<< HEAD
		// Go through all knowledge paths and retrive data for each path
		for (final KnowledgePath knowledgePath : knowledgePaths) {
			// Retrieve data for the knowledge path
			value = getKnowledge(knowledgePath.getNodes());
			// In case when the root knowledge is referenced, then return
			// entries for the first level of nesting.
			if (knowledge.equals(value)) {
				for (final KnowledgePath rootKP : knowledge.keySet()) {
=======
		for (KnowledgePath kp : knowledgePaths) {
			try {				
				value = getKnowledge(kp.getNodes());
			} catch (KnowledgeNotFoundException knfe) {
				throw new KnowledgeNotFoundException(kp);
			}
			if (knowledge.equals(value))
				for (KnowledgePath rootKP : knowledge.keySet())
>>>>>>> cad43efc9a0cec98e0e595ffde0322b5b4e3a37c
					result.setValue(rootKP, knowledge.get(rootKP));
				}
			} else {
Solution content
			throws KnowledgeNotFoundException {
		final ValueSet result = new ValueSet();
		Object value;
		for (KnowledgePath kp : knowledgePaths) {
			try {				
				value = getKnowledge(kp.getNodes());
			} catch (KnowledgeNotFoundException knfe) {
				throw new KnowledgeNotFoundException(kp);
			}
			if (knowledge.equals(value))
				for (KnowledgePath rootKP : knowledge.keySet())
					result.setValue(rootKP, knowledge.get(rootKP));
File
BaseKnowledgeManager.java
Developer's decision
Version 2
Kind of conflict
Comment
For statement
If statement
Method invocation
Try statement
Variable
Chunk
Conflicting content
		// At the moment we consider only KnowledgeChangeListener as a
		// TriggerListener
		if (trigger instanceof KnowledgeChangeTrigger) {
<<<<<<< HEAD
			final KnowledgeChangeTrigger kct = (KnowledgeChangeTrigger) trigger;
			if (kcListeners.containsKey(kct)) {
				kcListeners.get(kct).remove(triggerListener);
=======
			KnowledgeChangeTrigger kt = ((KnowledgeChangeTrigger) trigger);
			if (knowledgeChangeListeners.containsKey(kt)) {
				knowledgeChangeListeners.get(kt).remove(triggerListener);
>>>>>>> cad43efc9a0cec98e0e595ffde0322b5b4e3a37c
			}
		}
	}
Solution content
		if (trigger instanceof KnowledgeChangeTrigger) {
			final KnowledgeChangeTrigger kct = (KnowledgeChangeTrigger) trigger;
			if (knowledgeChangeListeners.containsKey(kct)) {
				knowledgeChangeListeners.get(kct).remove(triggerListener);
			}
		}
	}
File
BaseKnowledgeManager.java
Developer's decision
Manual
Kind of conflict
Cast expression
If statement
Method invocation
Variable
Chunk
Conflicting content
			int endIndex = -1;
	 */
	protected Object getKnowledge(final List knowledgePath)
			throws KnowledgeNotFoundException {
<<<<<<< HEAD
		assert knowledgePath != null;
		Object result = null;
		// If the path points to root knowledge, then we should return the
		// reference knowledge
		if (knowledgePath.isEmpty()) {
			result = knowledge;
		} else {
			// Otherwise we should go through each knowledge entry, find the
			// partial path matching and try to retrieve the data from the
			// matched node in the knowledge
			for (final KnowledgePath kPath : knowledge.keySet()) {
				try {
					// Find partial matching of the path
					endIndex = containmentEndIndex(knowledgePath,
							kPath.getNodes());
					if (endIndex > -1) {
						// Retrieve data from the node
						result = getKnowledgeFromNode(knowledgePath.subList(
								endIndex + 1, knowledgePath.size()),
								knowledge.get(kPath));
						break;
					}
				} catch (KnowledgeNotFoundException knfe) {
					continue;
				}
			}
			if (endIndex < 0) {
				throw new KnowledgeNotFoundException();
=======
		assert (knowledgePath != null);
		if (knowledgePath.isEmpty())
			return knowledge;
		
		// handle ID separately
		if ((knowledgePath.size() == 1) && (knowledgePath.get(0) instanceof PathNodeComponentId))
			return id;
		
		int containmentEndIndex;
		for (KnowledgePath kp : knowledge.keySet()) {
			try {
				containmentEndIndex = containmentEndIndex(knowledgePath,
						kp.getNodes());
				if (containmentEndIndex > -1)
					return getKnowledgeFromNode(knowledgePath.subList(
							containmentEndIndex + 1, knowledgePath.size()),
							knowledge.get(kp));
			} catch (KnowledgeNotFoundException knfe) {
				continue;
>>>>>>> cad43efc9a0cec98e0e595ffde0322b5b4e3a37c
			}
		}
		return result;
Solution content
	 */
	protected Object getKnowledge(final List knowledgePath)
			throws KnowledgeNotFoundException {
		assert knowledgePath != null;
		Object result = null;
		// If the path points to root knowledge, then we should return the
		// reference knowledge
		if (knowledgePath.isEmpty()) {
			result = knowledge;
		} else {
		// handle ID separately
		if ((knowledgePath.size() == 1) && (knowledgePath.get(0) instanceof PathNodeComponentId))
			return id;
			// Otherwise we should go through each knowledge entry, find the
			// partial path matching and try to retrieve the data from the
			// matched node in the knowledge
			int endIndex = -1;
			for (final KnowledgePath kPath : knowledge.keySet()) {
				try {
					// Find partial matching of the path
					endIndex = containmentEndIndex(knowledgePath,
							kPath.getNodes());
					if (endIndex > -1) {
						// Retrieve data from the node
						result = getKnowledgeFromNode(knowledgePath.subList(
								endIndex + 1, knowledgePath.size()),
								knowledge.get(kPath));
						break;
					}
				} catch (KnowledgeNotFoundException knfe) {
					continue;
				}
			}
			if (endIndex < 0) {
				throw new KnowledgeNotFoundException();
			}
		}
		return result;
File
BaseKnowledgeManager.java
Developer's decision
Combination
Kind of conflict
Assert statement
Attribute
Catch clause
Comment
Continue statement
For statement
If statement
Method invocation
Throw statement
Try statement
Variable
Chunk
Conflicting content
				continue;
			}
		}
<<<<<<< HEAD
		// Now we need to go through collected parents and try to remove the
		// the objects from them.
		for (final Object p : parentsToPaths.keySet()) {
			keysToDelete = parentsToPaths.get(p);
=======
		for (Entry> entry : parentsToDeleteKeys.entrySet()) {
			Object p = entry.getKey();
			keysToDelete = entry.getValue();
>>>>>>> cad43efc9a0cec98e0e595ffde0322b5b4e3a37c
			// We need to sort the keys in order to start deleting from the end.
			// This is important for list consistency.
			Collections.sort(keysToDelete);
Solution content
				continue;
			}
		}
		// Now we need to go through collected parents and try to remove the
		// the objects from them.
		for (final Object p : parentsToPaths.keySet()) {
			keysToDelete = parentsToPaths.get(p);
			// We need to sort the keys in order to start deleting from the end.
			// This is important for list consistency.
			Collections.sort(keysToDelete);
File
BaseKnowledgeManager.java
Developer's decision
Version 1
Kind of conflict
Comment
Chunk
Conflicting content
		this.notFoundPath = notFoundPath;
	}

<<<<<<< HEAD
	private static final long serialVersionUID = 1L;

=======
	public KnowledgePath getNotFoundPath() {
		return notFoundPath;
	}
	
	
	
>>>>>>> cad43efc9a0cec98e0e595ffde0322b5b4e3a37c
}
Solution content
		this.notFoundPath = notFoundPath;
	}

	public KnowledgePath getNotFoundPath() {
		return notFoundPath;
	}
}
File
KnowledgeNotFoundException.java
Developer's decision
Version 2
Kind of conflict
Attribute
Method declaration