The lack of an official JSON API has been a huge sore point for quite some time and has spawned dozens of libraries re-implementing the same thing over and over (GSON, Jackson, and even my own nanojson). I do hope that we avoid the DocumentBuilderFactory mistakes of XML and just end up with One True JSON implementation this time.
Are you sure that's true? As you say, look at the "standard" API for XML parsing: a complete disaster. Dates, similar. Logging was slightly less disastrous because they took so much from Log4j, but they still made it unwieldy enough that the log4j guys ended up writing an API on top of that which everyone uses. Now, props where props are due: Sun crushed the collections APIs compared to other languages at the time. A…
Java 9 features announced
61–70 of 228 posts
Re: Java 9 features announced
#62The http client was so basic in the JDK it has spawned TWO apache HttpClients projects.
Jigsaw... fool me three times? Wasn't this supposed to be in JDK7?
Re: Java 9 features announced
#63Nothing pollutes java source more than getters and setters. I can't believe this still isn't being address. Wish they'd move in the direction Groovy has in this regard.
Re: Java 9 features announced
#64Still no solution for the GC fragmentation and pauses? Arbitrarily large heaps and data structures? They are going to improve lock performance, but do nothing to help people avoid locking like lightweight threads. Not waking up a thread and not locking is faster... It's weird how so many software projects completely lose sight of the fundamentals. I know I am biased due to how I use Java. I care very little for synta…
What particularly is your issue around GC fragmentation? I ask because I had issues previously, but it was "solved" by moving to the G1 GC, I didn't know if you have considered the same.
It's bad enough that people who care aren't using G1 yet. They still use CMS and small heaps and are careful to prevent promotion and fragmentation.
You basically end up benefiting from GC for short lived allocations, but pay dearly for using Java when managing state the collector can't handle.
I have not closely reviewed this benchmark but this was one person's experience http://blog.mgm-tp.com/2013/12/benchmarking-g1-and-other-jav...
Re: Java 9 features announced
#65Earlier quoted context omitted.
Amen. How about some language keywords like "readable" and "writeable"? public class Foo { public readable int canSeeeMeButCantChange; public writeable int cantReadMe; public int existingBehavior; } These are pretty simple changes to the compiler and verifier. You would make canSeeeMeButCantChange an invalid "left hand" variable in the compiler, and the verifier would have to check for any writes to the fields. cantR…
The other "Missing feature" is null safe ".". Other languages have it, but I don't know what the technical name is... basically: Integer val = some.other.chain.of.objects.value; In Java, this code has a huge potential for NullPointerExceptions. Instead a new operator (yes, I know) like: Integer val = some.?other.?chain.?of.?objects.?value; If any of the intermediate objects are null, the whole assignment becomes null…
Re: Java 9 features announced
#66Is it possible to have native JSON parsing with JNI bindings to make parsing faster, or will the overhead cancel out any boost in performance?
Re: Java 9 features announced
#67Nothing pollutes java source more than getters and setters. I can't believe this still isn't being address. Wish they'd move in the direction Groovy has in this regard.
Sorry to ask, but as a noob who just picked up Java, how do other languages address this issue? What's wrong with getters and setters?
class Blah(object):
foo = 2 # A normal property. Direct access
@property
def bar(self):
return self.some_lookup_method()
@bar.setter
def bar(self, value):
self.set_the_bar(value)Re: Java 9 features announced
#68Earlier quoted context omitted.
Sorry to ask, but as a noob who just picked up Java, how do other languages address this issue? What's wrong with getters and setters?
C# introduces the concepts of fields and properties. I dont remember which is which but I think properties are in fact getters and setters,without the verbose "object.getProperty()" syntax , you just write "object.property" and it's call a getter function or a setter function. Basically you keep states encapsulated without have to manually write methods,you just write methods when you need then. Java verbosity on tha…
This goes back to at least Eiffel (1985).
Re: Java 9 features announced
#69Earlier quoted context omitted.
Replacing code while it's running. Currently this is possible but quite limited in the official JDK, you can only replace the contents of method bodies. Edit: Demo of it in action here, notch is rapidly developing a game in Eclipse by changing the code while it's running: https://www.youtube.com/watch?v=rhN35bGvM8c
There's always JRebel!
Re: Java 9 features announced
#70Still no hash literal :-(