X Tutup
Skip to content

Commit de5af3a

Browse files
author
jossonsmith
committed
Fixed bug that once java.lang.reflect.Array was declared in java.util.AbstractCollection
1 parent d9864b4 commit de5af3a

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

sources/net.sf.j2s.java.core/src/java/lang/reflect/Array.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
* conversion would occur.
1717
*
1818
* @author Nakul Saraiya
19+
*
20+
* @j2sPrefix
21+
* Array.getComponentType = function () {
22+
* return Object;
23+
* };
1924
*/
2025
public final
2126
class Array {
@@ -46,6 +51,13 @@ private Array() {}
4651
* @exception IllegalArgumentException if componentType is Void.TYPE
4752
* @exception NegativeArraySizeException if the specified <code>length</code>
4853
* is negative
54+
*
55+
* @j2sNativeSrc
56+
* return Clazz.newArray (length);
57+
* // return new Array (length);
58+
* @j2sNative
59+
* return Clazz.newArray (b);
60+
* // return new Array (b);
4961
*/
5062
public static Object newInstance(Class componentType, int length)
5163
throws NegativeArraySizeException {
@@ -84,6 +96,8 @@ public static Object newInstance(Class componentType, int length)
8496
* is Void.TYPE.
8597
* @exception NegativeArraySizeException if any of the components in
8698
* the specified <code>dimensions</code> argument is negative.
99+
*
100+
* @j2sIgnore
87101
*/
88102
public static Object newInstance(Class componentType, int[] dimensions)
89103
throws IllegalArgumentException, NegativeArraySizeException {

sources/net.sf.j2s.java.core/src/java/package.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
(function () {
22
ClazzLoader.registerPackages ("java", [
33
"io", "lang", "lang.reflect", "util"]);
4+
5+
window["reflect"] = java.lang.reflect;
46

57
var base = ClazzLoader.getClasspathFor ("java.*");
68

sources/net.sf.j2s.java.core/src/java/util/AbstractCollection.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,6 @@
3838
* @version 1.24, 01/18/03
3939
* @see Collection
4040
* @since 1.2
41-
*
42-
* @j2sPrefix
43-
java.lang.reflect.Array = {
44-
newInstance : function (type, size) {
45-
return new Array (size);
46-
}
47-
};
48-
Array.getComponentType = function () {
49-
return Object;
50-
};
51-
52-
@j2sIgnoreImport java.lang.reflect.Array
5341
*/
5442

5543
public abstract class AbstractCollection implements Collection {

0 commit comments

Comments
 (0)
X Tutup