Author: akazakov
Date: 2007-07-10 06:52:37 -0400 (Tue, 10 Jul 2007)
New Revision: 2364
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java
Log:
http://jira.jboss.com/jira/browse/EXIN-327
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java 2007-07-10
10:37:43 UTC (rev 2363)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java 2007-07-10
10:52:37 UTC (rev 2364)
@@ -169,20 +169,20 @@
// Mark nonunique name.
if(!markedDeclarations.contains(checkedDeclaration)) {
// Mark first wrong declaration with that name
- ISeamTextSourceReference target =
((SeamComponentDeclaration)checkedDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
- addError(NONUNIQUE_COMPONENT_NAME_MESSAGE_ID, target,
NONUNIQUE_NAME_MESSAGE_GROUP);
+ IResource checkedDeclarationResource = checkedDeclaration.getResource();
+ ISeamTextSourceReference location =
((SeamComponentDeclaration)checkedDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
+ addError(NONUNIQUE_COMPONENT_NAME_MESSAGE_ID, location,
checkedDeclarationResource, NONUNIQUE_NAME_MESSAGE_GROUP);
markedDeclarations.add(checkedDeclaration);
- validationContext.addLinkedResource(checkedDeclaration.getName(),
checkedDeclaration.getResource().getLocation());
+ validationContext.addLinkedResource(checkedDeclaration.getName(),
checkedDeclarationResource.getLocation());
}
// Mark next wrong declaration with that name
markedDeclarations.add(javaDeclaration);
validationContext.addLinkedResource(javaDeclaration.getName(),
javaDeclaration.getResource().getLocation());
- ISeamTextSourceReference target =
((SeamComponentDeclaration)javaDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
- addError(NONUNIQUE_COMPONENT_NAME_MESSAGE_ID, target,
NONUNIQUE_NAME_MESSAGE_GROUP);
+ ISeamTextSourceReference location =
((SeamComponentDeclaration)javaDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
+ addError(NONUNIQUE_COMPONENT_NAME_MESSAGE_ID, location, javaDeclarationResource,
NONUNIQUE_NAME_MESSAGE_GROUP);
}
}
}
}
}
-
}
\ No newline at end of file
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java 2007-07-10
10:37:43 UTC (rev 2363)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java 2007-07-10
10:52:37 UTC (rev 2364)
@@ -53,15 +53,15 @@
return "org.jboss.tools.seam.internal.core.validation.messages";
}
- protected void addError(String messageId, String[] messageArguments,
ISeamTextSourceReference target, String messageGroup) {
- IMessage message = new Message(getBaseName(), IMessage.HIGH_SEVERITY, messageId,
messageArguments, target.getResource(), messageGroup);
- message.setLength(target.getLength());
- message.setOffset(target.getStartPosition());
+ protected void addError(String messageId, String[] messageArguments,
ISeamTextSourceReference location, IResource target, String messageGroup) {
+ IMessage message = new Message(getBaseName(), IMessage.HIGH_SEVERITY, messageId,
messageArguments, target, messageGroup);
+ message.setLength(location.getLength());
+ message.setOffset(location.getStartPosition());
reporter.addMessage(this, message);
}
- protected void addError(String messageId, ISeamTextSourceReference target, String
messageGroup) {
- addError(messageId, new String[0], target, messageGroup);
+ protected void addError(String messageId, ISeamTextSourceReference location, IResource
target, String messageGroup) {
+ addError(messageId, new String[0], location, target, messageGroup);
}
protected void removeMessagesFromResources(Set<IResource> resources, String
messageGroup) {