auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String generate(Nameable nameable) throws MisoNamingException { for (DefaultMisoEntityPrefix prefix : DefaultMisoEntityPrefix.values()) { if (prefix.getClass().isAssignableFrom(nameable.getClass())) { return prefix.name() + nameable.getId(); } } throw new MisoNamingException("Cannot generate a MISO name from an object of type: " + nameable.getClass().getSimpleName()); }

Target:
public String generate(Nameable nameable) throws MisoNamingException { DefaultMisoEntityPrefix selected = null; for (DefaultMisoEntityPrefix prefix : DefaultMisoEntityPrefix.values()) { if (prefix.getClass().isAssignableFrom(nameable.getClass())) { if (selected != null) { throw new MisoNamingException("Multiple prefixes are available for object of type: " + nameable.getClass().getSimpleName()); } selected = prefix; } } if (selected == null) { throw new MisoNamingException("Cannot generate a MISO name from an object of type: " + nameable.getClass().getSimpleName()); } return selected.name() + nameable.getId(); }
Source:
public byte[] getSha1Hash() { try { return getChecksum("SHA-1"); } catch (NoSuchAlgorithmException e) { VoltDB.crashLocalVoltDB("Bad JVM has no SHA-1 hash.", true, e); throw new RuntimeException("crashLocalVoltDB didn't work - this should be impossible, but exception is required to make compiler happy"); } }

Target:
public byte[] getSha1Hash() { MessageDigest md = null; try { md = MessageDigest.getInstance("SHA-1"); } catch (NoSuchAlgorithmException e) { VoltDB.crashLocalVoltDB("Bad JVM has no SHA-1 hash.", true, e); } for (Entry<String, byte[]> e : super.entrySet()) { if (e.getKey().equals("buildinfo.txt") || e.getKey().equals("catalog-report.html")) { continue; } if (e.getKey().equals(VoltCompiler.AUTOGEN_DDL_FILE_NAME)) { byte[] ddlbytes = e.getValue(); int index = 0; while (ddlbytes[index] != '\n') { index++; } byte[] newddlbytes = Arrays.copyOfRange(ddlbytes, index, ddlbytes.length); md.update(e.getKey().getBytes(Constants.UTF8ENCODING)); md.update(newddlbytes); } else { md.update(e.getKey().getBytes(Constants.UTF8ENCODING)); md.update(e.getValue()); } } return md.digest(); }
Source:
public PropNValue(IntVar[] vars, IntVar nvalue) { super(ArrayUtils.concat(vars, nvalue), PropagatorPriority.LINEAR, true); this.nValue = nvalue; n = vars.length; TIntArrayList list = new TIntArrayList(); for(int i = 0; i<vars.length; i++) { for(int value = vars[i].getLB(); value <= vars[i].getUB(); value = vars[i].nextValue(value)) { if(!list.contains(value)) { list.add(value); } } } list.sort(); concernedValues = list.toArray(); possibleValues = SetFactory.makeStoredSet(SetType.BITSET, 0, model); mandatoryValues = SetFactory.makeStoredSet(SetType.BITSET, 0, model); witness = new IStateInt[concernedValues.length]; listForRandomPick = new TIntArrayList(); for(int j = 0; j<witness.length; j++) { witness[j] = getModel().getEnvironment().makeInt(-1); int value = concernedValues[j]; possibleValues.add(value); listForRandomPick.clear(); for(int i = 0; i<n; i++) { if(vars[i].isInstantiatedTo(value)) { mandatoryValues.add(value); witness[j].set(i); break; } else if(vars[i].contains(value)) { listForRandomPick.add(i); } } if(witness[j].get() == -1) { witness[j].set(listForRandomPick.getQuick(rnd.nextInt(listForRandomPick.size()))); } } }

Target:
public PropNValue(IntVar[] vars, IntVar nvalue) { super(ArrayUtils.concat(vars, nvalue), PropagatorPriority.LINEAR, true); this.nValue = nvalue; n = vars.length; TIntHashSet set = new TIntHashSet(); int min = Integer.MAX_VALUE; for(int i = 0; i<vars.length; i++) { for(int value = vars[i].getLB(); value <= vars[i].getUB(); value = vars[i].nextValue(value)) { set.add(value); min = Math.min(min, value); } } concernedValues = set.toArray(); possibleValues = SetFactory.makeStoredSet(SetType.BITSET, min, model); mandatoryValues = SetFactory.makeStoredSet(SetType.BITSET, min, model); witness = new int[concernedValues.length]; Arrays.fill(witness, -1); listForRandomPick = new TIntArrayList(); for(int j = 0; j<witness.length; j++) { possibleValues.add(concernedValues[j]); selectRandomWitness(j); } }
Source:
public <C extends Credential> C getCredential(final Class<C> credentialType, final String algorithmName, final AlgorithmParameterSpec parameterSpec) throws IOException { final C credential; final Class<C> crType; try { createAndInitCredentialStore(); crType = credentialType != null ? credentialType : (Class<C>) credentialStoreReference.getType(); credential = credentialStore.retrieve(credentialStoreReference.getAlias(), crType); } catch (CredentialStoreException e) { throw ElytronMessages.log.unableToReadCredential(e); } catch (UnsupportedCredentialTypeException e) { return null; } if (crType.isInstance(credential) && (parameterSpec == null || credential.impliesParameters(parameterSpec)) && (algorithmName == null || credential instanceof AlgorithmCredential && algorithmName.equals(((AlgorithmCredential) credential).getAlgorithm()))) { return credential; } else { return null; } }

Target:
public <C extends Credential> C getCredential(final Class<C> credentialType, final String algorithmName, final AlgorithmParameterSpec parameterSpec) throws IOException { Assert.checkNotNullParam("credentialType", credentialType); final C credential; try { createAndInitCredentialStore(); credential = credentialStore.retrieve(credentialStoreReference.getAlias(), credentialType); } catch (CredentialStoreException | ConfigXMLParseException e) { throw ElytronMessages.log.unableToReadCredential(e); } catch (UnsupportedCredentialTypeException e) { return null; } if (credentialType.isInstance(credential) && (parameterSpec == null || credential.impliesParameters(parameterSpec)) && (algorithmName == null || credential instanceof AlgorithmCredential && algorithmName.equals(((AlgorithmCredential) credential).getAlgorithm()))) { return credential; } else { return null; } }
Source:
public MethodCallExpr buildBinding(DrlxParseSuccess drlxParseResult ) { MethodCallExpr bindDSL = new MethodCallExpr(null, BIND_CALL); if(drlxParseResult.hasUnificationVariable()) { bindDSL.addArgument(context.getVarExpr(drlxParseResult.getUnificationVariable())); } else { bindDSL.addArgument(context.getVarExpr(drlxParseResult.getExprBinding())); } final Expression constraintExpression = getConstraintExpression(drlxParseResult); MethodCallExpr bindAsDSL = new MethodCallExpr(bindDSL, BIND_AS_CALL); bindAsDSL.addArgument(context.getVarExpr(drlxParseResult.getPatternBinding())); drlxParseResult.getUsedDeclarationsOnLeft().forEach(d -> bindAsDSL.addArgument(toVar(d))); bindAsDSL.addArgument(constraintExpression); return buildReactOn( drlxParseResult, bindAsDSL ); }

