auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean isAllowedInSessionLevelAnySection(String sessionName, String privilegeName) { for (String sectionName : this.sessionLevel.keySet()) { <START> if (this.sessionLevel.get(sectionName).get(sessionName).containsKey(privilegeName) && <END> this.sessionLevel.get(sectionName).get(sessionName).get(privilegeName).booleanValue()) { return true; } } for (String sectionName : this.sectionLevel.keySet()) { if (isAllowedInSectionLevel(sectionName, privilegeName)) { return true; } } return false; }</code><technical_language>a check for <code>this.sessionLevel.get(sectionName).containsKey(sessionName)</code></technical_language>

Target:
private boolean isAllowedInSessionLevelAnySection(String sessionName, String privilegeName) { HashSet<String> sections = new HashSet<String>(this.sessionLevel.keySet()); sections.addAll(this.sectionLevel.keySet()); for (String sectionName : sections) { if (isAllowedInSessionLevel(sectionName, sessionName, privilegeName)) { return true; } } return false; }
Source:
<code>public void created(ClientCacheEntryCreatedEvent e) { for (CreatedListener listener : created) { try { listener.created(e.getKey(), e.getVersion()); <START> } catch (Throwable t) { <END> log.error("Listener " + listener + " has thrown an exception", t); } } }</code><technical_language>I starting reluctant catching Throwable rethrowing: change this Exception in embedded listeners</technical_language>

Target:
public void created(ClientCacheEntryCreatedEvent e) { for (CreatedListener listener : created) { try { listener.created(e.getKey(), e.getVersion()); } catch (Exception ex) { log.error("Listener " + listener + " has thrown an exception", ex); } } }
Source:
<code><START> protected Object getSessionUser(String sessionID) { <END> return SessionDataContainer.getInstance().GetData(sessionID, USER_SESSION_KEY); }</code><technical_language>SessionDataContainer.getInstance().getUser(sessionID)</technical_language>

Target:
protected Object getSessionUser(String sessionID) { return SessionDataContainer.getInstance().getUser(sessionID); }
Source:
<code>public void validateFor(InvocationOnMock invocation) { <START> Throwable throwable = this.throwable; <END> if (throwable == null) { throw cannotStubWithNullThrowable(); } if (throwable instanceof RuntimeException || throwable instanceof Error) { return; } if (!new MethodInfo(invocation).isValidException(throwable)) { throw checkedExceptionInvalid(throwable); } }</code><technical_language>this line removed</technical_language>

Target:
public void validateFor(InvocationOnMock invocation) { if (throwable == null) { throw cannotStubWithNullThrowable(); } if (throwable instanceof RuntimeException || throwable instanceof Error) { return; } if (!new InvocationInfo(invocation).isValidException(throwable)) { throw checkedExceptionInvalid(throwable); } }
Source:
<code>public static void skipContent(@Nonnull JayceInternalReaderImpl in) throws IOException { NodeLevel nodeLevel = in.getNodeLevel(); in.readInt(); <START> in.readId(); <END> if (nodeLevel != NodeLevel.TYPES) { in.skipId(); in.skipIds(); in.skipId(); in.skipId(); in.skipId(); in.skipIds(); in.readNodes(NField.class); in.readNodes(NMethod.class); in.skipNodes(NAnnotation.class); in.skipNodes(NMarker.class); } }</code><technical_language>skipId</technical_language>

Target:
public static void skipContent(@Nonnull JayceInternalReaderImpl in) throws IOException { NodeLevel nodeLevel = in.getNodeLevel(); in.skipInt(); in.skipId(); if (nodeLevel != NodeLevel.TYPES) { in.skipId(); in.skipIds(); in.skipId(); in.skipId(); in.skipId(); in.skipIds(); in.skipNodes(NField.class); in.skipNodes(NMethod.class); in.skipNodes(NAnnotation.class); in.skipNodes(NMarker.class); } }
Source:
<code>public boolean isItemValid(int slot, @Nonnull ItemStack stack) { if (checkSlot(slot)) { <START> return compose.isItemValid(slot, stack); <END> } return false; }</code><technical_language>need slot + minSlot</technical_language>

Target:
public boolean isItemValid(int slot, @Nonnull ItemStack stack) { if (checkSlot(slot)) { return compose.isItemValid(slot + minSlot, stack); } return false; }
Source:
<code>public ImageLicense processPage(int pageId, PageTitle pageTitle, JSONObject result) { try { <START> if (result.getJSONArray("imageinfo") != null) { <END> JSONObject imageInfo = (JSONObject) result.getJSONArray("imageinfo").get(0); ImageLicense license = parseImageLicenseMetadata(imageInfo.getJSONObject("extmetadata")); return license; } return null; } catch (JSONException e) { Log.w(TAG, e); return null; } }</code><technical_language>I get* methods return null. If field present, throw exception. implementation of getJSONArray() (as reported Android Studio): public JSONArray getJSONArray(String name) throws JSONException { Object object = get(name); if (object instanceof JSONArray) { return (JSONArray) object; } else { throw JSON.typeMismatch(name, object, "JSONArray"); } }</technical_language>

Target:
public ImageLicense processPage(int pageId, PageTitle pageTitle, JSONObject result) { ImageLicense license = new ImageLicense("", "", ""); try { JSONObject imageInfo = (JSONObject) result.getJSONArray("imageinfo").get(0); parseImageLicenseMetadata(license, imageInfo.getJSONObject("extmetadata")); } catch (JSONException e) { Log.w(TAG, e); } return license; }
Source:
<code><START> private static TmfTimeRange getTimeRangeForX(int x, SWTBotTimeGraphEntry entry){ <END> Long low = entry.getTimeForPoint(x); assertNotNull(low); Long high = entry.getTimeForPoint(x + 1); assertNotNull(high); return new TmfTimeRange(TmfTimestamp.fromNanos(low), TmfTimestamp.fromNanos(high)); }</code><technical_language>I if this good bad news, is longer need for uncertainty ranges -- selection window range times expected nanosecond. method validateRanges() longs expected input. For example line 479, window [30,70], drag 30ns left, new window is [60,100]</technical_language>

