From 89d74d94c98ea0ba725f3da052fee7706f38c39c Mon Sep 17 00:00:00 2001 From: Alexey Tsvetkov Date: Mon, 29 Sep 2014 17:44:03 +0400 Subject: [PATCH] JS backend: added @NotNull annotation to JsName's getIdent() --- .../src/com/google/dart/compiler/backend/js/ast/JsCatch.java | 2 +- .../google/dart/compiler/backend/js/ast/JsCatchScope.java | 2 +- .../src/com/google/dart/compiler/backend/js/ast/JsName.java | 5 ++++- .../src/com/google/dart/compiler/backend/js/ast/JsScope.java | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsCatch.java b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsCatch.java index 4cd48e11a02..cdc1d13f305 100644 --- a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsCatch.java +++ b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsCatch.java @@ -17,7 +17,7 @@ public class JsCatch extends SourceInfoAwareJsNode implements HasCondition { private JsExpression condition; private JsParameter param; - public JsCatch(JsScope parent, String ident) { + public JsCatch(JsScope parent, @NotNull String ident) { super(); assert (parent != null); scope = new JsCatchScope(parent, ident); diff --git a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsCatchScope.java b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsCatchScope.java index 671f4dd0daf..afa4115f641 100644 --- a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsCatchScope.java +++ b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsCatchScope.java @@ -13,7 +13,7 @@ import org.jetbrains.annotations.NotNull; public class JsCatchScope extends JsScope { private final JsName name; - public JsCatchScope(JsScope parent, String ident) { + public JsCatchScope(JsScope parent, @NotNull String ident) { super(parent, "Catch scope", null); name = new JsName(this, ident); } diff --git a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsName.java b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsName.java index b58099cd680..ab19d383c1b 100644 --- a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsName.java +++ b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsName.java @@ -13,16 +13,19 @@ import org.jetbrains.annotations.NotNull; */ public class JsName extends HasMetadata implements Symbol { private final JsScope enclosing; + + @NotNull private final String ident; /** * @param ident the unmangled ident to use for this name */ - JsName(JsScope enclosing, String ident) { + JsName(JsScope enclosing, @NotNull String ident) { this.enclosing = enclosing; this.ident = ident; } + @NotNull public String getIdent() { return ident; } diff --git a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsScope.java b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsScope.java index 01ddf652872..392d82db557 100644 --- a/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsScope.java +++ b/js/js.dart-ast/src/com/google/dart/compiler/backend/js/ast/JsScope.java @@ -166,7 +166,7 @@ public abstract class JsScope { } @NotNull - protected JsName doCreateName(String ident) { + protected JsName doCreateName(@NotNull String ident) { JsName name = new JsName(this, ident); names = Maps.put(names, ident, name); return name;