auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void scan() throws IOException { if (!rowGroupOpen) { openRowGroup(type); } beginScan(presentStream, null); ensureValuesCapacity(); makeInnerQualifyingSet(); QualifyingSet input = hasNulls ? innerQualifyingSet : inputQualifyingSet; int numInput = input.getPositionCount(); if (inDictionaryStream != null) { if (inDictionaryFlags == null || inDictionaryFlags.length < numInput) { inDictionaryFlags = new boolean[roundupSize(numInput)]; } int begin = hasNulls ? innerPosInRowGroup : posInRowGroup; int end = input.getEnd(); inDictionaryStream.getSetBits(input.getPositions(), numInput, begin, end - begin, inDictionaryFlags); } if (filter != null) { outputQualifyingSet.reset(numInput); } if (numInput > 0) { if (filter != null) { outputQualifyingSet.reset(numInput); resultsProcessor.reset(); numInnerResults = dataStream.scan(input.getPositions(), 0, numInput, input.getEnd(), resultsProcessor); outputQualifyingSet.setPositionCount(numInnerResults); } else { resultsProcessor.reset(); numInnerResults = dataStream.scan(input.getPositions(), 0, numInput, input.getEnd(), resultsProcessor); } } if (hasNulls) { innerPosInRowGroup = innerQualifyingSet.getEnd(); } addNullsAfterScan(filter != null ? outputQualifyingSet : inputQualifyingSet, inputQualifyingSet.getEnd()); if (filter != null) { outputQualifyingSet.setEnd(inputQualifyingSet.getEnd()); } if (outputChannelSet) { if (numValues > 0) { averageResultSize = SIZE_OF_INT + toIntExact(dictionaryBlock.getSizeInBytes() / numValues); } else { averageResultSize = SIZE_OF_INT; } } endScan(presentStream); }

Target:
public void scan() throws IOException { if (!rowGroupOpen) { openRowGroup(type); } beginScan(presentStream, null); ensureValuesCapacity(); makeInnerQualifyingSet(); QualifyingSet input = hasNulls ? innerQualifyingSet : inputQualifyingSet; int numInput = input.getPositionCount(); if (inDictionaryStream != null) { if (inDictionaryFlags == null || inDictionaryFlags.length < numInput) { inDictionaryFlags = newBooleanArrayForReuse(numInput); } int begin = hasNulls ? innerPosInRowGroup : posInRowGroup; int end = input.getEnd(); inDictionaryStream.getSetBits(input.getPositions(), numInput, begin, end - begin, inDictionaryFlags); } if (filter != null) { outputQualifyingSet.reset(numInput); } if (numInput > 0) { if (filter != null) { outputQualifyingSet.reset(numInput); resultsProcessor.reset(); numInnerResults = dataStream.scan(input.getPositions(), 0, numInput, input.getEnd(), resultsProcessor); outputQualifyingSet.setPositionCount(numInnerResults); } else { resultsProcessor.reset(); numInnerResults = dataStream.scan(input.getPositions(), 0, numInput, input.getEnd(), resultsProcessor); } } if (hasNulls) { innerPosInRowGroup = innerQualifyingSet.getEnd(); } addNullsAfterScan(filter != null ? outputQualifyingSet : inputQualifyingSet, inputQualifyingSet.getEnd()); if (filter != null) { outputQualifyingSet.setEnd(inputQualifyingSet.getEnd()); } if (outputChannelSet) { if (numValues > 0) { averageResultSize = SIZE_OF_INT + toIntExact(dictionaryBlock.getSizeInBytes() / numValues); } else { averageResultSize = SIZE_OF_INT; } } endScan(presentStream); }
Source:
public void run(String[] args) { setNinjaMode(NinjaModeHelper.determineModeFromSystemPropertiesOrProdIfNotSet()); setPort(tryToGetPortFromSystemPropertyOrReturnDefault()); setHost(System.getProperty(COMMAND_LINE_PARAMETER_NINJA_HOST, DEFAULT_HOST)); setNinjaContextPath(tryToGetContextPathFromSystemPropertyOrReturnDefault()); setJettyConfiguration(System.getProperty(COMMAND_LINE_PARAMETER_NINJA_JETTY_CONFIGURATION)); try { this.start(); } catch (Exception cause) { System.err.println("Unable to start server. "); cause.printStackTrace(System.err); System.exit(1); } Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { shutdown(); } }); try { server.join(); } catch (InterruptedException e) { } }

Target:
public void run(String[] args) { setNinjaMode(NinjaModeHelper.determineModeFromSystemPropertiesOrProdIfNotSet()); setPort(tryToGetPortFromSystemPropertyOrReturnDefault()); setHost(System.getProperty(COMMAND_LINE_PARAMETER_NINJA_HOST, DEFAULT_HOST)); setNinjaContextPath(tryToGetContextPathFromSystemPropertyOrReturnDefault()); setJettyConfiguration(System.getProperty(COMMAND_LINE_PARAMETER_NINJA_JETTY_CONFIGURATION)); try { this.start(); } catch (Exception e) { logger.error("Unable to start server.", e); System.exit(1); } Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { shutdown(); } }); try { server.join(); } catch (InterruptedException e) { logger.error("Server interrupted (likely server is just shutting down)", e); } }
Source:
protected BaseRealm(RealmConfiguration configuration) { this.threadId = Thread.currentThread().getId(); this.configuration = configuration; this.sharedRealm = SharedRealm.getInstance(configuration, !(this instanceof Realm) ? null : new SharedRealm.SchemaVersionListener() { @Override public void onSchemaVersionChanged(long currentVersion) { RealmCache.updateSchemaCache((Realm) BaseRealm.this); } }, true); this.schema = new StandardRealmSchema(this); ObjectServerFacade.getSyncFacadeIfPossible().downloadServerChangesIfNeeded(configuration); }

Target:
BaseRealm(RealmConfiguration configuration) { this.threadId = Thread.currentThread().getId(); this.configuration = configuration; this.realmCache = null; this.sharedRealm = SharedRealm.getInstance(configuration, !(this instanceof Realm) ? null : new SharedRealm.SchemaVersionListener() { @Override public void onSchemaVersionChanged(long currentVersion) { if (realmCache != null) { realmCache.updateSchemaCache((Realm) BaseRealm.this); } } }, true); this.schema = new StandardRealmSchema(this); }
Source:
private SessionId handleAcrChange(SessionId session, List<Prompt> prompts) { if (session != null) { if (session.getState() == SessionIdState.AUTHENTICATED) { String sessionPrompts; if (prompts.contains(Prompt.LOGIN)) { sessionPrompts = prompt; } else { prompts.add(Prompt.LOGIN); sessionPrompts = session.getSessionAttributes().get("prompt"); sessionPrompts = StringUtils.isEmpty(sessionPrompts) ? "" : (sessionPrompts + " "); sessionPrompts = sessionPrompts + Prompt.LOGIN.getParamName(); } session.getSessionAttributes().put("prompt", sessionPrompts); session.setState(SessionIdState.UNAUTHENTICATED); String remoteIp = networkService.getRemoteIp(); session.getSessionAttributes().put(Constants.REMOTE_IP, remoteIp); sessionIdService.updateSessionId(session); sessionIdService.reinitLogin(session, false); } } return session; }

