[ https://issues.apache.org/jira/browse/MAILBOX-43?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Felix Knecht closed MAILBOX-43. ------------------------------- Resolution: Fixed Fix Version/s: 0.2 Use equals instead of == > Review if equals or == should be used > ------------------------------------- > > Key: MAILBOX-43 > URL: https://issues.apache.org/jira/browse/MAILBOX-43 > Project: James Mailbox > Issue Type: Bug > Affects Versions: 0.2 > Environment: all > Reporter: Felix Knecht > Assignee: Norman Maurer > Fix For: 0.2 > > > Is it really correct to compare references and not values in following > places? Note that this are mostly either String or Long or Integer. > I'm sure there are more. I guess that all these kinds of 'equals' should not > compare reference but value. > e.g. JCRHeader.java, compares references instead values. > ... > private String fieldName; > private String value; > public boolean equals(Object obj) { > if (this == obj) > return true; > if (obj == null) > return false; > if (getClass() != obj.getClass()) > return false; > final JCRHeader other = (JCRHeader) obj; > if (getValue() != other.getValue() || getFieldName() != > other.getFieldName()) > return false; > return true; > } -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org