From sunil.lmc at gmail.com Thu Oct 9 14:21:26 2014 From: sunil.lmc at gmail.com (sunil) Date: Thu, 9 Oct 2014 09:21:26 -0500 Subject: Introduction Message-ID: Hello All, I am new to OpenJDK group and I wish to be an active member here. I am looking for mentors whom I can pair with to learn as a observer and eventually be a contributor . Please reach out to me at sunil.lmc at gmail.com , if you could get me upto the speed. Have a good day all. Thanks Sunil From martijnverburg at gmail.com Thu Oct 9 14:54:24 2014 From: martijnverburg at gmail.com (Martijn Verburg) Date: Thu, 9 Oct 2014 15:54:24 +0100 Subject: Introduction In-Reply-To: References: Message-ID: Hi Sunil, You'll want to join the mailing list adoption-discuss where we have such mentors :-). Cheers, Martijn On Thursday, 9 October 2014, sunil wrote: > Hello All, > I am new to OpenJDK group and I wish to be an active member > here. I am looking for mentors whom I can pair with to learn as a observer > and eventually be a contributor . Please reach out to me at > sunil.lmc at gmail.com , if you could get me upto the speed. > Have a good day > all. > > Thanks > > Sunil > -- Cheers, Martijn From gchauvet at zatarox.com Fri Oct 10 04:50:51 2014 From: gchauvet at zatarox.com (CHAUVET Guillaume) Date: Fri, 10 Oct 2014 06:50:51 +0200 Subject: [SUGGESTION]: Define aliases when importing multiple classes with same classname Message-ID: <2dd1c9a31fa755cdc073d82b8cbc22d7@zatarox.com> Dear OpenJDK community, I would like to submit you a potential new Java feature already existing in Eiffel language : renaming classes/interfaces when importing them. The goal is to improve the clashnames resolution when importing some classes with the same classname but provided from different packages by adding a classname alias mechanism. Below, a simple use case that display how this potential new syntax : Snippet class ================== import javax.management.Query; import javax.persistence.Query as PersistenceQuery; import org.apache.lucene.search.Query as LucentQuery; public class Snippet { private javax.persistence.Query q1; // Direct classname resolution private PersistenceQuery q2; // Using alias classname of javax.persistence.Query private Query q3; // Using default imported class : javax.management.Query private LucentQuery q4; // Using alias classname of org.apache.lucene.search.Query public PersistenceQuery getPersistence() { return q2; } } Caller class ================== Snippet s = new Snippet(); s.getPersistence(); // return javax.persistence.Query, not the internal alias used in class definition I'm ready to involved to implement this new feature by contributing to the OpenJDK development effort. Best regards From neugens at redhat.com Fri Oct 10 07:38:45 2014 From: neugens at redhat.com (Mario Torre) Date: Fri, 10 Oct 2014 09:38:45 +0200 Subject: [SUGGESTION]: Define aliases when importing multiple classes with same classname In-Reply-To: <2dd1c9a31fa755cdc073d82b8cbc22d7@zatarox.com> References: <2dd1c9a31fa755cdc073d82b8cbc22d7@zatarox.com> Message-ID: <1412926725.3688.16.camel@nirvana.localdomain> On Fri, 2014-10-10 at 06:50 +0200, CHAUVET Guillaume wrote: > Dear OpenJDK community, Hello Guillaume, First of all welcome and thanks for this proposal. > I would like to submit you a potential new Java feature already existing > in Eiffel language : renaming classes/interfaces when importing them. > The goal is to improve the clashnames resolution when importing some > classes with the same classname but provided from different packages by > adding a classname alias mechanism. Below, a simple use case that > display how this potential new syntax : > > Snippet class > ================== > import javax.management.Query; > import javax.persistence.Query as PersistenceQuery; > import org.apache.lucene.search.Query as LucentQuery; > > public class Snippet { > > private javax.persistence.Query q1; // Direct classname resolution > private PersistenceQuery q2; // Using alias classname of > javax.persistence.Query > private Query q3; // Using default imported class : > javax.management.Query > private LucentQuery q4; // Using alias classname of > org.apache.lucene.search.Query > > public PersistenceQuery getPersistence() { > return q2; > } > } > > Caller class > ================== > Snippet s = new Snippet(); > s.getPersistence(); // return javax.persistence.Query, not the internal > alias used in class definition Not sure, it seems really confusing. You declare a type internally and make public API return that type, but then the method returns something else (which is really the same, but nobody knows!). Yes, JavaDoc may do the right thing, but people reading the code would be lost. I think preserving clarity of the language is the first goal of any addition so this change isn't likely to get traction, but you can try :) > I'm ready to involved to implement this new feature by contributing to > the OpenJDK development effort. Best thing is to start discussing here like you did, then if enough people like the idea or you don't get enough feedback but have a general impression that it's worth it, you could go ahead with a JEP. If it's accepted, you'll get all the tools needed to experiment and allow us to keep track of the work. At that point, depending on the specific changes, you may need to involve the JCP to get the changes part of the Java specification. If you join the adoption-discuss you can find people to help with all those steps, but as I said, the discussion should go on here first. Cheers, Mario From brian.goetz at oracle.com Wed Oct 15 16:30:53 2014 From: brian.goetz at oracle.com (Brian Goetz) Date: Wed, 15 Oct 2014 12:30:53 -0400 Subject: [SUGGESTION]: Define aliases when importing multiple classes with same classname In-Reply-To: <2dd1c9a31fa755cdc073d82b8cbc22d7@zatarox.com> References: <2dd1c9a31fa755cdc073d82b8cbc22d7@zatarox.com> Message-ID: <543EA13D.7050609@oracle.com> Note that this issue is not new: https://bugs.openjdk.java.net/browse/JDK-4214789 https://bugs.openjdk.java.net/browse/JDK-4194542 On 10/10/2014 12:50 AM, CHAUVET Guillaume wrote: > Dear OpenJDK community, > > I would like to submit you a potential new Java feature already existing > in Eiffel language : renaming classes/interfaces when importing them. > The goal is to improve the clashnames resolution when importing some > classes with the same classname but provided from different packages by > adding a classname alias mechanism. Below, a simple use case that > display how this potential new syntax : > > Snippet class > ================== > import javax.management.Query; > import javax.persistence.Query as PersistenceQuery; > import org.apache.lucene.search.Query as LucentQuery; > > public class Snippet { > > private javax.persistence.Query q1; // Direct classname resolution > private PersistenceQuery q2; // Using alias classname of > javax.persistence.Query > private Query q3; // Using default imported class : > javax.management.Query > private LucentQuery q4; // Using alias classname of > org.apache.lucene.search.Query > > public PersistenceQuery getPersistence() { > return q2; > } > } > > Caller class > ================== > Snippet s = new Snippet(); > s.getPersistence(); // return javax.persistence.Query, not the internal > alias used in class definition > > > I'm ready to involved to implement this new feature by contributing to > the OpenJDK development effort. > > Best regards > From pbenedict at apache.org Wed Oct 15 16:50:59 2014 From: pbenedict at apache.org (Paul Benedict) Date: Wed, 15 Oct 2014 11:50:59 -0500 Subject: [SUGGESTION]: Define aliases when importing multiple classes with same classname In-Reply-To: <543EA13D.7050609@oracle.com> References: <2dd1c9a31fa755cdc073d82b8cbc22d7@zatarox.com> <543EA13D.7050609@oracle.com> Message-ID: Interestingly, these tickets are closed as duplicates and none link to an open request. Was the original was accidentally marked a dupe and closed too? Cheers, Paul On Wed, Oct 15, 2014 at 11:30 AM, Brian Goetz wrote: > Note that this issue is not new: > https://bugs.openjdk.java.net/browse/JDK-4214789 > https://bugs.openjdk.java.net/browse/JDK-4194542 > > > On 10/10/2014 12:50 AM, CHAUVET Guillaume wrote: > >> Dear OpenJDK community, >> >> I would like to submit you a potential new Java feature already existing >> in Eiffel language : renaming classes/interfaces when importing them. >> The goal is to improve the clashnames resolution when importing some >> classes with the same classname but provided from different packages by >> adding a classname alias mechanism. Below, a simple use case that >> display how this potential new syntax : >> >> Snippet class >> ================== >> import javax.management.Query; >> import javax.persistence.Query as PersistenceQuery; >> import org.apache.lucene.search.Query as LucentQuery; >> >> public class Snippet { >> >> private javax.persistence.Query q1; // Direct classname resolution >> private PersistenceQuery q2; // Using alias classname of >> javax.persistence.Query >> private Query q3; // Using default imported class : >> javax.management.Query >> private LucentQuery q4; // Using alias classname of >> org.apache.lucene.search.Query >> >> public PersistenceQuery getPersistence() { >> return q2; >> } >> } >> >> Caller class >> ================== >> Snippet s = new Snippet(); >> s.getPersistence(); // return javax.persistence.Query, not the internal >> alias used in class definition >> >> >> I'm ready to involved to implement this new feature by contributing to >> the OpenJDK development effort. >> >> Best regards >> >> From neugens at redhat.com Wed Oct 15 16:57:58 2014 From: neugens at redhat.com (Mario Torre) Date: Wed, 15 Oct 2014 18:57:58 +0200 Subject: [SUGGESTION]: Define aliases when importing multiple classes with same classname In-Reply-To: References: <2dd1c9a31fa755cdc073d82b8cbc22d7@zatarox.com> <543EA13D.7050609@oracle.com> Message-ID: <1413392278.14801.5.camel@nirvana.localdomain> On Wed, 2014-10-15 at 11:50 -0500, Paul Benedict wrote: > Interestingly, these tickets are closed as duplicates and none link to > an > open request. Was the original was accidentally marked a dupe and > closed > too? I was just about to send the same mail. Cheers, Mario From gchauvet at zatarox.com Wed Oct 15 18:37:13 2014 From: gchauvet at zatarox.com (CHAUVET Guillaume) Date: Wed, 15 Oct 2014 20:37:13 +0200 Subject: [SUGGESTION]: Define aliases when importing multiple classes with same classname In-Reply-To: <1412926725.3688.16.camel@nirvana.localdomain> References: <2dd1c9a31fa755cdc073d82b8cbc22d7@zatarox.com> <1412926725.3688.16.camel@nirvana.localdomain> Message-ID: Hello Mario & folks, Thank you for your warm welcome. I take your point about the return type that is a little bit confusing. I've revisited this part by suggesting that alias can't be used for result and parameter types (in fact, clashnames often happen in body class implementation, rarely (never ?) in methods signature). Moreover, I haven't seen these tickets created for this same issue on openjdk jira. All my apologies... Best regards, From david.holmes at oracle.com Thu Oct 16 00:02:10 2014 From: david.holmes at oracle.com (David Holmes) Date: Thu, 16 Oct 2014 10:02:10 +1000 Subject: [SUGGESTION]: Define aliases when importing multiple classes with same classname In-Reply-To: References: <2dd1c9a31fa755cdc073d82b8cbc22d7@zatarox.com> <543EA13D.7050609@oracle.com> Message-ID: <543F0B02.1060109@oracle.com> On 16/10/2014 2:50 AM, Paul Benedict wrote: > Interestingly, these tickets are closed as duplicates and none link to an > open request. Was the original was accidentally marked a dupe and closed > too? There's a weird cycle involving those two and https://bugs.openjdk.java.net/browse/JDK-4478140 But there is also: https://bugs.openjdk.java.net/browse/PLAN-444 David > > Cheers, > Paul > > On Wed, Oct 15, 2014 at 11:30 AM, Brian Goetz > wrote: > >> Note that this issue is not new: >> https://bugs.openjdk.java.net/browse/JDK-4214789 >> https://bugs.openjdk.java.net/browse/JDK-4194542 >> >> >> On 10/10/2014 12:50 AM, CHAUVET Guillaume wrote: >> >>> Dear OpenJDK community, >>> >>> I would like to submit you a potential new Java feature already existing >>> in Eiffel language : renaming classes/interfaces when importing them. >>> The goal is to improve the clashnames resolution when importing some >>> classes with the same classname but provided from different packages by >>> adding a classname alias mechanism. Below, a simple use case that >>> display how this potential new syntax : >>> >>> Snippet class >>> ================== >>> import javax.management.Query; >>> import javax.persistence.Query as PersistenceQuery; >>> import org.apache.lucene.search.Query as LucentQuery; >>> >>> public class Snippet { >>> >>> private javax.persistence.Query q1; // Direct classname resolution >>> private PersistenceQuery q2; // Using alias classname of >>> javax.persistence.Query >>> private Query q3; // Using default imported class : >>> javax.management.Query >>> private LucentQuery q4; // Using alias classname of >>> org.apache.lucene.search.Query >>> >>> public PersistenceQuery getPersistence() { >>> return q2; >>> } >>> } >>> >>> Caller class >>> ================== >>> Snippet s = new Snippet(); >>> s.getPersistence(); // return javax.persistence.Query, not the internal >>> alias used in class definition >>> >>> >>> I'm ready to involved to implement this new feature by contributing to >>> the OpenJDK development effort. >>> >>> Best regards >>> >>> From david.holmes at oracle.com Thu Oct 16 02:02:26 2014 From: david.holmes at oracle.com (David Holmes) Date: Thu, 16 Oct 2014 12:02:26 +1000 Subject: [SUGGESTION]: Define aliases when importing multiple classes with same classname In-Reply-To: <543F0B02.1060109@oracle.com> References: <2dd1c9a31fa755cdc073d82b8cbc22d7@zatarox.com> <543EA13D.7050609@oracle.com> <543F0B02.1060109@oracle.com> Message-ID: <543F2732.6030502@oracle.com> On 16/10/2014 10:02 AM, David Holmes wrote: > On 16/10/2014 2:50 AM, Paul Benedict wrote: >> Interestingly, these tickets are closed as duplicates and none link to an >> open request. Was the original was accidentally marked a dupe and closed >> too? > > There's a weird cycle involving those two and > > https://bugs.openjdk.java.net/browse/JDK-4478140 > > But there is also: > > https://bugs.openjdk.java.net/browse/PLAN-444 Oops sorry - that's an internal URL. David > David > > >> >> Cheers, >> Paul >> >> On Wed, Oct 15, 2014 at 11:30 AM, Brian Goetz >> wrote: >> >>> Note that this issue is not new: >>> https://bugs.openjdk.java.net/browse/JDK-4214789 >>> https://bugs.openjdk.java.net/browse/JDK-4194542 >>> >>> >>> On 10/10/2014 12:50 AM, CHAUVET Guillaume wrote: >>> >>>> Dear OpenJDK community, >>>> >>>> I would like to submit you a potential new Java feature already >>>> existing >>>> in Eiffel language : renaming classes/interfaces when importing them. >>>> The goal is to improve the clashnames resolution when importing some >>>> classes with the same classname but provided from different packages by >>>> adding a classname alias mechanism. Below, a simple use case that >>>> display how this potential new syntax : >>>> >>>> Snippet class >>>> ================== >>>> import javax.management.Query; >>>> import javax.persistence.Query as PersistenceQuery; >>>> import org.apache.lucene.search.Query as LucentQuery; >>>> >>>> public class Snippet { >>>> >>>> private javax.persistence.Query q1; // Direct classname >>>> resolution >>>> private PersistenceQuery q2; // Using alias classname of >>>> javax.persistence.Query >>>> private Query q3; // Using default imported class : >>>> javax.management.Query >>>> private LucentQuery q4; // Using alias classname of >>>> org.apache.lucene.search.Query >>>> >>>> public PersistenceQuery getPersistence() { >>>> return q2; >>>> } >>>> } >>>> >>>> Caller class >>>> ================== >>>> Snippet s = new Snippet(); >>>> s.getPersistence(); // return javax.persistence.Query, not the internal >>>> alias used in class definition >>>> >>>> >>>> I'm ready to involved to implement this new feature by contributing to >>>> the OpenJDK development effort. >>>> >>>> Best regards >>>> >>>> From neugens.limasoftware at gmail.com Thu Oct 16 06:56:32 2014 From: neugens.limasoftware at gmail.com (Mario Torre) Date: Thu, 16 Oct 2014 08:56:32 +0200 Subject: [SUGGESTION]: Define aliases when importing multiple classes with same classname In-Reply-To: <543F2732.6030502@oracle.com> References: <2dd1c9a31fa755cdc073d82b8cbc22d7@zatarox.com> <543EA13D.7050609@oracle.com> <543F0B02.1060109@oracle.com> <543F2732.6030502@oracle.com> Message-ID: A secret master plan, I knew it! ;) Cheers, Mario Il 16/ott/2014 04:03 "David Holmes" ha scritto: > On 16/10/2014 10:02 AM, David Holmes wrote: > >> On 16/10/2014 2:50 AM, Paul Benedict wrote: >> >>> Interestingly, these tickets are closed as duplicates and none link to an >>> open request. Was the original was accidentally marked a dupe and closed >>> too? >>> >> >> There's a weird cycle involving those two and >> >> https://bugs.openjdk.java.net/browse/JDK-4478140 >> >> But there is also: >> >> https://bugs.openjdk.java.net/browse/PLAN-444 >> > > Oops sorry - that's an internal URL. > > David > > David >> >> >> >>> Cheers, >>> Paul >>> >>> On Wed, Oct 15, 2014 at 11:30 AM, Brian Goetz >>> wrote: >>> >>> Note that this issue is not new: >>>> https://bugs.openjdk.java.net/browse/JDK-4214789 >>>> https://bugs.openjdk.java.net/browse/JDK-4194542 >>>> >>>> >>>> On 10/10/2014 12:50 AM, CHAUVET Guillaume wrote: >>>> >>>> Dear OpenJDK community, >>>>> >>>>> I would like to submit you a potential new Java feature already >>>>> existing >>>>> in Eiffel language : renaming classes/interfaces when importing them. >>>>> The goal is to improve the clashnames resolution when importing some >>>>> classes with the same classname but provided from different packages by >>>>> adding a classname alias mechanism. Below, a simple use case that >>>>> display how this potential new syntax : >>>>> >>>>> Snippet class >>>>> ================== >>>>> import javax.management.Query; >>>>> import javax.persistence.Query as PersistenceQuery; >>>>> import org.apache.lucene.search.Query as LucentQuery; >>>>> >>>>> public class Snippet { >>>>> >>>>> private javax.persistence.Query q1; // Direct classname >>>>> resolution >>>>> private PersistenceQuery q2; // Using alias classname of >>>>> javax.persistence.Query >>>>> private Query q3; // Using default imported class : >>>>> javax.management.Query >>>>> private LucentQuery q4; // Using alias classname of >>>>> org.apache.lucene.search.Query >>>>> >>>>> public PersistenceQuery getPersistence() { >>>>> return q2; >>>>> } >>>>> } >>>>> >>>>> Caller class >>>>> ================== >>>>> Snippet s = new Snippet(); >>>>> s.getPersistence(); // return javax.persistence.Query, not the internal >>>>> alias used in class definition >>>>> >>>>> >>>>> I'm ready to involved to implement this new feature by contributing to >>>>> the OpenJDK development effort. >>>>> >>>>> Best regards >>>>> >>>>> >>>>> From the.warl0ck.1989 at gmail.com Mon Oct 20 07:09:04 2014 From: the.warl0ck.1989 at gmail.com (Aaron Lewis) Date: Mon, 20 Oct 2014 15:09:04 +0800 Subject: Looking for a standalone Java source code parser Message-ID: Hi, I'm looking for a parser that parses Java source code, is there any recommend ones? -- Best Regards, Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/ Finger Print: 9F67 391B B770 8FF6 99DC D92D 87F6 2602 1371 4D33 From benjamin.john.evans at gmail.com Mon Oct 20 07:13:56 2014 From: benjamin.john.evans at gmail.com (Ben Evans) Date: Mon, 20 Oct 2014 15:13:56 +0800 Subject: Looking for a standalone Java source code parser In-Reply-To: References: Message-ID: There is certainly a BNF grammar for Java 5 out there somewhere. A tool like ANTLR should be able to produce a parser for you from that. What's the specific use case? Thanks, Ben On 20 Oct 2014 15:10, "Aaron Lewis" wrote: > Hi, > > I'm looking for a parser that parses Java source code, is there any > recommend ones? > > -- > Best Regards, > Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/ > Finger Print: 9F67 391B B770 8FF6 99DC D92D 87F6 2602 1371 4D33 > From the.warl0ck.1989 at gmail.com Mon Oct 20 07:22:04 2014 From: the.warl0ck.1989 at gmail.com (Aaron Lewis) Date: Mon, 20 Oct 2014 15:22:04 +0800 Subject: Looking for a standalone Java source code parser In-Reply-To: References: Message-ID: Hi Ben, Thanks for the quick reply. I'm trying to do static analysis (e.g API calls, function parameters) on JSP files. I will do what tomcat does and convert the JSP file into a JAVA file first, then do the analysis on JAVA code. Basically I want to know what java class::method is called and what parameters are passed in, if possible. So, is there any existing tool I can use ? On Mon, Oct 20, 2014 at 3:13 PM, Ben Evans wrote: > There is certainly a BNF grammar for Java 5 out there somewhere. A tool like > ANTLR should be able to produce a parser for you from that. > > What's the specific use case? > > Thanks, > > Ben > > On 20 Oct 2014 15:10, "Aaron Lewis" wrote: >> >> Hi, >> >> I'm looking for a parser that parses Java source code, is there any >> recommend ones? >> >> -- >> Best Regards, >> Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/ >> Finger Print: 9F67 391B B770 8FF6 99DC D92D 87F6 2602 1371 4D33 -- Best Regards, Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/ Finger Print: 9F67 391B B770 8FF6 99DC D92D 87F6 2602 1371 4D33 From dmitry.samersoff at oracle.com Mon Oct 20 07:39:56 2014 From: dmitry.samersoff at oracle.com (Dmitry Samersoff) Date: Mon, 20 Oct 2014 11:39:56 +0400 Subject: Looking for a standalone Java source code parser In-Reply-To: References: Message-ID: <5444BC4C.5060002@oracle.com> Aaron, It might be easier to parse compiled class file (using e.g. ASM library) than deal with a source code. -Dmitry On 2014-10-20 11:22, Aaron Lewis wrote: > Hi Ben, > > Thanks for the quick reply. > I'm trying to do static analysis (e.g API calls, function parameters) > on JSP files. > I will do what tomcat does and convert the JSP file into a JAVA file > first, then do the analysis on JAVA code. > > Basically I want to know what java class::method is called and what > parameters are passed in, if possible. > > So, is there any existing tool I can use ? > > > > > On Mon, Oct 20, 2014 at 3:13 PM, Ben Evans > wrote: >> There is certainly a BNF grammar for Java 5 out there somewhere. A tool like >> ANTLR should be able to produce a parser for you from that. >> >> What's the specific use case? >> >> Thanks, >> >> Ben >> >> On 20 Oct 2014 15:10, "Aaron Lewis" wrote: >>> >>> Hi, >>> >>> I'm looking for a parser that parses Java source code, is there any >>> recommend ones? >>> >>> -- >>> Best Regards, >>> Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/ >>> Finger Print: 9F67 391B B770 8FF6 99DC D92D 87F6 2602 1371 4D33 > > > -- Dmitry Samersoff Oracle Java development team, Saint Petersburg, Russia * I would love to change the world, but they won't give me the sources. From neugens.limasoftware at gmail.com Mon Oct 20 09:55:47 2014 From: neugens.limasoftware at gmail.com (Mario Torre) Date: Mon, 20 Oct 2014 11:55:47 +0200 Subject: Looking for a standalone Java source code parser In-Reply-To: References: Message-ID: I think you may then need to use exactly what Tomcat uses to generate the bytecode/java files. I'm not really expert here, but I would guess that Tomcat may perform some optimisations or other things that may not generate the same code. As Dmitry suggest, if you can have the bytecode it would probably make it easier to do static analysis. If you're building a static analysis tool, it's an interesting project indeed, any plans to make it open source? :) Cheers, Mario 2014-10-20 9:22 GMT+02:00 Aaron Lewis : > Hi Ben, > > Thanks for the quick reply. > I'm trying to do static analysis (e.g API calls, function parameters) > on JSP files. > I will do what tomcat does and convert the JSP file into a JAVA file > first, then do the analysis on JAVA code. > > Basically I want to know what java class::method is called and what > parameters are passed in, if possible. > > So, is there any existing tool I can use ? > > > > > On Mon, Oct 20, 2014 at 3:13 PM, Ben Evans > wrote: >> There is certainly a BNF grammar for Java 5 out there somewhere. A tool like >> ANTLR should be able to produce a parser for you from that. >> >> What's the specific use case? >> >> Thanks, >> >> Ben >> >> On 20 Oct 2014 15:10, "Aaron Lewis" wrote: >>> >>> Hi, >>> >>> I'm looking for a parser that parses Java source code, is there any >>> recommend ones? >>> >>> -- >>> Best Regards, >>> Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/ >>> Finger Print: 9F67 391B B770 8FF6 99DC D92D 87F6 2602 1371 4D33 > > > > -- > Best Regards, > Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/ > Finger Print: 9F67 391B B770 8FF6 99DC D92D 87F6 2602 1371 4D33 -- pgp key: http://subkeys.pgp.net/ PGP Key ID: 80F240CF Fingerprint: BA39 9666 94EC 8B73 27FA FC7C 4086 63E3 80F2 40CF Java Champion - Blog: http://neugens.wordpress.com - Twitter: @neugens Proud GNU Classpath developer: http://www.classpath.org/ OpenJDK: http://openjdk.java.net/projects/caciocavallo/ Please, support open standards: http://endsoftpatents.org/ From alex.buckley at oracle.com Mon Oct 20 18:55:45 2014 From: alex.buckley at oracle.com (Alex Buckley) Date: Mon, 20 Oct 2014 11:55:45 -0700 Subject: Looking for a standalone Java source code parser In-Reply-To: References: Message-ID: <54455AB1.60307@oracle.com> On 10/20/2014 12:13 AM, Ben Evans wrote: > There is certainly a BNF grammar for Java 5 out there somewhere. A tool > like ANTLR should be able to produce a parser for you from that. ANTLR 4 ships with a grammar for Java 7, and has an experimental grammar for Java 8. There was some work this summer between Oracle and Terence Parr to improve ANTLR's Java 8 grammar and integrate the resulting parser into javac - see the compiler-grammar-dev list. Alex From mparchet at sunrise.ch Mon Oct 20 20:32:27 2014 From: mparchet at sunrise.ch (Michael Parchet) Date: Mon, 20 Oct 2014 22:32:27 +0200 Subject: Downloud Openjdk 7, 8, or 9 for Linux, Mac or windows Message-ID: <8A0FF610-E6B8-4F74-86E1-01ABDCD13FF0@sunrise.ch> Hello, Where I could download open jdk (not oracle jdk )7, 8, or 9, for Mac, windows or Linux. Tanks by avance for your answer Best regards mparchet From brian.goetz at oracle.com Mon Oct 20 21:43:19 2014 From: brian.goetz at oracle.com (Brian Goetz) Date: Mon, 20 Oct 2014 17:43:19 -0400 Subject: Looking for a standalone Java source code parser In-Reply-To: References: Message-ID: <544581F7.2070009@oracle.com> There's an ANTLR grammar in the JLS, if this helps. On 10/20/2014 3:09 AM, Aaron Lewis wrote: > Hi, > > I'm looking for a parser that parses Java source code, is there any > recommend ones? > From the.warl0ck.1989 at gmail.com Tue Oct 21 03:14:06 2014 From: the.warl0ck.1989 at gmail.com (Aaron Lewis) Date: Tue, 21 Oct 2014 11:14:06 +0800 Subject: Looking for a standalone Java source code parser In-Reply-To: <544581F7.2070009@oracle.com> References: <544581F7.2070009@oracle.com> Message-ID: Hi, list, I took a look at ANTLR first, and I did this: wget http://www.antlr.org/download/antlr-4.2-complete.jar wget https://raw.githubusercontent.com/antlr/grammars-v4/master/java/Java.g4 Then I created a simple Java file: import java.io.*; public class Foo { public static void main (String[] args) { } } It compiles with javac, so I moved to ANTLR: %> java -jar antlr-4.2-complete.jar Foo.java error(50): /run/shm/antlr/Foo.java:1:0: syntax error: 'import' came as a complete surprise to me error(50): /run/shm/antlr/Foo.java:1:11: syntax error: mismatched input '.' expecting SEMI Hmm, I think the g4 file I downloaded is the official one, so I must have done something wrong. Anyone know how to correct that? On Tue, Oct 21, 2014 at 5:43 AM, Brian Goetz wrote: > There's an ANTLR grammar in the JLS, if this helps. > > > On 10/20/2014 3:09 AM, Aaron Lewis wrote: >> >> Hi, >> >> I'm looking for a parser that parses Java source code, is there any >> recommend ones? >> > -- Best Regards, Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/ Finger Print: 9F67 391B B770 8FF6 99DC D92D 87F6 2602 1371 4D33 From the.warl0ck.1989 at gmail.com Tue Oct 21 05:26:50 2014 From: the.warl0ck.1989 at gmail.com (Aaron Lewis) Date: Tue, 21 Oct 2014 13:26:50 +0800 Subject: Looking for a standalone Java source code parser In-Reply-To: References: <544581F7.2070009@oracle.com> Message-ID: Never mind, I misunderstood the toolchain ;-( I should be invoking the .g file instead. On Tue, Oct 21, 2014 at 11:14 AM, Aaron Lewis wrote: > Hi, list, > > I took a look at ANTLR first, and I did this: > > wget http://www.antlr.org/download/antlr-4.2-complete.jar > wget https://raw.githubusercontent.com/antlr/grammars-v4/master/java/Java.g4 > > Then I created a simple Java file: > import java.io.*; > > public class Foo { > public static void main (String[] args) > { > > } > } > > It compiles with javac, so I moved to ANTLR: > %> java -jar antlr-4.2-complete.jar Foo.java > error(50): /run/shm/antlr/Foo.java:1:0: syntax error: 'import' came as > a complete surprise to me > error(50): /run/shm/antlr/Foo.java:1:11: syntax error: mismatched > input '.' expecting SEMI > > Hmm, I think the g4 file I downloaded is the official one, so I must > have done something wrong. > Anyone know how to correct that? > > > On Tue, Oct 21, 2014 at 5:43 AM, Brian Goetz wrote: >> There's an ANTLR grammar in the JLS, if this helps. >> >> >> On 10/20/2014 3:09 AM, Aaron Lewis wrote: >>> >>> Hi, >>> >>> I'm looking for a parser that parses Java source code, is there any >>> recommend ones? >>> >> > > > > -- > Best Regards, > Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/ > Finger Print: 9F67 391B B770 8FF6 99DC D92D 87F6 2602 1371 4D33 -- Best Regards, Aaron Lewis - PGP: 0x13714D33 - http://pgp.mit.edu/ Finger Print: 9F67 391B B770 8FF6 99DC D92D 87F6 2602 1371 4D33 From neugens at redhat.com Wed Oct 22 17:10:11 2014 From: neugens at redhat.com (Mario Torre) Date: Wed, 22 Oct 2014 19:10:11 +0200 Subject: FreeJava DevRoom - Call for Paper 2015 Message-ID: <1413997811.14618.1.camel@nirvana.localdomain> We are pleased to announce the Call for Participation in the FOSDEM 2015 Free Java DevRoom! This marks the 12th year that the Free Java DevRoom has been a part of FOSDEM, and also marks 20 years of Java! This year FOSDEM Free Java DevRoom will be 31 January & 1 February 2015 in Brussels, Belgium, with usual additional events and meetings on Friday, Saturday and Sunday; please, refer to the FOSDEM website for the schedule of the whole event: https://fosdem.org/2015/ The Free Java DevRoom has become unique in that it has attracted hackers from very different Free Software Java projects, giving the opportunity to bring together companies of various sizes, different project communities, mainstream core Java developers, alternative Java language implementations and runtimes, and everything that form the Free Java Universe, everybody participating to share their knowledge in an atmosphere of cooperation and friendly competition. It has been a long journey so far, exciting and fun, and hard at times. But together we have made it, and Java today more than ever can count on a dynamic and vibrant Community, innovation due to participation, and a user base that is continually growing. We won't sit and rest on the paved road we built, though! We are eager to contribute to the next "20 years of excellence", and we want you to be part of it! As always, check out our wiki for more details on the conference: http://wiki.debian.org/Java/DevJam/2015/Fosdem And join the Free Java DevoRoom mailing list [java-devroom at lists.fosdem.org]: https://lists.fosdem.org/listinfo/java-devroom *** IMPORTANT *** Fosdem organisers have expressed the desire to record everything, and we will do our best to record the sessions by default. If you wish to NOT be recorded please write clearly so in the proposal. Please submit one (or more) 25 minute talk proposal(s) by the 1st of December 2014, 23.59 CET on the mailing list. We will also select a small number of 45 minutes talk. If you wish to submit a 45 minutes talk please state this in the proposal, all proposals will be considered to be of 25 minute by default otherwise. A template for submitting a talk can be found at: http://wiki.debian.org/Java/DevJam/2015/Fosdem/CallForParticipation Tracks will be announced around 10th of December on the mailing list. Please join us! --The Free Java DevRoom Organizing Committee From cnewland at chrisnewland.com Thu Oct 23 08:55:33 2014 From: cnewland at chrisnewland.com (Chris Newland) Date: Thu, 23 Oct 2014 09:55:33 +0100 Subject: Downloud Openjdk 7, 8, or 9 for Linux, Mac or windows In-Reply-To: <8A0FF610-E6B8-4F74-86E1-01ABDCD13FF0@sunrise.ch> References: <8A0FF610-E6B8-4F74-86E1-01ABDCD13FF0@sunrise.ch> Message-ID: Hi Michael, NB: I don't speak for Oracle or OpenJDK! Not sure if you've had any other answers but since Java 7, OpenJDK has been the reference implementation of Java so the Oracle JDK binaries are based on the OpenJDK codebase (with a few proprietary bits added). Reference implementation downloads exist for OpenJDK 7 on Linux and Windows but these are very out of date and *will not* have the latest security patches: https://jdk7.java.net/java-se-7-ri/ Likewise, reference implementation binaries for OpenJDK 8 exist but again will not contain the latest security patches: https://jdk8.java.net/java-se-8-ri/ On Linux, I believe most distributions maintain an OpenJDK 7 package and some may provide an OpenJDK 8 package. OpenJDK 9 is the development version of Java 9 and I don't know of any binary downloads but you can learn more about the project here: http://openjdk.java.net/projects/jdk9/ If want to learn about OpenJDK and building your own binaries then the Adopt OpenJDK project is a great place to start: https://java.net/projects/adoptopenjdk/pages/WhatToWorkOnForOpenJDK#Build_OpenJDK For OpenJDK 9 I've also posted a gist on how to build your own copy from source (on Debian Linux): https://gist.github.com/chriswhocodes/c5ca0766ded3046691f0 Hope this helps. Kind regards, Chris @chriswhocodes On Mon, October 20, 2014 21:32, Michael Parchet wrote: > Hello, > > > Where I could download open jdk (not oracle jdk )7, 8, or 9, for Mac, > windows or Linux. > > Tanks by avance for your answer > > > Best regards > > > mparchet > > > From ivan at azulsystems.com Fri Oct 24 15:24:12 2014 From: ivan at azulsystems.com (Ivan Krylov) Date: Fri, 24 Oct 2014 19:24:12 +0400 Subject: Downloud Openjdk 7, 8, or 9 for Linux, Mac or windows In-Reply-To: <8A0FF610-E6B8-4F74-86E1-01ABDCD13FF0@sunrise.ch> References: <8A0FF610-E6B8-4F74-86E1-01ABDCD13FF0@sunrise.ch> Message-ID: <544A6F1C.10004@azulsystems.com> Shameless plug: we do it for 6, 7 and 8. http://www.azulsystems.com/products/zulu For linux systems you may also want to check icedtea builds which are openjdk sources based as well. Thanks, Ivan On 21/10/2014 00:32, Michael Parchet wrote: > Hello, > > Where I could download open jdk (not oracle jdk )7, 8, or 9, for Mac, windows or Linux. > > Tanks by avance for your answer > > Best regards > > mparchet > > > From nicarran at gmail.com Wed Oct 29 12:06:18 2014 From: nicarran at gmail.com (nicarran at gmail.com) Date: Wed, 29 Oct 2014 07:06:18 -0500 Subject: java.util.Optional: a better implementation? Message-ID: <5450D83A.1080809@gmail.com> Hi, I'm evaluating java.util.Optional to use it all around my code. I noticed that its current implementation checks for null on almost every method and that these checks can be avoided by changing its implementation to an abstract Optional class with two subclasses, one for the EMPTY and another for the not-empty (present) values without breaking compatibility. Something like this: ********************** public abstract class Optional { private static final Optional EMPTY=new Empty<>(); private static class Empty extends Optional { @Override public boolean isPresent() { return false; } @Override public T get() { throw new NoSuchElementException("No value present"); } @Override public void ifPresent(Consumer consumer) { } // and so on } private static class Present extends Optional { private final T value; Present(T value) { this.value=Objects.requireNonNull(value); } @Override public boolean isPresent() { return true; } @Override public T get() { return value; } @Override public void ifPresent(Consumer consumer) { consumer.accept(value); } // and so on } private Optional() {} public static Optional of(T value) { return new Present<>(value); } public static Optional ofNullable(T value) { return value==null? empty(): new Present<>(value); } @SuppressWarnings("unchecked") public static Optional empty(){ return (Optional)EMPTY; } public abstract boolean isPresent(); public abstract T get(); public abstract void ifPresent(Consumer consumer); // and so on } ******************** The JVM probably optimizes and throws away the null checks yielding in equal performance compared to the proposed implementation (above) ---I haven't done any performance tests----, but why wait for the JVM when this implementation is also nicer to read? What do you think? Please let me know if this is not the appropriate mailing list to post this message, Thanks, Nicolas From doug.simon at oracle.com Wed Oct 29 12:24:58 2014 From: doug.simon at oracle.com (Doug Simon) Date: Wed, 29 Oct 2014 13:24:58 +0100 Subject: java.util.Optional: a better implementation? In-Reply-To: <5450D83A.1080809@gmail.com> References: <5450D83A.1080809@gmail.com> Message-ID: Hi Nicolas, Your proposal would replace a null check with a type test or (worse) a virtual dispatch. If you do the performance experiment, I?d be very surprised if the current implementation is not the fastest. -Doug > On Oct 29, 2014, at 1:06 PM, nicarran at gmail.com wrote: > > Hi, > > I'm evaluating java.util.Optional to use it all around my code. I > noticed that its current implementation checks for null on almost every > method and that these checks can be avoided by changing its > implementation to an abstract Optional class with two subclasses, one > for the EMPTY and another for the not-empty (present) values without > breaking compatibility. Something like this: > > ********************** > > public abstract class Optional { > > private static final Optional EMPTY=new Empty<>(); > > private static class Empty > extends Optional { > > @Override > public boolean isPresent() { > return false; > } > @Override > public T get() { > throw new NoSuchElementException("No value present"); > } > @Override > public void ifPresent(Consumer consumer) { > } > // and so on > } > > private static class Present > extends Optional { > > private final T value; > > Present(T value) { > this.value=Objects.requireNonNull(value); > } > > @Override > public boolean isPresent() { > return true; > } > @Override > public T get() { > return value; > } > @Override > public void ifPresent(Consumer consumer) { > consumer.accept(value); > } > // and so on > } > > private Optional() {} > > public static Optional of(T value) { > return new Present<>(value); > } > > public static Optional ofNullable(T value) { > return value==null? empty(): new Present<>(value); > } > > @SuppressWarnings("unchecked") > public static Optional empty(){ > return (Optional)EMPTY; > } > > public abstract boolean isPresent(); > > public abstract T get(); > > public abstract void ifPresent(Consumer consumer); > > // and so on > } > ******************** > > The JVM probably optimizes and throws away the null checks yielding in > equal performance compared to the proposed implementation (above) ---I > haven't done any performance tests----, but why wait for the JVM when > this implementation is also nicer to read? What do you think? > > Please let me know if this is not the appropriate mailing list to post > this message, > Thanks, > Nicolas From david.holmes at oracle.com Wed Oct 29 12:25:50 2014 From: david.holmes at oracle.com (David Holmes) Date: Wed, 29 Oct 2014 22:25:50 +1000 Subject: java.util.Optional: a better implementation? In-Reply-To: <5450D83A.1080809@gmail.com> References: <5450D83A.1080809@gmail.com> Message-ID: <5450DCCE.4080501@oracle.com> Nicolas, core-libs-dev is the right mailing list for this so I've cc'd it. Please drop the discuss list from any follow up. David On 29/10/2014 10:06 PM, nicarran at gmail.com wrote: > Hi, > > I'm evaluating java.util.Optional to use it all around my code. I > noticed that its current implementation checks for null on almost every > method and that these checks can be avoided by changing its > implementation to an abstract Optional class with two subclasses, one > for the EMPTY and another for the not-empty (present) values without > breaking compatibility. Something like this: > > ********************** > > public abstract class Optional { > > private static final Optional EMPTY=new Empty<>(); > > private static class Empty > extends Optional { > > @Override > public boolean isPresent() { > return false; > } > @Override > public T get() { > throw new NoSuchElementException("No value present"); > } > @Override > public void ifPresent(Consumer consumer) { > } > // and so on > } > > private static class Present > extends Optional { > > private final T value; > > Present(T value) { > this.value=Objects.requireNonNull(value); > } > > @Override > public boolean isPresent() { > return true; > } > @Override > public T get() { > return value; > } > @Override > public void ifPresent(Consumer consumer) { > consumer.accept(value); > } > // and so on > } > > private Optional() {} > > public static Optional of(T value) { > return new Present<>(value); > } > > public static Optional ofNullable(T value) { > return value==null? empty(): new Present<>(value); > } > > @SuppressWarnings("unchecked") > public static Optional empty(){ > return (Optional)EMPTY; > } > > public abstract boolean isPresent(); > > public abstract T get(); > > public abstract void ifPresent(Consumer consumer); > > // and so on > } > ******************** > > The JVM probably optimizes and throws away the null checks yielding in > equal performance compared to the proposed implementation (above) ---I > haven't done any performance tests----, but why wait for the JVM when > this implementation is also nicer to read? What do you think? > > Please let me know if this is not the appropriate mailing list to post > this message, > Thanks, > Nicolas > From Alan.Bateman at oracle.com Wed Oct 29 12:36:13 2014 From: Alan.Bateman at oracle.com (Alan Bateman) Date: Wed, 29 Oct 2014 12:36:13 +0000 Subject: java.util.Optional: a better implementation? In-Reply-To: <5450D83A.1080809@gmail.com> References: <5450D83A.1080809@gmail.com> Message-ID: <5450DF3D.1050705@oracle.com> On 29/10/2014 12:06, nicarran at gmail.com wrote: > : > > Please let me know if this is not the appropriate mailing list to post > this message, > core-libs-dev is the mailing list to bring up topics such as this. You might want to click through "value-based" link in the javadoc to see if your proposal fits with where Optional is going. -Alan