Permalink
Browse files

[RESOURCE-1] Javadoc generation fails under JDK 1.8

Add javadoc to clarify source of generated file.
  • Loading branch information...
julianhyde committed May 6, 2015
1 parent 6ac69b3 commit da5b2f203402324c68dd2eb2e5ce628f722fefbb
View
27 pom.xml
@@ -170,4 +170,31 @@
</plugins>
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<links>
<link>http://docs.oracle.com/javase/8/docs/api/</link>
</links>
<excludePackageNames>org.apache.calcite.sql.parser.impl</excludePackageNames>
<tags>
<tag>
<name>goal</name>
<placement>a</placement>
<head>Goal:</head>
</tag>
<tag>
<name>phase</name>
<placement>a</placement>
<head>Phase:</head>
</tag>
</tags>
</configuration>
</plugin>
</plugins>
</reporting>
</project>
@@ -30,6 +30,12 @@
* Defining wrapper classes around resources that allow the compiler to check
* whether the resources exist and have the argument types that your code
* expects.
*
* <p>If this class belongs to a package other than
* {@code net.hydromatic.resource}, it was probably generated by the Maven
* plugin (groupId: "net.hydromatic", artifactId:
* "hydromatic-resource-maven-plugin"). Code generation allows projects to use
* this resource library without adding a runtime dependency on another JAR.
*/
public class Resources {
private static final ThreadLocal<Locale> MAP_THREAD_TO_LOCALE =
@@ -38,8 +44,8 @@
private Resources() {}
/** Returns the preferred locale of the current thread, or
* the default locale if the current thread has not called {@link
* #setThreadLocale}.
* the default locale if the current thread has not called
* {@link #setThreadLocale}.
*
* @return Locale */
protected static Locale getThreadOrDefaultLocale() {
@@ -92,13 +98,20 @@ public Object invoke(Object proxy, Method method, Object[] args)
}
/** Applies all validations to all resource methods in the given
* resource object. */
* resource object.
*
* @param o Resource object to validate
*/
public static void validate(Object o) {
validate(o, EnumSet.allOf(Validation.class));
}
/** Applies the given validations to all resource methods in the given
* resource object. */
* resource object.
*
* @param o Resource object to validate
* @param validations Validations to perform
*/
public static void validate(Object o, EnumSet<Validation> validations) {
int count = 0;
for (Method method : o.getClass().getMethods()) {
@@ -457,8 +470,7 @@ public T ex() {
return ex(null);
}
@Override
public void validate(EnumSet<Validation> validations) {
@Override public void validate(EnumSet<Validation> validations) {
super.validate(validations);
if (validations.contains(Validation.CREATE_EXCEPTION)) {
validateException(
@@ -84,7 +84,8 @@
} catch (AssertionError e) {
assertThat(e.getMessage(),
startsWith(
"key 'OnlyInClass' not found for resource 'onlyInClass' in bundle 'java.util.PropertyResourceBundle@"));
"key 'OnlyInClass' not found for resource 'onlyInClass' in "
+ "bundle 'java.util.PropertyResourceBundle@"));
}
}

0 comments on commit da5b2f2

Please sign in to comment.