langtools/src/jdk.jshell/share/classes/jdk/jshell/Unit.java
changeset 42827 36468b5fa7f4
parent 40304 0318f4e75c6d
child 43134 006808ae5f6e
equal deleted inserted replaced
42826:563b42fc70ba 42827:36468b5fa7f4
   166                     .map(u -> u.snippet().key())
   166                     .map(u -> u.snippet().key())
   167                     .collect(toSet());
   167                     .collect(toSet());
   168             // Snippets to add to imports
   168             // Snippets to add to imports
   169             Collection<Snippet> plus = plusUnfiltered.stream()
   169             Collection<Snippet> plus = plusUnfiltered.stream()
   170                     .filter(u -> !units.contains(u))
   170                     .filter(u -> !units.contains(u))
   171                     .map(u -> u.snippet())
   171                     .map(Unit::snippet)
   172                     .collect(toList());
   172                     .collect(toList());
   173             // Snippets to wrap in an outer
   173             // Snippets to wrap in an outer
   174             List<Snippet> snippets = units.stream()
   174             List<Snippet> snippets = units.stream()
   175                     .map(u -> u.snippet())
   175                     .map(Unit::snippet)
   176                     .collect(toList());
   176                     .collect(toList());
   177             // Snippet wraps to wrap in an outer
   177             // Snippet wraps to wrap in an outer
   178             List<Wrap> wraps = units.stream()
   178             List<Wrap> wraps = units.stream()
   179                     .map(u -> u.activeGuts)
   179                     .map(u -> u.activeGuts)
   180                     .collect(toList());
   180                     .collect(toList());
   303     boolean doRedefines() {
   303     boolean doRedefines() {
   304         if (toRedefine.isEmpty()) {
   304         if (toRedefine.isEmpty()) {
   305             return true;
   305             return true;
   306         }
   306         }
   307         ClassBytecodes[] cbcs = toRedefine.stream()
   307         ClassBytecodes[] cbcs = toRedefine.stream()
   308                 .map(ci -> ci.toClassBytecodes())
   308                 .map(ClassInfo::toClassBytecodes)
   309                 .toArray(size -> new ClassBytecodes[size]);
   309                 .toArray(ClassBytecodes[]::new);
   310         try {
   310         try {
   311             state.executionControl().redefine(cbcs);
   311             state.executionControl().redefine(cbcs);
   312             state.classTracker.markLoaded(cbcs);
   312             state.classTracker.markLoaded(cbcs);
   313             return true;
   313             return true;
   314         } catch (ClassInstallException ex) {
   314         } catch (ClassInstallException ex) {