Comments (6)
[author="jbachorik", created="Mon, 17 May 2010 13:29:18 +0200"]
The intended functionality sounds reasonable.
Anyway, I have few comments for the patch:
1. Consider renaming newStringBuffer() method to newStringBuilder(boolean threadSafe) - giving the API caller the option to create either StringBuilder(thread-unsafe) or StringBuffer (thread-safe)
2. Consider dropping the specialized versions of the "append" method, keeping only the "append(StringBuffer buffer, String strToAppend)" version. The specialized versions can be replaced by calling "append(buffer, str(nonString))" - otherwise you would need to wrap pretty large portion of the "append" methods from the backing StringBuilder/Buffer
from btrace.
[author="joachimhskeie", created="Tue, 18 May 2010 20:32:46 +0200"]
The problem here then, is that both StringBuffer and StringBuilder extends java.lang.Object, and the BTrace Script needs to declare the type of the Builder/Buffer (to avoid having to work with Object).
I guess its possible to do one of two things:
#. Add both a newStringBuffer() and newStringBuilder() methods, and both append(StringBuffer, String) append(StringBuilder, String).
#. Create a BtraceStringBuffer that will either keep one StringBuilder or one StringBuffer.
I'd chose the first option, though, that makes the code slightly cleaner and lighter.
from btrace.
[author="joachimhskeie", created="Thu, 17 Jun 2010 12:40:48 +0200"]
Jaroslav: Are you able to comment on the two proposed solutions ?
from btrace.
[author="jbachorik", created="Thu, 24 Jun 2010 08:03:02 +0200"]
newStringBuilder()/newStringBuffer() approach seems to be the correct one
from btrace.
[author="joachimhskeie", created="Tue, 29 Jun 2010 08:04:22 +0200"]
Would it then be OK to move this issue to the 1.2 release and commit the patch for the StringBuffer while at the same time opeing a new issue to implement the newStringBuilder() methods ?
from btrace.
[author="jbachorik", created="Fri, 9 Jul 2010 16:21:38 +0200"]
I've adapted your proposed patch to use java.lang.Appendable instead of StringBuffer/StringBuilder, thus having only one set of methods for working with appendable buffers.
Fixed http://kenai.com/projects/btrace/sources/hg/revision/325
from btrace.
Related Issues (20)
- Disable BTrace debug logging HOT 4
- Stack map does not match the one at exception handler HOT 7
- Exception in thread "main" java.lang.NullPointerException HOT 2
- Throw NoSuchFieldException when call getInt() method HOT 5
- btrace INFO: Attaching BTrace to PID: 3866 Broken pipe HOT 1
- Does the BTrace agent support java 17? HOT 1
- Unsupported class file major version 29281 HOT 5
- Is adding method printStrings with a ... array possible? HOT 4
- Javaagent args for output directory seems wrong HOT 3
- Btrace doesn't trace methods when trusted is true HOT 1
- Adding XStream to the dependencies error HOT 2
- JAR artifacts are shadowed with the version number
- [BTRACE WARN] Class verification failed:
- Windows batch scripts do not work properly HOT 2
- Build fails with missing artifact HOT 4
- NoClassDefFoundError for NonBlockingIdentityHashMap when running an application with BTrace HOT 4
- Review target compileJava15Java in btrace-runtime/build.gradle
- NoClassDefFoundError for ConcurrentAutoTable and others when running an application with BTrace HOT 1
- VerifyError: Bad type on operand stack HOT 2
- MT-safety of HistoOnEvent example HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from btrace.