[The Java Posse] Re: A quick and dirty way to throw unchecked exceptions

2009-08-26 Thread Reinier Zwitserloot
WTF? I already posted a much better version of this in the supermegauber thread. no need for class file hacking. sun.misc.Unsafe is an even worse idea (Security Manager issues, as well as a dependency on running in sun VMs). public class SneakyThrow { public static RuntimeException

Optimizations? was Re: [The Java Posse] A quick and dirty way to throw unchecked exceptions

2009-08-26 Thread Fabrizio Giudici
Christian Catchpole wrote: Compile this.. (any package you like, or no package at all) public class Rethrow { public static void unchecked(Throwable t) { t=t; } } javap reports the byte code as.. public static void unchecked(java.lang.Throwable); Code: Stack=1,

Re: Optimizations? was Re: [The Java Posse] A quick and dirty way to throw unchecked exceptions

2009-08-26 Thread Christian Catchpole
yeah, don't take too much notice of that. i noticed that if you disassemble a throw, it doesn't have a return. but the a=a does. maybe its requirement of bytecode that a method that does return, finishes with return byte code. but its like Java strings being a char array with a size. there's

Re: Optimizations? was Re: [The Java Posse] A quick and dirty way to throw unchecked exceptions

2009-08-26 Thread Christian Catchpole
Oops. i totally misread your comment.. yeah, i was surprised as well. :) On Aug 26, 7:53 pm, Fabrizio Giudici fabrizio.giud...@tidalwave.it wrote: Christian Catchpole wrote: Compile this..  (any package you like, or no package at all) public class Rethrow {     public static void

Re: Optimizations? was Re: [The Java Posse] A quick and dirty way to throw unchecked exceptions

2009-08-26 Thread Christian Catchpole
of course it's need a return if it's NOT being JITted... im talking a load of crap tonight.. aload_0 f crap.. get it! :) On Aug 26, 8:09 pm, Christian Catchpole christ...@catchpole.net wrote: yeah, don't take too much notice of that.  i noticed that if you disassemble a throw, it doesn't have

[The Java Posse] open source licences scheme

2009-08-26 Thread Jan Goyvaerts
Putting a project on Kenai requires the choice of an open source license scheme. In Netbeans you'll get a combobox with the names. And if I'm not mistaken it can show you the licence terms at http://opensource.org/. I guess, if I were a jurist of some sorts these terms would be without question.

[The Java Posse] Re: open source licences scheme

2009-08-26 Thread Mike Jones
Hi Jan OSS Watch provides guidance albeit it is geared to helping the UK academic community: http://www.oss-watch.ac.uk/ http://www.oss-watch.ac.uk/resources/ipr.xml Hope that helps. Cheers Mike 2009/8/26 Jan Goyvaerts java.arti...@gmail.com: Putting a project on Kenai requires the choice

Re: Optimizations? was Re: [The Java Posse] A quick and dirty way to throw unchecked exceptions

2009-08-26 Thread Marcelo Fukushima
i guess nowadays javac translates almost literally the source code into bytecode, leaving the hard work for JIT On Wed, Aug 26, 2009 at 7:29 AM, Christian Catchpolechrist...@catchpole.net wrote: of course it's need a return if it's NOT being JITted... im talking a load of crap tonight..

[The Java Posse] Re: Has anybody else tried Lombok?

2009-08-26 Thread Steve
Thanks, Reinier, I submitted an issue. As far as field prefixes, it's in our style guide and I've been doing it forever, but I'm starting to question it. As Roel mentioned, IDEs help you distinguish them. Our Groovy classes certainly don't have prefixes. It's cleaner... Hmm... So how many

Re: Optimizations? was Re: [The Java Posse] A quick and dirty way to throw unchecked exceptions

2009-08-26 Thread Marcelo Fukushima
im guessing its because of the receiving side of the append function? have not tried, but id hope that two + three + one() would become two three + one() ? On Wed, Aug 26, 2009 at 2:54 PM, Alexey Zingerinline_f...@yahoo.com wrote: There are quite a few optimizations with strings, for

[The Java Posse] Re: A quick and dirty way to throw unchecked exceptions

2009-08-26 Thread Reinier Zwitserloot
The pain of being an idiot, not reading the javadoc on sneakyThrows, and presuming that the return value has any meaning whatsoever is not something I'm going to get concerned about. Everyone is an idiot sometime, but there's a line, and that's far removed from it. Contrast this to the sheer

[The Java Posse] Re: A quick and dirty way to throw unchecked exceptions

2009-08-26 Thread Casper Bang
Reinier I wanted to do a less invasive version of disableCheckedExceptions, however I can not get your initial disableCheckedExceptions to run: error: Exception thrown while constructing Processor object: java.lang.UnsatisfiedLinkError: Error looking up function 'Agent_OnAttach': javac:

