auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void classSetup() { startTime = TimeHelper.combineDateTime("09/05/2016", "1000"); endTime = TimeHelper.combineDateTime("09/05/2017", "1000"); fsa = FeedbackSessionAttributes .builder(null, null, null) .withStartTime(startTime).withEndTime(endTime).withTimeZone(8).withGracePeriod(15) .withFeedbackSessionType(FeedbackSessionType.STANDARD).withOpeningEmailEnabled(false) .withClosingEmailEnabled(false).withPublishedEmailEnabled(false) .build(); }

Target:
public void classSetup() { startTime = TimeHelper.combineDateTime("09/05/2016", "1000"); endTime = TimeHelper.combineDateTime("09/05/2017", "1000"); fsa = FeedbackSessionAttributes .builder("", "", "") .withStartTime(startTime) .withEndTime(endTime) .withTimeZone(8) .withGracePeriod(15) .withFeedbackSessionType(FeedbackSessionType.STANDARD) .withOpeningEmailEnabled(false) .withClosingEmailEnabled(false) .withPublishedEmailEnabled(false) .build(); }
Source:
public void checkStorageDomainNotEqualWithStatusActive() { setStorageDomainStatus(StorageDomainStatus.Active); assertFalse(cmd.checkStorageDomainStatusNotEqual(StorageDomainStatus.Active)); List<String> messages = cmd.getReturnValue().getCanDoActionMessages(); assertEquals(messages.size(), 0); }

Target:
public void checkStorageDomainNotEqualWithStatusActive() { setStorageDomainStatus(StorageDomainStatus.Active); assertFalse(cmd.checkStorageDomainStatusNotEqual(StorageDomainStatus.Active)); List<String> messages = cmd.getReturnValue().getCanDoActionMessages(); assertEquals(messages.size(), 2); assertEquals(messages.get(0), VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2.toString()); assertEquals(messages.get(1), String.format("$status %1$s", StorageDomainStatus.Active)); }
Source:
public void testNullEncoding() throws IOException, URISyntaxException { new ReversedLinesFileReader(new File(this.getClass().getResource("/test-file-empty.bin").toURI()), (Charset) null); }

Target:
public void testNullEncoding() throws IOException, URISyntaxException { final File file = new File(temporaryFolder, "write.txt"); final String text = "Hello /u1234"; FileUtils.writeStringToFile(file, text, (Charset) null); ReversedLinesFileReader rlfr = new ReversedLinesFileReader(file, (Charset) null); assertEquals(text, rlfr.readLine()); }
Source:
protected abstract Object[] readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException; protected abstract boolean buildAnalysisSegments(ISegmentStore<ISegment> segments, IProgressMonitor monitor) throws TmfAnalysisException; @Override public @Nullable ISegmentStore<ISegment> getSegmentStore() { return fSegmentStore; }

Target:
protected abstract Object[] readObject(ObjectInputStream ois) throws ClassNotFoundException, IOException; protected abstract boolean buildAnalysisSegments(ISegmentStore<ISegment> segmentStore, IProgressMonitor monitor) throws TmfAnalysisException; @Override public @Nullable ISegmentStore<ISegment> getSegmentStore() { return fSegmentStore; }
Source:
protected List<Attribute> init(AbstractDefinition inputDefinition, ExpressionExecutor[] attributeExpressionExecutors, ExecutionPlanContext executionPlanContext) { kalmonFilterHashMap = new ConcurrentHashMap<String, ConcurrentHashMap<Integer, KalmonFilter>>(); if (attributeExpressionExecutors.length != 7) { throw new ExecutionPlanValidationException("Invalid no of arguments passed to " + "kf:kalman2DFilter() function, " + "requires 7, but found " + attributeExpressionExecutors.length); } ArrayList<Attribute> attributes = new ArrayList<Attribute>(2); attributes.add(new Attribute("kalmonLatitude", Attribute.Type.DOUBLE)); attributes.add(new Attribute("kalmonLongitude", Attribute.Type.DOUBLE)); return attributes; }

Target:
protected List<Attribute> init(AbstractDefinition inputDefinition, ExpressionExecutor[] attributeExpressionExecutors, ExecutionPlanContext executionPlanContext) { kalmonFilterHashMap = new ConcurrentHashMap<String, ConcurrentHashMap<Integer, KFRelatedValueHolder>>(); if (attributeExpressionExecutors.length != 7) { throw new ExecutionPlanValidationException("Invalid no of arguments passed to " + "kf:kalman2DFilter() function, " + "requires 7, but found " + attributeExpressionExecutors.length); } ArrayList<Attribute> attributes = new ArrayList<Attribute>(2); attributes.add(new Attribute("estimatedX", Attribute.Type.DOUBLE)); attributes.add(new Attribute("estimatedY", Attribute.Type.DOUBLE)); return attributes; }
Source:
private void atomicWriteToFile(String content, File file) throws IOException { File directory = file.getParentFile(); String fileName = file.getName() + ".tmp"; File tempFile = new File(directory, fileName); FileOutputStream out = new FileOutputStream(tempFile); IOUtils.write(content, out); out.close(); FileUtils.moveFile(tempFile, file); }

Target:
private void atomicWriteToFile(String content, File file) throws IOException { File directory = file.getParentFile(); File tempFile = File.createTempFile(file.getName(), null, directory); FileOutputStream out = new FileOutputStream(tempFile); try { IOUtils.write(content, out); } catch (IOException iox) { if (out != null) out.close(); tempFile.delete(); throw iox; } out.close(); FileSystem defaultFileSystem = FileSystems.getDefault(); Path tempFilePath = defaultFileSystem.getPath(tempFile.getCanonicalPath()); Path destinationFilePath = defaultFileSystem.getPath(file.getCanonicalPath()); try { Files.move(tempFilePath, destinationFilePath, StandardCopyOption.ATOMIC_MOVE); } catch (IOException iox) { tempFile.delete(); throw iox; } }
Source:
public Iterable<@NonNull IEventDeclaration> getEventDeclarations() { return checkNotNull(ImmutableList.copyOf(fStreamInput.getStream().getEventDeclarations())); }

Target:
public Iterable<IEventDeclaration> getEventDeclarations() { return checkNotNull(ImmutableList.copyOf(fStreamInput.getStream().getEventDeclarations())); }
Source:
public Expression visit(LazyExpression e) { insideLazyExpression = true; Expression result = super.visit(e); insideLazyExpression = false; return result; }

Target:
public Expression visit(LazyExpression e) { boolean prevCtx = insideLazyExpression; insideLazyExpression = true; Expression result = super.visit(e); insideLazyExpression = prevCtx; return result; }
Source:
private void removeCacheByKey(final Ehcache tenantCache, final String tenantRecordId) { for (String key : (List<String>) tenantCache.getKeys()) { if (key.endsWith("::" + tenantRecordId)) { tenantCache.remove(key); } } }

