From cd6d4007aa4f72b51756e4a571abf876fa3e3133 Mon Sep 17 00:00:00 2001
From: Matthias Klose
Date: Tue, 21 Oct 2008 17:55:01 +0000
Subject: re PR libgcj/37636 (java tools are unable to find resource files)
libjava/ChangeLog:
2008-10-21 Andrew John Hughes
* sources.am, Makfile.in: Regenerate.
2008-10-17 Matthias Klose
* configure.ac: Fix bashisms.
* configure: Regenerate.
2008-10-15 Matthias Klose
* configure.ac: Disable build of gjdoc, if configured without
--with-antlr-jar or if no antlr.jar found.
* configure: Regenerate.
2008-10-09 Andrew John Hughes
* classpath/configure.ac,
* classpath/m4/ac_prog_antlr.m4,
* classpath/m4/ac_prog_java.m4,
* classpath/tools/Makefile.am:
Ported --regen-gjdoc-parser patch and
cantlr support from GNU Classpath.
2008-10-06 Andrew Haley
* java/lang/Thread.java (Thread): Always create the ThreadLocalMap
when creating a thread.
(getThreadLocals) Don't lazily create the ThreadLocalMap.
2008-09-28 Andrew John Hughes
* classpath/java/lang/ThreadLocalMap.java,
* java/lang/ThreadLocalMap$Entry.h,
* java/lang/ThreadLocalMap.h,
* lib/java/lang/ThreadLocalMap.class,
* lib/java/lang/ThreadLocalMap$Entry.class:
Add the new files for the ThreadLocal patch.
2008-09-28 Andrew John Hughes
* classpath/ChangeLog,
* classpath/java/lang/InheritableThreadLocal.java,
* classpath/java/lang/Thread.java,
* classpath/java/lang/ThreadLocal.java:
Merge Daniel Frampton's ThreadLocal patch.
* gcj/javaprims.h: Updated.
* java/lang/Thread.h: Regenerated.
* java/lang/Thread.java:
Replace WeakIdentityHashMap with ThreadLocalMap.
(getThreadLocals()): Likewise.
* java/lang/ThreadLocal.h: Regenerated.
* java/lang/ThreadLocal.java:
(computeNextHash()): New method.
(ThreadLocal()): Initialise fastHash.
(internalGet()): Updated to match Classpath's get().
(internalSet(Object)): Likewise for set(Object).
(internalRemove()): Likewise for remove().
2008-09-25 Andrew John Hughes
* classpath/configure,
* classpath/configure.ac:
Resynchronise with Classpath's configure.
* classpath/examples/Makefile.in:
Add equivalent support for building as in
tools/Makefile.in.
* classpath/java/nio/Buffer.java,
* classpath/java/nio/ByteBuffer.java,
* classpath/java/nio/ByteBufferImpl.java,
* classpath/java/nio/CharBuffer.java,
* classpath/java/nio/CharBufferImpl.java,
* classpath/java/nio/CharSequenceBuffer.java,
* classpath/java/nio/CharViewBufferImpl.java,
* classpath/java/nio/DirectByteBufferImpl.java,
* classpath/java/nio/DoubleBuffer.java,
* classpath/java/nio/DoubleBufferImpl.java,
* classpath/java/nio/DoubleViewBufferImpl.java,
* classpath/java/nio/FloatBuffer.java,
* classpath/java/nio/FloatBufferImpl.java,
* classpath/java/nio/FloatViewBufferImpl.java,
* classpath/java/nio/IntBuffer.java,
* classpath/java/nio/IntBufferImpl.java,
* classpath/java/nio/IntViewBufferImpl.java,
* classpath/java/nio/LongBuffer.java,
* classpath/java/nio/LongBufferImpl.java,
* classpath/java/nio/LongViewBufferImpl.java,
* classpath/java/nio/MappedByteBuffer.java,
* classpath/java/nio/MappedByteBufferImpl.java,
* classpath/java/nio/ShortBuffer.java,
* classpath/java/nio/ShortBufferImpl.java,
* classpath/java/nio/ShortViewBufferImpl.java:
Replace use of gnu.classpath.Pointer with gnu.gcj.RawData,
and fix some formatting issues.
* classpath/tools/gnu/classpath/tools/gjdoc/expr/JavaLexer.java,
* classpath/tools/gnu/classpath/tools/gjdoc/expr/JavaLexer.smap,
* classpath/tools/gnu/classpath/tools/gjdoc/expr/JavaRecognizer.java,
* classpath/tools/gnu/classpath/tools/gjdoc/expr/JavaRecognizer.smap,
* classpath/tools/gnu/classpath/tools/gjdoc/expr/JavaTokenTypes.java,
* classpath/tools/gnu/classpath/tools/gjdoc/expr/JavaTokenTypes.txt:
Regenerated (later version of antlr).
* java/nio/Buffer.h: Regenerated.
* java/nio/Buffer.java: Ported changes from Classpath.
* java/nio/ByteBuffer.h,
* java/nio/CharBuffer.h: Regenerated.
* java/nio/DirectByteBufferImpl.java: Ported changes from
Classpath.
* java/nio/DoubleBuffer.h,
* java/nio/FloatBuffer.h,
* java/nio/IntBuffer.h,
* java/nio/LongBuffer.h,
* java/nio/MappedByteBuffer.h,
* java/nio/MappedByteBufferImpl.h: Regenerated.
* java/nio/MappedByteBufferImpl.java: Ported changes from
Classpath.
* java/nio/ShortBuffer.h: Regenerated.
2008-09-24 Matthias Klose
* configure.ac: Search for antlr.jar, if not configured.
* configure: Regenerate.
2008-09-24 Matthias Klose
* Makefile.am: Build a gjdoc binary, if enabled.
* configure.ac: Add options --disable-gjdoc, --with-antlr-jar=file.
* Makefile.in, */Makefile.in, configure: Regenerate.
2008-09-22 Andrew Haley
* java/lang/String.java (toString(char[], int, int)): New method.
2008-09-14 Matthias Klose
Import GNU Classpath (libgcj-import-20080914).
* Regenerate class and header files.
* Regenerate auto* files.
* configure.ac: Don't pass --disable-gjdoc to classpath.
* sources.am: Regenerated.
* HACKING: Mention to build gjdoc in maintainer builds.
* gnu/classpath/Configuration.java: Update classpath version.
* gcj/javaprims.h: Update.
2008-09-08 Andrew John Hughes
* Makefile.am: Replace natStringBuffer.cc
and natStringBuilder.cc with natAbstractStringBuffer.cc.
* Makefile.in: Regenerated.
* java/lang/AbstractStringBuffer.java:
(append(int)): Made native.
(regionMatches(int,String)): Likewise.
* java/lang/StringBuffer.h: Regenerated.
* java/lang/StringBuffer.java: Remerged with GNU Classpath.
* java/lang/StringBuilder.h: Regenerated.
* java/lang/StringBuilder.java: Remerged with GNU Classpath.
* java/lang/natAbstractStringBuffer.cc: Provide common
native methods for StringBuffer and StringBuilder.
* java/lang/natStringBuffer.cc,
* java/lang/natStringBuilder.cc: Removed.
2008-09-04 Andrew John Hughes
* Makefile.in,
* classpath/configure: Regenerated.
* gnu/gcj/util/natDebug.cc,
* gnu/gcj/xlib/natColormap.cc,
* gnu/gcj/xlib/natDisplay.cc,
* gnu/gcj/xlib/natDrawable.cc,
* gnu/gcj/xlib/natFont.cc,
* gnu/gcj/xlib/natWMSizeHints.cc,
* gnu/gcj/xlib/natWindow.cc,
* gnu/gcj/xlib/natXImage.cc:
Add :: prefix to namespaces.
* java/io/CharArrayWriter.h,
* java/lang/StringBuffer.h:
Regenerated using patched gjavah.
* java/lang/natStringBuffer.cc:
Fix naming of append(jint).
* java/sql/Timestamp.h: Regenerated
using patched gjavah.
* jni.cc: Rename p to functions
to match change in GNU Classpath.
* scripts/makemake.tcl: Switch
gnu.java.math to BC compilation.
* sources.am: Regenerated.
2008-08-21 Andrew John Hughes
* Makefile.in: Updated location of Configuration.java.
* classpath/lib/gnu/java/locale/LocaleData.class: Regenerated.
2008-08-18 Andrew John Hughes
* Makefile.in: Updated with new Java files.
* classpath/configure: Regenerated.
* classpath/tools/Makefile.am: Add missing
use of GJDOC_EX so --disable-gjdoc works.
* classpath/tools/Makefile.in: Regenerated.
2008-08-15 Matthias Klose
Import GNU Classpath (libgcj-import-20080811).
* Regenerate class and header files.
* Regenerate auto* files.
* configure.ac: Don't pass --with-fastjar to classpath, substitute new
dummy value in classpath/gnu/classpath/Configuration.java.in, pass
--disable-gjdoc to classpath.
* scripts/makemake.tcl:
* sources.am: Regenerated.
* java/lang/AbstractStringBuffer.java, gnu/java/lang/VMCPStringBuilder.java:
New, copied from classpath, use System instead of VMSystem.
* java/lang/StringBuffer.java: Merge from classpath.
* java/lang/ClassLoader.java: Merge from classpath.
* gcj/javaprims.h: Update class definitions,
remove _Jv_jobjectRefType, jobjectRefType definitions.
libjava/classpath/ChangeLog.gcj:
2008-10-21 Matthias Klose
* classpath/tools/gnu/classpath/tools/gjdoc/expr/Java*: Move from ...
* classpath/tools/generated/gnu/classpath/tools/gjdoc/expr/ ... here.
* Update .class files.
2008-10-21 Andrew John Hughes
* tools/Makefile.am:
Always generate parser in the srcdir.
2008-10-21 Matthias Klose
* doc/Makefile.am (MAINTAINERCLEANFILES): Add gjdoc.1.
* doc/Makefile.in: Regenerate.
2008-10-20 Matthias Klose
* configure.ac: Don't check for working java, if not configured
with --enable-java-maintainer-mode.
* configure: Regenerate.
2008-10-19 Matthias Klose
* m4/ac_prog_java.m4: Revert previous change.
* m4/ac_prog_javac.m4: Apply it here.
* configure: Regenerate.
2008-10-19 Matthias Klose
* m4/ac_prog_javac.m4: Don't check for working javac, if not configured
with --enable-java-maintainer-mode.
* configure: Regenerate.
* Makefile.in, */Makefile.in: Regenerate.
2008-09-30 Matthias Klose
* m4/ac_prog_antlr.m4: Check for cantlr binary as well.
2008-09-29 Matthias Klose
* m4/ac_prog_antlr.m4: Check for antlr binary as well.
2008-09-28 Matthias Klose
* PR libgcj/37636. Revert:
2008-02-20 Matthias Klose
* tools/Makefile.am ($(TOOLS_ZIP)): Revert part of previous change,
Do copy resource files in JAVA_MAINTAINER_MODE only.
* tools/Makefile.in: Regenerate.
2008-09-14 Matthias Klose
* m4/ac_prog_javac_works.m4, m4/ac_prog_javac.m4, m4/acinclude.m4:
Revert local changes.
* m4/ac_prog_antlr.m4: Check for an runantlr binary.
* tools/Makefile.am, lib/Makefile.am: Revert local changes (JCOMPILER).
* tools/Makefile.am: Remove USE_JAVAC_FLAGS, pass ANTLR_JAR in
GLIBJ_CLASSPATH.
2008-09-14 Matthias Klose
Revert:
Daniel Frampton
* AUTHORS: Added.
* java/lang/InheritableThreadLocal.java,
* java/lang/Thread.java,
* java/lang/ThreadLocal.java:
Modified to use java.lang.ThreadLocalMap.
* java/lang/ThreadLocalMap.java:
New cheaper ThreadLocal-specific WeakHashMap.
2008-08-15 Matthias Klose
* m4/acinclude.m4 (CLASSPATH_JAVAC_MEM_CHECK): Remove unknown
args for javac.
libjava/classpath/ChangeLog:
2008-10-20 Andrew John Hughes
* m4/ac_prog_antlr.m4:
Remove redundant checks.
* tools/Makefile.am:
Use gjdoc_gendir when calling antlr.
2008-10-15 Andrew John Hughes
* configure.ac:
Remove superfluous AC_PROG_JAVA call.
2008-10-06 Andrew John Hughes
* m4/ac_prog_antlr:
Check for cantlr as well.
* tools/Makefile.am:
Only build GJDoc parser when both
CREATE_GJDOC and CREATE_GJDOC_PARSER
are on.
2008-10-02 Andrew John Hughes
* configure.ac:
Add regen-gjdoc-parser option,
and separate antlr tests.
* m4/ac_prog_antlr.m4:
Turn single test into AC_LIB_ANTLR
and AC_PROG_ANTLR.
* m4/ac_prog_java.m4:
Quote tests.
* tools/Makefile.am:
Support CREATE_GJDOC_PARSER option.
2008-09-14 Andrew John Hughes
* examples/Makefile.am:
Check lib directly as well as glibj.zip
for boot classes.
* m4/acinclude.m4:
Only require the class files to be built
to allow the tools and examples to be built,
not the installation of glibj.zip.
* tools/Makefile.am:
Check lib directly as well as glibj.zip
for boot classes.
2008-09-13 Andrew John Hughes
* examples/Makefile.am,
* lib/Makefile.am:
Add GCJ rules.
* m4/ac_prog_javac.m4:
Check whether JAVAC is gcj.
* m4/ac_prog_javac_works.m4:
Add GCJ rules.
* m4/acinclude.m4:
Don't bother checking for -J
if using GCJ.
* tools/Makefile.am:
Add GCJ rules.
2007-08-23 Daniel Frampton
* AUTHORS: Added.
* java/lang/InheritableThreadLocal.java,
* java/lang/Thread.java,
* java/lang/ThreadLocal.java:
Modified to use java.lang.ThreadLocalMap.
* java/lang/ThreadLocalMap.java:
New cheaper ThreadLocal-specific WeakHashMap.
2008-02-07 Ian Rogers
* java/util/zip/ZipEntry.java:
Use byte fields instead of integer fields,
store the time as well as the DOS time and
don't retain a global Calendar instance.
(setDOSTime(int)): Set KNOWN_DOSTIME instead
of KNOWN_TIME, and unset KNOWN_TIME.
(getDOSTime()): Compute DOS time from UNIX time
only when needed.
(clone()): Provide cloning via the ZipEntry constructor
where possible.
(setTime(long)): Don't compute DOS time at this point.
(getCalendar()): Removed.
2008-09-09 Andrew John Hughes
* tools/gnu/classpath/tools/getopt/Parser.java:
(setHeader(String)): Make synchronized.
(setFooter(String)): Likewise.
* tools/gnu/classpath/tools/rmic/SourceGiopRmicCompiler.java,
(reset()): Make synchronized.
(name(Class)): Likewise.
2008-09-04 Robert Schuster
* gnu/java/nio/charset/ByteDecodeLoopHelper:
(arrayDecodeLoop): Added new break label, escape to that label.
* gnu/java/nio/charset/ByteEncodeLoopHelper:
(arrayDecodeLoop): Added new break label, escape to that label.
2008-09-04 Robert Schuster
* java/text/DecimalFormat.java:
(scanFix): Use 'i + 1' when looking at following character.
(scanNegativePattern): Dito.
2008-09-02 Andrew John Hughes
* tools/gnu/classpath/tools/javah/ClassWrapper.java:
(makeVtable()): Populate methodNameMap.
(printMethods(CniPrintStream)): Always use pre-populated
methodNameMap for bridge targets.
2008-09-01 Mario Torre
* gnu/java/awt/peer/x/XImage.java (XImageProducer): remove @Override
annotation to allow compilation on javac < 1.6 and ecj < 3.4.
2008-09-01 Mario Torre
* gnu/java/awt/peer/x/XGraphicsDevice.java (getDisplay): fix to support
new Escher API.
* gnu/java/awt/peer/x/XImage.java (getSource): method implemented.
* gnu/java/awt/peer/x/XImage.java (XImageProducer): implement ImageProducer
for getSource.
2008-09-01 Andrew John Hughes
* gnu/java/util/regex/BacktrackStack.java,
* gnu/java/util/regex/CharIndexed.java,
* gnu/java/util/regex/CharIndexedCharArray.java,
* gnu/java/util/regex/CharIndexedCharSequence.java,
* gnu/java/util/regex/CharIndexedInputStream.java,
* gnu/java/util/regex/CharIndexedString.java,
* gnu/java/util/regex/CharIndexedStringBuffer.java,
* gnu/java/util/regex/RE.java,
* gnu/java/util/regex/REException.java,
* gnu/java/util/regex/REFilterInputStream.java,
* gnu/java/util/regex/REMatch.java,
* gnu/java/util/regex/REMatchEnumeration.java,
* gnu/java/util/regex/RESyntax.java,
* gnu/java/util/regex/REToken.java,
* gnu/java/util/regex/RETokenAny.java,
* gnu/java/util/regex/RETokenBackRef.java,
* gnu/java/util/regex/RETokenChar.java,
* gnu/java/util/regex/RETokenEnd.java,
* gnu/java/util/regex/RETokenEndOfPreviousMatch.java,
* gnu/java/util/regex/RETokenEndSub.java,
* gnu/java/util/regex/RETokenIndependent.java,
* gnu/java/util/regex/RETokenLookAhead.java,
* gnu/java/util/regex/RETokenLookBehind.java,
* gnu/java/util/regex/RETokenNamedProperty.java,
* gnu/java/util/regex/RETokenOneOf.java,
* gnu/java/util/regex/RETokenPOSIX.java,
* gnu/java/util/regex/RETokenRange.java,
* gnu/java/util/regex/RETokenRepeated.java,
* gnu/java/util/regex/RETokenStart.java,
* gnu/java/util/regex/RETokenWordBoundary.java,
* gnu/java/util/regex/UncheckedRE.java:
Fix indentation.
2008-09-01 Andrew John Hughes
* gnu/java/util/regex/RETokenStart.java:
(getMaximumLength()): Add Override annotation.
(matchThis(CharIndexed, REMatch)): Likewise.
(returnsFixedLengthMatches()): Renamed from
returnsFixedLengthmatches and added Override
annotation.
(findFixedLengthMatches(CharIndexed,REMatch,int)):
Add Override annotation.
(dump(CPStringBuilder)): Likewise.
* gnu/javax/print/ipp/IppRequest.java:
(RequestWriter.writeOperationAttributes(AttributeSet)):
Throw exception, don't just create and drop it.
* javax/management/MBeanServerPermission.java:
(MBeanServerPermissionCollection.add(Permission)): Compare
against individual Strings not the entire array, and
store the result of replace.
* javax/swing/text/html/StyleSheet.java:
(setBaseFontSize(size)): Store result of trim().
2008-09-01 Andrew John Hughes
* javax/tools/FileObject.java:
(openReader(boolean)): Document new parameter.
2008-03-27 Michael Franz
PR classpath/35690:
* javax/tools/FileObject.java:
(toUri()): Fix case from toURI.
(openReader(boolean)): Add missing boolean argument.
2008-08-26 Andrew John Hughes
PR classpath/35487:
* gnu/javax/management/Server.java:
(beans): Change to ConcurrentHashMap.
(defaultDomain): Make final.
(outer): Likewise.
(LazyListenersHolder): Added to wrap
listeners, also now a ConcurrentHashMap,
providing lazy initialisation safely.
(sequenceNumber): Documented.
(getBean(ObjectName)): Remove redundant cast.
(addNotificationListener(ObjectName,NotificationListener,
NotificationFilter,Object)): Remove map initialisation
and use holder.
(getObjectInstance(ObjectName)): Remove redundant cast.
(registerMBean(Object,ObjectName)): Add bean atomically.
(removeNotificationListener(ObjectName,NotificationListener)):
Simplified.
(removeNotificationListener(ObjectName,NotificationListener,
NotificationFilter,Object)): Likewise.
(notify(ObjectName,String)): Documented.
2008-08-26 Andrew John Hughes
* gnu/javax/management/Server.java:
Genericised.
2008-08-26 Andrew John Hughes
* gnu/javax/management/Translator.java:
Genericised.
2008-08-26 Andrew John Hughes
* javax/management/DefaultLoaderRepository.java,
* javax/management/JMX.java,
* javax/management/MBeanAttributeInfo.java,
* javax/management/MBeanConstructorInfo.java,
* javax/management/MBeanOperationInfo.java,
* javax/management/MBeanServerDelegate.java:
Fix warnings due to generics.
2008-08-25 Andrew John Hughes
* javax/management/MBeanPermission.java,
* javax/management/MBeanServerDelegate.java,
* javax/management/MBeanServerFactory.java,
* javax/management/MBeanServerInvocationHandler.java,
* javax/management/MBeanServerPermission.java:
Fix warnings due to use of non-generic collections.
2008-08-25 Mario Torre
* gnu/javax/rmi/CORBA/RmiUtilities.java (readValue): check if sender is
null to avoid NPE.
2008-08-22 Mario Torre
* gnu/CORBA/OrbFunctional.java (set_parameters): Fix
NullPointerException checking when param is null.
2008-08-23 Andrew John Hughes
* java/util/regex/Matcher.java:
(reset()): Reset append position so
we don't try and append to the end of
the old input.
2008-08-22 Andrew John Hughes
PR classpath/32028:
* m4/acinclude.m4:
Also allow versions of GJDoc from 0.8* on, as
CVS is 0.8.0-pre.
2008-08-21 Andrew John Hughes
PR classpath/32028:
* m4/acinclude.m4:
(CLASSPATH_WITH_GJDOC): Ensure version 0.7.9 is
being used.
2008-08-20 Andrew John Hughes
* tools/Makefile.am:
Add taglets subdirectory to list of excluded
paths when GJDoc is not compiled.
2008-08-19 David P Grove
* scripts/check_jni_methods.sh.in:
Fix build issue on AIX by splitting generation
of method list.
2008-08-18 Andrew John Hughes
* native/jni/gstreamer-peer/gst_native_pipeline.c:
(get_free_space(int)): Use #else not #elif when
there is no condition.
2008-08-17 Andrew John Hughes
PR classpath/31895:
* java/text/DecimalFormat.java:
(setCurrency(Currency)): Update prefixes and
suffixes when currency changes.
* java/text/DecimalFormatSymbols.java:
(DecimalFormatSymbols(Locale)): Set locale earlier
so it can be used by setCurrency(Currency).
(setCurrency(Currency)): Set the symbol correctly using
the locale of the instance.
* java/util/Currency.java:
Throw error instead of just printing a message.
2008-08-17 Andrew John Hughes
* javax/activation/ActivationDataFlavor.java:
Suppress warnings from public API.
(mimeType): Made final.
(representationClass): Added generic type and
made final.
(normalizeMimeTypeParameter(String,String)):
Use CPStringBuilder.
* javax/activation/CommandInfo.java:
(verb): Made final.
(className): Made final.
* javax/activation/DataHandler.java:
(dataSource): Made final.
* javax/activation/FileDataSource.java:
(file): Made final.
* javax/activation/MailcapCommandMap.java:
Use generics on collections and CPStringBuilder
instead of StringBuffer.
* javax/activation/MimeType.java:
(toString()): Use CPStringBuilder.
(getBaseType()): Likewise.
* javax/activation/MimeTypeParameterList.java:
Use generics on collections and CPStringBuilder
instead of StringBuffer.
* javax/activation/MimeTypeParseException.java:
(MimeTypeParseException(String,String)): Use
CPStringBuilder.
* javax/activation/MimetypesFileTypeMap.java:
Use generics on collections and CPStringBuilder
instead of StringBuffer.
* javax/activation/URLDataSource.java:
(url): Made final.
2008-08-17 Andrew John Hughes
* gnu/javax/activation/viewers/ImageViewer.java,
* gnu/javax/activation/viewers/TextEditor.java,
* gnu/javax/activation/viewers/TextViewer.java,
* javax/activation/ActivationDataFlavor.java,
* javax/activation/CommandInfo.java,
* javax/activation/CommandMap.java,
* javax/activation/CommandObject.java,
* javax/activation/DataContentHandler.java,
* javax/activation/DataContentHandlerFactory.java,
* javax/activation/DataHandler.java,
* javax/activation/DataHandlerDataSource.java,
* javax/activation/DataSource.java,
* javax/activation/DataSourceDataContentHandler.java,
* javax/activation/FileDataSource.java,
* javax/activation/FileTypeMap.java,
* javax/activation/MailcapCommandMap.java,
* javax/activation/MimeType.java,
* javax/activation/MimeTypeParameterList.java,
* javax/activation/MimeTypeParseException.java,
* javax/activation/MimetypesFileTypeMap.java,
* javax/activation/ObjectDataContentHandler.java,
* javax/activation/URLDataSource.java,
* javax/activation/UnsupportedDataTypeException.java,
* javax/activation/package.html,
* resource/META-INF/mailcap.default,
* resource/META-INF/mimetypes.default:
Import GNU JAF CVS as of 17/08/2008.
2006-04-25 Archit Shah
* javax/activation/MimeTypeParameterList.java:
Insert ';' separator before parameter list.
2005-06-29 Xavier Poinsard
* javax/activation/ObjectDataContentHandler.java:
Fixed typo.
2005-05-28 Chris Burdess
* javax/activation/CommandMap.java,
* javax/activation/MailcapCommandMap.java:
Updated to JAF 1.1.
2004-06-09 Chris Burdess
* javax/activation/MailcapCommandMap.java:
Fixed bug whereby x-java prefix was not
attempted.
2008-08-17 Andrew John Hughes
* AUTHORS: Added Laszlo.
2008-04-20 Andrew John Hughes
PR classpath/30436:
* java/util/Scanner.java:
Fix package to be java.util and correct
indentation.
2007-07-25 Laszlo Andras Hernadi
PR classpath/30436:
* java/util/Scanner.java:
Initial implementation.
2008-08-17 Andrew John Hughes
* java/util/regex/Matcher.java:
(toMatchResult()): Implemented.
2008-08-13 Joshua Sumali
* doc/Makefile.am (gjdoc.pod): Generate gjdoc pod from cp-tools.texinfo
instead of invoke.texi. Remove invoke.texi from EXTRA_DIST.
* doc/invoke.texi: Removed and merged into ...
* doc/cp-tools.texinfo: Here
2008-08-12 Robert Schuster
* native/jni/java-net/local.c
(local_bind): Removed fprintf call, fixed access outside
of array bounds.
From-SVN: r141271
---
.../classpath/java/util/AbstractCollection.java | 4 +-
libjava/classpath/java/util/AbstractMap.java | 4 +-
libjava/classpath/java/util/ArrayList.java | 21 +-
libjava/classpath/java/util/Arrays.java | 24 +-
libjava/classpath/java/util/BitSet.java | 5 +-
libjava/classpath/java/util/Calendar.java | 36 +-
libjava/classpath/java/util/Collections.java | 4 +-
libjava/classpath/java/util/Currency.java | 2 +-
libjava/classpath/java/util/Date.java | 4 +-
libjava/classpath/java/util/Formatter.java | 28 +-
libjava/classpath/java/util/Hashtable.java | 4 +-
libjava/classpath/java/util/Locale.java | 7 +-
libjava/classpath/java/util/Properties.java | 42 +-
.../java/util/PropertyResourceBundle.java | 19 +-
libjava/classpath/java/util/ResourceBundle.java | 70 +-
libjava/classpath/java/util/Scanner.java | 2223 ++++++++++++++++++++
libjava/classpath/java/util/Stack.java | 6 +-
libjava/classpath/java/util/TimeZone.java | 6 +-
libjava/classpath/java/util/TreeMap.java | 6 +-
libjava/classpath/java/util/Vector.java | 43 +-
.../classpath/java/util/logging/FileHandler.java | 4 +-
libjava/classpath/java/util/logging/Logger.java | 4 +-
.../java/util/logging/SimpleFormatter.java | 4 +-
.../classpath/java/util/logging/XMLFormatter.java | 20 +-
.../java/util/prefs/AbstractPreferences.java | 55 +-
libjava/classpath/java/util/regex/Matcher.java | 289 ++-
libjava/classpath/java/util/regex/Pattern.java | 6 +-
.../java/util/regex/PatternSyntaxException.java | 4 +-
libjava/classpath/java/util/zip/Deflater.java | 2 -
libjava/classpath/java/util/zip/Inflater.java | 2 -
libjava/classpath/java/util/zip/ZipEntry.java | 166 +-
libjava/classpath/java/util/zip/ZipFile.java | 2 +-
32 files changed, 2912 insertions(+), 204 deletions(-)
create mode 100644 libjava/classpath/java/util/Scanner.java
(limited to 'libjava/classpath/java/util')
diff --git a/libjava/classpath/java/util/AbstractCollection.java b/libjava/classpath/java/util/AbstractCollection.java
index ef74342..a11654e 100644
--- a/libjava/classpath/java/util/AbstractCollection.java
+++ b/libjava/classpath/java/util/AbstractCollection.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package java.util;
+import gnu.java.lang.CPStringBuilder;
+
import java.lang.reflect.Array;
/**
@@ -434,7 +436,7 @@ public abstract class AbstractCollection
public String toString()
{
Iterator itr = iterator();
- StringBuffer r = new StringBuffer("[");
+ CPStringBuilder r = new CPStringBuilder("[");
boolean hasNext = itr.hasNext();
while (hasNext)
{
diff --git a/libjava/classpath/java/util/AbstractMap.java b/libjava/classpath/java/util/AbstractMap.java
index 02a30a2..5d59db9 100644
--- a/libjava/classpath/java/util/AbstractMap.java
+++ b/libjava/classpath/java/util/AbstractMap.java
@@ -39,6 +39,8 @@ exception statement from your version. */
package java.util;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.Serializable;
/**
@@ -524,7 +526,7 @@ public abstract class AbstractMap implements Map
public String toString()
{
Iterator> entries = entrySet().iterator();
- StringBuilder r = new StringBuilder("{");
+ CPStringBuilder r = new CPStringBuilder("{");
for (int pos = size(); pos > 0; pos--)
{
Map.Entry entry = entries.next();
diff --git a/libjava/classpath/java/util/ArrayList.java b/libjava/classpath/java/util/ArrayList.java
index 0693049..1fb25d8 100644
--- a/libjava/classpath/java/util/ArrayList.java
+++ b/libjava/classpath/java/util/ArrayList.java
@@ -472,8 +472,7 @@ public class ArrayList extends AbstractList
// use of a negative index will cause an ArrayIndexOutOfBoundsException,
// a subclass of the required exception, with no effort on our part.
if (index > size)
- throw new IndexOutOfBoundsException("Index: " + index + ", Size: "
- + size);
+ raiseBoundsError(index);
}
/**
@@ -488,11 +487,25 @@ public class ArrayList extends AbstractList
// use of a negative index will cause an ArrayIndexOutOfBoundsException,
// a subclass of the required exception, with no effort on our part.
if (index >= size)
- throw new IndexOutOfBoundsException("Index: " + index + ", Size: "
- + size);
+ raiseBoundsError(index);
}
/**
+ * Raise the ArrayIndexOfOutBoundsException.
+ *
+ * @param index the index of the access
+ * @throws IndexOutOfBoundsException unconditionally
+ */
+ private void raiseBoundsError(int index)
+ {
+ // Implementaion note: put in a separate method to make the JITs job easier
+ // (separate common from uncommon code at method boundaries when trivial to
+ // do so).
+ throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + size);
+ }
+
+
+ /**
* Remove from this list all elements contained in the given collection.
* This is not public, due to Sun's API, but this performs in linear
* time while the default behavior of AbstractList would be quadratic.
diff --git a/libjava/classpath/java/util/Arrays.java b/libjava/classpath/java/util/Arrays.java
index e5f7727..d154eb1 100644
--- a/libjava/classpath/java/util/Arrays.java
+++ b/libjava/classpath/java/util/Arrays.java
@@ -39,6 +39,8 @@ exception statement from your version. */
package java.util;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.Serializable;
import java.lang.reflect.Array;
@@ -2935,7 +2937,7 @@ public class Arrays
{
if (v == null)
return "null";
- StringBuilder b = new StringBuilder("[");
+ CPStringBuilder b = new CPStringBuilder("[");
for (int i = 0; i < v.length; ++i)
{
if (i > 0)
@@ -2957,7 +2959,7 @@ public class Arrays
{
if (v == null)
return "null";
- StringBuilder b = new StringBuilder("[");
+ CPStringBuilder b = new CPStringBuilder("[");
for (int i = 0; i < v.length; ++i)
{
if (i > 0)
@@ -2979,7 +2981,7 @@ public class Arrays
{
if (v == null)
return "null";
- StringBuilder b = new StringBuilder("[");
+ CPStringBuilder b = new CPStringBuilder("[");
for (int i = 0; i < v.length; ++i)
{
if (i > 0)
@@ -3001,7 +3003,7 @@ public class Arrays
{
if (v == null)
return "null";
- StringBuilder b = new StringBuilder("[");
+ CPStringBuilder b = new CPStringBuilder("[");
for (int i = 0; i < v.length; ++i)
{
if (i > 0)
@@ -3023,7 +3025,7 @@ public class Arrays
{
if (v == null)
return "null";
- StringBuilder b = new StringBuilder("[");
+ CPStringBuilder b = new CPStringBuilder("[");
for (int i = 0; i < v.length; ++i)
{
if (i > 0)
@@ -3045,7 +3047,7 @@ public class Arrays
{
if (v == null)
return "null";
- StringBuilder b = new StringBuilder("[");
+ CPStringBuilder b = new CPStringBuilder("[");
for (int i = 0; i < v.length; ++i)
{
if (i > 0)
@@ -3067,7 +3069,7 @@ public class Arrays
{
if (v == null)
return "null";
- StringBuilder b = new StringBuilder("[");
+ CPStringBuilder b = new CPStringBuilder("[");
for (int i = 0; i < v.length; ++i)
{
if (i > 0)
@@ -3089,7 +3091,7 @@ public class Arrays
{
if (v == null)
return "null";
- StringBuilder b = new StringBuilder("[");
+ CPStringBuilder b = new CPStringBuilder("[");
for (int i = 0; i < v.length; ++i)
{
if (i > 0)
@@ -3111,7 +3113,7 @@ public class Arrays
{
if (v == null)
return "null";
- StringBuilder b = new StringBuilder("[");
+ CPStringBuilder b = new CPStringBuilder("[");
for (int i = 0; i < v.length; ++i)
{
if (i > 0)
@@ -3122,7 +3124,7 @@ public class Arrays
return b.toString();
}
- private static void deepToString(Object[] v, StringBuilder b, HashSet seen)
+ private static void deepToString(Object[] v, CPStringBuilder b, HashSet seen)
{
b.append("[");
for (int i = 0; i < v.length; ++i)
@@ -3171,7 +3173,7 @@ public class Arrays
if (v == null)
return "null";
HashSet seen = new HashSet();
- StringBuilder b = new StringBuilder();
+ CPStringBuilder b = new CPStringBuilder();
deepToString(v, b, seen);
return b.toString();
}
diff --git a/libjava/classpath/java/util/BitSet.java b/libjava/classpath/java/util/BitSet.java
index e4f923b..13bf8a1 100644
--- a/libjava/classpath/java/util/BitSet.java
+++ b/libjava/classpath/java/util/BitSet.java
@@ -36,6 +36,9 @@ obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
package java.util;
+
+import gnu.java.lang.CPStringBuilder;
+
import java.io.Serializable;
/* Written using "Java Class Libraries", 2nd edition, ISBN 0-201-31002-3
@@ -687,7 +690,7 @@ public class BitSet implements Cloneable, Serializable
*/
public String toString()
{
- StringBuffer r = new StringBuffer("{");
+ CPStringBuilder r = new CPStringBuilder("{");
boolean first = true;
for (int i = 0; i < bits.length; ++i)
{
diff --git a/libjava/classpath/java/util/Calendar.java b/libjava/classpath/java/util/Calendar.java
index 712296b..0449e12 100644
--- a/libjava/classpath/java/util/Calendar.java
+++ b/libjava/classpath/java/util/Calendar.java
@@ -39,6 +39,8 @@ exception statement from your version. */
package java.util;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
@@ -485,6 +487,28 @@ public abstract class Calendar
}
/**
+ * The set of properties for obtaining the minimum number of days in
+ * the first week.
+ */
+ private static transient final Properties properties;
+
+ /**
+ * Reads in the properties.
+ */
+ static
+ {
+ properties = new Properties();
+ try
+ {
+ properties.load(Calendar.class.getResourceAsStream("weeks.properties"));
+ }
+ catch (IOException exception)
+ {
+ System.out.println("Failed to load weeks resource: " + exception);
+ }
+ }
+
+ /**
* Constructs a new Calendar with the default time zone and the default
* locale.
*/
@@ -505,9 +529,13 @@ public abstract class Calendar
lenient = true;
String[] days = { "", "sun", "mon", "tue", "wed", "thu", "fri", "sat" };
- ResourceBundle rb = getBundle(locale);
- String min = (String) rb.getObject("minNumberOfDaysInFirstWeek");
- String first = (String) rb.getObject("firstDayOfWeek");
+ String country = locale.getCountry();
+ String min = properties.getProperty("minDays." + country);
+ if (min == null)
+ min = properties.getProperty("minDays.DEFAULT");
+ String first = properties.getProperty("firstDay." + country);
+ if (first == null)
+ first = properties.getProperty("firstDay.DEFAULT");
try
{
if (min != null)
@@ -1328,7 +1356,7 @@ public abstract class Calendar
*/
public String toString()
{
- StringBuilder sb = new StringBuilder(getClass().getName());
+ CPStringBuilder sb = new CPStringBuilder(getClass().getName());
sb.append('[');
sb.append("time=");
if (isTimeSet)
diff --git a/libjava/classpath/java/util/Collections.java b/libjava/classpath/java/util/Collections.java
index ae2010f..066c9d5 100644
--- a/libjava/classpath/java/util/Collections.java
+++ b/libjava/classpath/java/util/Collections.java
@@ -39,6 +39,8 @@ exception statement from your version. */
package java.util;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.Serializable;
/**
@@ -1135,7 +1137,7 @@ public class Collections
*/
public String toString()
{
- StringBuffer r = new StringBuffer("{");
+ CPStringBuilder r = new CPStringBuilder("{");
for (int i = n - 1; --i > 0; )
r.append(element).append(", ");
r.append(element).append("}");
diff --git a/libjava/classpath/java/util/Currency.java b/libjava/classpath/java/util/Currency.java
index b5da13c..11235f1 100644
--- a/libjava/classpath/java/util/Currency.java
+++ b/libjava/classpath/java/util/Currency.java
@@ -139,7 +139,7 @@ public final class Currency
}
catch (IOException exception)
{
- System.out.println("Failed to load currency resource: " + exception);
+ throw new InternalError("Failed to load currency resource: " + exception);
}
}
diff --git a/libjava/classpath/java/util/Date.java b/libjava/classpath/java/util/Date.java
index 8646c19..5f83cd0 100644
--- a/libjava/classpath/java/util/Date.java
+++ b/libjava/classpath/java/util/Date.java
@@ -37,6 +37,8 @@ exception statement from your version. */
package java.util;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
@@ -722,7 +724,7 @@ public class Date
boolean localTimezone = true;
// Trim out any nested stuff in parentheses now to make parsing easier.
- StringBuilder buf = new StringBuilder();
+ CPStringBuilder buf = new CPStringBuilder();
int parenNesting = 0;
int len = string.length();
for (int i = 0; i < len; i++)
diff --git a/libjava/classpath/java/util/Formatter.java b/libjava/classpath/java/util/Formatter.java
index 8213078..9217d93 100644
--- a/libjava/classpath/java/util/Formatter.java
+++ b/libjava/classpath/java/util/Formatter.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package java.util;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.Closeable;
import java.io.File;
import java.io.FileNotFoundException;
@@ -470,7 +472,7 @@ public final class Formatter
* @param width the width of the numeric value.
* @param isNegative true if the value is negative.
*/
- private void applyLocalization(StringBuilder builder, int flags, int width,
+ private void applyLocalization(CPStringBuilder builder, int flags, int width,
boolean isNegative)
{
DecimalFormatSymbols dfsyms;
@@ -741,9 +743,9 @@ public final class Formatter
* @param conversion the conversion character.
* @return the result.
*/
- private StringBuilder basicIntegralConversion(Object arg, int flags,
- int width, int precision,
- int radix, char conversion)
+ private CPStringBuilder basicIntegralConversion(Object arg, int flags,
+ int width, int precision,
+ int radix, char conversion)
{
assert radix == 8 || radix == 10 || radix == 16;
noPrecision(precision);
@@ -798,7 +800,7 @@ public final class Formatter
else
throw new IllegalFormatConversionException(conversion, arg.getClass());
- return new StringBuilder(result);
+ return new CPStringBuilder(result);
}
/**
@@ -819,9 +821,9 @@ public final class Formatter
{
assert radix == 8 || radix == 16;
- StringBuilder builder = basicIntegralConversion(arg, flags, width,
- precision, radix,
- conversion);
+ CPStringBuilder builder = basicIntegralConversion(arg, flags, width,
+ precision, radix,
+ conversion);
int insertPoint = 0;
// Insert the sign.
@@ -897,9 +899,9 @@ public final class Formatter
int precision, char conversion)
throws IOException
{
- StringBuilder builder = basicIntegralConversion(arg, flags, width,
- precision, 10,
- conversion);
+ CPStringBuilder builder = basicIntegralConversion(arg, flags, width,
+ precision, 10,
+ conversion);
boolean isNegative = false;
if (builder.charAt(0) == '-')
{
@@ -920,7 +922,7 @@ public final class Formatter
* @param conversion the formatting character to specify the type of data.
* @param syms the date formatting symbols.
*/
- private void singleDateTimeConversion(StringBuilder builder, Calendar cal,
+ private void singleDateTimeConversion(CPStringBuilder builder, Calendar cal,
char conversion,
DateFormatSymbols syms)
{
@@ -1151,7 +1153,7 @@ public final class Formatter
else
syms = new DateFormatSymbols(fmtLocale);
- StringBuilder result = new StringBuilder();
+ CPStringBuilder result = new CPStringBuilder();
singleDateTimeConversion(result, cal, subConversion, syms);
genericFormat(result.toString(), flags, width, precision);
diff --git a/libjava/classpath/java/util/Hashtable.java b/libjava/classpath/java/util/Hashtable.java
index 07bd946..0851de8 100644
--- a/libjava/classpath/java/util/Hashtable.java
+++ b/libjava/classpath/java/util/Hashtable.java
@@ -39,6 +39,8 @@ exception statement from your version. */
package java.util;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
@@ -579,7 +581,7 @@ public class Hashtable extends Dictionary
// would repeatedly re-lock/release the monitor, we directly use the
// unsynchronized EntryIterator instead.
Iterator> entries = new EntryIterator();
- StringBuilder r = new StringBuilder("{");
+ CPStringBuilder r = new CPStringBuilder("{");
for (int pos = size; pos > 0; pos--)
{
r.append(entries.next());
diff --git a/libjava/classpath/java/util/Locale.java b/libjava/classpath/java/util/Locale.java
index cd372f2..c28709f 100644
--- a/libjava/classpath/java/util/Locale.java
+++ b/libjava/classpath/java/util/Locale.java
@@ -39,6 +39,9 @@ exception statement from your version. */
package java.util;
import gnu.classpath.SystemProperties;
+
+import gnu.java.lang.CPStringBuilder;
+
import gnu.java.locale.LocaleHelper;
import java.io.IOException;
@@ -548,7 +551,7 @@ public final class Locale implements Serializable, Cloneable
return "";
else if (country.length() == 0 && variant.length() == 0)
return language;
- StringBuffer result = new StringBuffer(language);
+ CPStringBuilder result = new CPStringBuilder(language);
result.append('_').append(country);
if (variant.length() != 0)
result.append('_').append(variant);
@@ -922,7 +925,7 @@ public final class Locale implements Serializable, Cloneable
*/
public String getDisplayName(Locale locale)
{
- StringBuffer result = new StringBuffer();
+ CPStringBuilder result = new CPStringBuilder();
int count = 0;
String[] delimiters = {"", " (", ","};
if (language.length() != 0)
diff --git a/libjava/classpath/java/util/Properties.java b/libjava/classpath/java/util/Properties.java
index e294fee..a57004b 100644
--- a/libjava/classpath/java/util/Properties.java
+++ b/libjava/classpath/java/util/Properties.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package java.util;
+import gnu.java.lang.CPStringBuilder;
+
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
@@ -46,6 +48,7 @@ import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintStream;
import java.io.PrintWriter;
+import java.io.Reader;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamConstants;
@@ -155,7 +158,7 @@ public class Properties extends Hashtable
+ *
+ * The behaviour of region matching is further affected
+ * by the use of transparent or opaque bounds (see
+ * {@link #useTransparentBounds(boolean)}) and whether or not
+ * anchors ({@code ^} and {@code $}) are in use
+ * (see {@link #useAnchoringBounds(boolean)}). With transparent
+ * bounds, the matcher is aware of input outside the bounds
+ * set by this method, whereas, with opaque bounds (the default)
+ * only the input within the bounds is used. The use of
+ * anchors are affected by this setting; with transparent
+ * bounds, anchors will match the beginning of the real input,
+ * while with opaque bounds they match the beginning of the
+ * region. {@link #useAnchoringBounds(boolean)} can be used
+ * to turn on or off the matching of anchors.
+ *
+ *
+ * @param start the start of the region (inclusive).
+ * @param end the end of the region (exclusive).
+ * @return a reference to this matcher.
+ * @throws IndexOutOfBoundsException if either {@code start} or
+ * {@code end} are less than zero,
+ * if either {@code start} or
+ * {@code end} are greater than the
+ * length of the input, or if
+ * {@code start} is greater than
+ * {@code end}.
+ * @see #regionStart()
+ * @see #regionEnd()
+ * @see #hasTransparentBounds()
+ * @see #useTransparentBounds(boolean)
+ * @see #hasAnchoringBounds()
+ * @see #useAnchoringBounds(boolean)
+ * @since 1.5
+ */
+ public Matcher region(int start, int end)
+ {
+ int length = input.length();
+ if (start < 0)
+ throw new IndexOutOfBoundsException("The start position was less than zero.");
+ if (start >= length)
+ throw new IndexOutOfBoundsException("The start position is after the end of the input.");
+ if (end < 0)
+ throw new IndexOutOfBoundsException("The end position was less than zero.");
+ if (end > length)
+ throw new IndexOutOfBoundsException("The end position is after the end of the input.");
+ if (start > end)
+ throw new IndexOutOfBoundsException("The start position is after the end position.");
+ reset();
+ regionStart = start;
+ regionEnd = end;
+ return this;
+ }
+
+ /**
+ * The start of the region on which to perform matches (inclusive).
+ *
+ * @return the start index of the region.
+ * @see #region(int,int)
+ * #see #regionEnd()
+ * @since 1.5
+ */
+ public int regionStart()
+ {
+ return regionStart;
+ }
+
+ /**
+ * The end of the region on which to perform matches (exclusive).
+ *
+ * @return the end index of the region.
+ * @see #region(int,int)
+ * @see #regionStart()
+ * @since 1.5
+ */
+ public int regionEnd()
+ {
+ return regionEnd;
+ }
+
+ /**
+ * Returns true if the bounds of the region marked by
+ * {@link #regionStart()} and {@link #regionEnd()} are
+ * transparent. When these bounds are transparent, the
+ * matching process can look beyond them to perform
+ * lookahead, lookbehind and boundary matching operations.
+ * By default, the bounds are opaque.
+ *
+ * @return true if the bounds of the matching region are
+ * transparent.
+ * @see #useTransparentBounds(boolean)
+ * @see #region(int,int)
+ * @see #regionStart()
+ * @see #regionEnd()
+ * @since 1.5
+ */
+ public boolean hasTransparentBounds()
+ {
+ return transparentBounds;
+ }
+
+ /**
+ * Sets the transparency of the bounds of the region
+ * marked by {@link #regionStart()} and {@link #regionEnd()}.
+ * A value of {@code true} makes the bounds transparent,
+ * so the matcher can see beyond them to perform lookahead,
+ * lookbehind and boundary matching operations. A value
+ * of {@code false} (the default) makes the bounds opaque,
+ * restricting the match to the input region denoted
+ * by {@link #regionStart()} and {@link #regionEnd()}.
+ *
+ * @param transparent true if the bounds should be transparent.
+ * @return a reference to this matcher.
+ * @see #hasTransparentBounds()
+ * @see #region(int,int)
+ * @see #regionStart()
+ * @see #regionEnd()
+ * @since 1.5
+ */
+ public Matcher useTransparentBounds(boolean transparent)
+ {
+ transparentBounds = transparent;
+ return this;
+ }
+
+ /**
+ * Returns true if the matcher will honour the use of
+ * the anchoring bounds: {@code ^}, {@code \A}, {@code \Z},
+ * {@code \z} and {@code $}. By default, the anchors
+ * are used. Note that the effect of the anchors is
+ * also affected by {@link #hasTransparentBounds()}.
+ *
+ * @return true if the matcher will attempt to match
+ * the anchoring bounds.
+ * @see #useAnchoringBounds(boolean)
+ * @see #hasTransparentBounds()
+ * @since 1.5
+ */
+ public boolean hasAnchoringBounds()
+ {
+ return anchoringBounds == 0;
+ }
+
+ /**
+ * Enables or disables the use of the anchoring bounds:
+ * {@code ^}, {@code \A}, {@code \Z}, {@code \z} and
+ * {@code $}. By default, their use is enabled. When
+ * disabled, the matcher will not attempt to match
+ * the anchors.
+ *
+ * @param useAnchors true if anchoring bounds should be used.
+ * @return a reference to this matcher.
+ * @since 1.5
+ * @see #hasAnchoringBounds()
+ */
+ public Matcher useAnchoringBounds(boolean useAnchors)
+ {
+ if (useAnchors)
+ anchoringBounds = 0;
+ else
+ anchoringBounds = RE.REG_NOTBOL|RE.REG_NOTEOL;
+ return this;
+ }
+
+ /**
+ * Returns a read-only snapshot of the current state of
+ * the {@link Matcher} as a {@link MatchResult}. Any
+ * subsequent changes to this instance are not reflected
+ * in the returned {@link MatchResult}.
+ *
+ * @return a {@link MatchResult} instance representing the
+ * current state of the {@link Matcher}.
+ */
+ public MatchResult toMatchResult()
+ {
+ Matcher snapshot = new Matcher(pattern, input);
+ snapshot.match = (REMatch) match.clone();
+ return snapshot;
+ }
+
}
diff --git a/libjava/classpath/java/util/regex/Pattern.java b/libjava/classpath/java/util/regex/Pattern.java
index 217ce08..35ec0b8 100644
--- a/libjava/classpath/java/util/regex/Pattern.java
+++ b/libjava/classpath/java/util/regex/Pattern.java
@@ -191,7 +191,7 @@ public final class Pattern implements Serializable
public String[] split (CharSequence input, int limit)
{
Matcher matcher = new Matcher(this, input);
- ArrayList list = new ArrayList();
+ ArrayList list = new ArrayList();
int empties = 0;
int count = 0;
int start = 0;
@@ -251,9 +251,7 @@ public final class Pattern implements Serializable
list.add(t);
}
- String[] output = new String [list.size()];
- list.toArray(output);
- return output;
+ return list.toArray(new String[list.size()]);
}
public String pattern ()
diff --git a/libjava/classpath/java/util/regex/PatternSyntaxException.java b/libjava/classpath/java/util/regex/PatternSyntaxException.java
index 41e650d..38e27db 100644
--- a/libjava/classpath/java/util/regex/PatternSyntaxException.java
+++ b/libjava/classpath/java/util/regex/PatternSyntaxException.java
@@ -37,6 +37,8 @@ exception statement from your version. */
package java.util.regex;
+import gnu.java.lang.CPStringBuilder;
+
/**
* Indicates illegal pattern for regular expression.
* Includes state to inspect the pattern and what and where the expression
@@ -115,7 +117,7 @@ public class PatternSyntaxException extends IllegalArgumentException
public String getMessage()
{
String lineSep = System.getProperty("line.separator");
- StringBuffer sb = new StringBuffer(desc);
+ CPStringBuilder sb = new CPStringBuilder(desc);
sb.append(lineSep);
sb.append('\t');
sb.append(pattern);
diff --git a/libjava/classpath/java/util/zip/Deflater.java b/libjava/classpath/java/util/zip/Deflater.java
index e97c605..41d9881 100644
--- a/libjava/classpath/java/util/zip/Deflater.java
+++ b/libjava/classpath/java/util/zip/Deflater.java
@@ -241,7 +241,6 @@ public class Deflater
/**
* Gets the number of input bytes processed so far.
*/
- @Deprecated
public int getTotalIn()
{
return (int) engine.getTotalIn();
@@ -259,7 +258,6 @@ public class Deflater
/**
* Gets the number of output bytes so far.
*/
- @Deprecated
public int getTotalOut()
{
return (int) totalOut;
diff --git a/libjava/classpath/java/util/zip/Inflater.java b/libjava/classpath/java/util/zip/Inflater.java
index 509b957..e3e555a 100644
--- a/libjava/classpath/java/util/zip/Inflater.java
+++ b/libjava/classpath/java/util/zip/Inflater.java
@@ -246,7 +246,6 @@ public class Inflater
* Gets the total number of processed compressed input bytes.
* @return the total number of bytes of processed input bytes.
*/
- @Deprecated
public int getTotalIn()
{
return (int) (totalIn - getRemaining());
@@ -266,7 +265,6 @@ public class Inflater
* Gets the total number of output bytes returned by inflate().
* @return the total number of output bytes.
*/
- @Deprecated
public int getTotalOut()
{
return (int) totalOut;
diff --git a/libjava/classpath/java/util/zip/ZipEntry.java b/libjava/classpath/java/util/zip/ZipEntry.java
index 893f043..a6d01af 100644
--- a/libjava/classpath/java/util/zip/ZipEntry.java
+++ b/libjava/classpath/java/util/zip/ZipEntry.java
@@ -50,23 +50,39 @@ import java.util.Calendar;
*/
public class ZipEntry implements ZipConstants, Cloneable
{
- private static final int KNOWN_SIZE = 1;
- private static final int KNOWN_CSIZE = 2;
- private static final int KNOWN_CRC = 4;
- private static final int KNOWN_TIME = 8;
- private static final int KNOWN_EXTRA = 16;
-
- private static Calendar cal;
-
- private String name;
+ private static final byte KNOWN_SIZE = 1;
+ private static final byte KNOWN_CSIZE = 2;
+ private static final byte KNOWN_CRC = 4;
+ private static final byte KNOWN_TIME = 8;
+ private static final byte KNOWN_DOSTIME = 16;
+ private static final byte KNOWN_EXTRA = 32;
+
+ /** Immutable name of the entry */
+ private final String name;
+ /** Uncompressed size */
private int size;
+ /** Compressed size */
private long compressedSize = -1;
+ /** CRC of uncompressed data */
private int crc;
+ /** Comment or null if none */
+ private String comment = null;
+ /** The compression method. Either DEFLATED or STORED, by default -1. */
+ private byte method = -1;
+ /** Flags specifying what we know about this entry */
+ private byte known = 0;
+ /**
+ * The 32bit DOS encoded format for the time of this entry. Only valid if
+ * KNOWN_DOSTIME is set in known.
+ */
private int dostime;
- private short known = 0;
- private short method = -1;
+ /**
+ * The 64bit Java encoded millisecond time since the beginning of the epoch.
+ * Only valid if KNOWN_TIME is set in known.
+ */
+ private long time;
+ /** Extra data */
private byte[] extra = null;
- private String comment = null;
int flags; /* used by ZipOutputStream */
int offset; /* used by ZipFile and ZipOutputStream */
@@ -113,6 +129,7 @@ public class ZipEntry implements ZipConstants, Cloneable
compressedSize = e.compressedSize;
crc = e.crc;
dostime = e.dostime;
+ time = e.time;
method = e.method;
extra = e.extra;
comment = e.comment;
@@ -121,37 +138,60 @@ public class ZipEntry implements ZipConstants, Cloneable
final void setDOSTime(int dostime)
{
this.dostime = dostime;
- known |= KNOWN_TIME;
+ known |= KNOWN_DOSTIME;
+ known &= ~KNOWN_TIME;
}
final int getDOSTime()
{
- if ((known & KNOWN_TIME) == 0)
- return 0;
- else
+ if ((known & KNOWN_DOSTIME) != 0)
return dostime;
+ else if ((known & KNOWN_TIME) != 0)
+ {
+ Calendar cal = Calendar.getInstance();
+ cal.setTimeInMillis(time);
+ dostime = (cal.get(Calendar.YEAR) - 1980 & 0x7f) << 25
+ | (cal.get(Calendar.MONTH) + 1) << 21
+ | (cal.get(Calendar.DAY_OF_MONTH)) << 16
+ | (cal.get(Calendar.HOUR_OF_DAY)) << 11
+ | (cal.get(Calendar.MINUTE)) << 5
+ | (cal.get(Calendar.SECOND)) >> 1;
+ known |= KNOWN_DOSTIME;
+ return dostime;
+ }
+ else
+ return 0;
}
/**
* Creates a copy of this zip entry.
*/
- /**
- * Clones the entry.
- */
public Object clone()
{
- try
+ // JCL defines this as being the same as the copy constructor above,
+ // except that value of the "extra" field is also copied. Take care
+ // that in the case of a subclass we use clone() rather than the copy
+ // constructor.
+ ZipEntry clone;
+ if (this.getClass() == ZipEntry.class)
+ clone = new ZipEntry(this);
+ else
{
- // The JCL says that the `extra' field is also copied.
- ZipEntry clone = (ZipEntry) super.clone();
- if (extra != null)
- clone.extra = (byte[]) extra.clone();
- return clone;
+ try
+ {
+ clone = (ZipEntry) super.clone();
+ }
+ catch (CloneNotSupportedException e)
+ {
+ throw new InternalError();
+ }
}
- catch (CloneNotSupportedException ex)
+ if (extra != null)
{
- throw new InternalError();
+ clone.extra = new byte[extra.length];
+ System.arraycopy(extra, 0, clone.extra, 0, extra.length);
}
+ return clone;
}
/**
@@ -169,18 +209,9 @@ public class ZipEntry implements ZipConstants, Cloneable
*/
public void setTime(long time)
{
- Calendar cal = getCalendar();
- synchronized (cal)
- {
- cal.setTimeInMillis(time);
- dostime = (cal.get(Calendar.YEAR) - 1980 & 0x7f) << 25
- | (cal.get(Calendar.MONTH) + 1) << 21
- | (cal.get(Calendar.DAY_OF_MONTH)) << 16
- | (cal.get(Calendar.HOUR_OF_DAY)) << 11
- | (cal.get(Calendar.MINUTE)) << 5
- | (cal.get(Calendar.SECOND)) >> 1;
- }
+ this.time = time;
this.known |= KNOWN_TIME;
+ this.known &= ~KNOWN_DOSTIME;
}
/**
@@ -192,39 +223,34 @@ public class ZipEntry implements ZipConstants, Cloneable
// The extra bytes might contain the time (posix/unix extension)
parseExtra();
- if ((known & KNOWN_TIME) == 0)
- return -1;
-
- int sec = 2 * (dostime & 0x1f);
- int min = (dostime >> 5) & 0x3f;
- int hrs = (dostime >> 11) & 0x1f;
- int day = (dostime >> 16) & 0x1f;
- int mon = ((dostime >> 21) & 0xf) - 1;
- int year = ((dostime >> 25) & 0x7f) + 1980; /* since 1900 */
-
- try
- {
- cal = getCalendar();
- synchronized (cal)
- {
- cal.set(year, mon, day, hrs, min, sec);
- return cal.getTimeInMillis();
- }
- }
- catch (RuntimeException ex)
+ if ((known & KNOWN_TIME) != 0)
+ return time;
+ else if ((known & KNOWN_DOSTIME) != 0)
{
- /* Ignore illegal time stamp */
- known &= ~KNOWN_TIME;
- return -1;
+ int sec = 2 * (dostime & 0x1f);
+ int min = (dostime >> 5) & 0x3f;
+ int hrs = (dostime >> 11) & 0x1f;
+ int day = (dostime >> 16) & 0x1f;
+ int mon = ((dostime >> 21) & 0xf) - 1;
+ int year = ((dostime >> 25) & 0x7f) + 1980; /* since 1900 */
+
+ try
+ {
+ Calendar cal = Calendar.getInstance();
+ cal.set(year, mon, day, hrs, min, sec);
+ time = cal.getTimeInMillis();
+ known |= KNOWN_TIME;
+ return time;
+ }
+ catch (RuntimeException ex)
+ {
+ /* Ignore illegal time stamp */
+ known &= ~KNOWN_TIME;
+ return -1;
+ }
}
- }
-
- private static synchronized Calendar getCalendar()
- {
- if (cal == null)
- cal = Calendar.getInstance();
-
- return cal;
+ else
+ return -1;
}
/**
@@ -298,7 +324,7 @@ public class ZipEntry implements ZipConstants, Cloneable
if (method != ZipOutputStream.STORED
&& method != ZipOutputStream.DEFLATED)
throw new IllegalArgumentException();
- this.method = (short) method;
+ this.method = (byte) method;
}
/**
diff --git a/libjava/classpath/java/util/zip/ZipFile.java b/libjava/classpath/java/util/zip/ZipFile.java
index 3b34bd1..7cf7007 100644
--- a/libjava/classpath/java/util/zip/ZipFile.java
+++ b/libjava/classpath/java/util/zip/ZipFile.java
@@ -340,7 +340,7 @@ public class ZipFile implements ZipConstants
}
catch (IOException ioe)
{
- return EmptyEnumeration.getInstance();
+ return new EmptyEnumeration();
}
}
--
cgit v1.1