auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ValueType typeCheck(TypeContext ctx) { List<DeclType> dts = new LinkedList<DeclType>(); TypeContext thisCtx = ctx.extend(selfName, getExprType()); ValueType type = getExprType(); if (hasDelegate) { ValueType delegateObjectType = ctx.lookup(delegateDeclaration.getFieldName()); for (Declaration d : decls_ExceptDelegate()) { DeclType dt = d.typeCheck(ctx, thisCtx); dts.add(dt); } StructuralType delegateStructuralType = delegateObjectType.getStructuralType(thisCtx); for (DeclType declType : delegateStructuralType.getDeclTypes()) { if (!dts.stream().anyMatch(newDefDeclType-> newDefDeclType.isSubtypeOf(declType, thisCtx))) { dts.add(declType); } } } else { for (Declaration d : decls) { DeclType dt = d.typeCheck(ctx, thisCtx); dts.add(dt); } } StructuralType requiredT = type.getStructuralType(ctx); StructuralType actualT = new StructuralType(selfName, dts); if (!actualT.isSubtypeOf(requiredT, ctx)) { throw new RuntimeException("typechecking error: not a subtype"); } return type; }

Target:
public ValueType typeCheck(TypeContext ctx) { List<DeclType> dts = new LinkedList<DeclType>(); TypeContext thisCtx = ctx.extend(selfName, getExprType()); for (Declaration d : decls_ExceptDelegate()) { DeclType dt = d.typeCheck(ctx, thisCtx); dts.add(dt); } ValueType type = getExprType(); if (hasDelegate) { ValueType delegateObjectType = ctx.lookup(delegateDeclaration.getFieldName()); StructuralType delegateStructuralType = delegateObjectType.getStructuralType(thisCtx); for (DeclType declType : delegateStructuralType.getDeclTypes()) { if (!dts.stream().anyMatch(newDefDeclType-> newDefDeclType.isSubtypeOf(declType, thisCtx))) { dts.add(declType); } } } StructuralType requiredT = type.getStructuralType(ctx); StructuralType actualT = new StructuralType(selfName, dts); if (!actualT.isSubtypeOf(requiredT, ctx)) { throw new RuntimeException("typechecking error: not a subtype"); } return type; }
Source:
public void updateSensorData(SensorJob sensorJob, String priority) { if (sensorJobExecutor == null) { sensorJobExecutor = new SensorJobExecutor(connMan); this.sensorJobExecutor.startExecutor(); } if (sensorJob != null && priority != null) { switch (priority) { case Config.REFRESH_PRIORITY_HIGH: sensorJobExecutor.addHighPriorityJob(sensorJob); break; case Config.REFRESH_PRIORITY_MEDIUM: sensorJobExecutor.addMediumPriorityJob(sensorJob); break; case Config.REFRESH_PRIORITY_LOW: sensorJobExecutor.addLowPriorityJob(sensorJob); break; default: try { long prio = Long.parseLong(priority); sensorJobExecutor.addPriorityJob(sensorJob, prio); } catch (NumberFormatException e) { System.err.println("Sensor data update priority do not exist! Please check the input!"); return; } } logger.debug("Add new sensorJob with priority: to sensorJobExecuter", sensorJob.toString(), priority); } }

Target:
public void updateSensorData(SensorJob sensorJob, String priority) { if (sensorJobExecutor == null) { sensorJobExecutor = new SensorJobExecutor(connMan); this.sensorJobExecutor.startExecutor(); } if (sensorJob != null && priority != null) { switch (priority) { case Config.REFRESH_PRIORITY_HIGH: sensorJobExecutor.addHighPriorityJob(sensorJob); break; case Config.REFRESH_PRIORITY_MEDIUM: sensorJobExecutor.addMediumPriorityJob(sensorJob); break; case Config.REFRESH_PRIORITY_LOW: sensorJobExecutor.addLowPriorityJob(sensorJob); break; default: try { long prio = Long.parseLong(priority); sensorJobExecutor.addPriorityJob(sensorJob, prio); } catch (NumberFormatException e) { logger.debug("Sensor data update priority do not exist! Please check the input!"); return; } } logger.debug("Add new sensorJob with priority: to sensorJobExecuter", sensorJob.toString(), priority); } }
Source:
public Response getApplication(@PathParam("seaCloudsId") String seaCloudsId) throws IOException { if (seaCloudsId == null) { LOG.error("Missing input parameters"); return Response.status(Response.Status.NOT_ACCEPTABLE).build(); } else { SeaCloudsApplicationData seaCloudsApplicationData = dataStore.getSeaCloudsApplicationDataById(seaCloudsId); if (seaCloudsApplicationData == null) { return Response.status(Response.Status.BAD_REQUEST).build(); } for (JsonNode application : deployer.getApplicationsTree()) { if(application.get("id").getTextValue().equals(seaCloudsApplicationData.getDeployerApplicationId())){ return Response.ok(application.toString()).build(); } } return Response.status(Response.Status.BAD_REQUEST).build(); } }

Target:
public Response getApplication(@PathParam("seaCloudsId") String seaCloudsId) throws IOException { if (seaCloudsId == null) { LOG.error("Missing input parameters"); return Response.status(Response.Status.NOT_ACCEPTABLE).build(); } else { SeaCloudsApplicationData seaCloudsApplicationData = dataStore.getSeaCloudsApplicationDataById(seaCloudsId); if (seaCloudsApplicationData == null) { return Response.status(Response.Status.BAD_REQUEST).build(); } for (JsonNode application : deployer.getApplicationsTree()) { if(application.get("id").getTextValue().equals(seaCloudsApplicationData.getDeployerApplicationId())){ return Response.ok(application).build(); } } return Response.status(Response.Status.BAD_REQUEST).build(); } }
Source:
public void checkAccountExists(final String email) { if (!TextUtils.isEmpty(email)) { mActivityHelper.getFirebaseAuth() .fetchProvidersForEmail(email) .addOnFailureListener( new TaskFailureLogger(TAG, "Error fetching providers for email")) .addOnCompleteListener( new OnCompleteListener<ProviderQueryResult>() { @Override public void onComplete(@NonNull Task<ProviderQueryResult> task) { if (task.isSuccessful()) { List<String> providers = task.getResult().getProviders(); if (providers != null && !providers.isEmpty()) { String provider = providers.get(0); if (provider.equalsIgnoreCase(EmailAuthProvider.PROVIDER_ID)) { Intent signInIntent = SignInActivity.createIntent( RegisterEmailActivity.this, mActivityHelper.getFlowParams(), email); mActivityHelper.startActivityForResult(signInIntent, RC_SIGN_IN); } else { Intent intent = WelcomeBackIdpPrompt.createIntent( RegisterEmailActivity.this, mActivityHelper.getFlowParams(), provider, null, email); mActivityHelper.startActivityForResult(intent, RC_WELCOME_BACK_IDP); } } } mActivityHelper.dismissDialog(); } }); } }

