mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-03 03:55:51 +01:00
added missing default values to plugin.xml and module.xml
This commit is contained in:
@@ -101,6 +101,8 @@ import javax.xml.transform.TransformerFactory;
|
|||||||
import javax.xml.transform.dom.DOMSource;
|
import javax.xml.transform.dom.DOMSource;
|
||||||
import javax.xml.transform.stream.StreamResult;
|
import javax.xml.transform.stream.StreamResult;
|
||||||
|
|
||||||
|
import static javax.lang.model.util.ElementFilter.methodsIn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author Sebastian Sdorra
|
* @author Sebastian Sdorra
|
||||||
@@ -432,7 +434,7 @@ public final class ScmAnnotationProcessor extends AbstractProcessor
|
|||||||
//J-
|
//J-
|
||||||
descriptorElements.add(
|
descriptorElements.add(
|
||||||
new SubscriberElement(
|
new SubscriberElement(
|
||||||
clazz.toString(),
|
clazz.toString(),
|
||||||
param.asType().toString(),
|
param.asType().toString(),
|
||||||
desc
|
desc
|
||||||
)
|
)
|
||||||
@@ -538,6 +540,15 @@ public final class ScmAnnotationProcessor extends AbstractProcessor
|
|||||||
attributes.put(entry.getKey().getSimpleName().toString(),
|
attributes.put(entry.getKey().getSimpleName().toString(),
|
||||||
getValue(entry.getValue()));
|
getValue(entry.getValue()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add default values
|
||||||
|
for (ExecutableElement meth : methodsIn(am.getAnnotationType().asElement().getEnclosedElements())) {
|
||||||
|
String attribute = meth.getSimpleName().toString();
|
||||||
|
AnnotationValue defaultValue = meth.getDefaultValue();
|
||||||
|
if (defaultValue != null && !attributes.containsKey(attribute)) {
|
||||||
|
attributes.put(attribute, getValue(defaultValue));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user