auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static String getServerUrl() { return System.getProperty(PLUGIN_ID + "." + PROP_SERVER_CONFIGURATION_URL, "<LINK_0>"); }

Target:
private static String getServerUrl() { return System.getProperty(PLUGIN_ID + "." + PROP_SERVER, "<LINK_0>"); }
Source:
public TmfTimeRange getCurrentRange() { return getCurrentTraceContext().getTimerange(); }

Target:
public synchronized TmfTimeRange getCurrentRange() { return getCurrentTraceContext().getTimerange(); }
Source:
@Override protected void afterTest() throws Exception { super.afterTest(); for (Ignite g : G.allGrids()) g.cache(DEFAULT_CACHE_NAME).removeAll(); }

Target:
@Override protected void afterTest() throws Exception { super.afterTest(); grid(0).cache(DEFAULT_CACHE_NAME).removeAll(); }
Source:
public MetadataResponse sync(String entity, String system, String key, String... values) { MetadataResponse result = new MetadataResponse(); StringBuilder message = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); message.append("<SyncRequest><EntityName>"); message.append(entity); message.append("</EntityName><KeyName>"); message.append(key); message.append("</KeyName>"); for(String value: values) { if(value!=null && value.length()>0) { message.append("<KeyValue>"); message.append(value); message.append("</KeyValue>"); } } message.append("</SyncRequest>"); log.log(Level.INFO, "Initiating sync request:"+message.toString()); boolean foundActiveHost = false; for(String restEndPoint: resyncRestEndpoints) { try { URL url = new URL(restEndPoint); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Type", "application/xml"); OutputStream os = conn.getOutputStream(); os.write(message.toString().getBytes()); os.flush(); if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) { foundActiveHost = true; break; } else { log.warning("unable to send resync message to:"+restEndPoint); } conn.disconnect(); } catch (MalformedURLException e) { result.setErrorMessage(e.getMessage()); } catch (IOException e) { result.setErrorMessage(e.getMessage()); } } if(!foundActiveHost && result.getStatus()==MetadataResponse.Status.Success) { result.setErrorMessage("Unable to resync message"); } return result; }

Target:
public MetadataResponse sync(String entity, String system, String key, String... values) { StringBuilder message = new StringBuilder("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); message.append("<SyncRequest><EntityName>"); message.append(entity); message.append("</EntityName><System>"); message.append(system); message.append("</System><KeyName>"); message.append(key); message.append("</KeyName>"); for(String value: values) { if(value!=null && value.length()>0) { message.append("<KeyValue>"); message.append(value); message.append("</KeyValue>"); } } message.append("</SyncRequest>"); log.log(Level.INFO, "Initiating sync request:"+message.toString()); boolean foundActiveHost = false; for(String restEndPoint: resyncRestEndpoints) { try { URL url = new URL(restEndPoint); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setDoOutput(true); conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Type", "application/xml"); OutputStream os = conn.getOutputStream(); os.write(message.toString().getBytes()); os.flush(); if (conn.getResponseCode() == HttpURLConnection.HTTP_OK) { return new MetadataResponse(); } else { log.warning("unable to send resync message, recieved Http response code:"+ conn.getResponseCode()+ " response message:"+conn.getResponseMessage()+" from:"+restEndPoint); } conn.disconnect(); } catch (MalformedURLException e) { log.severe(e.getMessage()); } catch (IOException e) { log.severe(e.getMessage()); } } MetadataResponse result = new MetadataResponse(); result.setErrorMessage("Unable to resync message"); return result; }
Source:
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { super.drawGuiContainerForegroundLayer(mouseX, mouseY); mouseX -= cornerX; mouseY -= cornerY; if(71 <= mouseX && mouseX < 83 && 16 <= mouseY && mouseY < 68) { List<String> text = Lists.newArrayList(); FluidStack fuel = fuelInfo.fluid; text.add(TextFormatting.WHITE + Util.translate("gui.smeltery.fuel")); if(fuel != null) { text.add(fuel.getLocalizedName()); liquidToString(fuel, text); } else { text.add(Util.translate("gui.smeltery.fuel.empty")); } text.add(Util.translateFormatted("gui.smeltery.fuel.heat", fuelInfo.heat)); this.drawHoveringText(text, mouseX, mouseY); } }

Target:
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) { super.drawGuiContainerForegroundLayer(mouseX, mouseY); mouseX -= cornerX; mouseY -= cornerY; if(71 <= mouseX && mouseX < 83 && 16 <= mouseY && mouseY < 68) { drawFuelTooltip(mouseX, mouseY); } }
Source:
private Boolean validateForBoolean(String value) { if (!value.equals("true") && !value.equals("false")) { return false; } return true; }

Target:
private void validateForBoolean(String value) { if (!value.equals("true") && !value.equals("false")) { throw new OpenClinicaSystemException(FAILED, ErrorConstants.ERR_VALUE_TYPE_MISMATCH); } }
Source:
public FilterType propertyIsEqualTo(String propertyName, int literal) { return buildPropertyIsFilterType( propertyName, literal, PROPERTY_IS_OPS.PropertyIsEqualTo, DEFAULT_MATCH_CASE); }

Target:
public FilterType propertyIsEqualTo(String propertyName, int literal) { return buildPropertyIsFilterType(propertyName, literal, PROPERTY_IS_OPS.PropertyIsEqualTo); }
Source:
public String getTenantAsString() { return Value.of(getTenant().getId()).getString(); }

Target:
public String getTenantAsString() { return getTenant().isFilled() ? String.valueOf(getTenant().getId()) : null; }
Source:
public synchronized void append(Frame frame) { if (FrameHeaderFlyweight.FLAGS_M == (FrameHeaderFlyweight.FLAGS_M & frame.flags())) { final ByteBuf buffer = FrameHeaderFlyweight.sliceFrameMetadataRetained(frame.content()); metadataBuffer.addComponent(true, buffer); } else { final ByteBuf buffer = FrameHeaderFlyweight.sliceFrameDataRetained(frame.content()); dataBuffer.addComponent(true, buffer); } }

