«ENDIF»
«IF augmentType !== null»
- @SuppressWarnings("unchecked")
+ @«SuppressWarnings.importedName»({ "unchecked", "checkstyle:methodTypeParameterName"})
«IF addOverride»@«Override.importedName»«ENDIF»
- public <E extends «augmentType.importedName»> E «AUGMENTABLE_AUGMENTATION_NAME»(«Class.importedName»<E> augmentationType) {
- return (E) «AUGMENTATION_FIELD».get(«CodeHelpers.importedName».nonNullValue(augmentationType, "augmentationType"));
+ public <E$$ extends «augmentType.importedName»> E$$ «AUGMENTABLE_AUGMENTATION_NAME»(«Class.importedName»<E$$> augmentationType) {
+ return (E$$) «AUGMENTATION_FIELD».get(«CodeHelpers.importedName».nonNullValue(augmentationType, "augmentationType"));
}
«ENDIF»
'''
CompilationTestUtils.cleanUp(sourcesOutputDir, compiledOutputDir);
}
+ @Test
+ public void testMdsal425() throws Exception {
+ final File sourcesOutputDir = CompilationTestUtils.generatorOutput("mdsal425");
+ final File compiledOutputDir = CompilationTestUtils.compilerOutput("mdsal425");
+ generateTestSources("/compilation/mdsal425", sourcesOutputDir);
+ CompilationTestUtils.testCompilation(sourcesOutputDir, compiledOutputDir);
+ CompilationTestUtils.cleanUp(sourcesOutputDir, compiledOutputDir);
+ }
+
private static void testReturnTypeIdentityref(final Class<?> clazz, final String methodName,
final String returnTypeStr) throws NoSuchMethodException {
Method method = clazz.getMethod(methodName);
--- /dev/null
+module mdsal425 {
+ namespace "urn:odl:mdsal425";
+ prefix mdsal425;
+
+ container e {
+
+ }
+}
+
/**
* Returns instance of augmentation.
*
- * @param augmentationType
- * Type of augmentation to be returned.
+ * @param augmentationType Type of augmentation to be returned.
+ * @param <E$$> Type capture for augmentation type
* @return instance of augmentation.
*/
- <E extends Augmentation<T>> @Nullable E augmentation(Class<E> augmentationType);
+ // E$$ is an identifier which cannot be generated from models.
+ @SuppressWarnings("checkstyle:methodTypeParameterName")
+ <E$$ extends Augmentation<T>> @Nullable E$$ augmentation(Class<E$$> augmentationType);
}