auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void adjustOpeningAndClosingAndVisibleTimeForPrivateSessions() { if (getStartTime() == null) { setStartTime(getCreatedTime()); } if (getEndTime() == null) { setEndTime(TimeHelper.parseInstant("2118-01-01 12:00 AM +0000")); } if ("PRIVATE".equals(feedbackSessionType)) { setSessionVisibleFromTime(TimeHelper.parseInstant("2118-01-01 12:00 AM +0000")); } }

Target:
private void adjustOpeningAndClosingAndVisibleTimeForPrivateSessions() { if ("PRIVATE".equals(feedbackSessionType)) { setStartTime(TimeHelper.parseInstant("2118-01-01 12:00 AM +0000")); setSessionVisibleFromTime(Const.TIME_REPRESENTS_FOLLOW_OPENING); setEndTime(TimeHelper.parseInstant("2118-01-01 12:00 AM +0000")); } }
Source:
public void kill() throws IOException, InterruptedException { this.action("kill-server"); }

Target:
public void kill() throws IOException, InterruptedException { executeAdb("kill-server"); }
Source:
public void init() { this.addParameter("name", this.name); this.addParameter("context", this.context); this.addParameter("visibility", this.visibility); this.addParameter("version", this.version); this.addParameter("swagger", this.swagger); this.addParameter("tags", this.tags); this.addParameter("description", this.description); }

Target:
public void init() { this.addParameter("name", this.name); this.addParameter("context", this.context); this.addParameter("visibility", this.visibility); this.addParameter("version", this.version); this.addParameter("swagger", this.swagger); }
Source:
public NamedConfig setName(String name) { this.name = name; return this; }

Target:
public ClientReliableTopicConfig setName(String name) { this.name = name; return this; }
Source:
public Path rename(final Path pathToPomXML, final String newName, final String comment) { try { final org.uberfire.java.nio.file.Path projectDirectory = Paths.convert(pathToPomXML).getParent(); final org.uberfire.java.nio.file.Path newModulePath = projectDirectory.resolveSibling(newName); final POM content = pomService.load(pathToPomXML); if (newModulePath.equals(projectDirectory)) { return pathToPomXML; } if (ioService.exists(newModulePath)) { throw new FileAlreadyExistsException(newModulePath.toString()); } final Path oldModuleDir = Paths.convert(projectDirectory); final Module oldModule = resourceResolver.resolveModule(oldModuleDir); content.setName(newName); final Path newPathToPomXML = Paths.convert(newModulePath.resolve(POM_PATH)); try { ioService.startBatch(newModulePath.getFileSystem()); ioService.move(projectDirectory, newModulePath, commentedOptionFactory.makeCommentedOption(comment)); pomService.save(newPathToPomXML, content, null, comment); } catch (final Exception e) { throw e; } finally { final Module newModule = resourceResolver.resolveModule(Paths.convert(newModulePath)); renameModuleEvent.fire(new RenameModuleEvent(oldModule, newModule)); ioService.endBatch(); } invalidateDMOCache.fire(new InvalidateDMOModuleCacheEvent(sessionInfo, oldModule, oldModuleDir)); return newPathToPomXML; } catch (final Exception e) { throw ExceptionUtilities.handleException(e); } }

Target:
public Path rename(final Path pathToPomXML, final String newName, final String comment) { try { final org.uberfire.java.nio.file.Path projectDirectory = Paths.convert(pathToPomXML).getParent(); final org.uberfire.java.nio.file.Path newModulePath = projectDirectory.resolveSibling(newName); final POM content = pomService.load(pathToPomXML); if (newModulePath.equals(projectDirectory)) { return pathToPomXML; } if (ioService.exists(newModulePath)) { throw new FileAlreadyExistsException(newModulePath.toString()); } final Path oldModuleDir = Paths.convert(projectDirectory); final Module oldModule = resourceResolver.resolveModule(oldModuleDir); content.setName(newName); final Path newPathToPomXML = Paths.convert(newModulePath.resolve(POM_PATH)); try { ioService.startBatch(newModulePath.getFileSystem()); ioService.move(projectDirectory, newModulePath, commentedOptionFactory.makeCommentedOption(comment)); pomService.save(newPathToPomXML, content, null, comment); final Module newModule = resourceResolver.resolveModule(Paths.convert(newModulePath)); renameModuleEvent.fire(new RenameModuleEvent(oldModule, newModule)); } catch (final Exception e) { throw e; } finally { ioService.endBatch(); } invalidateDMOCache.fire(new InvalidateDMOModuleCacheEvent(sessionInfo, oldModule, oldModuleDir)); return newPathToPomXML; } catch (final Exception e) { throw ExceptionUtilities.handleException(e); } }
Source:
public void testFindScriptResources() throws Exception { TestApplication app = new TestApplication(); String targetId1 = this.mngr.createTarget( "id: tid1\nhandler: h" ); String targetId2 = this.mngr.createTarget( "id: tid2\nhandler: h" ); this.mngr.associateTargetWith( targetId1, app, null ); this.mngr.associateTargetWith( targetId2, app, null ); File dir1 = new File( this.configurationMngr.getWorkingDirectory(), ConfigurationUtils.TARGETS + "/" + targetId1 ); File dir2 = new File( this.configurationMngr.getWorkingDirectory(), ConfigurationUtils.TARGETS + "/" + targetId2 ); Utils.createDirectory( dir1 ); Utils.createDirectory( dir2 ); Utils.writeStringInto( "#!/bin/bash\necho Bonjour le monde cruel > toto.txt", new File( dir1, "tott.script" )); Utils.writeStringInto( "#!/bin/bash\necho touch toto.txt", new File( dir2, "titi.script" )); Assert.assertNotNull( this.mngr.findScriptResources(targetId1) ); Assert.assertNotNull( this.mngr.findScriptResources(targetId2) ); }

