I have a StringBuilder argument passed to another module's class method and do some modification, include deleteCharAt, clear, append..., etc.
I got following warning message in Android Studio though the code seems run very well.
Cannot access java.lang.AbstractStringBuilder",
A simple simulation as bellow:
1 - Create an new project with an empty Activity.
2 - Add a Java library module.
3 - library code as bellow:
public class MyClass {
public void add1(StringBuilder sb){
sb.append("a");
}
public void add2(StringBuffer sb){
sb.append("b");
}
}
4 - activity code as bellow:
MyClass mc=new MyClass();
StringBuilder sb1=new StringBuilder();
mc.add1(sb1); // warning: cannot access java.lang.AbstractStringBuilder android
Log.d("SB1",sb1.toString());
StringBuffer sb2=new StringBuffer();
mc.add2(sb2); // warning: cannot access java.lang.AbstractStringBuilder android
Log.d("SB2",sb2.toString());
Android is not a client/server type program, I think it should not be an issue of JRE version problem?
I have run "Inspect Code" but didn't find any further information. Any ideas?