Target:
private SessionId handleAcrChange(SessionId session, List<Prompt> prompts) { if (session != null) { if (session.getState() == SessionIdState.AUTHENTICATED) { if (!prompts.contains(Prompt.LOGIN)) { prompts.add(Prompt.LOGIN); } session.getSessionAttributes().put("prompt", org.xdi.oxauth.model.util.StringUtils.implode(prompts, " ")); session.setState(SessionIdState.UNAUTHENTICATED); String remoteIp = networkService.getRemoteIp(); session.getSessionAttributes().put(Constants.REMOTE_IP, remoteIp); sessionIdService.updateSessionId(session); sessionIdService.reinitLogin(session, false); } } return session; }
Source:
public boolean get(URIish uri, CredentialItem... items) throws UnsupportedCredentialItem { for (CredentialItem i : items) { if (i instanceof CredentialItem.Username) { ((CredentialItem.Username) i).setValue(username); continue; } if (i instanceof CredentialItem.Password) { ((CredentialItem.Password) i).setValue(password); continue; } if (i instanceof CredentialItem.StringType) { String promptText = i.getPromptText(); if (promptText.matches("(?i)(password:|passphrase for)(.*)")) { ((CredentialItem.StringType) i).setValue(new String( password)); continue; } } throw new UnsupportedCredentialItem(uri, i.getClass().getName() + ":" + i.getPromptText()); } return true; }

Target:
public boolean get(URIish uri, CredentialItem... items) throws UnsupportedCredentialItem { for (CredentialItem i : items) { if (i instanceof CredentialItem.Username) { ((CredentialItem.Username) i).setValue(username); continue; } if (i instanceof CredentialItem.Password) { ((CredentialItem.Password) i).setValue(password); continue; } if (i instanceof CredentialItem.StringType) { String promptText = i.getPromptText(); if (promptText.matches("(?i)(\\bpassword\\b|\\bpassphrase\\b)(\\s)?(for)?(\\s)?(.*)?(:?)")) { ((CredentialItem.StringType) i).setValue(new String( password)); continue; } } throw new UnsupportedCredentialItem(uri, i.getClass().getName() + ":" + i.getPromptText()); } return true; }
Source:
public ByteBuffer toByteBuffer() { final short numNonZeroRegisters = getNumNonZeroRegisters(); if (storageBuffer.remaining() == getNumBytesForDenseStorage() && numNonZeroRegisters < DENSE_THRESHOLD) { final ByteBuffer retVal = ByteBuffer.wrap(new byte[numNonZeroRegisters * 3 + getNumHeaderBytes()]); setVersion(retVal); setRegisterOffset(retVal, getRegisterOffset()); setNumNonZeroRegisters(retVal, numNonZeroRegisters); setMaxOverflowValue(retVal, getMaxOverflowValue()); setMaxOverflowRegister(retVal, getMaxOverflowRegister()); final int startPosition = getPayloadBytePosition(); retVal.position(getPayloadBytePosition(retVal)); final byte[] zipperBuffer = new byte[NUM_BYTES_FOR_BUCKETS]; ByteBuffer roStorageBuffer = storageBuffer.asReadOnlyBuffer(); roStorageBuffer.position(startPosition); roStorageBuffer.get(zipperBuffer); final ByteOrder byteOrder = retVal.order(); for (int i = 0; i < NUM_BYTES_FOR_BUCKETS; ++i) { if (zipperBuffer[i] != 0) { final short val = (short) (0xffff & (i + startPosition - initPosition)); retVal.putShort(val); retVal.put(zipperBuffer[i]); } } retVal.rewind(); return retVal.asReadOnlyBuffer(); } return storageBuffer.asReadOnlyBuffer(); }

Target:
public ByteBuffer toByteBuffer() { final ByteBuffer myBuffer = getStorageBuffer(); final int initialPosition = getInitPosition(); final short numNonZeroRegisters = getNumNonZeroRegisters(); if (myBuffer.remaining() == getNumBytesForDenseStorage() && numNonZeroRegisters < DENSE_THRESHOLD) { final ByteBuffer retVal = ByteBuffer.wrap(new byte[numNonZeroRegisters * 3 + getNumHeaderBytes()]); setVersion(retVal); setRegisterOffset(retVal, getRegisterOffset()); setNumNonZeroRegisters(retVal, numNonZeroRegisters); setMaxOverflowValue(retVal, getMaxOverflowValue()); setMaxOverflowRegister(retVal, getMaxOverflowRegister()); final int startPosition = getPayloadBytePosition(); retVal.position(getPayloadBytePosition(retVal)); final byte[] zipperBuffer = new byte[NUM_BYTES_FOR_BUCKETS]; ByteBuffer roStorageBuffer = myBuffer.asReadOnlyBuffer(); roStorageBuffer.position(startPosition); roStorageBuffer.get(zipperBuffer); final ByteOrder byteOrder = retVal.order(); for (int i = 0; i < NUM_BYTES_FOR_BUCKETS; ++i) { if (zipperBuffer[i] != 0) { final short val = (short) (0xffff & (i + startPosition - initialPosition)); retVal.putShort(val); retVal.put(zipperBuffer[i]); } } retVal.rewind(); return retVal.asReadOnlyBuffer(); } return myBuffer.asReadOnlyBuffer(); }
Source:
public void finish() { String shell = new DefaultShell().getText(); new WaitUntil(new ShellWithTextIsAvailable(NEW_DOCKER_CONNECTION_SHELL)); new WaitUntil(new WidgetIsEnabled(new FinishButton())); new FinishButton().click(); new WaitWhile(new ShellWithTextIsAvailable(shell), TimePeriod.LONG); new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG); }