Target:
public void testFindScriptResources() throws Exception { TestApplication app = new TestApplication(); String targetId1 = this.mngr.createTarget( "id: tid1\nhandler: h" ); String targetId2 = this.mngr.createTarget( "id: tid2\nhandler: h" ); this.mngr.associateTargetWith( targetId1, app, null ); this.mngr.associateTargetWith( targetId2, app, null ); File dir1 = new File( this.configurationMngr.getWorkingDirectory(), ConfigurationUtils.TARGETS + "/" + targetId1 ); File dir2 = new File( this.configurationMngr.getWorkingDirectory(), ConfigurationUtils.TARGETS + "/" + targetId2 ); Utils.createDirectory( dir1 ); Utils.createDirectory( dir2 ); Utils.writeStringInto( "#!/bin/bash\necho Bonjour le monde cruel > toto.txt", new File( dir1, "target-script.sh" )); Utils.writeStringInto( "#!/bin/bash\necho touch toto.txt", new File( dir2, "target-script.py" )); Assert.assertEquals( 1, this.mngr.findScriptResources(targetId1).size() ); Assert.assertEquals( 1, this.mngr.findScriptResources( app, app.getMySql()).size()); }
Source:
protected void declareConstraintsAndOr(final List<KiePMMLFieldOperatorValue> orConstraints, final CEDescrBuilder<?, ?> andOrBuilder) { for (KiePMMLFieldOperatorValue kiePMMLOperatorValue : orConstraints) { if (kiePMMLOperatorValue.getName() != null) { commonDeclarePatternWithConstraint(andOrBuilder, kiePMMLOperatorValue.getName(), kiePMMLOperatorValue.getConstraintsAsString()); } if (kiePMMLOperatorValue.getNestedKiePMMLFieldOperatorValues() != null) { switch (kiePMMLOperatorValue.getOperator()) { case "||": declareConstraintsAndOr(kiePMMLOperatorValue.getNestedKiePMMLFieldOperatorValues(), andOrBuilder.or()); break; case "&&": declareConstraintsAndOr(kiePMMLOperatorValue.getNestedKiePMMLFieldOperatorValues(), andOrBuilder.and()); break; default: throw new KiePMMLException(String.format("Operator %s not managed inside declareConstraintsAndOr, yet", kiePMMLOperatorValue.getOperator())); } } } }

Target:
protected void declareConstraintsAndOr(final List<KiePMMLFieldOperatorValue> orConstraints, final CEDescrBuilder<?, ?> andOrBuilder) { for (KiePMMLFieldOperatorValue kiePMMLFieldOperatorValue : orConstraints) { if (kiePMMLFieldOperatorValue.getName() != null) { commonDeclarePatternWithConstraint(andOrBuilder, kiePMMLFieldOperatorValue.getName(), kiePMMLFieldOperatorValue.getConstraintsAsString()); } if (kiePMMLFieldOperatorValue.getNestedKiePMMLFieldOperatorValues() != null) { switch (kiePMMLFieldOperatorValue.getOperator()) { case OR: declareConstraintsAndOr(kiePMMLFieldOperatorValue.getNestedKiePMMLFieldOperatorValues(), andOrBuilder.or()); break; case AND: declareConstraintsAndOr(kiePMMLFieldOperatorValue.getNestedKiePMMLFieldOperatorValues(), andOrBuilder.and()); break; default: throw new KiePMMLException(String.format("Operator %s not managed inside declareConstraintsAndOr, yet", kiePMMLFieldOperatorValue.getOperator())); } } } }
Source:
protected void executeQueryCommand() { getQueryReturnValue().setSucceeded(true); if (getVdsStaticDao().getByHostName(getParameters().getServerName()) != null || getVdsStaticDao().getAllWithIpAddress(getParameters().getServerName()).size() > 0) { setErrorMessage(VdcBllMessages.SERVER_ALREADY_EXISTS_IN_ANOTHER_CLUSTER.toString()); return; } SSHClient client = null; try { Map<String, String> serverFingerPrintMap = getGlusterUtil().getPeers(getParameters().getServerName(), getParameters().getPassword(), getParameters().getFingerprint()); if (!validateServers(serverFingerPrintMap.keySet())) { setErrorMessage(VdcBllMessages.SERVER_ALREADY_EXISTS_IN_ANOTHER_CLUSTER.toString()); } serverFingerPrintMap.put(getParameters().getServerName(), getParameters().getFingerprint()); getQueryReturnValue().setReturnValue(serverFingerPrintMap); } catch (AuthenticationException ae) { setErrorMessage(VdcBllMessages.SSH_AUTHENTICATION_FAILED.toString()); } catch (Exception e) { throw new RuntimeException(e); } finally { if (client != null) { client.disconnect(); } } }

Target:
protected void executeQueryCommand() { if (getVdsStaticDao().getByHostName(getParameters().getServerName()) != null || getVdsStaticDao().getAllWithIpAddress(getParameters().getServerName()).size() > 0) { throw new RuntimeException(VdcBllMessages.SERVER_ALREADY_EXISTS_IN_ANOTHER_CLUSTER.toString()); } SSHClient client = null; try { Map<String, String> serverFingerPrintMap = getGlusterUtil().getPeers(getParameters().getServerName(), getParameters().getPassword(), getParameters().getFingerprint()); if (!validateServers(serverFingerPrintMap.keySet())) { throw new RuntimeException(VdcBllMessages.SERVER_ALREADY_EXISTS_IN_ANOTHER_CLUSTER.toString()); } serverFingerPrintMap.put(getParameters().getServerName(), getParameters().getFingerprint()); getQueryReturnValue().setReturnValue(serverFingerPrintMap); } catch (AuthenticationException ae) { throw new RuntimeException(VdcBllMessages.SSH_AUTHENTICATION_FAILED.toString()); } catch (RuntimeException re) { throw re; } catch (Exception e) { throw new RuntimeException(e); } finally { if (client != null) { client.disconnect(); } } }
Source:
public Runtime build() { ResourceLoader resourceLoader = this.resourceLoader != null ? this.resourceLoader : new MultiLoader(this.classLoader); ClassFinder classFinder = this.classFinder != null ? this.classFinder : new ResourceLoaderClassFinder(resourceLoader, this.classLoader); BackendSupplier backendSupplier = this.backendSupplier != null ? this.backendSupplier : new BackendModuleBackendSupplier(resourceLoader, classFinder, this.runtimeOptions); final Plugins plugins = new Plugins(this.classLoader, new PluginFactory(), this.eventBus, this.runtimeOptions); for (final Plugin plugin : additionalPlugins) { plugins.addPlugin(plugin); } final RunnerSupplier runnerSupplier = new ThreadLocalRunnerSupplier(this.runtimeOptions, this.eventBus, backendSupplier, this.glueSupplier); final FeatureLoader featureLoader = new FeatureLoader(resourceLoader); final FeatureSupplier featureSupplier = this.featureSupplier != null ? this.featureSupplier : new FeaturePathFeatureSupplier(featureLoader, this.runtimeOptions); final RerunFilters rerunFilters = new RerunFilters(this.runtimeOptions, featureLoader); final Filters filters = new Filters(this.runtimeOptions, rerunFilters); return new Runtime(plugins, this.runtimeOptions, this.eventBus, filters, runnerSupplier, featureSupplier); }