Target:
public synchronized void append(Frame frame) { final ByteBuf byteBuf = frame.content(); final FrameType frameType = FrameHeaderFlyweight.frameType(byteBuf); final int frameLength = FrameHeaderFlyweight.frameLength(byteBuf); final int metadataLength = FrameHeaderFlyweight.metadataLength(byteBuf, frameType, frameLength); final int dataLength = FrameHeaderFlyweight.dataLength(byteBuf, frameType); if (0 < metadataLength) { int metadataOffset = FrameHeaderFlyweight.metadataOffset(byteBuf); if (FrameHeaderFlyweight.hasMetadataLengthField(frameType)) { metadataOffset += FrameHeaderFlyweight.FRAME_LENGTH_SIZE; } metadataBuffer.addComponent(true, byteBuf.retainedSlice(metadataOffset, metadataLength)); } if (0 < dataLength) { final int dataOffset = FrameHeaderFlyweight.dataOffset(byteBuf, frameType, frameLength); dataBuffer.addComponent(true, byteBuf.retainedSlice(dataOffset, dataLength)); } }
Source:
protected void createControls(final Composite parent, int horizontalSpan) { setNotificationsAllowed(false); try { Composite composite = new Composite(parent, SWT.BORDER); if (fillVertically) { GridLayout layout = ALayout.getZeroMarginLayout(1, false); layout.verticalSpacing = 4; composite.setLayout(layout); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); } else { GridLayout layout = ALayout.getZeroMarginLayout(horizontalSpan, false); layout.verticalSpacing = 4; composite.setLayout(layout); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false); gd.horizontalSpan = horizontalSpan; composite.setLayoutData(gd); } if (isDisplayLabel() && !getLabel().equals("")) { labelWidget = new Label(composite, SWT.NONE); labelWidget.setText(getLabel() + ":"); if (getToolTip() != null) { labelWidget.setToolTipText(getToolTip()); } } createEditor(composite); addToolTip(composite, getToolTip()); } finally { setNotificationsAllowed(true); } refresh(); }

Target:
protected void createControls(final Composite parent, int horizontalSpan) { setNotificationsAllowed(false); try { Composite composite = new Composite(parent, SWT.BORDER); if (fillVertically) { GridLayout layout = ALayout.getZeroMarginLayout(1, false); layout.verticalSpacing = 4; composite.setLayout(layout); composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); } else { GridLayout layout = ALayout.getZeroMarginLayout(horizontalSpan, false); layout.verticalSpacing = 4; composite.setLayout(layout); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false); gd.horizontalSpan = horizontalSpan; composite.setLayoutData(gd); } if (isDisplayLabel() && Strings.isValid(getLabel())) { labelWidget = new Label(composite, SWT.NONE); labelWidget.setText(getLabel() + ":"); if (getToolTip() != null) { labelWidget.setToolTipText(getToolTip()); } } createEditor(composite); addToolTip(composite, getToolTip()); } finally { setNotificationsAllowed(true); } refresh(); }
Source:
public <V> V get(final String key) throws IllegalArgumentException { if (!sideEffects.containsKey(key)) { if (!closed) { final RequestMessage msg = RequestMessage.build(Tokens.OPS_GATHER) .addArg(Tokens.ARGS_SIDE_EFFECT, serverSideEffect) .addArg(Tokens.ARGS_SIDE_EFFECT_KEY, key) .addArg(Tokens.ARGS_HOST, host) .processor("traversal").create(); try { final Result result = client.submitAsync(msg).get().one(); sideEffects.put(key, null == result ? null : result.getObject()); if (keys.isEmpty()) keys = new HashSet<>(); keys.add(key); } catch (Exception ex) { final Throwable root = ExceptionUtils.getRootCause(ex); final String exMsg = null == root ? "" : root.getMessage(); if (exMsg.equals("Could not find side-effects for " + serverSideEffect + ".")) sideEffects.put(key, null); else throw new RuntimeException("Could not get keys", root); } } else { sideEffects.put(key, null); } } return (V) sideEffects.get(key); }

Target:
public <V> V get(final String key) throws IllegalArgumentException { if (!sideEffects.containsKey(key)) { if (!closed) { final RequestMessage msg = RequestMessage.build(Tokens.OPS_GATHER) .addArg(Tokens.ARGS_SIDE_EFFECT, serverSideEffect) .addArg(Tokens.ARGS_SIDE_EFFECT_KEY, key) .addArg(Tokens.ARGS_HOST, host) .processor("traversal").create(); try { final Result result = client.submitAsync(msg).get().one(); sideEffects.put(key, null == result ? null : result.getObject()); if (keys.equals(Collections.emptySet())) keys = new HashSet<>(); keys.add(key); } catch (Exception ex) { final Throwable root = ExceptionUtils.getRootCause(ex); final String exMsg = null == root ? "" : root.getMessage(); if (exMsg.equals("Could not find side-effects for " + serverSideEffect + ".")) sideEffects.put(key, null); else throw new RuntimeException("Could not get keys", root); } } else { sideEffects.put(key, null); } } return (V) sideEffects.get(key); }
Source:
private JobInput getJobInput(JobStatus status, String user, List<Constraint> constraints) { JobInput.Builder input = new JobInput.Builder(); input.status(status.name().toUpperCase()); if (user != null) input.owner(user); String id = null; String priority = null; String name = null; for (Constraint constraint : constraints) { String value = constraint.getValue(); switch (constraint.getTargetField()) { case ID: { switch (constraint.getAction()) { case EQUALS: id = getValue(id, value); break; case GREATER_THAN_OR_EQUAL_TO: input.greaterThanId(value); break; case LESS_THAN_OR_EQUAL_TO: input.lowerThanId(value); break; default: ; } } break; case PRIORITY: { priority = getValue(priority, value.toUpperCase()); } break; case NAME: { switch (constraint.getAction()) { case EQUALS: name = getValue(name, value); break; case CONTAINS: name = getValue(name, "*" + value + "*"); break; case STARTS_WITH: name = getValue(name, value + "*"); break; default: ; } } break; } } if (id != null) input.id(id); if (priority != null) input.priority(priority); if (name != null) input.jobName(name); return input.build(); }