Target:
public void checkAccountExists(final String email) { if (!TextUtils.isEmpty(email)) { mActivityHelper.getFirebaseAuth() .fetchProvidersForEmail(email) .addOnFailureListener( new TaskFailureLogger(TAG, "Error fetching providers for email")) .addOnCompleteListener(this, new OnCompleteListener<ProviderQueryResult>() { @Override public void onComplete(@NonNull Task<ProviderQueryResult> task) { mActivityHelper.dismissDialog(); } }) .addOnSuccessListener(new OnSuccessListener<ProviderQueryResult>() { @Override public void onSuccess(ProviderQueryResult result) { List<String> providers = result.getProviders(); if (providers != null && !providers.isEmpty()) { String provider = providers.get(0); if (provider.equalsIgnoreCase(EmailAuthProvider.PROVIDER_ID)) { Intent signInIntent = SignInActivity.createIntent( RegisterEmailActivity.this, mActivityHelper.getFlowParams(), email); mActivityHelper.startActivityForResult(signInIntent, RC_SIGN_IN); } else { Intent intent = WelcomeBackIdpPrompt.createIntent( RegisterEmailActivity.this, mActivityHelper.getFlowParams(), provider, null, email); mActivityHelper.startActivityForResult(intent, RC_WELCOME_BACK_IDP); } } } }); } }
Source:
public void testConnectionServiceFocusGainedWithSameConnectionService() throws Exception { if (!mShouldTestTelecom) { return; } placeAndVerifyCall(); verifyConnectionForOutgoingCall().setActive(); assertTrue(connectionService.waitForEvent( MockConnectionService.EVENT_CONNECTION_SERVICE_FOCUS_GAINED)); Thread.sleep(500); placeAndVerifyCall(); verifyConnectionForOutgoingCall(); assertFalse(connectionService.waitForEvent( MockConnectionService.EVENT_CONNECTION_SERVICE_FOCUS_GAINED)); assertFalse(connectionService.waitForEvent( MockConnectionService.EVENT_CONNECTION_SERVICE_FOCUS_LOST)); }

Target:
public void testConnectionServiceFocusGainedWithSameConnectionService() { if (!mShouldTestTelecom) { return; } placeAndVerifyCall(); Connection outgoing = verifyConnectionForOutgoingCall(); outgoing.setActive(); assertTrue(connectionService.waitForEvent( MockConnectionService.EVENT_CONNECTION_SERVICE_FOCUS_GAINED)); assertCallState(mInCallCallbacks.getService().getLastCall(), Call.STATE_ACTIVE); placeAndVerifyCall(); verifyConnectionForOutgoingCall(); assertFalse(connectionService.waitForEvent( MockConnectionService.EVENT_CONNECTION_SERVICE_FOCUS_GAINED)); assertFalse(connectionService.waitForEvent( MockConnectionService.EVENT_CONNECTION_SERVICE_FOCUS_LOST)); }
Source:
public Intent getIntent(GraphData data) throws InvalidStateException { render(data); setPanAndZoom(Boolean.valueOf(mData.getConfiguration("zoom", "false")).equals(Boolean.TRUE)); String title = mRenderer.getChartTitle(); if (Graph.TYPE_BUBBLE.equals(mData.getType())) { return ChartFactory.getBubbleChartIntent(mContext, mDataset, mRenderer, title); } if (Graph.TYPE_TIME.equals(mData.getType())) { return ChartFactory.getTimeChartIntent(mContext, mDataset, mRenderer, title, getTimeFormat()); } if (Graph.TYPE_BAR.equals(mData.getType())) { return ChartFactory.getBarChartIntent(mContext, mDataset, mRenderer, BarChart.Type.DEFAULT, title); } return ChartFactory.getLineChartIntent(mContext, mDataset, mRenderer, title); }

Target:
public Intent getIntent(GraphData data) throws InvalidStateException { render(data); setPanAndZoom(Boolean.valueOf(mData.getConfiguration("zoom", "false"))); String title = mRenderer.getChartTitle(); if (Graph.TYPE_BUBBLE.equals(mData.getType())) { return ChartFactory.getBubbleChartIntent(mContext, mDataset, mRenderer, title); } if (Graph.TYPE_TIME.equals(mData.getType())) { return ChartFactory.getTimeChartIntent(mContext, mDataset, mRenderer, title, getTimeFormat()); } if (Graph.TYPE_BAR.equals(mData.getType())) { return ChartFactory.getBarChartIntent(mContext, mDataset, mRenderer, BarChart.Type.DEFAULT, title); } return ChartFactory.getLineChartIntent(mContext, mDataset, mRenderer, title); }
Source:
public IOStructGen(CommonTree tree, CTFTrace trace) { this.fTrace = trace; this.fTree = tree; }

Target:
public IOStructGen(CommonTree tree, CTFTrace trace) { fTrace = trace; fTree = tree; }
Source:
protected void deliverInternal(VoltMessage message) { assert(lockingVows()); logRxMessage(message); boolean canDeliver = m_scheduler.sequenceForReplay(message); if (message instanceof DumpMessage) { hostLog.warn("Received DumpMessage at " + CoreUtils.hsIdToString(m_hsId)); try { m_scheduler.dump(); } catch (Throwable ignore) { hostLog.warn("Failed to dump the content of the scheduler", ignore); } } if (message instanceof Iv2RepairLogRequestMessage) { handleLogRequest(message); return; } if (message instanceof Iv2RepairLogResponseMessage) { m_algo.deliver(message); return; } if (message instanceof RejoinMessage) { m_joinProducer.deliver((RejoinMessage) message); return; } m_repairLog.deliver(message); if (canDeliver) { m_scheduler.deliver(message); } }