Target:
public Runtime build() { final ResourceLoader resourceLoader = this.resourceLoader != null ? this.resourceLoader : new MultiLoader(this.classLoader); final ClassFinder classFinder = this.classFinder != null ? this.classFinder : new ResourceLoaderClassFinder(resourceLoader, this.classLoader); final BackendSupplier backendSupplier = this.backendSupplier != null ? this.backendSupplier : new BackendModuleBackendSupplier(resourceLoader, classFinder, this.runtimeOptions); final Plugins plugins = new Plugins(this.classLoader, new PluginFactory(), this.eventBus, this.runtimeOptions); for (final Plugin plugin : additionalPlugins) { plugins.addPlugin(plugin); } final RunnerSupplier runnerSupplier = runtimeOptions.isMultiThreaded() ? new ThreadLocalRunnerSupplier(this.runtimeOptions, eventBus, backendSupplier, this.glueSupplier) : new SingletonRunnerSupplier(this.runtimeOptions, eventBus, backendSupplier, this.glueSupplier); final ExecutorService executor = runtimeOptions.isMultiThreaded() ? Executors.newFixedThreadPool(runtimeOptions.getThreads()) : new SameThreadExecutorService(); final FeatureLoader featureLoader = new FeatureLoader(resourceLoader); final FeatureSupplier featureSupplier = this.featureSupplier != null ? this.featureSupplier : new FeaturePathFeatureSupplier(featureLoader, this.runtimeOptions); final RerunFilters rerunFilters = new RerunFilters(this.runtimeOptions, featureLoader); final Filters filters = new Filters(this.runtimeOptions, rerunFilters); return new Runtime(plugins, this.runtimeOptions, eventBus, filters, runnerSupplier, featureSupplier, executor); }
Source:
private void callCheckTaintTag(int tagIdx, int primitiveIdx, Type primitiveType) { super.visitFieldInsn(GETSTATIC, Type.getInternalName(Configuration.class), "autoTainter", Type.getDescriptor(TaintSourceWrapper.class)); super.visitVarInsn(ALOAD, tagIdx); super.visitVarInsn(primitiveType.getOpcode(ILOAD), primitiveIdx); boxPrimitive(primitiveType); super.visitLdcInsn(baseSink); super.visitLdcInsn(owner+"."+name+desc); super.visitMethodInsn(INVOKEVIRTUAL, Type.getInternalName(TaintSourceWrapper.class), "checkTaint", "("+Configuration.TAINT_TAG_DESC+"Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;)V", false); }

Target:
private void callCheckTaintTag(int tagIdx, int primitiveIdx, Type primitiveType) { super.visitFieldInsn(GETSTATIC, Type.getInternalName(Configuration.class), "autoTainter", Type.getDescriptor(TaintSourceWrapper.class)); Type containerType = TaintUtils.getContainerReturnType(primitiveType); mv.visitTypeInsn(NEW, containerType.getInternalName()); mv.visitInsn(DUP); super.visitVarInsn(ALOAD, tagIdx); super.visitVarInsn(primitiveType.getOpcode(ILOAD), primitiveIdx); mv.visitMethodInsn(INVOKESPECIAL, containerType.getInternalName(), "<init>", "("+Configuration.TAINT_TAG_DESC+ primitiveType.getDescriptor()+")V", false); super.visitLdcInsn(baseSink); super.visitLdcInsn(owner+"."+name+desc); super.visitMethodInsn(INVOKEVIRTUAL, Type.getInternalName(TaintSourceWrapper.class), "checkTaint", "(Ljava/lang/Object;Ljava/lang/String;Ljava/lang/String;)V", false); }
Source:
static void updateSubstitutionCodes(final List<CramCompressionRecord> records, final SubstitutionMatrix substitutionMatrix) { for (final CramCompressionRecord record : records) { if (record.readFeatures != null) { for (final ReadFeature recordFeature : record.readFeatures) { if (recordFeature.getOperator() == Substitution.operator) { final Substitution substitution = ((Substitution) recordFeature); if (substitution.getCode() == -1) { final byte refBase = substitution.getReferenceBase(); final byte base = substitution.getBase(); substitution.setCode(substitutionMatrix.code(refBase, base)); } } } } } }

Target:
static void updateSubstitutionCodes(final List<CramCompressionRecord> records, final SubstitutionMatrix substitutionMatrix) { for (final CramCompressionRecord record : records) { if (record.readFeatures != null) { for (final ReadFeature recordFeature : record.readFeatures) { if (recordFeature.getOperator() == Substitution.operator) { final Substitution substitution = ((Substitution) recordFeature); if (substitution.getCode() == Substitution.NO_CODE) { final byte refBase = substitution.getReferenceBase(); final byte base = substitution.getBase(); substitution.setCode(substitutionMatrix.code(refBase, base)); } } } } } }
Source:
public void create() { ResourceManager.getInstance().init(); AsyncTaskManager.getInstance().InitAsyncTaskManager(); OvfDataUpdater.getInstance().initOvfDataUpdater(); VdsLoadBalancer.getInstance().setMigrationHandler(new MigrationHandler() { @Override public void migrateVMs(List<Pair<Guid, Guid>> list) { for (Pair<Guid, Guid> pair : list) { MigrateVmToServerParameters parameters = new MigrateVmToServerParameters(false, pair.getFirst(), pair.getSecond()); Backend.getInstance().runInternalAction(VdcActionType.MigrateVmToServer, parameters, ExecutionHandler.createInternalJobContext()); } } }); ThreadPoolUtil.execute(new Runnable() { @Override public void run() { MacPoolManager.getInstance().initialize(); } }); StoragePoolStatusHandler.Init(); GlusterJobsManager.init(); try { log.info("Init VM custom properties utilities"); VmPropertiesUtils.getInstance().init(); } catch (InitializationException e) { log.error("Initialization of vm custom properties failed.",e); } }