Target:
private void removeCacheByKey(final Ehcache tenantCache, final String tenantRecordId) { for (Object key : tenantCache.getKeys()) { if (null != key && key.toString().endsWith("::" + tenantRecordId)) { tenantCache.remove(key); } } }
Source:
public void cloneSnapshot(String s, TableName tableName, boolean b) throws IOException, TableExistsException, RestoreSnapshotException { throw new UnsupportedOperationException("cloneSnapshot"); }

Target:
public void cloneSnapshot(String s, TableName tableName, boolean b) throws IOException, TableExistsException, RestoreSnapshotException { if (!b) { this.cloneSnapshot(s, tableName); } throw new UnsupportedOperationException("cloneSnapshot"); }
Source:
public void startCycle() { if (tileAltar.getWorld() != null) tileAltar.getWorld().notifyBlockUpdate(tileAltar.getPos(), tileAltar.getWorld().getBlockState(tileAltar.getPos()), tileAltar.getWorld().getBlockState(tileAltar.getPos()), 3); checkTier(); if ((fluid == null || fluid.amount <= 0) && totalCharge <= 0) return; if (!isActive) progress = 0; if (tileAltar.getStackInSlot(0) != null) { AltarRecipe recipe = AltarRecipeRegistry.getRecipeForInput(Collections.singletonList(tileAltar.getStackInSlot(0))); if (recipe != null) { if (recipe.doesRequiredItemMatch(tileAltar.getStackInSlot(0), altarTier)) { this.isActive = true; this.recipe = recipe; this.result = recipe.getOutput() == null ? null : new ItemStack(recipe.getOutput().getItem(), 1, recipe.getOutput().getMetadata()); this.liquidRequired = recipe.getSyphon(); this.canBeFilled = recipe.isFillable(); this.consumptionRate = recipe.getConsumeRate(); this.drainRate = recipe.getDrainRate(); return; } } } isActive = false; }

Target:
public void startCycle() { if (tileAltar.getWorld() != null) tileAltar.getWorld().notifyBlockUpdate(tileAltar.getPos(), tileAltar.getWorld().getBlockState(tileAltar.getPos()), tileAltar.getWorld().getBlockState(tileAltar.getPos()), 3); checkTier(); if ((fluid == null || fluid.amount <= 0) && totalCharge <= 0) return; if (!isActive) progress = 0; if (tileAltar.getStackInSlot(0) != null) { AltarRecipe recipe = AltarRecipeRegistry.getRecipeForInput(tileAltar.getStackInSlot(0)); if (recipe != null) { if (recipe.doesRequiredItemMatch(tileAltar.getStackInSlot(0), altarTier)) { this.isActive = true; this.recipe = recipe; this.result = recipe.getOutput() == null ? null : new ItemStack(recipe.getOutput().getItem(), 1, recipe.getOutput().getMetadata()); this.liquidRequired = recipe.getSyphon(); this.canBeFilled = recipe.isFillable(); this.consumptionRate = recipe.getConsumeRate(); this.drainRate = recipe.getDrainRate(); return; } } } isActive = false; }
Source:
public void testCommentTable() { }

Target:
public void testCommentTable() { assertQueryFails("COMMENT ON TABLE orders IS 'hello'", "This connector does not support commenting tables"); }
Source:
public void setUp() throws Exception { classLoader = Thread.currentThread().getContextClassLoader(); transformers = new LocalizedXStreams(classLoader); en = transformers.get(Locale.US).getConverterLookup(); }

Target:
public void setUp() throws Exception { ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); LocalizedXStreams transformers = new LocalizedXStreams(classLoader); en = transformers.get(Locale.US).getConverterLookup(); no = transformers.get(new Locale("no")).getConverterLookup(); }
Source:
private Vector<OCFile> getFolderContent(long parentId ) { Vector<OCFile> ret = new Vector<OCFile>(); Uri req_uri = Uri.withAppendedPath( ProviderTableMeta.CONTENT_URI_DIR, String.valueOf(parentId)); Cursor c = null; if (getContentProviderClient() != null) { try { c = getContentProviderClient().query(req_uri, null, ProviderTableMeta.FILE_PARENT + "=?", new String[]{String.valueOf(parentId)}, null); } catch (RemoteException e) { Log_OC.e(TAG, e.getMessage()); return ret; } } else { c = getContentResolver().query(req_uri, null, ProviderTableMeta.FILE_PARENT + "=?", new String[]{String.valueOf(parentId)}, null); } if (c!= null) { if (c.moveToFirst()) { boolean inFolderAvailableOffline = isAnyAncestorAvailableOfflineFolder(parentId); do { OCFile child = createFileInstance(c); if (inFolderAvailableOffline) { child.setAvailableOfflineStatus(OCFile.AvailableOfflineStatus.AVAILABLE_OFFLINE_PARENT); } ret.add(child); } while (c.moveToNext()); } c.close(); } Collections.sort(ret); return ret; }

Target:
private Vector<OCFile> getFolderContent(long parentId ) { Vector<OCFile> ret = new Vector<OCFile>(); Uri req_uri = Uri.withAppendedPath( ProviderTableMeta.CONTENT_URI_DIR, String.valueOf(parentId)); Cursor c = null; if (getContentProviderClient() != null) { try { c = getContentProviderClient().query(req_uri, null, ProviderTableMeta.FILE_PARENT + "=?", new String[]{String.valueOf(parentId)}, null); } catch (RemoteException e) { Log_OC.e(TAG, e.getMessage()); return ret; } } else { c = getContentResolver().query(req_uri, null, ProviderTableMeta.FILE_PARENT + "=?", new String[]{String.valueOf(parentId)}, null); } if (c!= null) { if (c.moveToFirst()) { do { OCFile child = createFileInstance(c); ret.add(child); } while (c.moveToNext()); } c.close(); } Collections.sort(ret); return ret; }
Source:
public Response getAPIRevisions(String apiId, MessageContext messageContext) { try { APIProvider apiProvider = RestApiCommonUtil.getLoggedInUserProvider(); List<APIRevision> apiRevisions = apiProvider.getAPIRevisions(apiId); APIRevisionListDTO apiRevisionListDTO = APIMappingUtil.fromListAPIRevisiontoDTO(apiRevisions); return Response.ok().entity(apiRevisionListDTO).build(); } catch (Exception e) { String errorMessage = "Error while adding retrieving API Revision for api id : " + apiId + " - " + e.getMessage(); RestApiUtil.handleInternalServerError(errorMessage, e, log); } return null; }