Target:
protected void deliverInternal(VoltMessage message) { assert(lockingVows()); logRxMessage(message); boolean canDeliver = m_scheduler.sequenceForReplay(message); if (message instanceof DumpMessage) { hostLog.warn("Received DumpMessage at " + CoreUtils.hsIdToString(m_hsId)); try { m_scheduler.dump(); } catch (Throwable ignore) { hostLog.warn("Failed to dump the content of the scheduler", ignore); } } if (message instanceof Iv2RepairLogRequestMessage) { handleLogRequest(message); return; } else if (message instanceof Iv2RepairLogResponseMessage) { m_algo.deliver(message); return; } else if (message instanceof RejoinMessage) { m_joinProducer.deliver((RejoinMessage) message); return; } else if (message instanceof RepairLogTruncationMessage) { m_repairLog.deliver(message); return; } m_repairLog.deliver(message); if (canDeliver) { m_scheduler.deliver(message); } }
Source:
public Boolean evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException { if (source.eResource() != null) { ECrossReferenceAdapter adapter = CrossReferenceAdapter.getCrossReferenceAdapter(source.eResource().getResourceSet()); for (Setting setting : adapter.getNonNavigableInverseReferences(source)) { EObject notationElement = setting.getEObject(); if (notationElement instanceof Table) { Table table = (Table) notationElement; EObject parent = table.getOwner() == null ? table.getContext() : table.getOwner(); if (parent == source) { return true; } } } } return false; }

Target:
public Boolean evaluate(EObject source, IParameterValueList2 parameterValues, IFacetManager facetManager) throws DerivedTypedElementException { Collection<Setting> settings = EMFHelper.getUsages(source); if (settings != null) { for (Setting setting : settings) { EObject usingElement = setting.getEObject(); if (usingElement instanceof Table) { Table table = (Table) usingElement; EObject parent = table.getOwner() == null ? table.getContext() : table.getOwner(); if (parent == source) { return true; } } } } return false; }
Source:
public void start() { Frontend.getInstance().runAction(ActionType.TransferDiskImage, createInitParams(this.diskImage), result -> { if (result.getReturnValue().getSucceeded()) { Guid transferId = result.getReturnValue().getActionReturnValue(); Frontend.getInstance().runQuery(QueryType.GetImageTransferById, new IdQueryParameters(transferId), new AsyncQuery<QueryReturnValue>(returnValue -> { ImageTransfer imageTransfer = returnValue.getReturnValue(); initiateDownload(imageTransfer); })); } }, this); }

Target:
public void start() { Frontend.getInstance().runAction(ActionType.TransferDiskImage, null, result -> { if (result.getReturnValue().getSucceeded()) { Frontend.getInstance().runQuery(QueryType.GetImageTransferById, new IdQueryParameters(this.diskImageId), new AsyncQuery<QueryReturnValue>(returnValue -> { ImageTransfer imageTransfer = returnValue.getReturnValue(); initiateDownload(imageTransfer); })); } }, this); }
Source:
private static String getSpecifiedName( StructuralNode sn, boolean incParams, boolean dataDrivenNodesAsRegex) { String name = sn.getName(); if (sn.isDataDriven() && dataDrivenNodesAsRegex) { return DATA_DRIVEN_NODE_REGEX; } int bracketIndex = name.lastIndexOf("("); if (bracketIndex >= 0) { name = name.substring(0, bracketIndex); } int questIndex = name.indexOf("?"); if (questIndex >= 0) { if (incParams) { String params = name.substring(questIndex); name = name.substring(0, questIndex) + regexEscape(params); } else { name = name.substring(0, questIndex); } } if (name.endsWith("/")) { name = name.substring(0, name.length() - 1); } try { if (sn.getURI().getPath() == null || sn.getURI().getPath().length() == 1) { return name; } } catch (URIException e) { } int slashIndex = name.lastIndexOf('/'); if (slashIndex >= 0) { name = name.substring(slashIndex + 1); } if (sn.isLeaf()) { int colonIndex = name.indexOf(":"); if (colonIndex > 0) { name = name.substring(colonIndex + 1); } } return name; }

Target:
private static String getSpecifiedName( StructuralNode sn, boolean incParams, boolean dataDrivenNodesAsRegex) { String name = sn.getName(); if (sn.isDataDriven() && dataDrivenNodesAsRegex) { return DATA_DRIVEN_NODE_REGEX; } int bracketIndex = name.lastIndexOf("("); if (bracketIndex >= 0) { name = name.substring(0, bracketIndex); } int queryIndex = name.indexOf("?"); if (queryIndex >= 0) { if (incParams) { String params = name.substring(queryIndex); name = name.substring(0, queryIndex) + regexEscape(params); } else { name = name.substring(0, queryIndex); } } if (name.endsWith("/")) { name = name.substring(0, name.length() - 1); } try { if (sn.getURI().getPath() == null || sn.getURI().getPath().length() == 1) { return name; } } catch (URIException e) { } int slashIndex = name.lastIndexOf('/'); if (slashIndex >= 0) { name = name.substring(slashIndex + 1); } if (sn.isLeaf()) { int colonIndex = name.indexOf(":"); if (colonIndex > 0) { name = name.substring(colonIndex + 1); } } return name; }
Source:
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sample); ButterKnife.inject(this); Dart.inject(this); stringText.setText(stringExtra); intText.setText(String.valueOf(intExtra)); parcelableText.setText(String.valueOf(parcelableExtra)); optionalText.setText(String.valueOf(optionalExtra)); parcelNameText.setText(String.valueOf(parcelExtra.getName())); parcelAgeText.setText(String.valueOf(parcelExtra.getAge())); }

Target:
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_sample); ButterKnife.inject(this); Dart.inject(this); stringText.setText(stringExtra); intText.setText(String.valueOf(intExtra)); parcelableText.setText(String.valueOf(parcelableExtra)); optionalText.setText(String.valueOf(optionalExtra)); parcelText.setText(String.valueOf(parcelExtra.getName())); }
Source:
public void start() { if (mSignificantMotionSensor == null) { if (mLegacyMotionSensor != null) { mLegacyMotionSensor.start(); } return; } mStopSignificantMotionSensor = false; if (Build.VERSION.SDK_INT >= 18) { final TriggerEventListener tr = new TriggerEventListener() { @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2) @Override public void onTrigger(TriggerEvent event) { if (mStopSignificantMotionSensor) { return; } AppGlobals.guiLogInfo("Major motion detected."); LocalBroadcastManager broadcastManager = LocalBroadcastManager.getInstance(mAppContext); if (broadcastManager == null) { return; } broadcastManager.sendBroadcastSync(new Intent(ACTION_USER_MOTION_DETECTED)); mSensorManager.requestTriggerSensor(this, mSignificantMotionSensor); } }; mSensorManager.requestTriggerSensor(tr, mSignificantMotionSensor); } }

