You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Marshall Schor (JIRA)" <ui...@incubator.apache.org> on 2007/01/02 20:34:27 UTC
[jira] Created: (UIMA-149) Cloning may fail for subclasses of
ResultSpecification
Cloning may fail for subclasses of ResultSpecification
------------------------------------------------------
Key: UIMA-149
URL: http://issues.apache.org/jira/browse/UIMA-149
Project: UIMA
Issue Type: Improvement
Reporter: Marshall Schor
Priority: Minor
Findbugs found this problem, and says: clone method does not call super.clone()
This non-final class defines a clone() method that does not call super.clone(). If this class ("A") is extended by a subclass ("B"), and the subclass B calls super.clone(), then it is likely that B's clone() method will return an object of type A, which violates the standard contract for clone().
If all clone() methods call super.clone(), then they are guaranteed to use Object.clone(), which always returns an object of the correct type.
Solution could be to mark this class "final" if we don't want users to extend it.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Closed: (UIMA-149) Cloning may fail for subclasses of
ResultSpecification
Posted by "Adam Lally (JIRA)" <ui...@incubator.apache.org>.
[ https://issues.apache.org/jira/browse/UIMA-149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adam Lally closed UIMA-149.
---------------------------
Resolution: Fixed
Fix Version/s: 2.1
changed class to be final
> Cloning may fail for subclasses of ResultSpecification
> ------------------------------------------------------
>
> Key: UIMA-149
> URL: https://issues.apache.org/jira/browse/UIMA-149
> Project: UIMA
> Issue Type: Improvement
> Reporter: Marshall Schor
> Assigned To: Adam Lally
> Priority: Minor
> Fix For: 2.1
>
>
> Findbugs found this problem, and says: clone method does not call super.clone()
> This non-final class defines a clone() method that does not call super.clone(). If this class ("A") is extended by a subclass ("B"), and the subclass B calls super.clone(), then it is likely that B's clone() method will return an object of type A, which violates the standard contract for clone().
> If all clone() methods call super.clone(), then they are guaranteed to use Object.clone(), which always returns an object of the correct type.
> Solution could be to mark this class "final" if we don't want users to extend it.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Assigned: (UIMA-149) Cloning may fail for subclasses of
ResultSpecification
Posted by "Marshall Schor (JIRA)" <ui...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/UIMA-149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Marshall Schor reassigned UIMA-149:
-----------------------------------
Assignee: Adam Lally
> Cloning may fail for subclasses of ResultSpecification
> ------------------------------------------------------
>
> Key: UIMA-149
> URL: http://issues.apache.org/jira/browse/UIMA-149
> Project: UIMA
> Issue Type: Improvement
> Reporter: Marshall Schor
> Assigned To: Adam Lally
> Priority: Minor
>
> Findbugs found this problem, and says: clone method does not call super.clone()
> This non-final class defines a clone() method that does not call super.clone(). If this class ("A") is extended by a subclass ("B"), and the subclass B calls super.clone(), then it is likely that B's clone() method will return an object of type A, which violates the standard contract for clone().
> If all clone() methods call super.clone(), then they are guaranteed to use Object.clone(), which always returns an object of the correct type.
> Solution could be to mark this class "final" if we don't want users to extend it.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira