Index: ChangeLog =================================================================== RCS file: /cvsroot/classpath/classpath/ChangeLog,v retrieving revision 1.2386.2.69 diff -u -3 -p -u -r1.2386.2.69 ChangeLog --- ChangeLog 27 Jan 2005 09:45:32 -0000 1.2386.2.69 +++ ChangeLog 28 Jan 2005 10:32:18 -0000 @@ -1,3 +1,46 @@ +2005-01-27 Michael Koch + + * java/util/GregorianCalendar.java (getLeniarDay): + Made private. + +2005-01-27 Patrik Reali + + * doc/www.gnu.org/faq/faq.wml: type in faq code corrected + +2005-01-27 Michael Koch + + * java/awt/dnd/DropTarget.java (addDropTargetListener): + Clarified comments. + +2005-01-27 Graydon Hoare + + * java/awt/dnd/DropTarget.java + (addDropTargetListener): Despite documentation, do not throw. + * javax/swing/JComponent.java: Set a default DropTarget. + +2005-01-27 Michael Koch + + * java/util/zip/ZipFile.java + (ZIP_MAGIC): New constant. + (ZipFile): Check if given file is really a zip file. + (checkZipFile): New method. + (checkClosed): New method. + (entries): Check if file was closed. Return an empty enumeration in + error case. + (getEntries): Use checkClosed(). + (getEntry): Check if file was closed. + (getInputStream): Likewise. + (size): Likewise. + +2005-01-27 Patrik Reali + + * doc/www.gnu.org/faq/faq.wml: current command to generate doc + added to the faq + +2005-01-27 Patrik Reali + + * doc/www.gnu.org/docs/docs.wml: link to gjdoc-generated docs + 2005-01-27 Andrew John Hughes * javax/swing/SwingUtilities.java: Index: doc/www.gnu.org/docs/docs.wml =================================================================== RCS file: /cvsroot/classpath/classpath/doc/www.gnu.org/docs/docs.wml,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 docs.wml --- doc/www.gnu.org/docs/docs.wml 27 Nov 2003 14:49:58 -0000 1.4 +++ doc/www.gnu.org/docs/docs.wml 28 Jan 2005 10:32:19 -0000 @@ -5,26 +5,23 @@ -Classpath::General Information +Classpath::Legal Information
-

Legal Notices