Target:
public void finish() { new WaitUntil(new ShellWithTextIsAvailable(NEW_DOCKER_CONNECTION_SHELL)); new WaitUntil(new WidgetIsEnabled(new FinishButton())); new FinishButton().click(); new WaitWhile(new ShellWithTextIsAvailable(NEW_DOCKER_CONNECTION_SHELL), TimePeriod.LONG); new WaitWhile(new JobIsRunning(), TimePeriod.VERY_LONG); }
Source:
private static void queryRewrite(PinotQuery pinotQuery) { invokeCompileTimeFunctions(pinotQuery); rewriteSelections(pinotQuery.getSelectList()); Expression filterExpression = pinotQuery.getFilterExpression(); if (filterExpression != null) { pinotQuery.setFilterExpression(updateComparisonPredicate(filterExpression)); } Expression havingExpression = pinotQuery.getHavingExpression(); if (havingExpression != null) { pinotQuery.setHavingExpression(updateComparisonPredicate(havingExpression)); } rewriteNonAggregationGroupByToDistinct(pinotQuery); Map<Identifier, Expression> aliasMap = extractAlias(pinotQuery.getSelectList()); applyAlias(aliasMap, pinotQuery); validate(aliasMap, pinotQuery); }

Target:
private static void queryRewrite(PinotQuery pinotQuery) { invokeCompileTimeFunctions(pinotQuery); rewriteSelections(pinotQuery.getSelectList()); Expression filterExpression = pinotQuery.getFilterExpression(); if (filterExpression != null) { pinotQuery.setFilterExpression(updateComparisonPredicate(filterExpression)); } Expression havingExpression = pinotQuery.getHavingExpression(); if (havingExpression != null) { pinotQuery.setHavingExpression(updateComparisonPredicate(havingExpression)); } applyOrdinals(pinotQuery); rewriteNonAggregationGroupByToDistinct(pinotQuery); Map<Identifier, Expression> aliasMap = extractAlias(pinotQuery.getSelectList()); applyAlias(aliasMap, pinotQuery); validate(aliasMap, pinotQuery); }
Source:
public Integer call() throws Exception { PrintWriter writer = null; int passes = 0; int failures = 0; try { writer = writer(outputFile); ListMultimap<String, Interpretation> expected = read(expectedFile); ListMultimap<String, Interpretation> observed = read(observedFile); for (String sample : observed.keySet()) { for (Interpretation e : expected.get(sample)) { Genotype expectedGenotype = asGenotype(e); for (Haplotype expectedHaplotype : expectedGenotype.getHaplotypes()) { for (AlleleList expectedAlleleList : expectedHaplotype.getAlleleLists()) { if (shouldValidate(e, expectedAlleleList)) { for (Allele expectedAllele : expectedAlleleList.getAlleles()) { boolean match = false; for (Interpretation o : observed.get(sample)) { AlleleList observedAlleleList = asAlleleList(o); if (sameLocus(observedAlleleList, expectedAlleleList)) { if (shouldValidate(o, observedAlleleList)) { for (Allele observedAllele : observedAlleleList.getAlleles()) { if (matchByField(expectedAllele.getGlstring(), observedAllele.getGlstring()) >= resolution) { match = true; break; } } } } if (match) { passes++; } else { failures++; } } if (!printSummary) { writer.println((match ? "PASS" : "FAIL") + "\t" + sample + "\t" + expectedAllele); } } } } } } } if (printSummary) { writer.println("PASS\t" + passes); writer.println("FAIL\t" + failures); } return 0; } finally { try { writer.close(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } } }

Target:
public Integer call() throws Exception { PrintWriter writer = null; int passes = 0; int failures = 0; try { writer = writer(outputFile); ListMultimap<String, Interpretation> expected = read(expectedFile); ListMultimap<String, Interpretation> observed = read(observedFile); for (String sample : observed.keySet()) { for (Interpretation e : expected.get(sample)) { Genotype expectedGenotype = asGenotype(e); for (Haplotype expectedHaplotype : expectedGenotype.getHaplotypes()) { for (AlleleList expectedAlleleList : expectedHaplotype.getAlleleLists()) { if (shouldValidate(e, expectedAlleleList)) { for (Allele expectedAllele : expectedAlleleList.getAlleles()) { boolean match = false; for (Interpretation o : observed.get(sample)) { AlleleList observedAlleleList = asAlleleList(o); if (sameLocus(observedAlleleList, expectedAlleleList)) { for (Allele observedAllele : observedAlleleList.getAlleles()) { if (matchByField(expectedAllele.getGlstring(), observedAllele.getGlstring()) >= resolution) { match = true; break; } } } if (match) { passes++; } else { failures++; } } if (!printSummary) { writer.println((match ? "PASS" : "FAIL") + "\t" + sample + "\t" + expectedAllele); } } } } } } } if (printSummary) { writer.println("PASS\t" + passes); writer.println("FAIL\t" + failures); } return 0; } finally { try { writer.close(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } } }
Source:
public void updateTick (World world, int x, int y, int z, Random random) { if (!world.isRemote) { this.func_149853_b(world, random, x, y, z); } }

Target:
public void updateTick (World world, int x, int y, int z, Random random) { if (!world.isRemote) { this.checkAndDropBlock(world, x, y, z); int meta = world.getBlockMetadata(x, y, z); EnumSaplingType saplingType = getSaplingType(meta); if (random.nextInt(saplingType.growthProbability) == 0 && hasEnoughLightToGrow(saplingType, world, x, y, z)) func_149879_c(world, x, y, z, random); } }
Source:
public Meal(String name, ArrayList<Food> ingredients) { this.name = name; this.ingredients = ingredients; }

Target:
public Meal(String name, ArrayList<Food> ingredients) { this.name = name; this.ingredients = new ArrayList<Food>(); for(Food f : ingredients) { this.ingredients.add(f); } }
Source:
protected void demandUnload(SynchronizedResourceSet resourceSet, Resource resource, IProgressMonitor monitor) { lock.lock(); try { unloadingPool.execute(new ResourceUnloader(resourceSet, resource, monitor)); } finally { lock.unlock(); } }

Target:
protected void demandUnload(SynchronizedResourceSet resourceSet, Resource resource, IProgressMonitor monitor) { unloadingPool.execute(new ResourceUnloader(resourceSet, resource, monitor)); }
Source:
public void onAttach(final Activity activity) { super.onAttach(activity); this.activity = (AbstractBindServiceActivity) activity; this.application = (WalletApplication) activity.getApplication(); this.config = application.getConfiguration(); hideBalance = config.getHideBalanceOnLaunch(); this.wallet = application.getWallet(); this.loaderManager = LoaderManager.getInstance(this); showLocalBalance = getResources().getBoolean(R.bool.show_local_balance); }

Target:
public void onAttach(final Activity activity) { super.onAttach(activity); this.activity = (AbstractBindServiceActivity) activity; this.application = (WalletApplication) activity.getApplication(); this.config = application.getConfiguration(); this.wallet = application.getWallet(); this.loaderManager = LoaderManager.getInstance(this); hideBalance = config.getHideBalance(); showLocalBalance = getResources().getBoolean(R.bool.show_local_balance); }
Source:
public EventResult submitEventSync(Event event, Callable<EventResult> callable) { FutureTask<EventResult> task = submitTaskInternal(event, callable); if (task != null) { try { return task.get(); } catch (CancellationException e) { log.infoFormat("Failed to submit event using submitEventSync (the event was cancelled)- pool {0} , exception {1}", event.getStoragePoolId(), e); } catch (Exception e) { log.errorFormat("Failed at submitEventSync, for pool {0} with exception {1}", event.getStoragePoolId(), e); } } return null; }

Target:
public EventResult submitEventSync(Event event, Callable<EventResult> callable) { FutureTask<EventResult> task = submitTaskInternal(event, callable); if (task != null) { try { return task.get(); } catch (CancellationException e) { log.debugFormat("Failed to submit event using submitEventSync (the event was cancelled)- pool {0} , exception {1}", event.getStoragePoolId(), e); } catch (Exception e) { log.errorFormat("Failed at submitEventSync, for pool {0} with exception {1}", event.getStoragePoolId(), e); } } return null; }
Source:
private void importReceipt() { permissionsDelegate.checkPermissionAndMaybeAsk(Manifest.permission.READ_EXTERNAL_STORAGE) .subscribe(() -> { try { final ImportPhotoPdfDialogFragment fragment = new ImportPhotoPdfDialogFragment(); fragment.show(getChildFragmentManager(), ImportPhotoPdfDialogFragment.TAG); } catch (IllegalStateException ex) { floatingActionMenu.post(() -> { floatingActionMenu.open(true); final ImportPhotoPdfDialogFragment fragment = new ImportPhotoPdfDialogFragment(); fragment.show(getChildFragmentManager(), ImportPhotoPdfDialogFragment.TAG); }); } }, throwable -> Toast.makeText(getContext(), getString(R.string.toast_no_storage_permissions), Toast.LENGTH_SHORT).show()); }

Target:
private void importReceipt() { final ImportPhotoPdfDialogFragment fragment = new ImportPhotoPdfDialogFragment(); fragment.show(getChildFragmentManager(), ImportPhotoPdfDialogFragment.TAG); }
Source:
public Diff getPrimeRefining() { Diff main = null; if (primeRefining != null) { main = primeRefining; } else { for (Diff refBy : this.getRefinedBy()) { if (refBy instanceof ReferenceChange) { ReferenceChange rc = (ReferenceChange)refBy; if (this.getView() == rc.getValue()) { main = rc; break; } } else if (refBy instanceof AttributeChange) { AttributeChange ac = (AttributeChange)refBy; if (this.getView() == ac.getValue()) { main = ac; break; } } } } return main; }

Target:
public Diff getPrimeRefining() { if (primeRefining == null) { for (Diff refBy : this.getRefinedBy()) { if (refBy instanceof ReferenceChange) { ReferenceChange rc = (ReferenceChange)refBy; if (this.getView() == rc.getValue()) { primeRefining = rc; break; } } else if (refBy instanceof AttributeChange) { AttributeChange ac = (AttributeChange)refBy; if (this.getView() == ac.getValue()) { primeRefining = ac; break; } } } } return primeRefining; }
Source:
public void validate(File templateFile) throws IOException { SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema; Validator validator; try { schema = factory.newSchema(getSchemaFile()); validator = schema.newValidator(); validator.validate(new StreamSource(templateFile)); } catch (SAXException e) { log.error(e.getMessage(), e); throw new APIException(e); } }

Target:
public void validate(File templateFile) throws IOException { final SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); final Schema schema; final Validator validator; try { schema = factory.newSchema(getSchemaFile()); validator = schema.newValidator(); validateMetatags(templateFile); validator.validate(new StreamSource(templateFile)); } catch (SAXException e) { log.error(e.getMessage(), e); throw new APIException("radiology.report.template.validation.error", null, e); } }
Source:
public Direction getDirection(ITmfEvent event) { try { IKernelAnalysisEventLayout layout = TRACE_LAYOUTS.get(event.getTrace()); if (layout == null) { return null; } String evname = event.getName(); if (layout.eventsNetworkReceive().contains(evname)) { return Direction.EFFECT; } else if (layout.eventsNetworkSend().contains(evname)) { return Direction.CAUSE; } } catch (ExecutionException e) { } return null; }

Target:
public Direction getDirection(ITmfEvent event) { IKernelAnalysisEventLayout layout = TRACE_LAYOUTS.get(event.getTrace()); if (layout == null) { return null; } String evname = event.getName(); if (layout.eventsNetworkReceive().contains(evname)) { return Direction.EFFECT; } else if (layout.eventsNetworkSend().contains(evname)) { return Direction.CAUSE; } return null; }
Source:
public void setUp() throws Exception { this.baseDir = this.temp.newFolder("base"); final File file1 = new File(this.baseDir.getAbsolutePath() + "/a.out"); final File file2 = new File(this.baseDir.getAbsolutePath() + "/testdir"); final File file3 = new File(file2.getAbsolutePath() + "/b.out"); final File file4 = new File(file2.getAbsolutePath() + "/testdir"); final File file5 = new File(file2.getAbsolutePath() + "/c.out"); final File file6 = new File(file4.getAbsolutePath() + "/c1.out"); final File file7 = new File(file4.getAbsolutePath() + "/c2.out"); file1.createNewFile(); file2.mkdir(); file3.createNewFile(); file4.mkdir(); file5.createNewFile(); file6.createNewFile(); file7.createNewFile(); createBigDir(this.baseDir.getAbsolutePath()); byte[] fileData = new byte[]{1, 2, 3}; FileOutputStream out = new FileOutputStream(file1); out.write(fileData); out.close(); fileData = new byte[]{2, 3, 4}; out = new FileOutputStream(file3); out.write(fileData); out.close(); this.sourceDir = this.temp.newFolder("src"); FileUtils.copyDirectory(this.baseDir, this.sourceDir); this.destDir = this.temp.newFolder("dest"); }

Target:
public void setUp() throws Exception { this.baseDir = this.temp.newFolder("base"); final File file1 = new File(this.baseDir.getAbsolutePath() + "/a.out"); final File file2 = new File(this.baseDir.getAbsolutePath() + "/testdir"); final File file3 = new File(file2.getAbsolutePath() + "/b.out"); final File file4 = new File(file2.getAbsolutePath() + "/testdir"); final File file5 = new File(file2.getAbsolutePath() + "/c.out"); final File file6 = new File(file4.getAbsolutePath() + "/c1.out"); final File file7 = new File(file4.getAbsolutePath() + "/c2.out"); file1.createNewFile(); file2.mkdir(); file3.createNewFile(); file4.mkdir(); file5.createNewFile(); file6.createNewFile(); file7.createNewFile(); byte[] fileData = new byte[]{1, 2, 3}; FileOutputStream out = new FileOutputStream(file1); out.write(fileData); out.close(); fileData = new byte[]{2, 3, 4}; out = new FileOutputStream(file3); out.write(fileData); out.close(); this.sourceDir = this.temp.newFolder("src"); FileUtils.copyDirectory(this.baseDir, this.sourceDir); this.destDir = this.temp.newFolder("dest"); }
Source:
private UserContext(final CountryCode country, final Locale language, final List<Locale> fallbackLanguages, final ZoneId zoneId, final Reference<Zone> zone, final Reference<CustomerGroup> customerGroup, final Reference<Channel> channel) { this.country = country; this.language = language; this.fallbackLanguages = fallbackLanguages; this.zoneId = zoneId; this.zone = zone; this.customerGroup = Optional.ofNullable(customerGroup); this.channel = Optional.ofNullable(channel); }

Target:
private UserContext(final CountryCode country, final Locale language, final List<Locale> fallbackLanguages, final ZoneId zoneId, final Reference<Zone> zone, final Reference<CustomerGroup> customerGroup, final Reference<Channel> channel) { this.country = country; this.language = language; this.fallbackLanguages = fallbackLanguages; this.zoneId = zoneId; this.zone = zone; this.customerGroup = Optional.ofNullable(customerGroup); this.channel = Optional.ofNullable(channel); this.currency = Monetary.getCurrency("EUR"); this.priceFinder = PriceFinder.of(currency, country, this.customerGroup, this.channel); this.priceFormatter = PriceFormatter.of(language); }
Source:
private void zoom(ITmfChartTimeProvider viewer, final int count, final int x) { long newDuration = viewer.getWindowDuration(); if( newDuration == 0) { return; } double ratio = 1.0; if (count > 0) { ratio = ZOOM_FACTOR; newDuration = Math.round(ZOOM_FACTOR * newDuration); } else { ratio = 1.0 / ZOOM_FACTOR; newDuration = (long) Math.ceil(newDuration * ratio); } newDuration = Math.max(MIN_WINDOW_SIZE, newDuration); IAxis xAxis = getChart().getAxisSet().getXAxis(0); long timeAtXPos = limitXDataCoordinate(xAxis.getDataCoordinate(x)) + viewer.getTimeOffset(); long newWindowStartTime = timeAtXPos - Math.round(ratio * (timeAtXPos - viewer.getWindowStartTime())); long newWindowEndTime = validateWindowEndTime(newWindowStartTime, newWindowStartTime + newDuration); newWindowStartTime = validateWindowStartTime(newWindowStartTime); viewer.updateWindow(newWindowStartTime, newWindowEndTime); }

Target:
private void zoom(ITmfChartTimeProvider viewer, final int count, final int x) { long newDuration = viewer.getWindowDuration(); if (newDuration == 0 || count == 0) { return; } double ratio = 1.0; if (count > 0) { ratio = ZOOM_FACTOR; newDuration = Math.round(ZOOM_FACTOR * newDuration); } else { ratio = 1.0 / ZOOM_FACTOR; newDuration = (long) Math.ceil(newDuration * ratio); } newDuration = Math.max(MIN_WINDOW_SIZE, newDuration); IAxis xAxis = getChart().getAxisSet().getXAxis(0); long timeAtXPos = limitXDataCoordinate(xAxis.getDataCoordinate(x)) + viewer.getTimeOffset(); long newWindowStartTime = timeAtXPos - Math.round(ratio * (timeAtXPos - viewer.getWindowStartTime())); long newWindowEndTime = validateWindowEndTime(newWindowStartTime, newWindowStartTime + newDuration); newWindowStartTime = validateWindowStartTime(newWindowStartTime); xAxis.setRange(new Range(newWindowStartTime - viewer.getTimeOffset(), newWindowEndTime - viewer.getTimeOffset())); viewer.updateWindow(newWindowStartTime, newWindowEndTime); }
Source:
private static List<StreamSet> groupJoinedStreams(JobGraph jobGraph) { Multimap<OperatorSpec, InputOperatorSpec> joinOpSpecToInputOpSpecs = OperatorSpecGraphAnalyzer.getJoinToInputOperatorSpecs( jobGraph.getApplicationDescriptorImpl().getInputOperators().values()); Map<String, TableDescriptor> tableDescMap = jobGraph.getTables().stream() .collect(Collectors.toMap(TableDescriptor::getTableId, desc -> desc)); List<StreamSet> streamSets = new ArrayList<>(); for (OperatorSpec joinOpSpec : joinOpSpecToInputOpSpecs.keySet()) { Collection<InputOperatorSpec> joinedInputOpSpecs = joinOpSpecToInputOpSpecs.get(joinOpSpec); StreamSet streamSet = getStreamSet(joinOpSpec.getOpId(), joinedInputOpSpecs, jobGraph); if (joinOpSpec instanceof StreamTableJoinOperatorSpec) { StreamTableJoinOperatorSpec streamTableJoinOperatorSpec = (StreamTableJoinOperatorSpec) joinOpSpec; TableDescriptor tableDescriptor = tableDescMap.get(streamTableJoinOperatorSpec.getTableId()); if (tableDescriptor instanceof LocalTableDescriptor) { LocalTableDescriptor localTableDescriptor = (LocalTableDescriptor) tableDescriptor; Collection<String> sideInputs = ListUtils.emptyIfNull(localTableDescriptor.getSideInputs()); Iterable<StreamEdge> sideInputStreams = sideInputs.stream().map(jobGraph::getStreamEdge)::iterator; Iterable<StreamEdge> streams = streamSet.getStreamEdges(); streamSet = new StreamSet(streamSet.getSetId(), Iterables.concat(streams, sideInputStreams)); } } streamSets.add(streamSet); } return Collections.unmodifiableList(streamSets); }

Target:
private static List<StreamSet> groupJoinedStreams(JobGraph jobGraph) { Multimap<OperatorSpec, InputOperatorSpec> joinOpSpecToInputOpSpecs = OperatorSpecGraphAnalyzer.getJoinToInputOperatorSpecs( jobGraph.getApplicationDescriptorImpl().getInputOperators().values()); Map<String, TableDescriptor> tableDescriptors = jobGraph.getTables().stream() .collect(Collectors.toMap(TableDescriptor::getTableId, Function.identity())); List<StreamSet> streamSets = new ArrayList<>(); for (OperatorSpec joinOpSpec : joinOpSpecToInputOpSpecs.keySet()) { Collection<InputOperatorSpec> joinedInputOpSpecs = joinOpSpecToInputOpSpecs.get(joinOpSpec); StreamSet streamSet = getStreamSet(joinOpSpec.getOpId(), joinedInputOpSpecs, jobGraph); if (joinOpSpec instanceof StreamTableJoinOperatorSpec) { StreamTableJoinOperatorSpec streamTableJoinOperatorSpec = (StreamTableJoinOperatorSpec) joinOpSpec; TableDescriptor tableDescriptor = tableDescriptors.get(streamTableJoinOperatorSpec.getTableId()); if (tableDescriptor instanceof LocalTableDescriptor) { LocalTableDescriptor localTableDescriptor = (LocalTableDescriptor) tableDescriptor; Collection<String> sideInputs = ListUtils.emptyIfNull(localTableDescriptor.getSideInputs()); Iterable<StreamEdge> sideInputStreams = sideInputs.stream().map(jobGraph::getStreamEdge)::iterator; Iterable<StreamEdge> streams = streamSet.getStreamEdges(); streamSet = new StreamSet(streamSet.getSetId(), Iterables.concat(streams, sideInputStreams)); } } streamSets.add(streamSet); } return Collections.unmodifiableList(streamSets); }
Source:
private static void addAllFieldsFromRelation(SelectAnalysis context, AnalyzedRelation relation) { for (Symbol field : relation.outputs()) { if (!isSysColumn(field)) { context.add(Symbols.pathFromSymbol(field), field); } } }

Target:
private static void addAllFieldsFromRelation(SelectAnalysis context, AnalyzedRelation relation) { for (Symbol field : relation.outputs()) { var columnIdent = Symbols.pathFromSymbol(field); if (!columnIdent.isSystemColumn()) { context.add(Symbols.pathFromSymbol(field), field); } } }
Source:
private void removeDetachedServers(List<VDS> existingServers, List<GlusterServerInfo> fetchedServers) { for (final VDS server : existingServers) { if (isRemovableStatus(server.getStatus()) && serverDetached(server, fetchedServers)) { log.debugFormat("Server {0} has been removed directly using the gluster CLI. Removing it from engine as well.", server.getName()); logUtil.logServerMessage(server, AuditLogType.GLUSTER_SERVER_REMOVED_FROM_CLI); logUtil.logAuditMessage(server.getVdsGroupId(), null, server, AuditLogType.GLUSTER_SERVER_REMOVED_FROM_CLI, new HashMap<String, String>() { { put(GlusterConstants.VDS_GROUP_NAME, server.getVdsGroupName()); } }); try { removeServerFromDb(server); runVdsCommand(VDSCommandType.RemoveVds, new RemoveVdsVDSCommandParameters(server.getId())); } catch (Exception e) { log.errorFormat("Error while removing server {0} from database!", server.getName(), e); } } } }

Target:
private void removeDetachedServers(List<VDS> existingServers, List<GlusterServerInfo> fetchedServers) { for (final VDS server : existingServers) { if (isRemovableStatus(server.getStatus()) && serverDetached(server, fetchedServers)) { log.debugFormat("Server {0} has been removed directly using the gluster CLI. Removing it from engine as well.", server.getName()); logUtil.logServerMessage(server, AuditLogType.GLUSTER_SERVER_REMOVED_FROM_CLI); try { removeServerFromDb(server); runVdsCommand(VDSCommandType.RemoveVds, new RemoveVdsVDSCommandParameters(server.getId())); } catch (Exception e) { log.errorFormat("Error while removing server {0} from database!", server.getName(), e); } } } }
Source:
private void refreshIcons() { Iterator<Stereotype> iter = getUMLElement().getAppliedStereotypes().iterator(); Stereotype stereotype = iter.next(); Image icon = ElementUtil.getStereotypeImage(getUMLElement(), stereotype, SHAPE_CONSTANT); if (icon != null) { if (icon.getLocation() != "" && icon.getLocation() != null) { try { getPrimaryShape().setIcon(icon.getLocation()); } catch (MalformedURLException e) { Activator.log.error(icon.getLocation() + " " + e.getLocalizedMessage(), e); } } else { getPrimaryShape().setIcon(Activator.getShape(getUMLElement(), stereotype, false)); } } }

Target:
private void refreshIcons() { Iterator<Stereotype> iter = getUMLElement().getAppliedStereotypes().iterator(); Stereotype stereotype = iter.next(); Image icon = ElementUtil.getStereotypeImage(getUMLElement(), stereotype, SHAPE_CONSTANT); if (icon != null) { if (icon.getLocation() != null && !icon.getLocation().isEmpty()) { try { ShapeNamedElementFigure shape = getPrimaryShape(); if (shape != null) { shape.setIcon(icon.getLocation()); } } catch (MalformedURLException e) { Activator.log.error(String.format("$0 $2", icon.getLocation(), e.getLocalizedMessage()), e); } } else { getPrimaryShape().setIcon(Activator.getShape(getUMLElement(), stereotype, false)); } } }
Source:
private void submitFirewallConfiguration() throws KuraException { short timeout = 30; this.pendingFirewallConfigurationChange = true; this.configurationService.snapshot(); while (this.pendingFirewallConfigurationChange && timeout > 0) { timeout -= 0.5; try { Thread.sleep(500); } catch (InterruptedException e) { } } if (this.pendingFirewallConfigurationChange) { logger.warn("Did not receive a firewall configuration change event"); this.pendingFirewallConfigurationChange = false; } }

Target:
private void submitFirewallConfiguration() throws KuraException { short timeout = 30000; final short sleep = 500; this.pendingFirewallConfigurationChange = true; this.configurationService.snapshot(); while (this.pendingFirewallConfigurationChange && timeout > 0) { timeout -= sleep; try { Thread.sleep(sleep); } catch (InterruptedException e) { } } if (this.pendingFirewallConfigurationChange) { logger.warn("Did not receive a firewall configuration change event"); this.pendingFirewallConfigurationChange = false; } }
Source:
protected Command getCommand(IEvaluationContext context) { Command result = UnexecutableCommand.INSTANCE; TransactionalEditingDomain editingDomain = getEditingDomain(context); EObject selectedElement = getSelectedElement(); if (selectedElement instanceof NamedElement) { final NamedElement namedElement = (NamedElement) selectedElement; final String label = UMLLabelInternationalization.getInstance().getLabelWithoutUML(namedElement); if (null != label && LabelInternationalizationPreferencesUtils.getInternationalizationPreference(namedElement)) { AbstractTransactionalCommand cmd = new RenameNamedElementLabelCommand( editingDomain, "ChangeLabelCommand", namedElement, label, "Rename label...", "New label:"); result = new GMFtoEMFCommandWrapper(cmd); } else { final String currentName = namedElement.getName(); if (currentName != null) { result = new RenameElementCommand( editingDomain, "Rename", namedElement, currentName, "Rename...", "New name:"); } } } return result; }

Target:
protected Command getCommand(IEvaluationContext context) { Command result = UnexecutableCommand.INSTANCE; TransactionalEditingDomain editingDomain = getEditingDomain(context); EObject selectedElement = getSelectedElement(); if (selectedElement instanceof NamedElement) { final NamedElement namedElement = (NamedElement) selectedElement; final String label = UMLLabelInternationalization.getInstance().getLabelWithoutUML(namedElement); if (null != label && LabelInternationalizationPreferencesUtils.getInternationalizationPreference(namedElement)) { AbstractTransactionalCommand cmd = new RenameNamedElementLabelCommand(editingDomain, "ChangeLabelCommand", namedElement, label, Messages.RenameNamedElementHandler_Label_DialogTitle); result = new GMFtoEMFCommandWrapper(cmd); } else { final String currentName = namedElement.getName(); if (currentName != null) { EStructuralFeature nameFeature = namedElement.eClass().getEStructuralFeature("name"); result = new RenameElementCommand(editingDomain, "Rename", namedElement, currentName, nameFeature, Messages.RenameNamedElementHandler_Name_DialogTitle, Messages.RenameNamedElementHandler_Name_DialogMessage); } } } return result; }
Source:
public void addCustomHeaders() throws URISyntaxException { Map<String, String> inputHeaders = new LinkedHashMap<>(); inputHeaders.put("header1", "value1"); inputHeaders.put("header2", "value2"); SyncManager.addCustomRequestHeaders(inputHeaders); Map<String, String> outputHeaders = SyncManager.getCustomRequestHeaders(new URI("http://localhost")); assertEquals(2, outputHeaders.size()); }

Target:
public void addCustomHeaders() throws URISyntaxException { Map<String, String> inputHeaders = new LinkedHashMap<>(); inputHeaders.put("header1", "value1"); inputHeaders.put("header2", "value2"); SyncManager.addCustomRequestHeaders(inputHeaders); Map<String, String> outputHeaders = SyncManager.getCustomRequestHeaders(new URI("http://localhost")); assertEquals(2, outputHeaders.size()); Iterator<Map.Entry<String, String>> it = outputHeaders.entrySet().iterator(); Map.Entry<String, String> header1 = it.next(); assertEquals("header1", header1.getKey()); assertEquals("value1", header1.getValue()); Map.Entry<String, String> header2 = it.next(); assertEquals("header2", header2.getKey()); assertEquals("value2", header2.getValue()); }
Source:
public String getLogFileParentDir() { ArrayList<String> elements = new ArrayList<String>(); if(mPrefix.length() > 0) { elements.add(mPrefix); } if(mTopic.length() > 0) { elements.add(mTopic); } return StringUtils.join(elements, "/"); }

Target:
public String getLogFileParentDir() { ArrayList<String> elements = new ArrayList<String>(); if (mPrefix != null && mPrefix.length() > 0) { elements.add(mPrefix); } if (mTopic != null && mTopic.length() > 0) { elements.add(mTopic); } return StringUtils.join(elements, "/"); }
Source:
public boolean removeBlobStore(PartitionId id) { return partitionTostore.remove(id) == null ? false : true; }

Target:
public boolean removeBlobStore(PartitionId id) { return partitionToStore.remove(id) != null; }
Source:
public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) { XmlStringBuilder xml = new XmlStringBuilder(this); xml.attribute("type", type) .rightAngleBracket(); xml.escape(uri.toString()); xml.closeElement(this); return xml; }

