diff --git a/lsp/src/main/java/workspace/DAPWorkspaceManager.java b/lsp/src/main/java/workspace/DAPWorkspaceManager.java index 1cffb2a36..c856102dc 100644 --- a/lsp/src/main/java/workspace/DAPWorkspaceManager.java +++ b/lsp/src/main/java/workspace/DAPWorkspaceManager.java @@ -107,9 +107,6 @@ public class DAPWorkspaceManager * These are the only property names that can sensibly set via the DAP launch. */ private static List propertyNames = Arrays.asList( - "vdmj.annotations.packages", - "vdmj.annotations.debug", - "vdmj.mapping.search_path", "vdmj.scheduler.fcfs_timeslice", "vdmj.scheduler.virtual_timeslice", "vdmj.scheduler.jitter", @@ -284,7 +281,7 @@ private void processSettings(DAPRequest request) } } - // System properties above override those from the properties file + // System properties above override those from any properties file Diag.info("Reading properties from %s", LSPWorkspaceManager.PROPERTIES); Properties.init(LSPWorkspaceManager.PROPERTIES); } diff --git a/vdmj/src/main/java/com/fujitsu/vdmj/syntax/SyntaxReader.java b/vdmj/src/main/java/com/fujitsu/vdmj/syntax/SyntaxReader.java index db259b3dd..f402199da 100644 --- a/vdmj/src/main/java/com/fujitsu/vdmj/syntax/SyntaxReader.java +++ b/vdmj/src/main/java/com/fujitsu/vdmj/syntax/SyntaxReader.java @@ -88,6 +88,7 @@ public abstract class SyntaxReader /** The maximum number of syntax errors allowed in one Reader. */ private static final int MAX = 100; + /** A list of class names from the vdmj.annotations resource file */ private static List annotationClasses = null; /** @@ -408,13 +409,16 @@ private ASTAnnotation readAnnotation(LexTokenReader ltr) throws LexException, Pa protected void trailingAnnotationCheck() throws LexException, ParserException { - ASTAnnotationList trailing = readAnnotations(getComments()); - - if (!trailing.isEmpty()) + if (getErrorCount() == 0) // Avoid confusing annotation warnings, if spec invalid { - for (ASTAnnotation annotation: trailing) + ASTAnnotationList trailing = readAnnotations(getComments()); + + if (!trailing.isEmpty()) { - warning(5038, "Trailing annotation ignored: " + annotation, annotation.name.location); + for (ASTAnnotation annotation: trailing) + { + warning(5038, "Trailing annotation ignored: " + annotation, annotation.name.location); + } } } } @@ -832,24 +836,21 @@ protected ASTAnnotation loadAnnotation(LexIdentifierToken name) * annotations to be in any package, though the ASTAnnotation rule remains. */ - if (annotationClasses != null) + for (String annotationClass: annotationClasses) { - for (String annotationClass: annotationClasses) + try { - try + if (annotationClass.endsWith("." + astName)) { - if (annotationClass.endsWith("." + astName)) - { - Class clazz = Class.forName(annotationClass); - Constructor ctor = clazz.getConstructor(LexIdentifierToken.class); - return (ASTAnnotation) ctor.newInstance(name); - } - } - catch (Exception e) - { - throwMessage(2334, "Failed to instantiate " + astName); + Class clazz = Class.forName(annotationClass); + Constructor ctor = clazz.getConstructor(LexIdentifierToken.class); + return (ASTAnnotation) ctor.newInstance(name); } } + catch (Exception e) + { + throwMessage(2334, "Failed to instantiate " + astName); + } } throwMessage(2334, "Cannot find " + astName + " on " + classpath); @@ -858,7 +859,7 @@ protected ASTAnnotation loadAnnotation(LexIdentifierToken name) protected LexCommentList getComments() { - return reader.getComments(); + return reader.getComments(); // Also clears comments } protected boolean isReserved(String name) diff --git a/vdmj/src/main/java/com/fujitsu/vdmj/tc/modules/TCExportAll.java b/vdmj/src/main/java/com/fujitsu/vdmj/tc/modules/TCExportAll.java index 3a5523097..bd99de6ba 100644 --- a/vdmj/src/main/java/com/fujitsu/vdmj/tc/modules/TCExportAll.java +++ b/vdmj/src/main/java/com/fujitsu/vdmj/tc/modules/TCExportAll.java @@ -27,7 +27,6 @@ import com.fujitsu.vdmj.lex.LexLocation; import com.fujitsu.vdmj.tc.definitions.TCDefinition; import com.fujitsu.vdmj.tc.definitions.TCDefinitionList; -import com.fujitsu.vdmj.tc.definitions.TCStateDefinition; import com.fujitsu.vdmj.tc.modules.visitors.TCImportExportVisitor; import com.fujitsu.vdmj.typechecker.Environment; @@ -47,7 +46,7 @@ public TCDefinitionList getDefinition(TCDefinitionList actualDefs) for (TCDefinition d: actualDefs) { - if (!(d instanceof TCStateDefinition)) // Everything except state defs + // if (!(d instanceof TCStateDefinition)) // Everything except state defs { list.add(d); }