aboutsummaryrefslogtreecommitdiff
path: root/libjava/classpath/java
diff options
context:
space:
mode:
authorMark Wielaard <mark@gcc.gnu.org>2005-11-18 00:59:33 +0000
committerMark Wielaard <mark@gcc.gnu.org>2005-11-18 00:59:33 +0000
commitca9e049bc145ae985bc0e2dd6079dacdd51717ac (patch)
tree4c44aaa3ed1ee1b4f15732664c05cfc9214e1fa9 /libjava/classpath/java
parentfb3a09c214e19c97d3751003d9a2ea8008f5005e (diff)
downloadgcc-ca9e049bc145ae985bc0e2dd6079dacdd51717ac.zip
gcc-ca9e049bc145ae985bc0e2dd6079dacdd51717ac.tar.gz
gcc-ca9e049bc145ae985bc0e2dd6079dacdd51717ac.tar.bz2
Imported GNU Classpath gcj-import-20051117.
* gnu/java/net/protocol/file/Connection.java: Removed, fully merged. * sources.am: Regenerated. * Makefile.in: Likewise. From-SVN: r107153
Diffstat (limited to 'libjava/classpath/java')
-rw-r--r--libjava/classpath/java/awt/Component.java33
-rw-r--r--libjava/classpath/java/awt/Container.java24
-rw-r--r--libjava/classpath/java/awt/image/MemoryImageSource.java2
-rw-r--r--libjava/classpath/java/io/FilePermission.java8
-rw-r--r--libjava/classpath/java/net/URL.java12
-rw-r--r--libjava/classpath/java/net/URLClassLoader.java98
-rw-r--r--libjava/classpath/java/security/ProtectionDomain.java4
7 files changed, 80 insertions, 101 deletions
diff --git a/libjava/classpath/java/awt/Component.java b/libjava/classpath/java/awt/Component.java
index 9b389e2..ec03d63 100644
--- a/libjava/classpath/java/awt/Component.java
+++ b/libjava/classpath/java/awt/Component.java
@@ -1409,7 +1409,6 @@ public abstract class Component
{
if (parent != null)
{
- Rectangle parentBounds = parent.getBounds();
Rectangle oldBounds = new Rectangle(oldx, oldy, oldwidth,
oldheight);
Rectangle newBounds = new Rectangle(x, y, width, height);
@@ -1887,13 +1886,7 @@ public abstract class Component
*/
public void repaint()
{
- if(!isShowing())
- {
- Component p = parent;
- if (p != null)
- p.repaint(0, getX(), getY(), width, height);
- }
- else
+ if (isShowing())
repaint(0, 0, 0, width, height);
}
@@ -1908,13 +1901,7 @@ public abstract class Component
*/
public void repaint(long tm)
{
- if(!isShowing())
- {
- Component p = parent;
- if (p != null)
- p.repaint(tm, getX(), getY(), width, height);
- }
- else
+ if (isShowing())
repaint(tm, 0, 0, width, height);
}
@@ -1932,13 +1919,7 @@ public abstract class Component
*/
public void repaint(int x, int y, int w, int h)
{
- if(!isShowing())
- {
- Component p = parent;
- if (p != null)
- p.repaint(0, x + getX(), y + getY(), width, height);
- }
- else
+ if (isShowing())
repaint(0, x, y, w, h);
}
@@ -1957,13 +1938,7 @@ public abstract class Component
*/
public void repaint(long tm, int x, int y, int width, int height)
{
- if(!isShowing())
- {
- Component p = parent;
- if (p != null)
- p.repaint(tm, x + getX(), y + getY(), width, height);
- }
- else
+ if (isShowing())
{
ComponentPeer p = peer;
if (p != null)
diff --git a/libjava/classpath/java/awt/Container.java b/libjava/classpath/java/awt/Container.java
index 4676895..ed791dc 100644
--- a/libjava/classpath/java/awt/Container.java
+++ b/libjava/classpath/java/awt/Container.java
@@ -123,6 +123,7 @@ public class Container extends Component
*/
public Container()
{
+ // Nothing to do here.
}
/**
@@ -427,7 +428,8 @@ public class Container extends Component
for (int j = 0; j < list.length; j++)
r.removeComponentListener(list[j]);
- r.removeNotify();
+ if (r.isShowing())
+ r.removeNotify();
System.arraycopy(component, index + 1, component, index,
ncomponents - index - 1);
@@ -846,7 +848,7 @@ public class Container extends Component
*/
public void paintComponents(Graphics g)
{
- super.paint(g);
+ paint(g);
visitChildren(g, GfxPaintAllVisitor.INSTANCE, true);
}
@@ -1972,6 +1974,7 @@ public class Container extends Component
*/
protected AccessibleContainerHandler()
{
+ // Nothing to do here.
}
/**
@@ -2039,8 +2042,7 @@ class LightweightDispatcher implements Serializable
* location, otherwise the appropriate component from the conditions
* above.
*/
- Component getDeepestComponentForMouseEventAt (
- Component parent, int x, int y)
+ Component getDeepestComponentForMouseEventAt(Component parent, int x, int y)
{
if (parent == null || (! parent.contains(x, y)))
return null;
@@ -2064,8 +2066,7 @@ class LightweightDispatcher implements Serializable
Point p = me.getPoint();
while (candidate == null && parent != null)
{
- candidate =
- getDeepestComponentForMouseEventAt(parent, p.x, p.y);
+ candidate = getDeepestComponentForMouseEventAt(parent, p.x, p.y);
if (candidate == null || (candidate.eventMask & me.getID()) == 0)
{
candidate = null;
@@ -2147,14 +2148,12 @@ class LightweightDispatcher implements Serializable
break;
}
- if (me.getID() == MouseEvent.MOUSE_RELEASED
- || me.getID() == MouseEvent.MOUSE_PRESSED && modifiers > 0
+ if (me.getID() == MouseEvent.MOUSE_PRESSED && modifiers > 0
|| me.getID() == MouseEvent.MOUSE_DRAGGED)
{
// If any of the following events occur while a button is held down,
// they should be dispatched to the same component to which the
// original MOUSE_PRESSED event was dispatched:
- // - MOUSE_RELEASED
// - MOUSE_PRESSED: another button pressed while the first is held
// down
// - MOUSE_DRAGGED
@@ -2204,10 +2203,13 @@ class LightweightDispatcher implements Serializable
// there is a CLICKED event after this, it will do clean up.
if (--pressCount == 0
&& mouseEventTarget != pressedComponent)
- pressedComponent = null;
+ {
+ pressedComponent = null;
+ pressCount = 0;
+ }
break;
}
-
+
MouseEvent newEvt =
AWTUtilities.convertMouseEvent(nativeContainer, me,
mouseEventTarget);
diff --git a/libjava/classpath/java/awt/image/MemoryImageSource.java b/libjava/classpath/java/awt/image/MemoryImageSource.java
index c27e0bf..95cd408 100644
--- a/libjava/classpath/java/awt/image/MemoryImageSource.java
+++ b/libjava/classpath/java/awt/image/MemoryImageSource.java
@@ -187,7 +187,7 @@ public class MemoryImageSource implements ImageProducer
ic = (ImageConsumer) list.elementAt(i);
sendPicture(ic);
if (animated)
- ic.imageComplete(ImageConsumer.SINGLEFRAME);
+ ic.imageComplete(ImageConsumer.SINGLEFRAMEDONE);
else
ic.imageComplete(ImageConsumer.STATICIMAGEDONE);
}
diff --git a/libjava/classpath/java/io/FilePermission.java b/libjava/classpath/java/io/FilePermission.java
index 356787b..31802c6 100644
--- a/libjava/classpath/java/io/FilePermission.java
+++ b/libjava/classpath/java/io/FilePermission.java
@@ -278,13 +278,13 @@ public final class FilePermission extends Permission implements Serializable
break;
}
- if (readPerm && ! fp.readPerm)
+ if (fp.readPerm && ! readPerm)
return false;
- if (writePerm && ! fp.writePerm)
+ if (fp.writePerm && ! writePerm)
return false;
- if (executePerm && ! fp.executePerm)
+ if (fp.executePerm && ! executePerm)
return false;
- if (deletePerm && ! fp.deletePerm)
+ if (fp.deletePerm && ! deletePerm)
return false;
return true;
diff --git a/libjava/classpath/java/net/URL.java b/libjava/classpath/java/net/URL.java
index 627dbc3..1d947a0 100644
--- a/libjava/classpath/java/net/URL.java
+++ b/libjava/classpath/java/net/URL.java
@@ -408,10 +408,7 @@ public final class URL implements Serializable
// The 1.2 doc specifically says these are copied to the new URL.
host = context.host;
port = context.port;
- file = context.file;
userInfo = context.userInfo;
- if (file == null || file.length() == 0)
- file = "/";
authority = context.authority;
}
}
@@ -423,10 +420,13 @@ public final class URL implements Serializable
protocol = context.protocol;
host = context.host;
port = context.port;
- file = context.file;
userInfo = context.userInfo;
- if (file == null || file.length() == 0)
- file = "/";
+ if (spec.indexOf(":/", 1) < 0)
+ {
+ file = context.file;
+ if (file == null || file.length() == 0)
+ file = "/";
+ }
authority = context.authority;
}
else // Protocol NOT specified in spec. and no context available.
diff --git a/libjava/classpath/java/net/URLClassLoader.java b/libjava/classpath/java/net/URLClassLoader.java
index 726778e..9d0e504 100644
--- a/libjava/classpath/java/net/URLClassLoader.java
+++ b/libjava/classpath/java/net/URLClassLoader.java
@@ -536,15 +536,15 @@ public class URLClassLoader extends SecureClassLoader
Resource getResource(String name)
{
try
- {
- File file = new File(dir, name).getCanonicalFile();
- if (file.exists() && !file.isDirectory())
- return new FileResource(this, file);
- }
+ {
+ File file = new File(dir, name).getCanonicalFile();
+ if (file.exists() && !file.isDirectory())
+ return new FileResource(this, file);
+ }
catch (IOException e)
- {
- // Fall through...
- }
+ {
+ // Fall through...
+ }
return null;
}
}
@@ -873,47 +873,47 @@ public class URLClassLoader extends SecureClassLoader
// construct the class (and watch out for those nasty IOExceptions)
try
{
- byte[] data;
- InputStream in = resource.getInputStream();
- try
- {
- int length = resource.getLength();
- if (length != -1)
- {
- // We know the length of the data.
- // Just try to read it in all at once
- data = new byte[length];
- int pos = 0;
- while (length - pos > 0)
- {
- int len = in.read(data, pos, length - pos);
- if (len == -1)
- throw new EOFException("Not enough data reading from: "
- + in);
- pos += len;
- }
- }
- else
- {
- // We don't know the data length.
- // Have to read it in chunks.
- ByteArrayOutputStream out = new ByteArrayOutputStream(4096);
- byte[] b = new byte[4096];
- int l = 0;
- while (l != -1)
- {
- l = in.read(b);
- if (l != -1)
- out.write(b, 0, l);
- }
- data = out.toByteArray();
- }
- }
- finally
- {
- in.close();
- }
- final byte[] classData = data;
+ byte[] data;
+ InputStream in = resource.getInputStream();
+ try
+ {
+ int length = resource.getLength();
+ if (length != -1)
+ {
+ // We know the length of the data.
+ // Just try to read it in all at once
+ data = new byte[length];
+ int pos = 0;
+ while (length - pos > 0)
+ {
+ int len = in.read(data, pos, length - pos);
+ if (len == -1)
+ throw new EOFException("Not enough data reading from: "
+ + in);
+ pos += len;
+ }
+ }
+ else
+ {
+ // We don't know the data length.
+ // Have to read it in chunks.
+ ByteArrayOutputStream out = new ByteArrayOutputStream(4096);
+ byte[] b = new byte[4096];
+ int l = 0;
+ while (l != -1)
+ {
+ l = in.read(b);
+ if (l != -1)
+ out.write(b, 0, l);
+ }
+ data = out.toByteArray();
+ }
+ }
+ finally
+ {
+ in.close();
+ }
+ final byte[] classData = data;
// Now get the CodeSource
final CodeSource source = resource.getCodeSource();
diff --git a/libjava/classpath/java/security/ProtectionDomain.java b/libjava/classpath/java/security/ProtectionDomain.java
index a5851b5..a8a0939 100644
--- a/libjava/classpath/java/security/ProtectionDomain.java
+++ b/libjava/classpath/java/security/ProtectionDomain.java
@@ -37,6 +37,8 @@ exception statement from your version. */
package java.security;
+import gnu.classpath.SystemProperties;
+
/**
* <p>This <code>ProtectionDomain</code> class encapsulates the characteristics
* of a domain, which encloses a set of classes whose instances are granted a
@@ -222,7 +224,7 @@ public class ProtectionDomain
*/
public String toString()
{
- String linesep = System.getProperty("line.separator");
+ String linesep = SystemProperties.getProperty("line.separator");
StringBuffer sb = new StringBuffer("ProtectionDomain (").append(linesep);
if (code_source == null)