Target:
public MethodCallExpr buildBinding(DrlxParseSuccess drlxParseResult ) { MethodCallExpr bindDSL = new MethodCallExpr(null, BIND_CALL); if(drlxParseResult.hasUnificationVariable()) { bindDSL.addArgument(context.getVarExpr(drlxParseResult.getUnificationVariable())); } else { bindDSL.addArgument(context.getVarExpr(drlxParseResult.getExprBinding())); } final Expression constraintExpression = getConstraintExpression(drlxParseResult); MethodCallExpr bindAsDSL = new MethodCallExpr(bindDSL, BIND_AS_CALL); bindAsDSL.addArgument(context.getVarExpr(drlxParseResult.getPatternBinding())); drlxParseResult.getUsedDeclarationsOnLeft().forEach(d -> bindAsDSL.addArgument(context.getVar(d))); bindAsDSL.addArgument(constraintExpression); return buildReactOn( drlxParseResult, bindAsDSL ); }
Source:
private static void mockAdapterRegistry(BackendDefinitionAdapter definitionAdapter, BackendDefinitionSetAdapter definitionSetAdapter, BackendPropertySetAdapter propertySetAdapter, BackendPropertyAdapter propertyAdapter) { when(adapterRegistry.getDefinitionSetAdapter(any(Class.class))).thenReturn(definitionSetAdapter); when(adapterRegistry.getDefinitionAdapter(any(Class.class))).thenReturn(definitionAdapter); when(adapterRegistry.getPropertySetAdapter(any(Class.class))).thenReturn(propertySetAdapter); when(adapterRegistry.getPropertyAdapter(any(Class.class))).thenReturn(propertyAdapter); }

Target:
private void mockAdapterRegistry(BackendDefinitionAdapter definitionAdapter, BackendDefinitionSetAdapter definitionSetAdapter, BackendPropertySetAdapter propertySetAdapter, BackendPropertyAdapter propertyAdapter) { when(adapterRegistry.getDefinitionSetAdapter(any(Class.class))).thenReturn(definitionSetAdapter); when(adapterRegistry.getDefinitionAdapter(any(Class.class))).thenReturn(definitionAdapter); when(adapterRegistry.getPropertySetAdapter(any(Class.class))).thenReturn(propertySetAdapter); when(adapterRegistry.getPropertyAdapter(any(Class.class))).thenReturn(propertyAdapter); }
Source:
private void close(Path path) throws IOException { Path directoryWhereGeneratedArtifactsWasPlaced = path.getParent(); try (Stream<Path> s = Files.list(directoryWhereGeneratedArtifactsWasPlaced)) { s.filter(p -> !Files.isDirectory(p)).map(ThrowingFunction.unchecked(p -> p)) .forEach(ThrowingConsumer.unchecked(Files::delete)); } }

Target:
private void close(Path path) throws IOException { Path directoryWhereGeneratedArtifactsWasPlaced = path.getParent(); try (Stream<Path> s = Files.list(directoryWhereGeneratedArtifactsWasPlaced)) { s.filter(p -> !Files.isDirectory(p)).forEach(ThrowingConsumer.unchecked(Files::delete)); } }
Source:
public void transform(StructuredRecord valueIn, Emitter<StructuredRecord> emitter) { Schema inputSchema = valueIn.getSchema(); Schema outputSchema = getOutputSchema(inputSchema); StructuredRecord.Builder builder = StructuredRecord.builder(outputSchema); for (Schema.Field inputField : inputSchema.getFields()) { String inputFieldName = inputField.getName(); if (!fieldsToKeep.isEmpty()) { if (!fieldsToKeep.contains(inputFieldName)) { continue; } } else if (fieldsToDrop.contains(inputFieldName)) { continue; } String outputFieldName = fieldsToRename.get(inputFieldName); if (outputFieldName == null) { outputFieldName = inputFieldName; } Schema.Field outputField = outputSchema.getField(outputFieldName); Object inputVal = valueIn.get(inputFieldName); if (fieldsToConvert.containsKey(inputFieldName)) { convertAndSet(builder, outputFieldName, inputVal, inputField.getSchema(), outputField.getSchema()); } else { builder.set(outputFieldName, inputVal); } } emitter.emit(builder.build()); }

Target:
public void transform(StructuredRecord valueIn, Emitter<StructuredRecord> emitter) { Schema inputSchema = valueIn.getSchema(); Schema outputSchema = getOutputSchema(inputSchema); StructuredRecord.Builder builder = StructuredRecord.builder(outputSchema); for (Schema.Field inputField : inputSchema.getFields()) { String inputFieldName = inputField.getName(); if (!fieldsToKeep.isEmpty() && !fieldsToKeep.contains(inputFieldName)) { continue; } else if (fieldsToDrop.contains(inputFieldName)) { continue; } String outputFieldName = fieldsToRename.get(inputFieldName); if (outputFieldName == null) { outputFieldName = inputFieldName; } Schema.Field outputField = outputSchema.getField(outputFieldName); Object inputVal = valueIn.get(inputFieldName); if (fieldsToConvert.containsKey(inputFieldName)) { convertAndSet(builder, outputFieldName, inputVal, inputField.getSchema(), outputField.getSchema()); } else { builder.set(outputFieldName, inputVal); } } emitter.emit(builder.build()); }
Source:
public void doRun() { try (TraceCompassLogUtils.ScopeLog log = new TraceCompassLogUtils.ScopeLog(LOGGER, Level.FINER, "ZoomThread:GettingStates")) { for (TimeGraphEntry entry : fZoomEntryList) { if (getMonitor().isCanceled()) { log.addData("canceled", true); return; } if (entry == null) { break; } zoom(entry, getMonitor()); } zoomEntries(fZoomEntryList, getZoomStartTime(), getZoomEndTime(), getResolution(), getMonitor()); } List<ILinkEvent> events; try (TraceCompassLogUtils.ScopeLog linkLog = new TraceCompassLogUtils.ScopeLog(LOGGER, Level.FINER, "ZoomThread:GettingLinks")) { events = getLinks(); } try (TraceCompassLogUtils.ScopeLog markerLoglog = new TraceCompassLogUtils.ScopeLog(LOGGER, Level.FINER, "ZoomThread:GettingMarkers")) { List<IMarkerEvent> markers = new ArrayList<>(getViewMarkerList(getZoomStartTime(), getZoomEndTime(), getResolution(), getMonitor())); markers.addAll(getTraceMarkerList(getZoomStartTime(), getZoomEndTime(), getResolution(), getMonitor())); applyResults(() -> { if (events != null) { fTimeGraphViewer.setLinks(events); } fTimeGraphViewer.setMarkerCategories(getMarkerCategories()); fTimeGraphViewer.setMarkers(markers); redraw(); }); } }