Target:
private static long getTimeRangeForX(int x, SWTBotTimeGraphEntry entry){ Long timeForPoint = entry.getTimeForPoint(x); assertNotNull(timeForPoint); return timeForPoint; }
Source:
<code>private void addExecutionPermissionToScripts() throws IOException { <START> String schedulerHome = ClasspathUtils.findSchedulerHome(); <END> if (!StandardSystemProperty.OS_NAME.value().toLowerCase().contains("windows")) { File scriptsDirectory = new File(schedulerHome, "dist/scripts/processbuilder/linux"); if (scriptsDirectory != null) { for (File script : scriptsDirectory.listFiles()) { script.setExecutable(true, false); } } else { throw new IOException("The directory that contains scripts required for the runAsMe mode does not exist"); } } }</code><technical_language>Include this instruction in if block String schedulerHome = ClasspathUtils.findSchedulerHome();</technical_language>

Target:
private void addExecutionPermissionToScripts() throws IOException { if (!StandardSystemProperty.OS_NAME.value().toLowerCase().contains("windows")) { String schedulerHome = ClasspathUtils.findSchedulerHome(); File scriptsDirectory = new File(schedulerHome, "dist/scripts/processbuilder/linux"); if (scriptsDirectory != null) { for (File script : scriptsDirectory.listFiles()) { script.setExecutable(true, false); } } else { throw new IOException("The directory that contains scripts required for the runAsMe mode does not exist"); } } }
Source:
<code>public void stop() throws InterruptedException { if (supervisorTaskChecker != null) { supervisorTaskChecker.shutdownNow(); supervisorTaskChecker.awaitTermination(10, TimeUnit.SECONDS); <START> supervisorTaskChecker = null; <END> } supervisorTaskCheckTimes.clear(); }</code><technical_language>is of setting null</technical_language>

Target:
public void stop() throws InterruptedException { if (supervisorTaskChecker != null) { supervisorTaskChecker.shutdownNow(); supervisorTaskChecker.awaitTermination(10, TimeUnit.SECONDS); } supervisorTaskCheckTimes.clear(); }
Source:
<code>public void tick(WorkloadExecutionStatus status, WorkloadAdjuster adjuster) { log.debug("Going to perform tick with status {}", status); if (isPeriodic()) { long currentTime = System.currentTimeMillis(); if (startTime == 0) { startTime = currentTime - period; } long difference = currentTime - startTime; if(difference >= period) { <START> startTime = startTime + period; <END> sendSamples(samplesCount, status, adjuster); } } else { int samplesLeft = samplesCount - samplesSubmitted; sendSamples(samplesLeft, status, adjuster); } }</code><technical_language>if period << difference</technical_language>

Target:
public void tick(WorkloadExecutionStatus status, WorkloadAdjuster adjuster) { log.debug("Going to perform tick with status {}", status); if (isPeriodic()) { long currentTime = System.currentTimeMillis(); if (startTime == 0) { startTime = currentTime - period; } long difference = currentTime - startTime; if(difference >= period) { if (status.getTotalSamples() < samplesSubmitted) { log.warn("Can not create such load with invocations with ms period", samplesCount, period); } startTime = startTime + period; sendSamples(samplesCount, status, adjuster); } } else { int samplesLeft = samplesCount - samplesSubmitted; sendSamples(samplesLeft, status, adjuster); } }
Source:
<code>private DB selectDatabase(Mongo mongo) { DB db = mongo.getDB(dbName); db.setWriteConcern(WriteConcern.JOURNALED); if (username != null) { if(authDbName != null) { <START> DB authDb = mongo.getDB(authDbName) <END> authDb.authenticate(username, password.toCharArray()); } else { db.authenticate(username, password.toCharArray()); } } return db; }</code><technical_language>A missing semicolon [causes project fail compile](<LINK_0></technical_language>

Target:
private DB selectDatabase(Mongo mongo) { DB db = mongo.getDB(dbName); db.setWriteConcern(WriteConcern.JOURNALED); if (username != null) { if(authDbName != null) { DB authDb = mongo.getDB(authDbName); authDb.authenticate(username, password.toCharArray()); } else { db.authenticate(username, password.toCharArray()); } } return db; }
Source:
<code>private List<DispoItem> massDisposition(BranchId branch, String setId, List<String> itemIds, String resolutionType, String resolution) { List<DispoItem> toEdit = new ArrayList<>(); List<DispoItem> allItemsInSet = getDispoItems(branch, setId); for (DispoItem item : allItemsInSet) { if (itemIds.contains(item.getGuid())) { DispoItemData newItem = new DispoItemData(); newItem.setGuid(item.getGuid()); newItem.setName(item.getName()); List<DispoAnnotationData> newAnnotations = new ArrayList<>(); newAnnotations = item.getAnnotationsList(); for (DispoAnnotationData annotation : item.getAnnotationsList()) { if (annotation.getResolution().equals("")) { annotation.setResolutionType(resolutionType); annotation.setResolution(resolution); <START> annotation.setLastResolution(resolution); <END> annotation.setIsResolutionValid(true); annotation.setIsConnected(true); annotation.setIsDefault(false); dispoConnector.connectAnnotation(annotation, item.getDiscrepanciesList()); newAnnotations.set(annotation.getIndex(), annotation); } } newItem.setAnnotationsList(newAnnotations); newItem.setDiscrepanciesList(item.getDiscrepanciesList()); newItem.setStatus(dispoConnector.getItemStatus(newItem)); toEdit.add(newItem); } } return toEdit; }</code><technical_language>I want valid test script covered test point. This save resolution of is</technical_language>

Target:
private List<DispoItem> massDisposition(BranchId branch, String setId, List<String> itemIds, String resolutionType, String resolution) { List<DispoItem> toEdit = new ArrayList<>(); List<DispoItem> allItemsInSet = getDispoItems(branch, setId); for (DispoItem item : allItemsInSet) { if (itemIds.contains(item.getGuid())) { DispoItemData newItem = new DispoItemData(); newItem.setGuid(item.getGuid()); newItem.setName(item.getName()); List<DispoAnnotationData> newAnnotations = new ArrayList<>(); newAnnotations = item.getAnnotationsList(); for (DispoAnnotationData annotation : item.getAnnotationsList()) { if (annotation.getResolution().equals("")) { annotation.setResolutionType(resolutionType); annotation.setResolution(resolution); annotation.setLastResolution("N/A"); annotation.setIsResolutionValid(true); annotation.setIsConnected(true); annotation.setIsDefault(false); dispoConnector.connectAnnotation(annotation, item.getDiscrepanciesList()); newAnnotations.set(annotation.getIndex(), annotation); } } newItem.setAnnotationsList(newAnnotations); newItem.setDiscrepanciesList(item.getDiscrepanciesList()); newItem.setStatus(dispoConnector.getItemStatus(newItem)); toEdit.add(newItem); } } return toEdit; }
Source:
<code>public void updateModel(final @Nullable ISegmentStore<ISegment> dataInput) { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (!getTableViewer().getTable().isDisposed()) { ISegmentStore<ISegment> data = dataInput; ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace(); if (trace == null) { fAnalysisModule = null; } else { fAnalysisModule = TmfTraceUtils.getAnalysisModuleOfClass(trace, LatencyAnalysis.class, LatencyAnalysis.ID); } if (data == null){ setInput(null); getTableViewer().setItemCount(0); return; } setInput(data); <START> getTableViewer().setItemCount((int) data.getNbElements()); <END> } } }); }</code><technical_language>DeferredContentProvider support more Integer.MAX_VALUE either, do want do a bounds check here? Truncate max int</technical_language>