Target:
private JobInput getJobInput(JobStatus status, String user, List<Constraint> constraints) { JobInput.Builder input = new JobInput.Builder(); input.status(status.name().toUpperCase()); if (user != null) input.owner(user); String id = null; String priority = null; String name = null; for (Constraint constraint : constraints) { String value = constraint.getValue(); switch (constraint.getTargetField()) { case ID: { switch (constraint.getAction()) { case EQUALS: id = getValue(id, value); break; case GREATER_THAN_OR_EQUAL_TO: input.afterId(value); break; case LESS_THAN_OR_EQUAL_TO: input.beforeId(value); break; default: break; } } break; case PRIORITY: { priority = getValue(priority, value.toUpperCase()); } break; case NAME: { switch (constraint.getAction()) { case EQUALS: name = getValue(name, value); break; case CONTAINS: name = getValue(name, "*" + value + "*"); break; case STARTS_WITH: name = getValue(name, value + "*"); break; default: break; } } break; } } if (id != null) input.id(id); if (priority != null) input.priority(priority); if (name != null) input.jobName(name); return input.build(); }
Source:
public IpPrefix requestDownstreamPrefix(final int interfaceType) { final int index = mDownstreamPrefixMap.indexOfKey(interfaceType); if (index >= 0) { return mDownstreamPrefixMap.valueAt(index); } if (interfaceType == TETHERING_BLUETOOTH) { final IpPrefix prefix = new IpPrefix(BLUETOOTH_PREFIX); updateDownstreamRecord(interfaceType, prefix); return prefix; } final byte[] bytes = {(byte) 0xc0, (byte) 0xa8, 0, 0}; int random = getRandomSubNetId(); for (int i = 0; i < MAX_SUBNET_NUM; i++) { final int subNet = (random + i) & SUBNET_MASK; if (subNet == BLUETOOTH_RESVERED) continue; bytes[2] = (byte) subNet; InetAddress addr; try { addr = InetAddress.getByAddress(bytes); } catch (UnknownHostException e) { throw new IllegalStateException("Invalid address, shouldn't happen.", e); } final IpPrefix prefix = new IpPrefix(addr, DEFAULT_PREFIX_LENGTH); if (prefix.equals(mLastConflictPrefix)) continue; if (getDownstreamType(prefix) != TETHERING_INVALID) continue; if (!isConflictWithUpstream(prefix)) { updateDownstreamRecord(interfaceType, prefix); return prefix; } } return null; }

Target:
public IpPrefix requestDownstreamPrefix(final int interfaceType) { final int index = mDownstreamPrefixMap.indexOfKey(interfaceType); if (index >= 0) { return mDownstreamPrefixMap.valueAt(index); } if (interfaceType == TETHERING_BLUETOOTH) { final IpPrefix prefix = new IpPrefix(BLUETOOTH_PREFIX); updateDownstreamPrefix(interfaceType, prefix); return prefix; } final byte[] bytes = mTetheringPrefix.getRawAddress(); int random = getRandomSubNetId(); for (int i = 0; i < MAX_SUBNET_NUM; i++) { final int subNet = (random + i) & BYTE_MASK; if (subNet == BLUETOOTH_RESERVED) continue; bytes[2] = (byte) subNet; final InetAddress addr; try { addr = InetAddress.getByAddress(bytes); } catch (UnknownHostException e) { throw new IllegalStateException("Invalid address, shouldn't happen.", e); } final IpPrefix prefix = new IpPrefix(addr, DEFAULT_PREFIX_LENGTH); if (mLastConflictPrefix != null && isConflictPrefix(prefix, mLastConflictPrefix)) continue; if (isDownstreamPrefixInUse(prefix)) continue; if (!isConflictWithUpstream(prefix)) { updateDownstreamPrefix(interfaceType, prefix); return prefix; } } return null; }
Source:
public void addAll(HyperLogLogPlus other) throws HyperLogLogPlusMergeException { if (other.sizeof() != sizeof()) { throw new HyperLogLogPlusMergeException("Cannot merge estimators of different sizes"); } if ((format == Format.NORMAL) && (other.format == Format.NORMAL)) { registerSet.merge(other.registerSet); return; } if ((format == Format.SPARSE) && (other.format == Format.SPARSE)) { sparseSet = mergeEstimators(other); if (sparseSet.length > (sparseSetThreshold * (SPARSE_SET_TEMP_SET_RATIO + 1)) / SPARSE_SET_TEMP_SET_RATIO) { convertToNormal(); } return; } if ((format == Format.SPARSE) && (other.format == Format.NORMAL)) { convertToNormal(); registerSet.merge(other.registerSet); return; } if ((format == Format.NORMAL) && (other.format == Format.SPARSE)) { other.mergeTempList(); for (int i = 0; i < other.sparseSet.length; i++) { int k = other.sparseSet[i]; int idx = other.getIndex(k, p); int r = other.decodeRunLength(k); registerSet.updateIfGreater(idx, r); } return; } throw new IllegalStateException("Unhandled HLL++ merge combination"); }

Target:
public void addAll(HyperLogLogPlus other) throws HyperLogLogPlusMergeException { if (other.sizeof() != sizeof()) { throw new HyperLogLogPlusMergeException("Cannot merge estimators of different sizes"); } if (format == Format.SPARSE) { mergeTempList(); } if (other.format == Format.SPARSE) { other.mergeTempList(); } if ((format == Format.NORMAL) && (other.format == Format.NORMAL)) { registerSet.merge(other.registerSet); return; } if ((format == Format.SPARSE) && (other.format == Format.SPARSE)) { sparseSet = mergeEstimators(other); if (sparseSet.length > sparseSetThreshold) { convertToNormal(); } return; } if ((format == Format.SPARSE) && (other.format == Format.NORMAL)) { convertToNormal(); registerSet.merge(other.registerSet); return; } if ((format == Format.NORMAL) && (other.format == Format.SPARSE)) { for (int i = 0; i < other.sparseSet.length; i++) { int k = other.sparseSet[i]; int idx = other.getIndex(k, p); int r = other.decodeRunLength(k); registerSet.updateIfGreater(idx, r); } return; } throw new IllegalStateException("Unhandled HLL++ merge combination"); }
Source:
public OpenAPI getDocument() throws OpenAPIBuildException { if (mappings.isEmpty() || !isEnabled()) { return null; } else if (mappings.size() == 1) { OpenAPI document = mappings.peekLast().getDocument(); if(document == null) { document = mappings.peekLast().buildDocument(); } return document; } else { List<OpenAPI> docs = new ArrayList<>(); for (OpenApiMapping mapping : mappings) { if(mapping.getDocument() == null) { allDocuments = null; mapping.buildDocument(); } docs.add(mapping.getDocument()); } if(allDocuments == null) { allDocuments = new OpenAPIImpl(); OpenAPIImpl.merge(allDocuments, docs, true); } return allDocuments; } }

Target:
public OpenAPI getDocument() throws OpenAPIBuildException { if (mappings.isEmpty() || !isEnabled()) { return null; } if (mappings.size() == 1) { OpenAPI document = mappings.peekLast().getDocument(); if (document == null) { document = mappings.peekLast().buildDocument(); } return document; } List<OpenAPI> docs = new ArrayList<>(); for (OpenApiMapping mapping : mappings) { if (mapping.getDocument() == null) { allDocuments = null; mapping.buildDocument(); } docs.add(mapping.getDocument()); } if (allDocuments == null) { allDocuments = new OpenAPIImpl(); OpenAPIImpl.merge(allDocuments, docs, true); } return allDocuments; }
Source:
public static <T, U extends T> U put(Class<T> type, U object) { if (context == null) return null; context.put(type, object); return object; }

