提交 7e3bc36b 编写于 作者: J Jerome Lacoste

Revert "merge changelog.html fixes from kk"

Note that the above description is incorrect as to what the merge was about.
It is the message that I intended to make. It appears that I accidentaly merged multiple fixes waiting to be reviewed on my private fork.

This reverts commit dce0d2af, reversing
changes made to 63f67f30.
上级 dce0d2af
* check classes moved to stapler
* check why we can't just use IOUtil
* check cases where we don't want to closeQuietly. We should at least log. Why not having a global error handler instead ?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!--
......@@ -16,8 +15,7 @@ Some tips:
- link to bugs in the issue tracker, e-mail thread in the archive, and so on if you can.
-->
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<head id="head">
<title>Changelog</title>
<link rel="alternate" title="Hudson announcements" href="https://hudson.dev.java.net/servlets/ProjectNewsRSS" type="application/rss+xml">
<link rel="stylesheet" TYPE="text/css" href="changelog.css">
......@@ -40,14 +38,14 @@ Some tips:
<div id="ratings" style="display:none; font-size:120%;
border:1px solid black; background-color:#eee; padding:0.5em; margin-bottom:1em">
Help other Hudson users by letting the community know which releases you've used,
and whether they had any significant issues. <br>
Legend: <br>
and whether they had any significant issues. <br/>
Legend: <br/>
<img src="http://ci.jenkins-ci.org/images/16x16/health-80plus.gif" width="16" height="16"
alt="Sunny"> = I use it on my production site without major issues. <br>
alt="Sunny"/> = I use it on my production site without major issues. <br/>
<img src="http://ci.jenkins-ci.org/images/16x16/health-40to59.gif" width="16" height="16"
alt="Cloudy"> = I don't recommend it. <br>
alt="Cloudy"/> = I don't recommend it. <br/>
<img src="http://ci.jenkins-ci.org/images/16x16/health-00to19.gif" width="16" height="16"
alt="Lightning"> = I tried it but rolled back to a previous version. <br>
alt="Lightning"/> = I tried it but rolled back to a previous version. <br/>
View ratings below, and click one of the icons next to your version to provide your input.
</div>
......@@ -116,7 +114,7 @@ Upcoming changes</a>
If the JNLP-connected slave drops out without the master not noticing, allow the reconnection
without rejecting it.
(<a href="http://issues.jenkins-ci.org/browse/JENKINS-5055">issue 5055</a>)
<li class='major rfe'>
<li class'major rfe'>
Fixed a trademark bug that caused a considerable fiasco by renaming to Jenkins
</ul>
<h3><a name=v1.395>What's new in 1.395</a> (2011/01/21)</h3>
......@@ -326,7 +324,7 @@ Upcoming changes</a>
<li class=rfe>
Update bundled subversion plugin to version 1.20 and ssh-slaves to version 0.14.
</ul>
<h4><s><a name=v1.385>What's new in 1.385</a> (2010/11/15)</s></h4>
<s><h4><a name=v1.385>What's new in 1.385</a> (2010/11/15)</h4></s>
<ul class=image>
<li class=rfe> Oops, same as 1.384
</ul>
......@@ -387,7 +385,7 @@ Upcoming changes</a>
<li class=rfe>
Improved packet fragmentation in Winstone when writing out HTTP responses.
<li class=rfe><a href="http://wiki.jenkins-ci.org/display/JENKINS//Extension+Point+for+Project+Views+Navigation">Extension Point to provide alternate UI for Project Views implemented</a>
(<a href="http://issues.jenkins-ci.org/browse/JENKINS-1467">issue 1467</a>)
</l> (<a href="http://issues.jenkins-ci.org/browse/JENKINS-1467">issue 1467</a>)
</ul>
<h3><a name=v1.380>What's new in 1.380</a> (2010/10/09)</h3>
<ul class=image>
......@@ -662,7 +660,7 @@ Upcoming changes</a>
Fix redirect after login when return URL has characters that need encoding.
(<a href="http://issues.jenkins-ci.org/browse/JENKINS-6960">issue 6960</a>)
<li class=bug>
&lt;input type='hidden'&gt; field shouldn't be getting the plain text password value.
&lt;input type='hidden'> field shouldn't be getting the plain text password value.
<li class=rfe>
Added a mechanism to register CLI option handler as an extension point.
<li class=rfe>
......@@ -1615,7 +1613,7 @@ Upcoming changes</a>
(<a href="http://issues.jenkins-ci.org/browse/JENKINS-4752">issue 4752</a>)
<li class='major bug'>
Fixed <tt>NotExportableException</tt> when making a remote API call on a project.
(<a href="https://hudson.dev.java.net/servlets/BrowseList?list=users&amp;by=thread&amp;from=2222483">report</a>)
(<a href="https://hudson.dev.java.net/servlets/BrowseList?list=users&by=thread&from=2222483">report</a>)
<li class=bug>
Fixed <tt>IllegalArgumentException: name</tt>
(<a href="http://old.nabble.com/bug-1.331-to26145963.html">report</a>)
......
......@@ -26,14 +26,12 @@ package hudson;
import hudson.util.DualOutputStream;
import hudson.util.EncodingStream;
import com.thoughtworks.xstream.core.util.Base64Encoder;
import hudson.util.IOUtils;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Writer;
......@@ -176,19 +174,11 @@ public class Main {
con.connect();
// send the data
FileInputStream in = new FileInputStream(tmpFile);
try {
Util.copyStream(in,con.getOutputStream());
} finally {
IOUtils.closeQuietly(in);
}
Util.copyStream(in,con.getOutputStream());
in.close();
if(con.getResponseCode()!=200) {
InputStream errorStream = con.getErrorStream();
try{
Util.copyStream(errorStream,System.err);
} finally{
IOUtils.closeQuietly(errorStream);
}
Util.copyStream(con.getErrorStream(),System.err);
}
return ret;
......
......@@ -306,7 +306,7 @@ public abstract class Proc {
try {
byte[] buf = new byte[8192];
int len;
while ((len = in.read(buf)) >= 0) {
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
out.flush();
}
......@@ -315,7 +315,7 @@ public abstract class Proc {
out.close();
}
} catch (IOException e) {
throw new RuntimeException(e);
// TODO: what to do?
}
}
}
......@@ -331,7 +331,7 @@ public abstract class Proc {
}
/**
* Remotely launched process via {@link hudson.remoting.Channel}.
* Retemoly launched process via {@link Channel}.
*/
public static final class RemoteProc extends Proc {
private final Future<Integer> process;
......
......@@ -61,13 +61,10 @@ public class UDPBroadcastThread extends Thread {
@Override
public void run() {
try {
try{
mcs.joinGroup(MULTICAST);
} finally{
ready.signal();
}
while(true) {
while(true) {
byte[] buf = new byte[2048];
DatagramPacket p = new DatagramPacket(buf,buf.length);
mcs.receive(p);
......
......@@ -419,19 +419,17 @@ public class Util {
}
}
// FIXME we are using 8k buffers instead of 4k in IOUtil. Do we really want to support our own version ? Or is it to avoid a dependency ?
public static void copyStream(InputStream in,OutputStream out) throws IOException {
byte[] buf = new byte[8192];
int len;
while((len=in.read(buf))>=0)
while((len=in.read(buf))>0)
out.write(buf,0,len);
}
// FIXME we are using 8k buffers instead of 4k in IOUtil. Do we really want to support our own version ? Or is it to avoid a dependency ?
public static void copyStream(Reader in, Writer out) throws IOException {
char[] buf = new char[8192];
int len;
while((len=in.read(buf))>=0)
while((len=in.read(buf))>0)
out.write(buf,0,len);
}
......@@ -521,7 +519,7 @@ public class Util {
DigestInputStream in =new DigestInputStream(source,md5);
try {
while(in.read(garbage)>=0)
while(in.read(garbage)>0)
; // simply discard the input
} finally {
in.close();
......
......@@ -113,16 +113,12 @@ public class LargeText {
final Session session = source.open();
public int read() throws IOException {
byte[] buf = new byte[1];
int n;
while ((n = session.read(buf)) != -1) {
if (n > 0) {
return buf[0];
}
}
return -1; // EOF
int n = session.read(buf);
if(n==1) return buf[0];
else return -1; // EOF
}
public int read(byte[] buf, int off, int len) throws IOException { // CHECKED-CALLERS
public int read(byte[] buf, int off, int len) throws IOException {
return session.read(buf,off,len);
}
......@@ -365,11 +361,11 @@ public class LargeText {
n -= in.skip(n);
}
public int read(byte[] buf) throws IOException { // CHECKED-CALLERS
public int read(byte[] buf) throws IOException {
return in.read(buf);
}
public int read(byte[] buf, int offset, int length) throws IOException { // CHECKED-CALLERS
public int read(byte[] buf, int offset, int length) throws IOException {
return in.read(buf,offset,length);
}
}
......
......@@ -291,7 +291,7 @@ public class TarInputStream extends FilterInputStream {
* @throws IOException on error
*/
public int read() throws IOException {
int num = this.read(this.oneBuf, 0, 1); // FIXME check if read() guarantees to return at least 1 character, otherwise bug lurking
int num = this.read(this.oneBuf, 0, 1);
return num == -1 ? -1 : ((int) this.oneBuf[0]) & 0xFF;
}
......
......@@ -138,7 +138,7 @@ public class ChunkedInputStream extends InputStream {
* @throws IOException if an IO problem occurs.
*/
@Override
public int read(byte[] b, int off, int len) throws IOException { // CHECKED-CALLERS
public int read (byte[] b, int off, int len) throws IOException {
if (closed) {
throw new IOException("Attempted read from closed stream.");
......@@ -168,7 +168,7 @@ public class ChunkedInputStream extends InputStream {
* @throws IOException if an IO problem occurs.
*/
@Override
public int read(byte[] b) throws IOException { // CHECKED-CALLERS
public int read (byte[] b) throws IOException {
return read(b, 0, b.length);
}
......
......@@ -140,8 +140,8 @@ public class CompressedFile {
try {
Util.copyStream(in,out);
} finally {
IOUtils.closeQuietly(in);
IOUtils.closeQuietly(out);
in.close();
out.close();
}
// if the compressed file is created successfully, remove the original
file.delete();
......
......@@ -57,7 +57,7 @@ public class HeadBufferingStream extends FilterInputStream {
}
@Override
public int read(byte b[], int off, int len) throws IOException { // CHECKED-CALLERS
public int read(byte b[], int off, int len) throws IOException {
int r = in.read(b, off, len);
if(r>0) {
int sp = space();
......
......@@ -57,7 +57,7 @@ public class StreamCopyThread extends Thread {
try {
byte[] buf = new byte[8192];
int len;
while ((len = in.read(buf)) >= 0)
while ((len = in.read(buf)) > 0)
out.write(buf, 0, len);
} finally {
// it doesn't make sense not to close InputStream that's already EOF-ed,
......@@ -67,7 +67,7 @@ public class StreamCopyThread extends Thread {
out.close();
}
} catch (IOException e) {
throw new RuntimeException(e);
// TODO: what to do?
}
}
}
......@@ -57,13 +57,10 @@ final class ZipArchiver extends Archiver {
} else {
zip.putNextEntry(new ZipEntry(relativePath));
FileInputStream in = new FileInputStream(f);
try {
int len;
while((len=in.read(buf))>=0)
zip.write(buf,0,len);
} finally {
in.close();
}
int len;
while((len=in.read(buf))>0)
zip.write(buf,0,len);
in.close();
zip.closeEntry();
}
entriesWritten++;
......
......@@ -47,7 +47,7 @@ public class FilePathTest extends ChannelTestCase {
* An attempt to reproduce the file descriptor leak.
* If this operation leaks a file descriptor, 2500 should be enough, I think.
*/
public void DISABLED_testCopyTo2() throws Exception {
public void testCopyTo2() throws Exception {
for (int j=0; j<2500; j++) {
File tmp = File.createTempFile("testCopyFrom","");
FilePath f = new FilePath(tmp);
......
......@@ -29,7 +29,6 @@ import org.apache.commons.io.IOUtils;
import java.io.IOException;
import java.net.URL;
import java.util.logging.Logger;
/**
* Quick test for {@link UpdateCenter}.
......@@ -37,13 +36,16 @@ import java.util.logging.Logger;
* @author Kohsuke Kawaguchi
*/
public class UpdateCenterTest extends TestCase {
private URL getDataFileURL(String name) {
return UpdateCenterTest.class.getResource(name);
}
public void testData() throws IOException {
URL url = getDataFileURL("light_update-center.json?version=build"); // we use the "light" version to speed things up.
// check if we have the internet connectivity. See HUDSON-2095
try {
new URL("http://updates.hudson-labs.org/").openStream();
} catch (IOException e) {
System.out.println("Skipping this test. No internet connectivity");
return;
}
URL url = new URL("http://updates.hudson-labs.org/update-center.json?version=build");
String jsonp = IOUtils.toString(url.openStream());
String json = jsonp.substring(jsonp.indexOf('(')+1,jsonp.lastIndexOf(')'));
......@@ -51,6 +53,6 @@ public class UpdateCenterTest extends TestCase {
UpdateSite.Data data = us.new Data(JSONObject.fromObject(json));
assertTrue(data.core.url.startsWith("http://updates.hudson-labs.org/"));
assertTrue(data.plugins.containsKey("rake"));
Logger.getLogger(UpdateCenterTest.class.getName()).fine(data.core.url);
System.out.println(data.core.url);
}
}
......@@ -28,7 +28,6 @@ import java.text.DateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Locale;
import java.util.logging.Logger;
import junit.framework.TestCase;
import org.jvnet.hudson.test.Bug;
......@@ -157,9 +156,8 @@ public class CronTabTest extends TestCase {
*/
private void compare(Calendar a, Calendar b) {
DateFormat f = DateFormat.getDateTimeInstance();
String msg = f.format(a.getTime()) + " vs " + f.format(b.getTime());
Logger.getLogger(CronTabTest.class.getName()).fine(msg);
assertEquals(msg, a,b);
System.out.println(f.format(a.getTime())+" vs "+f.format(b.getTime()));
assertEquals(a,b);
}
}
......@@ -40,7 +40,6 @@ import hudson.util.DescribableList;
import java.io.File;
import java.io.IOException;
import java.util.Set;
import java.util.logging.Logger;
import org.apache.commons.io.FileUtils;
......@@ -123,7 +122,7 @@ public class NodeListTest extends TestCase {
x.write(nl);
String xml = FileUtils.readFileToString(tmp);
Logger.getLogger(NodeListTest.class.getName()).fine(xml);
System.out.println(xml);
assertEquals(4,xml.split("\n").length);
NodeList back = (NodeList)x.read();
......
......@@ -32,7 +32,6 @@ import java.util.Iterator;
import java.util.Set;
import java.util.HashSet;
import java.util.Map.Entry;
import java.util.logging.Logger;
/**
* @author Kohsuke Kawaguchi
......@@ -47,7 +46,7 @@ public class ConsistentHashTest extends TestCase {
hash.add("data2");
hash.add("data3");
Logger.getLogger(ConsistentHashTest.class.getName()).fine(hash.lookup(0));
System.out.println(hash.lookup(0));
// there's one in 2^32 chance that this test fails, but these two query points are
// only off by one.
......@@ -83,9 +82,9 @@ public class ConsistentHashTest extends TestCase {
else odd++;
}
// again, there's a small chance tha this test fails.
String msg = ""+even+"/"+odd;
assertTrue(msg,even*8<odd);
// again, there's a small chance tha this test fails.
System.out.printf("%d/%d\n",even,odd);
assertTrue(even*8<odd);
}
/**
......
......@@ -5,7 +5,6 @@ import junit.framework.TestCase;
import java.util.Map;
import java.util.Map.Entry;
import java.util.TreeMap;
import java.util.logging.Logger;
/**
* @author Kohsuke Kawaguchi
......@@ -27,7 +26,7 @@ public class PackedMapTest extends TestCase {
assertEquals("d", p.get("c"));
assertEquals(p.size(),2);
for (Entry<String,String> e : p.entrySet()) {
Logger.getLogger(PackedMapTest.class.getName()).fine(e.getKey()+'='+e.getValue());
System.out.println(e.getKey()+'='+e.getValue());
}
Holder h = new Holder();
......
......@@ -33,7 +33,8 @@ import java.util.Arrays;
public class QuotedStringTokenizerTest extends TestCase {
private void check(String src, String... expected) {
String[] r = QuotedStringTokenizer.tokenize(src);
assertTrue(Arrays.asList(r).toString(), Arrays.equals(r, expected));
System.out.println(Arrays.asList(r));
assertTrue(Arrays.equals(r, expected));
}
public void test1() {
......
......@@ -51,7 +51,8 @@ public class SecretTest extends TestCase {
assertEquals("abc",secret.getPlainText());
// make sure we got some encryption going
assertNotSame("abc", secret.getEncryptedValue());
System.out.println(secret.getEncryptedValue());
assertTrue(!"abc".equals(secret.getEncryptedValue()));
// can we round trip?
assertEquals(secret,Secret.fromString(secret.getEncryptedValue()));
......
......@@ -29,7 +29,6 @@ import hudson.model.Result;
import hudson.model.Run;
import java.util.Map;
import java.util.logging.Logger;
/**
* Tests for XML serialization of java objects.
......@@ -37,9 +36,7 @@ import java.util.logging.Logger;
*/
public class XStream2Test extends TestCase {
public static final Logger LOGGER = Logger.getLogger(XStream2Test.class.getName());
public static final class Foo {
public static final class Foo {
Result r1,r2;
}
......@@ -147,7 +144,7 @@ public class XStream2Test extends TestCase {
ImmutableMapHolder a = new ImmutableMapHolder();
a.m = m;
String xml = xs.toXML(a);
LOGGER.fine(xml);
System.out.println(xml);
assertFalse("shouldn't contain the class name",xml.contains("google"));
assertFalse("shouldn't contain the class name",xml.contains("class"));
a = (ImmutableMapHolder)xs.fromXML(xml);
......@@ -160,7 +157,7 @@ public class XStream2Test extends TestCase {
MapHolder a = new MapHolder();
a.m = m;
String xml = xs.toXML(a);
LOGGER.fine(xml);
System.out.println(xml);
assertTrue("XML should mention the class name",xml.contains('\"'+ImmutableMap.class.getName()+'\"'));
a = (MapHolder)xs.fromXML(xml);
......
updateCenter.post(
{
"connectionCheckUrl": "http://www.google.com/",
"core": {
"buildDate": "Jan 21, 2011",
"name": "core",
"url": "http://updates.hudson-labs.org/download/war/1.395/hudson.war",
"version": "1.395"
},
"id": "default",
"plugins": {
"rake": {
"buildDate": "Oct 30, 2010",
"dependencies": [],
"developers": [ {
"developerId": "david_calavera",
"email": "calavera@apache.org",
"name": "David Calavera"
}],
"excerpt": "This plugin allows Hudson to invoke <a href='http://rake.rubyforge.org'>Rake<\/a> tasks as build steps.",
"labels": ["builder"],
"name": "rake",
"previousTimestamp": "2010-10-28T22:18:02.00Z",
"previousVersion": "1.7.2",
"releaseTimestamp": "2010-10-30T16:33:22.00Z",
"requiredCore": "1.376",
"scm": "github.com",
"title": "Rake plugin",
"url": "http://updates.hudson-labs.org/download/plugins/rake/1.7.3/rake.hpi",
"version": "1.7.3",
"wiki": "http://wiki.hudson-ci.org//display/HUDSON/Rake+plugin"
},
"rebuild": {
"buildDate": "Sep 15, 2010",
"dependencies": [],
"developers": [ {
"developerId": "ragesh_nair",
"email": "ragesh.x.nair@sonyericsson.com",
"name": "Ragesh Nair"
}],
"excerpt": "This plugin allows the user to _rebuild_ a _parameterized build_ without entering the _parameters_ again.",
"labels": ["misc"],
"name": "rebuild",
"previousTimestamp": "2010-07-16T20:17:48.00Z",
"previousVersion": "1.1",
"releaseTimestamp": "2010-09-15T14:07:48.00Z",
"requiredCore": "1.354",
"scm": "svn.dev.java.net",
"title": "Rebuild Plugin",
"url": "http://updates.hudson-labs.org/download/plugins/rebuild/1.4/rebuild.hpi",
"version": "1.4",
"wiki": "http://wiki.hudson-ci.org//display/HUDSON/Rebuild+Plugin"
},
},
"signature": {
"certificates": ["MIIE8jCCA9qgAwIBAgIBBjANBgkqhkiG9w0BAQUFADCBojELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFDASBgNVBAcTC1NhbnRhIENsYXJhMRcwFQYDVQQKEw5IdWRzb24gcHJvamVjdDEXMBUGA1UECxMOSHVkc29uIFJvb3QgQ0ExFzAVBgNVBAMTDkh1ZHNvbiBSb290IENBMR0wGwYJKoZIhvcNAQkBFg5odWRzb25Ac3VuLmNvbTAeFw0xMDA0MTgyMzQzMzhaFw0xMTA0MTgyMzQzMzhaMIGVMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEBxMIU2FuIEpvc2UxDzANBgNVBAoTBkh1ZHNvbjEPMA0GA1UECxMGSHVkc29uMR0wGwYDVQQDExRIdWRzb24gVXBkYXRlIENlbnRlcjEdMBsGCSqGSIb3DQEJARYOa2tAa29oc3VrZS5vcmcwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDUQ7uN/ZQvyHvi5UONr2CAmWfWiAPPqaF4SS7dTIaLM/sxRgnZY1k7zt/8MTce7gNOd2EyCru93EgMVY1ivEH4b9fYSlzSnu8Lx2RdMulW0iqinLY17Jv+J1qxq+tRUyMa9y3DN28sf7ydLcpEJog3Of6KL+zJlKQS0oNcgsju9LdfzccmMu8Qq3lNhtcdsPkcRWpHyGiyva99xXBR/pqxM0GR8aMZYNwLi59Vg8/fpkTLwhBGVOgEIdO4ARvH/HTlfaLdr2pJ5BfsODk7A3VHV2ObDYIa+skEy1PPvtLv3/TfI/nD9Owt/TlpyI5aAbd1lboUrsPNyKjiR6GIfOcFAgMBAAGjggE8MIIBODAJBgNVHRMEAjAAMB0GA1UdDgQWBBSMP/tadXU+XdrmlxxDSCZeyMAcbDCB1wYDVR0jBIHPMIHMgBRRpkLqhXylaDmRPhWgCQ0fl62cX6GBqKSBpTCBojELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFDASBgNVBAcTC1NhbnRhIENsYXJhMRcwFQYDVQQKEw5IdWRzb24gcHJvamVjdDEXMBUGA1UECxMOSHVkc29uIFJvb3QgQ0ExFzAVBgNVBAMTDkh1ZHNvbiBSb290IENBMR0wGwYJKoZIhvcNAQkBFg5odWRzb25Ac3VuLmNvbYIJAImLL4rgC+O7MDIGCWCGSAGG+EIBBAQlFiNodHRwOi8vaHVkc29uLWNpLm9yZy9odWRzb24tY3JsLnBlbTANBgkqhkiG9w0BAQUFAAOCAQEADs3NHx8j+x45msMgjHPoMb4yvz42vI1ea4UyYHrDZGlEsK7kfVbNHNpt+UGZaws0b+f6brL/3DA9w0niCTucHMd+ZqqFGpXHvV/IVVrR7omLgQ6EdinYYDXzIl/1Z97jeRDmL4/kckxxGyTyw/Y4/YatmVSM8ZESY3W9lYS9P90I+Jmo0e4W6tY+ztPrsw3C3ixmvfqG++YQTjZivr/5sCUd6UJHAz7XuX9Eqgyz2Od1wOazmtP7TEsQVEwiJXGB5HFLw7qtC51K3VdAj43nm+qgKe0U3yOw57EYKlntQzCWF24ucOZ1QhpvrIlzcD1q4AlIdlTD0OtuP9uGIYCTjA=="],
"digest": "5GfPwsLf4xDFFg4/g4r4WofnS70=",
"signature": "SKTyc4xy6OV2+ClP/4edsGGJv/E8qcR+gyAB/HUvfztB+9D2DiHLJAQVXx0PnPQZeHB1sZnNfEEH/gGg0cf7lfJBIU6fIMGrqzoAIQvTxG7ZNgjhba/+ojDjM222R8Sy19hGws4/pO4d+W9CwRSNNz8FZqGPxnV4k21IfQ9QF8lxCguetXzWX2edJT2fr4j32bFtbDxfsUdYNc4D6F8/8BScQpoHgBNVqLa8oWRUpn6qae2hfLXkAixeHlDDNbEZWuQ7g/kmXrn5COf0vVH4Jrr1L8QzVvifjrVbM55UZl2tv/EExUJXYeVUJMmA1wmvpwbr+6Pr9tIeKsq51sqTVw=="
},
"updateCenterVersion": "1"
}
);
......@@ -90,7 +90,7 @@ public class LaunchTest extends TestCase {
public static void copyStream(InputStream in, OutputStream out) throws IOException {
byte[] buf = new byte[8192];
int len;
while((len=in.read(buf))>=0)
while((len=in.read(buf))>0)
out.write(buf,0,len);
}
}
......@@ -186,10 +186,7 @@ public final class BinarySafeStream {
int avail = super.available();
if(avail >0) {
byte[] buf = new byte[avail];
int len2 = super.read(buf);
if (len2 > 0) {
baos.write(buf,0,len2);
}
baos.write(buf,0,super.read(buf));
}
StringBuilder buf = new StringBuilder("Invalid encoded sequence encountered:");
for (byte ch : baos.toByteArray())
......
......@@ -143,11 +143,11 @@ public class FastPipedInputStream extends InputStream {
public int read() throws IOException {
byte[] b = new byte[1];
return read(b, 0, b.length) == -1 ? -1 : (255 & b[0]); // FIXME check if read() guarantees to return at least 1 character, otherwise bug lurking
return read(b, 0, b.length) == -1 ? -1 : (255 & b[0]);
}
@Override
public int read(byte[] b) throws IOException { // CHECKED-CALLERS
public int read(byte[] b) throws IOException {
return read(b, 0, b.length);
}
......
......@@ -453,12 +453,9 @@ final class RemoteClassLoader extends URLClassLoader {
byte[] buf = new byte[8192];
int len;
try {
while((len=in.read(buf))>=0)
baos.write(buf,0,len);
} finally {
in.close();
}
while((len=in.read(buf))>0)
baos.write(buf,0,len);
in.close();
return baos.toByteArray();
}
......
......@@ -68,11 +68,11 @@ public class RemoteInputStream extends InputStream implements Serializable {
return core.read();
}
public int read(byte[] b) throws IOException { // CHECKED-CALLERS
public int read(byte[] b) throws IOException {
return core.read(b);
}
public int read(byte[] b, int off, int len) throws IOException { // CHECKED-CALLERS
public int read(byte[] b, int off, int len) throws IOException {
return core.read(b, off, len);
}
......
......@@ -24,14 +24,14 @@ final class CopyThread extends Thread {
try {
byte[] buf = new byte[8192];
int len;
while ((len = in.read(buf)) >= 0)
while ((len = in.read(buf)) > 0)
out.write(buf, 0, len);
} finally {
in.close();
out.close();
}
} catch (IOException e) {
throw new RuntimeException(e);
// TODO: what to do?
}
}
}
......@@ -46,14 +46,11 @@ class Copier extends Thread {
try {
byte[] buf = new byte[8192];
int len;
try {
while((len=in.read(buf))>=0)
out.write(buf,0,len);
} finally {
in.close();
}
while((len=in.read(buf))>0)
out.write(buf,0,len);
in.close();
} catch (IOException e) {
throw new RuntimeException(e);
// TODO: what to do?
}
}
}
......@@ -45,12 +45,9 @@ public class TestCallable implements Callable {
byte[] buf = new byte[8192];
int len;
try {
while((len=in.read(buf))>=0)
baos.write(buf,0,len);
} finally {
in.close();
}
while((len=in.read(buf))>0)
baos.write(buf,0,len);
in.close();
r[1] = baos.toByteArray();
......
......@@ -294,7 +294,7 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
WebClient c = client.get();
if(c==null) continue;
// unload the page to cancel asynchronous operations
safeUnloadPage(c, 2);
c.getPage("about:blank");
}
clients.clear();
} finally {
......@@ -315,16 +315,6 @@ public abstract class HudsonTestCase extends TestCase implements RootAction {
}
}
private void safeUnloadPage(WebClient c, int maxTries) {
if (maxTries == 0) return;
try{
c.getPage("about:blank");
} catch(Exception e){
e.printStackTrace();
safeUnloadPage(c, maxTries--);
}
}
@Override
protected void runTest() throws Throwable {
System.out.println("=== Starting "+ getClass().getSimpleName() + "." + getName());
......
......@@ -17,8 +17,6 @@ import java.io.IOException;
* @author Kohsuke Kawaguchi
*/
public class UDPBroadcastThreadTest extends HudsonTestCase {
// FIXME these tests will fail if don't have a network link
/**
* Old unicast based clients should still be able to receive some reply,
* as we haven't changed the port.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册