[JavaLangStringBuilder isEmpty]: unrecognized selector sent to instance
- Dominant language
- Java
- Stars
- 6k
- Forks
- 999
- Avg merge
- 19h 20m
- Merged PRs (30d)
- 14
Description
Running transpiled code like this
```java
StringBuilder sb = new StringBuilder();
if (sb.isEmpty()) {
sb.append("");
}
```
I get
```
[JavaLangStringBuilder isEmpty]: unrecognized selector sent to instance
```
using self-compiled j2objc version 7e76bfd.
The default implementation is present at that commit: https://github.com/google/j2objc/blame/7e76bfd/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/CharSequence.java#L89
so I'm not sure where the problem is.
Contributor guide
Research direction
Reproduce the Java StringBuilder example and inspect the generated Objective-C behavior behind the isEmpty call. Compare that behavior with the default implementation at jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/CharSequence.java:89. Done means the sample no longer raises an unrecognized-selector error when calling StringBuilder.isEmpty().
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100