Target:
public void updateModel(final @Nullable ISegmentStore<ISegment> dataInput) { Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (!getTableViewer().getTable().isDisposed()) { ISegmentStore<ISegment> data = dataInput; ITmfTrace trace = TmfTraceManager.getInstance().getActiveTrace(); if (trace == null) { fAnalysisModule = null; } else { fAnalysisModule = TmfTraceUtils.getAnalysisModuleOfClass(trace, LatencyAnalysis.class, LatencyAnalysis.ID); } if (data == null){ setInput(null); getTableViewer().setItemCount(0); return; } setInput(data); if (data.getNbElements() <= Integer.MAX_VALUE) { getTableViewer().setItemCount((int) data.getNbElements()); } else { getTableViewer().setItemCount(Integer.MAX_VALUE); } } } }); }
Source:
<code>public ServiceBusMessage(ServiceBusReceivedMessage receivedMessage) { Objects.requireNonNull(receivedMessage, "'receivedMessage' cannot be null."); this.amqpAnnotatedMessage = new AmqpAnnotatedMessage(receivedMessage.getAmqpAnnotatedMessage()); this.context = Context.NONE; <START> final AmqpDataBody amqpDataBody = ((AmqpDataBody) receivedMessage.getAmqpAnnotatedMessage().getBody()); <END> final List<BinaryData> binaryDataList = amqpDataBody.getData().stream().collect(Collectors.toList()); if (binaryDataList.size() > 0) { binaryData = binaryDataList.get(0).getData(); } else { binaryData = EMPTY_BYTE_ARRAY; } amqpAnnotatedMessage.getHeader().setDeliveryCount(null); removeValues(amqpAnnotatedMessage.getMessageAnnotations(), LOCKED_UNTIL_KEY_ANNOTATION_NAME, SEQUENCE_NUMBER_ANNOTATION_NAME, DEAD_LETTER_SOURCE_KEY_ANNOTATION_NAME, ENQUEUED_SEQUENCE_NUMBER_ANNOTATION_NAME, ENQUEUED_TIME_UTC_ANNOTATION_NAME); removeValues(amqpAnnotatedMessage.getApplicationProperties(), DEAD_LETTER_DESCRIPTION_ANNOTATION_NAME, DEAD_LETTER_REASON_ANNOTATION_NAME); }</code><technical_language>test actual BodyType of this. miss this result in a runtime exception move support multiple types</technical_language>

Target:
public ServiceBusMessage(ServiceBusReceivedMessage receivedMessage) { Objects.requireNonNull(receivedMessage, "'receivedMessage' cannot be null."); this.amqpAnnotatedMessage = new AmqpAnnotatedMessage(receivedMessage.getAmqpAnnotatedMessage()); this.context = Context.NONE; this.binaryData = receivedMessage.getBody(); amqpAnnotatedMessage.getHeader().setDeliveryCount(null); removeValues(amqpAnnotatedMessage.getMessageAnnotations(), LOCKED_UNTIL_KEY_ANNOTATION_NAME, SEQUENCE_NUMBER_ANNOTATION_NAME, DEAD_LETTER_SOURCE_KEY_ANNOTATION_NAME, ENQUEUED_SEQUENCE_NUMBER_ANNOTATION_NAME, ENQUEUED_TIME_UTC_ANNOTATION_NAME); removeValues(amqpAnnotatedMessage.getApplicationProperties(), DEAD_LETTER_DESCRIPTION_ANNOTATION_NAME, DEAD_LETTER_REASON_ANNOTATION_NAME); }
Source:
<code>public AsyncRequest(int method, String url, String entity) { <START> super(method, url + "/@async", entity); <END> }</code><technical_language>Put string in a constant</technical_language>

Target:
public AsyncRequest(int method, String url, String entity) { super(method, url + ASYNC_ADAPTER, entity); }
Source:
<code>public void loadPlugins(Class source) { URL[] urls; <START> if (checkFileExists() == false) { <END> log.info("No plugin configuration file found, skipping loading plugins"); return; } try (InputStream inputStream = openFromFile()) { PluginProperties props = parsePluginConfigs(inputStream); List<PluginProperties.PluginConfiguration> pluginConfigurations = getEnabledJars(props); logPlugins(pluginConfigurations); urls = getJarPathsFromPluginConfigurations(pluginConfigurations); } catch (IOException e) { throw new MissingPluginConfigurationException( "Unable to load plugin config file: " + this.filename, e); } addJarsToClassPath(source, urls); }</code><technical_language>This reads a weird. "Not loading plugins: plugin configuration file found: %s" %s is path searched</technical_language>

Target:
public void loadPlugins(Class source) { URL[] urls; if (checkFileExists() == false) { log.info("Not loading plugins: No plugin configuration file found: {}", this.filename); return; } try (InputStream inputStream = openFromFile()) { PluginProperties props = parsePluginConfigs(inputStream); List<PluginProperties.PluginConfiguration> pluginConfigurations = getEnabledJars(props); logPlugins(pluginConfigurations); urls = getJarPathsFromPluginConfigurations(pluginConfigurations); } catch (IOException e) { throw new MissingPluginConfigurationException( String.format( "Not loading plugins: No plugin configuration file found: %s", this.filename), e); } addJarsToClassPath(source, urls); }
Source:
<code>public void createsMeasuredResponseWithCustomHeader() throws IOException { <START> final String customHeader = "X-Custom-Takes-Millis"; <END> MatcherAssert.assertThat( new RsPrint( new TkMeasured( new TkText("custom header response"), customHeader ).act() ).print(), Matchers.containsString(customHeader) ); }</code><technical_language>same: <LINK_0></technical_language>