Target:
public XmlStringBuilder toXML(XmlEnvironment xmlEnvironment) { XmlStringBuilder xml = new XmlStringBuilder(this, xmlEnvironment); xml.attribute("type", type) .rightAngleBracket(); xml.escape(uri.toString()); xml.closeElement(this); return xml; }
Source:
public static byte[] renderExceptionToPng(Exception e) { final StringBuilder sb = new StringBuilder(); sb.append("Exception occurred: "); final String stack = Throwables.getStackTraceAsString(e) ; sb.append(getFirstNLines(stack, 5)); final String text = sb.toString(); final String[] lines = text.split("\n"); BufferedImage img = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); Graphics2D g2d = img.createGraphics(); g2d.setFont(font); int lineWidth = 0; int lineHeight = 0; FontMetrics fm = g2d.getFontMetrics(); for (String line : lines) { lineWidth = Math.max(lineWidth, fm.stringWidth(line)); lineHeight = Math.max(lineHeight, fm.getHeight()); } g2d.dispose(); final int paddingLeft = 10; final int paddingTop = 10; final int imgWidth = paddingLeft + lineWidth; final int imgHeight = paddingTop + lineHeight * lines.length; img = new BufferedImage(imgWidth, imgHeight, BufferedImage.TYPE_INT_RGB); g2d = img.createGraphics(); g2d.setFont(font); g2d.setColor(Color.WHITE); g2d.fillRect(0, 0, imgWidth, imgHeight); fm = g2d.getFontMetrics(); g2d.setColor(Color.BLACK); int yOffset = 0; for (String line : lines) { g2d.drawString(line, paddingLeft, yOffset + fm.getAscent()); yOffset += lineHeight; } g2d.dispose(); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { ImageIO.write(img, "png", baos); } catch (IOException ex) { throw new RuntimeException(e); } return baos.toByteArray(); }