Target:
public void start() { if (mSignificantMotionSensor == null) { if (mLegacyMotionSensor != null) { mLegacyMotionSensor.start(); } return; } mStopSignificantMotionSensor = false; if (Build.VERSION.SDK_INT >= 18) { final TriggerEventListener tr = new TriggerEventListener() { @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR2) @Override public void onTrigger(TriggerEvent event) { if (mStopSignificantMotionSensor) { return; } AppGlobals.guiLogInfo("Major motion detected."); LocalBroadcastManager.getInstance(mContext).sendBroadcastSync(new Intent(ACTION_USER_MOTION_DETECTED)); mSensorManager.requestTriggerSensor(this, mSignificantMotionSensor); } }; mSensorManager.requestTriggerSensor(tr, mSignificantMotionSensor); } }
Source:
public ResponseEntity<?> handleFormPost(HttpServletRequest request, String layer, String body) throws RestException, GeoWebCacheException { final TileLayer tl; { String layerName = layer; if (layer != null) { try { tl = seeder.findTileLayer(layerName); } catch (GeoWebCacheException e) { throw new RestException(e.getMessage(), HttpStatus.BAD_REQUEST); } } else { tl = null; } } try { body = URLDecoder.decode(body, "UTF-8"); } catch (IOException e) { body = null; } if (body == null || body == "") { throw new RestException("Unable to parse form result.", HttpStatus.BAD_REQUEST); } Map<String, String> params = splitToMap(body); if (params.containsKey("list")) { if (tl == null) { throw new RestException("No layer specified", HttpStatus.BAD_REQUEST); } boolean listAllTasks = "all".equals(params.get("list")); return handleDoGet(tl, listAllTasks); } else if (params.containsKey("kill_thread")) { return handleKillThreadPost(params, tl); } else if (params.containsKey("kill_all")) { return handleKillAllThreadsPost(params, tl); } else if (params.get("minX") != null) { if (tl == null) { throw new RestException("No layer specified", HttpStatus.BAD_REQUEST); } return handleDoSeedPost(params, tl); } else { throw new RestException( "Unknown or malformed request. Please try again, somtimes the form " + "is not properly received. This frequently happens on the first POST " + "after a restart. The POST was to " + request.getRequestURI(), HttpStatus.BAD_REQUEST); } }

Target:
public ResponseEntity<?> handleFormPost(HttpServletRequest request, String layer, String body) throws RestException, GeoWebCacheException { final TileLayer tl; { String layerName = layer; if (layer != null) { try { tl = seeder.findTileLayer(layerName); } catch (GeoWebCacheException e) { throw new RestException(e.getMessage(), HttpStatus.BAD_REQUEST); } } else { tl = null; } } try { body = URLDecoder.decode(body, "UTF-8"); } catch (IOException e) { body = null; } if (body == null || body == "") { throw new RestException("Unable to parse form result.", HttpStatus.BAD_REQUEST); } Map<String, String> params = splitToMap(body); if (params.containsKey("list")) { if (tl == null) { throw new RestException("No layer specified", HttpStatus.BAD_REQUEST); } boolean listAllTasks = "all".equals(params.get("list")); return handleDoGet(tl, listAllTasks); } else if (params.containsKey("kill_thread")) { return handleKillThreadPost(params, tl); } else if (params.containsKey("kill_all")) { return handleKillAllThreadsPost(params, tl); } else if (params.get("minX") != null) { if (tl == null) { throw new RestException("No layer specified", HttpStatus.BAD_REQUEST); } return handleDoSeedPost(params, tl); } return new ResponseEntity<Object>(HttpStatus.BAD_REQUEST); }
Source:
public InputStream fetchMediaFile(String mediaFileURL) throws FormSourceException { InputStream mediaFile = mapException(() -> openRosaXMLFetcher.getFile(mediaFileURL, null)); if (mediaFile != null) { return mediaFile; } else { throw new FormSourceException(FETCH_ERROR); } }

Target:
public InputStream fetchMediaFile(String mediaFileURL) throws FormSourceException { return mapException(() -> openRosaXMLFetcher.getFile(mediaFileURL, null)); }
Source:
private void loadValidUrl() { if (mWebView != null) { if (PreferencesState.getCredentialsFromPreferences().isDemoCredentials()) { showHideWebView(false); mErrorDemoText.setText( translate(R.string.demo_page_text)); ; } else { showHideWebView(true); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setDomStorageEnabled(true); clearCookies(getActivity()); mWebView.loadUrl(url); mWebView.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); loadedFirstTime = true; } }); } } }

Target:
private void loadValidUrl() { if (mWebView != null) { if (PreferencesState.getCredentialsFromPreferences().isDemoCredentials()) { showHideWebView(false); mErrorDemoText.setTextTranslation(R.string.demo_page_text); ; } else { showHideWebView(true); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setDomStorageEnabled(true); clearCookies(getActivity()); mWebView.loadUrl(url); mWebView.setWebViewClient(new WebViewClient() { @Override public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); loadedFirstTime = true; } }); } } }
Source:
private void refreshBaseline(ResourceControllerDataProvider clusterData, Map<HelixConstants.ChangeType, Set<String>> clusterChanges, Map<String, Resource> resourceMap, final CurrentStateOutput currentStateOutput) throws HelixRebalanceException { LOG.info("Start calculating the new baseline."); _metricCollector.getMetric(WagedRebalancerMetricNames.GlobalStateReadLatencyGauge.name(), LatencyMetric.class).startMeasuringLatency(); Map<String, ResourceAssignment> currentBaseline = getBaselineAssignment(_assignmentMetadataStore, currentStateOutput, resourceMap.keySet()); _metricCollector.getMetric(WagedRebalancerMetricNames.GlobalStateReadLatencyGauge.name(), LatencyMetric.class).endMeasuringLatency(); Map<String, ResourceAssignment> newBaseline = calculateAssignment(clusterData, clusterChanges, resourceMap, clusterData.getAllInstances(), Collections.emptyMap(), currentBaseline); _metricCollector.getMetric(WagedRebalancerMetricNames.GlobalStateWriteLatencyGauge.name(), LatencyMetric.class).startMeasuringLatency(); if (_assignmentMetadataStore != null) { try { _assignmentMetadataStore.persistBaseline(newBaseline); } catch (Exception ex) { throw new HelixRebalanceException("Failed to persist the new baseline assignment.", HelixRebalanceException.Type.INVALID_REBALANCER_STATUS, ex); } } else { LOG.debug("Assignment Metadata Store is empty. Skip persist the baseline assignment."); } _metricCollector.getMetric(WagedRebalancerMetricNames.GlobalStateWriteLatencyGauge.name(), LatencyMetric.class).endMeasuringLatency(); LOG.info("Finish calculating the new baseline."); }