Target:
public void create() { ResourceManager.getInstance().init(); AsyncTaskManager.getInstance().InitAsyncTaskManager(); OvfDataUpdater.getInstance().initOvfDataUpdater(); VdsLoadBalancer.getInstance().setMigrationHandler(new MigrationHandler() { @Override public void migrateVMs(List<Pair<Guid, Guid>> list) { for (Pair<Guid, Guid> pair : list) { MigrateVmToServerParameters parameters = new MigrateVmToServerParameters(false, pair.getFirst(), pair.getSecond()); Backend.getInstance().runInternalAction(VdcActionType.MigrateVmToServer, parameters, ExecutionHandler.createInternalJobContext()); } } }); ThreadPoolUtil.execute(new Runnable() { @Override public void run() { MacPoolManager.getInstance().initialize(); } }); StoragePoolStatusHandler.Init(); GlusterJobsManager.init(); try { log.info("Init VM custom properties utilities"); VmPropertiesUtils.getInstance().init(); } catch (InitializationException e) { log.error("Initialization of vm custom properties failed.",e); } try { log.info("Init device custom properties utilities"); DevicePropertiesUtils.getInstance().init(); } catch (InitializationException e) { log.error("Initialization of device custom properties failed.",e); } }
Source:
public void refresh() { boolean releaseLock = true; if (lockManager.acquireLock(monitoringLock).getFirst()) { try { setIsSetNonOperationalExecuted(false); synchronized (this) { refreshCachedVds(); if (cachedVds == null) { log.error("VdsManager::refreshVdsRunTimeInfo - refresh is NULL for '{}'", getVdsId()); return; } try { updateIteration(); if (isMonitoringNeeded()) { setStartTime(); releaseLock = false; hostMonitoring = Injector.injectMembers( new HostMonitoring(this, cachedVds, monitoringStrategy)); hostMonitoring.refresh(); unrespondedAttempts.set(0); setLastUpdate(); } } catch (VDSNetworkException e) { logNetworkException(e); } catch (VDSRecoveringException ex) { handleVdsRecoveringException(ex); } catch (RuntimeException ex) { logFailureMessage(ex); } } } catch (Throwable t) { releaseLock = true; log.error("Timer update runtime info failed. Exception:", ExceptionUtils.getRootCauseMessage(t)); log.debug("Exception:", t); } finally { if (releaseLock) { lockManager.releaseLock(monitoringLock); } } } }

Target:
public void refresh() { boolean releaseLock = true; if (lockManager.acquireLock(monitoringLock).getFirst()) { try { setIsSetNonOperationalExecuted(false); synchronized (this) { refreshCachedVds(); if (cachedVds == null) { log.error("VdsManager::refreshVdsRunTimeInfo - onTimer is NULL for '{}'", getVdsId()); return; } try { updateIteration(); if (isMonitoringNeeded()) { setStartTime(); releaseLock = false; hostMonitoring = new HostMonitoring(this, cachedVds, monitoringStrategy, resourceManager, dbFacade, auditLogDirector); hostMonitoring.refresh(); } } catch (VDSNetworkException e) { logNetworkException(e); } catch (VDSRecoveringException ex) { handleVdsRecoveringException(ex); } catch (RuntimeException ex) { logFailureMessage(ex); } } } catch (Throwable e) { releaseLock = true; log.error("Timer update runtime info failed. Exception:", ExceptionUtils.getRootCauseMessage(e)); log.debug("Exception:", e); } finally { if (releaseLock) { lockManager.releaseLock(monitoringLock); } } } }
Source:
public ProcessLocation createProcessLocation(String processId) throws IOException { File processRootDirectory = new File( (Config.getConfig().getString(METADATA_DIRECTORY) + File.separator + processId)); if (!processRootDirectory.mkdir()) { throw new IOException(); } File processImageDirectory = new File(processRootDirectory.getPath() + File.separator + "images"); if (!processImageDirectory.mkdir()) { throw new IOException(); } URI processMetaFile = createResource(processRootDirectory.toURI(), "meta.xml"); return new ProcessLocation(processRootDirectory.toURI(), processImageDirectory.toURI(), processMetaFile); }

Target:
public ProcessLocation createProcessLocation(String processId) throws IOException { File processRootDirectory = new File( (Config.getConfig().getString(METADATA_DIRECTORY) + File.separator + processId)); if (!processRootDirectory.mkdir()) { throw new IOException("Could not create processRoot directory."); } File processImageDirectory = new File(processRootDirectory.getPath() + File.separator + "images"); if (!processImageDirectory.mkdir()) { throw new IOException("Could not create image directory"); } URI processMetaFile = createResource(processRootDirectory.toURI(), "meta.xml"); return new ProcessLocation(processRootDirectory.toURI(), processImageDirectory.toURI(), processMetaFile); }
Source:
public void accept(final Socket socket) throws IOException { final InputStream input = socket.getInputStream(); final RqLive req = new RqLive(input); boolean keep = false; final Iterator<String> values = new RqHeaders.Base(req) .header(CONNECTION).iterator(); if (values.hasNext()) { do { keep = KEEP_ALIVE.equals(values.next()); } while (!keep && values.hasNext()); } try { this.print( BkBasic.addSocketHeaders( req, socket ), new BufferedOutputStream(socket.getOutputStream()), keep ); } finally { if (!keep) { input.close(); } } }

Target:
public void accept(final Socket socket) throws IOException { final InputStream input = socket.getInputStream(); try { this.print( BkBasic.addSocketHeaders( new RqLive(input), socket ), new BufferedOutputStream(socket.getOutputStream()) ); } finally { input.close(); } }
Source:
private void test(String[] original, String[] compiled, DiagnosticType warning) { Compiler compiler = compile(original); assertThat(exitCodes).isNotEmpty(); assertThat(exitCodes.get(exitCodes.size() - 1)).isEqualTo(0); if (warning == null) { assertEquals("Expected no warnings or errors\n" + "Errors: \n" + Joiner.on("\n").join(compiler.getErrors()) + "Warnings: \n" + Joiner.on("\n").join(compiler.getWarnings()), 0, compiler.getErrors().length + compiler.getWarnings().length); } else { assertThat(compiler.getWarnings()).hasLength(1); assertThat(compiler.getWarnings()[0].getType()).isEqualTo(warning); } Node root = compiler.getRoot().getLastChild(); if (useStringComparison) { assertThat(compiler.toSource()).isEqualTo(Joiner.on("").join(compiled)); } else { Node expectedRoot = parse(compiled); String explanation = expectedRoot.checkTreeEquals(root); assertNull("\nExpected: " + compiler.toSource(expectedRoot) + "\nResult: " + compiler.toSource(root) + "\n" + explanation, explanation); } }

