From 6b811c5daec1b28e6f63b57f98a032236f2c3cf7 Mon Sep 17 00:00:00 2001 From: Peter Hallam Date: Mon, 3 May 2010 12:57:15 -0700 Subject: Merge awt-kernel, icu, luni-kernel, prefs, security-kernel, x-net into luni Merge xml except xmlpull and kxml into luni --- JavaLibrary.mk | 35 +- awt-kernel/MODULE_LICENSE_APACHE2 | 0 .../src/main/java/java/awt/font/NumericShaper.java | 847 ----- .../src/main/java/java/awt/font/TextAttribute.java | 295 -- .../java/beans/IndexedPropertyChangeEvent.java | 64 - .../main/java/java/beans/PropertyChangeEvent.java | 114 - .../java/java/beans/PropertyChangeListener.java | 36 - .../java/beans/PropertyChangeListenerProxy.java | 59 - .../java/java/beans/PropertyChangeSupport.java | 501 --- icu/MODULE_LICENSE_BSD_LIKE | 0 icu/license.html | 51 - .../com/ibm/icu4jni/charset/CharsetDecoderICU.java | 360 -- .../com/ibm/icu4jni/charset/CharsetEncoderICU.java | 434 --- .../java/com/ibm/icu4jni/charset/CharsetICU.java | 116 - .../com/ibm/icu4jni/charset/NativeConverter.java | 120 - .../java/com/ibm/icu4jni/common/ErrorCode.java | 205 -- .../main/java/com/ibm/icu4jni/lang/UCharacter.java | 185 - .../java/com/ibm/icu4jni/regex/NativeRegEx.java | 132 - .../com/ibm/icu4jni/text/CollationAttribute.java | 40 - .../ibm/icu4jni/text/CollationElementIterator.java | 230 -- .../java/com/ibm/icu4jni/text/CollationKey.java | 122 - .../main/java/com/ibm/icu4jni/text/Collator.java | 248 -- .../com/ibm/icu4jni/text/NativeBreakIterator.java | 158 - .../java/com/ibm/icu4jni/text/NativeCollation.java | 232 -- .../com/ibm/icu4jni/text/NativeDecimalFormat.java | 611 ---- .../main/java/com/ibm/icu4jni/text/NativeIDN.java | 44 - .../com/ibm/icu4jni/text/NativeNormalizer.java | 47 - .../com/ibm/icu4jni/text/RuleBasedCollator.java | 543 --- icu/src/main/java/com/ibm/icu4jni/util/ICU.java | 311 -- .../main/java/com/ibm/icu4jni/util/LocaleData.java | 321 -- icu/src/main/native/BidiWrapper.cpp | 180 - icu/src/main/native/ErrorCode.cpp | 39 - icu/src/main/native/ErrorCode.h | 35 - icu/src/main/native/ICU.cpp | 710 ---- icu/src/main/native/NativeBreakIterator.cpp | 143 - icu/src/main/native/NativeCollation.cpp | 199 -- icu/src/main/native/NativeConverter.cpp | 1019 ------ icu/src/main/native/NativeDecimalFormat.cpp | 608 ---- icu/src/main/native/NativeIDN.cpp | 66 - icu/src/main/native/NativeNormalizer.cpp | 50 - icu/src/main/native/NativeRegEx.cpp | 356 -- icu/src/main/native/ScopedJavaUnicodeString.h | 57 - icu/src/main/native/UCharacter.cpp | 203 -- icu/src/main/native/sub.mk | 31 - icu/unicode-license.txt | 48 - luni-kernel/MODULE_LICENSE_APACHE2 | 0 luni-kernel/src/main/java/java/lang/Class.java | 1579 --------- .../src/main/java/java/lang/ClassCache.java | 702 ---- .../src/main/java/java/lang/ClassLoader.java | 1103 ------ luni-kernel/src/main/java/java/lang/Compiler.java | 92 - .../src/main/java/java/lang/LangAccessImpl.java | 55 - luni-kernel/src/main/java/java/lang/Object.java | 354 -- luni-kernel/src/main/java/java/lang/Package.java | 303 -- .../src/main/java/java/lang/ProcessManager.java | 414 --- luni-kernel/src/main/java/java/lang/Runtime.java | 836 ----- .../src/main/java/java/lang/StackTraceElement.java | 237 -- luni-kernel/src/main/java/java/lang/System.java | 713 ---- luni-kernel/src/main/java/java/lang/Thread.java | 1488 -------- .../src/main/java/java/lang/ThreadGroup.java | 893 ----- luni-kernel/src/main/java/java/lang/Throwable.java | 391 --- .../main/java/java/lang/ref/PhantomReference.java | 75 - .../src/main/java/java/lang/ref/Reference.java | 150 - .../src/main/java/java/lang/ref/SoftReference.java | 114 - .../src/main/java/java/lang/ref/WeakReference.java | 113 - .../java/java/lang/reflect/AccessibleObject.java | 455 --- .../src/main/java/java/lang/reflect/Array.java | 776 ----- .../main/java/java/lang/reflect/Constructor.java | 460 --- .../src/main/java/java/lang/reflect/Field.java | 907 ----- .../src/main/java/java/lang/reflect/Method.java | 555 --- .../java/lang/reflect/ReflectionAccessImpl.java | 54 - .../org/apache/harmony/kernel/vm/LangAccess.java | 129 - .../apache/harmony/kernel/vm/ReflectionAccess.java | 63 - .../org/apache/harmony/kernel/vm/StringUtils.java | 63 - .../main/java/org/apache/harmony/kernel/vm/VM.java | 289 -- .../harmony/lang/annotation/AnnotationFactory.java | 323 -- .../harmony/lang/annotation/AnnotationMember.java | 387 --- luni-kernel/src/main/native/Register.cpp | 107 - .../src/main/native/java_lang_ProcessManager.cpp | 419 --- luni-kernel/src/main/native/java_lang_System.cpp | 93 - luni-kernel/src/main/native/sub.mk | 18 - .../src/test/java/java/lang/reflect/AllTests.java | 29 - .../java/java/lang/reflect/ConstructorTest.java | 49 - .../test/java/java/lang/reflect/MethodTest.java | 49 - .../org/apache/harmony/kernel/dalvik/AllTests.java | 28 - .../apache/harmony/kernel/dalvik/ThreadsTest.java | 259 -- luni/MODULE_LICENSE_W3C | 3 + luni/license.html | 51 + .../com/ibm/icu4jni/charset/CharsetDecoderICU.java | 360 ++ .../com/ibm/icu4jni/charset/CharsetEncoderICU.java | 434 +++ .../java/com/ibm/icu4jni/charset/CharsetICU.java | 116 + .../com/ibm/icu4jni/charset/NativeConverter.java | 120 + .../java/com/ibm/icu4jni/common/ErrorCode.java | 205 ++ .../main/java/com/ibm/icu4jni/lang/UCharacter.java | 185 + .../java/com/ibm/icu4jni/regex/NativeRegEx.java | 132 + .../com/ibm/icu4jni/text/CollationAttribute.java | 40 + .../ibm/icu4jni/text/CollationElementIterator.java | 230 ++ .../java/com/ibm/icu4jni/text/CollationKey.java | 122 + .../main/java/com/ibm/icu4jni/text/Collator.java | 248 ++ .../com/ibm/icu4jni/text/NativeBreakIterator.java | 158 + .../java/com/ibm/icu4jni/text/NativeCollation.java | 232 ++ .../com/ibm/icu4jni/text/NativeDecimalFormat.java | 611 ++++ .../main/java/com/ibm/icu4jni/text/NativeIDN.java | 44 + .../com/ibm/icu4jni/text/NativeNormalizer.java | 47 + .../com/ibm/icu4jni/text/RuleBasedCollator.java | 543 +++ luni/src/main/java/com/ibm/icu4jni/util/ICU.java | 311 ++ .../main/java/com/ibm/icu4jni/util/LocaleData.java | 321 ++ .../src/main/java/java/awt/font/NumericShaper.java | 847 +++++ .../src/main/java/java/awt/font/TextAttribute.java | 295 ++ .../java/beans/IndexedPropertyChangeEvent.java | 64 + .../main/java/java/beans/PropertyChangeEvent.java | 114 + .../java/java/beans/PropertyChangeListener.java | 36 + .../java/beans/PropertyChangeListenerProxy.java | 59 + .../java/java/beans/PropertyChangeSupport.java | 501 +++ luni/src/main/java/java/lang/Class.java | 1579 +++++++++ luni/src/main/java/java/lang/ClassCache.java | 702 ++++ luni/src/main/java/java/lang/ClassLoader.java | 1103 ++++++ luni/src/main/java/java/lang/Compiler.java | 92 + luni/src/main/java/java/lang/LangAccessImpl.java | 55 + luni/src/main/java/java/lang/Object.java | 354 ++ luni/src/main/java/java/lang/Package.java | 303 ++ luni/src/main/java/java/lang/ProcessManager.java | 414 +++ luni/src/main/java/java/lang/Runtime.java | 836 +++++ .../src/main/java/java/lang/StackTraceElement.java | 237 ++ luni/src/main/java/java/lang/System.java | 713 ++++ luni/src/main/java/java/lang/Thread.java | 1488 ++++++++ luni/src/main/java/java/lang/ThreadGroup.java | 893 +++++ luni/src/main/java/java/lang/Throwable.java | 391 +++ .../main/java/java/lang/ref/PhantomReference.java | 75 + luni/src/main/java/java/lang/ref/Reference.java | 150 + .../src/main/java/java/lang/ref/SoftReference.java | 114 + .../src/main/java/java/lang/ref/WeakReference.java | 113 + .../java/java/lang/reflect/AccessibleObject.java | 455 +++ luni/src/main/java/java/lang/reflect/Array.java | 776 +++++ .../main/java/java/lang/reflect/Constructor.java | 460 +++ luni/src/main/java/java/lang/reflect/Field.java | 907 +++++ luni/src/main/java/java/lang/reflect/Method.java | 555 +++ .../java/lang/reflect/ReflectionAccessImpl.java | 54 + .../java/java/security/AccessControlContext.java | 278 ++ .../main/java/java/security/AccessController.java | 368 ++ .../java/java/util/prefs/AbstractPreferences.java | 930 +++++ .../java/util/prefs/BackingStoreException.java | 51 + .../util/prefs/FilePreferencesFactoryImpl.java | 44 + .../java/java/util/prefs/FilePreferencesImpl.java | 232 ++ .../prefs/InvalidPreferencesFormatException.java | 63 + .../main/java/java/util/prefs/NodeChangeEvent.java | 94 + .../java/java/util/prefs/NodeChangeListener.java | 49 + luni/src/main/java/java/util/prefs/NodeSet.java | 34 + .../java/util/prefs/PreferenceChangeEvent.java | 112 + .../java/util/prefs/PreferenceChangeListener.java | 43 + .../src/main/java/java/util/prefs/Preferences.java | 895 +++++ .../java/java/util/prefs/PreferencesFactory.java | 43 + luni/src/main/java/java/util/prefs/XMLParser.java | 593 ++++ luni/src/main/java/java/util/prefs/package.html | 13 + .../java/javax/net/DefaultServerSocketFactory.java | 49 + .../main/java/javax/net/DefaultSocketFactory.java | 60 + .../main/java/javax/net/ServerSocketFactory.java | 109 + luni/src/main/java/javax/net/SocketFactory.java | 153 + luni/src/main/java/javax/net/package.html | 7 + .../net/ssl/CertPathTrustManagerParameters.java | 52 + .../javax/net/ssl/DefaultHostnameVerifier.java | 329 ++ .../main/java/javax/net/ssl/DefaultSSLContext.java | 124 + .../net/ssl/DefaultSSLServerSocketFactory.java | 62 + .../javax/net/ssl/DefaultSSLSocketFactory.java | 76 + .../javax/net/ssl/HandshakeCompletedEvent.java | 141 + .../javax/net/ssl/HandshakeCompletedListener.java | 34 + .../main/java/javax/net/ssl/HostnameVerifier.java | 40 + .../java/javax/net/ssl/HttpsURLConnection.java | 222 ++ luni/src/main/java/javax/net/ssl/KeyManager.java | 27 + .../main/java/javax/net/ssl/KeyManagerFactory.java | 233 ++ .../java/javax/net/ssl/KeyManagerFactorySpi.java | 74 + .../javax/net/ssl/KeyStoreBuilderParameters.java | 79 + .../javax/net/ssl/ManagerFactoryParameters.java | 27 + luni/src/main/java/javax/net/ssl/SSLContext.java | 253 ++ .../src/main/java/javax/net/ssl/SSLContextSpi.java | 109 + luni/src/main/java/javax/net/ssl/SSLEngine.java | 464 +++ .../main/java/javax/net/ssl/SSLEngineResult.java | 172 + luni/src/main/java/javax/net/ssl/SSLException.java | 61 + .../java/javax/net/ssl/SSLHandshakeException.java | 37 + .../main/java/javax/net/ssl/SSLKeyException.java | 36 + .../javax/net/ssl/SSLPeerUnverifiedException.java | 38 + .../src/main/java/javax/net/ssl/SSLPermission.java | 58 + .../java/javax/net/ssl/SSLProtocolException.java | 37 + .../main/java/javax/net/ssl/SSLServerSocket.java | 232 ++ .../java/javax/net/ssl/SSLServerSocketFactory.java | 103 + luni/src/main/java/javax/net/ssl/SSLSession.java | 231 ++ .../java/javax/net/ssl/SSLSessionBindingEvent.java | 75 + .../javax/net/ssl/SSLSessionBindingListener.java | 44 + .../main/java/javax/net/ssl/SSLSessionContext.java | 82 + luni/src/main/java/javax/net/ssl/SSLSocket.java | 299 ++ .../main/java/javax/net/ssl/SSLSocketFactory.java | 147 + luni/src/main/java/javax/net/ssl/TrustManager.java | 28 + .../java/javax/net/ssl/TrustManagerFactory.java | 229 ++ .../java/javax/net/ssl/TrustManagerFactorySpi.java | 67 + .../java/javax/net/ssl/X509ExtendedKeyManager.java | 76 + .../main/java/javax/net/ssl/X509KeyManager.java | 113 + .../main/java/javax/net/ssl/X509TrustManager.java | 76 + luni/src/main/java/javax/net/ssl/package.html | 20 + luni/src/main/java/javax/xml/XMLConstants.java | 179 + .../datatype/DatatypeConfigurationException.java | 171 + .../java/javax/xml/datatype/DatatypeConstants.java | 268 ++ .../java/javax/xml/datatype/DatatypeFactory.java | 1020 ++++++ .../src/main/java/javax/xml/datatype/Duration.java | 987 ++++++ .../java/javax/xml/datatype/FactoryFinder.java | 396 +++ .../java/javax/xml/datatype/SecuritySupport.java | 105 + .../javax/xml/datatype/XMLGregorianCalendar.java | 1037 ++++++ luni/src/main/java/javax/xml/datatype/package.html | 147 + .../java/javax/xml/namespace/NamespaceContext.java | 256 ++ luni/src/main/java/javax/xml/namespace/QName.java | 496 +++ .../src/main/java/javax/xml/namespace/package.html | 33 + luni/src/main/java/javax/xml/package.html | 7 + .../java/javax/xml/parsers/DocumentBuilder.java | 319 ++ .../javax/xml/parsers/DocumentBuilderFactory.java | 501 +++ .../xml/parsers/FactoryConfigurationError.java | 120 + .../main/java/javax/xml/parsers/FilePathToURI.java | 129 + .../xml/parsers/ParserConfigurationException.java | 53 + .../src/main/java/javax/xml/parsers/SAXParser.java | 526 +++ .../java/javax/xml/parsers/SAXParserFactory.java | 378 ++ .../java/javax/xml/parsers/SecuritySupport.java | 105 + luni/src/main/java/javax/xml/parsers/package.html | 17 + .../java/javax/xml/transform/ErrorListener.java | 109 + .../main/java/javax/xml/transform/OutputKeys.java | 193 ++ luni/src/main/java/javax/xml/transform/Result.java | 80 + .../java/javax/xml/transform/SecuritySupport.java | 105 + luni/src/main/java/javax/xml/transform/Source.java | 47 + .../java/javax/xml/transform/SourceLocator.java | 90 + .../main/java/javax/xml/transform/Templates.java | 73 + .../main/java/javax/xml/transform/Transformer.java | 321 ++ .../TransformerConfigurationException.java | 96 + .../javax/xml/transform/TransformerException.java | 316 ++ .../javax/xml/transform/TransformerFactory.java | 327 ++ .../TransformerFactoryConfigurationError.java | 116 + .../main/java/javax/xml/transform/URIResolver.java | 44 + .../java/javax/xml/transform/dom/DOMLocator.java | 44 + .../java/javax/xml/transform/dom/DOMResult.java | 350 ++ .../java/javax/xml/transform/dom/DOMSource.java | 132 + .../main/java/javax/xml/transform/dom/package.html | 36 + .../main/java/javax/xml/transform/overview.html | 257 ++ .../src/main/java/javax/xml/transform/package.html | 201 ++ .../java/javax/xml/transform/sax/SAXResult.java | 138 + .../java/javax/xml/transform/sax/SAXSource.java | 205 ++ .../xml/transform/sax/SAXTransformerFactory.java | 144 + .../javax/xml/transform/sax/TemplatesHandler.java | 62 + .../xml/transform/sax/TransformerHandler.java | 70 + .../main/java/javax/xml/transform/sax/package.html | 69 + .../javax/xml/transform/stream/FilePathToURI.java | 129 + .../javax/xml/transform/stream/StreamResult.java | 195 ++ .../javax/xml/transform/stream/StreamSource.java | 273 ++ .../java/javax/xml/transform/stream/package.html | 30 + .../src/main/java/javax/xml/validation/Schema.java | 92 + .../java/javax/xml/validation/SchemaFactory.java | 675 ++++ .../javax/xml/validation/SchemaFactoryFinder.java | 499 +++ .../javax/xml/validation/SchemaFactoryLoader.java | 31 + .../java/javax/xml/validation/SecuritySupport.java | 162 + .../javax/xml/validation/TypeInfoProvider.java | 181 + .../main/java/javax/xml/validation/Validator.java | 439 +++ .../javax/xml/validation/ValidatorHandler.java | 450 +++ .../main/java/javax/xml/validation/package.html | 91 + .../main/java/javax/xml/xpath/SecuritySupport.java | 162 + luni/src/main/java/javax/xml/xpath/XPath.java | 299 ++ .../main/java/javax/xml/xpath/XPathConstants.java | 78 + .../main/java/javax/xml/xpath/XPathException.java | 99 + .../main/java/javax/xml/xpath/XPathExpression.java | 185 + .../javax/xml/xpath/XPathExpressionException.java | 61 + .../main/java/javax/xml/xpath/XPathFactory.java | 292 ++ .../xpath/XPathFactoryConfigurationException.java | 61 + .../java/javax/xml/xpath/XPathFactoryFinder.java | 455 +++ .../main/java/javax/xml/xpath/XPathFunction.java | 51 + .../javax/xml/xpath/XPathFunctionException.java | 61 + .../javax/xml/xpath/XPathFunctionResolver.java | 60 + .../javax/xml/xpath/XPathVariableResolver.java | 51 + luni/src/main/java/javax/xml/xpath/package.html | 261 ++ .../org/apache/harmony/kernel/vm/LangAccess.java | 129 + .../apache/harmony/kernel/vm/ReflectionAccess.java | 63 + .../org/apache/harmony/kernel/vm/StringUtils.java | 63 + .../main/java/org/apache/harmony/kernel/vm/VM.java | 289 ++ .../harmony/lang/annotation/AnnotationFactory.java | 323 ++ .../harmony/lang/annotation/AnnotationMember.java | 387 +++ .../org/apache/harmony/xml/ExpatAttributes.java | 154 + .../org/apache/harmony/xml/ExpatException.java | 28 + .../java/org/apache/harmony/xml/ExpatParser.java | 808 +++++ .../org/apache/harmony/xml/ExpatPullParser.java | 964 ++++++ .../java/org/apache/harmony/xml/ExpatReader.java | 326 ++ .../java/org/apache/harmony/xml/dom/AttrImpl.java | 141 + .../apache/harmony/xml/dom/CDATASectionImpl.java | 87 + .../apache/harmony/xml/dom/CharacterDataImpl.java | 99 + .../org/apache/harmony/xml/dom/CommentImpl.java | 55 + .../harmony/xml/dom/DOMConfigurationImpl.java | 491 +++ .../harmony/xml/dom/DOMImplementationImpl.java | 90 + .../harmony/xml/dom/DocumentFragmentImpl.java | 49 + .../org/apache/harmony/xml/dom/DocumentImpl.java | 538 +++ .../apache/harmony/xml/dom/DocumentTypeImpl.java | 113 + .../org/apache/harmony/xml/dom/ElementImpl.java | 457 +++ .../org/apache/harmony/xml/dom/EntityImpl.java | 81 + .../harmony/xml/dom/EntityReferenceImpl.java | 51 + .../org/apache/harmony/xml/dom/InnerNodeImpl.java | 245 ++ .../org/apache/harmony/xml/dom/LeafNodeImpl.java | 69 + .../apache/harmony/xml/dom/NamedNodeMapImpl.java | 176 + .../java/org/apache/harmony/xml/dom/NodeImpl.java | 733 ++++ .../org/apache/harmony/xml/dom/NodeListImpl.java | 63 + .../org/apache/harmony/xml/dom/NotationImpl.java | 63 + .../harmony/xml/dom/ProcessingInstructionImpl.java | 73 + .../java/org/apache/harmony/xml/dom/TextImpl.java | 172 + .../xml/parsers/DocumentBuilderFactoryImpl.java | 105 + .../harmony/xml/parsers/DocumentBuilderImpl.java | 481 +++ .../harmony/xml/parsers/SAXParserFactoryImpl.java | 123 + .../apache/harmony/xml/parsers/SAXParserImpl.java | 112 + .../xnet/provider/jsse/AbstractSessionContext.java | 221 ++ .../harmony/xnet/provider/jsse/AlertException.java | 66 + .../harmony/xnet/provider/jsse/AlertProtocol.java | 286 ++ .../harmony/xnet/provider/jsse/Appendable.java | 33 + .../xnet/provider/jsse/CertificateMessage.java | 176 + .../xnet/provider/jsse/CertificateRequest.java | 189 + .../xnet/provider/jsse/CertificateVerify.java | 97 + .../harmony/xnet/provider/jsse/CipherSuite.java | 610 ++++ .../xnet/provider/jsse/ClientHandshakeImpl.java | 629 ++++ .../harmony/xnet/provider/jsse/ClientHello.java | 206 ++ .../xnet/provider/jsse/ClientKeyExchange.java | 152 + .../xnet/provider/jsse/ClientSessionContext.java | 229 ++ .../xnet/provider/jsse/ConnectionState.java | 169 + .../xnet/provider/jsse/ConnectionStateSSLv3.java | 354 ++ .../xnet/provider/jsse/ConnectionStateTLS.java | 352 ++ .../harmony/xnet/provider/jsse/ContentType.java | 49 + .../harmony/xnet/provider/jsse/DHParameters.java | 108 + .../harmony/xnet/provider/jsse/DataStream.java | 42 + .../harmony/xnet/provider/jsse/DelegatedTask.java | 65 + .../xnet/provider/jsse/DigitalSignature.java | 254 ++ .../xnet/provider/jsse/EndOfBufferException.java | 35 + .../xnet/provider/jsse/EndOfSourceException.java | 34 + .../xnet/provider/jsse/FileClientSessionCache.java | 374 ++ .../harmony/xnet/provider/jsse/Finished.java | 82 + .../harmony/xnet/provider/jsse/Handshake.java | 89 + .../xnet/provider/jsse/HandshakeIODataStream.java | 464 +++ .../xnet/provider/jsse/HandshakeProtocol.java | 534 +++ .../harmony/xnet/provider/jsse/HelloRequest.java | 77 + .../harmony/xnet/provider/jsse/JSSEProvider.java | 137 + .../xnet/provider/jsse/KeyManagerFactoryImpl.java | 133 + .../harmony/xnet/provider/jsse/KeyManagerImpl.java | 186 + .../apache/harmony/xnet/provider/jsse/Logger.java | 122 + .../apache/harmony/xnet/provider/jsse/Message.java | 74 + .../harmony/xnet/provider/jsse/NativeCrypto.java | 330 ++ .../xnet/provider/jsse/OpenSSLMessageDigest.java | 118 + .../provider/jsse/OpenSSLMessageDigestJDK.java | 117 + .../jsse/OpenSSLServerSocketFactoryImpl.java | 71 + .../provider/jsse/OpenSSLServerSocketImpl.java | 163 + .../xnet/provider/jsse/OpenSSLSessionImpl.java | 483 +++ .../xnet/provider/jsse/OpenSSLSignature.java | 215 ++ .../provider/jsse/OpenSSLSocketFactoryImpl.java | 84 + .../xnet/provider/jsse/OpenSSLSocketImpl.java | 995 ++++++ .../provider/jsse/OpenSSLSocketImplWrapper.java | 203 ++ .../org/apache/harmony/xnet/provider/jsse/PRF.java | 201 ++ .../xnet/provider/jsse/ProtocolVersion.java | 158 + .../xnet/provider/jsse/SSLBufferedInput.java | 77 + .../xnet/provider/jsse/SSLClientSessionCache.java | 53 + .../harmony/xnet/provider/jsse/SSLContextImpl.java | 127 + .../xnet/provider/jsse/SSLEngineAppData.java | 95 + .../xnet/provider/jsse/SSLEngineDataStream.java | 91 + .../harmony/xnet/provider/jsse/SSLEngineImpl.java | 769 +++++ .../harmony/xnet/provider/jsse/SSLInputStream.java | 125 + .../harmony/xnet/provider/jsse/SSLParameters.java | 440 +++ .../xnet/provider/jsse/SSLRecordProtocol.java | 482 +++ .../xnet/provider/jsse/SSLServerSessionCache.java | 52 + .../harmony/xnet/provider/jsse/SSLSessionImpl.java | 366 ++ .../xnet/provider/jsse/SSLStreamedInput.java | 57 + .../harmony/xnet/provider/jsse/SSLv3Constants.java | 84 + .../xnet/provider/jsse/ServerHandshakeImpl.java | 724 ++++ .../harmony/xnet/provider/jsse/ServerHello.java | 137 + .../xnet/provider/jsse/ServerHelloDone.java | 78 + .../xnet/provider/jsse/ServerKeyExchange.java | 193 ++ .../xnet/provider/jsse/ServerSessionContext.java | 137 + .../provider/jsse/TrustManagerFactoryImpl.java | 134 + .../xnet/provider/jsse/TrustManagerImpl.java | 234 ++ luni/src/main/java/org/apache/xalan/Version.java | 153 + luni/src/main/java/org/apache/xalan/Version.src | 153 + .../apache/xalan/extensions/ExpressionContext.java | 93 + .../apache/xalan/extensions/ExpressionVisitor.java | 82 + .../apache/xalan/extensions/ExtensionHandler.java | 147 + .../extensions/ExtensionNamespaceSupport.java | 106 + .../extensions/ExtensionNamespacesManager.java | 286 ++ .../apache/xalan/extensions/ExtensionsTable.java | 241 ++ .../org/apache/xalan/extensions/ObjectFactory.java | 154 + .../xalan/processor/ProcessorAttributeSet.java | 105 + .../xalan/processor/ProcessorCharacters.java | 179 + .../xalan/processor/ProcessorDecimalFormat.java | 75 + .../xalan/processor/ProcessorExsltFuncResult.java | 70 + .../xalan/processor/ProcessorExsltFunction.java | 189 + .../xalan/processor/ProcessorGlobalParamDecl.java | 77 + .../processor/ProcessorGlobalVariableDecl.java | 77 + .../apache/xalan/processor/ProcessorImport.java | 56 + .../apache/xalan/processor/ProcessorInclude.java | 396 +++ .../org/apache/xalan/processor/ProcessorKey.java | 156 + .../org/apache/xalan/processor/ProcessorLRE.java | 369 ++ .../xalan/processor/ProcessorNamespaceAlias.java | 97 + .../xalan/processor/ProcessorOutputElem.java | 223 ++ .../xalan/processor/ProcessorPreserveSpace.java | 78 + .../xalan/processor/ProcessorStripSpace.java | 78 + .../xalan/processor/ProcessorStylesheetDoc.java | 31 + .../processor/ProcessorStylesheetElement.java | 147 + .../apache/xalan/processor/ProcessorTemplate.java | 53 + .../xalan/processor/ProcessorTemplateElem.java | 126 + .../org/apache/xalan/processor/ProcessorText.java | 82 + .../apache/xalan/processor/ProcessorUnknown.java | 36 + .../apache/xalan/processor/StylesheetHandler.java | 1727 ++++++++++ .../xalan/processor/TransformerFactoryImpl.java | 1043 ++++++ .../xalan/processor/WhitespaceInfoPaths.java | 82 + .../apache/xalan/processor/XSLProcessorVersion.src | 116 + .../apache/xalan/processor/XSLTAttributeDef.java | 1665 +++++++++ .../org/apache/xalan/processor/XSLTElementDef.java | 833 +++++ .../xalan/processor/XSLTElementProcessor.java | 383 +++ .../org/apache/xalan/processor/XSLTSchema.java | 922 +++++ .../java/org/apache/xalan/processor/package.html | 41 + .../java/org/apache/xalan/res/XSLMessages.java | 73 + .../org/apache/xalan/res/XSLTErrorResources.java | 1511 ++++++++ .../java/org/apache/xalan/res/XSLTInfo.properties | 30 + .../main/java/org/apache/xalan/res/package.html | 26 + .../apache/xalan/serialize/SerializerUtils.java | 273 ++ .../main/java/org/apache/xalan/templates/AVT.java | 614 ++++ .../java/org/apache/xalan/templates/AVTPart.java | 94 + .../org/apache/xalan/templates/AVTPartSimple.java | 100 + .../org/apache/xalan/templates/AVTPartXPath.java | 150 + .../org/apache/xalan/templates/AbsPathChecker.java | 81 + .../java/org/apache/xalan/templates/Constants.java | 399 +++ .../xalan/templates/DecimalFormatProperties.java | 404 +++ .../apache/xalan/templates/ElemApplyImport.java | 112 + .../apache/xalan/templates/ElemApplyTemplates.java | 421 +++ .../org/apache/xalan/templates/ElemAttribute.java | 276 ++ .../apache/xalan/templates/ElemAttributeSet.java | 174 + .../apache/xalan/templates/ElemCallTemplate.java | 364 ++ .../org/apache/xalan/templates/ElemChoose.java | 166 + .../org/apache/xalan/templates/ElemComment.java | 143 + .../java/org/apache/xalan/templates/ElemCopy.java | 136 + .../org/apache/xalan/templates/ElemCopyOf.java | 239 ++ .../org/apache/xalan/templates/ElemElement.java | 372 ++ .../java/org/apache/xalan/templates/ElemEmpty.java | 38 + .../xalan/templates/ElemExsltFuncResult.java | 95 + .../apache/xalan/templates/ElemExsltFunction.java | 145 + .../apache/xalan/templates/ElemExtensionCall.java | 315 ++ .../apache/xalan/templates/ElemExtensionDecl.java | 369 ++ .../xalan/templates/ElemExtensionScript.java | 103 + .../org/apache/xalan/templates/ElemFallback.java | 110 + .../org/apache/xalan/templates/ElemForEach.java | 494 +++ .../java/org/apache/xalan/templates/ElemIf.java | 150 + .../apache/xalan/templates/ElemLiteralResult.java | 1478 ++++++++ .../org/apache/xalan/templates/ElemMessage.java | 124 + .../org/apache/xalan/templates/ElemNumber.java | 2157 ++++++++++++ .../org/apache/xalan/templates/ElemOtherwise.java | 57 + .../java/org/apache/xalan/templates/ElemPI.java | 224 ++ .../java/org/apache/xalan/templates/ElemParam.java | 124 + .../java/org/apache/xalan/templates/ElemSort.java | 349 ++ .../org/apache/xalan/templates/ElemTemplate.java | 413 +++ .../xalan/templates/ElemTemplateElement.java | 1660 +++++++++ .../java/org/apache/xalan/templates/ElemText.java | 148 + .../apache/xalan/templates/ElemTextLiteral.java | 225 ++ .../org/apache/xalan/templates/ElemUnknown.java | 121 + .../java/org/apache/xalan/templates/ElemUse.java | 205 ++ .../org/apache/xalan/templates/ElemValueOf.java | 289 ++ .../org/apache/xalan/templates/ElemVariable.java | 528 +++ .../apache/xalan/templates/ElemVariablePsuedo.java | 68 + .../java/org/apache/xalan/templates/ElemWhen.java | 126 + .../org/apache/xalan/templates/ElemWithParam.java | 261 ++ .../org/apache/xalan/templates/FuncDocument.java | 463 +++ .../org/apache/xalan/templates/FuncFormatNumb.java | 188 + .../java/org/apache/xalan/templates/FuncKey.java | 151 + .../org/apache/xalan/templates/KeyDeclaration.java | 198 ++ .../org/apache/xalan/templates/NamespaceAlias.java | 159 + .../apache/xalan/templates/OutputProperties.java | 689 ++++ .../xalan/templates/RedundentExprEliminator.java | 1432 ++++++++ .../org/apache/xalan/templates/Stylesheet.java | 1516 ++++++++ .../apache/xalan/templates/StylesheetComposed.java | 349 ++ .../org/apache/xalan/templates/StylesheetRoot.java | 1405 ++++++++ .../org/apache/xalan/templates/TemplateList.java | 923 +++++ .../templates/TemplateSubPatternAssociation.java | 249 ++ .../apache/xalan/templates/VarNameCollector.java | 80 + .../org/apache/xalan/templates/WhiteSpaceInfo.java | 87 + .../java/org/apache/xalan/templates/XMLNSDecl.java | 87 + .../org/apache/xalan/templates/XSLTVisitable.java | 40 + .../org/apache/xalan/templates/XSLTVisitor.java | 126 + .../xalan/templates/XUnresolvedVariable.java | 187 + .../xalan/templates/XUnresolvedVariableSimple.java | 84 + .../java/org/apache/xalan/templates/package.html | 44 + .../xalan/transformer/ClonerToResultTree.java | 212 ++ .../java/org/apache/xalan/transformer/Counter.java | 157 + .../apache/xalan/transformer/CountersTable.java | 208 ++ .../apache/xalan/transformer/DecimalToRoman.java | 62 + .../org/apache/xalan/transformer/KeyIterator.java | 153 + .../org/apache/xalan/transformer/KeyManager.java | 115 + .../org/apache/xalan/transformer/KeyTable.java | 260 ++ .../java/org/apache/xalan/transformer/MsgMgr.java | 315 ++ .../org/apache/xalan/transformer/NodeSortKey.java | 129 + .../org/apache/xalan/transformer/NodeSorter.java | 557 +++ .../xalan/transformer/SerializerSwitcher.java | 205 ++ .../org/apache/xalan/transformer/TrAXFilter.java | 235 ++ .../apache/xalan/transformer/TransformState.java | 128 + .../xalan/transformer/TransformerClient.java | 43 + .../xalan/transformer/TransformerHandlerImpl.java | 1080 ++++++ .../xalan/transformer/TransformerIdentityImpl.java | 1481 ++++++++ .../apache/xalan/transformer/TransformerImpl.java | 3271 ++++++++++++++++++ .../xalan/transformer/TreeWalker2Result.java | 155 + .../apache/xalan/transformer/XalanProperties.java | 35 + .../xalan/transformer/XalanTransformState.java | 148 + .../java/org/apache/xalan/transformer/package.html | 39 + .../org/apache/xalan/xslt/EnvironmentCheck.java | 1296 +++++++ .../java/org/apache/xalan/xslt/ObjectFactory.java | 661 ++++ .../org/apache/xalan/xslt/SecuritySupport.java | 125 + .../org/apache/xalan/xslt/SecuritySupport12.java | 146 + .../main/java/org/apache/xalan/xslt/package.html | 26 + luni/src/main/java/org/apache/xml/dtm/Axis.java | 220 ++ luni/src/main/java/org/apache/xml/dtm/DTM.java | 967 ++++++ .../java/org/apache/xml/dtm/DTMAxisIterator.java | 110 + .../java/org/apache/xml/dtm/DTMAxisTraverser.java | 116 + .../apache/xml/dtm/DTMConfigurationException.java | 99 + .../java/org/apache/xml/dtm/DTMDOMException.java | 54 + .../main/java/org/apache/xml/dtm/DTMException.java | 383 +++ .../main/java/org/apache/xml/dtm/DTMFilter.java | 188 + .../main/java/org/apache/xml/dtm/DTMIterator.java | 344 ++ .../main/java/org/apache/xml/dtm/DTMManager.java | 430 +++ .../main/java/org/apache/xml/dtm/DTMWSFilter.java | 56 + .../java/org/apache/xml/dtm/ObjectFactory.java | 661 ++++ .../java/org/apache/xml/dtm/SecuritySupport.java | 125 + .../java/org/apache/xml/dtm/SecuritySupport12.java | 146 + .../org/apache/xml/dtm/ref/ChunkedIntArray.java | 306 ++ .../org/apache/xml/dtm/ref/CoroutineManager.java | 344 ++ .../apache/xml/dtm/ref/DTMAxisIterNodeList.java | 142 + .../apache/xml/dtm/ref/DTMAxisIteratorBase.java | 281 ++ .../apache/xml/dtm/ref/DTMChildIterNodeList.java | 119 + .../org/apache/xml/dtm/ref/DTMDefaultBase.java | 2371 +++++++++++++ .../xml/dtm/ref/DTMDefaultBaseIterators.java | 2192 ++++++++++++ .../xml/dtm/ref/DTMDefaultBaseTraversers.java | 1744 ++++++++++ .../org/apache/xml/dtm/ref/DTMDocumentImpl.java | 2411 +++++++++++++ .../org/apache/xml/dtm/ref/DTMManagerDefault.java | 859 +++++ .../org/apache/xml/dtm/ref/DTMNamedNodeMap.java | 300 ++ .../org/apache/xml/dtm/ref/DTMNodeIterator.java | 186 + .../java/org/apache/xml/dtm/ref/DTMNodeList.java | 127 + .../org/apache/xml/dtm/ref/DTMNodeListBase.java | 81 + .../java/org/apache/xml/dtm/ref/DTMNodeProxy.java | 2218 ++++++++++++ .../java/org/apache/xml/dtm/ref/DTMStringPool.java | 191 ++ .../java/org/apache/xml/dtm/ref/DTMTreeWalker.java | 404 +++ .../org/apache/xml/dtm/ref/ExpandedNameTable.java | 391 +++ .../java/org/apache/xml/dtm/ref/ExtendedType.java | 145 + .../apache/xml/dtm/ref/IncrementalSAXSource.java | 89 + .../xml/dtm/ref/IncrementalSAXSource_Filter.java | 807 +++++ .../java/org/apache/xml/dtm/ref/NodeLocator.java | 110 + .../org/apache/xml/dtm/ref/SecuritySupport.java | 125 + .../org/apache/xml/dtm/ref/SecuritySupport12.java | 146 + .../org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java | 1766 ++++++++++ .../DOM2DTMdefaultNamespaceDeclarationNode.java | 679 ++++ .../org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java | 2513 ++++++++++++++ .../org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java | 3383 ++++++++++++++++++ .../org/apache/xml/dtm/ref/sax2dtm/SAX2RTFDTM.java | 362 ++ .../java/org/apache/xml/res/XMLErrorResources.java | 363 ++ .../main/java/org/apache/xml/res/XMLMessages.java | 147 + .../xml/serializer/AttributesImplSerializer.java | 237 ++ .../java/org/apache/xml/serializer/CharInfo.java | 807 +++++ .../org/apache/xml/serializer/DOM3Serializer.java | 170 + .../org/apache/xml/serializer/DOMSerializer.java | 74 + .../org/apache/xml/serializer/ElemContext.java | 222 ++ .../java/org/apache/xml/serializer/ElemDesc.java | 179 + .../org/apache/xml/serializer/EncodingInfo.java | 562 +++ .../java/org/apache/xml/serializer/Encodings.java | 497 +++ .../org/apache/xml/serializer/Encodings.properties | 260 ++ .../xml/serializer/ExtendedContentHandler.java | 271 ++ .../xml/serializer/ExtendedLexicalHandler.java | 39 + .../apache/xml/serializer/HTMLEntities.properties | 311 ++ .../java/org/apache/xml/serializer/Method.java | 82 + .../apache/xml/serializer/NamespaceMappings.java | 500 +++ .../org/apache/xml/serializer/ObjectFactory.java | 660 ++++ .../xml/serializer/OutputPropertiesFactory.java | 516 +++ .../apache/xml/serializer/OutputPropertyUtils.java | 83 + .../org/apache/xml/serializer/SecuritySupport.java | 123 + .../apache/xml/serializer/SecuritySupport12.java | 143 + .../xml/serializer/SerializationHandler.java | 145 + .../java/org/apache/xml/serializer/Serializer.java | 238 ++ .../org/apache/xml/serializer/SerializerBase.java | 1699 +++++++++ .../apache/xml/serializer/SerializerConstants.java | 59 + .../apache/xml/serializer/SerializerFactory.java | 185 + .../org/apache/xml/serializer/SerializerTrace.java | 153 + .../xml/serializer/SerializerTraceWriter.java | 341 ++ .../org/apache/xml/serializer/ToHTMLStream.java | 2350 +++++++++++++ .../org/apache/xml/serializer/ToSAXHandler.java | 438 +++ .../java/org/apache/xml/serializer/ToStream.java | 3601 ++++++++++++++++++++ .../apache/xml/serializer/ToTextSAXHandler.java | 413 +++ .../org/apache/xml/serializer/ToTextStream.java | 634 ++++ .../org/apache/xml/serializer/ToUnknownStream.java | 1316 +++++++ .../org/apache/xml/serializer/ToXMLSAXHandler.java | 774 +++++ .../org/apache/xml/serializer/ToXMLStream.java | 646 ++++ .../xml/serializer/TransformStateSetter.java | 56 + .../java/org/apache/xml/serializer/TreeWalker.java | 527 +++ .../java/org/apache/xml/serializer/Version.java | 150 + .../java/org/apache/xml/serializer/Version.src | 150 + .../org/apache/xml/serializer/WriterChain.java | 82 + .../org/apache/xml/serializer/WriterToASCI.java | 155 + .../xml/serializer/WriterToUTF8Buffered.java | 502 +++ .../apache/xml/serializer/XMLEntities.properties | 30 + .../apache/xml/serializer/XSLOutputAttributes.java | 236 ++ .../xml/serializer/dom3/DOM3SerializerImpl.java | 158 + .../apache/xml/serializer/dom3/DOM3TreeWalker.java | 2149 ++++++++++++ .../apache/xml/serializer/dom3/DOMConstants.java | 134 + .../xml/serializer/dom3/DOMErrorHandlerImpl.java | 67 + .../apache/xml/serializer/dom3/DOMErrorImpl.java | 176 + .../apache/xml/serializer/dom3/DOMLocatorImpl.java | 180 + .../apache/xml/serializer/dom3/DOMOutputImpl.java | 177 + .../xml/serializer/dom3/DOMStringListImpl.java | 99 + .../xml/serializer/dom3/LSSerializerImpl.java | 1537 +++++++++ .../xml/serializer/dom3/NamespaceSupport.java | 315 ++ .../apache/xml/serializer/output_html.properties | 44 + .../apache/xml/serializer/output_text.properties | 37 + .../xml/serializer/output_unknown.properties | 46 + .../apache/xml/serializer/output_xml.properties | 46 + .../java/org/apache/xml/serializer/package.html | 43 + .../org/apache/xml/serializer/utils/AttList.java | 264 ++ .../apache/xml/serializer/utils/DOM2Helper.java | 122 + .../org/apache/xml/serializer/utils/Messages.java | 366 ++ .../org/apache/xml/serializer/utils/MsgKey.java | 131 + .../xml/serializer/utils/SerializerMessages.java | 296 ++ .../serializer/utils/SerializerMessages_ca.java | 293 ++ .../serializer/utils/SerializerMessages_cs.java | 293 ++ .../serializer/utils/SerializerMessages_de.java | 293 ++ .../serializer/utils/SerializerMessages_en.java | 30 + .../serializer/utils/SerializerMessages_es.java | 293 ++ .../serializer/utils/SerializerMessages_fr.java | 293 ++ .../serializer/utils/SerializerMessages_hu.java | 293 ++ .../serializer/utils/SerializerMessages_it.java | 293 ++ .../serializer/utils/SerializerMessages_ja.java | 293 ++ .../serializer/utils/SerializerMessages_ko.java | 293 ++ .../serializer/utils/SerializerMessages_pl.java | 293 ++ .../serializer/utils/SerializerMessages_pt_BR.java | 293 ++ .../serializer/utils/SerializerMessages_ru.java | 293 ++ .../serializer/utils/SerializerMessages_sk.java | 293 ++ .../serializer/utils/SerializerMessages_sl.java | 293 ++ .../serializer/utils/SerializerMessages_sv.java | 98 + .../serializer/utils/SerializerMessages_tr.java | 293 ++ .../serializer/utils/SerializerMessages_zh.java | 291 ++ .../serializer/utils/SerializerMessages_zh_CN.java | 28 + .../serializer/utils/SerializerMessages_zh_TW.java | 293 ++ .../xml/serializer/utils/StringToIntTable.java | 203 ++ .../xml/serializer/utils/SystemIDResolver.java | 302 ++ .../java/org/apache/xml/serializer/utils/URI.java | 1653 +++++++++ .../org/apache/xml/serializer/utils/Utils.java | 40 + .../serializer/utils/WrappedRuntimeException.java | 81 + .../org/apache/xml/serializer/utils/XML11Char.java | 414 +++ .../org/apache/xml/serializer/utils/XMLChar.java | 1026 ++++++ .../main/java/org/apache/xml/utils/AttList.java | 255 ++ .../main/java/org/apache/xml/utils/BoolStack.java | 202 ++ .../main/java/org/apache/xml/utils/Constants.java | 112 + .../main/java/org/apache/xml/utils/DOM2Helper.java | 314 ++ .../main/java/org/apache/xml/utils/DOMBuilder.java | 795 +++++ .../main/java/org/apache/xml/utils/DOMHelper.java | 1341 ++++++++ .../main/java/org/apache/xml/utils/DOMOrder.java | 41 + .../org/apache/xml/utils/DefaultErrorHandler.java | 363 ++ .../org/apache/xml/utils/FastStringBuffer.java | 1293 +++++++ .../main/java/org/apache/xml/utils/IntStack.java | 211 ++ .../main/java/org/apache/xml/utils/IntVector.java | 419 +++ .../src/main/java/org/apache/xml/utils/NSInfo.java | 110 + .../main/java/org/apache/xml/utils/NameSpace.java | 59 + .../org/apache/xml/utils/NamespaceSupport2.java | 749 ++++ .../java/org/apache/xml/utils/NodeConsumer.java | 40 + .../main/java/org/apache/xml/utils/NodeVector.java | 739 ++++ .../java/org/apache/xml/utils/ObjectFactory.java | 661 ++++ .../main/java/org/apache/xml/utils/ObjectPool.java | 174 + .../java/org/apache/xml/utils/ObjectStack.java | 215 ++ .../java/org/apache/xml/utils/ObjectVector.java | 431 +++ .../java/org/apache/xml/utils/PrefixResolver.java | 72 + .../apache/xml/utils/PrefixResolverDefault.java | 145 + luni/src/main/java/org/apache/xml/utils/QName.java | 709 ++++ .../org/apache/xml/utils/SAXSourceLocator.java | 170 + .../java/org/apache/xml/utils/SecuritySupport.java | 125 + .../org/apache/xml/utils/SecuritySupport12.java | 146 + .../org/apache/xml/utils/StopParseException.java | 40 + .../org/apache/xml/utils/StringBufferPool.java | 60 + .../org/apache/xml/utils/StringToIntTable.java | 196 ++ .../java/org/apache/xml/utils/StringVector.java | 223 ++ .../org/apache/xml/utils/StylesheetPIHandler.java | 340 ++ .../apache/xml/utils/SuballocatedIntVector.java | 557 +++ .../org/apache/xml/utils/SystemIDResolver.java | 295 ++ .../apache/xml/utils/ThreadControllerWrapper.java | 96 + .../main/java/org/apache/xml/utils/TreeWalker.java | 508 +++ luni/src/main/java/org/apache/xml/utils/URI.java | 1673 +++++++++ .../main/java/org/apache/xml/utils/UnImplNode.java | 1977 +++++++++++ .../apache/xml/utils/WrappedRuntimeException.java | 74 + .../main/java/org/apache/xml/utils/XML11Char.java | 432 +++ .../main/java/org/apache/xml/utils/XMLChar.java | 668 ++++ .../apache/xml/utils/XMLCharacterRecognizer.java | 109 + .../org/apache/xml/utils/XMLReaderManager.java | 161 + .../main/java/org/apache/xml/utils/XMLString.java | 689 ++++ .../org/apache/xml/utils/XMLStringDefault.java | 818 +++++ .../org/apache/xml/utils/XMLStringFactory.java | 71 + .../main/java/org/apache/xml/utils/package.html | 27 + .../org/apache/xml/utils/res/CharArrayWrapper.java | 42 + .../org/apache/xml/utils/res/IntArrayWrapper.java | 42 + .../org/apache/xml/utils/res/LongArrayWrapper.java | 42 + .../apache/xml/utils/res/StringArrayWrapper.java | 43 + .../org/apache/xml/utils/res/XResourceBundle.java | 140 + .../apache/xml/utils/res/XResourceBundleBase.java | 50 + .../org/apache/xml/utils/res/XResources_cy.java | 84 + .../org/apache/xml/utils/res/XResources_de.java | 73 + .../org/apache/xml/utils/res/XResources_el.java | 90 + .../org/apache/xml/utils/res/XResources_en.java | 73 + .../org/apache/xml/utils/res/XResources_es.java | 73 + .../org/apache/xml/utils/res/XResources_fr.java | 73 + .../org/apache/xml/utils/res/XResources_he.java | 79 + .../org/apache/xml/utils/res/XResources_hy.java | 86 + .../org/apache/xml/utils/res/XResources_it.java | 73 + .../apache/xml/utils/res/XResources_ja_JP_A.java | 86 + .../apache/xml/utils/res/XResources_ja_JP_HA.java | 86 + .../apache/xml/utils/res/XResources_ja_JP_HI.java | 87 + .../apache/xml/utils/res/XResources_ja_JP_I.java | 86 + .../org/apache/xml/utils/res/XResources_ka.java | 84 + .../org/apache/xml/utils/res/XResources_ko.java | 80 + .../org/apache/xml/utils/res/XResources_sv.java | 73 + .../org/apache/xml/utils/res/XResources_zh_CN.java | 80 + .../org/apache/xml/utils/res/XResources_zh_TW.java | 80 + luni/src/main/java/org/apache/xpath/Arg.java | 258 ++ .../main/java/org/apache/xpath/CachedXPathAPI.java | 340 ++ .../src/main/java/org/apache/xpath/Expression.java | 589 ++++ .../main/java/org/apache/xpath/ExpressionNode.java | 52 + .../java/org/apache/xpath/ExpressionOwner.java | 45 + .../java/org/apache/xpath/ExtensionsProvider.java | 60 + .../src/main/java/org/apache/xpath/FoundIndex.java | 37 + luni/src/main/java/org/apache/xpath/NodeSet.java | 1370 ++++++++ .../src/main/java/org/apache/xpath/NodeSetDTM.java | 1247 +++++++ .../src/main/java/org/apache/xpath/SourceTree.java | 52 + .../java/org/apache/xpath/SourceTreeManager.java | 390 +++ .../main/java/org/apache/xpath/VariableStack.java | 547 +++ .../xpath/WhitespaceStrippingElementMatcher.java | 54 + luni/src/main/java/org/apache/xpath/XPath.java | 643 ++++ luni/src/main/java/org/apache/xpath/XPathAPI.java | 288 ++ .../main/java/org/apache/xpath/XPathContext.java | 1352 ++++++++ .../main/java/org/apache/xpath/XPathException.java | 328 ++ .../main/java/org/apache/xpath/XPathFactory.java | 50 + .../org/apache/xpath/XPathProcessorException.java | 54 + .../main/java/org/apache/xpath/XPathVisitable.java | 42 + .../main/java/org/apache/xpath/XPathVisitor.java | 203 ++ .../org/apache/xpath/axes/AttributeIterator.java | 75 + .../java/org/apache/xpath/axes/AxesWalker.java | 590 ++++ .../org/apache/xpath/axes/BasicTestIterator.java | 226 ++ .../java/org/apache/xpath/axes/ChildIterator.java | 121 + .../org/apache/xpath/axes/ChildTestIterator.java | 178 + .../org/apache/xpath/axes/ContextNodeList.java | 136 + .../org/apache/xpath/axes/DescendantIterator.java | 380 +++ .../org/apache/xpath/axes/FilterExprIterator.java | 214 ++ .../xpath/axes/FilterExprIteratorSimple.java | 315 ++ .../org/apache/xpath/axes/FilterExprWalker.java | 349 ++ .../xpath/axes/HasPositionalPredChecker.java | 124 + .../java/org/apache/xpath/axes/IteratorPool.java | 119 + .../org/apache/xpath/axes/LocPathIterator.java | 1033 ++++++ .../apache/xpath/axes/MatchPatternIterator.java | 331 ++ .../java/org/apache/xpath/axes/NodeSequence.java | 953 ++++++ .../org/apache/xpath/axes/OneStepIterator.java | 345 ++ .../apache/xpath/axes/OneStepIteratorForward.java | 172 + .../java/org/apache/xpath/axes/PathComponent.java | 36 + .../org/apache/xpath/axes/PredicatedNodeTest.java | 647 ++++ .../java/org/apache/xpath/axes/RTFIterator.java | 43 + .../org/apache/xpath/axes/ReverseAxesWalker.java | 247 ++ .../apache/xpath/axes/SelfIteratorNoPredicate.java | 127 + .../java/org/apache/xpath/axes/SubContextList.java | 52 + .../org/apache/xpath/axes/UnionChildIterator.java | 150 + .../org/apache/xpath/axes/UnionPathIterator.java | 584 ++++ .../java/org/apache/xpath/axes/WalkerFactory.java | 1825 ++++++++++ .../org/apache/xpath/axes/WalkingIterator.java | 363 ++ .../apache/xpath/axes/WalkingIteratorSorted.java | 214 ++ .../main/java/org/apache/xpath/axes/package.html | 27 + .../java/org/apache/xpath/compiler/Compiler.java | 1268 +++++++ .../org/apache/xpath/compiler/FunctionTable.java | 407 +++ .../java/org/apache/xpath/compiler/Keywords.java | 286 ++ .../main/java/org/apache/xpath/compiler/Lexer.java | 669 ++++ .../java/org/apache/xpath/compiler/OpCodes.java | 632 ++++ .../main/java/org/apache/xpath/compiler/OpMap.java | 455 +++ .../org/apache/xpath/compiler/OpMapVector.java | 116 + .../org/apache/xpath/compiler/PsuedoNames.java | 59 + .../org/apache/xpath/compiler/XPathDumper.java | 31 + .../org/apache/xpath/compiler/XPathParser.java | 2401 +++++++++++++ .../java/org/apache/xpath/compiler/package.html | 26 + .../xpath/domapi/XPathStylesheetDOM3Exception.java | 34 + .../org/apache/xpath/functions/FuncBoolean.java | 48 + .../org/apache/xpath/functions/FuncCeiling.java | 47 + .../org/apache/xpath/functions/FuncConcat.java | 90 + .../org/apache/xpath/functions/FuncContains.java | 57 + .../java/org/apache/xpath/functions/FuncCount.java | 64 + .../org/apache/xpath/functions/FuncCurrent.java | 82 + .../apache/xpath/functions/FuncDoclocation.java | 71 + .../xpath/functions/FuncExtElementAvailable.java | 95 + .../apache/xpath/functions/FuncExtFunction.java | 340 ++ .../xpath/functions/FuncExtFunctionAvailable.java | 104 + .../java/org/apache/xpath/functions/FuncFalse.java | 56 + .../java/org/apache/xpath/functions/FuncFloor.java | 47 + .../org/apache/xpath/functions/FuncGenerateId.java | 62 + .../java/org/apache/xpath/functions/FuncId.java | 151 + .../java/org/apache/xpath/functions/FuncLang.java | 82 + .../java/org/apache/xpath/functions/FuncLast.java | 106 + .../org/apache/xpath/functions/FuncLocalPart.java | 57 + .../org/apache/xpath/functions/FuncNamespace.java | 78 + .../apache/xpath/functions/FuncNormalizeSpace.java | 86 + .../java/org/apache/xpath/functions/FuncNot.java | 47 + .../org/apache/xpath/functions/FuncNumber.java | 47 + .../org/apache/xpath/functions/FuncPosition.java | 134 + .../java/org/apache/xpath/functions/FuncQname.java | 63 + .../java/org/apache/xpath/functions/FuncRound.java | 52 + .../org/apache/xpath/functions/FuncStartsWith.java | 48 + .../org/apache/xpath/functions/FuncString.java | 47 + .../apache/xpath/functions/FuncStringLength.java | 47 + .../org/apache/xpath/functions/FuncSubstring.java | 124 + .../apache/xpath/functions/FuncSubstringAfter.java | 55 + .../xpath/functions/FuncSubstringBefore.java | 53 + .../java/org/apache/xpath/functions/FuncSum.java | 65 + .../apache/xpath/functions/FuncSystemProperty.java | 186 + .../org/apache/xpath/functions/FuncTranslate.java | 88 + .../java/org/apache/xpath/functions/FuncTrue.java | 56 + .../xpath/functions/FuncUnparsedEntityURI.java | 55 + .../java/org/apache/xpath/functions/Function.java | 144 + .../org/apache/xpath/functions/Function2Args.java | 184 + .../org/apache/xpath/functions/Function3Args.java | 183 + .../apache/xpath/functions/FunctionDef1Arg.java | 167 + .../apache/xpath/functions/FunctionMultiArgs.java | 236 ++ .../org/apache/xpath/functions/FunctionOneArg.java | 174 + .../org/apache/xpath/functions/ObjectFactory.java | 661 ++++ .../apache/xpath/functions/SecuritySupport.java | 125 + .../apache/xpath/functions/SecuritySupport12.java | 146 + .../xpath/functions/WrongNumberArgsException.java | 43 + .../java/org/apache/xpath/functions/package.html | 29 + .../apache/xpath/jaxp/JAXPExtensionsProvider.java | 208 ++ .../org/apache/xpath/jaxp/JAXPPrefixResolver.java | 127 + .../org/apache/xpath/jaxp/JAXPVariableStack.java | 73 + .../org/apache/xpath/jaxp/XPathExpressionImpl.java | 396 +++ .../org/apache/xpath/jaxp/XPathFactoryImpl.java | 265 ++ .../main/java/org/apache/xpath/jaxp/XPathImpl.java | 545 +++ .../org/apache/xpath/objects/DTMXRTreeFrag.java | 58 + .../java/org/apache/xpath/objects/XBoolean.java | 168 + .../org/apache/xpath/objects/XBooleanStatic.java | 69 + .../apache/xpath/objects/XMLStringFactoryImpl.java | 101 + .../java/org/apache/xpath/objects/XNodeSet.java | 969 ++++++ .../org/apache/xpath/objects/XNodeSetForDOM.java | 128 + .../main/java/org/apache/xpath/objects/XNull.java | 130 + .../java/org/apache/xpath/objects/XNumber.java | 437 +++ .../java/org/apache/xpath/objects/XObject.java | 759 +++++ .../org/apache/xpath/objects/XObjectFactory.java | 161 + .../java/org/apache/xpath/objects/XRTreeFrag.java | 301 ++ .../xpath/objects/XRTreeFragSelectWrapper.java | 154 + .../java/org/apache/xpath/objects/XString.java | 1122 ++++++ .../org/apache/xpath/objects/XStringForChars.java | 216 ++ .../org/apache/xpath/objects/XStringForFSB.java | 986 ++++++ .../java/org/apache/xpath/objects/package.html | 27 + .../main/java/org/apache/xpath/operations/And.java | 75 + .../java/org/apache/xpath/operations/Bool.java | 68 + .../main/java/org/apache/xpath/operations/Div.java | 67 + .../java/org/apache/xpath/operations/Equals.java | 74 + .../main/java/org/apache/xpath/operations/Gt.java | 49 + .../main/java/org/apache/xpath/operations/Gte.java | 50 + .../main/java/org/apache/xpath/operations/Lt.java | 49 + .../main/java/org/apache/xpath/operations/Lte.java | 49 + .../java/org/apache/xpath/operations/Minus.java | 68 + .../main/java/org/apache/xpath/operations/Mod.java | 67 + .../java/org/apache/xpath/operations/Mult.java | 66 + .../main/java/org/apache/xpath/operations/Neg.java | 65 + .../org/apache/xpath/operations/NotEquals.java | 49 + .../java/org/apache/xpath/operations/Number.java | 69 + .../org/apache/xpath/operations/Operation.java | 212 ++ .../main/java/org/apache/xpath/operations/Or.java | 75 + .../java/org/apache/xpath/operations/Plus.java | 67 + .../main/java/org/apache/xpath/operations/Quo.java | 52 + .../java/org/apache/xpath/operations/String.java | 47 + .../apache/xpath/operations/UnaryOperation.java | 163 + .../java/org/apache/xpath/operations/Variable.java | 387 +++ .../xpath/operations/VariableSafeAbsRef.java | 74 + .../java/org/apache/xpath/operations/package.html | 26 + luni/src/main/java/org/apache/xpath/package.html | 27 + .../xpath/patterns/ContextMatchStepPattern.java | 179 + .../org/apache/xpath/patterns/FunctionPattern.java | 248 ++ .../java/org/apache/xpath/patterns/NodeTest.java | 692 ++++ .../org/apache/xpath/patterns/NodeTestFilter.java | 39 + .../org/apache/xpath/patterns/StepPattern.java | 1053 ++++++ .../org/apache/xpath/patterns/UnionPattern.java | 218 ++ .../java/org/apache/xpath/patterns/package.html | 26 + .../org/apache/xpath/res/XPATHErrorResources.java | 999 ++++++ .../java/org/apache/xpath/res/XPATHMessages.java | 139 + .../main/java/org/apache/xpath/res/package.html | 26 + luni/src/main/java/org/w3c/dom/Attr.java | 275 ++ luni/src/main/java/org/w3c/dom/CDATASection.java | 54 + luni/src/main/java/org/w3c/dom/CharacterData.java | 153 + luni/src/main/java/org/w3c/dom/Comment.java | 30 + .../main/java/org/w3c/dom/DOMConfiguration.java | 413 +++ luni/src/main/java/org/w3c/dom/DOMError.java | 87 + .../src/main/java/org/w3c/dom/DOMErrorHandler.java | 45 + luni/src/main/java/org/w3c/dom/DOMException.java | 131 + .../main/java/org/w3c/dom/DOMImplementation.java | 136 + .../java/org/w3c/dom/DOMImplementationList.java | 43 + .../java/org/w3c/dom/DOMImplementationSource.java | 58 + luni/src/main/java/org/w3c/dom/DOMLocator.java | 58 + luni/src/main/java/org/w3c/dom/DOMStringList.java | 50 + luni/src/main/java/org/w3c/dom/Document.java | 814 +++++ .../main/java/org/w3c/dom/DocumentFragment.java | 53 + luni/src/main/java/org/w3c/dom/DocumentType.java | 83 + luni/src/main/java/org/w3c/dom/Element.java | 439 +++ luni/src/main/java/org/w3c/dom/Entity.java | 90 + .../src/main/java/org/w3c/dom/EntityReference.java | 43 + luni/src/main/java/org/w3c/dom/NameList.java | 68 + luni/src/main/java/org/w3c/dom/NamedNodeMap.java | 183 + luni/src/main/java/org/w3c/dom/Node.java | 900 +++++ luni/src/main/java/org/w3c/dom/NodeList.java | 41 + luni/src/main/java/org/w3c/dom/Notation.java | 40 + .../java/org/w3c/dom/ProcessingInstruction.java | 51 + luni/src/main/java/org/w3c/dom/Text.java | 126 + luni/src/main/java/org/w3c/dom/TypeInfo.java | 185 + .../src/main/java/org/w3c/dom/UserDataHandler.java | 72 + .../java/org/w3c/dom/ls/DOMImplementationLS.java | 122 + luni/src/main/java/org/w3c/dom/ls/LSException.java | 47 + luni/src/main/java/org/w3c/dom/ls/LSInput.java | 218 ++ luni/src/main/java/org/w3c/dom/ls/LSOutput.java | 106 + luni/src/main/java/org/w3c/dom/ls/LSParser.java | 466 +++ .../main/java/org/w3c/dom/ls/LSParserFilter.java | 172 + .../java/org/w3c/dom/ls/LSResourceResolver.java | 81 + .../src/main/java/org/w3c/dom/ls/LSSerializer.java | 440 +++ .../java/org/w3c/dom/ls/LSSerializerFilter.java | 65 + luni/src/main/java/org/w3c/dom/package.html | 10 + .../java/org/w3c/dom/traversal/NodeFilter.java | 146 + .../java/org/w3c/dom/traversal/NodeIterator.java | 111 + luni/src/main/java/org/xml/sax/AttributeList.java | 193 ++ luni/src/main/java/org/xml/sax/Attributes.java | 257 ++ luni/src/main/java/org/xml/sax/ContentHandler.java | 419 +++ luni/src/main/java/org/xml/sax/DTDHandler.java | 117 + .../src/main/java/org/xml/sax/DocumentHandler.java | 232 ++ luni/src/main/java/org/xml/sax/EntityResolver.java | 119 + luni/src/main/java/org/xml/sax/ErrorHandler.java | 139 + luni/src/main/java/org/xml/sax/HandlerBase.java | 369 ++ luni/src/main/java/org/xml/sax/InputSource.java | 337 ++ luni/src/main/java/org/xml/sax/Locator.java | 136 + luni/src/main/java/org/xml/sax/Parser.java | 209 ++ luni/src/main/java/org/xml/sax/SAXException.java | 153 + .../org/xml/sax/SAXNotRecognizedException.java | 53 + .../java/org/xml/sax/SAXNotSupportedException.java | 53 + .../main/java/org/xml/sax/SAXParseException.java | 269 ++ luni/src/main/java/org/xml/sax/XMLFilter.java | 65 + luni/src/main/java/org/xml/sax/XMLReader.java | 404 +++ .../src/main/java/org/xml/sax/ext/Attributes2.java | 132 + .../main/java/org/xml/sax/ext/Attributes2Impl.java | 320 ++ .../src/main/java/org/xml/sax/ext/DeclHandler.java | 146 + .../main/java/org/xml/sax/ext/DefaultHandler2.java | 185 + .../main/java/org/xml/sax/ext/EntityResolver2.java | 197 ++ .../main/java/org/xml/sax/ext/LexicalHandler.java | 212 ++ luni/src/main/java/org/xml/sax/ext/Locator2.java | 75 + .../main/java/org/xml/sax/ext/Locator2Impl.java | 105 + luni/src/main/java/org/xml/sax/ext/package.html | 46 + .../org/xml/sax/helpers/AttributeListImpl.java | 314 ++ .../java/org/xml/sax/helpers/AttributesImpl.java | 618 ++++ .../java/org/xml/sax/helpers/DefaultHandler.java | 467 +++ .../main/java/org/xml/sax/helpers/LocatorImpl.java | 214 ++ .../java/org/xml/sax/helpers/NamespaceSupport.java | 840 +++++ .../main/java/org/xml/sax/helpers/NewInstance.java | 79 + .../java/org/xml/sax/helpers/ParserAdapter.java | 1046 ++++++ .../java/org/xml/sax/helpers/ParserFactory.java | 133 + .../java/org/xml/sax/helpers/XMLFilterImpl.java | 715 ++++ .../java/org/xml/sax/helpers/XMLReaderAdapter.java | 538 +++ .../java/org/xml/sax/helpers/XMLReaderFactory.java | 203 ++ .../src/main/java/org/xml/sax/helpers/package.html | 11 + luni/src/main/java/org/xml/sax/package.html | 297 ++ luni/src/main/native/BidiWrapper.cpp | 180 + luni/src/main/native/ErrorCode.cpp | 39 + luni/src/main/native/ErrorCode.h | 35 + luni/src/main/native/ICU.cpp | 710 ++++ luni/src/main/native/NativeBreakIterator.cpp | 143 + luni/src/main/native/NativeCollation.cpp | 199 ++ luni/src/main/native/NativeConverter.cpp | 1019 ++++++ luni/src/main/native/NativeDecimalFormat.cpp | 608 ++++ luni/src/main/native/NativeIDN.cpp | 66 + luni/src/main/native/NativeNormalizer.cpp | 50 + luni/src/main/native/NativeRegEx.cpp | 356 ++ luni/src/main/native/Register.cpp | 107 + luni/src/main/native/ScopedJavaUnicodeString.h | 57 + luni/src/main/native/UCharacter.cpp | 203 ++ luni/src/main/native/java_lang_ProcessManager.cpp | 419 +++ luni/src/main/native/java_lang_System.cpp | 93 + .../native/org_apache_harmony_xml_ExpatParser.cpp | 1538 +++++++++ ...che_harmony_xnet_provider_jsse_NativeCrypto.cpp | 2655 +++++++++++++++ luni/src/main/native/sub.mk | 29 +- .../provider/jsse/ClientSessionContextTest.java | 86 + .../harmony/xnet/provider/jsse/FakeSession.java | 114 + .../provider/jsse/FileClientSessionCacheTest.java | 57 + luni/src/test/java/java/lang/reflect/AllTests.java | 29 + .../java/java/lang/reflect/ConstructorTest.java | 49 + .../test/java/java/lang/reflect/MethodTest.java | 49 + .../java/util/prefs/AbstractPreferencesTest.java | 1486 ++++++++ .../prefs/tests/java/util/prefs/AllTests.java | 43 + .../java/util/prefs/BackingStoreExceptionTest.java | 96 + .../java/util/prefs/FilePreferencesImplTest.java | 326 ++ .../InvalidPreferencesFormatExceptionTest.java | 119 + .../java/util/prefs/MockAbstractPreferences.java | 254 ++ .../java/util/prefs/MockNodeChangeListener.java | 132 + .../util/prefs/MockPreferenceChangeListener.java | 118 + .../tests/java/util/prefs/MockSecurityManager.java | 62 + .../tests/java/util/prefs/NodeChangeEventTest.java | 162 + .../java/util/prefs/NodeChangeListenerTest.java | 87 + .../java/util/prefs/PreferenceChangeEventTest.java | 206 ++ .../util/prefs/PreferenceChangeListenerTest.java | 65 + .../java/util/prefs/PreferencesFactoryTest.java | 78 + .../tests/java/util/prefs/PreferencesTest.java | 1992 +++++++++++ .../test/java/org/apache/harmony/xml/AllTests.java | 29 + .../org/apache/harmony/xml/ExpatParserTest.java | 892 +++++ .../apache/harmony/xml/JaxenXPathTestSuite.java | 306 ++ .../xml/NamespacedAttributesLookupTest.java | 139 + .../harmony/xml/XsltXPathConformanceTestSuite.java | 635 ++++ .../test/java/tests/api/javax/net/AllTests.java | 37 + .../api/javax/net/ServerSocketFactoryTest.java | 251 ++ .../tests/api/javax/net/SocketFactoryTest.java | 408 +++ .../java/tests/api/javax/net/ssl/AllTests.java | 71 + .../ssl/CertPathTrustManagerParametersTest.java | 96 + .../api/javax/net/ssl/CertificatesToPlayWith.java | 478 +++ .../javax/net/ssl/HandshakeCompletedEventTest.java | 743 ++++ .../api/javax/net/ssl/HostnameVerifierTest.java | 213 ++ .../api/javax/net/ssl/HttpsURLConnectionTest.java | 498 +++ .../api/javax/net/ssl/KeyManagerFactory1Test.java | 634 ++++ .../api/javax/net/ssl/KeyManagerFactory2Test.java | 287 ++ .../javax/net/ssl/KeyManagerFactorySpiTest.java | 180 + .../net/ssl/KeyStoreBuilderParametersTest.java | 150 + .../tests/api/javax/net/ssl/SSLContext1Test.java | 718 ++++ .../tests/api/javax/net/ssl/SSLContext2Test.java | 323 ++ .../tests/api/javax/net/ssl/SSLContextSpiTest.java | 323 ++ .../ssl/SSLEngineResultHandshakeStatusTest.java | 100 + .../javax/net/ssl/SSLEngineResultStatusTest.java | 107 + .../api/javax/net/ssl/SSLEngineResultTest.java | 259 ++ .../tests/api/javax/net/ssl/SSLEngineTest.java | 1929 +++++++++++ .../tests/api/javax/net/ssl/SSLExceptionTest.java | 211 ++ .../javax/net/ssl/SSLHandshakeExceptionTest.java | 73 + .../api/javax/net/ssl/SSLKeyExceptionTest.java | 73 + .../net/ssl/SSLPeerUnverifiedExceptionTest.java | 73 + .../tests/api/javax/net/ssl/SSLPermissionTest.java | 92 + .../javax/net/ssl/SSLProtocolExceptionTest.java | 73 + .../javax/net/ssl/SSLServerSocketFactoryTest.java | 135 + .../api/javax/net/ssl/SSLServerSocketTest.java | 614 ++++ .../javax/net/ssl/SSLSessionBindingEventTest.java | 260 ++ .../net/ssl/SSLSessionBindingListenerTest.java | 103 + .../api/javax/net/ssl/SSLSessionContextTest.java | 141 + .../tests/api/javax/net/ssl/SSLSessionTest.java | 895 +++++ .../api/javax/net/ssl/SSLSocketFactoryTest.java | 178 + .../tests/api/javax/net/ssl/SSLSocketTest.java | 916 +++++ .../javax/net/ssl/TrustManagerFactory1Test.java | 712 ++++ .../javax/net/ssl/TrustManagerFactory2Test.java | 279 ++ .../javax/net/ssl/TrustManagerFactorySpiTest.java | 168 + .../javax/net/ssl/X509ExtendedKeyManagerTest.java | 200 ++ .../api/javax/net/ssl/X509KeyManagerTest.java | 794 +++++ .../api/javax/net/ssl/X509TrustManagerTest.java | 258 ++ .../java/tests/api/javax/xml/parsers/AllTests.java | 44 + .../xml/parsers/DocumentBuilderFactoryTest.java | 1121 ++++++ .../api/javax/xml/parsers/DocumentBuilderTest.java | 731 ++++ .../xml/parsers/FactoryConfigurationErrorTest.java | 139 + .../parsers/ParserConfigurationExceptionTest.java | 55 + .../javax/xml/parsers/SAXParserFactoryTest.java | 501 +++ .../tests/api/javax/xml/parsers/SAXParserTest.java | 1163 +++++++ .../javax/xml/parsers/SAXParserTestSupport.java | 492 +++ .../org/apache/harmony/kernel/dalvik/AllTests.java | 28 + .../apache/harmony/kernel/dalvik/ThreadsTest.java | 259 ++ .../test/java/tests/api/org/xml/sax/AllTests.java | 40 + .../tests/api/org/xml/sax/HandlerBaseTest.java | 226 ++ .../tests/api/org/xml/sax/InputSourceTest.java | 254 ++ .../tests/api/org/xml/sax/SAXExceptionTest.java | 131 + .../org/xml/sax/SAXNotRecognizedExceptionTest.java | 55 + .../org/xml/sax/SAXNotSupportedExceptionTest.java | 55 + .../api/org/xml/sax/SAXParseExceptionTest.java | 276 ++ .../java/tests/api/org/xml/sax/ext/AllTests.java | 34 + .../api/org/xml/sax/ext/Attributes2ImplTest.java | 464 +++ .../api/org/xml/sax/ext/DefaultHandler2Test.java | 234 ++ .../api/org/xml/sax/ext/Locator2ImplTest.java | 153 + .../tests/api/org/xml/sax/helpers/AllTests.java | 40 + .../org/xml/sax/helpers/AttributeListImplTest.java | 270 ++ .../org/xml/sax/helpers/AttributesImplTest.java | 608 ++++ .../org/xml/sax/helpers/DefaultHandlerTest.java | 278 ++ .../api/org/xml/sax/helpers/LocatorImplTest.java | 172 + .../org/xml/sax/helpers/NamespaceSupportTest.java | 434 +++ .../api/org/xml/sax/helpers/ParserAdapterTest.java | 475 +++ .../api/org/xml/sax/helpers/ParserFactoryTest.java | 167 + .../api/org/xml/sax/helpers/XMLFilterImplTest.java | 678 ++++ .../org/xml/sax/helpers/XMLReaderAdapterTest.java | 421 +++ .../org/xml/sax/helpers/XMLReaderFactoryTest.java | 165 + .../api/org/xml/sax/support/BrokenInputStream.java | 50 + .../api/org/xml/sax/support/DoNothingParser.java | 55 + .../org/xml/sax/support/DoNothingXMLReader.java | 79 + .../api/org/xml/sax/support/MethodLogger.java | 95 + .../tests/api/org/xml/sax/support/MockFilter.java | 89 + .../tests/api/org/xml/sax/support/MockHandler.java | 147 + .../tests/api/org/xml/sax/support/MockParser.java | 68 + .../tests/api/org/xml/sax/support/MockReader.java | 128 + .../api/org/xml/sax/support/MockResolver.java | 47 + .../api/org/xml/sax/support/NoAccessParser.java | 55 + .../api/org/xml/sax/support/NoAccessXMLReader.java | 79 + .../api/org/xml/sax/support/NoInstanceParser.java | 58 + .../org/xml/sax/support/NoInstanceXMLReader.java | 82 + .../api/org/xml/sax/support/NoSubclassParser.java | 54 + .../org/xml/sax/support/NoSubclassXMLReader.java | 79 + luni/src/test/java/tests/org/w3c/dom/AllTests.java | 105 + .../tests/org/w3c/dom/AttrGetOwnerElement.java | 156 + .../java/tests/org/w3c/dom/CreateAttributeNS.java | 230 ++ .../java/tests/org/w3c/dom/CreateDocument.java | 317 ++ .../java/tests/org/w3c/dom/CreateDocumentType.java | 222 ++ .../java/tests/org/w3c/dom/CreateElementNS.java | 252 ++ .../org/w3c/dom/DOMDocumentBuilderFactory.java | 94 + .../w3c/dom/DOMImplementationCreateDocument.java | 177 + .../dom/DOMImplementationCreateDocumentType.java | 208 ++ .../org/w3c/dom/DOMImplementationHasFeature.java | 147 + .../test/java/tests/org/w3c/dom/DOMTestCase.java | 230 ++ .../tests/org/w3c/dom/DocumentBuilderSetting.java | 281 ++ .../w3c/dom/DocumentBuilderSettingStrategy.java | 158 + .../org/w3c/dom/DocumentCreateAttributeNS.java | 315 ++ .../tests/org/w3c/dom/DocumentCreateElementNS.java | 169 + .../w3c/dom/DocumentGetElementsByTagnameNS.java | 150 + .../tests/org/w3c/dom/DocumentGeteEementById.java | 72 + .../java/tests/org/w3c/dom/DocumentImportNode.java | 699 ++++ .../org/w3c/dom/DocumentTypeInternalSubset.java | 76 + .../tests/org/w3c/dom/DocumentTypePublicId.java | 97 + .../tests/org/w3c/dom/DocumentTypeSystemId.java | 95 + .../tests/org/w3c/dom/ElementGetAttributeNS.java | 89 + .../org/w3c/dom/ElementGetAttributeNodeNS.java | 139 + .../org/w3c/dom/ElementGetElementsByTagNameNS.java | 122 + .../tests/org/w3c/dom/ElementHasAttribute.java | 123 + .../tests/org/w3c/dom/ElementHasAttributeNS.java | 139 + .../org/w3c/dom/ElementRemoveAttributeNS.java | 80 + .../tests/org/w3c/dom/ElementSetAttributeNS.java | 266 ++ .../org/w3c/dom/ElementSetAttributeNodeNS.java | 276 ++ .../java/tests/org/w3c/dom/GetAttributeNS.java | 187 + .../java/tests/org/w3c/dom/GetAttributeNodeNS.java | 121 + .../java/tests/org/w3c/dom/GetElementById.java | 102 + .../tests/org/w3c/dom/GetElementsByTagNameNS.java | 381 +++ .../java/tests/org/w3c/dom/GetNamedItemNS.java | 135 + .../org/w3c/dom/HCEntitiesRemoveNamedItemNS.java | 102 + .../org/w3c/dom/HCEntitiesSetNamedItemNS.java | 86 + .../org/w3c/dom/HCNamedNodeMapInvalidType.java | 103 + .../w3c/dom/HCNodeDocumentFragmentNormalize.java | 108 + .../org/w3c/dom/HCNotationsRemoveNamedItemNS.java | 110 + .../org/w3c/dom/HCNotationsSetNamedItemNS.java | 112 + .../test/java/tests/org/w3c/dom/HasAttribute.java | 119 + .../java/tests/org/w3c/dom/HasAttributeNS.java | 172 + .../test/java/tests/org/w3c/dom/HasAttributes.java | 111 + .../test/java/tests/org/w3c/dom/ImportNode.java | 604 ++++ .../java/tests/org/w3c/dom/InternalSubset.java | 92 + .../test/java/tests/org/w3c/dom/IsSupported.java | 272 ++ .../src/test/java/tests/org/w3c/dom/LocalName.java | 132 + .../org/w3c/dom/NamedNodeMapGetNamedItemNS.java | 229 ++ .../org/w3c/dom/NamedNodeMapRemoveNamedItemNS.java | 342 ++ .../org/w3c/dom/NamedNodeMapSetNamedItemNS.java | 451 +++ .../test/java/tests/org/w3c/dom/NamespaceURI.java | 153 + .../java/tests/org/w3c/dom/NodeGetLocalName.java | 107 + .../tests/org/w3c/dom/NodeGetNamespaceURI.java | 111 + .../tests/org/w3c/dom/NodeGetOwnerDocument.java | 128 + .../test/java/tests/org/w3c/dom/NodeGetPrefix.java | 108 + .../java/tests/org/w3c/dom/NodeHasAttributes.java | 171 + .../java/tests/org/w3c/dom/NodeIsSupported.java | 216 ++ .../test/java/tests/org/w3c/dom/NodeNormalize.java | 209 ++ .../test/java/tests/org/w3c/dom/NodeSetPrefix.java | 314 ++ .../src/test/java/tests/org/w3c/dom/Normalize.java | 106 + .../test/java/tests/org/w3c/dom/OwnerDocument.java | 88 + .../test/java/tests/org/w3c/dom/OwnerElement.java | 118 + luni/src/test/java/tests/org/w3c/dom/Prefix.java | 337 ++ luni/src/test/java/tests/org/w3c/dom/PublicId.java | 91 + .../java/tests/org/w3c/dom/RemoveAttributeNS.java | 147 + .../java/tests/org/w3c/dom/RemoveNamedItemNS.java | 178 + .../java/tests/org/w3c/dom/SetAttributeNS.java | 355 ++ .../java/tests/org/w3c/dom/SetAttributeNodeNS.java | 237 ++ .../java/tests/org/w3c/dom/SetNamedItemNS.java | 248 ++ luni/src/test/java/tests/org/w3c/dom/SystemId.java | 94 + luni/src/test/java/tests/prefs/AllTests.java | 34 + luni/src/test/java/tests/xml/AllTests.java | 49 + luni/src/test/java/tests/xml/DeclarationTest.java | 107 + luni/src/test/java/tests/xml/DomTest.java | 1383 ++++++++ luni/src/test/java/tests/xml/NodeTest.java | 91 + luni/src/test/java/tests/xml/NormalizeTest.java | 622 ++++ luni/src/test/java/tests/xml/SaxTest.java | 177 + .../src/test/java/tests/xml/SimpleBuilderTest.java | 162 + luni/src/test/java/tests/xml/SimpleParserTest.java | 289 ++ luni/src/test/java/tests/xnet/AllTests.java | 34 + luni/src/test/resources/SimpleBuilderTest.xml | 21 + luni/src/test/resources/SimpleParserTest.xml | 19 + luni/src/test/resources/hc_staff.xml | 60 + luni/src/test/resources/nwf/staff.dtd | 17 + luni/src/test/resources/nwf/staff.xml | 57 + luni/src/test/resources/out_dh/staff.out | 45 + luni/src/test/resources/out_hb/staff.out | 45 + .../prefs/java/util/prefs/userprefs-ascii.xml | 63 + .../java/util/prefs/userprefs-badencoding.xml | 64 + .../prefs/java/util/prefs/userprefs-badform.xml | 54 + .../prefs/java/util/prefs/userprefs-badtype.xml | 64 + .../java/util/prefs/userprefs-higherversion.xml | 64 + .../resources/prefs/java/util/prefs/userprefs.xml | 76 + luni/src/test/resources/recipe.xml | 24 + luni/src/test/resources/recipe1.xml | 24 + luni/src/test/resources/recipt.dtd | 17 + luni/src/test/resources/recipt.xml | 24 + luni/src/test/resources/reciptWrong.xml | 21 + .../prefs/BackingStoreExceptionTest.golden.ser | Bin 0 -> 1547 bytes ...nvalidPreferencesFormatExceptionTest.golden.ser | Bin 0 -> 1583 bytes luni/src/test/resources/simple.xml | 34 + luni/src/test/resources/simple_ns.dtd | 45 + luni/src/test/resources/simple_ns.xml | 59 + luni/src/test/resources/staff.dtd | 17 + luni/src/test/resources/staff.xml | 57 + luni/src/test/resources/staff2.dtd | 24 + luni/src/test/resources/staff2.xml | 13 + luni/src/test/resources/staffEntRes.xml | 60 + luni/src/test/resources/staffNS.dtd | 45 + luni/src/test/resources/staffNS.xml | 59 + luni/src/test/resources/systemid.xml | 24 + luni/src/test/resources/systemid/recipt.dtd | 17 + luni/src/test/resources/systemid/staff.dtd | 17 + luni/src/test/resources/wf/staff.dtd | 17 + luni/src/test/resources/wf/staff.xml | 57 + luni/src/test/resources/wrong.xml | 1 + luni/src/test/resources/xhtml1-strict.dtd | 65 + luni/unicode-license.txt | 48 + prefs/MODULE_LICENSE_APACHE2 | 0 .../java/java/util/prefs/AbstractPreferences.java | 930 ----- .../java/util/prefs/BackingStoreException.java | 51 - .../util/prefs/FilePreferencesFactoryImpl.java | 44 - .../java/java/util/prefs/FilePreferencesImpl.java | 232 -- .../prefs/InvalidPreferencesFormatException.java | 63 - .../main/java/java/util/prefs/NodeChangeEvent.java | 94 - .../java/java/util/prefs/NodeChangeListener.java | 49 - prefs/src/main/java/java/util/prefs/NodeSet.java | 34 - .../java/util/prefs/PreferenceChangeEvent.java | 112 - .../java/util/prefs/PreferenceChangeListener.java | 43 - .../src/main/java/java/util/prefs/Preferences.java | 895 ----- .../java/java/util/prefs/PreferencesFactory.java | 43 - prefs/src/main/java/java/util/prefs/XMLParser.java | 593 ---- prefs/src/main/java/java/util/prefs/package.html | 13 - .../java/util/prefs/AbstractPreferencesTest.java | 1486 -------- .../prefs/tests/java/util/prefs/AllTests.java | 43 - .../java/util/prefs/BackingStoreExceptionTest.java | 96 - .../java/util/prefs/FilePreferencesImplTest.java | 326 -- .../InvalidPreferencesFormatExceptionTest.java | 119 - .../java/util/prefs/MockAbstractPreferences.java | 254 -- .../java/util/prefs/MockNodeChangeListener.java | 132 - .../util/prefs/MockPreferenceChangeListener.java | 118 - .../tests/java/util/prefs/MockSecurityManager.java | 62 - .../tests/java/util/prefs/NodeChangeEventTest.java | 162 - .../java/util/prefs/NodeChangeListenerTest.java | 87 - .../java/util/prefs/PreferenceChangeEventTest.java | 206 -- .../util/prefs/PreferenceChangeListenerTest.java | 65 - .../java/util/prefs/PreferencesFactoryTest.java | 78 - .../tests/java/util/prefs/PreferencesTest.java | 1992 ----------- prefs/src/test/java/tests/prefs/AllTests.java | 34 - .../prefs/java/util/prefs/userprefs-ascii.xml | 63 - .../java/util/prefs/userprefs-badencoding.xml | 64 - .../prefs/java/util/prefs/userprefs-badform.xml | 54 - .../prefs/java/util/prefs/userprefs-badtype.xml | 64 - .../java/util/prefs/userprefs-higherversion.xml | 64 - .../resources/prefs/java/util/prefs/userprefs.xml | 76 - .../prefs/BackingStoreExceptionTest.golden.ser | Bin 1547 -> 0 bytes ...nvalidPreferencesFormatExceptionTest.golden.ser | Bin 1583 -> 0 bytes security-kernel/MODULE_LICENSE_APACHE2 | 0 .../java/java/security/AccessControlContext.java | 278 -- .../main/java/java/security/AccessController.java | 368 -- x-net/MODULE_LICENSE_APACHE2 | 0 .../java/javax/net/DefaultServerSocketFactory.java | 49 - .../main/java/javax/net/DefaultSocketFactory.java | 60 - .../main/java/javax/net/ServerSocketFactory.java | 109 - x-net/src/main/java/javax/net/SocketFactory.java | 153 - x-net/src/main/java/javax/net/package.html | 7 - .../net/ssl/CertPathTrustManagerParameters.java | 52 - .../javax/net/ssl/DefaultHostnameVerifier.java | 329 -- .../main/java/javax/net/ssl/DefaultSSLContext.java | 124 - .../net/ssl/DefaultSSLServerSocketFactory.java | 62 - .../javax/net/ssl/DefaultSSLSocketFactory.java | 76 - .../javax/net/ssl/HandshakeCompletedEvent.java | 141 - .../javax/net/ssl/HandshakeCompletedListener.java | 34 - .../main/java/javax/net/ssl/HostnameVerifier.java | 40 - .../java/javax/net/ssl/HttpsURLConnection.java | 222 -- x-net/src/main/java/javax/net/ssl/KeyManager.java | 27 - .../main/java/javax/net/ssl/KeyManagerFactory.java | 233 -- .../java/javax/net/ssl/KeyManagerFactorySpi.java | 74 - .../javax/net/ssl/KeyStoreBuilderParameters.java | 79 - .../javax/net/ssl/ManagerFactoryParameters.java | 27 - x-net/src/main/java/javax/net/ssl/SSLContext.java | 253 -- .../src/main/java/javax/net/ssl/SSLContextSpi.java | 109 - x-net/src/main/java/javax/net/ssl/SSLEngine.java | 464 --- .../main/java/javax/net/ssl/SSLEngineResult.java | 172 - .../src/main/java/javax/net/ssl/SSLException.java | 61 - .../java/javax/net/ssl/SSLHandshakeException.java | 37 - .../main/java/javax/net/ssl/SSLKeyException.java | 36 - .../javax/net/ssl/SSLPeerUnverifiedException.java | 38 - .../src/main/java/javax/net/ssl/SSLPermission.java | 58 - .../java/javax/net/ssl/SSLProtocolException.java | 37 - .../main/java/javax/net/ssl/SSLServerSocket.java | 232 -- .../java/javax/net/ssl/SSLServerSocketFactory.java | 103 - x-net/src/main/java/javax/net/ssl/SSLSession.java | 231 -- .../java/javax/net/ssl/SSLSessionBindingEvent.java | 75 - .../javax/net/ssl/SSLSessionBindingListener.java | 44 - .../main/java/javax/net/ssl/SSLSessionContext.java | 82 - x-net/src/main/java/javax/net/ssl/SSLSocket.java | 299 -- .../main/java/javax/net/ssl/SSLSocketFactory.java | 147 - .../src/main/java/javax/net/ssl/TrustManager.java | 28 - .../java/javax/net/ssl/TrustManagerFactory.java | 229 -- .../java/javax/net/ssl/TrustManagerFactorySpi.java | 67 - .../java/javax/net/ssl/X509ExtendedKeyManager.java | 76 - .../main/java/javax/net/ssl/X509KeyManager.java | 113 - .../main/java/javax/net/ssl/X509TrustManager.java | 76 - x-net/src/main/java/javax/net/ssl/package.html | 20 - .../xnet/provider/jsse/AbstractSessionContext.java | 221 -- .../harmony/xnet/provider/jsse/AlertException.java | 66 - .../harmony/xnet/provider/jsse/AlertProtocol.java | 286 -- .../harmony/xnet/provider/jsse/Appendable.java | 33 - .../xnet/provider/jsse/CertificateMessage.java | 176 - .../xnet/provider/jsse/CertificateRequest.java | 189 - .../xnet/provider/jsse/CertificateVerify.java | 97 - .../harmony/xnet/provider/jsse/CipherSuite.java | 610 ---- .../xnet/provider/jsse/ClientHandshakeImpl.java | 629 ---- .../harmony/xnet/provider/jsse/ClientHello.java | 206 -- .../xnet/provider/jsse/ClientKeyExchange.java | 152 - .../xnet/provider/jsse/ClientSessionContext.java | 229 -- .../xnet/provider/jsse/ConnectionState.java | 169 - .../xnet/provider/jsse/ConnectionStateSSLv3.java | 354 -- .../xnet/provider/jsse/ConnectionStateTLS.java | 352 -- .../harmony/xnet/provider/jsse/ContentType.java | 49 - .../harmony/xnet/provider/jsse/DHParameters.java | 108 - .../harmony/xnet/provider/jsse/DataStream.java | 42 - .../harmony/xnet/provider/jsse/DelegatedTask.java | 65 - .../xnet/provider/jsse/DigitalSignature.java | 254 -- .../xnet/provider/jsse/EndOfBufferException.java | 35 - .../xnet/provider/jsse/EndOfSourceException.java | 34 - .../xnet/provider/jsse/FileClientSessionCache.java | 374 -- .../harmony/xnet/provider/jsse/Finished.java | 82 - .../harmony/xnet/provider/jsse/Handshake.java | 89 - .../xnet/provider/jsse/HandshakeIODataStream.java | 464 --- .../xnet/provider/jsse/HandshakeProtocol.java | 534 --- .../harmony/xnet/provider/jsse/HelloRequest.java | 77 - .../harmony/xnet/provider/jsse/JSSEProvider.java | 137 - .../xnet/provider/jsse/KeyManagerFactoryImpl.java | 133 - .../harmony/xnet/provider/jsse/KeyManagerImpl.java | 186 - .../apache/harmony/xnet/provider/jsse/Logger.java | 122 - .../apache/harmony/xnet/provider/jsse/Message.java | 74 - .../harmony/xnet/provider/jsse/NativeCrypto.java | 330 -- .../xnet/provider/jsse/OpenSSLMessageDigest.java | 118 - .../provider/jsse/OpenSSLMessageDigestJDK.java | 117 - .../jsse/OpenSSLServerSocketFactoryImpl.java | 71 - .../provider/jsse/OpenSSLServerSocketImpl.java | 163 - .../xnet/provider/jsse/OpenSSLSessionImpl.java | 483 --- .../xnet/provider/jsse/OpenSSLSignature.java | 215 -- .../provider/jsse/OpenSSLSocketFactoryImpl.java | 84 - .../xnet/provider/jsse/OpenSSLSocketImpl.java | 995 ------ .../provider/jsse/OpenSSLSocketImplWrapper.java | 203 -- .../org/apache/harmony/xnet/provider/jsse/PRF.java | 201 -- .../xnet/provider/jsse/ProtocolVersion.java | 158 - .../xnet/provider/jsse/SSLBufferedInput.java | 77 - .../xnet/provider/jsse/SSLClientSessionCache.java | 53 - .../harmony/xnet/provider/jsse/SSLContextImpl.java | 127 - .../xnet/provider/jsse/SSLEngineAppData.java | 95 - .../xnet/provider/jsse/SSLEngineDataStream.java | 91 - .../harmony/xnet/provider/jsse/SSLEngineImpl.java | 769 ----- .../harmony/xnet/provider/jsse/SSLInputStream.java | 125 - .../harmony/xnet/provider/jsse/SSLParameters.java | 440 --- .../xnet/provider/jsse/SSLRecordProtocol.java | 482 --- .../xnet/provider/jsse/SSLServerSessionCache.java | 52 - .../harmony/xnet/provider/jsse/SSLSessionImpl.java | 366 -- .../xnet/provider/jsse/SSLStreamedInput.java | 57 - .../harmony/xnet/provider/jsse/SSLv3Constants.java | 84 - .../xnet/provider/jsse/ServerHandshakeImpl.java | 724 ---- .../harmony/xnet/provider/jsse/ServerHello.java | 137 - .../xnet/provider/jsse/ServerHelloDone.java | 78 - .../xnet/provider/jsse/ServerKeyExchange.java | 193 -- .../xnet/provider/jsse/ServerSessionContext.java | 137 - .../provider/jsse/TrustManagerFactoryImpl.java | 134 - .../xnet/provider/jsse/TrustManagerImpl.java | 234 -- ...che_harmony_xnet_provider_jsse_NativeCrypto.cpp | 2655 --------------- x-net/src/main/native/sub.mk | 21 - .../provider/jsse/ClientSessionContextTest.java | 86 - .../harmony/xnet/provider/jsse/FakeSession.java | 114 - .../provider/jsse/FileClientSessionCacheTest.java | 57 - .../test/java/tests/api/javax/net/AllTests.java | 37 - .../api/javax/net/ServerSocketFactoryTest.java | 251 -- .../tests/api/javax/net/SocketFactoryTest.java | 408 --- .../java/tests/api/javax/net/ssl/AllTests.java | 71 - .../ssl/CertPathTrustManagerParametersTest.java | 96 - .../api/javax/net/ssl/CertificatesToPlayWith.java | 478 --- .../javax/net/ssl/HandshakeCompletedEventTest.java | 743 ---- .../api/javax/net/ssl/HostnameVerifierTest.java | 213 -- .../api/javax/net/ssl/HttpsURLConnectionTest.java | 498 --- .../api/javax/net/ssl/KeyManagerFactory1Test.java | 634 ---- .../api/javax/net/ssl/KeyManagerFactory2Test.java | 287 -- .../javax/net/ssl/KeyManagerFactorySpiTest.java | 180 - .../net/ssl/KeyStoreBuilderParametersTest.java | 150 - .../tests/api/javax/net/ssl/SSLContext1Test.java | 718 ---- .../tests/api/javax/net/ssl/SSLContext2Test.java | 323 -- .../tests/api/javax/net/ssl/SSLContextSpiTest.java | 323 -- .../ssl/SSLEngineResultHandshakeStatusTest.java | 100 - .../javax/net/ssl/SSLEngineResultStatusTest.java | 107 - .../api/javax/net/ssl/SSLEngineResultTest.java | 259 -- .../tests/api/javax/net/ssl/SSLEngineTest.java | 1929 ----------- .../tests/api/javax/net/ssl/SSLExceptionTest.java | 211 -- .../javax/net/ssl/SSLHandshakeExceptionTest.java | 73 - .../api/javax/net/ssl/SSLKeyExceptionTest.java | 73 - .../net/ssl/SSLPeerUnverifiedExceptionTest.java | 73 - .../tests/api/javax/net/ssl/SSLPermissionTest.java | 92 - .../javax/net/ssl/SSLProtocolExceptionTest.java | 73 - .../javax/net/ssl/SSLServerSocketFactoryTest.java | 135 - .../api/javax/net/ssl/SSLServerSocketTest.java | 614 ---- .../javax/net/ssl/SSLSessionBindingEventTest.java | 260 -- .../net/ssl/SSLSessionBindingListenerTest.java | 103 - .../api/javax/net/ssl/SSLSessionContextTest.java | 141 - .../tests/api/javax/net/ssl/SSLSessionTest.java | 895 ----- .../api/javax/net/ssl/SSLSocketFactoryTest.java | 178 - .../tests/api/javax/net/ssl/SSLSocketTest.java | 916 ----- .../javax/net/ssl/TrustManagerFactory1Test.java | 712 ---- .../javax/net/ssl/TrustManagerFactory2Test.java | 279 -- .../javax/net/ssl/TrustManagerFactorySpiTest.java | 168 - .../javax/net/ssl/X509ExtendedKeyManagerTest.java | 200 -- .../api/javax/net/ssl/X509KeyManagerTest.java | 794 ----- .../api/javax/net/ssl/X509TrustManagerTest.java | 258 -- x-net/src/test/java/tests/xnet/AllTests.java | 34 - xml/MODULE_LICENSE_APACHE2 | 0 xml/MODULE_LICENSE_BSD_LIKE | 1 - xml/MODULE_LICENSE_W3C | 3 - xml/src/main/java/javax/xml/XMLConstants.java | 179 - .../datatype/DatatypeConfigurationException.java | 171 - .../java/javax/xml/datatype/DatatypeConstants.java | 268 -- .../java/javax/xml/datatype/DatatypeFactory.java | 1020 ------ xml/src/main/java/javax/xml/datatype/Duration.java | 987 ------ .../java/javax/xml/datatype/FactoryFinder.java | 396 --- .../java/javax/xml/datatype/SecuritySupport.java | 105 - .../javax/xml/datatype/XMLGregorianCalendar.java | 1037 ------ xml/src/main/java/javax/xml/datatype/package.html | 147 - .../java/javax/xml/namespace/NamespaceContext.java | 256 -- xml/src/main/java/javax/xml/namespace/QName.java | 496 --- xml/src/main/java/javax/xml/namespace/package.html | 33 - xml/src/main/java/javax/xml/package.html | 7 - .../java/javax/xml/parsers/DocumentBuilder.java | 319 -- .../javax/xml/parsers/DocumentBuilderFactory.java | 501 --- .../xml/parsers/FactoryConfigurationError.java | 120 - .../main/java/javax/xml/parsers/FilePathToURI.java | 129 - .../xml/parsers/ParserConfigurationException.java | 53 - xml/src/main/java/javax/xml/parsers/SAXParser.java | 526 --- .../java/javax/xml/parsers/SAXParserFactory.java | 378 -- .../java/javax/xml/parsers/SecuritySupport.java | 105 - xml/src/main/java/javax/xml/parsers/package.html | 17 - .../java/javax/xml/transform/ErrorListener.java | 109 - .../main/java/javax/xml/transform/OutputKeys.java | 193 -- xml/src/main/java/javax/xml/transform/Result.java | 80 - .../java/javax/xml/transform/SecuritySupport.java | 105 - xml/src/main/java/javax/xml/transform/Source.java | 47 - .../java/javax/xml/transform/SourceLocator.java | 90 - .../main/java/javax/xml/transform/Templates.java | 73 - .../main/java/javax/xml/transform/Transformer.java | 321 -- .../TransformerConfigurationException.java | 96 - .../javax/xml/transform/TransformerException.java | 316 -- .../javax/xml/transform/TransformerFactory.java | 327 -- .../TransformerFactoryConfigurationError.java | 116 - .../main/java/javax/xml/transform/URIResolver.java | 44 - .../java/javax/xml/transform/dom/DOMLocator.java | 44 - .../java/javax/xml/transform/dom/DOMResult.java | 350 -- .../java/javax/xml/transform/dom/DOMSource.java | 132 - .../main/java/javax/xml/transform/dom/package.html | 36 - .../main/java/javax/xml/transform/overview.html | 257 -- xml/src/main/java/javax/xml/transform/package.html | 201 -- .../java/javax/xml/transform/sax/SAXResult.java | 138 - .../java/javax/xml/transform/sax/SAXSource.java | 205 -- .../xml/transform/sax/SAXTransformerFactory.java | 144 - .../javax/xml/transform/sax/TemplatesHandler.java | 62 - .../xml/transform/sax/TransformerHandler.java | 70 - .../main/java/javax/xml/transform/sax/package.html | 69 - .../javax/xml/transform/stream/FilePathToURI.java | 129 - .../javax/xml/transform/stream/StreamResult.java | 195 -- .../javax/xml/transform/stream/StreamSource.java | 273 -- .../java/javax/xml/transform/stream/package.html | 30 - xml/src/main/java/javax/xml/validation/Schema.java | 92 - .../java/javax/xml/validation/SchemaFactory.java | 675 ---- .../javax/xml/validation/SchemaFactoryFinder.java | 499 --- .../javax/xml/validation/SchemaFactoryLoader.java | 31 - .../java/javax/xml/validation/SecuritySupport.java | 162 - .../javax/xml/validation/TypeInfoProvider.java | 181 - .../main/java/javax/xml/validation/Validator.java | 439 --- .../javax/xml/validation/ValidatorHandler.java | 450 --- .../main/java/javax/xml/validation/package.html | 91 - .../main/java/javax/xml/xpath/SecuritySupport.java | 162 - xml/src/main/java/javax/xml/xpath/XPath.java | 299 -- .../main/java/javax/xml/xpath/XPathConstants.java | 78 - .../main/java/javax/xml/xpath/XPathException.java | 99 - .../main/java/javax/xml/xpath/XPathExpression.java | 185 - .../javax/xml/xpath/XPathExpressionException.java | 61 - .../main/java/javax/xml/xpath/XPathFactory.java | 292 -- .../xpath/XPathFactoryConfigurationException.java | 61 - .../java/javax/xml/xpath/XPathFactoryFinder.java | 455 --- .../main/java/javax/xml/xpath/XPathFunction.java | 51 - .../javax/xml/xpath/XPathFunctionException.java | 61 - .../javax/xml/xpath/XPathFunctionResolver.java | 60 - .../javax/xml/xpath/XPathVariableResolver.java | 51 - xml/src/main/java/javax/xml/xpath/package.html | 261 -- .../org/apache/harmony/xml/ExpatAttributes.java | 154 - .../org/apache/harmony/xml/ExpatException.java | 28 - .../java/org/apache/harmony/xml/ExpatParser.java | 808 ----- .../org/apache/harmony/xml/ExpatPullParser.java | 964 ------ .../java/org/apache/harmony/xml/ExpatReader.java | 326 -- .../java/org/apache/harmony/xml/dom/AttrImpl.java | 141 - .../apache/harmony/xml/dom/CDATASectionImpl.java | 87 - .../apache/harmony/xml/dom/CharacterDataImpl.java | 99 - .../org/apache/harmony/xml/dom/CommentImpl.java | 55 - .../harmony/xml/dom/DOMConfigurationImpl.java | 491 --- .../harmony/xml/dom/DOMImplementationImpl.java | 90 - .../harmony/xml/dom/DocumentFragmentImpl.java | 49 - .../org/apache/harmony/xml/dom/DocumentImpl.java | 538 --- .../apache/harmony/xml/dom/DocumentTypeImpl.java | 113 - .../org/apache/harmony/xml/dom/ElementImpl.java | 457 --- .../org/apache/harmony/xml/dom/EntityImpl.java | 81 - .../harmony/xml/dom/EntityReferenceImpl.java | 51 - .../org/apache/harmony/xml/dom/InnerNodeImpl.java | 245 -- .../org/apache/harmony/xml/dom/LeafNodeImpl.java | 69 - .../apache/harmony/xml/dom/NamedNodeMapImpl.java | 176 - .../java/org/apache/harmony/xml/dom/NodeImpl.java | 733 ---- .../org/apache/harmony/xml/dom/NodeListImpl.java | 63 - .../org/apache/harmony/xml/dom/NotationImpl.java | 63 - .../harmony/xml/dom/ProcessingInstructionImpl.java | 73 - .../java/org/apache/harmony/xml/dom/TextImpl.java | 172 - .../xml/parsers/DocumentBuilderFactoryImpl.java | 105 - .../harmony/xml/parsers/DocumentBuilderImpl.java | 481 --- .../harmony/xml/parsers/SAXParserFactoryImpl.java | 123 - .../apache/harmony/xml/parsers/SAXParserImpl.java | 112 - xml/src/main/java/org/apache/xalan/Version.java | 153 - xml/src/main/java/org/apache/xalan/Version.src | 153 - .../apache/xalan/extensions/ExpressionContext.java | 93 - .../apache/xalan/extensions/ExpressionVisitor.java | 82 - .../apache/xalan/extensions/ExtensionHandler.java | 147 - .../extensions/ExtensionNamespaceSupport.java | 106 - .../extensions/ExtensionNamespacesManager.java | 286 -- .../apache/xalan/extensions/ExtensionsTable.java | 241 -- .../org/apache/xalan/extensions/ObjectFactory.java | 154 - .../xalan/processor/ProcessorAttributeSet.java | 105 - .../xalan/processor/ProcessorCharacters.java | 179 - .../xalan/processor/ProcessorDecimalFormat.java | 75 - .../xalan/processor/ProcessorExsltFuncResult.java | 70 - .../xalan/processor/ProcessorExsltFunction.java | 189 - .../xalan/processor/ProcessorGlobalParamDecl.java | 77 - .../processor/ProcessorGlobalVariableDecl.java | 77 - .../apache/xalan/processor/ProcessorImport.java | 56 - .../apache/xalan/processor/ProcessorInclude.java | 396 --- .../org/apache/xalan/processor/ProcessorKey.java | 156 - .../org/apache/xalan/processor/ProcessorLRE.java | 369 -- .../xalan/processor/ProcessorNamespaceAlias.java | 97 - .../xalan/processor/ProcessorOutputElem.java | 223 -- .../xalan/processor/ProcessorPreserveSpace.java | 78 - .../xalan/processor/ProcessorStripSpace.java | 78 - .../xalan/processor/ProcessorStylesheetDoc.java | 31 - .../processor/ProcessorStylesheetElement.java | 147 - .../apache/xalan/processor/ProcessorTemplate.java | 53 - .../xalan/processor/ProcessorTemplateElem.java | 126 - .../org/apache/xalan/processor/ProcessorText.java | 82 - .../apache/xalan/processor/ProcessorUnknown.java | 36 - .../apache/xalan/processor/StylesheetHandler.java | 1727 ---------- .../xalan/processor/TransformerFactoryImpl.java | 1043 ------ .../xalan/processor/WhitespaceInfoPaths.java | 82 - .../apache/xalan/processor/XSLProcessorVersion.src | 116 - .../apache/xalan/processor/XSLTAttributeDef.java | 1665 --------- .../org/apache/xalan/processor/XSLTElementDef.java | 833 ----- .../xalan/processor/XSLTElementProcessor.java | 383 --- .../org/apache/xalan/processor/XSLTSchema.java | 922 ----- .../java/org/apache/xalan/processor/package.html | 41 - .../java/org/apache/xalan/res/XSLMessages.java | 73 - .../org/apache/xalan/res/XSLTErrorResources.java | 1511 -------- .../java/org/apache/xalan/res/XSLTInfo.properties | 30 - .../main/java/org/apache/xalan/res/package.html | 26 - .../apache/xalan/serialize/SerializerUtils.java | 273 -- .../main/java/org/apache/xalan/templates/AVT.java | 614 ---- .../java/org/apache/xalan/templates/AVTPart.java | 94 - .../org/apache/xalan/templates/AVTPartSimple.java | 100 - .../org/apache/xalan/templates/AVTPartXPath.java | 150 - .../org/apache/xalan/templates/AbsPathChecker.java | 81 - .../java/org/apache/xalan/templates/Constants.java | 399 --- .../xalan/templates/DecimalFormatProperties.java | 404 --- .../apache/xalan/templates/ElemApplyImport.java | 112 - .../apache/xalan/templates/ElemApplyTemplates.java | 421 --- .../org/apache/xalan/templates/ElemAttribute.java | 276 -- .../apache/xalan/templates/ElemAttributeSet.java | 174 - .../apache/xalan/templates/ElemCallTemplate.java | 364 -- .../org/apache/xalan/templates/ElemChoose.java | 166 - .../org/apache/xalan/templates/ElemComment.java | 143 - .../java/org/apache/xalan/templates/ElemCopy.java | 136 - .../org/apache/xalan/templates/ElemCopyOf.java | 239 -- .../org/apache/xalan/templates/ElemElement.java | 372 -- .../java/org/apache/xalan/templates/ElemEmpty.java | 38 - .../xalan/templates/ElemExsltFuncResult.java | 95 - .../apache/xalan/templates/ElemExsltFunction.java | 145 - .../apache/xalan/templates/ElemExtensionCall.java | 315 -- .../apache/xalan/templates/ElemExtensionDecl.java | 369 -- .../xalan/templates/ElemExtensionScript.java | 103 - .../org/apache/xalan/templates/ElemFallback.java | 110 - .../org/apache/xalan/templates/ElemForEach.java | 494 --- .../java/org/apache/xalan/templates/ElemIf.java | 150 - .../apache/xalan/templates/ElemLiteralResult.java | 1478 -------- .../org/apache/xalan/templates/ElemMessage.java | 124 - .../org/apache/xalan/templates/ElemNumber.java | 2157 ------------ .../org/apache/xalan/templates/ElemOtherwise.java | 57 - .../java/org/apache/xalan/templates/ElemPI.java | 224 -- .../java/org/apache/xalan/templates/ElemParam.java | 124 - .../java/org/apache/xalan/templates/ElemSort.java | 349 -- .../org/apache/xalan/templates/ElemTemplate.java | 413 --- .../xalan/templates/ElemTemplateElement.java | 1660 --------- .../java/org/apache/xalan/templates/ElemText.java | 148 - .../apache/xalan/templates/ElemTextLiteral.java | 225 -- .../org/apache/xalan/templates/ElemUnknown.java | 121 - .../java/org/apache/xalan/templates/ElemUse.java | 205 -- .../org/apache/xalan/templates/ElemValueOf.java | 289 -- .../org/apache/xalan/templates/ElemVariable.java | 528 --- .../apache/xalan/templates/ElemVariablePsuedo.java | 68 - .../java/org/apache/xalan/templates/ElemWhen.java | 126 - .../org/apache/xalan/templates/ElemWithParam.java | 261 -- .../org/apache/xalan/templates/FuncDocument.java | 463 --- .../org/apache/xalan/templates/FuncFormatNumb.java | 188 - .../java/org/apache/xalan/templates/FuncKey.java | 151 - .../org/apache/xalan/templates/KeyDeclaration.java | 198 -- .../org/apache/xalan/templates/NamespaceAlias.java | 159 - .../apache/xalan/templates/OutputProperties.java | 689 ---- .../xalan/templates/RedundentExprEliminator.java | 1432 -------- .../org/apache/xalan/templates/Stylesheet.java | 1516 -------- .../apache/xalan/templates/StylesheetComposed.java | 349 -- .../org/apache/xalan/templates/StylesheetRoot.java | 1405 -------- .../org/apache/xalan/templates/TemplateList.java | 923 ----- .../templates/TemplateSubPatternAssociation.java | 249 -- .../apache/xalan/templates/VarNameCollector.java | 80 - .../org/apache/xalan/templates/WhiteSpaceInfo.java | 87 - .../java/org/apache/xalan/templates/XMLNSDecl.java | 87 - .../org/apache/xalan/templates/XSLTVisitable.java | 40 - .../org/apache/xalan/templates/XSLTVisitor.java | 126 - .../xalan/templates/XUnresolvedVariable.java | 187 - .../xalan/templates/XUnresolvedVariableSimple.java | 84 - .../java/org/apache/xalan/templates/package.html | 44 - .../xalan/transformer/ClonerToResultTree.java | 212 -- .../java/org/apache/xalan/transformer/Counter.java | 157 - .../apache/xalan/transformer/CountersTable.java | 208 -- .../apache/xalan/transformer/DecimalToRoman.java | 62 - .../org/apache/xalan/transformer/KeyIterator.java | 153 - .../org/apache/xalan/transformer/KeyManager.java | 115 - .../org/apache/xalan/transformer/KeyTable.java | 260 -- .../java/org/apache/xalan/transformer/MsgMgr.java | 315 -- .../org/apache/xalan/transformer/NodeSortKey.java | 129 - .../org/apache/xalan/transformer/NodeSorter.java | 557 --- .../xalan/transformer/SerializerSwitcher.java | 205 -- .../org/apache/xalan/transformer/TrAXFilter.java | 235 -- .../apache/xalan/transformer/TransformState.java | 128 - .../xalan/transformer/TransformerClient.java | 43 - .../xalan/transformer/TransformerHandlerImpl.java | 1080 ------ .../xalan/transformer/TransformerIdentityImpl.java | 1481 -------- .../apache/xalan/transformer/TransformerImpl.java | 3271 ------------------ .../xalan/transformer/TreeWalker2Result.java | 155 - .../apache/xalan/transformer/XalanProperties.java | 35 - .../xalan/transformer/XalanTransformState.java | 148 - .../java/org/apache/xalan/transformer/package.html | 39 - .../org/apache/xalan/xslt/EnvironmentCheck.java | 1296 ------- .../java/org/apache/xalan/xslt/ObjectFactory.java | 661 ---- .../org/apache/xalan/xslt/SecuritySupport.java | 125 - .../org/apache/xalan/xslt/SecuritySupport12.java | 146 - .../main/java/org/apache/xalan/xslt/package.html | 26 - xml/src/main/java/org/apache/xml/dtm/Axis.java | 220 -- xml/src/main/java/org/apache/xml/dtm/DTM.java | 967 ------ .../java/org/apache/xml/dtm/DTMAxisIterator.java | 110 - .../java/org/apache/xml/dtm/DTMAxisTraverser.java | 116 - .../apache/xml/dtm/DTMConfigurationException.java | 99 - .../java/org/apache/xml/dtm/DTMDOMException.java | 54 - .../main/java/org/apache/xml/dtm/DTMException.java | 383 --- .../main/java/org/apache/xml/dtm/DTMFilter.java | 188 - .../main/java/org/apache/xml/dtm/DTMIterator.java | 344 -- .../main/java/org/apache/xml/dtm/DTMManager.java | 430 --- .../main/java/org/apache/xml/dtm/DTMWSFilter.java | 56 - .../java/org/apache/xml/dtm/ObjectFactory.java | 661 ---- .../java/org/apache/xml/dtm/SecuritySupport.java | 125 - .../java/org/apache/xml/dtm/SecuritySupport12.java | 146 - .../org/apache/xml/dtm/ref/ChunkedIntArray.java | 306 -- .../org/apache/xml/dtm/ref/CoroutineManager.java | 344 -- .../apache/xml/dtm/ref/DTMAxisIterNodeList.java | 142 - .../apache/xml/dtm/ref/DTMAxisIteratorBase.java | 281 -- .../apache/xml/dtm/ref/DTMChildIterNodeList.java | 119 - .../org/apache/xml/dtm/ref/DTMDefaultBase.java | 2371 ------------- .../xml/dtm/ref/DTMDefaultBaseIterators.java | 2192 ------------ .../xml/dtm/ref/DTMDefaultBaseTraversers.java | 1744 ---------- .../org/apache/xml/dtm/ref/DTMDocumentImpl.java | 2411 ------------- .../org/apache/xml/dtm/ref/DTMManagerDefault.java | 859 ----- .../org/apache/xml/dtm/ref/DTMNamedNodeMap.java | 300 -- .../org/apache/xml/dtm/ref/DTMNodeIterator.java | 186 - .../java/org/apache/xml/dtm/ref/DTMNodeList.java | 127 - .../org/apache/xml/dtm/ref/DTMNodeListBase.java | 81 - .../java/org/apache/xml/dtm/ref/DTMNodeProxy.java | 2218 ------------ .../java/org/apache/xml/dtm/ref/DTMStringPool.java | 191 -- .../java/org/apache/xml/dtm/ref/DTMTreeWalker.java | 404 --- .../org/apache/xml/dtm/ref/ExpandedNameTable.java | 391 --- .../java/org/apache/xml/dtm/ref/ExtendedType.java | 145 - .../apache/xml/dtm/ref/IncrementalSAXSource.java | 89 - .../xml/dtm/ref/IncrementalSAXSource_Filter.java | 807 ----- .../java/org/apache/xml/dtm/ref/NodeLocator.java | 110 - .../org/apache/xml/dtm/ref/SecuritySupport.java | 125 - .../org/apache/xml/dtm/ref/SecuritySupport12.java | 146 - .../org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java | 1766 ---------- .../DOM2DTMdefaultNamespaceDeclarationNode.java | 679 ---- .../org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java | 2513 -------------- .../org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java | 3383 ------------------ .../org/apache/xml/dtm/ref/sax2dtm/SAX2RTFDTM.java | 362 -- .../java/org/apache/xml/res/XMLErrorResources.java | 363 -- .../main/java/org/apache/xml/res/XMLMessages.java | 147 - .../xml/serializer/AttributesImplSerializer.java | 237 -- .../java/org/apache/xml/serializer/CharInfo.java | 807 ----- .../org/apache/xml/serializer/DOM3Serializer.java | 170 - .../org/apache/xml/serializer/DOMSerializer.java | 74 - .../org/apache/xml/serializer/ElemContext.java | 222 -- .../java/org/apache/xml/serializer/ElemDesc.java | 179 - .../org/apache/xml/serializer/EncodingInfo.java | 562 --- .../java/org/apache/xml/serializer/Encodings.java | 497 --- .../org/apache/xml/serializer/Encodings.properties | 260 -- .../xml/serializer/ExtendedContentHandler.java | 271 -- .../xml/serializer/ExtendedLexicalHandler.java | 39 - .../apache/xml/serializer/HTMLEntities.properties | 311 -- .../java/org/apache/xml/serializer/Method.java | 82 - .../apache/xml/serializer/NamespaceMappings.java | 500 --- .../org/apache/xml/serializer/ObjectFactory.java | 660 ---- .../xml/serializer/OutputPropertiesFactory.java | 516 --- .../apache/xml/serializer/OutputPropertyUtils.java | 83 - .../org/apache/xml/serializer/SecuritySupport.java | 123 - .../apache/xml/serializer/SecuritySupport12.java | 143 - .../xml/serializer/SerializationHandler.java | 145 - .../java/org/apache/xml/serializer/Serializer.java | 238 -- .../org/apache/xml/serializer/SerializerBase.java | 1699 --------- .../apache/xml/serializer/SerializerConstants.java | 59 - .../apache/xml/serializer/SerializerFactory.java | 185 - .../org/apache/xml/serializer/SerializerTrace.java | 153 - .../xml/serializer/SerializerTraceWriter.java | 341 -- .../org/apache/xml/serializer/ToHTMLStream.java | 2350 ------------- .../org/apache/xml/serializer/ToSAXHandler.java | 438 --- .../java/org/apache/xml/serializer/ToStream.java | 3601 -------------------- .../apache/xml/serializer/ToTextSAXHandler.java | 413 --- .../org/apache/xml/serializer/ToTextStream.java | 634 ---- .../org/apache/xml/serializer/ToUnknownStream.java | 1316 ------- .../org/apache/xml/serializer/ToXMLSAXHandler.java | 774 ----- .../org/apache/xml/serializer/ToXMLStream.java | 646 ---- .../xml/serializer/TransformStateSetter.java | 56 - .../java/org/apache/xml/serializer/TreeWalker.java | 527 --- .../java/org/apache/xml/serializer/Version.java | 150 - .../java/org/apache/xml/serializer/Version.src | 150 - .../org/apache/xml/serializer/WriterChain.java | 82 - .../org/apache/xml/serializer/WriterToASCI.java | 155 - .../xml/serializer/WriterToUTF8Buffered.java | 502 --- .../apache/xml/serializer/XMLEntities.properties | 30 - .../apache/xml/serializer/XSLOutputAttributes.java | 236 -- .../xml/serializer/dom3/DOM3SerializerImpl.java | 158 - .../apache/xml/serializer/dom3/DOM3TreeWalker.java | 2149 ------------ .../apache/xml/serializer/dom3/DOMConstants.java | 134 - .../xml/serializer/dom3/DOMErrorHandlerImpl.java | 67 - .../apache/xml/serializer/dom3/DOMErrorImpl.java | 176 - .../apache/xml/serializer/dom3/DOMLocatorImpl.java | 180 - .../apache/xml/serializer/dom3/DOMOutputImpl.java | 177 - .../xml/serializer/dom3/DOMStringListImpl.java | 99 - .../xml/serializer/dom3/LSSerializerImpl.java | 1537 --------- .../xml/serializer/dom3/NamespaceSupport.java | 315 -- .../apache/xml/serializer/output_html.properties | 44 - .../apache/xml/serializer/output_text.properties | 37 - .../xml/serializer/output_unknown.properties | 46 - .../apache/xml/serializer/output_xml.properties | 46 - .../java/org/apache/xml/serializer/package.html | 43 - .../org/apache/xml/serializer/utils/AttList.java | 264 -- .../apache/xml/serializer/utils/DOM2Helper.java | 122 - .../org/apache/xml/serializer/utils/Messages.java | 366 -- .../org/apache/xml/serializer/utils/MsgKey.java | 131 - .../xml/serializer/utils/SerializerMessages.java | 296 -- .../serializer/utils/SerializerMessages_ca.java | 293 -- .../serializer/utils/SerializerMessages_cs.java | 293 -- .../serializer/utils/SerializerMessages_de.java | 293 -- .../serializer/utils/SerializerMessages_en.java | 30 - .../serializer/utils/SerializerMessages_es.java | 293 -- .../serializer/utils/SerializerMessages_fr.java | 293 -- .../serializer/utils/SerializerMessages_hu.java | 293 -- .../serializer/utils/SerializerMessages_it.java | 293 -- .../serializer/utils/SerializerMessages_ja.java | 293 -- .../serializer/utils/SerializerMessages_ko.java | 293 -- .../serializer/utils/SerializerMessages_pl.java | 293 -- .../serializer/utils/SerializerMessages_pt_BR.java | 293 -- .../serializer/utils/SerializerMessages_ru.java | 293 -- .../serializer/utils/SerializerMessages_sk.java | 293 -- .../serializer/utils/SerializerMessages_sl.java | 293 -- .../serializer/utils/SerializerMessages_sv.java | 98 - .../serializer/utils/SerializerMessages_tr.java | 293 -- .../serializer/utils/SerializerMessages_zh.java | 291 -- .../serializer/utils/SerializerMessages_zh_CN.java | 28 - .../serializer/utils/SerializerMessages_zh_TW.java | 293 -- .../xml/serializer/utils/StringToIntTable.java | 203 -- .../xml/serializer/utils/SystemIDResolver.java | 302 -- .../java/org/apache/xml/serializer/utils/URI.java | 1653 --------- .../org/apache/xml/serializer/utils/Utils.java | 40 - .../serializer/utils/WrappedRuntimeException.java | 81 - .../org/apache/xml/serializer/utils/XML11Char.java | 414 --- .../org/apache/xml/serializer/utils/XMLChar.java | 1026 ------ .../main/java/org/apache/xml/utils/AttList.java | 255 -- .../main/java/org/apache/xml/utils/BoolStack.java | 202 -- .../main/java/org/apache/xml/utils/Constants.java | 112 - .../main/java/org/apache/xml/utils/DOM2Helper.java | 314 -- .../main/java/org/apache/xml/utils/DOMBuilder.java | 795 ----- .../main/java/org/apache/xml/utils/DOMHelper.java | 1341 -------- .../main/java/org/apache/xml/utils/DOMOrder.java | 41 - .../org/apache/xml/utils/DefaultErrorHandler.java | 363 -- .../org/apache/xml/utils/FastStringBuffer.java | 1293 ------- .../main/java/org/apache/xml/utils/IntStack.java | 211 -- .../main/java/org/apache/xml/utils/IntVector.java | 419 --- xml/src/main/java/org/apache/xml/utils/NSInfo.java | 110 - .../main/java/org/apache/xml/utils/NameSpace.java | 59 - .../org/apache/xml/utils/NamespaceSupport2.java | 749 ---- .../java/org/apache/xml/utils/NodeConsumer.java | 40 - .../main/java/org/apache/xml/utils/NodeVector.java | 739 ---- .../java/org/apache/xml/utils/ObjectFactory.java | 661 ---- .../main/java/org/apache/xml/utils/ObjectPool.java | 174 - .../java/org/apache/xml/utils/ObjectStack.java | 215 -- .../java/org/apache/xml/utils/ObjectVector.java | 431 --- .../java/org/apache/xml/utils/PrefixResolver.java | 72 - .../apache/xml/utils/PrefixResolverDefault.java | 145 - xml/src/main/java/org/apache/xml/utils/QName.java | 709 ---- .../org/apache/xml/utils/SAXSourceLocator.java | 170 - .../java/org/apache/xml/utils/SecuritySupport.java | 125 - .../org/apache/xml/utils/SecuritySupport12.java | 146 - .../org/apache/xml/utils/StopParseException.java | 40 - .../org/apache/xml/utils/StringBufferPool.java | 60 - .../org/apache/xml/utils/StringToIntTable.java | 196 -- .../java/org/apache/xml/utils/StringVector.java | 223 -- .../org/apache/xml/utils/StylesheetPIHandler.java | 340 -- .../apache/xml/utils/SuballocatedIntVector.java | 557 --- .../org/apache/xml/utils/SystemIDResolver.java | 295 -- .../apache/xml/utils/ThreadControllerWrapper.java | 96 - .../main/java/org/apache/xml/utils/TreeWalker.java | 508 --- xml/src/main/java/org/apache/xml/utils/URI.java | 1673 --------- .../main/java/org/apache/xml/utils/UnImplNode.java | 1977 ----------- .../apache/xml/utils/WrappedRuntimeException.java | 74 - .../main/java/org/apache/xml/utils/XML11Char.java | 432 --- .../main/java/org/apache/xml/utils/XMLChar.java | 668 ---- .../apache/xml/utils/XMLCharacterRecognizer.java | 109 - .../org/apache/xml/utils/XMLReaderManager.java | 161 - .../main/java/org/apache/xml/utils/XMLString.java | 689 ---- .../org/apache/xml/utils/XMLStringDefault.java | 818 ----- .../org/apache/xml/utils/XMLStringFactory.java | 71 - .../main/java/org/apache/xml/utils/package.html | 27 - .../org/apache/xml/utils/res/CharArrayWrapper.java | 42 - .../org/apache/xml/utils/res/IntArrayWrapper.java | 42 - .../org/apache/xml/utils/res/LongArrayWrapper.java | 42 - .../apache/xml/utils/res/StringArrayWrapper.java | 43 - .../org/apache/xml/utils/res/XResourceBundle.java | 140 - .../apache/xml/utils/res/XResourceBundleBase.java | 50 - .../org/apache/xml/utils/res/XResources_cy.java | 84 - .../org/apache/xml/utils/res/XResources_de.java | 73 - .../org/apache/xml/utils/res/XResources_el.java | 90 - .../org/apache/xml/utils/res/XResources_en.java | 73 - .../org/apache/xml/utils/res/XResources_es.java | 73 - .../org/apache/xml/utils/res/XResources_fr.java | 73 - .../org/apache/xml/utils/res/XResources_he.java | 79 - .../org/apache/xml/utils/res/XResources_hy.java | 86 - .../org/apache/xml/utils/res/XResources_it.java | 73 - .../apache/xml/utils/res/XResources_ja_JP_A.java | 86 - .../apache/xml/utils/res/XResources_ja_JP_HA.java | 86 - .../apache/xml/utils/res/XResources_ja_JP_HI.java | 87 - .../apache/xml/utils/res/XResources_ja_JP_I.java | 86 - .../org/apache/xml/utils/res/XResources_ka.java | 84 - .../org/apache/xml/utils/res/XResources_ko.java | 80 - .../org/apache/xml/utils/res/XResources_sv.java | 73 - .../org/apache/xml/utils/res/XResources_zh_CN.java | 80 - .../org/apache/xml/utils/res/XResources_zh_TW.java | 80 - xml/src/main/java/org/apache/xpath/Arg.java | 258 -- .../main/java/org/apache/xpath/CachedXPathAPI.java | 340 -- xml/src/main/java/org/apache/xpath/Expression.java | 589 ---- .../main/java/org/apache/xpath/ExpressionNode.java | 52 - .../java/org/apache/xpath/ExpressionOwner.java | 45 - .../java/org/apache/xpath/ExtensionsProvider.java | 60 - xml/src/main/java/org/apache/xpath/FoundIndex.java | 37 - xml/src/main/java/org/apache/xpath/NodeSet.java | 1370 -------- xml/src/main/java/org/apache/xpath/NodeSetDTM.java | 1247 ------- xml/src/main/java/org/apache/xpath/SourceTree.java | 52 - .../java/org/apache/xpath/SourceTreeManager.java | 390 --- .../main/java/org/apache/xpath/VariableStack.java | 547 --- .../xpath/WhitespaceStrippingElementMatcher.java | 54 - xml/src/main/java/org/apache/xpath/XPath.java | 643 ---- xml/src/main/java/org/apache/xpath/XPathAPI.java | 288 -- .../main/java/org/apache/xpath/XPathContext.java | 1352 -------- .../main/java/org/apache/xpath/XPathException.java | 328 -- .../main/java/org/apache/xpath/XPathFactory.java | 50 - .../org/apache/xpath/XPathProcessorException.java | 54 - .../main/java/org/apache/xpath/XPathVisitable.java | 42 - .../main/java/org/apache/xpath/XPathVisitor.java | 203 -- .../org/apache/xpath/axes/AttributeIterator.java | 75 - .../java/org/apache/xpath/axes/AxesWalker.java | 590 ---- .../org/apache/xpath/axes/BasicTestIterator.java | 226 -- .../java/org/apache/xpath/axes/ChildIterator.java | 121 - .../org/apache/xpath/axes/ChildTestIterator.java | 178 - .../org/apache/xpath/axes/ContextNodeList.java | 136 - .../org/apache/xpath/axes/DescendantIterator.java | 380 --- .../org/apache/xpath/axes/FilterExprIterator.java | 214 -- .../xpath/axes/FilterExprIteratorSimple.java | 315 -- .../org/apache/xpath/axes/FilterExprWalker.java | 349 -- .../xpath/axes/HasPositionalPredChecker.java | 124 - .../java/org/apache/xpath/axes/IteratorPool.java | 119 - .../org/apache/xpath/axes/LocPathIterator.java | 1033 ------ .../apache/xpath/axes/MatchPatternIterator.java | 331 -- .../java/org/apache/xpath/axes/NodeSequence.java | 953 ------ .../org/apache/xpath/axes/OneStepIterator.java | 345 -- .../apache/xpath/axes/OneStepIteratorForward.java | 172 - .../java/org/apache/xpath/axes/PathComponent.java | 36 - .../org/apache/xpath/axes/PredicatedNodeTest.java | 647 ---- .../java/org/apache/xpath/axes/RTFIterator.java | 43 - .../org/apache/xpath/axes/ReverseAxesWalker.java | 247 -- .../apache/xpath/axes/SelfIteratorNoPredicate.java | 127 - .../java/org/apache/xpath/axes/SubContextList.java | 52 - .../org/apache/xpath/axes/UnionChildIterator.java | 150 - .../org/apache/xpath/axes/UnionPathIterator.java | 584 ---- .../java/org/apache/xpath/axes/WalkerFactory.java | 1825 ---------- .../org/apache/xpath/axes/WalkingIterator.java | 363 -- .../apache/xpath/axes/WalkingIteratorSorted.java | 214 -- .../main/java/org/apache/xpath/axes/package.html | 27 - .../java/org/apache/xpath/compiler/Compiler.java | 1268 ------- .../org/apache/xpath/compiler/FunctionTable.java | 407 --- .../java/org/apache/xpath/compiler/Keywords.java | 286 -- .../main/java/org/apache/xpath/compiler/Lexer.java | 669 ---- .../java/org/apache/xpath/compiler/OpCodes.java | 632 ---- .../main/java/org/apache/xpath/compiler/OpMap.java | 455 --- .../org/apache/xpath/compiler/OpMapVector.java | 116 - .../org/apache/xpath/compiler/PsuedoNames.java | 59 - .../org/apache/xpath/compiler/XPathDumper.java | 31 - .../org/apache/xpath/compiler/XPathParser.java | 2401 ------------- .../java/org/apache/xpath/compiler/package.html | 26 - .../xpath/domapi/XPathStylesheetDOM3Exception.java | 34 - .../org/apache/xpath/functions/FuncBoolean.java | 48 - .../org/apache/xpath/functions/FuncCeiling.java | 47 - .../org/apache/xpath/functions/FuncConcat.java | 90 - .../org/apache/xpath/functions/FuncContains.java | 57 - .../java/org/apache/xpath/functions/FuncCount.java | 64 - .../org/apache/xpath/functions/FuncCurrent.java | 82 - .../apache/xpath/functions/FuncDoclocation.java | 71 - .../xpath/functions/FuncExtElementAvailable.java | 95 - .../apache/xpath/functions/FuncExtFunction.java | 340 -- .../xpath/functions/FuncExtFunctionAvailable.java | 104 - .../java/org/apache/xpath/functions/FuncFalse.java | 56 - .../java/org/apache/xpath/functions/FuncFloor.java | 47 - .../org/apache/xpath/functions/FuncGenerateId.java | 62 - .../java/org/apache/xpath/functions/FuncId.java | 151 - .../java/org/apache/xpath/functions/FuncLang.java | 82 - .../java/org/apache/xpath/functions/FuncLast.java | 106 - .../org/apache/xpath/functions/FuncLocalPart.java | 57 - .../org/apache/xpath/functions/FuncNamespace.java | 78 - .../apache/xpath/functions/FuncNormalizeSpace.java | 86 - .../java/org/apache/xpath/functions/FuncNot.java | 47 - .../org/apache/xpath/functions/FuncNumber.java | 47 - .../org/apache/xpath/functions/FuncPosition.java | 134 - .../java/org/apache/xpath/functions/FuncQname.java | 63 - .../java/org/apache/xpath/functions/FuncRound.java | 52 - .../org/apache/xpath/functions/FuncStartsWith.java | 48 - .../org/apache/xpath/functions/FuncString.java | 47 - .../apache/xpath/functions/FuncStringLength.java | 47 - .../org/apache/xpath/functions/FuncSubstring.java | 124 - .../apache/xpath/functions/FuncSubstringAfter.java | 55 - .../xpath/functions/FuncSubstringBefore.java | 53 - .../java/org/apache/xpath/functions/FuncSum.java | 65 - .../apache/xpath/functions/FuncSystemProperty.java | 186 - .../org/apache/xpath/functions/FuncTranslate.java | 88 - .../java/org/apache/xpath/functions/FuncTrue.java | 56 - .../xpath/functions/FuncUnparsedEntityURI.java | 55 - .../java/org/apache/xpath/functions/Function.java | 144 - .../org/apache/xpath/functions/Function2Args.java | 184 - .../org/apache/xpath/functions/Function3Args.java | 183 - .../apache/xpath/functions/FunctionDef1Arg.java | 167 - .../apache/xpath/functions/FunctionMultiArgs.java | 236 -- .../org/apache/xpath/functions/FunctionOneArg.java | 174 - .../org/apache/xpath/functions/ObjectFactory.java | 661 ---- .../apache/xpath/functions/SecuritySupport.java | 125 - .../apache/xpath/functions/SecuritySupport12.java | 146 - .../xpath/functions/WrongNumberArgsException.java | 43 - .../java/org/apache/xpath/functions/package.html | 29 - .../apache/xpath/jaxp/JAXPExtensionsProvider.java | 208 -- .../org/apache/xpath/jaxp/JAXPPrefixResolver.java | 127 - .../org/apache/xpath/jaxp/JAXPVariableStack.java | 73 - .../org/apache/xpath/jaxp/XPathExpressionImpl.java | 396 --- .../org/apache/xpath/jaxp/XPathFactoryImpl.java | 265 -- .../main/java/org/apache/xpath/jaxp/XPathImpl.java | 545 --- .../org/apache/xpath/objects/DTMXRTreeFrag.java | 58 - .../java/org/apache/xpath/objects/XBoolean.java | 168 - .../org/apache/xpath/objects/XBooleanStatic.java | 69 - .../apache/xpath/objects/XMLStringFactoryImpl.java | 101 - .../java/org/apache/xpath/objects/XNodeSet.java | 969 ------ .../org/apache/xpath/objects/XNodeSetForDOM.java | 128 - .../main/java/org/apache/xpath/objects/XNull.java | 130 - .../java/org/apache/xpath/objects/XNumber.java | 437 --- .../java/org/apache/xpath/objects/XObject.java | 759 ----- .../org/apache/xpath/objects/XObjectFactory.java | 161 - .../java/org/apache/xpath/objects/XRTreeFrag.java | 301 -- .../xpath/objects/XRTreeFragSelectWrapper.java | 154 - .../java/org/apache/xpath/objects/XString.java | 1122 ------ .../org/apache/xpath/objects/XStringForChars.java | 216 -- .../org/apache/xpath/objects/XStringForFSB.java | 986 ------ .../java/org/apache/xpath/objects/package.html | 27 - .../main/java/org/apache/xpath/operations/And.java | 75 - .../java/org/apache/xpath/operations/Bool.java | 68 - .../main/java/org/apache/xpath/operations/Div.java | 67 - .../java/org/apache/xpath/operations/Equals.java | 74 - .../main/java/org/apache/xpath/operations/Gt.java | 49 - .../main/java/org/apache/xpath/operations/Gte.java | 50 - .../main/java/org/apache/xpath/operations/Lt.java | 49 - .../main/java/org/apache/xpath/operations/Lte.java | 49 - .../java/org/apache/xpath/operations/Minus.java | 68 - .../main/java/org/apache/xpath/operations/Mod.java | 67 - .../java/org/apache/xpath/operations/Mult.java | 66 - .../main/java/org/apache/xpath/operations/Neg.java | 65 - .../org/apache/xpath/operations/NotEquals.java | 49 - .../java/org/apache/xpath/operations/Number.java | 69 - .../org/apache/xpath/operations/Operation.java | 212 -- .../main/java/org/apache/xpath/operations/Or.java | 75 - .../java/org/apache/xpath/operations/Plus.java | 67 - .../main/java/org/apache/xpath/operations/Quo.java | 52 - .../java/org/apache/xpath/operations/String.java | 47 - .../apache/xpath/operations/UnaryOperation.java | 163 - .../java/org/apache/xpath/operations/Variable.java | 387 --- .../xpath/operations/VariableSafeAbsRef.java | 74 - .../java/org/apache/xpath/operations/package.html | 26 - xml/src/main/java/org/apache/xpath/package.html | 27 - .../xpath/patterns/ContextMatchStepPattern.java | 179 - .../org/apache/xpath/patterns/FunctionPattern.java | 248 -- .../java/org/apache/xpath/patterns/NodeTest.java | 692 ---- .../org/apache/xpath/patterns/NodeTestFilter.java | 39 - .../org/apache/xpath/patterns/StepPattern.java | 1053 ------ .../org/apache/xpath/patterns/UnionPattern.java | 218 -- .../java/org/apache/xpath/patterns/package.html | 26 - .../org/apache/xpath/res/XPATHErrorResources.java | 999 ------ .../java/org/apache/xpath/res/XPATHMessages.java | 139 - .../main/java/org/apache/xpath/res/package.html | 26 - xml/src/main/java/org/w3c/dom/Attr.java | 275 -- xml/src/main/java/org/w3c/dom/CDATASection.java | 54 - xml/src/main/java/org/w3c/dom/CharacterData.java | 153 - xml/src/main/java/org/w3c/dom/Comment.java | 30 - .../main/java/org/w3c/dom/DOMConfiguration.java | 413 --- xml/src/main/java/org/w3c/dom/DOMError.java | 87 - xml/src/main/java/org/w3c/dom/DOMErrorHandler.java | 45 - xml/src/main/java/org/w3c/dom/DOMException.java | 131 - .../main/java/org/w3c/dom/DOMImplementation.java | 136 - .../java/org/w3c/dom/DOMImplementationList.java | 43 - .../java/org/w3c/dom/DOMImplementationSource.java | 58 - xml/src/main/java/org/w3c/dom/DOMLocator.java | 58 - xml/src/main/java/org/w3c/dom/DOMStringList.java | 50 - xml/src/main/java/org/w3c/dom/Document.java | 814 ----- .../main/java/org/w3c/dom/DocumentFragment.java | 53 - xml/src/main/java/org/w3c/dom/DocumentType.java | 83 - xml/src/main/java/org/w3c/dom/Element.java | 439 --- xml/src/main/java/org/w3c/dom/Entity.java | 90 - xml/src/main/java/org/w3c/dom/EntityReference.java | 43 - xml/src/main/java/org/w3c/dom/NameList.java | 68 - xml/src/main/java/org/w3c/dom/NamedNodeMap.java | 183 - xml/src/main/java/org/w3c/dom/Node.java | 900 ----- xml/src/main/java/org/w3c/dom/NodeList.java | 41 - xml/src/main/java/org/w3c/dom/Notation.java | 40 - .../java/org/w3c/dom/ProcessingInstruction.java | 51 - xml/src/main/java/org/w3c/dom/Text.java | 126 - xml/src/main/java/org/w3c/dom/TypeInfo.java | 185 - xml/src/main/java/org/w3c/dom/UserDataHandler.java | 72 - .../java/org/w3c/dom/ls/DOMImplementationLS.java | 122 - xml/src/main/java/org/w3c/dom/ls/LSException.java | 47 - xml/src/main/java/org/w3c/dom/ls/LSInput.java | 218 -- xml/src/main/java/org/w3c/dom/ls/LSOutput.java | 106 - xml/src/main/java/org/w3c/dom/ls/LSParser.java | 466 --- .../main/java/org/w3c/dom/ls/LSParserFilter.java | 172 - .../java/org/w3c/dom/ls/LSResourceResolver.java | 81 - xml/src/main/java/org/w3c/dom/ls/LSSerializer.java | 440 --- .../java/org/w3c/dom/ls/LSSerializerFilter.java | 65 - xml/src/main/java/org/w3c/dom/package.html | 10 - .../java/org/w3c/dom/traversal/NodeFilter.java | 146 - .../java/org/w3c/dom/traversal/NodeIterator.java | 111 - xml/src/main/java/org/xml/sax/AttributeList.java | 193 -- xml/src/main/java/org/xml/sax/Attributes.java | 257 -- xml/src/main/java/org/xml/sax/ContentHandler.java | 419 --- xml/src/main/java/org/xml/sax/DTDHandler.java | 117 - xml/src/main/java/org/xml/sax/DocumentHandler.java | 232 -- xml/src/main/java/org/xml/sax/EntityResolver.java | 119 - xml/src/main/java/org/xml/sax/ErrorHandler.java | 139 - xml/src/main/java/org/xml/sax/HandlerBase.java | 369 -- xml/src/main/java/org/xml/sax/InputSource.java | 337 -- xml/src/main/java/org/xml/sax/Locator.java | 136 - xml/src/main/java/org/xml/sax/Parser.java | 209 -- xml/src/main/java/org/xml/sax/SAXException.java | 153 - .../org/xml/sax/SAXNotRecognizedException.java | 53 - .../java/org/xml/sax/SAXNotSupportedException.java | 53 - .../main/java/org/xml/sax/SAXParseException.java | 269 -- xml/src/main/java/org/xml/sax/XMLFilter.java | 65 - xml/src/main/java/org/xml/sax/XMLReader.java | 404 --- xml/src/main/java/org/xml/sax/ext/Attributes2.java | 132 - .../main/java/org/xml/sax/ext/Attributes2Impl.java | 320 -- xml/src/main/java/org/xml/sax/ext/DeclHandler.java | 146 - .../main/java/org/xml/sax/ext/DefaultHandler2.java | 185 - .../main/java/org/xml/sax/ext/EntityResolver2.java | 197 -- .../main/java/org/xml/sax/ext/LexicalHandler.java | 212 -- xml/src/main/java/org/xml/sax/ext/Locator2.java | 75 - .../main/java/org/xml/sax/ext/Locator2Impl.java | 105 - xml/src/main/java/org/xml/sax/ext/package.html | 46 - .../org/xml/sax/helpers/AttributeListImpl.java | 314 -- .../java/org/xml/sax/helpers/AttributesImpl.java | 618 ---- .../java/org/xml/sax/helpers/DefaultHandler.java | 467 --- .../main/java/org/xml/sax/helpers/LocatorImpl.java | 214 -- .../java/org/xml/sax/helpers/NamespaceSupport.java | 840 ----- .../main/java/org/xml/sax/helpers/NewInstance.java | 79 - .../java/org/xml/sax/helpers/ParserAdapter.java | 1046 ------ .../java/org/xml/sax/helpers/ParserFactory.java | 133 - .../java/org/xml/sax/helpers/XMLFilterImpl.java | 715 ---- .../java/org/xml/sax/helpers/XMLReaderAdapter.java | 538 --- .../java/org/xml/sax/helpers/XMLReaderFactory.java | 203 -- xml/src/main/java/org/xml/sax/helpers/package.html | 11 - xml/src/main/java/org/xml/sax/package.html | 297 -- .../native/org_apache_harmony_xml_ExpatParser.cpp | 1538 --------- xml/src/main/native/sub.mk | 20 - .../test/java/org/apache/harmony/xml/AllTests.java | 29 - .../org/apache/harmony/xml/ExpatParserTest.java | 892 ----- .../apache/harmony/xml/JaxenXPathTestSuite.java | 306 -- .../xml/NamespacedAttributesLookupTest.java | 139 - .../harmony/xml/XsltXPathConformanceTestSuite.java | 635 ---- .../java/tests/api/javax/xml/parsers/AllTests.java | 44 - .../xml/parsers/DocumentBuilderFactoryTest.java | 1121 ------ .../api/javax/xml/parsers/DocumentBuilderTest.java | 731 ---- .../xml/parsers/FactoryConfigurationErrorTest.java | 139 - .../parsers/ParserConfigurationExceptionTest.java | 55 - .../javax/xml/parsers/SAXParserFactoryTest.java | 501 --- .../tests/api/javax/xml/parsers/SAXParserTest.java | 1163 ------- .../javax/xml/parsers/SAXParserTestSupport.java | 492 --- .../test/java/tests/api/org/xml/sax/AllTests.java | 40 - .../tests/api/org/xml/sax/HandlerBaseTest.java | 226 -- .../tests/api/org/xml/sax/InputSourceTest.java | 254 -- .../tests/api/org/xml/sax/SAXExceptionTest.java | 131 - .../org/xml/sax/SAXNotRecognizedExceptionTest.java | 55 - .../org/xml/sax/SAXNotSupportedExceptionTest.java | 55 - .../api/org/xml/sax/SAXParseExceptionTest.java | 276 -- .../java/tests/api/org/xml/sax/ext/AllTests.java | 34 - .../api/org/xml/sax/ext/Attributes2ImplTest.java | 464 --- .../api/org/xml/sax/ext/DefaultHandler2Test.java | 234 -- .../api/org/xml/sax/ext/Locator2ImplTest.java | 153 - .../tests/api/org/xml/sax/helpers/AllTests.java | 40 - .../org/xml/sax/helpers/AttributeListImplTest.java | 270 -- .../org/xml/sax/helpers/AttributesImplTest.java | 608 ---- .../org/xml/sax/helpers/DefaultHandlerTest.java | 278 -- .../api/org/xml/sax/helpers/LocatorImplTest.java | 172 - .../org/xml/sax/helpers/NamespaceSupportTest.java | 434 --- .../api/org/xml/sax/helpers/ParserAdapterTest.java | 475 --- .../api/org/xml/sax/helpers/ParserFactoryTest.java | 167 - .../api/org/xml/sax/helpers/XMLFilterImplTest.java | 678 ---- .../org/xml/sax/helpers/XMLReaderAdapterTest.java | 421 --- .../org/xml/sax/helpers/XMLReaderFactoryTest.java | 165 - .../api/org/xml/sax/support/BrokenInputStream.java | 50 - .../api/org/xml/sax/support/DoNothingParser.java | 55 - .../org/xml/sax/support/DoNothingXMLReader.java | 79 - .../api/org/xml/sax/support/MethodLogger.java | 95 - .../tests/api/org/xml/sax/support/MockFilter.java | 89 - .../tests/api/org/xml/sax/support/MockHandler.java | 147 - .../tests/api/org/xml/sax/support/MockParser.java | 68 - .../tests/api/org/xml/sax/support/MockReader.java | 128 - .../api/org/xml/sax/support/MockResolver.java | 47 - .../api/org/xml/sax/support/NoAccessParser.java | 55 - .../api/org/xml/sax/support/NoAccessXMLReader.java | 79 - .../api/org/xml/sax/support/NoInstanceParser.java | 58 - .../org/xml/sax/support/NoInstanceXMLReader.java | 82 - .../api/org/xml/sax/support/NoSubclassParser.java | 54 - .../org/xml/sax/support/NoSubclassXMLReader.java | 79 - xml/src/test/java/tests/org/w3c/dom/AllTests.java | 105 - .../tests/org/w3c/dom/AttrGetOwnerElement.java | 156 - .../java/tests/org/w3c/dom/CreateAttributeNS.java | 230 -- .../java/tests/org/w3c/dom/CreateDocument.java | 317 -- .../java/tests/org/w3c/dom/CreateDocumentType.java | 222 -- .../java/tests/org/w3c/dom/CreateElementNS.java | 252 -- .../org/w3c/dom/DOMDocumentBuilderFactory.java | 94 - .../w3c/dom/DOMImplementationCreateDocument.java | 177 - .../dom/DOMImplementationCreateDocumentType.java | 208 -- .../org/w3c/dom/DOMImplementationHasFeature.java | 147 - .../test/java/tests/org/w3c/dom/DOMTestCase.java | 230 -- .../tests/org/w3c/dom/DocumentBuilderSetting.java | 281 -- .../w3c/dom/DocumentBuilderSettingStrategy.java | 158 - .../org/w3c/dom/DocumentCreateAttributeNS.java | 315 -- .../tests/org/w3c/dom/DocumentCreateElementNS.java | 169 - .../w3c/dom/DocumentGetElementsByTagnameNS.java | 150 - .../tests/org/w3c/dom/DocumentGeteEementById.java | 72 - .../java/tests/org/w3c/dom/DocumentImportNode.java | 699 ---- .../org/w3c/dom/DocumentTypeInternalSubset.java | 76 - .../tests/org/w3c/dom/DocumentTypePublicId.java | 97 - .../tests/org/w3c/dom/DocumentTypeSystemId.java | 95 - .../tests/org/w3c/dom/ElementGetAttributeNS.java | 89 - .../org/w3c/dom/ElementGetAttributeNodeNS.java | 139 - .../org/w3c/dom/ElementGetElementsByTagNameNS.java | 122 - .../tests/org/w3c/dom/ElementHasAttribute.java | 123 - .../tests/org/w3c/dom/ElementHasAttributeNS.java | 139 - .../org/w3c/dom/ElementRemoveAttributeNS.java | 80 - .../tests/org/w3c/dom/ElementSetAttributeNS.java | 266 -- .../org/w3c/dom/ElementSetAttributeNodeNS.java | 276 -- .../java/tests/org/w3c/dom/GetAttributeNS.java | 187 - .../java/tests/org/w3c/dom/GetAttributeNodeNS.java | 121 - .../java/tests/org/w3c/dom/GetElementById.java | 102 - .../tests/org/w3c/dom/GetElementsByTagNameNS.java | 381 --- .../java/tests/org/w3c/dom/GetNamedItemNS.java | 135 - .../org/w3c/dom/HCEntitiesRemoveNamedItemNS.java | 102 - .../org/w3c/dom/HCEntitiesSetNamedItemNS.java | 86 - .../org/w3c/dom/HCNamedNodeMapInvalidType.java | 103 - .../w3c/dom/HCNodeDocumentFragmentNormalize.java | 108 - .../org/w3c/dom/HCNotationsRemoveNamedItemNS.java | 110 - .../org/w3c/dom/HCNotationsSetNamedItemNS.java | 112 - .../test/java/tests/org/w3c/dom/HasAttribute.java | 119 - .../java/tests/org/w3c/dom/HasAttributeNS.java | 172 - .../test/java/tests/org/w3c/dom/HasAttributes.java | 111 - .../test/java/tests/org/w3c/dom/ImportNode.java | 604 ---- .../java/tests/org/w3c/dom/InternalSubset.java | 92 - .../test/java/tests/org/w3c/dom/IsSupported.java | 272 -- xml/src/test/java/tests/org/w3c/dom/LocalName.java | 132 - .../org/w3c/dom/NamedNodeMapGetNamedItemNS.java | 229 -- .../org/w3c/dom/NamedNodeMapRemoveNamedItemNS.java | 342 -- .../org/w3c/dom/NamedNodeMapSetNamedItemNS.java | 451 --- .../test/java/tests/org/w3c/dom/NamespaceURI.java | 153 - .../java/tests/org/w3c/dom/NodeGetLocalName.java | 107 - .../tests/org/w3c/dom/NodeGetNamespaceURI.java | 111 - .../tests/org/w3c/dom/NodeGetOwnerDocument.java | 128 - .../test/java/tests/org/w3c/dom/NodeGetPrefix.java | 108 - .../java/tests/org/w3c/dom/NodeHasAttributes.java | 171 - .../java/tests/org/w3c/dom/NodeIsSupported.java | 216 -- .../test/java/tests/org/w3c/dom/NodeNormalize.java | 209 -- .../test/java/tests/org/w3c/dom/NodeSetPrefix.java | 314 -- xml/src/test/java/tests/org/w3c/dom/Normalize.java | 106 - .../test/java/tests/org/w3c/dom/OwnerDocument.java | 88 - .../test/java/tests/org/w3c/dom/OwnerElement.java | 118 - xml/src/test/java/tests/org/w3c/dom/Prefix.java | 337 -- xml/src/test/java/tests/org/w3c/dom/PublicId.java | 91 - .../java/tests/org/w3c/dom/RemoveAttributeNS.java | 147 - .../java/tests/org/w3c/dom/RemoveNamedItemNS.java | 178 - .../java/tests/org/w3c/dom/SetAttributeNS.java | 355 -- .../java/tests/org/w3c/dom/SetAttributeNodeNS.java | 237 -- .../java/tests/org/w3c/dom/SetNamedItemNS.java | 248 -- xml/src/test/java/tests/org/w3c/dom/SystemId.java | 94 - xml/src/test/java/tests/xml/AllTests.java | 49 - xml/src/test/java/tests/xml/DeclarationTest.java | 107 - xml/src/test/java/tests/xml/DomTest.java | 1383 -------- xml/src/test/java/tests/xml/NodeTest.java | 91 - xml/src/test/java/tests/xml/NormalizeTest.java | 622 ---- xml/src/test/java/tests/xml/SaxTest.java | 177 - xml/src/test/java/tests/xml/SimpleBuilderTest.java | 162 - xml/src/test/java/tests/xml/SimpleParserTest.java | 289 -- xml/src/test/resources/SimpleBuilderTest.xml | 21 - xml/src/test/resources/SimpleParserTest.xml | 19 - xml/src/test/resources/hc_staff.xml | 60 - xml/src/test/resources/nwf/staff.dtd | 17 - xml/src/test/resources/nwf/staff.xml | 57 - xml/src/test/resources/out_dh/staff.out | 45 - xml/src/test/resources/out_hb/staff.out | 45 - xml/src/test/resources/recipe.xml | 24 - xml/src/test/resources/recipe1.xml | 24 - xml/src/test/resources/recipt.dtd | 17 - xml/src/test/resources/recipt.xml | 24 - xml/src/test/resources/reciptWrong.xml | 21 - xml/src/test/resources/simple.xml | 34 - xml/src/test/resources/simple_ns.dtd | 45 - xml/src/test/resources/simple_ns.xml | 59 - xml/src/test/resources/staff.dtd | 17 - xml/src/test/resources/staff.xml | 57 - xml/src/test/resources/staff2.dtd | 24 - xml/src/test/resources/staff2.xml | 13 - xml/src/test/resources/staffEntRes.xml | 60 - xml/src/test/resources/staffNS.dtd | 45 - xml/src/test/resources/staffNS.xml | 59 - xml/src/test/resources/systemid.xml | 24 - xml/src/test/resources/systemid/recipt.dtd | 17 - xml/src/test/resources/systemid/staff.dtd | 17 - xml/src/test/resources/wf/staff.dtd | 17 - xml/src/test/resources/wf/staff.xml | 57 - xml/src/test/resources/wrong.xml | 1 - xml/src/test/resources/xhtml1-strict.dtd | 65 - 2248 files changed, 318137 insertions(+), 318234 deletions(-) delete mode 100644 awt-kernel/MODULE_LICENSE_APACHE2 delete mode 100644 awt-kernel/src/main/java/java/awt/font/NumericShaper.java delete mode 100644 awt-kernel/src/main/java/java/awt/font/TextAttribute.java delete mode 100644 awt-kernel/src/main/java/java/beans/IndexedPropertyChangeEvent.java delete mode 100644 awt-kernel/src/main/java/java/beans/PropertyChangeEvent.java delete mode 100644 awt-kernel/src/main/java/java/beans/PropertyChangeListener.java delete mode 100644 awt-kernel/src/main/java/java/beans/PropertyChangeListenerProxy.java delete mode 100644 awt-kernel/src/main/java/java/beans/PropertyChangeSupport.java delete mode 100644 icu/MODULE_LICENSE_BSD_LIKE delete mode 100644 icu/license.html delete mode 100644 icu/src/main/java/com/ibm/icu4jni/charset/CharsetDecoderICU.java delete mode 100644 icu/src/main/java/com/ibm/icu4jni/charset/CharsetEncoderICU.java delete mode 100644 icu/src/main/java/com/ibm/icu4jni/charset/CharsetICU.java delete mode 100644 icu/src/main/java/com/ibm/icu4jni/charset/NativeConverter.java delete mode 100644 icu/src/main/java/com/ibm/icu4jni/common/ErrorCode.java delete mode 100644 icu/src/main/java/com/ibm/icu4jni/lang/UCharacter.java delete mode 100644 icu/src/main/java/com/ibm/icu4jni/regex/NativeRegEx.java delete mode 100644 icu/src/main/java/com/ibm/icu4jni/text/CollationAttribute.java delete mode 100644 icu/src/main/java/com/ibm/icu4jni/text/CollationElementIterator.java delete mode 100644 icu/src/main/java/com/ibm/icu4jni/text/CollationKey.java delete mode 100644 icu/src/main/java/com/ibm/icu4jni/text/Collator.java delete mode 100644 icu/src/main/java/com/ibm/icu4jni/text/NativeBreakIterator.java delete mode 100644 icu/src/main/java/com/ibm/icu4jni/text/NativeCollation.java delete mode 100644 icu/src/main/java/com/ibm/icu4jni/text/NativeDecimalFormat.java delete mode 100644 icu/src/main/java/com/ibm/icu4jni/text/NativeIDN.java delete mode 100644 icu/src/main/java/com/ibm/icu4jni/text/NativeNormalizer.java delete mode 100644 icu/src/main/java/com/ibm/icu4jni/text/RuleBasedCollator.java delete mode 100644 icu/src/main/java/com/ibm/icu4jni/util/ICU.java delete mode 100644 icu/src/main/java/com/ibm/icu4jni/util/LocaleData.java delete mode 100644 icu/src/main/native/BidiWrapper.cpp delete mode 100644 icu/src/main/native/ErrorCode.cpp delete mode 100644 icu/src/main/native/ErrorCode.h delete mode 100644 icu/src/main/native/ICU.cpp delete mode 100644 icu/src/main/native/NativeBreakIterator.cpp delete mode 100644 icu/src/main/native/NativeCollation.cpp delete mode 100644 icu/src/main/native/NativeConverter.cpp delete mode 100644 icu/src/main/native/NativeDecimalFormat.cpp delete mode 100644 icu/src/main/native/NativeIDN.cpp delete mode 100644 icu/src/main/native/NativeNormalizer.cpp delete mode 100644 icu/src/main/native/NativeRegEx.cpp delete mode 100644 icu/src/main/native/ScopedJavaUnicodeString.h delete mode 100644 icu/src/main/native/UCharacter.cpp delete mode 100644 icu/src/main/native/sub.mk delete mode 100644 icu/unicode-license.txt delete mode 100644 luni-kernel/MODULE_LICENSE_APACHE2 delete mode 100644 luni-kernel/src/main/java/java/lang/Class.java delete mode 100644 luni-kernel/src/main/java/java/lang/ClassCache.java delete mode 100644 luni-kernel/src/main/java/java/lang/ClassLoader.java delete mode 100644 luni-kernel/src/main/java/java/lang/Compiler.java delete mode 100644 luni-kernel/src/main/java/java/lang/LangAccessImpl.java delete mode 100644 luni-kernel/src/main/java/java/lang/Object.java delete mode 100644 luni-kernel/src/main/java/java/lang/Package.java delete mode 100644 luni-kernel/src/main/java/java/lang/ProcessManager.java delete mode 100644 luni-kernel/src/main/java/java/lang/Runtime.java delete mode 100644 luni-kernel/src/main/java/java/lang/StackTraceElement.java delete mode 100644 luni-kernel/src/main/java/java/lang/System.java delete mode 100644 luni-kernel/src/main/java/java/lang/Thread.java delete mode 100644 luni-kernel/src/main/java/java/lang/ThreadGroup.java delete mode 100644 luni-kernel/src/main/java/java/lang/Throwable.java delete mode 100644 luni-kernel/src/main/java/java/lang/ref/PhantomReference.java delete mode 100644 luni-kernel/src/main/java/java/lang/ref/Reference.java delete mode 100644 luni-kernel/src/main/java/java/lang/ref/SoftReference.java delete mode 100644 luni-kernel/src/main/java/java/lang/ref/WeakReference.java delete mode 100644 luni-kernel/src/main/java/java/lang/reflect/AccessibleObject.java delete mode 100644 luni-kernel/src/main/java/java/lang/reflect/Array.java delete mode 100644 luni-kernel/src/main/java/java/lang/reflect/Constructor.java delete mode 100644 luni-kernel/src/main/java/java/lang/reflect/Field.java delete mode 100644 luni-kernel/src/main/java/java/lang/reflect/Method.java delete mode 100644 luni-kernel/src/main/java/java/lang/reflect/ReflectionAccessImpl.java delete mode 100644 luni-kernel/src/main/java/org/apache/harmony/kernel/vm/LangAccess.java delete mode 100644 luni-kernel/src/main/java/org/apache/harmony/kernel/vm/ReflectionAccess.java delete mode 100644 luni-kernel/src/main/java/org/apache/harmony/kernel/vm/StringUtils.java delete mode 100644 luni-kernel/src/main/java/org/apache/harmony/kernel/vm/VM.java delete mode 100644 luni-kernel/src/main/java/org/apache/harmony/lang/annotation/AnnotationFactory.java delete mode 100644 luni-kernel/src/main/java/org/apache/harmony/lang/annotation/AnnotationMember.java delete mode 100644 luni-kernel/src/main/native/Register.cpp delete mode 100644 luni-kernel/src/main/native/java_lang_ProcessManager.cpp delete mode 100644 luni-kernel/src/main/native/java_lang_System.cpp delete mode 100644 luni-kernel/src/main/native/sub.mk delete mode 100644 luni-kernel/src/test/java/java/lang/reflect/AllTests.java delete mode 100644 luni-kernel/src/test/java/java/lang/reflect/ConstructorTest.java delete mode 100644 luni-kernel/src/test/java/java/lang/reflect/MethodTest.java delete mode 100644 luni-kernel/src/test/java/tests/api/org/apache/harmony/kernel/dalvik/AllTests.java delete mode 100644 luni-kernel/src/test/java/tests/api/org/apache/harmony/kernel/dalvik/ThreadsTest.java create mode 100644 luni/MODULE_LICENSE_W3C create mode 100644 luni/license.html create mode 100644 luni/src/main/java/com/ibm/icu4jni/charset/CharsetDecoderICU.java create mode 100644 luni/src/main/java/com/ibm/icu4jni/charset/CharsetEncoderICU.java create mode 100644 luni/src/main/java/com/ibm/icu4jni/charset/CharsetICU.java create mode 100644 luni/src/main/java/com/ibm/icu4jni/charset/NativeConverter.java create mode 100644 luni/src/main/java/com/ibm/icu4jni/common/ErrorCode.java create mode 100644 luni/src/main/java/com/ibm/icu4jni/lang/UCharacter.java create mode 100644 luni/src/main/java/com/ibm/icu4jni/regex/NativeRegEx.java create mode 100644 luni/src/main/java/com/ibm/icu4jni/text/CollationAttribute.java create mode 100644 luni/src/main/java/com/ibm/icu4jni/text/CollationElementIterator.java create mode 100644 luni/src/main/java/com/ibm/icu4jni/text/CollationKey.java create mode 100644 luni/src/main/java/com/ibm/icu4jni/text/Collator.java create mode 100644 luni/src/main/java/com/ibm/icu4jni/text/NativeBreakIterator.java create mode 100644 luni/src/main/java/com/ibm/icu4jni/text/NativeCollation.java create mode 100644 luni/src/main/java/com/ibm/icu4jni/text/NativeDecimalFormat.java create mode 100644 luni/src/main/java/com/ibm/icu4jni/text/NativeIDN.java create mode 100644 luni/src/main/java/com/ibm/icu4jni/text/NativeNormalizer.java create mode 100644 luni/src/main/java/com/ibm/icu4jni/text/RuleBasedCollator.java create mode 100644 luni/src/main/java/com/ibm/icu4jni/util/ICU.java create mode 100644 luni/src/main/java/com/ibm/icu4jni/util/LocaleData.java create mode 100644 luni/src/main/java/java/awt/font/NumericShaper.java create mode 100644 luni/src/main/java/java/awt/font/TextAttribute.java create mode 100644 luni/src/main/java/java/beans/IndexedPropertyChangeEvent.java create mode 100644 luni/src/main/java/java/beans/PropertyChangeEvent.java create mode 100644 luni/src/main/java/java/beans/PropertyChangeListener.java create mode 100644 luni/src/main/java/java/beans/PropertyChangeListenerProxy.java create mode 100644 luni/src/main/java/java/beans/PropertyChangeSupport.java create mode 100644 luni/src/main/java/java/lang/Class.java create mode 100644 luni/src/main/java/java/lang/ClassCache.java create mode 100644 luni/src/main/java/java/lang/ClassLoader.java create mode 100644 luni/src/main/java/java/lang/Compiler.java create mode 100644 luni/src/main/java/java/lang/LangAccessImpl.java create mode 100644 luni/src/main/java/java/lang/Object.java create mode 100644 luni/src/main/java/java/lang/Package.java create mode 100644 luni/src/main/java/java/lang/ProcessManager.java create mode 100644 luni/src/main/java/java/lang/Runtime.java create mode 100644 luni/src/main/java/java/lang/StackTraceElement.java create mode 100644 luni/src/main/java/java/lang/System.java create mode 100644 luni/src/main/java/java/lang/Thread.java create mode 100644 luni/src/main/java/java/lang/ThreadGroup.java create mode 100644 luni/src/main/java/java/lang/Throwable.java create mode 100644 luni/src/main/java/java/lang/ref/PhantomReference.java create mode 100644 luni/src/main/java/java/lang/ref/Reference.java create mode 100644 luni/src/main/java/java/lang/ref/SoftReference.java create mode 100644 luni/src/main/java/java/lang/ref/WeakReference.java create mode 100644 luni/src/main/java/java/lang/reflect/AccessibleObject.java create mode 100644 luni/src/main/java/java/lang/reflect/Array.java create mode 100644 luni/src/main/java/java/lang/reflect/Constructor.java create mode 100644 luni/src/main/java/java/lang/reflect/Field.java create mode 100644 luni/src/main/java/java/lang/reflect/Method.java create mode 100644 luni/src/main/java/java/lang/reflect/ReflectionAccessImpl.java create mode 100644 luni/src/main/java/java/security/AccessControlContext.java create mode 100644 luni/src/main/java/java/security/AccessController.java create mode 100644 luni/src/main/java/java/util/prefs/AbstractPreferences.java create mode 100644 luni/src/main/java/java/util/prefs/BackingStoreException.java create mode 100644 luni/src/main/java/java/util/prefs/FilePreferencesFactoryImpl.java create mode 100644 luni/src/main/java/java/util/prefs/FilePreferencesImpl.java create mode 100644 luni/src/main/java/java/util/prefs/InvalidPreferencesFormatException.java create mode 100644 luni/src/main/java/java/util/prefs/NodeChangeEvent.java create mode 100644 luni/src/main/java/java/util/prefs/NodeChangeListener.java create mode 100644 luni/src/main/java/java/util/prefs/NodeSet.java create mode 100644 luni/src/main/java/java/util/prefs/PreferenceChangeEvent.java create mode 100644 luni/src/main/java/java/util/prefs/PreferenceChangeListener.java create mode 100644 luni/src/main/java/java/util/prefs/Preferences.java create mode 100644 luni/src/main/java/java/util/prefs/PreferencesFactory.java create mode 100644 luni/src/main/java/java/util/prefs/XMLParser.java create mode 100644 luni/src/main/java/java/util/prefs/package.html create mode 100644 luni/src/main/java/javax/net/DefaultServerSocketFactory.java create mode 100644 luni/src/main/java/javax/net/DefaultSocketFactory.java create mode 100644 luni/src/main/java/javax/net/ServerSocketFactory.java create mode 100644 luni/src/main/java/javax/net/SocketFactory.java create mode 100644 luni/src/main/java/javax/net/package.html create mode 100644 luni/src/main/java/javax/net/ssl/CertPathTrustManagerParameters.java create mode 100644 luni/src/main/java/javax/net/ssl/DefaultHostnameVerifier.java create mode 100644 luni/src/main/java/javax/net/ssl/DefaultSSLContext.java create mode 100644 luni/src/main/java/javax/net/ssl/DefaultSSLServerSocketFactory.java create mode 100644 luni/src/main/java/javax/net/ssl/DefaultSSLSocketFactory.java create mode 100644 luni/src/main/java/javax/net/ssl/HandshakeCompletedEvent.java create mode 100644 luni/src/main/java/javax/net/ssl/HandshakeCompletedListener.java create mode 100644 luni/src/main/java/javax/net/ssl/HostnameVerifier.java create mode 100644 luni/src/main/java/javax/net/ssl/HttpsURLConnection.java create mode 100644 luni/src/main/java/javax/net/ssl/KeyManager.java create mode 100644 luni/src/main/java/javax/net/ssl/KeyManagerFactory.java create mode 100644 luni/src/main/java/javax/net/ssl/KeyManagerFactorySpi.java create mode 100644 luni/src/main/java/javax/net/ssl/KeyStoreBuilderParameters.java create mode 100644 luni/src/main/java/javax/net/ssl/ManagerFactoryParameters.java create mode 100644 luni/src/main/java/javax/net/ssl/SSLContext.java create mode 100644 luni/src/main/java/javax/net/ssl/SSLContextSpi.java create mode 100644 luni/src/main/java/javax/net/ssl/SSLEngine.java create mode 100644 luni/src/main/java/javax/net/ssl/SSLEngineResult.java create mode 100644 luni/src/main/java/javax/net/ssl/SSLException.java create mode 100644 luni/src/main/java/javax/net/ssl/SSLHandshakeException.java create mode 100644 luni/src/main/java/javax/net/ssl/SSLKeyException.java create mode 100644 luni/src/main/java/javax/net/ssl/SSLPeerUnverifiedException.java create mode 100644 luni/src/main/java/javax/net/ssl/SSLPermission.java create mode 100644 luni/src/main/java/javax/net/ssl/SSLProtocolException.java create mode 100644 luni/src/main/java/javax/net/ssl/SSLServerSocket.java create mode 100644 luni/src/main/java/javax/net/ssl/SSLServerSocketFactory.java create mode 100644 luni/src/main/java/javax/net/ssl/SSLSession.java create mode 100644 luni/src/main/java/javax/net/ssl/SSLSessionBindingEvent.java create mode 100644 luni/src/main/java/javax/net/ssl/SSLSessionBindingListener.java create mode 100644 luni/src/main/java/javax/net/ssl/SSLSessionContext.java create mode 100644 luni/src/main/java/javax/net/ssl/SSLSocket.java create mode 100644 luni/src/main/java/javax/net/ssl/SSLSocketFactory.java create mode 100644 luni/src/main/java/javax/net/ssl/TrustManager.java create mode 100644 luni/src/main/java/javax/net/ssl/TrustManagerFactory.java create mode 100644 luni/src/main/java/javax/net/ssl/TrustManagerFactorySpi.java create mode 100644 luni/src/main/java/javax/net/ssl/X509ExtendedKeyManager.java create mode 100644 luni/src/main/java/javax/net/ssl/X509KeyManager.java create mode 100644 luni/src/main/java/javax/net/ssl/X509TrustManager.java create mode 100644 luni/src/main/java/javax/net/ssl/package.html create mode 100644 luni/src/main/java/javax/xml/XMLConstants.java create mode 100644 luni/src/main/java/javax/xml/datatype/DatatypeConfigurationException.java create mode 100644 luni/src/main/java/javax/xml/datatype/DatatypeConstants.java create mode 100644 luni/src/main/java/javax/xml/datatype/DatatypeFactory.java create mode 100644 luni/src/main/java/javax/xml/datatype/Duration.java create mode 100644 luni/src/main/java/javax/xml/datatype/FactoryFinder.java create mode 100644 luni/src/main/java/javax/xml/datatype/SecuritySupport.java create mode 100644 luni/src/main/java/javax/xml/datatype/XMLGregorianCalendar.java create mode 100644 luni/src/main/java/javax/xml/datatype/package.html create mode 100644 luni/src/main/java/javax/xml/namespace/NamespaceContext.java create mode 100644 luni/src/main/java/javax/xml/namespace/QName.java create mode 100644 luni/src/main/java/javax/xml/namespace/package.html create mode 100644 luni/src/main/java/javax/xml/package.html create mode 100644 luni/src/main/java/javax/xml/parsers/DocumentBuilder.java create mode 100644 luni/src/main/java/javax/xml/parsers/DocumentBuilderFactory.java create mode 100644 luni/src/main/java/javax/xml/parsers/FactoryConfigurationError.java create mode 100644 luni/src/main/java/javax/xml/parsers/FilePathToURI.java create mode 100644 luni/src/main/java/javax/xml/parsers/ParserConfigurationException.java create mode 100644 luni/src/main/java/javax/xml/parsers/SAXParser.java create mode 100644 luni/src/main/java/javax/xml/parsers/SAXParserFactory.java create mode 100644 luni/src/main/java/javax/xml/parsers/SecuritySupport.java create mode 100644 luni/src/main/java/javax/xml/parsers/package.html create mode 100644 luni/src/main/java/javax/xml/transform/ErrorListener.java create mode 100644 luni/src/main/java/javax/xml/transform/OutputKeys.java create mode 100644 luni/src/main/java/javax/xml/transform/Result.java create mode 100644 luni/src/main/java/javax/xml/transform/SecuritySupport.java create mode 100644 luni/src/main/java/javax/xml/transform/Source.java create mode 100644 luni/src/main/java/javax/xml/transform/SourceLocator.java create mode 100644 luni/src/main/java/javax/xml/transform/Templates.java create mode 100644 luni/src/main/java/javax/xml/transform/Transformer.java create mode 100644 luni/src/main/java/javax/xml/transform/TransformerConfigurationException.java create mode 100644 luni/src/main/java/javax/xml/transform/TransformerException.java create mode 100644 luni/src/main/java/javax/xml/transform/TransformerFactory.java create mode 100644 luni/src/main/java/javax/xml/transform/TransformerFactoryConfigurationError.java create mode 100644 luni/src/main/java/javax/xml/transform/URIResolver.java create mode 100644 luni/src/main/java/javax/xml/transform/dom/DOMLocator.java create mode 100644 luni/src/main/java/javax/xml/transform/dom/DOMResult.java create mode 100644 luni/src/main/java/javax/xml/transform/dom/DOMSource.java create mode 100644 luni/src/main/java/javax/xml/transform/dom/package.html create mode 100644 luni/src/main/java/javax/xml/transform/overview.html create mode 100644 luni/src/main/java/javax/xml/transform/package.html create mode 100644 luni/src/main/java/javax/xml/transform/sax/SAXResult.java create mode 100644 luni/src/main/java/javax/xml/transform/sax/SAXSource.java create mode 100644 luni/src/main/java/javax/xml/transform/sax/SAXTransformerFactory.java create mode 100644 luni/src/main/java/javax/xml/transform/sax/TemplatesHandler.java create mode 100644 luni/src/main/java/javax/xml/transform/sax/TransformerHandler.java create mode 100644 luni/src/main/java/javax/xml/transform/sax/package.html create mode 100644 luni/src/main/java/javax/xml/transform/stream/FilePathToURI.java create mode 100644 luni/src/main/java/javax/xml/transform/stream/StreamResult.java create mode 100644 luni/src/main/java/javax/xml/transform/stream/StreamSource.java create mode 100644 luni/src/main/java/javax/xml/transform/stream/package.html create mode 100644 luni/src/main/java/javax/xml/validation/Schema.java create mode 100644 luni/src/main/java/javax/xml/validation/SchemaFactory.java create mode 100644 luni/src/main/java/javax/xml/validation/SchemaFactoryFinder.java create mode 100644 luni/src/main/java/javax/xml/validation/SchemaFactoryLoader.java create mode 100644 luni/src/main/java/javax/xml/validation/SecuritySupport.java create mode 100644 luni/src/main/java/javax/xml/validation/TypeInfoProvider.java create mode 100644 luni/src/main/java/javax/xml/validation/Validator.java create mode 100644 luni/src/main/java/javax/xml/validation/ValidatorHandler.java create mode 100644 luni/src/main/java/javax/xml/validation/package.html create mode 100644 luni/src/main/java/javax/xml/xpath/SecuritySupport.java create mode 100644 luni/src/main/java/javax/xml/xpath/XPath.java create mode 100644 luni/src/main/java/javax/xml/xpath/XPathConstants.java create mode 100644 luni/src/main/java/javax/xml/xpath/XPathException.java create mode 100644 luni/src/main/java/javax/xml/xpath/XPathExpression.java create mode 100644 luni/src/main/java/javax/xml/xpath/XPathExpressionException.java create mode 100644 luni/src/main/java/javax/xml/xpath/XPathFactory.java create mode 100644 luni/src/main/java/javax/xml/xpath/XPathFactoryConfigurationException.java create mode 100644 luni/src/main/java/javax/xml/xpath/XPathFactoryFinder.java create mode 100644 luni/src/main/java/javax/xml/xpath/XPathFunction.java create mode 100644 luni/src/main/java/javax/xml/xpath/XPathFunctionException.java create mode 100644 luni/src/main/java/javax/xml/xpath/XPathFunctionResolver.java create mode 100644 luni/src/main/java/javax/xml/xpath/XPathVariableResolver.java create mode 100644 luni/src/main/java/javax/xml/xpath/package.html create mode 100644 luni/src/main/java/org/apache/harmony/kernel/vm/LangAccess.java create mode 100644 luni/src/main/java/org/apache/harmony/kernel/vm/ReflectionAccess.java create mode 100644 luni/src/main/java/org/apache/harmony/kernel/vm/StringUtils.java create mode 100644 luni/src/main/java/org/apache/harmony/kernel/vm/VM.java create mode 100644 luni/src/main/java/org/apache/harmony/lang/annotation/AnnotationFactory.java create mode 100644 luni/src/main/java/org/apache/harmony/lang/annotation/AnnotationMember.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/ExpatAttributes.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/ExpatException.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/ExpatParser.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/ExpatPullParser.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/ExpatReader.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/AttrImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/CDATASectionImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/CharacterDataImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/CommentImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/DOMConfigurationImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/DOMImplementationImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/DocumentFragmentImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/DocumentImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/DocumentTypeImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/ElementImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/EntityImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/EntityReferenceImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/InnerNodeImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/LeafNodeImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/NamedNodeMapImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/NodeImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/NodeListImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/NotationImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/ProcessingInstructionImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/dom/TextImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderFactoryImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/parsers/SAXParserFactoryImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xml/parsers/SAXParserImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/AbstractSessionContext.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/AlertException.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/AlertProtocol.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/Appendable.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateMessage.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateRequest.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateVerify.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHello.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientKeyExchange.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientSessionContext.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ConnectionState.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ConnectionStateSSLv3.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ConnectionStateTLS.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ContentType.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/DHParameters.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/DataStream.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/DelegatedTask.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/DigitalSignature.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfBufferException.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfSourceException.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/FileClientSessionCache.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/Finished.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/Handshake.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeIODataStream.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeProtocol.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/HelloRequest.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/JSSEProvider.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerFactoryImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/Logger.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/Message.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/NativeCrypto.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLMessageDigest.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLMessageDigestJDK.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketFactoryImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSessionImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSignature.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketFactoryImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImplWrapper.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/PRF.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ProtocolVersion.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLBufferedInput.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLClientSessionCache.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLContextImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineAppData.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineDataStream.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLInputStream.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParameters.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLRecordProtocol.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSessionCache.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLStreamedInput.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLv3Constants.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHello.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHelloDone.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerKeyExchange.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerSessionContext.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/TrustManagerFactoryImpl.java create mode 100644 luni/src/main/java/org/apache/harmony/xnet/provider/jsse/TrustManagerImpl.java create mode 100644 luni/src/main/java/org/apache/xalan/Version.java create mode 100644 luni/src/main/java/org/apache/xalan/Version.src create mode 100644 luni/src/main/java/org/apache/xalan/extensions/ExpressionContext.java create mode 100644 luni/src/main/java/org/apache/xalan/extensions/ExpressionVisitor.java create mode 100644 luni/src/main/java/org/apache/xalan/extensions/ExtensionHandler.java create mode 100644 luni/src/main/java/org/apache/xalan/extensions/ExtensionNamespaceSupport.java create mode 100644 luni/src/main/java/org/apache/xalan/extensions/ExtensionNamespacesManager.java create mode 100644 luni/src/main/java/org/apache/xalan/extensions/ExtensionsTable.java create mode 100755 luni/src/main/java/org/apache/xalan/extensions/ObjectFactory.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorAttributeSet.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorCharacters.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorDecimalFormat.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorExsltFuncResult.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorExsltFunction.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorGlobalParamDecl.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorGlobalVariableDecl.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorImport.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorInclude.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorKey.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorLRE.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorNamespaceAlias.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorOutputElem.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorPreserveSpace.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorStripSpace.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorStylesheetDoc.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorStylesheetElement.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorTemplate.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorTemplateElem.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorText.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/ProcessorUnknown.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/StylesheetHandler.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/TransformerFactoryImpl.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/WhitespaceInfoPaths.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/XSLProcessorVersion.src create mode 100644 luni/src/main/java/org/apache/xalan/processor/XSLTAttributeDef.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/XSLTElementDef.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/XSLTElementProcessor.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/XSLTSchema.java create mode 100644 luni/src/main/java/org/apache/xalan/processor/package.html create mode 100644 luni/src/main/java/org/apache/xalan/res/XSLMessages.java create mode 100644 luni/src/main/java/org/apache/xalan/res/XSLTErrorResources.java create mode 100644 luni/src/main/java/org/apache/xalan/res/XSLTInfo.properties create mode 100644 luni/src/main/java/org/apache/xalan/res/package.html create mode 100644 luni/src/main/java/org/apache/xalan/serialize/SerializerUtils.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/AVT.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/AVTPart.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/AVTPartSimple.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/AVTPartXPath.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/AbsPathChecker.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/Constants.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/DecimalFormatProperties.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemApplyImport.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemApplyTemplates.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemAttribute.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemAttributeSet.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemCallTemplate.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemChoose.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemComment.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemCopy.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemCopyOf.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemElement.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemEmpty.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemExsltFuncResult.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemExsltFunction.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemExtensionCall.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemExtensionDecl.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemExtensionScript.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemFallback.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemForEach.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemIf.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemLiteralResult.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemMessage.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemNumber.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemOtherwise.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemPI.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemParam.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemSort.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemTemplate.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemTemplateElement.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemText.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemTextLiteral.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemUnknown.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemUse.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemValueOf.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemVariable.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemVariablePsuedo.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemWhen.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/ElemWithParam.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/FuncDocument.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/FuncFormatNumb.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/FuncKey.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/KeyDeclaration.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/NamespaceAlias.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/OutputProperties.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/RedundentExprEliminator.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/Stylesheet.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/StylesheetComposed.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/StylesheetRoot.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/TemplateList.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/TemplateSubPatternAssociation.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/VarNameCollector.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/WhiteSpaceInfo.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/XMLNSDecl.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/XSLTVisitable.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/XSLTVisitor.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/XUnresolvedVariable.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/XUnresolvedVariableSimple.java create mode 100644 luni/src/main/java/org/apache/xalan/templates/package.html create mode 100644 luni/src/main/java/org/apache/xalan/transformer/ClonerToResultTree.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/Counter.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/CountersTable.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/DecimalToRoman.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/KeyIterator.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/KeyManager.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/KeyTable.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/MsgMgr.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/NodeSortKey.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/NodeSorter.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/SerializerSwitcher.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/TrAXFilter.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/TransformState.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/TransformerClient.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/TransformerHandlerImpl.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/TransformerIdentityImpl.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/TransformerImpl.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/TreeWalker2Result.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/XalanProperties.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/XalanTransformState.java create mode 100644 luni/src/main/java/org/apache/xalan/transformer/package.html create mode 100644 luni/src/main/java/org/apache/xalan/xslt/EnvironmentCheck.java create mode 100755 luni/src/main/java/org/apache/xalan/xslt/ObjectFactory.java create mode 100755 luni/src/main/java/org/apache/xalan/xslt/SecuritySupport.java create mode 100755 luni/src/main/java/org/apache/xalan/xslt/SecuritySupport12.java create mode 100644 luni/src/main/java/org/apache/xalan/xslt/package.html create mode 100644 luni/src/main/java/org/apache/xml/dtm/Axis.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/DTM.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/DTMAxisIterator.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/DTMAxisTraverser.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/DTMConfigurationException.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/DTMDOMException.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/DTMException.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/DTMFilter.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/DTMIterator.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/DTMManager.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/DTMWSFilter.java create mode 100755 luni/src/main/java/org/apache/xml/dtm/ObjectFactory.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/SecuritySupport.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/SecuritySupport12.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/CoroutineManager.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/DTMAxisIterNodeList.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/DTMChildIterNodeList.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBase.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseTraversers.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/DTMNodeIterator.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/DTMNodeList.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/DTMNodeListBase.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/DTMStringPool.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/DTMTreeWalker.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/ExpandedNameTable.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/ExtendedType.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/NodeLocator.java create mode 100755 luni/src/main/java/org/apache/xml/dtm/ref/SecuritySupport.java create mode 100755 luni/src/main/java/org/apache/xml/dtm/ref/SecuritySupport12.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java create mode 100644 luni/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2RTFDTM.java create mode 100644 luni/src/main/java/org/apache/xml/res/XMLErrorResources.java create mode 100644 luni/src/main/java/org/apache/xml/res/XMLMessages.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/AttributesImplSerializer.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/CharInfo.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/DOM3Serializer.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/DOMSerializer.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/ElemContext.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/ElemDesc.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/EncodingInfo.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/Encodings.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/Encodings.properties create mode 100644 luni/src/main/java/org/apache/xml/serializer/ExtendedContentHandler.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/ExtendedLexicalHandler.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/HTMLEntities.properties create mode 100644 luni/src/main/java/org/apache/xml/serializer/Method.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/NamespaceMappings.java create mode 100755 luni/src/main/java/org/apache/xml/serializer/ObjectFactory.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/OutputPropertiesFactory.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/OutputPropertyUtils.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/SecuritySupport.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/SecuritySupport12.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/SerializationHandler.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/Serializer.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/SerializerBase.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/SerializerConstants.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/SerializerFactory.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/SerializerTrace.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/SerializerTraceWriter.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/ToHTMLStream.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/ToSAXHandler.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/ToStream.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/ToTextSAXHandler.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/ToTextStream.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/ToUnknownStream.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/ToXMLSAXHandler.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/ToXMLStream.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/TransformStateSetter.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/TreeWalker.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/Version.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/Version.src create mode 100644 luni/src/main/java/org/apache/xml/serializer/WriterChain.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/WriterToASCI.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/WriterToUTF8Buffered.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/XMLEntities.properties create mode 100644 luni/src/main/java/org/apache/xml/serializer/XSLOutputAttributes.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/dom3/DOM3TreeWalker.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/dom3/DOMConstants.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/dom3/DOMErrorHandlerImpl.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/dom3/DOMErrorImpl.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/dom3/DOMLocatorImpl.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/dom3/DOMOutputImpl.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/dom3/DOMStringListImpl.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/dom3/LSSerializerImpl.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/dom3/NamespaceSupport.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/output_html.properties create mode 100644 luni/src/main/java/org/apache/xml/serializer/output_text.properties create mode 100644 luni/src/main/java/org/apache/xml/serializer/output_unknown.properties create mode 100644 luni/src/main/java/org/apache/xml/serializer/output_xml.properties create mode 100644 luni/src/main/java/org/apache/xml/serializer/package.html create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/AttList.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/DOM2Helper.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/Messages.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/MsgKey.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_ca.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_cs.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_de.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_en.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_es.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_fr.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_hu.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_it.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_ja.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_ko.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_pl.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_pt_BR.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_ru.java create mode 100755 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_sk.java create mode 100755 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_sl.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_sv.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_tr.java create mode 100755 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_zh.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_zh_CN.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_zh_TW.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/StringToIntTable.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/SystemIDResolver.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/URI.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/Utils.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/WrappedRuntimeException.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/XML11Char.java create mode 100644 luni/src/main/java/org/apache/xml/serializer/utils/XMLChar.java create mode 100644 luni/src/main/java/org/apache/xml/utils/AttList.java create mode 100644 luni/src/main/java/org/apache/xml/utils/BoolStack.java create mode 100644 luni/src/main/java/org/apache/xml/utils/Constants.java create mode 100644 luni/src/main/java/org/apache/xml/utils/DOM2Helper.java create mode 100644 luni/src/main/java/org/apache/xml/utils/DOMBuilder.java create mode 100644 luni/src/main/java/org/apache/xml/utils/DOMHelper.java create mode 100644 luni/src/main/java/org/apache/xml/utils/DOMOrder.java create mode 100644 luni/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java create mode 100644 luni/src/main/java/org/apache/xml/utils/FastStringBuffer.java create mode 100644 luni/src/main/java/org/apache/xml/utils/IntStack.java create mode 100644 luni/src/main/java/org/apache/xml/utils/IntVector.java create mode 100644 luni/src/main/java/org/apache/xml/utils/NSInfo.java create mode 100644 luni/src/main/java/org/apache/xml/utils/NameSpace.java create mode 100644 luni/src/main/java/org/apache/xml/utils/NamespaceSupport2.java create mode 100644 luni/src/main/java/org/apache/xml/utils/NodeConsumer.java create mode 100644 luni/src/main/java/org/apache/xml/utils/NodeVector.java create mode 100644 luni/src/main/java/org/apache/xml/utils/ObjectFactory.java create mode 100644 luni/src/main/java/org/apache/xml/utils/ObjectPool.java create mode 100644 luni/src/main/java/org/apache/xml/utils/ObjectStack.java create mode 100644 luni/src/main/java/org/apache/xml/utils/ObjectVector.java create mode 100644 luni/src/main/java/org/apache/xml/utils/PrefixResolver.java create mode 100644 luni/src/main/java/org/apache/xml/utils/PrefixResolverDefault.java create mode 100644 luni/src/main/java/org/apache/xml/utils/QName.java create mode 100644 luni/src/main/java/org/apache/xml/utils/SAXSourceLocator.java create mode 100644 luni/src/main/java/org/apache/xml/utils/SecuritySupport.java create mode 100644 luni/src/main/java/org/apache/xml/utils/SecuritySupport12.java create mode 100644 luni/src/main/java/org/apache/xml/utils/StopParseException.java create mode 100644 luni/src/main/java/org/apache/xml/utils/StringBufferPool.java create mode 100644 luni/src/main/java/org/apache/xml/utils/StringToIntTable.java create mode 100644 luni/src/main/java/org/apache/xml/utils/StringVector.java create mode 100644 luni/src/main/java/org/apache/xml/utils/StylesheetPIHandler.java create mode 100644 luni/src/main/java/org/apache/xml/utils/SuballocatedIntVector.java create mode 100644 luni/src/main/java/org/apache/xml/utils/SystemIDResolver.java create mode 100644 luni/src/main/java/org/apache/xml/utils/ThreadControllerWrapper.java create mode 100644 luni/src/main/java/org/apache/xml/utils/TreeWalker.java create mode 100644 luni/src/main/java/org/apache/xml/utils/URI.java create mode 100644 luni/src/main/java/org/apache/xml/utils/UnImplNode.java create mode 100644 luni/src/main/java/org/apache/xml/utils/WrappedRuntimeException.java create mode 100644 luni/src/main/java/org/apache/xml/utils/XML11Char.java create mode 100644 luni/src/main/java/org/apache/xml/utils/XMLChar.java create mode 100644 luni/src/main/java/org/apache/xml/utils/XMLCharacterRecognizer.java create mode 100644 luni/src/main/java/org/apache/xml/utils/XMLReaderManager.java create mode 100644 luni/src/main/java/org/apache/xml/utils/XMLString.java create mode 100644 luni/src/main/java/org/apache/xml/utils/XMLStringDefault.java create mode 100644 luni/src/main/java/org/apache/xml/utils/XMLStringFactory.java create mode 100644 luni/src/main/java/org/apache/xml/utils/package.html create mode 100755 luni/src/main/java/org/apache/xml/utils/res/CharArrayWrapper.java create mode 100755 luni/src/main/java/org/apache/xml/utils/res/IntArrayWrapper.java create mode 100755 luni/src/main/java/org/apache/xml/utils/res/LongArrayWrapper.java create mode 100755 luni/src/main/java/org/apache/xml/utils/res/StringArrayWrapper.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResourceBundle.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResourceBundleBase.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResources_cy.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResources_de.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResources_el.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResources_en.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResources_es.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResources_fr.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResources_he.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResources_hy.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResources_it.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResources_ja_JP_A.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResources_ja_JP_HA.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResources_ja_JP_HI.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResources_ja_JP_I.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResources_ka.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResources_ko.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResources_sv.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResources_zh_CN.java create mode 100644 luni/src/main/java/org/apache/xml/utils/res/XResources_zh_TW.java create mode 100644 luni/src/main/java/org/apache/xpath/Arg.java create mode 100644 luni/src/main/java/org/apache/xpath/CachedXPathAPI.java create mode 100644 luni/src/main/java/org/apache/xpath/Expression.java create mode 100644 luni/src/main/java/org/apache/xpath/ExpressionNode.java create mode 100644 luni/src/main/java/org/apache/xpath/ExpressionOwner.java create mode 100644 luni/src/main/java/org/apache/xpath/ExtensionsProvider.java create mode 100644 luni/src/main/java/org/apache/xpath/FoundIndex.java create mode 100644 luni/src/main/java/org/apache/xpath/NodeSet.java create mode 100644 luni/src/main/java/org/apache/xpath/NodeSetDTM.java create mode 100644 luni/src/main/java/org/apache/xpath/SourceTree.java create mode 100644 luni/src/main/java/org/apache/xpath/SourceTreeManager.java create mode 100644 luni/src/main/java/org/apache/xpath/VariableStack.java create mode 100644 luni/src/main/java/org/apache/xpath/WhitespaceStrippingElementMatcher.java create mode 100644 luni/src/main/java/org/apache/xpath/XPath.java create mode 100644 luni/src/main/java/org/apache/xpath/XPathAPI.java create mode 100644 luni/src/main/java/org/apache/xpath/XPathContext.java create mode 100644 luni/src/main/java/org/apache/xpath/XPathException.java create mode 100644 luni/src/main/java/org/apache/xpath/XPathFactory.java create mode 100644 luni/src/main/java/org/apache/xpath/XPathProcessorException.java create mode 100644 luni/src/main/java/org/apache/xpath/XPathVisitable.java create mode 100644 luni/src/main/java/org/apache/xpath/XPathVisitor.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/AttributeIterator.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/AxesWalker.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/BasicTestIterator.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/ChildIterator.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/ChildTestIterator.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/ContextNodeList.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/DescendantIterator.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/FilterExprIterator.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/FilterExprIteratorSimple.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/FilterExprWalker.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/HasPositionalPredChecker.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/IteratorPool.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/LocPathIterator.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/MatchPatternIterator.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/NodeSequence.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/OneStepIterator.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/OneStepIteratorForward.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/PathComponent.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/PredicatedNodeTest.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/RTFIterator.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/ReverseAxesWalker.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/SelfIteratorNoPredicate.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/SubContextList.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/UnionChildIterator.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/UnionPathIterator.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/WalkerFactory.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/WalkingIterator.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/WalkingIteratorSorted.java create mode 100644 luni/src/main/java/org/apache/xpath/axes/package.html create mode 100644 luni/src/main/java/org/apache/xpath/compiler/Compiler.java create mode 100644 luni/src/main/java/org/apache/xpath/compiler/FunctionTable.java create mode 100644 luni/src/main/java/org/apache/xpath/compiler/Keywords.java create mode 100644 luni/src/main/java/org/apache/xpath/compiler/Lexer.java create mode 100644 luni/src/main/java/org/apache/xpath/compiler/OpCodes.java create mode 100644 luni/src/main/java/org/apache/xpath/compiler/OpMap.java create mode 100644 luni/src/main/java/org/apache/xpath/compiler/OpMapVector.java create mode 100644 luni/src/main/java/org/apache/xpath/compiler/PsuedoNames.java create mode 100644 luni/src/main/java/org/apache/xpath/compiler/XPathDumper.java create mode 100644 luni/src/main/java/org/apache/xpath/compiler/XPathParser.java create mode 100644 luni/src/main/java/org/apache/xpath/compiler/package.html create mode 100644 luni/src/main/java/org/apache/xpath/domapi/XPathStylesheetDOM3Exception.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncBoolean.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncCeiling.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncConcat.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncContains.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncCount.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncCurrent.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncDoclocation.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncExtElementAvailable.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncExtFunction.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncExtFunctionAvailable.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncFalse.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncFloor.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncGenerateId.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncId.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncLang.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncLast.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncLocalPart.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncNamespace.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncNormalizeSpace.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncNot.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncNumber.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncPosition.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncQname.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncRound.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncStartsWith.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncString.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncStringLength.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncSubstring.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncSubstringAfter.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncSubstringBefore.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncSum.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncSystemProperty.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncTranslate.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncTrue.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FuncUnparsedEntityURI.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/Function.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/Function2Args.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/Function3Args.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FunctionDef1Arg.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FunctionMultiArgs.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/FunctionOneArg.java create mode 100755 luni/src/main/java/org/apache/xpath/functions/ObjectFactory.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/SecuritySupport.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/SecuritySupport12.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/WrongNumberArgsException.java create mode 100644 luni/src/main/java/org/apache/xpath/functions/package.html create mode 100644 luni/src/main/java/org/apache/xpath/jaxp/JAXPExtensionsProvider.java create mode 100644 luni/src/main/java/org/apache/xpath/jaxp/JAXPPrefixResolver.java create mode 100644 luni/src/main/java/org/apache/xpath/jaxp/JAXPVariableStack.java create mode 100644 luni/src/main/java/org/apache/xpath/jaxp/XPathExpressionImpl.java create mode 100644 luni/src/main/java/org/apache/xpath/jaxp/XPathFactoryImpl.java create mode 100644 luni/src/main/java/org/apache/xpath/jaxp/XPathImpl.java create mode 100755 luni/src/main/java/org/apache/xpath/objects/DTMXRTreeFrag.java create mode 100644 luni/src/main/java/org/apache/xpath/objects/XBoolean.java create mode 100644 luni/src/main/java/org/apache/xpath/objects/XBooleanStatic.java create mode 100644 luni/src/main/java/org/apache/xpath/objects/XMLStringFactoryImpl.java create mode 100644 luni/src/main/java/org/apache/xpath/objects/XNodeSet.java create mode 100644 luni/src/main/java/org/apache/xpath/objects/XNodeSetForDOM.java create mode 100644 luni/src/main/java/org/apache/xpath/objects/XNull.java create mode 100644 luni/src/main/java/org/apache/xpath/objects/XNumber.java create mode 100644 luni/src/main/java/org/apache/xpath/objects/XObject.java create mode 100644 luni/src/main/java/org/apache/xpath/objects/XObjectFactory.java create mode 100644 luni/src/main/java/org/apache/xpath/objects/XRTreeFrag.java create mode 100644 luni/src/main/java/org/apache/xpath/objects/XRTreeFragSelectWrapper.java create mode 100644 luni/src/main/java/org/apache/xpath/objects/XString.java create mode 100644 luni/src/main/java/org/apache/xpath/objects/XStringForChars.java create mode 100644 luni/src/main/java/org/apache/xpath/objects/XStringForFSB.java create mode 100644 luni/src/main/java/org/apache/xpath/objects/package.html create mode 100644 luni/src/main/java/org/apache/xpath/operations/And.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/Bool.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/Div.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/Equals.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/Gt.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/Gte.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/Lt.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/Lte.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/Minus.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/Mod.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/Mult.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/Neg.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/NotEquals.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/Number.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/Operation.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/Or.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/Plus.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/Quo.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/String.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/UnaryOperation.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/Variable.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/VariableSafeAbsRef.java create mode 100644 luni/src/main/java/org/apache/xpath/operations/package.html create mode 100644 luni/src/main/java/org/apache/xpath/package.html create mode 100644 luni/src/main/java/org/apache/xpath/patterns/ContextMatchStepPattern.java create mode 100644 luni/src/main/java/org/apache/xpath/patterns/FunctionPattern.java create mode 100644 luni/src/main/java/org/apache/xpath/patterns/NodeTest.java create mode 100644 luni/src/main/java/org/apache/xpath/patterns/NodeTestFilter.java create mode 100644 luni/src/main/java/org/apache/xpath/patterns/StepPattern.java create mode 100644 luni/src/main/java/org/apache/xpath/patterns/UnionPattern.java create mode 100644 luni/src/main/java/org/apache/xpath/patterns/package.html create mode 100644 luni/src/main/java/org/apache/xpath/res/XPATHErrorResources.java create mode 100644 luni/src/main/java/org/apache/xpath/res/XPATHMessages.java create mode 100644 luni/src/main/java/org/apache/xpath/res/package.html create mode 100644 luni/src/main/java/org/w3c/dom/Attr.java create mode 100644 luni/src/main/java/org/w3c/dom/CDATASection.java create mode 100644 luni/src/main/java/org/w3c/dom/CharacterData.java create mode 100644 luni/src/main/java/org/w3c/dom/Comment.java create mode 100644 luni/src/main/java/org/w3c/dom/DOMConfiguration.java create mode 100644 luni/src/main/java/org/w3c/dom/DOMError.java create mode 100644 luni/src/main/java/org/w3c/dom/DOMErrorHandler.java create mode 100644 luni/src/main/java/org/w3c/dom/DOMException.java create mode 100644 luni/src/main/java/org/w3c/dom/DOMImplementation.java create mode 100644 luni/src/main/java/org/w3c/dom/DOMImplementationList.java create mode 100644 luni/src/main/java/org/w3c/dom/DOMImplementationSource.java create mode 100644 luni/src/main/java/org/w3c/dom/DOMLocator.java create mode 100644 luni/src/main/java/org/w3c/dom/DOMStringList.java create mode 100644 luni/src/main/java/org/w3c/dom/Document.java create mode 100644 luni/src/main/java/org/w3c/dom/DocumentFragment.java create mode 100644 luni/src/main/java/org/w3c/dom/DocumentType.java create mode 100644 luni/src/main/java/org/w3c/dom/Element.java create mode 100644 luni/src/main/java/org/w3c/dom/Entity.java create mode 100644 luni/src/main/java/org/w3c/dom/EntityReference.java create mode 100644 luni/src/main/java/org/w3c/dom/NameList.java create mode 100644 luni/src/main/java/org/w3c/dom/NamedNodeMap.java create mode 100644 luni/src/main/java/org/w3c/dom/Node.java create mode 100644 luni/src/main/java/org/w3c/dom/NodeList.java create mode 100644 luni/src/main/java/org/w3c/dom/Notation.java create mode 100644 luni/src/main/java/org/w3c/dom/ProcessingInstruction.java create mode 100644 luni/src/main/java/org/w3c/dom/Text.java create mode 100644 luni/src/main/java/org/w3c/dom/TypeInfo.java create mode 100644 luni/src/main/java/org/w3c/dom/UserDataHandler.java create mode 100644 luni/src/main/java/org/w3c/dom/ls/DOMImplementationLS.java create mode 100644 luni/src/main/java/org/w3c/dom/ls/LSException.java create mode 100644 luni/src/main/java/org/w3c/dom/ls/LSInput.java create mode 100644 luni/src/main/java/org/w3c/dom/ls/LSOutput.java create mode 100644 luni/src/main/java/org/w3c/dom/ls/LSParser.java create mode 100644 luni/src/main/java/org/w3c/dom/ls/LSParserFilter.java create mode 100644 luni/src/main/java/org/w3c/dom/ls/LSResourceResolver.java create mode 100644 luni/src/main/java/org/w3c/dom/ls/LSSerializer.java create mode 100644 luni/src/main/java/org/w3c/dom/ls/LSSerializerFilter.java create mode 100644 luni/src/main/java/org/w3c/dom/package.html create mode 100644 luni/src/main/java/org/w3c/dom/traversal/NodeFilter.java create mode 100644 luni/src/main/java/org/w3c/dom/traversal/NodeIterator.java create mode 100644 luni/src/main/java/org/xml/sax/AttributeList.java create mode 100644 luni/src/main/java/org/xml/sax/Attributes.java create mode 100644 luni/src/main/java/org/xml/sax/ContentHandler.java create mode 100644 luni/src/main/java/org/xml/sax/DTDHandler.java create mode 100644 luni/src/main/java/org/xml/sax/DocumentHandler.java create mode 100644 luni/src/main/java/org/xml/sax/EntityResolver.java create mode 100644 luni/src/main/java/org/xml/sax/ErrorHandler.java create mode 100644 luni/src/main/java/org/xml/sax/HandlerBase.java create mode 100644 luni/src/main/java/org/xml/sax/InputSource.java create mode 100644 luni/src/main/java/org/xml/sax/Locator.java create mode 100644 luni/src/main/java/org/xml/sax/Parser.java create mode 100644 luni/src/main/java/org/xml/sax/SAXException.java create mode 100644 luni/src/main/java/org/xml/sax/SAXNotRecognizedException.java create mode 100644 luni/src/main/java/org/xml/sax/SAXNotSupportedException.java create mode 100644 luni/src/main/java/org/xml/sax/SAXParseException.java create mode 100644 luni/src/main/java/org/xml/sax/XMLFilter.java create mode 100644 luni/src/main/java/org/xml/sax/XMLReader.java create mode 100644 luni/src/main/java/org/xml/sax/ext/Attributes2.java create mode 100644 luni/src/main/java/org/xml/sax/ext/Attributes2Impl.java create mode 100644 luni/src/main/java/org/xml/sax/ext/DeclHandler.java create mode 100644 luni/src/main/java/org/xml/sax/ext/DefaultHandler2.java create mode 100644 luni/src/main/java/org/xml/sax/ext/EntityResolver2.java create mode 100644 luni/src/main/java/org/xml/sax/ext/LexicalHandler.java create mode 100644 luni/src/main/java/org/xml/sax/ext/Locator2.java create mode 100644 luni/src/main/java/org/xml/sax/ext/Locator2Impl.java create mode 100644 luni/src/main/java/org/xml/sax/ext/package.html create mode 100644 luni/src/main/java/org/xml/sax/helpers/AttributeListImpl.java create mode 100644 luni/src/main/java/org/xml/sax/helpers/AttributesImpl.java create mode 100644 luni/src/main/java/org/xml/sax/helpers/DefaultHandler.java create mode 100644 luni/src/main/java/org/xml/sax/helpers/LocatorImpl.java create mode 100644 luni/src/main/java/org/xml/sax/helpers/NamespaceSupport.java create mode 100644 luni/src/main/java/org/xml/sax/helpers/NewInstance.java create mode 100644 luni/src/main/java/org/xml/sax/helpers/ParserAdapter.java create mode 100644 luni/src/main/java/org/xml/sax/helpers/ParserFactory.java create mode 100644 luni/src/main/java/org/xml/sax/helpers/XMLFilterImpl.java create mode 100644 luni/src/main/java/org/xml/sax/helpers/XMLReaderAdapter.java create mode 100644 luni/src/main/java/org/xml/sax/helpers/XMLReaderFactory.java create mode 100644 luni/src/main/java/org/xml/sax/helpers/package.html create mode 100644 luni/src/main/java/org/xml/sax/package.html create mode 100644 luni/src/main/native/BidiWrapper.cpp create mode 100644 luni/src/main/native/ErrorCode.cpp create mode 100644 luni/src/main/native/ErrorCode.h create mode 100644 luni/src/main/native/ICU.cpp create mode 100644 luni/src/main/native/NativeBreakIterator.cpp create mode 100644 luni/src/main/native/NativeCollation.cpp create mode 100644 luni/src/main/native/NativeConverter.cpp create mode 100644 luni/src/main/native/NativeDecimalFormat.cpp create mode 100644 luni/src/main/native/NativeIDN.cpp create mode 100644 luni/src/main/native/NativeNormalizer.cpp create mode 100644 luni/src/main/native/NativeRegEx.cpp create mode 100644 luni/src/main/native/Register.cpp create mode 100644 luni/src/main/native/ScopedJavaUnicodeString.h create mode 100644 luni/src/main/native/UCharacter.cpp create mode 100644 luni/src/main/native/java_lang_ProcessManager.cpp create mode 100644 luni/src/main/native/java_lang_System.cpp create mode 100644 luni/src/main/native/org_apache_harmony_xml_ExpatParser.cpp create mode 100644 luni/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp create mode 100644 luni/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/ClientSessionContextTest.java create mode 100644 luni/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/FakeSession.java create mode 100644 luni/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/FileClientSessionCacheTest.java create mode 100644 luni/src/test/java/java/lang/reflect/AllTests.java create mode 100644 luni/src/test/java/java/lang/reflect/ConstructorTest.java create mode 100644 luni/src/test/java/java/lang/reflect/MethodTest.java create mode 100644 luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/AbstractPreferencesTest.java create mode 100644 luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/AllTests.java create mode 100644 luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/BackingStoreExceptionTest.java create mode 100644 luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/FilePreferencesImplTest.java create mode 100644 luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/InvalidPreferencesFormatExceptionTest.java create mode 100644 luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/MockAbstractPreferences.java create mode 100644 luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/MockNodeChangeListener.java create mode 100644 luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/MockPreferenceChangeListener.java create mode 100644 luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/MockSecurityManager.java create mode 100644 luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/NodeChangeEventTest.java create mode 100644 luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/NodeChangeListenerTest.java create mode 100644 luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferenceChangeEventTest.java create mode 100644 luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferenceChangeListenerTest.java create mode 100644 luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferencesFactoryTest.java create mode 100644 luni/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferencesTest.java create mode 100644 luni/src/test/java/org/apache/harmony/xml/AllTests.java create mode 100644 luni/src/test/java/org/apache/harmony/xml/ExpatParserTest.java create mode 100644 luni/src/test/java/org/apache/harmony/xml/JaxenXPathTestSuite.java create mode 100644 luni/src/test/java/org/apache/harmony/xml/NamespacedAttributesLookupTest.java create mode 100644 luni/src/test/java/org/apache/harmony/xml/XsltXPathConformanceTestSuite.java create mode 100644 luni/src/test/java/tests/api/javax/net/AllTests.java create mode 100644 luni/src/test/java/tests/api/javax/net/ServerSocketFactoryTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/SocketFactoryTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/AllTests.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/CertPathTrustManagerParametersTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/CertificatesToPlayWith.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/HandshakeCompletedEventTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/HostnameVerifierTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/HttpsURLConnectionTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/KeyManagerFactory1Test.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/KeyManagerFactory2Test.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/KeyManagerFactorySpiTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/KeyStoreBuilderParametersTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLContext1Test.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLContext2Test.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLContextSpiTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLEngineResultHandshakeStatusTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLEngineResultStatusTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLEngineResultTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLEngineTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLExceptionTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLHandshakeExceptionTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLKeyExceptionTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLPeerUnverifiedExceptionTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLPermissionTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLProtocolExceptionTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLServerSocketFactoryTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLServerSocketTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLSessionBindingEventTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLSessionBindingListenerTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLSessionContextTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLSessionTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLSocketFactoryTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/SSLSocketTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/TrustManagerFactory1Test.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/TrustManagerFactory2Test.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/TrustManagerFactorySpiTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/X509ExtendedKeyManagerTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/X509KeyManagerTest.java create mode 100644 luni/src/test/java/tests/api/javax/net/ssl/X509TrustManagerTest.java create mode 100644 luni/src/test/java/tests/api/javax/xml/parsers/AllTests.java create mode 100644 luni/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderFactoryTest.java create mode 100644 luni/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderTest.java create mode 100644 luni/src/test/java/tests/api/javax/xml/parsers/FactoryConfigurationErrorTest.java create mode 100644 luni/src/test/java/tests/api/javax/xml/parsers/ParserConfigurationExceptionTest.java create mode 100644 luni/src/test/java/tests/api/javax/xml/parsers/SAXParserFactoryTest.java create mode 100644 luni/src/test/java/tests/api/javax/xml/parsers/SAXParserTest.java create mode 100644 luni/src/test/java/tests/api/javax/xml/parsers/SAXParserTestSupport.java create mode 100644 luni/src/test/java/tests/api/org/apache/harmony/kernel/dalvik/AllTests.java create mode 100644 luni/src/test/java/tests/api/org/apache/harmony/kernel/dalvik/ThreadsTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/AllTests.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/HandlerBaseTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/InputSourceTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/SAXExceptionTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/SAXNotRecognizedExceptionTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/SAXNotSupportedExceptionTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/SAXParseExceptionTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/ext/AllTests.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/ext/Attributes2ImplTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/ext/DefaultHandler2Test.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/ext/Locator2ImplTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/helpers/AllTests.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/helpers/AttributeListImplTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/helpers/AttributesImplTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/helpers/DefaultHandlerTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/helpers/LocatorImplTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/helpers/NamespaceSupportTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/helpers/ParserAdapterTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/helpers/ParserFactoryTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/helpers/XMLFilterImplTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/helpers/XMLReaderAdapterTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/helpers/XMLReaderFactoryTest.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/support/BrokenInputStream.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/support/DoNothingParser.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/support/DoNothingXMLReader.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/support/MethodLogger.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/support/MockFilter.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/support/MockHandler.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/support/MockParser.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/support/MockReader.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/support/MockResolver.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/support/NoAccessParser.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/support/NoAccessXMLReader.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/support/NoInstanceParser.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/support/NoInstanceXMLReader.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/support/NoSubclassParser.java create mode 100644 luni/src/test/java/tests/api/org/xml/sax/support/NoSubclassXMLReader.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/AllTests.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/AttrGetOwnerElement.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/CreateAttributeNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/CreateDocument.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/CreateDocumentType.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/CreateElementNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/DOMDocumentBuilderFactory.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/DOMImplementationCreateDocument.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/DOMImplementationCreateDocumentType.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/DOMImplementationHasFeature.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/DOMTestCase.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/DocumentBuilderSetting.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/DocumentBuilderSettingStrategy.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/DocumentCreateAttributeNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/DocumentCreateElementNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/DocumentGetElementsByTagnameNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/DocumentGeteEementById.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/DocumentImportNode.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/DocumentTypeInternalSubset.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/DocumentTypePublicId.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/DocumentTypeSystemId.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/ElementGetAttributeNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/ElementGetAttributeNodeNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/ElementGetElementsByTagNameNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/ElementHasAttribute.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/ElementHasAttributeNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/ElementRemoveAttributeNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/ElementSetAttributeNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/ElementSetAttributeNodeNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/GetAttributeNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/GetAttributeNodeNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/GetElementById.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/GetElementsByTagNameNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/GetNamedItemNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/HCEntitiesRemoveNamedItemNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/HCEntitiesSetNamedItemNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/HCNamedNodeMapInvalidType.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/HCNodeDocumentFragmentNormalize.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/HCNotationsRemoveNamedItemNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/HCNotationsSetNamedItemNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/HasAttribute.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/HasAttributeNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/HasAttributes.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/ImportNode.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/InternalSubset.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/IsSupported.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/LocalName.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/NamedNodeMapGetNamedItemNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/NamedNodeMapRemoveNamedItemNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/NamedNodeMapSetNamedItemNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/NamespaceURI.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/NodeGetLocalName.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/NodeGetNamespaceURI.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/NodeGetOwnerDocument.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/NodeGetPrefix.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/NodeHasAttributes.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/NodeIsSupported.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/NodeNormalize.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/NodeSetPrefix.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/Normalize.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/OwnerDocument.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/OwnerElement.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/Prefix.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/PublicId.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/RemoveAttributeNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/RemoveNamedItemNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/SetAttributeNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/SetAttributeNodeNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/SetNamedItemNS.java create mode 100644 luni/src/test/java/tests/org/w3c/dom/SystemId.java create mode 100644 luni/src/test/java/tests/prefs/AllTests.java create mode 100644 luni/src/test/java/tests/xml/AllTests.java create mode 100644 luni/src/test/java/tests/xml/DeclarationTest.java create mode 100644 luni/src/test/java/tests/xml/DomTest.java create mode 100644 luni/src/test/java/tests/xml/NodeTest.java create mode 100644 luni/src/test/java/tests/xml/NormalizeTest.java create mode 100644 luni/src/test/java/tests/xml/SaxTest.java create mode 100644 luni/src/test/java/tests/xml/SimpleBuilderTest.java create mode 100644 luni/src/test/java/tests/xml/SimpleParserTest.java create mode 100644 luni/src/test/java/tests/xnet/AllTests.java create mode 100644 luni/src/test/resources/SimpleBuilderTest.xml create mode 100644 luni/src/test/resources/SimpleParserTest.xml create mode 100644 luni/src/test/resources/hc_staff.xml create mode 100644 luni/src/test/resources/nwf/staff.dtd create mode 100644 luni/src/test/resources/nwf/staff.xml create mode 100644 luni/src/test/resources/out_dh/staff.out create mode 100644 luni/src/test/resources/out_hb/staff.out create mode 100644 luni/src/test/resources/prefs/java/util/prefs/userprefs-ascii.xml create mode 100644 luni/src/test/resources/prefs/java/util/prefs/userprefs-badencoding.xml create mode 100644 luni/src/test/resources/prefs/java/util/prefs/userprefs-badform.xml create mode 100644 luni/src/test/resources/prefs/java/util/prefs/userprefs-badtype.xml create mode 100644 luni/src/test/resources/prefs/java/util/prefs/userprefs-higherversion.xml create mode 100644 luni/src/test/resources/prefs/java/util/prefs/userprefs.xml create mode 100644 luni/src/test/resources/recipe.xml create mode 100644 luni/src/test/resources/recipe1.xml create mode 100644 luni/src/test/resources/recipt.dtd create mode 100644 luni/src/test/resources/recipt.xml create mode 100644 luni/src/test/resources/reciptWrong.xml create mode 100644 luni/src/test/resources/serialization/org/apache/harmony/prefs/tests/java/util/prefs/BackingStoreExceptionTest.golden.ser create mode 100644 luni/src/test/resources/serialization/org/apache/harmony/prefs/tests/java/util/prefs/InvalidPreferencesFormatExceptionTest.golden.ser create mode 100644 luni/src/test/resources/simple.xml create mode 100644 luni/src/test/resources/simple_ns.dtd create mode 100644 luni/src/test/resources/simple_ns.xml create mode 100644 luni/src/test/resources/staff.dtd create mode 100644 luni/src/test/resources/staff.xml create mode 100644 luni/src/test/resources/staff2.dtd create mode 100644 luni/src/test/resources/staff2.xml create mode 100644 luni/src/test/resources/staffEntRes.xml create mode 100644 luni/src/test/resources/staffNS.dtd create mode 100644 luni/src/test/resources/staffNS.xml create mode 100644 luni/src/test/resources/systemid.xml create mode 100644 luni/src/test/resources/systemid/recipt.dtd create mode 100644 luni/src/test/resources/systemid/staff.dtd create mode 100644 luni/src/test/resources/wf/staff.dtd create mode 100644 luni/src/test/resources/wf/staff.xml create mode 100644 luni/src/test/resources/wrong.xml create mode 100644 luni/src/test/resources/xhtml1-strict.dtd create mode 100644 luni/unicode-license.txt delete mode 100644 prefs/MODULE_LICENSE_APACHE2 delete mode 100644 prefs/src/main/java/java/util/prefs/AbstractPreferences.java delete mode 100644 prefs/src/main/java/java/util/prefs/BackingStoreException.java delete mode 100644 prefs/src/main/java/java/util/prefs/FilePreferencesFactoryImpl.java delete mode 100644 prefs/src/main/java/java/util/prefs/FilePreferencesImpl.java delete mode 100644 prefs/src/main/java/java/util/prefs/InvalidPreferencesFormatException.java delete mode 100644 prefs/src/main/java/java/util/prefs/NodeChangeEvent.java delete mode 100644 prefs/src/main/java/java/util/prefs/NodeChangeListener.java delete mode 100644 prefs/src/main/java/java/util/prefs/NodeSet.java delete mode 100644 prefs/src/main/java/java/util/prefs/PreferenceChangeEvent.java delete mode 100644 prefs/src/main/java/java/util/prefs/PreferenceChangeListener.java delete mode 100644 prefs/src/main/java/java/util/prefs/Preferences.java delete mode 100644 prefs/src/main/java/java/util/prefs/PreferencesFactory.java delete mode 100644 prefs/src/main/java/java/util/prefs/XMLParser.java delete mode 100644 prefs/src/main/java/java/util/prefs/package.html delete mode 100644 prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/AbstractPreferencesTest.java delete mode 100644 prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/AllTests.java delete mode 100644 prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/BackingStoreExceptionTest.java delete mode 100644 prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/FilePreferencesImplTest.java delete mode 100644 prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/InvalidPreferencesFormatExceptionTest.java delete mode 100644 prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/MockAbstractPreferences.java delete mode 100644 prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/MockNodeChangeListener.java delete mode 100644 prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/MockPreferenceChangeListener.java delete mode 100644 prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/MockSecurityManager.java delete mode 100644 prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/NodeChangeEventTest.java delete mode 100644 prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/NodeChangeListenerTest.java delete mode 100644 prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferenceChangeEventTest.java delete mode 100644 prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferenceChangeListenerTest.java delete mode 100644 prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferencesFactoryTest.java delete mode 100644 prefs/src/test/java/org/apache/harmony/prefs/tests/java/util/prefs/PreferencesTest.java delete mode 100644 prefs/src/test/java/tests/prefs/AllTests.java delete mode 100644 prefs/src/test/resources/prefs/java/util/prefs/userprefs-ascii.xml delete mode 100644 prefs/src/test/resources/prefs/java/util/prefs/userprefs-badencoding.xml delete mode 100644 prefs/src/test/resources/prefs/java/util/prefs/userprefs-badform.xml delete mode 100644 prefs/src/test/resources/prefs/java/util/prefs/userprefs-badtype.xml delete mode 100644 prefs/src/test/resources/prefs/java/util/prefs/userprefs-higherversion.xml delete mode 100644 prefs/src/test/resources/prefs/java/util/prefs/userprefs.xml delete mode 100644 prefs/src/test/resources/serialization/org/apache/harmony/prefs/tests/java/util/prefs/BackingStoreExceptionTest.golden.ser delete mode 100644 prefs/src/test/resources/serialization/org/apache/harmony/prefs/tests/java/util/prefs/InvalidPreferencesFormatExceptionTest.golden.ser delete mode 100644 security-kernel/MODULE_LICENSE_APACHE2 delete mode 100644 security-kernel/src/main/java/java/security/AccessControlContext.java delete mode 100644 security-kernel/src/main/java/java/security/AccessController.java delete mode 100644 x-net/MODULE_LICENSE_APACHE2 delete mode 100644 x-net/src/main/java/javax/net/DefaultServerSocketFactory.java delete mode 100644 x-net/src/main/java/javax/net/DefaultSocketFactory.java delete mode 100644 x-net/src/main/java/javax/net/ServerSocketFactory.java delete mode 100644 x-net/src/main/java/javax/net/SocketFactory.java delete mode 100644 x-net/src/main/java/javax/net/package.html delete mode 100644 x-net/src/main/java/javax/net/ssl/CertPathTrustManagerParameters.java delete mode 100644 x-net/src/main/java/javax/net/ssl/DefaultHostnameVerifier.java delete mode 100644 x-net/src/main/java/javax/net/ssl/DefaultSSLContext.java delete mode 100644 x-net/src/main/java/javax/net/ssl/DefaultSSLServerSocketFactory.java delete mode 100644 x-net/src/main/java/javax/net/ssl/DefaultSSLSocketFactory.java delete mode 100644 x-net/src/main/java/javax/net/ssl/HandshakeCompletedEvent.java delete mode 100644 x-net/src/main/java/javax/net/ssl/HandshakeCompletedListener.java delete mode 100644 x-net/src/main/java/javax/net/ssl/HostnameVerifier.java delete mode 100644 x-net/src/main/java/javax/net/ssl/HttpsURLConnection.java delete mode 100644 x-net/src/main/java/javax/net/ssl/KeyManager.java delete mode 100644 x-net/src/main/java/javax/net/ssl/KeyManagerFactory.java delete mode 100644 x-net/src/main/java/javax/net/ssl/KeyManagerFactorySpi.java delete mode 100644 x-net/src/main/java/javax/net/ssl/KeyStoreBuilderParameters.java delete mode 100644 x-net/src/main/java/javax/net/ssl/ManagerFactoryParameters.java delete mode 100644 x-net/src/main/java/javax/net/ssl/SSLContext.java delete mode 100644 x-net/src/main/java/javax/net/ssl/SSLContextSpi.java delete mode 100644 x-net/src/main/java/javax/net/ssl/SSLEngine.java delete mode 100644 x-net/src/main/java/javax/net/ssl/SSLEngineResult.java delete mode 100644 x-net/src/main/java/javax/net/ssl/SSLException.java delete mode 100644 x-net/src/main/java/javax/net/ssl/SSLHandshakeException.java delete mode 100644 x-net/src/main/java/javax/net/ssl/SSLKeyException.java delete mode 100644 x-net/src/main/java/javax/net/ssl/SSLPeerUnverifiedException.java delete mode 100644 x-net/src/main/java/javax/net/ssl/SSLPermission.java delete mode 100644 x-net/src/main/java/javax/net/ssl/SSLProtocolException.java delete mode 100644 x-net/src/main/java/javax/net/ssl/SSLServerSocket.java delete mode 100644 x-net/src/main/java/javax/net/ssl/SSLServerSocketFactory.java delete mode 100644 x-net/src/main/java/javax/net/ssl/SSLSession.java delete mode 100644 x-net/src/main/java/javax/net/ssl/SSLSessionBindingEvent.java delete mode 100644 x-net/src/main/java/javax/net/ssl/SSLSessionBindingListener.java delete mode 100644 x-net/src/main/java/javax/net/ssl/SSLSessionContext.java delete mode 100644 x-net/src/main/java/javax/net/ssl/SSLSocket.java delete mode 100644 x-net/src/main/java/javax/net/ssl/SSLSocketFactory.java delete mode 100644 x-net/src/main/java/javax/net/ssl/TrustManager.java delete mode 100644 x-net/src/main/java/javax/net/ssl/TrustManagerFactory.java delete mode 100644 x-net/src/main/java/javax/net/ssl/TrustManagerFactorySpi.java delete mode 100644 x-net/src/main/java/javax/net/ssl/X509ExtendedKeyManager.java delete mode 100644 x-net/src/main/java/javax/net/ssl/X509KeyManager.java delete mode 100644 x-net/src/main/java/javax/net/ssl/X509TrustManager.java delete mode 100644 x-net/src/main/java/javax/net/ssl/package.html delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/AbstractSessionContext.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/AlertException.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/AlertProtocol.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/Appendable.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateMessage.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateRequest.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CertificateVerify.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/CipherSuite.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHello.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientKeyExchange.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientSessionContext.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ConnectionState.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ConnectionStateSSLv3.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ConnectionStateTLS.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ContentType.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/DHParameters.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/DataStream.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/DelegatedTask.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/DigitalSignature.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfBufferException.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/EndOfSourceException.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/FileClientSessionCache.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/Finished.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/Handshake.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeIODataStream.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/HandshakeProtocol.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/HelloRequest.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/JSSEProvider.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerFactoryImpl.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/KeyManagerImpl.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/Logger.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/Message.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/NativeCrypto.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLMessageDigest.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLMessageDigestJDK.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketFactoryImpl.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLServerSocketImpl.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSessionImpl.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSignature.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketFactoryImpl.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImpl.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/OpenSSLSocketImplWrapper.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/PRF.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ProtocolVersion.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLBufferedInput.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLClientSessionCache.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLContextImpl.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineAppData.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineDataStream.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLEngineImpl.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLInputStream.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLParameters.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLRecordProtocol.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLServerSessionCache.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLSessionImpl.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLStreamedInput.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/SSLv3Constants.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHandshakeImpl.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHello.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerHelloDone.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerKeyExchange.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/ServerSessionContext.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/TrustManagerFactoryImpl.java delete mode 100644 x-net/src/main/java/org/apache/harmony/xnet/provider/jsse/TrustManagerImpl.java delete mode 100644 x-net/src/main/native/org_apache_harmony_xnet_provider_jsse_NativeCrypto.cpp delete mode 100644 x-net/src/main/native/sub.mk delete mode 100644 x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/ClientSessionContextTest.java delete mode 100644 x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/FakeSession.java delete mode 100644 x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/FileClientSessionCacheTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/AllTests.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ServerSocketFactoryTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/SocketFactoryTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/AllTests.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/CertPathTrustManagerParametersTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/CertificatesToPlayWith.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/HandshakeCompletedEventTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/HostnameVerifierTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/HttpsURLConnectionTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/KeyManagerFactory1Test.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/KeyManagerFactory2Test.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/KeyManagerFactorySpiTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/KeyStoreBuilderParametersTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLContext1Test.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLContext2Test.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLContextSpiTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLEngineResultHandshakeStatusTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLEngineResultStatusTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLEngineResultTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLEngineTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLExceptionTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLHandshakeExceptionTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLKeyExceptionTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLPeerUnverifiedExceptionTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLPermissionTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLProtocolExceptionTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLServerSocketFactoryTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLServerSocketTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLSessionBindingEventTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLSessionBindingListenerTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLSessionContextTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLSessionTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLSocketFactoryTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/SSLSocketTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/TrustManagerFactory1Test.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/TrustManagerFactory2Test.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/TrustManagerFactorySpiTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/X509ExtendedKeyManagerTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/X509KeyManagerTest.java delete mode 100644 x-net/src/test/java/tests/api/javax/net/ssl/X509TrustManagerTest.java delete mode 100644 x-net/src/test/java/tests/xnet/AllTests.java delete mode 100644 xml/MODULE_LICENSE_APACHE2 delete mode 100644 xml/MODULE_LICENSE_BSD_LIKE delete mode 100644 xml/MODULE_LICENSE_W3C delete mode 100644 xml/src/main/java/javax/xml/XMLConstants.java delete mode 100644 xml/src/main/java/javax/xml/datatype/DatatypeConfigurationException.java delete mode 100644 xml/src/main/java/javax/xml/datatype/DatatypeConstants.java delete mode 100644 xml/src/main/java/javax/xml/datatype/DatatypeFactory.java delete mode 100644 xml/src/main/java/javax/xml/datatype/Duration.java delete mode 100644 xml/src/main/java/javax/xml/datatype/FactoryFinder.java delete mode 100644 xml/src/main/java/javax/xml/datatype/SecuritySupport.java delete mode 100644 xml/src/main/java/javax/xml/datatype/XMLGregorianCalendar.java delete mode 100644 xml/src/main/java/javax/xml/datatype/package.html delete mode 100644 xml/src/main/java/javax/xml/namespace/NamespaceContext.java delete mode 100644 xml/src/main/java/javax/xml/namespace/QName.java delete mode 100644 xml/src/main/java/javax/xml/namespace/package.html delete mode 100644 xml/src/main/java/javax/xml/package.html delete mode 100644 xml/src/main/java/javax/xml/parsers/DocumentBuilder.java delete mode 100644 xml/src/main/java/javax/xml/parsers/DocumentBuilderFactory.java delete mode 100644 xml/src/main/java/javax/xml/parsers/FactoryConfigurationError.java delete mode 100644 xml/src/main/java/javax/xml/parsers/FilePathToURI.java delete mode 100644 xml/src/main/java/javax/xml/parsers/ParserConfigurationException.java delete mode 100644 xml/src/main/java/javax/xml/parsers/SAXParser.java delete mode 100644 xml/src/main/java/javax/xml/parsers/SAXParserFactory.java delete mode 100644 xml/src/main/java/javax/xml/parsers/SecuritySupport.java delete mode 100644 xml/src/main/java/javax/xml/parsers/package.html delete mode 100644 xml/src/main/java/javax/xml/transform/ErrorListener.java delete mode 100644 xml/src/main/java/javax/xml/transform/OutputKeys.java delete mode 100644 xml/src/main/java/javax/xml/transform/Result.java delete mode 100644 xml/src/main/java/javax/xml/transform/SecuritySupport.java delete mode 100644 xml/src/main/java/javax/xml/transform/Source.java delete mode 100644 xml/src/main/java/javax/xml/transform/SourceLocator.java delete mode 100644 xml/src/main/java/javax/xml/transform/Templates.java delete mode 100644 xml/src/main/java/javax/xml/transform/Transformer.java delete mode 100644 xml/src/main/java/javax/xml/transform/TransformerConfigurationException.java delete mode 100644 xml/src/main/java/javax/xml/transform/TransformerException.java delete mode 100644 xml/src/main/java/javax/xml/transform/TransformerFactory.java delete mode 100644 xml/src/main/java/javax/xml/transform/TransformerFactoryConfigurationError.java delete mode 100644 xml/src/main/java/javax/xml/transform/URIResolver.java delete mode 100644 xml/src/main/java/javax/xml/transform/dom/DOMLocator.java delete mode 100644 xml/src/main/java/javax/xml/transform/dom/DOMResult.java delete mode 100644 xml/src/main/java/javax/xml/transform/dom/DOMSource.java delete mode 100644 xml/src/main/java/javax/xml/transform/dom/package.html delete mode 100644 xml/src/main/java/javax/xml/transform/overview.html delete mode 100644 xml/src/main/java/javax/xml/transform/package.html delete mode 100644 xml/src/main/java/javax/xml/transform/sax/SAXResult.java delete mode 100644 xml/src/main/java/javax/xml/transform/sax/SAXSource.java delete mode 100644 xml/src/main/java/javax/xml/transform/sax/SAXTransformerFactory.java delete mode 100644 xml/src/main/java/javax/xml/transform/sax/TemplatesHandler.java delete mode 100644 xml/src/main/java/javax/xml/transform/sax/TransformerHandler.java delete mode 100644 xml/src/main/java/javax/xml/transform/sax/package.html delete mode 100644 xml/src/main/java/javax/xml/transform/stream/FilePathToURI.java delete mode 100644 xml/src/main/java/javax/xml/transform/stream/StreamResult.java delete mode 100644 xml/src/main/java/javax/xml/transform/stream/StreamSource.java delete mode 100644 xml/src/main/java/javax/xml/transform/stream/package.html delete mode 100644 xml/src/main/java/javax/xml/validation/Schema.java delete mode 100644 xml/src/main/java/javax/xml/validation/SchemaFactory.java delete mode 100644 xml/src/main/java/javax/xml/validation/SchemaFactoryFinder.java delete mode 100644 xml/src/main/java/javax/xml/validation/SchemaFactoryLoader.java delete mode 100644 xml/src/main/java/javax/xml/validation/SecuritySupport.java delete mode 100644 xml/src/main/java/javax/xml/validation/TypeInfoProvider.java delete mode 100644 xml/src/main/java/javax/xml/validation/Validator.java delete mode 100644 xml/src/main/java/javax/xml/validation/ValidatorHandler.java delete mode 100644 xml/src/main/java/javax/xml/validation/package.html delete mode 100644 xml/src/main/java/javax/xml/xpath/SecuritySupport.java delete mode 100644 xml/src/main/java/javax/xml/xpath/XPath.java delete mode 100644 xml/src/main/java/javax/xml/xpath/XPathConstants.java delete mode 100644 xml/src/main/java/javax/xml/xpath/XPathException.java delete mode 100644 xml/src/main/java/javax/xml/xpath/XPathExpression.java delete mode 100644 xml/src/main/java/javax/xml/xpath/XPathExpressionException.java delete mode 100644 xml/src/main/java/javax/xml/xpath/XPathFactory.java delete mode 100644 xml/src/main/java/javax/xml/xpath/XPathFactoryConfigurationException.java delete mode 100644 xml/src/main/java/javax/xml/xpath/XPathFactoryFinder.java delete mode 100644 xml/src/main/java/javax/xml/xpath/XPathFunction.java delete mode 100644 xml/src/main/java/javax/xml/xpath/XPathFunctionException.java delete mode 100644 xml/src/main/java/javax/xml/xpath/XPathFunctionResolver.java delete mode 100644 xml/src/main/java/javax/xml/xpath/XPathVariableResolver.java delete mode 100644 xml/src/main/java/javax/xml/xpath/package.html delete mode 100644 xml/src/main/java/org/apache/harmony/xml/ExpatAttributes.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/ExpatException.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/ExpatParser.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/ExpatPullParser.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/ExpatReader.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/AttrImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/CDATASectionImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/CharacterDataImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/CommentImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/DOMConfigurationImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/DOMImplementationImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/DocumentFragmentImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/DocumentImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/DocumentTypeImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/ElementImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/EntityImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/EntityReferenceImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/InnerNodeImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/LeafNodeImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/NamedNodeMapImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/NodeImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/NodeListImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/NotationImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/ProcessingInstructionImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/dom/TextImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderFactoryImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/parsers/DocumentBuilderImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/parsers/SAXParserFactoryImpl.java delete mode 100644 xml/src/main/java/org/apache/harmony/xml/parsers/SAXParserImpl.java delete mode 100644 xml/src/main/java/org/apache/xalan/Version.java delete mode 100644 xml/src/main/java/org/apache/xalan/Version.src delete mode 100644 xml/src/main/java/org/apache/xalan/extensions/ExpressionContext.java delete mode 100644 xml/src/main/java/org/apache/xalan/extensions/ExpressionVisitor.java delete mode 100644 xml/src/main/java/org/apache/xalan/extensions/ExtensionHandler.java delete mode 100644 xml/src/main/java/org/apache/xalan/extensions/ExtensionNamespaceSupport.java delete mode 100644 xml/src/main/java/org/apache/xalan/extensions/ExtensionNamespacesManager.java delete mode 100644 xml/src/main/java/org/apache/xalan/extensions/ExtensionsTable.java delete mode 100755 xml/src/main/java/org/apache/xalan/extensions/ObjectFactory.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorAttributeSet.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorCharacters.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorDecimalFormat.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorExsltFuncResult.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorExsltFunction.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorGlobalParamDecl.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorGlobalVariableDecl.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorImport.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorInclude.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorKey.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorLRE.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorNamespaceAlias.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorOutputElem.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorPreserveSpace.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorStripSpace.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorStylesheetDoc.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorStylesheetElement.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorTemplate.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorTemplateElem.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorText.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/ProcessorUnknown.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/StylesheetHandler.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/TransformerFactoryImpl.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/WhitespaceInfoPaths.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/XSLProcessorVersion.src delete mode 100644 xml/src/main/java/org/apache/xalan/processor/XSLTAttributeDef.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/XSLTElementDef.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/XSLTElementProcessor.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/XSLTSchema.java delete mode 100644 xml/src/main/java/org/apache/xalan/processor/package.html delete mode 100644 xml/src/main/java/org/apache/xalan/res/XSLMessages.java delete mode 100644 xml/src/main/java/org/apache/xalan/res/XSLTErrorResources.java delete mode 100644 xml/src/main/java/org/apache/xalan/res/XSLTInfo.properties delete mode 100644 xml/src/main/java/org/apache/xalan/res/package.html delete mode 100644 xml/src/main/java/org/apache/xalan/serialize/SerializerUtils.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/AVT.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/AVTPart.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/AVTPartSimple.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/AVTPartXPath.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/AbsPathChecker.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/Constants.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/DecimalFormatProperties.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemApplyImport.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemApplyTemplates.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemAttribute.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemAttributeSet.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemCallTemplate.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemChoose.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemComment.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemCopy.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemCopyOf.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemElement.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemEmpty.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemExsltFuncResult.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemExsltFunction.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemExtensionCall.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemExtensionDecl.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemExtensionScript.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemFallback.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemForEach.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemIf.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemLiteralResult.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemMessage.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemNumber.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemOtherwise.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemPI.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemParam.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemSort.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemTemplate.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemTemplateElement.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemText.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemTextLiteral.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemUnknown.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemUse.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemValueOf.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemVariable.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemVariablePsuedo.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemWhen.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/ElemWithParam.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/FuncDocument.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/FuncFormatNumb.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/FuncKey.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/KeyDeclaration.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/NamespaceAlias.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/OutputProperties.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/RedundentExprEliminator.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/Stylesheet.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/StylesheetComposed.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/StylesheetRoot.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/TemplateList.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/TemplateSubPatternAssociation.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/VarNameCollector.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/WhiteSpaceInfo.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/XMLNSDecl.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/XSLTVisitable.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/XSLTVisitor.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/XUnresolvedVariable.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/XUnresolvedVariableSimple.java delete mode 100644 xml/src/main/java/org/apache/xalan/templates/package.html delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/ClonerToResultTree.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/Counter.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/CountersTable.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/DecimalToRoman.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/KeyIterator.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/KeyManager.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/KeyTable.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/MsgMgr.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/NodeSortKey.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/NodeSorter.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/SerializerSwitcher.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/TrAXFilter.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/TransformState.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/TransformerClient.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/TransformerHandlerImpl.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/TransformerIdentityImpl.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/TreeWalker2Result.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/XalanProperties.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/XalanTransformState.java delete mode 100644 xml/src/main/java/org/apache/xalan/transformer/package.html delete mode 100644 xml/src/main/java/org/apache/xalan/xslt/EnvironmentCheck.java delete mode 100755 xml/src/main/java/org/apache/xalan/xslt/ObjectFactory.java delete mode 100755 xml/src/main/java/org/apache/xalan/xslt/SecuritySupport.java delete mode 100755 xml/src/main/java/org/apache/xalan/xslt/SecuritySupport12.java delete mode 100644 xml/src/main/java/org/apache/xalan/xslt/package.html delete mode 100644 xml/src/main/java/org/apache/xml/dtm/Axis.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/DTM.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/DTMAxisIterator.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/DTMAxisTraverser.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/DTMConfigurationException.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/DTMDOMException.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/DTMException.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/DTMFilter.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/DTMIterator.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/DTMManager.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/DTMWSFilter.java delete mode 100755 xml/src/main/java/org/apache/xml/dtm/ObjectFactory.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/SecuritySupport.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/SecuritySupport12.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/ChunkedIntArray.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/CoroutineManager.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIterNodeList.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/DTMAxisIteratorBase.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/DTMChildIterNodeList.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBase.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseIterators.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/DTMDefaultBaseTraversers.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/DTMDocumentImpl.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/DTMManagerDefault.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/DTMNamedNodeMap.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeIterator.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeList.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeListBase.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/DTMNodeProxy.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/DTMStringPool.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/DTMTreeWalker.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/ExpandedNameTable.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/ExtendedType.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/IncrementalSAXSource_Filter.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/NodeLocator.java delete mode 100755 xml/src/main/java/org/apache/xml/dtm/ref/SecuritySupport.java delete mode 100755 xml/src/main/java/org/apache/xml/dtm/ref/SecuritySupport12.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/dom2dtm/DOM2DTM.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/dom2dtm/DOM2DTMdefaultNamespaceDeclarationNode.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2DTM2.java delete mode 100644 xml/src/main/java/org/apache/xml/dtm/ref/sax2dtm/SAX2RTFDTM.java delete mode 100644 xml/src/main/java/org/apache/xml/res/XMLErrorResources.java delete mode 100644 xml/src/main/java/org/apache/xml/res/XMLMessages.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/AttributesImplSerializer.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/CharInfo.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/DOM3Serializer.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/DOMSerializer.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/ElemContext.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/ElemDesc.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/EncodingInfo.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/Encodings.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/Encodings.properties delete mode 100644 xml/src/main/java/org/apache/xml/serializer/ExtendedContentHandler.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/ExtendedLexicalHandler.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/HTMLEntities.properties delete mode 100644 xml/src/main/java/org/apache/xml/serializer/Method.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/NamespaceMappings.java delete mode 100755 xml/src/main/java/org/apache/xml/serializer/ObjectFactory.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/OutputPropertiesFactory.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/OutputPropertyUtils.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/SecuritySupport.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/SecuritySupport12.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/SerializationHandler.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/Serializer.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/SerializerBase.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/SerializerConstants.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/SerializerFactory.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/SerializerTrace.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/SerializerTraceWriter.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/ToHTMLStream.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/ToSAXHandler.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/ToStream.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/ToTextSAXHandler.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/ToTextStream.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/ToUnknownStream.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/ToXMLSAXHandler.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/ToXMLStream.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/TransformStateSetter.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/TreeWalker.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/Version.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/Version.src delete mode 100644 xml/src/main/java/org/apache/xml/serializer/WriterChain.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/WriterToASCI.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/WriterToUTF8Buffered.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/XMLEntities.properties delete mode 100644 xml/src/main/java/org/apache/xml/serializer/XSLOutputAttributes.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/dom3/DOM3SerializerImpl.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/dom3/DOM3TreeWalker.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/dom3/DOMConstants.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/dom3/DOMErrorHandlerImpl.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/dom3/DOMErrorImpl.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/dom3/DOMLocatorImpl.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/dom3/DOMOutputImpl.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/dom3/DOMStringListImpl.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/dom3/LSSerializerImpl.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/dom3/NamespaceSupport.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/output_html.properties delete mode 100644 xml/src/main/java/org/apache/xml/serializer/output_text.properties delete mode 100644 xml/src/main/java/org/apache/xml/serializer/output_unknown.properties delete mode 100644 xml/src/main/java/org/apache/xml/serializer/output_xml.properties delete mode 100644 xml/src/main/java/org/apache/xml/serializer/package.html delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/AttList.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/DOM2Helper.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/Messages.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/MsgKey.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_ca.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_cs.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_de.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_en.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_es.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_fr.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_hu.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_it.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_ja.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_ko.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_pl.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_pt_BR.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_ru.java delete mode 100755 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_sk.java delete mode 100755 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_sl.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_sv.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_tr.java delete mode 100755 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_zh.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_zh_CN.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SerializerMessages_zh_TW.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/StringToIntTable.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/SystemIDResolver.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/URI.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/Utils.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/WrappedRuntimeException.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/XML11Char.java delete mode 100644 xml/src/main/java/org/apache/xml/serializer/utils/XMLChar.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/AttList.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/BoolStack.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/Constants.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/DOM2Helper.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/DOMBuilder.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/DOMHelper.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/DOMOrder.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/DefaultErrorHandler.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/FastStringBuffer.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/IntStack.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/IntVector.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/NSInfo.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/NameSpace.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/NamespaceSupport2.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/NodeConsumer.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/NodeVector.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/ObjectFactory.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/ObjectPool.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/ObjectStack.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/ObjectVector.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/PrefixResolver.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/PrefixResolverDefault.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/QName.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/SAXSourceLocator.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/SecuritySupport.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/SecuritySupport12.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/StopParseException.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/StringBufferPool.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/StringToIntTable.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/StringVector.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/StylesheetPIHandler.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/SuballocatedIntVector.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/SystemIDResolver.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/ThreadControllerWrapper.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/TreeWalker.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/URI.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/UnImplNode.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/WrappedRuntimeException.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/XML11Char.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/XMLChar.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/XMLCharacterRecognizer.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/XMLReaderManager.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/XMLString.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/XMLStringDefault.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/XMLStringFactory.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/package.html delete mode 100755 xml/src/main/java/org/apache/xml/utils/res/CharArrayWrapper.java delete mode 100755 xml/src/main/java/org/apache/xml/utils/res/IntArrayWrapper.java delete mode 100755 xml/src/main/java/org/apache/xml/utils/res/LongArrayWrapper.java delete mode 100755 xml/src/main/java/org/apache/xml/utils/res/StringArrayWrapper.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResourceBundle.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResourceBundleBase.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResources_cy.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResources_de.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResources_el.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResources_en.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResources_es.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResources_fr.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResources_he.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResources_hy.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResources_it.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResources_ja_JP_A.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResources_ja_JP_HA.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResources_ja_JP_HI.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResources_ja_JP_I.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResources_ka.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResources_ko.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResources_sv.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResources_zh_CN.java delete mode 100644 xml/src/main/java/org/apache/xml/utils/res/XResources_zh_TW.java delete mode 100644 xml/src/main/java/org/apache/xpath/Arg.java delete mode 100644 xml/src/main/java/org/apache/xpath/CachedXPathAPI.java delete mode 100644 xml/src/main/java/org/apache/xpath/Expression.java delete mode 100644 xml/src/main/java/org/apache/xpath/ExpressionNode.java delete mode 100644 xml/src/main/java/org/apache/xpath/ExpressionOwner.java delete mode 100644 xml/src/main/java/org/apache/xpath/ExtensionsProvider.java delete mode 100644 xml/src/main/java/org/apache/xpath/FoundIndex.java delete mode 100644 xml/src/main/java/org/apache/xpath/NodeSet.java delete mode 100644 xml/src/main/java/org/apache/xpath/NodeSetDTM.java delete mode 100644 xml/src/main/java/org/apache/xpath/SourceTree.java delete mode 100644 xml/src/main/java/org/apache/xpath/SourceTreeManager.java delete mode 100644 xml/src/main/java/org/apache/xpath/VariableStack.java delete mode 100644 xml/src/main/java/org/apache/xpath/WhitespaceStrippingElementMatcher.java delete mode 100644 xml/src/main/java/org/apache/xpath/XPath.java delete mode 100644 xml/src/main/java/org/apache/xpath/XPathAPI.java delete mode 100644 xml/src/main/java/org/apache/xpath/XPathContext.java delete mode 100644 xml/src/main/java/org/apache/xpath/XPathException.java delete mode 100644 xml/src/main/java/org/apache/xpath/XPathFactory.java delete mode 100644 xml/src/main/java/org/apache/xpath/XPathProcessorException.java delete mode 100644 xml/src/main/java/org/apache/xpath/XPathVisitable.java delete mode 100644 xml/src/main/java/org/apache/xpath/XPathVisitor.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/AttributeIterator.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/AxesWalker.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/BasicTestIterator.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/ChildIterator.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/ChildTestIterator.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/ContextNodeList.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/DescendantIterator.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/FilterExprIterator.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/FilterExprIteratorSimple.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/FilterExprWalker.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/HasPositionalPredChecker.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/IteratorPool.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/LocPathIterator.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/MatchPatternIterator.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/NodeSequence.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/OneStepIterator.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/OneStepIteratorForward.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/PathComponent.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/PredicatedNodeTest.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/RTFIterator.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/ReverseAxesWalker.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/SelfIteratorNoPredicate.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/SubContextList.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/UnionChildIterator.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/UnionPathIterator.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/WalkerFactory.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/WalkingIterator.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/WalkingIteratorSorted.java delete mode 100644 xml/src/main/java/org/apache/xpath/axes/package.html delete mode 100644 xml/src/main/java/org/apache/xpath/compiler/Compiler.java delete mode 100644 xml/src/main/java/org/apache/xpath/compiler/FunctionTable.java delete mode 100644 xml/src/main/java/org/apache/xpath/compiler/Keywords.java delete mode 100644 xml/src/main/java/org/apache/xpath/compiler/Lexer.java delete mode 100644 xml/src/main/java/org/apache/xpath/compiler/OpCodes.java delete mode 100644 xml/src/main/java/org/apache/xpath/compiler/OpMap.java delete mode 100644 xml/src/main/java/org/apache/xpath/compiler/OpMapVector.java delete mode 100644 xml/src/main/java/org/apache/xpath/compiler/PsuedoNames.java delete mode 100644 xml/src/main/java/org/apache/xpath/compiler/XPathDumper.java delete mode 100644 xml/src/main/java/org/apache/xpath/compiler/XPathParser.java delete mode 100644 xml/src/main/java/org/apache/xpath/compiler/package.html delete mode 100644 xml/src/main/java/org/apache/xpath/domapi/XPathStylesheetDOM3Exception.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncBoolean.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncCeiling.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncConcat.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncContains.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncCount.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncCurrent.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncDoclocation.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncExtElementAvailable.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncExtFunction.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncExtFunctionAvailable.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncFalse.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncFloor.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncGenerateId.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncId.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncLang.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncLast.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncLocalPart.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncNamespace.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncNormalizeSpace.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncNot.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncNumber.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncPosition.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncQname.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncRound.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncStartsWith.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncString.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncStringLength.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncSubstring.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncSubstringAfter.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncSubstringBefore.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncSum.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncSystemProperty.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncTranslate.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncTrue.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FuncUnparsedEntityURI.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/Function.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/Function2Args.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/Function3Args.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FunctionDef1Arg.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FunctionMultiArgs.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/FunctionOneArg.java delete mode 100755 xml/src/main/java/org/apache/xpath/functions/ObjectFactory.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/SecuritySupport.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/SecuritySupport12.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/WrongNumberArgsException.java delete mode 100644 xml/src/main/java/org/apache/xpath/functions/package.html delete mode 100644 xml/src/main/java/org/apache/xpath/jaxp/JAXPExtensionsProvider.java delete mode 100644 xml/src/main/java/org/apache/xpath/jaxp/JAXPPrefixResolver.java delete mode 100644 xml/src/main/java/org/apache/xpath/jaxp/JAXPVariableStack.java delete mode 100644 xml/src/main/java/org/apache/xpath/jaxp/XPathExpressionImpl.java delete mode 100644 xml/src/main/java/org/apache/xpath/jaxp/XPathFactoryImpl.java delete mode 100644 xml/src/main/java/org/apache/xpath/jaxp/XPathImpl.java delete mode 100755 xml/src/main/java/org/apache/xpath/objects/DTMXRTreeFrag.java delete mode 100644 xml/src/main/java/org/apache/xpath/objects/XBoolean.java delete mode 100644 xml/src/main/java/org/apache/xpath/objects/XBooleanStatic.java delete mode 100644 xml/src/main/java/org/apache/xpath/objects/XMLStringFactoryImpl.java delete mode 100644 xml/src/main/java/org/apache/xpath/objects/XNodeSet.java delete mode 100644 xml/src/main/java/org/apache/xpath/objects/XNodeSetForDOM.java delete mode 100644 xml/src/main/java/org/apache/xpath/objects/XNull.java delete mode 100644 xml/src/main/java/org/apache/xpath/objects/XNumber.java delete mode 100644 xml/src/main/java/org/apache/xpath/objects/XObject.java delete mode 100644 xml/src/main/java/org/apache/xpath/objects/XObjectFactory.java delete mode 100644 xml/src/main/java/org/apache/xpath/objects/XRTreeFrag.java delete mode 100644 xml/src/main/java/org/apache/xpath/objects/XRTreeFragSelectWrapper.java delete mode 100644 xml/src/main/java/org/apache/xpath/objects/XString.java delete mode 100644 xml/src/main/java/org/apache/xpath/objects/XStringForChars.java delete mode 100644 xml/src/main/java/org/apache/xpath/objects/XStringForFSB.java delete mode 100644 xml/src/main/java/org/apache/xpath/objects/package.html delete mode 100644 xml/src/main/java/org/apache/xpath/operations/And.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/Bool.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/Div.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/Equals.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/Gt.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/Gte.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/Lt.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/Lte.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/Minus.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/Mod.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/Mult.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/Neg.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/NotEquals.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/Number.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/Operation.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/Or.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/Plus.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/Quo.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/String.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/UnaryOperation.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/Variable.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/VariableSafeAbsRef.java delete mode 100644 xml/src/main/java/org/apache/xpath/operations/package.html delete mode 100644 xml/src/main/java/org/apache/xpath/package.html delete mode 100644 xml/src/main/java/org/apache/xpath/patterns/ContextMatchStepPattern.java delete mode 100644 xml/src/main/java/org/apache/xpath/patterns/FunctionPattern.java delete mode 100644 xml/src/main/java/org/apache/xpath/patterns/NodeTest.java delete mode 100644 xml/src/main/java/org/apache/xpath/patterns/NodeTestFilter.java delete mode 100644 xml/src/main/java/org/apache/xpath/patterns/StepPattern.java delete mode 100644 xml/src/main/java/org/apache/xpath/patterns/UnionPattern.java delete mode 100644 xml/src/main/java/org/apache/xpath/patterns/package.html delete mode 100644 xml/src/main/java/org/apache/xpath/res/XPATHErrorResources.java delete mode 100644 xml/src/main/java/org/apache/xpath/res/XPATHMessages.java delete mode 100644 xml/src/main/java/org/apache/xpath/res/package.html delete mode 100644 xml/src/main/java/org/w3c/dom/Attr.java delete mode 100644 xml/src/main/java/org/w3c/dom/CDATASection.java delete mode 100644 xml/src/main/java/org/w3c/dom/CharacterData.java delete mode 100644 xml/src/main/java/org/w3c/dom/Comment.java delete mode 100644 xml/src/main/java/org/w3c/dom/DOMConfiguration.java delete mode 100644 xml/src/main/java/org/w3c/dom/DOMError.java delete mode 100644 xml/src/main/java/org/w3c/dom/DOMErrorHandler.java delete mode 100644 xml/src/main/java/org/w3c/dom/DOMException.java delete mode 100644 xml/src/main/java/org/w3c/dom/DOMImplementation.java delete mode 100644 xml/src/main/java/org/w3c/dom/DOMImplementationList.java delete mode 100644 xml/src/main/java/org/w3c/dom/DOMImplementationSource.java delete mode 100644 xml/src/main/java/org/w3c/dom/DOMLocator.java delete mode 100644 xml/src/main/java/org/w3c/dom/DOMStringList.java delete mode 100644 xml/src/main/java/org/w3c/dom/Document.java delete mode 100644 xml/src/main/java/org/w3c/dom/DocumentFragment.java delete mode 100644 xml/src/main/java/org/w3c/dom/DocumentType.java delete mode 100644 xml/src/main/java/org/w3c/dom/Element.java delete mode 100644 xml/src/main/java/org/w3c/dom/Entity.java delete mode 100644 xml/src/main/java/org/w3c/dom/EntityReference.java delete mode 100644 xml/src/main/java/org/w3c/dom/NameList.java delete mode 100644 xml/src/main/java/org/w3c/dom/NamedNodeMap.java delete mode 100644 xml/src/main/java/org/w3c/dom/Node.java delete mode 100644 xml/src/main/java/org/w3c/dom/NodeList.java delete mode 100644 xml/src/main/java/org/w3c/dom/Notation.java delete mode 100644 xml/src/main/java/org/w3c/dom/ProcessingInstruction.java delete mode 100644 xml/src/main/java/org/w3c/dom/Text.java delete mode 100644 xml/src/main/java/org/w3c/dom/TypeInfo.java delete mode 100644 xml/src/main/java/org/w3c/dom/UserDataHandler.java delete mode 100644 xml/src/main/java/org/w3c/dom/ls/DOMImplementationLS.java delete mode 100644 xml/src/main/java/org/w3c/dom/ls/LSException.java delete mode 100644 xml/src/main/java/org/w3c/dom/ls/LSInput.java delete mode 100644 xml/src/main/java/org/w3c/dom/ls/LSOutput.java delete mode 100644 xml/src/main/java/org/w3c/dom/ls/LSParser.java delete mode 100644 xml/src/main/java/org/w3c/dom/ls/LSParserFilter.java delete mode 100644 xml/src/main/java/org/w3c/dom/ls/LSResourceResolver.java delete mode 100644 xml/src/main/java/org/w3c/dom/ls/LSSerializer.java delete mode 100644 xml/src/main/java/org/w3c/dom/ls/LSSerializerFilter.java delete mode 100644 xml/src/main/java/org/w3c/dom/package.html delete mode 100644 xml/src/main/java/org/w3c/dom/traversal/NodeFilter.java delete mode 100644 xml/src/main/java/org/w3c/dom/traversal/NodeIterator.java delete mode 100644 xml/src/main/java/org/xml/sax/AttributeList.java delete mode 100644 xml/src/main/java/org/xml/sax/Attributes.java delete mode 100644 xml/src/main/java/org/xml/sax/ContentHandler.java delete mode 100644 xml/src/main/java/org/xml/sax/DTDHandler.java delete mode 100644 xml/src/main/java/org/xml/sax/DocumentHandler.java delete mode 100644 xml/src/main/java/org/xml/sax/EntityResolver.java delete mode 100644 xml/src/main/java/org/xml/sax/ErrorHandler.java delete mode 100644 xml/src/main/java/org/xml/sax/HandlerBase.java delete mode 100644 xml/src/main/java/org/xml/sax/InputSource.java delete mode 100644 xml/src/main/java/org/xml/sax/Locator.java delete mode 100644 xml/src/main/java/org/xml/sax/Parser.java delete mode 100644 xml/src/main/java/org/xml/sax/SAXException.java delete mode 100644 xml/src/main/java/org/xml/sax/SAXNotRecognizedException.java delete mode 100644 xml/src/main/java/org/xml/sax/SAXNotSupportedException.java delete mode 100644 xml/src/main/java/org/xml/sax/SAXParseException.java delete mode 100644 xml/src/main/java/org/xml/sax/XMLFilter.java delete mode 100644 xml/src/main/java/org/xml/sax/XMLReader.java delete mode 100644 xml/src/main/java/org/xml/sax/ext/Attributes2.java delete mode 100644 xml/src/main/java/org/xml/sax/ext/Attributes2Impl.java delete mode 100644 xml/src/main/java/org/xml/sax/ext/DeclHandler.java delete mode 100644 xml/src/main/java/org/xml/sax/ext/DefaultHandler2.java delete mode 100644 xml/src/main/java/org/xml/sax/ext/EntityResolver2.java delete mode 100644 xml/src/main/java/org/xml/sax/ext/LexicalHandler.java delete mode 100644 xml/src/main/java/org/xml/sax/ext/Locator2.java delete mode 100644 xml/src/main/java/org/xml/sax/ext/Locator2Impl.java delete mode 100644 xml/src/main/java/org/xml/sax/ext/package.html delete mode 100644 xml/src/main/java/org/xml/sax/helpers/AttributeListImpl.java delete mode 100644 xml/src/main/java/org/xml/sax/helpers/AttributesImpl.java delete mode 100644 xml/src/main/java/org/xml/sax/helpers/DefaultHandler.java delete mode 100644 xml/src/main/java/org/xml/sax/helpers/LocatorImpl.java delete mode 100644 xml/src/main/java/org/xml/sax/helpers/NamespaceSupport.java delete mode 100644 xml/src/main/java/org/xml/sax/helpers/NewInstance.java delete mode 100644 xml/src/main/java/org/xml/sax/helpers/ParserAdapter.java delete mode 100644 xml/src/main/java/org/xml/sax/helpers/ParserFactory.java delete mode 100644 xml/src/main/java/org/xml/sax/helpers/XMLFilterImpl.java delete mode 100644 xml/src/main/java/org/xml/sax/helpers/XMLReaderAdapter.java delete mode 100644 xml/src/main/java/org/xml/sax/helpers/XMLReaderFactory.java delete mode 100644 xml/src/main/java/org/xml/sax/helpers/package.html delete mode 100644 xml/src/main/java/org/xml/sax/package.html delete mode 100644 xml/src/main/native/org_apache_harmony_xml_ExpatParser.cpp delete mode 100644 xml/src/main/native/sub.mk delete mode 100644 xml/src/test/java/org/apache/harmony/xml/AllTests.java delete mode 100644 xml/src/test/java/org/apache/harmony/xml/ExpatParserTest.java delete mode 100644 xml/src/test/java/org/apache/harmony/xml/JaxenXPathTestSuite.java delete mode 100644 xml/src/test/java/org/apache/harmony/xml/NamespacedAttributesLookupTest.java delete mode 100644 xml/src/test/java/org/apache/harmony/xml/XsltXPathConformanceTestSuite.java delete mode 100644 xml/src/test/java/tests/api/javax/xml/parsers/AllTests.java delete mode 100644 xml/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderFactoryTest.java delete mode 100644 xml/src/test/java/tests/api/javax/xml/parsers/DocumentBuilderTest.java delete mode 100644 xml/src/test/java/tests/api/javax/xml/parsers/FactoryConfigurationErrorTest.java delete mode 100644 xml/src/test/java/tests/api/javax/xml/parsers/ParserConfigurationExceptionTest.java delete mode 100644 xml/src/test/java/tests/api/javax/xml/parsers/SAXParserFactoryTest.java delete mode 100644 xml/src/test/java/tests/api/javax/xml/parsers/SAXParserTest.java delete mode 100644 xml/src/test/java/tests/api/javax/xml/parsers/SAXParserTestSupport.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/AllTests.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/HandlerBaseTest.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/InputSourceTest.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/SAXExceptionTest.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/SAXNotRecognizedExceptionTest.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/SAXNotSupportedExceptionTest.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/SAXParseExceptionTest.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/ext/AllTests.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/ext/Attributes2ImplTest.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/ext/DefaultHandler2Test.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/ext/Locator2ImplTest.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/helpers/AllTests.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/helpers/AttributeListImplTest.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/helpers/AttributesImplTest.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/helpers/DefaultHandlerTest.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/helpers/LocatorImplTest.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/helpers/NamespaceSupportTest.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/helpers/ParserAdapterTest.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/helpers/ParserFactoryTest.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/helpers/XMLFilterImplTest.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/helpers/XMLReaderAdapterTest.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/helpers/XMLReaderFactoryTest.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/support/BrokenInputStream.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/support/DoNothingParser.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/support/DoNothingXMLReader.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/support/MethodLogger.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/support/MockFilter.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/support/MockHandler.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/support/MockParser.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/support/MockReader.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/support/MockResolver.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/support/NoAccessParser.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/support/NoAccessXMLReader.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/support/NoInstanceParser.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/support/NoInstanceXMLReader.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/support/NoSubclassParser.java delete mode 100644 xml/src/test/java/tests/api/org/xml/sax/support/NoSubclassXMLReader.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/AllTests.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/AttrGetOwnerElement.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/CreateAttributeNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/CreateDocument.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/CreateDocumentType.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/CreateElementNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/DOMDocumentBuilderFactory.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/DOMImplementationCreateDocument.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/DOMImplementationCreateDocumentType.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/DOMImplementationHasFeature.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/DOMTestCase.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/DocumentBuilderSetting.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/DocumentBuilderSettingStrategy.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/DocumentCreateAttributeNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/DocumentCreateElementNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/DocumentGetElementsByTagnameNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/DocumentGeteEementById.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/DocumentImportNode.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/DocumentTypeInternalSubset.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/DocumentTypePublicId.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/DocumentTypeSystemId.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/ElementGetAttributeNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/ElementGetAttributeNodeNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/ElementGetElementsByTagNameNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/ElementHasAttribute.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/ElementHasAttributeNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/ElementRemoveAttributeNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/ElementSetAttributeNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/ElementSetAttributeNodeNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/GetAttributeNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/GetAttributeNodeNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/GetElementById.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/GetElementsByTagNameNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/GetNamedItemNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/HCEntitiesRemoveNamedItemNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/HCEntitiesSetNamedItemNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/HCNamedNodeMapInvalidType.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/HCNodeDocumentFragmentNormalize.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/HCNotationsRemoveNamedItemNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/HCNotationsSetNamedItemNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/HasAttribute.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/HasAttributeNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/HasAttributes.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/ImportNode.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/InternalSubset.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/IsSupported.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/LocalName.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/NamedNodeMapGetNamedItemNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/NamedNodeMapRemoveNamedItemNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/NamedNodeMapSetNamedItemNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/NamespaceURI.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/NodeGetLocalName.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/NodeGetNamespaceURI.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/NodeGetOwnerDocument.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/NodeGetPrefix.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/NodeHasAttributes.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/NodeIsSupported.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/NodeNormalize.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/NodeSetPrefix.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/Normalize.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/OwnerDocument.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/OwnerElement.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/Prefix.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/PublicId.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/RemoveAttributeNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/RemoveNamedItemNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/SetAttributeNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/SetAttributeNodeNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/SetNamedItemNS.java delete mode 100644 xml/src/test/java/tests/org/w3c/dom/SystemId.java delete mode 100644 xml/src/test/java/tests/xml/AllTests.java delete mode 100644 xml/src/test/java/tests/xml/DeclarationTest.java delete mode 100644 xml/src/test/java/tests/xml/DomTest.java delete mode 100644 xml/src/test/java/tests/xml/NodeTest.java delete mode 100644 xml/src/test/java/tests/xml/NormalizeTest.java delete mode 100644 xml/src/test/java/tests/xml/SaxTest.java delete mode 100644 xml/src/test/java/tests/xml/SimpleBuilderTest.java delete mode 100644 xml/src/test/java/tests/xml/SimpleParserTest.java delete mode 100644 xml/src/test/resources/SimpleBuilderTest.xml delete mode 100644 xml/src/test/resources/SimpleParserTest.xml delete mode 100644 xml/src/test/resources/hc_staff.xml delete mode 100644 xml/src/test/resources/nwf/staff.dtd delete mode 100644 xml/src/test/resources/nwf/staff.xml delete mode 100644 xml/src/test/resources/out_dh/staff.out delete mode 100644 xml/src/test/resources/out_hb/staff.out delete mode 100644 xml/src/test/resources/recipe.xml delete mode 100644 xml/src/test/resources/recipe1.xml delete mode 100644 xml/src/test/resources/recipt.dtd delete mode 100644 xml/src/test/resources/recipt.xml delete mode 100644 xml/src/test/resources/reciptWrong.xml delete mode 100644 xml/src/test/resources/simple.xml delete mode 100644 xml/src/test/resources/simple_ns.dtd delete mode 100644 xml/src/test/resources/simple_ns.xml delete mode 100644 xml/src/test/resources/staff.dtd delete mode 100644 xml/src/test/resources/staff.xml delete mode 100644 xml/src/test/resources/staff2.dtd delete mode 100644 xml/src/test/resources/staff2.xml delete mode 100644 xml/src/test/resources/staffEntRes.xml delete mode 100644 xml/src/test/resources/staffNS.dtd delete mode 100644 xml/src/test/resources/staffNS.xml delete mode 100644 xml/src/test/resources/systemid.xml delete mode 100644 xml/src/test/resources/systemid/recipt.dtd delete mode 100644 xml/src/test/resources/systemid/staff.dtd delete mode 100644 xml/src/test/resources/wf/staff.dtd delete mode 100644 xml/src/test/resources/wf/staff.xml delete mode 100644 xml/src/test/resources/wrong.xml delete mode 100644 xml/src/test/resources/xhtml1-strict.dtd diff --git a/JavaLibrary.mk b/JavaLibrary.mk index 6f4a050..d3d4355 100644 --- a/JavaLibrary.mk +++ b/JavaLibrary.mk @@ -50,7 +50,7 @@ $(shell cd $(LOCAL_PATH) && ls -d */src/$(1)/{java,resources} 2> /dev/null) endef # The Java files and their associated resources. -core_src_files := $(call all-main-java-files-under,awt-kernel dalvik dom icu json junit luni luni-kernel openssl prefs security-kernel support x-net xml) +core_src_files := $(call all-main-java-files-under,dalvik dom json junit luni openssl support xml) core_resource_dirs := $(call all-core-resource-dirs,main) test_resource_dirs := $(call all-core-resource-dirs,test) @@ -124,16 +124,6 @@ LOCAL_MODULE := core-tests-json include $(BUILD_JAVA_LIBRARY) include $(CLEAR_VARS) -LOCAL_SRC_FILES := $(call all-test-java-files-under,luni-kernel) -LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) -LOCAL_NO_STANDARD_LIBRARIES := true -LOCAL_JAVA_LIBRARIES := core core-tests-support -LOCAL_DX_FLAGS := --core-library -LOCAL_MODULE_TAGS := tests -LOCAL_MODULE := core-tests-luni-kernel -include $(BUILD_JAVA_LIBRARY) - -include $(CLEAR_VARS) LOCAL_SRC_FILES := $(call all-test-java-files-under,luni) LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) LOCAL_NO_STANDARD_LIBRARIES := true @@ -146,9 +136,6 @@ LOCAL_JAVA_LIBRARIES := \ core-tests-support \ core-tests-dom \ core-tests-json \ - core-tests-luni-kernel \ - core-tests-prefs \ - core-tests-x-net \ core-tests-xml \ sqlite-jdbc LOCAL_DX_FLAGS := --core-library @@ -157,16 +144,6 @@ LOCAL_MODULE := core-tests-luni include $(BUILD_JAVA_LIBRARY) include $(CLEAR_VARS) -LOCAL_SRC_FILES := $(call all-test-java-files-under,prefs) -LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) -LOCAL_NO_STANDARD_LIBRARIES := true -LOCAL_JAVA_LIBRARIES := core core-tests-support -LOCAL_DX_FLAGS := --core-library -LOCAL_MODULE_TAGS := tests -LOCAL_MODULE := core-tests-prefs -include $(BUILD_JAVA_LIBRARY) - -include $(CLEAR_VARS) LOCAL_SRC_FILES := $(call all-test-java-files-under,support) LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) LOCAL_NO_STANDARD_LIBRARIES := true @@ -177,16 +154,6 @@ LOCAL_MODULE := core-tests-support include $(BUILD_JAVA_LIBRARY) include $(CLEAR_VARS) -LOCAL_SRC_FILES := $(call all-test-java-files-under,x-net) -LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) -LOCAL_NO_STANDARD_LIBRARIES := true -LOCAL_JAVA_LIBRARIES := core core-tests-support -LOCAL_DX_FLAGS := --core-library -LOCAL_MODULE_TAGS := tests -LOCAL_MODULE := core-tests-x-net -include $(BUILD_JAVA_LIBRARY) - -include $(CLEAR_VARS) LOCAL_SRC_FILES := $(call all-test-java-files-under,xml) LOCAL_JAVA_RESOURCE_DIRS := $(test_resource_dirs) LOCAL_NO_STANDARD_LIBRARIES := true diff --git a/awt-kernel/MODULE_LICENSE_APACHE2 b/awt-kernel/MODULE_LICENSE_APACHE2 deleted file mode 100644 index e69de29..0000000 diff --git a/awt-kernel/src/main/java/java/awt/font/NumericShaper.java b/awt-kernel/src/main/java/java/awt/font/NumericShaper.java deleted file mode 100644 index b170f25..0000000 --- a/awt-kernel/src/main/java/java/awt/font/NumericShaper.java +++ /dev/null @@ -1,847 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @author Ilya S. Okomin - * @version $Revision$ - */ -package java.awt.font; - -import java.io.IOException; -import java.io.Serializable; -import org.apache.harmony.misc.HashCode; - -/** - * The Class NumericShaper provides methods to convert latin character codes - * to unicode character codes. - * For tables of the character codes used, - * see unicode.org. - */ -public final class NumericShaper implements Serializable { - - /** The Constant serialVersionUID. */ - private static final long serialVersionUID = -8022764705923730308L; - - /** - * The Constant EUROPEAN indicates the latin and extended range, - * and latin decimal base. - */ - public static final int EUROPEAN = 1; - - /** The Constant ARABIC indicates the ARABIC range and decimal base. */ - public static final int ARABIC = 2; - - /** - * The Constant EASTERN_ARABIC indicates the ARABIC range and - * ARABIC_EXTENDED decimal base. - */ - public static final int EASTERN_ARABIC = 4; - - /** - * The Constant DEVANAGARI indicates the DEVANAGARI range and - * decimal base. - */ - public static final int DEVANAGARI = 8; - - /** The Constant BENGALI indicates the BENGALI range and decimal base. */ - public static final int BENGALI = 16; - - /** The Constant GURMUKHI indicates the GURMUKHI range and decimal base. */ - public static final int GURMUKHI = 32; - - /** The Constant GUJARATI indicates the GUJARATI range and decimal base. */ - public static final int GUJARATI = 64; - - /** The Constant ORIYA indicates the ORIYA range and decimal base. */ - public static final int ORIYA = 128; - - /** The Constant TAMIL indicates the TAMIL range and decimal base. */ - public static final int TAMIL = 256; - - /** The Constant TELUGU indicates the TELUGU range and decimal base. */ - public static final int TELUGU = 512; - - /** The Constant KANNADA indicates the KANNADA range and decimal base. */ - public static final int KANNADA = 1024; - - /** - * The Constant MALAYALAM indicates the MALAYALAM range and decimal base. - */ - public static final int MALAYALAM = 2048; - - /** The Constant THAI indicates the THAI range and decimal base. */ - public static final int THAI = 4096; - - /** The Constant LAO indicates the LAO range and decimal base. */ - public static final int LAO = 8192; - - /** The Constant TIBETAN indicates the TIBETAN range and decimal base. */ - public static final int TIBETAN = 16384; - - /** The Constant MYANMAR indicates the MYANMAR range and decimal base. */ - public static final int MYANMAR = 32768; - - /** - * The Constant ETHIOPIC indicates the ETHIOPIC range and decimal base. - */ - public static final int ETHIOPIC = 65536; - - /** The Constant KHMER indicates the KHMER range and decimal base. */ - public static final int KHMER = 131072; - - /** - * The Constant MONGOLIAN indicates the MONGOLIAN range and - * decimal base. - */ - public static final int MONGOLIAN = 262144; - - /** The Constant ALL_RANGES indicates all ranges. */ - public static final int ALL_RANGES = 524287; - - /* Further one can find the set of script indices. - * Index is the power you need the 2 to raise to to get corresponding - * range constant value. Also script ranges, context names and digits low - * ranges are indexed with these indices. - */ - - // Index of the EUROPEAN range - /** The Constant INDEX_EUROPEAN. */ - private static final int INDEX_EUROPEAN = 0; - - // Index of the ARABIC range - /** The Constant INDEX_ARABIC. */ - private static final int INDEX_ARABIC = 1; - - // Index of the EASTERN_ARABIC range - /** The Constant INDEX_EASTERN_ARABIC. */ - private static final int INDEX_EASTERN_ARABIC = 2; - - // Index of the DEVANAGARI range - /** The Constant INDEX_DEVANAGARI. */ - private static final int INDEX_DEVANAGARI = 3; - - // Index of the BENGALI range - /** The Constant INDEX_BENGALI. */ - private static final int INDEX_BENGALI = 4; - - // Index of the GURMUKHI range - /** The Constant INDEX_GURMUKHI. */ - private static final int INDEX_GURMUKHI = 5; - - // Index of the GUJARTI range - /** The Constant INDEX_GUJARATI. */ - private static final int INDEX_GUJARATI = 6; - - // Index of the ORIYA range - /** The Constant INDEX_ORIYA. */ - private static final int INDEX_ORIYA = 7; - - // Index of the TAMIL range - /** The Constant INDEX_TAMIL. */ - private static final int INDEX_TAMIL = 8; - - // Index of the TELUGU range - /** The Constant INDEX_TELUGU. */ - private static final int INDEX_TELUGU = 9; - - // Index of the KANNADA range - /** The Constant INDEX_KANNADA. */ - private static final int INDEX_KANNADA = 10; - - // Index of the MALAYALAM range - /** The Constant INDEX_MALAYALAM. */ - private static final int INDEX_MALAYALAM = 11; - - // Index of the THAI range - /** The Constant INDEX_THAI. */ - private static final int INDEX_THAI = 12; - - // Index of the LAO range - /** The Constant INDEX_LAO. */ - private static final int INDEX_LAO = 13; - - // Index of the TIBETAN range - /** The Constant INDEX_TIBETAN. */ - private static final int INDEX_TIBETAN = 14; - - // Index of the MYANMAR range - /** The Constant INDEX_MYANMAR. */ - private static final int INDEX_MYANMAR = 15; - - // Index of the ETHIOPIC range - /** The Constant INDEX_ETHIOPIC. */ - private static final int INDEX_ETHIOPIC = 16; - - // Index of the KHMER range - /** The Constant INDEX_KHMER. */ - private static final int INDEX_KHMER = 17; - - // Index of the MONGOLIAN range - /** The Constant INDEX_MONGOLIAN. */ - private static final int INDEX_MONGOLIAN = 18; - - // Maximum index that range can't exceed - /** The Constant MAX_INDEX. */ - private static final int MAX_INDEX = 19; - - /* - * Scripts ranges array. Array represents ranges as pairs of - * lowest and highest range bounds. - * Data is taken from the UnicodeData.txt file from - * http://www.unicode.org/Public/UNIDATA/ - */ - /** The scripts ranges. */ - private final int[] scriptsRanges = { - 0x0000, 0x024F, // EUROPEAN (basic latin + latin-1 + extended) - 0x0600, 0x06FF, // ARABIC - 0x0600, 0x06FF, // EASTERN_ARABIC (XXX: diff with ARABIC ? ) - 0x0900, 0x097F, // DEVANAGARI - 0x0980, 0x09FF, // BENGALI - 0x0A00, 0x0A7F, // GURMUKHI - 0x0A80, 0x0AFF, // GUJARATI - 0x0B00, 0x0B7F, // ORIYA - 0x0B80, 0x0BFF, // TAMIL - 0x0C00, 0x0C7F, // TELUGU - 0x0C80, 0x0CFF, // KANNADA - 0x0D00, 0x0D7F, // MALAYALAM - 0x0E00, 0x0E7F, // THAI - 0x0E80, 0x0EFF, // LAO - 0x0F00, 0x0FFF, // TIBETAN - 0x1000, 0x109F, // MYANMAR - 0x1200, 0x137F, // ETHIOPIC - 0x1780, 0x17FF, // KHMER - 0x1800, 0x18AF // MONGOLIAN - }; - - /* - * Digit low ranges values decreased by 0x0030. Each low range - * value decreased by 0x0030 for easy obtaing unicode value of the - * context dependent digit. European digits starts from 0x0030 hence - * context dependent unicode digit value equals to - * digitsLowRanges[script index] + european digit char unicode value. - * !! the only exception is ETHIOPIC script where there is no '0' digit - * Data is taken from the UnicodeData.txt file from - * http://www.unicode.org/Public/UNIDATA/ - */ - /** The digits low ranges. */ - private final int[] digitsLowRanges = { - 0x0000, // EUROPEAN - 0x0630, // ARABIC - 0x0630, // EASTERN_ARABIC - 0x0936, // DEVANAGARI - 0x09B6, // BENGALI - 0x0A36, // GURMUKHI - 0x0AB6, // GUJARATI - 0x0B36, // ORIYA - 0x0BB6, // TAMIL - 0x0C36, // TELUGU - 0x0CB6, // KANNADA - 0x0D36, // MALAYALAM - 0x0E20, // THAI - 0x0EA0, // LAO - 0x0EF0, // TIBETAN - 0x1010, // MYANMAR - 0x1338, // ETHIOPIC - (low range-1) no ETHIOPIC '0' DIGIT! - 0x17B0, // KHMER - 0x17E0 // MONGOLIAN - }; - - // Set of context names used in toString method - /** The contexts. */ - private final String[] contexts = { - "EUROPEAN", //$NON-NLS-1$ - "ARABIC", //$NON-NLS-1$ - "EASTERN_ARABIC", //$NON-NLS-1$ - "DEVANAGARI", //$NON-NLS-1$ - "BENGALI", //$NON-NLS-1$ - "GURMUKHI", //$NON-NLS-1$ - "GUJARATI", //$NON-NLS-1$ - "ORIYA", //$NON-NLS-1$ - "TAMIL", //$NON-NLS-1$ - "TELUGU", //$NON-NLS-1$ - "KANNADA", //$NON-NLS-1$ - "MALAYALAM", //$NON-NLS-1$ - "THAI", //$NON-NLS-1$ - "LAO", //$NON-NLS-1$ - "TIBETAN", //$NON-NLS-1$ - "MYANMAR", //$NON-NLS-1$ - "ETHIOPIC", //$NON-NLS-1$ - "KHMER", //$NON-NLS-1$ - "MONGOLIAN" //$NON-NLS-1$ - }; - - /* - * Strong characters flags array is to determine if the - * unicode bidirectional category of the character is strong, - * according to Unicode specification. If the bit with index equals to - * character's unicode value is 1 - the character is strong. - * This array was generated using UnicodeData.txt file from - * http://www.unicode.org/Public/UNIDATA/ - */ - - /** The Constant STRONG_TEXT_FLAGS. */ - private static final int[] STRONG_TEXT_FLAGS = { 0, 0, 134217726, 134217726, - 0, 69207040, -8388609, -8388609, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -65533, -1, -1, -100663297, 196611, 16415, 0, 0, 0, - 67108864, -10432, -5, -32769, -4194305, -1, -1, -1, -1, -1017, -1, - -32769, 67108863, 65535, -131072, -25165825, -2, 767, 1073741824, - -65463, 2033663, -939513841, 134217726, 2047, -73728, -1, -1, - 541065215, -67059616, -180225, 65535, -8192, 16383, -1, 131135, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, -469762049, -16703999, 537001971, - -417812, -473563649, -1333765759, 133431235, -423960, -1016201729, - 1577058305, 1900480, -278552, -470942209, 72193, 65475, -417812, - 1676541439, -1333782143, 262083, -700594200, -1006647528, 8396230, - 524224, -139282, 66059775, 30, 65475, -139284, -470811137, - 1080036831, 65475, -139284, -1006633473, 8396225, 65475, -58720276, - 805044223, -16547713, 1835008, -2, 917503, 268402815, 0, -17816170, - 537783470, 872349791, 0, -50331649, -1050673153, -257, -2147481601, - 3872, -1073741824, 237503, 0, -1, 16914171, 16777215, 0, 0, -1, - -65473, 536870911, -1, -1, -2080374785, -1, -1, -249, -1, 67108863, - -1, -1, 1031749119, -1, -49665, 2134769663, -8388803, -1, - -12713985, -1, 134217727, 536870911, 65535, -1, -1, 2097151, -2, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 8388607, 134217726, -1, -1, 131071, 253951, 6553599, 262143, - 122879, -1, -1065353217, 401605055, 1023, 67043328, -1, -1, - 16777215, -1, 511, 0, 0, 536870911, 33226872, -64, 2047999, -1, - -64513, 67044351, 0, -830472193, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, 0, 0, - -1, -1, -1, -1, 268435455, -1, -1, 67108863, 1061158911, -1, - -1426112705, 1073741823, -1, 1608515583, 265232348, 534519807, - 49152, 27648, 0, -2147352576, 2031616, 0, 0, 0, 1043332228, - -201605808, 992, -1, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - -4194304, -1, 134217727, 2097152, 0, 0, 0, 0, 0, 0, 0, -268435456, - -1, -1, 1023, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4096, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, - -32769, 2147483647, 0, -1, -1, -1, 31, -1, -65473, -1, 32831, - 8388607, 2139062143, 2139062143, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 224, 524157950, -2, -1, -528482305, -2, -1, - -134217729, -32, -122881, -1, -1, -32769, 16777215, 0, -65536, - 536870911, -1, 15, -1879048193, -1, 131071, -61441, 2147483647, -1, - -1, -1, -125829121, -1, -1, 1073741823, 2147483647, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 2097152, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 134217728, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 8191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2117, 159, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 8, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2147483648, 1, 0, 0, -2147483648, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, -2147483648, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2147483648, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -49153, -1, -63489, -1, -1, 67108863, 0, - -1594359681, 1602223615, -37, -1, -1, 262143, -524288, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 1073741823, -65536, -1, -196609, -1, - 255, 536805376, 0, 0, 0, -2162688, -1, -1, -1, 536870911, 0, - 134217726, 134217726, -64, -1, 2147483647, 486341884, 0 - - }; - - // index of context range (Serialization support) - /** The key. */ - private int key; - - // flag, true if shaping contextual (Serialization support) - /** The mask. */ - private int mask; - - // ranges to be shaped - /** The ranges. */ - private int fRanges; - - // index of the default context - /** The default context index. */ - private int fDefaultContextIndex; - - // flag if NumericShaper shapes contextually - /** The contextual. */ - private boolean fContextual; - - // uses for non-context dependent case only - /** The single range index. */ - private int fSingleRangeIndex; - - /** - * Creates NumericShaper with specified parameters. - * - * @param ranges specified ranges to be shaped - * @param defaultContext default context range - * @param isContextual specifies if the instance is contextual - */ - private NumericShaper(int ranges, int defaultContext, boolean isContextual){ - this.fRanges = ranges; - this.fDefaultContextIndex = getIndexFromRange(defaultContext); - this.fContextual = isContextual; - - if (!fContextual){ - fSingleRangeIndex = getIndexFromRange(ranges); - } - } - - /** - * Returns script index of the specified context range. - * - * @param range specified range - * - * @return one of the script indices according to the specified range. - */ - private int getIndexFromRange(int range){ - if (range == 0) { - throw rangeException(range); - } - - int index = 0; - while (index < MAX_INDEX){ - if (range == (1 << index)){ - return index; - } - index++; - } - - throw rangeException(range); - } - - /** - * Returns range corresponding to the specified script index. - * - * @param index specified script index - * - * @return one of the range constants according to the specified script index. - */ - private int getRangeFromIndex(int index){ - if (index < 0 || index >= MAX_INDEX){ - throw rangeException(index); - } - - return 1 << index; - } - - private static IllegalArgumentException rangeException(int value) { - throw new IllegalArgumentException("Illegal range argument value: " + value); - } - - @Override - public int hashCode() { - HashCode hash = new HashCode(); - - hash.append(fRanges); - hash.append(fDefaultContextIndex); - hash.append(fContextual); - - return hash.hashCode(); - - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - - if (obj == this) { - return true; - } - - try { - NumericShaper ns = (NumericShaper)obj; - return (fRanges == ns.fRanges && - fDefaultContextIndex == ns.fDefaultContextIndex && - fContextual == ns.fContextual); - } catch (ClassCastException e){ - } - - return false; - } - - @Override - public String toString() { - /* !! There is no description in the documentation what this method must - * return. Thus format of toString method is based on 1.5 release - * behavior and can be obtained using next test sample: - * - * // Simple shapers toString format - * System.out.println(NumericShaper.getShaper(NumericShaper.EASTERN_ARABIC)); - * - * // Context shapers with default context toString format - * System.out.println(NumericShaper.getContextualShaper( - * NumericShaper.ARABIC | NumericShaper.TAMIL)); - * - * // Context shapers with context - * System.out.println(NumericShaper.getContextualShaper( - * NumericShaper.ARABIC | NumericShaper.TAMIL, - * NumericShaper.EASTERN_ARABIC)); - */ - StringBuffer sb = new StringBuffer(super.toString()); - - sb.append("[contextual:"); //$NON-NLS-1$ - sb.append(fContextual); - - if (fContextual){ - sb.append(", context:"); //$NON-NLS-1$ - sb.append(contexts[fDefaultContextIndex]); - } - - sb.append(", range(s): "); //$NON-NLS-1$ - if (fContextual) { - int index = 0; - boolean isFirst = true; - while (index < MAX_INDEX){ - if ((fRanges & (1 << index)) != 0){ - if (isFirst){ - isFirst = false; - } else { - sb.append(", "); //$NON-NLS-1$ - } - sb.append(contexts[index]); - } - index++; - } - } else { - sb.append(contexts[fSingleRangeIndex]); - } - sb.append("]"); //$NON-NLS-1$ - - return sb.toString(); - } - - /** - * Gets the NumericShaper for the specified unicode ranges - * and default unicode range. The defaultContext parameter - * is used as the starting context (which indicates the - * language/script being used). The OR logical operation - * should be used for multiple ranges: - * NumericShaper.DEVANAGARI | NumericShaper.BENGALI. - * The NumericShaper returned by this method is contextual - * in that it supports multiple character ranges, depending - * on the context. - * - * @param ranges the unicode ranges. - * @param defaultContext the default, starting context. - * - * @return the NumericShaper for the specified ranges. - */ - public static NumericShaper getContextualShaper(int ranges, - int defaultContext) { - ranges &= ALL_RANGES; - defaultContext &= ALL_RANGES; - return new NumericShaper(ranges, defaultContext, true); - } - - /** - * Gets the NumericShaper for the specified unicode ranges. - * The OR logical operation should be used for multiple ranges: - * NumericShaper.DEVANAGARI | NumericShaper.BENGALI. - * The NumericShaper returned by this method is contextual - * in that it supports multiple character ranges, depending - * on the context. - * - * @param ranges the unicode ranges. - * - * @return the NumericShaper for the specified ranges. - */ - public static NumericShaper getContextualShaper(int ranges) { - ranges &= ALL_RANGES; - return new NumericShaper(ranges, EUROPEAN, true); - } - - /** - * Gets the masks for all of the ranges supported by this NumericShaper, - * packed into an int value using the logical OR logical operation - * for multiple ranges: - * NumericShaper.DEVANAGARI | NumericShaper.BENGALI. - * - * @return all ranges of this NumericShaper. - */ - public int getRanges() { - return fRanges; - } - - /** - * Gets a NumericShaper for the specified unicode range. - * The NumericShaper supports only a single range and - * hence is not contextual. - * - * @param singleRange the specified unicode single range. - * - * @return the NumericShaper for the specified unicode range. - */ - public static NumericShaper getShaper(int singleRange) { - singleRange &= ALL_RANGES; - return new NumericShaper(singleRange, EUROPEAN, false); - } - - /** - * Checks if this NumericShaper is contextual (supporting - * multiple script ranges) or not. - * - * @return true, if this NumericShaper is contextual, false otherwise. - */ - public boolean isContextual() { - return fContextual; - } - - /** - * Transforms the encoding of the text, starting from the character - * at index start and transforming count characters, - * using the specified context. - * - * @param text the text to be shaped. - * @param start the start offset of the text. - * @param count the number of characters to be shaped. - * @param context the context to be used for shaping. - */ - public void shape(char[] text, int start, int count, int context) { - if (isContextual()){ - contextualShape(text, start, count, getIndexFromRange(context)); - } else { - nonContextualShape(text, start, count); - } - } - - /** - * Transforms the encoding of the text, starting from the character - * at index start and transforming count characters. - * - * @param text the text to be shaped. - * @param start the start offset of the text. - * @param count the number of characters to be shaped. - */ - public void shape(char[] text, int start, int count) { - if (isContextual()){ - contextualShape(text, start, count, fDefaultContextIndex); - } else { - nonContextualShape(text, start, count); - } - } - - /** - * Converts count of digits of the given array of characters from the start - * index using specified context. This method is applied for the contextual - * shaping, if the shaper instance is not contextual use nonContextualShape - * method. - * - * @param text an array of chars - * @param start index of the first character to convert - * @param count a number of characters to convert - * @param contextIndex index of the script index to use in shaper - */ - private void contextualShape(char[] text, int start, int count, - int contextIndex){ - char maxDigit = (char)0x0039; - char minDigit = (char)0x0030; - - int currIndex; - if (((1 << contextIndex) & fRanges) == 0 ){ - currIndex = INDEX_EUROPEAN; - } else { - currIndex = contextIndex; - } - - for (int ind = start; ind < start + count; ind++){ - if (minDigit <= text[ind] && text[ind] <= maxDigit){ - if (currIndex != INDEX_ETHIOPIC || text[ind] != '0'){ - text[ind] = (char)(digitsLowRanges[currIndex] + text[ind]); - } - } else { - if(isCharStrong(text[ind])){ - int index = getCharIndex(text[ind]); - if (currIndex != index){ - if (((1 << index) & fRanges) != 0){ - currIndex = index; - } else { - currIndex = INDEX_EUROPEAN; - } - } - } - } - } - - } - - /** - * Converts count of digits of the given array of characters from the start - * index. Method is applied for non-contextual shaper. - * - * @param text an array of chars - * @param start index of the first character to convert - * @param count a number of characters to convert - */ - private void nonContextualShape(char[] text, int start, int count){ - char maxDigit = (char)0x0039; - char minDigit = (char)((fRanges == ETHIOPIC) ? 0x0031 : 0x0030); - for (int ind = start; ind < start + count; ind++){ - if (minDigit <= text[ind] && text[ind] <= maxDigit){ - text[ind] = (char)(digitsLowRanges[fSingleRangeIndex] + text[ind]); - } - } - - } - - /** - * Returns the index of the script of the specified char. - * - * @param ch specified unicode character - * - * @return script index corresponding to the given char - */ - private int getCharIndex(char ch){ - int index = INDEX_EUROPEAN; - for (int i=0; i < MAX_INDEX; i++){ - int j = i * 2; - if (scriptsRanges[j] <= ch && ch <= scriptsRanges[j+1]){ - return i; - } - } - - return index; - } - - /** - * Returns true if the bidirectional category of the character - * is strong. - * - * @param chr the chr - * - * @return true, if the character is strong, false otherwise - */ - private boolean isCharStrong(int chr) { - return (STRONG_TEXT_FLAGS[chr >> 5] & (1 << (chr % 32))) != 0; - } - - /** - * Updates all private serialized fields for object to be correctly serialized - * according to the serialized form of this class mentioned in the - * documentation. - */ - private void updateRangesFields(){ - fRanges = (mask & ~(1 << 31)); - fContextual = ((mask &(1 << 31)) != 0); - if (fContextual){ - fRanges = (mask & ~(1 << 31)); - fDefaultContextIndex = key; - } else { - fRanges = mask; - fSingleRangeIndex = key; - } - } - - /** - * Updates private fields for object after deserialization - * according to the serialized form of this class mentioned in the - * documentation. - */ - private void updateKeyMaskFields(){ - mask = fRanges; - if (fContextual){ - mask |= (1 << 31); - key = fDefaultContextIndex; - } else{ - key = fSingleRangeIndex; - } - } - - /** - * Write object. - * - * @param out the out - * - * @throws IOException Signals that an I/O exception has occurred. - */ - private void writeObject(java.io.ObjectOutputStream out) - throws IOException{ - updateKeyMaskFields(); - out.defaultWriteObject(); - } - - /** - * Read object. - * - * @param in the in - * - * @throws IOException Signals that an I/O exception has occurred. - * @throws ClassNotFoundException the class not found exception - */ - private void readObject(java.io.ObjectInputStream in) - throws IOException, ClassNotFoundException{ - in.defaultReadObject(); - updateRangesFields(); - } - -} - diff --git a/awt-kernel/src/main/java/java/awt/font/TextAttribute.java b/awt-kernel/src/main/java/java/awt/font/TextAttribute.java deleted file mode 100644 index 0f00ae8..0000000 --- a/awt-kernel/src/main/java/java/awt/font/TextAttribute.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @author Ilya S. Okomin - * @version $Revision$ - */ -package java.awt.font; - -import java.io.InvalidObjectException; -import java.text.AttributedCharacterIterator.Attribute; -import java.util.HashMap; -import java.util.Map; - -/** - * The TextAttribute class defines attribute keys and attribute values - * for text rendering. Each TextAttributes should have the following - * information: - * - */ -public final class TextAttribute extends Attribute { - - /** The Constant serialVersionUID. */ - private static final long serialVersionUID = 7744112784117861702L; - - // set of available text attributes - /** The Constant attrMap. */ - private static final Map attrMap = new HashMap(); - - /** - * Instantiates a new TextAttribute with the specified name. - * - * @param name the name of TextAttribute. - */ - protected TextAttribute(String name) { - super(name); - attrMap.put(name, this); - } - - /** - * Resolves the instance being deserialized. - * - * @return the Object. - * - * @throws InvalidObjectException the InvalidObjectException. - */ - @Override - protected Object readResolve() throws InvalidObjectException { - TextAttribute result = attrMap.get(this.getName()); - if (result != null) { - return result; - } - throw new InvalidObjectException("Unknown attribute name"); - } - - /** - * The BACKGROUND text attribute. - */ - public static final TextAttribute BACKGROUND = new TextAttribute("background"); //$NON-NLS-1$ - - /** The BIDI_EMBEDDING text attribute key. */ - public static final TextAttribute BIDI_EMBEDDING = new TextAttribute("bidi_embedding"); //$NON-NLS-1$ - - /** The CHAR_REPLACEMENT text attribute key. */ - public static final TextAttribute CHAR_REPLACEMENT = new TextAttribute("char_replacement"); //$NON-NLS-1$ - - /** The FAMILY text attribute key. */ - public static final TextAttribute FAMILY = new TextAttribute("family"); //$NON-NLS-1$ - - /** The FONT text attribute key. */ - public static final TextAttribute FONT = new TextAttribute("font"); //$NON-NLS-1$ - - /** The FOREGROUND text attribute key. */ - public static final TextAttribute FOREGROUND = new TextAttribute("foreground"); //$NON-NLS-1$ - - /** The INPUT_METHOD_HIGHLIGHT text attribute key. */ - public static final TextAttribute INPUT_METHOD_HIGHLIGHT = new TextAttribute( - "input method highlight"); //$NON-NLS-1$ - - /** The INPUT_METHOD_UNDERLINE text attribute key. */ - public static final TextAttribute INPUT_METHOD_UNDERLINE = new TextAttribute( - "input method underline"); //$NON-NLS-1$ - - /** The JUSTIFICATION text attribute key. */ - public static final TextAttribute JUSTIFICATION = new TextAttribute("justification"); //$NON-NLS-1$ - - /** The Constant JUSTIFICATION_indicates the full requested width. */ - public static final Float JUSTIFICATION_FULL = new Float(1.0f); - - /** - * The Constant JUSTIFICATION_NONE indicates that line is not - * allowed for justification. - */ - public static final Float JUSTIFICATION_NONE = new Float(0.0f); - - /** The NUMERIC_SHAPING text attribute. */ - public static final TextAttribute NUMERIC_SHAPING = new TextAttribute("numeric_shaping"); //$NON-NLS-1$ - - /** The POSTURE text attribute. */ - public static final TextAttribute POSTURE = new TextAttribute("posture"); //$NON-NLS-1$ - - /** The Constant POSTURE_REGULAR indicates regular posture. */ - public static final Float POSTURE_REGULAR = new Float(0.0f); - - /** The Constant POSTURE_OBLIQUE indicates italic posture. */ - public static final Float POSTURE_OBLIQUE = new Float(0.20f); - - /** The RUN_DIRECTION text attribute. */ - public static final TextAttribute RUN_DIRECTION = new TextAttribute("run_direction"); //$NON-NLS-1$ - - /** - * The Constant RUN_DIRECTION_LTR indicates left-to-right run - * direction. - */ - public static final Boolean RUN_DIRECTION_LTR = false; - - /** - * The Constant RUN_DIRECTION_RTL indicates right-to-left run - * direction. - */ - public static final Boolean RUN_DIRECTION_RTL = true; - - /** The SIZE text attribute. */ - public static final TextAttribute SIZE = new TextAttribute("size"); //$NON-NLS-1$ - - /** The STRIKETHROUGH text attribute. */ - public static final TextAttribute STRIKETHROUGH = new TextAttribute("strikethrough"); //$NON-NLS-1$ - - /** The Constant STRIKETHROUGH_ON indicates a single strikethrough. */ - public static final Boolean STRIKETHROUGH_ON = true; - - /** The SUPERSCRIPT text attribute. */ - public static final TextAttribute SUPERSCRIPT = new TextAttribute("superscript"); //$NON-NLS-1$ - - /** The Constant SUPERSCRIPT_SUB indicates a standard subscript. */ - public static final Integer SUPERSCRIPT_SUB = -1; - - /** The Constant SUPERSCRIPT_SUPER indicates a standard superscript. */ - public static final Integer SUPERSCRIPT_SUPER = 1; - - /** The SWAP_COLORS text attribute. */ - public static final TextAttribute SWAP_COLORS = new TextAttribute("swap_colors"); //$NON-NLS-1$ - - /** - * The Constant SWAP_COLORS_ON indicates a swap of foreground - * and background. - */ - public static final Boolean SWAP_COLORS_ON = true; - - /** The TRANSFORM text attribute. */ - public static final TextAttribute TRANSFORM = new TextAttribute("transform"); //$NON-NLS-1$ - - /** The Constant UNDERLINE text attribute. */ - public static final TextAttribute UNDERLINE = new TextAttribute("underline"); //$NON-NLS-1$ - - /** - * The Constant UNDERLINE_ON indicates a standard underline - * at the roman baseline for roman text. - */ - public static final Integer UNDERLINE_ON = 0; - - /** - * The Constant UNDERLINE_LOW_ONE_PIXEL indicates a single - * pixel solid low underline. - */ - public static final Integer UNDERLINE_LOW_ONE_PIXEL = 1; - - /** - * The Constant UNDERLINE_LOW_TWO_PIXEL indicates a double - * pixel solid low underline. - */ - public static final Integer UNDERLINE_LOW_TWO_PIXEL = 2; - - /** - * The Constant UNDERLINE_LOW_DOTTED indicates a - * single pixel dotted low underline. - */ - public static final Integer UNDERLINE_LOW_DOTTED = 3; - - /** - * The Constant UNDERLINE_LOW_GRAY indicates double pixel - * gray low underline. - */ - public static final Integer UNDERLINE_LOW_GRAY = 4; - - /** - * The Constant UNDERLINE_LOW_DASHED indicates single pixel dashed - * low underline. - */ - public static final Integer UNDERLINE_LOW_DASHED = 5; - - /** The WEIGHT text attribute. */ - public static final TextAttribute WEIGHT = new TextAttribute("weight"); //$NON-NLS-1$ - - /** - * The Constant WEIGHT_EXTRA_LIGHT indicates the lightest - * predefined weight. - */ - public static final Float WEIGHT_EXTRA_LIGHT = new Float(0.5f); - - /** - * The Constant WEIGHT_LIGHT indicates the standard light weight. - */ - public static final Float WEIGHT_LIGHT = new Float(0.75f); - - /** - * The Constant WEIGHT_DEMILIGHT indicates an intermediate weight - * between LIGHT and STANDARD. - */ - public static final Float WEIGHT_DEMILIGHT = new Float(0.875f); - - /** - * The Constant WEIGHT_REGULAR indicates the standart weight. - */ - public static final Float WEIGHT_REGULAR = new Float(1.0f); - - /** - * The Constant WEIGHT_SEMIBOLD indicates a semi weight - * of REGULAR. - */ - public static final Float WEIGHT_SEMIBOLD = new Float(1.25f); - - /** The Constant WEIGHT_MEDIUM indicates average weight - * between the REGULAR and BOLD. */ - public static final Float WEIGHT_MEDIUM = new Float(1.5f); - - /** The Constant WEIGHT_DEMIBOLD indicates - * a lighter weight than BOLD. */ - public static final Float WEIGHT_DEMIBOLD = new Float(1.75f); - - /** The Constant WEIGHT_BOLD indicates the standard bold weight. */ - public static final Float WEIGHT_BOLD = new Float(2.0f); - - /** The Constant WEIGHT_HEAVY indicates a heavier weight than BOLD. */ - public static final Float WEIGHT_HEAVY = new Float(2.25f); - - /** The Constant WEIGHT_EXTRABOLD indicates an extra heavy weight. */ - public static final Float WEIGHT_EXTRABOLD = new Float(2.5f); - - /** - * The Constant WEIGHT_ULTRABOLD indicates the heaviest predefined - * weight. - */ - public static final Float WEIGHT_ULTRABOLD = new Float(2.75f); - - /** The WIDTH text attribute. */ - public static final TextAttribute WIDTH = new TextAttribute("width"); //$NON-NLS-1$ - - /** - * The Constant WIDTH_CONDENSED indicates the most condensed - * predefined width. - */ - public static final Float WIDTH_CONDENSED = new Float(0.75f); - - /** - * The Constant WIDTH_SEMI_CONDENSED indicates - * a semi condensed width. - */ - public static final Float WIDTH_SEMI_CONDENSED = new Float(0.875f); - - /** - * The Constant WIDTH_REGULAR indicates the standard width. - */ - public static final Float WIDTH_REGULAR = new Float(1.0f); - - /** - * The Constant WIDTH_SEMI_EXTENDED indicates semi extended width. - */ - public static final Float WIDTH_SEMI_EXTENDED = new Float(1.25f); - - /** - * The Constant WIDTH_EXTENDED indicates extended width. - */ - public static final Float WIDTH_EXTENDED = new Float(1.5f); - -} diff --git a/awt-kernel/src/main/java/java/beans/IndexedPropertyChangeEvent.java b/awt-kernel/src/main/java/java/beans/IndexedPropertyChangeEvent.java deleted file mode 100644 index f52d6e6..0000000 --- a/awt-kernel/src/main/java/java/beans/IndexedPropertyChangeEvent.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package java.beans; - -/** - * A type of {@link PropertyChangeEvent} that indicates that an indexed property - * has changed. - */ -public class IndexedPropertyChangeEvent extends PropertyChangeEvent { - - private static final long serialVersionUID = -320227448495806870L; - - private final int index; - - /** - * Creates a new property changed event with an indication of the property - * index. - * - * @param source - * the changed bean. - * @param propertyName - * the changed property, or null to indicate an - * unspecified set of the properties has changed. - * @param oldValue - * the previous value of the property, or null if - * the propertyName is null or the - * previous value is unknown. - * @param newValue - * the new value of the property, or null if the - * propertyName is null or the new - * value is unknown.. - * @param index - * the index of the property. - */ - public IndexedPropertyChangeEvent(Object source, String propertyName, - Object oldValue, Object newValue, int index) { - super(source, propertyName, oldValue, newValue); - this.index = index; - } - - /** - * Answer the index of the property that was changed in this event. - * - * @return the property element index. - */ - public int getIndex() { - return index; - } -} diff --git a/awt-kernel/src/main/java/java/beans/PropertyChangeEvent.java b/awt-kernel/src/main/java/java/beans/PropertyChangeEvent.java deleted file mode 100644 index d614be3..0000000 --- a/awt-kernel/src/main/java/java/beans/PropertyChangeEvent.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package java.beans; - -import java.util.EventObject; - -/** - * An event that indicates that a constraint or a boundary of a property has - * changed. - */ -public class PropertyChangeEvent extends EventObject { - - private static final long serialVersionUID = 7042693688939648123L; - - String propertyName; - - Object oldValue; - - Object newValue; - - Object propagationId; - - /** - * The constructor used to create a new {@code PropertyChangeEvent}. - * - * @param source - * the changed bean. - * @param propertyName - * the changed property, or null to indicate an - * unspecified set of the properties has changed. - * @param oldValue - * the previous value of the property, or null if - * the propertyName is null or the - * previous value is unknown. - * @param newValue - * the new value of the property, or null if the - * propertyName is null or the new - * value is unknown. - */ - public PropertyChangeEvent(Object source, String propertyName, - Object oldValue, Object newValue) { - super(source); - - this.propertyName = propertyName; - this.oldValue = oldValue; - this.newValue = newValue; - } - - /** - * Returns the name of the property that has changed. If an unspecified set - * of properties has changed it returns null. - * - * @return the name of the property that has changed, or null. - */ - public String getPropertyName() { - return propertyName; - } - - /** - * Sets the propagationId object. - * - * @see #getPropagationId() - */ - public void setPropagationId(Object propagationId) { - this.propagationId = propagationId; - } - - /** - * Returns the propagationId object. This is reserved for future use. Beans - * 1.0 demands that a listener receiving this property and then sending its - * own PropertyChangeEvent sets the received propagationId on the new - * PropertyChangeEvent's propagationId field. - * - * @return the propagationId object. - */ - public Object getPropagationId() { - return propagationId; - } - - /** - * Returns the old value that the property had. If the old value is unknown - * this method returns null. - * - * @return the old property value or null. - */ - public Object getOldValue() { - return oldValue; - } - - /** - * Returns the new value that the property now has. If the new value is - * unknown this method returns null. - * - * @return the old property value or null. - */ - public Object getNewValue() { - return newValue; - } -} diff --git a/awt-kernel/src/main/java/java/beans/PropertyChangeListener.java b/awt-kernel/src/main/java/java/beans/PropertyChangeListener.java deleted file mode 100644 index a0a4201..0000000 --- a/awt-kernel/src/main/java/java/beans/PropertyChangeListener.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package java.beans; - -import java.util.EventListener; - -/** - * A PropertyChangeListener can subscribe with a event source. Whenever that - * source raises a PropertyChangeEvent this listener will get notified. - */ -public interface PropertyChangeListener extends EventListener { - - /** - * The source bean calls this method when an event is raised. - * - * @param event - * the {@link PropertyChangeEvent} object which contains the name - * and the old and new value of the property that has changed. - */ - public void propertyChange(PropertyChangeEvent event); -} diff --git a/awt-kernel/src/main/java/java/beans/PropertyChangeListenerProxy.java b/awt-kernel/src/main/java/java/beans/PropertyChangeListenerProxy.java deleted file mode 100644 index 4841b72..0000000 --- a/awt-kernel/src/main/java/java/beans/PropertyChangeListenerProxy.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package java.beans; - -import java.util.EventListenerProxy; - -/** - * The implementation of this listener proxy just delegates the received events - * to its listener. - */ -public class PropertyChangeListenerProxy extends EventListenerProxy implements - PropertyChangeListener { - - String propertyName; - - /** - * Creates a new listener proxy that associates a listener with a property - * name. - * - * @param propertyName - * the name of the associated property. - * @param listener - * the listener to delegate incoming events to. - */ - public PropertyChangeListenerProxy(String propertyName, - PropertyChangeListener listener) { - super(listener); - this.propertyName = propertyName; - } - - /** - * Returns the name of the property associated with this listener proxy. - * - * @return the name of the associated property. - */ - public String getPropertyName() { - return propertyName; - } - - public void propertyChange(PropertyChangeEvent event) { - PropertyChangeListener listener = (PropertyChangeListener) getListener(); - listener.propertyChange(event); - } -} diff --git a/awt-kernel/src/main/java/java/beans/PropertyChangeSupport.java b/awt-kernel/src/main/java/java/beans/PropertyChangeSupport.java deleted file mode 100644 index 32e2da6..0000000 --- a/awt-kernel/src/main/java/java/beans/PropertyChangeSupport.java +++ /dev/null @@ -1,501 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package java.beans; - -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.io.Serializable; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - -/** - * This utility class - * - */ -public class PropertyChangeSupport implements Serializable { - - private static final long serialVersionUID = 6401253773779951803l; - - private transient Object sourceBean; - - private transient List allPropertiesChangeListeners = - new ArrayList(); - - private transient Map> - selectedPropertiesChangeListeners = - new HashMap>(); - - // fields for serialization compatibility - private Hashtable> children; - - private Object source; - - private int propertyChangeSupportSerializedDataVersion = 1; - - /** - * Creates a new instance that uses the source bean as source for any event. - * - * @param sourceBean - * the bean used as source for all events. - */ - public PropertyChangeSupport(Object sourceBean) { - if (sourceBean == null) { - throw new NullPointerException(); - } - this.sourceBean = sourceBean; - } - - /** - * Fires a {@link PropertyChangeEvent} with the given name, old value and - * new value. As source the bean used to initialize this instance is used. - * If the old value and the new value are not null and equal the event will - * not be fired. - * - * @param propertyName - * the name of the property - * @param oldValue - * the old value of the property - * @param newValue - * the new value of the property - */ - public void firePropertyChange(String propertyName, Object oldValue, - Object newValue) { - PropertyChangeEvent event = createPropertyChangeEvent(propertyName, - oldValue, newValue); - doFirePropertyChange(event); - } - - /** - * Fires an {@link IndexedPropertyChangeEvent} with the given name, old - * value, new value and index. As source the bean used to initialize this - * instance is used. If the old value and the new value are not null and - * equal the event will not be fired. - * - * @param propertyName - * the name of the property - * @param index - * the index - * @param oldValue - * the old value of the property - * @param newValue - * the new value of the property - */ - public void fireIndexedPropertyChange(String propertyName, int index, - Object oldValue, Object newValue) { - - // nulls and equals check done in doFire... - doFirePropertyChange(new IndexedPropertyChangeEvent(sourceBean, - propertyName, oldValue, newValue, index)); - } - - /** - * Removes the listener from the specific property. This only happens if it - * was registered to this property. Nothing happens if it was not - * registered with this property or if the property name or the listener is - * null. - * - * @param propertyName - * the property name the listener is listening to - * @param listener - * the listener to remove - */ - public synchronized void removePropertyChangeListener(String propertyName, - PropertyChangeListener listener) { - if ((propertyName != null) && (listener != null)) { - List listeners = - selectedPropertiesChangeListeners.get(propertyName); - - if (listeners != null) { - listeners.remove(listener); - } - } - } - - /** - * Adds a listener to a specific property. Nothing happens if the property - * name or the listener is null. - * - * @param propertyName - * the name of the property - * @param listener - * the listener to register for the property with the given name - */ - public synchronized void addPropertyChangeListener(String propertyName, - PropertyChangeListener listener) { - if ((listener != null) && (propertyName != null)) { - List listeners = - selectedPropertiesChangeListeners.get(propertyName); - - if (listeners == null) { - listeners = new ArrayList(); - selectedPropertiesChangeListeners.put(propertyName, listeners); - } - - // RI compatibility - if (listener instanceof PropertyChangeListenerProxy) { - PropertyChangeListenerProxy proxy = - (PropertyChangeListenerProxy) listener; - - listeners.add(new PropertyChangeListenerProxy( - proxy.getPropertyName(), - (PropertyChangeListener) proxy.getListener())); - } else { - listeners.add(listener); - } - } - } - - /** - * Returns an array of listeners that registered to the property with the - * given name. If the property name is null an empty array is returned. - * - * @param propertyName - * the name of the property whose listeners should be returned - * @return the array of listeners to the property with the given name. - */ - public synchronized PropertyChangeListener[] getPropertyChangeListeners( - String propertyName) { - List listeners = null; - - if (propertyName != null) { - listeners = selectedPropertiesChangeListeners.get(propertyName); - } - - return (listeners == null) ? new PropertyChangeListener[] {} - : listeners.toArray( - new PropertyChangeListener[listeners.size()]); - } - - /** - * Fires a property change of a boolean property with the given name. If the - * old value and the new value are not null and equal the event will not be - * fired. - * - * @param propertyName - * the property name - * @param oldValue - * the old value - * @param newValue - * the new value - */ - public void firePropertyChange(String propertyName, boolean oldValue, - boolean newValue) { - PropertyChangeEvent event = createPropertyChangeEvent(propertyName, - oldValue, newValue); - doFirePropertyChange(event); - } - - /** - * Fires a property change of a boolean property with the given name. If the - * old value and the new value are not null and equal the event will not be - * fired. - * - * @param propertyName - * the property name - * @param index - * the index of the changed property - * @param oldValue - * the old value - * @param newValue - * the new value - */ - public void fireIndexedPropertyChange(String propertyName, int index, - boolean oldValue, boolean newValue) { - - if (oldValue != newValue) { - fireIndexedPropertyChange(propertyName, index, Boolean - .valueOf(oldValue), Boolean.valueOf(newValue)); - } - } - - /** - * Fires a property change of an integer property with the given name. If - * the old value and the new value are not null and equal the event will not - * be fired. - * - * @param propertyName - * the property name - * @param oldValue - * the old value - * @param newValue - * the new value - */ - public void firePropertyChange(String propertyName, int oldValue, - int newValue) { - PropertyChangeEvent event = createPropertyChangeEvent(propertyName, - oldValue, newValue); - doFirePropertyChange(event); - } - - /** - * Fires a property change of an integer property with the given name. If - * the old value and the new value are not null and equal the event will not - * be fired. - * - * @param propertyName - * the property name - * @param index - * the index of the changed property - * @param oldValue - * the old value - * @param newValue - * the new value - */ - public void fireIndexedPropertyChange(String propertyName, int index, - int oldValue, int newValue) { - - if (oldValue != newValue) { - fireIndexedPropertyChange(propertyName, index, - Integer.valueOf(oldValue), Integer.valueOf(newValue)); - } - } - - /** - * Returns true if there are listeners registered to the property with the - * given name. - * - * @param propertyName - * the name of the property - * @return true if there are listeners registered to that property, false - * otherwise. - */ - public synchronized boolean hasListeners(String propertyName) { - boolean result = allPropertiesChangeListeners.size() > 0; - if (!result && (propertyName != null)) { - List listeners = - selectedPropertiesChangeListeners.get(propertyName); - if (listeners != null) { - result = listeners.size() > 0; - } - } - return result; - } - - /** - * removes a property change listener that was registered to all properties. - * - * @param listener - * the listener to remove - */ - public synchronized void removePropertyChangeListener( - PropertyChangeListener listener) { - if (listener != null) { - if (listener instanceof PropertyChangeListenerProxy) { - String name = ((PropertyChangeListenerProxy) listener) - .getPropertyName(); - PropertyChangeListener lst = (PropertyChangeListener) - ((PropertyChangeListenerProxy) listener).getListener(); - - removePropertyChangeListener(name, lst); - } else { - allPropertiesChangeListeners.remove(listener); - } - } - } - - /** - * Registers a listener with all properties. - * - * @param listener - * the listener to register - */ - public synchronized void addPropertyChangeListener( - PropertyChangeListener listener) { - if (listener != null) { - if (listener instanceof PropertyChangeListenerProxy) { - String name = ((PropertyChangeListenerProxy) listener) - .getPropertyName(); - PropertyChangeListener lst = (PropertyChangeListener) - ((PropertyChangeListenerProxy) listener).getListener(); - addPropertyChangeListener(name, lst); - } else { - allPropertiesChangeListeners.add(listener); - } - } - } - - /** - * Returns an array with the listeners that registered to all properties. - * - * @return the array of listeners - */ - public synchronized PropertyChangeListener[] getPropertyChangeListeners() { - ArrayList result = - new ArrayList( - allPropertiesChangeListeners); - - for (String propertyName : selectedPropertiesChangeListeners.keySet()) { - List selectedListeners = - selectedPropertiesChangeListeners.get(propertyName); - - if (selectedListeners != null) { - - for (PropertyChangeListener listener : selectedListeners) { - result.add(new PropertyChangeListenerProxy(propertyName, - listener)); - } - } - } - - return result.toArray(new PropertyChangeListener[result.size()]); - } - - private void writeObject(ObjectOutputStream oos) throws IOException { - List allSerializedPropertiesChangeListeners = - new ArrayList(); - - for (PropertyChangeListener pcl : allPropertiesChangeListeners) { - if (pcl instanceof Serializable) { - allSerializedPropertiesChangeListeners.add(pcl); - } - } - - Map> - selectedSerializedPropertiesChangeListeners = - new HashMap>(); - - for (String propertyName : selectedPropertiesChangeListeners.keySet()) { - List keyValues = - selectedPropertiesChangeListeners.get(propertyName); - - if (keyValues != null) { - List serializedPropertiesChangeListeners - = new ArrayList(); - - for (PropertyChangeListener pcl : keyValues) { - if (pcl instanceof Serializable) { - serializedPropertiesChangeListeners.add(pcl); - } - } - - if (!serializedPropertiesChangeListeners.isEmpty()) { - selectedSerializedPropertiesChangeListeners.put( - propertyName, serializedPropertiesChangeListeners); - } - } - } - - children = new Hashtable>( - selectedSerializedPropertiesChangeListeners); - children.put("", allSerializedPropertiesChangeListeners); //$NON-NLS-1$ - oos.writeObject(children); - - Object source = null; - if (sourceBean instanceof Serializable) { - source = sourceBean; - } - oos.writeObject(source); - - oos.writeInt(propertyChangeSupportSerializedDataVersion); - } - - @SuppressWarnings("unchecked") - private void readObject(ObjectInputStream ois) throws IOException, - ClassNotFoundException { - children = (Hashtable>) ois - .readObject(); - - selectedPropertiesChangeListeners = new HashMap>( - children); - allPropertiesChangeListeners = selectedPropertiesChangeListeners - .remove(""); //$NON-NLS-1$ - if (allPropertiesChangeListeners == null) { - allPropertiesChangeListeners = new ArrayList(); - } - - sourceBean = ois.readObject(); - propertyChangeSupportSerializedDataVersion = ois.readInt(); - } - - /** - * Fires a property change event to all listeners of that property. - * - * @param event - * the event to fire - */ - public void firePropertyChange(PropertyChangeEvent event) { - doFirePropertyChange(event); - } - - private PropertyChangeEvent createPropertyChangeEvent(String propertyName, - Object oldValue, Object newValue) { - return new PropertyChangeEvent(sourceBean, propertyName, oldValue, - newValue); - } - - private PropertyChangeEvent createPropertyChangeEvent(String propertyName, - boolean oldValue, boolean newValue) { - return new PropertyChangeEvent(sourceBean, propertyName, oldValue, - newValue); - } - - private PropertyChangeEvent createPropertyChangeEvent(String propertyName, - int oldValue, int newValue) { - return new PropertyChangeEvent(sourceBean, propertyName, oldValue, - newValue); - } - - private void doFirePropertyChange(PropertyChangeEvent event) { - String propertyName = event.getPropertyName(); - Object oldValue = event.getOldValue(); - Object newValue = event.getNewValue(); - - if ((newValue != null) && (oldValue != null) - && newValue.equals(oldValue)) { - return; - } - - /* - * Copy the listeners collections so they can be modified while we fire - * events. - */ - - // Listeners to all property change events - PropertyChangeListener[] listensToAll; - // Listens to a given property change - PropertyChangeListener[] listensToOne = null; - synchronized (this) { - listensToAll = allPropertiesChangeListeners - .toArray(new PropertyChangeListener[allPropertiesChangeListeners - .size()]); - - List listeners = selectedPropertiesChangeListeners - .get(propertyName); - if (listeners != null) { - listensToOne = listeners - .toArray(new PropertyChangeListener[listeners.size()]); - } - } - - // Fire the listeners - for (PropertyChangeListener listener : listensToAll) { - listener.propertyChange(event); - } - if (listensToOne != null) { - for (PropertyChangeListener listener : listensToOne) { - listener.propertyChange(event); - } - } - } - -} diff --git a/icu/MODULE_LICENSE_BSD_LIKE b/icu/MODULE_LICENSE_BSD_LIKE deleted file mode 100644 index e69de29..0000000 diff --git a/icu/license.html b/icu/license.html deleted file mode 100644 index b905ddf..0000000 --- a/icu/license.html +++ /dev/null @@ -1,51 +0,0 @@ - - - - -ICU License - ICU 1.8.1 and later - - - -

ICU License - ICU 1.8.1 and later

- -

COPYRIGHT AND PERMISSION NOTICE

- -

-Copyright (c) 1995-2006 International Business Machines Corporation and others -

-

-All rights reserved. -

-

-Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), -to deal in the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, and/or sell -copies of the Software, and to permit persons -to whom the Software is furnished to do so, provided that the above -copyright notice(s) and this permission notice appear in all copies -of the Software and that both the above copyright notice(s) and this -permission notice appear in supporting documentation. -

-

-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL -THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, -OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER -RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, -NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE -USE OR PERFORMANCE OF THIS SOFTWARE. -

-

-Except as contained in this notice, the name of a copyright holder shall not be -used in advertising or otherwise to promote the sale, use or other dealings in -this Software without prior written authorization of the copyright holder. -

- -
-

-All trademarks and registered trademarks mentioned herein are the property of their respective owners. -

- - diff --git a/icu/src/main/java/com/ibm/icu4jni/charset/CharsetDecoderICU.java b/icu/src/main/java/com/ibm/icu4jni/charset/CharsetDecoderICU.java deleted file mode 100644 index 9c74d68..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/charset/CharsetDecoderICU.java +++ /dev/null @@ -1,360 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2006, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -******************************************************************************* -*/ - /** - * A JNI interface for ICU converters. - * - * - * @author Ram Viswanadha, IBM - */ -package com.ibm.icu4jni.charset; - -import com.ibm.icu4jni.common.ErrorCode; -// BEGIN android-removed -// import com.ibm.icu4jni.converters.NativeConverter; -// END android-removed - - -import java.nio.CharBuffer; -import java.nio.charset.Charset; -import java.nio.charset.CharsetDecoder; -import java.nio.charset.CoderResult; -import java.nio.charset.CodingErrorAction; -import java.nio.ByteBuffer; - -public final class CharsetDecoderICU extends CharsetDecoder{ - - - private static final int INPUT_OFFSET = 0, - OUTPUT_OFFSET = 1, - INVALID_BYTES = 2, - INPUT_HELD = 3, - LIMIT = 4; - /* data is 3 element array where - * data[INPUT_OFFSET] = on input contains the start of input and on output the number of input chars consumed - * data[OUTPUT_OFFSET] = on input contains the start of output and on output the number of output bytes written - * data[INVALID_CHARS] = number of invalid chars - * data[INPUT_HELD] = number of input chars held in the converter's state - */ - private int[] data = new int[LIMIT]; - - /* handle to the ICU converter that is opened */ - private long converterHandle=0; - - - private byte[] input = null; - private char[] output= null; - - // BEGIN android-added - private byte[] allocatedInput = null; - private char[] allocatedOutput = null; - // END android-added - - // These instance variables are - // always assigned in the methods - // before being used. This class - // inhrently multithread unsafe - // so we dont have to worry about - // synchronization - private int inEnd; - private int outEnd; - private int ec; - private int onUnmappableInput = NativeConverter.STOP_CALLBACK;; - private int onMalformedInput = NativeConverter.STOP_CALLBACK;; - private int savedInputHeldLen; - - /** - * Constructs a new decoder for the given charset - * @param cs for which the decoder is created - * @param cHandle the address of ICU converter - * @exception RuntimeException - * @stable ICU 2.4 - */ - public CharsetDecoderICU(Charset cs,long cHandle){ - super(cs, - NativeConverter.getAveCharsPerByte(cHandle), - NativeConverter.getMaxCharsPerByte(cHandle) - ); - - char[] sub = replacement().toCharArray(); - ec = NativeConverter.setCallbackDecode(cHandle, - onMalformedInput, - onUnmappableInput, - sub, sub.length); - if(ErrorCode.isFailure(ec)){ - throw ErrorCode.getException(ec); - } - // store the converter handle - converterHandle=cHandle; - - } - - /** - * Sets this decoders replacement string. Substitutes the string in input if an - * umappable or illegal sequence is encountered - * @param newReplacement to replace the error bytes with - * @stable ICU 2.4 - */ - protected void implReplaceWith(String newReplacement) { - if(converterHandle > 0){ - if( newReplacement.length() > NativeConverter.getMaxBytesPerChar(converterHandle)) { - throw new IllegalArgumentException(); - } - ec =NativeConverter.setSubstitutionChars(converterHandle, - newReplacement.toCharArray(), - newReplacement.length() - ); - if(ErrorCode.isFailure(ec)){ - throw ErrorCode.getException(ec); - } - } - } - - /** - * Sets the action to be taken if an illegal sequence is encountered - * @param newAction action to be taken - * @exception IllegalArgumentException - * @stable ICU 2.4 - */ - protected final void implOnMalformedInput(CodingErrorAction newAction) { - if(newAction.equals(CodingErrorAction.IGNORE)){ - onMalformedInput = NativeConverter.SKIP_CALLBACK; - }else if(newAction.equals(CodingErrorAction.REPLACE)){ - onMalformedInput = NativeConverter.SUBSTITUTE_CALLBACK; - }else if(newAction.equals(CodingErrorAction.REPORT)){ - onMalformedInput = NativeConverter.STOP_CALLBACK; - } - char[] sub = replacement().toCharArray(); - //System.out.println(" setting callbacks mfi " + onMalformedInput +" umi " + onUnmappableInput); - ec = NativeConverter.setCallbackDecode(converterHandle, onMalformedInput, onUnmappableInput, sub, sub.length); - if(ErrorCode.isFailure(ec)){ - throw ErrorCode.getException(ec); - } - } - - /** - * Sets the action to be taken if an illegal sequence is encountered - * @param newAction action to be taken - * @exception IllegalArgumentException - * @stable ICU 2.4 - */ - protected final void implOnUnmappableCharacter(CodingErrorAction newAction) { - if(newAction.equals(CodingErrorAction.IGNORE)){ - onUnmappableInput = NativeConverter.SKIP_CALLBACK; - }else if(newAction.equals(CodingErrorAction.REPLACE)){ - onUnmappableInput = NativeConverter.SUBSTITUTE_CALLBACK; - }else if(newAction.equals(CodingErrorAction.REPORT)){ - onUnmappableInput = NativeConverter.STOP_CALLBACK; - } - char[] sub = replacement().toCharArray(); - ec = NativeConverter.setCallbackDecode(converterHandle,onMalformedInput, onUnmappableInput, sub, sub.length); - if(ErrorCode.isFailure(ec)){ - throw ErrorCode.getException(ec); - } - } - - /** - * Flushes any characters saved in the converter's internal buffer and - * resets the converter. - * @param out action to be taken - * @return result of flushing action and completes the decoding all input. - * Returns CoderResult.UNDERFLOW if the action succeeds. - * @stable ICU 2.4 - */ - protected final CoderResult implFlush(CharBuffer out) { - try{ - - data[OUTPUT_OFFSET] = getArray(out); - - ec=NativeConverter.flushByteToChar( - converterHandle, /* Handle to ICU Converter */ - output, /* input array of chars */ - outEnd, /* input index+1 to be written */ - data /* contains data, inOff,outOff */ - ); - - - /* If we don't have room for the output, throw an exception*/ - if (ErrorCode.isFailure(ec)) { - if (ec == ErrorCode.U_BUFFER_OVERFLOW_ERROR) { - return CoderResult.OVERFLOW; - }else if (ec == ErrorCode.U_TRUNCATED_CHAR_FOUND ) {//CSDL: add this truncated character error handling - if(data[INPUT_OFFSET]>0){ - return CoderResult.malformedForLength(data[INPUT_OFFSET]); - } - }else { - ErrorCode.getException(ec); - } - } - return CoderResult.UNDERFLOW; - }finally{ - /* save the flushed data */ - setPosition(out); - implReset(); - } - } - - /** - * Resets the to Unicode mode of converter - * @stable ICU 2.4 - */ - protected void implReset() { - NativeConverter.resetByteToChar(converterHandle); - data[INPUT_OFFSET] = 0; - data[OUTPUT_OFFSET] = 0; - data[INVALID_BYTES] = 0; - data[INPUT_HELD] = 0; - savedInputHeldLen = 0; - output = null; - input = null; - } - - /** - * Decodes one or more bytes. The default behaviour of the converter - * is stop and report if an error in input stream is encountered. - * To set different behaviour use @see CharsetDecoder.onMalformedInput() - * This method allows a buffer by buffer conversion of a data stream. - * The state of the conversion is saved between calls to convert. - * Among other things, this means multibyte input sequences can be - * split between calls. If a call to convert results in an Error, the - * conversion may be continued by calling convert again with suitably - * modified parameters.All conversions should be finished with a call to - * the flush method. - * @param in buffer to decode - * @param out buffer to populate with decoded result - * @return result of decoding action. Returns CoderResult.UNDERFLOW if the decoding - * action succeeds or more input is needed for completing the decoding action. - * @stable ICU 2.4 - */ - protected CoderResult decodeLoop(ByteBuffer in,CharBuffer out){ - - if(!in.hasRemaining()){ - return CoderResult.UNDERFLOW; - } - - data[INPUT_OFFSET] = getArray(in); - data[OUTPUT_OFFSET]= getArray(out); - data[INPUT_HELD] = 0; - - try{ - /* do the conversion */ - ec=NativeConverter.decode( - converterHandle, /* Handle to ICU Converter */ - input, /* input array of bytes */ - inEnd, /* last index+1 to be converted */ - output, /* input array of chars */ - outEnd, /* input index+1 to be written */ - data, /* contains data, inOff,outOff */ - false /* donot flush the data */ - ); - - - /* return an error*/ - if(ec == ErrorCode.U_BUFFER_OVERFLOW_ERROR){ - return CoderResult.OVERFLOW; - }else if(ec==ErrorCode.U_INVALID_CHAR_FOUND){ - return CoderResult.malformedForLength(data[INVALID_BYTES]); - }else if(ec==ErrorCode.U_ILLEGAL_CHAR_FOUND){ - return CoderResult.malformedForLength(data[INVALID_BYTES]); - } - /* decoding action succeded */ - return CoderResult.UNDERFLOW; - }finally{ - setPosition(in); - setPosition(out); - } - } - - /** - * Releases the system resources by cleanly closing ICU converter opened - * @stable ICU 2.4 - */ - protected void finalize()throws Throwable{ - NativeConverter.closeConverter(converterHandle); - super.finalize(); - converterHandle = 0; - } - - //------------------------------------------ - // private utility methods - //------------------------------------------ - - private final int getArray(CharBuffer out){ - if(out.hasArray()){ - // BEGIN android-changed: take arrayOffset into account - output = out.array(); - outEnd = out.arrayOffset() + out.limit(); - return out.arrayOffset() + out.position(); - // END android-changed - }else{ - outEnd = out.remaining(); - // BEGIN android-added - if (allocatedOutput == null || (outEnd > allocatedOutput.length)) { - allocatedOutput = new char[outEnd]; - } - output = allocatedOutput; - // END android-added - //since the new - // buffer start position - // is 0 - return 0; - } - - } - private final int getArray(ByteBuffer in){ - if(in.hasArray()){ - // BEGIN android-changed: take arrayOffset into account - input = in.array(); - inEnd = in.arrayOffset() + in.limit(); - return in.arrayOffset() + in.position() + savedInputHeldLen;/*exclude the number fo bytes held in previous conversion*/ - // END android-changed - }else{ - inEnd = in.remaining(); - // BEGIN android-added - if (allocatedInput == null || (inEnd > allocatedInput.length)) { - allocatedInput = new byte[inEnd]; - } - input = allocatedInput; - // END android-added - // save the current position - int pos = in.position(); - in.get(input,0,inEnd); - // reset the position - in.position(pos); - // the start position - // of the new buffer - // is whatever is savedInputLen - return savedInputHeldLen; - } - - } - private final void setPosition(CharBuffer out){ - if(out.hasArray()){ - // BEGIN android-changed: take arrayOffset into account - out.position(out.position() + data[OUTPUT_OFFSET] - out.arrayOffset()); - // END android-changed - }else{ - out.put(output,0,data[OUTPUT_OFFSET]); - } - // BEGIN android-added - // release reference to output array, which may not be ours - output = null; - // END android-added - } - private final void setPosition(ByteBuffer in){ - - // ok was there input held in the previous invocation of decodeLoop - // that resulted in output in this invocation? - // BEGIN android-changed - in.position(in.position() + data[INPUT_OFFSET] + savedInputHeldLen - data[INPUT_HELD]); - savedInputHeldLen = data[INPUT_HELD]; - // release reference to input array, which may not be ours - input = null; - // END android-changed - } -} diff --git a/icu/src/main/java/com/ibm/icu4jni/charset/CharsetEncoderICU.java b/icu/src/main/java/com/ibm/icu4jni/charset/CharsetEncoderICU.java deleted file mode 100644 index eada080..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/charset/CharsetEncoderICU.java +++ /dev/null @@ -1,434 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2006, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -******************************************************************************* -*/ -/** - * A JNI interface for ICU converters. - * - * - * @author Ram Viswanadha, IBM - */ -package com.ibm.icu4jni.charset; - -import java.nio.ByteBuffer; -import java.nio.CharBuffer; -import java.nio.charset.Charset; -import java.nio.charset.CharsetEncoder; -import java.nio.charset.CoderResult; -import java.nio.charset.CodingErrorAction; - -import com.ibm.icu4jni.common.ErrorCode; -// BEGIN android-removed -// import com.ibm.icu4jni.converters.NativeConverter; -// END android-removed - -public final class CharsetEncoderICU extends CharsetEncoder { - - private static final int INPUT_OFFSET = 0, - OUTPUT_OFFSET = 1, - INVALID_CHARS = 2, - INPUT_HELD = 3, - LIMIT = 4; - /* data is 3 element array where - * data[INPUT_OFFSET] = on input contains the start of input and on output the number of input chars consumed - * data[OUTPUT_OFFSET] = on input contains the start of output and on output the number of output bytes written - * data[INVALID_CHARS] = number of invalid chars - * data[INPUT_HELD] = number of input chars held in the converter's state - */ - private int[] data = new int[LIMIT]; - /* handle to the ICU converter that is opened */ - private long converterHandle=0; - - private char[] input = null; - private byte[] output = null; - - // BEGIN android-added - private char[] allocatedInput = null; - private byte[] allocatedOutput = null; - // END android-added - - // These instance variables are - // always assigned in the methods - // before being used. This class - // inhrently multithread unsafe - // so we dont have to worry about - // synchronization - private int inEnd; - private int outEnd; - private int ec; - private int savedInputHeldLen; - private int onUnmappableInput = NativeConverter.STOP_CALLBACK;; - private int onMalformedInput = NativeConverter.STOP_CALLBACK;; - - /** - * Construcs a new encoder for the given charset - * @param cs for which the decoder is created - * @param cHandle the address of ICU converter - * @param replacement the substitution bytes - * @stable ICU 2.4 - */ - public CharsetEncoderICU(Charset cs, long cHandle, byte[] replacement) { - super( - cs, - (float) NativeConverter.getAveBytesPerChar(cHandle), - (float) NativeConverter.getMaxBytesPerChar(cHandle), - replacement); - byte[] sub = replacement(); - // The default callback action on unmappable input - // or malformed input is to ignore so we set ICU converter - // callback to stop and report the error - ec = NativeConverter.setCallbackEncode( cHandle, - onMalformedInput, - onUnmappableInput, - sub, sub.length); - converterHandle = cHandle; - if (ErrorCode.isFailure(ec)) { - throw ErrorCode.getException(ec); - } - } - - /** - * Sets this encoders replacement string. Substitutes the string in output if an - * umappable or illegal sequence is encountered - * @param newReplacement to replace the error chars with - * @stable ICU 2.4 - */ - protected void implReplaceWith(byte[] newReplacement) { - if (converterHandle != 0) { - if (newReplacement.length - > NativeConverter.getMaxBytesPerChar(converterHandle)) { - throw new IllegalArgumentException("Number of replacement Bytes are greater than max bytes per char"); - } - ec = NativeConverter.setSubstitutionBytes(converterHandle, - newReplacement, - newReplacement.length); - if (ErrorCode.isFailure(ec)) { - throw ErrorCode.getException(ec); - } - } - } - - /** - * Sets the action to be taken if an illegal sequence is encountered - * @param newAction action to be taken - * @exception IllegalArgumentException - * @stable ICU 2.4 - */ - protected void implOnMalformedInput(CodingErrorAction newAction) { - onMalformedInput = NativeConverter.STOP_CALLBACK; - - if (newAction.equals(CodingErrorAction.IGNORE)) { - onMalformedInput = NativeConverter.SKIP_CALLBACK; - } else if (newAction.equals(CodingErrorAction.REPLACE)) { - onMalformedInput = NativeConverter.SUBSTITUTE_CALLBACK; - } - byte[] sub = replacement(); - ec = NativeConverter.setCallbackEncode(converterHandle, onMalformedInput, onUnmappableInput, sub, sub.length); - if (ErrorCode.isFailure(ec)) { - throw ErrorCode.getException(ec); - } - - } - - /** - * Sets the action to be taken if an illegal sequence is encountered - * @param newAction action to be taken - * @exception IllegalArgumentException - * @stable ICU 2.4 - */ - protected void implOnUnmappableCharacter(CodingErrorAction newAction) { - onUnmappableInput = NativeConverter.STOP_CALLBACK; - - if (newAction.equals(CodingErrorAction.IGNORE)) { - onUnmappableInput = NativeConverter.SKIP_CALLBACK; - } else if (newAction.equals(CodingErrorAction.REPLACE)) { - onUnmappableInput = NativeConverter.SUBSTITUTE_CALLBACK; - } - byte[] sub = replacement(); - ec = NativeConverter.setCallbackEncode(converterHandle, onMalformedInput, onUnmappableInput, sub, sub.length); - if (ErrorCode.isFailure(ec)) { - throw ErrorCode.getException(ec); - } - } - - /** - * Flushes any characters saved in the converter's internal buffer and - * resets the converter. - * @param out action to be taken - * @return result of flushing action and completes the decoding all input. - * Returns CoderResult.UNDERFLOW if the action succeeds. - * @stable ICU 2.4 - */ - protected CoderResult implFlush(ByteBuffer out) { - try { - data[OUTPUT_OFFSET] = getArray(out); - ec = NativeConverter.flushCharToByte(converterHandle,/* Handle to ICU Converter */ - output, /* output array of chars */ - outEnd, /* output index+1 to be written */ - data /* contains data, inOff,outOff */ - ); - - /* If we don't have room for the output, throw an exception*/ - if (ErrorCode.isFailure(ec)) { - if (ec == ErrorCode.U_BUFFER_OVERFLOW_ERROR) { - return CoderResult.OVERFLOW; - }else if (ec == ErrorCode.U_TRUNCATED_CHAR_FOUND) {//CSDL: add this truncated character error handling - if(data[INPUT_OFFSET]>0){ - return CoderResult.malformedForLength(data[INPUT_OFFSET]); - } - }else { - ErrorCode.getException(ec); - } - } - return CoderResult.UNDERFLOW; - } finally { - setPosition(out); - implReset(); - } - } - - /** - * Resets the from Unicode mode of converter - * @stable ICU 2.4 - */ - protected void implReset() { - NativeConverter.resetCharToByte(converterHandle); - data[INPUT_OFFSET] = 0; - data[OUTPUT_OFFSET] = 0; - data[INVALID_CHARS] = 0; - data[INPUT_HELD] = 0; - savedInputHeldLen = 0; - } - - /** - * Encodes one or more chars. The default behaviour of the - * converter is stop and report if an error in input stream is encountered. - * To set different behaviour use @see CharsetEncoder.onMalformedInput() - * @param in buffer to decode - * @param out buffer to populate with decoded result - * @return result of decoding action. Returns CoderResult.UNDERFLOW if the decoding - * action succeeds or more input is needed for completing the decoding action. - * @stable ICU 2.4 - */ - protected CoderResult encodeLoop(CharBuffer in, ByteBuffer out) { - - if (!in.hasRemaining()) { - return CoderResult.UNDERFLOW; - } - - data[INPUT_OFFSET] = getArray(in); - data[OUTPUT_OFFSET]= getArray(out); - data[INPUT_HELD] = 0; - // BEGIN android-added - data[INVALID_CHARS] = 0; // Make sure we don't see earlier errors. - // END android added - - try { - /* do the conversion */ - ec = NativeConverter.encode(converterHandle,/* Handle to ICU Converter */ - input, /* input array of bytes */ - inEnd, /* last index+1 to be converted */ - output, /* output array of chars */ - outEnd, /* output index+1 to be written */ - data, /* contains data, inOff,outOff */ - false /* donot flush the data */ - ); - if (ErrorCode.isFailure(ec)) { - /* If we don't have room for the output return error */ - if (ec == ErrorCode.U_BUFFER_OVERFLOW_ERROR) { - return CoderResult.OVERFLOW; - } else if (ec == ErrorCode.U_INVALID_CHAR_FOUND) { - return CoderResult.unmappableForLength(data[INVALID_CHARS]); - } else if (ec == ErrorCode.U_ILLEGAL_CHAR_FOUND) { - // in.position(in.position() - 1); - return CoderResult.malformedForLength(data[INVALID_CHARS]); - } - } - return CoderResult.UNDERFLOW; - } finally { - /* save state */ - setPosition(in); - setPosition(out); - } - } - - /** - * Ascertains if a given Unicode character can - * be converted to the target encoding - * - * @param c the character to be converted - * @return true if a character can be converted - * @stable ICU 2.4 - * - */ - public boolean canEncode(char c) { - return canEncode((int) c); - } - - /** - * Ascertains if a given Unicode code point (32bit value for handling surrogates) - * can be converted to the target encoding. If the caller wants to test if a - * surrogate pair can be converted to target encoding then the - * responsibility of assembling the int value lies with the caller. - * For assembling a code point the caller can use UTF16 class of ICU4J and do something like: - *
-     * while(i
-     * or
-     * 
-     * String src = new String(mySource);
-     * int i,codepoint;
-     * boolean passed = false;
-     * while(i0xfff)? 2:1;
-     *    if(!(CharsetEncoderICU) myConv).canEncode(codepoint)){
-     *        passed = false;
-     *    }
-     * }
-     * 
- * - * @param codepoint Unicode code point as int value - * @return true if a character can be converted - * @obsolete ICU 2.4 - * @deprecated ICU 3.4 - */ - public boolean canEncode(int codepoint) { - return NativeConverter.canEncode(converterHandle, codepoint); - } - - /** - * Releases the system resources by cleanly closing ICU converter opened - * @exception Throwable exception thrown by super class' finalize method - * @stable ICU 2.4 - */ - protected void finalize() throws Throwable { - NativeConverter.closeConverter(converterHandle); - super.finalize(); - converterHandle=0; - } - - //------------------------------------------ - // private utility methods - //------------------------------------------ - private final int getArray(ByteBuffer out) { - if(out.hasArray()){ - // BEGIN android-changed: take arrayOffset into account - output = out.array(); - outEnd = out.arrayOffset() + out.limit(); - return out.arrayOffset() + out.position(); - // END android-changed - }else{ - outEnd = out.remaining(); - // BEGIN android-added - if (allocatedOutput == null || (outEnd > allocatedOutput.length)) { - allocatedOutput = new byte[outEnd]; - } - output = allocatedOutput; - // END android-added - //since the new - // buffer start position - // is 0 - return 0; - } - } - - private final int getArray(CharBuffer in) { - if(in.hasArray()){ - // BEGIN android-changed: take arrayOffset into account - input = in.array(); - inEnd = in.arrayOffset() + in.limit(); - return in.arrayOffset() + in.position() + savedInputHeldLen;/*exclude the number fo bytes held in previous conversion*/ - // END android-changed - }else{ - inEnd = in.remaining(); - // BEGIN android-added - if (allocatedInput == null || (inEnd > allocatedInput.length)) { - allocatedInput = new char[inEnd]; - } - input = allocatedInput; - // END android-added - // save the current position - int pos = in.position(); - in.get(input,0,inEnd); - // reset the position - in.position(pos); - // the start position - // of the new buffer - // is whatever is savedInputLen - return savedInputHeldLen; - } - - } - private final void setPosition(ByteBuffer out) { - - if (out.hasArray()) { - // in getArray method we accessed the - // array backing the buffer directly and wrote to - // it, so just just set the position and return. - // This is done to avoid the creation of temp array. - // BEGIN android-changed: take arrayOffset into account - out.position(out.position() + data[OUTPUT_OFFSET] - out.arrayOffset()); - // END android-changed - } else { - out.put(output, 0, data[OUTPUT_OFFSET]); - } - // BEGIN android-added - // release reference to output array, which may not be ours - output = null; - // END android-added - } - private final void setPosition(CharBuffer in){ - -// BEGIN android-removed -// // was there input held in the previous invocation of encodeLoop -// // that resulted in output in this invocation? -// if(data[OUTPUT_OFFSET]>0 && savedInputHeldLen>0){ -// int len = in.position() + data[INPUT_OFFSET] + savedInputHeldLen; -// in.position(len); -// savedInputHeldLen = data[INPUT_HELD]; -// }else{ -// in.position(in.position() + data[INPUT_OFFSET] + savedInputHeldLen); -// savedInputHeldLen = data[INPUT_HELD]; -// in.position(in.position() - savedInputHeldLen); -// } -// END android-removed - -// BEGIN android-added - // Slightly rewired original code to make it cleaner. Also - // added a fix for the problem where input charatcers got - // lost when invalid characters were encountered. Not sure - // what happens when data[INVALID_CHARS] is > 1, though, - // since we never saw that happening. - int len = in.position() + data[INPUT_OFFSET] + savedInputHeldLen; - len -= data[INVALID_CHARS]; // Otherwise position becomes wrong. - in.position(len); - savedInputHeldLen = data[INPUT_HELD]; - // was there input held in the previous invocation of encodeLoop - // that resulted in output in this invocation? - if(!(data[OUTPUT_OFFSET]>0 && savedInputHeldLen>0)){ - in.position(in.position() - savedInputHeldLen); - } -// END android-added - - // BEGIN android-added - // release reference to input array, which may not be ours - input = null; - // END android-added - } -} diff --git a/icu/src/main/java/com/ibm/icu4jni/charset/CharsetICU.java b/icu/src/main/java/com/ibm/icu4jni/charset/CharsetICU.java deleted file mode 100644 index fe0f920..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/charset/CharsetICU.java +++ /dev/null @@ -1,116 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2005, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -******************************************************************************* -*/ - -package com.ibm.icu4jni.charset; - -import java.nio.charset.Charset; -import java.nio.charset.CharsetDecoder; -import java.nio.charset.CharsetEncoder; -import java.util.HashMap; -import java.util.Map; - -public final class CharsetICU extends Charset { - private final String icuCanonicalName; - /** - * Constructor to create a the CharsetICU object - * @param canonicalName the canonical name as a string - * @param aliases the alias set as an array of strings - * @stable ICU 2.4 - */ - protected CharsetICU(String canonicalName, String icuCanonName, String[] aliases) { - super(canonicalName, aliases); - icuCanonicalName = icuCanonName; - } - /** - * Returns a new decoder instance of this charset object - * @return a new decoder object - * @stable ICU 2.4 - */ - public CharsetDecoder newDecoder() { - long converterHandle = NativeConverter.openConverter(icuCanonicalName); - return new CharsetDecoderICU(this, converterHandle); - } - - // hardCoded list of replacement bytes - private static final Map subByteMap = new HashMap(); - static { - subByteMap.put("UTF-32", new byte[]{0x00, 0x00, (byte)0xfe, (byte)0xff}); - subByteMap.put("ibm-16684_P110-2003", new byte[]{0x40, 0x40}); // make \u3000 the sub char - subByteMap.put("ibm-971_P100-1995", new byte[]{(byte)0xa1, (byte)0xa1}); // make \u3000 the sub char - } - /** - * Returns a new encoder object of the charset - * @return a new encoder - * @stable ICU 2.4 - */ - public CharsetEncoder newEncoder() { - // the arrays are locals and not - // instance variables since the - // methods on this class need to - // be thread safe - long converterHandle = NativeConverter.openConverter(icuCanonicalName); - - //According to the contract all converters should have non-empty replacement - byte[] replacement = NativeConverter.getSubstitutionBytes(converterHandle); - - try { - return new CharsetEncoderICU(this,converterHandle, replacement); - } catch (IllegalArgumentException ex) { - // work around for the non-sensical check in the nio API that - // a substitution character must be mappable while decoding!! - replacement = subByteMap.get(icuCanonicalName); - if (replacement == null) { - replacement = new byte[NativeConverter.getMinBytesPerChar(converterHandle)]; - for(int i = 0; i < replacement.length; ++i) { - replacement[i]= 0x3f; - } - } - NativeConverter.setSubstitutionBytes(converterHandle, replacement, replacement.length); - return new CharsetEncoderICU(this,converterHandle, replacement); - } - } - - /** - * Ascertains if a charset is a sub set of this charset - * @param cs charset to test - * @return true if the given charset is a subset of this charset - * @stable ICU 2.4 - * - * //CSDL: major changes by Jack - */ - public boolean contains(Charset cs){ - if (null == cs) { - return false; - } else if (this.equals(cs)) { - return true; - } - - long converterHandle1 = 0; - long converterHandle2 = 0; - - try { - converterHandle1 = NativeConverter.openConverter(this.name()); - if (converterHandle1 > 0) { - converterHandle2 = NativeConverter.openConverter(cs.name()); - if (converterHandle2 > 0) { - return NativeConverter.contains(converterHandle1, - converterHandle2); - } - } - return false; - } finally { - if (0 != converterHandle1) { - NativeConverter.closeConverter(converterHandle1); - if (0 != converterHandle2) { - NativeConverter.closeConverter(converterHandle2); - } - } - } - } -} diff --git a/icu/src/main/java/com/ibm/icu4jni/charset/NativeConverter.java b/icu/src/main/java/com/ibm/icu4jni/charset/NativeConverter.java deleted file mode 100644 index 6a97c27..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/charset/NativeConverter.java +++ /dev/null @@ -1,120 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2006, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -******************************************************************************* -*/ - -package com.ibm.icu4jni.charset; - -import java.nio.charset.Charset; - -public final class NativeConverter { - /** - * Converts an array of bytes containing characters in an external - * encoding into an array of Unicode characters. This method allows - * buffer-by-buffer conversion of a data stream. The state of the - * conversion is saved between calls. Among other things, - * this means multibyte input sequences can be split between calls. - * If a call to results in an error, the conversion may be - * continued by calling this method again with suitably modified parameters. - * All conversions should be finished with a call to the flush method. - * - * @param converterHandle Address of converter object created by C code - * @param input byte array containing text to be converted. - * @param inEnd stop conversion at this offset in input array (exclusive). - * @param output character array to receive conversion result. - * @param outEnd stop writing to output array at this offset (exclusive). - * @param data integer array containing the following data - * data[0] = inputOffset - * data[1] = outputOffset - * @return int error code returned by ICU - * @internal ICU 2.4 - */ - public static native int decode(long converterHandle, byte[] input, int inEnd, - char[] output, int outEnd, int[] data, boolean flush); - - /** - * Converts an array of Unicode chars to an array of bytes in an external encoding. - * This method allows a buffer by buffer conversion of a data stream. The state of the - * conversion is saved between calls to convert. Among other things, - * this means multibyte input sequences can be split between calls. - * If a call results in an error, the conversion may be - * continued by calling this method again with suitably modified parameters. - * All conversions should be finished with a call to the flush method. - * - * @param converterHandle Address of converter object created by C code - * @param input char array containing text to be converted. - * @param inEnd stop conversion at this offset in input array (exclusive). - * @param output byte array to receive conversion result. - * @param outEnd stop writing to output array at this offset (exclusive). - * @param data integer array containing the following data - * data[0] = inputOffset - * data[1] = outputOffset - * @return int error code returned by ICU - * @internal ICU 2.4 - */ - public static native int encode(long converterHandle, char[] input, int inEnd, - byte[] output, int outEnd, int[] data, boolean flush); - - /** - * Writes any remaining output to the output buffer and resets the - * converter to its initial state. - * - * @param converterHandle Address of converter object created by C code - * @param output byte array to receive flushed output. - * @param outEnd stop writing to output array at this offset (exclusive). - * @return int error code returned by ICU - * @param data integer array containing the following data - * data[0] = inputOffset - * data[1] = outputOffset - * @internal ICU 2.4 - */ - public static native int flushCharToByte(long converterHandle, byte[] output, int outEnd, int[] data); - - /** - * Writes any remaining output to the output buffer and resets the - * converter to its initial state. - * - * @param converterHandle Address of converter object created by the native code - * @param output char array to receive flushed output. - * @param outEnd stop writing to output array at this offset (exclusive). - * @return int error code returned by ICU - * @param data integer array containing the following data - * data[0] = inputOffset - * data[1] = outputOffset - * @internal ICU 2.4 - */ - public static native int flushByteToChar(long converterHandle, char[] output, int outEnd, int[] data); - - public static native long openConverter(String encoding); - public static native void closeConverter(long converterHandle); - - public static native void resetByteToChar(long converterHandle); - public static native void resetCharToByte(long converterHandle); - - public static native int setSubstitutionChars(long converterHandle, char[] subChars,int length); - public static native int setSubstitutionBytes(long converterHandle, byte[] subChars,int length); - public static native byte[] getSubstitutionBytes(long converterHandle); - - public static native int getMaxBytesPerChar(long converterHandle); - public static native int getMinBytesPerChar(long converterHandle); - public static native float getAveBytesPerChar(long converterHandle); - public static native int getMaxCharsPerByte(long converterHandle); - public static native float getAveCharsPerByte(long converterHandle); - - public static native boolean contains(long converterHandle1, long converterHandle2); - - public static native boolean canEncode(long converterHandle, int codeUnit); - - public static native String[] getAvailableCharsetNames(); - public static native Charset charsetForName(String charsetName); - - public static final int STOP_CALLBACK = 0;//CodingErrorAction.REPORT - public static final int SKIP_CALLBACK = 1;//CodingErrorAction.IGNORE - public static final int SUBSTITUTE_CALLBACK = 2;//CodingErrorAction.REPLACE - public static native int setCallbackDecode(long converterHandle, int onMalformedInput, int onUnmappableInput, char[] subChars, int length); - public static native int setCallbackEncode(long converterHandle, int onMalformedInput, int onUnmappableInput, byte[] subBytes, int length); -} diff --git a/icu/src/main/java/com/ibm/icu4jni/common/ErrorCode.java b/icu/src/main/java/com/ibm/icu4jni/common/ErrorCode.java deleted file mode 100644 index 023f165..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/common/ErrorCode.java +++ /dev/null @@ -1,205 +0,0 @@ -/** -****************************************************************************** -* Copyright (C) 1996-2005, International Business Machines Corporation and * -* others. All Rights Reserved. * -****************************************************************************** -* -****************************************************************************** -*/ - -package com.ibm.icu4jni.common; - -/** -* Error exception class mapping ICU error codes of the enum UErrorCode -* @author syn wee quek -* @internal -*/ -public final class ErrorCode extends Exception -{ - - // public methods -------------------------------------------------------- - - /** - * Generic mapping from the error codes to java default exceptions. - * @param error error code - * @return java default exception that maps to the argument error code, - * otherwise if error is not a valid error code, null is returned. - * @stable ICU 2.4 - */ - public static final RuntimeException getException(int error) - { - if (error <= U_ZERO_ERROR && error >= U_ERROR_LIMIT) { - return null; - } - String errorname = ERROR_NAMES_[U_ILLEGAL_ARGUMENT_ERROR]; - switch (error) { - case U_ILLEGAL_ARGUMENT_ERROR : - return new IllegalArgumentException(errorname); - case U_INDEX_OUTOFBOUNDS_ERROR : - return new ArrayIndexOutOfBoundsException(errorname); - case U_BUFFER_OVERFLOW_ERROR : - return new ArrayIndexOutOfBoundsException(errorname); - case U_UNSUPPORTED_ERROR : - return new UnsupportedOperationException(errorname); - default : - return new RuntimeException(errorname); - } - } - - // public static data member --------------------------------------------- - - /** - * Start of information results (semantically successful) - */ - public static final int U_ERROR_INFO_START = -128; - /** - * A resource bundle lookup returned a fallback result (not an error) - */ - public static final int U_USING_FALLBACK_ERROR = -128; - /** - * A resource bundle lookup returned a result from the root locale (not an - * error) - */ - public static final int U_USING_DEFAULT_ERROR = -127; - /** - * A SafeClone operation required allocating memory (informational - * only - */ - public static final int U_SAFECLONE_ALLOCATED_ERROR = -126; - /** - * This must always be the last warning value to indicate the limit for - * UErrorCode warnings (last warning code +1) - */ - public static final int U_ERROR_INFO_LIMIT = -125; - - /** - * No error, no warning - */ - public static final int U_ZERO_ERROR = 0; - /** - * Start of codes indicating failure - */ - public static final int U_ILLEGAL_ARGUMENT_ERROR = 1; - public static final int U_MISSING_RESOURCE_ERROR = 2; - public static final int U_INVALID_FORMAT_ERROR = 3; - public static final int U_FILE_ACCESS_ERROR = 4; - /** - * Indicates a bug in the library code - */ - public static final int U_INTERNAL_PROGRAM_ERROR = 5; - public static final int U_MESSAGE_PARSE_ERROR = 6; - /** - * Memory allocation error - */ - public static final int U_MEMORY_ALLOCATION_ERROR = 7; - public static final int U_INDEX_OUTOFBOUNDS_ERROR = 8; - /** - * Equivalent to Java ParseException - */ - public static final int U_PARSE_ERROR = 9; - /** - * In the Character conversion routines: Invalid character or sequence was - * encountered - */ - public static final int U_INVALID_CHAR_FOUND = 10; - /** - * In the Character conversion routines: More bytes are required to complete - * the conversion successfully - */ - public static final int U_TRUNCATED_CHAR_FOUND = 11; - /** - * In codeset conversion: a sequence that does NOT belong in the codepage has - * been encountered - */ - public static final int U_ILLEGAL_CHAR_FOUND = 12; - /** - * Conversion table file found, but corrupted - */ - public static final int U_INVALID_TABLE_FORMAT = 13; - /** - * Conversion table file not found - */ - public static final int U_INVALID_TABLE_FILE = 14; - /** - * A result would not fit in the supplied buffer - */ - public static final int U_BUFFER_OVERFLOW_ERROR = 15; - /** - * Requested operation not supported in current context - */ - public static final int U_UNSUPPORTED_ERROR = 16; - /** - * an operation is requested over a resource that does not support it - */ - public static final int U_RESOURCE_TYPE_MISMATCH = 17; - /** - * ISO-2022 illlegal escape sequence - */ - public static final int U_ILLEGAL_ESCAPE_SEQUENCE = 18; - /** - * ISO-2022 unsupported escape sequence - */ - public static final int U_UNSUPPORTED_ESCAPE_SEQUENCE = 19; - /** - * No space available for in-buffer expansion for Arabic shaping - */ - public static final int U_NO_SPACE_AVAILABLE = 20; - /** - * This must always be the last value to indicate the limit for UErrorCode - * (last error code +1) - */ - public static final int U_ERROR_LIMIT = 21; - /** - * Load library flag - */ - public static boolean LIBRARY_LOADED = false; - - // private data member ---------------------------------------------------- - - /** - * Array of error code names corresponding to the errorcodes. - * ie ERROR_NAMES_[0] = name of U_ZERO_ERROR - */ - private static final String ERROR_NAMES_[] = { - "U_ZERO_ERROR", "U_ILLEGAL_ARGUMENT_ERROR", - "U_MISSING_RESOURCE_ERROR", "U_INVALID_FORMAT_ERROR", - "U_FILE_ACCESS_ERROR", "U_INTERNAL_PROGRAM_ERROR", - "U_MESSAGE_PARSE_ERROR", "U_MEMORY_ALLOCATION_ERROR", - "U_INDEX_OUTOFBOUNDS_ERROR", "U_PARSE_ERROR", - "U_INVALID_CHAR_FOUND", "U_TRUNCATED_CHAR_FOUND", - "U_ILLEGAL_CHAR_FOUND", "U_INVALID_TABLE_FORMAT", - "U_INVALID_TABLE_FILE", "U_BUFFER_OVERFLOW_ERROR", - "U_UNSUPPORTED_ERROR", "U_RESOURCE_TYPE_MISMATCH", - "U_ILLEGAL_ESCAPE_SEQUENCE", "U_UNSUPPORTED_ESCAPE_SEQUENCE" - }; - /** - * Returns the error name of the input error code - * @param ec int value of the error code - * @return String name of the error code - * @stable ICU 2.4 - */ - public static String getErrorName(int ec){ - return ERROR_NAMES_[ec]; - } - - /** - * Returns true if the input error code denotes success - * @param ec int value of the error code - * @return boolean - * @stable ICU 2.4 - */ - public static boolean isSuccess(int ec){ - return (ec<=U_ZERO_ERROR); - } - - /** - * Returns true if the input error code denotes failure - * @param ec int value of the error code - * @return boolean - * @stable ICU 2.4 - */ - public static boolean isFailure(int ec){ - return (ec>U_ZERO_ERROR); - } -} - diff --git a/icu/src/main/java/com/ibm/icu4jni/lang/UCharacter.java b/icu/src/main/java/com/ibm/icu4jni/lang/UCharacter.java deleted file mode 100644 index 08fe26a..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/lang/UCharacter.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.ibm.icu4jni.lang; - -import java.lang.Character.UnicodeBlock; - -public final class UCharacter { - - public static native boolean isDefined(int codePoint); - public static native boolean isDigit(int codePoint); - public static native boolean isIdentifierIgnorable(int codePoint); - public static native boolean isLetter(int codePoint); - public static native boolean isLetterOrDigit(int codePoint); - public static native boolean isLowerCase(int codePoint); - public static native boolean isMirrored(int codePoint); - public static native boolean isSpaceChar(int codePoint); - public static native boolean isTitleCase(int codePoint); - public static native boolean isUnicodeIdentifierPart(int codePoint); - public static native boolean isUnicodeIdentifierStart(int codePoint); - public static native boolean isUpperCase(int codePoint); - public static native boolean isWhitespace(int codePoint); - public static native byte getDirectionality(int codePoint); - public static native int digit(int codePoint, int radix); - public static native int forName(String blockName); - public static native int getNumericValue(int codePoint); - public static native int getType(int codePoint); - public static native int of(int codePoint); - public static native int toLowerCase(int codePoint); - public static native int toTitleCase(int codePoint); - public static native int toUpperCase(int codePoint); - public static native String toLowerCase(String s, String localeName); - public static native String toUpperCase(String s, String localeName); - - public static UnicodeBlock[] getBlockTable() { - /** - * The indices of the entries of this table correspond with the value - * of the ICU enum UBlockCode. When updating ICU it's necessary - * to check if there where any changes for the properties - * used by java.lang.Character. - * The enum is defined in common/unicode/uchar.h - */ - UnicodeBlock[] result = new UnicodeBlock[] { null, - UnicodeBlock.BASIC_LATIN, - UnicodeBlock.LATIN_1_SUPPLEMENT, - UnicodeBlock.LATIN_EXTENDED_A, - UnicodeBlock.LATIN_EXTENDED_B, - UnicodeBlock.IPA_EXTENSIONS, - UnicodeBlock.SPACING_MODIFIER_LETTERS, - UnicodeBlock.COMBINING_DIACRITICAL_MARKS, - UnicodeBlock.GREEK, - UnicodeBlock.CYRILLIC, - UnicodeBlock.ARMENIAN, - UnicodeBlock.HEBREW, - UnicodeBlock.ARABIC, - UnicodeBlock.SYRIAC, - UnicodeBlock.THAANA, - UnicodeBlock.DEVANAGARI, - UnicodeBlock.BENGALI, - UnicodeBlock.GURMUKHI, - UnicodeBlock.GUJARATI, - UnicodeBlock.ORIYA, - UnicodeBlock.TAMIL, - UnicodeBlock.TELUGU, - UnicodeBlock.KANNADA, - UnicodeBlock.MALAYALAM, - UnicodeBlock.SINHALA, - UnicodeBlock.THAI, - UnicodeBlock.LAO, - UnicodeBlock.TIBETAN, - UnicodeBlock.MYANMAR, - UnicodeBlock.GEORGIAN, - UnicodeBlock.HANGUL_JAMO, - UnicodeBlock.ETHIOPIC, - UnicodeBlock.CHEROKEE, - UnicodeBlock.UNIFIED_CANADIAN_ABORIGINAL_SYLLABICS, - UnicodeBlock.OGHAM, - UnicodeBlock.RUNIC, - UnicodeBlock.KHMER, - UnicodeBlock.MONGOLIAN, - UnicodeBlock.LATIN_EXTENDED_ADDITIONAL, - UnicodeBlock.GREEK_EXTENDED, - UnicodeBlock.GENERAL_PUNCTUATION, - UnicodeBlock.SUPERSCRIPTS_AND_SUBSCRIPTS, - UnicodeBlock.CURRENCY_SYMBOLS, - UnicodeBlock.COMBINING_MARKS_FOR_SYMBOLS, - UnicodeBlock.LETTERLIKE_SYMBOLS, - UnicodeBlock.NUMBER_FORMS, - UnicodeBlock.ARROWS, - UnicodeBlock.MATHEMATICAL_OPERATORS, - UnicodeBlock.MISCELLANEOUS_TECHNICAL, - UnicodeBlock.CONTROL_PICTURES, - UnicodeBlock.OPTICAL_CHARACTER_RECOGNITION, - UnicodeBlock.ENCLOSED_ALPHANUMERICS, - UnicodeBlock.BOX_DRAWING, - UnicodeBlock.BLOCK_ELEMENTS, - UnicodeBlock.GEOMETRIC_SHAPES, - UnicodeBlock.MISCELLANEOUS_SYMBOLS, - UnicodeBlock.DINGBATS, - UnicodeBlock.BRAILLE_PATTERNS, - UnicodeBlock.CJK_RADICALS_SUPPLEMENT, - UnicodeBlock.KANGXI_RADICALS, - UnicodeBlock.IDEOGRAPHIC_DESCRIPTION_CHARACTERS, - UnicodeBlock.CJK_SYMBOLS_AND_PUNCTUATION, - UnicodeBlock.HIRAGANA, - UnicodeBlock.KATAKANA, - UnicodeBlock.BOPOMOFO, - UnicodeBlock.HANGUL_COMPATIBILITY_JAMO, - UnicodeBlock.KANBUN, - UnicodeBlock.BOPOMOFO_EXTENDED, - UnicodeBlock.ENCLOSED_CJK_LETTERS_AND_MONTHS, - UnicodeBlock.CJK_COMPATIBILITY, - UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A, - UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS, - UnicodeBlock.YI_SYLLABLES, - UnicodeBlock.YI_RADICALS, - UnicodeBlock.HANGUL_SYLLABLES, - UnicodeBlock.HIGH_SURROGATES, - UnicodeBlock.HIGH_PRIVATE_USE_SURROGATES, - UnicodeBlock.LOW_SURROGATES, - UnicodeBlock.PRIVATE_USE_AREA, - UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS, - UnicodeBlock.ALPHABETIC_PRESENTATION_FORMS, - UnicodeBlock.ARABIC_PRESENTATION_FORMS_A, - UnicodeBlock.COMBINING_HALF_MARKS, - UnicodeBlock.CJK_COMPATIBILITY_FORMS, - UnicodeBlock.SMALL_FORM_VARIANTS, - UnicodeBlock.ARABIC_PRESENTATION_FORMS_B, - UnicodeBlock.SPECIALS, - UnicodeBlock.HALFWIDTH_AND_FULLWIDTH_FORMS, - UnicodeBlock.OLD_ITALIC, - UnicodeBlock.GOTHIC, - UnicodeBlock.DESERET, - UnicodeBlock.BYZANTINE_MUSICAL_SYMBOLS, - UnicodeBlock.MUSICAL_SYMBOLS, - UnicodeBlock.MATHEMATICAL_ALPHANUMERIC_SYMBOLS, - UnicodeBlock.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B, - UnicodeBlock.CJK_COMPATIBILITY_IDEOGRAPHS_SUPPLEMENT, - UnicodeBlock.TAGS, - UnicodeBlock.CYRILLIC_SUPPLEMENTARY, - UnicodeBlock.TAGALOG, - UnicodeBlock.HANUNOO, - UnicodeBlock.BUHID, - UnicodeBlock.TAGBANWA, - UnicodeBlock.MISCELLANEOUS_MATHEMATICAL_SYMBOLS_A, - UnicodeBlock.SUPPLEMENTAL_ARROWS_A, - UnicodeBlock.SUPPLEMENTAL_ARROWS_B, - UnicodeBlock.MISCELLANEOUS_MATHEMATICAL_SYMBOLS_B, - UnicodeBlock.SUPPLEMENTAL_MATHEMATICAL_OPERATORS, - UnicodeBlock.KATAKANA_PHONETIC_EXTENSIONS, - UnicodeBlock.VARIATION_SELECTORS, - UnicodeBlock.SUPPLEMENTARY_PRIVATE_USE_AREA_A, - UnicodeBlock.SUPPLEMENTARY_PRIVATE_USE_AREA_B, - UnicodeBlock.LIMBU, - UnicodeBlock.TAI_LE, - UnicodeBlock.KHMER_SYMBOLS, - UnicodeBlock.PHONETIC_EXTENSIONS, - UnicodeBlock.MISCELLANEOUS_SYMBOLS_AND_ARROWS, - UnicodeBlock.YIJING_HEXAGRAM_SYMBOLS, - UnicodeBlock.LINEAR_B_SYLLABARY, - UnicodeBlock.LINEAR_B_IDEOGRAMS, - UnicodeBlock.AEGEAN_NUMBERS, - UnicodeBlock.UGARITIC, - UnicodeBlock.SHAVIAN, - UnicodeBlock.OSMANYA, - UnicodeBlock.CYPRIOT_SYLLABARY, - UnicodeBlock.TAI_XUAN_JING_SYMBOLS, - UnicodeBlock.VARIATION_SELECTORS_SUPPLEMENT - }; - return result; - } -} diff --git a/icu/src/main/java/com/ibm/icu4jni/regex/NativeRegEx.java b/icu/src/main/java/com/ibm/icu4jni/regex/NativeRegEx.java deleted file mode 100644 index a8ce8a6..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/regex/NativeRegEx.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.ibm.icu4jni.regex; - -public final class NativeRegEx { - private NativeRegEx() { - } - - /** - * Opens (compiles) an ICU regular expression. - */ - public static native int open(String pattern, int flags); - - /** - * Makes a copy of a compiled regular expression. - */ - public static native int clone(int regex); - - /** - * Closes the regular expression, recovering all resources (memory) it was - * holding. - */ - public static native void close(int regex); - - /** - * Sets the subject text string upon which the regular expression will look - * for matches. - */ - public static native void setText(int regex, String text); - - /** - * Attempts to match the input string, beginning at startIndex, against the - * pattern. - */ - public static native boolean matches(int regex, int startIndex); - - /** - * Attempts to match the input string, starting from the specified index, - * against the pattern. - */ - public static native boolean lookingAt(int regex, int startIndex); - - /** - * Finds the first matching substring of the input string that matches the - * pattern. - */ - public static native boolean find(int regex, int startIndex); - - /** - * Finds the first matching substring of the input string that matches the - * pattern. - */ - public static native boolean findNext(int regex); - - /** - * Gets the number of capturing groups in this regular expression's pattern. - */ - public static native int groupCount(int regex); - - /** - * Gets all the group information for the current match of the pattern. - */ - public static native void startEnd(int regex, int[] startEnd); - - /** - * Sets the region of the input to be considered during matching. - */ - public static native void setRegion(int regex, int start, int end); - - /** - * Queries the start of the region of the input to be considered during - * matching. - */ - public static native int regionStart(int regex); - - /** - * Queries the end of the region of the input to be considered during - * matching. - */ - public static native int regionEnd(int regex); - - /** - * Controls the transparency of the region bounds. - */ - public static native void useTransparentBounds(int regex, boolean value); - - /** - * Queries the transparency of the region bounds. - */ - public static native boolean hasTransparentBounds(int regex); - - /** - * Controls the anchoring property of the region bounds. - */ - public static native void useAnchoringBounds(int regex, boolean value); - - /** - * Queries the anchoring property of the region bounds. - */ - public static native boolean hasAnchoringBounds(int regex); - - /** - * Queries whether we hit the end of the input during the last match. - */ - public static native boolean hitEnd(int regex); - - /** - * Queries whether more input might change a current match, but wouldn't - * destroy it. - */ - public static native boolean requireEnd(int regex); - - /** - * Resets the matcher, cause a current match to be lost, and sets the - * position at which a subsequent findNext() would start. - */ - public static native void reset(int regex, int position); -} diff --git a/icu/src/main/java/com/ibm/icu4jni/text/CollationAttribute.java b/icu/src/main/java/com/ibm/icu4jni/text/CollationAttribute.java deleted file mode 100644 index eaf626f..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/text/CollationAttribute.java +++ /dev/null @@ -1,40 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2005, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -******************************************************************************* -*/ - -package com.ibm.icu4jni.text; - -/** - * TODO: move these constants into NativeCollation. - */ -public final class CollationAttribute { - // Values from the native UColAttributeValue enum. - public static final int VALUE_DEFAULT = -1; - public static final int VALUE_PRIMARY = 0; - public static final int VALUE_SECONDARY = 1; - public static final int VALUE_TERTIARY = 2; - public static final int VALUE_DEFAULT_STRENGTH = VALUE_TERTIARY; - public static final int VALUE_QUATERNARY = 3; - public static final int VALUE_IDENTICAL = 15; - public static final int VALUE_OFF = 16; - public static final int VALUE_ON = 17; - public static final int VALUE_SHIFTED = 20; - public static final int VALUE_NON_IGNORABLE = 21; - public static final int VALUE_LOWER_FIRST = 24; - public static final int VALUE_UPPER_FIRST = 25; - public static final int VALUE_ON_WITHOUT_HANGUL = 28; - public static final int VALUE_ATTRIBUTE_VALUE_COUNT = 29; - // Values from the UColAttribute enum. - public static final int FRENCH_COLLATION = 0; - public static final int ALTERNATE_HANDLING = 1; - public static final int CASE_FIRST = 2; - public static final int CASE_LEVEL = 3; - public static final int NORMALIZATION_MODE = 4; - public static final int DECOMPOSITION_MODE = NORMALIZATION_MODE; - public static final int STRENGTH = 5; -} diff --git a/icu/src/main/java/com/ibm/icu4jni/text/CollationElementIterator.java b/icu/src/main/java/com/ibm/icu4jni/text/CollationElementIterator.java deleted file mode 100644 index 0f5bae4..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/text/CollationElementIterator.java +++ /dev/null @@ -1,230 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2005, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -******************************************************************************* -*/ - -package com.ibm.icu4jni.text; - -import java.text.CharacterIterator; - - -/** -* Collation element iterator JNI wrapper. -* Iterates over the collation elements of a data string. -* The iterator supports both forward and backwards full iteration, ie if -* backwards iteration is performed in the midst of a forward iteration, the -* result is undefined. -* To perform a backwards iteration in the midst of a forward iteration, -* reset() has to be called. -* This will shift the position to either the start or the last character in the -* data string depending on whether next() is called or previous(). -*
-*   RuleBasedCollator coll = Collator.getInstance();
-*   CollationElementIterator iterator = coll.getCollationElementIterator("abc");
-*   int ce = 0;
-*   while (ce != CollationElementIterator.NULLORDER) {
-*     ce = iterator.next();
-*   }
-*   iterator.reset();
-*   while (ce != CollationElementIterator.NULLORDER) {
-*     ce = iterator.previous();
-*   }
-* 
-* @author syn wee quek -* @stable ICU 2.4 -*/ - -public final class CollationElementIterator -{ - // public data member ------------------------------------------- - - /** - * @stable ICU 2.4 - */ - public static final int NULLORDER = 0xFFFFFFFF; - - // public methods ----------------------------------------------- - - /** - * Reset the collation elements to their initial state. - * This will move the 'cursor' to the beginning of the text. - * @stable ICU 2.4 - */ - public void reset() - { - NativeCollation.reset(m_collelemiterator_); - } - - /** - * Get the ordering priority of the next collation element in the text. - * A single character may contain more than one collation element. - * @return next collation elements ordering, or NULLORDER if the end of the - * text is reached. - * @stable ICU 2.4 - */ - public int next() - { - return NativeCollation.next(m_collelemiterator_); - } - - /** - * Get the ordering priority of the previous collation element in the text. - * A single character may contain more than one collation element. - * @return previous collation element ordering, or NULLORDER if the end of - * the text is reached. - * @stable ICU 2.4 - */ - public int previous() - { - return NativeCollation.previous(m_collelemiterator_); - } - - /** - * Get the maximum length of any expansion sequences that end with the - * specified comparison order. - * @param order collation order returned by previous or next. - * @return maximum size of the expansion sequences ending with the collation - * element or 1 if collation element does not occur at the end of - * any expansion sequence - * @stable ICU 2.4 - */ - public int getMaxExpansion(int order) - { - return NativeCollation.getMaxExpansion(m_collelemiterator_, order); - } - - /** - * Set the text containing the collation elements. - * @param source text containing the collation elements. - * @stable ICU 2.4 - */ - public void setText(String source) - { - NativeCollation.setText(m_collelemiterator_, source); - } - - // BEGIN android-added - public void setText(CharacterIterator source) - { - NativeCollation.setText(m_collelemiterator_, source.toString()); - } - // END android-added - - /** - * Get the offset of the current source character. - * This is an offset into the text of the character containing the current - * collation elements. - * @return offset of the current source character. - * @stable ICU 2.4 - */ - public int getOffset() - { - return NativeCollation.getOffset(m_collelemiterator_); - } - - /** - * Set the offset of the current source character. - * This is an offset into the text of the character to be processed. - * @param offset The desired character offset. - * @stable ICU 2.4 - */ - public void setOffset(int offset) - { - NativeCollation.setOffset(m_collelemiterator_, offset); - } - - /** - * Gets the primary order of a collation order. - * @param order the collation order - * @return the primary order of a collation order. - * @stable ICU 2.4 - */ - public static int primaryOrder(int order) - { - return ((order & PRIMARY_ORDER_MASK_) >> PRIMARY_ORDER_SHIFT_) & - UNSIGNED_16_BIT_MASK_; - } - - /** - * Gets the secondary order of a collation order. - * @param order the collation order - * @return the secondary order of a collation order. - * @stable ICU 2.4 - */ - public static int secondaryOrder(int order) - { - return (order & SECONDARY_ORDER_MASK_) >> SECONDARY_ORDER_SHIFT_; - } - - /** - * Gets the tertiary order of a collation order. - * @param order the collation order - * @return the tertiary order of a collation order. - * @stable ICU 2.4 - */ - public static int tertiaryOrder(int order) - { - return order & TERTIARY_ORDER_MASK_; - } - - // protected constructor ---------------------------------------- - - /** - * CollationElementIteratorJNI constructor. - * The only caller of this class should be - * RuleBasedCollator.getCollationElementIterator(). - * @param collelemiteratoraddress address of C collationelementiterator - */ - CollationElementIterator(int collelemiteratoraddress) - { - m_collelemiterator_ = collelemiteratoraddress; - } - - // protected methods -------------------------------------------- - - /** - * Garbage collection. - * Close C collator and reclaim memory. - * @stable ICU 2.4 - */ - protected void finalize() - { - NativeCollation.closeElements(m_collelemiterator_); - } - - // private data members ----------------------------------------- - - /** - * C collator - */ - private int m_collelemiterator_; - - /** - * ICU constant primary order mask for collation elements - */ - private static final int PRIMARY_ORDER_MASK_ = 0xffff0000; - /** - * ICU constant secondary order mask for collation elements - */ - private static final int SECONDARY_ORDER_MASK_ = 0x0000ff00; - /** - * ICU constant tertiary order mask for collation elements - */ - private static final int TERTIARY_ORDER_MASK_ = 0x000000ff; - /** - * ICU constant primary order shift for collation elements - */ - private static final int PRIMARY_ORDER_SHIFT_ = 16; - /** - * ICU constant secondary order shift for collation elements - */ - private static final int SECONDARY_ORDER_SHIFT_ = 8; - /** - * Unsigned 16 bit mask - */ - private static final int UNSIGNED_16_BIT_MASK_ = 0x0000FFFF; -} diff --git a/icu/src/main/java/com/ibm/icu4jni/text/CollationKey.java b/icu/src/main/java/com/ibm/icu4jni/text/CollationKey.java deleted file mode 100644 index dbd714c..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/text/CollationKey.java +++ /dev/null @@ -1,122 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2005, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* -******************************************************************************* -*/ - -package com.ibm.icu4jni.text; - -/** - * A concrete implementation of the abstract java.text.CollationKey. - */ -public final class CollationKey extends java.text.CollationKey { - /** - * The key. - */ - private final byte[] bytes; - - /** - * Cached hash value. - */ - private int hashCode; - - CollationKey(String source, byte[] bytes) { - super(source); - this.bytes = bytes; - } - - public int compareTo(java.text.CollationKey other) { - // Get the bytes from the other collation key. - final byte[] rhsBytes; - if (other instanceof CollationKey) { - rhsBytes = ((CollationKey) other).bytes; - } else { - rhsBytes = other.toByteArray(); - } - - if (bytes == null || bytes.length == 0) { - if (rhsBytes == null || rhsBytes.length == 0) { - return 0; - } - return -1; - } else { - if (rhsBytes == null || rhsBytes.length == 0) { - return 1; - } - } - - int count = Math.min(bytes.length, rhsBytes.length); - for (int i = 0; i < count; ++i) { - int s = bytes[i] & 0xff; - int t = rhsBytes[i] & 0xff; - if (s < t) { - return -1; - } - if (s > t) { - return 1; - } - } - if (bytes.length < rhsBytes.length) { - return -1; - } - if (bytes.length > rhsBytes.length) { - return 1; - } - return 0; - } - - /** - * Checks if target object is equal to this object. - * Target is first casted to CollationKey and bitwise compared. - * @param target comparison object - * @return true if both objects are equal, false otherwise - * @stable ICU 2.4 - */ - public boolean equals(Object object) { - if (object == this) { - return true; - } - if (!(object instanceof CollationKey)) { - return false; - } - return compareTo((CollationKey) object) == 0; - } - - /** - * Creates a hash code for this CollationKey. - * Compute the hash by iterating sparsely over about 32 (up to 63) bytes - * spaced evenly through the string. For each byte, multiply the previous - * hash value by a prime number and add the new byte in, like a linear - * congruential random number generator, producing a pseudo-random - * deterministic value well distributed over the output range. - * @return hash value of collation key. Hash value is never 0. - * @stable ICU 2.4 - */ - public int hashCode() { - if (hashCode == 0) { - if (bytes != null && bytes.length != 0) { - int len = bytes.length; - int inc = ((len - 32) / 32) + 1; - for (int i = 0; i < len;) { - hashCode = (hashCode * 37) + bytes[i]; - i += inc; - } - } - if (hashCode == 0) { - hashCode = 1; - } - } - return hashCode; - } - - public byte[] toByteArray() { - if (bytes == null || bytes.length == 0) { - return null; - } - return bytes.clone(); - } -} diff --git a/icu/src/main/java/com/ibm/icu4jni/text/Collator.java b/icu/src/main/java/com/ibm/icu4jni/text/Collator.java deleted file mode 100644 index 9eb85ea..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/text/Collator.java +++ /dev/null @@ -1,248 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2005, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* -******************************************************************************* -*/ - -package com.ibm.icu4jni.text; - -import com.ibm.icu4jni.text.RuleBasedCollator; -import java.util.Locale; - -public abstract class Collator implements Cloneable { - /** - * Strongest collator strength value. Typically used to denote differences - * between base characters. See class documentation for more explanation. - * @see #setStrength - * @see #getStrength - * @stable ICU 2.4 - */ - public final static int PRIMARY = CollationAttribute.VALUE_PRIMARY; - - /** - * Second level collator strength value. - * Accents in the characters are considered secondary differences. - * Other differences between letters can also be considered secondary - * differences, depending on the language. - * See class documentation for more explanation. - * @see #setStrength - * @see #getStrength - * @stable ICU 2.4 - */ - public final static int SECONDARY = CollationAttribute.VALUE_SECONDARY; - - /** - * Third level collator strength value. - * Upper and lower case differences in characters are distinguished at this - * strength level. In addition, a variant of a letter differs from the base - * form on the tertiary level. - * See class documentation for more explanation. - * @see #setStrength - * @see #getStrength - * @stable ICU 2.4 - */ - public final static int TERTIARY = CollationAttribute.VALUE_TERTIARY; - - /** - * Fourth level collator strength value. - * When punctuation is ignored - * - * (see Ignoring Punctuations in the user guide) at PRIMARY to TERTIARY - * strength, an additional strength level can - * be used to distinguish words with and without punctuation. - * See class documentation for more explanation. - * @see #setStrength - * @see #getStrength - * @stable ICU 2.4 - */ - public final static int QUATERNARY = CollationAttribute.VALUE_QUATERNARY; - - /** - *

- * Smallest Collator strength value. When all other strengths are equal, - * the IDENTICAL strength is used as a tiebreaker. The Unicode code point - * values of the NFD form of each string are compared, just in case there - * is no difference. - * See class documentation for more explanation. - *

- *

- * Note this value is different from JDK's - *

- * @stable ICU 2.4 - */ - public final static int IDENTICAL = CollationAttribute.VALUE_IDENTICAL; - - /** - *

Decomposition mode value. With NO_DECOMPOSITION set, Strings - * will not be decomposed for collation. This is the default - * decomposition setting unless otherwise specified by the locale - * used to create the Collator.

- * - *

Note this value is different from the JDK's.

- * @see #CANONICAL_DECOMPOSITION - * @see #getDecomposition - * @see #setDecomposition - * @stable ICU 2.4 - */ - public final static int NO_DECOMPOSITION = CollationAttribute.VALUE_OFF; - - /** - *

Decomposition mode value. With CANONICAL_DECOMPOSITION set, - * characters that are canonical variants according to the Unicode standard - * will be decomposed for collation.

- * - *

CANONICAL_DECOMPOSITION corresponds to Normalization Form D as - * described in - * Unicode Technical Report #15. - *

- * @see #NO_DECOMPOSITION - * @see #getDecomposition - * @see #setDecomposition - * @stable ICU 2.4 - */ - public final static int CANONICAL_DECOMPOSITION = CollationAttribute.VALUE_ON; - - public static Collator getInstance(Locale locale) { - return new RuleBasedCollator(locale); - } - - public boolean equals(String source, String target) { - return (compare(source, target) == 0); - } - - public abstract boolean equals(Object target); - - public abstract Object clone() throws CloneNotSupportedException; - - /** - * The comparison function compares the character data stored in two - * different strings. Returns information about whether a string is less - * than, greater than or equal to another string. - *

Example of use: - *

-     * .  Collator myCollation = Collator.getInstance(Locale::US);
-     * .  myCollation.setStrength(CollationAttribute.VALUE_PRIMARY);
-     * .  // result would be CollationAttribute.VALUE_EQUAL
-     * .  // ("abc" == "ABC")
-     * .  // (no primary difference between "abc" and "ABC")
-     * .  int result = myCollation.compare("abc", "ABC",3);
-     * .  myCollation.setStrength(CollationAttribute.VALUE_TERTIARY);
-     * .  // result would be Collation.LESS (abc" <<< "ABC")
-     * .  // (with tertiary difference between "abc" and "ABC")
-     * .  int result = myCollation.compare("abc", "ABC",3);
-     * 
- * @stable ICU 2.4 - */ - public abstract int compare(String source, String target); - - /** - * Get the decomposition mode of this Collator. - * @return the decomposition mode - * @see #CANONICAL_DECOMPOSITION - * @see #NO_DECOMPOSITION - * @stable ICU 2.4 - */ - public abstract int getDecomposition(); - - /** - * Set the normalization mode used int this object - * The normalization mode influences how strings are compared. - * @param mode desired normalization mode - * @see #CANONICAL_DECOMPOSITION - * @see #NO_DECOMPOSITION - * @stable ICU 2.4 - */ - public abstract void setDecomposition(int mode); - - /** - * Determines the minimum strength that will be use in comparison or - * transformation. - *

- * E.g. with strength == SECONDARY, the tertiary difference is ignored - *

- *

- * E.g. with strength == PRIMARY, the secondary and tertiary difference - * are ignored. - *

- * @return the current comparison level. - * @see #PRIMARY - * @see #SECONDARY - * @see #TERTIARY - * @see #QUATERNARY - * @see #IDENTICAL - * @stable ICU 2.4 - */ - public abstract int getStrength(); - - /** - * Gets the attribute to be used in comparison or transformation. - * @param type the attribute to be set from CollationAttribute - * @return value attribute value from CollationAttribute - * @stable ICU 2.4 - */ - public abstract int getAttribute(int type); - - /** - * Sets the minimum strength to be used in comparison or transformation. - *

Example of use: - *

-     * . Collator myCollation = Collator.createInstance(Locale::US);
-     * . myCollation.setStrength(PRIMARY);
-     * . // result will be "abc" == "ABC"
-     * . // tertiary differences will be ignored
-     * . int result = myCollation->compare("abc", "ABC");
-     * 
- * @param strength the new comparison level. - * @see #PRIMARY - * @see #SECONDARY - * @see #TERTIARY - * @see #QUATERNARY - * @see #IDENTICAL - * @stable ICU 2.4 - */ - public abstract void setStrength(int strength); - - /** - * Sets the attribute to be used in comparison or transformation. - *

Example of use: - *

-     * . Collator myCollation = Collator.createInstance(Locale::US);
-     * . myCollation.setAttribute(CollationAttribute.CASE_LEVEL,
-     * .                          CollationAttribute.VALUE_ON);
-     * . int result = myCollation->compare("\\u30C3\\u30CF",
-     * .                                   "\\u30C4\\u30CF");
-     * . // result will be -1.
-     * 
- * @param type the attribute to be set from CollationAttribute - * @param value attribute value from CollationAttribute - * @stable ICU 2.4 - */ - public abstract void setAttribute(int type, int value); - - /** - * Get the sort key as an CollationKey object from the argument string. - * To retrieve sort key in terms of byte arrays, use the method as below
- * - * Collator collator = Collator.getInstance(); - * CollationKey collationKey = collator.getCollationKey("string"); - * byte[] array = collationKey.toByteArray(); - *
- * Byte array result are zero-terminated and can be compared using - * java.util.Arrays.equals(); - * @param source string to be processed. - * @return the sort key - * @stable ICU 2.4 - */ - public abstract CollationKey getCollationKey(String source); - - /** - * Returns a hash of this collation object - * @return hash of this collation object - * @stable ICU 2.4 - */ - public abstract int hashCode(); -} diff --git a/icu/src/main/java/com/ibm/icu4jni/text/NativeBreakIterator.java b/icu/src/main/java/com/ibm/icu4jni/text/NativeBreakIterator.java deleted file mode 100644 index 272d525..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/text/NativeBreakIterator.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.ibm.icu4jni.text; - -import java.text.CharacterIterator; -import java.text.StringCharacterIterator; -import java.util.Locale; - -public final class NativeBreakIterator implements Cloneable { - // Acceptable values for the 'type' field. - private static final int BI_CHAR_INSTANCE = 1; - private static final int BI_WORD_INSTANCE = 2; - private static final int BI_LINE_INSTANCE = 3; - private static final int BI_SENT_INSTANCE = 4; - - private final int addr; - private final int type; - private CharacterIterator charIter; - - private NativeBreakIterator(int iterAddr, int type) { - this.addr = iterAddr; - this.type = type; - this.charIter = new StringCharacterIterator(""); - } - - @Override - public Object clone() { - int cloneAddr = cloneImpl(this.addr); - NativeBreakIterator clone = new NativeBreakIterator(cloneAddr, this.type); - // The RI doesn't clone the CharacterIterator. - clone.charIter = this.charIter; - return clone; - } - - @Override - public boolean equals(Object object) { - if (object == this) { - return true; - } - if (!(object instanceof NativeBreakIterator)) { - return false; - } - // TODO: is this sufficient? shouldn't we be checking the underlying rules? - NativeBreakIterator rhs = (NativeBreakIterator) object; - return type == rhs.type && charIter.equals(rhs.charIter); - } - - @Override - public int hashCode() { - return 42; // No-one uses BreakIterator as a hash key. - } - - @Override - protected void finalize() { - closeBreakIteratorImpl(this.addr); - } - - public int current() { - return currentImpl(this.addr); - } - - public int first() { - return firstImpl(this.addr); - } - - public int following(int offset) { - return followingImpl(this.addr, offset); - } - - public CharacterIterator getText() { - int newLoc = currentImpl(this.addr); - this.charIter.setIndex(newLoc); - return this.charIter; - } - - public int last() { - return lastImpl(this.addr); - } - - public int next(int n) { - return nextImpl(this.addr, n); - } - - public int next() { - return nextImpl(this.addr, 1); - } - - public int previous() { - return previousImpl(this.addr); - } - - public void setText(CharacterIterator newText) { - this.charIter = newText; - StringBuilder sb = new StringBuilder(); - for (char c = newText.first(); c != CharacterIterator.DONE; c = newText.next()) { - sb.append(c); - } - setTextImpl(this.addr, sb.toString()); - } - - public void setText(String newText) { - setText(new StringCharacterIterator(newText)); - } - - public boolean isBoundary(int offset) { - return isBoundaryImpl(this.addr, offset); - } - - public int preceding(int offset) { - return precedingImpl(this.addr, offset); - } - - public static NativeBreakIterator getCharacterInstance(Locale where) { - return new NativeBreakIterator(getCharacterInstanceImpl(where.toString()), BI_CHAR_INSTANCE); - } - - public static NativeBreakIterator getLineInstance(Locale where) { - return new NativeBreakIterator(getLineInstanceImpl(where.toString()), BI_LINE_INSTANCE); - } - - public static NativeBreakIterator getSentenceInstance(Locale where) { - return new NativeBreakIterator(getSentenceInstanceImpl(where.toString()), BI_SENT_INSTANCE); - } - - public static NativeBreakIterator getWordInstance(Locale where) { - return new NativeBreakIterator(getWordInstanceImpl(where.toString()), BI_WORD_INSTANCE); - } - - private static native int getCharacterInstanceImpl(String locale); - private static native int getWordInstanceImpl(String locale); - private static native int getLineInstanceImpl(String locale); - private static native int getSentenceInstanceImpl(String locale); - private static native void closeBreakIteratorImpl(int addr); - private static native void setTextImpl(int addr, String text); - private static native int cloneImpl(int addr); - private static native int precedingImpl(int addr, int offset); - private static native boolean isBoundaryImpl(int addr, int offset); - private static native int nextImpl(int addr, int n); - private static native int previousImpl(int addr); - private static native int currentImpl(int addr); - private static native int firstImpl(int addr); - private static native int followingImpl(int addr, int offset); - private static native int lastImpl(int addr); -} diff --git a/icu/src/main/java/com/ibm/icu4jni/text/NativeCollation.java b/icu/src/main/java/com/ibm/icu4jni/text/NativeCollation.java deleted file mode 100644 index d481790..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/text/NativeCollation.java +++ /dev/null @@ -1,232 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2005, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* -******************************************************************************* -*/ - -package com.ibm.icu4jni.text; - -/** -* Package static class for declaring all native methods for collation use. -* @author syn wee quek -* @internal ICU 2.4 -*/ - -final class NativeCollation -{ - // collator methods --------------------------------------------- - - public NativeCollation() { - - } - - /** - * Method to create a new C Collator using the argument locale rules. - * @param locale locale name - * @return new c collator - * @internal ICU 2.4 - */ - static native int openCollator(String locale); - - /** - * Method to create a new C Collator using the argument rules. - * @param rules , set of collation rules - * @param normalizationmode default normalization mode - * @param collationstrength default collation strength - * @return new c collator - * @internal ICU 2.4 - */ - static native int openCollatorFromRules(String rules, - int normalizationmode, - int collationstrength); - - /** - * Close a C collator - * Once closed, a UCollatorOld should not be used. - * @param collatoraddress The UCollatorOld to close - * @internal ICU 2.4 - */ - static native void closeCollator(int collatoraddress); - - /** - * Compare two strings. - * The strings will be compared using the normalization mode and options - * specified in openCollator or openCollatorFromRules - * @param collatoraddress address of the c collator - * @param source The source string. - * @param target The target string. - * @return result of the comparison, Collation.EQUAL, - * Collation.GREATER or Collation.LESS - * @internal ICU 2.4 - */ - static native int compare(int collatoraddress, String source, - String target); - - /** - * Get the normalization mode for this object. - * The normalization mode influences how strings are compared. - * @param collatoraddress - * @return normalization mode; one of the values from Normalization - * @internal ICU 2.4 - */ - static native int getNormalization(int collatoraddress); - - /** - * Set the normalization mode used int this object - * The normalization mode influences how strings are compared. - * @param collatoraddress the address of the C collator - * @param normalizationmode desired normalization mode; one of the values - * from Normalization - * @internal ICU 2.4 - */ - static native void setNormalization(int collatoraddress, - int normalizationmode); - - /** - * Get the collation rules from a UCollator. - * The rules will follow the rule syntax. - * @param collatoraddress the address of the C collator - * @return collation rules. - * @internal ICU 2.4 - */ - static native String getRules(int collatoraddress); - - /** - * Get a sort key for the argument string - * Sort keys may be compared using java.util.Arrays.equals - * @param collatoraddress address of the C collator - * @param source string for key to be generated - * @return sort key - * @internal ICU 2.4 - */ - static native byte[] getSortKey(int collatoraddress, String source); - - /** - * Gets the version information for collation. - * @param collatoraddress address of the C collator - * @return version information - * @internal ICU 2.4 - */ - // private native String getVersion(int collatoraddress); - - /** - * Universal attribute setter. - * @param collatoraddress address of the C collator - * @param type type of attribute to be set - * @param value attribute value - * @exception RuntimeException when error occurs while setting attribute value - * @internal ICU 2.4 - */ - static native void setAttribute(int collatoraddress, int type, int value); - - /** - * Universal attribute getter - * @param collatoraddress address of the C collator - * @param type type of attribute to be set - * @return attribute value - * @exception RuntimeException thrown when error occurs while getting attribute value - * @internal ICU 2.4 - */ - static native int getAttribute(int collatoraddress, int type); - - /** - * Thread safe cloning operation - * @param collatoraddress address of C collator to be cloned - * @return address of the new clone - * @exception RuntimeException thrown when error occurs while cloning - * @internal ICU 2.4 - */ - static native int safeClone(int collatoraddress); - - /** - * Create a CollationElementIterator object that will iterator over the - * elements in a string, using the collation rules defined in this - * RuleBasedCollator - * @param collatoraddress address of C collator - * @param source string to iterate over - * @return address of C collationelementiterator - * @internal ICU 2.4 - */ - static native int getCollationElementIterator(int collatoraddress, - String source); - - - // collationelementiterator methods ------------------------------------- - - /** - * Close a C collation element iterator. - * @param address of C collation element iterator to close. - * @internal ICU 2.4 - */ - static native void closeElements(int address); - - /** - * Reset the collation elements to their initial state. - * This will move the 'cursor' to the beginning of the text. - * @param address of C collation element iterator to reset. - * @internal ICU 2.4 - */ - static native void reset(int address); - - /** - * Get the ordering priority of the next collation element in the text. - * A single character may contain more than one collation element. - * @param address if C collation elements containing the text. - * @return next collation elements ordering, or NULLORDER if the end of the - * text is reached. - * @internal ICU 2.4 - */ - static native int next(int address); - - /** - * Get the ordering priority of the previous collation element in the text. - * A single character may contain more than one collation element. - * @param address of the C collation element iterator containing the text. - * @return previous collation element ordering, or NULLORDER if the end of - * the text is reached. - * @internal ICU 2.4 - */ - static native int previous(int address); - - /** - * Get the maximum length of any expansion sequences that end with the - * specified comparison order. - * @param address of the C collation element iterator containing the text. - * @param order collation order returned by previous or next. - * @return maximum length of any expansion sequences ending with the - * specified order. - * @internal ICU 2.4 - */ - static native int getMaxExpansion(int address, int order); - - /** - * Set the text containing the collation elements. - * @param address of the C collation element iterator to be set - * @param source text containing the collation elements. - * @internal ICU 2.4 - */ - static native void setText(int address, String source); - - /** - * Get the offset of the current source character. - * This is an offset into the text of the character containing the current - * collation elements. - * @param address of the C collation elements iterator to query. - * @return offset of the current source character. - * @internal ICU 2.4 - */ - static native int getOffset(int address); - - /** - * Set the offset of the current source character. - * This is an offset into the text of the character to be processed. - * @param address of the C collation element iterator to set. - * @param offset The desired character offset. - * @internal ICU 2.4 - */ - static native void setOffset(int address, int offset); -} diff --git a/icu/src/main/java/com/ibm/icu4jni/text/NativeDecimalFormat.java b/icu/src/main/java/com/ibm/icu4jni/text/NativeDecimalFormat.java deleted file mode 100644 index 6f751d5..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/text/NativeDecimalFormat.java +++ /dev/null @@ -1,611 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.ibm.icu4jni.text; - -import com.ibm.icu4jni.util.LocaleData; - -import java.math.BigDecimal; -import java.math.BigInteger; -import java.math.RoundingMode; -import java.text.AttributedCharacterIterator; -import java.text.AttributedString; -import java.text.DecimalFormatSymbols; -import java.text.FieldPosition; -import java.text.Format; -import java.text.NumberFormat; -import java.text.ParsePosition; -import java.util.Currency; -import java.util.Locale; - -public final class NativeDecimalFormat { - /** - * Constants corresponding to the native type UNumberFormatSymbol, for setSymbol. - */ - private static final int UNUM_DECIMAL_SEPARATOR_SYMBOL = 0; - private static final int UNUM_GROUPING_SEPARATOR_SYMBOL = 1; - private static final int UNUM_PATTERN_SEPARATOR_SYMBOL = 2; - private static final int UNUM_PERCENT_SYMBOL = 3; - private static final int UNUM_ZERO_DIGIT_SYMBOL = 4; - private static final int UNUM_DIGIT_SYMBOL = 5; - private static final int UNUM_MINUS_SIGN_SYMBOL = 6; - private static final int UNUM_PLUS_SIGN_SYMBOL = 7; - private static final int UNUM_CURRENCY_SYMBOL = 8; - private static final int UNUM_INTL_CURRENCY_SYMBOL = 9; - private static final int UNUM_MONETARY_SEPARATOR_SYMBOL = 10; - private static final int UNUM_EXPONENTIAL_SYMBOL = 11; - private static final int UNUM_PERMILL_SYMBOL = 12; - private static final int UNUM_PAD_ESCAPE_SYMBOL = 13; - private static final int UNUM_INFINITY_SYMBOL = 14; - private static final int UNUM_NAN_SYMBOL = 15; - private static final int UNUM_SIGNIFICANT_DIGIT_SYMBOL = 16; - private static final int UNUM_MONETARY_GROUPING_SEPARATOR_SYMBOL = 17; - private static final int UNUM_FORMAT_SYMBOL_COUNT = 18; - - /** - * Constants corresponding to the native type UNumberFormatAttribute, for - * getAttribute/setAttribute. - */ - private static final int UNUM_PARSE_INT_ONLY = 0; - private static final int UNUM_GROUPING_USED = 1; - private static final int UNUM_DECIMAL_ALWAYS_SHOWN = 2; - private static final int UNUM_MAX_INTEGER_DIGITS = 3; - private static final int UNUM_MIN_INTEGER_DIGITS = 4; - private static final int UNUM_INTEGER_DIGITS = 5; - private static final int UNUM_MAX_FRACTION_DIGITS = 6; - private static final int UNUM_MIN_FRACTION_DIGITS = 7; - private static final int UNUM_FRACTION_DIGITS = 8; - private static final int UNUM_MULTIPLIER = 9; - private static final int UNUM_GROUPING_SIZE = 10; - private static final int UNUM_ROUNDING_MODE = 11; - private static final int UNUM_ROUNDING_INCREMENT = 12; - private static final int UNUM_FORMAT_WIDTH = 13; - private static final int UNUM_PADDING_POSITION = 14; - private static final int UNUM_SECONDARY_GROUPING_SIZE = 15; - private static final int UNUM_SIGNIFICANT_DIGITS_USED = 16; - private static final int UNUM_MIN_SIGNIFICANT_DIGITS = 17; - private static final int UNUM_MAX_SIGNIFICANT_DIGITS = 18; - private static final int UNUM_LENIENT_PARSE = 19; - - /** - * Constants corresponding to the native type UNumberFormatTextAttribute, for - * getTextAttribute/setTextAttribute. - */ - private static final int UNUM_POSITIVE_PREFIX = 0; - private static final int UNUM_POSITIVE_SUFFIX = 1; - private static final int UNUM_NEGATIVE_PREFIX = 2; - private static final int UNUM_NEGATIVE_SUFFIX = 3; - private static final int UNUM_PADDING_CHARACTER = 4; - private static final int UNUM_CURRENCY_CODE = 5; - private static final int UNUM_DEFAULT_RULESET = 6; - private static final int UNUM_PUBLIC_RULESETS = 7; - - /** - * The address of the ICU DecimalFormat* on the native heap. - */ - private final int addr; - - /** - * The last pattern we gave to ICU, so we can make repeated applications cheap. - * This helps in cases like String.format("%.2f,%.2f\n", x, y) where the DecimalFormat is - * reused. - */ - private String lastPattern; - - // TODO: store all these in DecimalFormat instead! - private boolean negPrefNull; - private boolean negSuffNull; - private boolean posPrefNull; - private boolean posSuffNull; - - /** - * Cache the BigDecimal form of the multiplier. This is null until we've - * formatted a BigDecimal (with a multiplier that is not 1), or the user has - * explicitly called {@link #setMultiplier(int)} with any multiplier. - */ - private BigDecimal multiplierBigDecimal = null; - - public NativeDecimalFormat(String pattern, DecimalFormatSymbols dfs) { - try { - this.addr = openDecimalFormatImpl(pattern, dfs.getCurrencySymbol(), - dfs.getDecimalSeparator(), dfs.getDigit(), dfs.getGroupingSeparator(), - dfs.getInfinity(), dfs.getInternationalCurrencySymbol(), dfs.getMinusSign(), - dfs.getMonetaryDecimalSeparator(), dfs.getNaN(), dfs.getPatternSeparator(), - dfs.getPercent(), dfs.getPerMill(), dfs.getZeroDigit()); - this.lastPattern = pattern; - } catch (NullPointerException npe) { - throw npe; - } catch (RuntimeException re) { - throw new IllegalArgumentException("syntax error: " + re.getMessage() + ": " + pattern); - } - } - - // Used to implement clone. - private NativeDecimalFormat(NativeDecimalFormat other) { - this.addr = cloneDecimalFormatImpl(other.addr); - this.lastPattern = other.lastPattern; - this.negPrefNull = other.negPrefNull; - this.negSuffNull = other.negSuffNull; - this.posPrefNull = other.posPrefNull; - this.posSuffNull = other.posSuffNull; - } - - // TODO: remove this and just have DecimalFormat.hashCode do the right thing itself. - @Override - public int hashCode() { - return this.getPositivePrefix().hashCode(); - } - - @Override - public Object clone() { - return new NativeDecimalFormat(this); - } - - @Override - protected void finalize() { - closeDecimalFormatImpl(this.addr); - } - - /** - * Note: this doesn't check that the underlying native DecimalFormat objects' configured - * native DecimalFormatSymbols objects are equal. It is assumed that the - * caller (DecimalFormat) will check the DecimalFormatSymbols objects - * instead, for performance. - * - * This is also unreasonably expensive, calling down to JNI multiple times. - * - * TODO: remove this and just have DecimalFormat.equals do the right thing itself. - */ - @Override - public boolean equals(Object object) { - if (object == this) { - return true; - } - if (!(object instanceof NativeDecimalFormat)) { - return false; - } - NativeDecimalFormat obj = (NativeDecimalFormat) object; - if (obj.addr == this.addr) { - return true; - } - return obj.toPattern().equals(this.toPattern()) && - obj.isDecimalSeparatorAlwaysShown() == this.isDecimalSeparatorAlwaysShown() && - obj.getGroupingSize() == this.getGroupingSize() && - obj.getMultiplier() == this.getMultiplier() && - obj.getNegativePrefix().equals(this.getNegativePrefix()) && - obj.getNegativeSuffix().equals(this.getNegativeSuffix()) && - obj.getPositivePrefix().equals(this.getPositivePrefix()) && - obj.getPositiveSuffix().equals(this.getPositiveSuffix()) && - obj.getMaximumIntegerDigits() == this.getMaximumIntegerDigits() && - obj.getMaximumFractionDigits() == this.getMaximumFractionDigits() && - obj.getMinimumIntegerDigits() == this.getMinimumIntegerDigits() && - obj.getMinimumFractionDigits() == this.getMinimumFractionDigits() && - obj.isGroupingUsed() == this.isGroupingUsed(); - } - - /** - * Copies the DecimalFormatSymbols settings into our native peer in bulk. - */ - public void setDecimalFormatSymbols(final DecimalFormatSymbols dfs) { - setDecimalFormatSymbols(this.addr, dfs.getCurrencySymbol(), dfs.getDecimalSeparator(), - dfs.getDigit(), dfs.getGroupingSeparator(), dfs.getInfinity(), - dfs.getInternationalCurrencySymbol(), dfs.getMinusSign(), - dfs.getMonetaryDecimalSeparator(), dfs.getNaN(), dfs.getPatternSeparator(), - dfs.getPercent(), dfs.getPerMill(), dfs.getZeroDigit()); - } - - private BigDecimal applyMultiplier(BigDecimal valBigDecimal) { - if (multiplierBigDecimal == null) { - multiplierBigDecimal = BigDecimal.valueOf(getMultiplier()); - } - // Get new value by multiplying multiplier. - return valBigDecimal.multiply(multiplierBigDecimal); - } - - public StringBuffer formatBigDecimal(BigDecimal value, StringBuffer buffer, FieldPosition field) { - if (buffer == null || field == null) { - throw new NullPointerException(); - } - if (getMultiplier() != 1) { - value = applyMultiplier(value); - } - StringBuilder val = new StringBuilder(); - val.append(value.unscaledValue().toString(10)); - int scale = value.scale(); - scale = makeScalePositive(scale, val); - String fieldType = getFieldType(field.getFieldAttribute()); - String result = format(this.addr, val.toString(), field, fieldType, null, scale); - return buffer.append(result); - } - - public StringBuffer formatBigInteger(BigInteger value, StringBuffer buffer, FieldPosition field) { - if (buffer == null || field == null) { - throw new NullPointerException(); - } - String fieldType = getFieldType(field.getFieldAttribute()); - String result = format(this.addr, value.toString(10), field, fieldType, null, 0); - return buffer.append(result); - } - - public StringBuffer format(long value, StringBuffer buffer, FieldPosition field) { - if (buffer == null || field == null) { - throw new NullPointerException(); - } - String fieldType = getFieldType(field.getFieldAttribute()); - buffer.append(format(this.addr, value, field, fieldType, null)); - return buffer; - } - - public StringBuffer format(double value, StringBuffer buffer, FieldPosition field) { - if (buffer == null || field == null) { - throw new NullPointerException(); - } - String fieldType = getFieldType(field.getFieldAttribute()); - buffer.append(format(this.addr, value, field, fieldType, null)); - return buffer; - } - - public void applyLocalizedPattern(String pattern) { - applyPattern(this.addr, true, pattern); - lastPattern = null; - } - - public void applyPattern(String pattern) { - if (lastPattern != null && pattern.equals(lastPattern)) { - return; - } - applyPattern(this.addr, false, pattern); - lastPattern = pattern; - } - - public AttributedCharacterIterator formatToCharacterIterator(Object object) { - if (!(object instanceof Number)) { - throw new IllegalArgumentException(); - } - Number number = (Number) object; - String text = null; - StringBuffer attributes = new StringBuffer(); - - if(number instanceof BigInteger) { - BigInteger valBigInteger = (BigInteger) number; - text = format(this.addr, valBigInteger.toString(10), null, null, attributes, 0); - } else if(number instanceof BigDecimal) { - BigDecimal valBigDecimal = (BigDecimal) number; - if (getMultiplier() != 1) { - valBigDecimal = applyMultiplier(valBigDecimal); - } - StringBuilder val = new StringBuilder(); - val.append(valBigDecimal.unscaledValue().toString(10)); - int scale = valBigDecimal.scale(); - scale = makeScalePositive(scale, val); - text = format(this.addr, val.toString(), null, null, attributes, scale); - } else if (number instanceof Double || number instanceof Float) { - double dv = number.doubleValue(); - text = format(this.addr, dv, null, null, attributes); - } else { - long lv = number.longValue(); - text = format(this.addr, lv, null, null, attributes); - } - - AttributedString as = new AttributedString(text); - - String[] attrs = attributes.toString().split(";"); - // add NumberFormat field attributes to the AttributedString - int size = attrs.length / 3; - if(size * 3 != attrs.length) { - return as.getIterator(); - } - for (int i = 0; i < size; i++) { - Format.Field attribute = getField(attrs[3*i]); - as.addAttribute(attribute, attribute, Integer.parseInt(attrs[3*i+1]), - Integer.parseInt(attrs[3*i+2])); - } - - // return the CharacterIterator from AttributedString - return as.getIterator(); - } - - private int makeScalePositive(int scale, StringBuilder val) { - if (scale < 0) { - scale = -scale; - for (int i = scale; i > 0; i--) { - val.append('0'); - } - scale = 0; - } - return scale; - } - - public String toLocalizedPattern() { - return toPatternImpl(this.addr, true); - } - - public String toPattern() { - return toPatternImpl(this.addr, false); - } - - public Number parse(String string, ParsePosition position) { - return parse(addr, string, position); - } - - // start getter and setter - - public int getMaximumFractionDigits() { - return getAttribute(this.addr, UNUM_MAX_FRACTION_DIGITS); - } - - public int getMaximumIntegerDigits() { - return getAttribute(this.addr, UNUM_MAX_INTEGER_DIGITS); - } - - public int getMinimumFractionDigits() { - return getAttribute(this.addr, UNUM_MIN_FRACTION_DIGITS); - } - - public int getMinimumIntegerDigits() { - return getAttribute(this.addr, UNUM_MIN_INTEGER_DIGITS); - } - - public int getGroupingSize() { - return getAttribute(this.addr, UNUM_GROUPING_SIZE); - } - - public int getMultiplier() { - return getAttribute(this.addr, UNUM_MULTIPLIER); - } - - public String getNegativePrefix() { - if (negPrefNull) { - return null; - } - return getTextAttribute(this.addr, UNUM_NEGATIVE_PREFIX); - } - - public String getNegativeSuffix() { - if (negSuffNull) { - return null; - } - return getTextAttribute(this.addr, UNUM_NEGATIVE_SUFFIX); - } - - public String getPositivePrefix() { - if (posPrefNull) { - return null; - } - return getTextAttribute(this.addr, UNUM_POSITIVE_PREFIX); - } - - public String getPositiveSuffix() { - if (posSuffNull) { - return null; - } - return getTextAttribute(this.addr, UNUM_POSITIVE_SUFFIX); - } - - public boolean isDecimalSeparatorAlwaysShown() { - return getAttribute(this.addr, UNUM_DECIMAL_ALWAYS_SHOWN) != 0; - } - - public boolean isParseIntegerOnly() { - return getAttribute(this.addr, UNUM_PARSE_INT_ONLY) != 0; - } - - public boolean isGroupingUsed() { - return getAttribute(this.addr, UNUM_GROUPING_USED) != 0; - } - - public void setDecimalSeparatorAlwaysShown(boolean value) { - int i = value ? -1 : 0; - setAttribute(this.addr, UNUM_DECIMAL_ALWAYS_SHOWN, i); - } - - public void setCurrency(Currency currency) { - setSymbol(this.addr, UNUM_CURRENCY_SYMBOL, currency.getSymbol()); - setSymbol(this.addr, UNUM_INTL_CURRENCY_SYMBOL, currency.getCurrencyCode()); - } - - public void setGroupingSize(int value) { - setAttribute(this.addr, UNUM_GROUPING_SIZE, value); - } - - public void setGroupingUsed(boolean value) { - int i = value ? -1 : 0; - setAttribute(this.addr, UNUM_GROUPING_USED, i); - } - - public void setMaximumFractionDigits(int value) { - setAttribute(this.addr, UNUM_MAX_FRACTION_DIGITS, value); - } - - public void setMaximumIntegerDigits(int value) { - setAttribute(this.addr, UNUM_MAX_INTEGER_DIGITS, value); - } - - public void setMinimumFractionDigits(int value) { - setAttribute(this.addr, UNUM_MIN_FRACTION_DIGITS, value); - } - - public void setMinimumIntegerDigits(int value) { - setAttribute(this.addr, UNUM_MIN_INTEGER_DIGITS, value); - } - - public void setMultiplier(int value) { - setAttribute(this.addr, UNUM_MULTIPLIER, value); - // Update the cached BigDecimal for multiplier. - multiplierBigDecimal = BigDecimal.valueOf(value); - } - - public void setNegativePrefix(String value) { - negPrefNull = value == null; - if (!negPrefNull) { - setTextAttribute(this.addr, UNUM_NEGATIVE_PREFIX, value); - } - } - - public void setNegativeSuffix(String value) { - negSuffNull = value == null; - if (!negSuffNull) { - setTextAttribute(this.addr, UNUM_NEGATIVE_SUFFIX, value); - } - } - - public void setPositivePrefix(String value) { - posPrefNull = value == null; - if (!posPrefNull) { - setTextAttribute(this.addr, UNUM_POSITIVE_PREFIX, value); - } - } - - public void setPositiveSuffix(String value) { - posSuffNull = value == null; - if (!posSuffNull) { - setTextAttribute(this.addr, UNUM_POSITIVE_SUFFIX, value); - } - } - - public void setParseIntegerOnly(boolean value) { - int i = value ? -1 : 0; - setAttribute(this.addr, UNUM_PARSE_INT_ONLY, i); - } - - static protected String getFieldType(Format.Field field) { - if(field == null) { - return null; - } - if(field.equals(NumberFormat.Field.SIGN)) { - return "sign"; - } - if(field.equals(NumberFormat.Field.INTEGER)) { - return "integer"; - } - if(field.equals(NumberFormat.Field.FRACTION)) { - return "fraction"; - } - if(field.equals(NumberFormat.Field.EXPONENT)) { - return "exponent"; - } - if(field.equals(NumberFormat.Field.EXPONENT_SIGN)) { - return "exponent_sign"; - } - if(field.equals(NumberFormat.Field.EXPONENT_SYMBOL)) { - return "exponent_symbol"; - } - if(field.equals(NumberFormat.Field.CURRENCY)) { - return "currency"; - } - if(field.equals(NumberFormat.Field.GROUPING_SEPARATOR)) { - return "grouping_separator"; - } - if(field.equals(NumberFormat.Field.DECIMAL_SEPARATOR)) { - return "decimal_separator"; - } - if(field.equals(NumberFormat.Field.PERCENT)) { - return "percent"; - } - if(field.equals(NumberFormat.Field.PERMILLE)) { - return "permille"; - } - return null; - } - - protected Format.Field getField(String type) { - if(type.equals("")) { - return null; - } - if(type.equals("sign")) { - return NumberFormat.Field.SIGN; - } - if(type.equals("integer")) { - return NumberFormat.Field.INTEGER; - } - if(type.equals("fraction")) { - return NumberFormat.Field.FRACTION; - } - if(type.equals("exponent")) { - return NumberFormat.Field.EXPONENT; - } - if(type.equals("exponent_sign")) { - return NumberFormat.Field.EXPONENT_SIGN; - } - if(type.equals("exponent_symbol")) { - return NumberFormat.Field.EXPONENT_SYMBOL; - } - if(type.equals("currency")) { - return NumberFormat.Field.CURRENCY; - } - if(type.equals("grouping_separator")) { - return NumberFormat.Field.GROUPING_SEPARATOR; - } - if(type.equals("decimal_separator")) { - return NumberFormat.Field.DECIMAL_SEPARATOR; - } - if(type.equals("percent")) { - return NumberFormat.Field.PERCENT; - } - if(type.equals("permille")) { - return NumberFormat.Field.PERMILLE; - } - return null; - } - - private static void applyPattern(int addr, boolean localized, String pattern) { - try { - applyPatternImpl(addr, localized, pattern); - } catch (NullPointerException npe) { - throw npe; - } catch (RuntimeException re) { - throw new IllegalArgumentException("syntax error: " + re.getMessage() + ": " + pattern); - } - } - - public void setRoundingMode(RoundingMode roundingMode, double roundingIncrement) { - final int nativeRoundingMode; - switch (roundingMode) { - case CEILING: nativeRoundingMode = 0; break; - case FLOOR: nativeRoundingMode = 1; break; - case DOWN: nativeRoundingMode = 2; break; - case UP: nativeRoundingMode = 3; break; - case HALF_EVEN: nativeRoundingMode = 4; break; - case HALF_DOWN: nativeRoundingMode = 5; break; - case HALF_UP: nativeRoundingMode = 6; break; - default: throw new AssertionError(); - } - setRoundingMode(addr, nativeRoundingMode, roundingIncrement); - } - - private static native void applyPatternImpl(int addr, boolean localized, String pattern); - private static native int cloneDecimalFormatImpl(int addr); - private static native void closeDecimalFormatImpl(int addr); - private static native String format(int addr, long value, FieldPosition position, String fieldType, StringBuffer attributes); - private static native String format(int addr, double value, FieldPosition position, String fieldType, StringBuffer attributes); - private static native String format(int addr, String value, FieldPosition position, String fieldType, StringBuffer attributes, int scale); - private static native int getAttribute(int addr, int symbol); - private static native String getTextAttribute(int addr, int symbol); - private static native int openDecimalFormatImpl(String pattern, String currencySymbol, - char decimalSeparator, char digit, char groupingSeparator, String infinity, - String internationalCurrencySymbol, char minusSign, char monetaryDecimalSeparator, - String nan, char patternSeparator, char percent, char perMill, char zeroDigit); - private static native Number parse(int addr, String string, ParsePosition position); - private static native void setDecimalFormatSymbols(int addr, String currencySymbol, - char decimalSeparator, char digit, char groupingSeparator, String infinity, - String internationalCurrencySymbol, char minusSign, char monetaryDecimalSeparator, - String nan, char patternSeparator, char percent, char perMill, char zeroDigit); - private static native void setSymbol(int addr, int symbol, String str); - private static native void setAttribute(int addr, int symbol, int i); - private static native void setRoundingMode(int addr, int roundingMode, double roundingIncrement); - private static native void setTextAttribute(int addr, int symbol, String str); - private static native String toPatternImpl(int addr, boolean localized); -} diff --git a/icu/src/main/java/com/ibm/icu4jni/text/NativeIDN.java b/icu/src/main/java/com/ibm/icu4jni/text/NativeIDN.java deleted file mode 100644 index b973131..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/text/NativeIDN.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.ibm.icu4jni.text; - -public class NativeIDN { - public static String toASCII(String s, int flags) { - return convert(s, flags, true); - } - - public static String toUnicode(String s, int flags) { - try { - return convert(s, flags, false); - } catch (IllegalArgumentException ex) { - // The RI documentation explicitly states that this method can't fail. - // ICU4C disagrees, as does the RI in practice. - // The RI just returns the input string if it can't - return s; - } - } - - private static String convert(String s, int flags, boolean toAscii) { - if (s == null) { - throw new NullPointerException(); - } - return convertImpl(s, flags, toAscii); - } - private static native String convertImpl(String s, int flags, boolean toAscii); - - private NativeIDN() {} -} diff --git a/icu/src/main/java/com/ibm/icu4jni/text/NativeNormalizer.java b/icu/src/main/java/com/ibm/icu4jni/text/NativeNormalizer.java deleted file mode 100644 index f14b6c1..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/text/NativeNormalizer.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.ibm.icu4jni.text; - -import java.text.Normalizer.Form; - -public final class NativeNormalizer { - public static boolean isNormalized(CharSequence src, Form form) { - return isNormalizedImpl(src.toString(), toUNormalizationMode(form)); - } - - public static String normalize(CharSequence src, Form form) { - return normalizeImpl(src.toString(), toUNormalizationMode(form)); - } - - private static int toUNormalizationMode(Form form) { - // Translates Java enum constants to ICU int constants. - // See UNormalizationMode in "unicode/unorm.h". Stable API since ICU 2.0. - switch (form) { - case NFC: return 4; - case NFD: return 2; - case NFKC: return 5; - case NFKD: return 3; - } - throw new AssertionError("unknown Normalizer.Form " + form); - } - - private static native String normalizeImpl(String src, int form); - - private static native boolean isNormalizedImpl(String src, int form); - - private NativeNormalizer() {} -} diff --git a/icu/src/main/java/com/ibm/icu4jni/text/RuleBasedCollator.java b/icu/src/main/java/com/ibm/icu4jni/text/RuleBasedCollator.java deleted file mode 100644 index 8e048dd..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/text/RuleBasedCollator.java +++ /dev/null @@ -1,543 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2005, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* -******************************************************************************* -*/ - -package com.ibm.icu4jni.text; - -import java.util.Locale; -import java.text.CharacterIterator; -import java.text.ParseException; - -/** -* Concrete implementation class for Collation. -*

-* The collation table is composed of a list of collation rules, where each -* rule is of three forms: -*

-*    < modifier >
-*    < relation > < text-argument >
-*    < reset > < text-argument >
-* 
-*

-* RuleBasedCollator has the following restrictions for efficiency -* (other subclasses may be used for more complex languages) : -*

    -*
  1. If a French secondary ordering is specified it applies to the whole -* collator object. -*
  2. All non-mentioned Unicode characters are at the end of the collation -* order. -*
  3. If a character is not located in the RuleBasedCollator, the default -* Unicode Collation Algorithm (UCA) rule-based table is automatically -* searched as a backup. -*
-* -* The following demonstrates how to create your own collation rules: -*
    -*
  • Text-Argument: A text-argument is any sequence of -* characters, excluding special characters (that is, common whitespace -* characters [0009-000D, 0020] and rule syntax characters [0021-002F, -* 003A-0040, 005B-0060, 007B-007E]). If those characters are desired, -* you can put them in single quotes (e.g. ampersand => '&'). Note that -* unquoted white space characters are ignored; e.g. b c is -* treated as bc. -*
  • Modifier: There is a single modifier which is used -* to specify that all accents (secondary differences) are backwards. -*

    '@' : Indicates that accents are sorted backwards, as in French. -*

  • Relation: The relations are the following: -*
      -*
    • '<' : Greater, as a letter difference (primary) -*
    • ';' : Greater, as an accent difference (secondary) -*
    • ',' : Greater, as a case difference (tertiary) -*
    • '=' : Equal -*
    -*
  • Reset: There is a single reset which is used -* primarily for contractions and expansions, but which can also be used -* to add a modification at the end of a set of rules. -*

    '&' : Indicates that the next rule follows the position to where -* the reset text-argument would be sorted. -*

-* -*

-* This sounds more complicated than it is in practice. For example, the -* following are equivalent ways of expressing the same thing: -*

-*
-* a < b < c
-* a < b & b < c
-* a < c & a < b
-* 
-*
-* Notice that the order is important, as the subsequent item goes immediately -* after the text-argument. The following are not equivalent: -*
-*
-* a < b & a < c
-* a < c & a < b
-* 
-*
-* Either the text-argument must already be present in the sequence, or some -* initial substring of the text-argument must be present. (e.g. "a < b & ae < -* e" is valid since "a" is present in the sequence before "ae" is reset). In -* this latter case, "ae" is not entered and treated as a single character; -* instead, "e" is sorted as if it were expanded to two characters: "a" -* followed by an "e". This difference appears in natural languages: in -* traditional Spanish "ch" is treated as though it contracts to a single -* character (expressed as "c < ch < d"), while in traditional German a-umlaut -* is treated as though it expanded to two characters (expressed as "a,A < b,B -* ... & ae;? & AE;?"). [? and ? are, of course, the escape sequences for -* a-umlaut.] -*

-* Ignorable Characters -*

-* For ignorable characters, the first rule must start with a relation (the -* examples we have used above are really fragments; "a < b" really should be -* "< a < b"). If, however, the first relation is not "<", then all the all -* text-arguments up to the first "<" are ignorable. For example, ", - < a < b" -* makes "-" an ignorable character, as we saw earlier in the word -* "black-birds". In the samples for different languages, you see that most -* accents are ignorable. -* -*

Normalization and Accents -*

-* RuleBasedCollator automatically processes its rule table to -* include both pre-composed and combining-character versions of accented -* characters. Even if the provided rule string contains only base characters -* and separate combining accent characters, the pre-composed accented -* characters matching all canonical combinations of characters from the rule -* string will be entered in the table. -*

-* This allows you to use a RuleBasedCollator to compare accented strings even -* when the collator is set to NO_DECOMPOSITION. However, if the strings to be -* collated contain combining sequences that may not be in canonical order, you -* should set the collator to CANONICAL_DECOMPOSITION to enable sorting of -* combining sequences. -* For more information, see -* The Unicode Standard, Version 3.0.) -* -*

Errors -*

-* The following are errors: -*

    -*
  • A text-argument contains unquoted punctuation symbols -* (e.g. "a < b-c < d"). -*
  • A relation or reset character not followed by a text-argument -* (e.g. "a < , b"). -*
  • A reset where the text-argument (or an initial substring of the -* text-argument) is not already in the sequence or allocated in the -* default UCA table. -* (e.g. "a < b & e < f") -*
-* If you produce one of these errors, a RuleBasedCollator throws -* a ParseException. -* -*

Examples -*

Simple: "< a < b < c < d" -*

Norwegian: "< a,A< b,B< c,C< d,D< e,E< f,F< g,G< h,H< i,I< j,J -* < k,K< l,L< m,M< n,N< o,O< p,P< q,Q< r,R< s,S< t,T -* < u,U< v,V< w,W< x,X< y,Y< z,Z -* < ?=a?,?=A? -* ;aa,AA< ?,?< ?,?" -* -*

-* Normally, to create a rule-based Collator object, you will use -* Collator's factory method getInstance. -* However, to create a rule-based Collator object with specialized rules -* tailored to your needs, you construct the RuleBasedCollator -* with the rules contained in a String object. For example: -*

-*
-* String Simple = "< a < b < c < d";
-* RuleBasedCollator mySimple = new RuleBasedCollator(Simple);
-* 
-*
-* Or: -*
-*
-* String Norwegian = "< a,A< b,B< c,C< d,D< e,E< f,F< g,G< h,H< i,I< j,J" +
-*                 "< k,K< l,L< m,M< n,N< o,O< p,P< q,Q< r,R< s,S< t,T" +
-*                 "< u,U< v,V< w,W< x,X< y,Y< z,Z" +
-*                 "< ?=a?,?=A?" +
-*                 ";aa,AA< ?,?< ?,?";
-* RuleBasedCollator myNorwegian = new RuleBasedCollator(Norwegian);
-* 
-*
-* -*

-* Combining Collators is as simple as concatenating strings. -* Here's an example that combines two Collators from two -* different locales: -*

-*
-* // Create an en_US Collator object
-* RuleBasedCollator en_USCollator = (RuleBasedCollator)
-*     Collator.getInstance(new Locale("en", "US", ""));
-* // Create a da_DK Collator object
-* RuleBasedCollator da_DKCollator = (RuleBasedCollator)
-*     Collator.getInstance(new Locale("da", "DK", ""));
-* // Combine the two
-* // First, get the collation rules from en_USCollator
-* String en_USRules = en_USCollator.getRules();
-* // Second, get the collation rules from da_DKCollator
-* String da_DKRules = da_DKCollator.getRules();
-* RuleBasedCollator newCollator =
-*     new RuleBasedCollator(en_USRules + da_DKRules);
-* // newCollator has the combined rules
-* 
-*
-* -*

-* Another more interesting example would be to make changes on an existing -* table to create a new Collator object. For example, add -* "& C < ch, cH, Ch, CH" to the en_USCollator object to create -* your own: -*

-*
-* // Create a new Collator object with additional rules
-* String addRules = "& C < ch, cH, Ch, CH";
-* RuleBasedCollator myCollator =
-*     new RuleBasedCollator(en_USCollator + addRules);
-* // myCollator contains the new rules
-* 
-*
-* -*

-* The following example demonstrates how to change the order of -* non-spacing accents, -*

-*
-* // old rule
-* String oldRules = "=?;?;?"    // main accents Diaeresis 00A8, Macron 00AF
-*                               // Acute 00BF
-*                 + "< a , A ; ae, AE ; ? , ?"
-*                 + "< b , B < c, C < e, E & C < d, D";
-* // change the order of accent characters
-* String addOn = "& ?;?;?;"; // Acute 00BF, Macron 00AF, Diaeresis 00A8
-* RuleBasedCollator myCollator = new RuleBasedCollator(oldRules + addOn);
-* 
-*
-* -*

-* The last example shows how to put new primary ordering in before the -* default setting. For example, in Japanese Collator, you -* can either sort English characters before or after Japanese characters, -*

-*
-* // get en_US Collator rules
-* RuleBasedCollator en_USCollator =
-*                      (RuleBasedCollator)Collator.getInstance(Locale.US);
-* // add a few Japanese character to sort before English characters
-* // suppose the last character before the first base letter 'a' in
-* // the English collation rule is ?
-* String jaString = "& \\u30A2 , \\u30FC < \\u30C8";
-* RuleBasedCollator myJapaneseCollator = new
-*     RuleBasedCollator(en_USCollator.getRules() + jaString);
-* 
-*
-*

-* @author syn wee quek -* @stable ICU 2.4 -*/ -public final class RuleBasedCollator extends Collator { - private int m_collator_; - private int m_hashcode_ = 0; - - /** - * RuleBasedCollator constructor. This takes the table rules and builds a - * collation table out of them. Please see RuleBasedCollator class - * description for more details on the collation rule syntax. - * @param rules the collation rules to build the collation table from. - * @exception ParseException thrown if rules are empty or a Runtime error - * if collator can not be created. - * @stable ICU 2.4 - */ - public RuleBasedCollator(String rules) throws ParseException { - if (rules == null) { - throw new NullPointerException(); - } - m_collator_ = NativeCollation.openCollatorFromRules(rules, - CollationAttribute.VALUE_OFF, CollationAttribute.VALUE_DEFAULT_STRENGTH); - } - - /** - * RuleBasedCollator constructor. This takes the table rules and builds a - * collation table out of them. Please see RuleBasedCollator class - * description for more details on the collation rule syntax. - * @param rules the collation rules to build the collation table from. - * @param strength collation strength - * @exception ParseException thrown if rules are empty or a Runtime error - * if collator can not be created. - * @see #PRIMARY - * @see #SECONDARY - * @see #TERTIARY - * @see #QUATERNARY - * @see #IDENTICAL - * @stable ICU 2.4 - */ - public RuleBasedCollator(String rules, int strength) throws ParseException { - if (rules == null) { - throw new NullPointerException(); - } - m_collator_ = NativeCollation.openCollatorFromRules(rules, CollationAttribute.VALUE_OFF, strength); - } - - /** - * RuleBasedCollator constructor. This takes the table rules and builds a - * collation table out of them. Please see RuleBasedCollator class - * description for more details on the collation rule syntax. - *

Note API change starting from release 2.4. Prior to release 2.4, the - * normalizationMode argument values are from the class - * com.ibm.icu4jni.text.Normalization. In 2.4, - * the valid normalizationMode arguments for this API are - * CollationAttribute.VALUE_ON and CollationAttribute.VALUE_OFF. - *

- * @param rules the collation rules to build the collation table from. - * @param strength collation strength - * @param normalizationMode normalization mode - * @exception IllegalArgumentException thrown when constructor error occurs - * @see #PRIMARY - * @see #SECONDARY - * @see #TERTIARY - * @see #QUATERNARY - * @see #IDENTICAL - * @see #CANONICAL_DECOMPOSITION - * @see #NO_DECOMPOSITION - * @stable ICU 2.4 - */ - public RuleBasedCollator(String rules, int normalizationMode, int strength) { - if (rules == null) { - throw new NullPointerException(); - } - m_collator_ = NativeCollation.openCollatorFromRules(rules, normalizationMode, strength); - } - - /** - * Makes a complete copy of the current object. - * @return a copy of this object if data clone is a success, otherwise null - * @stable ICU 2.4 - */ - public Object clone() { - RuleBasedCollator result = null; - int collatoraddress = NativeCollation.safeClone(m_collator_); - result = new RuleBasedCollator(collatoraddress); - return (Collator)result; - } - - /** - * The comparison function compares the character data stored in two - * different strings. Returns information about whether a string is less - * than, greater than or equal to another string. - *

Example of use: - *
- * - * Collator myCollation = Collator.createInstance(Locale::US); - * myCollation.setStrength(CollationAttribute.VALUE_PRIMARY); - * // result would be 0 ("abc" == "ABC") - * // (no primary difference between "abc" and "ABC") - * int result = myCollation.compare("abc", "ABC",3); - * myCollation.setStrength(CollationAttribute.VALUE_TERTIARY); - * // result would be -1 (abc" <<< "ABC") - * // (with tertiary difference between "abc" and "ABC") - * int result = myCollation.compare("abc", "ABC",3); - * - */ - public int compare(String source, String target) { - return NativeCollation.compare(m_collator_, source, target); - } - - /** - * Get the normalization mode for this object. - * The normalization mode influences how strings are compared. - * @see #CANONICAL_DECOMPOSITION - * @see #NO_DECOMPOSITION - * @stable ICU 2.4 - */ - public int getDecomposition() { - return NativeCollation.getNormalization(m_collator_); - } - - /** - *

Sets the decomposition mode of the Collator object on or off. - * If the decomposition mode is set to on, string would be decomposed into - * NFD format where necessary before sorting.

- *

- * @param decompositionmode the new decomposition mode - * @see #CANONICAL_DECOMPOSITION - * @see #NO_DECOMPOSITION - * @stable ICU 2.4 - */ - public void setDecomposition(int decompositionmode) { - NativeCollation.setAttribute(m_collator_, - CollationAttribute.NORMALIZATION_MODE, decompositionmode); - } - - /** - * Determines the minimum strength that will be use in comparison or - * transformation. - *

- * E.g. with strength == CollationAttribute.VALUE_SECONDARY, the tertiary difference - * is ignored - *

- *

- * E.g. with strength == PRIMARY, the secondary and tertiary difference are - * ignored. - *

- * @return the current comparison level. - * @see #PRIMARY - * @see #SECONDARY - * @see #TERTIARY - * @see #QUATERNARY - * @see #IDENTICAL - * @stable ICU 2.4 - */ - public int getStrength() { - return NativeCollation.getAttribute(m_collator_, CollationAttribute.STRENGTH); - } - - /** - * Sets the minimum strength to be used in comparison or transformation. - *

Example of use: - *
- * - * Collator myCollation = Collator.createInstance(Locale::US); - * myCollation.setStrength(PRIMARY); - * // result will be "abc" == "ABC" - * // tertiary differences will be ignored - * int result = myCollation->compare("abc", "ABC"); - * - * @param strength the new comparison level. - * @exception IllegalArgumentException when argument does not belong to any collation strength - * mode or error occurs while setting data. - * @see #PRIMARY - * @see #SECONDARY - * @see #TERTIARY - * @see #QUATERNARY - * @see #IDENTICAL - * @stable ICU 2.4 - */ - public void setStrength(int strength) { - NativeCollation.setAttribute(m_collator_, CollationAttribute.STRENGTH, strength); - } - - /** - * Sets the attribute to be used in comparison or transformation. - *

Example of use: - *
- * - * Collator myCollation = Collator.createInstance(Locale::US); - * myCollation.setAttribute(CollationAttribute.CASE_LEVEL, - * CollationAttribute.VALUE_ON); - * int result = myCollation->compare("\\u30C3\\u30CF", - * "\\u30C4\\u30CF"); - * // result will be -1 - * - * @param type the attribute to be set from CollationAttribute - * @param value attribute value from CollationAttribute - * @stable ICU 2.4 - */ - public void setAttribute(int type, int value) { - NativeCollation.setAttribute(m_collator_, type, value); - } - - /** - * Gets the attribute to be used in comparison or transformation. - * @param type the attribute to be set from CollationAttribute - * @return value attribute value from CollationAttribute - * @stable ICU 2.4 - */ - public int getAttribute(int type) { - return NativeCollation.getAttribute(m_collator_, type); - } - - public CollationKey getCollationKey(String source) { - if (source == null) { - return null; - } - byte[] key = NativeCollation.getSortKey(m_collator_, source); - if (key == null) { - return null; - } - return new CollationKey(source, key); - } - - /** - * Get the collation rules of this Collation object - * The rules will follow the rule syntax. - * @return collation rules. - * @stable ICU 2.4 - */ - public String getRules() { - return NativeCollation.getRules(m_collator_); - } - - /** - * Create a CollationElementIterator object that will iterator over the - * elements in a string, using the collation rules defined in this - * RuleBasedCollator - * @param source string to iterate over - * @return address of C collationelement - * @exception IllegalArgumentException thrown when error occurs - * @stable ICU 2.4 - */ - public CollationElementIterator getCollationElementIterator(String source) { - CollationElementIterator result = new CollationElementIterator( - NativeCollation.getCollationElementIterator(m_collator_, source)); - // result.setOwnCollationElementIterator(true); - return result; - } - - public CollationElementIterator getCollationElementIterator(CharacterIterator it) { - // We only implement the String-based API, so build a string from the iterator. - return getCollationElementIterator(characterIteratorToString(it)); - } - - private String characterIteratorToString(CharacterIterator it) { - StringBuilder result = new StringBuilder(); - for (char ch = it.current(); ch != CharacterIterator.DONE; ch = it.next()) { - result.append(ch); - } - return result.toString(); - } - - @Override - public int hashCode() { - return 42; // No-one uses RuleBasedCollator as a hash key. - } - - /** - * Checks if argument object is equals to this object. - * @param target object - * @return true if source is equivalent to target, false otherwise - * @stable ICU 2.4 - */ - public boolean equals(Object object) { - if (object == this) { - return true; - } - if (!(object instanceof RuleBasedCollator)) { - return false; - } - RuleBasedCollator rhs = (RuleBasedCollator) object; - return getRules().equals(rhs.getRules()) && - getStrength() == rhs.getStrength() && - getDecomposition() == rhs.getDecomposition(); - } - - RuleBasedCollator(Locale locale) { - m_collator_ = NativeCollation.openCollator(locale.toString()); - } - - @Override - protected void finalize() { - NativeCollation.closeCollator(m_collator_); - } - - private RuleBasedCollator(int addr) { - m_collator_ = addr; - } -} diff --git a/icu/src/main/java/com/ibm/icu4jni/util/ICU.java b/icu/src/main/java/com/ibm/icu4jni/util/ICU.java deleted file mode 100644 index b684068..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/util/ICU.java +++ /dev/null @@ -1,311 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.ibm.icu4jni.util; - -import java.util.Locale; -import java.util.TimeZone; -import java.util.logging.Logger; - -/** - * Makes ICU data accessible to Java. - */ -public final class ICU { - /** - * Cache for ISO language names. - */ - private static String[] isoLanguages; - - /** - * Cache for ISO country names. - */ - private static String[] isoCountries; - - /** - * Available timezones cache. - */ - private static String[] availableTimezones; - - /** - * Returns an array of ISO language names (two-letter codes), fetched either - * from ICU's database or from our memory cache. - * - * @return The array. - */ - public static String[] getISOLanguages() { - if (isoLanguages == null) { - isoLanguages = getISOLanguagesNative(); - } - return isoLanguages.clone(); - } - - /** - * Returns an array of ISO country names (two-letter codes), fetched either - * from ICU's database or from our memory cache. - * - * @return The array. - */ - public static String[] getISOCountries() { - if (isoCountries == null) { - isoCountries = getISOCountriesNative(); - } - return isoCountries.clone(); - } - - /** - * Returns an array of names of timezones that are available in the system, - * fetched either from the TimeZone class or from our memory cache. - * - * @return The array. - */ - public static String[] getKnownTimezones() { - if (availableTimezones == null) { - availableTimezones = TimeZone.getAvailableIDs(); - } - return availableTimezones.clone(); - } - - /** - * Returns the display name for the given time zone using the given locale. - * - * @param id The time zone ID, for example "Europe/Berlin" - * @param daylight Indicates whether daylight savings is in use - * @param style The style, 0 for long, 1 for short - * @param locale The locale name, for example "en_US". - * @return The desired display name - */ - public static String getDisplayTimeZone(String id, boolean daylight, int style, String locale) { - // If we already have the strings, linear search through them is 10x quicker than - // calling ICU for just the one we want. - if (DefaultTimeZones.locale.equals(locale)) { - String result = lookupDisplayTimeZone(DefaultTimeZones.names, id, daylight, style); - if (result != null) { - return result; - } - } - return getDisplayTimeZoneNative(id, daylight, style, locale); - } - - public static String lookupDisplayTimeZone(String[][] zoneStrings, String id, boolean daylight, int style) { - for (String[] row : zoneStrings) { - if (row[0].equals(id)) { - if (daylight) { - return (style == TimeZone.LONG) ? row[3] : row[4]; - } else { - return (style == TimeZone.LONG) ? row[1] : row[2]; - } - } - } - return null; - } - - /** - * Initialization holder for default time zone names. This class will - * be preloaded by the zygote to share the time and space costs of setting - * up the list of time zone names, so although it looks like the lazy - * initialization idiom, it's actually the opposite. - */ - private static class DefaultTimeZones { - /** - * Name of default locale at the time this class was initialized. - */ - private static final String locale = Locale.getDefault().toString(); - - /** - * Names of time zones for the default locale. - */ - private static final String[][] names = createTimeZoneNamesFor(locale); - } - - /** - * Creates array of time zone names for the given locale. This method takes - * about 2s to run on a 400MHz ARM11. - */ - private static String[][] createTimeZoneNamesFor(String locale) { - long start = System.currentTimeMillis(); - - /* - * The following code is optimized for fast native response (the time a - * method call can be in native code is limited). It prepares an empty - * array to keep native code from having to create new Java objects. It - * also fill in the time zone IDs to speed things up a bit. There's one - * array for each time zone name type. (standard/long, standard/short, - * daylight/long, daylight/short) The native method that fetches these - * strings is faster if it can do all entries of one type, before having - * to change to the next type. That's why the array passed down to - * native has 5 entries, each providing space for all time zone names of - * one type. Likely this access to the fields is much faster in the - * native code because there's less array access overhead. - */ - String[][] arrayToFill = new String[5][]; - arrayToFill[0] = getKnownTimezones(); - arrayToFill[1] = new String[availableTimezones.length]; - arrayToFill[2] = new String[availableTimezones.length]; - arrayToFill[3] = new String[availableTimezones.length]; - arrayToFill[4] = new String[availableTimezones.length]; - - /* - * Fill in the zone names in native. - */ - getTimeZonesNative(arrayToFill, locale); - - /* - * Finally we need to reorder the entries so we get the expected result. - */ - String[][] result = new String[availableTimezones.length][5]; - for (int i = 0; i < availableTimezones.length; i++) { - result[i][0] = arrayToFill[0][i]; - result[i][1] = arrayToFill[1][i]; - result[i][2] = arrayToFill[2][i]; - result[i][3] = arrayToFill[3][i]; - result[i][4] = arrayToFill[4][i]; - } - - Logger.global.info("Loaded time zone names for " + locale + " in " - + (System.currentTimeMillis() - start) + "ms."); - - return result; - } - - /** - * Returns the display names for all given timezones using the given locale. - * - * @return An array of time zone strings. Each row represents one time zone. - * The first columns holds the ID of the time zone, for example - * "Europe/Berlin". The other columns then hold for each row the - * four time zone names with and without daylight savings and in - * long and short format. It's exactly the array layout required by - * the TimeZone class. - */ - public static String[][] getDisplayTimeZones(String locale) { - String defaultLocale = Locale.getDefault().toString(); - if (locale == null) { - locale = defaultLocale; - } - - // If locale == default and the default locale hasn't changed since - // DefaultTimeZones loaded, return the cached names. - // TODO: We should force a reboot if the default locale changes. - if (defaultLocale.equals(locale) && DefaultTimeZones.locale.equals(defaultLocale)) { - return clone2dStringArray(DefaultTimeZones.names); - } - - return createTimeZoneNamesFor(locale); - } - - public static String[][] clone2dStringArray(String[][] array) { - String[][] result = new String[array.length][]; - for (int i = 0; i < array.length; ++i) { - result[i] = array[i].clone(); - } - return result; - } - - /** - * Returns the appropriate {@code Locale} given a {@code String} of the form returned - * by {@code toString}. This is very lenient, and doesn't care what's between the underscores: - * this method can parse strings that {@code Locale.toString} won't produce. - * Used to remove duplication. - */ - public static Locale localeFromString(String localeName) { - int first = localeName.indexOf('_'); - int second = localeName.indexOf('_', first + 1); - if (first == -1) { - // Language only ("ja"). - return new Locale(localeName); - } else if (second == -1) { - // Language and country ("ja_JP"). - return new Locale(localeName.substring(0, first), localeName.substring(first + 1)); - } else { - // Language and country and variant ("ja_JP_TRADITIONAL"). - return new Locale(localeName.substring(0, first), localeName.substring(first + 1, second), localeName.substring(second + 1)); - } - } - - public static Locale[] localesFromStrings(String[] localeNames) { - Locale[] result = new Locale[localeNames.length]; - for (int i = 0; i < result.length; ++i) { - result[i] = localeFromString(localeNames[i]); - } - return result; - } - - private static Locale[] availableLocalesCache; - public static Locale[] getAvailableLocales() { - if (availableLocalesCache == null) { - availableLocalesCache = localesFromStrings(getAvailableLocalesNative()); - } - return availableLocalesCache.clone(); - } - - public static Locale[] getAvailableBreakIteratorLocales() { - return localesFromStrings(getAvailableBreakIteratorLocalesNative()); - } - - public static Locale[] getAvailableCalendarLocales() { - return localesFromStrings(getAvailableCalendarLocalesNative()); - } - - public static Locale[] getAvailableCollatorLocales() { - return localesFromStrings(getAvailableCollatorLocalesNative()); - } - - public static Locale[] getAvailableDateFormatLocales() { - return localesFromStrings(getAvailableDateFormatLocalesNative()); - } - - public static Locale[] getAvailableDateFormatSymbolsLocales() { - return getAvailableDateFormatLocales(); - } - - public static Locale[] getAvailableDecimalFormatSymbolsLocales() { - return getAvailableNumberFormatLocales(); - } - - public static Locale[] getAvailableNumberFormatLocales() { - return localesFromStrings(getAvailableNumberFormatLocalesNative()); - } - - // --- Native methods accessing ICU's database ---------------------------- - - private static native String[] getAvailableBreakIteratorLocalesNative(); - private static native String[] getAvailableCalendarLocalesNative(); - private static native String[] getAvailableCollatorLocalesNative(); - private static native String[] getAvailableDateFormatLocalesNative(); - private static native String[] getAvailableLocalesNative(); - private static native String[] getAvailableNumberFormatLocalesNative(); - - public static native String getCurrencyCodeNative(String locale); - public static native int getCurrencyFractionDigitsNative(String currencyCode); - public static native String getCurrencySymbolNative(String locale, String currencyCode); - - public static native String getDisplayCountryNative(String countryCode, String locale); - public static native String getDisplayLanguageNative(String languageCode, String locale); - public static native String getDisplayVariantNative(String variantCode, String locale); - - public static native String getISO3CountryNative(String locale); - public static native String getISO3LanguageNative(String locale); - - private static native String[] getISOLanguagesNative(); - private static native String[] getISOCountriesNative(); - - private static native void getTimeZonesNative(String[][] arrayToFill, String locale); - - private static native String getDisplayTimeZoneNative(String id, boolean isDST, int style, - String locale); - - static native boolean initLocaleDataImpl(String locale, LocaleData result); -} diff --git a/icu/src/main/java/com/ibm/icu4jni/util/LocaleData.java b/icu/src/main/java/com/ibm/icu4jni/util/LocaleData.java deleted file mode 100644 index e27bd54..0000000 --- a/icu/src/main/java/com/ibm/icu4jni/util/LocaleData.java +++ /dev/null @@ -1,321 +0,0 @@ -/* - * Copyright (C) 2009 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.ibm.icu4jni.util; - -import java.text.DateFormat; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Locale; - -/** - * Passes locale-specific from ICU native code to Java. - *

- * Note that you share these; you must not alter any of the fields, nor their array elements - * in the case of arrays. If you ever expose any of these things to user code, you must give - * them a clone rather than the original. - */ -public final class LocaleData { - // A cache for the locale-specific data. - private static final HashMap localeDataCache = new HashMap(); - - public Integer firstDayOfWeek; - public Integer minimalDaysInFirstWeek; - - public String[] amPm; - - public String[] eras; - - public String[] longMonthNames; - public String[] shortMonthNames; - - public String[] longWeekdayNames; - public String[] shortWeekdayNames; - - public String fullTimeFormat; - public String longTimeFormat; - public String mediumTimeFormat; - public String shortTimeFormat; - - public String fullDateFormat; - public String longDateFormat; - public String mediumDateFormat; - public String shortDateFormat; - - // DecimalFormatSymbols. - public char zeroDigit; - public char digit; - public char decimalSeparator; - public char groupingSeparator; - public char patternSeparator; - public char percent; - public char perMill; - public char monetarySeparator; - public char minusSign; - public String exponentSeparator; - public String infinity; - public String NaN; - - public String currencySymbol; - public String internationalCurrencySymbol; - - public String numberPattern; - public String integerPattern; - public String currencyPattern; - public String percentPattern; - - private LocaleData() { - } - - /** - * Returns a shared LocaleData for the given locale. - */ - public static LocaleData get(Locale locale) { - if (locale == null) { - locale = Locale.getDefault(); - } - String localeName = locale.toString(); - synchronized (localeDataCache) { - LocaleData localeData = localeDataCache.get(localeName); - if (localeData != null) { - return localeData; - } - } - LocaleData newLocaleData = makeLocaleData(locale); - synchronized (localeDataCache) { - LocaleData localeData = localeDataCache.get(localeName); - if (localeData != null) { - return localeData; - } - localeDataCache.put(localeName, newLocaleData); - return newLocaleData; - } - } - - private static LocaleData makeLocaleData(Locale locale) { - String language = locale.getLanguage(); - String country = locale.getCountry(); - String variant = locale.getVariant(); - // Start with data from the parent (next-most-specific) locale... - LocaleData result = new LocaleData(); - if (!variant.isEmpty()) { - result.overrideWithDataFrom(get(new Locale(language, country, ""))); - } else if (!country.isEmpty()) { - result.overrideWithDataFrom(get(new Locale(language, "", ""))); - } else if (!language.isEmpty()) { - result.overrideWithDataFrom(get(Locale.ROOT)); - } - // Override with data from this locale. - result.overrideWithDataFrom(initLocaleData(locale)); - return result; - } - - @Override public String toString() { - return "LocaleData[" + - "firstDayOfWeek=" + firstDayOfWeek + "," + - "minimalDaysInFirstWeek=" + minimalDaysInFirstWeek + "," + - "amPm=" + Arrays.toString(amPm) + "," + - "eras=" + Arrays.toString(eras) + "," + - "longMonthNames=" + Arrays.toString(longMonthNames) + "," + - "shortMonthNames=" + Arrays.toString(shortMonthNames) + "," + - "longWeekdayNames=" + Arrays.toString(longWeekdayNames) + "," + - "shortWeekdayNames=" + Arrays.toString(shortWeekdayNames) + "," + - "fullTimeFormat=" + fullTimeFormat + "," + - "longTimeFormat=" + longTimeFormat + "," + - "mediumTimeFormat=" + mediumTimeFormat + "," + - "shortTimeFormat=" + shortTimeFormat + "," + - "fullDateFormat=" + fullDateFormat + "," + - "longDateFormat=" + longDateFormat + "," + - "mediumDateFormat=" + mediumDateFormat + "," + - "shortDateFormat=" + shortDateFormat + "," + - "zeroDigit=" + zeroDigit + "," + - "digit=" + digit + "," + - "decimalSeparator=" + decimalSeparator + "," + - "groupingSeparator=" + groupingSeparator + "," + - "patternSeparator=" + patternSeparator + "," + - "percent=" + percent + "," + - "perMill=" + perMill + "," + - "monetarySeparator=" + monetarySeparator + "," + - "minusSign=" + minusSign + "," + - "exponentSeparator=" + exponentSeparator + "," + - "infinity=" + infinity + "," + - "NaN=" + NaN + "," + - "currencySymbol=" + currencySymbol + "," + - "internationalCurrencySymbol=" + internationalCurrencySymbol + "," + - "numberPattern=" + numberPattern + "," + - "integerPattern=" + integerPattern + "," + - "currencyPattern=" + currencyPattern + "," + - "percentPattern=" + percentPattern + "]"; - } - - private void overrideWithDataFrom(LocaleData overrides) { - if (overrides.firstDayOfWeek != null) { - firstDayOfWeek = overrides.firstDayOfWeek; - } - if (overrides.minimalDaysInFirstWeek != null) { - minimalDaysInFirstWeek = overrides.minimalDaysInFirstWeek; - } - if (overrides.amPm != null) { - amPm = overrides.amPm; - } - if (overrides.eras != null) { - eras = overrides.eras; - } - if (overrides.longMonthNames != null) { - longMonthNames = overrides.longMonthNames; - } - if (overrides.shortMonthNames != null) { - shortMonthNames = overrides.shortMonthNames; - } - if (overrides.longWeekdayNames != null) { - longWeekdayNames = overrides.longWeekdayNames; - } - if (overrides.shortWeekdayNames != null) { - shortWeekdayNames = overrides.shortWeekdayNames; - } - if (overrides.fullTimeFormat != null) { - fullTimeFormat = overrides.fullTimeFormat; - } - if (overrides.longTimeFormat != null) { - longTimeFormat = overrides.longTimeFormat; - } - if (overrides.mediumTimeFormat != null) { - mediumTimeFormat = overrides.mediumTimeFormat; - } - if (overrides.shortTimeFormat != null) { - shortTimeFormat = overrides.shortTimeFormat; - } - if (overrides.fullDateFormat != null) { - fullDateFormat = overrides.fullDateFormat; - } - if (overrides.longDateFormat != null) { - longDateFormat = overrides.longDateFormat; - } - if (overrides.mediumDateFormat != null) { - mediumDateFormat = overrides.mediumDateFormat; - } - if (overrides.shortDateFormat != null) { - shortDateFormat = overrides.shortDateFormat; - } - if (overrides.zeroDigit != '\0') { - zeroDigit = overrides.zeroDigit; - } - if (overrides.digit != '\0') { - digit = overrides.digit; - } - if (overrides.decimalSeparator != '\0') { - decimalSeparator = overrides.decimalSeparator; - } - if (overrides.groupingSeparator != '\0') { - groupingSeparator = overrides.groupingSeparator; - } - if (overrides.patternSeparator != '\0') { - patternSeparator = overrides.patternSeparator; - } - if (overrides.percent != '\0') { - percent = overrides.percent; - } - if (overrides.perMill != '\0') { - perMill = overrides.perMill; - } - if (overrides.monetarySeparator != '\0') { - monetarySeparator = overrides.monetarySeparator; - } - if (overrides.minusSign != '\0') { - minusSign = overrides.minusSign; - } - if (overrides.exponentSeparator != null) { - exponentSeparator = overrides.exponentSeparator; - } - if (overrides.NaN != null) { - NaN = overrides.NaN; - } - if (overrides.infinity != null) { - infinity = overrides.infinity; - } - if (overrides.currencySymbol != null) { - currencySymbol = overrides.currencySymbol; - } - if (overrides.internationalCurrencySymbol != null) { - internationalCurrencySymbol = overrides.internationalCurrencySymbol; - } - if (overrides.numberPattern != null) { - numberPattern = overrides.numberPattern; - } - if (overrides.integerPattern != null) { - integerPattern = overrides.integerPattern; - } - if (overrides.currencyPattern != null) { - currencyPattern = overrides.currencyPattern; - } - if (overrides.percentPattern != null) { - percentPattern = overrides.percentPattern; - } - } - - public String getDateFormat(int style) { - switch (style) { - case DateFormat.SHORT: - return shortDateFormat; - case DateFormat.MEDIUM: - return mediumDateFormat; - case DateFormat.LONG: - return longDateFormat; - case DateFormat.FULL: - return fullDateFormat; - } - throw new AssertionError(); - } - - public String getTimeFormat(int style) { - switch (style) { - case DateFormat.SHORT: - return shortTimeFormat; - case DateFormat.MEDIUM: - return mediumTimeFormat; - case DateFormat.LONG: - return longTimeFormat; - case DateFormat.FULL: - return fullTimeFormat; - } - throw new AssertionError(); - } - - private static LocaleData initLocaleData(Locale locale) { - LocaleData localeData = new LocaleData(); - if (!ICU.initLocaleDataImpl(locale.toString(), localeData)) { - throw new AssertionError("couldn't initialize LocaleData for locale " + locale); - } - if (localeData.fullTimeFormat != null) { - // There are some full time format patterns in ICU that use the pattern character 'v'. - // Java doesn't accept this, so we replace it with 'z' which has about the same result - // as 'v', the timezone name. - // 'v' -> "PT", 'z' -> "PST", v is the generic timezone and z the standard tz - // "vvvv" -> "Pacific Time", "zzzz" -> "Pacific Standard Time" - localeData.fullTimeFormat = localeData.fullTimeFormat.replace('v', 'z'); - } - if (localeData.numberPattern != null) { - // The number pattern might contain positive and negative subpatterns. Arabic, for - // example, might look like "#,##0.###;#,##0.###-" because the minus sign should be - // written last. Macedonian supposedly looks something like "#,##0.###;(#,##0.###)". - // (The negative subpattern is optional, though, and not present in most locales.) - // By only swallowing '#'es and ','s after the '.', we ensure that we don't - // accidentally eat too much. - localeData.integerPattern = localeData.numberPattern.replaceAll("\\.[#,]*", ""); - } - return localeData; - } -} diff --git a/icu/src/main/native/BidiWrapper.cpp b/icu/src/main/native/BidiWrapper.cpp deleted file mode 100644 index 03efa92..0000000 --- a/icu/src/main/native/BidiWrapper.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#define LOG_TAG "BidiWrapper" - -#include -#include "ErrorCode.h" -#include "UniquePtr.h" -#include "unicode/ubidi.h" -#include -#include - -struct BiDiData { - BiDiData(UBiDi* biDi) : mBiDi(biDi), mEmbeddingLevels(NULL) { - } - - ~BiDiData() { - ubidi_close(mBiDi); - } - - UBiDiLevel* embeddingLevels() { - return reinterpret_cast(&mEmbeddingLevels[0]); - } - - void setEmbeddingLevels(jbyte* newEmbeddingLevels) { - mEmbeddingLevels.reset(newEmbeddingLevels); - } - - UBiDi* uBiDi() { - return mBiDi; - } - -private: - UBiDi* mBiDi; - UniquePtr mEmbeddingLevels; - - // Disallow copy and assignment. - BiDiData(const BiDiData&); - void operator=(const BiDiData&); -}; - -static BiDiData* biDiData(jlong ptr) { - return reinterpret_cast(static_cast(ptr)); -} - -static UBiDi* uBiDi(jlong ptr) { - return reinterpret_cast(static_cast(ptr))->uBiDi(); -} - -static jlong BidiWrapper_ubidi_open(JNIEnv* env, jclass) { - return reinterpret_cast(new BiDiData(ubidi_open())); -} - -static void BidiWrapper_ubidi_close(JNIEnv* env, jclass, jlong ptr) { - delete biDiData(ptr); -} - -static void BidiWrapper_ubidi_setPara(JNIEnv* env, jclass, jlong ptr, jcharArray text, jint length, jbyte paraLevel, jbyteArray newEmbeddingLevels) { - BiDiData* data = biDiData(ptr); - // Copy the new embedding levels from the Java heap to the native heap. - if (newEmbeddingLevels != NULL) { - jbyte* dst; - data->setEmbeddingLevels(dst = new jbyte[length]); - env->GetByteArrayRegion(newEmbeddingLevels, 0, length, dst); - } else { - data->setEmbeddingLevels(NULL); - } - UErrorCode err = U_ZERO_ERROR; - jchar* chars = env->GetCharArrayElements(text, NULL); - ubidi_setPara(data->uBiDi(), chars, length, paraLevel, data->embeddingLevels(), &err); - env->ReleaseCharArrayElements(text, chars, 0); - icu4jni_error(env, err); -} - -static jlong BidiWrapper_ubidi_setLine(JNIEnv* env, jclass, jlong ptr, jint start, jint limit) { - UErrorCode err = U_ZERO_ERROR; - UBiDi* sized = ubidi_openSized(limit - start, 0, &err); - if (icu4jni_error(env, err) != FALSE) { - return 0; - } - UniquePtr lineData(new BiDiData(sized)); - ubidi_setLine(uBiDi(ptr), start, limit, lineData->uBiDi(), &err); - icu4jni_error(env, err); - return reinterpret_cast(lineData.release()); -} - -static jint BidiWrapper_ubidi_getDirection(JNIEnv * env, jclass clazz, jlong ptr) { - return ubidi_getDirection(uBiDi(ptr)); -} - -static jint BidiWrapper_ubidi_getLength(JNIEnv* env, jclass, jlong ptr) { - return ubidi_getLength(uBiDi(ptr)); -} - -static jbyte BidiWrapper_ubidi_getParaLevel(JNIEnv* env, jclass, jlong ptr) { - return ubidi_getParaLevel(uBiDi(ptr)); -} - -static jbyteArray BidiWrapper_ubidi_getLevels(JNIEnv* env, jclass, jlong ptr) { - UErrorCode err = U_ZERO_ERROR; - const UBiDiLevel* levels = ubidi_getLevels(uBiDi(ptr), &err); - if (icu4jni_error(env, err)) { - return NULL; - } - int len = ubidi_getLength(uBiDi(ptr)); - jbyteArray result = env->NewByteArray(len); - env->SetByteArrayRegion(result, 0, len, reinterpret_cast(levels)); - return result; -} - -static jint BidiWrapper_ubidi_countRuns(JNIEnv* env, jclass, jlong ptr) { - UErrorCode err = U_ZERO_ERROR; - int count = ubidi_countRuns(uBiDi(ptr), &err); - icu4jni_error(env, err); - return count; -} - -static jobjectArray BidiWrapper_ubidi_getRuns(JNIEnv* env, jclass, jlong ptr) { - UBiDi* ubidi = uBiDi(ptr); - UErrorCode err = U_ZERO_ERROR; - int runCount = ubidi_countRuns(ubidi, &err); - if (icu4jni_error(env, err)) { - return NULL; - } - jclass bidiRunClass = env->FindClass("org/apache/harmony/text/BidiRun"); - jmethodID bidiRunConstructor = env->GetMethodID(bidiRunClass, "", "(III)V"); - jobjectArray runs = env->NewObjectArray(runCount, bidiRunClass, NULL); - UBiDiLevel level = 0; - int start = 0; - int limit = 0; - for (int i = 0; i < runCount; ++i) { - ubidi_getLogicalRun(ubidi, start, &limit, &level); - jobject run = env->NewObject(bidiRunClass, bidiRunConstructor, start, limit, level); - env->SetObjectArrayElement(runs, i, run); - start = limit; - } - return runs; -} - -static jintArray BidiWrapper_ubidi_reorderVisual(JNIEnv* env, jclass, jbyteArray levels, jint length) { - UniquePtr local_indexMap(new int[length]); - jbyte* local_levelBytes = env->GetByteArrayElements(levels, NULL); - UBiDiLevel* local_levels = reinterpret_cast(local_levelBytes); - ubidi_reorderVisual(local_levels, length, &local_indexMap[0]); - jintArray result = env->NewIntArray(length); - env->SetIntArrayRegion(result, 0, length, &local_indexMap[0]); - env->ReleaseByteArrayElements(levels, local_levelBytes, 0); - return result; -} - -static JNINativeMethod gMethods[] = { - { "ubidi_close", "(J)V", (void*) BidiWrapper_ubidi_close }, - { "ubidi_countRuns", "(J)I", (void*) BidiWrapper_ubidi_countRuns }, - { "ubidi_getDirection", "(J)I", (void*) BidiWrapper_ubidi_getDirection }, - { "ubidi_getLength", "(J)I", (void*) BidiWrapper_ubidi_getLength }, - { "ubidi_getLevels", "(J)[B", (void*) BidiWrapper_ubidi_getLevels }, - { "ubidi_getParaLevel", "(J)B", (void*) BidiWrapper_ubidi_getParaLevel }, - { "ubidi_getRuns", "(J)[Lorg/apache/harmony/text/BidiRun;", (void*) BidiWrapper_ubidi_getRuns }, - { "ubidi_open", "()J", (void*) BidiWrapper_ubidi_open }, - { "ubidi_reorderVisual", "([BI)[I", (void*) BidiWrapper_ubidi_reorderVisual }, - { "ubidi_setLine", "(JII)J", (void*) BidiWrapper_ubidi_setLine }, - { "ubidi_setPara", "(J[CIB[B)V", (void*) BidiWrapper_ubidi_setPara }, -}; -int register_org_apache_harmony_text_BidiWrapper(JNIEnv* env) { - return jniRegisterNativeMethods(env, "org/apache/harmony/text/BidiWrapper", - gMethods, NELEM(gMethods)); -} diff --git a/icu/src/main/native/ErrorCode.cpp b/icu/src/main/native/ErrorCode.cpp deleted file mode 100644 index a9d0691..0000000 --- a/icu/src/main/native/ErrorCode.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2005, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -******************************************************************************* -*/ - -#include "ErrorCode.h" -#include "JNIHelp.h" - -/** -* Checks if an error has occurred, throwing a suitable exception if so. -* @param env JNI environment -* @param errorCode code to determine if it is an error -* @return 0 if errorCode is not an error, 1 if errorCode is an error, but the -* creation of the exception to be thrown fails - * @exception thrown if errorCode represents an error -*/ -UBool icu4jni_error(JNIEnv *env, UErrorCode errorCode) -{ - const char* message = u_errorName(errorCode); - if (errorCode <= U_ZERO_ERROR || errorCode >= U_ERROR_LIMIT) { - return 0; - } - - switch (errorCode) { - case U_ILLEGAL_ARGUMENT_ERROR: - return jniThrowException(env, "java/lang/IllegalArgumentException", message); - case U_INDEX_OUTOFBOUNDS_ERROR: - case U_BUFFER_OVERFLOW_ERROR: - return jniThrowException(env, "java/lang/ArrayIndexOutOfBoundsException", message); - case U_UNSUPPORTED_ERROR: - return jniThrowException(env, "java/lang/UnsupportedOperationException", message); - default: - return jniThrowRuntimeException(env, message); - } -} diff --git a/icu/src/main/native/ErrorCode.h b/icu/src/main/native/ErrorCode.h deleted file mode 100644 index e42a519..0000000 --- a/icu/src/main/native/ErrorCode.h +++ /dev/null @@ -1,35 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2005, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -******************************************************************************* -*/ - -#ifndef ERRORCODE_H -#define ERRORCODE_H - -#include -#include "unicode/utypes.h" -#include "unicode/putil.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** -* Checks if an error has occured. -* Throws a generic Java RuntimeException if an error has occured. -* @param env JNI environment variable -* @param errorcode code to determine if it is an erro -* @return 0 if errorcode is not an error, 1 if errorcode is an error, but the -* creation of the exception to be thrown fails -* @exception thrown if errorcode represents an error -*/ -UBool icu4jni_error(JNIEnv *env, UErrorCode errorcode); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/icu/src/main/native/ICU.cpp b/icu/src/main/native/ICU.cpp deleted file mode 100644 index 4f08513..0000000 --- a/icu/src/main/native/ICU.cpp +++ /dev/null @@ -1,710 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#define LOG_TAG "ICU" - -#include "JNIHelp.h" -#include "ScopedUtfChars.h" -#include "UniquePtr.h" -#include "cutils/log.h" -#include "unicode/numfmt.h" -#include "unicode/locid.h" -#include "unicode/ubrk.h" -#include "unicode/ucal.h" -#include "unicode/ucol.h" -#include "unicode/udat.h" -#include "unicode/gregocal.h" -#include "unicode/ucurr.h" -#include "unicode/calendar.h" -#include "unicode/datefmt.h" -#include "unicode/dtfmtsym.h" -#include "unicode/decimfmt.h" -#include "unicode/dcfmtsym.h" -#include "unicode/uclean.h" -#include "unicode/smpdtfmt.h" -#include "unicode/strenum.h" -#include "unicode/ustring.h" -#include "unicode/timezone.h" -#include "ErrorCode.h" -#include -#include -#include -#include - -static jclass string_class; - -class ScopedResourceBundle { -public: - ScopedResourceBundle(UResourceBundle* bundle) : mBundle(bundle) { - } - - ~ScopedResourceBundle() { - if (mBundle != NULL) { - ures_close(mBundle); - } - } - - UResourceBundle* get() { - return mBundle; - } - -private: - UResourceBundle* mBundle; - - // Disallow copy and assignment. - ScopedResourceBundle(const ScopedResourceBundle&); - void operator=(const ScopedResourceBundle&); -}; - -static Locale getLocale(JNIEnv* env, jstring localeName) { - return Locale::createFromName(ScopedUtfChars(env, localeName).c_str()); -} - -static jint getCurrencyFractionDigitsNative(JNIEnv* env, jclass, jstring currencyCode) { - UErrorCode status = U_ZERO_ERROR; - UniquePtr fmt(NumberFormat::createCurrencyInstance(status)); - if (U_FAILURE(status)) { - return -1; - } - const jchar* cCode = env->GetStringChars(currencyCode, NULL); - fmt->setCurrency(cCode, status); - env->ReleaseStringChars(currencyCode, cCode); - if (U_FAILURE(status)) { - return -1; - } - // for CurrencyFormats the minimum and maximum fraction digits are the same. - return fmt->getMinimumFractionDigits(); -} - -static jstring getCurrencyCodeNative(JNIEnv* env, jclass, jstring key) { - UErrorCode status = U_ZERO_ERROR; - ScopedResourceBundle supplData(ures_openDirect(NULL, "supplementalData", &status)); - if (U_FAILURE(status)) { - return NULL; - } - - ScopedResourceBundle currencyMap(ures_getByKey(supplData.get(), "CurrencyMap", NULL, &status)); - if (U_FAILURE(status)) { - return NULL; - } - - const char* keyChars = env->GetStringUTFChars(key, NULL); - ScopedResourceBundle currency(ures_getByKey(currencyMap.get(), keyChars, NULL, &status)); - env->ReleaseStringUTFChars(key, keyChars); - if (U_FAILURE(status)) { - return NULL; - } - - ScopedResourceBundle currencyElem(ures_getByIndex(currency.get(), 0, NULL, &status)); - if (U_FAILURE(status)) { - return env->NewStringUTF("None"); - } - - // check if there is a 'to' date. If there is, the currency isn't used anymore. - ScopedResourceBundle currencyTo(ures_getByKey(currencyElem.get(), "to", NULL, &status)); - if (!U_FAILURE(status)) { - // return and let the caller throw an exception - return NULL; - } - // We need to reset 'status'. It works like errno in that ICU doesn't set it - // to U_ZERO_ERROR on success: it only touches it on error, and the test - // above means it now holds a failure code. - status = U_ZERO_ERROR; - - ScopedResourceBundle currencyId(ures_getByKey(currencyElem.get(), "id", NULL, &status)); - if (U_FAILURE(status)) { - // No id defined for this country - return env->NewStringUTF("None"); - } - - int length; - const jchar* id = ures_getString(currencyId.get(), &length, &status); - if (U_FAILURE(status) || length == 0) { - return env->NewStringUTF("None"); - } - return env->NewString(id, length); -} - -static jstring getCurrencySymbolNative(JNIEnv* env, jclass, jstring locale, jstring currencyCode) { - // LOGI("ENTER getCurrencySymbolNative"); - - const char* locName = env->GetStringUTFChars(locale, NULL); - UErrorCode status = U_ZERO_ERROR; - ScopedResourceBundle root(ures_open(NULL, locName, &status)); - env->ReleaseStringUTFChars(locale, locName); - if (U_FAILURE(status)) { - return NULL; - } - - ScopedResourceBundle currencies(ures_getByKey(root.get(), "Currencies", NULL, &status)); - if (U_FAILURE(status)) { - return NULL; - } - - const char* currName = env->GetStringUTFChars(currencyCode, NULL); - ScopedResourceBundle currencyElems(ures_getByKey(currencies.get(), currName, NULL, &status)); - env->ReleaseStringUTFChars(currencyCode, currName); - if (U_FAILURE(status)) { - return NULL; - } - - int currSymbL; - const jchar* currSymbU = ures_getStringByIndex(currencyElems.get(), 0, &currSymbL, &status); - if (U_FAILURE(status)) { - return NULL; - } - - return (currSymbL == 0) ? NULL : env->NewString(currSymbU, currSymbL); -} - -static jstring getDisplayCountryNative(JNIEnv* env, jclass, jstring targetLocale, jstring locale) { - - Locale loc = getLocale(env, locale); - Locale targetLoc = getLocale(env, targetLocale); - - UnicodeString str; - targetLoc.getDisplayCountry(loc, str); - return env->NewString(str.getBuffer(), str.length()); -} - -static jstring getDisplayLanguageNative(JNIEnv* env, jclass, jstring targetLocale, jstring locale) { - - Locale loc = getLocale(env, locale); - Locale targetLoc = getLocale(env, targetLocale); - - UnicodeString str; - targetLoc.getDisplayLanguage(loc, str); - return env->NewString(str.getBuffer(), str.length()); -} - -static jstring getDisplayVariantNative(JNIEnv* env, jclass, jstring targetLocale, jstring locale) { - Locale loc = getLocale(env, locale); - Locale targetLoc = getLocale(env, targetLocale); - UnicodeString str; - targetLoc.getDisplayVariant(loc, str); - return env->NewString(str.getBuffer(), str.length()); -} - -static jstring getISO3CountryNative(JNIEnv* env, jclass, jstring locale) { - Locale loc = getLocale(env, locale); - return env->NewStringUTF(loc.getISO3Country()); -} - -static jstring getISO3LanguageNative(JNIEnv* env, jclass, jstring locale) { - Locale loc = getLocale(env, locale); - return env->NewStringUTF(loc.getISO3Language()); -} - -static jobjectArray toStringArray(JNIEnv* env, const char* const* strings) { - size_t count = 0; - while (strings[count] != NULL) { - ++count; - } - jobjectArray result = env->NewObjectArray(count, string_class, NULL); - for (size_t i = 0; i < count; ++i) { - jstring s = env->NewStringUTF(strings[i]); - env->SetObjectArrayElement(result, i, s); - env->DeleteLocalRef(s); - } - return result; -} - -static jobjectArray getISOCountriesNative(JNIEnv* env, jclass) { - return toStringArray(env, Locale::getISOCountries()); -} - -static jobjectArray getISOLanguagesNative(JNIEnv* env, jclass) { - return toStringArray(env, Locale::getISOLanguages()); -} - -template -static jobjectArray getAvailableLocales(JNIEnv* env, Counter* counter, Getter* getter) { - size_t count = (*counter)(); - jobjectArray result = env->NewObjectArray(count, string_class, NULL); - for (size_t i = 0; i < count; ++i) { - jstring s = env->NewStringUTF((*getter)(i)); - env->SetObjectArrayElement(result, i, s); - env->DeleteLocalRef(s); - } - return result; -} - -static jobjectArray getAvailableLocalesNative(JNIEnv* env, jclass) { - return getAvailableLocales(env, uloc_countAvailable, uloc_getAvailable); -} - -static jobjectArray getAvailableBreakIteratorLocalesNative(JNIEnv* env, jclass) { - return getAvailableLocales(env, ubrk_countAvailable, ubrk_getAvailable); -} - -static jobjectArray getAvailableCalendarLocalesNative(JNIEnv* env, jclass) { - return getAvailableLocales(env, ucal_countAvailable, ucal_getAvailable); -} - -static jobjectArray getAvailableCollatorLocalesNative(JNIEnv* env, jclass) { - return getAvailableLocales(env, ucol_countAvailable, ucol_getAvailable); -} - -static jobjectArray getAvailableDateFormatLocalesNative(JNIEnv* env, jclass) { - return getAvailableLocales(env, udat_countAvailable, udat_getAvailable); -} - -static jobjectArray getAvailableNumberFormatLocalesNative(JNIEnv* env, jclass) { - return getAvailableLocales(env, unum_countAvailable, unum_getAvailable); -} - -static TimeZone* timeZoneFromId(JNIEnv* env, jstring id) { - const jchar* chars = env->GetStringChars(id, NULL); - const UnicodeString zoneID(reinterpret_cast(chars), env->GetStringLength(id)); - env->ReleaseStringChars(id, chars); - return TimeZone::createTimeZone(zoneID); -} - -static jstring formatDate(JNIEnv* env, const SimpleDateFormat& fmt, const UDate& when) { - UnicodeString str; - fmt.format(when, str); - return env->NewString(str.getBuffer(), str.length()); -} - -static void getTimeZonesNative(JNIEnv* env, jclass, jobjectArray outerArray, jstring locale) { - // get all timezone objects - jobjectArray zoneIdArray = (jobjectArray) env->GetObjectArrayElement(outerArray, 0); - int count = env->GetArrayLength(zoneIdArray); - TimeZone* zones[count]; - for(int i = 0; i < count; i++) { - jstring id = (jstring) env->GetObjectArrayElement(zoneIdArray, i); - zones[i] = timeZoneFromId(env, id); - env->DeleteLocalRef(id); - } - - Locale loc = getLocale(env, locale); - - UErrorCode status = U_ZERO_ERROR; - UnicodeString longPattern("zzzz",""); - SimpleDateFormat longFormat(longPattern, loc, status); - UnicodeString shortPattern("z",""); - SimpleDateFormat shortFormat(shortPattern, loc, status); - - jobjectArray longStdTimeArray = (jobjectArray) env->GetObjectArrayElement(outerArray, 1); - jobjectArray shortStdTimeArray = (jobjectArray) env->GetObjectArrayElement(outerArray, 2); - jobjectArray longDlTimeArray = (jobjectArray) env->GetObjectArrayElement(outerArray, 3); - jobjectArray shortDlTimeArray = (jobjectArray) env->GetObjectArrayElement(outerArray, 4); - - // 15th January 2008 - UDate date1 = 1203105600000.0; - // 15th July 2008 - UDate date2 = 1218826800000.0; - - for (int i = 0; i < count; ++i) { - TimeZone* tz = zones[i]; - longFormat.setTimeZone(*tz); - shortFormat.setTimeZone(*tz); - - int32_t daylightOffset; - int32_t rawOffset; - tz->getOffset(date1, false, rawOffset, daylightOffset, status); - UDate standardDate; - UDate daylightSavingDate; - if (daylightOffset != 0) { - // The Timezone is reporting that we are in daylight time - // for the winter date. The dates are for the wrong hemisphere, - // swap them. - standardDate = date2; - daylightSavingDate = date1; - } else { - standardDate = date1; - daylightSavingDate = date2; - } - - jstring content = formatDate(env, shortFormat, daylightSavingDate); - env->SetObjectArrayElement(shortDlTimeArray, i, content); - env->DeleteLocalRef(content); - - content = formatDate(env, shortFormat, standardDate); - env->SetObjectArrayElement(shortStdTimeArray, i, content); - env->DeleteLocalRef(content); - - content = formatDate(env, longFormat, daylightSavingDate); - env->SetObjectArrayElement(longDlTimeArray, i, content); - env->DeleteLocalRef(content); - - content = formatDate(env, longFormat, standardDate); - env->SetObjectArrayElement(longStdTimeArray, i, content); - env->DeleteLocalRef(content); - - delete tz; - } -} - -static jstring getDisplayTimeZoneNative(JNIEnv* env, jclass, jstring zoneId, jboolean isDST, jint style, jstring localeId) { - UniquePtr zone(timeZoneFromId(env, zoneId)); - Locale locale = getLocale(env, localeId); - // Try to get the display name of the TimeZone according to the Locale - UnicodeString displayName; - zone->getDisplayName((UBool)isDST, (style == 0 ? TimeZone::SHORT : TimeZone::LONG), locale, displayName); - return env->NewString(displayName.getBuffer(), displayName.length()); -} - -static bool getDayIntVector(JNIEnv* env, UResourceBundle* gregorian, int* values) { - // get the First day of week and the minimal days in first week numbers - UErrorCode status = U_ZERO_ERROR; - ScopedResourceBundle gregorianElems(ures_getByKey(gregorian, "DateTimeElements", NULL, &status)); - if (U_FAILURE(status)) { - return false; - } - - int intVectSize; - const int* result = ures_getIntVector(gregorianElems.get(), &intVectSize, &status); - if (U_FAILURE(status) || intVectSize != 2) { - return false; - } - - values[0] = result[0]; - values[1] = result[1]; - return true; -} - -static jobjectArray getAmPmMarkers(JNIEnv* env, UResourceBundle* gregorian) { - UErrorCode status = U_ZERO_ERROR; - ScopedResourceBundle gregorianElems(ures_getByKey(gregorian, "AmPmMarkers", NULL, &status)); - if (U_FAILURE(status)) { - return NULL; - } - - ures_resetIterator(gregorianElems.get()); - - int lengthAm, lengthPm; - const jchar* am = ures_getStringByIndex(gregorianElems.get(), 0, &lengthAm, &status); - const jchar* pm = ures_getStringByIndex(gregorianElems.get(), 1, &lengthPm, &status); - - if (U_FAILURE(status)) { - return NULL; - } - - jobjectArray amPmMarkers = env->NewObjectArray(2, string_class, NULL); - jstring amU = env->NewString(am, lengthAm); - env->SetObjectArrayElement(amPmMarkers, 0, amU); - env->DeleteLocalRef(amU); - jstring pmU = env->NewString(pm, lengthPm); - env->SetObjectArrayElement(amPmMarkers, 1, pmU); - env->DeleteLocalRef(pmU); - - return amPmMarkers; -} - -static jobjectArray getEras(JNIEnv* env, UResourceBundle* gregorian) { - UErrorCode status = U_ZERO_ERROR; - ScopedResourceBundle gregorianElems(ures_getByKey(gregorian, "eras", NULL, &status)); - if (U_FAILURE(status)) { - return NULL; - } - - ScopedResourceBundle eraElems(ures_getByKey(gregorianElems.get(), "abbreviated", NULL, &status)); - if (U_FAILURE(status)) { - return NULL; - } - - int eraCount = ures_getSize(eraElems.get()); - jobjectArray eras = env->NewObjectArray(eraCount, string_class, NULL); - - ures_resetIterator(eraElems.get()); - for (int i = 0; i < eraCount; ++i) { - int eraLength; - const jchar* era = ures_getStringByIndex(eraElems.get(), i, &eraLength, &status); - if (U_FAILURE(status)) { - return NULL; - } - jstring eraU = env->NewString(era, eraLength); - env->SetObjectArrayElement(eras, i, eraU); - env->DeleteLocalRef(eraU); - } - return eras; -} - -static jobjectArray getMonthNames(JNIEnv* env, UResourceBundle* gregorian, bool longNames) { - UErrorCode status = U_ZERO_ERROR; - ScopedResourceBundle gregorianElems(ures_getByKey(gregorian, "monthNames", NULL, &status)); - if (U_FAILURE(status)) { - return NULL; - } - - ScopedResourceBundle monthNameElems(ures_getByKey(gregorianElems.get(), "format", NULL, &status)); - if (U_FAILURE(status)) { - return NULL; - } - - ScopedResourceBundle monthNameElemsFormat(ures_getByKey(monthNameElems.get(), longNames ? "wide" : "abbreviated", NULL, &status)); - if (U_FAILURE(status)) { - return NULL; - } - - ures_resetIterator(monthNameElemsFormat.get()); - int monthCount = ures_getSize(monthNameElemsFormat.get()); - // the array length is +1 because the harmony locales had an empty string at the end of their month name array - jobjectArray months = env->NewObjectArray(monthCount + 1, string_class, NULL); - for (int i = 0; i < monthCount; ++i) { - int monthNameLength; - const jchar* month = ures_getStringByIndex(monthNameElemsFormat.get(), i, &monthNameLength, &status); - if (U_FAILURE(status)) { - return NULL; - } - jstring monthU = env->NewString(month, monthNameLength); - env->SetObjectArrayElement(months, i, monthU); - env->DeleteLocalRef(monthU); - } - - jstring monthU = env->NewStringUTF(""); - env->SetObjectArrayElement(months, monthCount, monthU); - env->DeleteLocalRef(monthU); - - return months; -} - -static jobjectArray getLongMonthNames(JNIEnv* env, UResourceBundle* gregorian) { - return getMonthNames(env, gregorian, true); -} - -static jobjectArray getShortMonthNames(JNIEnv* env, UResourceBundle* gregorian) { - return getMonthNames(env, gregorian, false); -} - -static jobjectArray getWeekdayNames(JNIEnv* env, UResourceBundle* gregorian, bool longNames) { - UErrorCode status = U_ZERO_ERROR; - ScopedResourceBundle gregorianElems(ures_getByKey(gregorian, "dayNames", NULL, &status)); - if (U_FAILURE(status)) { - return NULL; - } - - ScopedResourceBundle dayNameElems(ures_getByKey(gregorianElems.get(), "format", NULL, &status)); - if (U_FAILURE(status)) { - return NULL; - } - - ScopedResourceBundle dayNameElemsFormat(ures_getByKey(dayNameElems.get(), longNames ? "wide" : "abbreviated", NULL, &status)); - if (U_FAILURE(status)) { - return NULL; - } - - ures_resetIterator(dayNameElemsFormat.get()); - int dayCount = ures_getSize(dayNameElemsFormat.get()); - jobjectArray weekdays = env->NewObjectArray(dayCount + 1, string_class, NULL); - // first entry in the weekdays array is an empty string - env->SetObjectArrayElement(weekdays, 0, env->NewStringUTF("")); - for(int i = 0; i < dayCount; i++) { - int dayNameLength; - const jchar* day = ures_getStringByIndex(dayNameElemsFormat.get(), i, &dayNameLength, &status); - if(U_FAILURE(status)) { - return NULL; - } - jstring dayU = env->NewString(day, dayNameLength); - env->SetObjectArrayElement(weekdays, i + 1, dayU); - env->DeleteLocalRef(dayU); - } - return weekdays; -} - -static jobjectArray getLongWeekdayNames(JNIEnv* env, UResourceBundle* gregorian) { - return getWeekdayNames(env, gregorian, true); -} - -static jobjectArray getShortWeekdayNames(JNIEnv* env, UResourceBundle* gregorian) { - return getWeekdayNames(env, gregorian, false); -} - -static jstring getIntCurrencyCode(JNIEnv* env, jstring locale) { - ScopedUtfChars localeChars(env, locale); - - // Extract the 2-character country name. - if (strlen(localeChars.c_str()) < 5) { - return NULL; - } - if (localeChars[3] < 'A' || localeChars[3] > 'Z' || localeChars[4] < 'A' || localeChars[4] > 'Z') { - return NULL; - } - - char country[3] = { localeChars[3], localeChars[4], 0 }; - return getCurrencyCodeNative(env, NULL, env->NewStringUTF(country)); -} - -static void setIntegerField(JNIEnv* env, jobject obj, const char* fieldName, int value) { - // Convert our int to a java.lang.Integer. - // TODO: switch to Integer.valueOf, add error checking. - jclass integerClass = env->FindClass("java/lang/Integer"); - jmethodID constructor = env->GetMethodID(integerClass, "", "(I)V"); - jobject integerValue = env->NewObject(integerClass, constructor, value); - // Set the field. - jclass localeDataClass = env->FindClass("com/ibm/icu4jni/util/LocaleData"); - jfieldID fid = env->GetFieldID(localeDataClass, fieldName, "Ljava/lang/Integer;"); - env->SetObjectField(obj, fid, integerValue); -} - -static void setStringField(JNIEnv* env, jobject obj, const char* fieldName, jstring value) { - jclass localeDataClass = env->FindClass("com/ibm/icu4jni/util/LocaleData"); - jfieldID fid = env->GetFieldID(localeDataClass, fieldName, "Ljava/lang/String;"); - env->SetObjectField(obj, fid, value); -} - -static void setStringArrayField(JNIEnv* env, jobject obj, const char* fieldName, jobjectArray value) { - jclass localeDataClass = env->FindClass("com/ibm/icu4jni/util/LocaleData"); - jfieldID fid = env->GetFieldID(localeDataClass, fieldName, "[Ljava/lang/String;"); - env->SetObjectField(obj, fid, value); -} - -static void setStringField(JNIEnv* env, jobject obj, const char* fieldName, UResourceBundle* bundle, int index) { - UErrorCode status = U_ZERO_ERROR; - int charCount; - const UChar* chars = ures_getStringByIndex(bundle, index, &charCount, &status); - if (U_SUCCESS(status)) { - setStringField(env, obj, fieldName, env->NewString(chars, charCount)); - } else { - LOGE("Error setting String field %s from ICU resource: %s", fieldName, u_errorName(status)); - } -} - -static void setCharField(JNIEnv* env, jobject obj, const char* fieldName, UResourceBundle* bundle, int index) { - UErrorCode status = U_ZERO_ERROR; - int charCount; - const UChar* chars = ures_getStringByIndex(bundle, index, &charCount, &status); - if (U_SUCCESS(status)) { - jclass localeDataClass = env->FindClass("com/ibm/icu4jni/util/LocaleData"); - jfieldID fid = env->GetFieldID(localeDataClass, fieldName, "C"); - env->SetCharField(obj, fid, chars[0]); - } else { - LOGE("Error setting char field %s from ICU resource: %s", fieldName, u_errorName(status)); - } -} - -static jboolean initLocaleDataImpl(JNIEnv* env, jclass, jstring locale, jobject localeData) { - const char* loc = env->GetStringUTFChars(locale, NULL); - UErrorCode status = U_ZERO_ERROR; - ScopedResourceBundle root(ures_openU(NULL, loc, &status)); - env->ReleaseStringUTFChars(locale, loc); - if (U_FAILURE(status)) { - LOGE("Error getting ICU resource bundle: %s", u_errorName(status)); - status = U_ZERO_ERROR; - return JNI_FALSE; - } - - ScopedResourceBundle calendar(ures_getByKey(root.get(), "calendar", NULL, &status)); - if (U_FAILURE(status)) { - LOGE("Error getting ICU calendar resource bundle: %s", u_errorName(status)); - return JNI_FALSE; - } - - ScopedResourceBundle gregorian(ures_getByKey(calendar.get(), "gregorian", NULL, &status)); - if (U_FAILURE(status)) { - LOGE("Error getting ICU gregorian resource bundle: %s", u_errorName(status)); - return JNI_FALSE; - } - - int firstDayVals[2]; - if (getDayIntVector(env, gregorian.get(), firstDayVals)) { - setIntegerField(env, localeData, "firstDayOfWeek", firstDayVals[0]); - setIntegerField(env, localeData, "minimalDaysInFirstWeek", firstDayVals[1]); - } - - setStringArrayField(env, localeData, "amPm", getAmPmMarkers(env, gregorian.get())); - setStringArrayField(env, localeData, "eras", getEras(env, gregorian.get())); - - setStringArrayField(env, localeData, "longMonthNames", getLongMonthNames(env, gregorian.get())); - setStringArrayField(env, localeData, "shortMonthNames", getShortMonthNames(env, gregorian.get())); - setStringArrayField(env, localeData, "longWeekdayNames", getLongWeekdayNames(env, gregorian.get())); - setStringArrayField(env, localeData, "shortWeekdayNames", getShortWeekdayNames(env, gregorian.get())); - - ScopedResourceBundle gregorianElems(ures_getByKey(gregorian.get(), "DateTimePatterns", NULL, &status)); - if (U_SUCCESS(status)) { - setStringField(env, localeData, "fullTimeFormat", gregorianElems.get(), 0); - setStringField(env, localeData, "longTimeFormat", gregorianElems.get(), 1); - setStringField(env, localeData, "mediumTimeFormat", gregorianElems.get(), 2); - setStringField(env, localeData, "shortTimeFormat", gregorianElems.get(), 3); - setStringField(env, localeData, "fullDateFormat", gregorianElems.get(), 4); - setStringField(env, localeData, "longDateFormat", gregorianElems.get(), 5); - setStringField(env, localeData, "mediumDateFormat", gregorianElems.get(), 6); - setStringField(env, localeData, "shortDateFormat", gregorianElems.get(), 7); - } - status = U_ZERO_ERROR; - - ScopedResourceBundle numberElements(ures_getByKey(root.get(), "NumberElements", NULL, &status)); - if (U_SUCCESS(status) && ures_getSize(numberElements.get()) >= 11) { - setCharField(env, localeData, "zeroDigit", numberElements.get(), 4); - setCharField(env, localeData, "digit", numberElements.get(), 5); - setCharField(env, localeData, "decimalSeparator", numberElements.get(), 0); - setCharField(env, localeData, "groupingSeparator", numberElements.get(), 1); - setCharField(env, localeData, "patternSeparator", numberElements.get(), 2); - setCharField(env, localeData, "percent", numberElements.get(), 3); - setCharField(env, localeData, "perMill", numberElements.get(), 8); - setCharField(env, localeData, "monetarySeparator", numberElements.get(), 0); - setCharField(env, localeData, "minusSign", numberElements.get(), 6); - setStringField(env, localeData, "exponentSeparator", numberElements.get(), 7); - setStringField(env, localeData, "infinity", numberElements.get(), 9); - setStringField(env, localeData, "NaN", numberElements.get(), 10); - } - status = U_ZERO_ERROR; - - jstring internationalCurrencySymbol = getIntCurrencyCode(env, locale); - jstring currencySymbol = NULL; - if (internationalCurrencySymbol != NULL) { - currencySymbol = getCurrencySymbolNative(env, NULL, locale, internationalCurrencySymbol); - } else { - internationalCurrencySymbol = env->NewStringUTF("XXX"); - } - if (currencySymbol == NULL) { - // This is the UTF-8 encoding of U+00A4 (CURRENCY SIGN). - currencySymbol = env->NewStringUTF("\xc2\xa4"); - } - setStringField(env, localeData, "currencySymbol", currencySymbol); - setStringField(env, localeData, "internationalCurrencySymbol", internationalCurrencySymbol); - - ScopedResourceBundle numberPatterns(ures_getByKey(root.get(), "NumberPatterns", NULL, &status)); - if (U_SUCCESS(status) && ures_getSize(numberPatterns.get()) >= 3) { - setStringField(env, localeData, "numberPattern", numberPatterns.get(), 0); - setStringField(env, localeData, "currencyPattern", numberPatterns.get(), 1); - setStringField(env, localeData, "percentPattern", numberPatterns.get(), 2); - } - - return JNI_TRUE; -} - -static JNINativeMethod gMethods[] = { - {"getAvailableBreakIteratorLocalesNative", "()[Ljava/lang/String;", (void*) getAvailableBreakIteratorLocalesNative}, - {"getAvailableCalendarLocalesNative", "()[Ljava/lang/String;", (void*) getAvailableCalendarLocalesNative}, - {"getAvailableCollatorLocalesNative", "()[Ljava/lang/String;", (void*) getAvailableCollatorLocalesNative}, - {"getAvailableDateFormatLocalesNative", "()[Ljava/lang/String;", (void*) getAvailableDateFormatLocalesNative}, - {"getAvailableLocalesNative", "()[Ljava/lang/String;", (void*) getAvailableLocalesNative}, - {"getAvailableNumberFormatLocalesNative", "()[Ljava/lang/String;", (void*) getAvailableNumberFormatLocalesNative}, - {"getCurrencyCodeNative", "(Ljava/lang/String;)Ljava/lang/String;", (void*) getCurrencyCodeNative}, - {"getCurrencyFractionDigitsNative", "(Ljava/lang/String;)I", (void*) getCurrencyFractionDigitsNative}, - {"getCurrencySymbolNative", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", (void*) getCurrencySymbolNative}, - {"getDisplayCountryNative", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", (void*) getDisplayCountryNative}, - {"getDisplayLanguageNative", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", (void*) getDisplayLanguageNative}, - {"getDisplayTimeZoneNative", "(Ljava/lang/String;ZILjava/lang/String;)Ljava/lang/String;", (void*) getDisplayTimeZoneNative}, - {"getDisplayVariantNative", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", (void*) getDisplayVariantNative}, - {"getISO3CountryNative", "(Ljava/lang/String;)Ljava/lang/String;", (void*) getISO3CountryNative}, - {"getISO3LanguageNative", "(Ljava/lang/String;)Ljava/lang/String;", (void*) getISO3LanguageNative}, - {"getISOCountriesNative", "()[Ljava/lang/String;", (void*) getISOCountriesNative}, - {"getISOLanguagesNative", "()[Ljava/lang/String;", (void*) getISOLanguagesNative}, - {"getTimeZonesNative", "([[Ljava/lang/String;Ljava/lang/String;)V", (void*) getTimeZonesNative}, - {"initLocaleDataImpl", "(Ljava/lang/String;Lcom/ibm/icu4jni/util/LocaleData;)Z", (void*) initLocaleDataImpl}, -}; -int register_com_ibm_icu4jni_util_Resources(JNIEnv* env) { - jclass stringclass = env->FindClass("java/lang/String"); - if (stringclass == NULL) { - return -1; - } - string_class = (jclass) env->NewGlobalRef(stringclass); - - return jniRegisterNativeMethods(env, "com/ibm/icu4jni/util/ICU", gMethods, NELEM(gMethods)); -} diff --git a/icu/src/main/native/NativeBreakIterator.cpp b/icu/src/main/native/NativeBreakIterator.cpp deleted file mode 100644 index 0be7630..0000000 --- a/icu/src/main/native/NativeBreakIterator.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#define LOG_TAG "NativeBreakIterator" - -#include "JNIHelp.h" -#include "ErrorCode.h" -#include "ScopedUtfChars.h" -#include "unicode/ubrk.h" -#include "unicode/putil.h" -#include - -static jint getIterator(JNIEnv* env, jstring locale, UBreakIteratorType type) { - UErrorCode status = U_ZERO_ERROR; - ScopedUtfChars localeChars(env, locale); - if (!localeChars.c_str()) { - return 0; - } - UBreakIterator* it = ubrk_open(type, localeChars.c_str(), NULL, 0, &status); - icu4jni_error(env, status); - return reinterpret_cast(it); -} - -static jint getCharacterInstanceImpl(JNIEnv* env, jclass clazz, jstring locale) { - return getIterator(env, locale, UBRK_CHARACTER); -} - -static jint getLineInstanceImpl(JNIEnv* env, jclass, jstring locale) { - return getIterator(env, locale, UBRK_LINE); -} - -static jint getSentenceInstanceImpl(JNIEnv* env, jclass, jstring locale) { - return getIterator(env, locale, UBRK_SENTENCE); -} - -static jint getWordInstanceImpl(JNIEnv* env, jclass, jstring locale) { - return getIterator(env, locale, UBRK_WORD); -} - -static UBreakIterator* breakIterator(jint address) { - return reinterpret_cast(static_cast(address)); -} - -static void closeBreakIteratorImpl(JNIEnv* env, jclass, jint address) { - ubrk_close(breakIterator(address)); -} - -static jint cloneImpl(JNIEnv* env, jclass, jint address) { - UErrorCode status = U_ZERO_ERROR; - jint bufferSize = U_BRK_SAFECLONE_BUFFERSIZE; - UBreakIterator* it = ubrk_safeClone(breakIterator(address), NULL, &bufferSize, &status); - icu4jni_error(env, status); - return reinterpret_cast(it); -} - -static void setTextImpl(JNIEnv* env, jclass, jint address, jstring text) { - UErrorCode status = U_ZERO_ERROR; - const UChar* chars = env->GetStringChars(text, NULL); - ubrk_setText(breakIterator(address), chars, env->GetStringLength(text), &status); - env->ReleaseStringChars(text, chars); - icu4jni_error(env, status); -} - -static jboolean isBoundaryImpl(JNIEnv*, jclass, jint address, jint offset) { - return ubrk_isBoundary(breakIterator(address), offset); -} - -static jint nextImpl(JNIEnv* env, jclass, jint address, jint n) { - UBreakIterator* bi = breakIterator(address); - if (n < 0) { - while (n++ < -1) { - ubrk_previous(bi); - } - return ubrk_previous(bi); - } else if (n == 0) { - return ubrk_current(bi); - } else { - while (n-- > 1) { - ubrk_next(bi); - } - return ubrk_next(bi); - } - return -1; -} - -static jint precedingImpl(JNIEnv*, jclass, jint address, jint offset) { - return ubrk_preceding(breakIterator(address), offset); -} - -static jint firstImpl(JNIEnv*, jclass, jint address) { - return ubrk_first(breakIterator(address)); -} - -static jint followingImpl(JNIEnv*, jclass, jint address, jint offset) { - return ubrk_following(breakIterator(address), offset); -} - -static jint currentImpl(JNIEnv*, jclass, jint address) { - return ubrk_current(breakIterator(address)); -} - -static jint previousImpl(JNIEnv*, jclass, jint address) { - return ubrk_previous(breakIterator(address)); -} - -static jint lastImpl(JNIEnv*, jclass, jint address) { - return ubrk_last(breakIterator(address)); -} - -static JNINativeMethod gMethods[] = { - { "cloneImpl", "(I)I", (void*) cloneImpl }, - { "closeBreakIteratorImpl", "(I)V", (void*) closeBreakIteratorImpl }, - { "currentImpl", "(I)I", (void*) currentImpl }, - { "firstImpl", "(I)I", (void*) firstImpl }, - { "followingImpl", "(II)I", (void*) followingImpl }, - { "getCharacterInstanceImpl", "(Ljava/lang/String;)I", (void*) getCharacterInstanceImpl }, - { "getLineInstanceImpl", "(Ljava/lang/String;)I", (void*) getLineInstanceImpl }, - { "getSentenceInstanceImpl", "(Ljava/lang/String;)I", (void*) getSentenceInstanceImpl }, - { "getWordInstanceImpl", "(Ljava/lang/String;)I", (void*) getWordInstanceImpl }, - { "isBoundaryImpl", "(II)Z", (void*) isBoundaryImpl }, - { "lastImpl", "(I)I", (void*) lastImpl }, - { "nextImpl", "(II)I", (void*) nextImpl }, - { "precedingImpl", "(II)I", (void*) precedingImpl }, - { "previousImpl", "(I)I", (void*) previousImpl }, - { "setTextImpl", "(ILjava/lang/String;)V", (void*) setTextImpl }, -}; -int register_com_ibm_icu4jni_text_NativeBreakIterator(JNIEnv* env) { - return jniRegisterNativeMethods(env, "com/ibm/icu4jni/text/NativeBreakIterator", - gMethods, NELEM(gMethods)); -} diff --git a/icu/src/main/native/NativeCollation.cpp b/icu/src/main/native/NativeCollation.cpp deleted file mode 100644 index 9a092e8..0000000 --- a/icu/src/main/native/NativeCollation.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2005, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -******************************************************************************* -*/ - -#define LOG_TAG "NativeCollation" - -#include "ErrorCode.h" -#include "JNIHelp.h" -#include "ScopedJavaUnicodeString.h" -#include "ScopedUtfChars.h" -#include "UniquePtr.h" -#include "ucol_imp.h" -#include "unicode/ucol.h" -#include "unicode/ucoleitr.h" - -static UCollator* toCollator(jint address) { - return reinterpret_cast(static_cast(address)); -} - -static UCollationElements* toCollationElements(jint address) { - return reinterpret_cast(static_cast(address)); -} - -static void closeCollator(JNIEnv* env, jclass, jint address) { - ucol_close(toCollator(address)); -} - -static void closeElements(JNIEnv* env, jclass, jint address) { - ucol_closeElements(toCollationElements(address)); -} - -static jint compare(JNIEnv* env, jclass, jint address, jstring lhs0, jstring rhs0) { - ScopedJavaUnicodeString lhs(env, lhs0); - ScopedJavaUnicodeString rhs(env, rhs0); - return ucol_strcoll(toCollator(address), - lhs.unicodeString().getBuffer(), lhs.unicodeString().length(), - rhs.unicodeString().getBuffer(), rhs.unicodeString().length()); -} - -static jint getAttribute(JNIEnv* env, jclass, jint address, jint type) { - UErrorCode status = U_ZERO_ERROR; - jint result = ucol_getAttribute(toCollator(address), (UColAttribute) type, &status); - icu4jni_error(env, status); - return result; -} - -static jint getCollationElementIterator(JNIEnv* env, jclass, jint address, jstring source0) { - ScopedJavaUnicodeString source(env, source0); - UErrorCode status = U_ZERO_ERROR; - UCollationElements* result = ucol_openElements(toCollator(address), - source.unicodeString().getBuffer(), source.unicodeString().length(), &status); - icu4jni_error(env, status); - return static_cast(reinterpret_cast(result)); -} - -static jint getMaxExpansion(JNIEnv* env, jclass, jint address, jint order) { - return ucol_getMaxExpansion(toCollationElements(address), order); -} - -static jint getNormalization(JNIEnv* env, jclass, jint address) { - UErrorCode status = U_ZERO_ERROR; - jint result = ucol_getAttribute(toCollator(address), UCOL_NORMALIZATION_MODE, &status); - icu4jni_error(env, status); - return result; -} - -static void setNormalization(JNIEnv* env, jclass, jint address, jint mode) { - UErrorCode status = U_ZERO_ERROR; - ucol_setAttribute(toCollator(address), UCOL_NORMALIZATION_MODE, UColAttributeValue(mode), &status); - icu4jni_error(env, status); -} - -static jint getOffset(JNIEnv* env, jclass, jint address) { - return ucol_getOffset(toCollationElements(address)); -} - -static jstring getRules(JNIEnv* env, jclass, jint address) { - int32_t length = 0; - const UChar* rules = ucol_getRules(toCollator(address), &length); - return env->NewString(rules, length); -} - -static jbyteArray getSortKey(JNIEnv* env, jclass, jint address, jstring source0) { - ScopedJavaUnicodeString source(env, source0); - const UCollator* collator = toCollator(address); - uint8_t byteArray[UCOL_MAX_BUFFER * 2]; - UniquePtr largerByteArray; - uint8_t *usedByteArray = byteArray; - const UChar* chars = source.unicodeString().getBuffer(); - size_t charCount = source.unicodeString().length(); - size_t byteArraySize = ucol_getSortKey(collator, chars, charCount, usedByteArray, sizeof(byteArray) - 1); - if (byteArraySize > sizeof(byteArray) - 1) { - // didn't fit, try again with a larger buffer. - largerByteArray.reset(new uint8_t[byteArraySize + 1]); - usedByteArray = largerByteArray.get(); - byteArraySize = ucol_getSortKey(collator, chars, charCount, usedByteArray, byteArraySize); - } - if (byteArraySize == 0) { - return NULL; - } - jbyteArray result = env->NewByteArray(byteArraySize); - env->SetByteArrayRegion(result, 0, byteArraySize, reinterpret_cast(usedByteArray)); - return result; -} - -static jint next(JNIEnv* env, jclass, jint address) { - UErrorCode status = U_ZERO_ERROR; - jint result = ucol_next(toCollationElements(address), &status); - icu4jni_error(env, status); - return result; -} - -static jint openCollator(JNIEnv* env, jclass, jstring localeName) { - ScopedUtfChars localeChars(env, localeName); - UErrorCode status = U_ZERO_ERROR; - UCollator* c = ucol_open(localeChars.c_str(), &status); - icu4jni_error(env, status); - return static_cast(reinterpret_cast(c)); -} - -static jint openCollatorFromRules(JNIEnv* env, jclass, jstring rules0, jint mode, jint strength) { - ScopedJavaUnicodeString rules(env, rules0); - UErrorCode status = U_ZERO_ERROR; - UCollator* c = ucol_openRules(rules.unicodeString().getBuffer(), rules.unicodeString().length(), - UColAttributeValue(mode), UCollationStrength(strength), NULL, &status); - icu4jni_error(env, status); - return static_cast(reinterpret_cast(c)); -} - -static jint previous(JNIEnv* env, jclass, jint address) { - UErrorCode status = U_ZERO_ERROR; - jint result = ucol_previous(toCollationElements(address), &status); - icu4jni_error(env, status); - return result; -} - -static void reset(JNIEnv* env, jclass, jint address) { - ucol_reset(toCollationElements(address)); -} - -static jint safeClone(JNIEnv* env, jclass, jint address) { - UErrorCode status = U_ZERO_ERROR; - jint bufferSize = U_COL_SAFECLONE_BUFFERSIZE; - UCollator* c = ucol_safeClone(toCollator(address), NULL, &bufferSize, &status); - icu4jni_error(env, status); - return static_cast(reinterpret_cast(c)); -} - -static void setAttribute(JNIEnv* env, jclass, jint address, jint type, jint value) { - UErrorCode status = U_ZERO_ERROR; - ucol_setAttribute(toCollator(address), (UColAttribute)type, (UColAttributeValue)value, &status); - icu4jni_error(env, status); -} - -static void setOffset(JNIEnv* env, jclass, jint address, jint offset) { - UErrorCode status = U_ZERO_ERROR; - ucol_setOffset(toCollationElements(address), offset, &status); - icu4jni_error(env, status); -} - -static void setText(JNIEnv* env, jclass, jint address, jstring source0) { - ScopedJavaUnicodeString source(env, source0); - UErrorCode status = U_ZERO_ERROR; - ucol_setText(toCollationElements(address), - source.unicodeString().getBuffer(), source.unicodeString().length(), &status); - icu4jni_error(env, status); -} - -static JNINativeMethod gMethods[] = { - { "openCollator", "(Ljava/lang/String;)I", (void*) openCollator }, - { "openCollatorFromRules", "(Ljava/lang/String;II)I", (void*) openCollatorFromRules }, - { "closeCollator", "(I)V", (void*) closeCollator }, - { "compare", "(ILjava/lang/String;Ljava/lang/String;)I", (void*) compare }, - { "getNormalization", "(I)I", (void*) getNormalization }, - { "setNormalization", "(II)V", (void*) setNormalization }, - { "getRules", "(I)Ljava/lang/String;", (void*) getRules }, - { "getSortKey", "(ILjava/lang/String;)[B", (void*) getSortKey }, - { "setAttribute", "(III)V", (void*) setAttribute }, - { "getAttribute", "(II)I", (void*) getAttribute }, - { "safeClone", "(I)I", (void*) safeClone }, - { "getCollationElementIterator", "(ILjava/lang/String;)I", (void*) getCollationElementIterator }, - { "closeElements", "(I)V", (void*) closeElements }, - { "reset", "(I)V", (void*) reset }, - { "next", "(I)I", (void*) next }, - { "previous", "(I)I", (void*) previous }, - { "getMaxExpansion", "(II)I", (void*) getMaxExpansion }, - { "setText", "(ILjava/lang/String;)V", (void*) setText }, - { "getOffset", "(I)I", (void*) getOffset }, - { "setOffset", "(II)V", (void*) setOffset } -}; -int register_com_ibm_icu4jni_text_NativeCollator(JNIEnv* env) { - return jniRegisterNativeMethods(env, "com/ibm/icu4jni/text/NativeCollation", - gMethods, NELEM(gMethods)); -} diff --git a/icu/src/main/native/NativeConverter.cpp b/icu/src/main/native/NativeConverter.cpp deleted file mode 100644 index 8b3952e..0000000 --- a/icu/src/main/native/NativeConverter.cpp +++ /dev/null @@ -1,1019 +0,0 @@ -/** -******************************************************************************* -* Copyright (C) 1996-2006, International Business Machines Corporation and * -* others. All Rights Reserved. * -******************************************************************************* -* -* -******************************************************************************* -*/ -/* - * @(#) icujniinterface.c 1.2 00/10/11 - * - * (C) Copyright IBM Corp. 2000 - All Rights Reserved - * A JNI wrapper to ICU native converter Interface - * @author: Ram Viswanadha - */ - -#define LOG_TAG "NativeConverter" - -#include "ErrorCode.h" -#include "JNIHelp.h" -#include "ScopedUtfChars.h" -#include "UniquePtr.h" -#include "unicode/ucnv.h" -#include "unicode/ucnv_cb.h" -#include "unicode/uset.h" -#include "unicode/ustring.h" -#include "unicode/utypes.h" -#include -#include - -#define com_ibm_icu4jni_converters_NativeConverter_STOP_CALLBACK 0L -#define com_ibm_icu4jni_converters_NativeConverter_SKIP_CALLBACK 1L -#define com_ibm_icu4jni_converters_NativeConverter_SUBSTITUTE_CALLBACK 2L - -/* Prototype of callback for substituting user settable sub chars */ -static void JNI_TO_U_CALLBACK_SUBSTITUTE - (const void *,UConverterToUnicodeArgs *,const char* ,int32_t ,UConverterCallbackReason ,UErrorCode * ); - -static jlong openConverter(JNIEnv* env, jclass, jstring converterName) { - ScopedUtfChars converterNameChars(env, converterName); - if (!converterNameChars.c_str()) { - return 0; - } - UErrorCode errorCode = U_ZERO_ERROR; - UConverter* conv = ucnv_open(converterNameChars.c_str(), &errorCode); - icu4jni_error(env, errorCode); - return (jlong) conv; -} - -static void closeConverter(JNIEnv* env, jclass, jlong handle) { - UConverter* cnv = (UConverter*)(long)handle; - if (cnv) { - // BEGIN android-added - // Free up any contexts created in setCallback[Encode|Decode]() - UConverterToUCallback toAction; - UConverterFromUCallback fromAction; - void* context1 = NULL; - void* context2 = NULL; - // TODO: ICU API bug? - // The documentation clearly states that the caller owns the returned - // pointers: http://icu-project.org/apiref/icu4c/ucnv_8h.html - ucnv_getToUCallBack(cnv, &toAction, const_cast(&context1)); - ucnv_getFromUCallBack(cnv, &fromAction, const_cast(&context2)); - // END android-added - ucnv_close(cnv); - // BEGIN android-added - if (context1 != NULL) { - free(context1); - } - if (context2 != NULL) { - free(context2); - } - // END android-added - } -} - -/** - * Converts a buffer of Unicode code units to target encoding - * @param env environment handle for JNI - * @param jClass handle for the class - * @param handle address of ICU converter - * @param source buffer of Unicode chars to convert - * @param sourceEnd limit of the source buffer - * @param target buffer to recieve the converted bytes - * @param targetEnd the limit of the target buffer - * @param data buffer to recieve state of the current conversion - * @param flush boolean that specifies end of source input - */ -static jint convertCharToByte(JNIEnv *env, jclass, jlong handle, jcharArray source, jint sourceEnd, jbyteArray target, jint targetEnd, jintArray data, jboolean flush) { - - UErrorCode errorCode =U_ZERO_ERROR; - UConverter* cnv = (UConverter*)handle; - if(cnv) { - jint* myData = (jint*) env->GetPrimitiveArrayCritical(data,NULL); - if(myData) { - jint* sourceOffset = &myData[0]; - jint* targetOffset = &myData[1]; - const jchar* uSource =(jchar*) env->GetPrimitiveArrayCritical(source, NULL); - if(uSource) { - jbyte* uTarget=(jbyte*) env->GetPrimitiveArrayCritical(target,NULL); - if(uTarget) { - const jchar* mySource = uSource+ *sourceOffset; - const UChar* mySourceLimit= uSource+sourceEnd; - char* cTarget = reinterpret_cast(uTarget+ *targetOffset); - const char* cTargetLimit = reinterpret_cast(uTarget+targetEnd); - - ucnv_fromUnicode( cnv , &cTarget, cTargetLimit,&mySource, - mySourceLimit,NULL,(UBool) flush, &errorCode); - - *sourceOffset = (jint) (mySource - uSource)-*sourceOffset; - *targetOffset = (jint) ((jbyte*)cTarget - uTarget)- *targetOffset; - if(U_FAILURE(errorCode)) { - env->ReleasePrimitiveArrayCritical(target,uTarget,0); - env->ReleasePrimitiveArrayCritical(source,(jchar*)uSource,0); - env->ReleasePrimitiveArrayCritical(data,(jint*)myData,0); - return errorCode; - } - }else{ - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - } - env->ReleasePrimitiveArrayCritical(target,uTarget,0); - }else{ - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - } - env->ReleasePrimitiveArrayCritical(source,(jchar*)uSource,0); - }else{ - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - } - env->ReleasePrimitiveArrayCritical(data,(jint*)myData,0); - return errorCode; - } - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - return errorCode; -} - -static jint encode(JNIEnv *env, jclass, jlong handle, jcharArray source, jint sourceEnd, jbyteArray target, jint targetEnd, jintArray data, jboolean flush) { - - UErrorCode ec = UErrorCode(convertCharToByte(env, NULL,handle,source,sourceEnd, target,targetEnd,data,flush)); - UConverter* cnv = (UConverter*)handle; - jint* myData = (jint*) env->GetPrimitiveArrayCritical(data,NULL); - - if(cnv && myData) { - - UErrorCode errorCode = U_ZERO_ERROR; - myData[3] = ucnv_fromUCountPending(cnv, &errorCode); - - if(ec == U_ILLEGAL_CHAR_FOUND || ec == U_INVALID_CHAR_FOUND) { - int8_t count =32; - UChar invalidUChars[32]; - ucnv_getInvalidUChars(cnv,invalidUChars,&count,&errorCode); - - if(U_SUCCESS(errorCode)) { - myData[2] = count; - } - } - } - env->ReleasePrimitiveArrayCritical(data,(jint*)myData,0); - return ec; -} - -/** - * Converts a buffer of encoded bytes to Unicode code units - * @param env environment handle for JNI - * @param jClass handle for the class - * @param handle address of ICU converter - * @param source buffer of Unicode chars to convert - * @param sourceEnd limit of the source buffer - * @param target buffer to recieve the converted bytes - * @param targetEnd the limit of the target buffer - * @param data buffer to recieve state of the current conversion - * @param flush boolean that specifies end of source input - */ -static jint convertByteToChar(JNIEnv *env, jclass, jlong handle, jbyteArray source, jint sourceEnd, jcharArray target, jint targetEnd, jintArray data, jboolean flush) { - - UErrorCode errorCode =U_ZERO_ERROR; - UConverter* cnv = (UConverter*)handle; - if(cnv) { - jint* myData = (jint*) env->GetPrimitiveArrayCritical(data,NULL); - if(myData) { - jint* sourceOffset = &myData[0]; - jint* targetOffset = &myData[1]; - - const jbyte* uSource =(jbyte*) env->GetPrimitiveArrayCritical(source, NULL); - if(uSource) { - jchar* uTarget=(jchar*) env->GetPrimitiveArrayCritical(target,NULL); - if(uTarget) { - const jbyte* mySource = uSource+ *sourceOffset; - const char* mySourceLimit = reinterpret_cast(uSource+sourceEnd); - UChar* cTarget=uTarget+ *targetOffset; - const UChar* cTargetLimit=uTarget+targetEnd; - - ucnv_toUnicode( cnv , &cTarget, cTargetLimit,(const char**)&mySource, - mySourceLimit,NULL,(UBool) flush, &errorCode); - - *sourceOffset = mySource - uSource - *sourceOffset ; - *targetOffset = cTarget - uTarget - *targetOffset; - if(U_FAILURE(errorCode)) { - env->ReleasePrimitiveArrayCritical(target,uTarget,0); - env->ReleasePrimitiveArrayCritical(source,(jchar*)uSource,0); - env->ReleasePrimitiveArrayCritical(data,(jint*)myData,0); - return errorCode; - } - }else{ - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - } - env->ReleasePrimitiveArrayCritical(target,uTarget,0); - }else{ - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - } - env->ReleasePrimitiveArrayCritical(source,(jchar*)uSource,0); - }else{ - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - } - env->ReleasePrimitiveArrayCritical(data,(jint*)myData,0); - return errorCode; - } - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - return errorCode; -} - -static jint decode(JNIEnv *env, jclass, jlong handle, jbyteArray source, jint sourceEnd, jcharArray target, jint targetEnd, jintArray data, jboolean flush) { - - jint ec = convertByteToChar(env, NULL,handle,source,sourceEnd, target,targetEnd,data,flush); - - jint* myData = (jint*) env->GetPrimitiveArrayCritical(data,NULL); - UConverter* cnv = (UConverter*)handle; - - if(myData && cnv) { - UErrorCode errorCode = U_ZERO_ERROR; - myData[3] = ucnv_toUCountPending(cnv, &errorCode); - - if(ec == U_ILLEGAL_CHAR_FOUND || ec == U_INVALID_CHAR_FOUND ) { - char invalidChars[32] = {'\0'}; - int8_t len = 32; - ucnv_getInvalidChars(cnv,invalidChars,&len,&errorCode); - - if(U_SUCCESS(errorCode)) { - myData[2] = len; - } - } - } - env->ReleasePrimitiveArrayCritical(data,(jint*)myData,0); - return ec; -} - -static void resetByteToChar(JNIEnv* env, jclass, jlong handle) { - UConverter* cnv = (UConverter*)handle; - if (cnv) { - ucnv_resetToUnicode(cnv); - } -} - -static void resetCharToByte(JNIEnv* env, jclass, jlong handle) { - UConverter* cnv = (UConverter*)handle; - if (cnv) { - ucnv_resetFromUnicode(cnv); - } -} - -static jint getMaxBytesPerChar(JNIEnv *env, jclass, jlong handle) { - UConverter* cnv = (UConverter*)handle; - return (cnv != NULL) ? ucnv_getMaxCharSize(cnv) : -1; -} - -static jint getMinBytesPerChar(JNIEnv *env, jclass, jlong handle) { - UConverter* cnv = (UConverter*)handle; - return (cnv != NULL) ? ucnv_getMinCharSize(cnv) : -1; -} - -static jfloat getAveBytesPerChar(JNIEnv *env, jclass, jlong handle) { - UConverter* cnv = (UConverter*)handle; - if (cnv) { - jfloat max = (jfloat)ucnv_getMaxCharSize(cnv); - jfloat min = (jfloat)ucnv_getMinCharSize(cnv); - return (jfloat) ( (max+min)/2 ); - } - return -1; -} - -static jint flushByteToChar(JNIEnv *env, jclass,jlong handle, jcharArray target, jint targetEnd, jintArray data) { - - UErrorCode errorCode =U_ZERO_ERROR; - UConverter* cnv = (UConverter*)handle; - if(cnv) { - jbyte source ='\0'; - jint* myData = (jint*) env->GetPrimitiveArrayCritical(data,NULL); - if(myData) { - jint* targetOffset = &myData[1]; - jchar* uTarget=(jchar*) env->GetPrimitiveArrayCritical(target,NULL); - if(uTarget) { - const jbyte* mySource = &source; - const char* mySourceLimit = reinterpret_cast(&source); - UChar* cTarget=uTarget+ *targetOffset; - const UChar* cTargetLimit=uTarget+targetEnd; - - ucnv_toUnicode( cnv , &cTarget, cTargetLimit,(const char**)&mySource, - mySourceLimit,NULL,TRUE, &errorCode); - - - *targetOffset = (jint) ((jchar*)cTarget - uTarget)- *targetOffset; - if(U_FAILURE(errorCode)) { - env->ReleasePrimitiveArrayCritical(target,uTarget,0); - env->ReleasePrimitiveArrayCritical(data,(jint*)myData,0); - return errorCode; - } - }else{ - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - } - env->ReleasePrimitiveArrayCritical(target,uTarget,0); - - }else{ - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - } - env->ReleasePrimitiveArrayCritical(data,(jint*)myData,0); - return errorCode; - } - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - return errorCode; -} - -static jint flushCharToByte (JNIEnv *env, jclass, jlong handle, jbyteArray target, jint targetEnd, jintArray data) { - - UErrorCode errorCode =U_ZERO_ERROR; - UConverter* cnv = (UConverter*)handle; - jchar source = '\0'; - if(cnv) { - jint* myData = (jint*) env->GetPrimitiveArrayCritical(data,NULL); - if(myData) { - jint* targetOffset = &myData[1]; - jbyte* uTarget=(jbyte*) env->GetPrimitiveArrayCritical(target,NULL); - if(uTarget) { - const jchar* mySource = &source; - const UChar* mySourceLimit= &source; - char* cTarget = reinterpret_cast(uTarget+ *targetOffset); - const char* cTargetLimit = reinterpret_cast(uTarget+targetEnd); - - ucnv_fromUnicode( cnv , &cTarget, cTargetLimit,&mySource, - mySourceLimit,NULL,TRUE, &errorCode); - - - *targetOffset = (jint) ((jbyte*)cTarget - uTarget)- *targetOffset; - if(U_FAILURE(errorCode)) { - env->ReleasePrimitiveArrayCritical(target,uTarget,0); - - env->ReleasePrimitiveArrayCritical(data,(jint*)myData,0); - return errorCode; - } - }else{ - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - } - env->ReleasePrimitiveArrayCritical(target,uTarget,0); - }else{ - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - } - env->ReleasePrimitiveArrayCritical(data,(jint*)myData,0); - return errorCode; - } - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - return errorCode; -} - -static void toChars(const UChar* us, char* cs, int32_t length) { - while (length > 0) { - UChar u = *us++; - *cs++=(char)u; - --length; - } -} -static jint setSubstitutionBytes(JNIEnv *env, jclass, jlong handle, jbyteArray subChars, jint length) { - UConverter* cnv = (UConverter*) handle; - UErrorCode errorCode = U_ZERO_ERROR; - if (cnv) { - jbyte* u_subChars = reinterpret_cast(env->GetPrimitiveArrayCritical(subChars, NULL)); - if (u_subChars) { - char mySubChars[length]; - toChars((UChar*)u_subChars,&mySubChars[0],length); - ucnv_setSubstChars(cnv,mySubChars, (char)length,&errorCode); - if(U_FAILURE(errorCode)) { - env->ReleasePrimitiveArrayCritical(subChars,mySubChars,0); - return errorCode; - } - } else{ - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - } - env->ReleasePrimitiveArrayCritical(subChars,u_subChars,0); - return errorCode; - } - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - return errorCode; -} - - -#define VALUE_STRING_LENGTH 32 - -struct SubCharStruct { - int length; - UChar subChars[256]; - UBool stopOnIllegal; -}; - - -static UErrorCode -setToUCallbackSubs(UConverter* cnv,UChar* subChars, int32_t length,UBool stopOnIllegal ) { - SubCharStruct* substitutionCharS = (SubCharStruct*) malloc(sizeof(SubCharStruct)); - UErrorCode errorCode = U_ZERO_ERROR; - if(substitutionCharS) { - UConverterToUCallback toUOldAction; - void* toUOldContext=NULL; - void* toUNewContext=NULL ; - if(subChars) { - u_strncpy(substitutionCharS->subChars,subChars,length); - }else{ - substitutionCharS->subChars[length++] =0xFFFD; - } - substitutionCharS->subChars[length]=0; - substitutionCharS->length = length; - substitutionCharS->stopOnIllegal = stopOnIllegal; - toUNewContext = substitutionCharS; - - ucnv_setToUCallBack(cnv, - JNI_TO_U_CALLBACK_SUBSTITUTE, - toUNewContext, - &toUOldAction, - (const void**)&toUOldContext, - &errorCode); - - if(toUOldContext) { - SubCharStruct* temp = (SubCharStruct*) toUOldContext; - free(temp); - } - - return errorCode; - } - return U_MEMORY_ALLOCATION_ERROR; -} -static jint setSubstitutionChars(JNIEnv *env, jclass, jlong handle, jcharArray subChars, jint length) { - - UErrorCode errorCode = U_ZERO_ERROR; - UConverter* cnv = (UConverter*) handle; - jchar* u_subChars=NULL; - if(cnv) { - if(subChars) { - int len = env->GetArrayLength(subChars); - u_subChars = reinterpret_cast(env->GetPrimitiveArrayCritical(subChars,NULL)); - if(u_subChars) { - errorCode = setToUCallbackSubs(cnv,u_subChars,len,FALSE); - }else{ - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - } - env->ReleasePrimitiveArrayCritical(subChars,u_subChars,0); - return errorCode; - } - } - return U_ILLEGAL_ARGUMENT_ERROR; -} - - -static void JNI_TO_U_CALLBACK_SUBSTITUTE( const void *context, UConverterToUnicodeArgs *toArgs, const char* codeUnits, int32_t length, UConverterCallbackReason reason, UErrorCode * err) { - - if(context) { - SubCharStruct* temp = (SubCharStruct*)context; - if( temp) { - if(temp->stopOnIllegal==FALSE) { - if (reason > UCNV_IRREGULAR) { - return; - } - /* reset the error */ - *err = U_ZERO_ERROR; - ucnv_cbToUWriteUChars(toArgs,temp->subChars ,temp->length , 0, err); - }else{ - if(reason != UCNV_UNASSIGNED) { - /* the caller must have set - * the error code accordingly - */ - return; - }else{ - *err = U_ZERO_ERROR; - ucnv_cbToUWriteUChars(toArgs,temp->subChars ,temp->length , 0, err); - return; - } - } - } - } - return; -} - -static jboolean canEncode(JNIEnv *env, jclass, jlong handle, jint codeUnit) { - - UErrorCode errorCode =U_ZERO_ERROR; - UConverter* cnv = (UConverter*)handle; - if(cnv) { - UChar source[3]; - UChar *mySource=source; - const UChar* sourceLimit = (codeUnit<0x010000) ? &source[1] : &source[2]; - char target[5]; - char *myTarget = target; - const char* targetLimit = &target[4]; - int i=0; - UTF_APPEND_CHAR(&source[0],i,2,codeUnit); - - ucnv_fromUnicode(cnv,&myTarget,targetLimit, - (const UChar**)&mySource, - sourceLimit,NULL, TRUE,&errorCode); - - if(U_SUCCESS(errorCode)) { - return (jboolean)TRUE; - } - } - return (jboolean)FALSE; -} - -/* - * If a charset listed in the IANA Charset Registry is supported by an implementation - * of the Java platform then its canonical name must be the name listed in the registry. - * Many charsets are given more than one name in the registry, in which case the registry - * identifies one of the names as MIME-preferred. If a charset has more than one registry - * name then its canonical name must be the MIME-preferred name and the other names in - * the registry must be valid aliases. If a supported charset is not listed in the IANA - * registry then its canonical name must begin with one of the strings "X-" or "x-". - */ -static jstring getJavaCanonicalName(JNIEnv *env, const char* icuCanonicalName) { - UErrorCode status = U_ZERO_ERROR; - - // Check to see if this is a well-known MIME or IANA name. - const char* cName = NULL; - if ((cName = ucnv_getStandardName(icuCanonicalName, "MIME", &status)) != NULL) { - return env->NewStringUTF(cName); - } else if ((cName = ucnv_getStandardName(icuCanonicalName, "IANA", &status)) != NULL) { - return env->NewStringUTF(cName); - } - - // Check to see if an alias already exists with "x-" prefix, if yes then - // make that the canonical name. - int32_t aliasCount = ucnv_countAliases(icuCanonicalName, &status); - for (int i = 0; i < aliasCount; ++i) { - const char* name = ucnv_getAlias(icuCanonicalName, i, &status); - if (name != NULL && name[0] == 'x' && name[1] == '-') { - return env->NewStringUTF(name); - } - } - - // As a last resort, prepend "x-" to any alias and make that the canonical name. - status = U_ZERO_ERROR; - const char* name = ucnv_getStandardName(icuCanonicalName, "UTR22", &status); - if (name == NULL && strchr(icuCanonicalName, ',') != NULL) { - name = ucnv_getAlias(icuCanonicalName, 1, &status); - } - // If there is no UTR22 canonical name then just return the original name. - if (name == NULL) { - name = icuCanonicalName; - } - UniquePtr result(new char[2 + strlen(name) + 1]); - strcpy(&result[0], "x-"); - strcat(&result[0], name); - return env->NewStringUTF(&result[0]); -} - -static jobjectArray getAvailableCharsetNames(JNIEnv *env, jclass) { - int32_t num = ucnv_countAvailable(); - jobjectArray result = env->NewObjectArray(num, env->FindClass("java/lang/String"), NULL); - for (int i = 0; i < num; ++i) { - const char* name = ucnv_getAvailableName(i); - jstring javaCanonicalName = getJavaCanonicalName(env, name); - env->SetObjectArrayElement(result, i, javaCanonicalName); - env->DeleteLocalRef(javaCanonicalName); - } - return result; -} - -static jobjectArray getAliases(JNIEnv* env, const char* icuCanonicalName) { - // Get an upper bound on the number of aliases... - const char* myEncName = icuCanonicalName; - UErrorCode error = U_ZERO_ERROR; - int32_t aliasCount = ucnv_countAliases(myEncName, &error); - if (aliasCount == 0 && myEncName[0] == 'x' && myEncName[1] == '-') { - myEncName = myEncName + 2; - aliasCount = ucnv_countAliases(myEncName, &error); - } - if (!U_SUCCESS(error)) { - return NULL; - } - - // Collect the aliases we want... - const char* aliasArray[aliasCount]; - int actualAliasCount = 0; - for(int i = 0; i < aliasCount; ++i) { - const char* name = ucnv_getAlias(myEncName, (uint16_t) i, &error); - if (!U_SUCCESS(error)) { - return NULL; - } - // TODO: why do we ignore these ones? - if (strchr(name, '+') == 0 && strchr(name, ',') == 0) { - aliasArray[actualAliasCount++]= name; - } - } - - // Convert our C++ char*[] into a Java String[]... - jobjectArray result = env->NewObjectArray(actualAliasCount, env->FindClass("java/lang/String"), NULL); - for (int i = 0; i < actualAliasCount; ++i) { - jstring alias = env->NewStringUTF(aliasArray[i]); - env->SetObjectArrayElement(result, i, alias); - env->DeleteLocalRef(alias); - } - return result; -} - -static const char* getICUCanonicalName(const char* name) { - UErrorCode error = U_ZERO_ERROR; - const char* canonicalName = NULL; - if ((canonicalName = ucnv_getCanonicalName(name, "MIME", &error)) != NULL) { - return canonicalName; - } else if((canonicalName = ucnv_getCanonicalName(name, "IANA", &error)) != NULL) { - return canonicalName; - } else if((canonicalName = ucnv_getCanonicalName(name, "", &error)) != NULL) { - return canonicalName; - } else if((canonicalName = ucnv_getAlias(name, 0, &error)) != NULL) { - /* we have some aliases in the form x-blah .. match those first */ - return canonicalName; - } else if (strstr(name, "x-") == name) { - /* check if the converter can be opened with the name given */ - error = U_ZERO_ERROR; - UConverter* conv = ucnv_open(name + 2, &error); - if (conv != NULL) { - ucnv_close(conv); - return name + 2; - } - } - return NULL; -} - -#define SUBS_ARRAY_CAPACITY 256 -struct EncoderCallbackContext { - int length; - char subChars[SUBS_ARRAY_CAPACITY]; - UConverterFromUCallback onUnmappableInput; - UConverterFromUCallback onMalformedInput; -}; - -static void CHARSET_ENCODER_CALLBACK(const void *context, - UConverterFromUnicodeArgs *fromArgs, - const UChar* codeUnits, - int32_t length, - UChar32 codePoint, - UConverterCallbackReason reason, - UErrorCode * status) { - if(context) { - EncoderCallbackContext* ctx = (EncoderCallbackContext*)context; - - if(ctx) { - UConverterFromUCallback realCB = NULL; - switch(reason) { - case UCNV_UNASSIGNED: - realCB = ctx->onUnmappableInput; - break; - case UCNV_ILLEGAL:/*malformed input*/ - case UCNV_IRREGULAR:/*malformed input*/ - realCB = ctx->onMalformedInput; - break; - /* - case UCNV_RESET: - ucnv_resetToUnicode(args->converter); - break; - case UCNV_CLOSE: - ucnv_close(args->converter); - break; - case UCNV_CLONE: - ucnv_clone(args->clone); - */ - default: - *status = U_ILLEGAL_ARGUMENT_ERROR; - return; - } - if (realCB == NULL) { - *status = U_INTERNAL_PROGRAM_ERROR; - } else { - realCB(context, fromArgs, codeUnits, length, codePoint, reason, status); - } - } - } -} - -static void JNI_FROM_U_CALLBACK_SUBSTITUTE_ENCODER(const void *context, - UConverterFromUnicodeArgs *fromArgs, - const UChar* codeUnits, - int32_t length, - UChar32 codePoint, - UConverterCallbackReason reason, - UErrorCode * err) { - if(context) { - EncoderCallbackContext* temp = (EncoderCallbackContext*)context; - *err = U_ZERO_ERROR; - ucnv_cbFromUWriteBytes(fromArgs,temp->subChars ,temp->length , 0, err); - } - return; -} - -static UConverterFromUCallback getFromUCallback(int32_t mode) { - switch(mode) { - default: /* falls through */ - case com_ibm_icu4jni_converters_NativeConverter_STOP_CALLBACK: - return UCNV_FROM_U_CALLBACK_STOP; - case com_ibm_icu4jni_converters_NativeConverter_SKIP_CALLBACK: - return UCNV_FROM_U_CALLBACK_SKIP ; - case com_ibm_icu4jni_converters_NativeConverter_SUBSTITUTE_CALLBACK: - return JNI_FROM_U_CALLBACK_SUBSTITUTE_ENCODER; - } -} - -static jint setCallbackEncode(JNIEnv *env, jclass, jlong handle, jint onMalformedInput, jint onUnmappableInput, jbyteArray subChars, jint length) { - - UConverter* conv = (UConverter*)handle; - UErrorCode errorCode =U_ZERO_ERROR; - - if(conv) { - - UConverterFromUCallback fromUOldAction = NULL; - void* fromUOldContext = NULL; - EncoderCallbackContext* fromUNewContext=NULL; - UConverterFromUCallback fromUNewAction=NULL; - jbyte* sub = (jbyte*) env->GetPrimitiveArrayCritical(subChars, NULL); - ucnv_getFromUCallBack(conv, &fromUOldAction, const_cast(&fromUOldContext)); - - /* fromUOldContext can only be DecodeCallbackContext since - the converter created is private data for the decoder - and callbacks can only be set via this method! - */ - if(fromUOldContext==NULL) { - fromUNewContext = (EncoderCallbackContext*) malloc(sizeof(EncoderCallbackContext)); - fromUNewAction = CHARSET_ENCODER_CALLBACK; - }else{ - fromUNewContext = (EncoderCallbackContext*) fromUOldContext; - fromUNewAction = fromUOldAction; - fromUOldAction = NULL; - fromUOldContext = NULL; - } - fromUNewContext->onMalformedInput = getFromUCallback(onMalformedInput); - fromUNewContext->onUnmappableInput = getFromUCallback(onUnmappableInput); - // BEGIN android-changed - if(sub!=NULL) { - fromUNewContext->length = length; - const char* src = const_cast(reinterpret_cast(sub)); - strncpy(fromUNewContext->subChars, src, length); - env->ReleasePrimitiveArrayCritical(subChars, sub, 0); - }else{ - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - } - // END android-changed - - ucnv_setFromUCallBack(conv, - fromUNewAction, - fromUNewContext, - &fromUOldAction, - (const void**)&fromUOldContext, - &errorCode); - - - return errorCode; - } - return U_ILLEGAL_ARGUMENT_ERROR; -} - -struct DecoderCallbackContext { - int length; - UChar subUChars[256]; - UConverterToUCallback onUnmappableInput; - UConverterToUCallback onMalformedInput; -}; - -static void JNI_TO_U_CALLBACK_SUBSTITUTE_DECODER(const void *context, - UConverterToUnicodeArgs *toArgs, - const char* codeUnits, - int32_t length, - UConverterCallbackReason reason, - UErrorCode * err) { - if(context) { - DecoderCallbackContext* temp = (DecoderCallbackContext*)context; - *err = U_ZERO_ERROR; - ucnv_cbToUWriteUChars(toArgs,temp->subUChars ,temp->length , 0, err); - } - return; -} - -static UConverterToUCallback getToUCallback(int32_t mode) { - switch(mode) { - default: /* falls through */ - case com_ibm_icu4jni_converters_NativeConverter_STOP_CALLBACK: - return UCNV_TO_U_CALLBACK_STOP; - case com_ibm_icu4jni_converters_NativeConverter_SKIP_CALLBACK: - return UCNV_TO_U_CALLBACK_SKIP ; - case com_ibm_icu4jni_converters_NativeConverter_SUBSTITUTE_CALLBACK: - return JNI_TO_U_CALLBACK_SUBSTITUTE_DECODER; - } -} - -static void CHARSET_DECODER_CALLBACK(const void *context, - UConverterToUnicodeArgs *args, - const char* codeUnits, - int32_t length, - UConverterCallbackReason reason, - UErrorCode *status ) { - - if(context) { - DecoderCallbackContext* ctx = (DecoderCallbackContext*)context; - - if(ctx) { - UConverterToUCallback realCB = NULL; - switch(reason) { - case UCNV_UNASSIGNED: - realCB = ctx->onUnmappableInput; - break; - case UCNV_ILLEGAL:/*malformed input*/ - case UCNV_IRREGULAR:/*malformed input*/ - realCB = ctx->onMalformedInput; - break; - /* - case UCNV_RESET: - ucnv_resetToUnicode(args->converter); - break; - case UCNV_CLOSE: - ucnv_close(args->converter); - break; - case UCNV_CLONE: - ucnv_clone(args->clone); - */ - default: - *status = U_ILLEGAL_ARGUMENT_ERROR; - return; - } - if (realCB == NULL) { - *status = U_INTERNAL_PROGRAM_ERROR; - } else { - realCB(context, args, codeUnits, length, reason, status); - } - } - } -} - -static jint setCallbackDecode(JNIEnv *env, jclass, jlong handle, jint onMalformedInput, jint onUnmappableInput, jcharArray subChars, jint length) { - - UConverter* conv = (UConverter*)handle; - UErrorCode errorCode =U_ZERO_ERROR; - if(conv) { - - UConverterToUCallback toUOldAction ; - void* toUOldContext; - DecoderCallbackContext* toUNewContext = NULL; - UConverterToUCallback toUNewAction = NULL; - jchar* sub = (jchar*) env->GetPrimitiveArrayCritical(subChars, NULL); - - ucnv_getToUCallBack(conv, &toUOldAction, const_cast(&toUOldContext)); - - /* toUOldContext can only be DecodeCallbackContext since - the converter created is private data for the decoder - and callbacks can only be set via this method! - */ - if(toUOldContext==NULL) { - toUNewContext = (DecoderCallbackContext*) malloc(sizeof(DecoderCallbackContext)); - toUNewAction = CHARSET_DECODER_CALLBACK; - }else{ - toUNewContext = reinterpret_cast(toUOldContext); - toUNewAction = toUOldAction; - toUOldAction = NULL; - toUOldContext = NULL; - } - toUNewContext->onMalformedInput = getToUCallback(onMalformedInput); - toUNewContext->onUnmappableInput = getToUCallback(onUnmappableInput); - // BEGIN android-changed - if(sub!=NULL) { - toUNewContext->length = length; - u_strncpy(toUNewContext->subUChars, sub, length); - env->ReleasePrimitiveArrayCritical(subChars, sub, 0); - }else{ - errorCode = U_ILLEGAL_ARGUMENT_ERROR; - } - // END android-changed - ucnv_setToUCallBack(conv, - toUNewAction, - toUNewContext, - &toUOldAction, - (const void**)&toUOldContext, - &errorCode); - - return errorCode; - } - return U_ILLEGAL_ARGUMENT_ERROR; -} - -static jint getMaxCharsPerByte(JNIEnv *env, jclass, jlong handle) { - /* - * currently we know that max number of chars per byte is 2 - */ - return 2; -} - -static jfloat getAveCharsPerByte(JNIEnv *env, jclass, jlong handle) { - return (1 / (jfloat) getMaxBytesPerChar(env, NULL, handle)); -} - -static jbyteArray getSubstitutionBytes(JNIEnv *env, jclass, jlong handle) { - const UConverter * cnv = (const UConverter *) handle; - if (cnv) { - UErrorCode status = U_ZERO_ERROR; - char subBytes[10]; - int8_t len =(char)10; - ucnv_getSubstChars(cnv,subBytes,&len,&status); - if(U_SUCCESS(status)) { - jbyteArray arr = env->NewByteArray(len); - if (arr) { - env->SetByteArrayRegion(arr,0,len,(jbyte*)subBytes); - } - return arr; - } - } - return env->NewByteArray(0); -} - -static jboolean contains(JNIEnv* env, jclass, jlong handle1, jlong handle2) { - UErrorCode status = U_ZERO_ERROR; - const UConverter * cnv1 = (const UConverter *) handle1; - const UConverter * cnv2 = (const UConverter *) handle2; - UBool bRet = 0; - - if(cnv1 != NULL && cnv2 != NULL) { - /* open charset 1 */ - USet* set1 = uset_open(1, 2); - ucnv_getUnicodeSet(cnv1, set1, UCNV_ROUNDTRIP_SET, &status); - - if(U_SUCCESS(status)) { - /* open charset 2 */ - status = U_ZERO_ERROR; - USet* set2 = uset_open(1, 2); - ucnv_getUnicodeSet(cnv2, set2, UCNV_ROUNDTRIP_SET, &status); - - /* contains? */ - if(U_SUCCESS(status)) { - bRet = uset_containsAll(set1, set2); - uset_close(set2); - } - uset_close(set1); - } - } - return bRet; -} - -static jobject charsetForName(JNIEnv* env, jclass, jstring charsetName) { - ScopedUtfChars charsetNameChars(env, charsetName); - if (!charsetNameChars.c_str()) { - return NULL; - } - // Get ICU's canonical name for this charset. - const char* icuCanonicalName = getICUCanonicalName(charsetNameChars.c_str()); - if (icuCanonicalName == NULL) { - return NULL; - } - // Get Java's canonical name for this charset. - jstring javaCanonicalName = getJavaCanonicalName(env, icuCanonicalName); - if (env->ExceptionOccurred()) { - return NULL; - } - - // Check that this charset is supported. - // ICU doesn't offer any "isSupported", so we just open and immediately close. - // We ignore the UErrorCode because ucnv_open returning NULL is all the information we need. - UErrorCode dummy = U_ZERO_ERROR; - UConverter* conv = ucnv_open(icuCanonicalName, &dummy); - if (conv == NULL) { - return NULL; - } - ucnv_close(conv); - - // Get the aliases for this charset. - jobjectArray aliases = getAliases(env, icuCanonicalName); - if (env->ExceptionOccurred()) { - return NULL; - } - - // Construct the CharsetICU object. - jclass charsetClass = env->FindClass("com/ibm/icu4jni/charset/CharsetICU"); - if (env->ExceptionOccurred()) { - return NULL; - } - jmethodID charsetConstructor = env->GetMethodID(charsetClass, "", - "(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V"); - if (env->ExceptionOccurred()) { - return NULL; - } - return env->NewObject(charsetClass, charsetConstructor, - javaCanonicalName, env->NewStringUTF(icuCanonicalName), aliases); -} - -static JNINativeMethod gMethods[] = { - { "canEncode", "(JI)Z", (void*) canEncode }, - { "charsetForName", "(Ljava/lang/String;)Ljava/nio/charset/Charset;", (void*) charsetForName }, - { "closeConverter", "(J)V", (void*) closeConverter }, - { "contains", "(JJ)Z", (void*) contains }, - { "decode", "(J[BI[CI[IZ)I", (void*) decode }, - { "encode", "(J[CI[BI[IZ)I", (void*) encode }, - { "flushByteToChar", "(J[CI[I)I", (void*) flushByteToChar }, - { "flushCharToByte", "(J[BI[I)I", (void*) flushCharToByte }, - { "getAvailableCharsetNames", "()[Ljava/lang/String;", (void*) getAvailableCharsetNames }, - { "getAveBytesPerChar", "(J)F", (void*) getAveBytesPerChar }, - { "getAveCharsPerByte", "(J)F", (void*) getAveCharsPerByte }, - { "getMaxBytesPerChar", "(J)I", (void*) getMaxBytesPerChar }, - { "getMaxCharsPerByte", "(J)I", (void*) getMaxCharsPerByte }, - { "getMinBytesPerChar", "(J)I", (void*) getMinBytesPerChar }, - { "getSubstitutionBytes", "(J)[B", (void*) getSubstitutionBytes }, - { "openConverter", "(Ljava/lang/String;)J", (void*) openConverter }, - { "resetByteToChar", "(J)V", (void*) resetByteToChar }, - { "resetCharToByte", "(J)V", (void*) resetCharToByte }, - { "setCallbackDecode", "(JII[CI)I", (void*) setCallbackDecode }, - { "setCallbackEncode", "(JII[BI)I", (void*) setCallbackEncode }, - { "setSubstitutionBytes", "(J[BI)I", (void*) setSubstitutionBytes }, - { "setSubstitutionChars", "(J[CI)I", (void*) setSubstitutionChars }, -}; -int register_com_ibm_icu4jni_converters_NativeConverter(JNIEnv* env) { - return jniRegisterNativeMethods(env, "com/ibm/icu4jni/charset/NativeConverter", - gMethods, NELEM(gMethods)); -} diff --git a/icu/src/main/native/NativeDecimalFormat.cpp b/icu/src/main/native/NativeDecimalFormat.cpp deleted file mode 100644 index 8f39a39..0000000 --- a/icu/src/main/native/NativeDecimalFormat.cpp +++ /dev/null @@ -1,608 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#define LOG_TAG "NativeDecimalFormat" - -#include "JNIHelp.h" -#include "cutils/log.h" -#include "unicode/unum.h" -#include "unicode/numfmt.h" -#include "unicode/decimfmt.h" -#include "unicode/fmtable.h" -#include "unicode/ustring.h" -#include "digitlst.h" -#include "ErrorCode.h" -#include "ScopedJavaUnicodeString.h" -#include -#include - -static DecimalFormat* toDecimalFormat(jint addr) { - return reinterpret_cast(static_cast(addr)); -} - -static DecimalFormatSymbols* makeDecimalFormatSymbols(JNIEnv* env, - jstring currencySymbol0, jchar decimalSeparator, jchar digit, - jchar groupingSeparator0, jstring infinity0, - jstring internationalCurrencySymbol0, jchar minusSign, - jchar monetaryDecimalSeparator, jstring nan0, jchar patternSeparator, - jchar percent, jchar perMill, jchar zeroDigit) { - ScopedJavaUnicodeString currencySymbol(env, currencySymbol0); - ScopedJavaUnicodeString infinity(env, infinity0); - ScopedJavaUnicodeString internationalCurrencySymbol(env, internationalCurrencySymbol0); - ScopedJavaUnicodeString nan(env, nan0); - UnicodeString groupingSeparator(groupingSeparator0); - - DecimalFormatSymbols* result = new DecimalFormatSymbols; - result->setSymbol(DecimalFormatSymbols::kCurrencySymbol, currencySymbol.unicodeString()); - result->setSymbol(DecimalFormatSymbols::kDecimalSeparatorSymbol, UnicodeString(decimalSeparator)); - result->setSymbol(DecimalFormatSymbols::kDigitSymbol, UnicodeString(digit)); - result->setSymbol(DecimalFormatSymbols::kGroupingSeparatorSymbol, groupingSeparator); - result->setSymbol(DecimalFormatSymbols::kMonetaryGroupingSeparatorSymbol, groupingSeparator); - result->setSymbol(DecimalFormatSymbols::kInfinitySymbol, infinity.unicodeString()); - result->setSymbol(DecimalFormatSymbols::kIntlCurrencySymbol, internationalCurrencySymbol.unicodeString()); - result->setSymbol(DecimalFormatSymbols::kMinusSignSymbol, UnicodeString(minusSign)); - result->setSymbol(DecimalFormatSymbols::kMonetarySeparatorSymbol, UnicodeString(monetaryDecimalSeparator)); - result->setSymbol(DecimalFormatSymbols::kNaNSymbol, nan.unicodeString()); - result->setSymbol(DecimalFormatSymbols::kPatternSeparatorSymbol, UnicodeString(patternSeparator)); - result->setSymbol(DecimalFormatSymbols::kPercentSymbol, UnicodeString(percent)); - result->setSymbol(DecimalFormatSymbols::kPerMillSymbol, UnicodeString(perMill)); - result->setSymbol(DecimalFormatSymbols::kZeroDigitSymbol, UnicodeString(zeroDigit)); - return result; -} - -static void setDecimalFormatSymbols(JNIEnv* env, jclass, jint addr, - jstring currencySymbol, jchar decimalSeparator, jchar digit, - jchar groupingSeparator, jstring infinity, - jstring internationalCurrencySymbol, jchar minusSign, - jchar monetaryDecimalSeparator, jstring nan, jchar patternSeparator, - jchar percent, jchar perMill, jchar zeroDigit) { - DecimalFormatSymbols* symbols = makeDecimalFormatSymbols(env, - currencySymbol, decimalSeparator, digit, groupingSeparator, - infinity, internationalCurrencySymbol, minusSign, - monetaryDecimalSeparator, nan, patternSeparator, percent, perMill, - zeroDigit); - toDecimalFormat(addr)->adoptDecimalFormatSymbols(symbols); -} - -static jint openDecimalFormatImpl(JNIEnv* env, jclass clazz, jstring pattern0, - jstring currencySymbol, jchar decimalSeparator, jchar digit, - jchar groupingSeparator, jstring infinity, - jstring internationalCurrencySymbol, jchar minusSign, - jchar monetaryDecimalSeparator, jstring nan, jchar patternSeparator, - jchar percent, jchar perMill, jchar zeroDigit) { - if (pattern0 == NULL) { - jniThrowNullPointerException(env, NULL); - return 0; - } - UErrorCode status = U_ZERO_ERROR; - UParseError parseError; - ScopedJavaUnicodeString pattern(env, pattern0); - DecimalFormatSymbols* symbols = makeDecimalFormatSymbols(env, - currencySymbol, decimalSeparator, digit, groupingSeparator, - infinity, internationalCurrencySymbol, minusSign, - monetaryDecimalSeparator, nan, patternSeparator, percent, perMill, - zeroDigit); - DecimalFormat* fmt = new DecimalFormat(pattern.unicodeString(), symbols, parseError, status); - if (fmt == NULL) { - delete symbols; - } - icu4jni_error(env, status); - return static_cast(reinterpret_cast(fmt)); -} - -static void closeDecimalFormatImpl(JNIEnv* env, jclass, jint addr) { - delete toDecimalFormat(addr); -} - -static void setRoundingMode(JNIEnv* env, jclass, jint addr, jint mode, jdouble increment) { - DecimalFormat* fmt = toDecimalFormat(addr); - fmt->setRoundingMode(static_cast(mode)); - fmt->setRoundingIncrement(increment); -} - -static void setSymbol(JNIEnv* env, jclass, jint addr, jint symbol, jstring s) { - const UChar* chars = env->GetStringChars(s, NULL); - const int32_t charCount = env->GetStringLength(s); - UErrorCode status = U_ZERO_ERROR; - UNumberFormat* fmt = reinterpret_cast(static_cast(addr)); - unum_setSymbol(fmt, static_cast(symbol), chars, charCount, &status); - icu4jni_error(env, status); - env->ReleaseStringChars(s, chars); -} - -static void setAttribute(JNIEnv *env, jclass clazz, jint addr, jint symbol, - jint value) { - - UNumberFormat *fmt = (UNumberFormat *)(int)addr; - - unum_setAttribute(fmt, (UNumberFormatAttribute) symbol, value); -} - -static jint getAttribute(JNIEnv *env, jclass clazz, jint addr, jint symbol) { - - UNumberFormat *fmt = (UNumberFormat *)(int)addr; - - int res = unum_getAttribute(fmt, (UNumberFormatAttribute) symbol); - - return res; -} - -static void setTextAttribute(JNIEnv *env, jclass clazz, jint addr, jint symbol, - jstring text) { - - // the errorcode returned by unum_setTextAttribute - UErrorCode status = U_ZERO_ERROR; - - // get the pointer to the number format - UNumberFormat *fmt = (UNumberFormat *)(int)addr; - - const UChar *textChars = env->GetStringChars(text, NULL); - int textLen = env->GetStringLength(text); - - unum_setTextAttribute(fmt, (UNumberFormatTextAttribute) symbol, textChars, - textLen, &status); - - env->ReleaseStringChars(text, textChars); - - icu4jni_error(env, status); -} - -static jstring getTextAttribute(JNIEnv *env, jclass clazz, jint addr, - jint symbol) { - - uint32_t resultlength, reslenneeded; - - // the errorcode returned by unum_getTextAttribute - UErrorCode status = U_ZERO_ERROR; - - // get the pointer to the number format - UNumberFormat *fmt = (UNumberFormat *)(int)addr; - - UChar* result = NULL; - resultlength=0; - - // find out how long the result will be - reslenneeded=unum_getTextAttribute(fmt, (UNumberFormatTextAttribute) symbol, - result, resultlength, &status); - - result = NULL; - if(status==U_BUFFER_OVERFLOW_ERROR) { - status=U_ZERO_ERROR; - resultlength=reslenneeded+1; - result=(UChar*)malloc(sizeof(UChar) * resultlength); - reslenneeded=unum_getTextAttribute(fmt, - (UNumberFormatTextAttribute) symbol, result, resultlength, - &status); - } - if (icu4jni_error(env, status) != FALSE) { - return NULL; - } - - jstring res = env->NewString(result, reslenneeded); - - free(result); - - return res; -} - -static void applyPatternImpl(JNIEnv *env, jclass clazz, jint addr, jboolean localized, jstring pattern0) { - if (pattern0 == NULL) { - jniThrowNullPointerException(env, NULL); - return; - } - ScopedJavaUnicodeString pattern(env, pattern0); - DecimalFormat* fmt = toDecimalFormat(addr); - UErrorCode status = U_ZERO_ERROR; - if (localized) { - fmt->applyLocalizedPattern(pattern.unicodeString(), status); - } else { - fmt->applyPattern(pattern.unicodeString(), status); - } - icu4jni_error(env, status); -} - -static jstring toPatternImpl(JNIEnv *env, jclass, jint addr, jboolean localized) { - DecimalFormat* fmt = toDecimalFormat(addr); - UnicodeString pattern; - if (localized) { - fmt->toLocalizedPattern(pattern); - } else { - fmt->toPattern(pattern); - } - return env->NewString(pattern.getBuffer(), pattern.length()); -} - -template -static jstring format(JNIEnv *env, jint addr, jobject field, jstring fieldType, jobject attributes, T val) { - UErrorCode status = U_ZERO_ERROR; - - DecimalFormat::AttributeBuffer attrBuffer; - attrBuffer.buffer = NULL; - DecimalFormat::AttributeBuffer* attrBufferPtr = NULL; - if (attributes != NULL || (fieldType != NULL && field != NULL)) { - attrBufferPtr = &attrBuffer; - // ICU requires that this is dynamically allocated and non-zero size. - // ICU grows it in chunks of 128 bytes, so that's a reasonable initial size. - attrBuffer.bufferSize = 128; - attrBuffer.buffer = new char[attrBuffer.bufferSize]; - attrBuffer.buffer[0] = '\0'; - } - - FieldPosition fp; - fp.setField(FieldPosition::DONT_CARE); - - UnicodeString str; - DecimalFormat* fmt = toDecimalFormat(addr); - fmt->format(val, str, fp, attrBufferPtr); - - if (attrBufferPtr && strlen(attrBuffer.buffer) > 0) { - // check if we want to get all attributes - if (attributes != NULL) { - jstring attrString = env->NewStringUTF(attrBuffer.buffer + 1); // cut off the leading ';' - jclass stringBufferClass = env->FindClass("java/lang/StringBuffer"); - jmethodID appendMethodID = env->GetMethodID(stringBufferClass, "append", "(Ljava/lang/String;)Ljava/lang/StringBuffer;"); - env->CallObjectMethod(attributes, appendMethodID, attrString); - } - - // check if we want one special attribute returned in the given FieldPos - if (fieldType != NULL && field != NULL) { - const char* fieldName = env->GetStringUTFChars(fieldType, NULL); - - const char* delimiter = ";"; - char* context = NULL; - char* resattr = strtok_r(attrBuffer.buffer, delimiter, &context); - - while (resattr != NULL && strcmp(resattr, fieldName) != 0) { - resattr = strtok_r(NULL, delimiter, &context); - } - - if (resattr != NULL && strcmp(resattr, fieldName) == 0) { - resattr = strtok_r(NULL, delimiter, &context); - int begin = (int) strtol(resattr, NULL, 10); - resattr = strtok_r(NULL, delimiter, &context); - int end = (int) strtol(resattr, NULL, 10); - - jclass fieldPositionClass = env->FindClass("java/text/FieldPosition"); - jmethodID setBeginIndexMethodID = env->GetMethodID(fieldPositionClass, "setBeginIndex", "(I)V"); - jmethodID setEndIndexMethodID = env->GetMethodID(fieldPositionClass, "setEndIndex", "(I)V"); - env->CallVoidMethod(field, setBeginIndexMethodID, (jint) begin); - env->CallVoidMethod(field, setEndIndexMethodID, (jint) end); - } - env->ReleaseStringUTFChars(fieldType, fieldName); - } - } - - jstring result = env->NewString(str.getBuffer(), str.length()); - delete[] attrBuffer.buffer; - return result; -} - -static jstring formatLong(JNIEnv* env, jclass, jint addr, jlong value, - jobject field, jstring fieldType, jobject attributes) { - int64_t longValue = value; - return format(env, addr, field, fieldType, attributes, longValue); -} - -static jstring formatDouble(JNIEnv* env, jclass, jint addr, jdouble value, - jobject field, jstring fieldType, jobject attributes) { - double doubleValue = value; - return format(env, addr, field, fieldType, attributes, doubleValue); -} - -static jstring formatDigitList(JNIEnv *env, jclass clazz, jint addr, jstring value, - jobject field, jstring fieldType, jobject attributes, jint scale) { - - // const char * valueUTF = env->GetStringUTFChars(value, NULL); - // LOGI("ENTER formatDigitList: %s, scale: %d", valueUTF, scale); - // env->ReleaseStringUTFChars(value, valueUTF); - - if (scale < 0) { - icu4jni_error(env, U_ILLEGAL_ARGUMENT_ERROR); - return NULL; - } - - const char * fieldName = NULL; - if(fieldType != NULL) { - fieldName = env->GetStringUTFChars(fieldType, NULL); - } - - uint32_t reslenneeded; - - // prepare digit list - - const char *valueChars = env->GetStringUTFChars(value, NULL); - - bool isInteger = (scale == 0); - bool isPositive = (*valueChars != '-'); - - // skip the '-' if the number is negative - const char *digits = (isPositive ? valueChars : valueChars + 1); - int length = strlen(digits); - - DecimalFormat* fmt = toDecimalFormat(addr); - - // The length of our digit list buffer must be the actual string length + 3, - // because ICU will append some additional characters at the head and at the - // tail of the string, in order to keep strtod() happy: - // - // - The sign "+" or "-" is appended at the head - // - The exponent "e" and the "\0" terminator is appended at the tail - // - // In retrospect, the changes to ICU's DigitList that were necessary for - // big numbers look a bit hacky. It would make sense to rework all this - // once ICU 4.x has been integrated into Android. Ideally, big number - // support would make it into ICU itself, so we don't need our private - // fix anymore. - DigitList digitList(length + 3); - digitList.fCount = length; - strcpy(digitList.fDigits, digits); - env->ReleaseStringUTFChars(value, valueChars); - - digitList.fDecimalAt = digitList.fCount - scale; - digitList.fIsPositive = isPositive; - digitList.fRoundingMode = fmt->getRoundingMode(); - digitList.round(fmt->getMaximumFractionDigits() + digitList.fDecimalAt); - - UChar *result = NULL; - - FieldPosition fp; - fp.setField(FieldPosition::DONT_CARE); - fp.setBeginIndex(0); - fp.setEndIndex(0); - - UErrorCode status = U_ZERO_ERROR; - - DecimalFormat::AttributeBuffer *attrBuffer = NULL; - attrBuffer = (DecimalFormat::AttributeBuffer *) calloc(sizeof(DecimalFormat::AttributeBuffer), 1); - attrBuffer->bufferSize = 128; - attrBuffer->buffer = (char *) calloc(129 * sizeof(char), 1); - - UnicodeString res; - - fmt->subformat(res, fp, attrBuffer, digitList, isInteger); - - reslenneeded = res.extract(NULL, 0, status); - - if(status==U_BUFFER_OVERFLOW_ERROR) { - status=U_ZERO_ERROR; - - result = (UChar*)malloc(sizeof(UChar) * (reslenneeded + 1)); - - res.extract(result, reslenneeded + 1, status); - - if (icu4jni_error(env, status) != FALSE) { - if(fieldType != NULL) { - env->ReleaseStringUTFChars(fieldType, fieldName); - } - free(result); - free(attrBuffer->buffer); - free(attrBuffer); - return NULL; - } - - } else { - if(fieldType != NULL) { - env->ReleaseStringUTFChars(fieldType, fieldName); - } - free(attrBuffer->buffer); - free(attrBuffer); - return NULL; - } - - int attrLength = (strlen(attrBuffer->buffer) + 1 ); - - if(attrLength > 1) { - - // check if we want to get all attributes - if(attributes != NULL) { - // prepare the classes and method ids - const char * stringBufferClassName = "java/lang/StringBuffer"; - jclass stringBufferClass = env->FindClass(stringBufferClassName); - jmethodID appendMethodID = env->GetMethodID(stringBufferClass, - "append", "(Ljava/lang/String;)Ljava/lang/StringBuffer;"); - - jstring attrString = env->NewStringUTF(attrBuffer->buffer + 1); // cut off the leading ';' - env->CallObjectMethod(attributes, appendMethodID, attrString); - } - - // check if we want one special attribute returned in the given FieldPos - if(fieldName != NULL && field != NULL) { - const char *delimiter = ";"; - int begin; - int end; - char * resattr; - resattr = strtok(attrBuffer->buffer, delimiter); - - while(resattr != NULL && strcmp(resattr, fieldName) != 0) { - resattr = strtok(NULL, delimiter); - } - - if(resattr != NULL && strcmp(resattr, fieldName) == 0) { - - // prepare the classes and method ids - const char * fieldPositionClassName = - "java/text/FieldPosition"; - jclass fieldPositionClass = env->FindClass( - fieldPositionClassName); - jmethodID setBeginIndexMethodID = env->GetMethodID( - fieldPositionClass, "setBeginIndex", "(I)V"); - jmethodID setEndIndexMethodID = env->GetMethodID( - fieldPositionClass, "setEndIndex", "(I)V"); - - - resattr = strtok(NULL, delimiter); - begin = (int) strtol(resattr, NULL, 10); - resattr = strtok(NULL, delimiter); - end = (int) strtol(resattr, NULL, 10); - - env->CallVoidMethod(field, setBeginIndexMethodID, (jint) begin); - env->CallVoidMethod(field, setEndIndexMethodID, (jint) end); - } - } - } - - if(fieldType != NULL) { - env->ReleaseStringUTFChars(fieldType, fieldName); - } - - jstring resulting = env->NewString(result, reslenneeded); - - free(attrBuffer->buffer); - free(attrBuffer); - free(result); - // const char * resultUTF = env->GetStringUTFChars(resulting, NULL); - // LOGI("RETURN formatDigitList: %s", resultUTF); - // env->ReleaseStringUTFChars(resulting, resultUTF); - - return resulting; -} - -static jobject parse(JNIEnv *env, jclass clazz, jint addr, jstring text, - jobject position) { - // TODO: cache these? - jclass parsePositionClass = env->FindClass("java/text/ParsePosition"); - jclass longClass = env->FindClass("java/lang/Long"); - jclass doubleClass = env->FindClass("java/lang/Double"); - jclass bigDecimalClass = env->FindClass("java/math/BigDecimal"); - jclass bigIntegerClass = env->FindClass("java/math/BigInteger"); - - jmethodID getIndexMethodID = env->GetMethodID(parsePositionClass, - "getIndex", "()I"); - jmethodID setIndexMethodID = env->GetMethodID(parsePositionClass, - "setIndex", "(I)V"); - jmethodID setErrorIndexMethodID = env->GetMethodID(parsePositionClass, - "setErrorIndex", "(I)V"); - - jmethodID longInitMethodID = env->GetMethodID(longClass, "", "(J)V"); - jmethodID dblInitMethodID = env->GetMethodID(doubleClass, "", "(D)V"); - jmethodID bigDecimalInitMethodID = env->GetMethodID(bigDecimalClass, "", "(Ljava/math/BigInteger;I)V"); - jmethodID bigIntegerInitMethodID = env->GetMethodID(bigIntegerClass, "", "(Ljava/lang/String;)V"); - jmethodID doubleValueMethodID = env->GetMethodID(bigDecimalClass, "doubleValue", "()D"); - - // make sure the ParsePosition is valid. Actually icu4c would parse a number - // correctly even if the parsePosition is set to -1, but since the RI fails - // for that case we have to fail too - int parsePos = env->CallIntMethod(position, getIndexMethodID, NULL); - const int strlength = env->GetStringLength(text); - if(parsePos < 0 || parsePos > strlength) { - return NULL; - } - - ParsePosition pp; - pp.setIndex(parsePos); - - DigitList digits; - - UNumberFormat *fmt = (UNumberFormat *)(int)addr; - Formattable res; - bool resultAssigned; - jchar *str = (UChar *)env->GetStringChars(text, NULL); - const UnicodeString src((UChar*)str, strlength, strlength); - ((const DecimalFormat*)fmt)->parse(src, resultAssigned, res, pp, FALSE, digits); - env->ReleaseStringChars(text, str); - - if(pp.getErrorIndex() == -1) { - parsePos = pp.getIndex(); - } else { - env->CallVoidMethod(position, setErrorIndexMethodID, - (jint) pp.getErrorIndex()); - return NULL; - } - - Formattable::Type numType = res.getType(); - UErrorCode fmtStatus; - - double resultDouble; - long resultLong; - int64_t resultInt64; - jstring resultStr; - jobject resultObject1, resultObject2; - - if (resultAssigned) - { - switch(numType) { - case Formattable::kDouble: - resultDouble = res.getDouble(); - env->CallVoidMethod(position, setIndexMethodID, (jint) parsePos); - return env->NewObject(doubleClass, dblInitMethodID, - (jdouble) resultDouble); - case Formattable::kLong: - resultLong = res.getLong(); - env->CallVoidMethod(position, setIndexMethodID, (jint) parsePos); - return env->NewObject(longClass, longInitMethodID, - (jlong) resultLong); - case Formattable::kInt64: - resultInt64 = res.getInt64(); - env->CallVoidMethod(position, setIndexMethodID, (jint) parsePos); - return env->NewObject(longClass, longInitMethodID, - (jlong) resultInt64); - default: - return NULL; - } - } - else - { - int scale = digits.fCount - digits.fDecimalAt; - // ATTENTION: Abuse of Implementation Knowlegde! - digits.fDigits[digits.fCount] = 0; - if (digits.fIsPositive) { - resultStr = env->NewStringUTF(digits.fDigits); - } else { - if (digits.fCount == 0) { - env->CallVoidMethod(position, setIndexMethodID, (jint) parsePos); - return env->NewObject(doubleClass, dblInitMethodID, (jdouble)-0); - } else { - // ATTENTION: Abuse of Implementation Knowlegde! - *(digits.fDigits - 1) = '-'; - resultStr = env->NewStringUTF(digits.fDigits - 1); - } - } - - env->CallVoidMethod(position, setIndexMethodID, (jint) parsePos); - - resultObject1 = env->NewObject(bigIntegerClass, bigIntegerInitMethodID, resultStr); - resultObject2 = env->NewObject(bigDecimalClass, bigDecimalInitMethodID, resultObject1, scale); - return resultObject2; - } -} - -static jint cloneDecimalFormatImpl(JNIEnv *env, jclass, jint addr) { - DecimalFormat* fmt = toDecimalFormat(addr); - return static_cast(reinterpret_cast(fmt->clone())); -} - -static JNINativeMethod gMethods[] = { - {"applyPatternImpl", "(IZLjava/lang/String;)V", (void*) applyPatternImpl}, - {"cloneDecimalFormatImpl", "(I)I", (void*) cloneDecimalFormatImpl}, - {"closeDecimalFormatImpl", "(I)V", (void*) closeDecimalFormatImpl}, - {"format", "(IDLjava/text/FieldPosition;Ljava/lang/String;Ljava/lang/StringBuffer;)Ljava/lang/String;", (void*) formatDouble}, - {"format", "(IJLjava/text/FieldPosition;Ljava/lang/String;Ljava/lang/StringBuffer;)Ljava/lang/String;", (void*) formatLong}, - {"format", "(ILjava/lang/String;Ljava/text/FieldPosition;Ljava/lang/String;Ljava/lang/StringBuffer;I)Ljava/lang/String;", (void*) formatDigitList}, - {"getAttribute", "(II)I", (void*) getAttribute}, - {"getTextAttribute", "(II)Ljava/lang/String;", (void*) getTextAttribute}, - {"openDecimalFormatImpl", "(Ljava/lang/String;Ljava/lang/String;CCCLjava/lang/String;Ljava/lang/String;CCLjava/lang/String;CCCC)I", (void*) openDecimalFormatImpl}, - {"parse", "(ILjava/lang/String;Ljava/text/ParsePosition;)Ljava/lang/Number;", (void*) parse}, - {"setAttribute", "(III)V", (void*) setAttribute}, - {"setDecimalFormatSymbols", "(ILjava/lang/String;CCCLjava/lang/String;Ljava/lang/String;CCLjava/lang/String;CCCC)V", (void*) setDecimalFormatSymbols}, - {"setSymbol", "(IILjava/lang/String;)V", (void*) setSymbol}, - {"setRoundingMode", "(IID)V", (void*) setRoundingMode}, - {"setTextAttribute", "(IILjava/lang/String;)V", (void*) setTextAttribute}, - {"toPatternImpl", "(IZ)Ljava/lang/String;", (void*) toPatternImpl}, -}; -int register_com_ibm_icu4jni_text_NativeDecimalFormat(JNIEnv* env) { - return jniRegisterNativeMethods(env, "com/ibm/icu4jni/text/NativeDecimalFormat", gMethods, - NELEM(gMethods)); -} diff --git a/icu/src/main/native/NativeIDN.cpp b/icu/src/main/native/NativeIDN.cpp deleted file mode 100644 index e8052fc..0000000 --- a/icu/src/main/native/NativeIDN.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#define LOG_TAG "NativeIDN" - -#include "ErrorCode.h" -#include "JNIHelp.h" -#include "ScopedJavaUnicodeString.h" -#include "unicode/uidna.h" - -static bool isLabelSeparator(const UChar ch) { - switch (ch) { - case 0x3002: // ideographic full stop - case 0xff0e: // fullwidth full stop - case 0xff61: // halfwidth ideographic full stop - return true; - default: - return false; - } -} - -static jstring convertImpl(JNIEnv* env, jclass, jstring s, jint flags, jboolean toAscii) { - ScopedJavaUnicodeString sus(env, s); - const UChar* src = sus.unicodeString().getBuffer(); - const size_t srcLength = sus.unicodeString().length(); - UChar dst[256]; - UErrorCode status = U_ZERO_ERROR; - size_t resultLength = toAscii - ? uidna_IDNToASCII(src, srcLength, &dst[0], sizeof(dst), flags, NULL, &status) - : uidna_IDNToUnicode(src, srcLength, &dst[0], sizeof(dst), flags, NULL, &status); - if (U_FAILURE(status)) { - jniThrowException(env, "java/lang/IllegalArgumentException", u_errorName(status)); - return NULL; - } - if (!toAscii) { - // ICU only translates separators to ASCII for toASCII. - // Java expects the translation for toUnicode too. - // We may as well do this here, while the string is still mutable. - for (size_t i = 0; i < resultLength; ++i) { - if (isLabelSeparator(dst[i])) { - dst[i] = '.'; - } - } - } - return env->NewString(&dst[0], resultLength); -} - -static JNINativeMethod gMethods[] = { - {"convertImpl", "(Ljava/lang/String;IZ)Ljava/lang/String;", (void*) convertImpl}, -}; -int register_com_ibm_icu4jni_text_NativeIDN(JNIEnv* env) { - return jniRegisterNativeMethods(env, "com/ibm/icu4jni/text/NativeIDN", gMethods, NELEM(gMethods)); -} diff --git a/icu/src/main/native/NativeNormalizer.cpp b/icu/src/main/native/NativeNormalizer.cpp deleted file mode 100644 index 257cf9b..0000000 --- a/icu/src/main/native/NativeNormalizer.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#define LOG_TAG "NativeNormalizer" - -#include "ErrorCode.h" -#include "JNIHelp.h" -#include "ScopedJavaUnicodeString.h" -#include "unicode/normlzr.h" - -static jstring normalizeImpl(JNIEnv* env, jclass, jstring s, jint intMode) { - ScopedJavaUnicodeString src(env, s); - UNormalizationMode mode = static_cast(intMode); - UErrorCode errorCode = U_ZERO_ERROR; - UnicodeString dst; - Normalizer::normalize(src.unicodeString(), mode, 0, dst, errorCode); - icu4jni_error(env, errorCode); - return dst.isBogus() ? NULL : env->NewString(dst.getBuffer(), dst.length()); -} - -static jboolean isNormalizedImpl(JNIEnv* env, jclass, jstring s, jint intMode) { - ScopedJavaUnicodeString src(env, s); - UNormalizationMode mode = static_cast(intMode); - UErrorCode errorCode = U_ZERO_ERROR; - UBool result = Normalizer::isNormalized(src.unicodeString(), mode, errorCode); - icu4jni_error(env, errorCode); - return result; -} - -static JNINativeMethod gMethods[] = { - {"normalizeImpl", "(Ljava/lang/String;I)Ljava/lang/String;", (void*) normalizeImpl}, - {"isNormalizedImpl", "(Ljava/lang/String;I)Z", (void*) isNormalizedImpl}, -}; -int register_com_ibm_icu4jni_text_NativeNormalizer(JNIEnv* env) { - return jniRegisterNativeMethods(env, "com/ibm/icu4jni/text/NativeNormalizer", - gMethods, NELEM(gMethods)); -} diff --git a/icu/src/main/native/NativeRegEx.cpp b/icu/src/main/native/NativeRegEx.cpp deleted file mode 100644 index 511f1e4..0000000 --- a/icu/src/main/native/NativeRegEx.cpp +++ /dev/null @@ -1,356 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#define LOG_TAG "NativeRegEx" - -#include -#include -#include - -#include "unicode/uregex.h" -#include "unicode/utypes.h" -#include "unicode/parseerr.h" - -#include -#include - -static jchar EMPTY_STRING = 0; - -/** - * A data structure that ties together an ICU regular expression and the - * character data it refers to (but does not have a copy of), so we can - * manage memory properly. - */ -struct RegExData { - // A pointer to the ICU regular expression - URegularExpression* regex; - // A pointer to (a copy of) the input text that *we* manage - jchar* text; -}; - -static void throwPatternSyntaxException(JNIEnv* env, UErrorCode status, - jstring pattern, UParseError error) -{ - jclass clazz = env->FindClass("java/util/regex/PatternSyntaxException"); - jmethodID method = env->GetMethodID(clazz, "", - "(Ljava/lang/String;Ljava/lang/String;I)V"); - - jstring message = env->NewStringUTF(u_errorName(status)); - jthrowable except = (jthrowable)(env->NewObject(clazz, method, message, - pattern, error.offset)); - env->Throw(except); -} - -static void throwRuntimeException(JNIEnv* env, UErrorCode status) { - jniThrowRuntimeException(env, u_errorName(status)); -} - -static void _close(JNIEnv* env, jclass clazz, RegExData* data) -{ - if (data->regex != NULL) { - uregex_close(data->regex); - } - - if (data->text != &EMPTY_STRING) { - delete[] data->text; - } - - free(data); -} - -static RegExData* open(JNIEnv* env, jclass clazz, jstring pattern, jint flags) -{ - flags = flags | UREGEX_ERROR_ON_UNKNOWN_ESCAPES; - - RegExData* data = (RegExData*)calloc(sizeof(RegExData), 1); - - UErrorCode status = U_ZERO_ERROR; - UParseError error; - error.offset = -1; - - jchar const * patternRaw; - int patternLen = env->GetStringLength(pattern); - if (patternLen == 0) { - data->regex = uregex_open(&EMPTY_STRING, -1, flags, &error, &status); - } else { - jchar const * patternRaw = env->GetStringChars(pattern, NULL); - data->regex = uregex_open(patternRaw, patternLen, flags, &error, - &status); - env->ReleaseStringChars(pattern, patternRaw); - } - - if (!U_SUCCESS(status)) { - _close(env, clazz, data); - throwPatternSyntaxException(env, status, pattern, error); - data = NULL; - } - - return data; -} - -static RegExData* _clone(JNIEnv* env, jclass clazz, RegExData* data) -{ - UErrorCode status = U_ZERO_ERROR; - - URegularExpression* clonedRegex = uregex_clone(data->regex, &status); - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - } - - RegExData* result = (RegExData*)calloc(sizeof(RegExData), 1); - result->regex = clonedRegex; - - return result; -} - -static void setText(JNIEnv* env, jclass clazz, RegExData* data, jstring text) -{ - UErrorCode status = U_ZERO_ERROR; - - uregex_setText(data->regex, &EMPTY_STRING, 0, &status); - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - return; - } - - if (data->text != &EMPTY_STRING) { - delete[] data->text; - data->text = NULL; - } - - int textLen = env->GetStringLength(text); - if (textLen == 0) { - data->text = &EMPTY_STRING; - } else { - data->text = new jchar[textLen + 1]; - env->GetStringRegion(text, 0, textLen, data->text); - data->text[textLen] = 0; - } - - uregex_setText(data->regex, data->text, textLen, &status); - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - } -} - -static jboolean matches(JNIEnv* env, jclass clazz, RegExData* data, - jint startIndex) -{ - UErrorCode status = U_ZERO_ERROR; - - jboolean result = uregex_matches(data->regex, startIndex, &status); - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - } - - return result; -} - -static jboolean lookingAt(JNIEnv* env, jclass clazz, RegExData* data, - jint startIndex) -{ - UErrorCode status = U_ZERO_ERROR; - - jboolean result = uregex_lookingAt(data->regex, startIndex, &status); - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - } - - return result; -} - -static jboolean find(JNIEnv* env, jclass clazz, RegExData* data, - jint startIndex) -{ - UErrorCode status = U_ZERO_ERROR; - - jboolean result = uregex_find(data->regex, startIndex, &status); - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - } - - return result; -} - -static jboolean findNext(JNIEnv* env, jclass clazz, RegExData* data) -{ - UErrorCode status = U_ZERO_ERROR; - - jboolean result = uregex_findNext(data->regex, &status); - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - } - - return result; -} - -static jint groupCount(JNIEnv* env, jclass clazz, RegExData* data) -{ - UErrorCode status = U_ZERO_ERROR; - - jint result = uregex_groupCount(data->regex, &status); - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - } - - return result; -} - -static void startEnd(JNIEnv* env, jclass clazz, RegExData* data, - jintArray offsets) -{ - UErrorCode status = U_ZERO_ERROR; - - jint * offsetsRaw = env->GetIntArrayElements(offsets, NULL); - - int groupCount = uregex_groupCount(data->regex, &status); - for (int i = 0; i <= groupCount && U_SUCCESS(status); i++) { - offsetsRaw[2 * i + 0] = uregex_start(data->regex, i, &status); - offsetsRaw[2 * i + 1] = uregex_end(data->regex, i, &status); - } - - env->ReleaseIntArrayElements(offsets, offsetsRaw, 0); - - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - } -} - -static void setRegion(JNIEnv* env, jclass clazz, RegExData* data, jint start, - jint end) -{ - UErrorCode status = U_ZERO_ERROR; - uregex_setRegion(data->regex, start, end, &status); - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - } -} - -static jint regionStart(JNIEnv* env, jclass clazz, RegExData* data) -{ - UErrorCode status = U_ZERO_ERROR; - int result = uregex_regionStart(data->regex, &status); - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - } - return result; -} - -static jint regionEnd(JNIEnv* env, jclass clazz, RegExData* data) -{ - UErrorCode status = U_ZERO_ERROR; - int result = uregex_regionEnd(data->regex, &status); - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - } - return result; -} - -static void useTransparentBounds(JNIEnv* env, jclass clazz, RegExData* data, - jboolean value) -{ - UErrorCode status = U_ZERO_ERROR; - uregex_useTransparentBounds(data->regex, value, &status); - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - } -} - -static jboolean hasTransparentBounds(JNIEnv* env, jclass clazz, RegExData* data) -{ - UErrorCode status = U_ZERO_ERROR; - jboolean result = uregex_hasTransparentBounds(data->regex, &status); - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - } - return result; -} - -static void useAnchoringBounds(JNIEnv* env, jclass clazz, RegExData* data, - jboolean value) -{ - UErrorCode status = U_ZERO_ERROR; - uregex_useAnchoringBounds(data->regex, value, &status); - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - } -} - -static jboolean hasAnchoringBounds(JNIEnv* env, jclass clazz, RegExData* data) -{ - UErrorCode status = U_ZERO_ERROR; - jboolean result = uregex_hasAnchoringBounds(data->regex, &status); - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - } - return result; -} - -static jboolean hitEnd(JNIEnv* env, jclass clazz, RegExData* data) -{ - UErrorCode status = U_ZERO_ERROR; - jboolean result = uregex_hitEnd(data->regex, &status); - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - } - return result; -} - -static jboolean requireEnd(JNIEnv* env, jclass clazz, RegExData* data) -{ - UErrorCode status = U_ZERO_ERROR; - jboolean result = uregex_requireEnd(data->regex, &status); - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - } - return result; -} - -static void reset(JNIEnv* env, jclass clazz, RegExData* data, jint position) -{ - UErrorCode status = U_ZERO_ERROR; - uregex_reset(data->regex, position, &status); - if (!U_SUCCESS(status)) { - throwRuntimeException(env, status); - } -} - -static JNINativeMethod gMethods[] = { - { "open", "(Ljava/lang/String;I)I", (void*)open }, - { "clone", "(I)I", (void*)_clone }, - { "close", "(I)V", (void*)_close }, - { "setText", "(ILjava/lang/String;)V", (void*)setText }, - { "matches", "(II)Z", (void*)matches }, - { "lookingAt", "(II)Z", (void*)lookingAt }, - { "find", "(II)Z", (void*)find }, - { "findNext", "(I)Z", (void*)findNext }, - { "groupCount", "(I)I", (void*)groupCount }, - { "startEnd", "(I[I)V", (void*)startEnd }, - { "setRegion", "(III)V", (void*)setRegion }, - { "regionStart", "(I)I", (void*)regionStart }, - { "regionEnd", "(I)I", (void*)regionEnd }, - { "useTransparentBounds", "(IZ)V", (void*)useTransparentBounds }, - { "hasTransparentBounds", "(I)Z", (void*)hasTransparentBounds }, - { "useAnchoringBounds", "(IZ)V", (void*)useAnchoringBounds }, - { "hasAnchoringBounds", "(I)Z", (void*)hasAnchoringBounds }, - { "hitEnd", "(I)Z", (void*)hitEnd }, - { "requireEnd", "(I)Z", (void*)requireEnd }, - { "reset", "(II)V", (void*)reset }, -}; -int register_com_ibm_icu4jni_regex_NativeRegEx(JNIEnv* env) { - return jniRegisterNativeMethods(env, "com/ibm/icu4jni/regex/NativeRegEx", - gMethods, NELEM(gMethods)); -} diff --git a/icu/src/main/native/ScopedJavaUnicodeString.h b/icu/src/main/native/ScopedJavaUnicodeString.h deleted file mode 100644 index b108a6b..0000000 --- a/icu/src/main/native/ScopedJavaUnicodeString.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef SCOPED_JAVA_UNICODE_STRING_H_included -#define SCOPED_JAVA_UNICODE_STRING_H_included - -#include "JNIHelp.h" -#include "unicode/unistr.h" - -// A smart pointer that provides access to an ICU UnicodeString given a JNI -// jstring. We give ICU a direct pointer to the characters on the Java heap. -// It's clever enough to copy-on-write if necessary. -class ScopedJavaUnicodeString { -public: - ScopedJavaUnicodeString(JNIEnv* env, jstring s) : mEnv(env), mString(s) { - mChars = env->GetStringChars(mString, NULL); - const int32_t charCount = env->GetStringLength(mString); - mUnicodeString.setTo(false, mChars, charCount); - } - - ~ScopedJavaUnicodeString() { - mEnv->ReleaseStringChars(mString, mChars); - } - - const UnicodeString& unicodeString() const { - return mUnicodeString; - } - - UnicodeString& unicodeString() { - return mUnicodeString; - } - -private: - JNIEnv* mEnv; - jstring mString; - const UChar* mChars; - UnicodeString mUnicodeString; - - // Disallow copy and assignment. - ScopedJavaUnicodeString(const ScopedJavaUnicodeString&); - void operator=(const ScopedJavaUnicodeString&); -}; - -#endif // SCOPED_JAVA_UNICODE_STRING_H_included diff --git a/icu/src/main/native/UCharacter.cpp b/icu/src/main/native/UCharacter.cpp deleted file mode 100644 index abad16a..0000000 --- a/icu/src/main/native/UCharacter.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (C) 2006 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#define LOG_TAG "UCharacter" - -#include "JNIHelp.h" -#include "ScopedJavaUnicodeString.h" -#include "ScopedUtfChars.h" -#include "unicode/locid.h" -#include "unicode/uchar.h" -#include -#include - -static jint digitImpl(JNIEnv*, jclass, jint codePoint, jint radix) { - return u_digit(codePoint, radix); -} - -static jint getTypeImpl(JNIEnv*, jclass, jint codePoint) { - return u_charType(codePoint); -} - -static jbyte getDirectionalityImpl(JNIEnv*, jclass, jint codePoint) { - return u_charDirection(codePoint); -} - -static jboolean isMirroredImpl(JNIEnv*, jclass, jint codePoint) { - return u_isMirrored(codePoint); -} - -static jint getNumericValueImpl(JNIEnv*, jclass, jint codePoint){ - // The letters A-Z in their uppercase ('\u0041' through '\u005A'), - // lowercase ('\u0061' through '\u007A'), - // and full width variant ('\uFF21' through '\uFF3A' - // and '\uFF41' through '\uFF5A') forms - // have numeric values from 10 through 35. This is independent of the - // Unicode specification, which does not assign numeric values to these - // char values. - if (codePoint >= 0x41 && codePoint <= 0x5A) { - return codePoint - 0x37; - } - if (codePoint >= 0x61 && codePoint <= 0x7A) { - return codePoint - 0x57; - } - if (codePoint >= 0xFF21 && codePoint <= 0xFF3A) { - return codePoint - 0xFF17; - } - if (codePoint >= 0xFF41 && codePoint <= 0xFF5A) { - return codePoint - 0xFF37; - } - - double result = u_getNumericValue(codePoint); - - if (result == U_NO_NUMERIC_VALUE) { - return -1; - } else if (result < 0 || floor(result + 0.5) != result) { - return -2; - } - - return result; -} - -static jboolean isDefinedImpl(JNIEnv*, jclass, jint codePoint) { - return u_isdefined(codePoint); -} - -static jboolean isDigitImpl(JNIEnv*, jclass, jint codePoint) { - return u_isdigit(codePoint); -} - -static jboolean isIdentifierIgnorableImpl(JNIEnv*, jclass, jint codePoint) { - // Java also returns TRUE for U+0085 Next Line (it omits U+0085 from whitespace ISO controls) - if(codePoint == 0x0085) { - return JNI_TRUE; - } - return u_isIDIgnorable(codePoint); -} - -static jboolean isLetterImpl(JNIEnv*, jclass, jint codePoint) { - return u_isalpha(codePoint); -} - -static jboolean isLetterOrDigitImpl(JNIEnv*, jclass, jint codePoint) { - return u_isalnum(codePoint); -} - -static jboolean isSpaceCharImpl(JNIEnv*, jclass, jint codePoint) { - return u_isJavaSpaceChar(codePoint); -} - -static jboolean isTitleCaseImpl(JNIEnv*, jclass, jint codePoint) { - return u_istitle(codePoint); -} - -static jboolean isUnicodeIdentifierPartImpl(JNIEnv*, jclass, jint codePoint) { - return u_isIDPart(codePoint); -} - -static jboolean isUnicodeIdentifierStartImpl(JNIEnv*, jclass, jint codePoint) { - return u_isIDStart(codePoint); -} - -static jboolean isWhitespaceImpl(JNIEnv*, jclass, jint codePoint) { - // Java omits U+0085 - if(codePoint == 0x0085) { - return JNI_FALSE; - } - return u_isWhitespace(codePoint); -} - -static jint toLowerCaseImpl(JNIEnv*, jclass, jint codePoint) { - return u_tolower(codePoint); -} - -static jint toTitleCaseImpl(JNIEnv*, jclass, jint codePoint) { - return u_totitle(codePoint); -} - -static jint toUpperCaseImpl(JNIEnv*, jclass, jint codePoint) { - return u_toupper(codePoint); -} - -static jstring toLowerCaseStringImpl(JNIEnv* env, jclass, jstring javaString, jstring localeName) { - ScopedJavaUnicodeString scopedString(env, javaString); - UnicodeString& s(scopedString.unicodeString()); - UnicodeString original(s); - s.toLower(Locale::createFromName(ScopedUtfChars(env, localeName).c_str())); - return s == original ? javaString : env->NewString(s.getBuffer(), s.length()); -} - -static jstring toUpperCaseStringImpl(JNIEnv* env, jclass, jstring javaString, jstring localeName) { - ScopedJavaUnicodeString scopedString(env, javaString); - UnicodeString& s(scopedString.unicodeString()); - UnicodeString original(s); - s.toUpper(Locale::createFromName(ScopedUtfChars(env, localeName).c_str())); - return s == original ? javaString : env->NewString(s.getBuffer(), s.length()); -} - -static jboolean isUpperCaseImpl(JNIEnv*, jclass, jint codePoint) { - return u_isupper(codePoint); -} - -static jboolean isLowerCaseImpl(JNIEnv*, jclass, jint codePoint) { - return u_islower(codePoint); -} - -static int forNameImpl(JNIEnv* env, jclass, jstring blockName) { - if (blockName == NULL) { - jniThrowNullPointerException(env, NULL); - return -1; - } - const char* bName = env->GetStringUTFChars(blockName, NULL); - int result = u_getPropertyValueEnum(UCHAR_BLOCK, bName); - env->ReleaseStringUTFChars(blockName, bName); - return result; -} - -static int ofImpl(JNIEnv*, jclass, jint codePoint) { - return ublock_getCode(codePoint); -} - -static JNINativeMethod gMethods[] = { - { "digit", "(II)I", (void*) digitImpl }, - { "forName", "(Ljava/lang/String;)I", (void*) forNameImpl }, - { "getDirectionality", "(I)B", (void*) getDirectionalityImpl }, - { "getNumericValue", "(I)I", (void*) getNumericValueImpl }, - { "getType", "(I)I", (void*) getTypeImpl }, - { "isDefined", "(I)Z", (void*) isDefinedImpl }, - { "isDigit", "(I)Z", (void*) isDigitImpl }, - { "isIdentifierIgnorable", "(I)Z", (void*) isIdentifierIgnorableImpl }, - { "isLetter", "(I)Z", (void*) isLetterImpl }, - { "isLetterOrDigit", "(I)Z", (void*) isLetterOrDigitImpl }, - { "isLowerCase", "(I)Z", (void*) isLowerCaseImpl }, - { "isMirrored", "(I)Z", (void*) isMirroredImpl }, - { "isSpaceChar", "(I)Z", (void*) isSpaceCharImpl }, - { "isTitleCase", "(I)Z", (void*) isTitleCaseImpl }, - { "isUnicodeIdentifierPart", "(I)Z", (void*) isUnicodeIdentifierPartImpl }, - { "isUnicodeIdentifierStart", "(I)Z", (void*) isUnicodeIdentifierStartImpl }, - { "isUpperCase", "(I)Z", (void*) isUpperCaseImpl }, - { "isWhitespace", "(I)Z", (void*) isWhitespaceImpl }, - { "of", "(I)I", (void*) ofImpl }, - { "toLowerCase", "(I)I", (void*) toLowerCaseImpl }, - { "toTitleCase", "(I)I", (void*) toTitleCaseImpl }, - { "toUpperCase", "(I)I", (void*) toUpperCaseImpl }, - { "toLowerCase", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", (void*) toLowerCaseStringImpl }, - { "toUpperCase", "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;", (void*) toUpperCaseStringImpl }, -}; -int register_com_ibm_icu4jni_lang_UCharacter(JNIEnv* env) { - return jniRegisterNativeMethods(env, "com/ibm/icu4jni/lang/UCharacter", - gMethods, NELEM(gMethods)); -} diff --git a/icu/src/main/native/sub.mk b/icu/src/main/native/sub.mk deleted file mode 100644 index 599c102..0000000 --- a/icu/src/main/native/sub.mk +++ /dev/null @@ -1,31 +0,0 @@ -# This file is included by the top-level libcore Android.mk. -# It's not a normal makefile, so we don't include CLEAR_VARS -# or BUILD_*_LIBRARY. - -LOCAL_SRC_FILES := \ - BidiWrapper.cpp \ - ErrorCode.cpp \ - ICU.cpp \ - NativeBreakIterator.cpp \ - NativeCollation.cpp \ - NativeConverter.cpp \ - NativeDecimalFormat.cpp \ - NativeIDN.cpp \ - NativeNormalizer.cpp \ - NativeRegEx.cpp \ - UCharacter.cpp - -LOCAL_C_INCLUDES += \ - external/icu4c/common \ - external/icu4c/i18n - -# Any shared/static libs that are listed here must also -# be listed in libs/nativehelper/Android.mk. -# TODO: fix this requirement - -LOCAL_SHARED_LIBRARIES += \ - libicudata \ - libicuuc \ - libicui18n - -LOCAL_STATIC_LIBRARIES += diff --git a/icu/unicode-license.txt b/icu/unicode-license.txt deleted file mode 100644 index 8a3350b..0000000 --- a/icu/unicode-license.txt +++ /dev/null @@ -1,48 +0,0 @@ -UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE - - Unicode Data Files include all data files under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, and -http://www.unicode.org/cldr/data/ . Unicode Software includes any source code -published in the Unicode Standard or under the directories -http://www.unicode.org/Public/, http://www.unicode.org/reports/, and -http://www.unicode.org/cldr/data/. - - NOTICE TO USER: Carefully read the following legal agreement. BY -DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES -("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND -AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU -DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES -OR SOFTWARE. - - COPYRIGHT AND PERMISSION NOTICE - - Copyright © 1991-2006 Unicode, Inc. All rights reserved. Distributed under -the Terms of Use in http://www.unicode.org/copyright.html. - - Permission is hereby granted, free of charge, to any person obtaining a copy -of the Unicode data files and any associated documentation (the "Data Files") or -Unicode software and any associated documentation (the "Software") to deal in -the Data Files or Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, and/or sell copies of -the Data Files or Software, and to permit persons to whom the Data Files or -Software are furnished to do so, provided that (a) the above copyright notice(s) -and this permission notice appear with all copies of the Data Files or Software, -(b) both the above copyright notice(s) and this permission notice appear in -associated documentation, and (c) there is clear notice in each modified Data -File or in the Software as well as in the documentation associated with the Data -File(s) or Software that the data or software has been modified. - - THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY -KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD -PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL -DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, -WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING -OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR -SOFTWARE. - - Except as contained in this notice, the name of a copyright holder shall not -be used in advertising or otherwise to promote the sale, use or other dealings -in these Data Files or Software without prior written authorization of the -copyright holder. diff --git a/luni-kernel/MODULE_LICENSE_APACHE2 b/luni-kernel/MODULE_LICENSE_APACHE2 deleted file mode 100644 index e69de29..0000000 diff --git a/luni-kernel/src/main/java/java/lang/Class.java b/luni-kernel/src/main/java/java/lang/Class.java deleted file mode 100644 index 35e47bc..0000000 --- a/luni-kernel/src/main/java/java/lang/Class.java +++ /dev/null @@ -1,1579 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * Copyright (C) 2006-2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package java.lang; - -import dalvik.system.VMStack; - -import org.apache.harmony.kernel.vm.StringUtils; -import org.apache.harmony.luni.lang.reflect.GenericSignatureParser; -import org.apache.harmony.luni.lang.reflect.Types; - -import java.io.InputStream; -import java.io.Serializable; -import java.lang.annotation.Annotation; -import java.lang.annotation.Inherited; -import java.lang.ref.SoftReference; -import java.lang.reflect.AccessibleObject; -import java.lang.reflect.AnnotatedElement; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.GenericDeclaration; -import java.lang.reflect.Member; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.lang.reflect.Type; -import java.lang.reflect.TypeVariable; -import java.util.Collection; -import java.util.HashMap; -import java.net.URL; -import java.security.ProtectionDomain; - -import static java.lang.ClassCache.REFLECT; -import static java.lang.ClassCache.compareClassLists; -import static java.lang.ClassCache.findMethodByName; -import static java.lang.ClassCache.findFieldByName; - -/** - * The in-memory representation of a Java class. This representation serves as - * the starting point for querying class-related information, a process usually - * called "reflection". There are basically three types of {@code Class} - * instances: those representing real classes and interfaces, those representing - * primitive types, and those representing array classes. - * - *

Class instances representing object types (classes or interfaces)

- *

- * These represent an ordinary class or interface as found in the class - * hierarchy. The name associated with these {@code Class} instances is simply - * the fully qualified class name of the class or interface that it represents. - * In addition to this human-readable name, each class is also associated by a - * so-called signature, which is the letter "L", followed by the - * class name and a semicolon (";"). The signature is what the runtime system - * uses internally for identifying the class (for example in a DEX file). - *

- *

Classes representing primitive types

- *

- * These represent the standard Java primitive types and hence share their - * names (for example "int" for the {@code int} primitive type). Although it is - * not possible to create new instances based on these {@code Class} instances, - * they are still useful for providing reflection information, and as the - * component type of array classes. There is one {@code Class} instance for each - * primitive type, and their signatures are: - *

- *
    - *
  • {@code B} representing the {@code byte} primitive type
  • - *
  • {@code S} representing the {@code short} primitive type
  • - *
  • {@code I} representing the {@code int} primitive type
  • - *
  • {@code J} representing the {@code long} primitive type
  • - *
  • {@code F} representing the {@code float} primitive type
  • - *
  • {@code D} representing the {@code double} primitive type
  • - *
  • {@code C} representing the {@code char} primitive type
  • - *
  • {@code Z} representing the {@code boolean} primitive type
  • - *
  • {@code V} representing void function return values
  • - *
- *

- *

Classes representing array classes

- *

- * These represent the classes of Java arrays. There is one such {@code Class} - * instance per combination of array leaf component type and arity (number of - * dimensions). In this case, the name associated with the {@code Class} - * consists of one or more left square brackets (one per dimension in the array) - * followed by the signature of the class representing the leaf component type, - * which can be either an object type or a primitive type. The signature of a - * {@code Class} representing an array type is the same as its name. Examples - * of array class signatures are: - *

- *
    - *
  • {@code [I} representing the {@code int[]} type
  • - *
  • {@code [Ljava/lang/String;} representing the {@code String[]} type
  • - *
  • {@code [[[C} representing the {@code char[][][]} type (three dimensions!)
  • - *
- */ -public final class Class implements Serializable, AnnotatedElement, GenericDeclaration, Type { - - private static final long serialVersionUID = 3206093459760846163L; - - /** - * This field is initialized by dalvikvm when the class is loaded. - */ - private transient ProtectionDomain pd; - - /** - * null-ok; cache of reflective information, wrapped in a soft - * reference - */ - private transient volatile SoftReference> cacheRef; - - private Class() { - // Prevent this class to be instantiated, instance - // should be created by JVM only - } - - /** - * Get the Signature attribute for this class. Returns null if not found. - */ - private String getSignatureAttribute() { - Object[] annotation = getSignatureAnnotation(); - - if (annotation == null) { - return null; - } - - return StringUtils.combineStrings(annotation); - } - - /** - * Get the Signature annotation for this class. Returns null if not found. - */ - native private Object[] getSignatureAnnotation(); - - /** - * Returns a {@code Class} object which represents the class with the - * specified name. The name should be the name of a class as described in - * the {@link Class class definition}; however, {@code Class}es representing - * primitive types can not be found using this method. - *

- * If the class has not been loaded so far, it is being loaded and linked - * first. This is done through either the class loader of the calling class - * or one of its parent class loaders. The class is also being initialized, - * which means that a possible static initializer block is executed. - * - * @param className - * the name of the non-primitive-type class to find. - * @return the named {@code Class} instance. - * @throws ClassNotFoundException - * if the requested class can not be found. - * @throws LinkageError - * if an error occurs during linkage - * @throws ExceptionInInitializerError - * if an exception occurs during static initialization of a - * class. - */ - public static Class forName(String className) throws ClassNotFoundException { - return forName(className, true, VMStack.getCallingClassLoader()); - } - - /** - * Returns a {@code Class} object which represents the class with the - * specified name. The name should be the name of a class as described in - * the {@link Class class definition}, however {@code Class}es representing - * primitive types can not be found using this method. Security rules will - * be obeyed. - *

- * If the class has not been loaded so far, it is being loaded and linked - * first. This is done through either the specified class loader or one of - * its parent class loaders. The caller can also request the class to be - * initialized, which means that a possible static initializer block is - * executed. - * - * @param className - * the name of the non-primitive-type class to find. - * @param initializeBoolean - * indicates whether the class should be initialized. - * @param classLoader - * the class loader to use to load the class. - * @return the named {@code Class} instance. - * @throws ClassNotFoundException - * if the requested class can not be found. - * @throws LinkageError - * if an error occurs during linkage - * @throws ExceptionInInitializerError - * if an exception occurs during static initialization of a - * class. - */ - public static Class forName(String className, boolean initializeBoolean, - ClassLoader classLoader) throws ClassNotFoundException { - - if (classLoader == null) { - SecurityManager smgr = System.getSecurityManager(); - if (smgr != null) { - ClassLoader calling = VMStack.getCallingClassLoader(); - if (calling != null) { - smgr.checkPermission(new RuntimePermission("getClassLoader")); - } - } - - classLoader = ClassLoader.getSystemClassLoader(); - } - // Catch an Exception thrown by the underlying native code. It wraps - // up everything inside a ClassNotFoundException, even if e.g. an - // Error occurred during initialization. This as a workaround for - // an ExceptionInInitilaizerError that's also wrapped. It is actually - // expected to be thrown. Maybe the same goes for other errors. - // Not wrapping up all the errors will break android though. - Class result; - try { - result = classForName(className, initializeBoolean, - classLoader); - } catch (ClassNotFoundException e) { - Throwable cause = e.getCause(); - if (cause instanceof ExceptionInInitializerError) { - throw (ExceptionInInitializerError) cause; - } - throw e; - } - return result; - } - - /* - * Returns a class by name without any security checks. - * - * @param className The name of the non-primitive type class to find - * @param initializeBoolean A boolean indicating whether the class should be - * initialized - * @param classLoader The class loader to use to load the class - * @return the named class. - * @throws ClassNotFoundException If the class could not be found - */ - static native Class classForName(String className, boolean initializeBoolean, - ClassLoader classLoader) throws ClassNotFoundException; - - /** - * Returns an array containing {@code Class} objects for all public classes - * and interfaces that are members of this class. This includes public - * members inherited from super classes and interfaces. If there are no such - * class members or if this object represents a primitive type then an array - * of length 0 is returned. - * - * @return the public class members of the class represented by this object. - * @throws SecurityException - * if a security manager exists and it does not allow member - * access. - */ - public Class[] getClasses() { - // BEGIN android-note - // trying to get closer to the RI which returns a raw class array. - // copied from newer version of harmony - // END android-note - checkPublicMemberAccess(); - return getFullListOfClasses(true); - } - - /** - * Returns the annotation of the given type. If there is no such annotation - * then the method returns {@code null}. - * - * @param annotationClass - * the annotation type. - * @return the annotation of the given type, or {@code null} if there is no - * such annotation. - */ - @SuppressWarnings("unchecked") - public A getAnnotation(Class annotationClass) { - Annotation[] list = getAnnotations(); - for (int i = 0; i < list.length; i++) { - if (annotationClass.isInstance(list[i])) { - return (A)list[i]; - } - } - - return null; - } - - /** - * Returns all the annotations of this class. If there are no annotations - * then an empty array is returned. - * - * @return a copy of the array containing this class' annotations. - * @see #getDeclaredAnnotations() - */ - public Annotation[] getAnnotations() { - /* - * We need to get the annotations declared on this class, plus the - * annotations from superclasses that have the "@Inherited" annotation - * set. We create a temporary map to use while we accumulate the - * annotations and convert it to an array at the end. - * - * It's possible to have duplicates when annotations are inherited. - * We use a Map to filter those out. - * - * HashMap might be overkill here. - */ - HashMap map = new HashMap(); - Annotation[] annos = getDeclaredAnnotations(); - - for (int i = annos.length-1; i >= 0; --i) - map.put(annos[i].annotationType(), annos[i]); - - for (Class sup = getSuperclass(); sup != null; - sup = sup.getSuperclass()) { - annos = sup.getDeclaredAnnotations(); - for (int i = annos.length-1; i >= 0; --i) { - Class clazz = annos[i].annotationType(); - if (!map.containsKey(clazz) && - clazz.isAnnotationPresent(Inherited.class)) { - map.put(clazz, annos[i]); - } - } - } - - /* convert annotation values from HashMap to array */ - Collection coll = map.values(); - return coll.toArray(new Annotation[coll.size()]); - } - - /** - * Returns the canonical name of this class. If this class does not have a - * canonical name as defined in the Java Language Specification, then the - * method returns {@code null}. - * - * @return this class' canonical name, or {@code null} if it does not have a - * canonical name. - */ - public String getCanonicalName() { - if (isLocalClass() || isAnonymousClass()) - return null; - - if (isArray()) { - /* - * The canonical name of an array type depends on the (existence of) - * the component type's canonical name. - */ - String name = getComponentType().getCanonicalName(); - if (name != null) { - return name + "[]"; - } - } else if (isMemberClass()) { - /* - * The canonical name of an inner class depends on the (existence - * of) the declaring class' canonical name. - */ - String name = getDeclaringClass().getCanonicalName(); - if (name != null) { - return name + "." + getSimpleName(); - } - } else { - /* - * The canonical name of a top-level class or primitive type is - * equal to the fully qualified name. - */ - return getName(); - } - - /* - * Other classes don't have a canonical name. - */ - return null; - } - - /** - * Returns the class loader which was used to load the class represented by - * this {@code Class}. Implementations are free to return {@code null} for - * classes that were loaded by the bootstrap class loader. The Android - * reference implementation, though, returns a reference to an actual - * representation of the bootstrap class loader. - * - * @return the class loader for the represented class. - * @throws SecurityException - * if a security manager exists and it does not allow accessing - * the class loader. - * @see ClassLoader - */ - public ClassLoader getClassLoader() { - SecurityManager smgr = System.getSecurityManager(); - ClassLoader loader = getClassLoaderImpl(); - if (smgr != null && loader != null) { - ClassLoader calling = VMStack.getCallingClassLoader(); - - if (calling != null && !calling.isAncestorOf(loader)) { - smgr.checkPermission(new RuntimePermission("getClassLoader")); - } - } - - if (this.isPrimitive()) { - return null; - } - - if (loader == null) { - loader = BootClassLoader.getInstance(); - } - - return loader; - } - - /** - * This must be provided by the VM vendor, as it is used by other provided - * class implementations in this package. Outside of this class, it is used - * by SecurityManager.checkMemberAccess(), classLoaderDepth(), - * currentClassLoader() and currentLoadedClass(). Return the ClassLoader for - * this Class without doing any security checks. The bootstrap ClassLoader - * is returned, unlike getClassLoader() which returns null in place of the - * bootstrap ClassLoader. - * - * @return the ClassLoader - * @see ClassLoader#isSystemClassLoader() - */ - ClassLoader getClassLoaderImpl() { - ClassLoader loader = getClassLoader(this); - return loader == null ? BootClassLoader.getInstance() : loader; - } - - /* - * Returns the defining class loader for the given class. - * - * @param clazz the class the class loader of which we want - * @return the class loader - */ - private static native ClassLoader getClassLoader(Class clazz); - - /** - * Returns a {@code Class} object which represents the component type if - * this class represents an array type. Returns {@code null} if this class - * does not represent an array type. The component type of an array type is - * the type of the elements of the array. - * - * @return the component type of this class. - */ - public native Class getComponentType(); - - /** - * Returns a {@code Constructor} object which represents the public - * constructor matching the specified parameter types. - * - * @param parameterTypes - * the parameter types of the requested constructor. - * {@code (Class[]) null} is equivalent to the empty array. - * @return the constructor described by {@code parameterTypes}. - * @throws NoSuchMethodException - * if the constructor can not be found. - * @throws SecurityException - * if a security manager exists and it does not allow member - * access. - * @see #getDeclaredConstructor(Class...) - */ - @SuppressWarnings("unchecked") - public Constructor getConstructor(Class... parameterTypes) throws NoSuchMethodException, - SecurityException { - checkPublicMemberAccess(); - return getMatchingConstructor(getDeclaredConstructors(this, true), parameterTypes); - } - - /** - * Returns an array containing {@code Constructor} objects for all public - * constructors for the class represented by this {@code Class}. If there - * are no public constructors or if this {@code Class} represents an array - * class, a primitive type or void then an empty array is returned. - * - * @return an array with the public constructors of the class represented by - * this {@code Class}. - * @throws SecurityException - * if a security manager exists and it does not allow member - * access. - * @see #getDeclaredConstructors() - */ - public Constructor[] getConstructors() throws SecurityException { - // BEGIN android-note - // trying to get closer to the RI which returns a raw constructor array. - // copied from newer version of harmony - // END android-note - checkPublicMemberAccess(); - return getDeclaredConstructors(this, true); - } - - /** - * Returns the annotations that are directly defined on the class - * represented by this {@code Class}. Annotations that are inherited are not - * included in the result. If there are no annotations at all, an empty - * array is returned. - * - * @return a copy of the array containing the annotations defined for the - * class that this {@code Class} represents. - * @see #getAnnotations() - */ - native public Annotation[] getDeclaredAnnotations(); - - /** - * Returns an array containing {@code Class} objects for all classes and - * interfaces that are declared as members of the class which this {@code - * Class} represents. If there are no classes or interfaces declared or if - * this class represents an array class, a primitive type or void, then an - * empty array is returned. - * - * @return an array with {@code Class} objects for all the classes and - * interfaces that are used in member declarations. - * @throws SecurityException - * if a security manager exists and it does not allow member - * access. - */ - public Class[] getDeclaredClasses() throws SecurityException { - // BEGIN android-note - // trying to get closer to the RI which returns a raw class array. - // copied from newer version of harmony - // END android-note - checkDeclaredMemberAccess(); - return getDeclaredClasses(this, false); - } - - /* - * Returns the list of member classes without performing any security checks - * first. This includes the member classes inherited from superclasses. If no - * member classes exist at all, an empty array is returned. - * - * @param publicOnly reflects whether we want only public members or all of them - * @return the list of classes - */ - private Class[] getFullListOfClasses(boolean publicOnly) { - Class[] result = getDeclaredClasses(this, publicOnly); - - // Traverse all superclasses - Class clazz = this.getSuperclass(); - while (clazz != null) { - Class[] temp = getDeclaredClasses(clazz, publicOnly); - if (temp.length != 0) { - result = arraycopy(new Class[result.length + temp.length], result, temp); - } - - clazz = clazz.getSuperclass(); - } - - return result; - } - - /* - * Returns the list of member classes of the given class. No security checks - * are performed. If no members exist, an empty array is returned. - * - * @param clazz the class the members of which we want - * @param publicOnly reflects whether we want only public member or all of them - * @return the class' class members - */ - native private static Class[] getDeclaredClasses(Class clazz, - boolean publicOnly); - - /** - * Returns a {@code Constructor} object which represents the constructor - * matching the specified parameter types that is declared by the class - * represented by this {@code Class}. - * - * @param parameterTypes - * the parameter types of the requested constructor. - * {@code (Class[]) null} is equivalent to the empty array. - * @return the constructor described by {@code parameterTypes}. - * @throws NoSuchMethodException - * if the requested constructor can not be found. - * @throws SecurityException - * if a security manager exists and it does not allow member - * access. - * @see #getConstructor(Class...) - */ - @SuppressWarnings("unchecked") - public Constructor getDeclaredConstructor(Class... parameterTypes) - throws NoSuchMethodException, SecurityException { - checkDeclaredMemberAccess(); - return getMatchingConstructor(getDeclaredConstructors(this, false), parameterTypes); - } - - /** - * Returns an array containing {@code Constructor} objects for all - * constructors declared in the class represented by this {@code Class}. If - * there are no constructors or if this {@code Class} represents an array - * class, a primitive type or void then an empty array is returned. - * - * @return an array with the constructors declared in the class represented - * by this {@code Class}. - * - * @throws SecurityException - * if a security manager exists and it does not allow member - * access. - * @see #getConstructors() - */ - public Constructor[] getDeclaredConstructors() throws SecurityException { - // BEGIN android-note - // trying to get closer to the RI which returns a raw constructor array. - // copied from newer version of harmony - // END android-note - checkDeclaredMemberAccess(); - return getDeclaredConstructors(this, false); - } - - /* - * Returns the list of constructors without performing any security checks - * first. If no constructors exist, an empty array is returned. - * - * @param clazz the class of interest - * @param publicOnly reflects whether we want only public constructors or all of them - * @return the list of constructors - */ - private static native Constructor[] getDeclaredConstructors(Class clazz, boolean publicOnly); - - /* - * Finds a constructor with a given signature. - * - * @param list the list of constructors to search through - * @param parameterTypes the formal parameter list - * @return the matching constructor - * @throws NoSuchMethodException if the constructor does not exist. - */ - private Constructor getMatchingConstructor( - Constructor[] list, Class[] parameterTypes) - throws NoSuchMethodException { - for (int i = 0; i < list.length; i++) { - if (compareClassLists(list[i].getParameterTypes(), parameterTypes)) { - return list[i]; - } - } - - // BEGIN android-changed - StringBuilder sb = new StringBuilder(); - sb.append(getSimpleName()); - sb.append('('); - boolean first = true; - if (parameterTypes != null) { - for (Class p : parameterTypes) { - if (!first) { - sb.append(','); - } - first = false; - sb.append(p.getSimpleName()); - } - } - sb.append(')'); - throw new NoSuchMethodException(sb.toString()); - // END android-changed - } - - /** - * Returns a {@code Field} object for the field with the specified name - * which is declared in the class represented by this {@code Class}. - * - * @param name - * the name of the requested field. - * @return the requested field in the class represented by this class. - * @throws NoSuchFieldException - * if the requested field can not be found. - * @throws SecurityException - * if a security manager exists and it does not allow member - * access. - * @see #getField(String) - */ - public Field getDeclaredField(String name) - throws NoSuchFieldException, SecurityException { - checkDeclaredMemberAccess(); - - Field[] fields = getClassCache().getDeclaredFields(); - Field field = findFieldByName(fields, name); - - /* - * Make a copy of the private (to the package) object, so that - * setAccessible() won't alter the private instance. - */ - return REFLECT.clone(field); - } - - /** - * Returns an array containing {@code Field} objects for all fields declared - * in the class represented by this {@code Class}. If there are no fields or - * if this {@code Class} represents an array class, a primitive type or void - * then an empty array is returned. - * - * @return an array with the fields declared in the class represented by - * this class. - * @throws SecurityException - * if a security manager exists and it does not allow member - * access. - * @see #getFields() - */ - public Field[] getDeclaredFields() throws SecurityException { - checkDeclaredMemberAccess(); - - // Return a copy of the private (to the package) array. - Field[] fields = getClassCache().getDeclaredFields(); - return ClassCache.deepCopy(fields); - } - - /* - * Returns the list of fields without performing any security checks - * first. If no fields exist at all, an empty array is returned. - * - * @param clazz the class of interest - * @param publicOnly reflects whether we want only public fields or all of them - * @return the list of fields - */ - static native Field[] getDeclaredFields(Class clazz, boolean publicOnly); - - /** - * Returns a {@code Method} object which represents the method matching the - * specified name and parameter types that is declared by the class - * represented by this {@code Class}. - * - * @param name - * the requested method's name. - * @param parameterTypes - * the parameter types of the requested method. - * {@code (Class[]) null} is equivalent to the empty array. - * @return the method described by {@code name} and {@code parameterTypes}. - * @throws NoSuchMethodException - * if the requested constructor can not be found. - * @throws NullPointerException - * if {@code name} is {@code null}. - * @throws SecurityException - * if a security manager exists and it does not allow member - * access. - * @see #getMethod(String, Class...) - */ - public Method getDeclaredMethod(String name, Class... parameterTypes) - throws NoSuchMethodException, SecurityException { - checkDeclaredMemberAccess(); - - Method[] methods = getClassCache().getDeclaredMethods(); - Method method = findMethodByName(methods, name, parameterTypes); - - /* - * Make a copy of the private (to the package) object, so that - * setAccessible() won't alter the private instance. - */ - return REFLECT.clone(method); - } - - /** - * Returns an array containing {@code Method} objects for all methods - * declared in the class represented by this {@code Class}. If there are no - * methods or if this {@code Class} represents an array class, a primitive - * type or void then an empty array is returned. - * - * @return an array with the methods declared in the class represented by - * this {@code Class}. - * @throws SecurityException - * if a security manager exists and it does not allow member - * access. - * @see #getMethods() - */ - public Method[] getDeclaredMethods() throws SecurityException { - checkDeclaredMemberAccess(); - - // Return a copy of the private (to the package) array. - Method[] methods = getClassCache().getDeclaredMethods(); - return ClassCache.deepCopy(methods); - } - - /** - * Returns the list of methods without performing any security checks - * first. If no methods exist, an empty array is returned. - */ - static native Method[] getDeclaredMethods(Class clazz, boolean publicOnly); - - /** - * Gets the {@link ClassCache} for this instance. - * - * @return non-null; the cache object - */ - /*package*/ ClassCache getClassCache() { - /* - * Note: It is innocuous if two threads try to simultaneously - * create the cache, so we don't bother protecting against that. - */ - ClassCache cache = null; - - if (cacheRef != null) { - cache = cacheRef.get(); - } - - if (cache == null) { - cache = new ClassCache(this); - cacheRef = new SoftReference>(cache); - } - - return cache; - } - - /** - * Returns the declaring {@code Class} of this {@code Class}. Returns - * {@code null} if the class is not a member of another class or if this - * {@code Class} represents an array class, a primitive type or void. - * - * @return the declaring {@code Class} or {@code null}. - */ - native public Class getDeclaringClass(); - - /** - * Returns the enclosing {@code Class} of this {@code Class}. If there is no - * enclosing class the method returns {@code null}. - * - * @return the enclosing {@code Class} or {@code null}. - */ - native public Class getEnclosingClass(); - - /** - * Gets the enclosing {@code Constructor} of this {@code Class}, if it is an - * anonymous or local/automatic class; otherwise {@code null}. - * - * @return the enclosing {@code Constructor} instance or {@code null}. - */ - native public Constructor getEnclosingConstructor(); - - /** - * Gets the enclosing {@code Method} of this {@code Class}, if it is an - * anonymous or local/automatic class; otherwise {@code null}. - * - * @return the enclosing {@code Method} instance or {@code null}. - */ - native public Method getEnclosingMethod(); - - /** - * Gets the {@code enum} constants associated with this {@code Class}. - * Returns {@code null} if this {@code Class} does not represent an {@code - * enum} type. - * - * @return an array with the {@code enum} constants or {@code null}. - */ - @SuppressWarnings("unchecked") - public T[] getEnumConstants() { - if (isEnum()) { - checkPublicMemberAccess(); - T[] values = getClassCache().getEnumValuesInOrder(); - - // Copy the private (to the package) array. - return (T[]) values.clone(); - } - - return null; - } - - /** - * Returns a {@code Field} object which represents the public field with the - * specified name. This method first searches the class C represented by - * this {@code Class}, then the interfaces implemented by C and finally the - * superclasses of C. - * - * @param name - * the name of the requested field. - * @return the public field specified by {@code name}. - * @throws NoSuchFieldException - * if the field can not be found. - * @throws SecurityException - * if a security manager exists and it does not allow member - * access. - * @see #getDeclaredField(String) - */ - public Field getField(String name) throws NoSuchFieldException, SecurityException { - checkPublicMemberAccess(); - - Field[] fields = getClassCache().getAllPublicFields(); - Field field = findFieldByName(fields, name); - - /* - * Make a copy of the private (to the package) object, so that - * setAccessible() won't alter the private instance. - */ - return REFLECT.clone(field); - } - - /** - * Returns an array containing {@code Field} objects for all public fields - * for the class C represented by this {@code Class}. Fields may be declared - * in C, the interfaces it implements or in the superclasses of C. The - * elements in the returned array are in no particular order. - *

- * If there are no public fields or if this class represents an array class, - * a primitive type or {@code void} then an empty array is returned. - *

- * - * @return an array with the public fields of the class represented by this - * {@code Class}. - * @throws SecurityException - * if a security manager exists and it does not allow member - * access. - * @see #getDeclaredFields() - */ - public Field[] getFields() throws SecurityException { - checkPublicMemberAccess(); - - // Return a copy of the private (to the package) array. - Field[] fields = getClassCache().getAllPublicFields(); - return ClassCache.deepCopy(fields); - } - - /** - * Gets the {@link Type}s of the interfaces that this {@code Class} directly - * implements. If the {@code Class} represents a primitive type or {@code - * void} then an empty array is returned. - * - * @return an array of {@link Type} instances directly implemented by the - * class represented by this {@code class}. - */ - public Type[] getGenericInterfaces() { - GenericSignatureParser parser = new GenericSignatureParser( - VMStack.getCallingClassLoader2()); - parser.parseForClass(this, getSignatureAttribute()); - return Types.getClonedTypeArray(parser.interfaceTypes); - } - - /** - * Gets the {@code Type} that represents the superclass of this {@code - * class}. - * - * @return an instance of {@code Type} representing the superclass. - */ - public Type getGenericSuperclass() { - GenericSignatureParser parser = new GenericSignatureParser( - VMStack.getCallingClassLoader2()); - parser.parseForClass(this, getSignatureAttribute()); - return Types.getType(parser.superclassType); - } - - /** - * Returns an array of {@code Class} objects that match the interfaces - * specified in the {@code implements} declaration of the class represented - * by this {@code Class}. The order of the elements in the array is - * identical to the order in the original class declaration. If the class - * does not implement any interfaces, an empty array is returned. - * - * @return an array with the interfaces of the class represented by this - * class. - */ - public native Class[] getInterfaces(); - // BEGIN android-note - // trying to get closer to the RI which returns a raw class array. - // copied from newer version of harmony - // END android-note - - // Changed to raw type to be closer to the RI - /** - * Returns a {@code Method} object which represents the public method with - * the specified name and parameter types. This method first searches the - * class C represented by this {@code Class}, then the superclasses of C and - * finally the interfaces implemented by C and finally the superclasses of C - * for a method with matching name. - * - * @param name - * the requested method's name. - * @param parameterTypes - * the parameter types of the requested method. - * {@code (Class[]) null} is equivalent to the empty array. - * @return the public field specified by {@code name}. - * @throws NoSuchMethodException - * if the method can not be found. - * @throws SecurityException - * if a security manager exists and it does not allow member - * access. - * @see #getDeclaredMethod(String, Class...) - */ - public Method getMethod(String name, Class... parameterTypes) throws NoSuchMethodException, - SecurityException { - checkPublicMemberAccess(); - - Method[] methods = getClassCache().getAllPublicMethods(); - Method method = findMethodByName(methods, name, parameterTypes); - - /* - * Make a copy of the private (to the package) object, so that - * setAccessible() won't alter the private instance. - */ - return REFLECT.clone(method); - } - - /** - * Returns an array containing {@code Method} objects for all public methods - * for the class C represented by this {@code Class}. Methods may be - * declared in C, the interfaces it implements or in the superclasses of C. - * The elements in the returned array are in no particular order. - *

- * If there are no public methods or if this {@code Class} represents a - * primitive type or {@code void} then an empty array is returned. - *

- * - * @return an array with the methods of the class represented by this - * {@code Class}. - * @throws SecurityException - * if a security manager exists and it does not allow member - * access. - * @see #getDeclaredMethods() - */ - public Method[] getMethods() throws SecurityException { - checkPublicMemberAccess(); - - // Return a copy of the private (to the package) array. - Method[] methods = getClassCache().getAllPublicMethods(); - return ClassCache.deepCopy(methods); - } - - /** - * Performs the security checks regarding the access of a public - * member of this {@code Class}. - * - *

Note: Because of the {@code getCallingClassLoader2()} - * check, this method must be called exactly one level deep into a - * public method on this instance.

- */ - /*package*/ void checkPublicMemberAccess() { - SecurityManager smgr = System.getSecurityManager(); - - if (smgr != null) { - smgr.checkMemberAccess(this, Member.PUBLIC); - - ClassLoader calling = VMStack.getCallingClassLoader2(); - ClassLoader current = getClassLoader(); - - if (calling != null && !calling.isAncestorOf(current)) { - smgr.checkPackageAccess(this.getPackage().getName()); - } - } - } - - /** - * Performs the security checks regarding the access of a declared - * member of this {@code Class}. - * - *

Note: Because of the {@code getCallingClassLoader2()} - * check, this method must be called exactly one level deep into a - * public method on this instance.

- */ - private void checkDeclaredMemberAccess() { - SecurityManager smgr = System.getSecurityManager(); - if (smgr != null) { - smgr.checkMemberAccess(this, Member.DECLARED); - - ClassLoader calling = VMStack.getCallingClassLoader2(); - ClassLoader current = getClassLoader(); - - if (calling != null && !calling.isAncestorOf(current)) { - smgr.checkPackageAccess(this.getPackage().getName()); - } - } - } - - /** - * Returns an integer that represents the modifiers of the class represented - * by this {@code Class}. The returned value is a combination of bits - * defined by constants in the {@link Modifier} class. - * - * @return the modifiers of the class represented by this {@code Class}. - */ - public int getModifiers() { - return getModifiers(this, false); - } - - /* - * Return the modifiers for the given class. - * - * @param clazz the class of interest - * @ignoreInnerClassesAttrib determines whether we look for and use the - * flags from an "inner class" attribute - */ - private static native int getModifiers(Class clazz, boolean ignoreInnerClassesAttrib); - - /** - * Returns the name of the class represented by this {@code Class}. For a - * description of the format which is used, see the class definition of - * {@link Class}. - * - * @return the name of the class represented by this {@code Class}. - */ - public native String getName(); - - /** - * Returns the simple name of the class represented by this {@code Class} as - * defined in the source code. If there is no name (that is, the class is - * anonymous) then an empty string is returned. If the receiver is an array - * then the name of the underlying type with square braces appended (for - * example {@code "Integer[]"}) is returned. - * - * @return the simple name of the class represented by this {@code Class}. - */ - public String getSimpleName() { - if (isArray()) { - return getComponentType().getSimpleName() + "[]"; - } - - String name = getName(); - - if (isAnonymousClass()) { - return ""; - } - - if (isMemberClass() || isLocalClass()) { - return getInnerClassName(); - } - - int dot = name.lastIndexOf('.'); - if (dot != -1) { - return name.substring(dot + 1); - } - - return name; - } - - /* - * Returns the simple name of a member or local class, or null otherwise. - * - * @return The name. - */ - private native String getInnerClassName(); - - /** - * Returns the {@code ProtectionDomain} of the class represented by this - * class. - *

- * Note: In order to conserve space in an embedded target like Android, we - * allow this method to return {@code null} for classes in the system - * protection domain (that is, for system classes). System classes are - * always given full permissions (that is, AllPermission). This can not be - * changed through the {@link java.security.Policy} class. - *

- * - * @return the {@code ProtectionDomain} of the class represented by this - * class. - * @throws SecurityException - * if a security manager exists and it does not allow member - * access. - */ - public ProtectionDomain getProtectionDomain() { - SecurityManager smgr = System.getSecurityManager(); - if (smgr != null) { - // Security check is independent of calling class loader. - smgr.checkPermission(new RuntimePermission("getProtectionDomain")); - } - - return pd; - } - - /** - * Returns the URL of the resource specified by {@code resName}. The mapping - * between the resource name and the URL is managed by the class' class - * loader. - * - * @param resName - * the name of the resource. - * @return the requested resource's {@code URL} object or {@code null} if - * the resource can not be found. - * @see ClassLoader - */ - public URL getResource(String resName) { - // Get absolute resource name, but without the leading slash - if (resName.startsWith("/")) { - resName = resName.substring(1); - } else { - String pkg = getName(); - int dot = pkg.lastIndexOf('.'); - if (dot != -1) { - pkg = pkg.substring(0, dot).replace('.', '/'); - } else { - pkg = ""; - } - - resName = pkg + "/" + resName; - } - - // Delegate to proper class loader - ClassLoader loader = getClassLoader(); - if (loader != null) { - return loader.getResource(resName); - } else { - return ClassLoader.getSystemResource(resName); - } - } - - /** - * Returns a read-only stream for the contents of the resource specified by - * {@code resName}. The mapping between the resource name and the stream is - * managed by the class' class loader. - * - * @param resName - * the name of the resource. - * @return a stream for the requested resource or {@code null} if no - * resource with the specified name can be found. - * @see ClassLoader - */ - public InputStream getResourceAsStream(String resName) { - // Get absolute resource name, but without the leading slash - if (resName.startsWith("/")) { - resName = resName.substring(1); - } else { - String pkg = getName(); - int dot = pkg.lastIndexOf('.'); - if (dot != -1) { - pkg = pkg.substring(0, dot).replace('.', '/'); - } else { - pkg = ""; - } - - resName = pkg + "/" + resName; - } - - // Delegate to proper class loader - ClassLoader loader = getClassLoader(); - if (loader != null) { - return loader.getResourceAsStream(resName); - } else { - return ClassLoader.getSystemResourceAsStream(resName); - } - } - - /** - * Returns null. (On Android, a {@code ClassLoader} can load classes from multiple dex files. - * All classes from any given dex file will have the same signers, but different dex - * files may have different signers. This does not fit well with the original - * {@code ClassLoader}-based model of {@code getSigners}.) - * - * @return null. - */ - public Object[] getSigners() { - // See http://code.google.com/p/android/issues/detail?id=1766. - return null; - } - - /** - * Returns the {@code Class} object which represents the superclass of the - * class represented by this {@code Class}. If this {@code Class} represents - * the {@code Object} class, a primitive type, an interface or void then the - * method returns {@code null}. If this {@code Class} represents an array - * class then the {@code Object} class is returned. - * - * @return the superclass of the class represented by this {@code Class}. - */ - public native Class getSuperclass(); - - /** - * Returns an array containing {@code TypeVariable} objects for type - * variables declared by the generic class represented by this {@code - * Class}. Returns an empty array if the class is not generic. - * - * @return an array with the type variables of the class represented by this - * class. - */ - @SuppressWarnings("unchecked") - public synchronized TypeVariable>[] getTypeParameters() { - GenericSignatureParser parser = new GenericSignatureParser( - VMStack.getCallingClassLoader2()); - parser.parseForClass(this, getSignatureAttribute()); - return parser.formalTypeParameters.clone(); - } - - /** - * Indicates whether this {@code Class} represents an annotation class. - * - * @return {@code true} if this {@code Class} represents an annotation - * class; {@code false} otherwise. - */ - public boolean isAnnotation() { - final int ACC_ANNOTATION = 0x2000; // not public in reflect.Modifiers - int mod = getModifiers(this, true); - return (mod & ACC_ANNOTATION) != 0; - } - - /** - * Indicates whether the specified annotation is present for the class - * represented by this {@code Class}. - * - * @param annotationClass - * the annotation to look for. - * @return {@code true} if the class represented by this {@code Class} is - * annotated with {@code annotationClass}; {@code false} otherwise. - */ - public boolean isAnnotationPresent(Class annotationClass) { - return getAnnotation(annotationClass) != null; - } - - /** - * Indicates whether the class represented by this {@code Class} is - * anonymously declared. - * - * @return {@code true} if the class represented by this {@code Class} is - * anonymous; {@code false} otherwise. - */ - native public boolean isAnonymousClass(); - - /** - * Indicates whether the class represented by this {@code Class} is an array - * class. - * - * @return {@code true} if the class represented by this {@code Class} is an - * array class; {@code false} otherwise. - */ - public boolean isArray() { - return getComponentType() != null; - } - - /** - * Indicates whether the specified class type can be converted to the class - * represented by this {@code Class}. Conversion may be done via an identity - * conversion or a widening reference conversion (if either the receiver or - * the argument represent primitive types, only the identity conversion - * applies). - * - * @param cls - * the class to check. - * @return {@code true} if {@code cls} can be converted to the class - * represented by this {@code Class}; {@code false} otherwise. - * @throws NullPointerException - * if {@code cls} is {@code null}. - */ - public native boolean isAssignableFrom(Class cls); - - /** - * Indicates whether the class represented by this {@code Class} is an - * {@code enum}. - * - * @return {@code true} if the class represented by this {@code Class} is an - * {@code enum}; {@code false} otherwise. - */ - public boolean isEnum() { - return ((getModifiers() & 0x4000) != 0) && (getSuperclass() == Enum.class); - } - - /** - * Indicates whether the specified object can be cast to the class - * represented by this {@code Class}. This is the runtime version of the - * {@code instanceof} operator. - * - * @param object - * the object to check. - * @return {@code true} if {@code object} can be cast to the type - * represented by this {@code Class}; {@code false} if {@code - * object} is {@code null} or cannot be cast. - */ - public native boolean isInstance(Object object); - - /** - * Indicates whether this {@code Class} represents an interface. - * - * @return {@code true} if this {@code Class} represents an interface; - * {@code false} otherwise. - */ - public native boolean isInterface(); - - /** - * Indicates whether the class represented by this {@code Class} is defined - * locally. - * - * @return {@code true} if the class represented by this {@code Class} is - * defined locally; {@code false} otherwise. - */ - public boolean isLocalClass() { - boolean enclosed = (getEnclosingMethod() != null || - getEnclosingConstructor() != null); - return enclosed && !isAnonymousClass(); - } - - /** - * Indicates whether the class represented by this {@code Class} is a member - * class. - * - * @return {@code true} if the class represented by this {@code Class} is a - * member class; {@code false} otherwise. - */ - public boolean isMemberClass() { - return getDeclaringClass() != null; - } - - /** - * Indicates whether this {@code Class} represents a primitive type. - * - * @return {@code true} if this {@code Class} represents a primitive type; - * {@code false} otherwise. - */ - public native boolean isPrimitive(); - - /** - * Indicates whether this {@code Class} represents a synthetic type. - * - * @return {@code true} if this {@code Class} represents a synthetic type; - * {@code false} otherwise. - */ - public boolean isSynthetic() { - final int ACC_SYNTHETIC = 0x1000; // not public in reflect.Modifiers - int mod = getModifiers(this, true); - return (mod & ACC_SYNTHETIC) != 0; - } - - /** - * Returns a new instance of the class represented by this {@code Class}, - * created by invoking the default (that is, zero-argument) constructor. If - * there is no such constructor, or if the creation fails (either because of - * a lack of available memory or because an exception is thrown by the - * constructor), an {@code InstantiationException} is thrown. If the default - * constructor exists but is not accessible from the context where this - * method is invoked, an {@code IllegalAccessException} is thrown. - * - * @return a new instance of the class represented by this {@code Class}. - * @throws IllegalAccessException - * if the default constructor is not visible. - * @throws InstantiationException - * if the instance can not be created. - * @throws SecurityException - * if a security manager exists and it does not allow creating - * new instances. - */ - public T newInstance() throws InstantiationException, IllegalAccessException { - checkPublicMemberAccess(); - return newInstanceImpl(); - } - - private native T newInstanceImpl() throws IllegalAccessException, - InstantiationException; - - @Override - public String toString() { - if (isPrimitive()) { - return getSimpleName().toLowerCase(); - } else { - return (isInterface() ? "interface " : "class ") + getName(); - } - } - - /** - * Returns the {@code Package} of which the class represented by this - * {@code Class} is a member. Returns {@code null} if no {@code Package} - * object was created by the class loader of the class. - * - * @return Package the {@code Package} of which this {@code Class} is a - * member or {@code null}. - */ - public Package getPackage() { - // TODO This might be a hack, but the VM doesn't have the necessary info. - ClassLoader loader = getClassLoader(); - if (loader != null) { - String name = getName(); - int dot = name.lastIndexOf('.'); - return (dot != -1 ? ClassLoader.getPackage(loader, name.substring(0, dot)) : null); - } - - return null; - } - - /** - * Returns the assertion status for the class represented by this {@code - * Class}. Assertion is enabled / disabled based on the class loader, - * package or class default at runtime. - * - * @return the assertion status for the class represented by this {@code - * Class}. - */ - public native boolean desiredAssertionStatus(); - - /** - * Casts this {@code Class} to represent a subclass of the specified class. - * If successful, this {@code Class} is returned; otherwise a {@code - * ClassCastException} is thrown. - * - * @param clazz - * the required type. - * @return this {@code Class} cast as a subclass of the given type. - * @throws ClassCastException - * if this {@code Class} cannot be cast to the specified type. - */ - @SuppressWarnings("unchecked") - public Class asSubclass(Class clazz) { - if (clazz.isAssignableFrom(this)) { - return (Class)this; - } - throw new ClassCastException(); - } - - /** - * Casts the specified object to the type represented by this {@code Class}. - * If the object is {@code null} then the result is also {@code null}. - * - * @param obj - * the object to cast. - * @return the object that has been cast. - * @throws ClassCastException - * if the object cannot be cast to the specified type. - */ - @SuppressWarnings("unchecked") - public T cast(Object obj) { - if (obj == null) { - return null; - } else if (this.isInstance(obj)) { - return (T)obj; - } - throw new ClassCastException(); - } - - /** - * Set the "accessible" flag of the given object, without doing any - * access checks. - * - *

Note: This method is implemented in native code, and, - * as such, is less efficient than using {@link ClassCache#REFLECT} - * to achieve the same goal. This method exists solely to help - * bootstrap the reflection bridge.

- * - * @param ao non-null; the object to modify - * @param flag the new value for the accessible flag - */ - /*package*/ static native void setAccessibleNoCheck(AccessibleObject ao, - boolean flag); - - /** - * Copies two arrays into one. Assumes that the destination array is large - * enough. - * - * @param result the destination array - * @param head the first source array - * @param tail the second source array - * @return the destination array, that is, result - */ - private static T[] arraycopy(T[] result, T[] head, T[] tail) { - System.arraycopy(head, 0, result, 0, head.length); - System.arraycopy(tail, 0, result, head.length, tail.length); - return result; - } - - /** - * This must be provided by the vm vendor, as it is used by other provided - * class implementations in this package. This method is used by - * SecurityManager.classDepth(), and getClassContext() which use the - * parameters (-1, false) and SecurityManager.classLoaderDepth(), - * currentClassLoader(), and currentLoadedClass() which use the parameters - * (-1, true). Walk the stack and answer an array containing the maxDepth - * most recent classes on the stack of the calling thread. Starting with the - * caller of the caller of getStackClasses(), return an array of not more - * than maxDepth Classes representing the classes of running methods on the - * stack (including native methods). Frames representing the VM - * implementation of java.lang.reflect are not included in the list. If - * stopAtPrivileged is true, the walk will terminate at any frame running - * one of the following methods:
    - *
  • java/security/AccessController.doPrivileged(Ljava/security/PrivilegedAction;)Ljava/lang/Object;
  • - *
  • java/security/AccessController.doPrivileged(Ljava/security/PrivilegedExceptionAction;)Ljava/lang/Object;
  • - *
  • java/security/AccessController.doPrivileged(Ljava/security/PrivilegedAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;
  • - *
  • java/security/AccessController.doPrivileged(Ljava/security/PrivilegedExceptionAction;Ljava/security/AccessControlContext;)Ljava/lang/Object;
  • - *
If one of the doPrivileged methods is found, the walk terminate - * and that frame is NOT included in the returned array. Notes: - *
    - *
  • This method operates on the defining classes of methods on stack. - * NOT the classes of receivers.
  • - *
  • The item at index zero in the result array describes the caller of - * the caller of this method.
  • - *
- * - * @param maxDepth - * maximum depth to walk the stack, -1 for the entire stack - * @param stopAtPrivileged - * stop at privileged classes - * @return the array of the most recent classes on the stack - */ - static final Class[] getStackClasses(int maxDepth, boolean stopAtPrivileged) { - return VMStack.getClasses(maxDepth, stopAtPrivileged); - } - -} diff --git a/luni-kernel/src/main/java/java/lang/ClassCache.java b/luni-kernel/src/main/java/java/lang/ClassCache.java deleted file mode 100644 index 5ea6992..0000000 --- a/luni-kernel/src/main/java/java/lang/ClassCache.java +++ /dev/null @@ -1,702 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package java.lang; - -import org.apache.harmony.kernel.vm.LangAccess; -import org.apache.harmony.kernel.vm.ReflectionAccess; - -import java.lang.reflect.AccessibleObject; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; -import java.util.EnumSet; -import java.util.HashSet; - -/** - * Cache of per-class data, meant to help the performance of reflection - * methods. - * - *

Note: None of the methods perform access checks. It is up - * to the (package internal) clients of this code to perform such - * checks as necessary.

- * - *

Also Note: None of the returned array values are - * protected in any way. It is up to the (again, package internal) - * clients of this code to protect the arrays if they should ever - * escape the package.

- */ -/*package*/ class ClassCache { - // TODO: Add caching for constructors and fields. - - /** non-null; comparator used for enumerated values */ - private static final EnumComparator ENUM_COMPARATOR = - new EnumComparator(); - - /** non-null; reflection access bridge */ - /*package*/ static final ReflectionAccess REFLECT = getReflectionAccess(); - - /** non-null; class that this instance represents */ - private final Class clazz; - - /** null-ok; list of all declared methods */ - private volatile Method[] declaredMethods; - - /** null-ok; list of all public declared methods */ - private volatile Method[] declaredPublicMethods; - - /** null-ok; list of all methods, both direct and inherited */ - private volatile Method[] allMethods; - - /** null-ok; list of all public methods, both direct and inherited */ - private volatile Method[] allPublicMethods; - - /** null-ok; list of all declared fields */ - private volatile Field[] declaredFields; - - /** null-ok; list of all public declared fields */ - private volatile Field[] declaredPublicFields; - - /** null-ok; list of all fields, both direct and inherited */ - private volatile Field[] allFields; - - /** null-ok; list of all public fields, both direct and inherited */ - private volatile Field[] allPublicFields; - - /** - * null-ok; array of enumerated values in their original order, if this - * instance's class is an enumeration - */ - private volatile T[] enumValuesInOrder; - - /** - * null-ok; array of enumerated values sorted by name, if this - * instance's class is an enumeration - */ - private volatile T[] enumValuesByName; - - static { - /* - * Provide access to this package from java.util as part of - * bootstrap. TODO: See if this can be removed in favor of the - * simpler mechanism below. (That is, see if EnumSet will be - * happy calling LangAccess.getInstance().) - */ - Field field; - - try { - field = EnumSet.class.getDeclaredField("LANG_BOOTSTRAP"); - REFLECT.setAccessibleNoCheck(field, true); - } catch (NoSuchFieldException ex) { - // This shouldn't happen because the field is in fact defined. - throw new AssertionError(ex); - } - - try { - field.set(null, LangAccessImpl.THE_ONE); - } catch (IllegalAccessException ex) { - // This shouldn't happen because we made the field accessible. - throw new AssertionError(ex); - } - - // Also set up the bootstrap-classpath-wide access mechanism. - LangAccess.setInstance(LangAccessImpl.THE_ONE); - } - - /** - * Constructs an instance. - * - * @param clazz non-null; class that this instance represents - */ - /*package*/ ClassCache(Class clazz) { - if (clazz == null) { - throw new NullPointerException("clazz == null"); - } - - this.clazz = clazz; - this.declaredMethods = null; - this.declaredPublicMethods = null; - this.allMethods = null; - this.allPublicMethods = null; - this.enumValuesInOrder = null; - this.enumValuesByName = null; - this.declaredFields = null; - this.declaredPublicFields = null; - this.allFields = null; - this.allPublicFields = null; - } - - /** - * Gets the list of all declared methods. - * - * @return non-null; the list of all declared methods - */ - public Method[] getDeclaredMethods() { - if (declaredMethods == null) { - declaredMethods = Class.getDeclaredMethods(clazz, false); - } - - return declaredMethods; - } - - /** - * Gets the list of all declared public methods. - * - * @return non-null; the list of all declared public methods - */ - public Method[] getDeclaredPublicMethods() { - if (declaredPublicMethods == null) { - declaredPublicMethods = Class.getDeclaredMethods(clazz, true); - } - - return declaredPublicMethods; - } - - /** - * Gets either the list of declared methods or the list of declared - * public methods. - * - * @param publicOnly whether to only return public methods - */ - public Method[] getDeclaredMethods(boolean publicOnly) { - return publicOnly ? getDeclaredPublicMethods() : getDeclaredMethods(); - } - - /** - * Gets the list of all methods, both directly - * declared and inherited. - * - * @return non-null; the list of all methods - */ - public Method[] getAllMethods() { - if (allMethods == null) { - allMethods = getFullListOfMethods(false); - } - - return allMethods; - } - - /** - * Gets the list of all public methods, both directly - * declared and inherited. - * - * @return non-null; the list of all public methods - */ - public Method[] getAllPublicMethods() { - if (allPublicMethods == null) { - allPublicMethods = getFullListOfMethods(true); - } - - return allPublicMethods; - } - - /* - * Returns the list of methods without performing any security checks - * first. This includes the methods inherited from superclasses. If no - * methods exist at all, an empty array is returned. - * - * @param publicOnly reflects whether we want only public methods - * or all of them - * @return the list of methods - */ - private Method[] getFullListOfMethods(boolean publicOnly) { - ArrayList methods = new ArrayList(); - HashSet seen = new HashSet(); - - findAllMethods(clazz, methods, seen, publicOnly); - - return methods.toArray(new Method[methods.size()]); - } - - /** - * Collects the list of methods without performing any security checks - * first. This includes the methods inherited from superclasses and from - * all implemented interfaces. The latter may also implement multiple - * interfaces, so we (potentially) recursively walk through a whole tree of - * classes. If no methods exist at all, an empty array is returned. - * - * @param clazz non-null; class to inspect - * @param methods non-null; the target list to add the results to - * @param seen non-null; a set of signatures we've already seen - * @param publicOnly reflects whether we want only public methods - * or all of them - */ - private static void findAllMethods(Class clazz, - ArrayList methods, HashSet seen, - boolean publicOnly) { - StringBuilder builder = new StringBuilder(); - Class origClass = clazz; - - // Traverse class and superclasses, get rid of dupes by signature - while (clazz != null) { - Method[] declaredMethods = - clazz.getClassCache().getDeclaredMethods(publicOnly); - int length = declaredMethods.length; - if (length != 0) { - for (Method method : declaredMethods) { - builder.setLength(0); - builder.append(method.getName()); - builder.append('('); - Class[] types = method.getParameterTypes(); - if (types.length != 0) { - builder.append(types[0].getName()); - for (int j = 1; j < types.length; j++) { - builder.append(','); - builder.append(types[j].getName()); - } - } - builder.append(')'); - - String signature = builder.toString(); - if (!seen.contains(signature)) { - methods.add(method); - seen.add(signature); - } - } - } - - clazz = clazz.getSuperclass(); - } - - // Traverse all interfaces, and do the same recursively. - Class[] interfaces = origClass.getInterfaces(); - for (Class intf : interfaces) { - findAllMethods(intf, methods, seen, publicOnly); - } - } - - /** - * Finds and returns a method with a given name and signature. Use - * this with one of the method lists returned by instances of this class. - * - * @param list non-null; the list of methods to search through - * @param parameterTypes non-null; the formal parameter list - * @return non-null; the matching method - * @throws NoSuchMethodException thrown if the method does not exist - */ - public static Method findMethodByName(Method[] list, String name, - Class[] parameterTypes) throws NoSuchMethodException { - if (name == null) { - throw new NullPointerException("Method name must not be null."); - } - for (int i = list.length - 1; i >= 0; i--) { - Method method = list[i]; - if (method.getName().equals(name) - && compareClassLists( - method.getParameterTypes(), parameterTypes)) { - return method; - } - } - - throw new NoSuchMethodException(name); - } - - /** - * Compares two class lists for equality. Empty and - * null lists are considered equal. This is useful - * for matching methods and constructors. - * - *

TODO: Take into account assignment compatibility?

- * - * @param a null-ok; the first list of types - * @param b null-ok; the second list of types - * @return true if and only if the lists are equal - */ - public static boolean compareClassLists(Class[] a, Class[] b) { - if (a == null) { - return (b == null) || (b.length == 0); - } - - int length = a.length; - - if (b == null) { - return (length == 0); - } - - if (length != b.length) { - return false; - } - - for (int i = length - 1; i >= 0; i--) { - if (a[i] != b[i]) { - return false; - } - } - - return true; - } - - /** - * Makes a deep copy of the given array of methods. This is useful - * when handing out arrays from the public API. - * - *

Note: In such cases, it is insufficient to just make - * a shallow copy of the array, since method objects aren't - * immutable due to the existence of {@link - * AccessibleObject#setAccessible}.

- * - * @param orig non-null; array to copy - * @return non-null; a deep copy of the given array - */ - public static Method[] deepCopy(Method[] orig) { - int length = orig.length; - Method[] result = new Method[length]; - - for (int i = length - 1; i >= 0; i--) { - result[i] = REFLECT.clone(orig[i]); - } - - return result; - } - - /** - * Gets the list of all declared fields. - * - * @return non-null; the list of all declared fields - */ - public Field[] getDeclaredFields() { - if (declaredFields == null) { - declaredFields = Class.getDeclaredFields(clazz, false); - } - - return declaredFields; - } - - /** - * Gets the list of all declared public fields. - * - * @return non-null; the list of all declared public fields - */ - public Field[] getDeclaredPublicFields() { - if (declaredPublicFields == null) { - declaredPublicFields = Class.getDeclaredFields(clazz, true); - } - - return declaredPublicFields; - } - - /** - * Gets either the list of declared fields or the list of declared - * public fields. - * - * @param publicOnly whether to only return public fields - */ - public Field[] getDeclaredFields(boolean publicOnly) { - return publicOnly ? getDeclaredPublicFields() : getDeclaredFields(); - } - - /** - * Gets the list of all fields, both directly - * declared and inherited. - * - * @return non-null; the list of all fields - */ - public Field[] getAllFields() { - if (allFields == null) { - allFields = getFullListOfFields(false); - } - - return allFields; - } - - /** - * Gets the list of all public fields, both directly - * declared and inherited. - * - * @return non-null; the list of all public fields - */ - public Field[] getAllPublicFields() { - if (allPublicFields == null) { - allPublicFields = getFullListOfFields(true); - } - - return allPublicFields; - } - - /* - * Returns the list of fields without performing any security checks - * first. This includes the fields inherited from superclasses. If no - * fields exist at all, an empty array is returned. - * - * @param publicOnly reflects whether we want only public fields - * or all of them - * @return the list of fields - */ - private Field[] getFullListOfFields(boolean publicOnly) { - ArrayList fields = new ArrayList(); - HashSet seen = new HashSet(); - - findAllfields(clazz, fields, seen, publicOnly); - - return fields.toArray(new Field[fields.size()]); - } - - /** - * Collects the list of fields without performing any security checks - * first. This includes the fields inherited from superclasses and from - * all implemented interfaces. The latter may also implement multiple - * interfaces, so we (potentially) recursively walk through a whole tree of - * classes. If no fields exist at all, an empty array is returned. - * - * @param clazz non-null; class to inspect - * @param fields non-null; the target list to add the results to - * @param seen non-null; a set of signatures we've already seen - * @param publicOnly reflects whether we want only public fields - * or all of them - */ - private static void findAllfields(Class clazz, - ArrayList fields, HashSet seen, - boolean publicOnly) { - - // Traverse class and superclasses, get rid of dupes by signature - while (clazz != null) { - Field[] declaredFields = - clazz.getClassCache().getDeclaredFields(publicOnly); - for (Field field : declaredFields) { - String signature = field.toString(); - if (!seen.contains(signature)) { - fields.add(field); - seen.add(signature); - } - } - - // Traverse all interfaces, and do the same recursively. - Class[] interfaces = clazz.getInterfaces(); - for (Class intf : interfaces) { - findAllfields(intf, fields, seen, publicOnly); - } - - clazz = clazz.getSuperclass(); - } - } - - /** - * Finds and returns a field with a given name and signature. Use - * this with one of the field lists returned by instances of this class. - * - * @param list non-null; the list of fields to search through - * @return non-null; the matching field - * @throws NoSuchFieldException thrown if the field does not exist - */ - public static Field findFieldByName(Field[] list, String name) - throws NoSuchFieldException { - if (name == null) { - throw new NullPointerException("Field name must not be null."); - } - for (int i = 0; i < list.length; i++) { - Field field = list[i]; - if (field.getName().equals(name)) { - return field; - } - } - - throw new NoSuchFieldException(name); - } - - /** - * Makes a deep copy of the given array of fields. This is useful - * when handing out arrays from the public API. - * - *

Note: In such cases, it is insufficient to just make - * a shallow copy of the array, since field objects aren't - * immutable due to the existence of {@link - * AccessibleObject#setAccessible}.

- * - * @param orig non-null; array to copy - * @return non-null; a deep copy of the given array - */ - public static Field[] deepCopy(Field[] orig) { - int length = orig.length; - Field[] result = new Field[length]; - - for (int i = length - 1; i >= 0; i--) { - result[i] = REFLECT.clone(orig[i]); - } - - return result; - } - - /** - * Gets the enumerated value with a given name. - * - * @param name non-null; name of the value - * @return null-ok; the named enumerated value or null - * if this instance's class doesn't have such a value (including - * if this instance isn't in fact an enumeration) - */ - @SuppressWarnings("unchecked") - public T getEnumValue(String name) { - Enum[] values = (Enum[]) getEnumValuesByName(); - - if (values == null) { - return null; - } - - // Binary search. - - int min = 0; - int max = values.length - 1; - - while (min <= max) { - /* - * The guessIdx calculation is equivalent to ((min + max) - * / 2) but won't go wonky when min and max are close to - * Integer.MAX_VALUE. - */ - int guessIdx = min + ((max - min) >> 1); - Enum guess = values[guessIdx]; - int cmp = name.compareTo(guess.name()); - - if (cmp < 0) { - max = guessIdx - 1; - } else if (cmp > 0) { - min = guessIdx + 1; - } else { - return (T) guess; - } - } - - return null; - } - - /** - * Gets the array of enumerated values, sorted by name. - * - * @return null-ok; the value array, or null if this - * instance's class isn't in fact an enumeration - */ - public T[] getEnumValuesByName() { - if (enumValuesByName == null) { - T[] values = getEnumValuesInOrder(); - - if (values != null) { - values = (T[]) values.clone(); - Arrays.sort((Enum[]) values, ENUM_COMPARATOR); - - /* - * Note: It's only safe (concurrency-wise) to set the - * instance variable after the array is properly sorted. - */ - enumValuesByName = values; - } - } - - return enumValuesByName; - } - - /** - * Gets the array of enumerated values, in their original declared - * order. - * - * @return null-ok; the value array, or null if this - * instance's class isn't in fact an enumeration - */ - public T[] getEnumValuesInOrder() { - if ((enumValuesInOrder == null) && clazz.isEnum()) { - enumValuesInOrder = callEnumValues(); - } - - return enumValuesInOrder; - } - - /** - * Calls the static method values() on this - * instance's class, which is presumed to be a properly-formed - * enumeration class, using proper privilege hygiene. - * - * @return non-null; the array of values as reported by - * value() - */ - @SuppressWarnings("unchecked") - private T[] callEnumValues() { - Method method; - - try { - Method[] methods = getDeclaredPublicMethods(); - method = findMethodByName(methods, "values", (Class[]) null); - method = REFLECT.accessibleClone(method); - } catch (NoSuchMethodException ex) { - // This shouldn't happen if the class is a well-formed enum. - throw new UnsupportedOperationException(ex); - } - - try { - return (T[]) method.invoke((Object[]) null); - } catch (IllegalAccessException ex) { - // This shouldn't happen because the method is "accessible." - throw new Error(ex); - } catch (InvocationTargetException ex) { - Throwable te = ex.getTargetException(); - if (te instanceof RuntimeException) { - throw (RuntimeException) te; - } else if (te instanceof Error) { - throw (Error) te; - } else { - throw new Error(te); - } - } - } - - /** - * Gets the reflection access object. This uses reflection to do - * so. My head is spinning. - * - * @return non-null; the reflection access object - */ - private static ReflectionAccess getReflectionAccess() { - /* - * Note: We can't do AccessibleObject.class.getCache() to - * get the cache, since that would cause a circularity in - * initialization. So instead, we do a direct call into the - * native side. - */ - Method[] methods = - Class.getDeclaredMethods(AccessibleObject.class, false); - - try { - Method method = findMethodByName(methods, "getReflectionAccess", - (Class[]) null); - Class.setAccessibleNoCheck(method, true); - return (ReflectionAccess) method.invoke((Object[]) null); - } catch (NoSuchMethodException ex) { - /* - * This shouldn't happen because the method - * AccessibleObject.getReflectionAccess() really is defined - * in this module. - */ - throw new Error(ex); - } catch (IllegalAccessException ex) { - // This shouldn't happen because the method is "accessible." - throw new Error(ex); - } catch (InvocationTargetException ex) { - throw new Error(ex); - } - } - - /** - * Comparator class for enumerated values. It compares strictly - * by name. - */ - private static class EnumComparator implements Comparator> { - public int compare(Enum e1, Enum e2) { - return e1.name().compareTo(e2.name()); - } - } -} diff --git a/luni-kernel/src/main/java/java/lang/ClassLoader.java b/luni-kernel/src/main/java/java/lang/ClassLoader.java deleted file mode 100644 index aae807e..0000000 --- a/luni-kernel/src/main/java/java/lang/ClassLoader.java +++ /dev/null @@ -1,1103 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package java.lang; - -import java.io.IOException; -import java.io.InputStream; -import java.net.URL; -import java.nio.ByteBuffer; -import java.security.ProtectionDomain; -import java.util.Collection; -import java.util.Enumeration; -import java.util.Map; -import java.util.HashMap; - -import dalvik.system.PathClassLoader; -import dalvik.system.VMStack; - -/** - * Loads classes and resources from a repository. One or more class loaders are - * installed at runtime. These are consulted whenever the runtime system needs a - * specific class that is not yet available in-memory. Typically, class loaders - * are grouped into a tree where child class loaders delegate all requests to - * parent class loaders. Only if the parent class loader cannot satisfy the - * request, the child class loader itself tries to handle it. - *

- * {@code ClassLoader} is an abstract class that implements the common - * infrastructure required by all class loaders. Android provides several - * concrete implementations of the class, with - * {@link dalvik.system.PathClassLoader} being the one typically used. Other - * applications may implement subclasses of {@code ClassLoader} to provide - * special ways for loading classes. - *

- * @see Class - */ -public abstract class ClassLoader { - - // BEGIN android-note - /* - * Because of a potential class initialization race between ClassLoader and - * java.lang.System, reproducible when using JDWP with "suspend=y", we defer - * creation of the system class loader until first use. We use a static - * inner class to get synchronization at init time without having to sync on - * every access. - */ - // END android-note - /** - * The 'System' ClassLoader - the one that is responsible for loading - * classes from the classpath. It is not equal to the bootstrap class loader - - * that one handles the built-in classes. - * - * @see #getSystemClassLoader() - */ - static private class SystemClassLoader { - public static ClassLoader loader = ClassLoader.createSystemClassLoader(); - } - - /** - * The parent ClassLoader. - */ - private ClassLoader parent; - - /** - * The packages known to the class loader. - */ - private Map packages = new HashMap(); - - /** - * Create the system class loader. Note this is NOT the bootstrap class - * loader (which is managed by the VM). We use a null value for the parent - * to indicate that the bootstrap loader is our parent. - */ - private static ClassLoader createSystemClassLoader() { - String classPath = System.getProperty("java.class.path", "."); - - // String[] paths = classPath.split(":"); - // URL[] urls = new URL[paths.length]; - // for (int i = 0; i < paths.length; i++) { - // try { - // urls[i] = new URL("file://" + paths[i]); - // } - // catch (Exception ex) { - // ex.printStackTrace(); - // } - // } - // - // return new java.net.URLClassLoader(urls, null); - - // TODO Make this a java.net.URLClassLoader once we have those? - return new PathClassLoader(classPath, BootClassLoader.getInstance()); - } - - /** - * Returns the system class loader. This is the parent for new - * {@code ClassLoader} instances and is typically the class loader used to - * start the application. If a security manager is present and the caller's - * class loader is neither {@code null} nor the same as or an ancestor of - * the system class loader, then this method calls the security manager's - * checkPermission method with a RuntimePermission("getClassLoader") - * permission to ensure that it is ok to access the system class loader. If - * not, a {@code SecurityException} is thrown. - * - * @return the system class loader. - * @throws SecurityException - * if a security manager exists and it does not allow access to - * the system class loader. - */ - public static ClassLoader getSystemClassLoader() { - SecurityManager smgr = System.getSecurityManager(); - if (smgr != null) { - ClassLoader caller = VMStack.getCallingClassLoader(); - if (caller != null && !caller.isAncestorOf(SystemClassLoader.loader)) { - smgr.checkPermission(new RuntimePermission("getClassLoader")); - } - } - - return SystemClassLoader.loader; - } - - /** - * Finds the URL of the resource with the specified name. The system class - * loader's resource lookup algorithm is used to find the resource. - * - * @return the {@code URL} object for the requested resource or {@code null} - * if the resource can not be found. - * @param resName - * the name of the resource to find. - * @see Class#getResource - */ - public static URL getSystemResource(String resName) { - return SystemClassLoader.loader.getResource(resName); - } - - /** - * Returns an enumeration of URLs for the resource with the specified name. - * The system class loader's resource lookup algorithm is used to find the - * resource. - * - * @return an enumeration of {@code URL} objects containing the requested - * resources. - * @param resName - * the name of the resource to find. - * @throws IOException - * if an I/O error occurs. - */ - public static Enumeration getSystemResources(String resName) throws IOException { - return SystemClassLoader.loader.getResources(resName); - } - - /** - * Returns a stream for the resource with the specified name. The system - * class loader's resource lookup algorithm is used to find the resource. - * Basically, the contents of the java.class.path are searched in order, - * looking for a path which matches the specified resource. - * - * @return a stream for the resource or {@code null}. - * @param resName - * the name of the resource to find. - * @see Class#getResourceAsStream - */ - public static InputStream getSystemResourceAsStream(String resName) { - return SystemClassLoader.loader.getResourceAsStream(resName); - } - - /** - * Constructs a new instance of this class with the system class loader as - * its parent. - * - * @throws SecurityException - * if a security manager exists and it does not allow the - * creation of a new {@code ClassLoader}. - */ - protected ClassLoader() { - this(getSystemClassLoader(), false); - } - - /** - * Constructs a new instance of this class with the specified class loader - * as its parent. - * - * @param parentLoader - * The {@code ClassLoader} to use as the new class loader's - * parent. - * @throws SecurityException - * if a security manager exists and it does not allow the - * creation of new a new {@code ClassLoader}. - */ - protected ClassLoader(ClassLoader parentLoader) { - this(parentLoader, false); - } - - /* - * constructor for the BootClassLoader which needs parent to be null. - */ - ClassLoader(ClassLoader parentLoader, boolean nullAllowed) { - SecurityManager smgr = System.getSecurityManager(); - if (smgr != null) { - smgr.checkCreateClassLoader(); - } - - if (parentLoader == null && !nullAllowed) { - throw new NullPointerException( - "Parent ClassLoader may not be null"); - } - - parent = parentLoader; - } - - /** - * Constructs a new class from an array of bytes containing a class - * definition in class file format. - * - * @param classRep - * the memory image of a class file. - * @param offset - * the offset into {@code classRep}. - * @param length - * the length of the class file. - * @return the {@code Class} object created from the specified subset of - * data in {@code classRep}. - * @throws ClassFormatError - * if {@code classRep} does not contain a valid class. - * @throws IndexOutOfBoundsException - * if {@code offset < 0}, {@code length < 0} or if - * {@code offset + length} is greater than the length of - * {@code classRep}. - * @deprecated Use {@link #defineClass(String, byte[], int, int)} - */ - @Deprecated - protected final Class defineClass(byte[] classRep, int offset, int length) - throws ClassFormatError { - - return VMClassLoader.defineClass(this, classRep, offset, length, null); - } - - /** - * Constructs a new class from an array of bytes containing a class - * definition in class file format. - * - * @param className - * the expected name of the new class, may be {@code null} if not - * known. - * @param classRep - * the memory image of a class file. - * @param offset - * the offset into {@code classRep}. - * @param length - * the length of the class file. - * @return the {@code Class} object created from the specified subset of - * data in {@code classRep}. - * @throws ClassFormatError - * if {@code classRep} does not contain a valid class. - * @throws IndexOutOfBoundsException - * if {@code offset < 0}, {@code length < 0} or if - * {@code offset + length} is greater than the length of - * {@code classRep}. - */ - protected final Class defineClass(String className, byte[] classRep, int offset, int length) - throws ClassFormatError { - - // TODO Define a default ProtectionDomain on first use - return defineClass(className, classRep, offset, length, null); - } - - /** - * Constructs a new class from an array of bytes containing a class - * definition in class file format and assigns the specified protection - * domain to the new class. If the provided protection domain is - * {@code null} then a default protection domain is assigned to the class. - * - * @param className - * the expected name of the new class, may be {@code null} if not - * known. - * @param classRep - * the memory image of a class file. - * @param offset - * the offset into {@code classRep}. - * @param length - * the length of the class file. - * @param protectionDomain - * the protection domain to assign to the loaded class, may be - * {@code null}. - * @return the {@code Class} object created from the specified subset of - * data in {@code classRep}. - * @throws ClassFormatError - * if {@code classRep} does not contain a valid class. - * @throws IndexOutOfBoundsException - * if {@code offset < 0}, {@code length < 0} or if - * {@code offset + length} is greater than the length of - * {@code classRep}. - * @throws NoClassDefFoundError - * if {@code className} is not equal to the name of the class - * contained in {@code classRep}. - */ - protected final Class defineClass(String className, byte[] classRep, int offset, int length, - ProtectionDomain protectionDomain) throws java.lang.ClassFormatError { - - return VMClassLoader.defineClass(this, className, classRep, offset, length, - protectionDomain); - } - - /** - * Defines a new class with the specified name, byte code from the byte - * buffer and the optional protection domain. If the provided protection - * domain is {@code null} then a default protection domain is assigned to - * the class. - * - * @param name - * the expected name of the new class, may be {@code null} if not - * known. - * @param b - * the byte buffer containing the byte code of the new class. - * @param protectionDomain - * the protection domain to assign to the loaded class, may be - * {@code null}. - * @return the {@code Class} object created from the data in {@code b}. - * @throws ClassFormatError - * if {@code b} does not contain a valid class. - * @throws NoClassDefFoundError - * if {@code className} is not equal to the name of the class - * contained in {@code b}. - */ - protected final Class defineClass(String name, ByteBuffer b, - ProtectionDomain protectionDomain) throws ClassFormatError { - - byte[] temp = new byte[b.remaining()]; - b.get(temp); - return defineClass(name, temp, 0, temp.length, protectionDomain); - } - - /** - * Overridden by subclasses, throws a {@code ClassNotFoundException} by - * default. This method is called by {@code loadClass} after the parent - * {@code ClassLoader} has failed to find a loaded class of the same name. - * - * @param className - * the name of the class to look for. - * @return the {@code Class} object that is found. - * @throws ClassNotFoundException - * if the class cannot be found. - */ - protected Class findClass(String className) throws ClassNotFoundException { - throw new ClassNotFoundException(className); - } - - /** - * Returns the class with the specified name if it has already been loaded - * by the virtual machine or {@code null} if it has not yet been loaded. - * - * @param className - * the name of the class to look for. - * @return the {@code Class} object or {@code null} if the requested class - * has not been loaded. - */ - protected final Class findLoadedClass(String className) { - ClassLoader loader; - if (this == BootClassLoader.getInstance()) - loader = null; - else - loader = this; - return VMClassLoader.findLoadedClass(loader, className); - } - - /** - * Finds the class with the specified name, loading it using the system - * class loader if necessary. - * - * @param className - * the name of the class to look for. - * @return the {@code Class} object with the requested {@code className}. - * @throws ClassNotFoundException - * if the class can not be found. - */ - protected final Class findSystemClass(String className) throws ClassNotFoundException { - return Class.forName(className, false, getSystemClassLoader()); - } - - /** - * Returns this class loader's parent. - * - * @return this class loader's parent or {@code null}. - * @throws SecurityException - * if a security manager exists and it does not allow to - * retrieve the parent class loader. - */ - public final ClassLoader getParent() { - SecurityManager smgr = System.getSecurityManager(); - if (smgr != null) { - smgr.checkPermission(new RuntimePermission("getClassLoader")); - } - - return parent; - } - - /** - * Returns the URL of the resource with the specified name. This - * implementation first tries to use the parent class loader to find the - * resource; if this fails then {@link #findResource(String)} is called to - * find the requested resource. - * - * @param resName - * the name of the resource to find. - * @return the {@code URL} object for the requested resource or {@code null} - * if either the resource can not be found or a security manager - * does not allow to access the resource. - * @see Class#getResource - */ - public URL getResource(String resName) { - URL resource = null; - - resource = parent.getResource(resName); - - if (resource == null) { - resource = findResource(resName); - } - - return resource; - } - - /** - * Returns an enumeration of URLs for the resource with the specified name. - * This implementation first uses this class loader's parent to find the - * resource, then it calls {@link #findResources(String)} to get additional - * URLs. The returned enumeration contains the {@code URL} objects of both - * find operations. - * - * @return an enumeration of {@code URL} objects for the requested resource. - * @param resName - * the name of the resource to find. - * @throws IOException - * if an I/O error occurs. - */ - @SuppressWarnings("unchecked") - public Enumeration getResources(String resName) throws IOException { - - Enumeration first = parent.getResources(resName); - Enumeration second = findResources(resName); - - return new TwoEnumerationsInOne(first, second); - } - - /** - * Returns a stream for the resource with the specified name. See - * {@link #getResource(String)} for a description of the lookup algorithm - * used to find the resource. - * - * @return a stream for the resource or {@code null} if either the resource - * can not be found or a security manager does not allow to access - * the resource. - * @param resName - * the name of the resource to find. - * @see Class#getResourceAsStream - */ - public InputStream getResourceAsStream(String resName) { - try { - URL url = getResource(resName); - if (url != null) { - return url.openStream(); - } - } catch (IOException ex) { - // Don't want to see the exception. - } - - return null; - } - - /** - * Loads the class with the specified name. Invoking this method is - * equivalent to calling {@code loadClass(className, false)}. - *

- * Note: In the Android reference implementation, the - * second parameter of {@link #loadClass(String, boolean)} is ignored - * anyway. - *

- * - * @return the {@code Class} object. - * @param className - * the name of the class to look for. - * @throws ClassNotFoundException - * if the class can not be found. - */ - public Class loadClass(String className) throws ClassNotFoundException { - return loadClass(className, false); - } - - /** - * Loads the class with the specified name, optionally linking it after - * loading. The following steps are performed: - *
    - *
  1. Call {@link #findLoadedClass(String)} to determine if the requested - * class has already been loaded.
  2. - *
  3. If the class has not yet been loaded: Invoke this method on the - * parent class loader.
  4. - *
  5. If the class has still not been loaded: Call - * {@link #findClass(String)} to find the class.
  6. - *
- *

- * Note: In the Android reference implementation, the - * {@code resolve} parameter is ignored; classes are never linked. - *

- * - * @return the {@code Class} object. - * @param className - * the name of the class to look for. - * @param resolve - * Indicates if the class should be resolved after loading. This - * parameter is ignored on the Android reference implementation; - * classes are not resolved. - * @throws ClassNotFoundException - * if the class can not be found. - */ - protected Class loadClass(String className, boolean resolve) throws ClassNotFoundException { - Class clazz = findLoadedClass(className); - - if (clazz == null) { - try { - clazz = parent.loadClass(className, false); - } catch (ClassNotFoundException e) { - // Don't want to see this. - } - - if (clazz == null) { - clazz = findClass(className); - } - } - - return clazz; - } - - /** - * Forces a class to be linked (initialized). If the class has already been - * linked this operation has no effect. - *

- * Note: In the Android reference implementation, this - * method has no effect. - *

- * - * @param clazz - * the class to link. - */ - protected final void resolveClass(Class clazz) { - // no-op, doesn't make sense on android. - } - - /** - * Indicates whether this class loader is the system class loader. This - * method must be provided by the virtual machine vendor, as it is used by - * other provided class implementations in this package. A sample - * implementation of this method is provided by the reference - * implementation. This method is used by - * SecurityManager.classLoaderDepth(), currentClassLoader() and - * currentLoadedClass(). Returns true if the receiver is a system class - * loader. - *

- * Note that this method has package visibility only. It is defined here to - * avoid the security manager check in getSystemClassLoader, which would be - * required to implement this method anywhere else. - *

- * - * @return {@code true} if the receiver is a system class loader - * @see Class#getClassLoaderImpl() - */ - final boolean isSystemClassLoader() { - return false; - } - - /** - *

- * Returns true if the receiver is ancestor of another class loader. It also - * returns true if the two class loader are equal. - *

- *

- * Note that this method has package visibility only. It is defined here to - * avoid the security manager check in getParent, which would be required to - * implement this method anywhere else. The method is also required in other - * places where class loaders are accesses. - *

- * - * @param child - * A child candidate - * @return {@code true} if the receiver is ancestor of, or equal to, - * the parameter - */ - final boolean isAncestorOf(ClassLoader child) { - for (ClassLoader current = child; current != null; - current = current.parent) { - if (current == this) { - return true; - } - } - return false; - } - - /** - * Finds the URL of the resource with the specified name. This - * implementation just returns {@code null}; it should be overridden in - * subclasses. - * - * @param resName - * the name of the resource to find. - * @return the {@code URL} object for the requested resource. - */ - protected URL findResource(String resName) { - return null; - } - - /** - * Finds an enumeration of URLs for the resource with the specified name. - * This implementation just returns an empty {@code Enumeration}; it should - * be overridden in subclasses. - * - * @param resName - * the name of the resource to find. - * @return an enumeration of {@code URL} objects for the requested resource. - * @throws IOException - * if an I/O error occurs. - */ - @SuppressWarnings( { - "unchecked", "unused" - }) - protected Enumeration findResources(String resName) throws IOException { - return EmptyEnumeration.getInstance(); - } - - /** - * Returns the absolute path of the native library with the specified name, - * or {@code null}. If this method returns {@code null} then the virtual - * machine searches the directories specified by the system property - * "java.library.path". - *

- * This implementation always returns {@code null}. - *

- * - * @param libName - * the name of the library to find. - * @return the absolute path of the library. - */ - protected String findLibrary(String libName) { - return null; - } - - /** - * Returns the package with the specified name. Package information is - * searched in this class loader. - * - * @param name - * the name of the package to find. - * @return the package with the requested name; {@code null} if the package - * can not be found. - */ - protected Package getPackage(String name) { - synchronized (packages) { - Package p = packages.get(name); - return p; - } - } - - /** - * Gets the package with the specified name, searching it in the specified - * class loader. - * - * @param loader - * the class loader to search the package in. - * @param name - * the name of the package to find. - * @return the package with the requested name; {@code null} if the package - * can not be found. - */ - static Package getPackage(ClassLoader loader, String name) { - return loader.getPackage(name); - } - - /** - * Returns all the packages known to this class loader. - * - * @return an array with all packages known to this class loader. - */ - protected Package[] getPackages() { - synchronized (packages) { - Collection col = packages.values(); - Package[] result = new Package[col.size()]; - col.toArray(result); - return result; - } - } - - /** - * Defines and returns a new {@code Package} using the specified - * information. If {@code sealBase} is {@code null}, the package is left - * unsealed. Otherwise, the package is sealed using this URL. - * - * @param name - * the name of the package. - * @param specTitle - * the title of the specification. - * @param specVersion - * the version of the specification. - * @param specVendor - * the vendor of the specification. - * @param implTitle - * the implementation title. - * @param implVersion - * the implementation version. - * @param implVendor - * the specification vendor. - * @param sealBase - * the URL used to seal this package or {@code null} to leave the - * package unsealed. - * @return the {@code Package} object that has been created. - * @throws IllegalArgumentException - * if a package with the specified name already exists. - */ - protected Package definePackage(String name, String specTitle, String specVersion, - String specVendor, String implTitle, String implVersion, String implVendor, URL sealBase) - throws IllegalArgumentException { - - synchronized (packages) { - if (packages.containsKey(name)) { - throw new IllegalArgumentException("Package " + name + " already defined"); - } - - Package newPackage = new Package(name, specTitle, specVersion, specVendor, implTitle, - implVersion, implVendor, sealBase); - - packages.put(name, newPackage); - - return newPackage; - } - } - - /** - * Gets the signers of the specified class. This implementation returns - * {@code null}. - * - * @param c - * the {@code Class} object for which to get the signers. - * @return signers the signers of {@code c}. - */ - final Object[] getSigners(Class c) { - return null; - } - - /** - * Sets the signers of the specified class. This implementation does - * nothing. - * - * @param c - * the {@code Class} object for which to set the signers. - * @param signers - * the signers for {@code c}. - */ - protected final void setSigners(Class c, Object[] signers) { - return; - } - - /** - *

- * This must be provided by the VM vendor. It is used by - * SecurityManager.checkMemberAccess() with depth = 3. Note that - * checkMemberAccess() assumes the following stack when called:
- *

- * - *
-     *          < user code &gt; <- want this class
-     *          Class.getDeclared*();
-     *          Class.checkMemberAccess();
-     *          SecurityManager.checkMemberAccess(); <- current frame
-     * 
- * - *

- * Returns the ClassLoader of the method (including natives) at the - * specified depth on the stack of the calling thread. Frames representing - * the VM implementation of java.lang.reflect are not included in the list. - *

- * Notes: - *
    - *
  • This method operates on the defining classes of methods on stack. - * NOT the classes of receivers.
  • - *
  • The item at depth zero is the caller of this method
  • - *
- * - * @param depth - * the stack depth of the requested ClassLoader - * @return the ClassLoader at the specified depth - */ - static final ClassLoader getStackClassLoader(int depth) { - Class[] stack = VMStack.getClasses(depth + 1, false); - if(stack.length < depth + 1) { - return null; - } - return stack[depth].getClassLoader(); - } - - /** - * This method must be provided by the VM vendor, as it is called by - * java.lang.System.loadLibrary(). System.loadLibrary() cannot call - * Runtime.loadLibrary() because this method loads the library using the - * ClassLoader of the calling method. Loads and links the library specified - * by the argument. - * - * @param libName - * the name of the library to load - * @param loader - * the classloader in which to load the library - * @throws UnsatisfiedLinkError - * if the library could not be loaded - * @throws SecurityException - * if the library was not allowed to be loaded - *

- * Note: This method does nothing in the Android reference - * implementation. - *

- */ - static void loadLibraryWithClassLoader(String libName, ClassLoader loader) { - return; - } - - /** - * This method must be provided by the VM vendor, as it is called by - * java.lang.System.load(). System.load() cannot call Runtime.load() because - * the library is loaded using the ClassLoader of the calling method. Loads - * and links the library specified by the argument. No security check is - * done. - *

- * Note: This method does nothing in the Android reference - * implementation. - *

- * - * @param libName - * the name of the library to load - * @param loader - * the classloader in which to load the library - * @param libraryPath - * the library path to search, or null - * @throws UnsatisfiedLinkError - * if the library could not be loaded - */ - static void loadLibraryWithPath(String libName, ClassLoader loader, String libraryPath) { - return; - } - - /** - * Sets the assertion status of the class with the specified name. - *

- * Note: This method does nothing in the Android reference - * implementation. - *

- * - * @param cname - * the name of the class for which to set the assertion status. - * @param enable - * the new assertion status. - */ - public void setClassAssertionStatus(String cname, boolean enable) { - return; - } - - /** - * Sets the assertion status of the package with the specified name. - *

- * Note: This method does nothing in the Android reference - * implementation. - *

- * - * @param pname - * the name of the package for which to set the assertion status. - * @param enable - * the new assertion status. - */ - public void setPackageAssertionStatus(String pname, boolean enable) { - return; - } - - /** - * Sets the default assertion status for this class loader. - *

- * Note: This method does nothing in the Android reference - * implementation. - *

- * - * @param enable - * the new assertion status. - */ - public void setDefaultAssertionStatus(boolean enable) { - return; - } - - /** - * Sets the default assertion status for this class loader to {@code false} - * and removes any package default and class assertion status settings. - *

- * Note: This method does nothing in the Android reference - * implementation. - *

- */ - public void clearAssertionStatus() { - return; - } - - /** - * Returns the assertion status of the named class Returns the assertion - * status of the class or nested class if it has been set. Otherwise returns - * the assertion status of its package or superpackage if that has been set. - * Otherwise returns the default assertion status. Returns 1 for enabled and - * 0 for disabled. - * - * @return the assertion status. - * @param cname - * the name of class. - */ - boolean getClassAssertionStatus(String cname) { - return false; - } - - /** - * Returns the assertion status of the named package Returns the assertion - * status of the named package or superpackage if that has been set. - * Otherwise returns the default assertion status. Returns 1 for enabled and - * 0 for disabled. - * - * @return the assertion status. - * @param pname - * the name of package. - */ - boolean getPackageAssertionStatus(String pname) { - return false; - } - - /** - * Returns the default assertion status - * - * @return the default assertion status. - */ - boolean getDefaultAssertionStatus() { - return false; - } -} - -/* - * Provides a helper class that combines two existing URL enumerations into one. - * It is required for the getResources() methods. Items are fetched from the - * first enumeration until it's empty, then from the second one. - */ -class TwoEnumerationsInOne implements Enumeration { - - private Enumeration first; - - private Enumeration second; - - public TwoEnumerationsInOne(Enumeration first, Enumeration second) { - this.first = first; - this.second = second; - } - - public boolean hasMoreElements() { - return first.hasMoreElements() || second.hasMoreElements(); - } - - public URL nextElement() { - if (first.hasMoreElements()) { - return first.nextElement(); - } else { - return second.nextElement(); - } - } - -} - -/** - * Provides an explicit representation of the boot class loader. It sits at the - * head of the class loader chain and delegates requests to the VM's internal - * class loading mechanism. - */ -class BootClassLoader extends ClassLoader { - - static BootClassLoader instance; - - public static synchronized BootClassLoader getInstance() { - if (instance == null) { - instance = new BootClassLoader(); - } - - return instance; - } - - public BootClassLoader() { - super(null, true); - } - - @Override - protected Class findClass(String name) throws ClassNotFoundException { - return VMClassLoader.loadClass(name, false); - } - - @Override - protected URL findResource(String name) { - return VMClassLoader.getResource(name); - } - - @SuppressWarnings("unused") - @Override - protected Enumeration findResources(String resName) throws IOException { - Enumeration result = VMClassLoader.getResources(resName); - - // VMClassLoader doesn't keep the contract for getResources() - if (result == null) { - result = EmptyEnumeration.getInstance(); - } - - return result; - } - - /** - * Returns package information for the given package. Unfortunately, the - * Android BootClassLoader doesn't really have this information, and as a - * non-secure ClassLoader, it isn't even required to, according to the spec. - * Yet, we want to provide it, in order to make all those hopeful callers of - * {@code myClass.getPackage().getName()} happy. Thus we construct a Package - * object the first time it is being requested and fill most of the fields - * with dummy values. The Package object is then put into the ClassLoader's - * Package cache, so we see the same one next time. We don't create Package - * objects for null arguments or for the default package. - *

- * There a limited chance that we end up with multiple Package objects - * representing the same package: It can happen when when a package is - * scattered across different JAR files being loaded by different - * ClassLoaders. Rather unlikely, and given that this whole thing is more or - * less a workaround, probably not worth the effort. - */ - @Override - protected Package getPackage(String name) { - if (name != null && !"".equals(name)) { - synchronized (this) { - Package pack = super.getPackage(name); - - if (pack == null) { - pack = definePackage(name, "Unknown", "0.0", "Unknown", "Unknown", "0.0", - "Unknown", null); - } - - return pack; - } - } - - return null; - } - - @Override - public URL getResource(String resName) { - return findResource(resName); - } - - @Override - protected Class loadClass(String className, boolean resolve) - throws ClassNotFoundException { - Class clazz = findLoadedClass(className); - - if (clazz == null) { - clazz = findClass(className); - } - - return clazz; - } - - @Override - public Enumeration getResources(String resName) throws IOException { - return findResources(resName); - } -} - -/** - * TODO Open issues - Missing / empty methods - Signer stuff - Protection - * domains - Assertions - */ diff --git a/luni-kernel/src/main/java/java/lang/Compiler.java b/luni-kernel/src/main/java/java/lang/Compiler.java deleted file mode 100644 index 88251e7..0000000 --- a/luni-kernel/src/main/java/java/lang/Compiler.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package java.lang; - -/** - * Placeholder class for environments which explicitly manage the action of a - * Just In Time (JIT) compiler. This class is usually implemented by - * the virtual machine vendor. - */ -public final class Compiler { - - /** - * Prevent this class from being instantiated. - */ - private Compiler(){ - //do nothing - } - - /** - * Executes an operation according to the specified command object. This - * method is the low-level interface to the JIT compiler. It may return any - * object or {@code null} if no JIT compiler is available. Returns null - * on Android, whether or not the system has a JIT. - * - * @param cmd - * the command object for the JIT compiler. - * @return the result of executing command or {@code null}. - */ - public static Object command(Object cmd) { - return null; - } - - /** - * Compiles the specified class using the JIT compiler and indicates if - * compilation has been successful. Does nothing and returns false on - * Android. - * - * @param classToCompile - * java.lang.Class the class to JIT compile - * @return {@code true} if the compilation has been successful; - * {@code false} if it has failed or if there is no JIT compiler - * available. - */ - public static boolean compileClass(Class classToCompile) { - return false; - } - - /** - * Compiles all classes whose name matches the specified name using the JIT - * compiler and indicates if compilation has been successful. Does nothing - * and returns false on Android. - * - * @param nameRoot - * the string to match class names with. - * @return {@code true} if the compilation has been successful; - * {@code false} if it has failed or if there is no JIT compiler - * available. - */ - public static boolean compileClasses(String nameRoot) { - return false; - } - - /** - * Disables the JIT compiler. Does nothing on Android. - */ - public static void disable() { - return; - } - - /** - * Enables the JIT compiler. Does nothing on Android. - */ - public static void enable() { - return; - } - -} diff --git a/luni-kernel/src/main/java/java/lang/LangAccessImpl.java b/luni-kernel/src/main/java/java/lang/LangAccessImpl.java deleted file mode 100644 index 44d4aac..0000000 --- a/luni-kernel/src/main/java/java/lang/LangAccessImpl.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package java.lang; - -import org.apache.harmony.kernel.vm.LangAccess; - -/** - * Implementation of bridge into java.lang. - */ -/*package*/ final class LangAccessImpl extends LangAccess { - /** non-null; unique instance of this class */ - /*package*/ static final LangAccessImpl THE_ONE = new LangAccessImpl(); - - /** - * This class is not publicly instantiable. Use {@link #THE_ONE}. - */ - private LangAccessImpl() { - // This space intentionally left blank. - } - - /** {@inheritDoc} */ - public T[] getEnumValuesInOrder(Class clazz) { - ClassCache cache = clazz.getClassCache(); - return cache.getEnumValuesInOrder(); - } - - /** {@inheritDoc} */ - public void unpark(Thread thread) { - thread.unpark(); - } - - /** {@inheritDoc} */ - public void parkFor(long nanos) { - Thread.currentThread().parkFor(nanos); - } - - /** {@inheritDoc} */ - public void parkUntil(long time) { - Thread.currentThread().parkUntil(time); - } -} diff --git a/luni-kernel/src/main/java/java/lang/Object.java b/luni-kernel/src/main/java/java/lang/Object.java deleted file mode 100644 index bdb66b9..0000000 --- a/luni-kernel/src/main/java/java/lang/Object.java +++ /dev/null @@ -1,354 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package java.lang; - -/** - * The root class of the Java class hierarchy. All non-primitive types - * (including arrays) inherit either directly or indirectly from this class. - *

- * {@code Object} provides some fundamental methods for accessing the - * {@link Class} of an object, getting its {@link #hashCode()}, or checking - * whether one object {@link #equals(Object)} another. The {@link #toString()} - * method can be used to convert an object reference into a printable string and - * is often overridden in subclasses. - *

- * The {@link #wait()} and {@link #notify()} methods provide a foundation for - * synchronization, acquiring and releasing an internal monitor associated with - * each {@code Object}. - */ -public class Object { - - /** - * Constructs a new instance of {@code Object}. - */ - public Object() { - } - - /** - * Creates and returns a copy of this {@code Object}. The default - * implementation returns a so-called "shallow" copy: It creates a new - * instance of the same class and then copies the field values (including - * object references) from this instance to the new instance. A "deep" copy, - * in contrast, would also recursively clone nested objects. A subclass that - * needs to implement this kind of cloning should call {@code super.clone()} - * to create the new instance and then create deep copies of the nested, - * mutable objects. - * - * @return a copy of this object. - * @throws CloneNotSupportedException - * if this object's class does not implement the {@code - * Cloneable} interface. - */ - protected Object clone() throws CloneNotSupportedException { - if (!(this instanceof Cloneable)) { - throw new CloneNotSupportedException("Class doesn't implement Cloneable"); - } - - return internalClone((Cloneable) this); - } - - /* - * Native helper method for cloning. - */ - private native Object internalClone(Cloneable o); - - /** - * Compares this instance with the specified object and indicates if they - * are equal. In order to be equal, {@code o} must represent the same object - * as this instance using a class-specific comparison. The general contract - * is that this comparison should be both transitive and reflexive. - *

- * The implementation in {@code Object} returns {@code true} only if {@code - * o} is the exact same object as the receiver (using the == operator for - * comparison). Subclasses often implement {@code equals(Object)} so that - * it takes into account the two object's types and states. - *

- *

- * The general contract for the {@code equals(Object)} and {@link - * #hashCode()} methods is that if {@code equals} returns {@code true} for - * any two objects, then {@code hashCode()} must return the same value for - * these objects. This means that subclasses of {@code Object} usually - * override either both methods or none of them. - *

- * - * @param o - * the object to compare this instance with. - * @return {@code true} if the specified object is equal to this {@code - * Object}; {@code false} otherwise. - * @see #hashCode - */ - public boolean equals(Object o) { - return this == o; - } - - /** - * Is called before the object's memory is being reclaimed by the VM. This - * can only happen once the VM has detected, during a run of the garbage - * collector, that the object is no longer reachable by any thread of the - * running application. - *

- * The method can be used to free system resources or perform other cleanup - * before the object is garbage collected. The default implementation of the - * method is empty, which is also expected by the VM, but subclasses can - * override {@code finalize()} as required. Uncaught exceptions which are - * thrown during the execution of this method cause it to terminate - * immediately but are otherwise ignored. - *

- * Note that the VM does guarantee that {@code finalize()} is called at most - * once for any object, but it doesn't guarantee when (if at all) {@code - * finalize()} will be called. For example, object B's {@code finalize()} - * can delay the execution of object A's {@code finalize()} method and - * therefore it can delay the reclamation of A's memory. To be safe, use a - * {@link java.lang.ref.ReferenceQueue}, because it provides more control - * over the way the VM deals with references during garbage collection. - *

- * - * @throws Throwable - * any exception which is raised during finalization; these are - * ignored by the virtual machine. - */ - protected void finalize() throws Throwable { - } - - /** - * Returns the unique instance of {@link Class} that represents this - * object's class. Note that {@code getClass()} is a special case in that it - * actually returns {@code Class} where {@code Foo} is the - * erasure of the type of the expression {@code getClass()} was called upon. - *

- * As an example, the following code actually compiles, although one might - * think it shouldn't: - *

- *

-     * List l = new ArrayList();
-     * Class c = l.getClass();
-     * 
- * - * @return this object's {@code Class} instance. - */ - public final native Class getClass(); - - /** - * Returns an integer hash code for this object. By contract, any two - * objects for which {@code equals(Object)} returns {@code true} must return - * the same hash code value. This means that subclasses of {@code Object} - * usually override both methods or neither method. - * - * @return this object's hash code. - * @see #equals - */ - public native int hashCode(); - - /** - * Causes a thread which is waiting on this object's monitor (by means of - * calling one of the {@code wait()} methods) to be woken up. If more than - * one thread is waiting, one of them is chosen at the discretion of the - * virtual machine. The chosen thread will not run immediately. The thread - * that called {@code notify()} has to release the object's monitor first. - * Also, the chosen thread still has to compete against other threads that - * try to synchronize on the same object. - *

- * This method can only be invoked by a thread which owns this object's - * monitor. A thread becomes owner of an object's monitor - *

- *
    - *
  • by executing a synchronized method of that object;
  • - *
  • by executing the body of a {@code synchronized} statement that - * synchronizes on the object;
  • - *
  • by executing a synchronized static method if the object is of type - * {@code Class}.
  • - *
- * - * @see #notifyAll - * @see #wait() - * @see #wait(long) - * @see #wait(long,int) - * @see java.lang.Thread - */ - public final native void notify(); - - /** - * Causes all threads which are waiting on this object's monitor (by means - * of calling one of the {@code wait()} methods) to be woken up. The threads - * will not run immediately. The thread that called {@code notify()} has to - * release the object's monitor first. Also, the threads still have to - * compete against other threads that try to synchronize on the same object. - *

- * This method can only be invoked by a thread which owns this object's - * monitor. A thread becomes owner of an object's monitor - *

- *
    - *
  • by executing a synchronized method of that object;
  • - *
  • by executing the body of a {@code synchronized} statement that - * synchronizes on the object;
  • - *
  • by executing a synchronized static method if the object is of type - * {@code Class}.
  • - *
- * - * @throws IllegalMonitorStateException - * if the thread calling this method is not the owner of this - * object's monitor. - * @see #notify - * @see #wait() - * @see #wait(long) - * @see #wait(long,int) - * @see java.lang.Thread - */ - public final native void notifyAll(); - - /** - * Returns a string containing a concise, human-readable description of this - * object. Subclasses are encouraged to override this method and provide an - * implementation that takes into account the object's type and data. The - * default implementation simply concatenates the class name, the '@' sign - * and a hexadecimal representation of the object's {@link #hashCode()}, - * that is, it is equivalent to the following expression: - * - *
-     * getClass().getName() + '@' + Integer.toHexString(hashCode())
-     * 
- * - * @return a printable representation of this object. - */ - public String toString() { - return getClass().getName() + '@' + Integer.toHexString(hashCode()); - } - - /** - * Causes the calling thread to wait until another thread calls the {@code - * notify()} or {@code notifyAll()} method of this object. This method can - * only be invoked by a thread which owns this object's monitor; see - * {@link #notify()} on how a thread can become the owner of a monitor. - *

- * A waiting thread can be sent {@code interrupt()} to cause it to - * prematurely stop waiting, so {@code wait} should be called in a loop to - * check that the condition that has been waited for has been met before - * continuing. - *

- *

- * While the thread waits, it gives up ownership of this object's monitor. - * When it is notified (or interrupted), it re-acquires the monitor before - * it starts running. - *

- * - * @throws IllegalMonitorStateException - * if the thread calling this method is not the owner of this - * object's monitor. - * @throws InterruptedException - * if another thread interrupts this thread while it is waiting. - * @see #notify - * @see #notifyAll - * @see #wait(long) - * @see #wait(long,int) - * @see java.lang.Thread - */ - public final void wait() throws InterruptedException { - wait(0 ,0); - } - - /** - * Causes the calling thread to wait until another thread calls the {@code - * notify()} or {@code notifyAll()} method of this object or until the - * specified timeout expires. This method can only be invoked by a thread - * which owns this object's monitor; see {@link #notify()} on how a thread - * can become the owner of a monitor. - *

- * A waiting thread can be sent {@code interrupt()} to cause it to - * prematurely stop waiting, so {@code wait} should be called in a loop to - * check that the condition that has been waited for has been met before - * continuing. - *

- *

- * While the thread waits, it gives up ownership of this object's monitor. - * When it is notified (or interrupted), it re-acquires the monitor before - * it starts running. - *

- * - * @param millis - * the maximum time to wait in milliseconds. - * @throws IllegalArgumentException - * if {@code millis < 0}. - * @throws IllegalMonitorStateException - * if the thread calling this method is not the owner of this - * object's monitor. - * @throws InterruptedException - * if another thread interrupts this thread while it is waiting. - * @see #notify - * @see #notifyAll - * @see #wait() - * @see #wait(long,int) - * @see java.lang.Thread - */ - public final void wait(long millis) throws InterruptedException { - wait(millis, 0); - } - - /** - * Causes the calling thread to wait until another thread calls the {@code - * notify()} or {@code notifyAll()} method of this object or until the - * specified timeout expires. This method can only be invoked by a thread - * that owns this object's monitor; see {@link #notify()} on how a thread - * can become the owner of a monitor. - *

- * A waiting thread can be sent {@code interrupt()} to cause it to - * prematurely stop waiting, so {@code wait} should be called in a loop to - * check that the condition that has been waited for has been met before - * continuing. - *

- *

- * While the thread waits, it gives up ownership of this object's monitor. - * When it is notified (or interrupted), it re-acquires the monitor before - * it starts running. - *

- * - * @param millis - * the maximum time to wait in milliseconds. - * @param nanos - * the fraction of a millisecond to wait, specified in - * nanoseconds. - * @throws IllegalArgumentException - * if {@code millis < 0}, {@code nanos < 0} or {@code nanos > - * 999999}. - * @throws IllegalMonitorStateException - * if the thread calling this method is not the owner of this - * object's monitor. - * @throws InterruptedException - * if another thread interrupts this thread while it is waiting. - * @see #notify - * @see #notifyAll - * @see #wait() - * @see #wait(long,int) - * @see java.lang.Thread - */ - public final native void wait(long millis, int nanos) throws InterruptedException; -} diff --git a/luni-kernel/src/main/java/java/lang/Package.java b/luni-kernel/src/main/java/java/lang/Package.java deleted file mode 100644 index 9ad40b8..0000000 --- a/luni-kernel/src/main/java/java/lang/Package.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package java.lang; - -import dalvik.system.VMStack; - -import java.lang.annotation.Annotation; -import java.lang.reflect.AnnotatedElement; -import java.net.URL; - -/** - * Contains information about a Java package. This includes implementation and - * specification versions. Typically this information is retrieved from the - * manifest. - *

- * Packages are managed by class loaders. All classes loaded by the same loader - * from the same package share a {@code Package} instance. - *

- * - * @see java.lang.ClassLoader - */ -public class Package implements AnnotatedElement { - - private final String name, specTitle, specVersion, specVendor, implTitle, - implVersion, implVendor; - private final URL sealBase; - - Package(String name, String specTitle, String specVersion, String specVendor, - String implTitle, String implVersion, String implVendor, URL sealBase) { - this.name = name; - this.specTitle = specTitle; - this.specVersion = specVersion; - this.specVendor = specVendor; - this.implTitle = implTitle; - this.implVersion = implVersion; - this.implVendor = implVendor; - this.sealBase = sealBase; - } - - /** - * Gets the annotation associated with the specified annotation type and - * this package, if present. - * - * @param annotationType - * the annotation type to look for. - * @return an instance of {@link Annotation} or {@code null}. - * @see java.lang.reflect.AnnotatedElement#getAnnotation(java.lang.Class) - */ - @SuppressWarnings("unchecked") - public
A getAnnotation(Class annotationType) { - Annotation[] list = getAnnotations(); - for (int i = 0; i < list.length; i++) { - if (annotationType.isInstance(list[i])) { - return (A) list[i]; - } - } - - return null; - } - - /** - * Gets all annotations associated with this package, if any. - * - * @return an array of {@link Annotation} instances, which may be empty. - * @see java.lang.reflect.AnnotatedElement#getAnnotations() - */ - public Annotation[] getAnnotations() { - return getDeclaredAnnotations(this, true); - } - - /** - * Gets all annotations directly declared on this package, if any. - * - * @return an array of {@link Annotation} instances, which may be empty. - * @see java.lang.reflect.AnnotatedElement#getDeclaredAnnotations() - */ - public Annotation[] getDeclaredAnnotations() { - return getDeclaredAnnotations(this, false); - } - - /* - * Returns the list of declared annotations of the given package. - * If no annotations exist, an empty array is returned. - * - * @param pkg the package of interest - * @param publicOnly reflects whether we want only public annotation or all - * of them. - * @return the list of annotations - */ - // TODO(Google) Provide proper (native) implementation. - private static native Annotation[] getDeclaredAnnotations(Package pkg, - boolean publicOnly); - - /** - * Indicates whether the specified annotation is present. - * - * @param annotationType - * the annotation type to look for. - * @return {@code true} if the annotation is present; {@code false} - * otherwise. - * @see java.lang.reflect.AnnotatedElement#isAnnotationPresent(java.lang.Class) - */ - public boolean isAnnotationPresent( - Class annotationType) { - return getAnnotation(annotationType) != null; - } - - /** - * Returns the title of the implementation of this package, or {@code null} - * if this is unknown. The format of this string is unspecified. - * - * @return the implementation title, may be {@code null}. - */ - public String getImplementationTitle() { - return implTitle; - } - - /** - * Returns the name of the vendor or organization that provides this - * implementation of the package, or {@code null} if this is unknown. The - * format of this string is unspecified. - * - * @return the implementation vendor name, may be {@code null}. - */ - public String getImplementationVendor() { - return implVendor; - } - - /** - * Returns the version of the implementation of this package, or {@code - * null} if this is unknown. The format of this string is unspecified. - * - * @return the implementation version, may be {@code null}. - */ - public String getImplementationVersion() { - return implVersion; - } - - /** - * Returns the name of this package in the standard dot notation; for - * example: "java.lang". - * - * @return the name of this package. - */ - public String getName() { - return name; - } - - /** - * Attempts to locate the requested package in the caller's class loader. If - * no package information can be located, {@code null} is returned. - * - * @param packageName - * the name of the package to find. - * @return the requested package, or {@code null}. - * @see ClassLoader#getPackage(java.lang.String) - */ - public static Package getPackage(String packageName) { - ClassLoader classloader = VMStack.getCallingClassLoader(); - return classloader.getPackage(packageName); - } - - /** - * Returns all the packages known to the caller's class loader. - * - * @return all the packages known to the caller's class loader. - * @see ClassLoader#getPackages - */ - public static Package[] getPackages() { - ClassLoader classloader = VMStack.getCallingClassLoader(); - return classloader.getPackages(); - } - - /** - * Returns the title of the specification this package implements, or - * {@code null} if this is unknown. - * - * @return the specification title, may be {@code null}. - */ - public String getSpecificationTitle() { - return specTitle; - } - - /** - * Returns the name of the vendor or organization that owns and maintains - * the specification this package implements, or {@code null} if this is - * unknown. - * - * @return the specification vendor name, may be {@code null}. - */ - public String getSpecificationVendor() { - return specVendor; - } - - /** - * Returns the version of the specification this package implements, or - * {@code null} if this is unknown. The version string is a sequence of - * non-negative integers separated by dots; for example: "1.2.3". - * - * @return the specification version string, may be {@code null}. - */ - public String getSpecificationVersion() { - return specVersion; - } - - @Override - public int hashCode() { - return name.hashCode(); - } - - /** - * Indicates whether this package's specification version is compatible with - * the specified version string. Version strings are compared by comparing - * each dot separated part of the version as an integer. - * - * @param version - * the version string to compare against. - * @return {@code true} if the package versions are compatible; {@code - * false} otherwise. - * @throws NumberFormatException - * if this package's version string or the one provided are not - * in the correct format. - */ - public boolean isCompatibleWith(String version) - throws NumberFormatException { - String[] requested = version.split("\\."); - String[] provided = specVersion.split("\\."); - - for (int i = 0; i < Math.min(requested.length, provided.length); i++) { - int reqNum = Integer.parseInt(requested[i]); - int provNum = Integer.parseInt(provided[i]); - - if (reqNum > provNum) { - return false; - } else if (reqNum < provNum) { - return true; - } - } - - if (requested.length > provided.length) { - return false; - } - - return true; - } - - /** - * Indicates whether this package is sealed. - * - * @return {@code true} if this package is sealed; {@code false} otherwise. - */ - public boolean isSealed() { - return sealBase != null; - } - - /** - * Indicates whether this package is sealed with respect to the specified - * URL. - * - * @param url - * the URL to check. - * @return {@code true} if this package is sealed with {@code url}; {@code - * false} otherwise - */ - public boolean isSealed(URL url) { - return sealBase != null && sealBase.sameFile(url); - } - - @Override - public String toString() { - return "package " + name; - } -} diff --git a/luni-kernel/src/main/java/java/lang/ProcessManager.java b/luni-kernel/src/main/java/java/lang/ProcessManager.java deleted file mode 100644 index 318fe9a..0000000 --- a/luni-kernel/src/main/java/java/lang/ProcessManager.java +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Copyright (C) 2007 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package java.lang; - -import java.io.File; -import java.io.FileDescriptor; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.lang.ref.ReferenceQueue; -import java.lang.ref.WeakReference; -import java.util.HashMap; -import java.util.Map; -import java.util.Arrays; -import java.util.logging.Logger; -import java.util.logging.Level; - -/** - * Manages child processes. - * - *

Harmony's native implementation (for comparison purposes): - * http://tinyurl.com/3ytwuq - */ -final class ProcessManager { - - /** - * constant communicated from native code indicating that a - * child died, but it was unable to determine the status - */ - private static final int WAIT_STATUS_UNKNOWN = -1; - - /** - * constant communicated from native code indicating that there - * are currently no children to wait for - */ - private static final int WAIT_STATUS_NO_CHILDREN = -2; - - /** - * constant communicated from native code indicating that a wait() - * call returned -1 and set an undocumented (and hence unexpected) errno - */ - private static final int WAIT_STATUS_STRANGE_ERRNO = -3; - - /** - * Initializes native static state. - */ - static native void staticInitialize(); - static { - staticInitialize(); - } - - /** - * Map from pid to Process. We keep weak references to the Process objects - * and clean up the entries when no more external references are left. The - * process objects themselves don't require much memory, but file - * descriptors (associated with stdin/out/err in this case) can be - * a scarce resource. - */ - private final Map processReferences - = new HashMap(); - - /** Keeps track of garbage-collected Processes. */ - private final ProcessReferenceQueue referenceQueue - = new ProcessReferenceQueue(); - - private ProcessManager() { - // Spawn a thread to listen for signals from child processes. - Thread processThread = new Thread(ProcessManager.class.getName()) { - @Override - public void run() { - watchChildren(); - } - }; - processThread.setDaemon(true); - processThread.start(); - } - - /** - * Kills the process with the given ID. - * - * @parm pid ID of process to kill - */ - private static native void kill(int pid) throws IOException; - - /** - * Cleans up after garbage collected processes. Requires the lock on the - * map. - */ - void cleanUp() { - ProcessReference reference; - while ((reference = referenceQueue.poll()) != null) { - synchronized (processReferences) { - processReferences.remove(reference.processId); - } - } - } - - /** - * Listens for signals from processes and calls back to - * {@link #onExit(int,int)}. - */ - native void watchChildren(); - - /** - * Called by {@link #watchChildren()} when a child process exits. - * - * @param pid ID of process that exited - * @param exitValue value the process returned upon exit - */ - void onExit(int pid, int exitValue) { - ProcessReference processReference = null; - - synchronized (processReferences) { - cleanUp(); - if (pid >= 0) { - processReference = processReferences.remove(pid); - } else if (exitValue == WAIT_STATUS_NO_CHILDREN) { - if (processReferences.isEmpty()) { - /* - * There are no eligible children; wait for one to be - * added. The wait() will return due to the - * notifyAll() call below. - */ - try { - processReferences.wait(); - } catch (InterruptedException ex) { - // This should never happen. - throw new AssertionError("unexpected interrupt"); - } - } else { - /* - * A new child was spawned just before we entered - * the synchronized block. We can just fall through - * without doing anything special and land back in - * the native wait(). - */ - } - } else { - // Something weird is happening; abort! - throw new AssertionError("unexpected wait() behavior"); - } - } - - if (processReference != null) { - ProcessImpl process = processReference.get(); - if (process != null) { - process.setExitValue(exitValue); - } - } - } - - /** - * Executes a native process. Fills in in, out, and err and returns the - * new process ID upon success. - */ - static native int exec(String[] command, String[] environment, - String workingDirectory, FileDescriptor in, FileDescriptor out, - FileDescriptor err, boolean redirectErrorStream) throws IOException; - - /** - * Executes a process and returns an object representing it. - */ - Process exec(String[] taintedCommand, String[] taintedEnvironment, File workingDirectory, - boolean redirectErrorStream) throws IOException { - // Make sure we throw the same exceptions as the RI. - if (taintedCommand == null) { - throw new NullPointerException(); - } - if (taintedCommand.length == 0) { - throw new IndexOutOfBoundsException(); - } - - // Handle security and safety by copying mutable inputs and checking them. - String[] command = taintedCommand.clone(); - String[] environment = taintedEnvironment != null ? taintedEnvironment.clone() : null; - SecurityManager securityManager = System.getSecurityManager(); - if (securityManager != null) { - securityManager.checkExec(command[0]); - } - // Check we're not passing null Strings to the native exec. - for (String arg : command) { - if (arg == null) { - throw new NullPointerException(); - } - } - // The environment is allowed to be null or empty, but no element may be null. - if (environment != null) { - for (String env : environment) { - if (env == null) { - throw new NullPointerException(); - } - } - } - - FileDescriptor in = new FileDescriptor(); - FileDescriptor out = new FileDescriptor(); - FileDescriptor err = new FileDescriptor(); - - String workingPath = (workingDirectory == null) - ? null - : workingDirectory.getPath(); - - // Ensure onExit() doesn't access the process map before we add our - // entry. - synchronized (processReferences) { - int pid; - try { - pid = exec(command, environment, workingPath, in, out, err, redirectErrorStream); - } catch (IOException e) { - IOException wrapper = new IOException("Error running exec()." - + " Command: " + Arrays.toString(command) - + " Working Directory: " + workingDirectory - + " Environment: " + Arrays.toString(environment)); - wrapper.initCause(e); - throw wrapper; - } - ProcessImpl process = new ProcessImpl(pid, in, out, err); - ProcessReference processReference - = new ProcessReference(process, referenceQueue); - processReferences.put(pid, processReference); - - /* - * This will wake up the child monitor thread in case there - * weren't previously any children to wait on. - */ - processReferences.notifyAll(); - - return process; - } - } - - static class ProcessImpl extends Process { - - /** Process ID. */ - final int id; - - final InputStream errorStream; - - /** Reads output from process. */ - final InputStream inputStream; - - /** Sends output to process. */ - final OutputStream outputStream; - - /** The process's exit value. */ - Integer exitValue = null; - final Object exitValueMutex = new Object(); - - ProcessImpl(int id, FileDescriptor in, FileDescriptor out, - FileDescriptor err) { - this.id = id; - - this.errorStream = new ProcessInputStream(err); - this.inputStream = new ProcessInputStream(in); - this.outputStream = new ProcessOutputStream(out); - } - - public void destroy() { - try { - kill(this.id); - } catch (IOException e) { - Logger.getLogger(Runtime.class.getName()).log(Level.FINE, - "Failed to destroy process " + id + ".", e); - } - } - - public int exitValue() { - synchronized (exitValueMutex) { - if (exitValue == null) { - throw new IllegalThreadStateException( - "Process has not yet terminated."); - } - - return exitValue; - } - } - - public InputStream getErrorStream() { - return this.errorStream; - } - - public InputStream getInputStream() { - return this.inputStream; - } - - public OutputStream getOutputStream() { - return this.outputStream; - } - - public int waitFor() throws InterruptedException { - synchronized (exitValueMutex) { - while (exitValue == null) { - exitValueMutex.wait(); - } - return exitValue; - } - } - - void setExitValue(int exitValue) { - synchronized (exitValueMutex) { - this.exitValue = exitValue; - exitValueMutex.notifyAll(); - } - } - - @Override - public String toString() { - return "Process[id=" + id + "]"; - } - } - - static class ProcessReference extends WeakReference { - - final int processId; - - public ProcessReference(ProcessImpl referent, - ProcessReferenceQueue referenceQueue) { - super(referent, referenceQueue); - this.processId = referent.id; - } - } - - static class ProcessReferenceQueue extends ReferenceQueue { - - @Override - public ProcessReference poll() { - // Why couldn't they get the generics right on ReferenceQueue? :( - Object reference = super.poll(); - return (ProcessReference) reference; - } - } - - static final ProcessManager instance = new ProcessManager(); - - /** Gets the process manager. */ - static ProcessManager getInstance() { - return instance; - } - - /** Automatically closes fd when collected. */ - private static class ProcessInputStream extends FileInputStream { - - private FileDescriptor fd; - - private ProcessInputStream(FileDescriptor fd) { - super(fd); - this.fd = fd; - } - - @Override - public void close() throws IOException { - try { - super.close(); - } finally { - synchronized (this) { - if (fd != null && fd.valid()) { - try { - ProcessManager.close(fd); - } finally { - fd = null; - } - } - } - } - } - } - - /** Automatically closes fd when collected. */ - private static class ProcessOutputStream extends FileOutputStream { - - private FileDescriptor fd; - - private ProcessOutputStream(FileDescriptor fd) { - super(fd); - this.fd = fd; - } - - @Override - public void close() throws IOException { - try { - super.close(); - } finally { - synchronized (this) { - if (fd != null && fd.valid()) { - try { - ProcessManager.close(fd); - } finally { - fd = null; - } - } - } - } - } - } - - /** Closes the given file descriptor. */ - private static native void close(FileDescriptor fd) throws IOException; -} diff --git a/luni-kernel/src/main/java/java/lang/Runtime.java b/luni-kernel/src/main/java/java/lang/Runtime.java deleted file mode 100644 index 6d928f7..0000000 --- a/luni-kernel/src/main/java/java/lang/Runtime.java +++ /dev/null @@ -1,836 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package java.lang; - -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.PipedInputStream; -import java.io.PipedOutputStream; -import java.io.Reader; -import java.io.InputStreamReader; -import java.io.UnsupportedEncodingException; -import java.io.Writer; - -import java.util.StringTokenizer; -import java.util.List; -import java.util.ArrayList; - -import dalvik.system.VMDebug; -import dalvik.system.VMStack; - -/** - * Allows Java applications to interface with the environment in which they are - * running. Applications can not create an instance of this class, but they can - * get a singleton instance by invoking {@link #getRuntime()}. - * - * @see System - */ -public class Runtime { - - /** - * Holds the Singleton global instance of Runtime. - */ - private static final Runtime mRuntime = new Runtime(); - - /** - * Holds the library paths, used for native library lookup. - */ - private final String[] mLibPaths; - - /** - * Holds the list of threads to run when the VM terminates - */ - private List shutdownHooks = new ArrayList(); - - /** - * Reflects whether finalization should be run for all objects - * when the VM terminates. - */ - private static boolean finalizeOnExit; - - /** - * Reflects whether we are already shutting down the VM. - */ - private boolean shuttingDown; - - /** - * Reflects whether we are tracing method calls. - */ - private boolean tracingMethods; - - /** - * Prevent this class from being instantiated. - */ - private Runtime(){ - String pathList = System.getProperty("java.library.path", "."); - String pathSep = System.getProperty("path.separator", ":"); - String fileSep = System.getProperty("file.separator", "/"); - - mLibPaths = pathList.split(pathSep); - - int i; - - if (false) - System.out.println("Runtime paths:"); - - // Add a '/' to the end so we don't have to do the property lookup - // and concatenation later. - for (i = 0; i < mLibPaths.length; i++) { - if (!mLibPaths[i].endsWith(fileSep)) - mLibPaths[i] += fileSep; - if (false) - System.out.println(" " + mLibPaths[i]); - } - } - - /** - * Executes the specified command and its arguments in a separate native - * process. The new process inherits the environment of the caller. Calling - * this method is equivalent to calling {@code exec(progArray, null, null)}. - * - * @param progArray - * the array containing the program to execute as well as any - * arguments to the program. - * @return the new {@code Process} object that represents the native - * process. - * @throws IOException - * if the requested program can not be executed. - * @throws SecurityException - * if the current {@code SecurityManager} disallows program - * execution. - * @see SecurityManager#checkExec - */ - public Process exec(String[] progArray) throws java.io.IOException { - return exec(progArray, null, null); - } - - /** - * Executes the specified command and its arguments in a separate native - * process. The new process uses the environment provided in {@code envp}. - * Calling this method is equivalent to calling - * {@code exec(progArray, envp, null)}. - * - * @param progArray - * the array containing the program to execute as well as any - * arguments to the program. - * @param envp - * the array containing the environment to start the new process - * in. - * @return the new {@code Process} object that represents the native - * process. - * @throws IOException - * if the requested program can not be executed. - * @throws SecurityException - * if the current {@code SecurityManager} disallows program - * execution. - * @see SecurityManager#checkExec - */ - public Process exec(String[] progArray, String[] envp) throws java.io.IOException { - return exec(progArray, envp, null); - } - - /** - * Executes the specified command and its arguments in a separate native - * process. The new process uses the environment provided in {@code envp} - * and the working directory specified by {@code directory}. - * - * @param progArray - * the array containing the program to execute as well as any - * arguments to the program. - * @param envp - * the array containing the environment to start the new process - * in. - * @param directory - * the directory in which to execute the program. If {@code null}, - * execute if in the same directory as the parent process. - * @return the new {@code Process} object that represents the native - * process. - * @throws IOException - * if the requested program can not be executed. - * @throws SecurityException - * if the current {@code SecurityManager} disallows program - * execution. - * @see SecurityManager#checkExec - */ - public Process exec(String[] progArray, String[] envp, File directory) throws IOException { - // BEGIN android-changed: push responsibility for argument checking into ProcessManager - return ProcessManager.getInstance().exec(progArray, envp, directory, false); - // END android-changed - } - - /** - * Executes the specified program in a separate native process. The new - * process inherits the environment of the caller. Calling this method is - * equivalent to calling {@code exec(prog, null, null)}. - * - * @param prog - * the name of the program to execute. - * @return the new {@code Process} object that represents the native - * process. - * @throws IOException - * if the requested program can not be executed. - * @throws SecurityException - * if the current {@code SecurityManager} disallows program - * execution. - * @see SecurityManager#checkExec - */ - public Process exec(String prog) throws java.io.IOException { - return exec(prog, null, null); - } - - /** - * Executes the specified program in a separate native process. The new - * process uses the environment provided in {@code envp}. Calling this - * method is equivalent to calling {@code exec(prog, envp, null)}. - * - * @param prog - * the name of the program to execute. - * @param envp - * the array containing the environment to start the new process - * in. - * @return the new {@code Process} object that represents the native - * process. - * @throws IOException - * if the requested program can not be executed. - * @throws SecurityException - * if the current {@code SecurityManager} disallows program - * execution. - * @see SecurityManager#checkExec - */ - public Process exec(String prog, String[] envp) throws java.io.IOException { - return exec(prog, envp, null); - } - - /** - * Executes the specified program in a separate native process. The new - * process uses the environment provided in {@code envp} and the working - * directory specified by {@code directory}. - * - * @param prog - * the name of the program to execute. - * @param envp - * the array containing the environment to start the new process - * in. - * @param directory - * the directory in which to execute the program. If {@code null}, - * execute if in the same directory as the parent process. - * @return the new {@code Process} object that represents the native - * process. - * @throws IOException - * if the requested program can not be executed. - * @throws SecurityException - * if the current {@code SecurityManager} disallows program - * execution. - * @see SecurityManager#checkExec - */ - public Process exec(String prog, String[] envp, File directory) throws java.io.IOException { - // Sanity checks - if (prog == null) { - throw new NullPointerException(); - } else if (prog.length() == 0) { - throw new IllegalArgumentException(); - } - - // Break down into tokens, as described in Java docs - StringTokenizer tokenizer = new StringTokenizer(prog); - int length = tokenizer.countTokens(); - String[] progArray = new String[length]; - for (int i = 0; i < length; i++) { - progArray[i] = tokenizer.nextToken(); - } - - // Delegate - return exec(progArray, envp, directory); - } - - /** - * Causes the virtual machine to stop running and the program to exit. If - * {@link #runFinalizersOnExit(boolean)} has been previously invoked with a - * {@code true} argument, then all objects will be properly - * garbage-collected and finalized first. - * - * @param code - * the return code. By convention, non-zero return codes indicate - * abnormal terminations. - * @throws SecurityException - * if the current {@code SecurityManager} does not allow the - * running thread to terminate the virtual machine. - * @see SecurityManager#checkExit - */ - public void exit(int code) { - // Security checks - SecurityManager smgr = System.getSecurityManager(); - if (smgr != null) { - smgr.checkExit(code); - } - - // Make sure we don't try this several times - synchronized(this) { - if (!shuttingDown) { - shuttingDown = true; - - Thread[] hooks; - synchronized (shutdownHooks) { - // create a copy of the hooks - hooks = new Thread[shutdownHooks.size()]; - shutdownHooks.toArray(hooks); - } - - // Start all shutdown hooks concurrently - for (int i = 0; i < hooks.length; i++) { - hooks[i].start(); - } - - // Wait for all shutdown hooks to finish - for (Thread hook : hooks) { - try { - hook.join(); - } catch (InterruptedException ex) { - // Ignore, since we are at VM shutdown. - } - } - - // Ensure finalization on exit, if requested - if (finalizeOnExit) { - runFinalization(true); - } - - // Get out of here finally... - nativeExit(code, true); - } - } - } - - /** - * Returns the amount of free memory resources which are available to the - * running program. - * - * @return the approximate amount of free memory, measured in bytes. - */ - public native long freeMemory(); - - /** - * Indicates to the virtual machine that it would be a good time to run the - * garbage collector. Note that this is a hint only. There is no guarantee - * that the garbage collector will actually be run. - */ - public native void gc(); - - /** - * Returns the single {@code Runtime} instance. - * - * @return the {@code Runtime} object for the current application. - */ - public static Runtime getRuntime() { - return mRuntime; - } - - /** - * Loads and links the dynamic library that is identified through the - * specified path. This method is similar to {@link #loadLibrary(String)}, - * but it accepts a full path specification whereas {@code loadLibrary} just - * accepts the name of the library to load. - * - * @param pathName - * the absolute (platform dependent) path to the library to load. - * @throws UnsatisfiedLinkError - * if the library can not be loaded. - * @throws SecurityException - * if the current {@code SecurityManager} does not allow to load - * the library. - * @see SecurityManager#checkLink - */ - public void load(String pathName) { - // Security checks - SecurityManager smgr = System.getSecurityManager(); - if (smgr != null) { - smgr.checkLink(pathName); - } - - load(pathName, VMStack.getCallingClassLoader()); - } - - /* - * Loads and links a library without security checks. - */ - void load(String filename, ClassLoader loader) { - if (filename == null) { - throw new NullPointerException("library path was null."); - } - if (!nativeLoad(filename, loader)) { - throw new UnsatisfiedLinkError( - "Library " + filename + " not found"); - } - } - - /** - * Loads and links the library with the specified name. The mapping of the - * specified library name to the full path for loading the library is - * implementation-dependent. - * - * @param libName - * the name of the library to load. - * @throws UnsatisfiedLinkError - * if the library can not be loaded. - * @throws SecurityException - * if the current {@code SecurityManager} does not allow to load - * the library. - * @see SecurityManager#checkLink - */ - public void loadLibrary(String libName) { - // Security checks - SecurityManager smgr = System.getSecurityManager(); - if (smgr != null) { - smgr.checkLink(libName); - } - - loadLibrary(libName, VMStack.getCallingClassLoader()); - } - - /* - * Loads and links a library without security checks. - */ - void loadLibrary(String libname, ClassLoader loader) { - String filename; - int i; - - if (loader != null) { - filename = loader.findLibrary(libname); - if (filename != null && nativeLoad(filename, loader)) - return; - // else fall through to exception - } else { - filename = System.mapLibraryName(libname); - for (i = 0; i < mLibPaths.length; i++) { - if (false) - System.out.println("Trying " + mLibPaths[i] + filename); - if (nativeLoad(mLibPaths[i] + filename, loader)) - return; - } - } - - throw new UnsatisfiedLinkError("Library " + libname + " not found"); - } - - private static native void nativeExit(int code, boolean isExit); - - private static native boolean nativeLoad(String filename, - ClassLoader loader); - - /** - * Requests proper finalization for all Objects on the heap. - * - * @param forced Decides whether the VM really needs to do this (true) - * or if this is just a suggestion that can safely be ignored - * (false). - */ - private native void runFinalization(boolean forced); - - /** - * Provides a hint to the virtual machine that it would be useful to attempt - * to perform any outstanding object finalizations. - * - */ - public void runFinalization() { - runFinalization(false); - } - - /** - * Sets the flag that indicates whether all objects are finalized when the - * virtual machine is about to exit. Note that all finalization which occurs - * when the system is exiting is performed after all running threads have - * been terminated. - * - * @param run - * {@code true} to enable finalization on exit, {@code false} to - * disable it. - * @deprecated This method is unsafe. - */ - @Deprecated - public static void runFinalizersOnExit(boolean run) { - SecurityManager smgr = System.getSecurityManager(); - if (smgr != null) { - smgr.checkExit(0); - } - finalizeOnExit = run; - } - - /** - * Returns the total amount of memory which is available to the running - * program. - * - * @return the total amount of memory, measured in bytes. - */ - public native long totalMemory(); - - /** - * Switches the output of debug information for instructions on or off. - * For the Android 1.0 reference implementation, this method does nothing. - * - * @param enable - * {@code true} to switch tracing on, {@code false} to switch it - * off. - */ - public void traceInstructions(boolean enable) { - // TODO(Google) Provide some implementation for this. - return; - } - - /** - * Switches the output of debug information for methods on or off. - * - * @param enable - * {@code true} to switch tracing on, {@code false} to switch it - * off. - */ - public void traceMethodCalls(boolean enable) { - if (enable != tracingMethods) { - if (enable) { - VMDebug.startMethodTracing(); - } else { - VMDebug.stopMethodTracing(); - } - tracingMethods = enable; - } - } - - /** - * Returns the localized version of the specified input stream. The input - * stream that is returned automatically converts all characters from the - * local character set to Unicode after reading them from the underlying - * stream. - * - * @param stream - * the input stream to localize. - * @return the localized input stream. - * @deprecated Use {@link InputStreamReader}. - */ - @Deprecated - public InputStream getLocalizedInputStream(InputStream stream) { - if (System.getProperty("file.encoding", "UTF-8").equals("UTF-8")) { - return stream; - } - return new ReaderInputStream(stream); - } - - /** - * Returns the localized version of the specified output stream. The output - * stream that is returned automatically converts all characters from - * Unicode to the local character set before writing them to the underlying - * stream. - * - * @param stream - * the output stream to localize. - * @return the localized output stream. - * @deprecated Use {@link OutputStreamWriter}. - */ - @Deprecated - public OutputStream getLocalizedOutputStream(OutputStream stream) { - if (System.getProperty("file.encoding", "UTF-8").equals("UTF-8")) { - return stream; - } - return new WriterOutputStream(stream ); - } - - /** - * Registers a virtual-machine shutdown hook. A shutdown hook is a - * {@code Thread} that is ready to run, but has not yet been started. All - * registered shutdown hooks will be executed once the virtual machine shuts - * down properly. A proper shutdown happens when either the - * {@link #exit(int)} method is called or the surrounding system decides to - * terminate the application, for example in response to a {@code CTRL-C} or - * a system-wide shutdown. A termination of the virtual machine due to the - * {@link #halt(int)} method, an {@link Error} or a {@code SIGKILL}, in - * contrast, is not considered a proper shutdown. In these cases the - * shutdown hooks will not be run. - *

- * Shutdown hooks are run concurrently and in an unspecified order. Hooks - * failing due to an unhandled exception are not a problem, but the stack - * trace might be printed to the console. Once initiated, the whole shutdown - * process can only be terminated by calling {@code halt()}. - *

- * If {@link #runFinalizersOnExit(boolean)} has been called with a {@code - * true} argument, garbage collection and finalization will take place after - * all hooks are either finished or have failed. Then the virtual machine - * terminates. - *

- * It is recommended that shutdown hooks do not do any time-consuming - * activities, in order to not hold up the shutdown process longer than - * necessary. - * - * @param hook - * the shutdown hook to register. - * @throws IllegalArgumentException - * if the hook has already been started or if it has already - * been registered. - * @throws IllegalStateException - * if the virtual machine is already shutting down. - * @throws SecurityException - * if a SecurityManager is registered and the calling code - * doesn't have the RuntimePermission("shutdownHooks"). - */ - public void addShutdownHook(Thread hook) { - // Sanity checks - if (hook == null) { - throw new NullPointerException("Hook may not be null."); - } - - if (shuttingDown) { - throw new IllegalStateException("VM already shutting down"); - } - - if (hook.hasBeenStarted) { - throw new IllegalArgumentException("Hook has already been started"); - } - - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission(new RuntimePermission("shutdownHooks")); - } - - synchronized (shutdownHooks) { - if (shutdownHooks.contains(hook)) { - throw new IllegalArgumentException("Hook already registered."); - } - - shutdownHooks.add(hook); - } - } - - /** - * Unregisters a previously registered virtual machine shutdown hook. - * - * @param hook - * the shutdown hook to remove. - * @return {@code true} if the hook has been removed successfully; {@code - * false} otherwise. - * @throws IllegalStateException - * if the virtual machine is already shutting down. - * @throws SecurityException - * if a SecurityManager is registered and the calling code - * doesn't have the RuntimePermission("shutdownHooks"). - */ - public boolean removeShutdownHook(Thread hook) { - // Sanity checks - if (hook == null) { - throw new NullPointerException("Hook may not be null."); - } - - if (shuttingDown) { - throw new IllegalStateException("VM already shutting down"); - } - - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission(new RuntimePermission("shutdownHooks")); - } - - synchronized (shutdownHooks) { - return shutdownHooks.remove(hook); - } - } - - /** - * Causes the virtual machine to stop running, and the program to exit. - * Neither shutdown hooks nor finalizers are run before. - * - * @param code - * the return code. By convention, non-zero return codes indicate - * abnormal terminations. - * @throws SecurityException - * if the current {@code SecurityManager} does not allow the - * running thread to terminate the virtual machine. - * @see SecurityManager#checkExit - * @see #addShutdownHook(Thread) - * @see #removeShutdownHook(Thread) - * @see #runFinalizersOnExit(boolean) - */ - public void halt(int code) { - // Security checks - SecurityManager smgr = System.getSecurityManager(); - if (smgr != null) { - smgr.checkExit(code); - } - - // Get out of here... - nativeExit(code, false); - } - - /** - * Returns the number of processors available to the virtual machine. The - * Android reference implementation (currently) always returns 1. - * - * @return the number of available processors, at least 1. - */ - public int availableProcessors() { - return 1; - } - - /** - * Returns the maximum amount of memory that may be used by the virtual - * machine, or {@code Long.MAX_VALUE} if there is no such limit. - * - * @return the maximum amount of memory that the virtual machine will try to - * allocate, measured in bytes. - */ - public native long maxMemory(); - -} - -/* - * Internal helper class for creating a localized InputStream. A reader - * wrapped in an InputStream. - */ -class ReaderInputStream extends InputStream { - - private Reader reader; - - private Writer writer; - - ByteArrayOutputStream out = new ByteArrayOutputStream(256); - - private byte[] bytes; - - private int nextByte; - - private int numBytes; - - String encoding = System.getProperty("file.encoding", "UTF-8"); - - public ReaderInputStream(InputStream stream) { - try { - reader = new InputStreamReader(stream, "UTF-8"); - writer = new OutputStreamWriter(out, encoding); - } catch (UnsupportedEncodingException e) { - // Should never happen, since UTF-8 and platform encoding must be - // supported. - throw new RuntimeException(e); - } - } - - @Override - public int read() throws IOException { - if (nextByte >= numBytes) { - readBuffer(); - } - - return (numBytes < 0) ? -1 : bytes[nextByte++]; - } - - private void readBuffer() throws IOException { - char[] chars = new char[128]; - int read = reader.read(chars); - if (read < 0) { - numBytes = read; - return; - } - - writer.write(chars, 0, read); - writer.flush(); - bytes = out.toByteArray(); - numBytes = bytes.length; - nextByte = 0; - } - -} - -/* - * Internal helper class for creating a localized OutputStream. A writer - * wrapped in an OutputStream. Bytes are written to characters in big-endian - * fashion. - */ -class WriterOutputStream extends OutputStream { - - private Reader reader; - - private Writer writer; - - private PipedOutputStream out; - - private PipedInputStream pipe; - - private int numBytes; - - private String enc = System.getProperty("file.encoding", "UTF-8"); - - public WriterOutputStream(OutputStream stream) { - try { - // sink - this.writer = new OutputStreamWriter(stream, enc); - - // transcriber - out = new PipedOutputStream(); - pipe = new PipedInputStream(out); - this.reader = new InputStreamReader(pipe, "UTF-8"); - - } catch (UnsupportedEncodingException e) { - // Should never happen, since platform encoding must be supported. - throw new RuntimeException(e); - } catch (IOException e) { - throw new RuntimeException(e); - } - } - - @Override - public void write(int b) throws IOException { - out.write(b); - if( ++numBytes > 256) { - flush(); - numBytes = 0; - } - } - - @Override - public void flush() throws IOException { - out.flush(); - char[] chars = new char[128]; - if (pipe.available() > 0) { - int read = reader.read(chars); - if (read > 0) { - writer.write(chars, 0, read); - } - } - writer.flush(); - } - - @Override - public void close() throws IOException { - out.close(); - flush(); - writer.close(); - } -} diff --git a/luni-kernel/src/main/java/java/lang/StackTraceElement.java b/luni-kernel/src/main/java/java/lang/StackTraceElement.java deleted file mode 100644 index 88fe1ab..0000000 --- a/luni-kernel/src/main/java/java/lang/StackTraceElement.java +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package java.lang; - -import java.io.Serializable; - -/** - * A representation of a single stack frame. Arrays of {@code StackTraceElement} - * are stored in {@link Throwable} objects to represent the whole state of the - * call stack at the time a {@code Throwable} gets thrown. - * - * @see Throwable#getStackTrace() - */ -public final class StackTraceElement implements Serializable { - - private static final long serialVersionUID = 6992337162326171013L; - - // BEGIN android-added - private static final int NATIVE_LINE_NUMBER = -2; - // END android-added - - String declaringClass; - - String methodName; - - String fileName; - - int lineNumber; - - /** - * Constructs a new {@code StackTraceElement} for a specified execution - * point. - * - * @param cls - * the fully qualified name of the class where execution is at. - * @param method - * the name of the method where execution is at. - * @param file - * The name of the file where execution is at or {@code null}. - * @param line - * the line of the file where execution is at, a negative number - * if unknown or {@code -2} if the execution is in a native - * method. - * @throws NullPointerException - * if {@code cls} or {@code method} is {@code null}. - */ - public StackTraceElement(String cls, String method, String file, int line) { - super(); - if (cls == null || method == null) { - throw new NullPointerException(); - } - declaringClass = cls; - methodName = method; - fileName = file; - lineNumber = line; - } - - /** - *

- * Private, nullary constructor for VM use only. - *

- */ - private StackTraceElement() { - super(); - } - - /** - * Compares this instance with the specified object and indicates if they - * are equal. In order to be equal, the following conditions must be - * fulfilled: - *
    - *
  • {@code obj} must be a stack trace element,
  • - *
  • the method names of this stack trace element and of {@code obj} must - * not be {@code null},
  • - *
  • the class, method and file names as well as the line number of this - * stack trace element and of {@code obj} must be equal.
  • - *
- * - * @param obj - * the object to compare this instance with. - * @return {@code true} if the specified object is equal to this - * {@code StackTraceElement}; {@code false} otherwise. - * @see #hashCode - */ - @Override - public boolean equals(Object obj) { - if (!(obj instanceof StackTraceElement)) { - return false; - } - StackTraceElement castObj = (StackTraceElement) obj; - - /* - * Unknown methods are never equal to anything (not strictly to spec, - * but spec does not allow null method/class names) - */ - if ((methodName == null) || (castObj.methodName == null)) { - return false; - } - - if (!getMethodName().equals(castObj.getMethodName())) { - return false; - } - if (!getClassName().equals(castObj.getClassName())) { - return false; - } - String localFileName = getFileName(); - if (localFileName == null) { - if (castObj.getFileName() != null) { - return false; - } - } else { - if (!localFileName.equals(castObj.getFileName())) { - return false; - } - } - if (getLineNumber() != castObj.getLineNumber()) { - return false; - } - - return true; - } - - /** - * Returns the fully qualified name of the class belonging to this - * {@code StackTraceElement}. - * - * @return the fully qualified type name of the class - */ - public String getClassName() { - return (declaringClass == null) ? "" : declaringClass; - } - - /** - * Returns the name of the Java source file containing class belonging to - * this {@code StackTraceElement}. - * - * @return the name of the file, or {@code null} if this information is not - * available. - */ - public String getFileName() { - return fileName; - } - - /** - * Returns the line number in the source for the class belonging to this - * {@code StackTraceElement}. - * - * @return the line number, or a negative number if this information is not - * available. - */ - public int getLineNumber() { - return lineNumber; - } - - /** - * Returns the name of the method belonging to this {@code - * StackTraceElement}. - * - * @return the name of the method, or "" if this information - * is not available. - */ - public String getMethodName() { - return (methodName == null) ? "" : methodName; - } - - @Override - public int hashCode() { - /* - * Either both methodName and declaringClass are null, or neither are - * null. - */ - if (methodName == null) { - // all unknown methods hash the same - return 0; - } - // declaringClass never null if methodName is non-null - return methodName.hashCode() ^ declaringClass.hashCode(); - } - - /** - * Indicates if the method name returned by {@link #getMethodName()} is - * implemented as a native method. - * - * @return {@code true} if the method in which this stack trace element is - * executing is a native method; {@code false} otherwise. - */ - public boolean isNativeMethod() { - // BEGIN android-changed - return lineNumber == NATIVE_LINE_NUMBER; - // END android-changed - } - - @Override - public String toString() { - StringBuilder buf = new StringBuilder(80); - - buf.append(getClassName()); - buf.append('.'); - buf.append(getMethodName()); - - if (isNativeMethod()) { - buf.append("(Native Method)"); - } else { - String fName = getFileName(); - - if (fName == null) { - buf.append("(Unknown Source)"); - } else { - int lineNum = getLineNumber(); - - buf.append('('); - buf.append(fName); - if (lineNum >= 0) { - buf.append(':'); - buf.append(lineNum); - } - buf.append(')'); - } - } - return buf.toString(); - } -} diff --git a/luni-kernel/src/main/java/java/lang/System.java b/luni-kernel/src/main/java/java/lang/System.java deleted file mode 100644 index 095307a..0000000 --- a/luni-kernel/src/main/java/java/lang/System.java +++ /dev/null @@ -1,713 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package java.lang; - -import java.io.Console; -import java.io.FileDescriptor; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.PrintStream; -import java.nio.channels.Channel; -import java.nio.channels.spi.SelectorProvider; -import java.security.SecurityPermission; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; -import java.util.PropertyPermission; -import java.util.Set; - -import dalvik.system.VMStack; - -/** - * Provides access to system-related information and resources including - * standard input and output. Enables clients to dynamically load native - * libraries. All methods of this class are accessed in a static way and the - * class itself can not be instantiated. - * - * @see Runtime - */ -public final class System { - - /** - * Default input stream. - */ - public static final InputStream in; - - /** - * Default output stream. - */ - public static final PrintStream out; - - /** - * Default error output stream. - */ - public static final PrintStream err; - - /** - * The System Properties table. - */ - private static Properties systemProperties; - - /** - * Initialize all the slots in System on first use. - */ - static { - /* - * Set up standard in, out, and err. TODO err and out are - * String.ConsolePrintStream. All three are buffered in Harmony. Check - * and possibly change this later. - */ - err = new PrintStream(new FileOutputStream(FileDescriptor.err)); - out = new PrintStream(new FileOutputStream(FileDescriptor.out)); - in = new FileInputStream(FileDescriptor.in); - } - - /** - * Sets the standard input stream to the given user defined input stream. - * - * @param newIn - * the user defined input stream to set as the standard input - * stream. - * @throws SecurityException - * if a {@link SecurityManager} is installed and its {@code - * checkPermission()} method does not allow the change of the - * stream. - */ - public static void setIn(InputStream newIn) { - SecurityManager secMgr = System.getSecurityManager(); - if(secMgr != null) { - secMgr.checkPermission(RuntimePermission.permissionToSetIO); - } - setFieldImpl("in", "Ljava/io/InputStream;", newIn); - } - - /** - * Sets the standard output stream to the given user defined output stream. - * - * @param newOut - * the user defined output stream to set as the standard output - * stream. - * @throws SecurityException - * if a {@link SecurityManager} is installed and its {@code - * checkPermission()} method does not allow the change of the - * stream. - */ - public static void setOut(java.io.PrintStream newOut) { - SecurityManager secMgr = System.getSecurityManager(); - if(secMgr != null) { - secMgr.checkPermission(RuntimePermission.permissionToSetIO); - } - setFieldImpl("out", "Ljava/io/PrintStream;", newOut); - } - - /** - * Sets the standard error output stream to the given user defined output - * stream. - * - * @param newErr - * the user defined output stream to set as the standard error - * output stream. - * @throws SecurityException - * if a {@link SecurityManager} is installed and its {@code - * checkPermission()} method does not allow the change of the - * stream. - */ - public static void setErr(java.io.PrintStream newErr) { - SecurityManager secMgr = System.getSecurityManager(); - if(secMgr != null) { - secMgr.checkPermission(RuntimePermission.permissionToSetIO); - } - setFieldImpl("err", "Ljava/io/PrintStream;", newErr); - } - - /** - * Prevents this class from being instantiated. - */ - private System() { - } - - /** - * Copies the number of {@code length} elements of the Array {@code src} - * starting at the offset {@code srcPos} into the Array {@code dest} at - * the position {@code destPos}. - * - * @param src - * the source array to copy the content. - * @param srcPos - * the starting index of the content in {@code src}. - * @param dest - * the destination array to copy the data into. - * @param destPos - * the starting index for the copied content in {@code dest}. - * @param length - * the number of elements of the {@code array1} content they have - * to be copied. - */ - public static native void arraycopy(Object src, int srcPos, Object dest, - int destPos, int length); - - /** - * Returns the current system time in milliseconds since January 1, 1970 - * 00:00:00 UTC. This method shouldn't be used for measuring timeouts or - * other elapsed time measurements, as changing the system time can affect - * the results. - * - * @return the local system time in milliseconds. - */ - public static native long currentTimeMillis(); - - /** - * Returns the current timestamp of the most precise timer available on the - * local system. This timestamp can only be used to measure an elapsed - * period by comparing it against another timestamp. It cannot be used as a - * very exact system time expression. - * - * @return the current timestamp in nanoseconds. - */ - public static native long nanoTime(); - - /** - * Causes the virtual machine to stop running and the program to exit. If - * {@link #runFinalizersOnExit(boolean)} has been previously invoked with a - * {@code true} argument, then all objects will be properly - * garbage-collected and finalized first. - * - * @param code - * the return code. - * @throws SecurityException - * if the running thread has not enough permission to exit the - * virtual machine. - * @see SecurityManager#checkExit - */ - public static void exit(int code) { - Runtime.getRuntime().exit(code); - } - - /** - * Indicates to the virtual machine that it would be a good time to run the - * garbage collector. Note that this is a hint only. There is no guarantee - * that the garbage collector will actually be run. - */ - public static void gc() { - Runtime.getRuntime().gc(); - } - - /** - * Returns the value of the environment variable with the given name {@code - * var}. - * - * @param name - * the name of the environment variable. - * @return the value of the specified environment variable or {@code null} - * if no variable exists with the given name. - * @throws SecurityException - * if a {@link SecurityManager} is installed and its {@code - * checkPermission()} method does not allow the querying of - * single environment variables. - */ - public static String getenv(String name) { - if (name == null) { - throw new NullPointerException(); - } - SecurityManager secMgr = System.getSecurityManager(); - if (secMgr != null) { - secMgr.checkPermission(new RuntimePermission("getenv." + name)); - } - - return getEnvByName(name); - } - - /* - * Returns an environment variable. No security checks are performed. - * @param var the name of the environment variable - * @return the value of the specified environment variable - */ - private static native String getEnvByName(String name); - - /** - * Returns an unmodifiable map of all available environment variables. - * - * @return the map representing all environment variables. - * @throws SecurityException - * if a {@link SecurityManager} is installed and its {@code - * checkPermission()} method does not allow the querying of - * all environment variables. - */ - public static Map getenv() { - SecurityManager secMgr = System.getSecurityManager(); - if (secMgr != null) { - secMgr.checkPermission(new RuntimePermission("getenv.*")); - } - - Map map = new HashMap(); - - int index = 0; - String entry = getEnvByIndex(index++); - while (entry != null) { - int pos = entry.indexOf('='); - if (pos != -1) { - map.put(entry.substring(0, pos), entry.substring(pos + 1)); - } - - entry = getEnvByIndex(index++); - } - - return new SystemEnvironment(map); - } - - /* - * Returns an environment variable. No security checks are performed. The - * safe way of traversing the environment is to start at index zero and - * count upwards until a null pointer is encountered. This marks the end of - * the Unix environment. - * @param index the index of the environment variable - * @return the value of the specified environment variable - */ - private static native String getEnvByIndex(int index); - - /** - * Returns the inherited channel from the creator of the current virtual - * machine. - * - * @return the inherited {@link Channel} or {@code null} if none exists. - * @throws IOException - * if an I/O error occurred. - * @see SelectorProvider - * @see SelectorProvider#inheritedChannel() - */ - public static Channel inheritedChannel() throws IOException { - return SelectorProvider.provider().inheritedChannel(); - } - - /** - * Returns the system properties. Note that this is not a copy, so that - * changes made to the returned Properties object will be reflected in - * subsequent calls to getProperty and getProperties. - * - * @return the system properties. - * @throws SecurityException - * if a {@link SecurityManager} is installed and its {@code - * checkPropertiesAccess()} method does not allow the operation. - */ - public static Properties getProperties() { - SecurityManager secMgr = System.getSecurityManager(); - if (secMgr != null) { - secMgr.checkPropertiesAccess(); - } - - return internalGetProperties(); - } - - /** - * Returns the system properties without any security checks. This is used - * for access from within java.lang. - * - * @return the system properties - */ - static Properties internalGetProperties() { - if (System.systemProperties == null) { - SystemProperties props = new SystemProperties(); - props.preInit(); - props.postInit(); - System.systemProperties = props; - } - - return systemProperties; - } - - /** - * Returns the value of a particular system property or {@code null} if no - * such property exists. - *

- * The properties currently provided by the virtual machine are: - * - *

-     *        java.vendor.url
-     *        java.class.path
-     *        user.home
-     *        java.class.version
-     *        os.version
-     *        java.vendor
-     *        user.dir
-     *        user.timezone
-     *        path.separator
-     *        os.name
-     *        os.arch
-     *        line.separator
-     *        file.separator
-     *        user.name
-     *        java.version
-     *        java.home
-     * 
- * - * @param prop - * the name of the system property to look up. - * @return the value of the specified system property or {@code null} if the - * property doesn't exist. - * @throws SecurityException - * if a {@link SecurityManager} is installed and its {@code - * checkPropertyAccess()} method does not allow the operation. - */ - public static String getProperty(String prop) { - return getProperty(prop, null); - } - - /** - * Returns the value of a particular system property. The {@code - * defaultValue} will be returned if no such property has been found. - * - * @param prop - * the name of the system property to look up. - * @param defaultValue - * the return value if the system property with the given name - * does not exist. - * @return the value of the specified system property or the {@code - * defaultValue} if the property does not exist. - * @throws SecurityException - * if a {@link SecurityManager} is installed and its {@code - * checkPropertyAccess()} method does not allow the operation. - */ - public static String getProperty(String prop, String defaultValue) { - if (prop.length() == 0) { - throw new IllegalArgumentException(); - } - SecurityManager secMgr = System.getSecurityManager(); - if (secMgr != null) { - secMgr.checkPropertyAccess(prop); - } - - return internalGetProperties().getProperty(prop, defaultValue); - } - - /** - * Sets the value of a particular system property. - * - * @param prop - * the name of the system property to be changed. - * @param value - * the value to associate with the given property {@code prop}. - * @return the old value of the property or {@code null} if the property - * didn't exist. - * @throws SecurityException - * if a security manager exists and write access to the - * specified property is not allowed. - */ - public static String setProperty(String prop, String value) { - if (prop.length() == 0) { - throw new IllegalArgumentException(); - } - SecurityManager secMgr = System.getSecurityManager(); - if (secMgr != null) { - secMgr.checkPermission(new PropertyPermission(prop, "write")); - } - return (String)internalGetProperties().setProperty(prop, value); - } - - /** - * Removes a specific system property. - * - * @param key - * the name of the system property to be removed. - * @return the property value or {@code null} if the property didn't exist. - * @throws NullPointerException - * if the argument {@code key} is {@code null}. - * @throws IllegalArgumentException - * if the argument {@code key} is empty. - * @throws SecurityException - * if a security manager exists and write access to the - * specified property is not allowed. - */ - public static String clearProperty(String key) { - if (key == null) { - throw new NullPointerException(); - } - if (key.length() == 0) { - throw new IllegalArgumentException(); - } - - SecurityManager secMgr = System.getSecurityManager(); - if (secMgr != null) { - secMgr.checkPermission(new PropertyPermission(key, "write")); - } - return (String)internalGetProperties().remove(key); - } - - /** - * Returns the {@link java.io.Console} associated with this VM, or null. - * Not all VMs will have an associated console. A console is typically only - * available for programs run from the command line. - * @since 1.6 - * @hide - */ - public static Console console() { - return Console.getConsole(); - } - - /** - * Returns null. Android does not use {@code SecurityManager}. This method - * is only provided for source compatibility. - * - * @return null - */ - public static SecurityManager getSecurityManager() { - return null; - } - - /** - * Returns an integer hash code for the parameter. The hash code returned is - * the same one that would be returned by the method {@code - * java.lang.Object.hashCode()}, whether or not the object's class has - * overridden hashCode(). The hash code for {@code null} is {@code 0}. - * - * @param anObject - * the object to calculate the hash code. - * @return the hash code for the given object. - * @see java.lang.Object#hashCode - */ - public static native int identityHashCode(Object anObject); - - /** - * Loads the specified file as a dynamic library. - * - * @param pathName - * the path of the file to be loaded. - * @throws SecurityException - * if the library was not allowed to be loaded. - */ - public static void load(String pathName) { - SecurityManager smngr = System.getSecurityManager(); - if (smngr != null) { - smngr.checkLink(pathName); - } - Runtime.getRuntime().load(pathName, VMStack.getCallingClassLoader()); - } - - /** - * Loads and links the shared library with the given name {@code libName}. - * The file will be searched in the default directory for shared libraries - * of the local system. - * - * @param libName - * the name of the library to load. - * @throws UnsatisfiedLinkError - * if the library could not be loaded. - * @throws SecurityException - * if the library was not allowed to be loaded. - */ - public static void loadLibrary(String libName) { - SecurityManager smngr = System.getSecurityManager(); - if (smngr != null) { - smngr.checkLink(libName); - } - Runtime.getRuntime().loadLibrary(libName, VMStack.getCallingClassLoader()); - } - - /** - * Provides a hint to the virtual machine that it would be useful to attempt - * to perform any outstanding object finalization. - */ - public static void runFinalization() { - Runtime.getRuntime().runFinalization(); - } - - /** - * Ensures that, when the virtual machine is about to exit, all objects are - * finalized. Note that all finalization which occurs when the system is - * exiting is performed after all running threads have been terminated. - * - * @param flag - * the flag determines if finalization on exit is enabled. - * @deprecated this method is unsafe. - */ - @SuppressWarnings("deprecation") - @Deprecated - public static void runFinalizersOnExit(boolean flag) { - Runtime.runFinalizersOnExit(flag); - } - - /** - * Sets all system properties. - * - * @param p - * the new system property. - * @throws SecurityException - * if a {@link SecurityManager} is installed and its {@code - * checkPropertiesAccess()} method does not allow the operation. - */ - public static void setProperties(Properties p) { - SecurityManager secMgr = System.getSecurityManager(); - if (secMgr != null) { - secMgr.checkPropertiesAccess(); - } - - systemProperties = p; - } - - /** - * Throws {@code UnsupportedOperationException}. - * - *

Security managers do not provide a secure environment for - * executing untrusted code and are unsupported on Android. Untrusted code - * cannot be safely isolated within the Dalvik VM. - * - * @param sm - * the new security manager. - * @throws SecurityException - * if the security manager has already been set and if its - * checkPermission method does not allow to redefine the - * security manager. - */ - public static void setSecurityManager(SecurityManager sm) { - if (sm != null) { - throw new UnsupportedOperationException(); - } - } - - /** - * Returns the platform specific file name format for the shared library - * named by the argument. - * - * @param userLibName - * the name of the library to look up. - * @return the platform specific filename for the library. - */ - public static native String mapLibraryName(String userLibName); - - /** - * Sets the value of the named static field in the receiver to the passed in - * argument. - * - * @param fieldName - * the name of the field to set, one of in, out, or err - * @param stream - * the new value of the field - */ - private static native void setFieldImpl(String fieldName, String signature, Object stream); - -} - -/** - * Internal class holding the System properties. Needed by the Dalvik VM for the - * two native methods. Must not be a local class, since we don't have a System - * instance. - */ -class SystemProperties extends Properties { - // Dummy, just to make the compiler happy. - - native void preInit(); - - native void postInit(); -} - -/** - * Internal class holding the System environment variables. The Java spec - * mandates that this map be read-only, so we wrap our real map into this one - * and make sure no one touches the contents. We also check for null parameters - * and do some (seemingly unnecessary) type casts to fulfill the contract layed - * out in the spec. - */ -class SystemEnvironment implements Map { - - private Map map; - - public SystemEnvironment(Map map) { - this.map = map; - } - - public void clear() { - throw new UnsupportedOperationException("Can't modify environment"); - } - - @SuppressWarnings("cast") - public boolean containsKey(Object key) { - if (key == null) { - throw new NullPointerException(); - } - - return map.containsKey((String)key); - } - - @SuppressWarnings("cast") - public boolean containsValue(Object value) { - if (value == null) { - throw new NullPointerException(); - } - - return map.containsValue((String)value); - } - - public Set entrySet() { - return map.entrySet(); - } - - @SuppressWarnings("cast") - public String get(Object key) { - if (key == null) { - throw new NullPointerException(); - } - - return map.get((String)key); - } - - public boolean isEmpty() { - return map.isEmpty(); - } - - public Set keySet() { - return map.keySet(); - } - - public String put(Object key, Object value) { - throw new UnsupportedOperationException("Can't modify environment"); - } - - public void putAll(Map map) { - throw new UnsupportedOperationException("Can't modify environment"); - } - - public String remove(Object key) { - throw new UnsupportedOperationException("Can't modify environment"); - } - - public int size() { - return map.size(); - } - - public Collection values() { - return map.values(); - } - -} diff --git a/luni-kernel/src/main/java/java/lang/Thread.java b/luni-kernel/src/main/java/java/lang/Thread.java deleted file mode 100644 index 625d718..0000000 --- a/luni-kernel/src/main/java/java/lang/Thread.java +++ /dev/null @@ -1,1488 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package java.lang; - -import dalvik.system.VMStack; - -import java.security.AccessController; -import java.util.Map; -import java.util.HashMap; - -import org.apache.harmony.security.fortress.SecurityUtils; - -/** - * A {@code Thread} is a concurrent unit of execution. It has its own call stack - * for methods being invoked, their arguments and local variables. Each virtual - * machine instance has at least one main {@code Thread} running when it is - * started; typically, there are several others for housekeeping. The - * application might decide to launch additional {@code Thread}s for specific - * purposes. - *

- * {@code Thread}s in the same VM interact and synchronize by the use of shared - * objects and monitors associated with these objects. Synchronized methods and - * part of the API in {@link Object} also allow {@code Thread}s to cooperate. - *

- * There are basically two main ways of having a {@code Thread} execute - * application code. One is providing a new class that extends {@code Thread} - * and overriding its {@link #run()} method. The other is providing a new - * {@code Thread} instance with a {@link Runnable} object during its creation. - * In both cases, the {@link #start()} method must be called to actually execute - * the new {@code Thread}. - *

- * Each {@code Thread} has an integer priority that basically determines the - * amount of CPU time the {@code Thread} gets. It can be set using the - * {@link #setPriority(int)} method. A {@code Thread} can also be made a daemon, - * which makes it run in the background. The latter also affects VM termination - * behavior: the VM does not terminate automatically as long as there are - * non-daemon threads running. - * - * @see java.lang.Object - * @see java.lang.ThreadGroup - * - */ -public class Thread implements Runnable { - - private static final int NANOS_PER_MILLI = 1000000; - - /** Park states */ - private static class ParkState { - /** park state indicating unparked */ - private static final int UNPARKED = 1; - - /** park state indicating preemptively unparked */ - private static final int PREEMPTIVELY_UNPARKED = 2; - - /** park state indicating parked */ - private static final int PARKED = 3; - } - - /** - * A representation of a thread's state. A given thread may only be in one - * state at a time. - */ - public enum State { - /** - * The thread has been created, but has never been started. - */ - NEW, - /** - * The thread may be run. - */ - RUNNABLE, - /** - * The thread is blocked and waiting for a lock. - */ - BLOCKED, - /** - * The thread is waiting. - */ - WAITING, - /** - * The thread is waiting for a specified amount of time. - */ - TIMED_WAITING, - /** - * The thread has been terminated. - */ - TERMINATED - } - - /** - * The maximum priority value allowed for a thread. - */ - public final static int MAX_PRIORITY = 10; - - /** - * The minimum priority value allowed for a thread. - */ - public final static int MIN_PRIORITY = 1; - - /** - * The normal (default) priority value assigned to threads. - */ - public final static int NORM_PRIORITY = 5; - - /* some of these are accessed directly by the VM; do not rename them */ - volatile VMThread vmThread; - volatile ThreadGroup group; - volatile boolean daemon; - volatile String name; - volatile int priority; - volatile long stackSize; - Runnable target; - private static int count = 0; - - /** - * Holds the thread's ID. We simply count upwards, so - * each Thread has a unique ID. - */ - private long id; - - /** - * Normal thread local values. - */ - ThreadLocal.Values localValues; - - /** - * Inheritable thread local values. - */ - ThreadLocal.Values inheritableValues; - - /** - * Holds the interrupt action for this Thread, if any. - *

- * This is required internally by NIO, so even if it looks like it's - * useless, don't delete it! - */ - private Runnable interruptAction; - - /** - * Holds the class loader for this Thread, in case there is one. - */ - private ClassLoader contextClassLoader; - - /** - * Holds the handler for uncaught exceptions in this Thread, - * in case there is one. - */ - private UncaughtExceptionHandler uncaughtHandler; - - /** - * Holds the default handler for uncaught exceptions, in case there is one. - */ - private static UncaughtExceptionHandler defaultUncaughtHandler; - - /** - * Reflects whether this Thread has already been started. A Thread - * can only be started once (no recycling). Also, we need it to deduce - * the proper Thread status. - */ - boolean hasBeenStarted = false; - - /** the park state of the thread */ - private int parkState = ParkState.UNPARKED; - - /** The synchronization object responsible for this thread parking. */ - private Object parkBlocker; - - /** - * Constructs a new {@code Thread} with no {@code Runnable} object and a - * newly generated name. The new {@code Thread} will belong to the same - * {@code ThreadGroup} as the {@code Thread} calling this constructor. - * - * @see java.lang.ThreadGroup - * @see java.lang.Runnable - */ - public Thread() { - create(null, null, null, 0); - } - - /** - * Constructs a new {@code Thread} with a {@code Runnable} object and a - * newly generated name. The new {@code Thread} will belong to the same - * {@code ThreadGroup} as the {@code Thread} calling this constructor. - * - * @param runnable - * a {@code Runnable} whose method run will be - * executed by the new {@code Thread} - * - * @see java.lang.ThreadGroup - * @see java.lang.Runnable - */ - public Thread(Runnable runnable) { - create(null, runnable, null, 0); - } - - /** - * Constructs a new {@code Thread} with a {@code Runnable} object and name - * provided. The new {@code Thread} will belong to the same {@code - * ThreadGroup} as the {@code Thread} calling this constructor. - * - * @param runnable - * a {@code Runnable} whose method run will be - * executed by the new {@code Thread} - * @param threadName - * the name for the {@code Thread} being created - * - * @see java.lang.ThreadGroup - * @see java.lang.Runnable - */ - public Thread(Runnable runnable, String threadName) { - if (threadName == null) { - throw new NullPointerException(); - } - - create(null, runnable, threadName, 0); - } - - /** - * Constructs a new {@code Thread} with no {@code Runnable} object and the - * name provided. The new {@code Thread} will belong to the same {@code - * ThreadGroup} as the {@code Thread} calling this constructor. - * - * @param threadName - * the name for the {@code Thread} being created - * - * @see java.lang.ThreadGroup - * @see java.lang.Runnable - * - */ - public Thread(String threadName) { - if (threadName == null) { - throw new NullPointerException(); - } - - create(null, null, threadName, 0); - } - - /** - * Constructs a new {@code Thread} with a {@code Runnable} object and a - * newly generated name. The new {@code Thread} will belong to the {@code - * ThreadGroup} passed as parameter. - * - * @param group - * {@code ThreadGroup} to which the new {@code Thread} will - * belong - * @param runnable - * a {@code Runnable} whose method run will be - * executed by the new {@code Thread} - * @throws SecurityException - * if group.checkAccess() fails with a - * SecurityException - * @throws IllegalThreadStateException - * if group.destroy() has already been done - * @see java.lang.ThreadGroup - * @see java.lang.Runnable - * @see java.lang.SecurityException - * @see java.lang.SecurityManager - */ - public Thread(ThreadGroup group, Runnable runnable) { - create(group, runnable, null, 0); - } - - /** - * Constructs a new {@code Thread} with a {@code Runnable} object, the given - * name and belonging to the {@code ThreadGroup} passed as parameter. - * - * @param group - * ThreadGroup to which the new {@code Thread} will belong - * @param runnable - * a {@code Runnable} whose method run will be - * executed by the new {@code Thread} - * @param threadName - * the name for the {@code Thread} being created - * @throws SecurityException - * if group.checkAccess() fails with a - * SecurityException - * @throws IllegalThreadStateException - * if group.destroy() has already been done - * @see java.lang.ThreadGroup - * @see java.lang.Runnable - * @see java.lang.SecurityException - * @see java.lang.SecurityManager - */ - public Thread(ThreadGroup group, Runnable runnable, String threadName) { - if (threadName == null) { - throw new NullPointerException(); - } - - create(group, runnable, threadName, 0); - } - - /** - * Constructs a new {@code Thread} with no {@code Runnable} object, the - * given name and belonging to the {@code ThreadGroup} passed as parameter. - * - * @param group - * {@code ThreadGroup} to which the new {@code Thread} will belong - * @param threadName - * the name for the {@code Thread} being created - * @throws SecurityException - * if group.checkAccess() fails with a - * SecurityException - * @throws IllegalThreadStateException - * if group.destroy() has already been done - * @see java.lang.ThreadGroup - * @see java.lang.Runnable - * @see java.lang.SecurityException - * @see java.lang.SecurityManager - */ - public Thread(ThreadGroup group, String threadName) { - if (threadName == null) { - throw new NullPointerException(); - } - - create(group, null, threadName, 0); - } - - /** - * Constructs a new {@code Thread} with a {@code Runnable} object, the given - * name and belonging to the {@code ThreadGroup} passed as parameter. - * - * @param group - * {@code ThreadGroup} to which the new {@code Thread} will - * belong - * @param runnable - * a {@code Runnable} whose method run will be - * executed by the new {@code Thread} - * @param threadName - * the name for the {@code Thread} being created - * @param stackSize - * a stack size for the new {@code Thread}. This has a highly - * platform-dependent interpretation. It may even be ignored - * completely. - * @throws SecurityException - * if group.checkAccess() fails with a - * SecurityException - * @throws IllegalThreadStateException - * if group.destroy() has already been done - * @see java.lang.ThreadGroup - * @see java.lang.Runnable - * @see java.lang.SecurityException - * @see java.lang.SecurityManager - */ - public Thread(ThreadGroup group, Runnable runnable, String threadName, long stackSize) { - if (threadName == null) { - throw new NullPointerException(); - } - create(group, runnable, threadName, stackSize); - } - - /** - * Package-scope method invoked by Dalvik VM to create "internal" - * threads or attach threads created externally. - * - * Don't call Thread.currentThread(), since there may not be such - * a thing (e.g. for Main). - */ - Thread(ThreadGroup group, String name, int priority, boolean daemon) { - synchronized (Thread.class) { - id = ++Thread.count; - } - - if (name == null) { - this.name = "Thread-" + id; - } else - this.name = name; - - if (group == null) { - throw new InternalError("group not specified"); - } - - this.group = group; - - this.target = null; - this.stackSize = 0; - this.priority = priority; - this.daemon = daemon; - - /* add ourselves to our ThreadGroup of choice */ - this.group.addThread(this); - } - - /** - * Initializes a new, existing Thread object with a runnable object, - * the given name and belonging to the ThreadGroup passed as parameter. - * This is the method that the several public constructors delegate their - * work to. - * - * @param group ThreadGroup to which the new Thread will belong - * @param runnable a java.lang.Runnable whose method run will - * be executed by the new Thread - * @param threadName Name for the Thread being created - * @param stackSize Platform dependent stack size - * @throws SecurityException if group.checkAccess() fails - * with a SecurityException - * @throws IllegalThreadStateException if group.destroy() has - * already been done - * @see java.lang.ThreadGroup - * @see java.lang.Runnable - * @see java.lang.SecurityException - * @see java.lang.SecurityManager - */ - private void create(ThreadGroup group, Runnable runnable, String threadName, long stackSize) { - SecurityManager smgr = System.getSecurityManager(); - if (smgr != null) { - if (group == null) { - group = smgr.getThreadGroup(); - } - - /* - * Freaky security requirement: If the Thread's class is actually - * a subclass of Thread and it tries to override either - * getContextClassLoader() or setContextClassLoader(), the - * SecurityManager has to allow this. - */ - if (getClass() != Thread.class) { - Class[] signature = new Class[] { ClassLoader.class }; - - try { - getClass().getDeclaredMethod("getContextClassLoader", signature); - smgr.checkPermission(new RuntimePermission("enableContextClassLoaderOverride")); - } catch (NoSuchMethodException ex) { - // Ignore. Just interested in the method's existence. - } - - try { - getClass().getDeclaredMethod("setContextClassLoader", signature); - smgr.checkPermission(new RuntimePermission("enableContextClassLoaderOverride")); - } catch (NoSuchMethodException ex) { - // Ignore. Just interested in the method's existence. - } - } - } - - Thread currentThread = Thread.currentThread(); - if (group == null) { - group = currentThread.getThreadGroup(); - } - - group.checkAccess(); - if (group.isDestroyed()) { - throw new IllegalThreadStateException("Group already destroyed"); - } - - this.group = group; - - synchronized (Thread.class) { - id = ++Thread.count; - } - - if (threadName == null) { - this.name = "Thread-" + id; - } else { - this.name = threadName; - } - - this.target = runnable; - this.stackSize = stackSize; - - this.priority = currentThread.getPriority(); - - this.contextClassLoader = currentThread.contextClassLoader; - - // Transfer over InheritableThreadLocals. - if (currentThread.inheritableValues != null) { - inheritableValues - = new ThreadLocal.Values(currentThread.inheritableValues); - } - - // store current AccessControlContext as inherited context for this thread - SecurityUtils.putContext(this, AccessController.getContext()); - - // add ourselves to our ThreadGroup of choice - this.group.addThread(this); - } - - /** - * Returns the number of active {@code Thread}s in the running {@code - * Thread}'s group and its subgroups. - * - * @return the number of {@code Thread}s - */ - public static int activeCount() { - return currentThread().getThreadGroup().activeCount(); - } - - /** - * Is used for operations that require approval from a SecurityManager. If - * there's none installed, this method is a no-op. If there's a - * SecurityManager installed, {@link SecurityManager#checkAccess(Thread)} is - * called for that SecurityManager. - * - * @throws SecurityException - * if a SecurityManager is installed and it does not allow - * access to the Thread. - * - * @see java.lang.SecurityException - * @see java.lang.SecurityManager - */ - public final void checkAccess() { - // Forwards the message to the SecurityManager (if there's one) passing - // the receiver as parameter - - SecurityManager currentManager = System.getSecurityManager(); - if (currentManager != null) { - currentManager.checkAccess(this); - } - } - - /** - * Returns the number of stack frames in this thread. - * - * @return Number of stack frames - * @deprecated The results of this call were never well defined. To make - * things worse, it would depend on whether the Thread was - * suspended or not, and suspend was deprecated too. - */ - @Deprecated - public int countStackFrames() { - return getStackTrace().length; - } - - /** - * Returns the Thread of the caller, that is, the current Thread. - * - * @return the current Thread. - */ - public static Thread currentThread() { - return VMThread.currentThread(); - } - - /** - * Destroys the receiver without any monitor cleanup. - * - * @deprecated Not implemented. - */ - @Deprecated - public void destroy() { - throw new NoSuchMethodError("Thread.destroy()"); // TODO Externalize??? - } - - /** - * Prints to the standard error stream a text representation of the current - * stack for this Thread. - * - * @see Throwable#printStackTrace() - */ - public static void dumpStack() { - new Throwable("stack dump").printStackTrace(); - } - - /** - * Copies an array with all Threads which are in the same ThreadGroup as the - * receiver - and subgroups - into the array threads passed as - * parameter. If the array passed as parameter is too small no exception is - * thrown - the extra elements are simply not copied. - * - * @param threads - * array into which the Threads will be copied - * @return How many Threads were copied over - * @throws SecurityException - * if the installed SecurityManager fails - * {@link SecurityManager#checkAccess(Thread)} - * @see java.lang.SecurityException - * @see java.lang.SecurityManager - */ - public static int enumerate(Thread[] threads) { - Thread thread = Thread.currentThread(); - thread.checkAccess(); - return thread.getThreadGroup().enumerate(threads); - } - - /** - *

- * Returns the stack traces of all the currently live threads and puts them - * into the given map. - *

- * - * @return A Map of current Threads to StackTraceElement arrays. - * @throws SecurityException - * if the current SecurityManager fails the - * {@link SecurityManager#checkPermission(java.security.Permission)} - * call. - */ - public static Map getAllStackTraces() { - SecurityManager securityManager = System.getSecurityManager(); - if (securityManager != null) { - securityManager.checkPermission(new RuntimePermission("getStackTrace")); - securityManager.checkPermission(new RuntimePermission("modifyThreadGroup")); - } - - Map map = new HashMap(); - - // Find out how many live threads we have. Allocate a bit more - // space than needed, in case new ones are just being created. - int count = ThreadGroup.mSystem.activeCount(); - Thread[] threads = new Thread[count + count / 2]; - - // Enumerate the threads and collect the stacktraces. - count = ThreadGroup.mSystem.enumerate(threads); - for (int i = 0; i < count; i++) { - map.put(threads[i], threads[i].getStackTrace()); - } - - return map; - } - - /** - * Returns the context ClassLoader for this Thread. - *

- * If the conditions - *

    - *
  1. there is a security manager - *
  2. the caller's class loader is not null - *
  3. the caller's class loader is not the same as the requested - * context class loader and not an ancestor thereof - *
- * are satisfied, a security check for - * RuntimePermission("getClassLoader") is performed first. - * - * @return ClassLoader The context ClassLoader - * @see java.lang.ClassLoader - * @see #getContextClassLoader() - * - * @throws SecurityException - * if the aforementioned security check fails. - */ - public ClassLoader getContextClassLoader() { - // First, if the conditions - // 1) there is a security manager - // 2) the caller's class loader is not null - // 3) the caller's class loader is not the same as the context - // class loader and not an ancestor thereof - // are satisfied we should perform a security check. - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - ClassLoader calling = VMStack.getCallingClassLoader(); - - if (calling != null && !calling.isAncestorOf(contextClassLoader)) { - sm.checkPermission(new RuntimePermission("getClassLoader")); - } - } - - return contextClassLoader; - } - - /** - * Returns the default exception handler that's executed when uncaught - * exception terminates a thread. - * - * @return an {@link UncaughtExceptionHandler} or null if - * none exists. - */ - public static UncaughtExceptionHandler getDefaultUncaughtExceptionHandler() { - return defaultUncaughtHandler; - } - - /** - * Returns the thread's identifier. The ID is a positive long - * generated on thread creation, is unique to the thread, and doesn't change - * during the lifetime of the thread; the ID may be reused after the thread - * has been terminated. - * - * @return the thread's ID. - */ - public long getId() { - return id; - } - - /** - * Returns the name of the Thread. - * - * @return the Thread's name - */ - public final String getName() { - return name; - } - - /** - * Returns the priority of the Thread. - * - * @return the Thread's priority - * @see Thread#setPriority - */ - public final int getPriority() { - return priority; - } - - /** - * Returns the a stack trace representing the current execution state of - * this Thread. - *

- * The RuntimePermission("getStackTrace") is checked before - * returning a result. - *

- * - * @return an array of StackTraceElements. - * @throws SecurityException - * if the current SecurityManager fails the - * {@link SecurityManager#checkPermission(java.security.Permission)} - * call. - */ - public StackTraceElement[] getStackTrace() { - SecurityManager securityManager = System.getSecurityManager(); - if (securityManager != null) { - securityManager.checkPermission(new RuntimePermission("getStackTrace")); - } - - StackTraceElement ste[] = VMStack.getThreadStackTrace(this); - return ste != null ? ste : new StackTraceElement[0]; - } - - /** - * Returns the current state of the Thread. This method is useful for - * monitoring purposes. - * - * @return a {@link State} value. - */ - public State getState() { - // TODO This is ugly and should be implemented better. - VMThread vmt = this.vmThread; - - // Make sure we have a valid reference to an object. If native code - // deletes the reference we won't run into a null reference later. - VMThread thread = vmThread; - if (thread != null) { - // If the Thread Object became invalid or was not yet started, - // getStatus() will return -1. - int state = thread.getStatus(); - if(state != -1) { - return VMThread.STATE_MAP[state]; - } - } - return hasBeenStarted ? Thread.State.TERMINATED : Thread.State.NEW; - } - - /** - * Returns the ThreadGroup to which this Thread belongs. - * - * @return the Thread's ThreadGroup - */ - public final ThreadGroup getThreadGroup() { - // TODO This should actually be done at native termination. - if (getState() == Thread.State.TERMINATED) { - return null; - } else { - return group; - } - } - - /** - * Returns the thread's uncaught exception handler. If not explicitly set, - * then the ThreadGroup's handler is returned. If the thread is terminated, - * then null is returned. - * - * @return an {@link UncaughtExceptionHandler} instance or {@code null}. - */ - public UncaughtExceptionHandler getUncaughtExceptionHandler() { - if (uncaughtHandler != null) - return uncaughtHandler; - else - return group; // ThreadGroup is instance of UEH - } - - /** - * Posts an interrupt request to this {@code Thread}. Unless the caller is - * the {@link #currentThread()}, the method {@code checkAccess()} is called - * for the installed {@code SecurityManager}, if any. This may result in a - * {@code SecurityException} being thrown. The further behavior depends on - * the state of this {@code Thread}: - *