Target:
private void refreshBaseline(ResourceControllerDataProvider clusterData, Map<HelixConstants.ChangeType, Set<String>> clusterChanges, Map<String, Resource> resourceMap, final CurrentStateOutput currentStateOutput) throws HelixRebalanceException { LOG.info("Start calculating the new baseline."); LatencyMetric globalBaselineCalcLatency = _metricCollector.getMetric( WagedRebalancerMetricCollector.WagedRebalancerMetricNames.GlobalBaselineCalcLatencyGauge .name(), LatencyMetric.class); globalBaselineCalcLatency.startMeasuringLatency(); Map<String, ResourceAssignment> currentBaseline = getBaselineAssignment(_assignmentMetadataStore, currentStateOutput, resourceMap.keySet()); Map<String, ResourceAssignment> newBaseline = calculateAssignment(clusterData, clusterChanges, resourceMap, clusterData.getAllInstances(), Collections.emptyMap(), currentBaseline); if (_assignmentMetadataStore != null) { try { LatencyMetric writeLatency = _metricCollector.getMetric( WagedRebalancerMetricCollector.WagedRebalancerMetricNames.StateWriteLatencyGauge.name(), LatencyMetric.class); writeLatency.startMeasuringLatency(); _assignmentMetadataStore.persistBaseline(newBaseline); writeLatency.endMeasuringLatency(); } catch (Exception ex) { throw new HelixRebalanceException("Failed to persist the new baseline assignment.", HelixRebalanceException.Type.INVALID_REBALANCER_STATUS, ex); } } else { LOG.debug("Assignment Metadata Store is empty. Skip persist the baseline assignment."); } globalBaselineCalcLatency.endMeasuringLatency(); LOG.info("Finish calculating the new baseline."); }
Source:
private static void perform(Context c, Measurement m) throws IOException { FileInputStream is = new FileInputStream(Measurement.getEntryFile(c, m.id, m.test_name)); String input = new GsonBuilder().disableHtmlEscaping().create().toJson(new JsonParser().parse(new InputStreamReader(is))); is.close(); MKCollectorResubmitSettings settings = new MKCollectorResubmitSettings(); settings.setTimeout(14); settings.setCABundlePath(c.getCacheDir() + "/" + Application.CA_BUNDLE); settings.setSerializedMeasurement(input); MKCollectorResubmitResults results = settings.perform(); if (results.isGood()) { String output = results.getUpdatedSerializedMeasurement(); FileOutputStream os = new FileOutputStream(Measurement.getEntryFile(c, m.id, m.test_name)); os.write(output.getBytes()); os.close(); m.report_id = results.getUpdatedReportID(); m.is_uploaded = true; m.is_upload_failed = false; m.save(); } else { Log.w(MKCollectorResubmitSettings.class.getSimpleName(), results.getLogs()); } }

Target:
private static void perform(Context c, Measurement m) throws IOException { File file = Measurement.getEntryFile(c, m.id, m.test_name); String input = FileUtils.readFileToString(file, StandardCharsets.UTF_8); MKCollectorResubmitSettings settings = new MKCollectorResubmitSettings(); settings.setTimeout(14); settings.setCABundlePath(c.getCacheDir() + "/" + Application.CA_BUNDLE); settings.setSerializedMeasurement(input); MKCollectorResubmitResults results = settings.perform(); if (results.isGood()) { String output = results.getUpdatedSerializedMeasurement(); FileUtils.writeStringToFile(file, output, StandardCharsets.UTF_8); m.report_id = results.getUpdatedReportID(); m.is_uploaded = true; m.is_upload_failed = false; m.save(); } else { Log.w(MKCollectorResubmitSettings.class.getSimpleName(), results.getLogs()); } }
Source:
private static void writeSeparatorLine(StringBuilder buf, int[] colLengths) { for (int colIdx = 0; colIdx < colLengths.length; colIdx++) { buf.append('+'); for (int i = 0; i < colLengths[colIdx] + 2; i++) { buf.append('-'); } } buf.append("+\n"); }

Target:
private static void writeSeparatorLine(StringBuilder buf, int[] colLengths) { for (int colIdx = 0; colIdx < colLengths.length; colIdx++) { buf.append('+'); for (int i = 0; i < colLengths[colIdx] + 2; i++) { buf.append('-'); } } buf.append('+').append(LINE_SEPARATOR); }
Source:
public void doFilter( ServletRequest req, ServletResponse resp, FilterChain chain ) throws ServletException, IOException { HttpServletRequest request = (HttpServletRequest) req; String requestId = Optional.ofNullable( request.getHeader( ActionUtil.X_REQUEST_ID ) ).orElse( WorkItemLifecycleEvent.generateWorkItemId() ); try { if ( logger.isDebugEnabled() ) { logger.debug( "received request with request id of: " + requestId ); } MDC.put( ActionUtil.REQUEST_ID, requestId ); chain.doFilter( req, resp ); } finally { if ( logger.isDebugEnabled() ) { logger.debug( "Exiting request with request id of: " + requestId ); } ( (HttpServletResponse) resp ).setHeader( ActionUtil.X_REQUEST_ID, requestId ); MDC.remove( ActionUtil.X_REQUEST_ID ); } }

Target:
public void doFilter( ServletRequest req, ServletResponse resp, FilterChain chain ) throws ServletException, IOException { HttpServletRequest request = (HttpServletRequest) req; String requestId = Optional.ofNullable( request.getHeader( RequestIdUtil.X_REQUEST_ID ) ).orElse( UUID.randomUUID().toString() ); try { if ( logger.isDebugEnabled() ) { logger.debug( "received request with request id of: " + requestId ); } MDC.put( RequestIdUtil.REQUEST_ID, RequestIdUtil.getFormattedRequestUid( requestId ) ); chain.doFilter( req, resp ); } finally { if ( logger.isDebugEnabled() ) { logger.debug( "Exiting request with request id of: " + requestId ); } ( (HttpServletResponse) resp ).setHeader( RequestIdUtil.X_REQUEST_ID, requestId ); MDC.remove( RequestIdUtil.X_REQUEST_ID ); } }
Source:
public void populateDAG(DAG dag, Configuration conf) { HDFSFileSplitter fileSplitter = dag.addOperator("FileSplitter", new HDFSFileSplitter()); BlockReader blockReader = dag.addOperator("BlockReader", new BlockReader()); dag.addStream("BlockMetadata", fileSplitter.blocksMetadataOutput, blockReader.blocksMetadataInput); filesMetadataOutput.set(fileSplitter.filesMetadataOutput); blocksMetadataOutput.set(blockReader.blocksMetadataOutput); messages.set(blockReader.messages); fileSplitter.setSequencialFileRead(sequencialFileRead); if (blockSize != 0) { fileSplitter.setBlockSize(blockSize); } HDFSScanner fileScanner = (HDFSScanner)fileSplitter.getScanner(); fileScanner.setFiles(files); if (scanIntervalMillis != 0) { fileScanner.setScanIntervalMillis(scanIntervalMillis); } fileScanner.setRecursive(recursive); if (filePatternRegularExp != null) { fileSplitter.getScanner().setFilePatternRegularExp(filePatternRegularExp); } blockReader.setUri(files); if (readersCount != 0) { dag.setAttribute(blockReader, Context.OperatorContext.PARTITIONER, new StatelessPartitioner<BlockReader>(readersCount)); } MetricsAggregator blockReaderMetrics = new MetricsAggregator(); blockReaderMetrics.addAggregators("bytesReadPerSec", new SingleMetricAggregator[] {new LongSumAggregator()}); dag.setAttribute(blockReader, Context.OperatorContext.METRICS_AGGREGATOR, blockReaderMetrics); dag.setAttribute(blockReader, Context.OperatorContext.COUNTERS_AGGREGATOR, new BasicCounters.LongAggregator<MutableLong>()); }

