auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
@Override public void sendMessage(ClusterNode node, Message msg, IgniteInClosure<IgniteException> ackC) { if (needStaleTop) { if (msg instanceof GridIoMessage) { GridIoMessage ioMsg = (GridIoMessage)msg; Message appMsg = ioMsg.message(); if (appMsg != null && appMsg instanceof DataStreamerRequest) { DataStreamerRequest req = (DataStreamerRequest)appMsg; AffinityTopologyVersion validTop = req.topologyVersion(); AffinityTopologyVersion staleTop = new AffinityTopologyVersion( validTop.topologyVersion() - 1, validTop.minorTopologyVersion()); appMsg = new DataStreamerRequest( req.requestId(), req.responseTopicBytes(), req.cacheName(), req.updaterBytes(), req.entries(), req.ignoreDeploymentOwnership(), req.skipStore(), req.keepBinary(), req.deploymentMode(), req.sampleClassName(), req.userVersion(), req.participants(), req.classLoaderId(), req.forceLocalDeployment(), staleTop, -1); msg = new GridIoMessage( GridTestUtils.<UUID>getFieldValue(ioMsg, "secSubjId"), GridTestUtils.<Byte>getFieldValue(ioMsg, "plc"), GridTestUtils.getFieldValue(ioMsg, "topic"), GridTestUtils.<Integer>getFieldValue(ioMsg, "topicOrd"), appMsg, GridTestUtils.<Boolean>getFieldValue(ioMsg, "ordered"), ioMsg.timeout(), ioMsg.skipOnTimeout()); needStaleTop = false; } } } super.sendMessage(node, msg, ackC); }

Target:
@Override public void sendMessage(ClusterNode node, Message msg, IgniteInClosure<IgniteException> ackC) { if (needStaleTop) { if (msg instanceof GridIoMessage) { GridIoMessage ioMsg = (GridIoMessage)msg; Message appMsg = ioMsg.message(); if (appMsg != null && appMsg instanceof DataStreamerRequest) { DataStreamerRequest req = (DataStreamerRequest)appMsg; AffinityTopologyVersion validTop = req.topologyVersion(); AffinityTopologyVersion staleTop = new AffinityTopologyVersion( validTop.topologyVersion() - 1, validTop.minorTopologyVersion()); appMsg = new DataStreamerRequest( req.requestId(), req.responseTopicBytes(), req.cacheName(), req.updaterBytes(), req.entries(), req.ignoreDeploymentOwnership(), req.skipStore(), req.keepBinary(), req.deploymentMode(), req.sampleClassName(), req.userVersion(), req.participants(), req.classLoaderId(), req.forceLocalDeployment(), staleTop, -1); msg = new GridIoMessage( GridTestUtils.<Byte>getFieldValue(ioMsg, "plc"), GridTestUtils.getFieldValue(ioMsg, "topic"), GridTestUtils.<Integer>getFieldValue(ioMsg, "topicOrd"), appMsg, GridTestUtils.<Boolean>getFieldValue(ioMsg, "ordered"), ioMsg.timeout(), ioMsg.skipOnTimeout()); needStaleTop = false; } } } super.sendMessage(node, msg, ackC); }
Source:
public void execute(Tuple tuple) { R obj = (R) tuple.getValue(0); consumer.accept(obj); }

Target:
public void execute(Tuple tuple) { R obj = (R) tuple.getValue(0); consumer.accept(obj); collector.ack(tuple); }
Source:
public void placeNewOrder(Market market, String symbol, int volume, double price, OrderType orderType) throws StockMarketExpection { MarketHistory tempM = market.getMarketHistory(); double totalCost = (price * volume); if (cashInHand < totalCost && orderType == OrderType.BUY) { throw new StockMarketExpection( "Trader does not have enough cash for purchase\n"); } for (Order o : this.ordersPlaced) { if (o.getStockSymbol().equals(symbol)) { throw new StockMarketExpection( "Trader cannot place multiple orders for the same stock.\n"); } } if (orderType == OrderType.SELL) { boolean found = false; for (Order o : this.position) { if (o.getStockSymbol().equals(symbol) && o.getSize() < volume) throw new StockMarketExpection( "Trader cannot sell more stocks than they own.\n"); else if (o.getStockSymbol().equals(symbol)) { found = true; } } if (found == false) { throw new StockMarketExpection( "Trader cannot sell more stocks than they own.\n"); } } if (orderType == OrderType.BUY) { Order newBuyOrder = new BuyOrder(symbol, volume,price, this); this.ordersPlaced.add(newBuyOrder); market.addOrder(newBuyOrder); } else { Order newSellOrder = new SellOrder(symbol, volume, price, this); this.ordersPlaced.add(newSellOrder); market.addOrder(newSellOrder); } }

Target:
public void placeNewOrder(Market market, String symbol, int volume, double price, OrderType orderType) throws StockMarketExpection { MarketHistory tempM = market.getMarketHistory(); double totalCost = (price * volume); if (cashInHand < totalCost && orderType == OrderType.BUY) { throw new StockMarketExpection( "Trader does not have enough cash for purchase\n"); } for (Order order : this.ordersPlaced) { if (order.getStockSymbol().equals(symbol)) { throw new StockMarketExpection( "Trader cannot place multiple orders for the same stock.\n"); } } if (orderType == OrderType.SELL) { boolean found = false; for (Order order : this.position) { if (order.getStockSymbol().equals(symbol) && order.getSize() < volume) throw new StockMarketExpection( "Trader cannot sell more stocks than they own.\n"); else if (order.getStockSymbol().equals(symbol)) { found = true; } } if (found == false) { throw new StockMarketExpection( "Trader cannot sell more stocks than they own.\n"); } } if (orderType == OrderType.BUY) { Order newBuyOrder = new BuyOrder(symbol, volume,price, this); this.ordersPlaced.add(newBuyOrder); market.addOrder(newBuyOrder); } else { Order newSellOrder = new SellOrder(symbol, volume, price, this); this.ordersPlaced.add(newSellOrder); market.addOrder(newSellOrder); } }
Source:
public void setComponentPopupMenu(JPopupMenu popup) { super.setComponentPopupMenu(popup); myColorChooserButton.setComponentPopupMenu(popup); }

