auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) { if (e.getMessage() != null && e.getMessage() instanceof Position) { Position position = (Position) e.getMessage(); String uniqueId = Context.getDataManager().getDeviceById(position.getDeviceId()).getUniqueId(); StringBuilder s = new StringBuilder(); s.append(formatChannel(e.getChannel())).append(" "); s.append("id: ").append(uniqueId).append(", "); s.append("time: ").append( new SimpleDateFormat(Log.DATE_FORMAT).format(position.getFixTime())).append(", "); s.append("lat: ").append(String.format("%.5f", position.getLatitude())).append(", "); s.append("lon: ").append(String.format("%.5f", position.getLongitude())).append(", "); s.append("speed: ").append(String.format("%.1f", position.getSpeed())).append(", "); s.append("course: ").append(String.format("%.1f", position.getCourse())); if ((position.getAttributes().get(Event.KEY_RESULT) != null)) { s.append(", result: ").append(position.getAttributes().get(Event.KEY_RESULT)); } Log.info(s.toString()); Position lastPosition = Context.getConnectionManager().getLastPosition(position.getDeviceId()); if (lastPosition == null || position.getFixTime().compareTo(lastPosition.getFixTime()) > 0) { Context.getConnectionManager().updatePosition(position); } } }

Target:
public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) { if (e.getMessage() != null && e.getMessage() instanceof Position) { Position position = (Position) e.getMessage(); String uniqueId = Context.getDataManager().getDeviceById(position.getDeviceId()).getUniqueId(); StringBuilder s = new StringBuilder(); s.append(formatChannel(e.getChannel())).append(" "); s.append("id: ").append(uniqueId).append(", "); s.append("time: ").append( new SimpleDateFormat(Log.DATE_FORMAT).format(position.getFixTime())).append(", "); s.append("lat: ").append(String.format("%.5f", position.getLatitude())).append(", "); s.append("lon: ").append(String.format("%.5f", position.getLongitude())).append(", "); s.append("speed: ").append(String.format("%.1f", position.getSpeed())).append(", "); s.append("course: ").append(String.format("%.1f", position.getCourse())); Object cmdResult = position.getAttributes().get(Event.KEY_RESULT); if (cmdResult != null) { s.append(", result: ").append(cmdResult); } Log.info(s.toString()); Position lastPosition = Context.getConnectionManager().getLastPosition(position.getDeviceId()); if (lastPosition == null || position.getFixTime().compareTo(lastPosition.getFixTime()) > 0) { Context.getConnectionManager().updatePosition(position); } } }
Source:
public List<URL> getJobJarAndDependencies(ProgramOptions programOptions) throws FileNotFoundException, ProgramInvocationException { String entryPointClass = programOptions.getEntryPointClassName(); String jarFilePath = programOptions.getJarFilePath(); File jarFile = jarFilePath != null ? getJarFile(jarFilePath) : null; return PackagedProgram .getJobJarAndDependencies(jarFile != null ? jarFile : null, entryPointClass); }

Target:
private List<URL> getJobJarAndDependencies(ProgramOptions programOptions) throws CliArgsException { String entryPointClass = programOptions.getEntryPointClassName(); String jarFilePath = programOptions.getJarFilePath(); try { File jarFile = jarFilePath != null ? getJarFile(jarFilePath) : null; return PackagedProgram.getJobJarAndDependencies(jarFile, entryPointClass); } catch (FileNotFoundException | ProgramInvocationException e) { throw new CliArgsException("Could not get job jar and dependencies from JAR file: " + e.getMessage(), e); } }
Source:
public void init(StreamGraph streamGraph, Config config) { try { SamzaSqlApplicationConfig sqlConfig = new SamzaSqlApplicationConfig(config); QueryTranslator queryTranslator = new QueryTranslator(sqlConfig); try { Class.forName("org.apache.calcite.jdbc.Driver"); } catch (ClassNotFoundException e) { throw new SamzaException("Unable to load calcite jdbc driver"); } List<SamzaSqlQueryParser.QueryInfo> queries = sqlConfig.getQueryInfo(); for (SamzaSqlQueryParser.QueryInfo query : queries) { LOG.info("Translating the query to samza stream graph", query.getSelectQuery()); queryTranslator.translate(query, streamGraph); } } catch (Exception e) { LOG.error("SamzaSqlApplication threw exception.", e); throw e; } }

Target:
public void init(StreamGraph streamGraph, Config config) { try { SamzaSqlApplicationConfig sqlConfig = new SamzaSqlApplicationConfig(config); QueryTranslator queryTranslator = new QueryTranslator(sqlConfig); List<SamzaSqlQueryParser.QueryInfo> queries = sqlConfig.getQueryInfo(); for (SamzaSqlQueryParser.QueryInfo query : queries) { LOG.info("Translating the query to samza stream graph", query.getSelectQuery()); queryTranslator.translate(query, streamGraph); } } catch (RuntimeException e) { LOG.error("SamzaSqlApplication threw exception.", e); throw e; } }
Source:
public void saveUnretireProgram_shouldTestSaveUnretireProgram() { Program program = new Program(); Concept concept = Context.getConceptService().getAllConcepts().get(0); User user = Context.getUserService().getAllUsers().get(0); program.setConcept(concept); program.setDescription("test"); program.setName("programTest"); program.setCreator(user); List<Program> list = pws.getAllPrograms(); String uuid = program.getUuid(); pws.retireProgram(program, "abc"); pws.unretireProgram(program); Program program1 = dao.getProgramByUuid(uuid); assertEquals(program, program1); }

Target:
public void saveUnretireProgram_shouldTestSaveUnretireProgram() { Program program = new Program(); Concept concept = Context.getConceptService().getAllConcepts().get(0); User testUser = Context.getUserService().getAllUsers().get(0); program.setConcept(concept); program.setDescription("test"); program.setName("programTest"); program.setCreator(testUser); pws.getAllPrograms(); pws.retireProgram(program, "abc"); pws.unretireProgram(program); Program programToBeAsserted = dao.getProgramByUuid(program.getUuid()); assertEquals(program, programToBeAsserted); }
Source:
public List<VerbDefinition> matchingVerbDefinitions(Activity activity) { Set<VerbDefinition> candidates = Sets.newConcurrentHashSet(verbDefinitionSet); for( VerbDefinition verbDefinition : candidates ) { if( activity.getVerb().equals(verbDefinition.getValue())) { for( ObjectCombination criteria : verbDefinition.getObjects()) { if( filter(activity, criteria) == false ) { verbDefinition.getObjects().remove(criteria); } } } else { candidates.remove(verbDefinition); } if( verbDefinition.getObjects().size() == 0) candidates.remove(verbDefinition); } return Lists.newArrayList(candidates); }