Target:
public void doRun() { try (TraceCompassLogUtils.ScopeLog log = new TraceCompassLogUtils.ScopeLog(LOGGER, Level.FINER, "ZoomThread:GettingStates")) { zoomEntries(fZoomEntryList, getZoomStartTime(), getZoomEndTime(), getResolution(), getMonitor()); } List<ILinkEvent> events; try (TraceCompassLogUtils.ScopeLog linkLog = new TraceCompassLogUtils.ScopeLog(LOGGER, Level.FINER, "ZoomThread:GettingLinks")) { events = getLinks(); } try (TraceCompassLogUtils.ScopeLog markerLoglog = new TraceCompassLogUtils.ScopeLog(LOGGER, Level.FINER, "ZoomThread:GettingMarkers")) { List<IMarkerEvent> markers = new ArrayList<>(getViewMarkerList(getZoomStartTime(), getZoomEndTime(), getResolution(), getMonitor())); markers.addAll(getTraceMarkerList(getZoomStartTime(), getZoomEndTime(), getResolution(), getMonitor())); applyResults(() -> { if (events != null) { fTimeGraphViewer.setLinks(events); } fTimeGraphViewer.setMarkerCategories(getMarkerCategories()); fTimeGraphViewer.setMarkers(markers); redraw(); }); } }
Source:
private float getDesiredViewDistance(SolGame game) { Hero hero = game.getHero(); if (hero.isAlive() && hero.isTranscendent()) { return Const.CAM_VIEW_DIST_SPACE; } else if (hero.isDead()) { return Const.CAM_VIEW_DIST_GROUND; } else { float velocity = hero.getVelocity().len(); float desiredViewDistance = Const.CAM_VIEW_DIST_SPACE; Planet nearestPlanet = game.getPlanetManager().getNearestPlanet(position); if (nearestPlanet.getFullHeight() < nearestPlanet.getPosition().dst(position) && MAX_ZOOM_SPD < velocity) { desiredViewDistance = Const.CAM_VIEW_DIST_JOURNEY; } else if (nearestPlanet.isNearGround(position) && velocity < MED_ZOOM_SPD) { desiredViewDistance = Const.CAM_VIEW_DIST_GROUND; } desiredViewDistance += hero.getHull().config.getApproxRadius(); return desiredViewDistance; } }

Target:
private float getDesiredViewDistance(SolGame game) { Hero hero = game.getHero(); if (hero.isAlive() && hero.isTranscendent()) { return Const.CAM_VIEW_DIST_SPACE; } else if (hero.isDead()) { return Const.CAM_VIEW_DIST_GROUND; } else { float speed = hero.getVelocity().len(); float desiredViewDistance = Const.CAM_VIEW_DIST_SPACE; Planet nearestPlanet = game.getPlanetManager().getNearestPlanet(position); if (nearestPlanet.getFullHeight() < nearestPlanet.getPosition().dst(position) && MAX_ZOOM_SPD < speed) { desiredViewDistance = Const.CAM_VIEW_DIST_JOURNEY; } else if (nearestPlanet.isNearGround(position) && speed < MED_ZOOM_SPD) { desiredViewDistance = Const.CAM_VIEW_DIST_GROUND; } desiredViewDistance += hero.getHull().config.getApproxRadius(); return desiredViewDistance; } }
Source:
public ProcessStatus check() { if (temporaryTransactOnOutput != null) { if (!outputDock.pushTransact(temporaryTransactOnOutput)) return ProcessStatus.FAILURE; temporaryTransactOnOutput = null; } Transact currentTransact = inputDock.pullTransact(); if (currentTransact == null) return ProcessStatus.NOTHING_TO_DO; System.out.println(Simulator.getTime() + ": advance body " + currentTransact.getNumber()); Double time = Simulator.getTime() + interval.get(); Simulator.pushEvent(new AdvanceEvent(currentTransact, time)); currentTransact = null; return ProcessStatus.SUCCESS; }

Target:
public BlockStatus check() { if (temporaryTransactOnOutput != null) { if (outputDock.hasTransact()) return BlockStatus.CHECK_AGAIN; outputDock.pushTransact(temporaryTransactOnOutput); temporaryTransactOnOutput = null; } Transact transact = inputDock.pullTransact(); if (transact == null) return BlockStatus.NOTHING_TO_DO; System.out.println(Simulator.getTime() + ": advance body " + transact.getNumber()); Double time = Simulator.getTime() + duration.get(); Simulator.pushEvent(new AdvanceEvent(transact, time)); return BlockStatus.SUCCESS; }
Source:
private String getStatusMessage(AbstractBuild r) { Result result = r.getResult(); Result previousResult; if(null != result) { Run previousBuild = r.getProject().getLastBuild().getPreviousBuild(); Run previousSuccessfulBuild = r.getPreviousSuccessfulBuild(); boolean buildHasSucceededBefore = previousSuccessfulBuild != null; Run lastNonAbortedBuild = previousBuild; while(lastNonAbortedBuild != null && lastNonAbortedBuild.getResult() == Result.ABORTED) { lastNonAbortedBuild = lastNonAbortedBuild.getPreviousBuild(); } if(lastNonAbortedBuild == null) { previousResult = Result.SUCCESS; } else { previousResult = lastNonAbortedBuild.getResult(); } if (result == Result.SUCCESS && (previousResult == Result.FAILURE || previousResult == Result.UNSTABLE) && buildHasSucceededBefore && notifier.getNotifyBackToNormal()) { return BACK_TO_NORMAL_STATUS_MESSAGE; } if (result == Result.FAILURE && previousResult == Result.FAILURE) { return STILL_FAILING_STATUS_MESSAGE; } if (result == Result.SUCCESS) { return SUCCESS_STATUS_MESSAGE; } if (result == Result.FAILURE) { return FAILURE_STATUS_MESSAGE; } if (result == Result.ABORTED) { return ABORTED_STATUS_MESSAGE; } if (result == Result.NOT_BUILT) { return NOT_BUILT_STATUS_MESSAGE; } if (result == Result.UNSTABLE) { return UNSTABLE_STATUS_MESSAGE; } if (lastNonAbortedBuild != null && result.isWorseThan(previousResult)) { return REGRESSION_STATUS_MESSAGE; } } return UNKNOWN_STATUS_MESSAGE; }