Target:
public void setComponentPopupMenu(JPopupMenu popup) { super.setComponentPopupMenu(popup); myResourceChooserButton.setComponentPopupMenu(popup); }
Source:
private void testMirrorMergeAction(MergeMode actionMergeMode, DifferenceState expectedLeftDiffState, DifferenceState expectedRightDiffState) { IEMFCompareConfiguration emfCC = createConfiguration(true, true); IComparisonScope scope = new DefaultComparisonScope(leftResource, rightResource, originResource); Comparison comparision = EMFCompare.builder().build().compare(scope); final MockMergeAction mergeAction = new MockMergeAction(emfCC, mergerRegistry, actionMergeMode, null); mergeAction.setMirrored(true); Diff leftDiff = get(filter(comparision.getDifferences(), fromSide(DifferenceSource.LEFT)), 0); assertEquals(DifferenceState.UNRESOLVED, leftDiff.getState()); mergeAction.updateSelection(new StructuredSelection(leftDiff)); mergeAction.run(); leftDiff = get(filter(comparision.getDifferences(), fromSide(DifferenceSource.LEFT)), 0); assertEquals(expectedLeftDiffState, leftDiff.getState()); Diff rightDiff = get(filter(comparision.getDifferences(), fromSide(DifferenceSource.RIGHT)), 0); assertEquals(DifferenceState.UNRESOLVED, rightDiff.getState()); mergeAction.updateSelection(new StructuredSelection(rightDiff)); mergeAction.run(); rightDiff = get(filter(comparision.getDifferences(), fromSide(DifferenceSource.RIGHT)), 0); assertEquals(expectedRightDiffState, rightDiff.getState()); editingDomain.dispose(); }

Target:
private void testMirrorMergeAction(MergeMode actionMergeMode, DifferenceState expectedLeftDiffState, DifferenceState expectedRightDiffState) { IEMFCompareConfiguration emfCC = createConfiguration(true, true); IComparisonScope scope = new DefaultComparisonScope(leftResource, rightResource, originResource); Comparison comparision = EMFCompare.builder().build().compare(scope); final MockMergeAction mergeAction = new MockMergeAction(emfCC, mergerRegistry, actionMergeMode, null); mergeAction.setMirrored(true); Diff leftDiff = get(filter(comparision.getDifferences(), fromSide(DifferenceSource.LEFT)), 0); assertEquals(DifferenceState.UNRESOLVED, leftDiff.getState()); mergeAction.updateSelection(new StructuredSelection(leftDiff)); mergeAction.run(); leftDiff = get(filter(comparision.getDifferences(), fromSide(DifferenceSource.LEFT)), 0); assertEquals(expectedLeftDiffState, leftDiff.getState()); Diff rightDiff = get(filter(comparision.getDifferences(), fromSide(DifferenceSource.RIGHT)), 0); assertEquals(DifferenceState.UNRESOLVED, rightDiff.getState()); mergeAction.updateSelection(new StructuredSelection(rightDiff)); mergeAction.run(); rightDiff = get(filter(comparision.getDifferences(), fromSide(DifferenceSource.RIGHT)), 0); assertEquals(expectedRightDiffState, rightDiff.getState()); }
Source:
public Iterable<AlgorithmEvaluation> applyAlgorithm(Attribute targetAttribute, String algorithm, Iterable<Entity> sourceEntities) { return stream(sourceEntities.spliterator(), false).map(entity -> { AlgorithmEvaluation algorithmResult = new AlgorithmEvaluation(entity); Object derivedValue; try { Object result = jsMagmaScriptEvaluator.eval(algorithm, entity); derivedValue = convert(result, targetAttribute); } catch (NullPointerException npe) { return algorithmResult.errorMessage( "Applying an algorithm on a null source value caused an exception. Is the target attribute required?"); } catch (Exception e) { return algorithmResult.errorMessage(e.getLocalizedMessage()); } return algorithmResult.value(derivedValue); }).collect(toList()); }

Target:
public Iterable<AlgorithmEvaluation> applyAlgorithm(Attribute targetAttribute, String algorithm, Iterable<Entity> sourceEntities) { return stream(sourceEntities.spliterator(), false).map(entity -> { AlgorithmEvaluation algorithmResult = new AlgorithmEvaluation(entity); Object derivedValue; try { Object result = jsMagmaScriptEvaluator.eval(algorithm, entity); derivedValue = convert(result, targetAttribute); } catch (ScriptExecutionException e) { LOG.warn("", e); return algorithmResult.errorMessage(e.getLocalizedMessage()); } return algorithmResult.value(derivedValue); }).collect(toList()); }
Source:
public Response setBranchName(long branchUuid, String newName) { BranchReadable branch = getBranchById(branchUuid); boolean modified = false; if (isDifferent(branch.getName(), newName)) { Callable<?> op = getBranchOps().changeBranchName(branch, newName); executeCallable(op); activityLog.createEntry(BRANCH_OPERATION_TYPEID, ActivityLog.INITIAL_STATUS, String.format( "Branch Operation Set Branch Name {branchUUID: %s prevName: %s newName: %s accountId: %s serverId: %s clientId: %s}", branchUuid, branch.getName(), newName, accountId, serverId, clientId)); modified = true; } return asResponse(modified); }

Target:
public Response setBranchName(long branchUuid, String newName) { BranchReadable branch = getBranchById(branchUuid); boolean modified = false; if (isDifferent(branch.getName(), newName)) { Callable<?> op = getBranchOps().changeBranchName(branch, newName); executeCallable(op); try { activityLog.createEntry(BRANCH_OPERATION_TYPEID, ActivityLog.INITIAL_STATUS, String.format( "Branch Operation Set Branch Name {branchUUID: %s prevName: %s newName: %s accountId: %s serverId: %s clientId: %s}", branchUuid, branch.getName(), newName, RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders), RestUtil.getClientId(httpHeaders))); modified = true; } catch (OseeCoreException ex) { OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex); } } return asResponse(modified); }
Source:
public void endWithFailure() { setSucceeded(true); ImagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation( getMovedDiskIds(), ImageStatus.OK, ImageStatus.OK, getCompensationContext()); }

Target:
public void endWithFailure() { setSucceeded(true); if (getParameters().getStage() != LiveMigrateStage.AUTO_GENERATED_SNAPSHOT_REMOVE_START) { ImagesHandler.updateAllDiskImagesSnapshotsStatusInTransactionWithCompensation( getMovedDiskIds(), ImageStatus.OK, ImageStatus.OK, getCompensationContext()); } }
Source:
public static void init(MainActivity mainActivity, Bitmap first_layer) { instance = new LayersDialog(mainActivity, first_layer); }