Target:
public Response getAPIRevisions(String apiId, MessageContext messageContext) { try { APIProvider apiProvider = RestApiCommonUtil.getLoggedInUserProvider(); List<APIRevision> apiRevisions = apiProvider.getAPIRevisions(apiId); APIRevisionListDTO apiRevisionListDTO = APIMappingUtil.fromListAPIRevisiontoDTO(apiRevisions); return Response.ok().entity(apiRevisionListDTO).build(); } catch (APIManagementException e) { String errorMessage = "Error while adding retrieving API Revision for api id : " + apiId + " - " + e.getMessage(); RestApiUtil.handleInternalServerError(errorMessage, e, log); } return null; }
Source:
protected List<KiePMMLModel> getKiePMMLModelsFromResource(KnowledgeBuilderImpl kbuilderImpl, Resource resource) { String[] classNamePackageName = getFactoryClassNamePackageName(resource); String factoryClassName = classNamePackageName[0]; String packageName = classNamePackageName[1]; try { final Class<? extends KiePMMLModelFactory> aClass = (Class<? extends KiePMMLModelFactory>) Class.forName(packageName + "." + factoryClassName); return aClass.newInstance().getKiePMMLModels(); } catch (ClassNotFoundException e) { logger.info(String.format("%s not found in kjar, going to compile model", factoryClassName)); } catch (Exception e) { throw new KiePMMLException("Exception while instantiating " + factoryClassName, e); } PMMLCompiler pmmlCompiler = kbuilderImpl.getCachedOrCreate(PMML_COMPILER_CACHE_KEY, () -> getCompiler(kbuilderImpl)); try { return pmmlCompiler.getModels(resource.getInputStream(), kbuilderImpl); } catch (IOException e) { throw new ExternalException("ExternalException", e); } }

Target:
protected List<KiePMMLModel> getKiePMMLModelsFromResource(KnowledgeBuilderImpl kbuilderImpl, Resource resource) { String[] classNamePackageName = getFactoryClassNamePackageName(resource); String factoryClassName = classNamePackageName[0]; String packageName = classNamePackageName[1]; String fullFactoryClassName = packageName + "." + factoryClassName; try { final Class<? extends KiePMMLModelFactory> aClass = (Class<? extends KiePMMLModelFactory>) kbuilderImpl.getRootClassLoader().loadClass(fullFactoryClassName); return aClass.newInstance().getKiePMMLModels(); } catch (ClassNotFoundException e) { logger.info(String.format("%s class not found in rootClassLoader, going to compile model", fullFactoryClassName)); } catch (Exception e) { throw new KiePMMLException("Exception while instantiating " + fullFactoryClassName, e); } PMMLCompiler pmmlCompiler = kbuilderImpl.getCachedOrCreate(PMML_COMPILER_CACHE_KEY, () -> getCompiler(kbuilderImpl)); try { return pmmlCompiler.getModels(resource.getInputStream(), kbuilderImpl); } catch (IOException e) { throw new ExternalException("ExternalException", e); } }
Source:
public void testOneTouchPlay() throws Exception { HdmiCecUtils hdmiCecUtils = new HdmiCecUtils(CecDevice.PLAYBACK_1, "1.0.0.0"); if (hdmiCecUtils.init()) { try { ITestDevice device = getDevice(); assertNotNull("Device not set", device); device.executeShellCommand("input keyevent KEYCODE_HOME"); hdmiCecUtils.checkExpectedOutput(CecDevice.TV, CecMessage.TEXT_VIEW_ON); hdmiCecUtils.checkExpectedOutput(CecMessage.ACTIVE_SOURCE); } finally { hdmiCecUtils.killCecProcess(); } } }

Target:
public void testOneTouchPlay() throws Exception { HdmiCecUtils hdmiCecUtils = new HdmiCecUtils(CecDevice.PLAYBACK_1, "1.0.0.0"); if (hdmiCecUtils.init()) { try { ITestDevice device = getDevice(); assertNotNull("Device not set", device); device.executeShellCommand("input keyevent KEYCODE_HOME"); hdmiCecUtils.checkExpectedOutput(CecDevice.TV, CecMessage.TEXT_VIEW_ON); String message = hdmiCecUtils.checkExpectedOutput(CecMessage.ACTIVE_SOURCE); assertEquals(PHYSICAL_ADDRESS, hdmiCecUtils.getParamsFromMessage(message)); } finally { hdmiCecUtils.killCecProcess(); } } }
Source:
public void start() { hWordle.setAlignment(Pos.CENTER); hWordle.setPadding(new Insets(20)); hWordle.prefWidthProperty().bind(root.widthProperty()); hWordle.prefHeightProperty().bind(root.heightProperty()); root.setCenter(hWordle); try { System.out.println("** 1. Creating Tag Cloud for " + searchText); buildTagCloud(tweeter.search(new TweetQuery().query(searchText).count(100))); createWordle(); } catch (TweetException ex) { System.out.println("Error Twitter: " + ex); return; } System.out.println("** 2. Starting new Tweets search for " + searchText); showTweetsExecutor.execute(showTweetsTask); }

Target:
public void start() { hWordle.setAlignment(Pos.CENTER); hWordle.setPadding(new Insets(20)); hWordle.prefWidthProperty().bind(root.widthProperty()); hWordle.prefHeightProperty().bind(root.heightProperty()); root.setCenter(hWordle); System.out.println("** 1. Creating Tag Cloud for " + tweetSetData.getSearchText()); tweetSetData.buildTree(100); createWordle(); System.out.println("** 2. Starting new Tweets search for " + tweetSetData.getSearchText()); showTweetsExecutor.execute(new ShowTweetsTask()); }
Source:
private File testResource(String baseName) { return new File(new File("k-distribution/src/test/resources" + baseName) .getAbsoluteFile().toString().replaceAll("k-distribution.k-distribution", "k-distribution")); }

Target:
private File testResource(String baseName) { return new File(new File("k-distribution/src/test/resources" + baseName) .getAbsoluteFile().toString().replace("k-distribution" + File.separator + "k-distribution", "k-distribution")); }
Source:
public RegistryEntry getRegistryEntry(String key) { MediationRegistryEntryImpl entryEmbedded = new MediationRegistryEntryImpl(); try { URL url = new URL(resolveRegistryPath(key)); if ("file".equals(url.getProtocol())) { try { url.openStream(); } catch (FileNotFoundException e) { return entryEmbedded; } catch (IOException e) { log.error("Error occurred while accessing registry resource: " + key, e); return null; } } URLConnection urlc = url.openConnection(); entryEmbedded.setKey(key); entryEmbedded.setName(url.getFile()); entryEmbedded.setType(ESBRegistryConstants.FILE); entryEmbedded.setDescription("Resource at : " + url.toString()); entryEmbedded.setLastModified(urlc.getLastModified()); entryEmbedded.setVersion(urlc.getLastModified()); if (urlc.getExpiration() > 0) { entryEmbedded.setCachableDuration( urlc.getExpiration() - System.currentTimeMillis()); } else { entryEmbedded.setCachableDuration(getCachableDuration()); } } catch (MalformedURLException e) { handleException("Invalid URL reference " + resolveRegistryPath(key), e); } catch (IOException e) { handleException("IO Error reading from URL " + resolveRegistryPath(key), e); } return entryEmbedded; }

