Skip to content

Commit de40cd7

Browse files
author
jossonsmith
committed
Import all the Error and Exception classes of java.io.* and java.lang.* and java.util.*
with Apache Harmony sources. Replace some of older Sun' classes with Apache Harmony's classes.
1 parent 46d75f9 commit de40cd7

32 files changed

Lines changed: 2602 additions & 0 deletions
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
17+
package java.io;
18+
19+
20+
/**
21+
* Objects that want to be serialized/deserialized using
22+
* ObjectOutputStream/ObjectInputStream should implement this interface.
23+
*
24+
*
25+
*/
26+
public interface Serializable {
27+
/* empty */
28+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
package java.io;
17+
18+
/**
19+
* This IO exception is thrown when a program asks for a particular character
20+
* converter and it is not available.
21+
*
22+
*/
23+
public class UnsupportedEncodingException extends IOException {
24+
25+
private static final long serialVersionUID = -4274276298326136670L;
26+
27+
/**
28+
* Constructs a new instance of this class with its walkback filled in.
29+
*/
30+
public UnsupportedEncodingException() {
31+
super();
32+
}
33+
34+
/**
35+
* Constructs a new instance of this class with its walkback and message
36+
* filled in.
37+
*
38+
* @param detailMessage
39+
* the detail message for the exception.
40+
*/
41+
public UnsupportedEncodingException(String detailMessage) {
42+
super(detailMessage);
43+
}
44+
45+
}
64 KB
Binary file not shown.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/* Copyright 2003, 2005 The Apache Software Foundation or its licensors, as applicable
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
package java.lang;
17+
18+
19+
/**
20+
* The CharSequence interface represents an ordered set of characters and the
21+
* functions to probe them.
22+
*/
23+
public interface CharSequence {
24+
25+
/**
26+
* Answers the number of characters in the sequence.
27+
*
28+
* @return the number of charcters in the sequence
29+
*/
30+
public int length();
31+
32+
/**
33+
* Answers the character at the specified index (0-based indexing).
34+
*
35+
* @param index -
36+
* of the character to return
37+
* @return character indicated by index
38+
* @throws IndexOutOfBoundsException
39+
* when <code>index &lt 0</code> or
40+
* <code>index</code> &gt= the length of the <code>CharSequence</code>
41+
*/
42+
public char charAt(int index);
43+
44+
/**
45+
* Answers a CharSequence from the <code>start</code> index to the
46+
* <code>end</code> index of this sequence.
47+
*
48+
* @param start -- index of the start of the sub-sequence to return
49+
* @param end -- index of the end of the sub-sequence to return
50+
* @return the sub sequence from start to end
51+
* @throws IndexOutOfBoundsException when 1. either index is below 0
52+
* 2. either index >= <code>this.length()</code>
53+
* 3. <code>start > end </code>
54+
*/
55+
public CharSequence subSequence(int start, int end);
56+
57+
/**
58+
* Answers a String with the same characters and ordering of this
59+
* CharSequence
60+
*
61+
* @return a String based on the CharSequence
62+
*/
63+
public String toString();
64+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/* Copyright 1998, 2002 The Apache Software Foundation or its licensors, as applicable
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
package java.lang;
17+
18+
19+
/**
20+
* This (empty) interface should be implemented by all classes which wish to
21+
* support cloning. The implementation of clone in class Object checks to ensure
22+
* that the object being cloned implements this interface, and throws
23+
* CloneNotSupportedException if not.
24+
*
25+
* @see Object#clone
26+
* @see CloneNotSupportedException
27+
*/
28+
public interface Cloneable {
29+
// Marker interface
30+
}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
package java.lang;
17+
18+
19+
/**
20+
* This interface should be implemented by all classes which wish to define a
21+
* <em>natural ordering</em> of their instances. The ordering rule must be
22+
* transitive and invertable (i.e. the sign of the result of x.compareTo(y) must
23+
* equal the negation of the sign of the result of y.compareTo(x) for all x and
24+
* y).
25+
* <p>
26+
* In addition, it is desireable (but not required) that when the result of
27+
* x.compareTo(y) is zero (and only then) the result of x.equals(y) should be
28+
* true.
29+
*
30+
*/
31+
//public interface Comparable<T> {
32+
public interface Comparable {
33+
34+
/**
35+
* Answers an integer indicating the relative positions of the receiver and
36+
* the argument in the natural order of elements of the receiver's class.
37+
*
38+
*
39+
* @return int which should be <0 if the receiver should sort before the
40+
* argument, 0 if the receiver should sort in the same position as
41+
* the argument, and >0 if the receiver should sort after the
42+
* argument.
43+
* @param another
44+
* Object an object to compare the receiver to
45+
* @throws ClassCastException
46+
* if the argument can not be converted into something
47+
* comparable with the receiver.
48+
*/
49+
int compareTo(Object another);
50+
// int compareTo(T another);
51+
}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
package java.lang;
17+
18+
19+
/**
20+
* This class is the superclass of all classes which represent unrecoverable
21+
* errors. When Errors are thrown, they should not be caught by application
22+
* code.
23+
*
24+
* @see Throwable
25+
* @see Exception
26+
* @see RuntimeException
27+
*/
28+
public class Error extends Throwable {
29+
30+
private static final long serialVersionUID = 4980196508277280342L;
31+
32+
/**
33+
* Constructs a new instance of this class with its walkback filled in.
34+
*/
35+
public Error() {
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+
* String The detail message for the exception.
45+
*/
46+
public Error(String detailMessage) {
47+
super(detailMessage);
48+
}
49+
50+
/**
51+
* Constructs a new instance of this class with its walkback, message and
52+
* cause filled in.
53+
*
54+
* @param detailMessage
55+
* String The detail message for the exception.
56+
* @param throwable
57+
* The cause of this Throwable
58+
*/
59+
public Error(String detailMessage, Throwable throwable) {
60+
super(detailMessage, throwable);
61+
}
62+
63+
/**
64+
* Constructs a new instance of this class with its walkback and cause
65+
* filled in.
66+
*
67+
* @param throwable
68+
* The cause of this Throwable
69+
*/
70+
public Error(Throwable throwable) {
71+
super(throwable);
72+
}
73+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/* Copyright 1998, 2004 The Apache Software Foundation or its licensors, as applicable
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
package java.lang;
17+
18+
19+
/**
20+
* This class is the superclass of all classes which represent recoverable
21+
* exceptions. When Exceptions are thrown, they may be caught by application
22+
* code.
23+
*
24+
* @see Throwable
25+
* @see Error
26+
* @see RuntimeException
27+
*/
28+
public class Exception extends Throwable {
29+
private static final long serialVersionUID = -3387516993124229948L;
30+
31+
/**
32+
* Constructs a new instance of this class with its walkback filled in.
33+
*/
34+
public Exception() {
35+
super();
36+
}
37+
38+
/**
39+
* Constructs a new instance of this class with its walkback and message
40+
* filled in.
41+
*
42+
* @param detailMessage
43+
* String The detail message for the exception.
44+
*/
45+
public Exception(String detailMessage) {
46+
super(detailMessage);
47+
}
48+
49+
/**
50+
* Constructs a new instance of this class with its walkback, message and
51+
* cause filled in.
52+
*
53+
* @param detailMessage
54+
* String The detail message for the exception.
55+
* @param throwable
56+
* The cause of this Throwable
57+
*/
58+
public Exception(String detailMessage, Throwable throwable) {
59+
super(detailMessage, throwable);
60+
}
61+
62+
/**
63+
* Constructs a new instance of this class with its walkback and cause
64+
* filled in.
65+
*
66+
* @param throwable
67+
* The cause of this Throwable
68+
*/
69+
public Exception(Throwable throwable) {
70+
super(throwable);
71+
}
72+
}

0 commit comments

Comments
 (0)