Target:
public static void init(MainActivity mainActivity, Bitmap first_layer) { if (instance == null) instance = new LayersDialog(mainActivity, first_layer); }
Source:
protected boolean processSingleACHUpdate(PaymentWorksVendorUpdatesDTO vendorUpdate, PaymentWorksVendorUpdateResults resultsDTO) { boolean routed; PaymentWorksVendor paymentWorksVendor = getPaymentWorksVendorService().savePaymentWorksVendorRecord( vendorUpdate, PaymentWorksConstants.ProcessStatus.ACH_UPDATE_COMPLETE, PaymentWorksConstants.TransactionType.ACH_UPDATE); try { if (ObjectUtils.isNotNull(vendorUpdate.getField_changes().getField_changes())) { routed = getPaymentWorksKfsService().directAchEdit(vendorUpdate, paymentWorksVendor.getVendorNumberList()); } else { throw new ValidationException("No field changes provided by PaymentWorks"); } } catch (Exception e) { routed = false; resultsDTO.setHasErrors(true); GlobalVariables.getMessageMap().clearErrorMessages(); GlobalVariables.getMessageMap().clearErrorPath(); LOG.error("processSingleACHUpdate, There was error processing vendor update with ID of " + vendorUpdate.getId() + " because " + e.getMessage()); } if (routed) { updateVendorRequestStatus(paymentWorksVendor, PaymentWorksConstants.PaymentWorksUpdateStatus.PROCESSED, PaymentWorksConstants.PaymentWorksStatusText.PROCESSED, PaymentWorksConstants.ProcessStatus.ACH_UPDATE_COMPLETE, routed); } else { updateVendorRequestStatus(paymentWorksVendor, PaymentWorksConstants.PaymentWorksUpdateStatus.PROCESSED, PaymentWorksConstants.PaymentWorksStatusText.PROCESSED, PaymentWorksConstants.ProcessStatus.ACH_UPDATE_REJECTED, routed); } LOG.debug("processSingleACHUpdate, returning " + routed); return routed; }

Target:
protected boolean processSingleACHUpdate(PaymentWorksVendorUpdatesDTO vendorUpdate, PaymentWorksVendorUpdateResults resultsDTO) { boolean routed; PaymentWorksVendor paymentWorksVendor = getPaymentWorksVendorService().savePaymentWorksVendorRecord( vendorUpdate, PaymentWorksConstants.ProcessStatus.ACH_UPDATE_COMPLETE, PaymentWorksConstants.TransactionType.ACH_UPDATE); try { if (ObjectUtils.isNotNull(vendorUpdate.getField_changes().getField_changes())) { routed = getPaymentWorksKfsService().directAchEdit(vendorUpdate, paymentWorksVendor.getVendorNumberList()); } else { throw new ValidationException("No field changes provided by PaymentWorks"); } } catch (Exception e) { routed = false; resultsDTO.setHasErrors(true); GlobalVariables.getMessageMap().clearErrorMessages(); GlobalVariables.getMessageMap().clearErrorPath(); LOG.error("processSingleACHUpdate, There was error processing vendor update with ID of " + vendorUpdate.getId() + " because " + e.getMessage(), e); } if (routed) { updateVendorRequestStatus(paymentWorksVendor, PaymentWorksConstants.PaymentWorksUpdateStatus.PROCESSED, PaymentWorksConstants.PaymentWorksStatusText.PROCESSED, PaymentWorksConstants.ProcessStatus.ACH_UPDATE_COMPLETE, routed); } else { updateVendorRequestStatus(paymentWorksVendor, PaymentWorksConstants.PaymentWorksUpdateStatus.PROCESSED, PaymentWorksConstants.PaymentWorksStatusText.PROCESSED, PaymentWorksConstants.ProcessStatus.ACH_UPDATE_REJECTED, routed); } LOG.debug("processSingleACHUpdate, returning " + routed); return routed; }
Source:
private static void writeToDisk(final Context context, final String filename, final ExtendedJSONObject pickle) { PrintStream ps = null; try { final FileOutputStream fos = context.openFileOutput(filename, Context.MODE_PRIVATE); ps = new PrintStream(fos); ps.print(pickle.toJSONString()); Logger.debug(LOG_TAG, "Persisted " + pickle.keySet().size() + " account settings to " + filename + "."); } catch (Exception e) { Logger.warn(LOG_TAG, "Caught exception persisting account settings to " + filename + "; ignoring.", e); } finally { if (ps != null) { ps.close(); } } }

Target:
private static void writeToDisk(final Context context, final String filename, final ExtendedJSONObject pickle) { try { final FileOutputStream fos = context.openFileOutput(filename, Context.MODE_PRIVATE); try { final PrintStream ps = new PrintStream(fos); try { ps.print(pickle.toJSONString()); Logger.debug(LOG_TAG, "Persisted " + pickle.keySet().size() + " account settings to " + filename + "."); } finally { ps.close(); } } finally { fos.close(); } } catch (Exception e) { Logger.warn(LOG_TAG, "Caught exception persisting account settings to " + filename + "; ignoring.", e); } }
Source:
protected ITimeGraphPresentationProvider getPresentationProvider() { return fPresentation; }

Target:
protected ITimeGraphPresentationProvider2 getPresentationProvider() { return fPresentation; }
Source:
public void onChanged(List<CidrAddress> added, List<CidrAddress> removed) { logger.debug("ip address change: added {}, removed {}", added, removed); deactivate(); start(); }

Target:
public void onChanged(List<CidrAddress> added, List<CidrAddress> removed) { logger.debug("ip address change: added {}, removed {}", added, removed); close(); start(); }
Source:
public void onCollideWithPlayer(PlayerEntity player) { if(!this.world.isRemote&&(this.inGround||this.getNoClip())&&this.arrowShake <= 0) { boolean flag = this.pickupStatus==AbstractArrowEntity.PickupStatus.ALLOWED||this.pickupStatus==AbstractArrowEntity.PickupStatus.CREATIVE_ONLY&&player.abilities.isCreativeMode||this.getNoClip()&&this.getShooter().getUniqueID()==player.getUniqueID(); if(this.pickupStatus==AbstractArrowEntity.PickupStatus.ALLOWED&&!player.inventory.addItemStackToInventory(this.getArrowStack())) { flag = false; } if(flag) { player.onItemPickup(this, 1); this.remove(); } } }

