You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by "Sian January (JIRA)" <ji...@apache.org> on 2006/11/23 16:09:02 UTC

[jira] Created: (HARMONY-2286) [classlib] [luni] EnumSet.writeReplace() is never used

[classlib] [luni] EnumSet.writeReplace() is never used
------------------------------------------------------

                 Key: HARMONY-2286
                 URL: http://issues.apache.org/jira/browse/HARMONY-2286
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Sian January
            Priority: Minor


I have been looking at some of the bugs found by Melody and one of them is that there's an illegal cast in EnumSet.writeReplace() ("Impossible cast from java.lang.Object[] to java.lang.Enum[] in java.util.EnumSet.writeReplace()").  I realised that this method is never used.  All instances of EnumSet are subclasses (either MiniEnumSet or HugeEnumSet) and because writeReplace() has private visibility it is not used by subclasses when they are serialized.

On inspection I don't actually think the inner class EnumSet.SerializationProxy is needed - I think serialization should work for EnumSet without it because it doesn't seem to have any special behaviour.

-- 
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: (HARMONY-2286) [classlib] [luni] EnumSet.writeReplace() is never used

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2286?page=all ]

Tim Ellison closed HARMONY-2286.
--------------------------------


Verified by Sian.


> [classlib] [luni] EnumSet.writeReplace() is never used
> ------------------------------------------------------
>
>                 Key: HARMONY-2286
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2286
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Sian January
>         Assigned To: Tim Ellison
>            Priority: Minor
>         Attachments: lunipatch.txt, lunipatch_updated.txt
>
>
> I have been looking at some of the bugs found by Melody and one of them is that there's an illegal cast in EnumSet.writeReplace() ("Impossible cast from java.lang.Object[] to java.lang.Enum[] in java.util.EnumSet.writeReplace()").  I realised that this method is never used.  All instances of EnumSet are subclasses (either MiniEnumSet or HugeEnumSet) and because writeReplace() has private visibility it is not used by subclasses when they are serialized.
> On inspection I don't actually think the inner class EnumSet.SerializationProxy is needed - I think serialization should work for EnumSet without it because it doesn't seem to have any special behaviour.

-- 
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] Assigned: (HARMONY-2286) [classlib] [luni] EnumSet.writeReplace() is never used

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2286?page=all ]

Tim Ellison reassigned HARMONY-2286:
------------------------------------

    Assignee: Tim Ellison

> [classlib] [luni] EnumSet.writeReplace() is never used
> ------------------------------------------------------
>
>                 Key: HARMONY-2286
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2286
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Sian January
>         Assigned To: Tim Ellison
>            Priority: Minor
>         Attachments: lunipatch.txt, lunipatch_updated.txt
>
>
> I have been looking at some of the bugs found by Melody and one of them is that there's an illegal cast in EnumSet.writeReplace() ("Impossible cast from java.lang.Object[] to java.lang.Enum[] in java.util.EnumSet.writeReplace()").  I realised that this method is never used.  All instances of EnumSet are subclasses (either MiniEnumSet or HugeEnumSet) and because writeReplace() has private visibility it is not used by subclasses when they are serialized.
> On inspection I don't actually think the inner class EnumSet.SerializationProxy is needed - I think serialization should work for EnumSet without it because it doesn't seem to have any special behaviour.

-- 
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] Commented: (HARMONY-2286) [classlib] [luni] EnumSet.writeReplace() is never used

Posted by "spark shen (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2286?page=comments#action_12453637 ] 
            
spark shen commented on HARMONY-2286:
-------------------------------------

SerializationProxy is documented in spec 'serialization form'. So to keep serialization compatibility, this inner class is needed. 

> [classlib] [luni] EnumSet.writeReplace() is never used
> ------------------------------------------------------
>
>                 Key: HARMONY-2286
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2286
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Sian January
>            Priority: Minor
>         Attachments: lunipatch.txt
>
>
> I have been looking at some of the bugs found by Melody and one of them is that there's an illegal cast in EnumSet.writeReplace() ("Impossible cast from java.lang.Object[] to java.lang.Enum[] in java.util.EnumSet.writeReplace()").  I realised that this method is never used.  All instances of EnumSet are subclasses (either MiniEnumSet or HugeEnumSet) and because writeReplace() has private visibility it is not used by subclasses when they are serialized.
> On inspection I don't actually think the inner class EnumSet.SerializationProxy is needed - I think serialization should work for EnumSet without it because it doesn't seem to have any special behaviour.

