import java.util.Map.Entry
import java.util.StringTokenizer
import java.util.regex.Pattern
+import org.gaul.modernizer_maven_annotations.SuppressModernizer
import org.opendaylight.mdsal.binding.model.api.ConcreteType
import org.opendaylight.mdsal.binding.model.api.Constant
import org.opendaylight.mdsal.binding.model.api.GeneratedProperty
import org.opendaylight.yangtools.yang.model.api.stmt.ModuleEffectiveStatement
import org.opendaylight.yangtools.yang.model.export.DeclaredStatementFormatter
+@SuppressModernizer
abstract class BaseTemplate extends JavaFileTemplate {
static final char NEW_LINE = '\n'
static final char SPACE = ' '
* @return string with comment in JAVA format
*/
def protected CharSequence asJavadoc(String comment) {
- if(comment === null) return ''
- var txt = comment
-
- txt = comment.trim
- txt = formatToParagraph(txt)
-
+ if (comment === null) {
+ return ''
+ }
return '''
- «wrapToDocumentation(txt)»
+ «wrapToDocumentation(formatToParagraph(comment.trim))»
'''
}
val StringTokenizer tokenizer = new StringTokenizer(formattedText, " ", true);
- while (tokenizer.hasMoreElements) {
- val nextElement = tokenizer.nextElement.toString
+ while (tokenizer.hasMoreTokens) {
+ val nextElement = tokenizer.nextToken
if (lineBuilder.length != 0 && lineBuilder.length + nextElement.length > 80) {
// FIXME: what tricks are we playing here? Equality probably does not trigger ever
sb.append(lineBuilder).append(NEW_LINE)
lineBuilder.setLength(0)
- if (nextElement.toString == ' ') {
+ if (nextElement == " ") {
isFirstElementOnNewLineEmptyChar = !isFirstElementOnNewLineEmptyChar;
}
}