Target:
public void onCollideWithPlayer(PlayerEntity player) { if(!this.world.isRemote&&(this.inGround||this.getNoClip())&&this.arrowShake <= 0) { boolean flag = this.pickupStatus==AbstractArrowEntity.PickupStatus.ALLOWED ||this.pickupStatus==AbstractArrowEntity.PickupStatus.CREATIVE_ONLY&&player.abilities.isCreativeMode ||this.getNoClip()&&this.getShooter().getUniqueID()==player.getUniqueID(); if(this.pickupStatus==AbstractArrowEntity.PickupStatus.ALLOWED &&!player.inventory.addItemStackToInventory(this.getArrowStack())) flag = false; if(flag) { player.onItemPickup(this, 1); this.remove(); } } }
Source:
public void dateTimeSetAttributesFilters() throws Exception { final ProductProjectionSearch termSearch = ProductProjectionSearch.ofStaged() .withQueryFilters(model -> model.allVariants().attribute().ofDateTime(ATTR_NAME_DATE_TIME_SET) .filtered().by(ZonedDateTime.parse("2002-10-12T23:06:10.204+00:00"))); assertThat(executeAndReturnIds(termSearch)).containsOnly(product1.getId()); final ProductProjectionSearch rangeSearch = ProductProjectionSearch.ofStaged() .withQueryFilters(model -> model.allVariants().attribute().ofDateTime(ATTR_NAME_DATE_TIME_SET) .filtered().byGreaterThanOrEqualTo(ZonedDateTime.parse("2002-10-12T23:06:10.204+00:00"))); assertThat(executeAndReturnIds(rangeSearch)).containsOnly(product1.getId()); }

Target:
public void dateTimeSetAttributesFilters() throws Exception { final ProductProjectionSearch termSearch = ProductProjectionSearch.ofStaged() .withQueryFilters(model -> model.allVariants().attribute().ofDateTime(ATTR_NAME_DATE_TIME_SET) .filtered().by(DATE_TIME_2002_23H)); assertThat(executeAndReturnIds(termSearch)).containsOnly(product1.getId()); final ProductProjectionSearch rangeSearch = ProductProjectionSearch.ofStaged() .withQueryFilters(model -> model.allVariants().attribute().ofDateTime(ATTR_NAME_DATE_TIME_SET) .filtered().byGreaterThanOrEqualTo(DATE_TIME_2002_23H)); assertThat(executeAndReturnIds(rangeSearch)).containsOnly(product1.getId()); }
Source:
public SpecialDay convert(final com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.SpecialDay source, final Type<? extends SpecialDay> destinationType) { final ByteBuffer bb = ByteBuffer.wrap(source.getSpecialDayDate()); final int year = bb.getShort() & 0xFFFF; final int month = bb.get() & 0xFF; final int day = bb.get() & 0xFF; final int weekDay = bb.get() & 0xFF; final SpecialDay specialDay = new SpecialDay(new CosemDate(year, month, day, weekDay), source.getDayId()); return specialDay; }

Target:
public SpecialDay convert(final com.alliander.osgp.adapter.ws.schema.smartmetering.configuration.SpecialDay source, final Type<? extends SpecialDay> destinationType) { return new SpecialDay(this.mapperFacade.map(source.getSpecialDayDate(), CosemDate.class), source.getDayId()); }
Source:
public Location newLocationFromString(Map properties, String spec) { String provider=spec, region=null; int split = spec.indexOf(':'); if (split<0) { if (spec.equalsIgnoreCase(getPrefix())) throw new IllegalArgumentException("Cannot use '"+spec+"' as a location ID; it is insufficient. "+ "Try jclouds:aws-ec2 (for example)."); } else { provider = spec.substring(0, split); region = spec.substring(split+1); if (provider.equalsIgnoreCase(JCLOUDS)) { provider = region; region = null; split = provider.indexOf(':'); if (split>=0) { region = provider.substring(split+1); provider = provider.substring(0, split); } } } if (region==null && AWS_REGIONS.contains(provider)) { region = provider; provider = "aws-ec2"; } return new JcloudsLocationFactory( new CredentialsFromEnv(BrooklynProperties.Factory.newEmpty().addFromMap(properties), provider).asMap()). newLocation(region); }

Target:
public Location newLocationFromString(Map properties, String spec) { String provider=spec, region=null; int split = spec.indexOf(':'); if (split<0) { if (spec.equalsIgnoreCase(getPrefix())) throw new IllegalArgumentException("Cannot use '"+spec+"' as a location ID; it is insufficient. "+ "Try jclouds:aws-ec2 (for example)."); } else { provider = spec.substring(0, split); region = spec.substring(split+1); if (provider.equalsIgnoreCase(JCLOUDS)) { provider = region; region = null; split = provider.indexOf(':'); if (split>=0) { region = provider.substring(split+1); provider = provider.substring(0, split); } } } if (region==null && AWS_REGIONS.contains(provider)) { region = provider; provider = "aws-ec2"; log.warn("Use of deprecated location '"+region+"'; in future refer to with explicit provider '"+provider+":"+region+"'"); } return new JcloudsLocationFactory( new CredentialsFromEnv(BrooklynProperties.Factory.newEmpty().addFromMap(properties), provider).asMap()). newLocation(region); }
Source:
public void onClose(KubernetesClientException e) { future.completeExceptionally( new RuntimeException( "Websocket connection is closed. But event about removing is not received.", e)); }

Target:
public void onClose(KubernetesClientException e) { future.completeExceptionally( new RuntimeException( "WebSocket connection is closed. But event about removing is not received.", e)); }
Source:
public void removeAuthenticationMethodEvent(final AuthenticationMethodEvent authenticationMethodEvent) { int r = -1; final int l = authenticationMethodEvents.length; for (int i = 0; i < l; i++) { if (authenticationMethodEvents[i] == authenticationMethodEvent) { r = i; break; } } if (r >= 0) { final AuthenticationMethodEvent[] newArray = new AuthenticationMethodEvent[l]; for (int i = 0, j = 0; i < l; i++) { if (j != r) { newArray[j++] = authenticationMethodEvents[i]; } } authenticationMethodEvents = newArray; } }

Target:
public void removeAuthenticationMethodEvent(final AuthenticationMethodEvent authenticationMethodEvent) { int r = -1; final int l = authenticationMethodEvents.length; for (int i = 0; i < l; i++) { if (authenticationMethodEvents[i] == authenticationMethodEvent) { r = i; break; } } if (r >= 0) { final AuthenticationMethodEvent[] newArray = new AuthenticationMethodEvent[l - 1]; for (int i = 0, j = 0; i < l; i++) { if (i != r) { newArray[j++] = authenticationMethodEvents[i]; } } authenticationMethodEvents = newArray; } }
Source:
public HttpRequestExecutingMessageHandler(String uri) { this(uri, (RestTemplate) null); }