Target:
public RegistryEntry getRegistryEntry(String key) { MediationRegistryEntryImpl entryEmbedded = new MediationRegistryEntryImpl(); try { URL url = new URL(resolveRegistryPath(key)); if ("file".equals(url.getProtocol())) { try { url.openStream(); } catch (IOException e) { log.error("Error occurred while accessing registry resource: " + key, e); return null; } } URLConnection urlc = url.openConnection(); entryEmbedded.setKey(key); entryEmbedded.setName(url.getFile()); entryEmbedded.setType(ESBRegistryConstants.FILE); entryEmbedded.setDescription("Resource at : " + url.toString()); entryEmbedded.setLastModified(urlc.getLastModified()); entryEmbedded.setVersion(urlc.getLastModified()); if (urlc.getExpiration() > 0) { entryEmbedded.setCachableDuration( urlc.getExpiration() - System.currentTimeMillis()); } else { entryEmbedded.setCachableDuration(getCachableDuration()); } } catch (MalformedURLException e) { handleException("Invalid URL reference " + resolveRegistryPath(key), e); } catch (IOException e) { handleException("IO Error reading from URL " + resolveRegistryPath(key), e); } return entryEmbedded; }
Source:
private void enterLoggedInState() { Stage stage = StageHolder.getStage(); stage.setTitle(mainWindowTitle); getMainScene().setContent(mainRoot); getMainScene().setMoveControl(mainRoot); if (preferencesService.getPreferences().isPrereleaseCheckEnabled()) { clientUpdateService.checkForRegularUpdateInBackground(); } else { clientUpdateService.checkForBetaUpdateInBackground(); } gamePathHandler.detectAndUpdateGamePath(); restoreLastView(); }

Target:
private void enterLoggedInState() { Stage stage = StageHolder.getStage(); stage.setTitle(mainWindowTitle); getMainScene().setContent(mainRoot); getMainScene().setMoveControl(mainRoot); applicationEventPublisher.publishEvent(new LoggedInEvent()); gamePathHandler.detectAndUpdateGamePath(); restoreLastView(); }
Source:
public void testTidyDatabaseList() { Set<File> databases = new HashSet<File>(); databases.add(new File("foo.db")); databases.add(new File("foo.db-journal")); databases.add(new File("bar.db")); databases.add(new File("bar.db-journal")); databases.add(new File("bar.db-uid")); databases.add(new File("baz.db")); databases.add(new File("baz.db-somethingelse")); databases.add(new File("dangling.db-journal")); File[] expected = { new File("foo.db"), new File("bar.db"), new File("baz.db"), new File("baz.db-somethingelse"), new File("dangling.db-journal") }; List<File> tidied = DatabasePeerManager.tidyDatabaseList(databases); assertEquals(expected.length, tidied.size()); assertEquals(true, tidied.containsAll(Arrays.asList(expected))); }

Target:
public void testTidyDatabaseList() { File[] databases = { new File("foo.db"), new File("foo.db-journal"), new File("bar.db"), new File("bar.db-journal"), new File( "bar.db-uid"), new File("baz.db"), new File("baz.db-somethingelse"), new File("dangling.db-journal"), }; File[] expected = { new File( "foo.db"), new File("bar.db"), new File("baz.db"), new File("baz.db-somethingelse"), new File("dangling.db-journal") }; List<File> tidied = DatabasePeerManager.tidyDatabaseList(Arrays.asList(databases)); assertArrayEquals(expected, tidied.toArray()); }
Source:
public OracleQueryRewriter(JdbcDataContext dataContext) { super(dataContext, 11); }

Target:
public OracleQueryRewriter(JdbcDataContext dataContext) { super(dataContext, FIRST_FETCH_SUPPORTING_VERSION); }
Source:
public void testCorrectHeaderFormatWithNodeId() { UserAgent baseUserAgent = UserAgent.of(UserAgent.Agent.of("service", "1.0.0"), "nodeId"); assertThat(UserAgents.format(baseUserAgent)).isEqualTo("service/1.0.0 (nodeId:nodeId)"); UserAgent derivedAgent = baseUserAgent.addAgent(UserAgent.Agent.of("remoting", "2.0.0")); assertThat(UserAgents.format(derivedAgent)).isEqualTo("service/1.0.0 (nodeId:nodeId), remoting/2.0.0"); }

Target:
public void testCorrectHeaderFormatWithNodeId() { UserAgent baseUserAgent = UserAgent.of(UserAgent.Agent.of("service", "1.0.0"), "myNode"); assertThat(UserAgents.format(baseUserAgent)).isEqualTo("service/1.0.0 (nodeId:myNode)"); UserAgent derivedAgent = baseUserAgent.addAgent(UserAgent.Agent.of("remoting", "2.0.0")); assertThat(UserAgents.format(derivedAgent)).isEqualTo("service/1.0.0 (nodeId:myNode), remoting/2.0.0"); }
Source:
public boolean isVerboseEnabled() { return !verbose.isEmpty(); }

Target:
public boolean isVerboseEnabled() { return isVerbose; }
Source:
private void parseRClass(String respectivePackageName, String rClass) { Element element; try { element = elementUtils.getTypeElement(rClass); } catch (MirroredTypeException mte) { element = typeUtils.asElement(mte.getTypeMirror()); } JCTree tree = (JCTree) trees.getTree(element); if (tree != null) { IdScanner idScanner = new IdScanner(symbols, respectivePackageName); tree.accept(idScanner); } else { parseCompiledR(respectivePackageName, (TypeElement) element); } }

Target:
private void parseRClass(String respectivePackageName, String rClass) { Element element; try { element = elementUtils.getTypeElement(rClass); } catch (MirroredTypeException mte) { element = typeUtils.asElement(mte.getTypeMirror()); } JCTree tree = (JCTree) trees.getTree(element); if (tree != null) { IdScanner idScanner = new IdScanner(symbols, elementUtils.getPackageOf(element) .getQualifiedName().toString(), respectivePackageName); tree.accept(idScanner); } else { parseCompiledR(respectivePackageName, (TypeElement) element); } }
Source:
public synchronized SSLContext getDefaultSSLContext() throws X509Exception.SSLContextException { if (defaultSSLContext == null) { defaultSSLContext = createSSLContext(); } return defaultSSLContext; }