-- 
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] Commented: (HARMONY-2286) [classlib] [luni] EnumSet.writeReplace() is never used

Posted by "spark shen (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2286?page=comments#action_12454525 ] 
            
spark shen commented on HARMONY-2286:
-------------------------------------

I cited the following paragraph:
<cite>

>>Class java.util.EnumSet.SerializationProxy extends Object implements Serializable 
>>serialVersionUID: 362491234563181265L 
>>Serialization Methods 
>>readResolve
>>private Object readResolve()Serialized Fields 
>>elementType
>>Class<T> elementTypeThe element type of this enum set. 
>>elements
>>Enum<E extends Enum<E>>[] elementsThe elements contained in this enum set.

<cite>

This paragraph lays below java.util.EnumMap->Serialized Form (It is odd that EnumSet does not provide a Serialized Form to link to this paragraph directly)

Best regards

> [classlib] [luni] EnumSet.writeReplace() is never used
> ------------------------------------------------------
>
>                 Key: HARMONY-2286
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2286
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Sian January
>            Priority: Minor
>         Attachments: lunipatch.txt
>
>
> I have been looking at some of the bugs found by Melody and one of them is that there's an illegal cast in EnumSet.writeReplace() ("Impossible cast from java.lang.Object[] to java.lang.Enum[] in java.util.EnumSet.writeReplace()").  I realised that this method is never used.  All instances of EnumSet are subclasses (either MiniEnumSet or HugeEnumSet) and because writeReplace() has private visibility it is not used by subclasses when they are serialized.
> On inspection I don't actually think the inner class EnumSet.SerializationProxy is needed - I think serialization should work for EnumSet without it because it doesn't seem to have any special behaviour.

-- 
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] Updated: (HARMONY-2286) [classlib] [luni] EnumSet.writeReplace() is never used

Posted by "Sian January (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2286?page=all ]

Sian January updated HARMONY-2286:
----------------------------------

    Patch Info: [Patch Available]

> [classlib] [luni] EnumSet.writeReplace() is never used
> ------------------------------------------------------
>
>                 Key: HARMONY-2286
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2286
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Sian January
>            Priority: Minor
>         Attachments: lunipatch.txt
>
>
> I have been looking at some of the bugs found by Melody and one of them is that there's an illegal cast in EnumSet.writeReplace() ("Impossible cast from java.lang.Object[] to java.lang.Enum[] in java.util.EnumSet.writeReplace()").  I realised that this method is never used.  All instances of EnumSet are subclasses (either MiniEnumSet or HugeEnumSet) and because writeReplace() has private visibility it is not used by subclasses when they are serialized.
> On inspection I don't actually think the inner class EnumSet.SerializationProxy is needed - I think serialization should work for EnumSet without it because it doesn't seem to have any special behaviour.

-- 
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] Updated: (HARMONY-2286) [classlib] [luni] EnumSet.writeReplace() is never used

Posted by "Sian January (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2286?page=all ]

Sian January updated HARMONY-2286:
----------------------------------

    Attachment: lunipatch.txt

Attached a fix.

> [classlib] [luni] EnumSet.writeReplace() is never used
> ------------------------------------------------------
>
>                 Key: HARMONY-2286
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2286
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Sian January
>            Priority: Minor
>         Attachments: lunipatch.txt
>
>
> I have been looking at some of the bugs found by Melody and one of them is that there's an illegal cast in EnumSet.writeReplace() ("Impossible cast from java.lang.Object[] to java.lang.Enum[] in java.util.EnumSet.writeReplace()").  I realised that this method is never used.  All instances of EnumSet are subclasses (either MiniEnumSet or HugeEnumSet) and because writeReplace() has private visibility it is not used by subclasses when they are serialized.
> On inspection I don't actually think the inner class EnumSet.SerializationProxy is needed - I think serialization should work for EnumSet without it because it doesn't seem to have any special behaviour.

-- 
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] Resolved: (HARMONY-2286) [classlib] [luni] EnumSet.writeReplace() is never used

Posted by "Tim Ellison (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2286?page=all ]

Tim Ellison resolved HARMONY-2286.
----------------------------------

    Resolution: Fixed

Thanks Sian.

Patch applied to LUNI module at repo revision r486204.

Please check that the patch was applied as you expected.


