Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent AccessControlException when running with active SecurityManager #60

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/com/unboundid/util/Debug.java
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,12 @@ public static void initialize()
debugEnabled = false;
debugTypes = EnumSet.allOf(DebugType.class);

logger.setLevel(Level.ALL);
try {
logger.setLevel(Level.ALL);
}
catch (final Exception e) {
//
}
}


Expand Down Expand Up @@ -309,7 +314,13 @@ else if (stackProp.equalsIgnoreCase("false"))
final String levelProp = properties.getProperty(PROPERTY_DEBUG_LEVEL);
if ((levelProp != null) && (! levelProp.isEmpty()))
{
logger.setLevel(Level.parse(levelProp));
try {
logger.setLevel(Level.parse(levelProp));
}
catch (final Exception e) {
logger.log(Level.WARNING, "Could not change log level to "+
levelProp, e);
}
}
}

Expand Down
16 changes: 7 additions & 9 deletions src/com/unboundid/util/StaticUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,17 +123,15 @@ public final class StaticUtils
// Try to dynamically determine the size of the terminal window using the
// COLUMNS environment variable.
int terminalWidth = 80;
final String columnsEnvVar = System.getenv("COLUMNS");
if (columnsEnvVar != null)
{
try
{
try {
final String columnsEnvVar = System.getenv("COLUMNS");
if (columnsEnvVar != null) {
terminalWidth = Integer.parseInt(columnsEnvVar);
}
catch (final Exception e)
{
Debug.debugException(e);
}
}
catch (final Exception e)
{
Debug.debugException(e);
}

TERMINAL_WIDTH_COLUMNS = terminalWidth;
Expand Down