Target:
public SSLContext getDefaultSSLContext() throws X509Exception.SSLContextException { SSLContext result = defaultSSLContext.get(); if (result == null) { result = createSSLContext(); if (!defaultSSLContext.compareAndSet(null, result)) { result = defaultSSLContext.get(); } } return result; }
Source:
public void hostsFailed(Set<Integer> failedHosts) { m_failedHostExecutorService.submit(new Runnable() { @Override public void run() { if (m_leaderAppointer.isLeader() && m_cartographer.hasPartitionMastersOnHosts(failedHosts)) { VoltZK.createMpRepairBlocker(m_messenger.getZK(), hostLog); } if (!m_leaderAppointer.isClusterKSafe(failedHosts)) { VoltDB.crashLocalVoltDB("Some partitions have no replicas. Cluster has become unviable.", false, null); return; } handleHostsFailedForMigratePartitionLeader(failedHosts); acceptExportStreamMastership(failedHosts); if (m_cartographer.isPartitionZeroLeader() || isFirstZeroPartitionReplica(failedHosts)) { for (int hostId : failedHosts) { m_snmp.hostDown(FaultLevel.ERROR, hostId, "Host left cluster mesh due to connection loss"); } final int missing = m_leaderAppointer.getKSafetyStatsSet().stream() .max((s1,s2) -> s1.getMissingCount() - s2.getMissingCount()) .map(s->s.getMissingCount()).orElse(failedHosts.size()); final int expected = m_clusterSettings.getReference().hostcount(); m_snmp.statistics(FaultFacility.CLUSTER, "Node lost. Cluster is down to " + (expected - missing) + " members out of original "+ expected + "."); } for (int hostId : failedHosts) { CoreZK.removeRejoinNodeIndicatorForHost(m_messenger.getZK(), hostId); VoltZK.removeStopNodeIndicator(m_messenger.getZK(), ZKUtil.joinZKPath(VoltZK.host_ids_be_stopped, Integer.toString(hostId)), hostLog); m_messenger.removeStopNodeNotice(hostId); } stopRejoiningHost(); m_clientInterface.handleFailedHosts(failedHosts); } }); }

Target:
public void hostsFailed(Set<Integer> failedHosts) { m_failedHostExecutorService.submit(new Runnable() { @Override public void run() { if (m_leaderAppointer.isLeader() && m_cartographer.hasPartitionMastersOnHosts(failedHosts)) { VoltZK.createActionBlocker(m_messenger.getZK(), VoltZK.mpRepairInProgress, CreateMode.EPHEMERAL, hostLog, "MP Repair"); } if (!m_leaderAppointer.isClusterKSafe(failedHosts)) { VoltDB.crashLocalVoltDB("Some partitions have no replicas. Cluster has become unviable.", false, null); return; } handleHostsFailedForMigratePartitionLeader(failedHosts); acceptExportStreamMastership(failedHosts); if (m_cartographer.isPartitionZeroLeader() || isFirstZeroPartitionReplica(failedHosts)) { for (int hostId : failedHosts) { m_snmp.hostDown(FaultLevel.ERROR, hostId, "Host left cluster mesh due to connection loss"); } final int missing = m_leaderAppointer.getKSafetyStatsSet().stream() .max((s1,s2) -> s1.getMissingCount() - s2.getMissingCount()) .map(s->s.getMissingCount()).orElse(failedHosts.size()); final int expected = m_clusterSettings.getReference().hostcount(); m_snmp.statistics(FaultFacility.CLUSTER, "Node lost. Cluster is down to " + (expected - missing) + " members out of original "+ expected + "."); } for (int hostId : failedHosts) { CoreZK.removeRejoinNodeIndicatorForHost(m_messenger.getZK(), hostId); VoltZK.removeStopNodeIndicator(m_messenger.getZK(), ZKUtil.joinZKPath(VoltZK.host_ids_be_stopped, Integer.toString(hostId)), hostLog); m_messenger.removeStopNodeNotice(hostId); } stopRejoiningHost(); m_clientInterface.handleFailedHosts(failedHosts); } }); }
Source:
@Override public void tag(String tag) throws IgniteCheckedException { if (tag == null || tag.isEmpty()) throw new IgniteCheckedException("Please provide not-null and not empty string for cluster tag"); if (tag.length() > MAX_TAG_LENGTH) throw new IgniteCheckedException("Maximum tag length is exceeded, max length is " + MAX_TAG_LENGTH + " symbols, provided value has " + tag.length() + " symbols."); if (!ctx.state().publicApiActiveState(true)) throw new IgniteCheckedException("Can not change cluster tag on inactive cluster. To activate the cluster call Ignite.active(true)."); ctx.cluster().updateTag(tag); }

Target:
@Override public void tag(String tag) throws IgniteCheckedException { if (tag == null || tag.isEmpty()) throw new IgniteCheckedException("Please provide not-null and not empty string for cluster tag"); if (tag.length() > MAX_TAG_LENGTH) { throw new IgniteCheckedException("Maximum tag length is exceeded, max length is " + MAX_TAG_LENGTH + " symbols, provided value has " + tag.length() + " symbols."); } if (!ctx.state().publicApiActiveState(true)) throw new IgniteCheckedException("Can not change cluster tag on inactive cluster. To activate the cluster call Ignite.active(true)."); ctx.cluster().updateTag(tag); }
Source:
public boolean hasWindowOrJoins() { Set<OperatorSpec> operatorSpecs = getAllOperatorSpecs(); Set<OperatorSpec> windowOrJoinSpecs = operatorSpecs.stream() .filter(spec -> spec.getOpCode() == OperatorSpec.OpCode.WINDOW || spec.getOpCode() == OperatorSpec.OpCode.JOIN) .collect(Collectors.toSet()); return windowOrJoinSpecs.size() != 0; }

