提交 34b5737e 编写于 作者: K kohsuke

NPE prevents Hudson from starting up on some environments

    (<a href="http://www.nabble.com/Failed-to-initialisze-Hudson-%3A-NullPointerException-td23252806.html">report</a>)


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@17574 71c3de6d-444a-0410-be80-ed276b4c234a
上级 3bfef0e3
......@@ -246,7 +246,7 @@ public final class Hudson extends Node implements ItemGroup<TopLevelItem>, Stapl
*
* Never null.
*/
private volatile AuthorizationStrategy authorizationStrategy;
private volatile AuthorizationStrategy authorizationStrategy = AuthorizationStrategy.UNSECURED;
/**
* Controls a part of the
......@@ -263,7 +263,7 @@ public final class Hudson extends Node implements ItemGroup<TopLevelItem>, Stapl
* @see #getSecurity()
* @see #setSecurityRealm(SecurityRealm)
*/
private volatile SecurityRealm securityRealm;
private volatile SecurityRealm securityRealm = SecurityRealm.NO_AUTHENTICATION;
/**
* Message displayed in the top page.
......@@ -1021,13 +1021,8 @@ public final class Hudson extends Node implements ItemGroup<TopLevelItem>, Stapl
public List<TopLevelItem> getItems() {
List<TopLevelItem> viewableItems = new ArrayList<TopLevelItem>();
for (TopLevelItem item : items.values()) {
if (item instanceof AccessControlled) {
if (((AccessControlled)item).hasPermission(Item.READ))
viewableItems.add(item);
}
else {
viewableItems.add(item);
}
if (item.hasPermission(Item.READ))
viewableItems.add(item);
}
return viewableItems;
......@@ -3307,7 +3302,7 @@ public final class Hudson extends Node implements ItemGroup<TopLevelItem>, Stapl
public static boolean PARALLEL_LOAD = !"false".equals(System.getProperty(Hudson.class.getName()+".parallelLoad"));
public static boolean KILL_AFTER_LOAD = Boolean.getBoolean(Hudson.class.getName()+".killAfterLoad");
public static boolean LOG_STARTUP_PERFORMANCE = Boolean.getBoolean(Hudson.class.getName()+".logStartupPerformance");
private static final boolean CONSISTENT_HASH = Boolean.getBoolean(Hudson.class.getName()+".consistentHash");
private static final boolean CONSISTENT_HASH = true; // Boolean.getBoolean(Hudson.class.getName()+".consistentHash");
private static final Logger LOGGER = Logger.getLogger(Hudson.class.getName());
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册