Target:
private void test(String[] original, String[] compiled, DiagnosticType warning) { exitCodes.clear(); Compiler compiler = compile(original); assertThat(exitCodes).containsExactly(0); if (warning == null) { assertEquals("Expected no warnings or errors\n" + "Errors: \n" + Joiner.on("\n").join(compiler.getErrors()) + "Warnings: \n" + Joiner.on("\n").join(compiler.getWarnings()), 0, compiler.getErrors().length + compiler.getWarnings().length); } else { assertThat(compiler.getWarnings()).hasLength(1); assertThat(compiler.getWarnings()[0].getType()).isEqualTo(warning); } Node root = compiler.getRoot().getLastChild(); if (useStringComparison) { assertThat(compiler.toSource()).isEqualTo(Joiner.on("").join(compiled)); } else { Node expectedRoot = parse(compiled); String explanation = expectedRoot.checkTreeEquals(root); assertNull("\nExpected: " + compiler.toSource(expectedRoot) + "\nResult: " + compiler.toSource(root) + "\n" + explanation, explanation); } }
Source:
private String constructEntityIdsAsCSV(Set<String> entityIds) throws UnsupportedEncodingException { if (entityIds.size() == 0) { return ""; } Set<String> ids = Sets.newHashSet(); for (String id : entityIds) { ids.add("\"" + id + "\""); } Joiner join = Joiner.on(","); return join.join(ids); }

Target:
private String constructEntityIdsAsCSV(Set<String> entityIds) throws UnsupportedEncodingException { if (CollectionUtils.isEmpty(entityIds)) { return ""; } Set<String> ids = Sets.newHashSet(); for (String id : entityIds) { ids.add("\"" + id + "\""); } return Joiner.on(",").join(ids); }
Source:
private void storeConsolesInternal(VmConsoles consoles, boolean isPool) { ConsoleProtocol selectedProtocol = consoles.getSelectedProcotol(); ConsoleContext context = consoles.getConsoleContext(); String id = isPool ? consoles.getVm().getVmPoolId().toString() : consoles.getVm().getId().toString(); KeyMaker keyMaker = new KeyMaker(id, isPool, context); clientStorage.setLocalItem(keyMaker.make(SELECTED_PROTOCOL), selectedProtocol.toString()); if (selectedProtocol == ConsoleProtocol.SPICE) { storeSpiceData(consoles, keyMaker); } else if (selectedProtocol == ConsoleProtocol.VNC) { storeVncData(consoles, keyMaker); } else if (selectedProtocol == ConsoleProtocol.RDP) { storeRdpData(consoles, keyMaker); } }

Target:
private void storeConsolesInternal(VmConsoles consoles, boolean isPool) { ConsoleProtocol selectedProtocol = consoles.getSelectedProcotol(); ConsoleContext context = consoles.getConsoleContext(); String id = consoles.getEntityId().toString(); KeyMaker keyMaker = new KeyMaker(id, isPool, context); clientStorage.setLocalItem(keyMaker.make(SELECTED_PROTOCOL), selectedProtocol.toString()); if (selectedProtocol == ConsoleProtocol.SPICE) { storeSpiceData(consoles, keyMaker); } else if (selectedProtocol == ConsoleProtocol.VNC) { storeVncData(consoles, keyMaker); } else if (selectedProtocol == ConsoleProtocol.RDP) { storeRdpData(consoles, keyMaker); } }
Source:
public void containerExists() throws InterruptedException { if(System.getProperty("os.name").contains("indows")) throw new SkipException("not yet implemented"); else super.containerExists(); }

Target:
public void containerExists() throws InterruptedException { super.containerExists(); }
Source:
public static Set<IPluginModelBase> parsePlugins(ILaunchConfiguration configuration, String attribute) throws CoreException { HashSet<IPluginModelBase> set = new HashSet<>(); Map<String, IPluginModelBase> unmatchedEntries = new HashMap<>(); List<String> entries = configuration.getAttribute(attribute, Collections.emptyList()); for (String token : entries) { int index = token.indexOf('@'); if (index < 0) { token = token.concat("@default:default"); index = token.indexOf('@'); } String idVersion = token.substring(0, index); int versionIndex = token.indexOf(BundleLauncherHelper.VERSION_SEPARATOR); String id = (versionIndex > 0) ? idVersion.substring(0, versionIndex) : idVersion; String version = (versionIndex > 0) ? idVersion.substring(versionIndex + 1) : null; ModelEntry entry = PluginRegistry.findEntry(id); if (entry != null) { IPluginModelBase matchingModels[] = attribute.equals(IPDELauncherConstants.SELECTED_TARGET_BUNDLES) ? entry.getExternalModels() : entry.getWorkspaceModels(); for (IPluginModelBase matchingModel : matchingModels) { if (matchingModel.isEnabled()) { if (version == null || matchingModel.getPluginBase().getVersion().equals(version)) { set.add(matchingModel); } else if (matchingModels.length == 1) { if (unmatchedEntries.remove(id) == null) { unmatchedEntries.put(id, matchingModel); } } } } } } set.addAll(unmatchedEntries.values()); return set; }

Target:
public static Set<IPluginModelBase> parsePlugins(ILaunchConfiguration configuration, String attribute) throws CoreException { HashSet<IPluginModelBase> set = new HashSet<>(); Map<String, IPluginModelBase> unmatchedEntries = new HashMap<>(); Set<String> entries = configuration.getAttribute(attribute, Collections.emptySet()); for (String token : entries) { int index = token.indexOf('@'); if (index < 0) { token = token.concat("@default:default"); index = token.indexOf('@'); } String idVersion = token.substring(0, index); int versionIndex = token.indexOf(BundleLauncherHelper.VERSION_SEPARATOR); String id = (versionIndex > 0) ? idVersion.substring(0, versionIndex) : idVersion; String version = (versionIndex > 0) ? idVersion.substring(versionIndex + 1) : null; ModelEntry entry = PluginRegistry.findEntry(id); if (entry != null) { IPluginModelBase matchingModels[] = attribute.equals(IPDELauncherConstants.SELECTED_TARGET_BUNDLES) ? entry.getExternalModels() : entry.getWorkspaceModels(); for (IPluginModelBase matchingModel : matchingModels) { if (matchingModel.isEnabled()) { if (version == null || matchingModel.getPluginBase().getVersion().equals(version)) { set.add(matchingModel); } else if (matchingModels.length == 1) { if (unmatchedEntries.remove(id) == null) { unmatchedEntries.put(id, matchingModel); } } } } } } set.addAll(unmatchedEntries.values()); return set; }
Source:
public void testPushReplicationFilterContinuesFromCorrectPlace() throws Exception { prepareTwoDocumentsInLocalDB(); ReplicatorBuilder.Push push = this.getPushBuilder(); push.filter(new PushFilter() { @Override public boolean shouldReplicateDocument(DocumentRevision revision) { return false; } }); Replicator replicator = push.build(); replicator.start(); while (replicator.getState() != Replicator.State.COMPLETE && replicator.getState() != Replicator.State.ERROR) { Thread.sleep(50); } Assert.assertEquals(Replicator.State.COMPLETE, replicator.getState()); Assert.assertEquals(0, couchClient.getDbInfo().getDocCount()); replicator = this.getPushBuilder().build(); replicator.start(); while (replicator.getState() != Replicator.State.COMPLETE && replicator.getState() != Replicator.State.ERROR) { Thread.sleep(50); } Assert.assertEquals(Replicator.State.COMPLETE, replicator.getState()); Assert.assertEquals(0, couchClient.getDbInfo().getDocCount()); }