Target:
public void createsMeasuredResponseWithCustomHeader() throws IOException { final String header = "X-Custom-Takes-Millis"; MatcherAssert.assertThat( new RsPrint( new TkMeasured( new TkText("custom header response"), header ).act() ).print(), Matchers.containsString(header) ); }
Source:
<code>protected void updateDetailsAvailability() { super.updateDetailsAvailability(); <START> NetworkView network = (NetworkView) getSelectedItem(); <END> networkExternalSubnetListModel.setIsAvailable(network.isExternal()); }</code><technical_language>I this return null</technical_language>

Target:
protected void updateDetailsAvailability() { super.updateDetailsAvailability(); NetworkView network = (NetworkView) getSelectedItem(); networkExternalSubnetListModel.setIsAvailable(network != null && network.isExternal()); }
Source:
<code>private Cluster findBestProbe(List<Cluster> clusters) { int highestProbeBitrateBps = 0; Cluster bestIt = new Cluster(); for (Cluster cluster : clusters) { if (cluster.sendMeanMs == 0 || cluster.recvMeanMs == 0) continue; if (cluster.numAboveMinDelta > cluster.count / 2 && <START> (cluster.recvMeanMs - cluster.sendMeanMs <= 2.0f && <END> cluster.sendMeanMs - cluster.recvMeanMs <= 5.0f)) { int probeBitrateBps = Math.min(cluster.getSendBitrateBps(), cluster .getRecvBitrateBps()); if (probeBitrateBps > highestProbeBitrateBps) { highestProbeBitrateBps = probeBitrateBps; bestIt = cluster; } } else { double sendBitrateBps = cluster.meanSize * 8 * 1000 / cluster.sendMeanMs; double recvBitrateBps = cluster.meanSize * 8 * 1000 / cluster.recvMeanMs; logger.warn("Probe failed, sent at " + sendBitrateBps + " bps, received at " + recvBitrateBps + " bps. Mean send delta: " + cluster.sendMeanMs + " ms, mean recv delta: " + cluster.recvMeanMs + " ms, num probes: " + cluster.count); break; } } return bestIt; }</code><technical_language>I find this easier read as: (-2.0f <= cluster.sendMeanMs - cluster.recvMeanMs && cluster.sendMeanMs - cluster.recvMeanMs <= 5.0f)) of cluster. MeanMs prefix suffix, is hard difference is negation of second. multiplying sides -1 (and inverting sense of comparison), a) easier symmetry, b) preferred "in range check"</technical_language>

Target:
private Cluster findBestProbe(List<Cluster> clusters) { int highestProbeBitrateBps = 0; Cluster bestIt = new Cluster(); for (Cluster cluster : clusters) { if (cluster.sendMeanMs == 0 || cluster.recvMeanMs == 0) continue; if (cluster.numAboveMinDelta > cluster.count / 2 && (-2.0f <= cluster.sendMeanMs - cluster.recvMeanMs && cluster.sendMeanMs - cluster.recvMeanMs <= 5.0f)) { int probeBitrateBps = Math.min(cluster.getSendBitrateBps(), cluster .getRecvBitrateBps()); if (probeBitrateBps > highestProbeBitrateBps) { highestProbeBitrateBps = probeBitrateBps; bestIt = cluster; } } else { double sendBitrateBps = cluster.meanSize * 8 * 1000 / cluster.sendMeanMs; double recvBitrateBps = cluster.meanSize * 8 * 1000 / cluster.recvMeanMs; logger.warn("Probe failed, sent at " + sendBitrateBps + " bps, received at " + recvBitrateBps + " bps. Mean send delta: " + cluster.sendMeanMs + " ms, mean recv delta: " + cluster.recvMeanMs + " ms, num probes: " + cluster.count); break; } } return bestIt; }
Source:
<code><START> public double getPWMDutyCycle(IOLine ioLine) throws InvalidOperatingModeException, XBeeException { <END> if (!connectionInterface.isOpen()) throw new XBeeException(XBeeException.CONNECTION_NOT_OPEN); if (ioLine == null) throw new NullPointerException("IO line cannot be null."); if (!ioLine.hasPWMCapability()) throw new IllegalArgumentException("Provided IO line does not have PWM capability."); String atCommand = ioLine.getPWMATCommand(); ATCommandResponse response = sendATCommand(new ATCommand(atCommand)); if (response == null || response.getResponseStatus() != ATCommandStatus.OK) throw new XBeeException(XBeeException.INVALID_OPERATION); int readValue = ByteUtils.byteArrayToInt(response.getResponse()); return readValue * 100.0/1023.0; }</code><technical_language>This need revisited throw proper exceptions</technical_language>

Target:
public double getPWMDutyCycle(IOLine ioLine) throws InvalidOperatingModeException, XBeeException { if (!connectionInterface.isOpen()) throw new XBeeException(XBeeException.CONNECTION_NOT_OPEN); if (ioLine == null) throw new NullPointerException("IO line cannot be null."); if (!ioLine.hasPWMCapability()) throw new IllegalArgumentException("Provided IO line does not have PWM capability."); String atCommand = ioLine.getPWMDutyCycleATCommand(); ATCommandResponse response = sendATCommand(new ATCommand(atCommand)); if (response == null || response.getResponseStatus() != ATCommandStatus.OK || response == null || response.getResponse().length == 0) throw new XBeeException(XBeeException.INVALID_OPERATION); int readValue = ByteUtils.byteArrayToInt(response.getResponse()); return Math.round((readValue * 100.0/1023.0) * 100.0) / 100.0; }
Source:
<code>public void test() throws Exception { for (Entry<String, SignatureAlgorithmIdentifier> entry : SignatureAlgorithmIdentifier.getAllSignatureAlgorithmIdentifiers().entrySet()) { SignatureAlgorithmIdentifier signatureAlgorithmIdentifier = entry.getValue(); assertEquals(signatureAlgorithmIdentifier.getName(), entry.getKey()); AlgorithmIdentifier algorithmIdentifier; try { algorithmIdentifier = new DefaultSignatureAlgorithmIdentifierFinder().find(entry.getKey()); } catch (IllegalArgumentException e) { continue; <START> } <END> assertEquals( signatureAlgorithmIdentifier.getOid(), algorithmIdentifier.getAlgorithm().getId()); assertEquals( base16().encode(signatureAlgorithmIdentifier.getEncoded()), base16().encode(algorithmIdentifier.getAlgorithm().getEncoded("DER"))); assertEquals(algorithmIdentifier, algorithmIdentifier); assertEquals(algorithmIdentifier.hashCode(), algorithmIdentifier.hashCode()); } }</code><technical_language>this is correct error java assertEquals(e.getMessage(), "Unknown signature type requested: " + entry.getKey());</technical_language>

