[ 
https://issues.apache.org/jira/browse/RIVER-416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13572482#comment-13572482
 ] 

Dennis Reedy commented on RIVER-416:
------------------------------------

Inn looking at Level, a Level is equal to another Level if they have the same 
integer value. The readResolve() for Level is:

{code}
// Serialization magic to prevent "doppelgangers".
// This is a peformance optimization.
private Object readResolve() {
    synchronized (Level.class) {
    for (int i = 0; i < known.size(); i++) {
        Level other = (Level) known.get(i);
        if (this.name.equals(other.name) && this.value == other.value
                && (this.resourceBundleName == other.resourceBundleName ||
                    (this.resourceBundleName != null &&
                    this.resourceBundleName.equals(other.resourceBundleName)))) 
{
            return other;
        }
    }
    // Woops.  Whoever sent us this object knows 
    // about a new log level.  Add it to our list.
    known.add(this);
    return this;
    }
}    
{code}

I'm not seeing why we need to add a different readResolve()?
                
> The com.sun.jini.logging.Levels class produces a RuntimeException with the 
> latest version of Java
> -------------------------------------------------------------------------------------------------
>
>                 Key: RIVER-416
>                 URL: https://issues.apache.org/jira/browse/RIVER-416
>             Project: River
>          Issue Type: Bug
>          Components: com_sun_jini_logging
>    Affects Versions: River_2.2.0
>            Reporter: Dennis Reedy
>            Priority: Blocker
>         Attachments: Levels.java
>
>
> The com.sun.jini.logging.Levels class produces a RuntimeException with the 
> latest version of Java (both 1.6 and 1.7). The issue surrounds creation of 
> custom java.util.logging.Level. The current implementation uses a 
> ClassReplacingObjectOutputStream and the LevelData approach. By removing this 
> approach and creating a subclass of java.util.logging.Level the issue gets 
> resolved.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to