    /**
     * The options for Guice stack trace collection.
     */
-@@ -20,14 +32,6 @@ public class InternalFlags {
+@@ -21,6 +33,10 @@ public class InternalFlags {
  
  
    public static IncludeStackTraceOption getIncludeStackTraceOption() {
--    String propertyValue = System.getProperty(
--        "guice_include_stack_traces");
--    if (IncludeStackTraceOption.OFF.name().equals(propertyValue)) {
--        return IncludeStackTraceOption.OFF;
--    }
--    if (IncludeStackTraceOption.COMPLETE.name().equals(propertyValue)) {
--        return IncludeStackTraceOption.COMPLETE;
--    }
--    return IncludeStackTraceOption.ONLY_FOR_DECLARING_SOURCE;
 +    return INCLUDE_STACK_TRACES;
-   }
- }
++  }
++
++  private static IncludeStackTraceOption parseIncludeStackTraceOption() {
+     String flag = System.getProperty("guice_include_stack_traces");
+     try {
+       return (flag == null || flag.length() == 0)

     CacheBuilder<Object, Object> builder = CacheBuilder.newBuilder().weakKeys().weakValues();
     if (!CUSTOM_LOADER_ENABLED) {
       builder.maximumSize(0);
diffdiff --git a/core/src/com/google/inject/internal/InternalFlags.java b/core/src/com/google/inject/internal/InternalFlags.
index 9458281..78d56ae 100644
--- a/core/src/com/google/inject/internal/InternalFlags.java
+++ b/core/src/com/google/inject/internal/InternalFlags.java
@@ -6,6 +6,18 @@ package com.google.inject.internal;
  */
 public class InternalFlags {
 
+  private static final IncludeStackTraceOption INCLUDE_STACK_TRACES;
+  static {
+    IncludeStackTraceOption includeStackTraces;
+    try {
+      includeStackTraces = IncludeStackTraceOption.valueOf(
+          System.getProperty("guice_include_stack_traces"));
+    } catch (Throwable e) {
+      includeStackTraces = IncludeStackTraceOption.ONLY_FOR_DECLARING_SOURCE;
+    }

Description: Wrap System.getProperty call in case security is enabled
Author: Stuart McCulloch <mcculls@gmail.com>
Bug-Google: http://code.google.com/p/google-guice/issues/detail?id=350
Last-Update: 2013-11-13

diff --git a/core/src/com/google/inject/internal/BytecodeGen.java b/core/src/com/google/inject/internal/BytecodeGen.java
index ad7764b..f0ebc0a 100644