Target:
public boolean hasWindowOrJoins() { Collection<OperatorSpec> operatorSpecs = getAllOperatorSpecs(); Set<OperatorSpec> windowOrJoinSpecs = operatorSpecs.stream() .filter(spec -> spec.getOpCode() == OperatorSpec.OpCode.WINDOW || spec.getOpCode() == OperatorSpec.OpCode.JOIN) .collect(Collectors.toSet()); return windowOrJoinSpecs.size() != 0; }
Source:
public Optional<String> checkValue(String value) { if (StringUtil.isBlank(value)) { return Optional.empty(); } if (value.equals(FIRST_EDITION)) { return Optional.of(Localization.lang("edition of book reported as just 1")); } if (bibDatabaseContextEdition.isBiblatexMode() && !ONLY_NUMERALS_OR_LITERALS.test(value.trim())) { return Optional.of(Localization.lang("should contain an integer or a literal")); } if (!bibDatabaseContextEdition.isBiblatexMode()) { if (!isFirstCharDigit(value) && (!allowIntegerEdition) && !FIRST_LETTER_CAPITALIZED.test(value.trim())) { return Optional.of(Localization.lang("should have the first letter capitalized")); } else { if (ONLY_NUMERALS.test(value.trim()) && (!allowIntegerEdition) && !FIRST_LETTER_CAPITALIZED.test(value.trim())) { return Optional.of(Localization.lang("should have the first letter capitalized")); } } } return Optional.empty(); }

Target:
public Optional<String> checkValue(String value) { if (StringUtil.isBlank(value)) { return Optional.empty(); } if (value.equals(FIRST_EDITION)) { return Optional.of(Localization.lang("edition of book reported as just 1")); } if (bibDatabaseContextEdition.isBiblatexMode()) { if (!ONLY_NUMERALS_OR_LITERALS.test(value.trim())) { return Optional.of(Localization.lang("should contain an integer or a literal")); } } else { if (ONLY_NUMERALS.test(value) && (!allowIntegerEdition)) { return Optional.of(Localization.lang("no integer as values for edition allowed")); } } if (!isFirstCharDigit(value) && !FIRST_LETTER_CAPITALIZED.test(value.trim())) { return Optional.of(Localization.lang("should have the first letter capitalized")); } return Optional.empty(); }
Source:
public AsyncJobStatus setContextOwner(Owner owner) { if (owner != null && owner.getId() == null) { throw new IllegalArgumentException("owner is null and lacks an ID"); } if (owner != null) { this.owner = owner; this.ownerId = owner.getId(); } else { this.owner = null; this.ownerId = null; } return this; }

Target:
public AsyncJobStatus setContextOwner(Owner owner) { if (owner != null) { if (owner.getId() == null) { throw new IllegalArgumentException("provided owner lacks an ID"); } this.owner = owner; this.ownerId = owner.getId(); } else { this.owner = null; this.ownerId = null; } return this; }
Source:
public void ack(Tuple input) { if(stormIdName != null && input.contains(stormIdName)) { String stormId = input.getStringByField(stormIdName); Monitor.getMonitor().endLatency(pair(input), boltService, stormIdName, stormId, null ); } else { Monitor.getMonitor().endLatency(pair(input), boltService, null ); } super.ack(input); }

Target:
public void ack(Tuple input) { if(stormIdName.isPresent() && input.contains(stormIdName.get())) { String stormId = input.getStringByField(stormIdName.get()); Monitor.getMonitor().endLatency(pair(input), boltService, stormIdName.get(), stormId, null ); } else { Monitor.getMonitor().endLatency(pair(input), boltService, null); } super.ack(input); }
Source:
private DomainMonitoringResult analyzeDomainReport(VDSDomainsData tempData, StoragePool storagePool, boolean isLog) { if (!tempData.isActual() && FeatureSupported.reportWhetherDomainMonitoringResultIsActual(storagePool.getCompatibilityVersion())) { log.error("Domain '{}' report isn't an actual report", getDomainIdTuple(tempData.getDomainId())); return DomainMonitoringResult.NOT_ACTUAL; } if (tempData.getCode() != 0) { if (isLog) { log.error("Domain '{}' was reported with error code '{}'", getDomainIdTuple(tempData.getDomainId()), tempData.getCode()); } if (tempData.getCode() == VdcBllErrors.StorageDomainDoesNotExist.getValue() || tempData.getCode() == VdcBllErrors.StorageException.getValue()) { return DomainMonitoringResult.STORAGE_ACCCESS_ERROR; } return DomainMonitoringResult.PROBLEMATIC; } if (tempData.getLastCheck() > Config .<Double> getValue(ConfigValues.MaxStorageVdsTimeoutCheckSec)) { if (isLog) { log.error("Domain '{}' check timeout '{}' is too big", getDomainIdTuple(tempData.getDomainId()), tempData.getLastCheck()); } return DomainMonitoringResult.PROBLEMATIC; } return DomainMonitoringResult.OK; }

Target:
private DomainMonitoringResult analyzeDomainReport(VDSDomainsData tempData, StoragePool storagePool, boolean isLog) { if (!tempData.isActual() && FeatureSupported.reportWhetherDomainMonitoringResultIsActual(storagePool.getCompatibilityVersion())) { log.warn("Domain '{}' report isn't an actual report", getDomainIdTuple(tempData.getDomainId())); return DomainMonitoringResult.NOT_ACTUAL; } if (tempData.getCode() != 0) { if (isLog) { log.error("Domain '{}' was reported with error code '{}'", getDomainIdTuple(tempData.getDomainId()), tempData.getCode()); } if (tempData.getCode() == VdcBllErrors.StorageDomainDoesNotExist.getValue() || tempData.getCode() == VdcBllErrors.StorageException.getValue()) { return DomainMonitoringResult.STORAGE_ACCCESS_ERROR; } return DomainMonitoringResult.PROBLEMATIC; } if (tempData.getLastCheck() > Config .<Double> getValue(ConfigValues.MaxStorageVdsTimeoutCheckSec)) { if (isLog) { log.error("Domain '{}' check timeout '{}' is too big", getDomainIdTuple(tempData.getDomainId()), tempData.getLastCheck()); } return DomainMonitoringResult.PROBLEMATIC; } return DomainMonitoringResult.OK; }
Source:
public static boolean isShowingEntireContents(StyledText widget) { if (widget.getTopPixel() != 0) return false; int lastVisiblePixel= computeLastVisiblePixel(widget); int bottom= widget.getLineIndex(lastVisiblePixel); if (bottom + 1 < widget.getLineCount()) return false; int bottomLastPixel= getLinePixel(widget, bottom + 1) - 1; return bottomLastPixel <= lastVisiblePixel; }

Target:
public static boolean isShowingEntireContents(StyledText widget) { if (widget.getTopPixel() != 0) { return false; } int lastVisiblePixel= computeLastVisiblePixel(widget); int bottom= widget.getLineIndex(lastVisiblePixel); if (bottom + 1 < widget.getLineCount()) { return false; } int bottomLastPixel= getLinePixel(widget, bottom + 1) - 1; return bottomLastPixel <= lastVisiblePixel; }
Source:
private Plugin loadPlugin(String name, File srcPlugin, FileSnapshot snapshot) throws IOException, ClassNotFoundException, InvalidPluginException { File tmp; FileInputStream in = new FileInputStream(srcPlugin); String extension = getExtension(srcPlugin); try { tmp = asTemp(in, tempNameFor(name), extension, tmpDir); } finally { in.close(); } String pluginName = srcPlugin.getName(); if (isJarPlugin(pluginName)) { return loadJarPlugin(name, srcPlugin, snapshot, tmp); } else if (isJsPlugin(pluginName)) { return loadJsPlugin(name, srcPlugin, snapshot); } else { throw new RuntimeException("Unsupported plugin type"); } }

