Return-Path: X-Original-To: apmail-commons-commits-archive@minotaur.apache.org Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7D0F810B83 for ; Wed, 21 Aug 2013 12:07:10 +0000 (UTC) Received: (qmail 50020 invoked by uid 500); 21 Aug 2013 12:07:10 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 49865 invoked by uid 500); 21 Aug 2013 12:06:59 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 49858 invoked by uid 99); 21 Aug 2013 12:06:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Aug 2013 12:06:58 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Aug 2013 12:06:57 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 455B723888CD; Wed, 21 Aug 2013 12:06:37 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1516142 - /commons/proper/jci/trunk/compilers/eclipse/src/main/java/org/apache/commons/jci/compilers/EclipseJavaCompiler.java Date: Wed, 21 Aug 2013 12:06:37 -0000 To: commits@commons.apache.org From: sebb@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130821120637.455B723888CD@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sebb Date: Wed Aug 21 12:06:36 2013 New Revision: 1516142 URL: http://svn.apache.org/r1516142 Log: Document the isPackage() bug Fix one obvious case - package-info Modified: commons/proper/jci/trunk/compilers/eclipse/src/main/java/org/apache/commons/jci/compilers/EclipseJavaCompiler.java Modified: commons/proper/jci/trunk/compilers/eclipse/src/main/java/org/apache/commons/jci/compilers/EclipseJavaCompiler.java URL: http://svn.apache.org/viewvc/commons/proper/jci/trunk/compilers/eclipse/src/main/java/org/apache/commons/jci/compilers/EclipseJavaCompiler.java?rev=1516142&r1=1516141&r2=1516142&view=diff ============================================================================== --- commons/proper/jci/trunk/compilers/eclipse/src/main/java/org/apache/commons/jci/compilers/EclipseJavaCompiler.java (original) +++ commons/proper/jci/trunk/compilers/eclipse/src/main/java/org/apache/commons/jci/compilers/EclipseJavaCompiler.java Wed Aug 21 12:06:36 2013 @@ -297,6 +297,11 @@ public final class EclipseJavaCompiler e private boolean isPackage( final String pClazzName ) { + // reject this early as it is cheap + if (pClazzName.contains("-")) { // "-" is not valid in package names + return false; + } + final InputStream is = pClassLoader.getResourceAsStream(ConversionUtils.convertClassToResourcePath(pClazzName)); if (is != null) { log.debug("found the class for " + pClazzName + "- no package"); @@ -315,6 +320,13 @@ public final class EclipseJavaCompiler e return false; } + /* + * See https://issues.apache.org/jira/browse/JCI-59 + * At present, the code assumes that anything else is a package name + * This is wrong, as for example jci.AdditionalTopLevel is not a package name. + * It's not clear how to fix this in general. + * It would seem to need access to the input classpath and/or the generated classes. + */ return true; }