OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.lang/] [PR12350.java] - Rev 772

Go to most recent revision | Compare with Previous | Blame | View Log

public class PR12350
{
    static public void main (String[] ignored) throws Throwable
    {
	StringBuffer b = new StringBuffer ("Good string.  More than 16 chars.");
 
	// Should cause sharing.
	String s = b.toString();
 
	// Take a char by char unshared copy of s.
	String t = new String (s.toCharArray());
 
	b.substring (0, 4);	// BUG: Clears shared flag.
	b.replace (0, 4, "Bad "); // Modifies shared data.
 
	System.out.println (s);
	assert s.equals (t);
    }
 
}
 

Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.