Skip to content

Commit 11f0e8a

Browse files
committed
Change AST.JLS09 to AST.JLS10
Signed-off-by: AndreSonntag <Andre-Sonntag@gmx.de>
1 parent 409884a commit 11f0e8a

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

  • plugins/de.cognicrypt.codegenerator/src/main/java/de/cognicrypt/codegenerator/generator

plugins/de.cognicrypt.codegenerator/src/main/java/de/cognicrypt/codegenerator/generator/CodeGenerator.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ protected boolean insertCallCodeIntoFile(final String temporaryOutputFile, final
132132
final TreeSet<SimpleEntry<Integer, Integer>> methLims = new TreeSet<>();
133133
final SimpleEntry<Integer, SimpleEntry<Integer, Integer>> classlims = new SimpleEntry<>(0, null);
134134

135-
final ASTParser astp = ASTParser.newParser(AST.JLS9);
135+
final ASTParser astp = ASTParser.newParser(AST.JLS10);
136136
astp.setSource(docContent.toCharArray());
137137
astp.setKind(ASTParser.K_COMPILATION_UNIT);
138138
final CompilationUnit cu = (CompilationUnit) astp.createAST(null);
@@ -325,23 +325,21 @@ memberPath, new File(this.project
325325
protected void cleanUpProject(IEditorPart editor) throws CoreException {
326326
this.project.refresh();
327327
final ICompilationUnit[] generatedCUnits = this.project.getPackagesOfProject(Constants.PackageNameAsName).getCompilationUnits();
328-
boolean noClassOpen = false;
329-
330-
if(editor == null) {
331-
if (generatedCUnits[0].getResource().getType() == IResource.FILE) {
328+
boolean anyFileOpen = false;
329+
330+
if(editor == null && generatedCUnits[0].getResource().getType() == IResource.FILE) {
332331
IFile genClass = (IFile) generatedCUnits[0].getResource();
333332
IDE.openEditor(Utils.getCurrentlyOpenPage(), genClass);
334333
editor = Utils.getCurrentlyOpenPage().getActiveEditor();
335-
noClassOpen = true;
336-
}
334+
anyFileOpen = true;
337335
}
338336

339337
final OrganizeImportsAction organizeImportsActionForAllFilesTouchedDuringGeneration = new OrganizeImportsAction(editor.getSite());
340338
final FormatAllAction faa = new FormatAllAction(editor.getSite());
341339
faa.runOnMultiple(generatedCUnits);
342340
organizeImportsActionForAllFilesTouchedDuringGeneration.runOnMultiple(generatedCUnits);
343341

344-
if (noClassOpen) {
342+
if (anyFileOpen) {
345343
Utils.closeEditor(editor);
346344
}
347345

0 commit comments

Comments
 (0)