...
Code Block | ||
---|---|---|
| ||
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="475c903e5239d149-71aca7d8-44864b1e-ab2fac79-9160b8c65831512d8380626b"><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="9d111de0fa8f3615-e1397ec1-4b534034-987dbd49-dd8bd17a23e6ad37c42130ee"><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="704bdc9ccb7191f6-5e5c5c80-4cdd44a5-bd508f85-6a5efdec586c3f5e0d9f05f5"><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="4c6934f42ed50ed9-0e6ffedc-40964497-b5d7add2-f82c542b7e723e96e58f4adc"><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="bc1aa181a2d6ef0f-313fd2bf-4d2146bf-a2ab9265-3d1c8de6ce677eff47a4c437"><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="d46c272458824b71-bd31d3a4-49b74667-af8391e3-a9c28fcb53bb2fa4e54ac40b"><ac:plain-text-body><![CDATA[ | [[Ware 2008 | AA. References#Ware 08]] | ]]></ac:plain-text-body></ac:structured-macro> |
...