Target:
public static <T, U extends T> U put(Class<T> type, U object) { if (context == null) { return null; } context.put(type, object); return object; }
Source:
private void showQuickStartTaskPromptIfNecessary() { if (AppPrefs.isQuickStartActive()) { QuickStartTask promptedTask = getPromptedQuickStartTask(); if (promptedTask != null && mQuickStartStore.hasDoneTask(AppPrefs.getSelectedSite(), promptedTask)) { resetQuickStartPromptCounter(); QuickStartMySitePrompts nextPrompt = getNextQuickStartPrompt(); if (nextPrompt != null) { setPromptedQuickStartTask(nextPrompt.getTask()); } else { setPromptedQuickStartTask(null); } } if (shouldShowQuickStartTaskPrompt() && getView() != null) { mQuickStartSnackBarHandler.removeCallbacksAndMessages(null); mQuickStartSnackBarHandler.postDelayed(new Runnable() { @Override public void run() { showQuickStartDialogTaskPrompt(AppPrefs.getNumberOfTimesQuickStartDialogShown() == MAX_NUMBER_OF_TIMES_TO_SHOW_QUICK_START_DIALOG); } }, AUTO_QUICK_START_SNACKBAR_DELAY_MS); } } }

Target:
private void showQuickStartTaskPromptIfNecessary() { if (AppPrefs.isQuickStartActive()) { QuickStartTask promptedTask = getPromptedQuickStartTask(); if (promptedTask != null && mQuickStartStore.hasDoneTask(AppPrefs.getSelectedSite(), promptedTask)) { resetQuickStartPromptCounter(); QuickStartMySitePrompts nextPrompt = getNextQuickStartPrompt(); if (nextPrompt != null) { setPromptedQuickStartTask(nextPrompt.getTask()); } else { setPromptedQuickStartTask(null); } } if (shouldShowQuickStartTaskPrompt()) { mQuickStartSnackBarHandler.removeCallbacksAndMessages(null); mQuickStartSnackBarHandler.postDelayed(new Runnable() { @Override public void run() { showQuickStartDialogTaskPrompt(); } }, AUTO_QUICK_START_SNACKBAR_DELAY_MS); } } }
Source:
public PlanWithProperties visitTableWriter(TableWriterNode node, Context context) { PlanWithProperties source = node.getSource().accept(this, context); Optional<PartitioningScheme> partitioningScheme = node.getPartitioningScheme(); if (partitioningScheme.isPresent() && source.getProperties().getNodePartitioning().isPresent() && partitioningScheme.get().getPartitioning().equals(source.getProperties().getNodePartitioning().get())) { return rebaseAndDeriveProperties(node, source); } if (!partitioningScheme.isPresent() && redistributeWrites) { partitioningScheme = Optional.of(new PartitioningScheme(Partitioning.create(FIXED_ARBITRARY_DISTRIBUTION, ImmutableList.of()), source.getNode().getOutputSymbols())); } if (partitioningScheme.isPresent()) { source = withDerivedProperties( partitionedExchange( idAllocator.getNextId(), REMOTE, source.getNode(), partitioningScheme.get()), source.getProperties()); } return rebaseAndDeriveProperties(node, source); }

Target:
public PlanWithProperties visitTableWriter(TableWriterNode node, Context context) { PlanWithProperties source = node.getSource().accept(this, context); Optional<PartitioningScheme> partitioningScheme = node.getPartitioningScheme(); if (!partitioningScheme.isPresent() && redistributeWrites) { partitioningScheme = Optional.of(new PartitioningScheme(Partitioning.create(FIXED_ARBITRARY_DISTRIBUTION, ImmutableList.of()), source.getNode().getOutputSymbols())); } if (partitioningScheme.isPresent() && !source.getProperties().isNodePartitionedOn(partitioningScheme.get().getPartitioning(), false)) { source = withDerivedProperties( partitionedExchange( idAllocator.getNextId(), REMOTE, source.getNode(), partitioningScheme.get()), source.getProperties()); } return rebaseAndDeriveProperties(node, source); }
Source:
public BigDecimal convertPressure(BigDecimal value) { if (this == DEFAULT_PRESSURE_UNIT) { return value.setScale(0, RoundingMode.HALF_UP); } else if (this == INHG) { return value.multiply(MBAR_TO_INHG).setScale(2, RoundingMode.HALF_UP); } else { return value.multiply(MBAR_TO_MMHG).setScale(1, RoundingMode.HALF_UP); } }

Target:
public BigDecimal convertPressure(BigDecimal value) { if (this == DEFAULT_PRESSURE_UNIT) { return value; } else if (this == INHG) { return value.multiply(MBAR_TO_INHG); } else { return value.multiply(MBAR_TO_MMHG); } }
Source:
private void validate() { assertThat(restTemplate, Objects::nonNull, () -> new AxonConfigurationException( "The RestTemplate is a hard requirement and should be provided")); assertThat(messageRoutingInformationEndpoint, name -> Objects.nonNull(name) && !name.equals(""), () -> new AxonConfigurationException( "The messageRoutingInformationEndpoint is a hard requirement and should be provided")); }

Target:
protected void validate() { super.validate(); assertNonNull(restTemplate, "The RestTemplate is a hard requirement and should be provided"); assertMessageRoutingInfoEndpoint( messageRoutingInformationEndpoint, "The messageRoutingInformationEndpoint is a hard requirement and should be provided" ); }
Source:
public <X> X get(String key) { if (unescape) { Object value = super.get(key); if (value != null && value instanceof String) { return (X) GwtSafeHtmlUtils.htmlUnescape((String) value); } return (X) value; } else { return (X) super.get(key); } }

Target:
public <X> X get(String key) { if (unescaped) { Object value = super.get(key); if (value instanceof String) { return (X) GwtSafeHtmlUtils.htmlUnescape((String) value); } return (X) value; } else { return (X) super.get(key); } }
Source:
public List<EditInfo> parseEditInfos(JsonElement result) throws RestApiException { if (!result.isJsonArray()) { return Collections.singletonList(gson.fromJson(result, EditInfo.class)); } return gson.fromJson(result, TYPE); }

Target:
public List<EditInfo> parseEditInfos(JsonElement result) { if (!result.isJsonArray()) { return Collections.singletonList(gson.fromJson(result, EditInfo.class)); } return gson.fromJson(result, TYPE); }
Source:
public String evaluate( String referer ) { ExternalSearch es_inst = ExternalSearch.getInstance(); return es_inst.identifySearchEngine( referer ); }