Target:
public void test() throws Exception { int verifiedCount = 0; for (Entry<String, SignatureAlgorithmIdentifier> entry : SignatureAlgorithmIdentifier.getAllSignatureAlgorithmIdentifiers().entrySet()) { SignatureAlgorithmIdentifier signatureAlgorithmIdentifier = entry.getValue(); assertEquals(signatureAlgorithmIdentifier.getName(), entry.getKey()); AlgorithmIdentifier algorithmIdentifier; try { algorithmIdentifier = new DefaultSignatureAlgorithmIdentifierFinder().find(entry.getKey()); } catch (IllegalArgumentException e) { continue; } assertEquals( signatureAlgorithmIdentifier.getOid(), algorithmIdentifier.getAlgorithm().getId()); assertEquals( base16().encode(signatureAlgorithmIdentifier.getEncoded()), base16().encode(algorithmIdentifier.getAlgorithm().getEncoded("DER"))); assertEquals(algorithmIdentifier, algorithmIdentifier); assertEquals(algorithmIdentifier.hashCode(), algorithmIdentifier.hashCode()); verifiedCount++; } assertThat(verifiedCount).as("Algorithm identifiers verified").isGreaterThanOrEqualTo(10); }
Source:
<code>public Query setIsolationLevel(IsolationLevel level) { <START> if (this instanceof ImmutableScan) { <END> super.setAttribute(ISOLATION_LEVEL, level.toBytes()); } else { setAttribute(ISOLATION_LEVEL, level.toBytes()); } return this; }</code><technical_language>Why</technical_language>

Target:
public Query setIsolationLevel(IsolationLevel level) { setAttribute(ISOLATION_LEVEL, level.toBytes()); return this; }
Source:
<code>public void fileModeTestFileWithMissingInWorkingTree() throws Exception { Git git = new Git(db); writeTrashFile("a", "Hello world a"); writeTrashFile("b", "Hello world b"); git.add().addFilepattern(".").call(); git.commit().setMessage("add files a & b").call(); Ref branch_1 = git.branchCreate().setName("branch_1").call(); git.rm().addFilepattern("a").call(); <START> File symlinkA = new File(db.getWorkTree(), "a"); <END> writeTrashFile("a", "b"); git.add().addFilepattern("a").call(); git.commit().setMessage("add file a").call(); FileEntry entry = new FileTreeIterator.FileEntry(new File( db.getWorkTree(), "a"), db.getFS()); assertEquals(FileMode.REGULAR_FILE, entry.getMode()); FileUtils.delete(symlinkA); git.checkout().setName(branch_1.getName()).call(); entry = new FileTreeIterator.FileEntry(new File(db.getWorkTree(), "a"), db.getFS()); assertEquals(FileMode.REGULAR_FILE, entry.getMode()); }</code><technical_language>is called 'symlinkA' . This test create symlinks. I this test a bugfix commit is a predecessor of this change. I changed this variable name fileA</technical_language>

Target:
public void fileModeTestFileWithMissingInWorkingTree() throws Exception { Git git = new Git(db); File fileA = writeTrashFile("a", "Hello world a"); writeTrashFile("b", "Hello world b"); git.add().addFilepattern(".").call(); git.commit().setMessage("add files a & b").call(); Ref branch_1 = git.branchCreate().setName("branch_1").call(); git.rm().addFilepattern("a").call(); writeTrashFile("a", "b"); git.add().addFilepattern("a").call(); git.commit().setMessage("add file a").call(); FileEntry entry = new FileTreeIterator.FileEntry(new File( db.getWorkTree(), "a"), db.getFS()); assertEquals(FileMode.REGULAR_FILE, entry.getMode()); FileUtils.delete(fileA); git.checkout().setName(branch_1.getName()).call(); entry = new FileTreeIterator.FileEntry(new File(db.getWorkTree(), "a"), db.getFS()); assertEquals(FileMode.REGULAR_FILE, entry.getMode()); }
Source:
<code><START> private void checkShutdown() { <END> if (completedOrFailedEvalCount.incrementAndGet() == initWorkerCount + initServerCount && !serverContexts.isEmpty()) { for (final ActiveContext serverContext : serverContexts) { serverContext.close(); } serverContexts.clear(); } }</code><technical_language>This code handles contexts a bit differently, compared PSExampleDriver. related #349 #362. Is close worker contexts right overlying tasks terminate</technical_language>

Target:
private void checkShutdown() { if (completedOrFailedEvalCount.incrementAndGet() == initWorkerCount + initServerCount) { for (final ActiveContext serverContext : serverContexts) { serverContext.close(); } for (final ActiveContext workerContext : workerContextsToClose) { workerContext.close(); } } }
Source:
<code>public <T> T find(Class<T> serviceClass) { final String[] eligibleLocalServices = applicationContext.getBeanNamesForAnnotation(Service.class); List<T> localServiceInstances = new LinkedList<>(); for (String eligibleService : eligibleLocalServices) { final Object bean = applicationContext.getBean(eligibleService); if (serviceClass.isInstance(bean) && !Proxy.isProxyClass(bean.getClass())) { <START> localServiceInstances.add((T) bean); <END> } } if (localServiceInstances.isEmpty()) { LOGGER.info("No local service found for {}", serviceClass); return null; } else if (localServiceInstances.size() == 1) { LOGGER.info("One local service found for {}", serviceClass); return localServiceInstances.get(0); } else { LOGGER.warn("{} local services found for {}", localServiceInstances.size(), serviceClass); return localServiceInstances.get(0); } }</code><technical_language>is strange build a List of service return</technical_language>

