Skip to content

Commit

Permalink
Merge branch 'master' into JENKINS-21969
Browse files Browse the repository at this point in the history
  • Loading branch information
christ66 committed Feb 28, 2014
2 parents 84e8d01 + 00d2717 commit ae5a3cb
Show file tree
Hide file tree
Showing 58 changed files with 577 additions and 291 deletions.
59 changes: 0 additions & 59 deletions .idea/compiler.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/encodings.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/groovyc.xml

This file was deleted.

41 changes: 31 additions & 10 deletions changelog.html
Expand Up @@ -55,14 +55,39 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=rfe>
Split the “raw HTML” markup formatter out of core into a bundled plugin.
<li class=bug>
Archiving of symlinks as artifacts did not work in some cases.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-21958">issue 21958</a>)
<li class=bug>
Slow rendering of directories with many entries in remote workspaces.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-21780">issue 21780</a>)
</ul>
</div><!--=TRUNK-END=-->

<!-- these changes are controlled by the release process. DO NOT MODIFY -->
<div id="rc" style="display:none;"><!--=BEGIN=-->
<h3><a name=v1.552>What's new in 1.552</a> <!--=DATE=--></h3>
<h3><a name=v1.553>What's new in 1.553</a> <!--=DATE=--></h3>
<ul class=image>
<li class=bug>
Build history widget only showed the last day of builds.
(Due to JENKINS-20892, even with this fix at most 20 builds are shown.)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-21159">issue 21159</a>)
<li class=bug>
Random class loading error mostly known to affect static analysis plugins.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-12124">issue 12124</a>)
<li class=bug>
After restarting Jenkins, users known only from changelogs could be shown as <code>First Last _first.last@some.org_</code>, breaking mail delivery.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-16332">issue 16332</a>)
<li class=bug>
CLI <code>build -s -v</code> command caused 100% CPU usage on the master.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-20965">issue 20965</a>)
<li class=rfe>
Slave started from Java Web Start can now install itself as a systemd service.
<li class=rfe>
Split the “raw HTML” markup formatter out of core into a bundled plugin.
</ul>
</div><!--=END=-->
<h3><a name=v1.552>What's new in 1.552</a> (2014/02/24)</h3>
<ul class=image>
<li class=bug>
Fixed handling of default JENKINS_HOME when storing CLI credentials
Expand All @@ -76,11 +101,7 @@ <h3><a name=v1.552>What's new in 1.552</a> <!--=DATE=--></h3>
<li class=bug>
Expensive symlink-related calls on Windows can be simplified.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-20534">issue 20534</a>)
<li class=bug>
Slow rendering of directories with many entries in remote workspaces.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-21780">issue 21780</a>)
</ul>
</div><!--=END=-->
<h3><a name=v1.551>What's new in 1.551</a> (2014/02/14)</h3>
<ul class=image>
<li class='major bug'>
Expand Down Expand Up @@ -236,12 +257,12 @@ <h3><a name=v1.544>What's new in 1.544</a> (2013/12/15)</h3>
<li class=bug>
JavaScript errors when navigating away from a page with a build timeline widget while the timeline is loading.
(<a href="https://github.com/jenkinsci/jenkins/pull/1041">pull request 1041</a>)
</ul>
<h3><a name=v1.543>What's new in 1.543</a> (2013/12/10)</h3>
<ul class=image>
<li class=bug>
Fixed a possible dead lock problem in deleting projects.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-19446">issue 19446</a>)
</ul>
<h3><a name=v1.543>What's new in 1.543</a> (2013/12/10)</h3>
<ul class=image>
<li class=bug>
HTML metacharacters not escaped in log messages.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-20800">issue 20800</a>)
Expand Down
2 changes: 1 addition & 1 deletion cli/pom.xml
Expand Up @@ -5,7 +5,7 @@
<parent>
<artifactId>pom</artifactId>
<groupId>org.jenkins-ci.main</groupId>
<version>1.553-SNAPSHOT</version>
<version>1.554-SNAPSHOT</version>
</parent>

<artifactId>cli</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Expand Up @@ -29,7 +29,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>pom</artifactId>
<version>1.553-SNAPSHOT</version>
<version>1.554-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
20 changes: 5 additions & 15 deletions core/src/main/java/hudson/ClassicPluginStrategy.java
Expand Up @@ -56,7 +56,6 @@
import java.io.FilenameFilter;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
Expand All @@ -72,7 +71,6 @@
import java.util.logging.Logger;

