Bukkit Discussion: String and StringBuffers

Discussion in 'Bukkit Discussion' started by The_Tree_Maker, May 12, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    The_Tree_Maker

    Would it be more efficient over all of the "Bukkit" project, to change all String Objects, String Instantiations, and String Parameters to StringBuffer Objects?

    or

    Is it a waste of development time for other things, instead of being able to concatenate strings easier and more efficiently.

    Also, why is '\n' not allowed in Minecraft chat as a newline?
     
  2. Offline

    Afforess

    IIRC, Java concatenates by using a string buffer, and converting it to a string during run time. Might just be for Java 7 though, I can't recall.
     
  3. Offline

    The_Tree_Maker

    Perhaps my discussion is a pointless one. Considering Bukkit doesn't do too much with Strings / Character Arrays, it doesn't really matter. Perhaps, I should find something else to research for making something more efficient. I really like efficiency and looking for better ways of getting something accomplished.

    Also, StringBuilder is another possible more efficient way then using a StringBuffer or a String Class Instance. The only real difference between them though is Synchronization and Thread Safety.

    Apparently, from what I've been reading the StringBuilder Class is almost a exact copy of the StringBuffer class except all the Synchronized keywords have been taken out.

    Thanks for your opinion :)
     
  4. Offline

    Afforess

    If you want to point out efficiency issues, feel free to peruse MM. I always appreciate another pair of eyes. ;) I'm sure I could use it much more.
     
Thread Status:
Not open for further replies.

Share This Page