Target:
public HttpRequestExecutingMessageHandler(String uri) { this(uri, null); }
Source:
private void setUriParts(URI uri) { if (uri == null) { throw new IllegalArgumentException("uri is null"); } String theScheme = uri.getScheme(); if (theScheme != null) { scheme = theScheme; } String rawPath = uri.getRawPath(); if (!uri.isOpaque() && schemeSpecificPart == null && (theScheme != null || rawPath != null)) { port = uri.getPort(); host = uri.getHost(); if (rawPath != null) { setPathAndMatrix(rawPath); } String rawQuery = uri.getRawQuery(); if (rawQuery != null) { query = JAXRSUtils.getStructuredParams(rawQuery, "&", false, true); } userInfo = uri.getUserInfo(); schemeSpecificPart = null; } else { schemeSpecificPart = uri.getSchemeSpecificPart(); } if (scheme != null && !"file".equalsIgnoreCase(scheme) && host == null && (query == null || query.isEmpty()) && userInfo == null && uri.getSchemeSpecificPart() != null) { schemeSpecificPart = uri.getSchemeSpecificPart(); } String theFragment = uri.getFragment(); if (theFragment != null) { fragment = theFragment; } }

Target:
private void setUriParts(URI uri) { if (uri == null) { throw new IllegalArgumentException("uri is null"); } String theScheme = uri.getScheme(); if (theScheme != null) { scheme = theScheme; } String rawPath = uri.getRawPath(); if (!uri.isOpaque() && schemeSpecificPart == null && (theScheme != null || rawPath != null)) { port = uri.getPort(); host = uri.getHost(); if (rawPath != null) { setPathAndMatrix(rawPath); } String rawQuery = uri.getRawQuery(); if (rawQuery != null) { query = JAXRSUtils.getStructuredParams(rawQuery, "&", false, true); } userInfo = uri.getUserInfo(); schemeSpecificPart = null; } else { schemeSpecificPart = uri.getSchemeSpecificPart(); } if (scheme != null && host == null && port == -1 && userInfo == null && CollectionUtils.isEmpty(query) && uri.getSchemeSpecificPart() != null && !schemeSpecificPartMatchesUriPath(uri)) { schemeSpecificPart = uri.getSchemeSpecificPart(); } String theFragment = uri.getFragment(); if (theFragment != null) { fragment = theFragment; } }
Source:
private static Intent prepareAudioLibraryIntent(String title, boolean multiSelect) { Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType(MIME_DATA_TYPE_AUDIO); if (multiSelect) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); } } return Intent.createChooser(intent, title); }

Target:
private static Intent prepareAudioLibraryIntent(String title, boolean multiSelect) { Intent intent = new Intent(Intent.ACTION_GET_CONTENT); intent.setType(MIME_DATA_TYPE_AUDIO); if (multiSelect && Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) { intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true); } return Intent.createChooser(intent, title); }
Source:
public String toString() { return "[status=" + status + "]"; }

Target:
public String toString() { return getClass().getSimpleName() + " [status=" + status + "]"; }
Source:
public static SegmentAssignment getSegmentAssignment(HelixManager helixManager, TableConfig tableConfig) { SegmentAssignment segmentAssignment; if (tableConfig.getTableType() == TableType.OFFLINE && Boolean.parseBoolean(tableConfig.getIsDimTable())) { segmentAssignment = new OfflineDimTableSegmentAssignment(); } else if (tableConfig.getTableType() == TableType.OFFLINE) { segmentAssignment = new OfflineSegmentAssignment(); } else { segmentAssignment = new RealtimeSegmentAssignment(); } segmentAssignment.init(helixManager, tableConfig); return segmentAssignment; }

Target:
public static SegmentAssignment getSegmentAssignment(HelixManager helixManager, TableConfig tableConfig) { SegmentAssignment segmentAssignment; if (tableConfig.getTableType() == TableType.OFFLINE) { segmentAssignment = tableConfig.isDimTable() ? new OfflineDimTableSegmentAssignment() : new OfflineSegmentAssignment(); } else { segmentAssignment = new RealtimeSegmentAssignment(); } segmentAssignment.init(helixManager, tableConfig); return segmentAssignment; }
Source:
protected void localFileInclusionAttack(HttpMessage msg) { String localFile; String response; Matcher matcher; String payload = null; try { for (int idx = 0; idx < LOCAL_FILE_TARGETS.length; idx++) { localFile = LOCAL_FILE_TARGETS[idx]; payload = MessageFormat.format(ATTACK_HEADER + ATTACK_BODY, localFile); msg.setRequestBody(payload); sendAndReceive(msg); response = msg.getResponseBody().toString(); matcher = LOCAL_FILE_PATTERNS[idx].matcher(response); if (matcher.find()) { newAlert() .setConfidence(Alert.CONFIDENCE_MEDIUM) .setAttack(payload) .setEvidence(matcher.group()) .setMessage(msg) .raise(); } if (isStop()) { return; } } } catch (IOException ex) { log.warn( "XXE Injection vulnerability check failed for payload [" + payload + "] due to an I/O error", ex); } }

Target:
private void localFileInclusionAttack(HttpMessage msg) { String payload = null; try { for (int idx = 0; idx < LOCAL_FILE_TARGETS.length; idx++) { String localFile = LOCAL_FILE_TARGETS[idx]; payload = MessageFormat.format(ATTACK_HEADER + ATTACK_BODY, localFile); msg.setRequestBody(payload); sendAndReceive(msg); String response = msg.getResponseBody().toString(); Matcher matcher = LOCAL_FILE_PATTERNS[idx].matcher(response); if (matcher.find()) { newAlert() .setConfidence(Alert.CONFIDENCE_MEDIUM) .setAttack(payload) .setEvidence(matcher.group()) .setMessage(msg) .raise(); } if (isStop()) { return; } } } catch (IOException ex) { log.warn( "XXE Injection vulnerability check failed for payload [" + payload + "] due to an I/O error", ex); } }
Source:
public @Nullable Object columnValue(ColumnName columnName) { return columnValue(columnName, DefaultColumnMapping.INSTANCE); }

Target:
public final @Nullable Object columnValue(ColumnName columnName) { return columnValue(columnName, DefaultColumnMapping.INSTANCE); }
Source:
private void addQueryToNode(final XPath xPath, final String nodeName) { List<XPath> xPaths = nodeNameToXPaths.get(nodeName); if (xPaths == null) { xPaths = new ArrayList<>(); nodeNameToXPaths.put(nodeName, xPaths); } xPaths.add(xPath); }