Target:
private String getStatusMessage(AbstractBuild r) { Result result = r.getResult(); Result previousResult; if(null != result) { AbstractBuild lastBuild = r.getProject().getLastBuild(); if (lastBuild != null) { Run previousBuild = lastBuild.getPreviousBuild(); Run previousSuccessfulBuild = r.getPreviousSuccessfulBuild(); boolean buildHasSucceededBefore = previousSuccessfulBuild != null; Run lastNonAbortedBuild = previousBuild; while (lastNonAbortedBuild != null && lastNonAbortedBuild.getResult() == Result.ABORTED) { lastNonAbortedBuild = lastNonAbortedBuild.getPreviousBuild(); } if (lastNonAbortedBuild == null) { previousResult = Result.SUCCESS; } else { previousResult = lastNonAbortedBuild.getResult(); } if (result == Result.SUCCESS && (previousResult == Result.FAILURE || previousResult == Result.UNSTABLE) && buildHasSucceededBefore && notifier.getNotifyBackToNormal()) { return BACK_TO_NORMAL_STATUS_MESSAGE; } if (result == Result.FAILURE && previousResult == Result.FAILURE) { return STILL_FAILING_STATUS_MESSAGE; } if (result == Result.SUCCESS) { return SUCCESS_STATUS_MESSAGE; } if (result == Result.FAILURE) { return FAILURE_STATUS_MESSAGE; } if (result == Result.ABORTED) { return ABORTED_STATUS_MESSAGE; } if (result == Result.NOT_BUILT) { return NOT_BUILT_STATUS_MESSAGE; } if (result == Result.UNSTABLE) { return UNSTABLE_STATUS_MESSAGE; } if (lastNonAbortedBuild != null && result.isWorseThan(previousResult)) { return REGRESSION_STATUS_MESSAGE; } } } return UNKNOWN_STATUS_MESSAGE; }
Source:
public HttpMessage cookie(Cookie cookie) { this.cookies.add(cookie); setHeader( HttpMessageHeaders.HTTP_COOKIE_PREFIX + cookie.getName(), cookieConverter.getCookieString(cookie)); return this; }

Target:
public HttpMessage cookie(Cookie cookie) { this.cookies.put(cookie.getName(), cookie); setHeader( HttpMessageHeaders.HTTP_COOKIE_PREFIX + cookie.getName(), cookieConverter.getCookieString(cookie)); return this; }
Source:
public ItemType getItemType() { return Sponge.getRegistry().getType( ItemType.class, this.statId.substring(this.statId.lastIndexOf('.') + 1)).get(); }

Target:
public ItemType getItemType() { return ItemTypeRegistryModule.getInstance().getById( this.statId.substring(this.statId.lastIndexOf('.') + 1)).get(); }
Source:
public static boolean ignoreLocalTestServices() { return Boolean.parseBoolean(System.getProperty("org.eclipse.mylyn.tests.ignore.local.services")); }

Target:
public static boolean ignoreLocalTestServices() { return Boolean.parseBoolean(System.getProperty(KEY_IGNORE_LOCAL_SERVICES)); }
Source:
private TestDescription testDescriptionFrom(ExtensionContext context) { return new TestDescription() { @Override public String getTestId() { return context.getUniqueId(); } @Override public String getFilesystemFriendlyName() { return context.getDisplayName(); } }; }

Target:
private TestDescription testDescriptionFrom(ExtensionContext context) { return new TestcontainersTestDescription( context.getUniqueId(), filesystemFriendlyNameOf(context) ); }
Source:
private void apply(TaskAdded event) { getBuilder().setValue("Description value").build(); }

Target:
private void apply(TaskAdded event) { getBuilder().setValue("Description value"); }
Source:
private Stream<Output> queryAsStream( List<String> terms, ReadOnlyFulltext indexReader ) { Stream<Output> stream; PrimitiveLongIterator primitiveLongIterator = indexReader.fuzzyQuery( terms.toArray( new String[0] ) ); Iterable<Output> iterable = () -> new Iterator<Output>() { @Override public boolean hasNext() { return primitiveLongIterator.hasNext(); } @Override public Output next() { return new Output( primitiveLongIterator.next() ); } }; stream = StreamSupport.stream( iterable.spliterator(), false ); return stream; }

Target:
private Stream<Output> queryAsStream( List<String> terms, ReadOnlyFulltext indexReader ) { PrimitiveLongIterator primitiveLongIterator = indexReader.fuzzyQuery( terms.toArray( new String[0] ) ); Iterator<Output> iterator = PrimitiveLongCollections.map( Output::new, primitiveLongIterator ); return StreamSupport.stream( Spliterators.spliteratorUnknownSize( iterator, Spliterator.ORDERED ), false ); }
Source:
public void testMatchDNSName() throws Exception { DefaultHostnameVerifier.matchDNSName( "host.domain.com", Collections.singletonList(SubjectName.DNS("*.domain.com")), publicSuffixMatcher); DefaultHostnameVerifier.matchDNSName( "host.xx", Collections.singletonList(SubjectName.DNS("*.xx")), publicSuffixMatcher); DefaultHostnameVerifier.matchDNSName( "host.appspot.com", Collections.singletonList(SubjectName.DNS("*.appspot.com")), publicSuffixMatcher); DefaultHostnameVerifier.matchDNSName( "demo-s3-bucket.s3.eu-central-1.amazonaws.com", Collections.singletonList(SubjectName.DNS("*.s3.eu-central-1.amazonaws.com")), publicSuffixMatcher); DefaultHostnameVerifier.matchDNSName( "hostname-workspace-1.ops.domain.local", Collections.singletonList(SubjectName.DNS("hostname-workspace-1.ops.domain.local")), publicSuffixMatcher); }

Target:
public void testMatchDNSName() throws Exception { DefaultHostnameVerifier.matchDNSName( "host.domain.com", Collections.singletonList(SubjectName.DNS("*.domain.com")), publicSuffixMatcher); DefaultHostnameVerifier.matchDNSName( "host.xx", Collections.singletonList(SubjectName.DNS("*.xx")), publicSuffixMatcher); DefaultHostnameVerifier.matchDNSName( "host.appspot.com", Collections.singletonList(SubjectName.DNS("*.appspot.com")), publicSuffixMatcher); DefaultHostnameVerifier.matchDNSName( "demo-s3-bucket.s3.eu-central-1.amazonaws.com", Collections.singletonList(SubjectName.DNS("*.s3.eu-central-1.amazonaws.com")), publicSuffixMatcher); DefaultHostnameVerifier.matchDNSName( "hostname-workspace-1.local", Collections.singletonList(SubjectName.DNS("hostname-workspace-1.local")), publicSuffixMatcher); }
Source:
public R apply(R record) { if (record.headers().isEmpty()) { throw new DataException("The message does not contain headers."); } headers.forEach(record.headers()::remove); return record; }

