pcpratts/rootbeer1 — pull request #146 by millecker (2014-02-19 12:07:21+00:00)
Title: Fix StringBuilder.append(Object) by String.valueOf(Object)

Hello Phil,

I tried to fix the following methods:
- ```StringBuilder.append(java.lang.Object)```
- ```System.out.print(java.lang.Object)```
- ```System.out.println(java.lang.Object)```

Therefore I implemented ```String.valueOf(java.lang.Object)```.

This pull request depends on *ForcedFields* and includes them.

The only problem I have is ```Object.toString()```.
It needs some dependencies which are not loaded when using ```System.out.print(java.lang.Object)```.

```
generated.cu: error: identifier "instance_getter_java_lang_Class_name" is undefined
generated.cu: error: identifier "instance_setter_java_lang_AbstractStringBuilder_value" is undefined
generated.cu: error: identifier "instance_setter_java_lang_AbstractStringBuilder_count" is undefined
```

And I think some right hand side heap kernel issue is still there, please see *ObjectToStringTest*.

```java
public void gpuMethod() {
...
m_toString5 = String.valueOf(returnObject5());
}
private Object returnObject5() {
return new String("str");
}

[TEST 1/1] org.trifort.rootbeer.testcases.rootbeertest.serialization.ObjectToStringTest@1d3e03c
0: db 00 00 00 00 00 00 00 a5 00 00 00 c0 00 00 00
16: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
32: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
48: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
64: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
96: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
112: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
128: ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00
144: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
176: 01 00 00 00 a1 0d 00 00 30 00 00 00 00 00 00 00
192: ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00
208: 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
224: 01 00 00 00 4c 0b 00 00 40 00 00 00 00 00 00 00
240: ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00
0: db 00 00 00 00 00 00 00 d0 1b 00 00 00 00 00 00
16: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
32: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
48: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
64: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
96: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
112: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
128: ff ff ff ff ff ff ff ff ff ff ff ff 00 00 00 00
144: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
176: 01 00 00 00 a1 0d 00 00 30 00 00 00 00 00 00 00
192: ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00
208: 0e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
224: 01 00 00 00 4c 0b 00 00 40 00 00 00 00 00 00 00
240: ff ff ff ff 00 00 00 00 00 00 00 00 00 00 00 00
m_toString5
lhs: str
rhs:
FAILED
Compare failed at: 0
```

Thanks!

Martin