Skip to content
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
6 changes: 3 additions & 3 deletions core/src/main/java/hudson/os/WindowsUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
import hudson.Functions;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import org.apache.commons.io.IOUtils;

/**
* Utilities for the Windows Platform.
Expand Down Expand Up @@ -119,8 +119,8 @@ public class WindowsUtil {
Process mklink = execCmd("mklink", "/J", junction.getAbsolutePath(), target.getAbsolutePath());
int result = mklink.waitFor();
if (result != 0) {
String stderr = IOUtils.toString(mklink.getErrorStream());
String stdout = IOUtils.toString(mklink.getInputStream());
String stderr = new String(mklink.getErrorStream().readAllBytes());
String stdout = new String(mklink.getInputStream().readAllBytes());
throw new IOException("Process exited with " + result + "\nStandard Output:\n" + stdout + "\nError Output:\n" + stderr);
}
return junction;
Expand Down
10 changes: 9 additions & 1 deletion core/src/main/java/hudson/scheduler/CronTabList.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public synchronized boolean check(Calendar cal) {
public String checkSanity() {
for (CronTab tab : tabs) {
String s = tab.checkSanity();
if (s != null) return s;
if (s != null) return s;
}
return null;
}
Expand Down Expand Up @@ -118,6 +118,10 @@ public static CronTabList create(@NonNull String format, Hash hash) {
if (timezone != null) {
LOGGER.log(Level.CONFIG, "CRON with timezone {0}", timezone);
} else {
/*
* @deprecated use {@link IllegalArgumentException}
* Some plugins might not catch : IllegalArgumentException & break
*/
throw new ANTLRException("Invalid or unsupported timezone '" + timezoneString + "'");
}
continue;
Expand All @@ -128,6 +132,10 @@ public static CronTabList create(@NonNull String format, Hash hash) {
try {
r.add(new CronTab(line, lineNumber, hash, timezone));
} catch (IllegalArgumentException e) {
/*
* @deprecated use {@link IllegalArgumentException}
* Some plugins might catch : IllegalArgumentException & break
*/
throw new ANTLRException(Messages.CronTabList_InvalidInput(line, e.getMessage()), e);
}
}
Expand Down