Target:
private void addQueryToNode(final XPath xPath, final String nodeName) { List<XPath> xPathsForNode = nodeNameToXPaths.get(nodeName); if (xPathsForNode == null) { xPathsForNode = new ArrayList<>(); nodeNameToXPaths.put(nodeName, xPathsForNode); } xPathsForNode.add(xPath); }
Source:
public boolean visit(IResourceDelta delta) throws CoreException { final IResource resource = delta.getResource(); final RepositoryMapping mapping = RepositoryMapping .getMapping(resource); if (mapping == null || mapping.getRepository() != repository) return true; IndexDiffCache cache = Activator.getDefault().getIndexDiffCache(); IndexDiffCacheEntry entry = null; if (cache != null) entry = cache.getIndexDiffCacheEntry(mapping.getRepository()); if (resource instanceof IFolder && delta.getKind() == IResourceDelta.ADDED) { String repoRelativePath = mapping.getRepoRelativePath(resource) + "/"; if (isIgnoredInOldIndex(entry, repoRelativePath)) { return false; } filesToUpdate.add(repoRelativePath); resourcesToUpdate.add(resource); return true; } if (delta.getKind() == IResourceDelta.CHANGED && (delta.getFlags() & INTERESTING_CHANGES) == 0) return true; if (resource.getType() != IResource.FILE) return true; String repoRelativePath = mapping.getRepoRelativePath(resource); if (isIgnoredInOldIndex(entry, repoRelativePath)) { return false; } if (resource.getName().equals(GITIGNORE_NAME)) { gitIgnoreChanged = true; return false; } if (repoRelativePath!= null) filesToUpdate.add(repoRelativePath); resourcesToUpdate.add(resource); return true; }

Target:
public boolean visit(IResourceDelta delta) throws CoreException { final IResource resource = delta.getResource(); final RepositoryMapping mapping = RepositoryMapping .getMapping(resource); if (mapping == null || mapping.getRepository() != repository) return true; IndexDiffCache cache = Activator.getDefault().getIndexDiffCache(); IndexDiffCacheEntry entry = null; if (cache != null) entry = cache.getIndexDiffCacheEntry(mapping.getRepository()); if (resource instanceof IFolder && delta.getKind() == IResourceDelta.ADDED) { String path = mapping.getRepoRelativePath(resource) + "/"; if (isIgnoredInOldIndex(entry, path)) { return true; } filesToUpdate.add(path); resourcesToUpdate.add(resource); return true; } if (delta.getKind() == IResourceDelta.CHANGED && (delta.getFlags() & INTERESTING_CHANGES) == 0) return true; if (resource.getType() != IResource.FILE) return true; if (resource.getName().equals(GITIGNORE_NAME)) { gitIgnoreChanged = true; return false; } String repoRelativePath = mapping.getRepoRelativePath(resource); if (repoRelativePath == null) { resourcesToUpdate.add(resource); return true; } if (isIgnoredInOldIndex(entry, repoRelativePath)) { return false; } filesToUpdate.add(repoRelativePath); resourcesToUpdate.add(resource); return true; }
Source:
private GerritTopMenus gerritTopMenusWithModule(AbstractModule module) { Injector injector = baseInjector.createChildInjector(module); return injector.getInstance(GerritTopMenus.class); }

Target:
private GerritTopMenus gerritTopMenusWithModule(AbstractModule module) { return baseInjector.createChildInjector(module).getInstance( GerritTopMenus.class); }
Source:
protected void compensate() { getCurrentTaskHandler().compensate(); }

Target:
protected void compensate() { if (hasTaskHandlers()) { getCurrentTaskHandler().compensate(); } else { internalCompensate(); } }
Source:
private void initOptionsIfNeeded() { if(status == null) { status = TF_NewStatus(); } if (options == null) { options = TF_NewSessionOptions(); if(protoBufConfigProto != null) { BytePointer bytePointer = new BytePointer(protoBufConfigProto.toByteArray()); TF_SetConfig(options,bytePointer,bytePointer.getStringBytes().length,status); if (TF_GetCode(status) != TF_OK) { throw new RuntimeException("ERROR: Unable to set value configuration:" + TF_Message(status).getString()); } } } }

Target:
private void initOptionsIfNeeded() { if(status == null) { status = TF_NewStatus(); } if (options == null) { options = TF_NewSessionOptions(); if(protoBufConfigProto != null) { BytePointer bytePointer = new BytePointer(protoBufConfigProto.toByteArray()); TF_SetConfig(options,bytePointer,bytePointer.getStringBytes().length,status); if (TF_GetCode(status) != TF_OK) { throw new IllegalStateException("ERROR: Unable to set value configuration:" + TF_Message(status).getString()); } } } }
Source:
public static ProductGroup get(int id){ return new ProductGroup(dataVault.get(id)); }

Target:
public static ProductGroup get(int id){ ProductGroup pg = dataVault.get(id); if(pg == null) return null; return new ProductGroup(pg); }
Source:
private List<ICraftingRecipe> getAllForIngredient(IIngredient target) { Set<Map.Entry<ResourceLocation, IRecipe>> recipes; List<ICraftingRecipe> results = new ArrayList<>(); recipes = ForgeRegistries.RECIPES.getEntries(); for(Map.Entry<ResourceLocation, IRecipe> recipeEntry : recipes) { OreIngredient oi; IRecipe recipe = recipeEntry.getValue(); for (Ingredient ingredient :recipe.getIngredients()){ IIngredient iIngredient =CraftTweakerMC.getIIngredient(ingredient); if (iIngredient == null) continue; if (target.contains(iIngredient)){ if(recipe instanceof MCRecipeBase) results.add((MCRecipeBase) recipe); else results.add(new MCRecipeWrapper(recipe)); } } } return results; }

Target:
private List<MCRecipeBase> getAllForIngredient(IIngredient target) { Set<Map.Entry<ResourceLocation, IRecipe>> recipes; List<MCRecipeBase> results = new ArrayList<>(); recipes = ForgeRegistries.RECIPES.getEntries(); for(Map.Entry<ResourceLocation, IRecipe> recipeEntry : recipes) { IRecipe recipe = recipeEntry.getValue(); for (Ingredient ingredient :recipe.getIngredients()){ IIngredient iIngredient =CraftTweakerMC.getIIngredient(ingredient); if (iIngredient == null) continue; if (target.contains(iIngredient)){ if(recipe instanceof MCRecipeBase) { results.add((MCRecipeBase) recipe); break; } else { results.add(new MCRecipeWrapper(recipe)); break; } } } } return results; }
Source:
static boolean detect() { final String path = AccessController .doPrivileged(new PrivilegedAction<String>() { public String run() { return System.getProperty("java.library.path"); } }); if (path == null) return false; cygpath = FS.scanPath(path, "cygpath.exe"); return cygpath != null; }