Target:
public <T> T find(Class<T> serviceClass) { final String[] eligibleLocalServices = applicationContext.getBeanNamesForAnnotation(Service.class); List<T> localServiceInstances = new LinkedList<>(); for (String eligibleService : eligibleLocalServices) { final Object bean = applicationContext.getBean(eligibleService); if (serviceClass.isInstance(bean) && !Proxy.isProxyClass(bean.getClass())) { localServiceInstances.add((T) bean); } } if (localServiceInstances.isEmpty()) { LOGGER.info("No local service found for {}", serviceClass); return null; } else if (localServiceInstances.size() == 1) { LOGGER.info("One local service found for {}", serviceClass); return localServiceInstances.get(0); } else { LOGGER.warn("{} local services found for {}", localServiceInstances.size(), serviceClass); return null; } }
Source:
<code>public StandardJoinFilterFunction(InternalJoinFilterFunction filterFunction, LongArrayList addresses, List<Page> pages) { this.filterFunction = requireNonNull(filterFunction, "filterFunction can not be null"); this.addresses = requireNonNull(addresses, "addresses is null"); <START> this.pages = requireNonNull(pages, "pages is null"); <END> }</code><technical_language>ImmutableList.copyOf</technical_language>

Target:
public StandardJoinFilterFunction(InternalJoinFilterFunction filterFunction, LongArrayList addresses, List<Page> pages) { this.filterFunction = requireNonNull(filterFunction, "filterFunction can not be null"); this.addresses = requireNonNull(addresses, "addresses is null"); this.pages = ImmutableList.copyOf(requireNonNull(pages, "pages is null")); }
Source:
<code>public ValueMatcher makeValueMatcher(String dimension, final Predicate predicate) { final DimensionSelector selector = cursor.makeDimensionSelector( new DefaultDimensionSpec(dimension, dimension) ); return new ValueMatcher() { final boolean matchNull = predicate.apply(null); @Override public boolean matches() { IndexedInts row = selector.getRow(); if (row.size() == 0) { return matchNull; } <START> for (int rowVal : row) { <END> if (predicate.apply(selector.lookupName(rowVal))) { return true; } } return false; } }; }</code><technical_language>this get treatment</technical_language>

Target:
public ValueMatcher makeValueMatcher(String dimension, final Predicate predicate) { final DimensionSelector selector = cursor.makeDimensionSelector( new DefaultDimensionSpec(dimension, dimension) ); return new ValueMatcher() { final boolean matchNull = predicate.apply(null); @Override public boolean matches() { IndexedInts row = selector.getRow(); if (row.size() == 0) { return matchNull; } for (int i = 0; i < row.size(); i++) { if (predicate.apply(selector.lookupName(row.get(i)))) { return true; } } return false; } }; }
Source:
<code>public boolean addNode(PlatformServer sender, String[] parents, String name, Serializable value) { <START> if ("management".equals(name) && value instanceof ManagementMessage) { <END> fire((ManagementMessage) value); } return false; }</code><technical_language>I a class loader issue here. Try tagging this class common component. Also, WARN Assert if type is expecting</technical_language>

Target:
public boolean addNode(PlatformServer sender, String[] parents, String name, Serializable value) { LOGGER.trace("[{}] addNode({}, {})", consumerId, name, String.valueOf(value)); if (RELIABLE_CHANNEL_KEY.equals(name)) { if (value instanceof ManagementMessage) { fire((ManagementMessage) value); } else if (value != null) { Utils.warnOrAssert(LOGGER, "[0] addNode(from={}) IGNORED: wrong value type: {}", value.getClass().getSimpleName()); } } return false; }
Source:
<code>public ReferencedEnvelope getBounds() throws IOException { <START> return this.getFeatures().getBounds(); <END> }</code><technical_language>inefficient here.. is all? get bounds of original collection, turn a polygon, intersect clip, return bounds of resulting geometry</technical_language>

Target:
public ReferencedEnvelope getBounds() throws IOException { ReferencedEnvelope orignalBounds = super.getBounds(); return JTS.toEnvelope(clip.intersection(JTS.toGeometry(orignalBounds))); }
Source:
<code>private MapperWrapper chainMapperWrappers(List<XStreamMarshallerExtension> extensions, MapperWrapper last) { if (extensions.isEmpty()) { return last; } else { XStreamMarshallerExtension head = extensions.get(0); <START> List<XStreamMarshallerExtension> tail = extensions.subList(1, extensions.size()); <END> return head.chainMapperWrapper(chainMapperWrappers(tail, last)); } }</code><technical_language>more readable replace lines extensions.remove(0) list shorter of item? Assuming extensions initially a copy of original list</technical_language>

Target:
private MapperWrapper chainMapperWrappers(List<XStreamMarshallerExtension> extensions, MapperWrapper last) { if (extensions.isEmpty()) { return last; } else { XStreamMarshallerExtension head = extensions.remove(0); return head.chainMapperWrapper(chainMapperWrappers(extensions, last)); } }
Source:
<code>public LruCache(int maxSize) { <START> super(maxSize + 1, 0.75f, true); <END> this.maxSize = maxSize; }</code><technical_language>maxSize + 1</technical_language>

Target:
public LruCache(int maxSize) { super(maxSize + 1, 1, true); this.maxSize = maxSize; }
Source:
<code>private ChannelInitializer<SocketChannel> channelInitializer(final Map<String, RequestHandler> requestHandlers) { return new ChannelInitializer<SocketChannel>() { @Override <START> protected void initChannel(SocketChannel ch) throws Exception { <END> ch.pipeline().addLast(new LengthFieldBasedFrameDecoder(TFrame.MAX_FRAME_LENGTH, 0, 2, -2, 0, true)); ch.pipeline().addLast(new TFrameCodec()); ch.pipeline().addLast(new MessageCodec()); ch.pipeline().addLast(new InitRequestHandler()); ch.pipeline().addLast(new MessageMultiplexer()); ch.pipeline().addLast(new RequestDispatcher(requestHandlers)); } }; }</code><technical_language>pass in a SocketChannel pass in .pipeline() returns</technical_language>

Target:
private ChannelInitializer<SocketChannel> channelInitializer(final Map<String, RequestHandler> requestHandlers) { return new ChannelInitializer<SocketChannel>() { @Override protected void initChannel(SocketChannel ch) throws Exception { ch.pipeline().addLast(new LengthFieldBasedFrameDecoder( TFrame.MAX_FRAME_LENGTH, TFrame.LENGTH_FIELD_OFFSET, TFrame.LENGTH_FIELD_LENGTH, TFrame.LENGTH_ADJUSTMENT, TFrame.INITIAL_BYTES_TO_STRIP, TFrame.FAIL_FAST )); ch.pipeline().addLast(new TFrameCodec()); ch.pipeline().addLast(new MessageCodec()); ch.pipeline().addLast(new InitRequestHandler()); ch.pipeline().addLast(new MessageMultiplexer()); ch.pipeline().addLast(new RequestDispatcher(requestHandlers)); } }; }
Source:
<code>public void testListRegions() { List<Region> regions = regionApi.list(); <START> assertTrue(regions.size() > 0, "Region list should not be empty"); <END> }</code><technical_language>!regions.isEmpty()</technical_language>