Target:
public List<VerbDefinition> matchingVerbDefinitions(Activity activity) { Set<VerbDefinition> matches = Sets.newConcurrentHashSet(); for( VerbDefinition verbDefinition : verbDefinitionSet ) { VerbDefinition verbDefinitionCopy = SerializationUtil.cloneBySerialization(verbDefinition); if( activity.getVerb().equals(verbDefinition.getValue())) { for( ObjectCombination criteria : verbDefinitionCopy.getObjects()) { if( filter(activity, criteria) == false ) { verbDefinitionCopy.getObjects().remove(criteria); } } if( verbDefinitionCopy.getObjects().size() > 0) matches.add(verbDefinitionCopy); } } return Lists.newArrayList(matches); }
Source:
public void shouldCountWorkspacesInStatus() throws Exception { activityManager.countWorkspacesInStatus(WorkspaceStatus.STARTING, 0L); verify(workspaceActivityDao).countWorkspacesInStatus(eq(WorkspaceStatus.STARTING), eq(0L)); }

Target:
public void shouldCountWorkspacesInStatus() throws Exception { when(workspaceActivityDao.countWorkspacesInStatus(eq(WorkspaceStatus.STARTING), eq(0L))) .thenReturn(15L); long count = activityManager.countWorkspacesInStatus(WorkspaceStatus.STARTING, 0L); verify(workspaceActivityDao).countWorkspacesInStatus(eq(WorkspaceStatus.STARTING), eq(0L)); assertEquals(15L, count); }
Source:
public Connection createConnection(String queryString) throws SQLException, NoDriverFoundException { final Properties info = new Properties(); info.put("user", this.getUsername()); info.put("password", this.getPassword()); final String url = constructUrlForConnection(queryString); final Driver jdbcDriverInstance = getJdbcDriverInstance(); SQLException lastException = null; try { long start = System.currentTimeMillis(); while (System.currentTimeMillis() < start + (1000 * connectTimeoutSeconds) && isRunning()) { try { logger().debug("Trying to create JDBC connection using to with properties: {}", driver.getClass().getName(), url, info); return jdbcDriverInstance.connect(url, info); } catch (SQLException e) { lastException = e; Thread.sleep(1000L); } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } throw new SQLException("Could not create new connection", lastException); }

Target:
public Connection createConnection(String queryString) throws SQLException, NoDriverFoundException { final Properties info = new Properties(); info.put("user", this.getUsername()); info.put("password", this.getPassword()); final String url = constructUrlForConnection(queryString); final Driver jdbcDriverInstance = getJdbcDriverInstance(); SQLException lastException = null; try { long start = System.currentTimeMillis(); while (System.currentTimeMillis() < start + (1000 * connectTimeoutSeconds) && isRunning()) { try { logger().debug("Trying to create JDBC connection using to with properties: {}", driver.getClass().getName(), url, info); return jdbcDriverInstance.connect(url, info); } catch (SQLException e) { lastException = e; Thread.sleep(100L); } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } throw new SQLException("Could not create new connection", lastException); }
Source:
public void start() { supervisorTaskChecker = Execs.scheduledSingleThreaded("intermediary-data-manager-%d"); supervisorTaskChecker.scheduleAtFixedRate( () -> { for (StorageLocation location : intermediarySegmentsLocations) { final File[] dirsPerSupervisorTask = location.getPath().listFiles(); if (dirsPerSupervisorTask != null) { for (File supervisorTaskDir : dirsPerSupervisorTask) { final String supervisorTaskId = supervisorTaskDir.getName(); supervisorTaskCheckTimes.computeIfAbsent( supervisorTaskId, k -> DateTimes.nowUtc().plus(intermediaryPartitionTimeout) ); } } } }, intermediaryPartitionDiscoveryPeriodSec, intermediaryPartitionDiscoveryPeriodSec, TimeUnit.SECONDS ); supervisorTaskChecker.scheduleAtFixedRate( () -> { final DateTime now = DateTimes.nowUtc(); final Set<String> expiredSupervisorTasks = new HashSet<>(); for (Entry<String, DateTime> entry : supervisorTaskCheckTimes.entrySet()) { final String supervisorTaskId = entry.getKey(); final DateTime checkTime = entry.getValue(); if (checkTime.isAfter(now)) { expiredSupervisorTasks.add(supervisorTaskId); } } final Map<String, TaskStatus> taskStatuses = indexingServiceClient.getTaskStatuses(expiredSupervisorTasks); RuntimeException exception = null; for (Entry<String, TaskStatus> entry : taskStatuses.entrySet()) { final String supervisorTaskId = entry.getKey(); final TaskStatus status = entry.getValue(); if (status.getStatusCode().isComplete()) { try { deletePartitions(supervisorTaskId); } catch (IOException e) { if (exception == null) { exception = new RuntimeException(e); } else { exception.addSuppressed(e); } } } } if (exception != null) { throw exception; } }, intermediaryPartitionCleanupPeriodSec, intermediaryPartitionCleanupPeriodSec, TimeUnit.SECONDS ); }

Target:
public void start() { supervisorTaskChecker = Execs.scheduledSingleThreaded("intermediary-data-manager-%d"); supervisorTaskChecker.scheduleAtFixedRate( () -> { try { discoverSupervisorTaskPartitions(); } catch (Exception e) { log.warn(e, "Error while discovering supervisorTasks"); } }, intermediaryPartitionDiscoveryPeriodSec, intermediaryPartitionDiscoveryPeriodSec, TimeUnit.SECONDS ); supervisorTaskChecker.scheduleAtFixedRate( () -> { try { deleteExpiredSuprevisorTaskPartitionsIfNotRunning(); } catch (InterruptedException e) { log.error(e, "Error while cleaning up partitions for expired supervisors"); } catch (Exception e) { log.warn(e, "Error while cleaning up partitions for expired supervisors"); } }, intermediaryPartitionCleanupPeriodSec, intermediaryPartitionCleanupPeriodSec, TimeUnit.SECONDS ); }
Source:
public void load(GlowEnderman entity, CompoundTag compound) { super.load(entity, compound); final MaterialData[] carried = {null}; if (!compound.readShort("carried", id -> { Material type = Material.getMaterial(id); if (type != null && type != Material.AIR) { carried[0] = new MaterialData(type); } })) { compound.readString("carried", id -> { if (!id.isEmpty()) { if (!id.contains(":")) { id = "minecraft:" + id; } Material type = ItemIds.getBlock(id); if (type == null) { type = ItemIds.getItem(id); } if (type != null && type != Material.AIR) { carried[0] = new MaterialData(type); } } }); } if (carried[0] != null) { compound.readShort("carriedData", data -> carried[0].setData((byte) data)); entity.setCarriedMaterial(carried[0]); } }

Target:
public void load(GlowEnderman entity, CompoundTag compound) { super.load(entity, compound); compound.tryGetMaterial("carried") .map(MaterialData::new) .ifPresent(carried -> { compound.readShort("carriedData", data -> carried.setData((byte) data)); entity.setCarriedMaterial(carried); }); }
Source:
public static void main(String[] args) throws IOException { if (args.length != 1) usage("nassau-binaryfile-perf-test <input-file>"); String inputFilename = args[0]; MessageCounter counter = new MessageCounter(); BinaryFILEStatusListener statusListener = new BinaryFILEStatusListener() { @Override public void endOfSession() { } }; BinaryFILEStatusParser parser = new BinaryFILEStatusParser(counter, statusListener); double seconds; try (BinaryFILEReader reader = BinaryFILEReader.open(new File(inputFilename), parser)) { long started = System.nanoTime(); while (reader.read() >= 0); long finished = System.nanoTime(); seconds = (finished - started) / (1000.0 * 1000 * 1000); } long messages = counter.getMessageCount(); System.out.printf("Results:\n"); System.out.printf("\n"); System.out.printf(" Messages: %10d\n", messages); System.out.printf(" Time: %13.2f s\n", seconds); System.out.printf(" Throughput: %13.2f messages/s\n", messages / seconds); System.out.printf("\n"); }

Target:
public static void main(String[] args) throws IOException { if (args.length != 1) usage("nassau-binaryfile-perf-test <input-file>"); String inputFilename = args[0]; MessageCounter counter = new MessageCounter(); BinaryFILEStatusListener statusListener = new BinaryFILEStatusListener() { @Override public void endOfSession() { } }; BinaryFILEStatusParser parser = new BinaryFILEStatusParser(counter, statusListener); try (BinaryFILEReader reader = BinaryFILEReader.open(new File(inputFilename), parser)) { long started = System.nanoTime(); while (reader.read() >= 0); long finished = System.nanoTime(); double seconds = (finished - started) / (1000.0 * 1000 * 1000); long messages = counter.getMessageCount(); System.out.printf("Results:\n"); System.out.printf("\n"); System.out.printf(" Messages: %10d\n", messages); System.out.printf(" Time: %13.2f s\n", seconds); System.out.printf(" Throughput: %13.2f messages/s\n", messages / seconds); System.out.printf("\n"); } }
Source:
public boolean doesDependencyExist( String parameterName ) { return dependencyGraph .values() .stream() .flatMap( Set::stream ) .anyMatch( s -> s.compareTo( parameterName ) == 0 ); }

Target:
public boolean doesDependencyExist( String parameterName ) { return dependencyGraph .values() .stream() .flatMap( Set::stream ) .anyMatch( s -> s.equals( parameterName ) ); }
Source:
public RaptorSessionProperties(StorageManagerConfig config) { sessionProperties = ImmutableList.of( stringProperty( EXTERNAL_BATCH_ID, "Two-phase commit batch ID", null, true), dataSizeSessionProperty( READER_MAX_MERGE_DISTANCE, "Reader: Maximum size of gap between two reads to merge into a single read", config.getOrcMaxMergeDistance(), false), dataSizeSessionProperty( READER_MAX_READ_SIZE, "Reader: Maximum size of a single read", config.getOrcMaxReadSize(), false), dataSizeSessionProperty( READER_STREAM_BUFFER_SIZE, "Reader: Size of buffer for streaming reads", config.getOrcStreamBufferSize(), false), dataSizeSessionProperty( READER_TINY_STRIPE_THRESHOLD, "Reader: Threshold below which an ORC stripe or file will read in its entirety", config.getOrcTinyStripeThreshold(), false), booleanProperty( READER_LAZY_READ_SMALL_RANGES, "Experimental: Reader: Read small file segments lazily", config.isOrcLazyReadSmallRanges(), false), integerProperty( ONE_SPLIT_PER_BUCKET_THRESHOLD, "Experimental: Maximum bucket count at which to produce multiple splits per bucket", config.getOneSplitPerBucketThreshold(), false), booleanProperty( ORC_ZSTD_JNI_DECOMPRESSION_ENABLED, "use JNI based std decompression for reading ORC files", config.isZstdJniDecompressionEnabled(), true), dataSizeSessionProperty( MAX_BUFFER_SIZE, "Max buffer size.", config.getMaxBufferSize(), false)); }

Target:
public RaptorSessionProperties(StorageManagerConfig config) { sessionProperties = ImmutableList.of( stringProperty( EXTERNAL_BATCH_ID, "Two-phase commit batch ID", null, true), dataSizeSessionProperty( READER_MAX_MERGE_DISTANCE, "Reader: Maximum size of gap between two reads to merge into a single read", config.getOrcMaxMergeDistance(), false), dataSizeSessionProperty( READER_MAX_READ_SIZE, "Reader: Maximum size of a single read", config.getOrcMaxReadSize(), false), dataSizeSessionProperty( READER_STREAM_BUFFER_SIZE, "Reader: Size of buffer for streaming reads", config.getOrcStreamBufferSize(), false), dataSizeSessionProperty( READER_TINY_STRIPE_THRESHOLD, "Reader: Threshold below which an ORC stripe or file will read in its entirety", config.getOrcTinyStripeThreshold(), false), booleanProperty( READER_LAZY_READ_SMALL_RANGES, "Experimental: Reader: Read small file segments lazily", config.isOrcLazyReadSmallRanges(), false), integerProperty( ONE_SPLIT_PER_BUCKET_THRESHOLD, "Experimental: Maximum bucket count at which to produce multiple splits per bucket", config.getOneSplitPerBucketThreshold(), false), booleanProperty( ORC_ZSTD_JNI_DECOMPRESSION_ENABLED, "use JNI based std decompression for reading ORC files", config.isZstdJniDecompressionEnabled(), true), dataSizeSessionProperty( WRITER_MAX_BUFFER_SIZE, "Raptor page writer max buffer size", config.getMaxBufferSize(), false)); }
Source:
public Extended80211Payload(final ByteBuf buffer) throws InvalidPacketException { this.ciphersuite = new CipherSuite(buffer); this.data = new Opaque(buffer, Optional.empty(), buffer1 -> Opaque.parseBytes(buffer1)); }

Target:
public Extended80211Payload(final ByteBuf buffer) throws InvalidPacketException { this.ciphersuite = new CipherSuite(buffer); this.data = new Opaque(buffer, Optional.empty(), Opaque::parseBytes); }
Source:
public void jjtClose() { if (beginLine == -1 && (children == null || children.length == 0)) { beginColumn = parser.token.beginColumn; } if (beginLine == -1) { beginLine = parser.token.beginLine; } endLine = parser.token.endLine; endColumn = parser.token.endColumn; if (endLine < beginLine) { beginLine = endLine; beginColumn = endColumn; } if (endLine == beginLine && endColumn < beginColumn) { beginColumn = endColumn; } }

Target:
public void jjtClose() { if (parser.token.next == jjtGetFirstToken()) { Token next = parser.token.next; Token implicit = new Token(IMPLICIT_TOKEN, ""); implicit.beginColumn = next.beginColumn; implicit.endColumn = next.beginColumn - 1; implicit.beginLine = next.beginLine; implicit.endLine = next.beginLine; implicit.next = next; if (next.specialToken != null) { next.specialToken.next = implicit; implicit.specialToken = next.specialToken; } next.specialToken = implicit; jjtSetFirstToken(implicit); jjtSetLastToken(implicit); } }
Source:
public RunLengthEncodedBlock(Block value, int positionCount) { requireNonNull(value, "value is null"); if (value.getPositionCount() != 1) { throw new IllegalArgumentException(format("Expected value to contain a single position but has %s positions", value.getPositionCount())); } if (value instanceof RunLengthEncodedBlock) { throw new IllegalArgumentException(format("Value can not be an instance of a %s", getClass().getName())); } if (positionCount < 0) { throw new IllegalArgumentException("positionCount is negative"); } this.value = value this.positionCount = positionCount; }

Target:
public RunLengthEncodedBlock(Block value, int positionCount) { requireNonNull(value, "value is null"); if (value.getPositionCount() != 1) { throw new IllegalArgumentException(format("Expected value to contain a single position but has %s positions", value.getPositionCount())); } if (value instanceof RunLengthEncodedBlock) { this.value = ((RunLengthEncodedBlock) value).getValue(); } else { this.value = value; } if (positionCount < 0) { throw new IllegalArgumentException("positionCount is negative"); } this.positionCount = positionCount; }
Source:
public static boolean isDefaultClient(ClientRegistration clientRegistration) { return AADWebAppConfiguration.AZURE_CLIENT_REGISTRATION_ID.equals( clientRegistration.getClientName()); }

Target:
public static boolean isDefaultClient(ClientRegistration clientRegistration) { return AZURE_CLIENT_REGISTRATION_ID.equals( clientRegistration.getClientName()); }
Source:
public static APIQueryControlResult submitQuery(final Configuration configuration) throws IOException, InjectionException, URISyntaxException, StreamTypeMismatchException { final Injector injector = Tang.Factory.getTang().newInjector(configuration); final String source1Socket = injector.getNamedInstance(UnionLeftSourceAddress.class); final String source2Socket = injector.getNamedInstance(UnionRightSourceAddress.class); final TextSocketSourceConfiguration localTextSocketSource1Conf = MISTExampleUtils.getLocalTextSocketSourceConf(source1Socket); final TextSocketSourceConfiguration localTextSocketSource2Conf = MISTExampleUtils.getLocalTextSocketSourceConf(source2Socket); final TextSocketSinkConfiguration localTextSocketSinkConf = MISTExampleUtils.getLocalTextSocketSinkConf(); final MISTBiPredicate<String, String> joinPred = (s1, s2) -> s1.equals(s2); final ApplyStatefulFunction<Tuple2<String, String>, String> applyStatefulFunction = new CollectStringTupleState(); final MISTQueryBuilder queryBuilder = new MISTQueryBuilder(); final ContinuousStream sourceStream1 = queryBuilder.socketTextStream(localTextSocketSource1Conf); final ContinuousStream sourceStream2 = queryBuilder.socketTextStream(localTextSocketSource2Conf); sourceStream1 .join(sourceStream2, joinPred, new TimeWindowInformation(5000, 5000)) .applyStatefulWindow(applyStatefulFunction) .textSocketOutput(localTextSocketSinkConf); final MISTQuery query = queryBuilder.build(); return MISTExampleUtils.submit(query, configuration); }

Target:
public static APIQueryControlResult submitQuery(final Configuration configuration) throws IOException, InjectionException, URISyntaxException, StreamTypeMismatchException { final Injector injector = Tang.Factory.getTang().newInjector(configuration); final String source1Socket = injector.getNamedInstance(UnionLeftSourceAddress.class); final String source2Socket = injector.getNamedInstance(UnionRightSourceAddress.class); final TextSocketSourceConfiguration localTextSocketSource1Conf = MISTExampleUtils.getLocalTextSocketSourceConf(source1Socket); final TextSocketSourceConfiguration localTextSocketSource2Conf = MISTExampleUtils.getLocalTextSocketSourceConf(source2Socket); final TextSocketSinkConfiguration localTextSocketSinkConf = MISTExampleUtils.getLocalTextSocketSinkConf(); final MISTBiPredicate<String, String> joinPred = (s1, s2) -> s1.equals(s2); final ApplyStatefulFunction<Tuple2<String, String>, String> applyStatefulFunction = new FoldStringTupleFunction(); final MISTQueryBuilder queryBuilder = new MISTQueryBuilder(); final ContinuousStream sourceStream1 = queryBuilder.socketTextStream(localTextSocketSource1Conf); final ContinuousStream sourceStream2 = queryBuilder.socketTextStream(localTextSocketSource2Conf); sourceStream1 .join(sourceStream2, joinPred, new TimeWindowInformation(5000, 5000)) .applyStatefulWindow(applyStatefulFunction) .textSocketOutput(localTextSocketSinkConf); final MISTQuery query = queryBuilder.build(); return MISTExampleUtils.submit(query, configuration); }
Source:
private void populateSelectedIssues(Optional<TurboIssue> selectedIssue) { selectedIssues.getChildren().clear(); FlowPane selectedIssueCards = getSelectedIssuesPane(selectedIssue); if (!selectedIssueCards.getChildren().isEmpty()) { selectedIssues.getChildren().addAll(createRepoTitle(selectedIssue.get().getRepoId()), selectedIssueCards); } }

Target:
private void populateSelectedIssues(Optional<TurboIssue> selectedIssue) { selectedIssues.getChildren().clear(); FlowPane selectedIssueCards = getSelectedIssuesPane(selectedIssue); selectedIssue.ifPresent(issue -> selectedIssues.getChildren().addAll(createRepoTitle(issue.getRepoId()), selectedIssueCards)); }
Source:
public FileGenerator(String _filename) { filename = _filename; try { File file = new File(filename); FileInputStream in = new FileInputStream(file); reader = new BufferedReader(new InputStreamReader(in)); } catch(IOException e) { throw new RuntimeException(e); } }

Target:
public FileGenerator(String _filename) { filename = _filename; reloadFile(); }
Source:
private InvocationStage handleTxWriteCommand(InvocationContext ctx, AbstractDataWriteCommand command, Object key) throws Throwable { try { CacheEntry entry = ctx.lookupEntry(command.getKey()); if (entry == null) { if (isLocalModeForced(command) || command.hasFlag(Flag.SKIP_REMOTE_LOOKUP) || command.loadType() == VisitableCommand.LoadType.DONT_LOAD) { entryFactory.wrapExternalEntry(ctx, key, null, true, command.hasFlag(Flag.IGNORE_RETURN_VALUES)); } else { return invokeNextAsync(ctx, command, remoteGet(ctx, command, true)).handle( (rCtx, rCommand, rv, t) -> updateMatcherForRetry((WriteCommand) rCommand)); } } return invokeNext(ctx, command).handle((rCtx, rCommand, rv, t) -> updateMatcherForRetry((WriteCommand) rCommand)); } catch (Throwable t) { updateMatcherForRetry(command); throw t; } }

Target:
private BasicInvocationStage handleTxWriteCommand(InvocationContext ctx, AbstractDataWriteCommand command, Object key) throws Throwable { try { if (!ctx.isOriginLocal() && !cdl.localNodeIsOwner(command.getKey())) { return returnWith(null); } CacheEntry entry = ctx.lookupEntry(command.getKey()); if (entry == null) { if (isLocalModeForced(command) || command.hasFlag(Flag.SKIP_REMOTE_LOOKUP) || !needsPreviousValue(ctx, command)) { entryFactory.wrapExternalEntry(ctx, key, null, true); } else { return invokeNextAsync(ctx, command, remoteGet(ctx, command, command.getKey(), true)).handle( (rCtx, rCommand, rv, t) -> updateMatcherForRetry((WriteCommand) rCommand)); } } return invokeNext(ctx, command).handle((rCtx, rCommand, rv, t) -> updateMatcherForRetry((WriteCommand) rCommand)); } catch (Throwable t) { updateMatcherForRetry(command); throw t; } }
Source:
protected void onExportChanged() { boolean externalNetwork = (Boolean) getExport().getEntity(); getExternalProviders().setIsChangable(externalNetwork); getIsVmNetwork().setIsChangable(!externalNetwork && isSupportBridgesReportByVDSM()); getHasMtu().setIsChangable(!externalNetwork && isMTUOverrideSupported()); if (externalNetwork) { getIsVmNetwork().setEntity(true); getHasMtu().setEntity(false); } Iterable<NetworkClusterModel> networkClusters = getNetworkClusterList().getItems(); if (networkClusters != null) { for (NetworkClusterModel networkCluster : networkClusters) { if (!(Boolean) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.SupportCustomDeviceProperties, networkCluster.getEntity().getcompatibility_version().getValue())) { networkCluster.setIsChangable(!externalNetwork); networkCluster.setAttached(!externalNetwork); } networkCluster.setRequired(!externalNetwork); } } super.onExportChanged(); }

Target:
protected void onExportChanged() { boolean externalNetwork = (Boolean) getExport().getEntity(); getExternalProviders().setIsChangable(externalNetwork); getIsVmNetwork().setIsChangable(!externalNetwork && isSupportBridgesReportByVDSM()); if (externalNetwork) { getIsVmNetwork().setEntity(true); } Iterable<NetworkClusterModel> networkClusters = getNetworkClusterList().getItems(); if (networkClusters != null) { for (NetworkClusterModel networkCluster : networkClusters) { if (!(Boolean) AsyncDataProvider.getConfigValuePreConverted(ConfigurationValues.SupportCustomDeviceProperties, networkCluster.getEntity().getcompatibility_version().getValue())) { networkCluster.setIsChangable(!externalNetwork); networkCluster.setAttached(!externalNetwork); } networkCluster.setRequired(!externalNetwork); } } super.onExportChanged(); }
Source:
public void shouldCreateStandbyTask() { final MockProcessor mockProcessor = new MockProcessor(); internalTopologyBuilder.addSource(null, "source1", null, null, null, topic1); internalTopologyBuilder.addProcessor("processor1", () -> mockProcessor, "source1"); internalTopologyBuilder.addStateStore(new MockKeyValueStoreBuilder("myStore", true), "processor1"); final StreamThread.StandbyTaskCreator standbyTaskCreator = createStandbyTaskCreator(internalTopologyBuilder); final StandbyTask standbyTask = standbyTaskCreator.createTask( new MockConsumer<>(OffsetResetStrategy.EARLIEST), new TaskId(1, 2), Collections.emptySet()); assertThat(standbyTask, not(nullValue())); }

Target:
public void shouldCreateStandbyTask() { setupInternalTopologyWithoutState(); internalTopologyBuilder.addStateStore(new MockKeyValueStoreBuilder("myStore", true), "processor1"); final StandbyTask standbyTask = createStandbyTask(); assertThat(standbyTask, not(nullValue())); }
Source:
public ExchangeClientStatus getStatus() { int bufferedPages; synchronized (this) { bufferedPages = pageBuffer.size(); if (bufferedPages > 0 && pageBuffer.peekLast() == NO_MORE_PAGES) { bufferedPages--; } } ImmutableList.Builder<PageBufferClientStatus> exchangeStatus = ImmutableList.builder(); for (HttpPageBufferClient client : allClients.values()) { exchangeStatus.add(client.getStatus()); } return new ExchangeClientStatus(bufferBytes, maxBufferBytes, averageBytesPerRequest, successfulRequests, bufferedPages, noMoreLocations, exchangeStatus.build()); }

Target:
public ExchangeClientStatus getStatus() { ImmutableList.Builder<PageBufferClientStatus> pageBufferClientStatusBuilder = ImmutableList.builder(); for (HttpPageBufferClient client : allClients.values()) { pageBufferClientStatusBuilder.add(client.getStatus()); } List<PageBufferClientStatus> pageBufferClientStatus = pageBufferClientStatusBuilder.build(); synchronized (this) { int bufferedPages = pageBuffer.size(); if (bufferedPages > 0 && pageBuffer.peekLast() == NO_MORE_PAGES) { bufferedPages--; } return new ExchangeClientStatus(bufferBytes, maxBufferBytes, averageBytesPerRequest, successfulRequests, bufferedPages, noMoreLocations, pageBufferClientStatus); } }
Source:
public PermissionTypeColumn() { makeSortable(Comparator.comparing(p -> !resources.userImage().equals(p))); }

Target:
public PermissionTypeColumn() { makeSortable(Comparator.comparing(p -> !resources.userImage().equals(getValue(p)))); }
Source:
public String getDescription(String ruleKey) { ConnectedRuleDetails details = ruleDetails(ruleKey); if (details == null) { return null; } String extendedDescription = details.getExtendedDescription(); if (extendedDescription.isEmpty()) { return details.getHtmlDescription(); } return details.getHtmlDescription() + "<br/><br/>" + details.getExtendedDescription(); }

Target:
public String getDescription(String ruleKey) { ConnectedRuleDetails details = ruleDetails(ruleKey); if (details == null) { return null; } String extendedDescription = details.getExtendedDescription(); if (extendedDescription.isEmpty()) { return details.getHtmlDescription(); } return details.getHtmlDescription() + "<br/><br/>" + extendedDescription; }
Source:
public static String quote(String string) { if (string == null || string.length() == 0) { return "\"\""; } char c = 0; int i; int len = string.length(); StringBuilder sb = new StringBuilder(len + 4); String t; sb.append('"'); for (i = 0; i < len; i += 1) { c = string.charAt(i); switch (c) { case '\\': case '"': case '/': sb.append('\\'); sb.append(c); break; case '\b': sb.append("\\b"); break; case '\t': sb.append("\\t"); break; case '\n': sb.append("\\n"); break; case '\f': sb.append("\\f"); break; case '\r': sb.append("\\r"); break; default: if (c < ' ') { t = "000" + Integer.toHexString(c); sb.append("\\u" + t.substring(t.length() - 4)); } else { sb.append(c); } } } sb.append('"'); return sb.toString(); }

Target:
private static String quote(String string) { if (string == null || string.length() == 0) { return "\"\""; } char c; int i; int len = string.length(); StringBuilder sb = new StringBuilder(len + 4); String t; sb.append('"'); for (i = 0; i < len; i += 1) { c = string.charAt(i); switch (c) { case '\\': case '"': case '/': sb.append('\\'); sb.append(c); break; case '\b': sb.append("\\b"); break; case '\t': sb.append("\\t"); break; case '\n': sb.append("\\n"); break; case '\f': sb.append("\\f"); break; case '\r': sb.append("\\r"); break; default: if (c < ' ') { t = "000" + Integer.toHexString(c); sb.append("\\u" + t.substring(t.length() - 4)); } else { sb.append(c); } } } sb.append('"'); return sb.toString(); }
Source:
public void testFastTransformArguments() { List<IllegalArgumentException> exc = new ArrayList<>(); double[] slopes = new double[] { -1.0, ((double)Integer.MAX_VALUE) + 1, 1e-10 }; for (double slope: slopes) { try { System.out.println(slope); new TmfTimestampTransformLinearFast(slope, 0.0); } catch (IllegalArgumentException e) { exc.add(e); } } System.out.println(exc); assertEquals(3, exc.size()); }

Target:
public void testFastTransformArguments() { List<IllegalArgumentException> exc = new ArrayList<>(); double[] slopes = new double[] { -1.0, ((double)Integer.MAX_VALUE) + 1, 1e-10 }; for (double slope: slopes) { try { new TmfTimestampTransformLinearFast(slope, 0.0); } catch (IllegalArgumentException e) { exc.add(e); } } assertEquals(3, exc.size()); }
Source:
void registerCapability(RegistrationParams params) { params.getRegistrations().forEach(reg -> { if ("workspace/didChangeWorkspaceFolders".equals(reg.getMethod())) { supportWorkspaceFoldersCapability = true; } else if ("workspace/executeCommand".equals(reg.getMethod())) { Gson gson = new Gson(); ExecuteCommandOptions executeCommandOptions = gson.fromJson((JsonObject) reg.getRegisterOptions(), ExecuteCommandOptions.class); List<String> newCommands = executeCommandOptions.getCommands(); if (!newCommands.isEmpty()) { registerCommands(newCommands); String regId = reg.getId(); synchronized (dynamicRegistrations) { Assert.isLegal(!dynamicRegistrations.containsKey(regId)); dynamicRegistrations.put(regId, () -> { unregisterCommands(newCommands); }); } } } }); }

Target:
void registerCapability(RegistrationParams params) { params.getRegistrations().forEach(reg -> { if ("workspace/didChangeWorkspaceFolders".equals(reg.getMethod())) { Assert.isNotNull(serverCapabilities, "Dynamic capability registration failed! Server not yet initialized?"); Assert.isLegal(!supportsWorkspaceFolders(serverCapabilities), "Can't enable workspaceFolders dynamically because it was already enabled on initialization"); onUnregistration(reg, () -> enableWorkspaceFolders(serverCapabilities, false)); enableWorkspaceFolders(serverCapabilities, true); } else if ("workspace/executeCommand".equals(reg.getMethod())) { Gson gson = new Gson(); ExecuteCommandOptions executeCommandOptions = gson.fromJson((JsonObject) reg.getRegisterOptions(), ExecuteCommandOptions.class); List<String> newCommands = executeCommandOptions.getCommands(); if (!newCommands.isEmpty()) { onUnregistration(reg, () -> unregisterCommands(newCommands)); registerCommands(newCommands); } } }); }
Source:
public PlannedServiceBundle(){ plannedItems = new ArrayList<>(); orgUnits = new ArrayList<>(); programs = new ArrayList<>(); }

Target:
public PlannedServiceBundle(){ }
Source:
public static final SmsManager getDefault() { return new SmsManager(); }

Target:
public static final SmsManager getDefault() { if (sInstance == null) { sInstance = new SmsManager(); } return sInstance; }
Source:
private boolean hardDelete() throws StoreException { if (indexes.size() > 0) { final Timer.Context context = metrics.hardDeleteTime.time(); try { FindInfo info = findDeletedEntriesSince(startToken, scanSizeInBytes, SystemTime.getInstance().seconds() - messageRetentionSeconds); endToken = info.getFindToken(); pruneHardDeleteRecoveryRange(); if (!endToken.equals(startToken)) { if (!info.getMessageEntries().isEmpty()) { performHardDeletes(info.getMessageEntries()); } startToken = endToken; return true; } } catch (StoreException e) { if (e.getErrorCode() != StoreErrorCodes.Store_Shutting_Down) { metrics.hardDeleteExceptionsCount.inc(); } throw e; } finally { context.stop(); } } return false; }

Target:
protected boolean hardDelete() throws StoreException { if (indexes.size() > 0) { final Timer.Context context = metrics.hardDeleteTime.time(); try { FindInfo info = findDeletedEntriesSince(startToken, scanSizeInBytes, time.seconds() - messageRetentionSeconds); endToken = info.getFindToken(); pruneHardDeleteRecoveryRange(); if (!endToken.equals(startToken)) { if (!info.getMessageEntries().isEmpty()) { performHardDeletes(info.getMessageEntries()); } startToken = endToken; return true; } } catch (StoreException e) { if (e.getErrorCode() != StoreErrorCodes.Store_Shutting_Down) { metrics.hardDeleteExceptionsCount.inc(); } throw e; } finally { context.stop(); } } return false; }
Source:
public void testSubscribeMessages(TestHarness th) throws IOException { DataEncoder dataEncoder = new DataEncoder("Conv-BEB"); dataEncoder.putStart(14, "event"); dataEncoder.put(13, "name", "Query"); dataEncoder.putStart(15, "subscriptions"); dataEncoder.put(10, "battery", "CurrentStateOnly"); dataEncoder.put(10, "wifi_status", "CurrentStateOnly"); dataEncoder.put(10, "network_status", "CurrentStateOnly"); dataEncoder.putEnd(15, "subscriptions"); dataEncoder.putEnd(14, "event"); byte[] sendData = dataEncoder.getData(); client.send(sendData, 0, sendData.length); LocalMessageProtocolMessage msg = client.newMessage(null); client.receive(msg); byte[] clientData = msg.getData(); DataDecoder dataDecoder = new DataDecoder("Conv-BEB", clientData, 0, clientData.length); dataDecoder.getStart(14); th.check(dataDecoder.getString(13).equals("Query")); th.check(dataDecoder.getString(10).equals("OK")); dataDecoder.getStart(15); while (dataDecoder.listHasMoreItems()) { String name = dataDecoder.getName(); if (name.equals("battery")) { dataDecoder.getStart(14); th.check(dataDecoder.getInteger(2) == 1); th.check(dataDecoder.getBoolean() == true); dataDecoder.getEnd(14); } else if (name.equals("network_status")) { dataDecoder.getStart(14); th.check(dataDecoder.getString(10).equals("")); dataDecoder.getEnd(14); } else if (name.equals("wifi_status")) { dataDecoder.getStart(14); th.check(dataDecoder.getBoolean() == true); dataDecoder.getEnd(14); } } dataDecoder.getEnd(15); }

Target:
public void testSubscribeMessages(TestHarness th) throws IOException { DataEncoder dataEncoder = new DataEncoder("Conv-BEB"); dataEncoder.putStart(14, "event"); dataEncoder.put(13, "name", "Query"); dataEncoder.putStart(15, "subscriptions"); dataEncoder.put(10, "battery", "CurrentStateOnly"); dataEncoder.put(10, "wifi_status", "CurrentStateOnly"); dataEncoder.put(10, "network_status", "CurrentStateOnly"); dataEncoder.putEnd(15, "subscriptions"); dataEncoder.putEnd(14, "event"); byte[] sendData = dataEncoder.getData(); client.send(sendData, 0, sendData.length); LocalMessageProtocolMessage msg = client.newMessage(null); client.receive(msg); byte[] clientData = msg.getData(); DataDecoder dataDecoder = new DataDecoder("Conv-BEB", clientData, 0, clientData.length); dataDecoder.getStart(14); th.check(dataDecoder.getString(13), "Query"); th.check(dataDecoder.getString(10), "OK"); dataDecoder.getStart(15); while (dataDecoder.listHasMoreItems()) { String name = dataDecoder.getName(); if (name.equals("battery")) { dataDecoder.getStart(14); th.check(dataDecoder.getInteger(2), 1); th.check(dataDecoder.getBoolean(), true); dataDecoder.getEnd(14); } else if (name.equals("network_status")) { dataDecoder.getStart(14); th.check(dataDecoder.getString(10), ""); dataDecoder.getEnd(14); } else if (name.equals("wifi_status")) { dataDecoder.getStart(14); th.check(dataDecoder.getBoolean(), true); dataDecoder.getEnd(14); } } dataDecoder.getEnd(15); }
Source:
private String getResult(RefUpdateElement element) { StringBuffer result = new StringBuffer(EMPTY_STRING); PushOperationResult pushOperationResult = element .getPushOperationResult(); Set<URIish> urIs = pushOperationResult.getURIs(); for (URIish uri : urIs) { result.append(UIText.PushResultTable_repository); result.append(SPACE); result.append(uri.toString()); result.append(NEWLINE); result.append(NEWLINE); String message = element.getRemoteRefUpdate(uri).getMessage(); if (message != null) { result.append(message); result.append(NEWLINE); } StringBuffer messagesBuffer = new StringBuffer(pushOperationResult .getPushResult(uri).getMessages()); trim(messagesBuffer); result.append(messagesBuffer); } return result.toString(); }

Target:
private String getResult(RefUpdateElement element) { StringBuilder result = new StringBuilder(EMPTY_STRING); PushOperationResult pushOperationResult = element .getPushOperationResult(); Set<URIish> urIs = pushOperationResult.getURIs(); Iterator<URIish> iterator = urIs.iterator(); while(iterator.hasNext()) { boolean lineBreakNeeded = false; URIish uri = iterator.next(); result.append(UIText.PushResultTable_repository); result.append(SPACE); result.append(uri.toString()); result.append(Text.DELIMITER); result.append(Text.DELIMITER); String message = element.getRemoteRefUpdate(uri).getMessage(); if (message != null) { result.append(message); result.append(Text.DELIMITER); lineBreakNeeded = true; } StringBuilder messagesBuffer = new StringBuilder(pushOperationResult .getPushResult(uri).getMessages()); trim(messagesBuffer); if (messagesBuffer.length()>0) { result.append(messagesBuffer); result.append(Text.DELIMITER); lineBreakNeeded = true; } if (iterator.hasNext() && lineBreakNeeded) result.append(Text.DELIMITER); } trim(result); return result.toString(); }
Source:
private <T> T runWithHandle(ThrowingSupplier<T> supplier) throws TException { try { T t = supplier.get(); responseHandle.success(); return t; } catch (TException e) { responseHandle.failed(e); throw e; } }

Target:
private <T> T runWithHandle(ThrowingSupplier<T> supplier) throws TException { T t; try { t = supplier.get(); } catch (TException e) { responseHandle.failed(e); throw e; } responseHandle.success(); return t; }
Source:
private List<Course> getCourseEntities(List<String> courseIds) { if (courseIds.size() == 0) { return new ArrayList<Course>(); } Query q = getPM().newQuery(Course.class); q.setFilter(":p.contains(ID)"); @SuppressWarnings("unchecked") List<Course> courses = (List<Course>) q.execute(courseIds); return courses; }

Target:
private List<Course> getCourseEntities(List<String> courseIds) { if (courseIds.isEmpty()) { return new ArrayList<Course>(); } Query q = getPM().newQuery(Course.class); q.setFilter(":p.contains(ID)"); @SuppressWarnings("unchecked") List<Course> courses = (List<Course>) q.execute(courseIds); return courses; }
Source:
public void testDefaults() { ConfigAssertions.assertRecordedDefaults(ConfigAssertions.recordDefaults(ElasticsearchConnectorConfig.class) .setTableDescriptionDir(new File("etc/elasticsearch/")) .setDefaultSchema("default") .setTableNames("") .setScrollSize(1000) .setScrollTime(new Duration(20, TimeUnit.SECONDS)) .setMaxHits(1000000) .setRequestTimeout(new Duration(10, TimeUnit.SECONDS))); }

Target:
public void testDefaults() { assertRecordedDefaults(ConfigAssertions.recordDefaults(ElasticsearchConnectorConfig.class) .setTableDescriptionDir(new File("etc/elasticsearch/")) .setDefaultSchema("default") .setTableNames("") .setScrollSize(1000) .setScrollTimeout(new Duration(20, SECONDS)) .setMaxHits(1000000) .setRequestTimeout(new Duration(10, SECONDS))); }
Source:
public void renameFile() { LinkedFileRenameDialogView dialog = new LinkedFileRenameDialogView(this.linkedFile); String oldFile = this.linkedFile.getLink(); int nameCount = Paths.get(oldFile).getNameCount(); Path subPath = Paths.get(oldFile).subpath(0, nameCount - 1); Optional<LinkedFile> editedFile = dialog.showAndWait(); editedFile.ifPresent(file -> { String newFile = System.getProperty("file.separator") + subPath.toString() + System.getProperty("file.separator") + file.getLink(); this.linkedFile.setLink(newFile); FileUtil.renameFile(Paths.get(oldFile), Paths.get(newFile)); }); }

Target:
public void renameFile() { String oldFile = this.linkedFile.getLink(); Path oldFilePath = Paths.get(oldFile); Optional<String> editedFile = dialogService.showInputDialogWithDefaultAndWait(Localization.lang("Rename file"), Localization.lang("New Filename"), oldFilePath.getFileName().toString()); editedFile.ifPresent(file -> { Path newFile = Paths.get(oldFile).resolveSibling(file); this.linkedFile.setLink(newFile.toString()); FileUtil.renameFile(Paths.get(oldFile), newFile); }); }
Source:
private String getProviderNameReplacement() { return ReplacementUtils.getVariableAssignmentString(EngineMessage.NETWORK_ATTACHMENT_NOT_EXISTS, provider.getName()); }

Target:
private String getProviderNameReplacement() { return ReplacementUtils.getVariableAssignmentString(EngineMessage.ACTION_TYPE_FAILED_EXTERNAL_PROVIDER_IS_READ_ONLY, provider.getName()); }
Source:
LStat(int[] rawlstat) { ctimeSec = rawlstat[0]; ctimeNSec = rawlstat[1]; mtimeSec = rawlstat[2]; mtimeNSec = rawlstat[3]; device = rawlstat[4]; inode = rawlstat[5]; mode = FileMode.fromBits(rawlstat[6]); userId = rawlstat[7]; groupId = rawlstat[8]; size = rawlstat[9] + rawlstat[10] << 32; }

Target:
LStat(int[] rawlstat) { ctimeSec = rawlstat[0]; ctimeNSec = rawlstat[1]; mtimeSec = rawlstat[2]; mtimeNSec = rawlstat[3]; device = rawlstat[4]; inode = rawlstat[5]; mode = FileMode.fromBits(rawlstat[6]); userId = rawlstat[7]; groupId = rawlstat[8]; size = (((long) rawlstat[9]) << 32) + rawlstat[10]; }
Source:
public void open() throws InterpreterException { synchronized (this) { if (!isOpened) { for (Interpreter interpreter : getInterpreterGroup() .getOrCreateSession(this.getUserName(), sessionId)) { try { if (!(interpreter instanceof ConfInterpreter)) { ((RemoteInterpreter) interpreter).internal_create(); ((RemoteInterpreter) interpreter).internal_create(); } } catch (IOException e) { throw new InterpreterException(e); } } interpreterProcess.callRemoteFunction(client -> { LOGGER.info("Open RemoteInterpreter {}", getClassName()); synchronized (getInterpreterGroup()) { if (!getInterpreterGroup().isAngularRegistryPushed()) { pushAngularObjectRegistryToRemote(client); getInterpreterGroup().setAngularRegistryPushed(true); } } return null; }); isOpened = true; } } }

Target:
public void open() throws InterpreterException { synchronized (this) { if (!isOpened) { for (Interpreter interpreter : getInterpreterGroup() .getOrCreateSession(this.getUserName(), sessionId)) { try { if (!(interpreter instanceof ConfInterpreter)) { ((RemoteInterpreter) interpreter).internal_create(); } } catch (IOException e) { throw new InterpreterException(e); } } interpreterProcess.callRemoteFunction(client -> { LOGGER.info("Open RemoteInterpreter {}", getClassName()); synchronized (getInterpreterGroup()) { if (!getInterpreterGroup().isAngularRegistryPushed()) { pushAngularObjectRegistryToRemote(client); getInterpreterGroup().setAngularRegistryPushed(true); } } return null; }); isOpened = true; } } }