Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
bgColor#ccccff
public class BigInteger {
  public BigInteger(String str) {
    // throws a security exception if not allowed
    this(str, check(thisBigInteger.getClass(class))); 
  }

  private BigInteger(String str, boolean securityManagerCheck) {
    // regular construction goes here
  }

  private static boolean check(Class c) {
    // Confirm class type
    if (c != java.math.BigInteger.class) {
      // Check the permission needed to subclass BigInteger
      // throws a security exception if not allowed
      securityManagerCheck(); 
    }
    return true;
  }
}

...

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="d6182dfcee387d70-c3b20e82-43894ee4-becd841e-83795cbce4d346aaba6fd59c"><ac:plain-text-body><![CDATA[

[[API 2006

AA. References#API 06]]

Class BigInteger

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="ea928c2067a6531f-7d57056b-40894b2c-b4709133-2ad78cbabd3a90a446fce167"><ac:plain-text-body><![CDATA[

[[Bloch 2008

AA. References#Bloch 08]]

Item 1. Consider static factory methods instead of constructors

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="dc7fe22e1835cf5b-095189df-4e674eb0-bb598bc1-82511b9e52c8a125ef7b28d0"><ac:plain-text-body><![CDATA[

[[Gong 2003

AA. References#Gong 03]]

Chapter 6, Enforcing Security Policy

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="ce0e2d74b2af8223-a3ce5334-4dc64f53-90e0ba3f-198ef9b11507f877ccb5ba25"><ac:plain-text-body><![CDATA[

[[Lai 2008

AA. References#Lai 08]]

Java Insecurity, Accounting for Subtleties That Can Compromise Code

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="2b2f1d8ccc45e000-b151d225-439c4cfd-9682a4b3-2053746a8135d0725ec3659a"><ac:plain-text-body><![CDATA[

[[McGraw 1999

AA. References#McGraw 99]]

Chapter Seven, Rule 3. Make everything final, unless there's a good reason not to

]]></ac:plain-text-body></ac:structured-macro>

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="2451befb55927f7b-f9dfda25-4c724e4c-b7628f32-9f749d0c4845ecc311ed602e"><ac:plain-text-body><![CDATA[

[[Ware 2008

AA. References#Ware 08]]

]]></ac:plain-text-body></ac:structured-macro>

...