Target:
private Plugin loadPlugin(String name, File srcPlugin, FileSnapshot snapshot) throws IOException, ClassNotFoundException, InvalidPluginException { String pluginName = srcPlugin.getName(); if (isJarPlugin(pluginName)) { File tmp; FileInputStream in = new FileInputStream(srcPlugin); String extension = getExtension(srcPlugin); try { tmp = asTemp(in, tempNameFor(name), extension, tmpDir); } finally { in.close(); } return loadJarPlugin(name, srcPlugin, snapshot, tmp); } else if (isJsPlugin(pluginName)) { return loadJsPlugin(name, srcPlugin, snapshot); } else { throw new InvalidPluginException(String.format( "Unsupported plugin type: ", srcPlugin.getName())); } }
Source:
public TargetRoll getAllModsForMaintenance() { TargetRoll mods = new TargetRoll(campaign.getCampaignOptions().getMaintenanceBonus(), "maintenance"); mods.addModifier(Availability.getTechModifier(getTechRating()), "tech rating " + ITechnology.getRatingName(getTechRating())); if(null != getUnit()) { mods.append(getUnit().getSiteMod()); if(getUnit().getEntity().hasQuirk("easy_maintain")) { mods.addModifier(-1, "easy to maintain"); } else if(getUnit().getEntity().hasQuirk("difficult_maintain")) { mods.addModifier(1, "difficult to maintain"); } if(isClanTechBase() || (this instanceof MekLocation && getUnit().getEntity().isClan())) { if (getUnit().getTech() == null) { mods.addModifier(2, "Clan tech"); } else if (!getUnit().getTech().isClanner() && !getUnit().getTech().getOptions().booleanOption(PersonnelOptions.TECH_CLAN_TECH_KNOWLEDGE)) { mods.addModifier(2, "Clan tech"); } } } if(campaign.getCampaignOptions().useQualityMaintenance()) { switch(quality) { case QUALITY_A: mods.addModifier(3, "Quality A"); break; case QUALITY_B: mods.addModifier(2, "Quality B"); break; case QUALITY_C: mods.addModifier(1, "Quality C"); break; case QUALITY_D: mods.addModifier(0, "Quality D"); break; case QUALITY_E: mods.addModifier(-1, "Quality E"); break; case QUALITY_F: mods.addModifier(-2, "Quality F"); break; } } return mods; }

Target:
public TargetRoll getAllModsForMaintenance() { TargetRoll mods = new TargetRoll(campaign.getCampaignOptions().getMaintenanceBonus(), "maintenance"); mods.addModifier(Availability.getTechModifier(getTechRating()), "tech rating " + ITechnology.getRatingName(getTechRating())); if (null != getUnit()) { mods.append(getUnit().getSiteMod()); if (getUnit().getEntity().hasQuirk("easy_maintain")) { mods.addModifier(-1, "easy to maintain"); } else if (getUnit().getEntity().hasQuirk("difficult_maintain")) { mods.addModifier(1, "difficult to maintain"); } if (isClanTechBase() || ((this instanceof MekLocation) && getUnit().getEntity().isClan())) { if (getUnit().getTech() == null) { mods.addModifier(2, "Clan tech"); } else if (!getUnit().getTech().isClanner() && !getUnit().getTech().getOptions().booleanOption(PersonnelOptions.TECH_CLAN_TECH_KNOWLEDGE)) { mods.addModifier(2, "Clan tech"); } } } if(campaign.getCampaignOptions().useQualityMaintenance()) { switch(quality) { case QUALITY_A: mods.addModifier(3, "Quality A"); break; case QUALITY_B: mods.addModifier(2, "Quality B"); break; case QUALITY_C: mods.addModifier(1, "Quality C"); break; case QUALITY_D: mods.addModifier(0, "Quality D"); break; case QUALITY_E: mods.addModifier(-1, "Quality E"); break; case QUALITY_F: mods.addModifier(-2, "Quality F"); break; } } return mods; }
Source:
public void testListAvailableContainers() { final long count = testingPostgres.runSelectStatement("select count(*) from tool where ispublished='f'", long.class); assertEquals("there should be 4 entries, there are " + count, 6, count); }

Target:
public void testListAvailableContainers() { final long count = testingPostgres.runSelectStatement("select count(*) from tool where ispublished='f'", long.class); assertEquals("unpublished entries should match", 6, count); }
Source:
public synchronized void init(HiveConf hiveConf) { if (getServiceState() == STATE.NOTINITED) { conf = hiveConf; conf.setVar(HiveConf.ConfVars.HIVE_SESSION_IMPL_CLASSNAME, GrillSessionImpl.class.getCanonicalName()); cliService = new CLIService(); addService(cliService); addService(new EventServiceImpl(GrillEventService.NAME)); addService(new MetricsServiceImpl(MetricsService.NAME)); String[] serviceNames = conf.getStrings(GrillConfConstants.GRILL_SERVICE_NAMES); for (String sName : serviceNames) { try { Class<? extends GrillService> serviceClass = conf.getClass( GrillConfConstants.getServiceImplConfKey(sName), null, GrillService.class); LOG.info("Adding " + sName + " service with " + serviceClass); Constructor<?> constructor = serviceClass.getConstructor(CLIService.class); GrillService service = (GrillService) constructor.newInstance(new Object[] {cliService}); addService(service); grillServices.add(service); } catch (Exception e) { LOG.warn("Could not add service:" + sName, e); throw new WebApplicationException(e); } } for (Service svc : getServices()) { services.put(svc.getName(), svc); } super.init(conf); String persistPathStr = conf.get(GrillConfConstants.GRILL_SERVER_PERSIST_LOCATION, GrillConfConstants.DEFAULT_GRILL_SERVER_PERSIST_LOCATION); persistDir = new Path(persistPathStr); try { setupPersistedState(); } catch (Exception e) { LOG.error("Could not setup persisted state", e); throw new WebApplicationException(e); } LOG.info("Initialized grill services: " + services.keySet().toString()); } }