Target:
public static byte[] renderExceptionToPng(Exception e) { final StringBuilder sb = new StringBuilder(); sb.append("Exception occurred: "); final String stack = Throwables.getStackTraceAsString(e) ; sb.append(getFirstNLines(stack, MAX_STACKTRACE_LINES)); final String text = sb.toString(); final String[] lines = text.split("\n"); BufferedImage img = new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB); Graphics2D g2d = img.createGraphics(); g2d.setFont(font); int lineWidth = 0; int lineHeight = 0; FontMetrics fm = g2d.getFontMetrics(); for (String line : lines) { lineWidth = Math.max(lineWidth, fm.stringWidth(line)); lineHeight = Math.max(lineHeight, fm.getHeight()); } g2d.dispose(); final int paddingLeft = 10; final int paddingTop = 10; final int imgWidth = paddingLeft + lineWidth; final int imgHeight = paddingTop + lineHeight * lines.length; img = new BufferedImage(imgWidth, imgHeight, BufferedImage.TYPE_INT_RGB); g2d = img.createGraphics(); g2d.setFont(font); g2d.setColor(Color.WHITE); g2d.fillRect(0, 0, imgWidth, imgHeight); fm = g2d.getFontMetrics(); g2d.setColor(Color.BLACK); int yOffset = 0; for (String line : lines) { g2d.drawString(line, paddingLeft, yOffset + fm.getAscent()); yOffset += lineHeight; } g2d.dispose(); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); try { ImageIO.write(img, "png", baos); } catch (IOException ex) { throw new RuntimeException(e); } return baos.toByteArray(); }
Source:
private String sendMessageForActionDelete(String correlationID, String message, ParameterResolutionContext prc) throws SenderException, TimeOutException { if (StringUtils.isEmpty(message)) { throw new SenderException(getLogPrefix() + "input string cannot be empty but must contain a documentId"); } CmisObject object = null; try { object = getCmisObject(message); } catch (CmisObjectNotFoundException e) { if (StringUtils.isNotEmpty(getResultOnNotFound())) { log.info(getLogPrefix() + "document with id [" + message + "] not found", e); return getResultOnNotFound(); } else { throw new SenderException(e); } } if (object.hasAllowableAction(Action.CAN_DELETE_OBJECT)) { Document suppDoc = (Document) object; suppDoc.delete(true); return "Document Deleted"; } else { throw new SenderException(getLogPrefix() + "Document cannot be deleted"); } }