Target:
public void testPushReplicationFilterContinuesFromCorrectPlace() throws Exception { prepareTwoDocumentsInLocalDB(); ReplicatorBuilder.Push push = this.getPushBuilder(); push.filter(new PushFilter() { @Override public boolean shouldReplicateDocument(DocumentRevision revision) { return false; } }); Replicator replicator = push.build(); replicator.start(); while (replicator.getState() != Replicator.State.COMPLETE && replicator.getState() != Replicator.State.ERROR) { Thread.sleep(50); } Assert.assertEquals(Replicator.State.COMPLETE, replicator.getState()); Assert.assertEquals(0, couchClient.getDbInfo().getDocCount()); replicator = this.getPushBuilder().build(); replicator.start(); while (replicator.getState() != Replicator.State.COMPLETE && replicator.getState() != Replicator.State.ERROR) { Thread.sleep(50); } Assert.assertEquals(Replicator.State.COMPLETE, replicator.getState()); Assert.assertEquals(0, couchClient.getDbInfo().getDocCount()); assertLastSequence(replicator); }
Source:
public void doSetup() { this.registry = new DefaultSubscriptionRegistry(); this.destinations = IntStream.range(0, this.numberOfDestinations) .mapToObj(i -> "/some/destination/" + i) .toArray(String[]::new); this.sessionIds = IntStream.range(0, this.numberOfSessions) .mapToObj(i -> "sessionId_" + i) .toArray(String[]::new); for (String sessionId : this.sessionIds) { registerSubscriptions(sessionId, this.subscriptionsPerSession); } }

Target:
public void doSetup() { this.findMessage = MessageBuilder.createMessage("", SimpMessageHeaderAccessor.create().getMessageHeaders()); this.uniqueIdGenerator = new AtomicInteger(); this.registry = new DefaultSubscriptionRegistry(); this.registry.setCacheLimit(this.cacheSizeLimit); this.registry.setSelectorHeaderName("selectorHeaders".equals(this.specialization) ? "someSelector" : null); this.destinationIds = IntStream.range(0, this.destinations) .mapToObj(i -> "/some/destination/" + i) .toArray(String[]::new); this.sessionIds = IntStream.range(0, this.sessions) .mapToObj(i -> "sessionId_" + i) .toArray(String[]::new); for (String sessionId : this.sessionIds) { for (String destinationId : this.destinationIds) { registerSubscriptions(sessionId, destinationId); } } }
Source:
public boolean replaceNode(final Node oldOne, final @Nonnull Node newOne) throws IOException { if (oldOne == nodes.get(oldOne.getNodeName())) { Queue.withLock(new Runnable() { public void run() { Nodes.this.nodes.remove(oldOne.getNodeName()); Nodes.this.nodes.put(newOne.getNodeName(), newOne); jenkins.updateComputerList(); jenkins.trimLabels(); } }); updateNode(newOne); NodeListener.fireOnUpdated(oldOne, newOne); Util.deleteRecursive(new File(getNodesDir(), oldOne.getNodeName())); return true; } else { return false; } }

Target:
public boolean replaceNode(final Node oldOne, final @Nonnull Node newOne) throws IOException { if (oldOne == nodes.get(oldOne.getNodeName())) { Queue.withLock(new Runnable() { public void run() { Nodes.this.nodes.remove(oldOne.getNodeName()); Nodes.this.nodes.put(newOne.getNodeName(), newOne); jenkins.updateComputerList(); jenkins.trimLabels(); } }); updateNode(newOne); if (!newOne.getNodeName().equals(oldOne.getNodeName())) { Util.deleteRecursive(new File(getNodesDir(), oldOne.getNodeName())); } NodeListener.fireOnUpdated(oldOne, newOne); return true; } else { return false; } }
Source:
protected void makeUninstallButton() { actionButton.classList.remove("btn-primary"); actionButton.classList.add("btn-danger"); actionButton.textContent = "Uninstall"; }

Target:
protected void makeUninstallButton() { actionButton.classList.remove("btn-primary"); actionButton.classList.add("btn-danger"); actionButton.textContent = constants.UninstallServiceTask(); }
Source:
public void shouldCleanUpBroadcasterUponDestory(){ DefaultBroadcasterFactory broadcasterFactory = new DefaultBroadcasterFactory(SimpleBroadcaster.class, "NEVER", config); Broadcaster b1 = broadcasterFactory.lookup("/LEAK/EXISTS", true); b1.destroy(); Assert.assertNull(broadcasterFactory.lookup("/LEAJ/EXISTS")); }

Target:
public void shouldCleanUpBroadcasterUponDestory(){ Broadcaster b1 = config.getBroadcasterFactory().lookup("/LEAK/EXISTS", true); b1.destroy(); Assert.assertNull(config.getBroadcasterFactory().lookup("/LEAK/EXISTS")); }
Source:
public AbstractClassVisitor() { super(Opcodes.ASM7); }

Target:
public AbstractClassVisitor() { super(FindBugsASM.ASM_VERSION); }
Source:
public ReverseDebugPreferencePage() { super( GRID ); IPreferenceStore store = CDebugUIPlugin.getDefault().getPreferenceStore(); setPreferenceStore( store ); setDescription( "Reverse Debug Settings" ); }

Target:
public ReverseDebugPreferencePage() { super( GRID ); IPreferenceStore store = CDebugUIPlugin.getDefault().getPreferenceStore(); setPreferenceStore( store ); setDescription( Messages.ReverseDebugPreferencePage_1 ); }
Source:
public static String getLocalPackageName(@NotNull String importPath) { return makePackageNameValid(PathUtil.getFileName(importPath)); }