Target:
public R apply(R record) { if (record == null) { return null; } Headers recordHeaders = record.headers(); if (recordHeaders.isEmpty()) { return record; } Headers newHeaders = new ConnectHeaders(); recordHeaders.forEach(header -> { if (!headerNames.contains(header.key())) { newHeaders.add(header); } } ); return record.newRecord(record.topic(), record.kafkaPartition(), record.keySchema(), record.key(), record.valueSchema(), record.value(), record.timestamp(), newHeaders); }
Source:
public void removesMagicFolder() { PersistentStoragePathSanitizer.sanitizeStoragePath(testFolderPath).toFile().mkdir(); PersistentStoragePathSanitizer.sanitizeStoragePath(testFolderPath); assertThat(testFolder.getRoot().listFiles()).isEmpty(); }

Target:
public void removesMagicFolder() { PersistentStoragePathSanitizer.sanitizeStoragePath(testFolderPath).toFile().mkdir(); assertThat(testFolder.getRoot().listFiles()) .hasSize(1); PersistentStoragePathSanitizer.sanitizeStoragePath(testFolderPath); assertThat(testFolder.getRoot().listFiles()) .as("Sanitization should remove the special subfolder.") .isEmpty(); }
Source:
protected void verifyRequirement(Collection<IRequirement> requirement, String filter, int min, int max, boolean greedy) { IExpression expr = ExpressionUtil.parse(filter); IMatchExpression<IInstallableUnit> matchExpr = ExpressionUtil.getFactory().matchExpression(expr); for (Iterator iterator = requirement.iterator(); iterator.hasNext();) { IRequirement required = (IRequirement) iterator.next(); System.out.println(required); if (required.getMatches().equals(matchExpr)) { String requirementDescr = "IRequirement " + filter; Assert.assertEquals("Min of " + requirementDescr, min, required.getMin()); Assert.assertEquals("Max of " + requirementDescr, max, required.getMax()); Assert.assertEquals("Greedy of " + requirementDescr, greedy, required.isGreedy()); return; } } Assert.fail("Missing IRequirement: " + filter); }

Target:
protected void verifyRequirement(Collection<IRequirement> requirement, String filter, int min, int max, boolean greedy) { IExpression expr = ExpressionUtil.parse(filter); IMatchExpression<IInstallableUnit> matchExpr = ExpressionUtil.getFactory().matchExpression(expr); for (Iterator iterator = requirement.iterator(); iterator.hasNext();) { IRequirement required = (IRequirement) iterator.next(); if (required.getMatches().equals(matchExpr)) { String requirementDescr = "IRequirement " + filter; Assert.assertEquals("Min of " + requirementDescr, min, required.getMin()); Assert.assertEquals("Max of " + requirementDescr, max, required.getMax()); Assert.assertEquals("Greedy of " + requirementDescr, greedy, required.isGreedy()); return; } } Assert.fail("Missing IRequirement: " + filter); }
Source:
public void executionSkipped(final TestIdentifier testIdentifier, final String reason) { if (!testIdentifier.isContainer()) { listener.onTestSkipped(); } }

Target:
public void executionSkipped(final TestIdentifier testIdentifier, final String reason) { if (testIdentifier.isContainer()) { return; } listener.onTestSkipped(); }
Source:
@Test public void getDeletedSecretSeriesById() { long now = OffsetDateTime.now().toEpochSecond(); long id = secretSeriesDAO.createSecretSeries("toBeFound_getSecretSeriesByDeletedName", "creator", "", null, null, now); long oldContentId = secretContentDAO.createSecretContent(id, "blah", "checksum", "creator", null, 0, now); secretSeriesDAO.setCurrentVersion(id, oldContentId, "creator", now); secretSeriesDAO.deleteSecretSeriesById(id); assertThat(secretSeriesDAO.getSecretSeriesById(id)).isEmpty(); Optional<SecretSeries> deletedSecretSeries = secretSeriesDAO.getDeletedSecretSeriesById(id); assertThat(deletedSecretSeries).isPresent(); assertThat(deletedSecretSeries.get().name()).contains("toBeFound_getSecretSeriesByDeletedName"); assertThat(deletedSecretSeries.get().name()).isNotEqualTo("toBeFound_getSecretSeriesByDeletedName"); assertThat(deletedSecretSeries.get().id()).isEqualTo(id); }

Target:
@Test public void getDeletedSecretSeriesById() { long now = OffsetDateTime.now().toEpochSecond(); long id = secretSeriesDAO.createSecretSeries("toBeFound_getSecretSeriesByDeletedId", "creator", "", null, null, now); long oldContentId = secretContentDAO.createSecretContent(id, "blah", "checksum", "creator", null, 0, now); secretSeriesDAO.setCurrentVersion(id, oldContentId, "creator", now); secretSeriesDAO.deleteSecretSeriesById(id); assertThat(secretSeriesDAO.getSecretSeriesById(id)).isEmpty(); Optional<SecretSeries> deletedSecretSeries = secretSeriesDAO.getDeletedSecretSeriesById(id); assertThat(deletedSecretSeries).isPresent(); assertThat(deletedSecretSeries.get().name()).contains("toBeFound_getSecretSeriesByDeletedId"); assertThat(deletedSecretSeries.get().name()).isNotEqualTo("toBeFound_getSecretSeriesByDeletedId"); assertThat(deletedSecretSeries.get().id()).isEqualTo(id); }
Source:
public AuditLogType getAuditLogTypeValue() { switch (getActionState()) { case EXECUTE: if (isVmInDb) { if (pendingAsyncTasks) { return getSucceeded() ? AuditLogType.USER_ADD_VM_TEMPLATE : AuditLogType.USER_FAILED_ADD_VM_TEMPLATE; } else { return getSucceeded() ? AuditLogType.USER_ADD_VM_TEMPLATE_FINISHED_SUCCESS : getAuditLogFailureType(); } } else { return getSucceeded() ? AuditLogType.USER_ADD_VM_TEMPLATE_SUCCESS : AuditLogType.USER_ADD_VM_TEMPLATE_FAILURE; } case END_SUCCESS: if (isVmInDb) { return getSucceeded() ? AuditLogType.USER_ADD_VM_TEMPLATE_FINISHED_SUCCESS : getAuditLogFailureType(); } return AuditLogType.UNASSIGNED; default: return getAuditLogFailureType(); } }