Target:
public void populateDAG(DAG dag, Configuration conf) { HDFSFileSplitter fileSplitter = dag.addOperator("FileSplitter", new HDFSFileSplitter()); BlockReader blockReader = dag.addOperator("BlockReader", new BlockReader()); dag.addStream("BlockMetadata", fileSplitter.blocksMetadataOutput, blockReader.blocksMetadataInput); filesMetadataOutput.set(fileSplitter.filesMetadataOutput); blocksMetadataOutput.set(blockReader.blocksMetadataOutput); messages.set(blockReader.messages); fileSplitter.setSequencialFileRead(sequencialFileRead); if (blockSize != 0) { fileSplitter.setBlockSize(blockSize); } HDFSScanner fileScanner = (HDFSScanner)fileSplitter.getScanner(); fileScanner.setFiles(files); if (scanIntervalMillis != 0) { fileScanner.setScanIntervalMillis(scanIntervalMillis); } fileScanner.setRecursive(recursive); if (filePatternRegularExp != null) { fileSplitter.getScanner().setFilePatternRegularExp(filePatternRegularExp); } blockReader.setUri(files); if (readersCount != 0) { dag.setAttribute(blockReader, Context.OperatorContext.PARTITIONER, new StatelessPartitioner<BlockReader>(readersCount)); } }
Source:
private void addUnresolvedVMArgs (List<String> lines) { int startIndex = lines.indexOf(VMARG_ADD_OPENS); if (startIndex != -1) { for (int i = startIndex; i < lines.size(); i++) { if (lines.get(i).contains("ALL-UNNAMED") && !lines.get(i-1).contains("--add-opens")) { lines.add(i, VMARG_ADD_OPENS); } } } }

Target:
private void addUnresolvedVMArgs(List<String> lines) { int startIndex = lines.indexOf(VMARG_ADD_OPENS); if (startIndex != -1) { for (int i = startIndex; i < lines.size(); i++) { if (lines.get(i).contains(VMARG_ALL_UNNAMED) && !lines.get(i-1).startsWith(VMARG_ADD_OPENS)) { lines.add(i, VMARG_ADD_OPENS); } } } }
Source:
public LoginAttemptResultReporter checkIsLockedOut(long userId) { UnsuccessfulLoginLockoutDTO lockoutInfo = unsuccessfulLoginLockoutDAO.getUnsuccessfulLoginLockoutInfoIfExist(userId) .orElseGet(() -> new UnsuccessfulLoginLockoutDTO(userId)); final long databaseTime = unsuccessfulLoginLockoutDAO.getDatabaseTimestampMillis(); if (databaseTime < lockoutInfo.getLockoutExpiration()){ throw new UnsuccessfulLoginLockoutException( databaseTime, lockoutInfo.getLockoutExpiration(), lockoutInfo.getUnsuccessfulLoginCount()); } return new ExponentialBackoffLoginAttemptReporter(lockoutInfo, unsuccessfulLoginLockoutDAO); }

Target:
public LoginAttemptResultReporter checkIsLockedOut(long userId) { Optional<UnsuccessfulLoginLockoutDTO> dtoOptional = unsuccessfulLoginLockoutDAO.getUnsuccessfulLoginLockoutInfoIfExist(userId); UnsuccessfulLoginLockoutDTO lockoutInfo; if (dtoOptional.isPresent()) { lockoutInfo = dtoOptional.get(); } else { lockoutInfo = new UnsuccessfulLoginLockoutDTO(userId); } final long databaseTime = unsuccessfulLoginLockoutDAO.getDatabaseTimestampMillis(); if (databaseTime < lockoutInfo.getLockoutExpiration()){ throw new UnsuccessfulLoginLockoutException( databaseTime, lockoutInfo.getLockoutExpiration(), lockoutInfo.getUnsuccessfulLoginCount()); } return new ExponentialBackoffLoginAttemptReporter(lockoutInfo, unsuccessfulLoginLockoutDAO); }
Source:
public void prepareReceived(final ChannelHandlerContext ctx, MessageEvent evt) throws Exception { final PrepareMessage prepare = (PrepareMessage) evt.getMessage(); String version = prepare.getVersion(); if (!"2.0".equals(version)) { sendVersionError(ctx); return; } List<String> scriptNames = prepare.getNames(); if (logger.isDebugEnabled()) { logger.debug("preparing script(s) " + scriptNames); } robot = new Robot(); whenAbortedOrFinished = whenAbortedOrFinished(ctx); ChannelFuture prepareFuture; try { final String aggregatedScript = aggregateScript(scriptNames, scriptLoader); if (scriptLoader != null) { Thread currentThread = currentThread(); ClassLoader contextClassLoader = currentThread.getContextClassLoader(); try { currentThread.setContextClassLoader(scriptLoader); prepareFuture = robot.prepare(aggregatedScript.toString()); } finally { currentThread.setContextClassLoader(contextClassLoader); } } else { prepareFuture = robot.prepare(aggregatedScript.toString()); } prepareFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(final ChannelFuture f) { PreparedMessage prepared = new PreparedMessage(); prepared.setScript(aggregatedScript); prepared.getBarriers().addAll(robot.getBarriersByName().keySet()); Channels.write(ctx, Channels.future(null), prepared); } }); } catch (Exception e) { sendErrorMessage(ctx, e); return; } }