Target:
public void testListRegions() { List<Region> regions = regionApi.list(); assertFalse(regions.isEmpty(), "Region list should not be empty"); }
Source:
<code>private NetworkSecurityGroup createGroup() { NetworkSecurityRule rule = NetworkSecurityRule.create("denyallout", null, null, NetworkSecurityRuleProperties.create("deny all out", Protocol.Tcp, "*", "*", "*", "*", Access.Deny, 4095, <START> Direction.Outbound)); <END> ArrayList<NetworkSecurityRule> ruleList = new ArrayList<NetworkSecurityRule>(); ruleList.add(rule); NetworkSecurityGroup nsg = NetworkSecurityGroup.create("samplensg", "westus", null, NetworkSecurityGroupProperties.create(ruleList, null, null, null, null, null), null); return nsg; }</code><technical_language>[minor] For factory methods amount of constructor parameters, consider providing a builder, code is easier read understand</technical_language>

Target:
private NetworkSecurityGroup createGroup() { NetworkSecurityRule rule = NetworkSecurityRule.create("denyallout", null, null, NetworkSecurityRuleProperties.builder() .description("deny all out") .protocol(Protocol.Tcp) .sourcePortRange("*") .destinationPortRange("*") .sourceAddressPrefix("*") .destinationAddressPrefix("*") .access(Access.Deny) .priority(4095) .direction(Direction.Outbound) .build()); ArrayList<NetworkSecurityRule> ruleList = new ArrayList<NetworkSecurityRule>(); ruleList.add(rule); NetworkSecurityGroup nsg = NetworkSecurityGroup.create("samplensg", "westus", null, NetworkSecurityGroupProperties.builder() .securityRules(ruleList) .build(), null); return nsg; }
Source:
<code>public static Runnable getTerminationRunnable(Vertx vertx, Logger log, Runnable action) { return () -> { CountDownLatch latch = new CountDownLatch(1); <START> System.out.println("Shutdown hook ! " + vertx); <END> if (vertx != null) { vertx.close(ar -> { if (!ar.succeeded()) { log.error("Failure in stopping Vert.x", ar.cause()); } latch.countDown(); }); try { if (!latch.await(2, TimeUnit.MINUTES)) { log.error("Timed out waiting to undeploy all"); } if (action != null) { action.run(); } } catch (InterruptedException e) { throw new IllegalStateException(e); } } }; }</code><technical_language>remove this? I guess for debugging purpose</technical_language>

Target:
public static Runnable getTerminationRunnable(Vertx vertx, Logger log, Runnable action) { return () -> { CountDownLatch latch = new CountDownLatch(1); if (vertx != null) { vertx.close(ar -> { if (!ar.succeeded()) { log.error("Failure in stopping Vert.x", ar.cause()); } latch.countDown(); }); try { if (!latch.await(2, TimeUnit.MINUTES)) { log.error("Timed out waiting to undeploy all"); } if (action != null) { action.run(); } } catch (InterruptedException e) { throw new IllegalStateException(e); } } }; }
Source:
<code>private List<BlockDevice> getBlockDevices(VirtualGuest virtualGuest) { if (virtualGuest.getVirtualGuestBlockDevices() == null) { return null; } List<BlockDevice> blockDevices = Lists.newArrayList(); for (VirtualGuestBlockDevice blockDevice : virtualGuest.getVirtualGuestBlockDevices()) { blockDevices.add(new BlockDevice(blockDevice.getDevice(), blockDevice.getVirtualDiskImage().getCapacity())); } Collections.sort(blockDevices, new BlockDevicesComparator()); <START> return blockDevices; <END> }</code><technical_language>return ImmutableList.copyOf(blockDevices)? is result object converted immutable collection passed user</technical_language>

Target:
private List<BlockDevice> getBlockDevices(VirtualGuest virtualGuest) { if (virtualGuest.getVirtualGuestBlockDevices() == null) { return null; } List<BlockDevice> blockDevices = Lists.newArrayList(); for (VirtualGuestBlockDevice blockDevice : virtualGuest.getVirtualGuestBlockDevices()) { blockDevices.add(new BlockDevice(blockDevice.getDevice(), blockDevice.getVirtualDiskImage().getCapacity())); } Collections.sort(blockDevices, new BlockDevicesComparator()); return ImmutableList.copyOf(blockDevices); }
Source:
<code>private Handler buildBaseHandler(Class<?> sqlObjectType, Method method) { <START> List<Class<?>> sqlMethodAnnotations = Stream.of(method.getAnnotations()) <END> .map(Annotation::annotationType) .filter(type -> type.isAnnotationPresent(SqlMethodAnnotation.class)) .collect(toList()); if (sqlMethodAnnotations.size() > 1) { throw new IllegalStateException( String.format("Mutually exclusive annotations on method %s.%s: %s", sqlObjectType.getName(), method.getName(), sqlMethodAnnotations)); } if (method.isDefault()) { if (!sqlMethodAnnotations.isEmpty()) { throw new IllegalStateException(String.format( "Method %s.%s has mutually exclusive default implementation and a SQL method annotation %s " + "(must be one or the other)", sqlObjectType.getSimpleName(), method.getName(), sqlMethodAnnotations.get(0).getName())); } return new DefaultMethodHandler(); } return sqlMethodAnnotations.stream() .map(type -> type.getAnnotation(SqlMethodAnnotation.class)) .map(a -> buildFactory(a.value())) .map(factory -> factory.buildHandler(sqlObjectType, method)) .findFirst() .orElseThrow(() -> new AbstractMethodError(String.format( "Method %s.%s must be default or be annotated with a SQL method annotation.", sqlObjectType.getSimpleName(), method.getName()))); }</code><technical_language>you, please, elaborate need a list a set</technical_language>