Target:
private String sendMessageForActionDelete(String correlationID, String message, ParameterResolutionContext prc) throws SenderException, TimeOutException { if (StringUtils.isEmpty(message)) { throw new SenderException(getLogPrefix() + "input string cannot be empty but must contain a documentId"); } CmisObject object = null; try { object = getCmisObject(message); } catch (CmisObjectNotFoundException e) { if (StringUtils.isNotEmpty(getResultOnNotFound())) { log.info(getLogPrefix() + "document with id [" + message + "] not found", e); return getResultOnNotFound(); } else { throw new SenderException(e); } } if (object.hasAllowableAction(Action.CAN_DELETE_OBJECT)) { Document suppDoc = (Document) object; suppDoc.delete(true); return correlationID; } else { throw new SenderException(getLogPrefix() + "Document cannot be deleted"); } }
Source:
public static void checkLatitude(double latitude) { if (Double.isNaN(latitude) || Double.isInfinite(latitude) || latitude < MIN_LATITUDE || latitude > MAX_LATITUDE) { throw new RuntimeException("Latitude must be between -90 and 90"); } }

Target:
private static void checkLatitude(double latitude) { Preconditions .checkArgument(latitude >= MIN_LATITUDE && latitude <= MAX_LATITUDE, "Latitude must be between -90 and 90"); }
Source:
public ConfidenceQualifiedNumber getAverage() { return getAverage(System.currentTimeMillis(), getConfig(TIMESTAMP_GRACE_TIME).toMilliseconds()); }