Target:
public String evaluate( String referer ) { ExternalSearch externalSearch = ExternalSearch.getInstance(); return externalSearch.identifySearchEngine( referer ); }
Source:
public void onResourceChanged(ResourceChangedEvent event) { ResourceDelta delta = event.getDelta(); Path resourceLocation = delta.getResource().getLocation(); if (project.equals(resourceLocation) && REMOVED == delta.getKind()) { EditorPartPresenter editorPart = editorAgent.getOpenedEditor(getLocation()); editorAgent.closeEditor(editorPart); removeHandlers(); } }

Target:
public void onResourceChanged(ResourceChangedEvent event) { ResourceDelta delta = event.getDelta(); Path resourceLocation = delta.getResource().getLocation(); if (REMOVED == delta.getKind() && project.equals(resourceLocation)) { EditorPartPresenter editorPart = editorAgent.getOpenedEditor(getLocation()); editorAgent.closeEditor(editorPart); removeHandlers(); } }
Source:
AsyncNonMetaRegionLocator(AsyncConnectionImpl conn) { this.conn = conn; this.maxConcurrentLocateRequestPerTable = conn.getConfiguration().getInt( MAX_CONCURRENT_LOCATE_REQUEST_PER_TABLE, DEFAULT_MAX_CONCURRENT_LOCATE_REQUEST_PER_TABLE); this.locatePrefetchLimit = conn.getConfiguration().getInt(LOCATE_PREFETCH_LIMIT, DEFAULT_LOCATE_PREFETCH_LIMIT); this.metaReplicaMode = CatalogReplicaMode.valueOf(conn.getConfiguration() .get(LOCATOR_META_REPLICAS_MODE, CatalogReplicaMode.None.toString())); switch (this.metaReplicaMode) { case LoadBalance: String replicaSelectorClass = conn.getConfiguration(). get(RegionLocator.LOCATOR_META_REPLICAS_MODE_LOADBALANCE_SELECTOR, CatalogReplicaLoadBalanceReplicaSimpleSelector.class.getName()); this.metaReplicaSelector = CatalogReplicaLoadBalanceReplicaSelectorFactory.createSelector( replicaSelectorClass, META_TABLE_NAME, conn); break; case None: if (this.metaReplicaMode == CatalogReplicaMode.None) { boolean userMetaReplicas = conn.getConfiguration().getBoolean(USE_META_REPLICAS, DEFAULT_USE_META_REPLICAS); if (userMetaReplicas) { this.metaReplicaMode = CatalogReplicaMode.HedgedRead; } } break; default: } }

Target:
AsyncNonMetaRegionLocator(AsyncConnectionImpl conn) { this.conn = conn; this.maxConcurrentLocateRequestPerTable = conn.getConfiguration().getInt( MAX_CONCURRENT_LOCATE_REQUEST_PER_TABLE, DEFAULT_MAX_CONCURRENT_LOCATE_REQUEST_PER_TABLE); this.locatePrefetchLimit = conn.getConfiguration().getInt(LOCATE_PREFETCH_LIMIT, DEFAULT_LOCATE_PREFETCH_LIMIT); this.metaReplicaMode = CatalogReplicaMode.fromString(conn.getConfiguration() .get(LOCATOR_META_REPLICAS_MODE, CatalogReplicaMode.NONE.toString())); switch (this.metaReplicaMode) { case LOAD_BALANCE: String replicaSelectorClass = conn.getConfiguration(). get(RegionLocator.LOCATOR_META_REPLICAS_MODE_LOADBALANCE_SELECTOR, CatalogReplicaLoadBalanceSimpleSelector.class.getName()); this.metaReplicaSelector = CatalogReplicaLoadBalanceSelectorFactory.createSelector( replicaSelectorClass, META_TABLE_NAME, conn, () -> { int numOfReplicas = 1; try { RegionLocations metaLocations = conn.registry.getMetaRegionLocations().get( conn.connConf.getReadRpcTimeoutNs(), TimeUnit.NANOSECONDS); numOfReplicas = metaLocations.size(); } catch (Exception e) { LOG.error("Failed to get table {}'s region replication, ", META_TABLE_NAME, e); } return numOfReplicas; }); break; case NONE: boolean useMetaReplicas = conn.getConfiguration().getBoolean(USE_META_REPLICAS, DEFAULT_USE_META_REPLICAS); if (useMetaReplicas) { this.metaReplicaMode = CatalogReplicaMode.HEDGED_READ; } break; default: } }
Source:
public String toString() { StringBuilder buf = new StringBuilder(); buf.append("HunkHeader["); buf.append(getOldImage().getStartLine() + "," + getOldImage().getLineCount()); buf.append("->"); buf.append(getNewStartLine() + "," + getNewLineCount()); buf.append("]"); return buf.toString(); }

Target:
public String toString() { StringBuilder buf = new StringBuilder(); buf.append("HunkHeader["); buf.append(getOldImage().getStartLine()); buf.append(','); buf.append(getOldImage().getLineCount()); buf.append("->"); buf.append(getNewStartLine()).append(',').append(getNewLineCount()); buf.append(']'); return buf.toString(); }
Source:
public TInterface findByNumber(UID uidBusiness, String number) { JPAGenericInvoiceEntity invoice = this.queryInvoice(uidBusiness.toString(), number).findOne(); if (!(invoice instanceof PTGenericInvoiceEntity)) { return null; } return (TInterface) invoice; }

Target:
public TInterface findByNumber(UID uidBusiness, String number) { JPAGenericInvoiceEntity invoice = this.queryInvoice(uidBusiness.toString(), number).findOne(); if (!(invoice instanceof PTGenericInvoiceEntity)) { throw new RuntimeException("Invoice number " + number + " of business " + uidBusiness + " is not of class " + PTGenericInvoiceEntity.class.getSimpleName()); } return (TInterface) invoice; }
Source:
public void executeSQL_shouldReturnNullGivenNull() { adminService.executeSQL(null, true); verify(adminDAO, never()).executeSQL("was never called", true); }