Target:
public void prepareReceived(final ChannelHandlerContext ctx, MessageEvent evt) throws Exception { final PrepareMessage prepare = (PrepareMessage) evt.getMessage(); String version = prepare.getVersion(); if (!"2.0".equals(version)) { sendVersionError(ctx); return; } List<String> scriptNames = prepare.getNames(); if (logger.isDebugEnabled()) { logger.debug("preparing script(s) " + scriptNames); } robot = new Robot(); whenAbortedOrFinished = whenAbortedOrFinished(ctx); ChannelFuture prepareFuture; try { final String aggregatedScript = aggregateScript(scriptNames, scriptLoader); if (scriptLoader != null) { Thread currentThread = currentThread(); ClassLoader contextClassLoader = currentThread.getContextClassLoader(); try { currentThread.setContextClassLoader(scriptLoader); prepareFuture = robot.prepare(aggregatedScript); } finally { currentThread.setContextClassLoader(contextClassLoader); } } else { prepareFuture = robot.prepare(aggregatedScript); } prepareFuture.addListener(new ChannelFutureListener() { @Override public void operationComplete(final ChannelFuture f) { PreparedMessage prepared = new PreparedMessage(); prepared.setScript(aggregatedScript); prepared.getBarriers().addAll(robot.getBarriersByName().keySet()); Channels.write(ctx, Channels.future(null), prepared); } }); } catch (Exception e) { sendErrorMessage(ctx, e); return; } }
Source:
public static void report(Saveable obj, String version) { OldDataMonitor odm = get(Jenkins.getInstance()); try { SaveableReference ref = referTo(obj); while (true) { VersionRange vr = odm.data.get(ref); if (vr != null) { vr.add(version); break; } else if (odm.data.putIfAbsent(ref, new VersionRange(version, null)) == null) { break; } } } catch (IllegalArgumentException ex) { LOGGER.log(Level.WARNING, "Bad parameter given to OldDataMonitor", ex); } }

Target:
public static void report(Saveable obj, String version) { OldDataMonitor odm = get(Jenkins.getInstance()); try { SaveableReference ref = referTo(obj); while (true) { VersionRange vr = odm.data.get(ref); if (vr != null && odm.data.replace(ref, vr, new VersionRange(vr, version, null))) { break; } else if (odm.data.putIfAbsent(ref, new VersionRange(null, version, null)) == null) { break; } } } catch (IllegalArgumentException ex) { LOGGER.log(Level.WARNING, "Bad parameter given to OldDataMonitor", ex); } }
Source:
public Crypter(String keysetFileName) throws CrypterException { String keysetLocation = Paths.get(keysetDir, keysetFileName + KEYSET_FILE_EXTENSION).toString(); synchronized (Crypter.class) { File keysetFile = new File(keysetLocation); try { AeadConfig.register(); if (!keysetFile.exists()) { keysetHandle = initKeysetHandle(keysetFile); } else { keysetHandle = readKeysetHandle(keysetFile); } aead = AeadFactory.getPrimitive(keysetHandle); associatedData = getAssociatedData(keysetHandle); } catch (GeneralSecurityException | IOException e) { LOGGER.warn("Problem initializing keyset."); throw new CrypterException("Problem initializing keyset", e); } } }

Target:
public Crypter(String keysetFileName) throws CrypterException { String keysetLocation = Paths.get(keysetDir, keysetFileName + KEYSET_FILE_EXTENSION).toString(); synchronized (Crypter.class) { File keysetFile = new File(keysetLocation); try { AeadConfig.register(); if (!keysetFile.exists()) { keysetHandle = initKeysetHandle(keysetFile); } else { keysetHandle = readKeysetHandle(keysetFile); } aead = AeadFactory.getPrimitive(keysetHandle); associatedData = getAssociatedData(); } catch (GeneralSecurityException | IOException e) { LOGGER.warn("Problem initializing keyset."); throw new CrypterException("Problem initializing keyset", e); } } }
Source:
public InputStream writeObject(final VelocityResourceKey key) throws DotStateException, DotDataException, DotSecurityException { long language = new Long(key.language); ContentletVersionInfo info = APILocator.getVersionableAPI().getContentletVersionInfo(key.id1, language); if (isLiveVersionNotAvailable(key, info) && language != defaultLang && APILocator.getLanguageAPI().canDefaultContentToDefaultLanguage()) { info = APILocator.getVersionableAPI().getContentletVersionInfo(key.id1, defaultLang); } if (isLiveVersionNotAvailable(key, info)) { throw new ResourceNotFoundException("cannot find content for: " + key); } Contentlet contentlet = (key.mode.showLive) ? APILocator.getContentletAPI().find(info.getLiveInode(), APILocator.systemUser(), false) : APILocator.getContentletAPI().find(info.getWorkingInode(), APILocator.systemUser(), false); Logger.debug(this, "DotResourceLoader:\tWriting out contentlet inode = " + contentlet.getInode()); if (null == contentlet) { throw new ResourceNotFoundException("cannot find content for: " + key); } return buildVelocity(contentlet, key.mode, key.path); }

Target:
public InputStream writeObject(final VelocityResourceKey key) throws DotStateException, DotDataException, DotSecurityException { long language = new Long(key.language); ContentletVersionInfo info = APILocator.getVersionableAPI().getContentletVersionInfo(key.id1, language); if (isLiveVersionNotAvailable(key, info) && shouldCheckForVersionInfoInDefaultLanguage( language)) { info = APILocator.getVersionableAPI().getContentletVersionInfo(key.id1, defaultLang); } if (isLiveVersionNotAvailable(key, info)) { throw new ResourceNotFoundException("cannot find content for: " + key); } Contentlet contentlet = (key.mode.showLive) ? APILocator.getContentletAPI().find(info.getLiveInode(), APILocator.systemUser(), false) : APILocator.getContentletAPI().find(info.getWorkingInode(), APILocator.systemUser(), false); Logger.debug(this, "DotResourceLoader:\tWriting out contentlet inode = " + contentlet.getInode()); if (null == contentlet) { throw new ResourceNotFoundException("cannot find content for: " + key); } return buildVelocity(contentlet, key.mode, key.path); }
Source:
public Mutex getMutexForClientSession(final String sessionId) { Assert.requireNonBlank(sessionId, "sessionId"); WeakReference<Mutex> mutexReference = sessionMutexMap.get(sessionId); Assert.requireNonNull(mutexReference, "mutexReference"); return mutexReference.get(); }