- Classpath::Developer's Documentation Index: doc/www.gnu.org/faq/faq.wml =================================================================== RCS file: /cvsroot/classpath/classpath/doc/www.gnu.org/faq/faq.wml,v retrieving revision 1.13 diff -u -3 -p -u -r1.13 faq.wml --- doc/www.gnu.org/faq/faq.wml 4 Aug 2004 21:05:51 -0000 1.13 +++ doc/www.gnu.org/faq/faq.wml 28 Jan 2005 10:32:23 -0000 @@ -463,7 +463,7 @@ make && make install
  • Create a simple gjdoc script and put it in your PATH:
    - #!/bin/sh
    + #!/bin/sh
    CLASSPATH=/home/mark/src/libxmlj:/home/mark/src/gjdoc/src/resources \
    LD_LIBRARY_PATH=/usr/local/libxmlj/lib \
    /home/mark/src/gjdoc/src/gjdoc $* @@ -480,6 +480,24 @@ crashes then make sure that your java so entities. +

    Alternatively, you may also try the following command (the one used to generate the doc on ):
    +

      + +$(GJDOC) -public -use \
      + -sourcepath "$(sourcepath)" \
      + -encoding UTF-8 \
      + -breakiterator \
      + -licensetext \
      + -linksource \
      + -splitindex \
      + -d html \
      + -doctitle "GNU Classpath $(VERSION)" \
      + -windowtitle "GNU Classpath $(VERSION) Documentation" \
      + -header $(classpathbox) -footer $(classpathbox) \
      + -subpackages java:javax:org +
      +
    + Index: java/awt/dnd/DropTarget.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/dnd/DropTarget.java,v retrieving revision 1.7.2.1 diff -u -3 -p -u -r1.7.2.1 DropTarget.java --- java/awt/dnd/DropTarget.java 14 Jan 2005 10:24:15 -0000 1.7.2.1 +++ java/awt/dnd/DropTarget.java 28 Jan 2005 10:32:24 -0000 @@ -205,15 +205,14 @@ public class DropTarget /** * Adds a new DropTargetListener. * - * @exception TooManyListenersException If there is already a - * DropTargetListener. + * @exception TooManyListenersException Sun's JDK does not, despite + * documentation, throw this exception here when you install an additional + * DropTargetListener. So to be compatible, we do the same + * thing. */ public void addDropTargetListener (DropTargetListener dtl) throws TooManyListenersException { - if (dtl != null) - throw new TooManyListenersException (); - dropTargetListener = dtl; } Index: java/util/GregorianCalendar.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/util/GregorianCalendar.java,v retrieving revision 1.26.2.5 diff -u -3 -p -u -r1.26.2.5 GregorianCalendar.java --- java/util/GregorianCalendar.java 24 Jan 2005 01:59:54 -0000 1.26.2.5 +++ java/util/GregorianCalendar.java 28 Jan 2005 10:32:25 -0000 @@ -644,7 +644,7 @@ public class GregorianCalendar extends C * @param gregorian true, if we should use the Gregorian rules. * @return the days since the epoch, may be negative. */ - public long getLinearDay(int year, int dayOfYear, boolean gregorian) + private long getLinearDay(int year, int dayOfYear, boolean gregorian) { // The 13 is the number of days, that were omitted in the Gregorian // Calender until the epoch. Index: java/util/zip/ZipFile.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/util/zip/ZipFile.java,v retrieving revision 1.16.2.2 diff -u -3 -p -u -r1.16.2.2 ZipFile.java --- java/util/zip/ZipFile.java 16 Jan 2005 15:15:13 -0000 1.16.2.2 +++ java/util/zip/ZipFile.java 28 Jan 2005 10:32:25 -0000 @@ -1,5 +1,6 @@ /* ZipFile.java -- - Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -38,6 +39,8 @@ exception statement from your version. * package java.util.zip; +import gnu.java.util.EmptyEnumeration; + import java.io.BufferedInputStream; import java.io.DataInput; import java.io.EOFException; @@ -94,6 +97,7 @@ public class ZipFile implements ZipConst { this.raf = new RandomAccessFile(name, "r"); this.name = name; + checkZipFile(); } /** @@ -106,6 +110,7 @@ public class ZipFile implements ZipConst { this.raf = new RandomAccessFile(file, "r"); this.name = file.getPath(); + checkZipFile(); } /** @@ -135,6 +140,28 @@ public class ZipFile implements ZipConst } this.raf = new RandomAccessFile(file, "r"); this.name = file.getPath(); + checkZipFile(); + } + + private void checkZipFile() throws IOException, ZipException + { + byte[] magicBuf = new byte[4]; + raf.read(magicBuf); + + if (readLeInt(magicBuf, 0) != LOCSIG) + { + raf.close(); + throw new ZipException("Not a valid zip file"); + } + } + + /** + * Checks if file is closed and throws an exception. + */ + private void checkClosed() + { + if (closed) + throw new IllegalStateException("ZipFile has closed: " + name); } /** @@ -312,16 +339,20 @@ public class ZipFile implements ZipConst /** * Returns an enumeration of all Zip entries in this Zip file. + * + * @exception IllegalStateException when the ZipFile has already been closed */ public Enumeration entries() { + checkClosed(); + try { return new ZipEntryEnumeration(getEntries().values().iterator()); } catch (IOException ioe) { - return null; + return EmptyEnumeration.getInstance(); } } @@ -335,8 +366,7 @@ public class ZipFile implements ZipConst { synchronized(raf) { - if (closed) - throw new IllegalStateException("ZipFile has closed: " + name); + checkClosed(); if (entries == null) readEntries(); @@ -351,9 +381,13 @@ public class ZipFile implements ZipConst * @param the name. May contain directory components separated by * slashes ('/'). * @return the zip entry, or null if no entry with that name exists. + * + * @exception IllegalStateException when the ZipFile has already been closed */ public ZipEntry getEntry(String name) { + checkClosed(); + try { HashMap entries = getEntries(); @@ -423,11 +457,14 @@ public class ZipFile implements ZipConst * @param entry the entry to create an InputStream for. * @return the input stream, or null if the requested entry does not exist. * + * @exception IllegalStateException when the ZipFile has already been closed * @exception IOException if a i/o error occured. * @exception ZipException if the Zip archive is malformed. */ public InputStream getInputStream(ZipEntry entry) throws IOException { + checkClosed(); + HashMap entries = getEntries(); String name = entry.getName(); ZipEntry zipEntry = (ZipEntry) entries.get(name); @@ -459,9 +496,13 @@ public class ZipFile implements ZipConst /** * Returns the number of entries in this zip file. + * + * @exception IllegalStateException when the ZipFile has already been closed */ public int size() { + checkClosed(); + try { return getEntries().size(); Index: javax/swing/JComponent.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/JComponent.java,v retrieving revision 1.20.2.5 diff -u -3 -p -u -r1.20.2.5 JComponent.java --- javax/swing/JComponent.java 26 Jan 2005 02:30:49 -0000 1.20.2.5 +++ javax/swing/JComponent.java 28 Jan 2005 10:32:27 -0000 @@ -1,5 +1,5 @@ /* JComponent.java -- Every component in swing inherits from this class. - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -50,6 +50,7 @@ import java.awt.Image; import java.awt.Insets; import java.awt.Point; import java.awt.Rectangle; +import java.awt.dnd.DropTarget; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ContainerEvent; @@ -395,6 +396,7 @@ public abstract class JComponent extends { super(); super.setLayout(new FlowLayout()); + setDropTarget(new DropTarget()); defaultLocale = Locale.getDefault(); debugGraphicsOptions = DebugGraphics.NONE_OPTION; }