Target:
public void executeSQL_shouldReturnNullGivenNull() { adminService.executeSQL(null, true); verify(adminDAO, never()).executeSQL(anyString(), anyBoolean()); }
Source:
private <T extends Timestamped> T deserialize(StorageObject object, Class<T> clas, boolean current_version) throws java.io.UnsupportedEncodingException { try { ByteArrayOutputStream output = new java.io.ByteArrayOutputStream(); Storage.Objects.Get getter = obj_api.get(object.getBucket(), object.getName()); if (!current_version) { getter.setGeneration(object.getGeneration()); } Closure timeExecuteClosure = new Closure<String>(this, this) { public Object doCall() throws Exception { mediaDownloadTimer.record(new Callable() { public Void call() throws Exception { getter.executeMediaAndDownloadTo(output); return null; } }); return Closure.DONE; } }; doRetry(timeExecuteClosure, "deserialize", object.getName()); String json = output.toString("UTF8"); return objectMapper.readValue(json, clas); } catch (Exception ex) { if (current_version) { log.error("Error reading {}: {}", value("object", object.getName()), ex.getMessage()); } else { log.error("Error reading generation={}: {}", value("object", object.getName()), value("generation", object.getGeneration()), ex.getMessage()); } return null; } }

Target:
private <T extends Timestamped> T deserialize(StorageObject object, Class<T> clas, boolean current_version) throws java.io.UnsupportedEncodingException { try { ByteArrayOutputStream output = new java.io.ByteArrayOutputStream(); Storage.Objects.Get getter = obj_api.get(object.getBucket(), object.getName()); if (!current_version) { getter.setGeneration(object.getGeneration()); } Closure timeExecuteClosure = new Closure<String>(this, this) { public Object doCall() throws Exception { mediaDownloadTimer.record(new Callable() { public Void call() throws Exception { getter.executeMediaAndDownloadTo(output); return null; } }); return Closure.DONE; } }; doRetry(timeExecuteClosure, "deserialize", object.getName()); String json = output.toString("UTF8"); return objectMapper.readValue(json, clas); } catch (Exception ex) { if (current_version) { log.error("Error reading {}: ", value("object", object.getName()), ex); } else { log.error("Error reading generation={}: ", value("object", object.getName()), value("generation", object.getGeneration()), ex); } return null; } }
Source:
private void verifyDeleteFailure(MockId idToDelete, StoreErrorCodes expectedErrorCode) { short accoundId = accountIdMap.containsKey(idToDelete) == true ? accountIdMap.get(idToDelete) : Utils.getRandomShort(TestUtils.RANDOM); short containerId = containerIdMap.containsKey(idToDelete) == true ? containerIdMap.get(idToDelete) : Utils.getRandomShort(TestUtils.RANDOM); MessageInfo info = new MessageInfo(idToDelete, DELETE_RECORD_SIZE, accoundId, containerId, System.currentTimeMillis()); MessageWriteSet writeSet = new MockMessageWriteSet(Collections.singletonList(info), Collections.singletonList(ByteBuffer.allocate(1))); try { store.delete(writeSet); fail("Store DELETE should have failed"); } catch (StoreException e) { assertEquals("Unexpected StoreErrorCode", expectedErrorCode, e.getErrorCode()); } }

Target:
private void verifyDeleteFailure(MockId idToDelete, StoreErrorCodes expectedErrorCode) throws StoreException { short accoundId = accountIdMap.containsKey(idToDelete) == true ? accountIdMap.get(idToDelete) : Utils.getRandomShort(TestUtils.RANDOM); short containerId = containerIdMap.containsKey(idToDelete) == true ? containerIdMap.get(idToDelete) : Utils.getRandomShort(TestUtils.RANDOM); MessageInfo info = new MessageInfo(idToDelete, DELETE_RECORD_SIZE, accoundId, containerId, System.currentTimeMillis()); MessageWriteSet writeSet = new MockMessageWriteSet(Collections.singletonList(info), Collections.singletonList(ByteBuffer.allocate(1))); if (store.getStoreConfig().storeDeleteAuthorizationCheck == true) { try { store.delete(writeSet); fail("Store DELETE should have failed"); } catch (StoreException e) { assertEquals("Unexpected StoreErrorCode", expectedErrorCode, e.getErrorCode()); } } }
Source:
public void testValidateQuestionDetails_duplicateMcqOptions_errorReturned() { FeedbackMcqQuestionDetails mcqDetails = new FeedbackMcqQuestionDetails(); Map<String, String[]> requestParams = new HashMap<>(); requestParams.put(Const.ParamsNames.FEEDBACK_QUESTION_TYPE, new String[] { "MCQ" }); requestParams.put(Const.ParamsNames.FEEDBACK_QUESTION_TEXT, new String[] { "mcq question text" }); requestParams.put(Const.ParamsNames.FEEDBACK_QUESTION_MCQ_GENERATED_OPTIONS, new String[] { "NONE" }); requestParams.put(Const.ParamsNames.FEEDBACK_QUESTION_NUMBEROFCHOICECREATED, new String[] { "2" }); requestParams.put(Const.ParamsNames.FEEDBACK_QUESTION_MCQCHOICE + "-0", new String[] { "Choice 1" }); requestParams.put(Const.ParamsNames.FEEDBACK_QUESTION_MCQCHOICE + "-1", new String[] { "Choice 1" }); requestParams.put(Const.ParamsNames.FEEDBACK_QUESTION_MCQ_HAS_WEIGHTS_ASSIGNED, new String[] { "off" }); assertTrue(mcqDetails.extractQuestionDetails(requestParams, FeedbackQuestionType.MCQ)); List<String> errors = mcqDetails.validateQuestionDetails(dummySessionToken); assertEquals(1, errors.size()); assertEquals(Const.FeedbackQuestion.MCQ_ERROR_DUPLICATE_MCQ_OPTION, errors.get(0)); requestParams.put(Const.ParamsNames.FEEDBACK_QUESTION_MCQCHOICE + "-1", new String[] { " Choice 1 " }); assertTrue(mcqDetails.extractQuestionDetails(requestParams, FeedbackQuestionType.MCQ)); errors = mcqDetails.validateQuestionDetails(dummySessionToken); assertEquals(1, errors.size()); assertEquals(Const.FeedbackQuestion.MCQ_ERROR_DUPLICATE_MCQ_OPTION, errors.get(0)); }

Target:
public void testValidateQuestionDetails_duplicateMcqOptions_errorReturned() { FeedbackMcqQuestionDetails mcqDetails = new FeedbackMcqQuestionDetails(); mcqDetails.setNumOfMcqChoices(2); mcqDetails.setMcqChoices(Arrays.asList("choice 1", "choice 1")); List<String> errors = mcqDetails.validateQuestionDetails(dummySessionToken); assertEquals(1, errors.size()); assertEquals(Const.FeedbackQuestion.MCQ_ERROR_DUPLICATE_MCQ_OPTION, errors.get(0)); mcqDetails.setMcqChoices(Arrays.asList("choice 1", " choice 1 ")); errors = mcqDetails.validateQuestionDetails(dummySessionToken); assertEquals(1, errors.size()); assertEquals(Const.FeedbackQuestion.MCQ_ERROR_DUPLICATE_MCQ_OPTION, errors.get(0)); }
Source:
private JoinBridgeAndLifecycle<T> data(Lifespan lifespan) { checkArgument(!Lifespan.taskWide().equals(lifespan)); return map.computeIfAbsent(lifespan, span -> { T joinBridge = joinBridgeProvider.apply(span); return new JoinBridgeAndLifecycle<>(joinBridge, new JoinLifecycle(joinBridge, probeFactoryCount, outerFactoryCount)); }); }