Target:
public ConfidenceQualifiedNumber getAverage() { return getAverage(System.currentTimeMillis(), 0); }
Source:
public ListenableFuture<?> truncateExportToSeqNo(StreamStartAction action, long sequenceNumber, long generationIdCreated) { return m_es.submit(new Runnable() { @Override public void run() { try { m_tupleCount = sequenceNumber; if (action == StreamStartAction.RECOVER) { if (sequenceNumber < 0) { exportLog.error("Snapshot does not include valid truncation point for partition " + m_partitionId); return; } if (m_committedBuffers.truncateToSequenceNumber(sequenceNumber, generationIdCreated)) { m_gapTracker = new ExportSequenceNumberTracker(); } else { m_gapTracker.truncateAfter(sequenceNumber); } if (exportLog.isDebugEnabled()) { exportLog.debug("Truncating tracker via snapshot truncation to " + sequenceNumber + ", tracker map is " + m_gapTracker.toString()); } } if (action == StreamStartAction.REJOIN) { if (m_committedBuffers.deletePBDFromOlderGeneration(generationIdCreated)) { m_gapTracker = new ExportSequenceNumberTracker(); } } resetStateInRejoinOrRecover(sequenceNumber, action); handleDrainedSource(null); } catch (Throwable t) { VoltDB.crashLocalVoltDB("Error while trying to truncate export to seq " + sequenceNumber, true, t); } } }); }