Target:
static boolean detect() { final String path = AccessController .doPrivileged(new PrivilegedAction<String>() { public String run() { return System.getProperty("java.library.path"); } }); if (path == null) return false; File found = FS.searchPath(path, "cygpath.exe"); if (found != null) cygpath = found.getPath(); return cygpath != null; }
Source:
protected void updateIndex(CanonicalTreeParser base, CanonicalTreeParser ours, CanonicalTreeParser theirs, MergeResult<RawText> result, File of) throws FileNotFoundException, IOException { if (result.containsConflicts()) { add(tw.getRawPath(), base, DirCacheEntry.STAGE_1, 0, 0); add(tw.getRawPath(), ours, DirCacheEntry.STAGE_2, 0, 0); add(tw.getRawPath(), theirs, DirCacheEntry.STAGE_3, 0, 0); mergeResults.put(tw.getPathString(), result); } else { DirCacheEntry dce = new DirCacheEntry(tw.getPathString()); int newMode = mergeFileModes(tw.getRawMode(0), tw.getRawMode(1), tw.getRawMode(2)); dce.setFileMode((newMode == FileMode.MISSING.getBits()) ? FileMode.REGULAR_FILE : FileMode.fromBits(newMode)); dce.setLastModified(of.lastModified()); dce.setLength((int) of.length()); InputStream is = new FileInputStream(of); try { dce.setObjectId(getObjectInserter().insert( Constants.OBJ_BLOB, of.length(), is)); } finally { is.close(); if (inCore) FileUtils.delete(of); } builder.add(dce); } }

Target:
private void updateIndex(CanonicalTreeParser base, CanonicalTreeParser ours, CanonicalTreeParser theirs, MergeResult<RawText> result, File of) throws FileNotFoundException, IOException { if (result.containsConflicts()) { add(tw.getRawPath(), base, DirCacheEntry.STAGE_1, 0, 0); add(tw.getRawPath(), ours, DirCacheEntry.STAGE_2, 0, 0); add(tw.getRawPath(), theirs, DirCacheEntry.STAGE_3, 0, 0); mergeResults.put(tw.getPathString(), result); } else { DirCacheEntry dce = new DirCacheEntry(tw.getPathString()); int newMode = mergeFileModes(tw.getRawMode(0), tw.getRawMode(1), tw.getRawMode(2)); dce.setFileMode((newMode == FileMode.MISSING.getBits()) ? FileMode.REGULAR_FILE : FileMode.fromBits(newMode)); dce.setLastModified(of.lastModified()); dce.setLength((int) of.length()); InputStream is = new FileInputStream(of); try { dce.setObjectId(getObjectInserter().insert( Constants.OBJ_BLOB, of.length(), is)); } finally { is.close(); if (inCore) FileUtils.delete(of); } builder.add(dce); } }
Source:
public BufferPoolsExports() { try { final Class<?> bufferPoolMXBeanClass = Class.forName("java.lang.management.BufferPoolMXBean"); bufferPoolMXBeans.addAll(accessBufferPoolMXBeans(bufferPoolMXBeanClass)); getName = bufferPoolMXBeanClass.getMethod("getName"); getMemoryUsed = bufferPoolMXBeanClass.getMethod("getMemoryUsed"); getTotalCapacity = bufferPoolMXBeanClass.getMethod("getTotalCapacity"); getCount = bufferPoolMXBeanClass.getMethod("getCount"); } catch (ClassNotFoundException e) { LOGGER.info("BufferPoolMXBean not available, not metrics for buffer pools will be exported"); } catch (NoSuchMethodException e) { LOGGER.info("Can not get necessary accessor from BufferPoolMXBean: " + e.getMessage()); } }

Target:
public BufferPoolsExports() { try { final Class<?> bufferPoolMXBeanClass = Class.forName("java.lang.management.BufferPoolMXBean"); bufferPoolMXBeans.addAll(accessBufferPoolMXBeans(bufferPoolMXBeanClass)); getName = bufferPoolMXBeanClass.getMethod("getName"); getMemoryUsed = bufferPoolMXBeanClass.getMethod("getMemoryUsed"); getTotalCapacity = bufferPoolMXBeanClass.getMethod("getTotalCapacity"); getCount = bufferPoolMXBeanClass.getMethod("getCount"); } catch (ClassNotFoundException e) { LOGGER.fine("BufferPoolMXBean not available, no metrics for buffer pools will be exported"); } catch (NoSuchMethodException e) { LOGGER.fine("Can not get necessary accessor from BufferPoolMXBean: " + e.getMessage()); } }
Source:
public Iterable<Attribute> getSubAttributes() { synchronized (subAttributes) { return new LinkedList<>(subAttributes.values()); } }

Target:
public Iterable<Attribute> getSubAttributes() { return ImmutableList.copyOf(subAttributes.values()); }
Source:
public void onInitializeAccessibilityEvent(AccessibilityEvent event) { if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_SELECTED) { event.setSource(this); event.setClassName(getClass().getName()); event.setPackageName(getContext().getPackageName()); event.setEnabled(isEnabled()); Map<String, CharSequence> map = new HashMap<>(); map.put("rating", String.valueOf((int) getRating())); map.put("num_of_stars", String.valueOf(getNumStars())); event.setContentDescription(ResourceUtil.getFormattedString(getResources(), R.string.rating_bar_selection, map)); return; } super.onInitializeAccessibilityEvent(event); }

Target:
public void onInitializeAccessibilityEvent(AccessibilityEvent event) { super.onInitializeAccessibilityEvent(event); if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_SELECTED) { final Map<String, CharSequence> map = new HashMap<>(); map.put("rating", String.valueOf((int) getRating())); map.put("num_of_stars", String.valueOf(getNumStars())); event.setContentDescription(ResourceUtil.getFormattedString(getResources(), R.string.rating_bar_selection, map)); } }
Source:
public void handleMessage(Message msg) { Pair<Account, OCFile> itemSyncKey = (Pair<Account, OCFile>) msg.obj; nextOperation(itemSyncKey.first,itemSyncKey.second); mService.stopSelf(msg.arg1); }