Target:
private JoinBridgeAndLifecycle<T> data(Lifespan lifespan) { checkArgument(!Lifespan.taskWide().equals(lifespan)); return joinBridgeMap.computeIfAbsent(lifespan, span -> { T joinBridge = joinBridgeProvider.apply(span); return new JoinBridgeAndLifecycle<>(joinBridge, new JoinLifecycle(joinBridge, probeFactoryCount, outerFactoryCount)); }); }
Source:
private VDS getAlternateUpServerInCluster(Guid clusterId, Guid vdsId) { List<VDS> vdsList = getVdsDao().getAllForVdsGroupWithStatus(clusterId, VDSStatus.Up); if (vdsList != null && vdsList.size() > 0) { for (VDS vds : vdsList) { if (!vdsId.equals(vds.getId())) { return vds; } } } return null; }

Target:
private VDS getAlternateUpServerInCluster(Guid clusterId, Guid vdsId) { List<VDS> vdsList = getVdsDao().getAllForVdsGroupWithStatus(clusterId, VDSStatus.Up); if (vdsList.isEmpty()) { return null; } for (VDS vds : vdsList) { if (!vdsId.equals(vds.getId())) { return vds; } } return null; }
Source:
public String associateAddress(NodeMetadata node) { IaasProvider iaasInfo = getIaasProvider(); ComputeServiceContext context = iaasInfo.getComputeService().getContext(); CloudStackApi cloudStackApi = context.unwrapApi(CloudStackApi.class); String ip = null; ListPublicIPAddressesOptions listPublicIPAddressesOptions = new ListPublicIPAddressesOptions(); listPublicIPAddressesOptions.zoneId(iaasInfo.getProperty(CloudControllerConstants.AVAILABILITY_ZONE)); Set<PublicIPAddress> publicIPAddresses = cloudStackApi.getAddressApi() .listPublicIPAddresses(listPublicIPAddressesOptions); String id = node.getProviderId(); for (PublicIPAddress publicIPAddress : publicIPAddresses) { if (publicIPAddress.getVirtualMachineId().equals(id)) { ip = publicIPAddress.getIPAddress(); log.debug("Successfully associated an IP address " + ip + " for node with id: " + node.getId()); break; } } if (ip == null || ip.isEmpty()) { String msg = "No address associated for node with id: " + node.getId(); log.debug(msg); throw new CloudControllerException(msg); } return ip; }

Target:
public String associateAddress(NodeMetadata node) { IaasProvider iaasInfo = getIaasProvider(); ComputeServiceContext context = iaasInfo.getComputeService().getContext(); CloudStackApi cloudStackApi = context.unwrapApi(CloudStackApi.class); String ip = null; ListPublicIPAddressesOptions listPublicIPAddressesOptions = new ListPublicIPAddressesOptions(); listPublicIPAddressesOptions.zoneId(iaasInfo.getProperty(CloudControllerConstants.AVAILABILITY_ZONE)); Set<PublicIPAddress> publicIPAddresses = cloudStackApi.getAddressApi() .listPublicIPAddresses(listPublicIPAddressesOptions); String id = node.getProviderId(); for (PublicIPAddress publicIPAddress : publicIPAddresses) { if (publicIPAddress.getVirtualMachineId().equals(id)) { ip = publicIPAddress.getIPAddress(); log.info("Successfully associated an IP address " + ip + " for node with id: " + node.getId()); break; } } if (ip == null || ip.isEmpty()) { String msg = "No address associated for node with id: " + node.getId(); log.warn(msg); throw new CloudControllerException(msg); } return ip; }
Source:
public ListenableFuture<LabelMeta> getLabelMeta(final LabelType type, final LabelId id) { return transform(labelClient.getLabelName(type, id), new AsyncFunction<Optional<String>, LabelMeta>() { @Override public ListenableFuture<LabelMeta> apply(final Optional<String> name) throws Exception { if (name.isPresent()) { return store.getMeta(id, type); } throw new LabelException(id, type, "Could not find label."); } }); }

Target:
public ListenableFuture<LabelMeta> getLabelMeta(final LabelType type, final LabelId id) { return transform(labelClient.getLabelName(type, id), new AsyncFunction<Optional<String>, LabelMeta>() { @Override public ListenableFuture<LabelMeta> apply(final Optional<String> name) throws Exception { if (name.isPresent()) { return store.getMeta(id, type); } return immediateFailedFuture(new LabelException(id, type, "Could not find label meta information for id " + id + " and " + type)); } }); }
Source:
public Tag create(final JsonObject params) throws IOException { final Directives dirs = new Directives().xpath(this.xpath()).add("tag"); final Set<String> keys = params.keySet(); final Iterator<String> iterator = keys.iterator(); while (iterator.hasNext()) { final String key = iterator.next(); if (params.get(key).toString().contains("}")) { dirs.add(key).set(params.get(key).toString()).up(); } else { dirs.add(key).set(params.getString(key)).up(); } } this.storage.apply(dirs); final References refs = new MkReferences( this.storage, this.self, this.coords ); final StringBuilder builder = new StringBuilder(); builder.append("refs/tags/").append(params.getString("name")); refs.create(builder.toString(), params.getString("sha")); return this.get(params.getString("sha")); }

Target:
public Tag create(final JsonObject params) throws IOException { final Directives dirs = new Directives().xpath(this.xpath()).add("tag"); for (final Entry<String, JsonValue> entry : params.entrySet()) { dirs.add(entry.getKey()).set(entry.getValue().toString()).up(); } this.storage.apply(dirs); new MkReferences(this.storage, this.self, this.coords).create( new StringBuilder().append("refs/tags/").append( params.getString("name") ).toString(), params.getString("sha") ); return this.get(params.getString("sha")); }
Source:
public void test_reuse_cluster_sender() throws InterruptedException { Microservices micro = Microservices.builder() .services(new GreetingServiceImpl()) .reuseClusterTransport(true) .build(); GreetingService service = micro.proxy().api(GreetingService.class).create(); CountDownLatch latch = new CountDownLatch(1); service.greeting("joe").whenComplete((result, error) -> { if (error == null) { latch.countDown(); } }); assertTrue(!micro.services().isEmpty()); ServiceInstance instance = micro.services().stream().findFirst().get(); assertEquals(instance.address(), micro.cluster().address()); assertEquals(instance.serviceName(), "io.scalecube.services.GreetingService"); latch.await(1, TimeUnit.SECONDS); micro.shutdown(); }