Target:
public ListenableFuture<?> truncateExportToSeqNo(StreamStartAction action, long sequenceNumber, long generationIdCreated) { return m_es.submit(new Runnable() { @Override public void run() { try { if (action == StreamStartAction.RECOVER) { if (sequenceNumber < 0) { exportLog.error("Snapshot does not include valid truncation point for partition " + m_partitionId); return; } if (m_committedBuffers.deleteStaleBlocks(generationIdCreated)) { m_gapTracker = m_committedBuffers.scanForGap(); } m_committedBuffers.truncateToSequenceNumber(sequenceNumber); m_gapTracker.truncateAfter(sequenceNumber); } if (action == StreamStartAction.REJOIN) { if (m_committedBuffers.deleteStaleBlocks(generationIdCreated)) { m_gapTracker = m_committedBuffers.scanForGap(); } } if (exportLog.isDebugEnabled()) { exportLog.debug("Truncating tracker via snapshot truncation to " + sequenceNumber + ", action is " + action + ", generationId is " + generationIdCreated + ", tracker map is " + m_gapTracker.toString()); } m_tupleCount = sequenceNumber; resetStateInRejoinOrRecover(sequenceNumber, action); handleDrainedSource(null); } catch (Throwable t) { VoltDB.crashLocalVoltDB("Error while trying to truncate export to seq " + sequenceNumber, true, t); } } }); }
Source:
public void setTopics(String topics) { this.topics = topics.split(","); }

Target:
public void setTopics(String topics) { this.topics = Iterables.toArray(Splitter.on(',').trimResults().omitEmptyStrings().split(topics), String.class); }