Check-in [62e0ed21e9]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add check to determine if a class name is an array or primitive type.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 62e0ed21e9d54534a55a2ab8f35b08783baaefe7
User & Date: stephanie.gawroriski 2019-11-09 13:03:18
Context
2019-11-09
13:09
Do not fail class load if the class is considered special. check-in: c912608401 user: stephanie.gawroriski tags: trunk
13:03
Add check to determine if a class name is an array or primitive type. check-in: 62e0ed21e9 user: stephanie.gawroriski tags: trunk
2019-11-05
08:02
Backup developer notes. check-in: 4705fdb23e user: squirreljme tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to runt/klib/supervisor/cc/squirreljme/jvm/lib/ClassNameUtils.java.

20
21
22
23
24
25
26
27


28




























































	 * Not used.
	 *
	 * @since 2019/11/04
	 */
	private ClassNameUtils()
	{
	}
}






































































|
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
	 * Not used.
	 *
	 * @since 2019/11/04
	 */
	private ClassNameUtils()
	{
	}
	
	/**
	 * Checks whether the given class name is an array.
	 *
	 * @param __cl The class name to check.
	 * @return If it is an array.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/11/09
	 */
	public static final boolean isArray(String __cl)
		throws NullPointerException
	{
		if (__cl == null)
			throw new NullPointerException("NARG");
		
		return (__cl.length() >= 1 && __cl.charAt(0) == '[');
	}
	
	/**
	 * Checks whether the given class name is a primitive type.
	 *
	 * @param __cl The class name to check.
	 * @return If it is a primitive type.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/11/09
	 */
	public static final boolean isPrimitiveType(String __cl)
		throws NullPointerException
	{
		if (__cl == null)
			throw new NullPointerException("NARG");
		
		switch (__cl)
		{
			case "boolean":
			case "byte":
			case "short":
			case "char":
			case "int":
			case "long":
			case "float":
			case "double":
				return true;
		}
		
		return false;
	}
	
	/**
	 * Is this an array or primitive type?
	 *
	 * @param __cl The class name to check.
	 * @return If it is an array or primitive type.
	 * @throws NullPointerException On null arguments.
	 * @since 2019/11/09
	 */
	public static final boolean isSpecial(String __cl)
		throws NullPointerException
	{
		return ClassNameUtils.isArray(__cl) ||
			ClassNameUtils.isPrimitiveType(__cl);
	}
}

Changes to runt/klib/supervisor/cc/squirreljme/jvm/task/Task.java.

12
13
14
15
16
17
18

19
20
21
22
23
24
25
import cc.squirreljme.jvm.Allocator;
import cc.squirreljme.jvm.Assembly;
import cc.squirreljme.jvm.Constants;
import cc.squirreljme.jvm.io.BinaryBlob;
import cc.squirreljme.jvm.Globals;
import cc.squirreljme.jvm.lib.ClassFileParser;
import cc.squirreljme.jvm.lib.ClassLibrary;

import cc.squirreljme.jvm.lib.ClassPath;
import java.util.HashMap;

/**
 * This represents a single task which has information on what it is running
 * along with its ID and such.
 *







>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import cc.squirreljme.jvm.Allocator;
import cc.squirreljme.jvm.Assembly;
import cc.squirreljme.jvm.Constants;
import cc.squirreljme.jvm.io.BinaryBlob;
import cc.squirreljme.jvm.Globals;
import cc.squirreljme.jvm.lib.ClassFileParser;
import cc.squirreljme.jvm.lib.ClassLibrary;
import cc.squirreljme.jvm.lib.ClassNameUtils;
import cc.squirreljme.jvm.lib.ClassPath;
import java.util.HashMap;

/**
 * This represents a single task which has information on what it is running
 * along with its ID and such.
 *