Target:
public AuditLogType getAuditLogTypeValue() { switch (getActionState()) { case EXECUTE: if (isVmInDb) { if (pendingAsyncTasks) { return getSucceeded() ? AuditLogType.USER_ADD_VM_TEMPLATE : AuditLogType.USER_FAILED_ADD_VM_TEMPLATE; } else { return getSucceeded() ? AuditLogType.USER_ADD_VM_TEMPLATE_FINISHED_SUCCESS : getAuditLogFailureType(); } } else { return getSucceeded() ? AuditLogType.USER_ADD_VM_TEMPLATE_SUCCESS : AuditLogType.USER_ADD_VM_TEMPLATE_FAILURE; } case END_SUCCESS: if (getParameters().getTemplateType() != VmEntityType.INSTANCE_TYPE) { return getSucceeded() ? AuditLogType.USER_ADD_VM_TEMPLATE_FINISHED_SUCCESS : getAuditLogFailureType(); } return AuditLogType.UNASSIGNED; default: return getAuditLogFailureType(); } }
Source:
private void processEvent(int cfIndex, byte[] keyBytes, byte[] valueBytes, OMDBUpdateEvent.OMDBUpdateAction action) throws IOException { String tableName = tablesNames.get(cfIndex); Class keyType = getKeyType(tableName); Class valueType = getValueType(tableName); if (valueType != null) { OMDBUpdateEvent.OMUpdateEventBuilder builder = new OMDBUpdateEvent.OMUpdateEventBuilder<>(); builder.setTable(tableName); Object key = codecRegistry.asObject(keyBytes, keyType); builder.setKey(key); if (!action.equals(OMDBUpdateEvent.OMDBUpdateAction.DELETE)) { Object value = codecRegistry.asObject(valueBytes, valueType); builder.setValue(value); } builder.setAction(action); OMDBUpdateEvent event = builder.build(); LOG.info("Generated OM update Event for table : " + event.getTable() + ", Key = " + event.getKey() + ", action = " + event.getAction()); omdbUpdateEvents.add(event); } }

Target:
private void processEvent(int cfIndex, byte[] keyBytes, byte[] valueBytes, OMDBUpdateEvent.OMDBUpdateAction action) throws IOException { String tableName = tablesNames.get(cfIndex); Class keyType = getKeyType(tableName); Class valueType = getValueType(tableName); if (valueType != null) { OMDBUpdateEvent.OMUpdateEventBuilder builder = new OMDBUpdateEvent.OMUpdateEventBuilder<>(); builder.setTable(tableName); Object key = codecRegistry.asObject(keyBytes, keyType); builder.setKey(key); if (!action.equals(OMDBUpdateEvent.OMDBUpdateAction.DELETE)) { Object value = codecRegistry.asObject(valueBytes, valueType); builder.setValue(value); } builder.setAction(action); OMDBUpdateEvent event = builder.build(); LOG.debug("Generated OM update Event for table : " + event.getTable() + ", Key = " + event.getKey() + ", action = " + event.getAction()); omdbUpdateEvents.add(event); } }
Source:
public static synchronized AmplitudeClient getInstance(String instance) { if (TextUtils.isEmpty(instance)) { instance = Constants.DEFAULT_INSTANCE; } instance = instance.toLowerCase(); AmplitudeClient client = instances.get(instance); if (client == null) { client = new AmplitudeClient(instance); instances.put(instance, client); } return client; }

Target:
public static synchronized AmplitudeClient getInstance(String instance) { instance = Utils.normalizeInstanceName(instance); AmplitudeClient client = instances.get(instance); if (client == null) { client = new AmplitudeClient(instance); instances.put(instance, client); } return client; }
Source:
private void overwriteSample(final List<SAMReadGroupRecord> readGroups, final String sampleAlias) { for (final SAMReadGroupRecord rg : readGroups) { rg.setSample(sampleAlias); } }

Target:
private void overwriteSample(final List<SAMReadGroupRecord> readGroups, final String sampleAlias) { readGroups.forEach(rg -> rg.setSample(sampleAlias)); }
Source:
public void loadConfiguration(GeoServerResourceLoader resourceLoader) throws IOException { synchronized (this) { Resource controlflow = resourceLoader.get(PROPERTYFILENAME); if (Resources.exists(controlflow)) { configFile = new PropertyFileWatcher(controlflow); configFile.setKnownLastModified(System.currentTimeMillis()); } } }

Target:
public void loadConfiguration(GeoServerResourceLoader resourceLoader) throws IOException { synchronized (this) { Resource controlflow = resourceLoader.get(PROPERTYFILENAME); if (Resources.exists(controlflow)) { configFile = new PropertyFileWatcher(controlflow); } } }
Source:
public void testWfsMetadataImpl() { assertThat(testWfsMetadata.getCoordinateOrder(), is(COORDINATE_ORDER)); assertThat(testWfsMetadata.getId(), is(TEST_ID)); assertThat(testWfsMetadata.getDescriptors().size(), is(1)); }

Target:
public void testWfsMetadataImpl() { assertThat(testWfsMetadata.getCoordinateOrder(), is(COORDINATE_ORDER)); assertThat(testWfsMetadata.getId(), is(TEST_ID)); assertThat(testWfsMetadata.getDescriptors(), hasSize(1)); }
Source:
private long resolve(AclStatus aclStatus) { String owner = aclStatus.getOwner(); String group = aclStatus.getGroup(); short permission = aclStatus.getPermission().toShort(); return buildPermissionStatus(owner, group, permission); }

Target:
private long resolve(AclStatus aclStatus) { String resolvedOwner = user(aclStatus.getOwner()); String resolvedGroup = group(aclStatus.getGroup()); FsPermission resolvedPermision = permission(aclStatus.getPermission()); return buildPermissionStatus( resolvedOwner, resolvedGroup, resolvedPermision.toShort()); }
Source:
private InternalContainerResource createAndMapContainerResource(final WorkerResourceSpec workerResourceSpec) { final TaskExecutorProcessSpec taskExecutorProcessSpec = TaskExecutorProcessUtils.processSpecFromWorkerResourceSpec(flinkConfig, workerResourceSpec); final InternalContainerResource internalContainerResource = new InternalContainerResource( normalize(taskExecutorProcessSpec.getTotalProcessMemorySize().getMebiBytes(), minMemMB), normalize(taskExecutorProcessSpec.getCpuCores().getValue().intValue(), minVcore), ExternalResourceUtils.getExternalResourcesForYarn(flinkConfig)); if (resourceWithinMaxAllocation(internalContainerResource)) { containerResourceToWorkerSpecs.computeIfAbsent(internalContainerResource, ignored -> new HashSet<>()) .add(workerResourceSpec); containerMemoryToContainerResource.computeIfAbsent(internalContainerResource.memory, ignored -> new HashSet<>()) .add(internalContainerResource); return internalContainerResource; } else { LOG.warn("Requested container resource exceeds yarn max allocation {}. Will not allocate resource.", internalContainerResource, new InternalContainerResource(maxMemMB, maxVcore, Collections.emptyMap())); return null; } }

