Merge branch 'master' of ssh://git.eclipse.org/gitroot/jetty/org.eclipse.jetty.project

This commit is contained in:
Jan Bartel 2011-07-15 15:21:23 +10:00
commit 82adc6cad4
3 changed files with 21 additions and 11 deletions

View File

@ -16,6 +16,7 @@ import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLConnection;
import java.util.List;
import org.eclipse.jetty.osgi.boot.utils.BundleClassLoaderHelper;
import org.osgi.framework.Bundle;
@ -145,8 +146,21 @@ public class DefaultBundleClassLoaderHelper implements BundleClassLoaderHelper
"m_modules");
Felix_BundleImpl_m_modules_field.setAccessible(true);
}
Object[] moduleArray = (Object[])Felix_BundleImpl_m_modules_field.get(bundle);
Object currentModuleImpl = moduleArray[moduleArray.length - 1];
// Figure out which version of the modules is exported
Object currentModuleImpl;
try
{
Object[] moduleArray = (Object[])Felix_BundleImpl_m_modules_field.get(bundle);
currentModuleImpl = moduleArray[moduleArray.length - 1];
}
catch (Throwable t2)
{
@SuppressWarnings("unchecked")
List<Object> moduleArray = (List<Object>)Felix_BundleImpl_m_modules_field.get(bundle);
currentModuleImpl = moduleArray.get(moduleArray.size() - 1);
}
if (Felix_ModuleImpl_m_classLoader_field == null && currentModuleImpl != null)
{
Felix_ModuleImpl_m_classLoader_field = bundle.getClass().getClassLoader().loadClass("org.apache.felix.framework.ModuleImpl").getDeclaredField(

View File

@ -190,7 +190,6 @@ public abstract class ConnectorCloseTestBase extends HttpServerTestFixture
/* ------------------------------------------------------------ */
public class ResponseReader implements Runnable
{
private int _last = 0;
private boolean _done = false;
protected char[] _buffer;
@ -225,7 +224,7 @@ public abstract class ConnectorCloseTestBase extends HttpServerTestFixture
try
{
int count = 0;
while (!_done || _last > 0 || count > 0)
while (!_done || count > 0)
{
count = doRead();
}
@ -245,10 +244,8 @@ public abstract class ConnectorCloseTestBase extends HttpServerTestFixture
/* ------------------------------------------------------------ */
protected int doRead() throws IOException, InterruptedException
{
if (_last > 0)
if (!_reader.ready())
{
_last = 0;
Thread.sleep(25);
}
@ -258,7 +255,6 @@ public abstract class ConnectorCloseTestBase extends HttpServerTestFixture
count = _reader.read(_buffer);
if (count > 0)
{
_last = count;
_response.append(_buffer, 0, count);
}
}

View File

@ -480,10 +480,10 @@ public class XmlParser
/**
* XML Node. Represents an XML element with optional attributes and ordered content.
*/
public static class Node extends AbstractList
public static class Node extends AbstractList<Object>
{
Node _parent;
private ArrayList _list;
private ArrayList<Object> _list;
private String _tag;
private Attribute[] _attrs;
private boolean _lastString = false;
@ -623,7 +623,7 @@ public class XmlParser
public void add(int i, Object o)
{
if (_list == null)
_list = new ArrayList();
_list = new ArrayList<Object>();
if (o instanceof String)
{
if (_lastString)