();
13 |
14 | public static synchronized String intern(String s)
15 | {
16 | String si = _internSet.get(s);
17 | if (si != null)
18 | return si;
19 |
20 | _internSet.put(s, s);
21 | return s;
22 | }
23 |
24 | public static void deleteOnExit()
25 | {}
26 | }
27 |
--------------------------------------------------------------------------------
/lib/java/io/Closeable.java:
--------------------------------------------------------------------------------
1 | /* Licensed to the Apache Software Foundation (ASF) under one or more
2 | * contributor license agreements. See the NOTICE file distributed with
3 | * this work for additional information regarding copyright ownership.
4 | * The ASF licenses this file to You under the Apache License, Version 2.0
5 | * (the "License"); you may not use this file except in compliance with
6 | * the License. You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package java.io;
18 |
19 | /**
20 | * Defines an interface for classes that can (or need to) be closed once they
21 | * are not used any longer. This usually includes all sorts of
22 | * {@link InputStream}s and {@link OutputStream}s. Calling the {@code close}
23 | * method releases resources that the object holds.
24 | */
25 | public interface Closeable {
26 |
27 | /**
28 | * Closes the object and release any system resources it holds. If the
29 | * object has already been closed, then invoking this method has no effect.
30 | *
31 | * @throws IOException
32 | * if any error occurs when closing the object.
33 | */
34 | public void close() throws IOException;
35 | }
--------------------------------------------------------------------------------
/lib/java/io/FileFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.io;
19 |
20 | /**
21 | * An interface for filtering {@link File} objects based on their names
22 | * or other information.
23 | *
24 | * @see File#listFiles(FileFilter)
25 | */
26 | public abstract interface FileFilter {
27 |
28 | /**
29 | * Indicating whether a specific file should be included in a pathname list.
30 | *
31 | * @param pathname
32 | * the abstract file to check.
33 | * @return {@code true} if the file should be included, {@code false}
34 | * otherwise.
35 | */
36 | public abstract boolean accept(File pathname);
37 | }
38 |
--------------------------------------------------------------------------------
/lib/java/io/FileNotFoundException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.io;
19 |
20 | /**
21 | * Thrown when a file specified by a program cannot be found.
22 | */
23 | public class FileNotFoundException extends IOException {
24 |
25 | private static final long serialVersionUID = -897856973823710492L;
26 |
27 | /**
28 | * Constructs a new {@code FileNotFoundException} with its stack trace
29 | * filled in.
30 | */
31 | public FileNotFoundException() {
32 | super();
33 | }
34 |
35 | /**
36 | * Constructs a new {@code FileNotFoundException} with its stack trace and
37 | * detail message filled in.
38 | *
39 | * @param detailMessage
40 | * the detail message for this exception.
41 | */
42 | public FileNotFoundException(String detailMessage) {
43 | super(detailMessage);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/lib/java/io/FilenameFilter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.io;
19 |
20 | /**
21 | * An interface for filtering {@link File} objects based on their names
22 | * or the directory they reside in.
23 | *
24 | * @see File
25 | * @see File#list(FilenameFilter)
26 | */
27 | public interface FilenameFilter {
28 |
29 | /**
30 | * Indicates if a specific filename matches this filter.
31 | *
32 | * @param dir
33 | * the directory in which the {@code filename} was found.
34 | * @param filename
35 | * the name of the file in {@code dir} to test.
36 | * @return {@code true} if the filename matches the filter
37 | * and can be included in the list, {@code false}
38 | * otherwise.
39 | */
40 | public abstract boolean accept(File dir, String filename);
41 | }
42 |
--------------------------------------------------------------------------------
/lib/java/io/Flushable.java:
--------------------------------------------------------------------------------
1 | /* Licensed to the Apache Software Foundation (ASF) under one or more
2 | * contributor license agreements. See the NOTICE file distributed with
3 | * this work for additional information regarding copyright ownership.
4 | * The ASF licenses this file to You under the Apache License, Version 2.0
5 | * (the "License"); you may not use this file except in compliance with
6 | * the License. You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package java.io;
18 |
19 | /**
20 | * Defines an interface for classes that can (or need to) be flushed, typically
21 | * before some output processing is considered to be finished and the object
22 | * gets closed.
23 | */
24 | public interface Flushable {
25 | /**
26 | * Flushes the object by writing out any buffered data to the underlying
27 | * output.
28 | *
29 | * @throws IOException
30 | * if there are any issues writing the data.
31 | */
32 | void flush() throws IOException;
33 | }
34 |
--------------------------------------------------------------------------------
/lib/java/io/IOException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.io;
19 |
20 | /**
21 | * Signals a general, I/O-related error. Error details may be specified when
22 | * calling the constructor, as usual. Note there are also several subclasses of
23 | * this class for more specific error situations, such as
24 | * {@link FileNotFoundException} or {@link EOFException}.
25 | */
26 | public class IOException extends Exception {
27 |
28 | private static final long serialVersionUID = 7818375828146090155L;
29 |
30 | /**
31 | * Constructs a new {@code IOException} with its stack trace filled in.
32 | */
33 | public IOException() {
34 | super();
35 | }
36 |
37 | /**
38 | * Constructs a new {@code IOException} with its stack trace and detail
39 | * message filled in.
40 | *
41 | * @param detailMessage
42 | * the detail message for this exception.
43 | */
44 | public IOException(String detailMessage) {
45 | super(detailMessage);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/lib/java/io/Serializable.java:
--------------------------------------------------------------------------------
1 | package java.io;
2 |
3 | public interface Serializable
4 | {
5 |
6 | }
7 |
--------------------------------------------------------------------------------
/lib/java/io/SyncFailedException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.io;
19 |
20 | /**
21 | * Signals that the {@link FileDescriptor#sync()} method has failed to
22 | * complete.
23 | */
24 | public class SyncFailedException extends IOException {
25 |
26 | private static final long serialVersionUID = -2353342684412443330L;
27 |
28 | /**
29 | * Constructs a new {@code SyncFailedException} with its stack trace and
30 | * detail message filled in.
31 | *
32 | * @param detailMessage
33 | * the detail message for this exception.
34 | */
35 | public SyncFailedException(String detailMessage) {
36 | super(detailMessage);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/lib/java/io/UTFDataFormatException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.io;
19 |
20 | /**
21 | * Signals that an incorrectly encoded UTF-8 string has been encountered, most
22 | * likely while reading some {@link DataInputStream}.
23 | *
24 | * @see DataInputStream#readUTF()
25 | */
26 | public class UTFDataFormatException extends IOException {
27 |
28 | private static final long serialVersionUID = 420743449228280612L;
29 |
30 | /**
31 | * Constructs a new {@code UTFDataFormatException} with its stack trace
32 | * filled in.
33 | */
34 | public UTFDataFormatException() {
35 | super();
36 | }
37 |
38 | /**
39 | * Constructs a new {@code UTFDataFormatException} with its stack trace and
40 | * detail message filled in.
41 | *
42 | * @param detailMessage
43 | * the detail message for this exception.
44 | */
45 | public UTFDataFormatException(String detailMessage) {
46 | super(detailMessage);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/lib/java/io/UnsupportedEncodingException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.io;
19 |
20 | /**
21 | * Thrown when a program asks for a particular character converter that is
22 | * unavailable.
23 | */
24 | public class UnsupportedEncodingException extends IOException {
25 |
26 | private static final long serialVersionUID = -4274276298326136670L;
27 |
28 | /**
29 | * Constructs a new {@code UnsupportedEncodingException} with its stack
30 | * trace filled in.
31 | */
32 | public UnsupportedEncodingException() {
33 | super();
34 | }
35 |
36 | /**
37 | * Constructs a new {@code UnsupportedEncodingException} with its stack
38 | * trace and detail message filled in.
39 | *
40 | * @param detailMessage
41 | * the detail message for this exception.
42 | */
43 | public UnsupportedEncodingException(String detailMessage) {
44 | super(detailMessage);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/java/lang/AbstractMethodError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown by the virtual machine when an abstract method is called.
22 | *
23 | * Note that this can only occur when inconsistent class files have been loaded,
24 | * since invoking an abstract method is a compile time error.
25 | */
26 | public class AbstractMethodError extends IncompatibleClassChangeError {
27 |
28 | private static final long serialVersionUID = -1654391082989018462L;
29 |
30 | /**
31 | * Constructs a new {@code AbstractMethodError} that includes the current
32 | * stack trace.
33 | */
34 | public AbstractMethodError() {
35 | super();
36 | }
37 |
38 | /**
39 | * Constructs a new {@code AbstractMethodError} with the current stack trace
40 | * and the specified detail message.
41 | *
42 | * @param detailMessage
43 | * the detail message for this error.
44 | */
45 | public AbstractMethodError(String detailMessage) {
46 | super(detailMessage);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/lib/java/lang/ArithmeticException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when the an invalid arithmetic operation is attempted.
22 | */
23 | public class ArithmeticException extends RuntimeException {
24 |
25 | private static final long serialVersionUID = 2256477558314496007L;
26 |
27 | /**
28 | * Constructs a new {@code ArithmeticException} that includes the current
29 | * stack trace.
30 | */
31 | public ArithmeticException() {
32 | super();
33 | }
34 |
35 | /**
36 | * Constructs a new {@code ArithmeticException} with the current stack trace
37 | * and the specified detail message.
38 | *
39 | * @param detailMessage
40 | * the detail message for this exception.
41 | */
42 | public ArithmeticException(String detailMessage) {
43 | super(detailMessage);
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/lib/java/lang/ArrayIndexOutOfBoundsException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | import org.apache.harmony.luni.internal.nls.Messages;
21 |
22 | /**
23 | * Thrown when the an array is indexed with a value less than zero, or greater
24 | * than or equal to the size of the array.
25 | */
26 | public class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException {
27 |
28 | private static final long serialVersionUID = -5116101128118950844L;
29 |
30 | /**
31 | * Constructs a new {@code ArrayIndexOutOfBoundsException} that includes the
32 | * current stack trace.
33 | */
34 | public ArrayIndexOutOfBoundsException() {
35 | super();
36 | }
37 |
38 | /**
39 | * Constructs a new {@code ArrayIndexOutOfBoundsException} with the current
40 | * stack trace and a detail message that is based on the specified invalid
41 | * {@code index}.
42 | *
43 | * @param index
44 | * the invalid index.
45 | */
46 | public ArrayIndexOutOfBoundsException(int index) {
47 | // luni.36=Array index out of range\: {0}
48 | super(Messages.getString("luni.36", index)); //$NON-NLS-1$
49 | }
50 |
51 | /**
52 | * Constructs a new {@code ArrayIndexOutOfBoundsException} with the current
53 | * stack trace and the specified detail message.
54 | *
55 | * @param detailMessage
56 | * the detail message for this exception.
57 | */
58 | public ArrayIndexOutOfBoundsException(String detailMessage) {
59 | super(detailMessage);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/lib/java/lang/ArrayStoreException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when a program attempts to store an element of an incompatible type in
22 | * an array.
23 | */
24 | public class ArrayStoreException extends RuntimeException {
25 |
26 | private static final long serialVersionUID = -4522193890499838241L;
27 |
28 | /**
29 | * Constructs a new {@code ArrayStoreException} that includes the current
30 | * stack trace.
31 | */
32 | public ArrayStoreException() {
33 | super();
34 | }
35 |
36 | /**
37 | * Constructs a new {@code ArrayStoreException} with the current stack trace
38 | * and the specified detail message.
39 | *
40 | * @param detailMessage
41 | * the detail message for this exception.
42 | */
43 | public ArrayStoreException(String detailMessage) {
44 | super(detailMessage);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/java/lang/CharSequence.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 |
21 | /**
22 | * This interface represents an ordered set of characters and defines the
23 | * methods to probe them.
24 | */
25 | public interface CharSequence {
26 |
27 | /**
28 | * Returns the number of characters in this sequence.
29 | *
30 | * @return the number of characters.
31 | */
32 | public int length();
33 |
34 | /**
35 | * Returns the character at the specified index, with the first character
36 | * having index zero.
37 | *
38 | * @param index
39 | * the index of the character to return.
40 | * @return the requested character.
41 | * @throws IndexOutOfBoundsException
42 | * if {@code index < 0} or {@code index} is greater than the
43 | * length of this sequence.
44 | */
45 | public char charAt(int index);
46 |
47 | /**
48 | * Returns a {@code CharSequence} from the {@code start} index (inclusive)
49 | * to the {@code end} index (exclusive) of this sequence.
50 | *
51 | * @param start
52 | * the start offset of the sub-sequence. It is inclusive, that
53 | * is, the index of the first character that is included in the
54 | * sub-sequence.
55 | * @param end
56 | * the end offset of the sub-sequence. It is exclusive, that is,
57 | * the index of the first character after those that are included
58 | * in the sub-sequence
59 | * @return the requested sub-sequence.
60 | * @throws IndexOutOfBoundsException
61 | * if {@code start < 0}, {@code end < 0}, {@code start > end},
62 | * or if {@code start} or {@code end} are greater than the
63 | * length of this sequence.
64 | */
65 | public CharSequence subSequence(int start, int end);
66 |
67 | /**
68 | * Returns a string with the same characters in the same order as in this
69 | * sequence.
70 | *
71 | * @return a string based on this sequence.
72 | */
73 | public String toString();
74 | }
75 |
--------------------------------------------------------------------------------
/lib/java/lang/Class.java:
--------------------------------------------------------------------------------
1 | package java.lang;
2 |
3 | public abstract class Class
4 | {
5 | public native boolean isInstance(Object o);
6 | public native boolean isPrimitive();
7 | public native boolean isArray();
8 | public native Class> getSuperclass();
9 | public native Class> getComponentType();
10 | public native Class> getArrayType();
11 | private Class> _arrayType;
12 | public native String getName();
13 |
14 | public final boolean desiredAssertionStatus()
15 | {
16 | return true;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/lib/java/lang/ClassCastException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | import org.apache.harmony.luni.internal.nls.Messages;
21 |
22 | /**
23 | * Thrown when a program attempts to cast a an object to a type with which it is
24 | * not compatible.
25 | */
26 | public class ClassCastException extends RuntimeException {
27 | private static final long serialVersionUID = -9223365651070458532L;
28 |
29 | /**
30 | * Constructs a new {@code ClassCastException} that includes the current
31 | * stack trace.
32 | */
33 | public ClassCastException() {
34 | super();
35 | }
36 |
37 | /**
38 | * Constructs a new {@code ClassCastException} with the current stack trace
39 | * and the specified detail message.
40 | *
41 | * @param detailMessage
42 | * the detail message for this exception.
43 | */
44 | public ClassCastException(String detailMessage) {
45 | super(detailMessage);
46 | }
47 |
48 | /**
49 | * Constructs a new {@code ClassCastException} with the current stack trace
50 | * and a detail message based on the source and target class.
51 | *
52 | * @param instanceClass
53 | * the class being cast from.
54 | * @param castClass
55 | * the class being cast to.
56 | */
57 | ClassCastException(Class> instanceClass, Class> castClass) {
58 | super(Messages.getString("luni.4B", instanceClass.getName(), castClass //$NON-NLS-1$
59 | .getName()));
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/lib/java/lang/ClassCircularityError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 |
19 | package java.lang;
20 |
21 | /**
22 | * Thrown when the virtual machine notices that an attempt is made to load a
23 | * class which would directly or indirectly inherit from one of its subclasses.
24 | *
25 | * Note that this error can only occur when inconsistent class files are loaded,
26 | * since it would normally be detected at compile time.
27 | */
28 | public class ClassCircularityError extends LinkageError {
29 |
30 | private static final long serialVersionUID = 1054362542914539689L;
31 |
32 | /**
33 | * Constructs a new {@code ClassCircularityError} that include the current
34 | * stack trace.
35 | */
36 | public ClassCircularityError() {
37 | super();
38 | }
39 |
40 | /**
41 | * Constructs a new {@code ClassCircularityError} with the current stack
42 | * trace and the specified detail message.
43 | *
44 | * @param detailMessage
45 | * the detail message for this error.
46 | */
47 | public ClassCircularityError(String detailMessage) {
48 | super(detailMessage);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/lib/java/lang/ClassFormatError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown by a class loader when a class file has an illegal format or if the
22 | * data that it contains can not be interpreted as a class.
23 | */
24 | public class ClassFormatError extends LinkageError {
25 |
26 | private static final long serialVersionUID = -8420114879011949195L;
27 |
28 | /**
29 | * Constructs a new {@code ClassFormatError} that includes the current stack
30 | * trace.
31 | */
32 | public ClassFormatError() {
33 | super();
34 | }
35 |
36 | /**
37 | * Constructs a new {@code ClassFormatError} with the current stack trace
38 | * and the specified detail message.
39 | *
40 | * @param detailMessage
41 | * the detail message for this error.
42 | */
43 | public ClassFormatError(String detailMessage) {
44 | super(detailMessage);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/java/lang/CloneNotSupportedException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when a program attempts to clone an object which does not support the
22 | * {@link Cloneable} interface.
23 | *
24 | * @see Cloneable
25 | */
26 | public class CloneNotSupportedException extends Exception {
27 |
28 | private static final long serialVersionUID = 5195511250079656443L;
29 |
30 | /**
31 | * Constructs a new {@code CloneNotSupportedException} that includes the
32 | * current stack trace.
33 | */
34 | public CloneNotSupportedException() {
35 | super();
36 | }
37 |
38 | /**
39 | * Constructs a new {@code CloneNotSupportedException} with the current
40 | * stack trace and the specified detail message.
41 | *
42 | * @param detailMessage
43 | * the detail message for this exception.
44 | */
45 | public CloneNotSupportedException(String detailMessage) {
46 | super(detailMessage);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/lib/java/lang/Cloneable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 |
21 | /**
22 | * This (empty) interface must be implemented by all classes that wish to
23 | * support cloning. The implementation of {@code clone()} in {@code Object}
24 | * checks if the object being cloned implements this interface and throws
25 | * {@code CloneNotSupportedException} if it does not.
26 | *
27 | * @see Object#clone
28 | * @see CloneNotSupportedException
29 | */
30 | public interface Cloneable {
31 | // Marker interface
32 | }
33 |
--------------------------------------------------------------------------------
/lib/java/lang/Comparable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * This interface should be implemented by all classes that wish to define a
22 | * natural order of their instances.
23 | * {@link java.util.Collections#sort} and {@code java.util.Arrays#sort} can then
24 | * be used to automatically sort lists of classes that implement this interface.
25 | *
26 | * The order rule must be both transitive (if {@code x.compareTo(y) < 0} and
27 | * {@code y.compareTo(z) < 0}, then {@code x.compareTo(z) < 0} must hold) and
28 | * invertible (the sign of the result of x.compareTo(y) must be equal to the
29 | * negation of the sign of the result of y.compareTo(x) for all combinations of
30 | * x and y).
31 | *
32 | * In addition, it is recommended (but not required) that if and only if the
33 | * result of x.compareTo(y) is zero, then the result of x.equals(y) should be
34 | * {@code true}.
35 | */
36 | public interface Comparable {
37 |
38 | /**
39 | * Compares this object to the specified object to determine their relative
40 | * order.
41 | *
42 | * @param another
43 | * the object to compare to this instance.
44 | * @return a negative integer if this instance is less than {@code another};
45 | * a positive integer if this instance is greater than
46 | * {@code another}; 0 if this instance has the same order as
47 | * {@code another}.
48 | * @throws ClassCastException
49 | * if {@code another} cannot be converted into something
50 | * comparable to {@code this} instance.
51 | */
52 | int compareTo(T another);
53 | }
54 |
--------------------------------------------------------------------------------
/lib/java/lang/Deprecated.java:
--------------------------------------------------------------------------------
1 | /* Licensed to the Apache Software Foundation (ASF) under one or more
2 | * contributor license agreements. See the NOTICE file distributed with
3 | * this work for additional information regarding copyright ownership.
4 | * The ASF licenses this file to You under the Apache License, Version 2.0
5 | * (the "License"); you may not use this file except in compliance with
6 | * the License. You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package java.lang;
18 |
19 | import java.lang.annotation.Documented;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 |
23 | /**
24 | * Annotation type used to mark program elements that should no longer be used
25 | * by programmers. Compilers produce a warning if a deprecated program element
26 | * is used.
27 | *
28 | * @since 1.5
29 | */
30 | @Documented
31 | @Retention(RetentionPolicy.RUNTIME)
32 | public @interface Deprecated {
33 | }
34 |
--------------------------------------------------------------------------------
/lib/java/lang/EnumConstantNotPresentException.java:
--------------------------------------------------------------------------------
1 | /* Licensed to the Apache Software Foundation (ASF) under one or more
2 | * contributor license agreements. See the NOTICE file distributed with
3 | * this work for additional information regarding copyright ownership.
4 | * The ASF licenses this file to You under the Apache License, Version 2.0
5 | * (the "License"); you may not use this file except in compliance with
6 | * the License. You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package java.lang;
18 |
19 | import org.apache.harmony.luni.internal.nls.Messages;
20 |
21 | /**
22 | * Thrown if an {@code enum} constant does not exist for a particular name.
23 | *
24 | * @since 1.5
25 | */
26 | public class EnumConstantNotPresentException extends RuntimeException {
27 |
28 | private static final long serialVersionUID = -6046998521960521108L;
29 |
30 | @SuppressWarnings("unchecked")
31 | private final Class extends Enum> enumType;
32 |
33 | private final String constantName;
34 |
35 | /**
36 | * Constructs a new {@code EnumConstantNotPresentException} with the current
37 | * stack trace and a detail message based on the specified enum type and
38 | * missing constant name.
39 | *
40 | * @param enumType
41 | * the enum type.
42 | * @param constantName
43 | * the missing constant name.
44 | */
45 | @SuppressWarnings("unchecked")
46 | public EnumConstantNotPresentException(Class extends Enum> enumType,
47 | String constantName) {
48 | // luni.03=The enum constant {0}.{1} is missing
49 | super(Messages.getString("luni.03", enumType.getName(), constantName)); //$NON-NLS-1$
50 | this.enumType = enumType;
51 | this.constantName = constantName;
52 | }
53 |
54 | /**
55 | * Gets the enum type for which the constant name is missing.
56 | *
57 | * @return the enum type for which a constant name has not been found.
58 | */
59 | @SuppressWarnings("unchecked")
60 | public Class extends Enum> enumType() {
61 | return enumType;
62 | }
63 |
64 | /**
65 | * Gets the name of the missing constant.
66 | *
67 | * @return the name of the constant that has not been found in the enum
68 | * type.
69 | */
70 | public String constantName() {
71 | return constantName;
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/lib/java/lang/Error.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 |
21 | /**
22 | * {@code Error} is the superclass of all classes that represent unrecoverable
23 | * errors. When errors are thrown, they should not be caught by application
24 | * code.
25 | *
26 | * @see Throwable
27 | * @see Exception
28 | * @see RuntimeException
29 | */
30 | public class Error extends Throwable {
31 |
32 | private static final long serialVersionUID = 4980196508277280342L;
33 |
34 | /**
35 | * Constructs a new {@code Error} that includes the current stack trace.
36 | */
37 | public Error() {
38 | super();
39 | }
40 |
41 | /**
42 | * Constructs a new {@code Error} with the current stack trace and the
43 | * specified detail message.
44 | *
45 | * @param detailMessage
46 | * the detail message for this error.
47 | */
48 | public Error(String detailMessage) {
49 | super(detailMessage);
50 | }
51 |
52 | /**
53 | * Constructs a new {@code Error} with the current stack trace, the
54 | * specified detail message and the specified cause.
55 | *
56 | * @param detailMessage
57 | * the detail message for this error.
58 | * @param throwable
59 | * the cause of this error.
60 | */
61 | public Error(String detailMessage, Throwable throwable) {
62 | super(detailMessage, throwable);
63 | }
64 |
65 | /**
66 | * Constructs a new {@code Error} with the current stack trace and the
67 | * specified cause.
68 | *
69 | * @param throwable
70 | * the cause of this error.
71 | */
72 | public Error(Throwable throwable) {
73 | super(throwable);
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/lib/java/lang/Exception.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 |
21 | /**
22 | * {@code Exception} is the superclass of all classes that represent recoverable
23 | * exceptions. When exceptions are thrown, they may be caught by application
24 | * code.
25 | *
26 | * @see Throwable
27 | * @see Error
28 | * @see RuntimeException
29 | */
30 | public class Exception extends Throwable {
31 | private static final long serialVersionUID = -3387516993124229948L;
32 |
33 | /**
34 | * Constructs a new {@code Exception} that includes the current stack trace.
35 | */
36 | public Exception() {
37 | super();
38 | }
39 |
40 | /**
41 | * Constructs a new {@code Exception} with the current stack trace and the
42 | * specified detail message.
43 | *
44 | * @param detailMessage
45 | * the detail message for this exception.
46 | */
47 | public Exception(String detailMessage) {
48 | super(detailMessage);
49 | }
50 |
51 | /**
52 | * Constructs a new {@code Exception} with the current stack trace, the
53 | * specified detail message and the specified cause.
54 | *
55 | * @param detailMessage
56 | * the detail message for this exception.
57 | * @param throwable
58 | * the cause of this exception.
59 | */
60 | public Exception(String detailMessage, Throwable throwable) {
61 | super(detailMessage, throwable);
62 | }
63 |
64 | /**
65 | * Constructs a new {@code Exception} with the current stack trace and the
66 | * specified cause.
67 | *
68 | * @param throwable
69 | * the cause of this exception.
70 | */
71 | public Exception(Throwable throwable) {
72 | super(throwable);
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/lib/java/lang/IllegalAccessError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when the virtual machine notices that a program tries access a field
22 | * which is not accessible from where it is referenced.
23 | *
24 | * Note that this can only occur when inconsistent class files have been loaded.
25 | */
26 | public class IllegalAccessError extends IncompatibleClassChangeError {
27 |
28 | private static final long serialVersionUID = -8988904074992417891L;
29 |
30 | /**
31 | * Constructs a new {@code IllegalAccessError} that includes the current
32 | * stack trace.
33 | */
34 | public IllegalAccessError() {
35 | super();
36 | }
37 |
38 | /**
39 | * Constructs a new {@code IllegalAccessError} with the current stack trace
40 | * and the specified detail message.
41 | *
42 | * @param detailMessage
43 | * the detail message for this error.
44 | */
45 | public IllegalAccessError(String detailMessage) {
46 | super(detailMessage);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/lib/java/lang/IllegalArgumentException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when a method is invoked with an argument which it can not reasonably
22 | * deal with.
23 | */
24 | public class IllegalArgumentException extends RuntimeException {
25 |
26 | private static final long serialVersionUID = -5365630128856068164L;
27 |
28 | /**
29 | * Constructs a new {@code IllegalArgumentException} that includes the
30 | * current stack trace.
31 | */
32 | public IllegalArgumentException() {
33 | super();
34 | }
35 |
36 | /**
37 | * Constructs a new {@code IllegalArgumentException} with the current stack
38 | * trace and the specified detail message.
39 | *
40 | * @param detailMessage
41 | * the detail message for this exception.
42 | */
43 | public IllegalArgumentException(String detailMessage) {
44 | super(detailMessage);
45 | }
46 |
47 | /**
48 | * Constructs a new {@code IllegalArgumentException} with the current stack
49 | * trace, the specified detail message and the specified cause.
50 | *
51 | * @param message
52 | * the detail message for this exception.
53 | * @param cause
54 | * the cause of this exception, may be {@code null}.
55 | * @since 1.5
56 | */
57 | public IllegalArgumentException(String message, Throwable cause) {
58 | super(message, cause);
59 | }
60 |
61 | /**
62 | * Constructs a new {@code IllegalArgumentException} with the current stack
63 | * trace and the specified cause.
64 | *
65 | * @param cause
66 | * the cause of this exception, may be {@code null}.
67 | * @since 1.5
68 | */
69 | public IllegalArgumentException(Throwable cause) {
70 | super((cause == null ? null : cause.toString()), cause);
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/lib/java/lang/IllegalMonitorStateException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when a monitor operation is attempted when the monitor is not in the
22 | * correct state, for example when a thread attempts to exit a monitor which it
23 | * does not own.
24 | */
25 | public class IllegalMonitorStateException extends RuntimeException {
26 |
27 | private static final long serialVersionUID = 3713306369498869069L;
28 |
29 | /**
30 | * Constructs a new {@code IllegalMonitorStateException} that includes the
31 | * current stack trace.
32 | */
33 | public IllegalMonitorStateException() {
34 | super();
35 | }
36 |
37 | /**
38 | * Constructs a new {@code IllegalArgumentException} with the current stack
39 | * trace and the specified detail message.
40 | *
41 | * @param detailMessage
42 | * the detail message for this exception.
43 | */
44 | public IllegalMonitorStateException(String detailMessage) {
45 | super(detailMessage);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/lib/java/lang/IllegalStateException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when an action is attempted at a time when the virtual machine is not
22 | * in the correct state.
23 | */
24 | public class IllegalStateException extends RuntimeException {
25 |
26 | private static final long serialVersionUID = -1848914673093119416L;
27 |
28 | /**
29 | * Constructs a new {@code IllegalStateException} that includes the current
30 | * stack trace.
31 | */
32 | public IllegalStateException() {
33 | super();
34 | }
35 |
36 | /**
37 | * Constructs a new {@code IllegalStateException} with the current stack
38 | * trace and the specified detail message.
39 | *
40 | * @param detailMessage
41 | * the detail message for this exception.
42 | */
43 | public IllegalStateException(String detailMessage) {
44 | super(detailMessage);
45 | }
46 |
47 | /**
48 | * Constructs a new {@code IllegalStateException} with the current stack
49 | * trace, the specified detail message and the specified cause.
50 | *
51 | * @param message
52 | * the detail message for this exception.
53 | * @param cause
54 | * the cause of this exception.
55 | * @since 1.5
56 | */
57 | public IllegalStateException(String message, Throwable cause) {
58 | super(message, cause);
59 | }
60 |
61 | /**
62 | * Constructs a new {@code IllegalStateException} with the current stack
63 | * trace and the specified cause.
64 | *
65 | * @param cause
66 | * the cause of this exception, may be {@code null}.
67 | * @since 1.5
68 | */
69 | public IllegalStateException(Throwable cause) {
70 | super((cause == null ? null : cause.toString()), cause);
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/lib/java/lang/IncompatibleClassChangeError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 |
21 | /**
22 | * {@code IncompatibleClassChangeError} is the superclass of all classes which
23 | * represent errors that occur when inconsistent class files are loaded into
24 | * the same running image.
25 | *
26 | * @see Error
27 | */
28 | public class IncompatibleClassChangeError extends LinkageError {
29 |
30 | private static final long serialVersionUID = -4914975503642802119L;
31 |
32 | /**
33 | * Constructs a new {@code IncompatibleClassChangeError} that includes the
34 | * current stack trace.
35 | */
36 | public IncompatibleClassChangeError() {
37 | super();
38 | }
39 |
40 | /**
41 | * Constructs a new {@code IncompatibleClassChangeError} with the current
42 | * stack trace and the specified detail message.
43 | *
44 | * @param detailMessage
45 | * the detail message for this error.
46 | */
47 | public IncompatibleClassChangeError(String detailMessage) {
48 | super(detailMessage);
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/lib/java/lang/IndexOutOfBoundsException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when a program attempts to access a value in an indexable collection
22 | * using a value which is outside of the range of valid indices.
23 | */
24 | public class IndexOutOfBoundsException extends RuntimeException {
25 |
26 | private static final long serialVersionUID = 234122996006267687L;
27 |
28 | /**
29 | * Constructs a new {@code IndexOutOfBoundsException} that includes the
30 | * current stack trace.
31 | */
32 | public IndexOutOfBoundsException() {
33 | super();
34 | }
35 |
36 | /**
37 | * Constructs a new {@code IndexOutOfBoundsException} with the current stack
38 | * trace and the specified detail message.
39 | *
40 | * @param detailMessage
41 | * the detail message for this exception.
42 | */
43 | public IndexOutOfBoundsException(String detailMessage) {
44 | super(detailMessage);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/java/lang/InstantiationError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when the virtual machine notices that a program tries to create a new
22 | * instance of a class which has no visible constructors from the location where
23 | * {@code new} is invoked.
24 | *
25 | * Note that this can only occur when inconsistent class files are being loaded.
26 | */
27 | public class InstantiationError extends IncompatibleClassChangeError {
28 | private static final long serialVersionUID = -4885810657349421204L;
29 |
30 | /**
31 | * Constructs a new {@code InstantiationError} that includes the current
32 | * stack trace.
33 | */
34 | public InstantiationError() {
35 | super();
36 | }
37 |
38 | /**
39 | * Constructs a new {@code InstantiationError} with the current stack trace
40 | * and the specified detail message.
41 | *
42 | * @param detailMessage
43 | * the detail message for this error.
44 | */
45 | public InstantiationError(String detailMessage) {
46 | super(detailMessage);
47 | }
48 |
49 | /**
50 | * Constructs a new {@code InstantiationError} with the current stack trace
51 | * and the class that caused this error.
52 | *
53 | * @param clazz
54 | * the class that can not be instantiated.
55 | */
56 | InstantiationError(Class> clazz) {
57 | super(clazz.getName());
58 | }
59 |
60 | }
61 |
--------------------------------------------------------------------------------
/lib/java/lang/InternalError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when the virtual machine notices that it has gotten into an undefined
22 | * state.
23 | */
24 | public class InternalError extends VirtualMachineError {
25 |
26 | private static final long serialVersionUID = -9062593416125562365L;
27 |
28 | /**
29 | * Constructs a new {@code InternalError} that includes the current stack
30 | * trace.
31 | */
32 | public InternalError() {
33 | super();
34 | }
35 |
36 | /**
37 | * Constructs a new {@code InternalError} with the current stack trace and
38 | * the specified detail message.
39 | *
40 | * @param detailMessage
41 | * the detail message for this error.
42 | */
43 | public InternalError(String detailMessage) {
44 | super(detailMessage);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/java/lang/Iterable.java:
--------------------------------------------------------------------------------
1 | /* Licensed to the Apache Software Foundation (ASF) under one or more
2 | * contributor license agreements. See the NOTICE file distributed with
3 | * this work for additional information regarding copyright ownership.
4 | * The ASF licenses this file to You under the Apache License, Version 2.0
5 | * (the "License"); you may not use this file except in compliance with
6 | * the License. You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package java.lang;
18 |
19 | import java.util.Iterator;
20 |
21 | /**
22 | * Objects of classes that implement this interface can be used within a
23 | * {@code foreach} statement.
24 | *
25 | * @since 1.5
26 | */
27 | public interface Iterable {
28 |
29 | /**
30 | * Returns an {@link Iterator} for the elements in this object.
31 | *
32 | * @return An {@code Iterator} instance.
33 | */
34 | Iterator iterator();
35 | }
36 |
--------------------------------------------------------------------------------
/lib/java/lang/LinkageError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 |
21 | /**
22 | * {@code LinkageError} is the superclass of all error classes that occur when
23 | * loading and linking class files.
24 | *
25 | * @see Error
26 | */
27 | public class LinkageError extends Error {
28 |
29 | private static final long serialVersionUID = 3579600108157160122L;
30 |
31 | /**
32 | * Constructs a new {@code LinkageError} that includes the current stack
33 | * trace.
34 | */
35 | public LinkageError() {
36 | super();
37 | }
38 |
39 | /**
40 | * Constructs a new {@code LinkageError} with the current stack trace and
41 | * the specified detail message.
42 | *
43 | * @param detailMessage
44 | * the detail message for this error.
45 | */
46 | public LinkageError(String detailMessage) {
47 | super(detailMessage);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/lib/java/lang/NegativeArraySizeException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when an attempt is made to create an array with a size of less than
22 | * zero.
23 | */
24 | public class NegativeArraySizeException extends RuntimeException {
25 |
26 | private static final long serialVersionUID = -8960118058596991861L;
27 |
28 | /**
29 | * Constructs a new {@code NegativeArraySizeException} that includes the
30 | * current stack trace.
31 | */
32 | public NegativeArraySizeException() {
33 | super();
34 | }
35 |
36 | /**
37 | * Constructs a new {@code NegativeArraySizeException} with the current
38 | * stack trace and the specified detail message.
39 | *
40 | * @param detailMessage
41 | * the detail message for this exception.
42 | */
43 | public NegativeArraySizeException(String detailMessage) {
44 | super(detailMessage);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/java/lang/NoClassDefFoundError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when the virtual machine is unable to locate a class which it has been
22 | * asked to load.
23 | */
24 | public class NoClassDefFoundError extends LinkageError {
25 |
26 | private static final long serialVersionUID = 9095859863287012458L;
27 |
28 | /**
29 | * Constructs a new {@code NoClassDefFoundError} that includes the current
30 | * stack trace.
31 | */
32 | public NoClassDefFoundError() {
33 | super();
34 | }
35 |
36 | /**
37 | * Constructs a new {@code NoClassDefFoundError} with the current stack
38 | * trace and the specified detail message.
39 | *
40 | * @param detailMessage
41 | * the detail message for this error.
42 | */
43 | public NoClassDefFoundError(String detailMessage) {
44 | super(detailMessage);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/java/lang/NoSuchFieldError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when the virtual machine notices that a program tries to reference,
22 | * on a class or object, a field that does not exist.
23 | *
24 | * Note that this can only occur when inconsistent class files are being loaded.
25 | */
26 | public class NoSuchFieldError extends IncompatibleClassChangeError {
27 |
28 | private static final long serialVersionUID = -3456430195886129035L;
29 |
30 | /**
31 | * Constructs a new {@code NoSuchFieldError} that includes the current stack
32 | * trace.
33 | */
34 | public NoSuchFieldError() {
35 | super();
36 | }
37 |
38 | /**
39 | * Constructs a new {@code NoSuchFieldError} with the current stack trace
40 | * and the specified detail message.
41 | *
42 | * @param detailMessage
43 | * the detail message for this error.
44 | */
45 | public NoSuchFieldError(String detailMessage) {
46 | super(detailMessage);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/lib/java/lang/NoSuchMethodError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when the virtual machine notices that a program tries to reference,
22 | * on a class or object, a method that does not exist.
23 | */
24 | public class NoSuchMethodError extends IncompatibleClassChangeError {
25 |
26 | private static final long serialVersionUID = -3765521442372831335L;
27 |
28 | /**
29 | * Constructs a new {@code NoSuchMethodError} that includes the current
30 | * stack trace.
31 | */
32 | public NoSuchMethodError() {
33 | super();
34 | }
35 |
36 | /**
37 | * Constructs a new {@code NoSuchMethodError} with the current stack trace
38 | * and the specified detail message.
39 | *
40 | * @param detailMessage
41 | * the detail message for this exception.
42 | */
43 | public NoSuchMethodError(String detailMessage) {
44 | super(detailMessage);
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/lib/java/lang/NullPointerException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when a program tries to access a field or method of an object or an
22 | * element of an array when there is no instance or array to use, that is if the
23 | * object or array points to {@code null}. It also occurs in some other, less
24 | * obvious circumstances, like a {@code throw e} statement where the {@link
25 | * Throwable} reference is {@code null}.
26 | */
27 | public class NullPointerException extends RuntimeException {
28 |
29 | private static final long serialVersionUID = 5162710183389028792L;
30 |
31 | /**
32 | * Constructs a new {@code NullPointerException} that includes the current
33 | * stack trace.
34 | */
35 | public NullPointerException() {
36 | super();
37 | }
38 |
39 | /**
40 | * Constructs a new {@code NullPointerException} with the current stack
41 | * trace and the specified detail message.
42 | *
43 | * @param detailMessage
44 | * the detail message for this exception.
45 | */
46 | public NullPointerException(String detailMessage) {
47 | super(detailMessage);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/lib/java/lang/Number.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 |
21 | /**
22 | * The abstract superclass of the classes which represent numeric base types
23 | * (that is {@link Byte}, {@link Short}, {@link Integer}, {@link Long},
24 | * {@link Float}, and {@link Double}.
25 | */
26 | public abstract class Number implements java.io.Serializable {
27 |
28 | private static final long serialVersionUID = -8742448824652078965L;
29 |
30 | /**
31 | * Empty default constructor.
32 | */
33 | public Number() {
34 | }
35 |
36 | /**
37 | * Returns this object's value as a byte. Might involve rounding and/or
38 | * truncating the value, so it fits into a byte.
39 | *
40 | * @return the primitive byte value of this object.
41 | */
42 | public byte byteValue() {
43 | return (byte) intValue();
44 | }
45 |
46 | /**
47 | * Returns this object's value as a double. Might involve rounding.
48 | *
49 | * @return the primitive double value of this object.
50 | */
51 | public abstract double doubleValue();
52 |
53 | /**
54 | * Returns this object's value as a float. Might involve rounding.
55 | *
56 | * @return the primitive float value of this object.
57 | */
58 | public abstract float floatValue();
59 |
60 | /**
61 | * Returns this object's value as an int. Might involve rounding and/or
62 | * truncating the value, so it fits into an int.
63 | *
64 | * @return the primitive int value of this object.
65 | */
66 | public abstract int intValue();
67 |
68 | /**
69 | * Returns this object's value as a long. Might involve rounding and/or
70 | * truncating the value, so it fits into a long.
71 | *
72 | * @return the primitive long value of this object.
73 | */
74 | public abstract long longValue();
75 |
76 | /**
77 | * Returns this object's value as a short. Might involve rounding and/or
78 | * truncating the value, so it fits into a short.
79 | *
80 | * @return the primitive short value of this object.
81 | */
82 | public short shortValue() {
83 | return (short) intValue();
84 | }
85 | }
86 |
--------------------------------------------------------------------------------
/lib/java/lang/NumberFormatException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when an invalid value is passed to a string-to-number conversion
22 | * method.
23 | */
24 | public class NumberFormatException extends java.lang.IllegalArgumentException {
25 |
26 | private static final long serialVersionUID = -2848938806368998894L;
27 |
28 | /**
29 | * Constructs a new {@code NumberFormatException} that includes the current
30 | * stack trace.
31 | */
32 | public NumberFormatException() {
33 | super();
34 | }
35 |
36 | /**
37 | * Constructs a new {@code NumberFormatException} with the current stack
38 | * trace and the specified detail message.
39 | *
40 | * @param detailMessage
41 | * the detail message for this exception.
42 | */
43 | public NumberFormatException(String detailMessage) {
44 | super(detailMessage);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/java/lang/Object.java:
--------------------------------------------------------------------------------
1 | package java.lang;
2 |
3 | import java.io.IOException;
4 |
5 | public class Object
6 | {
7 | public native int hashCode();
8 |
9 | public native Class extends Object> getClass();
10 |
11 | public native boolean equals(Object object);
12 |
13 | public String toString()
14 | {
15 | return "[" + hashCode() + "]";
16 | }
17 |
18 | protected Object clone() throws CloneNotSupportedException
19 | {
20 | throw new CloneNotSupportedException();
21 | }
22 |
23 | }
24 |
--------------------------------------------------------------------------------
/lib/java/lang/OutOfMemoryError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when a request for memory is made that can not be satisfied using the
22 | * available platform resources. Such a request may be made by both the running
23 | * application or by an internal function of the virtual machine.
24 | */
25 | public class OutOfMemoryError extends java.lang.VirtualMachineError {
26 |
27 | private static final long serialVersionUID = 8228564086184010517L;
28 |
29 | /**
30 | * Constructs a new {@code OutOfMemoryError} that includes the current stack
31 | * trace.
32 | */
33 | public OutOfMemoryError() {
34 | super();
35 | }
36 |
37 | /**
38 | * Constructs a new {@code OutOfMemoryError} with the current stack trace
39 | * and the specified detail message.
40 | *
41 | * @param detailMessage
42 | * the detail message for this error.
43 | */
44 | public OutOfMemoryError(String detailMessage) {
45 | super(detailMessage);
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/lib/java/lang/Override.java:
--------------------------------------------------------------------------------
1 | /* Licensed to the Apache Software Foundation (ASF) under one or more
2 | * contributor license agreements. See the NOTICE file distributed with
3 | * this work for additional information regarding copyright ownership.
4 | * The ASF licenses this file to You under the Apache License, Version 2.0
5 | * (the "License"); you may not use this file except in compliance with
6 | * the License. You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package java.lang;
18 |
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | * Annotation type used to mark methods that override a method declaration in a
26 | * superclass. Compilers produce an error if a method annotated with @Override
27 | * does not actually override a method in a superclass.
28 | *
29 | * @since 1.5
30 | */
31 | @Target(ElementType.METHOD)
32 | @Retention(RetentionPolicy.SOURCE)
33 | public @interface Override {
34 | }
35 |
--------------------------------------------------------------------------------
/lib/java/lang/Readable.java:
--------------------------------------------------------------------------------
1 | /* Licensed to the Apache Software Foundation (ASF) under one or more
2 | * contributor license agreements. See the NOTICE file distributed with
3 | * this work for additional information regarding copyright ownership.
4 | * The ASF licenses this file to You under the Apache License, Version 2.0
5 | * (the "License"); you may not use this file except in compliance with
6 | * the License. You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package java.lang;
18 |
19 | import java.io.IOException;
20 | import java.nio.CharBuffer;
21 |
22 | /**
23 | * Represents a sequence of characters that can be incrementally read (copied)
24 | * into a {@link CharBuffer}.
25 | */
26 | public interface Readable {
27 |
28 | /**
29 | * Reads characters into the specified {@code CharBuffer}. The maximum
30 | * number of characters read is {@code CharBuffer.remaining()}.
31 | *
32 | * @param cb
33 | * the buffer to be filled with characters read.
34 | * @return the number of characters actually read, or -1 if this
35 | * {@code Readable} reaches its end
36 | * @throws IOException
37 | * if an I/O error occurs.
38 | */
39 | int read(CharBuffer cb) throws IOException;
40 | }
41 |
--------------------------------------------------------------------------------
/lib/java/lang/RuntimeException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * {@code RuntimeException} is the superclass of all classes that represent
22 | * exceptional conditions which occur as a result of executing an application in
23 | * the virtual machine. Unlike checked exceptions (exceptions where the type
24 | * doesn't extend {@code RuntimeException} or {@link Error}), the compiler does
25 | * not require code to handle runtime exceptions.
26 | */
27 | public class RuntimeException extends Exception {
28 |
29 | private static final long serialVersionUID = -7034897190745766939L;
30 |
31 | /**
32 | * Constructs a new {@code RuntimeException} that includes the current stack
33 | * trace.
34 | */
35 | public RuntimeException() {
36 | super();
37 | }
38 |
39 | /**
40 | * Constructs a new {@code RuntimeException} with the current stack trace
41 | * and the specified detail message.
42 | *
43 | * @param detailMessage
44 | * the detail message for this exception.
45 | */
46 | public RuntimeException(String detailMessage) {
47 | super(detailMessage);
48 | }
49 |
50 | /**
51 | * Constructs a new {@code RuntimeException} with the current stack trace,
52 | * the specified detail message and the specified cause.
53 | *
54 | * @param detailMessage
55 | * the detail message for this exception.
56 | * @param throwable
57 | * the cause of this exception.
58 | */
59 | public RuntimeException(String detailMessage, Throwable throwable) {
60 | super(detailMessage, throwable);
61 | }
62 |
63 | /**
64 | * Constructs a new {@code RuntimeException} with the current stack trace
65 | * and the specified cause.
66 | *
67 | * @param throwable
68 | * the cause of this exception.
69 | */
70 | public RuntimeException(Throwable throwable) {
71 | super(throwable);
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/lib/java/lang/StackOverflowError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when the depth of the callstack of the running program excedes some
22 | * platform or virtual machine specific limit. Typically, this will occur only
23 | * when a program becomes infinitely recursive, but it can also occur in
24 | * correctly written (but deeply recursive) programs.
25 | */
26 | public class StackOverflowError extends java.lang.VirtualMachineError {
27 |
28 | private static final long serialVersionUID = 8609175038441759607L;
29 |
30 | /**
31 | * Constructs a new {@code StackOverflowError} that includes the current
32 | * stack trace.
33 | */
34 | public StackOverflowError() {
35 | super();
36 | }
37 |
38 | /**
39 | * Constructs a new {@code StackOverflowError} with the current stack trace
40 | * and the specified detail message.
41 | *
42 | * @param detailMessage
43 | * the detail message for this exception.
44 | */
45 | public StackOverflowError(String detailMessage) {
46 | super(detailMessage);
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/lib/java/lang/StringIndexOutOfBoundsException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 |
21 | import org.apache.harmony.luni.internal.nls.Messages;
22 |
23 | /**
24 | * Thrown when the a string is indexed with a value less than zero, or greater
25 | * than or equal to the size of the array.
26 | */
27 | public class StringIndexOutOfBoundsException extends IndexOutOfBoundsException {
28 |
29 | private static final long serialVersionUID = -6762910422159637258L;
30 |
31 | /**
32 | * Constructs a new {@code StringIndexOutOfBoundsException} that includes
33 | * the current stack trace.
34 | */
35 | public StringIndexOutOfBoundsException() {
36 | super();
37 | }
38 |
39 | /**
40 | * Constructs a new {@code StringIndexOutOfBoundsException} with the current
41 | * stack trace and a detail message that is based on the specified invalid
42 | * {@code index}.
43 | *
44 | * @param index
45 | * the index which is out of bounds.
46 | */
47 | public StringIndexOutOfBoundsException(int index) {
48 | super(Messages.getString("luni.55", index)); //$NON-NLS-1$
49 | }
50 |
51 | /**
52 | * Constructs a new {@code StringIndexOutOfBoundsException} with the current
53 | * stack trace and the specified detail message.
54 | *
55 | * @param detailMessage
56 | * the detail message for this exception.
57 | */
58 | public StringIndexOutOfBoundsException(String detailMessage) {
59 | super(detailMessage);
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/lib/java/lang/SuppressWarnings.java:
--------------------------------------------------------------------------------
1 | /* Licensed to the Apache Software Foundation (ASF) under one or more
2 | * contributor license agreements. See the NOTICE file distributed with
3 | * this work for additional information regarding copyright ownership.
4 | * The ASF licenses this file to You under the Apache License, Version 2.0
5 | * (the "License"); you may not use this file except in compliance with
6 | * the License. You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package java.lang;
18 |
19 | import java.lang.annotation.ElementType;
20 | import java.lang.annotation.Retention;
21 | import java.lang.annotation.RetentionPolicy;
22 | import java.lang.annotation.Target;
23 |
24 | /**
25 | * Annotation type used to indicate that the compiler should not issue the
26 | * specified warnings for the marked program element. Warnings are not only
27 | * suppressed for the annotated element but also for all program elements
28 | * contained in that element.
29 | *
30 | * It is recommended that programmers always use this annotation on the most
31 | * deeply nested element where it is actually needed.
32 | *
33 | * @since 1.5
34 | */
35 | @Target( { ElementType.TYPE, ElementType.FIELD, ElementType.METHOD,
36 | ElementType.PARAMETER, ElementType.CONSTRUCTOR,
37 | ElementType.LOCAL_VARIABLE })
38 | @Retention(RetentionPolicy.SOURCE)
39 | public @interface SuppressWarnings {
40 |
41 | /**
42 | * The list of warnings a compiler should not issue.
43 | */
44 | public String[] value();
45 | }
46 |
--------------------------------------------------------------------------------
/lib/java/lang/System.java:
--------------------------------------------------------------------------------
1 | package java.lang;
2 |
3 | import java.io.FileDescriptor;
4 | import java.io.FileOutputStream;
5 | import java.io.PrintStream;
6 |
7 | public class System
8 | {
9 | public static PrintStream out = new PrintStream(new FileOutputStream(FileDescriptor.out));
10 | public static PrintStream err = new PrintStream(new FileOutputStream(FileDescriptor.err));
11 |
12 | public static String getProperty(String key)
13 | {
14 | return "";
15 | }
16 |
17 | public static String getProperty(String key, String defaultValue)
18 | {
19 | return defaultValue;
20 | }
21 |
22 | /**
23 | * Copies the number of {@code length} elements of the Array {@code src}
24 | * starting at the offset {@code srcPos} into the Array {@code dest} at
25 | * the position {@code destPos}.
26 | *
27 | * @param src
28 | * the source array to copy the content.
29 | * @param srcPos
30 | * the starting index of the content in {@code src}.
31 | * @param dest
32 | * the destination array to copy the data into.
33 | * @param destPos
34 | * the starting index for the copied content in {@code dest}.
35 | * @param length
36 | * the number of elements of the {@code array1} content they have
37 | * to be copied.
38 | */
39 | public static void arraycopy(Object src, int srcPos, Object dest, int destPos,
40 | int length) {
41 | // sending getClass() to both arguments will check for null
42 | Class> type1 = src.getClass();
43 | Class> type2 = dest.getClass();
44 | if (!type1.isArray() || !type2.isArray()) {
45 | throw new ArrayStoreException();
46 | }
47 | Class> componentType1 = type1.getComponentType();
48 | Class> componentType2 = type2.getComponentType();
49 | if (!componentType1.isPrimitive()) {
50 | if (componentType2.isPrimitive()) {
51 | throw new ArrayStoreException();
52 | }
53 | } else {
54 | if (componentType2 != componentType1) {
55 | throw new ArrayStoreException();
56 | }
57 | }
58 | arraycopyImpl(src, srcPos, dest, destPos, length);
59 | }
60 |
61 | public static native void arraycopyImpl(Object src, int srcPos, Object dest, int destPos,
62 | int length);
63 |
64 | public static native long currentTimeMillis();
65 |
66 | public static native void gc();
67 |
68 | public static native void log(String s);
69 | }
70 |
--------------------------------------------------------------------------------
/lib/java/lang/ThreadDeath.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * ThreadDeath is thrown when a thread stops executing. It is used to aid in the
22 | * orderly unrolling of the thread's stack (eg. cleanup of monitors).
23 | */
24 | public class ThreadDeath extends Error {
25 |
26 | private static final long serialVersionUID = -4417128565033088268L;
27 |
28 | /**
29 | * Constructs a new instance of this class. Note that in the case of
30 | * ThreadDeath, the stacktrace may not be filled in a way which
31 | * allows a stack trace to be printed.
32 | */
33 | public ThreadDeath() {
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/lib/java/lang/UnknownError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when the virtual machine must throw an error which does not match any
22 | * known exceptional condition.
23 | */
24 | public class UnknownError extends VirtualMachineError {
25 |
26 | private static final long serialVersionUID = 2524784860676771849L;
27 |
28 | /**
29 | * Constructs a new {@code UnknownError} that includes the current stack
30 | * trace.
31 | */
32 | public UnknownError() {
33 | super();
34 | }
35 |
36 | /**
37 | * Constructs a new {@code UnknownError} with the current stack trace and
38 | * the specified detail message.
39 | *
40 | * @param detailMessage
41 | * the detail message for this exception.
42 | */
43 | public UnknownError(String detailMessage) {
44 | super(detailMessage);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/java/lang/UnsatisfiedLinkError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when an attempt is made to invoke a native for which an implementation
22 | * could not be found.
23 | */
24 | public class UnsatisfiedLinkError extends LinkageError {
25 |
26 | private static final long serialVersionUID = -4019343241616879428L;
27 |
28 | /**
29 | * Constructs a new {@code UnsatisfiedLinkError} that includes the current
30 | * stack trace.
31 | */
32 | public UnsatisfiedLinkError() {
33 | super();
34 | }
35 |
36 | /**
37 | * Constructs a new {@code UnsatisfiedLinkError} with the current stack
38 | * trace and the specified detail message.
39 | *
40 | * @param detailMessage
41 | * the detail message for this exception.
42 | */
43 | public UnsatisfiedLinkError(String detailMessage) {
44 | super(detailMessage);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/java/lang/UnsupportedOperationException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when an unsupported operation is attempted.
22 | */
23 | public class UnsupportedOperationException extends RuntimeException {
24 |
25 | private static final long serialVersionUID = -1242599979055084673L;
26 |
27 | /**
28 | * Constructs a new {@code UnsupportedOperationException} that includes the
29 | * current stack trace.
30 | */
31 | public UnsupportedOperationException() {
32 | }
33 |
34 | /**
35 | * Constructs a new {@code UnsupportedOperationException} with the current
36 | * stack trace and the specified detail message.
37 | *
38 | * @param detailMessage
39 | * the detail message for this exception.
40 | */
41 | public UnsupportedOperationException(String detailMessage) {
42 | super(detailMessage);
43 | }
44 |
45 | /**
46 | * Constructs a new {@code UnsupportedOperationException} with the current
47 | * stack trace, the specified detail message and the specified cause.
48 | *
49 | * @param message
50 | * the detail message for this exception.
51 | * @param cause
52 | * the optional cause of this exception, may be {@code null}.
53 | * @since 1.5
54 | */
55 | public UnsupportedOperationException(String message, Throwable cause) {
56 | super(message, cause);
57 | }
58 |
59 | /**
60 | * Constructs a new {@code UnsupportedOperationException} with the current
61 | * stack trace and the specified cause.
62 | *
63 | * @param cause
64 | * the optional cause of this exception, may be {@code null}.
65 | * @since 1.5
66 | */
67 | public UnsupportedOperationException(Throwable cause) {
68 | super((cause == null ? null : cause.toString()), cause);
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/lib/java/lang/VerifyError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 | /**
21 | * Thrown when the virtual machine notices that an attempt is made to load a
22 | * class which does not pass the class verification phase.
23 | */
24 | public class VerifyError extends LinkageError {
25 |
26 | private static final long serialVersionUID = 7001962396098498785L;
27 |
28 | /**
29 | * Constructs a new {@code VerifyError} that includes the current stack
30 | * trace.
31 | */
32 | public VerifyError() {
33 | super();
34 | }
35 |
36 | /**
37 | * Constructs a new {@code VerifyError} with the current stack trace and the
38 | * specified detail message.
39 | *
40 | * @param detailMessage
41 | * the detail message for this exception.
42 | */
43 | public VerifyError(String detailMessage) {
44 | super(detailMessage);
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/lib/java/lang/VirtualMachineError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.lang;
19 |
20 |
21 | /**
22 | * {@code VirtualMachineError} is the superclass of all error classes that occur
23 | * during the operation of the virtual machine.
24 | *
25 | * @see Error
26 | */
27 | public abstract class VirtualMachineError extends Error {
28 |
29 | private static final long serialVersionUID = 4161983926571568670L;
30 |
31 | /**
32 | * Constructs a new {@code VirtualMachineError} that includes the current
33 | * stack trace.
34 | */
35 | public VirtualMachineError() {
36 | super();
37 | }
38 |
39 | /**
40 | * Constructs a new {@code VirtualMachineError} with the current stack trace
41 | * and the specified detail message.
42 | *
43 | * @param detailMessage
44 | * the detail message for this exception.
45 | */
46 | public VirtualMachineError(String detailMessage) {
47 | super(detailMessage);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/lib/java/lang/Void.java:
--------------------------------------------------------------------------------
1 | /* Luje
2 | * © 2013 David Given
3 | * This file is redistributable under the terms of the
4 | * New BSD License. Please see the COPYING file in the
5 | * project root for the full text.
6 | */
7 |
8 | package java.lang;
9 |
10 | public class Void
11 | {
12 | public static Class TYPE;
13 |
14 | private static native Class getVoidClass();
15 |
16 | static
17 | {
18 | TYPE = getVoidClass();
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/lib/java/lang/annotation/AnnotationFormatError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with this
4 | * work for additional information regarding copyright ownership. The ASF
5 | * licenses this file to you under the Apache License, Version 2.0 (the
6 | * "License"); you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations under
15 | * the License.
16 | */
17 |
18 | package java.lang.annotation;
19 |
20 | /**
21 | * Indicates that an annotation in the binary representation of a class is
22 | * syntactically incorrect and the annotation parser is unable to process it.
23 | * This exception is unlikely to ever occur, given that the code has been
24 | * compiled by an ordinary Java compiler.
25 | *
26 | * @since 1.5
27 | */
28 | public class AnnotationFormatError extends Error {
29 |
30 | private static final long serialVersionUID = -4256701562333669892L;
31 |
32 | /**
33 | * Constructs an instance with the message provided.
34 | *
35 | * @param message
36 | * the details of the error.
37 | */
38 | public AnnotationFormatError(String message) {
39 | super(message);
40 | }
41 |
42 | /**
43 | * Constructs an instance with a message and a cause.
44 | *
45 | * @param message
46 | * the details of the error.
47 | * @param cause
48 | * the cause of the error or {@code null} if none.
49 | */
50 | public AnnotationFormatError(String message, Throwable cause) {
51 | super(message, cause);
52 | }
53 |
54 | /**
55 | * Constructs an instance with a cause. If the cause is not
56 | * {@code null}, then {@code cause.toString()} is used as the
57 | * error's message.
58 | *
59 | * @param cause
60 | * the cause of the error or {@code null} if none.
61 | */
62 | public AnnotationFormatError(Throwable cause) {
63 | super(cause == null ? null : cause.toString(), cause);
64 | }
65 |
66 | }
67 |
--------------------------------------------------------------------------------
/lib/java/lang/annotation/Documented.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with this
4 | * work for additional information regarding copyright ownership. The ASF
5 | * licenses this file to you under the Apache License, Version 2.0 (the
6 | * "License"); you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations under
15 | * the License.
16 | */
17 |
18 | package java.lang.annotation;
19 |
20 | /**
21 | * Defines a meta-annotation for indicating that an annotation is documented and
22 | * considered part of the public API.
23 | *
24 | * @since 1.5
25 | */
26 | @Documented
27 | @Retention(RetentionPolicy.RUNTIME)
28 | @Target(ElementType.ANNOTATION_TYPE)
29 | public @interface Documented {
30 | }
31 |
--------------------------------------------------------------------------------
/lib/java/lang/annotation/ElementType.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with this
4 | * work for additional information regarding copyright ownership. The ASF
5 | * licenses this file to you under the Apache License, Version 2.0 (the
6 | * "License"); you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations under
15 | * the License.
16 | */
17 |
18 | package java.lang.annotation;
19 |
20 | /**
21 | * Defines an enumeration for Java program elements. It is used in conjunction
22 | * with the {@link Target} meta-annotation to restrict the use of an annotation
23 | * to certain program elements.
24 | *
25 | * @since 1.5
26 | */
27 | public enum ElementType {
28 | /**
29 | * Class, interface or enum declaration.
30 | */
31 | TYPE,
32 | /**
33 | * Field declaration.
34 | */
35 | FIELD,
36 | /**
37 | * Method declaration.
38 | */
39 | METHOD,
40 | /**
41 | * Parameter declaration.
42 | */
43 | PARAMETER,
44 | /**
45 | * Constructor declaration.
46 | */
47 | CONSTRUCTOR,
48 | /**
49 | * Local variable declaration.
50 | */
51 | LOCAL_VARIABLE,
52 | /**
53 | * Annotation type declaration.
54 | */
55 | ANNOTATION_TYPE,
56 | /**
57 | * Package declaration.
58 | */
59 | PACKAGE
60 | }
61 |
--------------------------------------------------------------------------------
/lib/java/lang/annotation/IncompleteAnnotationException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with this
4 | * work for additional information regarding copyright ownership. The ASF
5 | * licenses this file to you under the Apache License, Version 2.0 (the
6 | * "License"); you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations under
15 | * the License.
16 | */
17 |
18 | package java.lang.annotation;
19 |
20 | import org.apache.harmony.annotation.internal.nls.Messages;
21 |
22 | /**
23 | * Indicates that an element of an annotation type was accessed that was added
24 | * after the type was compiled or serialized. This does not apply to new
25 | * elements that have default values.
26 | *
27 | * @since 1.5
28 | */
29 | public class IncompleteAnnotationException extends RuntimeException {
30 |
31 | private static final long serialVersionUID = 8445097402741811912L;
32 |
33 | private Class extends Annotation> annotationType;
34 |
35 | private String elementName;
36 |
37 | /**
38 | * Constructs an instance with the incomplete annotation type and the name
39 | * of the element that's missing.
40 | *
41 | * @param annotationType
42 | * the annotation type.
43 | * @param elementName
44 | * the name of the incomplete element.
45 | */
46 | public IncompleteAnnotationException(
47 | Class extends Annotation> annotationType, String elementName) {
48 | super(Messages.getString("annotation.0", elementName, annotationType.getName())); //$NON-NLS-1$
49 | this.annotationType = annotationType;
50 | this.elementName = elementName;
51 | }
52 |
53 | /**
54 | * Returns the annotation type.
55 | *
56 | * @return a Class instance.
57 | */
58 | public Class extends Annotation> annotationType() {
59 | return annotationType;
60 | }
61 |
62 | /**
63 | * Returns the incomplete element's name.
64 | *
65 | * @return the name of the element.
66 | */
67 | public String elementName() {
68 | return elementName;
69 | }
70 | }
71 |
--------------------------------------------------------------------------------
/lib/java/lang/annotation/Inherited.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with this
4 | * work for additional information regarding copyright ownership. The ASF
5 | * licenses this file to you under the Apache License, Version 2.0 (the
6 | * "License"); you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations under
15 | * the License.
16 | */
17 |
18 | package java.lang.annotation;
19 |
20 | /**
21 | * Defines a meta-annotation for indicating that an annotation is automatically
22 | * inherited.
23 | *
24 | * @since 1.5
25 | */
26 | @Documented
27 | @Retention(RetentionPolicy.RUNTIME)
28 | @Target(ElementType.ANNOTATION_TYPE)
29 | public @interface Inherited {
30 | }
31 |
--------------------------------------------------------------------------------
/lib/java/lang/annotation/Retention.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with this
4 | * work for additional information regarding copyright ownership. The ASF
5 | * licenses this file to you under the Apache License, Version 2.0 (the
6 | * "License"); you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations under
15 | * the License.
16 | */
17 |
18 | package java.lang.annotation;
19 |
20 | /**
21 | * Defines a meta-annotation for determining the scope of retention for an
22 | * annotation. If the retention annotation is not set {@code
23 | * RetentionPolicy.CLASS} is used as default retention.
24 | *
25 | * @see RetentionPolicy
26 | * @since 1.5
27 | */
28 | @Documented
29 | @Retention(RetentionPolicy.RUNTIME)
30 | @Target(ElementType.ANNOTATION_TYPE)
31 | public @interface Retention {
32 |
33 | /**
34 | * Returns the retention policy for the annotation.
35 | *
36 | * @return a retention policy as defined in {@code RetentionPolicy}
37 | */
38 | RetentionPolicy value();
39 | }
40 |
--------------------------------------------------------------------------------
/lib/java/lang/annotation/RetentionPolicy.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with this
4 | * work for additional information regarding copyright ownership. The ASF
5 | * licenses this file to you under the Apache License, Version 2.0 (the
6 | * "License"); you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations under
15 | * the License.
16 | */
17 |
18 | package java.lang.annotation;
19 |
20 | /**
21 | * Defines an enumeration for annotation retention policies. Used in conjunction
22 | * with the {@link Retention} annotation to specify an annotation's time-to-live
23 | * in the overall development life cycle.
24 | *
25 | * @since 1.5
26 | */
27 | public enum RetentionPolicy {
28 | /**
29 | * Annotation is only available in the source code.
30 | */
31 | SOURCE,
32 | /**
33 | * Annotation is available in the source code and in the class file, but not
34 | * at runtime. This is the default policy.
35 | */
36 | CLASS,
37 | /**
38 | * Annotation is available in the source code, the class file and is
39 | * available at runtime.
40 | */
41 | RUNTIME
42 | }
43 |
--------------------------------------------------------------------------------
/lib/java/lang/annotation/Target.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with this
4 | * work for additional information regarding copyright ownership. The ASF
5 | * licenses this file to you under the Apache License, Version 2.0 (the
6 | * "License"); you may not use this file except in compliance with the License.
7 | * You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 | * License for the specific language governing permissions and limitations under
15 | * the License.
16 | */
17 |
18 | package java.lang.annotation;
19 |
20 | /**
21 | * Defines a meta-annotation for determining what {@link ElementType}s an
22 | * annotation can be applied to.
23 | *
24 | * @see ElementType
25 | * @since 1.5
26 | */
27 | @Documented
28 | @Retention(RetentionPolicy.RUNTIME)
29 | @Target(ElementType.ANNOTATION_TYPE)
30 | public @interface Target {
31 |
32 | /**
33 | * Returns the program element types for which this annotation is applied.
34 | *
35 | * @return the types of element as defined by {@code ElementType}
36 | */
37 | ElementType[] value();
38 | }
39 |
--------------------------------------------------------------------------------
/lib/java/lang/reflect/Array.java:
--------------------------------------------------------------------------------
1 | package java.lang.reflect;
2 |
3 | public class Array
4 | {
5 | public static native Object newInstance(Class> componentType, int size);
6 | }
7 |
--------------------------------------------------------------------------------
/lib/java/net/MalformedURLException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.net;
19 |
20 | import java.io.IOException;
21 |
22 | /**
23 | * This exception is thrown when a program attempts to create an URL from an
24 | * incorrect specification.
25 | *
26 | * @see URL
27 | */
28 | public class MalformedURLException extends IOException {
29 |
30 | private static final long serialVersionUID = -182787522200415866L;
31 |
32 | /**
33 | * Constructs a new instance of this class with its walkback filled in.
34 | */
35 | public MalformedURLException() {
36 | super();
37 | }
38 |
39 | /**
40 | * Constructs a new instance of this class with its walkback and message
41 | * filled in.
42 | *
43 | * @param detailMessage
44 | * the detail message for this exception instance.
45 | */
46 | public MalformedURLException(String detailMessage) {
47 | super(detailMessage);
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/lib/java/nio/BufferOverflowException.java:
--------------------------------------------------------------------------------
1 | /* Licensed to the Apache Software Foundation (ASF) under one or more
2 | * contributor license agreements. See the NOTICE file distributed with
3 | * this work for additional information regarding copyright ownership.
4 | * The ASF licenses this file to You under the Apache License, Version 2.0
5 | * (the "License"); you may not use this file except in compliance with
6 | * the License. You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package java.nio;
18 |
19 | /**
20 | * A BufferOverflowException
is thrown when elements are written
21 | * to a buffer but there is not enough remaining space in the buffer.
22 | */
23 | public class BufferOverflowException extends RuntimeException {
24 |
25 | private static final long serialVersionUID = -5484897634319144535L;
26 |
27 | /**
28 | * Constructs a BufferOverflowException
.
29 | */
30 | public BufferOverflowException() {
31 | super();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/lib/java/nio/BufferUnderflowException.java:
--------------------------------------------------------------------------------
1 | /* Licensed to the Apache Software Foundation (ASF) under one or more
2 | * contributor license agreements. See the NOTICE file distributed with
3 | * this work for additional information regarding copyright ownership.
4 | * The ASF licenses this file to You under the Apache License, Version 2.0
5 | * (the "License"); you may not use this file except in compliance with
6 | * the License. You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package java.nio;
18 |
19 | /**
20 | * A BufferUnderflowException
is thrown when elements are read
21 | * from a buffer but there are not enough remaining elements in the buffer.
22 | */
23 | public class BufferUnderflowException extends RuntimeException {
24 |
25 | private static final long serialVersionUID = -1713313658691622206L;
26 |
27 | /**
28 | * Constructs a BufferUnderflowException
.
29 | */
30 | public BufferUnderflowException() {
31 | super();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/lib/java/nio/ByteOrder.java:
--------------------------------------------------------------------------------
1 | /* Licensed to the Apache Software Foundation (ASF) under one or more
2 | * contributor license agreements. See the NOTICE file distributed with
3 | * this work for additional information regarding copyright ownership.
4 | * The ASF licenses this file to You under the Apache License, Version 2.0
5 | * (the "License"); you may not use this file except in compliance with
6 | * the License. You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package java.nio;
18 |
19 | import org.apache.harmony.luni.platform.Platform;
20 |
21 | /**
22 | * Defines byte order constants.
23 | */
24 | public final class ByteOrder {
25 |
26 | /**
27 | * This constant represents big endian.
28 | */
29 | public static final ByteOrder BIG_ENDIAN = new ByteOrder("BIG_ENDIAN"); //$NON-NLS-1$
30 |
31 | /**
32 | * This constant represents little endian.
33 | */
34 | public static final ByteOrder LITTLE_ENDIAN = new ByteOrder("LITTLE_ENDIAN"); //$NON-NLS-1$
35 |
36 | private static final ByteOrder NATIVE_ORDER;
37 |
38 | static {
39 | if (Platform.getMemorySystem().isLittleEndian()) {
40 | NATIVE_ORDER = LITTLE_ENDIAN;
41 | } else {
42 | NATIVE_ORDER = BIG_ENDIAN;
43 | }
44 | }
45 |
46 | /**
47 | * Returns the current platform byte order.
48 | *
49 | * @return the byte order object, which is either LITTLE_ENDIAN or
50 | * BIG_ENDIAN.
51 | */
52 | public static ByteOrder nativeOrder() {
53 | return NATIVE_ORDER;
54 | }
55 |
56 | private final String name;
57 |
58 | private ByteOrder(String name) {
59 | super();
60 | this.name = name;
61 | }
62 |
63 | /**
64 | * Returns a string that describes this object.
65 | *
66 | * @return "BIG_ENDIAN" for {@link #BIG_ENDIAN ByteOrder.BIG_ENDIAN}
67 | * objects, "LITTLE_ENDIAN" for
68 | * {@link #LITTLE_ENDIAN ByteOrder.LITTLE_ENDIAN} objects.
69 | */
70 | @Override
71 | public String toString() {
72 | return name;
73 | }
74 | }
75 |
--------------------------------------------------------------------------------
/lib/java/nio/IntArrayBuffer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.nio;
19 |
20 | /**
21 | * IntArrayBuffer, ReadWriteIntArrayBuffer and ReadOnlyIntArrayBuffer compose
22 | * the implementation of array based int buffers.
23 | *
24 | * IntArrayBuffer implements all the shared readonly methods and is extended by
25 | * the other two classes.
26 | *
27 | *
28 | * All methods are marked final for runtime performance.
29 | *
30 | *
31 | */
32 | abstract class IntArrayBuffer extends IntBuffer {
33 |
34 | protected final int[] backingArray;
35 |
36 | protected final int offset;
37 |
38 | IntArrayBuffer(int[] array) {
39 | this(array.length, array, 0);
40 | }
41 |
42 | IntArrayBuffer(int capacity) {
43 | this(capacity, new int[capacity], 0);
44 | }
45 |
46 | IntArrayBuffer(int capacity, int[] backingArray, int offset) {
47 | super(capacity);
48 | this.backingArray = backingArray;
49 | this.offset = offset;
50 | }
51 |
52 | @Override
53 | public final int get() {
54 | if (position == limit) {
55 | throw new BufferUnderflowException();
56 | }
57 | return backingArray[offset + position++];
58 | }
59 |
60 | @Override
61 | public final int get(int index) {
62 | if (index < 0 || index >= limit) {
63 | throw new IndexOutOfBoundsException();
64 | }
65 | return backingArray[offset + index];
66 | }
67 |
68 | @Override
69 | public final IntBuffer get(int[] dest, int off, int len) {
70 | int length = dest.length;
71 | if (off < 0 || len < 0 || (long) len + (long) off > length) {
72 | throw new IndexOutOfBoundsException();
73 | }
74 | if (len > remaining()) {
75 | throw new BufferUnderflowException();
76 | }
77 | System.arraycopy(backingArray, offset + position, dest, off, len);
78 | position += len;
79 | return this;
80 | }
81 |
82 | @Override
83 | public final boolean isDirect() {
84 | return false;
85 | }
86 |
87 | @Override
88 | public final ByteOrder order() {
89 | return ByteOrder.nativeOrder();
90 | }
91 |
92 | }
93 |
--------------------------------------------------------------------------------
/lib/java/nio/InvalidMarkException.java:
--------------------------------------------------------------------------------
1 | /* Licensed to the Apache Software Foundation (ASF) under one or more
2 | * contributor license agreements. See the NOTICE file distributed with
3 | * this work for additional information regarding copyright ownership.
4 | * The ASF licenses this file to You under the Apache License, Version 2.0
5 | * (the "License"); you may not use this file except in compliance with
6 | * the License. You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package java.nio;
18 |
19 | /**
20 | * An {@code InvalidMarkException} is thrown when {@code reset()} is called on a
21 | * buffer, but no mark has been set previously.
22 | */
23 | public class InvalidMarkException extends IllegalStateException {
24 |
25 | private static final long serialVersionUID = 1698329710438510774L;
26 |
27 | /**
28 | * Constructs an {@code InvalidMarkException}.
29 | */
30 | public InvalidMarkException() {
31 | super();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/lib/java/nio/LongArrayBuffer.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.nio;
19 |
20 | /**
21 | * LongArrayBuffer, ReadWriteLongArrayBuffer and ReadOnlyLongArrayBuffer compose
22 | * the implementation of array based long buffers.
23 | *
24 | * LongArrayBuffer implements all the shared readonly methods and is extended by
25 | * the other two classes.
26 | *
27 | *
28 | * All methods are marked final for runtime performance.
29 | *
30 | *
31 | */
32 | abstract class LongArrayBuffer extends LongBuffer {
33 |
34 | protected final long[] backingArray;
35 |
36 | protected final int offset;
37 |
38 | LongArrayBuffer(long[] array) {
39 | this(array.length, array, 0);
40 | }
41 |
42 | LongArrayBuffer(int capacity) {
43 | this(capacity, new long[capacity], 0);
44 | }
45 |
46 | LongArrayBuffer(int capacity, long[] backingArray, int offset) {
47 | super(capacity);
48 | this.backingArray = backingArray;
49 | this.offset = offset;
50 | }
51 |
52 | @Override
53 | public final long get() {
54 | if (position == limit) {
55 | throw new BufferUnderflowException();
56 | }
57 | return backingArray[offset + position++];
58 | }
59 |
60 | @Override
61 | public final long get(int index) {
62 | if (index < 0 || index >= limit) {
63 | throw new IndexOutOfBoundsException();
64 | }
65 | return backingArray[offset + index];
66 | }
67 |
68 | @Override
69 | public final LongBuffer get(long[] dest, int off, int len) {
70 | int length = dest.length;
71 | if (off < 0 || len < 0 || (long) len + (long) off > length) {
72 | throw new IndexOutOfBoundsException();
73 | }
74 | if (len > remaining()) {
75 | throw new BufferUnderflowException();
76 | }
77 | System.arraycopy(backingArray, offset + position, dest, off, len);
78 | position += len;
79 | return this;
80 | }
81 |
82 | @Override
83 | public final boolean isDirect() {
84 | return false;
85 | }
86 |
87 | @Override
88 | public final ByteOrder order() {
89 | return ByteOrder.nativeOrder();
90 | }
91 |
92 | }
93 |
--------------------------------------------------------------------------------
/lib/java/nio/ReadOnlyBufferException.java:
--------------------------------------------------------------------------------
1 | /* Licensed to the Apache Software Foundation (ASF) under one or more
2 | * contributor license agreements. See the NOTICE file distributed with
3 | * this work for additional information regarding copyright ownership.
4 | * The ASF licenses this file to You under the Apache License, Version 2.0
5 | * (the "License"); you may not use this file except in compliance with
6 | * the License. You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package java.nio;
18 |
19 | /**
20 | * A {@code ReadOnlyBufferException} is thrown when some write operation is
21 | * called on a read-only buffer.
22 | */
23 | public class ReadOnlyBufferException extends UnsupportedOperationException {
24 |
25 | private static final long serialVersionUID = -1210063976496234090L;
26 |
27 | /**
28 | * Constructs a {@code ReadOnlyBufferException}.
29 | */
30 | public ReadOnlyBufferException() {
31 | super();
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/lib/java/nio/charset/CharacterCodingException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.nio.charset;
19 |
20 | import java.io.IOException;
21 |
22 | /**
23 | * A {@code CharacterCodingException} is thrown when an encoding or decoding
24 | * error occurs.
25 | */
26 | public class CharacterCodingException extends IOException {
27 |
28 | /*
29 | * This constant is used during deserialization to check the version
30 | * which created the serialized object.
31 | */
32 | private static final long serialVersionUID = 8421532232154627783L;
33 |
34 | /**
35 | * Constructs a new {@code CharacterCodingException}.
36 | */
37 | public CharacterCodingException() {
38 | super();
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/lib/java/nio/charset/CoderMalfunctionError.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.nio.charset;
19 |
20 | /**
21 | * A {@code CoderMalfunctionError} is thrown when the encoder/decoder is
22 | * malfunctioning.
23 | */
24 | public class CoderMalfunctionError extends Error {
25 |
26 | /*
27 | * This constant is used during deserialization to check the version
28 | * which created the serialized object.
29 | */
30 | private static final long serialVersionUID = -1151412348057794301L;
31 |
32 | /**
33 | * Constructs a new {@code CoderMalfunctionError}.
34 | *
35 | * @param ex
36 | * the original exception thrown by the encoder/decoder.
37 | */
38 | public CoderMalfunctionError(Exception ex) {
39 | super(ex);
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/lib/java/nio/charset/CodingErrorAction.java:
--------------------------------------------------------------------------------
1 | /* Licensed to the Apache Software Foundation (ASF) under one or more
2 | * contributor license agreements. See the NOTICE file distributed with
3 | * this work for additional information regarding copyright ownership.
4 | * The ASF licenses this file to You under the Apache License, Version 2.0
5 | * (the "License"); you may not use this file except in compliance with
6 | * the License. You may obtain a copy of the License at
7 | *
8 | * http://www.apache.org/licenses/LICENSE-2.0
9 | *
10 | * Unless required by applicable law or agreed to in writing, software
11 | * distributed under the License is distributed on an "AS IS" BASIS,
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | * See the License for the specific language governing permissions and
14 | * limitations under the License.
15 | */
16 |
17 | package java.nio.charset;
18 |
19 | /**
20 | * Used to indicate what kind of actions to take in case of encoding/decoding
21 | * errors. Currently three actions are defined: {@code IGNORE}, {@code REPLACE}
22 | * and {@code REPORT}.
23 | */
24 | public class CodingErrorAction {
25 |
26 | /**
27 | * Denotes the action to ignore any errors.
28 | */
29 | public static final CodingErrorAction IGNORE = new CodingErrorAction(
30 | "IGNORE"); //$NON-NLS-1$
31 |
32 | /**
33 | * Denotes the action to fill in the output with a replacement character
34 | * when malformed input or an unmappable character is encountered.
35 | */
36 | public static final CodingErrorAction REPLACE = new CodingErrorAction(
37 | "REPLACE"); //$NON-NLS-1$
38 |
39 | /**
40 | * Denotes the action to report the encountered error in an appropriate
41 | * manner, for example to throw an exception or return an informative
42 | * result.
43 | */
44 | public static final CodingErrorAction REPORT = new CodingErrorAction(
45 | "REPORT"); //$NON-NLS-1$
46 |
47 | // The name of this action
48 | private String action;
49 |
50 | /*
51 | * Can't instantiate outside.
52 | */
53 | private CodingErrorAction(String action) {
54 | this.action = action;
55 | }
56 |
57 | /**
58 | * Returns a text description of this action indication.
59 | *
60 | * @return a text description of this action indication.
61 | */
62 | @Override
63 | public String toString() {
64 | return "Action: " + this.action; //$NON-NLS-1$
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/lib/java/nio/charset/IllegalCharsetNameException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.nio.charset;
19 |
20 | import org.apache.harmony.niochar.internal.nls.Messages;
21 |
22 | /**
23 | * An {@code IllegalCharsetNameException} is thrown when an illegal charset name
24 | * is encountered.
25 | */
26 | public class IllegalCharsetNameException extends IllegalArgumentException {
27 |
28 | /*
29 | * This constant is used during deserialization to check the version
30 | * which created the serialized object.
31 | */
32 | private static final long serialVersionUID = 1457525358470002989L;
33 |
34 | // The illegal charset name
35 | private String charsetName;
36 |
37 | /**
38 | * Constructs a new {@code IllegalCharsetNameException} with the supplied
39 | * charset name.
40 | *
41 | * @param charset
42 | * the encountered illegal charset name.
43 | */
44 | public IllegalCharsetNameException(String charset) {
45 | // niochar.0F=The illegal charset name is "{0}".
46 | super(Messages.getString("niochar.0F", charset)); //$NON-NLS-1$
47 | this.charsetName = charset;
48 | }
49 |
50 | /**
51 | * Gets the encountered illegal charset name.
52 | *
53 | * @return the encountered illegal charset name.
54 | */
55 | public String getCharsetName() {
56 | return this.charsetName;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/lib/java/nio/charset/MalformedInputException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.nio.charset;
19 |
20 | import org.apache.harmony.niochar.internal.nls.Messages;
21 |
22 | /**
23 | * A {@code MalformedInputException} is thrown when a malformed input is
24 | * encountered, for example if a byte sequence is illegal for the given charset.
25 | */
26 | public class MalformedInputException extends CharacterCodingException {
27 |
28 | /*
29 | * This constant is used during deserialization to check the version
30 | * which created the serialized object.
31 | */
32 | private static final long serialVersionUID = -3438823399834806194L;
33 |
34 | // the length of the malformed input
35 | private int inputLength;
36 |
37 | /**
38 | * Constructs a new {@code MalformedInputException}.
39 | *
40 | * @param length
41 | * the length of the malformed input.
42 | */
43 | public MalformedInputException(int length) {
44 | this.inputLength = length;
45 | }
46 |
47 | /**
48 | * Gets the length of the malformed input.
49 | *
50 | * @return the length of the malformed input.
51 | */
52 | public int getInputLength() {
53 | return this.inputLength;
54 | }
55 |
56 | /**
57 | * Gets a message describing this exception.
58 | *
59 | * @return a message describing this exception.
60 | */
61 | @Override
62 | public String getMessage() {
63 | // niochar.05=Malformed input length is {0}.
64 | return Messages.getString("niochar.05", this.inputLength); //$NON-NLS-1$
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/lib/java/nio/charset/UnmappableCharacterException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.nio.charset;
19 |
20 | import org.apache.harmony.niochar.internal.nls.Messages;
21 |
22 | /**
23 | * An {@code UnmappableCharacterException} is thrown when an unmappable
24 | * character for the given charset is encountered.
25 | */
26 | public class UnmappableCharacterException extends CharacterCodingException {
27 |
28 | /*
29 | * This constant is used during deserialization to check the version
30 | * which created the serialized object.
31 | */
32 | private static final long serialVersionUID = -7026962371537706123L;
33 |
34 | // The length of the unmappable character
35 | private int inputLength;
36 |
37 | /**
38 | * Constructs a new {@code UnmappableCharacterException}.
39 | *
40 | * @param length
41 | * the length of the unmappable character.
42 | */
43 | public UnmappableCharacterException(int length) {
44 | this.inputLength = length;
45 | }
46 |
47 | /**
48 | * Gets the length of the unmappable character.
49 | *
50 | * @return the length of the unmappable character.
51 | */
52 | public int getInputLength() {
53 | return this.inputLength;
54 | }
55 |
56 | /**
57 | * Gets a message describing this exception.
58 | *
59 | * @return a message describing this exception.
60 | */
61 | @Override
62 | public String getMessage() {
63 | // niochar.0A=The unmappable character length is {0}.
64 | return Messages.getString("niochar.0A", this.inputLength); //$NON-NLS-1$
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/lib/java/nio/charset/UnsupportedCharsetException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.nio.charset;
19 |
20 | import org.apache.harmony.niochar.internal.nls.Messages;
21 |
22 | /**
23 | * An {@code UnsupportedCharsetException} is thrown when an unsupported charset
24 | * name is encountered.
25 | */
26 | public class UnsupportedCharsetException extends IllegalArgumentException {
27 |
28 | /*
29 | * This constant is used during deserialization to check the version
30 | * which created the serialized object.
31 | */
32 | private static final long serialVersionUID = 1490765524727386367L;
33 |
34 | // the unsupported charset name
35 | private String charsetName;
36 |
37 | /**
38 | * Constructs a new {@code UnsupportedCharsetException} with the supplied
39 | * charset name.
40 | *
41 | * @param charset
42 | * the encountered unsupported charset name.
43 | */
44 | public UnsupportedCharsetException(String charset) {
45 | // niochar.04=The unsupported charset name is "{0}".
46 | super(Messages.getString("niochar.04", charset)); //$NON-NLS-1$
47 | this.charsetName = charset;
48 | }
49 |
50 | /**
51 | * Gets the encountered unsupported charset name.
52 | *
53 | * @return the encountered unsupported charset name.
54 | */
55 | public String getCharsetName() {
56 | return this.charsetName;
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/lib/java/util/ConcurrentModificationException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.util;
19 |
20 | /**
21 | * An {@code ConcurrentModificationException} is thrown when a Collection is
22 | * modified and an existing iterator on the Collection is used to modify the
23 | * Collection as well.
24 | *
25 | * @see java.lang.RuntimeException
26 | */
27 | public class ConcurrentModificationException extends RuntimeException {
28 |
29 | private static final long serialVersionUID = -3666751008965953603L;
30 |
31 | /**
32 | * Constructs a new {@code ConcurrentModificationException} with the current
33 | * stack trace filled in.
34 | */
35 | public ConcurrentModificationException() {
36 | /*empty*/
37 | }
38 |
39 | /**
40 | * Constructs a new {@code ConcurrentModificationException} with the current
41 | * stack trace and message filled in.
42 | *
43 | * @param detailMessage
44 | * the detail message for the exception.
45 | */
46 | public ConcurrentModificationException(String detailMessage) {
47 | super(detailMessage);
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/lib/java/util/Enumeration.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.util;
19 |
20 | /**
21 | * An Enumeration is used to sequence over a collection of objects.
22 | *
23 | * Preferably an {@link Iterator} should be used. {@code Iterator} replaces the
24 | * enumeration interface and adds a way to remove elements from a collection.
25 | *
26 | * @see Hashtable
27 | * @see Properties
28 | * @see Vector
29 | * @version 1.0
30 | */
31 | public interface Enumeration {
32 |
33 | /**
34 | * Returns whether this {@code Enumeration} has more elements.
35 | *
36 | * @return {@code true} if there are more elements, {@code false} otherwise.
37 | * @see #nextElement
38 | */
39 | public boolean hasMoreElements();
40 |
41 | /**
42 | * Returns the next element in this {@code Enumeration}.
43 | *
44 | * @return the next element..
45 | * @throws NoSuchElementException
46 | * if there are no more elements.
47 | * @see #hasMoreElements
48 | */
49 | public E nextElement();
50 | }
51 |
--------------------------------------------------------------------------------
/lib/java/util/Iterator.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.util;
19 |
20 | /**
21 | * An {@code Iterator} is used to sequence over a collection of objects.
22 | * Conceptually, an iterator is always positioned between two elements of a
23 | * collection. A fresh iterator is always positioned in front of the first
24 | * element.
25 | *
26 | * If a collection has been changed since its creation, methods {@code next} and
27 | * {@code hasNext()} may throw a {@code ConcurrentModificationException}.
28 | * Iterators with this behavior are called fail-fast iterators.
29 | *
30 | * @param
31 | * the type of object returned by the iterator.
32 | */
33 | public interface Iterator {
34 | /**
35 | * Returns whether there are more elements to iterate, i.e. whether the
36 | * iterator is positioned in front of an element.
37 | *
38 | * @return {@code true} if there are more elements, {@code false} otherwise.
39 | * @see #next
40 | */
41 | public boolean hasNext();
42 |
43 | /**
44 | * Returns the next object in the iteration, i.e. returns the element in
45 | * front of the iterator and advances the iterator by one position.
46 | *
47 | * @return the next object.
48 | * @throws NoSuchElementException
49 | * if there are no more elements.
50 | * @see #hasNext
51 | */
52 | public E next();
53 |
54 | /**
55 | * Removes the last object returned by {@code next} from the collection.
56 | * This method can only be called once after {@code next} was called.
57 | *
58 | * @throws UnsupportedOperationException
59 | * if removing is not supported by the collection being
60 | * iterated.
61 | * @throws IllegalStateException
62 | * if {@code next} has not been called, or {@code remove} has
63 | * already been called after the last call to {@code next}.
64 | */
65 | public void remove();
66 | }
67 |
--------------------------------------------------------------------------------
/lib/java/util/MapEntry.java:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package java.util;
19 |
20 | /**
21 | * MapEntry is an internal class which provides an implementation of Map.Entry.
22 | */
23 | class MapEntry implements Map.Entry, Cloneable {
24 |
25 | K key;
26 | V value;
27 |
28 | interface Type