[The Java Posse] Re: A quick and dirty way to throw unchecked exceptions

2009-08-26 Thread Reinier Zwitserloot
lombok's @SneakyThrows is a magical way of throwing checked exceptions. the lombok proof of concept spinoff 'disableCheckedExceptions' goes a lot further - though that might be a bit beyond what you were looking for. more info: http://projectlombok.org/features/SneakyThrows.html

[The Java Posse] Re: open source licences scheme

2009-08-26 Thread Jan Goyvaerts
Thanks ! That's indeed the kind of accessible explanations I am looking for. What would be the logical choice for a care-free open source project ? Everybody can use it, modify it, bla bla bla and the usage is your sole responsability. On Aug 26, 1:55 pm, Mike Jones mike.a.jo...@gmail.com

[The Java Posse] Re: open source licences scheme

2009-08-26 Thread Joshua Marinacci
BSD all the way On Aug 26, 2009, at 2:27 PM, Jan Goyvaerts wrote: Thanks ! That's indeed the kind of accessible explanations I am looking for. What would be the logical choice for a care-free open source project ? Everybody can use it, modify it, bla bla bla and the usage is your sole

[The Java Posse] Re: A quick and dirty way to throw unchecked exceptions

2009-08-26 Thread Christian Catchpole
Yes, the desire for the throw dawned on me. Not that you included such javadoc in this thread. On Aug 27, 2:59 am, Reinier Zwitserloot reini...@gmail.com wrote: The pain of being an idiot, not reading the javadoc on sneakyThrows, and presuming that the return value has any meaning whatsoever

Re: Optimizations? was Re: [The Java Posse] A quick and dirty way to throw unchecked exceptions

2009-08-26 Thread Christian Catchpole
My class did have debug symbols. I guess no point having symbols that don't point to anything. On Aug 27, 3:32 am, Marcelo Fukushima takesh...@gmail.com wrote: i guess nowadays javac translates almost literally the source code into bytecode, leaving the hard work for JIT On Wed, Aug 26,

[The Java Posse] Lombok and Mixins

2009-08-26 Thread Mark Derricutt
After Project Lombok was first mentioned here I was thinking how this could work with mixins, and again after listening about the mixins for java (hereon known as M4J) project mentioned on the last show, and watching the video at http://www.berniecode.com/writing/java-mixins/ I was thinking about

[The Java Posse] Re: Lombok and Mixins

2009-08-26 Thread Reinier Zwitserloot
Simple. public class Something extends Whatever implements List { private @Delegate List listDelegate = new ArrayList(); } lombok would add all methods that exist in List.java (as that is the type of 'listDelegate' - arraylist is merely what's assigned to it, it's about the type of the

[The Java Posse] Re: open source licences scheme

2009-08-26 Thread Christian Catchpole
Yes, I once used Apache 2.0 but now I'm thinking New BSD is the way to go. And one of the main reasons I read was that, especially to non- java people, many see BSD and immediately understand what that's going to be. It's also easier when more and more licenses are becoming BSD. And it

[The Java Posse] Re: Lombok and Mixins

2009-08-26 Thread Mark Derricutt
Without being abstract, and without IDE support this would throw errors as the class/source doesn't implement the List interface, but lombok could (if possible) drop the abstract bytecode marker, and use an implementation mentioned in the annotation. public abstract class Something extends

[The Java Posse] Re: Lombok and Mixins

2009-08-26 Thread Reinier Zwitserloot
Nope; lombok injects those methods well before the latter stages of the error finding process runs - which is where problematic typing relations, such as missing methods that you ought to implement due to an interface, are found. It's just like using getFoo(); in your own method when getFoo() is

[The Java Posse] Re: Lombok and Mixins

2009-08-26 Thread Mark Derricutt
For javac maybe, but not for IDEA or Netbeans, or eclipse without the lombok plugin (thats more what I was meaning). On Thu, Aug 27, 2009 at 2:30 PM, Reinier Zwitserloot reini...@gmail.comwrote: Nope; lombok injects those methods well before the latter stages of the error finding process runs

[The Java Posse] give the start kickoff JPA-Spring

2009-08-26 Thread Math
Hello everyone , im trying and trying to configure a project with maven, spring and jpa. I had read read all google and can´t resolve the problems. first all code is here: http://code.google.com/p/base2dev/source/browse/#svn/src/trunk/base2dev i have so differents troubles . now are throwing

[The Java Posse] Re: open source licences scheme

2009-08-26 Thread Michael Neale
Does BSD have the be cool on the patents clause to provide author protection etc? from what I remember, other then that they are very similar. But BSD style seems to mean (in most peoples minds these days) the most liberal to everyone (user and author, not just author). On Aug 27, 8:34 am,