[JBoss JIRA] Created: (DNA-172) Java sequencer code has problem with package annotations
by Randall Hauch (JIRA)
Java sequencer code has problem with package annotations
--------------------------------------------------------
Key: DNA-172
URL: http://jira.jboss.com/jira/browse/DNA-172
Project: DNA
Issue Type: Bug
Components: Sequencers
Reporter: Randall Hauch
Assigned To: Serge Emmanuel Pagop
Fix For: 0.2
The "dna-sequencer-java" project has an "MySource.java" source file in the "src/test/resources/org/acme" that is used in some of the tests. Because the "src/test/resources" folder is considered a source folder (at least within the Eclipse project), the Eclipse compiler is compiling this class and generating this error:
MySource.java line 22: Package annotations must be in file package-info.java
Maven is okay, probably because the "src/test/resources" folder is not considered source and is not compiled (although the contents are added to the classpath for tests). However, if this code is intended to be a valid and well-formed example, then the package annotation should go into a "package-info.java" file. This is considered a "strongly recommended" best practice by the Java Language Specification (http://java.sun.com/docs/books/jls/third_edition/html/packages.html#7.4.1.1):
"The manner in which this restriction is enforced must, of necessity, vary from implementation to implementation. The following scheme is strongly recommended for file-system-based implementations: The sole annotated package declaration, if it exists, is placed in a source file called package-info.java in the directory containing the source files for the package. This file does not contain the source for a class called package-info.java; indeed it would be illegal for it to do so, as package-info is not a legal identifier. Typically package-info.java contains only a package declaration, preceded immediately by the annotations on the package. While the file could technically contain the source code for one or more package-private classes, it would be very bad form.
"It is recommended that package-info.java, if it is present, take the place of package.html for javadoc and other similar documentation generation systems. If this file is present, the documentation generation tool should look for the package documentation comment immediately preceding the (possibly annotated) package declaration in package-info.java. In this way, package-info.java becomes the sole repository for package level annotations and documentation. If, in future, it becomes desirable to add any other package-level information, this file should prove a convenient home for this information. "
However, it is quite possible that this code is intentionally different from the best practice, in which case the test cases should probably also have other examples of source that is not well-formed and invalid. Consequently, such test source should probably belong in folder that is not considered a source folder by Maven or Eclipse (or any other IDE in use).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 8 months
[JBoss JIRA] Created: (DNA-100) javadoc for org.jboss.dna.repository.sequencers.SequencerPathExpression should contain full explanation of syntax for path expressions
by Greg Haber (JIRA)
javadoc for org.jboss.dna.repository.sequencers.SequencerPathExpression should contain full explanation of syntax for path expressions
--------------------------------------------------------------------------------------------------------------------------------------
Key: DNA-100
URL: http://jira.jboss.com/jira/browse/DNA-100
Project: DNA
Issue Type: Bug
Components: Documentation
Affects Versions: 0.1
Reporter: Greg Haber
Priority: Minor
The javadoc for org.jboss.dna.repository.sequencer.SequencerPathExpression for version 0.1 (and also the trunk as of build 234) only has a brief example of a valid sequencer path expression. It should be revised to contain a complete description of the syntax for such path expressions.
Without such an explanation, user that want more detail than in the 0.1 getting started guide need to study the source for this class and the examples in org.jboss.dna.repository.sequencer.SequencerPathExpressionTest to determine syntax, which (for me at least) is non-trivial.
Once such an explanation is in place, the "for a more detailed explanation" text on the sequencing_service.html can link right to the javadoc.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 8 months
[JBoss JIRA] Created: (DNA-96) ValueFormatException should be replaced by existing JDK IllegalArgumentException and UnsupportedOperationException in ValueFactories
by Johnny Verhaeg (JIRA)
ValueFormatException should be replaced by existing JDK IllegalArgumentException and UnsupportedOperationException in ValueFactories
------------------------------------------------------------------------------------------------------------------------------------
Key: DNA-96
URL: http://jira.jboss.com/jira/browse/DNA-96
Project: DNA
Issue Type: Feature Request
Components: SPI
Affects Versions: 0.1
Reporter: Johnny Verhaeg
Fix For: 0.2
1) There may be a development situation where it is advantageous to know a passed-in path, segment, etc., is invalid (e.g., due to bad index value, character used, etc.) vs. a bad usage of the factory, such as trying to convert a Boolean value into a Date.
2) Non-ValueFactories classes that interact with the ValueFactories, such as BasicName, will need to throw IllegalArgumentException anyway when an invalid name is passed in, meaning the ValueFactories that interact with it would need to catch the IAE and re-throw as a ValueFormatException.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 8 months