src/jdk.jshell/share/classes/jdk/jshell/Eval.java
changeset 47975 5e86806f57f9
parent 47499 b3ea71b70f7b
child 48208 0a8db756a7e7
equal deleted inserted replaced
47974:9ec74010cadf 47975:5e86806f57f9
    57 import jdk.jshell.Key.TypeDeclKey;
    57 import jdk.jshell.Key.TypeDeclKey;
    58 import jdk.jshell.Snippet.Kind;
    58 import jdk.jshell.Snippet.Kind;
    59 import jdk.jshell.Snippet.SubKind;
    59 import jdk.jshell.Snippet.SubKind;
    60 import jdk.jshell.TaskFactory.AnalyzeTask;
    60 import jdk.jshell.TaskFactory.AnalyzeTask;
    61 import jdk.jshell.TaskFactory.BaseTask;
    61 import jdk.jshell.TaskFactory.BaseTask;
    62 import jdk.jshell.TaskFactory.CompileTask;
       
    63 import jdk.jshell.TaskFactory.ParseTask;
    62 import jdk.jshell.TaskFactory.ParseTask;
    64 import jdk.jshell.Wrap.CompoundWrap;
    63 import jdk.jshell.Wrap.CompoundWrap;
    65 import jdk.jshell.Wrap.Range;
    64 import jdk.jshell.Wrap.Range;
    66 import jdk.jshell.Snippet.Status;
    65 import jdk.jshell.Snippet.Status;
    67 import jdk.jshell.spi.ExecutionControl.ClassBytecodes;
    66 import jdk.jshell.spi.ExecutionControl.ClassBytecodes;
   452                     }
   451                     }
   453                     while (name == null || state.keyMap.doesVariableNameExist(name)) {
   452                     while (name == null || state.keyMap.doesVariableNameExist(name)) {
   454                         name = "$" + ++varNumber;
   453                         name = "$" + ++varNumber;
   455                     }
   454                     }
   456                 }
   455                 }
   457                 guts = Wrap.tempVarWrap(compileSource, typeName, name);
   456                 guts = Wrap.tempVarWrap(compileSource, ei.accessibleTypeName, name);
   458                 Collection<String> declareReferences = null; //TODO
   457                 Collection<String> declareReferences = null; //TODO
   459                 snip = new VarSnippet(state.keyMap.keyForVariable(name), userSource, guts,
   458                 snip = new VarSnippet(state.keyMap.keyForVariable(name), userSource, guts,
   460                         name, SubKind.TEMP_VAR_EXPRESSION_SUBKIND, typeName, declareReferences, null);
   459                         name, SubKind.TEMP_VAR_EXPRESSION_SUBKIND, typeName, declareReferences, null);
   461             } else {
   460             } else {
   462                 guts = Wrap.methodReturnWrap(compileSource);
   461                 guts = Wrap.methodReturnWrap(compileSource);