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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.lang/] [PR12350.java] - Blame information for rev 775

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

Line No. Rev Author Line
1 765 jeremybenn
public class PR12350
2
{
3
    static public void main (String[] ignored) throws Throwable
4
    {
5
        StringBuffer b = new StringBuffer ("Good string.  More than 16 chars.");
6
 
7
        // Should cause sharing.
8
        String s = b.toString();
9
 
10
        // Take a char by char unshared copy of s.
11
        String t = new String (s.toCharArray());
12
 
13
        b.substring (0, 4);      // BUG: Clears shared flag.
14
        b.replace (0, 4, "Bad "); // Modifies shared data.
15
 
16
        System.out.println (s);
17
        assert s.equals (t);
18
    }
19
 
20
}

powered by: WebSVN 2.1.0

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