Target:
private InternalContainerResource createAndMapContainerResource(final WorkerResourceSpec workerResourceSpec) { final TaskExecutorProcessSpec taskExecutorProcessSpec = TaskExecutorProcessUtils.processSpecFromWorkerResourceSpec(flinkConfig, workerResourceSpec); final InternalContainerResource internalContainerResource = new InternalContainerResource( normalize(taskExecutorProcessSpec.getTotalProcessMemorySize().getMebiBytes(), minMemMB), normalize(taskExecutorProcessSpec.getCpuCores().getValue().intValue(), minVcore), externalResourceConfigs); if (resourceWithinMaxAllocation(internalContainerResource)) { containerResourceToWorkerSpecs.computeIfAbsent(internalContainerResource, ignored -> new HashSet<>()) .add(workerResourceSpec); containerMemoryToContainerResource.computeIfAbsent(internalContainerResource.memory, ignored -> new HashSet<>()) .add(internalContainerResource); return internalContainerResource; } else { LOG.warn("Requested container resource exceeds yarn max allocation {}. Will not allocate resource.", internalContainerResource, new InternalContainerResource(maxMemMB, maxVcore, Collections.emptyMap())); return null; } }
Source:
public static NotificationListFragment newInstance() { NotificationListFragment fragment = new NotificationListFragment(); Bundle args = new Bundle(); fragment.setArguments(args); return fragment; }

Target:
public static NotificationListFragment newInstance() { return new NotificationListFragment(); }
Source:
public AccountDiffPreference getAccountDiffPreference() { AccountDiffPreference diffPref = null; try { diffPref = dbProvider.get().accountDiffPreferences().get(getAccountId()); if (diffPref == null) { return AccountDiffPreference.createDefault(getAccountId()); } } catch (OrmException e) { log.warn("Cannot query account diff preferences", e); } return diffPref; }

