Author: yradtsevich
Date: 2011-09-26 11:28:29 -0400 (Mon, 26 Sep 2011)
New Revision: 35046
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/VpeCustomStringStorage.java
Log:
- Added equals and hashCode methods to VpeCustomStringStorage
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/VpeCustomStringStorage.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/VpeCustomStringStorage.java 2011-09-26
14:39:13 UTC (rev 35045)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/custom/VpeCustomStringStorage.java 2011-09-26
15:28:29 UTC (rev 35046)
@@ -31,14 +31,17 @@
this.name = resourceName;
}
+ @Override
public InputStream getContents() throws CoreException {
return new ByteArrayInputStream(this.jarFileContent.getBytes());
}
+ @Override
public IPath getFullPath() {
return null;
}
+ @Override
public String getName() {
return this.name;
}
@@ -50,12 +53,52 @@
return this.jarFileContent;
}
+ @Override
public boolean isReadOnly() {
return true;
}
+ @Override
public Object getAdapter(Class adapter) {
return null;
}
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + (jarFileContent == null ? 0 : jarFileContent.hashCode());
+ result = prime * result + (name == null ? 0 : name.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ VpeCustomStringStorage other = (VpeCustomStringStorage) obj;
+ if (jarFileContent == null) {
+ if (other.jarFileContent != null) {
+ return false;
+ }
+ } else if (!jarFileContent.equals(other.jarFileContent)) {
+ return false;
+ }
+ if (name == null) {
+ if (other.name != null) {
+ return false;
+ }
+ } else if (!name.equals(other.name)) {
+ return false;
+ }
+ return true;
+ }
}
Show replies by date