Target:
public Mutex getMutexForClientSession(final String sessionId) { Assert.requireNonBlank(sessionId, "sessionId"); final WeakReference<Mutex> mutexReference = sessionMutexMap.get(sessionId); Assert.requireNonNull(mutexReference, "mutexReference"); return mutexReference.get(); }
Source:
public JudgmentWithCorrectionList<CommonCourtJudgment> processJudgment(SourceCcJudgment sourceCcJudgment) { JudgmentWithCorrectionList<CommonCourtJudgment> judgmentWithCorrectionList = sourceCcJudgmentConverter.convertJudgment(sourceCcJudgment); CommonCourtJudgment ccJudgment = judgmentWithCorrectionList.getJudgment(); CommonCourtJudgment oldJudgment = ccJudgmentRepository.findOneBySourceCodeAndSourceJudgmentId(ccJudgment.getSourceInfo().getSourceCode(), ccJudgment.getSourceInfo().getSourceJudgmentId()); if (oldJudgment != null) { judgmentOverwriter.overwriteJudgment(oldJudgment, ccJudgment, judgmentWithCorrectionList.getCorrectionList()); List<EnrichmentTag> judgmentEnrichmentTags = enrichmentTagRepository.findAllByJudgmentId(oldJudgment.getId()); enrichmentTagRepository.delete(judgmentEnrichmentTags); judgmentWithCorrectionList.setJudgment(oldJudgment); } return judgmentWithCorrectionList; }

Target:
public JudgmentWithCorrectionList<CommonCourtJudgment> processJudgment(SourceCcJudgment sourceCcJudgment) { JudgmentWithCorrectionList<CommonCourtJudgment> judgmentWithCorrectionList = sourceCcJudgmentConverter.convertJudgment(sourceCcJudgment); CommonCourtJudgment ccJudgment = judgmentWithCorrectionList.getJudgment(); CommonCourtJudgment oldJudgment = ccJudgmentRepository.findOneBySourceCodeAndSourceJudgmentId(ccJudgment.getSourceInfo().getSourceCode(), ccJudgment.getSourceInfo().getSourceJudgmentId()); if (oldJudgment != null) { judgmentOverwriter.overwriteJudgment(oldJudgment, ccJudgment, judgmentWithCorrectionList.getCorrectionList()); enrichmentTagRepository.deleteAllByJudgmentId(oldJudgment.getId()); judgmentWithCorrectionList.setJudgment(oldJudgment); } return judgmentWithCorrectionList; }
Source:
public int hashCode() { return key.hashCode() ^ value.hashCode(); }

Target:
public int hashCode() { return key.hashCode(); }
Source:
private boolean isInvalidHost(UriTemplate template) { Map<String, Object> uriKeysWithEmptyValues = Arrays.asList(template.getVariables()).stream().collect(toMap(v -> v, v -> "empty")); return URI.create(template.expand(uriKeysWithEmptyValues)).getHost() == null; }

Target:
private boolean isInvalidHost(UriTemplate template) { Map<String, Object> uriKeysWithEmptyValues = asList(template.getVariables()).stream().collect(toMap(identity(), v -> "empty")); return URI.create(template.expand(uriKeysWithEmptyValues)).getHost() == null; }
Source:
public static boolean isLocal(String domain, Properties configuration, Set<String> localDomains) { if (configuration == null) { return false; } String command = configuration.getProperty( Configuration.CONFIGURATION_LOCAL_DOMAIN_CHECKER); if (command == null) { String serverDomain = configuration .getProperty(Configuration.CONFIGURATION_SERVER_DOMAIN); String topicDomain = configuration .getProperty(Configuration.CONFIGURATION_SERVER_TOPICS_DOMAIN); String channelDomain = configuration .getProperty(Configuration.CONFIGURATION_SERVER_CHANNELS_DOMAIN); return (domain.equals(serverDomain) || domain.equals(topicDomain) || domain.equals(channelDomain)); } if (command.equals(Boolean.TRUE.toString())) { return true; } if (localDomains == null) { try { localDomains = getLocalDomains(configuration); } catch (Exception e) { return false; } } return localDomains.contains(domain); }

Target:
public static boolean isLocal(String domain, Properties configuration, Set<String> localDomains) { if (configuration == null) { return false; } String command = configuration.getProperty( Configuration.CONFIGURATION_LOCAL_DOMAIN_CHECKER); if (command == null) { String serverDomain = configuration .getProperty(Configuration.CONFIGURATION_SERVER_DOMAIN); String topicDomain = configuration .getProperty(Configuration.CONFIGURATION_SERVER_TOPICS_DOMAIN); String channelDomain = configuration .getProperty(Configuration.CONFIGURATION_SERVER_CHANNELS_DOMAIN); return (domain.equals(serverDomain) || domain.equals(topicDomain) || domain.equals(channelDomain)); } if (command.equals(Boolean.TRUE.toString())) { return true; } if (localDomains == null) { try { localDomains = getLocalDomains(configuration); } catch (Exception e) { return false; } } return localDomains.contains(domain.toLowerCase()); }
Source:
public RecordCursor getCursor(SqlExecutionContext executionContext) { cursor.of(reader, columnName); return cursor; }

Target:
public RecordCursor getCursor(SqlExecutionContext executionContext) { TableReader reader = engine.getReader(executionContext.getCairoSecurityContext(), tableName, tableVersion); cursor.of(reader, columnIndex); return cursor; }
Source:
public void onPermissionResult(boolean granted) { Style style = mapboxMap.getStyle(); if (granted && style != null) { displayDeviceLocation(style); } else { Toast.makeText(this, R.string.user_location_permission_not_granted, Toast.LENGTH_LONG).show(); finish(); } }

Target:
public void onPermissionResult(boolean granted) { mapboxMap.getStyle(new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { if (granted) { displayDeviceLocation(style); } else { Toast.makeText(ElevationQueryActivity.this, R.string.user_location_permission_not_granted, Toast.LENGTH_LONG).show(); finish(); } } }); }
Source:
public JsonElement serialize(Token src, Type typeOfSrc, JsonSerializationContext context) { JsonObject object = new JsonObject(); object.addProperty(MEMBER_ACCESS_TOKEN, src.accessToken); if (src.error != null) { object.addProperty(MEMBER_ERROR, src.error.code); } return object; }

Target:
public JsonElement serialize(Token src, Type typeOfSrc, JsonSerializationContext context) { JsonObject object = new JsonObject(); if (src.error != null) { object.addProperty(MEMBER_ERROR, src.error.code); } else { object.addProperty(MEMBER_ACCESS_TOKEN, src.accessToken); } return object; }
Source:
public BindingSetDecorator(final BindingSet set) { this.set = set; }

Target:
public BindingSetDecorator(final BindingSet set) { this.set = checkNotNull(set); }