Target:
private Handler buildBaseHandler(Class<?> sqlObjectType, Method method) { List<Class<?>> sqlMethodAnnotations = Stream.of(method.getAnnotations()) .map(Annotation::annotationType) .filter(type -> type.isAnnotationPresent(SqlMethodAnnotation.class)) .collect(toList()); if (sqlMethodAnnotations.size() > 1) { throw new IllegalStateException( String.format("Mutually exclusive annotations on method %s.%s: %s", sqlObjectType.getName(), method.getName(), sqlMethodAnnotations)); } if (method.isDefault()) { if (!sqlMethodAnnotations.isEmpty()) { throw new IllegalStateException(String.format( "Default method %s.%s has @%s annotation. " + "SQL object methods may be default, or have a SQL method annotation, but not both.", sqlObjectType.getSimpleName(), method.getName(), sqlMethodAnnotations.get(0).getSimpleName())); } return new DefaultMethodHandler(); } return sqlMethodAnnotations.stream() .map(type -> type.getAnnotation(SqlMethodAnnotation.class)) .map(a -> buildFactory(a.value())) .map(factory -> factory.buildHandler(sqlObjectType, method)) .findFirst() .orElseThrow(() -> new IllegalStateException(String.format( "Method %s.%s must be default or be annotated with a SQL method annotation.", sqlObjectType.getSimpleName(), method.getName()))); }
Source:
<code>public void verifyMapContains(Map<String, Boolean> map, List<FeedbackParticipantType> list) { for (FeedbackParticipantType participant : list) { assertTrue(map.get(participant.name())); } Set<FeedbackParticipantType> allParticipantTypes = EnumSet.allOf(FeedbackParticipantType.class); Set<String> nonParticipants = new HashSet<String>(); for (FeedbackParticipantType participantType : allParticipantTypes) { if (list.contains(participantType.name())) { <START> nonParticipants.add(participantType.name()); <END> } } for (String participant : nonParticipants) { assertFalse(map.containsKey(participant)); } }</code><technical_language>list is of FeedbackParticipantType, checking if contains participantType, participantType.name(). Also, I forgot negate if condition. If guessing objective correctly, this segment of code able do for in a more readable manner: Set<FeedbackParticipantType> nonParticipants = new HashSet<>(Arrays.asList(FeedbackParticipantType.values())); nonParticipants.removeAll(list); This test is passing right due nonParticipants empty, though, fix (L165, "OWN_TEAM_MEMBERS=true"). Also, avoid call Arrays.asList() times in allTests() ... construct pass relevant participants this method</technical_language>

Target:
public void verifyMapContains(Map<String, Boolean> map, List<FeedbackParticipantType> list) { for (FeedbackParticipantType participant : list) { assertTrue(map.get(participant.name())); } Set<FeedbackParticipantType> nonParticipants = new HashSet<>(Arrays.asList(FeedbackParticipantType.values())); nonParticipants.removeAll(list); for (FeedbackParticipantType nonParticipant : nonParticipants) { assertFalse(map.containsKey(nonParticipant.name())); } }
Source:
<code>public int getCount() { <START> return cities == null ? 0 : cities.size(); <END> }</code><technical_language>This null code in setData above</technical_language>

Target:
public int getCount() { return cities.size(); }
Source:
<code>public void testGetRequiredTokens() { final NoCodeInFileCheck checkObj = new NoCodeInFileCheck(); <START> assertArrayEquals(CommonUtil.EMPTY_INT_ARRAY, checkObj.getRequiredTokens(), <END> "Required tokens array is not empty"); }</code><technical_language>Please google.Truth assertWithMessage("Required tokens array is empty") .that(checkObj.getRequiredTokens()) .isEmpty();</technical_language>

Target:
public void testGetRequiredTokens() { final NoCodeInFileCheck checkObj = new NoCodeInFileCheck(); assertWithMessage("Required tokens array is not empty") .that(checkObj.getRequiredTokens()) .isEmpty(); }
Source:
<code>public Score toScore() { if ( scoreClass == null ) { return null; } <START> if ( BendableScore.class.equals( scoreClass ) ) { <END> return BendableScore.parseScore( scoreString ); } else if ( BendableBigDecimalScore.class.equals( scoreClass ) ) { return BendableBigDecimalScore.parseScore( scoreString ); } else if ( BendableLongScore.class.equals( scoreClass ) ) { return BendableLongScore.parseScore( scoreString ); } else if ( HardMediumSoftScore.class.equals( scoreClass ) ) { return HardMediumSoftScore.parseScore( scoreString ); } else if ( HardMediumSoftLongScore.class.equals( scoreClass ) ) { return HardMediumSoftLongScore.parseScore( scoreString ); } else if ( HardSoftScore.class.equals( scoreClass ) ) { return HardSoftScore.parseScore( scoreString ); } else if ( HardSoftBigDecimalScore.class.equals( scoreClass ) ) { return HardSoftBigDecimalScore.parseScore( scoreString ); } else if ( HardSoftDoubleScore.class.equals( scoreClass ) ) { return HardSoftDoubleScore.parseScore( scoreString ); } else if ( HardSoftLongScore.class.equals( scoreClass ) ) { return HardSoftLongScore.parseScore( scoreString ); } else if ( SimpleScore.class.equals( scoreClass ) ) { return SimpleScore.parseScore( scoreString ); } else if ( SimpleBigDecimalScore.class.equals( scoreClass ) ) { return SimpleBigDecimalScore.parseScore( scoreString ); } else if ( SimpleDoubleScore.class.equals( scoreClass ) ) { return SimpleDoubleScore.parseScore( scoreString ); } else if ( SimpleLongScore.class.equals( scoreClass ) ) { return SimpleLongScore.parseScore( scoreString ); } throw new UnsupportedOperationException( "Unsupported score class '" + scoreClass + "'." ); }</code><technical_language>Order of if's order <LINK_0> easier spot if is missing</technical_language>

Target:
public Score toScore() { if ( scoreClass == null ) { return null; } return ScoreUtils.parseScore( scoreClass, scoreString ); }
Source:
<code>private void send(final List<RemoteRefUpdate> cmds, final RefSpec spec) throws IOException { final String src = spec.getSource(); String dst = spec.getDestination(); <START> if (dst == null) dst = src; <END> final boolean force = spec.isForceUpdate(); cmds.add(new RemoteRefUpdate(db, src, dst, force, null, null)); }</code><technical_language>Style-nit: Put curly braces statement</technical_language>

Target:
private void send(final List<RemoteRefUpdate> cmds, final RefSpec spec) throws IOException { final String src = spec.getSource(); String dst = spec.getDestination(); if (dst == null) { dst = src; } final boolean force = spec.isForceUpdate(); cmds.add(new RemoteRefUpdate(db, src, dst, force, null, null)); }