1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-24 17:35:35 +02:00

Bug 350242 - NullPointerException in creation of new class.

This commit is contained in:
Sergey Prigogin 2011-06-24 18:51:30 -07:00
parent 550496d56c
commit b5b6ad368e

View file

@ -467,9 +467,11 @@ public class NewClassCodeGenerator {
String body = constructMethodDeclarations(tu, publicMethods, protectedMethods,
privateMethods, lineDelimiter);
body = CodeGeneration.getClassBodyContent(tu, fClassName, body, lineDelimiter);
code.append(body);
if (!body.endsWith(lineDelimiter)) {
code.append(lineDelimiter);
if (body != null) {
code.append(body);
if (!body.endsWith(lineDelimiter)) {
code.append(lineDelimiter);
}
}
code.append("};"); //$NON-NLS-1$
return removeRedundantVisibilityLabels(code.toString());