Target:
public AccountDiffPreference getAccountDiffPreference() { AccountDiffPreference diffPref; try { diffPref = dbProvider.get().accountDiffPreferences().get(getAccountId()); if (diffPref == null) { diffPref = AccountDiffPreference.createDefault(getAccountId()); } } catch (OrmException e) { log.warn("Cannot query account diff preferences", e); diffPref = AccountDiffPreference.createDefault(getAccountId()); } return diffPref; }
Source:
public void testConcatOnNonEmptyListOfNestedLists() { List<List<List<Character>>> listOfNestedLists = Arrays.asList( Arrays.asList(Collections.singletonList('1'), Collections.singletonList('2')), Arrays.asList(Collections.singletonList('3'), Collections.emptyList()), Arrays.asList(Arrays.asList('4', '5', '6')); assertEquals( Arrays.asList(Collections.singletonList('1'), Collections.singletonList('2'), Collections.singletonList('3'), Collections.emptyList(), Arrays.asList(4, 5, 6)), ListOps.concat(listOfNestedLists)); }

Target:
public void testConcatOnNonEmptyListOfNestedLists() { List<List<List<Character>>> listOfNestedLists = Arrays.asList( Arrays.asList( Collections.singletonList('1'), Collections.singletonList('2') ), Collections.singletonList( Collections.singletonList('3') ), Collections.singletonList( Collections.emptyList() ), Collections.singletonList( Arrays.asList('4', '5', '6') ) ); assertEquals( Arrays.asList( Collections.singletonList('1'), Collections.singletonList('2'), Collections.singletonList('3'), Collections.emptyList(), Arrays.asList('4', '5', '6') ), ListOps.concat(listOfNestedLists) ); }
Source:
static protected String guessFormatFromMimeType(String mimeType) { if (mimeType == null) { return null; } if (mimeType.contains("/xml")) { return "text/xml"; } if (mimeType.contains("/json")) { return "text/json"; } return null; }

Target:
static protected String guessFormatFromMimeType(String mimeType) { String[] components = mimeType.split(";"); if (components.length == 0) { return null; } return ImportingManager.getFormatFromMimeType(components[0]); }
Source:
public static long getDays(@NonNull Date date) { return date.getTime() / (1000 * 60 * 60 * 24); }

Target:
public static long getDays(@NonNull Date date) { return TimeUnit.MILLISECONDS.toDays(date.getTime()); }
Source:
private void addHeaders(final HttpRequest httpRequest) throws IOException, SignatureException { final String date = DateFormatter.dateToRfc882(); httpRequest.addHeader(HOST, NetUtils.buildHostField(NetworkClientImpl.this.connectionDetails)); httpRequest.addHeader(DATE, date); httpRequest.addHeader(CONTENT_TYPE, this.ds3Request.getContentType()); httpRequest.addHeader("User-Agent", "ds3_java_sdk"); for(final Map.Entry<String, String> header: this.ds3Request.getHeaders().entries()) { httpRequest.addHeader(header.getKey(), header.getValue()); } if (!this.hash.isEmpty()) { httpRequest.addHeader(getHashType(ds3Request.getChecksumType()), this.hash); } httpRequest.addHeader(AUTHORIZATION, this.getSignature(new SignatureDetails( this.ds3Request.getVerb(), this.hash, this.ds3Request.getContentType(), date, canonicalizeAmzHeaders(this.ds3Request.getHeaders()), canonicalizeResource(this.ds3Request.getPath(), this.ds3Request.getQueryParams()), NetworkClientImpl.this.connectionDetails.getCredentials() ))); }

Target:
private void addHeaders(final HttpRequest httpRequest) throws IOException, SignatureException { final String date = DateFormatter.dateToRfc882(); httpRequest.addHeader(HOST, NetUtils.buildHostField(NetworkClientImpl.this.connectionDetails)); httpRequest.addHeader(DATE, date); httpRequest.addHeader(CONTENT_TYPE, this.ds3Request.getContentType()); httpRequest.addHeader(USER_AGENT, AGENT_DS3_JAVA_SDK); for(final Map.Entry<String, String> header: this.ds3Request.getHeaders().entries()) { httpRequest.addHeader(header.getKey(), header.getValue()); } if (!this.hash.isEmpty()) { httpRequest.addHeader(getHashType(ds3Request.getChecksumType()), this.hash); } httpRequest.addHeader(AUTHORIZATION, this.getSignature(new SignatureDetails( this.ds3Request.getVerb(), this.hash, this.ds3Request.getContentType(), date, canonicalizeAmzHeaders(this.ds3Request.getHeaders()), canonicalizeResource(this.ds3Request.getPath(), this.ds3Request.getQueryParams()), NetworkClientImpl.this.connectionDetails.getCredentials() ))); }
Source:
private void checkExpectedImage(final NamedElement namedElement, final Stereotype stereotype) { Image image = labelProvider.getImage(namedElement); assertNotNull("The image must not be null.", image); Image expectedImage = getStereotypeIcon(stereotype); assertNotNull("The Stereotype must contain an icon.", expectedImage); }

Target:
private void checkExpectedImage(final NamedElement namedElement, final Stereotype stereotype) { Image image = labelProvider.getImage(namedElement); assertNotNull("The image must not be null.", image); Image expectedImage = getStereotypeIcon(stereotype); assertNotNull("The Stereotype must contain an icon.", expectedImage); assertEquals("The icon of the Element must be the same as the expected icon.", expectedImage, image); }
Source:
private boolean canViewChurch(int churchSecurity) { if(mAssignment == null) { return false; } switch(churchSecurity) { case 0: return mAssignment.isLeader() || mAssignment.isMember(); case 1: return mAssignment.isLeadership(); case 2: return true; default: return false; } }

Target:
private boolean canViewChurch(int churchSecurity) { if(mAssignment == null) { return false; } switch(churchSecurity) { case 0: return mAssignment.isLeader() || mAssignment.isMember(); case 1: return mAssignment.isLeadership(); case 2: case 3: return true; default: return false; } }
Source:
public TanyaReaction calculate(String s, String t) { int whoopsCount = 0; int yayCount = 0; int[] countT = new int[52]; int[] countS = new int[52]; countLetters(countS, s); countLetters(countT, t); for (int i = 0; i < 26; i++) { while (countS[i] > 0 && countT[i] > 0) { yayCount++; countS[i]--; countT[i]--; } while (countS[i + 26] > 0 && countT[i + 26] > 0) { yayCount++; countS[i + 26]--; countT[i + 26]--; } while (countS[i] > 0 && countT[i + 26] > 0) { whoopsCount++; countS[i]--; countT[i + 26]--; } while (countS[i + 26] > 0 && countT[i] > 0) { whoopsCount++; countS[i + 26]--; countT[i]--; } } return new TanyaReaction(yayCount, whoopsCount); }

Target:
public TanyaReaction calculate(String s, String t) { int whoopsCount = 0; int yayCount = 0; int[] countT = new int[ALPHABET_SIZE * 2]; int[] countS = new int[ALPHABET_SIZE * 2]; countLetters(countS, s); countLetters(countT, t); for (int i = 0; i < ALPHABET_SIZE; i++) { while (countS[i] > 0 && countT[i] > 0) { yayCount++; countS[i]--; countT[i]--; } while (countS[i + ALPHABET_SIZE] > 0 && countT[i + ALPHABET_SIZE] > 0) { yayCount++; countS[i + ALPHABET_SIZE]--; countT[i + ALPHABET_SIZE]--; } while (countS[i] > 0 && countT[i + ALPHABET_SIZE] > 0) { whoopsCount++; countS[i]--; countT[i + ALPHABET_SIZE]--; } while (countS[i + ALPHABET_SIZE] > 0 && countT[i] > 0) { whoopsCount++; countS[i + ALPHABET_SIZE]--; countT[i]--; } } return new TanyaReaction(yayCount, whoopsCount); }
Source:
public void mediaChanged(MediaModel mediaModel) { List<Integer> indexList = PostUtils.indexesOfFeaturedMediaIdInList(mediaModel.getMediaId(), mPosts); for (int position : indexList) { if (isValidPostPosition(position)) { int postId = mPosts.get(position).getId(); mFeaturedImageUrls.put(postId, mediaModel.getUrl()); notifyItemChanged(position); } } }

Target:
public void mediaChanged(MediaModel mediaModel) { List<Integer> indexList = PostUtils.indexesOfFeaturedMediaIdInList(mediaModel.getMediaId(), mPosts); for (int position : indexList) { PostModel post = getItem(position); if (post != null) { mFeaturedImageUrls.put(post.getId(), mediaModel.getUrl()); notifyItemChanged(position); } } }
Source:
protected void tearDown() { boolean removed = api().deleteAccount(username); assertTrue(removed); }

Target:
protected void tearDown() { api().deleteAccount(username); }
Source:
private BlockingTaskAwareExecutorServiceImpl createExecutorService() { return new BlockingTaskAwareExecutorServiceImpl("BlockingAwareTest-Controller", new ThreadPoolExecutor(1, 2, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<>(1000), new DummyThreadFactory()), TIME_SERVICE); }

Target:
private BlockingTaskAwareExecutorServiceImpl createExecutorService() { final String controllerName = "Controller-" + getClass().getSimpleName(); final ExecutorService realOne = new ThreadPoolExecutor(1, 2, 60, TimeUnit.SECONDS, new LinkedBlockingQueue<>(), new DummyThreadFactory()); return new BlockingTaskAwareExecutorServiceImpl(controllerName, realOne, TIME_SERVICE); }
Source:
public Object getCurrentTransactionId() { com.arjuna.ats.internal.jta.transaction.jts.TransactionImple transaction = com.arjuna.ats.internal.jta.transaction.jts.TransactionImple.getTransaction(); if (transaction == null) return null; return transaction.get_uid(); }

Target:
public Object getCurrentTransactionId() { com.arjuna.ats.internal.jta.transaction.jts.TransactionImple transaction = TransactionImple.getTransaction(); if (transaction == null) return null; return transaction.get_uid(); }
Source:
public void createODKDirs() throws RuntimeException { if (!new StorageStateProvider().isStorageMounted()) { throw new RuntimeException( Collect.getInstance().getString(R.string.sdcard_unmounted, Environment.getExternalStorageState())); } for (String dirPath : new StoragePathProvider().getOdkDirPaths()) { File dir = new File(dirPath); if (!dir.exists()) { if (!dir.mkdirs()) { String message = Collect.getInstance().getString(R.string.cannot_create_directory, dirPath); Timber.w(message); throw new RuntimeException(message); } } else { if (!dir.isDirectory()) { String message = Collect.getInstance().getString(R.string.not_a_directory, dirPath); Timber.w(message); throw new RuntimeException(message); } } } }

Target:
public void createODKDirs() throws RuntimeException { if (!storageStateProvider.isStorageMounted()) { throw new RuntimeException(context.getString(R.string.sdcard_unmounted, Environment.getExternalStorageState())); } for (String dirPath : storagePathProvider.getOdkDirPaths()) { File dir = new File(dirPath); if (!dir.exists()) { if (!dir.mkdirs()) { String message = context.getString(R.string.cannot_create_directory, dirPath); Timber.w(message); throw new RuntimeException(message); } } else { if (!dir.isDirectory()) { String message = context.getString(R.string.not_a_directory, dirPath); Timber.w(message); throw new RuntimeException(message); } } } }