public class ClassicPluginStrategy implements PluginStrategy {
private final ClassLoaderReflectionToolkit clt = new ClassLoaderReflectionToolkit();

/**
* Filter for jar files.
Expand Down Expand Up @@ -569,10 +567,10 @@ protected Class<?> findClass(String name) throws ClassNotFoundException {
if (PluginManager.FAST_LOOKUP) {
for (PluginWrapper pw : getTransitiveDependencies()) {
try {
Class c = clt.findLoadedClass(pw.classLoader,name);
Class<?> c = ClassLoaderReflectionToolkit._findLoadedClass(pw.classLoader, name);
if (c!=null) return c;
return clt.findClass(pw.classLoader,name);
} catch (InvocationTargetException e) {
return ClassLoaderReflectionToolkit._findClass(pw.classLoader, name);
} catch (ClassNotFoundException e) {
//not found. try next
}
}
Expand All @@ -596,15 +594,11 @@ protected Enumeration<URL> findResources(String name) throws IOException {
HashSet<URL> result = new HashSet<URL>();

if (PluginManager.FAST_LOOKUP) {
try {
for (PluginWrapper pw : getTransitiveDependencies()) {
Enumeration<URL> urls = clt.findResources(pw.classLoader, name);
Enumeration<URL> urls = ClassLoaderReflectionToolkit._findResources(pw.classLoader, name);
while (urls != null && urls.hasMoreElements())
result.add(urls.nextElement());
}
} catch (InvocationTargetException e) {
throw new Error(e);
}
} else {
for (Dependency dep : dependencies) {
PluginWrapper p = pluginManager.getPlugin(dep.shortName);
Expand All @@ -622,14 +616,10 @@ protected Enumeration<URL> findResources(String name) throws IOException {
@Override
protected URL findResource(String name) {
if (PluginManager.FAST_LOOKUP) {
try {
for (PluginWrapper pw : getTransitiveDependencies()) {
URL url = clt.findResource(pw.classLoader,name);
URL url = ClassLoaderReflectionToolkit._findResource(pw.classLoader, name);
if (url!=null) return url;
}
} catch (InvocationTargetException e) {
throw new Error(e);
}
} else {
for (Dependency dep : dependencies) {
PluginWrapper p = pluginManager.getPlugin(dep.shortName);
Expand Down
19 changes: 10 additions & 9 deletions core/src/main/java/hudson/FilePath.java
Expand Up @@ -665,7 +665,7 @@ public Void invoke(File dir, VirtualChannel channel) throws IOException {
private static final long serialVersionUID = 1L;
});
} finally {
IOUtils.closeQuietly(_in);
org.apache.commons.io.IOUtils.closeQuietly(_in);
}
}

Expand Down Expand Up @@ -815,7 +815,7 @@ public void copyFrom(URL url) throws IOException, InterruptedException {
public void copyFrom(InputStream in) throws IOException, InterruptedException {
OutputStream os = write();
try {
IOUtils.copy(in, os);
org.apache.commons.io.IOUtils.copy(in, os);
} finally {
os.close();
}
Expand Down Expand Up @@ -846,7 +846,7 @@ public void copyFrom(FileItem file) throws IOException, InterruptedException {
InputStream i = file.getInputStream();
OutputStream o = write();
try {
IOUtils.copy(i,o);
org.apache.commons.io.IOUtils.copy(i,o);
} finally {
try {
o.close();
Expand Down Expand Up @@ -1640,8 +1640,8 @@ public Void call() throws IOException {
Util.copyStream(fis,p.getOut());
return null;
} finally {
IOUtils.closeQuietly(fis);
IOUtils.closeQuietly(p.getOut());
org.apache.commons.io.IOUtils.closeQuietly(fis);
org.apache.commons.io.IOUtils.closeQuietly(p.getOut());
}
}
});
Expand All @@ -1655,7 +1655,7 @@ public Void call() throws IOException {
public String readToString() throws IOException {
InputStream in = read();
try {
return IOUtils.toString(in);
return org.apache.commons.io.IOUtils.toString(in);
} finally {
in.close();
}
Expand Down Expand Up @@ -1815,8 +1815,8 @@ public Void invoke(File f, VirtualChannel channel) throws IOException {
Util.copyStream(fis,out);
return null;
} finally {
IOUtils.closeQuietly(fis);
IOUtils.closeQuietly(out);
org.apache.commons.io.IOUtils.closeQuietly(fis);
org.apache.commons.io.IOUtils.closeQuietly(out);
}
}
});
Expand Down Expand Up @@ -1933,7 +1933,7 @@ public Integer invoke(File base, VirtualChannel channel) throws IOException {
@Override public void visit(File f, String relativePath) throws IOException {
if (f.isFile()) {
File target = new File(dest, relativePath);
target.getParentFile().mkdirs();
IOUtils.mkdirs(target.getParentFile());
Util.copyFile(f, target);
count.incrementAndGet();
}
Expand All @@ -1943,6 +1943,7 @@ public Integer invoke(File base, VirtualChannel channel) throws IOException {
}
@Override public void visitSymlink(File link, String target, String relativePath) throws IOException {
try {
IOUtils.mkdirs(new File(dest, relativePath).getParentFile());
Util.createSymlink(dest, target, relativePath, TaskListener.NULL);
} catch (InterruptedException x) {
throw (IOException) new IOException(x.toString()).initCause(x);
Expand Down
21 changes: 5 additions & 16 deletions core/src/main/java/hudson/PluginManager.java
Expand Up @@ -82,7 +82,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.lang.ref.WeakReference;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.URL;
import java.util.ArrayList;
Expand Down Expand Up @@ -941,8 +940,6 @@ public final class UberClassLoader extends ClassLoader {
*/
private ConcurrentMap<String, WeakReference<Class>> generatedClasses = new ConcurrentHashMap<String, WeakReference<Class>>();

private ClassLoaderReflectionToolkit clt = new ClassLoaderReflectionToolkit();

public UberClassLoader() {
super(PluginManager.class.getClassLoader());
}
Expand All @@ -963,11 +960,11 @@ protected Class<?> findClass(String name) throws ClassNotFoundException {
if (FAST_LOOKUP) {
for (PluginWrapper p : activePlugins) {
try {
Class c = clt.findLoadedClass(p.classLoader,name);
Class<?> c = ClassLoaderReflectionToolkit._findLoadedClass(p.classLoader, name);
if (c!=null) return c;
// calling findClass twice appears to cause LinkageError: duplicate class def
return clt.findClass(p.classLoader,name);
} catch (InvocationTargetException e) {
return ClassLoaderReflectionToolkit._findClass(p.classLoader, name);
} catch (ClassNotFoundException e) {
//not found. try next
}
}
Expand All @@ -987,15 +984,11 @@ protected Class<?> findClass(String name) throws ClassNotFoundException {
@Override
protected URL findResource(String name) {
if (FAST_LOOKUP) {
try {
for (PluginWrapper p : activePlugins) {
URL url = clt.findResource(p.classLoader,name);
URL url = ClassLoaderReflectionToolkit._findResource(p.classLoader, name);
if(url!=null)
return url;
}
} catch (InvocationTargetException e) {
throw new Error(e);
}
} else {
for (PluginWrapper p : activePlugins) {
URL url = p.classLoader.getResource(name);
Expand All @@ -1010,13 +1003,9 @@ protected URL findResource(String name) {
protected Enumeration<URL> findResources(String name) throws IOException {
List<URL> resources = new ArrayList<URL>();
if (FAST_LOOKUP) {
try {
for (PluginWrapper p : activePlugins) {
resources.addAll(Collections.list(clt.findResources(p.classLoader, name)));
resources.addAll(Collections.list(ClassLoaderReflectionToolkit._findResources(p.classLoader, name)));
}
} catch (InvocationTargetException e) {
throw new Error(e);
}
} else {
for (PluginWrapper p : activePlugins) {
resources.addAll(Collections.list(p.classLoader.getResources(name)));
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/cli/ConsoleCommand.java
Expand Up @@ -77,7 +77,7 @@ protected int run() throws Exception {
} else {
InputStream in = run.getLogInputStream();
IOUtils.skip(in,pos);
IOUtils.copy(new InputStreamReader(in,run.getCharset()),w);
org.apache.commons.io.IOUtils.copy(new InputStreamReader(in,run.getCharset()),w);
}
} finally {
w.flush(); // this pointless flush needed to work around SSHD-154
Expand Down Expand Up @@ -134,7 +134,7 @@ long get() {

return rb.get();
} finally {
IOUtils.closeQuietly(in);
org.apache.commons.io.IOUtils.closeQuietly(in);
}
}

Expand Down

0 comments on commit ae5a3cb

Please sign in to comment.