Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-21520] transient NoClassDefFoundError: javax/servlet/Servlet…
…Exception
  • Loading branch information
ndeloof committed Jul 10, 2015
1 parent 886a322 commit 377561e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/main/java/hudson/plugins/git/GitTool.java
Expand Up @@ -2,7 +2,6 @@

import hudson.EnvVars;
import hudson.Extension;
import hudson.Functions;
import hudson.init.Initializer;
import hudson.model.EnvironmentSpecific;
import hudson.model.Node;
Expand Down Expand Up @@ -131,7 +130,7 @@ public static void onLoaded() {
return;
}

String defaultGitExe = Functions.isWindows() ? "git.exe" : "git";
String defaultGitExe = isWindows() ? "git.exe" : "git";
GitTool tool = new GitTool(DEFAULT, defaultGitExe, Collections.<ToolProperty<?>>emptyList());
descriptor.setInstallations(new GitTool[] { tool });
descriptor.save();
Expand Down Expand Up @@ -192,5 +191,10 @@ public List<ToolDescriptor<? extends GitTool>> getApplicableDesccriptors() {
}

private static final Logger LOGGER = Logger.getLogger(GitTool.class.getName());

/** inline ${@link hudson.Functions#isWindows()} to prevent a transient remote classloader issue */
private static boolean isWindows() {
return File.pathSeparatorChar==';';
}
}

11 changes: 9 additions & 2 deletions src/main/java/org/jenkinsci/plugins/gitclient/CliGitAPIImpl.java
Expand Up @@ -79,7 +79,7 @@ public class CliGitAPIImpl extends LegacyCompatibleGitAPIImpl {
private StandardCredentials defaultCredentials;

private void warnIfWindowsTemporaryDirNameHasSpaces() {
if (!Functions.isWindows()) {
if (!isWindows()) {
return;
}
String[] varsToCheck = {"TEMP", "TMP"};
Expand Down Expand Up @@ -644,7 +644,7 @@ public ObjectId revParse(String revName) throws GitException, InterruptedExcepti
* See https://github.com/msysgit/msysgit/issues/36 where I filed this as a bug to msysgit.
**/
private String sanitize(String arg) {
if (Functions.isWindows())
if (isWindows())
arg = '"'+arg+'"';
return arg;
}
Expand Down Expand Up @@ -2530,4 +2530,11 @@ private String getGitCredentialsURL(URIish u, StandardCredentials cred) {
* best to avoid git interactively asking for credentials, there are many of other cases where git may hang.
*/
public static final int TIMEOUT = Integer.getInteger(Git.class.getName() + ".timeOut", 10);

/** inline ${@link hudson.Functions#isWindows()} to prevent a transient remote classloader issue */
private boolean isWindows() {
return File.pathSeparatorChar==';';
}


}

0 comments on commit 377561e

Please sign in to comment.