Target:
public static String getLocalPackageName(@NotNull String importPath) { final String illegalChars = "[-!\"#$%&'()*,:;<=>?[\\]^{|}\uFFFD]"; StringBuilder name = new StringBuilder(PathUtil.getFileName(importPath)); for (int i = 0; i < name.length(); i++) { char ch = name.charAt(i); if (Character.isWhitespace(ch) || illegalChars.indexOf(ch) != -1) { name.setCharAt(i, '_'); } } return name.toString(); }
Source:
public void visitFunctionDeclaration(FunctionDeclarationTree tree) { super.visitFunctionDeclaration(tree); checkFunction(tree); }

Target:
public void visitFunctionDeclaration(FunctionDeclarationTree tree) { checkFunction(tree); super.visitFunctionDeclaration(tree); }
Source:
private TransactionManager getTransactionManager() { try { return com.arjuna.ats.jta.TransactionManager.transactionManager(new InitialContext()); } catch (NamingException ne) { throw new IllegalStateException("Not possible to find transaction manager"); } }

Target:
private TransactionManager getTransactionManager() { try { return com.arjuna.ats.jta.TransactionManager.transactionManager(new InitialContext()); } catch (NamingException ne) { throw new IllegalStateException("Not possible to find transaction manager, " + "failed to initialize intial context. Cause: " + ne.getMessage(), ne); } }
Source:
public ValidationResult validate(Object value) { assert value == null || value instanceof String : "This validation must be run on a String!"; String mask = (String) value; boolean isValidFormat = isPrefixSupported ? MaskValidator.getInstance().isMaskFormatValid(mask) : MaskValidator.getInstance() .isMaskValidFormatPrefixFree(mask); boolean isValidValue = isPrefixSupported ? MaskValidator.getInstance().isMaskValid(mask) : MaskValidator.getInstance() .isMaskValidPrefixFree(mask); if (!isValidFormat) { return failWith(getSubnetBadFormatMessage()); } else if (!isValidValue) { return failWith(getInvalidNetmaskMessage()); } return new ValidationResult(); }

Target:
public ValidationResult validate(Object value) { assert value == null || value instanceof String : "This validation must be run on a String!"; String mask = (String) value; boolean isValidFormat = isPrefixSupported ? MaskValidator.getInstance().isMaskFormatValid(mask) : MaskValidator.getInstance() .isNetmaskFormatValid(mask); boolean isValidValue = isValidFormat ? (isPrefixSupported ? MaskValidator.getInstance().isMaskValid(mask) : MaskValidator.getInstance() .isNetmaskValid(mask)) : false; if (!isValidFormat) { return failWith(getSubnetBadFormatMessage()); } else if (!isValidValue) { return failWith(getInvalidNetmaskMessage()); } return new ValidationResult(); }
Source:
public void setWriteBufferSize(int bufferSize) { this.writeBufferSize = bufferSize; }

Target:
void setWriteBufferSize(int bufferSize) { this.writeBufferSize = bufferSize; }
Source:
protected void parse() throws ProtocolException { boolean witSupported = (protocolVersion >= NetworkParameters.ProtocolVersion.WITNESS_VERSION.getBitcoinProtocolVersion()) && (transactionOptions & TransactionOptions.WITNESS) != 0; cursor = offset; version = readUint32(); optimalEncodingMessageSize = 4; readInputs(); byte flags = 0; if(inputs.size() == 0 && witSupported) { flags = readBytes(1)[0]; optimalEncodingMessageSize += 1; if(flags != 0) { readInputs(); readOutputs(); } else { outputs = new ArrayList<TransactionOutput>(0); } } else { readOutputs(); } if(((flags & 1) != 0) && witSupported) { flags ^= 1; readWitness(); } if(flags != 0) { throw new ProtocolException("Unknown transaction optional data"); } lockTime = readUint32(); optimalEncodingMessageSize += 4; length = cursor - offset; }

Target:
protected void parse() throws ProtocolException { boolean witSupported = (protocolVersion >= NetworkParameters.ProtocolVersion.WITNESS_VERSION.getBitcoinProtocolVersion()) && (transactionOptions & TransactionOptions.WITNESS) != 0; cursor = offset; version = readUint32(); optimalEncodingMessageSize = 4; readInputs(); byte flags = 0; if (inputs.size() == 0 && witSupported) { flags = readBytes(1)[0]; optimalEncodingMessageSize += 1; if (flags != 0) { readInputs(); readOutputs(); } else { outputs = new ArrayList<TransactionOutput>(0); } } else { readOutputs(); } if (((flags & 1) != 0) && witSupported) { flags ^= 1; readWitness(); } if (flags != 0) { throw new ProtocolException("Unknown transaction optional data"); } lockTime = readUint32(); optimalEncodingMessageSize += 4; length = cursor - offset; witnesses = witnesses == null ? new ArrayList<TransactionWitness>() : witnesses; }
Source:
public List<ChePlugin> execute() throws InfrastructureException { Span tracingSpan = startTracingPhase(); BrokerStatusListener brokerStatusListener = new BrokerStatusListener(workspaceId, pluginsValidator, brokersResult); try { LOG.debug("Subscribing broker events listener for workspace '{}'", workspaceId); eventService.subscribe(brokerStatusListener, BrokerEvent.class); finishSpanIfExists(tracingSpan); return nextPhase.execute(); } finally { eventService.unsubscribe(brokerStatusListener); } }

Target:
public List<ChePlugin> execute() throws InfrastructureException { BrokerStatusListener brokerStatusListener = new BrokerStatusListener(workspaceId, pluginsValidator, brokersResult); try { LOG.debug("Subscribing broker events listener for workspace '{}'", workspaceId); eventService.subscribe(brokerStatusListener, BrokerEvent.class); return nextPhase.execute(); } finally { eventService.unsubscribe(brokerStatusListener); } }
Source:
protected void checkNotInEventLoop() { if (!CHECK_IO_DEADLOCKS) return; for (EventExecutor executor : cluster.manager.connectionFactory.eventLoopGroup) { if (executor.inEventLoop()) { throw new IllegalStateException( "Detected a synchronous Session call (execute() or prepare()) on an I/O thread, " + "this is a bug and can cause deadlocks or unpredictable behavior. " + "Make sure your Future callbacks only use async calls, or schedule them on a " + "different executor."); } } }