Target:
public void handleMessage(Message msg) { Pair<Account, String> itemSyncKey = (Pair<Account, String>) msg.obj; doOperation(itemSyncKey.first, itemSyncKey.second); mService.stopSelf(msg.arg1); }
Source:
public void test() throws Exception { MoodManager mm1 = MoodManager.getInstanceFor(conOne); MoodManager mm2 = MoodManager.getInstanceFor(conTwo); Roster r1 = Roster.getInstanceFor(conOne); Roster r2 = Roster.getInstanceFor(conTwo); syncSubscribe(conOne, conTwo, "two"); syncSubscribe(conTwo, conOne, "one"); final SimpleResultSyncPoint moodReceived = new SimpleResultSyncPoint(); mm2.addMoodListener(new MoodListener() { @Override public void onMoodUpdated(BareJid jid, Message message, MoodElement moodElement) { if (moodElement.getMood() == Mood.satisfied) { moodReceived.signal(); } } }); mm1.setMood(Mood.satisfied); moodReceived.waitForResult(timeout); r1.removeEntry(r1.getEntry(conTwo.getUser().asBareJid())); r2.removeEntry(r2.getEntry(conOne.getUser().asBareJid())); }

Target:
public void test() throws Exception { RosterIntegrationTest.ensureBothAccountsAreSubscribedToEachOther(conOne, conTwo, timeout); final SimpleResultSyncPoint moodReceived = new SimpleResultSyncPoint(); mm2.addMoodListener(new MoodListener() { @Override public void onMoodUpdated(BareJid jid, Message message, MoodElement moodElement) { if (moodElement.getMood() == Mood.satisfied) { moodReceived.signal(); } } }); mm1.setMood(Mood.satisfied); moodReceived.waitForResult(timeout); }
Source:
public void testCallService_FAIL() throws Exception { when(httpsClient.doHttpsPost(Mockito.anyString(), Mockito.anyString(),(Map<String,String>)Mockito.anyObject())).thenReturn(500); puppetInstallator.generateFilesinPuppetMaster(host, "test", productRelease, "install", "token"); puppetInstallator.callService(host, "test", productRelease, "install", "token"); }

Target:
public void testCallService_FAIL() throws Exception { when( httpsClient.doHttps(Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), (Map<String, String>) Mockito.anyObject())).thenReturn(500); puppetInstallator.generateFilesinPuppetMaster(host, "test", productRelease, "install", "token"); puppetInstallator.callService(host, "test", productRelease, "install", "token"); }
Source:
private File createIndexFile(File bamFile) throws IOException { final File bamIndexFile = File.createTempFile("Bai.", ".bai"); final SamReader bam = SamReaderFactory.makeDefault().open(bamFile); BAMIndexer.createIndex(bam, bamIndexFile); verbose("Wrote BAM Index file " + bamIndexFile); return bamIndexFile; }

Target:
private File createIndexFile(File bamFile) throws IOException { final File bamIndexFile = File.createTempFile("Bai.", ".bai"); final SamReader bam = SamReaderFactory.makeDefault().open(bamFile); BAMIndexer.createIndex(bam, bamIndexFile); verbose("Wrote BAM Index file " + bamIndexFile); bam.close(); return bamIndexFile; }
Source:
protected ToStringBuilder appendAttributes(ToStringBuilder tsb) { return super.appendAttributes(tsb) .append("operations", imageTicket.getOps()) .append("size", imageTicket.getSize()) .append("url", imageTicket.getUrl()) .append("filename", imageTicket.getFilename()) .append("sparse", imageTicket.isSparse()) .append("transferId", Guid.createGuidFromString(imageTicket.getTransferId())) .append("dirty", imageTicket.isDirty()); }

Target:
protected ToStringBuilder appendAttributes(ToStringBuilder tsb) { return super.appendAttributes(tsb) .append("imageTicket", ticket.getOps()) .append("size", ticket.getSize()) .append("url", ticket.getUrl()) .append("filename", ticket.getFilename()) .append("sparse", ticket.isSparse()) .append("transferId", Guid.createGuidFromString(ticket.getTransferId())) .append("dirty", ticket.isDirty()); }
Source:
static void appendTableName(DatabaseType databaseType, StringBuilder sb, String prefix, TableInfo<?, ?> tableInfo) { if (prefix != null) { sb.append(prefix); } if (tableInfo.getSchemaName() != null && tableInfo.getSchemaName().length() > 0){ databaseType.appendEscapedEntityName(sb, tableInfo.getSchemaName()); sb.append("."); } databaseType.appendEscapedEntityName(sb, tableInfo.getTableName()); sb.append(' '); }

Target:
static void appendTableName(DatabaseType databaseType, StringBuilder sb, String prefix, TableInfo<?, ?> tableInfo) { if (prefix != null) { sb.append(prefix); } if (tableInfo.getSchemaName() != null && tableInfo.getSchemaName().length() > 0){ databaseType.appendEscapedEntityName(sb, tableInfo.getSchemaName()); sb.append('.'); } databaseType.appendEscapedEntityName(sb, tableInfo.getTableName()); sb.append(' '); }
Source:
public KieServerState load(@NotNull String serverId) { KieServerState kieServerState = null; try (KubernetesClient client = createKubernetesClient()) { Map<String, String> data = client.configMaps() .withName(serverId) .get() .getData(); kieServerState = (KieServerState) xs.fromXML(data.get(CFG_MAP_DATA_KEY)); } catch (Exception e) { logger.error("Loading KieServerState failed.", e); } if (kieServerState == null || kieServerState.getConfiguration() .getConfigItem(KieServerConstants.KIE_SERVER_ID) == null || kieServerState.getConfiguration().getConfigItem(KieServerConstants.KIE_SERVER_ID) .getValue().length() == 0) { throw new IllegalStateException("Invalid KieServerId: " + serverId + ", or inconsistent state data."); } return kieServerState; }

Target:
public KieServerState load(@NotNull String serverId) { KieServerState kieServerState = processKieServerState(client -> { ConfigMap cm = client.configMaps().withName(serverId).get(); if (cm == null) { throw new IllegalStateException(("KieServerId: [" + serverId + "], not found. Please create an associated ConfigMap with configuration first.")); } return (KieServerState) xs.fromXML(cm.getData().get(CFG_MAP_DATA_KEY)); }); if (kieServerState == null || !retrieveKieServerId(kieServerState).equals(serverId)) { throw new IllegalStateException("Invalid KieServerId: " + serverId + ", or inconsistent state data."); } return kieServerState; }