Target:
public synchronized void init(HiveConf hiveConf) { if (getServiceState() == STATE.NOTINITED) { conf = hiveConf; conf.setVar(HiveConf.ConfVars.HIVE_SESSION_IMPL_CLASSNAME, GrillSessionImpl.class.getCanonicalName()); cliService = new CLIService(); addService(cliService); addService(new EventServiceImpl(GrillEventService.NAME)); addService(new MetricsServiceImpl(MetricsService.NAME)); String[] serviceNames = conf.getStrings(GrillConfConstants.GRILL_SERVICE_NAMES); for (String sName : serviceNames) { try { Class<? extends GrillService> serviceClass = conf.getClass( GrillConfConstants.getServiceImplConfKey(sName), null, GrillService.class); LOG.info("Adding " + sName + " service with " + serviceClass); Constructor<?> constructor = serviceClass.getConstructor(CLIService.class); GrillService service = (GrillService) constructor.newInstance(new Object[] {cliService}); addService(service); grillServices.add(service); } catch (Exception e) { LOG.warn("Could not add service:" + sName, e); throw new RuntimeException("Could not add service:" + sName, e); } } for (Service svc : getServices()) { services.put(svc.getName(), svc); } super.init(conf); String persistPathStr = conf.get(GrillConfConstants.GRILL_SERVER_PERSIST_LOCATION, GrillConfConstants.DEFAULT_GRILL_SERVER_PERSIST_LOCATION); persistDir = new Path(persistPathStr); try { setupPersistedState(); } catch (Exception e) { LOG.error("Could not recover from persisted state", e); throw new RuntimeException("Could not recover from persisted state", e); } LOG.info("Initialized grill services: " + services.keySet().toString()); } }
Source:
public Rule deepCopy() { Rule rule = null; try { rule = getClass().newInstance(); } catch (InstantiationException | IllegalAccessException e) { } rule.setName(getName()); rule.setLanguage(getLanguage()); rule.setMinimumLanguageVersion(getMinimumLanguageVersion()); rule.setMaximumLanguageVersion(getMaximumLanguageVersion()); rule.setSince(getSince()); rule.setMessage(getMessage()); rule.setRuleSetName(getRuleSetName()); rule.setExternalInfoUrl(getExternalInfoUrl()); if (usesDFA()) { rule.setUsesDFA(); } if (usesTypeResolution()) { rule.setUsesTypeResolution(); } if (usesMetrics()) { rule.setUsesMetrics(); } rule.setDescription(getDescription()); for (final String example : getExamples()) { rule.addExample(example); } rule.setPriority(getPriority()); for (final PropertyDescriptor<?> prop : getPropertyDescriptors()) { final PropertyDescriptor<?> existingProp = rule.getPropertyDescriptor(prop.name()); if (existingProp == null) { rule.definePropertyDescriptor(prop); } rule.setProperty((PropertyDescriptor<Object>) prop, getProperty((PropertyDescriptor<Object>) prop)); } return rule; }

Target:
public Rule deepCopy() { Rule rule = null; try { rule = getClass().newInstance(); } catch (InstantiationException | IllegalAccessException e) { } rule.setName(getName()); rule.setLanguage(getLanguage()); rule.setMinimumLanguageVersion(getMinimumLanguageVersion()); rule.setMaximumLanguageVersion(getMaximumLanguageVersion()); rule.setSince(getSince()); rule.setMessage(getMessage()); rule.setRuleSetName(getRuleSetName()); rule.setExternalInfoUrl(getExternalInfoUrl()); if (usesDFA()) { rule.setUsesDFA(); } if (usesTypeResolution()) { rule.setUsesTypeResolution(); } if (usesMetrics()) { rule.setUsesMetrics(); } rule.setDescription(getDescription()); for (final String example : getExamples()) { rule.addExample(example); } rule.setPriority(getPriority()); for (final PropertyDescriptor<?> prop : getPropertyDescriptors()) { if (!rule.hasDescriptor(prop)) { rule.definePropertyDescriptor(prop); } rule.setProperty((PropertyDescriptor<Object>) prop, getProperty((PropertyDescriptor<Object>) prop)); } return rule; }
Source:
public void pillowfight(String targetHostnameAndPort, String bucket, String username, String password, Integer iterations, Integer numItems, String keyPrefix, Integer numThreads, Integer numInstances, Integer randomSeed, Integer ratio, Integer minSize, Integer maxSize) { ((CouchbaseLoadGeneratorDriver)getDriver()).pillowfight(targetHostnameAndPort, bucket, username, password, iterations, numItems, keyPrefix, numThreads, numInstances, randomSeed, ratio, minSize, maxSize); }

Target:
public void pillowfight(String targetHostnameAndPort, String bucket, String username, String password, Integer iterations, Integer numItems, String keyPrefix, Integer numThreads, Integer numInstances, Integer randomSeed, Integer ratio, Integer minSize, Integer maxSize) { getDriver().pillowfight(targetHostnameAndPort, bucket, username, password, iterations, numItems, keyPrefix, numThreads, numInstances, randomSeed, ratio, minSize, maxSize); }
Source:
public void handleNewSession() { LOG.info("ZkStateChangeListener:: A new session established."); }

Target:
public void handleNewSession() { LOG.info("ZkStateChangeListener::A new session has been established."); }
Source:
public void initialise() { playerCamera = worldRenderer.getActiveCamera(); sceneOpaqueFbo = displayResolutionDependentFBOs.get(SCENE_OPAQUE); wireframeStateChange = new SetWireframe(true); renderingDebugConfig = config.getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); addDesiredStateChange(new LookThrough(playerCamera)); addDesiredStateChange(new SetViewportToSizeOf(SCENE_OPAQUE, displayResolutionDependentFBOs)); addDesiredStateChange(new EnableMaterial(CHUNK_SHADER.toString())); chunkShader = getMaterial(CHUNK_SHADER); }

Target:
public void initialise() { wireframeStateChange = new SetWireframe(true); renderingDebugConfig = config.getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); addDesiredStateChange(new SetViewportToSizeOf(READONLY_GBUFFER, displayResolutionDependentFBOs)); sceneOpaqueFbo = displayResolutionDependentFBOs.get(READONLY_GBUFFER); addDesiredStateChange(new EnableMaterial(CHUNK_SHADER.toString())); chunkShader = getMaterial(CHUNK_SHADER); }
Source:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpSession session = ((HttpServletRequest) request).getSession(false); String engineSessionId = (String) request.getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY); if (session != null && engineSessionId != null) { session.setAttribute( SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY, engineSessionId ); } chain.doFilter(request, response); }

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { String engineSessionId = (String) request.getAttribute(SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY); if (engineSessionId != null) { ((HttpServletRequest) request).getSession(true).setAttribute( SessionConstants.HTTP_SESSION_ENGINE_SESSION_ID_KEY, engineSessionId ); } chain.doFilter(request, response); }