6 PolicyNodeImpl synopsis

Document Sample
6 PolicyNodeImpl synopsis Powered By Docstoc
					PolicyNodeImpl -- synopsis by Florian Mueller (http://fosspatents.blogspot.com -- Twitter:FOSSpatents)

    Source code generated by decompilation of PolicyNodeImpl.class                           Source code shipped by Google according to Exhibit J to Oracle's
         (jdk1.5.0.22; spaces and blank lines inserted manually)                              amended complaint (spaces and blank lines inserted manually)

// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel
Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
// Source File Name:   PolicyNodeImpl.java

package sun.security.provider.certpath;

import java.security.cert.PolicyNode;
import java.util.*;1

final class PolicyNodeImpl                                                               public class PolicyNodeImpl implements PolicyNode {
    implements PolicyNode
{
                                                                                               private static final String ANY_POLICY =
                                                                                               "2.5.29.32.0";
                                                                                               private PolicyNodeImpl mParent;
                                                                                               private HashSet mChildren;
                                                                                               private String mValidPolicy;
                                                                                               private HashSet mQualifierSet;
                                                                                               private boolean mCriticalityIndicator;
                                                                                               private HashSet mExpectedPolicySet;
                                                                                               private boolean mOriginalExpectedPolicySet;
                                                                                               private int mDepth;
                                                                                               private boolean isImmutable;2

      PolicyNodeImpl(PolicyNodeImpl policynodeimpl,                                            public PolicyNodeImpl(PolicyNodeImpl policynodeimpl,
      String s, Set set, boolean flag, Set set1,                                                   String s, Set set, boolean flag, Set set1,
      boolean flag1)    {                                                                          boolean flag1) {
          isImmutable = false;                                                                     isImmutable = false;

1 Any "package" and "import" commands prior to the class definition are not stated in Oracle's Exhibit J, but there are some in the actual file. Therefore, the righthand bar is gray.
2 In the left column, the same ten declarations appear at the end of the class definition.

                                                                   PolicyNodeImpl synopsis -- page 1 of 10
    mParent = policynodeimpl;                                        mParent = policynodeimpl;
    mChildren = new HashSet();                                       mChildren = new HashSet();
    if(s != null)                                                    if(s != null) {
         mValidPolicy = s;                                               mValidPolicy = s;
    else                                                             } else {
         mValidPolicy = "";                                              mValidPolicy = "";
                                                                     }
    if(set != null)                                                  if(set != null) {
         mQualifierSet = new HashSet(set);                               mQualifierSet = new HashSet(set);
    else                                                             } else {
         mQualifierSet = new HashSet();                                  mQualifierSet = new HashSet();
                                                                     }
    mCriticalityIndicator = flag;                                    mCriticalityIndicator = flag;
    if(set1 != null)                                                 if(set1 != null) {
         mExpectedPolicySet = new HashSet(set1);                         mExpectedPolicySet = new HashSet(set1);
    else                                                             } else {
         mExpectedPolicySet = new HashSet();                             mExpectedPolicySet = new HashSet();
                                                                     }
    mOriginalExpectedPolicySet = !flag1;                             mOriginalExpectedPolicySet = !flag1;
    if(mParent != null)                                              if(mParent != null) {
    {
        mDepth = mParent.getDepth() + 1;                                 mDepth = mParent.getDepth() + 1;
        mParent.addChild(this);                                          mParent.addChild(this);
    } else                                                           } else {
    {
        mDepth = 0;                                                       mDepth = 0;
    }                                                                }
}                                                               }

PolicyNodeImpl(PolicyNodeImpl policynodeimpl,              PolicyNodeImpl(PolicyNodeImpl policynodeimpl,
PolicyNodeImpl policynodeimpl1)                                    PolicyNodeImpl policynodeimpl1) {
{
    this(policynodeimpl,                                             this(policynodeimpl,
    policynodeimpl1.mValidPolicy,                                    policynodeimpl1.mValidPolicy,
    ((Set) (policynodeimpl1.mQualifierSet)),                         ((Set) (policynodeimpl1.mQualifierSet)),
    policynodeimpl1.mCriticalityIndicator,                           policynodeimpl1.mCriticalityIndicator,
    ((Set) (policynodeimpl1.mExpectedPolicySet)),                    ((Set) (policynodeimpl1.mExpectedPolicySet)),
    false);                                                          false);
}                                                               }


                                           PolicyNodeImpl synopsis -- page 2 of 10
    public PolicyNode getParent()                                public PolicyNode getParent() {
    {
        return mParent;                                               return mParent;
    }                                                            }

    public Iterator getChildren()                                public Iterator getChildren() {
    {
        return                                                        return
       Collections.unmodifiableSet(mChildren).iterator();            Collections.unmodifiableSet(mChildren).iterator();
    }                                                            }

    public int getDepth()                                        public int getDepth() {
    {
        return mDepth;                                                return mDepth;
    }                                                            }

    public String getValidPolicy()                               public String getValidPolicy() {
    {
        return mValidPolicy;                                          return mValidPolicy;
    }                                                            }

    public Set getPolicyQualifiers()                             public Set getPolicyQualifiers() {
    {
        return                                                       return Collections.unmodifiableSet(mQualifierSet);
        Collections.unmodifiableSet(mQualifierSet);              }
    }

    public Set getExpectedPolicies()                             public Set getExpectedPolicies() {
    {
        return                                                        return
Collections.unmodifiableSet(mExpectedPolicySet);                      Collections.unmodifiableSet(mExpectedPolicySet);
    }                                                            }

    public boolean isCritical()                                  public boolean isCritical() {
    {
        return mCriticalityIndicator;                                 return mCriticalityIndicator;
    }                                                            }



                                            PolicyNodeImpl synopsis -- page 3 of 10
 public String toString()                                     public String toString() {
 {
     StringBuffer stringbuffer =                                   StringBuffer stringbuffer =
     new StringBuffer(asString());                                 new StringBuffer(asString());

     for(Iterator iterator = getChildren();                       for(Iterator iterator = getChildren();
     iterator.hasNext();                                          iterator.hasNext();
stringbuffer.append((PolicyNodeImpl)iterator.next()));       stringbuffer.append((PolicyNodeImpl)iterator.next()));

     return stringbuffer.toString();                               return stringbuffer.toString();
 }                                                            }

 boolean isImmutable()                                        boolean isImmutable() {
 {
     return isImmutable;                                           return isImmutable;
 }                                                            }

 void setImmutable()                                          void setImmutable() {
 {
     if(isImmutable)                                               if(isImmutable) return;
         return;
     PolicyNodeImpl policynodeimpl;                                PolicyNodeImpl policynodeimpl;
     for(Iterator iterator = mChildren.iterator();                 for(Iterator iterator = mChildren.iterator();
     iterator.hasNext();                                           iterator.hasNext();
     policynodeimpl.setImmutable())                                policynodeimpl.setImmutable())
         policynodeimpl =                                              policynodeimpl =
         (PolicyNodeImpl)iterator.next();                              (PolicyNodeImpl)iterator.next();

     isImmutable = true;                                           isImmutable = true;
 }                                                            }

 private void addChild(PolicyNodeImpl policynodeimpl)         private void addChild(PolicyNodeImpl policynodeimpl)
 {                                                            {
     if(isImmutable)                                              if(isImmutable) {
     {
         throw new IllegalStateException("PolicyNode                   throw new IllegalStateException("PolicyNode
         is immutable");                                               is immutable");
     } else                                                        } else {


                                         PolicyNodeImpl synopsis -- page 4 of 10
    {
        mChildren.add(policynodeimpl);                                  mChildren.add(policynodeimpl);
        return;                                                         return;
    }                                                              }
}                                                             }

void addExpectedPolicy(String s)                                   void addExpectedPolicy(String s) {
{
    if(isImmutable)                                                     if(isImmutable)
        throw new IllegalStateException("PolicyNode                         throw new
        is immutable");                                                     IllegalStateException("PolicyNode is
                                                                            immutable");

    if(mOriginalExpectedPolicySet)                                      if(mOriginalExpectedPolicySet) {
    {
        mExpectedPolicySet.clear();                                         mExpectedPolicySet.clear();
        mOriginalExpectedPolicySet = false;                                 mOriginalExpectedPolicySet = false;
    }                                                                   }
    mExpectedPolicySet.add(s);                                          mExpectedPolicySet.add(s);
}                                                                  }

void prune(int i)                                                  void prune(int i) {
{                                                                      if(isImmutable)
    if(isImmutable)                                                        throw new
        throw new IllegalStateException("PolicyNode                        IllegalStateException("PolicyNode is
        is immutable");                                                    immutable");
    if(mChildren.size() == 0)                                          if(mChildren.size() == 0)
        return;                                                            return;
    Iterator iterator = mChildren.iterator();                 Iterator iterator = mChildren.iterator();
    do                                                        do {
    {
        if(!iterator.hasNext())                                    if(!iterator.hasNext()) break;
            break;
        PolicyNodeImpl policynodeimpl =                            PolicyNodeImpl policynodeimpl =
        (PolicyNodeImpl)iterator.next();                           (PolicyNodeImpl)iterator.next();
        policynodeimpl.prune(i);                                   policynodeimpl.prune(i);
        if(policynodeimpl.mChildren.size() == 0 && i               if(policynodeimpl.mChildren.size() == 0 && i >
        > mDepth + 1)                                              mDepth + 1)
            iterator.remove();                                         iterator.remove();


                                         PolicyNodeImpl synopsis -- page 5 of 10
     } while(true);                                               } while(true);
}                                                            }

void deleteChild(PolicyNode policynode)                      void deleteChild(PolicyNode policynode) {
{
    if(isImmutable)                                               if(isImmutable) {
    {
        throw new IllegalStateException("PolicyNode                   throw new IllegalStateException("PolicyNode
        is immutable");                                               is immutable");
    } else                                                        } else {
    {
        mChildren.remove(policynode);                                  mChildren.remove(policynode);
        return;                                                        return;
    }                                                             }
}                                                            }

PolicyNodeImpl copyTree()                                    PolicyNodeImpl copyTree() {
{
    return copyTree(null);                                        return copyTree(null);
}                                                            }

private PolicyNodeImpl copyTree(PolicyNodeImpl               private PolicyNodeImpl copyTree(PolicyNodeImpl
policynodeimpl)                                              policynodeimpl) {
{
    PolicyNodeImpl policynodeimpl1 =                              PolicyNodeImpl policynodeimpl1 =
    new PolicyNodeImpl(policynodeimpl, this);                     new PolicyNodeImpl(policynodeimpl, this);
    PolicyNodeImpl policynodeimpl2;                               PolicyNodeImpl policynodeimpl2;
    for(Iterator iterator = mChildren.iterator();                 for(Iterator iterator = mChildren.iterator();
    iterator.hasNext();                                           iterator.hasNext();
    policynodeimpl2.copyTree(policynodeimpl1))                    policynodeimpl2.copyTree(policynodeimpl1))
    policynodeimpl2 =                                             policynodeimpl2 =
    (PolicyNodeImpl)iterator.next();                              (PolicyNodeImpl)iterator.next();

    return policynodeimpl1;                                       return policynodeimpl1;
}                                                            }

Set getPolicyNodes(int i)                                    Set getPolicyNodes(int i) {
{
    HashSet hashset = new HashSet();                              HashSet hashset = new HashSet();


                                        PolicyNodeImpl synopsis -- page 6 of 10
    getPolicyNodes(i, ((Set) (hashset)));                         getPolicyNodes(i, ((Set) (hashset)));
    return hashset;                                               return hashset;
}                                                            }

private void getPolicyNodes(int i, Set set)                  private void getPolicyNodes(int i, Set set) {
{
    if(mDepth == i)                                               if(mDepth == i) {
    {
        set.add(this);                                                set.add(this);
    } else                                                        } else {
    {
        PolicyNodeImpl policynodeimpl;                                 PolicyNodeImpl policynodeimpl;
        for(Iterator iterator = mChildren.iterator();                  for(Iterator iterator = mChildren.iterator();
        iterator.hasNext();                                            iterator.hasNext();
        policynodeimpl.getPolicyNodes(i, set))                         policynodeimpl.getPolicyNodes(i, set))
        policynodeimpl =                                               policynodeimpl =
        (PolicyNodeImpl)iterator.next();                               (PolicyNodeImpl)iterator.next();
    }                                                             }
}                                                            }

Set getPolicyNodesExpected(int i, String s,                  Set getPolicyNodesExpected(int i, String s,
boolean flag)                                                boolean flag) {
{
    if(s.equals("2.5.29.32.0"))                                   if(s.equals("2.5.29.32.0"))
         return getPolicyNodes(i);                                     return getPolicyNodes(i);
    else                                                          else
         return getPolicyNodesExpectedHelper(i, s,                     return getPolicyNodesExpectedHelper(i, s,
         flag);                                                        flag);
}                                                            }

private Set getPolicyNodesExpectedHelper(int i,              private Set getPolicyNodesExpectedHelper(int i,
String s, boolean flag)                                      String s, boolean flag)
{                                                       {
    HashSet hashset = new HashSet();                              HashSet hashset = new HashSet();

    if(mDepth < i)                                                if(mDepth < i) {
    {
        PolicyNodeImpl policynodeimpl;                                 PolicyNodeImpl policynodeimpl;
        for(Iterator iterator = mChildren.iterator();                  for(Iterator iterator = mChildren.iterator();


                                        PolicyNodeImpl synopsis -- page 7 of 10
            iterator.hasNext();                                            iterator.hasNext();
           hashset.addAll(policynodeimpl.getPolicyNodesE                   hashset.addAll(policynodeimpl.getPolicyNodesE
           xpectedHelper(i, s, flag)))                                     xpectedHelper(i, s, flag)))
                 policynodeimpl =                                          policynodeimpl =
                 (PolicyNodeImpl)iterator.next();                          (PolicyNodeImpl)iterator.next();
        } else                                                         } else if(flag) {
        if(flag)
        {
            if(mExpectedPolicySet.contains("2.5.29.32.0")                  if(mExpectedPolicySet.contains(
)                                                                          "2.5.29.32.0"))
                hashset.add(this);                                             hashset.add(this);
        } else                                                         } else if(mExpectedPolicySet.contains(s)) {
        if(mExpectedPolicySet.contains(s))
            hashset.add(this);                                              hashset.add(this);
                                                                       }

        return hashset;                                                return hashset;
    }                                                             }

    Set getPolicyNodesValid(int i, String s)                      Set getPolicyNodesValid(int i, String s) {
    {
        HashSet hashset = new HashSet();                               HashSet hashset = new HashSet();
        if(mDepth < i)                                                 if(mDepth < i) {
        {
            PolicyNodeImpl policynodeimpl;                                 PolicyNodeImpl policynodeimpl;
            for(Iterator iterator = mChildren.iterator();                  for(Iterator iterator = mChildren.iterator();
            iterator.hasNext();                                            iterator.hasNext();
            hashset.addAll(                                                hashset.addAll(
            policynodeimpl.getPolicyNodesValid(i, s)))                     policynodeimpl.getPolicyNodesValid(i, s)))
            policynodeimpl =                                               policynodeimpl =
            (PolicyNodeImpl)iterator.next();                               (PolicyNodeImpl)iterator.next();
        } else                                                         } else if(mValidPolicy.equals(s)) {
        if(mValidPolicy.equals(s))
            hashset.add(this);                                             hashset.add(this);
                                                                       }
        return hashset;                                                return hashset;
    }                                                             }

    private static String policyToString(String s)                private static String policyToString(String s) {


                                             PolicyNodeImpl synopsis -- page 8 of 10
{
    if(s.equals("2.5.29.32.0"))                                      if(s.equals("2.5.29.32.0")) {
         return "anyPolicy";                                             return "anyPolicy";
    else                                                             } else {
         return s;                                                       return s;
}                                                                    }
                                                                }

String asString()                                               String asString() {
{
    if(mParent == null)                                              if(mParent == null)
        return "anyPolicy   ROOT\n";                                     return "anyPolicy ROOT\n";

    StringBuffer stringbuffer = new StringBuffer();                  StringBuffer stringbuffer = new StringBuffer();
    int i = 0;                                                       int i = 0;
    for(int j = getDepth(); i < j; i++)                              for(int j = getDepth(); i < j; i++)
        stringbuffer.append(" ");                                        stringbuffer.append(" ");

    stringbuffer.append(policyToString(                              stringbuffer.append(policyToString(
    getValidPolicy()));                                              getValidPolicy()));
    stringbuffer.append(" CRIT: ");                                  stringbuffer.append(" CRIT: ");
    stringbuffer.append(isCritical());                               stringbuffer.append(isCritical());
    stringbuffer.append(" EP: ");                                    stringbuffer.append(" EP: ");
    for(Iterator iterator =                                          for(Iterator iterator =
    getExpectedPolicies().iterator();                                getExpectedPolicies().iterator();
    iterator.hasNext(); stringbuffer.append(" "))                    iterator.hasNext(); stringbuffer.append(" ")) {
    {
        String s = (String)iterator.next();                               String s = (String)iterator.next();
        stringbuffer.append(policyToString(s));                           stringbuffer.append(policyToString(s));
    }                                                                }

    stringbuffer.append(" (");                                       stringbuffer.append(" (");
    stringbuffer.append(getDepth());                                 stringbuffer.append(getDepth());
    stringbuffer.append(")\n");                                      stringbuffer.append(")\n");
    return stringbuffer.toString();                                  return stringbuffer.toString();
}                                                               }

private static final String ANY_POLICY =
"2.5.29.32.0";


                                           PolicyNodeImpl synopsis -- page 9 of 10
    private   PolicyNodeImpl mParent;
    private   HashSet mChildren;
    private   String mValidPolicy;
    private   HashSet mQualifierSet;
    private   boolean mCriticalityIndicator;
    private   HashSet mExpectedPolicySet;
    private   boolean mOriginalExpectedPolicySet;
    private   int mDepth;
    private   boolean isImmutable;
}                                                             }




                                             PolicyNodeImpl synopsis -- page 10 of 10

				
DOCUMENT INFO
Shared By:
Stats:
views:3997
posted:1/21/2011
language:English
pages:10
Description: PolicyNodeImpl is the Java class that Oracle presented in Exhibit J to its amended patent and copyright infringement complaint against Google. This file shows that the Android version of the file was apparently generated with a decompiler.