Skip to content
Permalink
Browse files

[JENKINS-47416] ViewGroup.getUrl could throw NPE during deserializati…

…on, so do not call it from migrateLegacyPrimaryAllViewLocalizedName.
  • Loading branch information...
jglick committed Oct 15, 2017
1 parent 27e5943 commit 6a2e907e7d4c00ae673a054cc3c65feb24f559de
Showing with 2 additions and 3 deletions.
  1. +2 −3 core/src/main/java/hudson/model/AllView.java
@@ -27,7 +27,6 @@
import java.util.Locale;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import jenkins.util.SystemProperties;
import org.apache.commons.lang.StringUtils;
@@ -121,7 +120,7 @@ protected void submit(StaplerRequest req) throws IOException, ServletException,
* its name is one of the localized forms of {@link Messages#_Hudson_ViewName()} and the user has not opted out of
* fixing the view name by setting the system property {@code hudson.mode.AllView.JENKINS-38606} to {@code false}.
* Use this method to round-trip the primary view name, e.g.
* {@code primaryView = applyJenkins38606Fixup(views, primaryView)}
* {@code primaryView = migrateLegacyPrimaryAllViewLocalizedName(views, primaryView)}
* <p>
* NOTE: we can only fix the localized name of an {@link AllView} if it is the primary view as otherwise urls
* would change, whereas the primary view is special and does not normally get accessed by the
@@ -164,7 +163,7 @@ public static String migrateLegacyPrimaryAllViewLocalizedName(@Nonnull List<View
// bingo JENKINS-38606 detected
LOGGER.log(Level.INFO,
"JENKINS-38606 detected for AllView in {0}; renaming view from {1} to {2}",
new Object[]{allView.owner.getUrl(), primaryView, DEFAULT_VIEW_NAME});
new Object[] {allView.owner, primaryView, DEFAULT_VIEW_NAME});
allView.name = DEFAULT_VIEW_NAME;
return DEFAULT_VIEW_NAME;
}

0 comments on commit 6a2e907

Please sign in to comment.
You can’t perform that action at this time.