Target:
protected void checkNotInEventLoop() { if (!CHECK_IO_DEADLOCKS) return; for (EventExecutor executor : cluster.manager.connectionFactory.eventLoopGroup) { if (executor.inEventLoop()) { throw new IllegalStateException( "Detected a synchronous Session call (execute() or prepare()) on an I/O thread, " + "this can cause deadlocks or unpredictable behavior. " + "Make sure your Future callbacks only use async calls, or schedule them on a " + "different executor."); } } }
Source:
private void assertKnownHostFileWritable() throws IOException { if( !knownHosts.canWrite() ) { throw new IOException( format( "Failed to write certificates to file %s as you have no write permissions to it. " + "Try configuring the Neo4j driver to use a file system location you do have write permissions to.", knownHosts.getAbsolutePath() ) ); } }

Target:
private void assertKnownHostFileWritable() throws IOException { if( !knownHosts.canWrite() ) { throw new IOException( format( "Failed to write certificates to file %s as you have no write permissions to it.\n" + "Try configuring the Neo4j driver to use a file system location you do have write permissions to.", knownHosts.getAbsolutePath() ) ); } }
Source:
public void commit(WrappedTinkerGraph graph, InventoryBackend.Transaction t) { graph.commit(); unlock(t); }

Target:
public void commit(WrappedTinkerGraph graph, InventoryBackend.Transaction t) { try { graph.commit(); } finally { unlock(t); } }
Source:
static Socket createSocketUtil(final String host, final int port, final String bindAddress, final int timeout) { Socket socket = null; if (timeout == 0) { try { socket = bindAddress == null ? new Socket(host, port) : new Socket(InetAddress.getByName(host), port, InetAddress.getByName(bindAddress), 0); return socket; } catch (Exception e) { String message = e.toString(); if (e instanceof Throwable) { throw new RuntimeCamelException(message, (Throwable)e); } throw new RuntimeCamelException(message); } } final Socket[] sockp = new Socket[1]; final Exception[] ee = new Exception[1]; String message = ""; Thread tmp = new Thread(new Runnable() { public void run() { sockp[0] = null; try { sockp[0] = bindAddress == null ? new Socket(host, port) : new Socket(InetAddress.getByName(host), port, InetAddress.getByName(bindAddress), 0); } catch (Exception e) { ee[0] = e; if (sockp[0] != null && sockp[0].isConnected()) { try { sockp[0].close(); } catch (Exception eee) { } } sockp[0] = null; } } }); tmp.setName("Opening Socket " + host); tmp.start(); try { tmp.join(timeout); message = "timeout: "; } catch (java.lang.InterruptedException eee) { } if (sockp[0] != null && sockp[0].isConnected()) { socket = sockp[0]; } else { message += "socket is not established"; if (ee[0] != null) { message = ee[0].toString(); } tmp.interrupt(); tmp = null; throw new RuntimeCamelException(message, ee[0]); } return socket; }

Target:
static Socket createSocketUtil(final String host, final int port, final String bindAddress, final int timeout) { Socket socket = null; if (timeout == 0) { try { socket = new Socket(InetAddress.getByName(host), port, InetAddress.getByName(bindAddress), 0); return socket; } catch (Exception e) { String message = e.toString(); if (e instanceof Throwable) { throw new RuntimeCamelException(message, (Throwable)e); } throw new RuntimeCamelException(message); } } final Socket[] sockp = new Socket[1]; final Exception[] ee = new Exception[1]; String message = ""; Thread tmp = new Thread(new Runnable() { public void run() { sockp[0] = null; try { sockp[0] = new Socket(InetAddress.getByName(host), port, InetAddress.getByName(bindAddress), 0); } catch (Exception e) { ee[0] = e; if (sockp[0] != null && sockp[0].isConnected()) { try { sockp[0].close(); } catch (Exception eee) { } } sockp[0] = null; } } }); tmp.setName("Opening Socket " + host); tmp.start(); try { tmp.join(timeout); message = "timeout: "; } catch (java.lang.InterruptedException eee) { } if (sockp[0] != null && sockp[0].isConnected()) { socket = sockp[0]; } else { message += "socket is not established"; if (ee[0] != null) { message = ee[0].toString(); } tmp.interrupt(); tmp = null; throw new RuntimeCamelException(message, ee[0]); } return socket; }
Source:
public void ack(final long uso, boolean runEveryWhere) { if (m_runEveryWhere && !m_isMaster && runEveryWhere) { m_lastAckUSO = uso; m_replicaMastershipRequested = true; if (!m_replicaRunning) { m_isMaster = false; m_replicaRunning = acceptMastership(); if (m_replicaRunning) { exportLog.info("Export generation " + getGeneration() + " accepting mastership for " + getTableName() + " partition " + getPartitionId() + " as replica"); } } return; } RunnableWithES runnable = new RunnableWithES("ack") { @Override public void run() { try { if (!getLocalExecutorService().isShutdown() && !m_mastershipAccepted.get()) { ackImpl(uso); } } catch (Exception e) { exportLog.error("Error acking export buffer", e); } catch (Error e) { VoltDB.crashLocalVoltDB("Error acking export buffer", true, e); } } }; stashOrSubmitTask(runnable, true, false); }

Target:
public void ack(final long uso, boolean runEveryWhere) { if (m_runEveryWhere && !m_isMaster && runEveryWhere) { m_lastAckUSO = uso; m_replicaMastershipRequested = true; if (!m_replicaRunning) { m_isMaster = false; m_replicaRunning = acceptMastership(); if (m_replicaRunning) { exportLog.info("Export generation " + getGeneration() + " accepting mastership for " + getTableName() + " partition " + getPartitionId() + " as replica"); } } return; } exportLog.error("Ack every " + m_runEveryWhere + " isM " + m_isMaster + " accept " + m_mastershipAccepted.get() + " runeverywhere " + runEveryWhere); RunnableWithES runnable = new RunnableWithES("ack") { @Override public void run() { try { if (!getLocalExecutorService().isShutdown() && !m_mastershipAccepted.get()) { ackImpl(uso); } } catch (Exception e) { exportLog.error("Error acking export buffer", e); } catch (Error e) { VoltDB.crashLocalVoltDB("Error acking export buffer", true, e); } } }; stashOrSubmitTask(runnable, true, false); }
Source:
public void sendResult(MutableObjectIterator<E> result) { if (iteratorFuture.isDone()) { throw new IllegalStateException("Result already done"); } iteratorFuture.complete(result); }

Target:
public void sendResult(MutableObjectIterator<E> result) { iteratorFuture.complete(result); }