> [classlib] [luni] EnumSet.writeReplace() is never used
> ------------------------------------------------------
>
>                 Key: HARMONY-2286
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2286
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Sian January
>         Assigned To: Tim Ellison
>            Priority: Minor
>         Attachments: lunipatch.txt, lunipatch_updated.txt
>
>
> I have been looking at some of the bugs found by Melody and one of them is that there's an illegal cast in EnumSet.writeReplace() ("Impossible cast from java.lang.Object[] to java.lang.Enum[] in java.util.EnumSet.writeReplace()").  I realised that this method is never used.  All instances of EnumSet are subclasses (either MiniEnumSet or HugeEnumSet) and because writeReplace() has private visibility it is not used by subclasses when they are serialized.
> On inspection I don't actually think the inner class EnumSet.SerializationProxy is needed - I think serialization should work for EnumSet without it because it doesn't seem to have any special behaviour.

-- 
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] Updated: (HARMONY-2286) [classlib] [luni] EnumSet.writeReplace() is never used

Posted by "Sian January (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/HARMONY-2286?page=all ]

Sian January updated HARMONY-2286:
----------------------------------

    Attachment: lunipatch_updated.txt

Thanks Spark - I guess I need to get my own copy of the spec.  I have attached a new patch that fixes the problem without getting rid of the Proxy.

> [classlib] [luni] EnumSet.writeReplace() is never used
> ------------------------------------------------------
>
>                 Key: HARMONY-2286
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2286
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Sian January
>            Priority: Minor
>         Attachments: lunipatch.txt, lunipatch_updated.txt
>
>
> I have been looking at some of the bugs found by Melody and one of them is that there's an illegal cast in EnumSet.writeReplace() ("Impossible cast from java.lang.Object[] to java.lang.Enum[] in java.util.EnumSet.writeReplace()").  I realised that this method is never used.  All instances of EnumSet are subclasses (either MiniEnumSet or HugeEnumSet) and because writeReplace() has private visibility it is not used by subclasses when they are serialized.
> On inspection I don't actually think the inner class EnumSet.SerializationProxy is needed - I think serialization should work for EnumSet without it because it doesn't seem to have any special behaviour.

-- 
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] Commented: (HARMONY-2286) [classlib] [luni] EnumSet.writeReplace() is never used

Posted by "Sian January (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2286?page=comments#action_12453884 ] 
            
Sian January commented on HARMONY-2286:
---------------------------------------

Could you possibly provide a link to the documentation you are referring to?  Thanks.

> [classlib] [luni] EnumSet.writeReplace() is never used
> ------------------------------------------------------
>
>                 Key: HARMONY-2286
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2286
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Sian January
>            Priority: Minor
>         Attachments: lunipatch.txt
>
>
> I have been looking at some of the bugs found by Melody and one of them is that there's an illegal cast in EnumSet.writeReplace() ("Impossible cast from java.lang.Object[] to java.lang.Enum[] in java.util.EnumSet.writeReplace()").  I realised that this method is never used.  All instances of EnumSet are subclasses (either MiniEnumSet or HugeEnumSet) and because writeReplace() has private visibility it is not used by subclasses when they are serialized.
> On inspection I don't actually think the inner class EnumSet.SerializationProxy is needed - I think serialization should work for EnumSet without it because it doesn't seem to have any special behaviour.

-- 
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] Commented: (HARMONY-2286) [classlib] [luni] EnumSet.writeReplace() is never used

Posted by "Sian January (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/HARMONY-2286?page=comments#action_12457776 ] 
            
Sian January commented on HARMONY-2286:
---------------------------------------

Thanks Tim - patch applied as expected.

> [classlib] [luni] EnumSet.writeReplace() is never used
> ------------------------------------------------------
>
>                 Key: HARMONY-2286
>                 URL: http://issues.apache.org/jira/browse/HARMONY-2286
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>            Reporter: Sian January
>         Assigned To: Tim Ellison
>            Priority: Minor
>         Attachments: lunipatch.txt, lunipatch_updated.txt
>
>
> I have been looking at some of the bugs found by Melody and one of them is that there's an illegal cast in EnumSet.writeReplace() ("Impossible cast from java.lang.Object[] to java.lang.Enum[] in java.util.EnumSet.writeReplace()").  I realised that this method is never used.  All instances of EnumSet are subclasses (either MiniEnumSet or HugeEnumSet) and because writeReplace() has private visibility it is not used by subclasses when they are serialized.
> On inspection I don't actually think the inner class EnumSet.SerializationProxy is needed - I think serialization should work for EnumSet without it because it doesn't seem to have any special behaviour.

-- 
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