Check-in [25bf7f0071]

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

Overview
Comment:Add quick flag for an intern check so that `this` is quickly returned if the string is already an intern.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:25bf7f00714c3a57be2324b6adc1dfa25af53798
User & Date: stephanie.gawroriski 2019-05-24 13:37:11
Context
2019-05-24
13:38
In String.replace() if the input string does not contain the character to be replaced then it returns `this`. check-in: 74c9fa8b65 user: stephanie.gawroriski tags: trunk
13:37
Add quick flag for an intern check so that `this` is quickly returned if the string is already an intern. check-in: 25bf7f0071 user: stephanie.gawroriski tags: trunk
13:34
Deprecate the basic sequence in the string. check-in: 41b9ac2142 user: stephanie.gawroriski tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to runt/apis/cldc-compact/java/lang/String.java.

60
61
62
63
64
65
66




67
68
69
70
71
72
73
...
804
805
806
807
808
809
810





811
812
813
814
815
816
817
	/** Is this string already lowercased? */
	private static final short _QUICK_ISLOWER =
		0b0000_0000__0000_0001;
	
	/** Is this string already uppercased? */
	private static final short _QUICK_ISUPPER =
		0b0000_0000__0000_0010;




	
	/** The basic character sequence data. */
	@Deprecated
	private final BasicSequence _sequence;
	
	/** Quick determination flags for speedy operations. */
	private volatile short _quickflags;
................................................................................
	 * to use this method for such things.
	 *
	 * @return The unique string instance.
	 * @since 2016/04/01
	 */
	public String intern()
	{





		throw new todo.TODO();
	}
	
	/**
	 * Returns {@code true} if this string is empty.
	 *
	 * @return {@code true} if this string is empty.







>
>
>
>







 







>
>
>
>
>







60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
...
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
	/** Is this string already lowercased? */
	private static final short _QUICK_ISLOWER =
		0b0000_0000__0000_0001;
	
	/** Is this string already uppercased? */
	private static final short _QUICK_ISUPPER =
		0b0000_0000__0000_0010;
	
	/** String is already interned? */
	private static final short _QUICK_INTERN =
		0b0000_0000__0000_0100;
	
	/** The basic character sequence data. */
	@Deprecated
	private final BasicSequence _sequence;
	
	/** Quick determination flags for speedy operations. */
	private volatile short _quickflags;
................................................................................
	 * to use this method for such things.
	 *
	 * @return The unique string instance.
	 * @since 2016/04/01
	 */
	public String intern()
	{
		// If this string is already interned then use this one instead
		// of searching through the map
		if ((this._quickflags & _QUICK_INTERN) != 0)
			return this;
		
		throw new todo.TODO();
	}
	
	/**
	 * Returns {@code true} if this string is empty.
	 *
	 * @return {@code true} if this string is empty.