Target:
public void test_reuse_cluster_sender() throws InterruptedException { Microservices micro = Microservices.builder() .services(new GreetingServiceImpl()) .reuseClusterTransport(true) .build(); GreetingService service = micro.proxy().api(GreetingService.class).create(); CountDownLatch latch = new CountDownLatch(1); service.greeting("joe").whenComplete((result, error) -> { if (error == null) { latch.countDown(); } }); assertTrue(!micro.services().isEmpty()); ServiceInstance instance = micro.services().stream().findFirst().get(); assertEquals(instance.address(), micro.cluster().address()); assertEquals(instance.serviceName(), "io.scalecube.services.GreetingService"); latch.await(1, TimeUnit.SECONDS); assertTrue(latch.getCount() == 0); micro.shutdown(); }
Source:
private void setupAppList() { Context activity = getActivity(); PackageManager pm = activity.getPackageManager(); List<ApplicationInfo> list = pm.getInstalledApplications(0); boolean showSystemApp = Settings.uiPref.getBoolean("show_system_apps", false); boolean showAppWithAds = Settings.uiPref.getBoolean("show_apps_with_ads", false); itemList = new ArrayList<Map<String, Object>>(); for(ApplicationInfo info : list) { if(showSystemApp || ((info.flags & ApplicationInfo.FLAG_SYSTEM) == 0)) { Map<String, Object> map = new HashMap<String, Object>(); map.put("title", pm.getApplicationLabel(info)); map.put("key", info.packageName); map.put("icon", pm.getApplicationIcon(info)); String ads = adPref.getString(info.packageName, ""); map.put("summary", ads); if (ads.length > 0) { itemList.add(map); } else { if (!showAppWithAds) { itemList.add(map); } } } } Collections.sort(itemList, new Comparator<Map<String, Object>>() { @Override public int compare(Map<String, Object> lhs, Map<String, Object> rhs) { String s1 = (String) lhs.get("title"); String s2 = (String) rhs.get("title"); return s1.compareToIgnoreCase(s2); } }); }

Target:
private void setupAppList() { Context activity = getActivity(); PackageManager pm = activity.getPackageManager(); List<ApplicationInfo> list = pm.getInstalledApplications(0); boolean showSystemApp = Settings.uiPref.getBoolean("show_system_apps", false); boolean showAppWithAds = Settings.uiPref.getBoolean("show_apps_with_ads", false); itemList = new ArrayList<Map<String, Object>>(); for(ApplicationInfo info : list) { if(showSystemApp || ((info.flags & ApplicationInfo.FLAG_SYSTEM) == 0)) { Map<String, Object> map = new HashMap<String, Object>(); map.put("title", pm.getApplicationLabel(info)); map.put("key", info.packageName); map.put("icon", pm.getApplicationIcon(info)); String ads = adPref.getString(info.packageName, ""); map.put("summary", ads); if (!showAppWithAds || (showAppWithAds && ads.length() > 0)) { itemList.add(map); } } } Collections.sort(itemList, new Comparator<Map<String, Object>>() { @Override public int compare(Map<String, Object> lhs, Map<String, Object> rhs) { String s1 = (String) lhs.get("title"); String s2 = (String) rhs.get("title"); return s1.compareToIgnoreCase(s2); } }); }
Source:
private Expression replaceAliases(Expression condition, List<? extends NamedExpression> named) { List<Alias> aliases = new ArrayList<>(); named.forEach(n -> { if (n instanceof Alias) { aliases.add((Alias) n); } }); return condition.transformDown(u -> { boolean qualified = u.qualifier() != null; for (Alias alias : aliases) { if (qualified ? Objects.equals(alias.qualifiedName(), u.qualifiedName()) : Objects.equals(alias.name(), u.name()) && !(alias.child() instanceof UnresolvedAttribute && Objects.equals(((UnresolvedAttribute) alias.child()).name(), alias.name()))) { return alias; } } return u; }, UnresolvedAttribute.class); }

Target:
private Expression replaceAliases(Expression condition, List<? extends NamedExpression> named) { List<Alias> aliases = new ArrayList<>(); named.forEach(n -> { if (n instanceof Alias) { Alias a = (Alias) n; if ((a.child() instanceof UnresolvedAttribute && Objects.equals(((UnresolvedAttribute) a.child()).name(),a.name())) == false) { aliases.add(a); } } }); return condition.transformDown(u -> { boolean qualified = u.qualifier() != null; for (Alias alias : aliases) { if (qualified ? Objects.equals(alias.qualifiedName(), u.qualifiedName()) : Objects.equals(alias.name(), u.name())) { return alias; } } return u; }, UnresolvedAttribute.class); }
Source:
public void enterParameterClause(SwiftParser.ParameterClauseContext ctx) { verifier.verifyParenthesisContentWhitespace(ctx); }

Target:
public void enterParameterClause(SwiftParser.ParameterClauseContext ctx) { verifier.verifyBracketContentWhitespace(ctx, Messages.PARENTHESES); }
Source:
public boolean ShouldEndAction() { synchronized (_listTasks) { java.util.ArrayList<EntityAsyncTask> CurrentActionTypeTasks = GetCurrentActionTypeTasks(); for (EntityAsyncTask task : CurrentActionTypeTasks) { if (task.getState() != AsyncTaskState.Ended) { log.infoFormat("Task ID: '{0}' is in state {1}. End action for entity {2} will proceed when all the entity tasks will be completed.", task.getTaskID(), task.getState(), getContainerId()); return false; } } } return true; }

Target:
public boolean ShouldEndAction() { synchronized (_listTasks) { java.util.ArrayList<EntityAsyncTask> CurrentActionTypeTasks = GetCurrentActionTypeTasks(); for (EntityAsyncTask task : CurrentActionTypeTasks) { if (task.getState() != AsyncTaskState.Ended) { log.infoFormat("Task ID: '{0}' is in state {1}. End action for entity {2} will proceed when all the entity's tasks are completed.", task.getTaskID(), task.getState(), getContainerId()); return false; } } } return true; }
Source:
private void reportBytesRead(int count) { if (bytesAvailable - count >= 0) { bytesAvailable -= count; } }

Target:
private void reportBytesRead(int count) { if (bytesAvailable >= count) { bytesAvailable -= count; } }