auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void eventDispatched(IExitedDMEvent e) { IDMContext dmc = e.getDMContext(); boolean restarting = fProcRestarting.contains(dmc); if (!restarting && dmc instanceof IContainerDMContext) { MIBreakpointsManager bpService = getServicesTracker().getService(MIBreakpointsManager.class); bpService.removeTargetFilter((IContainerDMContext) dmc); } if (dmc instanceof IBreakpointsTargetDMContext) { if (!fProcRestarting.remove(dmc)) { if (fBackend.getSessionType() != SessionType.CORE) { IBreakpointsTargetDMContext bpTargetDmc = (IBreakpointsTargetDMContext)dmc; MIBreakpointsManager bpmService = getServicesTracker().getService(MIBreakpointsManager.class); if (bpmService != null) { bpmService.stopTrackingBreakpoints(bpTargetDmc, new ImmediateRequestMonitor() { @Override protected void handleCompleted() { } }); } } } } super.eventDispatched(e); }

Target:
public void eventDispatched(IExitedDMEvent e) { IDMContext dmc = e.getDMContext(); if (dmc instanceof IContainerDMContext) { MIBreakpointsManager bpmService = getServicesTracker().getService(MIBreakpointsManager.class); boolean restarting = fProcRestarting.remove(dmc); if (bpmService != null) { if (!restarting) { bpmService.removeTargetFilter((IContainerDMContext) dmc); if (dmc instanceof IBreakpointsTargetDMContext) { if (fBackend.getSessionType() != SessionType.CORE) { IBreakpointsTargetDMContext bpTargetDmc = (IBreakpointsTargetDMContext) dmc; bpmService.stopTrackingBreakpoints(bpTargetDmc, new ImmediateRequestMonitor() { @Override protected void handleCompleted() { } }); } } } } } super.eventDispatched(e); }
Source:
private Optional<IdentifiedVersion> processEventLogUpdate(LockWatchStateUpdate update) { Optional<IdentifiedVersion> currentVersion = eventLog.getLatestKnownVersion(); Optional<IdentifiedVersion> latestVersion = eventLog.processUpdate(update); if (!(latestVersion.isPresent() && currentVersion.isPresent() && latestVersion.get().id().equals(currentVersion.get().id()) && update.accept(SuccessVisitor.INSTANCE))) { timestampMap.clear(); } return latestVersion; }

Target:
private Optional<IdentifiedVersion> processEventLogUpdate(LockWatchStateUpdate update) { CacheUpdate cacheUpdate = eventLog.processUpdate(update); if (cacheUpdate.shouldClearCache()) { timestampStateStore.clear(); } return cacheUpdate.getVersion(); }
Source:
public static boolean setLockscreenBackground() { return prefs.getBoolean(PREF_LOCKSCREEN_BACKGROUND, false); }

Target:
public static boolean setLockscreenBackground() { return prefs.getBoolean(PREF_LOCKSCREEN_BACKGROUND, true); }
Source:
private boolean createNewLogFile() { if (!outputDirectory.exists()) { if (!outputDirectory.mkdirs()) { new RobobuggyLogicNotification("Couldn't create logs folder!", RobobuggyMessageLevel.EXCEPTION); return false; } if (!outputDirectory.isDirectory()) { new RobobuggyLogicNotification("Output directory path isn't a folder!", RobobuggyMessageLevel.EXCEPTION); return false; } } Date logCreationDate = new Date(); outputDirectory = new File(RobobuggyConfigFile.LOG_FILE_LOCATION + "/" + formatDateIntoFile(logCreationDate)); if (!outputDirectory.mkdirs()) { new RobobuggyLogicNotification("Couldn't create log's container!", RobobuggyMessageLevel.EXCEPTION); return false; } outputFile = new File(outputDirectory.getPath() + "/" + RobobuggyConfigFile.LOG_FILE_NAME + "_" + formatDateIntoFile(logCreationDate) + ".txt") ; try { if (!outputFile.createNewFile()) { new RobobuggyLogicNotification("Couldn't create log file!", RobobuggyMessageLevel.EXCEPTION); return false; } } catch (IOException e) { new RobobuggyLogicNotification("Error reading the filesystem!", RobobuggyMessageLevel.EXCEPTION); return false; } return true; }

Target:
private boolean createNewLogFile() { Date logCreationDate = new Date(); outputDirectory = new File(RobobuggyConfigFile.LOG_FILE_LOCATION + "/" + formatDateIntoFile(logCreationDate)); if (!outputDirectory.mkdirs()) { new RobobuggyLogicNotification("Couldn't create log's container!", RobobuggyMessageLevel.EXCEPTION); return false; } outputFile = new File(outputDirectory.getPath() + "/" + RobobuggyConfigFile.LOG_FILE_NAME + "_" + formatDateIntoFile(logCreationDate) + ".txt") ; try { if (!outputFile.createNewFile()) { new RobobuggyLogicNotification("Couldn't create log file!", RobobuggyMessageLevel.EXCEPTION); return false; } } catch (IOException e) { new RobobuggyLogicNotification("Error reading the filesystem!", RobobuggyMessageLevel.EXCEPTION); return false; } return true; }
Source:
LoadElasticsearch(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(config, parent, child, context); elapsedTime = getTimer(Metrics.ELAPSED_TIME); Config elasticsearchConfig = getConfigs().getConfig(config, ELASTICSEARCH_CONFIGURATION); String loaderType = config.getString(DOCUMENT_LOADER_TYPE); indexName = config.getString(COLLECTION); indexType = config.getString(TYPE); ttl = config.getInt(TTL); DocumentLoaderFactory documentLoaderFactory = new DocumentLoaderFactory(); try { loader = documentLoaderFactory.getClient(loaderType, elasticsearchConfig); } catch (NoSuchDocumentLoaderException e) { throw new MorphlineRuntimeException(e); } }

Target:
LoadElasticsearch(CommandBuilder builder, Config config, Command parent, Command child, MorphlineContext context) { super(builder, config, parent, child, context); elapsedTime = getTimer(Metrics.ELAPSED_TIME); Config elasticsearchConfig = getConfigs().getConfig(config, ELASTICSEARCH_CONFIGURATION); String loaderType = getConfigs().getString(config, DOCUMENT_LOADER_TYPE); indexName = getConfigs().getString(config, COLLECTION); indexType = getConfigs().getString(config, TYPE); ttl = getConfigs().getInt(config, TTL); validateArguments(); DocumentLoaderFactory documentLoaderFactory = new DocumentLoaderFactory(); try { loader = documentLoaderFactory.getClient(loaderType, elasticsearchConfig); } catch (IllegalArgumentException e) { throw new MorphlineRuntimeException(e); } }
Source:
public Response getContentTypeFieldByVar(@PathParam("typeId") final String typeId, @PathParam("fieldVar") final String fieldVar, @Context final HttpServletRequest req) throws DotDataException, DotSecurityException { Response response = null; try { Field field = fieldAPI.byContentTypeIdAndVar(typeId, fieldVar); response = Response.ok(new ResponseEntityView(new JsonFieldTransformer(field).mapObject())).build(); } catch (Exception e) { response = ResponseUtil.mapExceptionResponse(e); } return response; }

Target:
public Response getContentTypeFieldByVar(@PathParam("typeId") final String typeId, @PathParam("fieldVar") final String fieldVar, @Context final HttpServletRequest req) throws DotDataException, DotSecurityException { this.webResource.init(null, false, req, false, null); Response response = null; try { final Field field = fieldAPI.byContentTypeIdAndVar(typeId, fieldVar); response = Response.ok(new ResponseEntityView(new JsonFieldTransformer(field).mapObject())).build(); } catch (Exception e) { response = ResponseUtil.mapExceptionResponse(e); } return response; }
Source:
public static boolean verifyBucketsSupport(final ConfigContext config, final MantaClient client) { AtomicBoolean isBucketsSupported = new AtomicBoolean(); try { String path = String.format("%s/buckets", config.getMantaHomeDirectory()); client.get(path); isBucketsSupported.set(true); } catch (IOException io) { isBucketsSupported.set(false); } return isBucketsSupported.get(); }

Target:
private static boolean verifyBucketsSupport(final ConfigContext config, final MantaClient client) throws IOException { try { String path = String.format("%s%sbuckets", config.getMantaHomeDirectory(), MantaClient.SEPARATOR); client.options(path); } catch (MantaClientHttpResponseException me) { if (MantaErrorCode.RESOURCE_NOT_FOUND_ERROR.equals(me.getServerCode())) { return false; } } return true; }
Source:
private CompletableFuture<Object> futureInvoke(final Message request, Function<Message, Object> fn) throws Exception { ResponseFuture responseFuture = new ResponseFuture(fn); futures.putIfAbsent(responseFuture.correlationId(), responseFuture); Message requestMessage = composeRequest(request, responseFuture.correlationId()); CompletableFuture<Void> sendFuture = sendRemote(requestMessage); sendFuture.whenComplete((success, error) -> { if (error != null) { ResponseFuture future = futures.remove(requestMessage.correlationId()); LOGGER.debug("cid send remote service request message failed , error {}", requestMessage.correlationId(), requestMessage, error); future.completeExceptionally(error); } }); return responseFuture.future(); }

Target:
private CompletableFuture<Object> futureInvoke(final Message request, Function<Message, Object> fn) throws Exception { ResponseFuture responseFuture = new ResponseFuture(fn); Message requestMessage = composeRequest(request, responseFuture.correlationId()); CompletableFuture<Void> sendFuture = sendRemote(requestMessage); sendFuture.whenComplete((success, error) -> { if (error != null) { LOGGER.debug("cid send remote service request message failed , error {}", requestMessage.correlationId(), requestMessage, error); Optional<ResponseFuture> future = ResponseFuture.get(requestMessage.correlationId()); if (future.isPresent()) { future.get().completeExceptionally(error); } } }); return responseFuture.future(); }
Source:
int computeHeightDifference (GtkRequisition requisition, int height) { int diffheight; diffheight = requisition.height - height; if (height - diffheight < 0) { return requisition.height; } else { return height; } }

Target:
int computeHeightDifference (GtkRequisition requisition, int height) { return (requisition.height - height) < 0 ? requisition.height : height; }
Source:
private void onSimRefresh(AsyncResult ar, Integer index) { if (ar.exception != null) { Rlog.e(LOG_TAG, "Sim REFRESH with exception: " + ar.exception); return; } if (!isValidCardIndex(index)) { Rlog.e(LOG_TAG,"onSimRefresh: invalid index : " + index); return; } IccRefreshResponse resp = (IccRefreshResponse) ar.result; Rlog.d(LOG_TAG, "onSimRefresh: " + resp); if (resp == null) { Rlog.e(LOG_TAG, "onSimRefresh: received without input"); return; } if (mUiccCards[index] == null) { Rlog.e(LOG_TAG,"onSimRefresh: refresh on null card : " + index); return; } Rlog.d(LOG_TAG, "Handling refresh: " + resp); boolean changed = false; switch(resp.refreshResult) { case IccRefreshResponse.REFRESH_RESULT_RESET: case IccRefreshResponse.REFRESH_RESULT_INIT: changed = mUiccCards[index].resetAppWithAid(resp.aid); break; default: return; } if (changed && resp.refreshResult == IccRefreshResponse.REFRESH_RESULT_RESET) { boolean requirePowerOffOnSimRefreshReset = mContext.getResources().getBoolean( com.android.internal.R.bool.config_requireRadioPowerOffOnSimRefreshReset); if (requirePowerOffOnSimRefreshReset) { mCis[index].setRadioPower(false, null); } } mCis[index].getIccCardStatus(obtainMessage(EVENT_GET_ICC_STATUS_DONE)); mIccChangedRegistrants.notifyRegistrants(new AsyncResult(null, index, null)); }

Target:
private void onSimRefresh(AsyncResult ar, Integer index) { if (ar.exception != null) { Rlog.e(LOG_TAG, "Sim REFRESH with exception: " + ar.exception); return; } if (!isValidCardIndex(index)) { Rlog.e(LOG_TAG,"onSimRefresh: invalid index : " + index); return; } IccRefreshResponse resp = (IccRefreshResponse) ar.result; Rlog.d(LOG_TAG, "onSimRefresh: " + resp); if (resp == null) { Rlog.e(LOG_TAG, "onSimRefresh: received without input"); return; } if (mUiccCards[index] == null) { Rlog.e(LOG_TAG,"onSimRefresh: refresh on null card : " + index); return; } Rlog.d(LOG_TAG, "Handling refresh: " + resp); boolean changed = false; switch(resp.refreshResult) { case IccRefreshResponse.REFRESH_RESULT_RESET: case IccRefreshResponse.REFRESH_RESULT_INIT: changed = mUiccCards[index].resetAppWithAid(resp.aid); break; default: return; } if (changed && resp.refreshResult == IccRefreshResponse.REFRESH_RESULT_RESET) { boolean requirePowerOffOnSimRefreshReset = mContext.getResources().getBoolean( com.android.internal.R.bool.config_requireRadioPowerOffOnSimRefreshReset); if (requirePowerOffOnSimRefreshReset) { mCis[index].setRadioPower(false, null); } } mCis[index].getIccCardStatus(obtainMessage(EVENT_GET_ICC_STATUS_DONE, index)); }
Source:
private void scanProjectTypes() { projectTypes = new ArrayList<>(); ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false); scanner.addIncludeFilter(new AnnotationTypeFilter(ProjectType.class)); for (BeanDefinition bd : scanner.findCandidateComponents("de.tudarmstadt.ukp")) { try { Class<?> clazz = (Class<?>) Class.forName(bd.getBeanClassName()); ProjectType pt = clazz.getAnnotation(ProjectType.class); if (projectTypes.stream().anyMatch(t -> t.id().equals(pt.id()))) { log.debug("Ignoring duplicate project type: ({})", pt.id(), pt.prio()); } else { log.debug("Found project type: ({})", pt.id(), pt.prio()); projectTypes.add(pt); } } catch (ClassNotFoundException e) { log.error("Class not found", bd.getBeanClassName(), e); } } projectTypes.sort((a, b) -> { return a.prio() - b.prio(); }); }

Target:
private void scanProjectTypes() { projectTypes = new ArrayList<>(); ClassPathScanningCandidateComponentProvider scanner = new ClassPathScanningCandidateComponentProvider(false); scanner.addIncludeFilter(new AnnotationTypeFilter(ProjectType.class)); for (BeanDefinition bd : scanner.findCandidateComponents("de.tudarmstadt.ukp")) { try { Class<?> clazz = (Class<?>) Class.forName(bd.getBeanClassName()); ProjectType pt = clazz.getAnnotation(ProjectType.class); if (projectTypes.stream().anyMatch(t -> t.id().equals(pt.id()))) { log.debug("Ignoring duplicate project type: ({})", pt.id(), pt.prio()); } else { log.debug("Found project type: ({})", pt.id(), pt.prio()); projectTypes.add(pt); } } catch (ClassNotFoundException e) { log.error("Class not found", bd.getBeanClassName(), e); } } projectTypes.sort(Comparator.comparingInt(ProjectType::prio)); }
Source:
private void updateGMFFontStyle(View view, BasicLabelStyle basicLabelStyle) { FontStyle fontStyle = (FontStyle) createOrFindStyle(view, NotationPackage.eINSTANCE.getFontStyle()); List<FontFormat> labelFormat = basicLabelStyle.getLabelFormat(); if (labelFormat == null) { fontStyle.setBold(false); fontStyle.setItalic(false); fontStyle.setUnderline(false); fontStyle.setStrikeThrough(false); } else { for (FontFormat fontFormat : labelFormat) { switch (fontFormat.getValue()) { case FontFormat.BOLD: fontStyle.setBold(true); break; case FontFormat.ITALIC: fontStyle.setItalic(true); break; case FontFormat.UNDERLINE: fontStyle.setUnderline(true); break; case FontFormat.STRIKE_THROUGH: fontStyle.setStrikeThrough(true); break; default: break; } } } fontStyle.setFontHeight(basicLabelStyle.getLabelSize()); if (fontStyle.getFontName() == null) { fontStyle.setFontName(DEFAULT_FONT_STYLE); } RGBValues labelColor = basicLabelStyle.getLabelColor(); if (labelColor != null) { fontStyle.setFontColor(FigureUtilities.RGBToInteger(new RGB(labelColor.getRed(), labelColor.getGreen(), labelColor.getBlue()))); } }

Target:
private void updateGMFFontStyle(View view, BasicLabelStyle basicLabelStyle) { FontStyle fontStyle = (FontStyle) createOrFindStyle(view, NotationPackage.eINSTANCE.getFontStyle()); List<FontFormat> labelFormat = basicLabelStyle.getLabelFormat(); fontStyle.setBold(false); fontStyle.setItalic(false); fontStyle.setUnderline(false); fontStyle.setStrikeThrough(false); for (FontFormat fontFormat : labelFormat) { switch (fontFormat.getValue()) { case FontFormat.BOLD: fontStyle.setBold(true); break; case FontFormat.ITALIC: fontStyle.setItalic(true); break; case FontFormat.UNDERLINE: fontStyle.setUnderline(true); break; case FontFormat.STRIKE_THROUGH: fontStyle.setStrikeThrough(true); break; default: break; } } fontStyle.setFontHeight(basicLabelStyle.getLabelSize()); if (fontStyle.getFontName() == null) { fontStyle.setFontName(DEFAULT_FONT_STYLE); } RGBValues labelColor = basicLabelStyle.getLabelColor(); if (labelColor != null) { fontStyle.setFontColor(FigureUtilities.RGBToInteger(new RGB(labelColor.getRed(), labelColor.getGreen(), labelColor.getBlue()))); } }
Source:
protected void setSchema(final String schema) throws DatabaseEngineException { try { this.conn.setSchema(schema); } catch (Exception e) { throw new DatabaseEngineException(String.format("Could not set current schema to '%s'", schema), e); } }

Target:
protected void setSchema(final String schema) throws DatabaseEngineException { try { this.conn.setSchema(schema); } catch (final Exception e) { throw new DatabaseEngineException(String.format("Could not set current schema to '%s'", schema), e); } }
Source:
public void sessionDestroyed(HttpSessionEvent se) { LocationService locationService; ServletContext context = se.getSession().getServletContext(); Object principal = getPrincipalFromSession(se.getSession()); if (principal != null) { try { locationService = getBeanFormApplicationContext(context, LocationService.class, "locationService"); locationService.clearUserLocation(principal); } catch (Exception ex) { logger.warn("Error clearing user location when session being destroyed: " + ex.getMessage()); } } }

Target:
public void sessionDestroyed(HttpSessionEvent se) { Object principal = getPrincipalFromSession(se.getSession()); if (principal != null) { try { locationService.clearUserLocation(principal); } catch (Exception ex) { logger.warn("Error clearing user location when session being destroyed: " + ex.getMessage()); } } }
Source:
private static AbstractHandleClient getHandleServiceClient( final URL handleServiceUrl, final AuthToken handleMgrToken, final InitReporter rep) { final AbstractHandleClient cli; try { cli = new AbstractHandleClient( handleServiceUrl, handleMgrToken); if (handleServiceUrl.getProtocol().equals("http")) { rep.reportInfo("Warning - the Handle Service url uses insecure http. " + "https is recommended."); cli.setIsInsecureHttpConnectionAllowed(true); } } catch (Exception e) { rep.reportFail("Could not establish a connection to the Handle Service at " + handleServiceUrl + ": " + e.getMessage()); return null; } try { cli.isOwner(Arrays.asList("FAKEHANDLE_-100")); } catch (Exception e) { rep.reportFail("Could not successfullly run methods on the Handle Service at " + handleServiceUrl + ": " + e.getMessage()); return null; } return cli; }

Target:
private static AbstractHandleClient getHandleServiceClient( final URL handleServiceUrl, final AuthToken handleMgrToken, final InitReporter rep) { final AbstractHandleClient cli; try { cli = new AbstractHandleClient( handleServiceUrl, handleMgrToken); if (handleServiceUrl.getProtocol().equals("http")) { rep.reportInfo("Warning - the Handle Service url uses insecure http. " + "https is recommended."); cli.setIsInsecureHttpConnectionAllowed(true); } cli.isOwner(Arrays.asList("FAKEHANDLE_-100")); } catch (Exception e) { rep.reportFail("Could not establish a connection to the Handle Service at " + handleServiceUrl + ": " + e.getMessage()); return null; } return cli; }
Source:
private JSONBuilder writeCoordinate(Point point) throws JSONException { CoordinateSequence seq = point.getCoordinateSequence(); if (!seq.hasM() || !encodeMeasures) { if (seq.hasZ()) { return writeCoordinate(seq.getX(0), seq.getY(0), seq.getZ(0)); } else { return writeCoordinate(seq.getX(0), seq.getY(0)); } } else { if (seq.hasZ()) { return writeCoordinate(seq.getX(0), seq.getY(0), seq.getZ(0), seq.getM(0)); } else { return writeCoordinate(seq.getX(0), seq.getY(0), 0, seq.getM(0)); } } }

Target:
private JSONBuilder writeCoordinate(Point point) throws JSONException { CoordinateSequence coordinates = point.getCoordinateSequence(); double m = encodeMeasures ? coordinates.getM(0) : Double.NaN; return writeCoordinate(coordinates.getX(0), coordinates.getY(0), coordinates.getZ(0), m); }
Source:
private void showInfoLostDialog() { AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder( this); alertDialogBuilder.setTitle(getResources().getString(R.string.dialog_title_are_you_sure)); alertDialogBuilder .setMessage(getResources().getString(R.string.dialog_message_data_lost)) .setCancelable(false) .setPositiveButton(getResources().getString(R.string.dialog_button_stay), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.cancel(); } }) .setNegativeButton(getResources().getString(R.string.dialog_button_leave), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { Intent intent = new Intent(AddEditPatientActivity.this, DashboardActivity.class); startActivity(intent); } }); AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); }

Target:
private void showInfoLostDialog() { AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder( this); alertDialogBuilder.setTitle(R.string.dialog_title_are_you_sure); alertDialogBuilder .setMessage(R.string.dialog_message_data_lost) .setCancelable(false) .setPositiveButton(R.string.dialog_button_stay, (dialog, id) -> dialog.cancel()) .setNegativeButton(R.string.dialog_button_leave, (dialog, id) -> { Intent intent = new Intent(AddEditPatientActivity.this, DashboardActivity.class); startActivity(intent); }); AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); }
Source:
public void testInverseBetaCdf() { assertFunction("inverse_beta_cdf(3, 3.6, 0.)", DOUBLE, 0.); assertFunction("inverse_beta_cdf(3, 3.6, 1.)", DOUBLE, 1.); assertFunction("inverse_beta_cdf(3, 3.6, 0.3)", DOUBLE, 0.3469675485440618); assertFunction("inverse_beta_cdf(3, 3.6, 0.95)", DOUBLE, 0.7600272463100223); assertInvalidFunction("inverse_beta_cdf(0, 3, 0.5)", "a, b must be > 0"); assertInvalidFunction("inverse_beta_cdf(3, 0, 0.5)", "a, b must be > 0"); assertInvalidFunction("inverse_beta_cdf(3, 5, -0.1)", "p must be 0 >= p >= 1"); assertInvalidFunction("inverse_beta_cdf(3, 5, 1.1)", "p must be 0 >= p >= 1"); }

Target:
public void testInverseBetaCdf() { assertFunction("inverse_beta_cdf(3, 3.6, 0.0)", DOUBLE, 0.0); assertFunction("inverse_beta_cdf(3, 3.6, 1.0)", DOUBLE, 1.0); assertFunction("inverse_beta_cdf(3, 3.6, 0.3)", DOUBLE, 0.3469675485440618); assertFunction("inverse_beta_cdf(3, 3.6, 0.95)", DOUBLE, 0.7600272463100223); assertInvalidFunction("inverse_beta_cdf(0, 3, 0.5)", "a must be > 0"); assertInvalidFunction("inverse_beta_cdf(3, 0, 0.5)", "b must be > 0"); assertInvalidFunction("inverse_beta_cdf(3, 5, -0.1)", "p must be in the interval [0, 1]"); assertInvalidFunction("inverse_beta_cdf(3, 5, 1.1)", "p must be in the interval [0, 1]"); }
Source:
public ClientResponseImpl shouldAccept(AuthUser user, StoredProcedureInvocation invocation, Procedure sysProc) { final String procName = invocation.getProcName(); if ( ! procName.equals("@AdHoc") && ! procName.equals("@AdHocSpForTest")) { return null; } ParameterSet params = invocation.getParams(); Object paramsArray = params.toArray(); if (paramsArray.length < 1) { return new ClientResponseImpl(ClientResponseImpl.GRACEFUL_FAILURE, new VoltTable[0], "Adhoc system procedure requires at least the query parameter.", invocation.clientHandle); } if ((paramsArray[0] instanceof String) == false) { return new ClientResponseImpl(ClientResponseImpl.GRACEFUL_FAILURE, new VoltTable[0], "Adhoc system procedure requires the query parameter to be of String type.", invocation.clientHandle); } return null; }

Target:
public ClientResponseImpl shouldAccept(AuthUser user, StoredProcedureInvocation invocation, Procedure sysProc) { final String procName = invocation.getProcName(); if ( ! procName.equals("@AdHoc") && ! procName.equals("@AdHocSpForTest")) { return null; } ParameterSet params = invocation.getParams(); final Object paramsArray = params.toArray(); if (paramsArray.length < 1) { return new ClientResponseImpl(ClientResponseImpl.GRACEFUL_FAILURE, new VoltTable[0], "Adhoc system procedure requires at least the query parameter.", invocation.clientHandle); } if ((paramsArray[0] instanceof String) == false) { return new ClientResponseImpl(ClientResponseImpl.GRACEFUL_FAILURE, new VoltTable[0], "Adhoc system procedure requires the query parameter to be of String type.", invocation.clientHandle); } return null; }
Source:
public void createCustomPaymentPlan(final DateTime exemptionDate, final Map<LocalDate, Money> map) { final DateTime when = new DateTime().minusSeconds(2); final DebtInterestCalculator debtInterestCalculator = getDebtInterestCalculator(when); final Money dueAmount = new Money(debtInterestCalculator.getDueAmount()); if (dueAmount.isZero() || dueAmount.isNegative()) { throw new DomainException("error.custom.payment.plan.cannot.be.created.for.event.without.debt"); } final Money mapValue = map.values().stream().reduce(Money.ZERO, Money::add); if (!dueAmount.equals(mapValue)) { throw new DomainException("error.custom.payment.plan.value.does.not.match.current.debt.value"); } final DueDateAmountMap currentMap = getDueDateAmountMap(); final LocalDate firstCustomDate = map.keySet().stream().min((d1, d2) -> d1.compareTo(d2)).orElse(null); final LocalDate lastCurrentDate = currentMap.keySet().stream().max((d1, d2) -> d1.compareTo(d2)).orElse(null); if (firstCustomDate.isBefore(lastCurrentDate)) { throw new DomainException("error.custom.payment.plan.must.be.after.currentPlan"); } currentMap.entrySet().forEach(e -> map.put(e.getKey(), e.getValue())); final EventExemption eventExemption = new EventExemption(this, Authenticate.getUser().getPerson(), dueAmount, EventExemptionJustificationType.CUSTOM_PAYMENT_PLAN, new DateTime(), EventExemptionJustificationType.CUSTOM_PAYMENT_PLAN.getLocalizedName()); eventExemption.setWhenCreated(when); setDueDateAmountMap(new DueDateAmountMap(map)); }

Target:
public void createCustomPaymentPlan(final DateTime exemptionDate, final Map<LocalDate, Money> map) { final DateTime when = new DateTime().minusSeconds(2); final DebtInterestCalculator debtInterestCalculator = getDebtInterestCalculator(when); final Money dueAmount = new Money(debtInterestCalculator.getDueAmount()); if (dueAmount.isZero() || dueAmount.isNegative()) { throw new DomainException("error.custom.payment.plan.cannot.be.created.for.event.without.debt"); } final Money mapValue = map.values().stream().reduce(Money.ZERO, Money::add); if (!dueAmount.equals(mapValue)) { throw new DomainException("error.custom.payment.plan.value.does.not.match.current.debt.value"); } final DueDateAmountMap currentMap = getDueDateAmountMap(); final LocalDate firstCustomDate = map.keySet().stream().min((d1, d2) -> d1.compareTo(d2)).orElse(null); final LocalDate lastCurrentDate = currentMap.keySet().stream().max((d1, d2) -> d1.compareTo(d2)).orElse(null); if (firstCustomDate.isBefore(lastCurrentDate)) { throw new DomainException("error.custom.payment.plan.must.be.after.currentPlan"); } currentMap.entrySet().forEach(e -> map.put(e.getKey(), e.getValue())); final EventExemption eventExemption = new EventExemption(this, Authenticate.getUser().getPerson(), dueAmount, EventExemptionJustificationType.CUSTOM_PAYMENT_PLAN, new DateTime(), EventExemptionJustificationType.CUSTOM_PAYMENT_PLAN.getLocalizedName()); eventExemption.setWhenCreated(exemptionDate); setDueDateAmountMap(new DueDateAmountMap(map)); }
Source:
public void remove(Replicator replicator) { synchronized (replicatorsInProgress) { if (replicatorsInProgress.remove(replicator)) { replicator.getEventBus().unregister(this); } } }

Target:
public boolean remove(Replicator replicator) { synchronized (replicatorsInProgress) { boolean removed = replicatorsInProgress.remove(replicator); if (removed) { replicator.getEventBus().unregister(this); } return removed; } }
Source:
private Object getName(Fixture fixture) { if (fixture instanceof VerifyFact) { return ((VerifyFact) fixture).getName(); } else if (fixture instanceof VerifyScorecardScore) { return TestScenarioConstants.INSTANCE.ScoreCardScore(); } else { return ""; } }

Target:
private Object getName(Fixture fixture) { if (fixture instanceof VerifyFact) { return ((VerifyFact) fixture).getName(); } else if (fixture instanceof VerifyScorecardScore) { return TestScenarioConstants.INSTANCE.ScoreCardScore(); } else { throw new IllegalArgumentException("Fixture type not supported " + fixture); } }
Source:
public PackingPlan repack(PackingPlan currentPackingPlan, Map<String, Integer> componentChanges) { this.numContainers = currentPackingPlan.getContainers().size(); resetToFirstContainer(); int additionalContainers = computeNumAdditionalContainers(componentChanges, currentPackingPlan); if (additionalContainers > 0) { increaseNumContainers(additionalContainers); LOG.info(String.format( "Allocated %s additional containers for repack bring the number of containers to %s.", additionalContainers, this.numContainers)); } while (true) { try { PackingPlanBuilder planBuilder = newPackingPlanBuilder(currentPackingPlan); planBuilder.updateNumContainers(numContainers); planBuilder = getResourceCompliantRRAllocation(planBuilder, componentChanges); return planBuilder.build(); } catch (ConstraintViolationException e) { LOG.info(String.format( "%s Increasing the number of containers to %s and attempting packing again.", e.getMessage(), this.numContainers)); increaseNumContainers(1); resetToFirstContainer(); int totalInstances = TopologyUtils.getTotalInstance(topology); if (numContainers > totalInstances) { throw new PackingException("Cannot add to that container"); } } } }

Target:
public PackingPlan repack(PackingPlan currentPackingPlan, Map<String, Integer> componentChanges) { this.numContainers = currentPackingPlan.getContainers().size(); resetToFirstContainer(); int additionalContainers = computeNumAdditionalContainers(componentChanges, currentPackingPlan); if (additionalContainers > 0) { increaseNumContainers(additionalContainers); LOG.info(String.format( "Allocated %s additional containers for repack bring the number of containers to %s.", additionalContainers, this.numContainers)); } while (true) { try { PackingPlanBuilder planBuilder = newPackingPlanBuilder(currentPackingPlan); planBuilder.updateNumContainers(numContainers); planBuilder = getResourceCompliantRRAllocation(planBuilder, componentChanges); return planBuilder.build(); } catch (ConstraintViolationException e) { LOG.info(String.format( "%s Increasing the number of containers to %s and attempting to repack again.", e.getMessage(), this.numContainers + 1)); retryWithAdditionalContainer(); } } }
Source:
private void updateEid() { List<UiccCardInfo> infos = mTelephonyManager.getUiccCardsInfo(); for (UiccCardInfo info : infos) { if (info != null && info.getSlotIndex() == mSlotId) { if (info.isEuicc()) { String eid = info.getEid(); if (!TextUtils.isEmpty(eid)) { mDialog.setText(EID_INFO_VALUE_ID, eid); } } else { mDialog.removeSettingFromScreen(EID_INFO_LABEL_ID); mDialog.removeSettingFromScreen(EID_INFO_VALUE_ID); } break; } } }

Target:
private void updateEid() { Map<Integer, Integer> slotMapping = mTelephonyManager.getLogicalToPhysicalSlotMapping(); Integer physicalSlotId = slotMapping.get(mSlotId); if (physicalSlotId != null) { List<UiccCardInfo> infos = mTelephonyManager.getUiccCardsInfo(); for (UiccCardInfo info : infos) { if (info != null && info.getSlotIndex() == physicalSlotId.intValue()) { if (info.isEuicc()) { String eid = info.getEid(); if (!TextUtils.isEmpty(eid)) { mDialog.setText(EID_INFO_VALUE_ID, eid); } } else { mDialog.removeSettingFromScreen(EID_INFO_LABEL_ID); mDialog.removeSettingFromScreen(EID_INFO_VALUE_ID); } break; } } } }
Source:
public void testEmailWith255CharacterDomainPartIsValid() { for (int num = 1; num < 251; num++) { isValidEmail( "foo@" + stringOfLength( num ) + ".com" ); } }

Target:
public void testEmailWith255CharacterDomainPartIsValid() { isValidEmail( "foo@" + stringOfLength( 63 ) + ".com" ); for (int num = 1; num <= 251; num++) { isValidEmail( "foo@" + stringOfLength( num ) + ".com" ); } }
Source:
public void testBufferFinishesWhenClientBuffersDestroyed() { BroadcastOutputBuffer buffer = createBroadcastBuffer( createInitialEmptyOutputBuffers(BROADCAST) .withBuffer(FIRST, BROADCAST_PARTITION_ID) .withBuffer(SECOND, BROADCAST_PARTITION_ID) .withBuffer(THIRD, BROADCAST_PARTITION_ID) .withNoMoreBufferIds(), sizeOfPages(5)); buffer.abort(FIRST); assertFalse(buffer.isFinished()); buffer.abort(SECOND); assertFalse(buffer.isFinished()); buffer.abort(THIRD); assertTrue(buffer.isFinished()); }

Target:
public void testBufferFinishesWhenClientBuffersDestroyed() { BroadcastOutputBuffer buffer = createBroadcastBuffer( createInitialEmptyOutputBuffers(BROADCAST) .withBuffer(FIRST, BROADCAST_PARTITION_ID) .withBuffer(SECOND, BROADCAST_PARTITION_ID) .withBuffer(THIRD, BROADCAST_PARTITION_ID) .withNoMoreBufferIds(), sizeOfPages(5)); for (int i = 0; i < 5; i++) { addPage(buffer, createPage(i)); } buffer.abort(FIRST); assertFalse(buffer.isFinished()); buffer.abort(SECOND); assertFalse(buffer.isFinished()); buffer.abort(THIRD); assertTrue(buffer.isFinished()); }
Source:
protected boolean validateForm() { final String host = _hostTextField.getText(); if (StringUtils.isNullOrEmpty(host)) { setStatusError("Please enter DataHub host name"); return false; } final String port = _portTextField.getText(); if (StringUtils.isNullOrEmpty(port)) { setStatusError("Please enter DataHub port number"); return false; } else { try { int portInt = Integer.parseInt(port); if (portInt <= 0) { setStatusError("Please enter a valid (positive port number)"); return false; } } catch (NumberFormatException e) { setStatusError("Please enter a valid port number"); return false; } } final String datastoreName = _datastoreNameTextField.getText(); if (StringUtils.isNullOrEmpty(datastoreName)) { setStatusError("Please enter a datastore name"); return false; } final String username = _usernameTextField.getText(); if (StringUtils.isNullOrEmpty(username)) { setStatusError("Please enter username"); return false; } if (_tenantName == null) { setStatusError("Please test the connection first"); return false; } setStatusValid(); return true; }

Target:
protected boolean validateForm() { final String host = _hostTextField.getText(); if (StringUtils.isNullOrEmpty(host)) { setStatusError("Please enter DataHub host name"); return false; } final String port = _portTextField.getText(); if (StringUtils.isNullOrEmpty(port)) { setStatusError("Please enter DataHub port number"); return false; } else { try { int portInt = Integer.parseInt(port); if (portInt <= 0) { setStatusError("Please enter a valid (positive port number)"); return false; } } catch (NumberFormatException e) { setStatusError("Please enter a valid port number"); return false; } } final String datastoreName = _datastoreNameTextField.getText(); if (StringUtils.isNullOrEmpty(datastoreName)) { setStatusError("Please enter a datastore name"); return false; } final String username = _usernameTextField.getText(); if (StringUtils.isNullOrEmpty(username)) { setStatusError("Please enter username"); return false; } final char[] password = _passwordTextField.getPassword(); if (password.length < 1) { setStatusError("Please enter password"); return false; } setStatusValid(); return true; }
Source:
public int hashCode() { return ((startCommit.hashCode() + numbers.length) * 31) + getNumber(); }

Target:
public int hashCode() { return commit.hashCode() ^ (number + 1); }
Source:
private void awaitOnLatch(CountDownLatch countDownLatch) throws InterruptedException { int totalAwaitTime = 0; int backoff = INVALIDATION_BACKOFF_SECONDS; while (!countDownLatch.await(backoff, TimeUnit.SECONDS)) { totalAwaitTime += backoff; if (totalAwaitTime >= MAX_INVALIDATION_WAIT_SECONDS) { throw new IllegalStateException("Server did not send an InvalidationDone message within " + totalAwaitTime + "s"); } backoff += INVALIDATION_BACKOFF_SECONDS; if ((totalAwaitTime + backoff) > MAX_INVALIDATION_WAIT_SECONDS) { backoff = (totalAwaitTime + backoff) - MAX_INVALIDATION_WAIT_SECONDS; } LOGGER.debug("Waiting for the server's InvalidationDone message for {}s, backing off {}s...", totalAwaitTime, backoff); } if (!entity.isConnected()) { throw new IllegalStateException("Entity disconnected"); } }

Target:
private void awaitOnLatch(CountDownLatch countDownLatch) throws InterruptedException { int totalAwaitTime = 0; int backoff = 1; while (!countDownLatch.await(backoff, TimeUnit.SECONDS)) { totalAwaitTime += backoff; backoff = (backoff >= 10) ? 10 : backoff * 2; LOGGER.debug("Waiting for the server's InvalidationDone message for {}s, backing off {}s...", totalAwaitTime, backoff); } if (!entity.isConnected()) { throw new IllegalStateException("Entity disconnected"); } }
Source:
public String serialize() { try { return new ObjectMapper().writeValueAsString(this); } catch (JsonProcessingException e) { throw logger.logExceptionAsError(new UncheckedIOException(e)); } }

Target:
public String serialize() { try { return MAPPER.writer().writeValueAsString(this); } catch (JsonProcessingException e) { throw logger.logExceptionAsError(new UncheckedIOException(e)); } }
Source:
public static @CheckForNull User get(String idOrFullName, boolean create, Map context) { if(idOrFullName==null) return null; List<CanonicalIdResolver> resolvers = new ArrayList<CanonicalIdResolver>(ExtensionList.lookup(CanonicalIdResolver.class)); Collections.sort(resolvers); String id = null; for (CanonicalIdResolver resolver : resolvers) { id = resolver.resolveCanonicalId(idOrFullName, context); if (id != null) { LOGGER.log(Level.FINE, "{0} mapped {1} to {2}", new Object[] {resolver, idOrFullName, id}); break; } } if (id == null) { throw new IllegalStateException("The user id should be always non-null thanks to DefaultUserCanonicalIdResolver"); } return getOrCreate(id, idOrFullName, create); }

Target:
public static @Nullable User get(String idOrFullName, boolean create, Map context) { if(idOrFullName==null) return null; List<CanonicalIdResolver> resolvers = new ArrayList<CanonicalIdResolver>(ExtensionList.lookup(CanonicalIdResolver.class)); Collections.sort(resolvers); String id = null; for (CanonicalIdResolver resolver : resolvers) { id = resolver.resolveCanonicalId(idOrFullName, context); if (id != null) { LOGGER.log(Level.FINE, "{0} mapped {1} to {2}", new Object[] {resolver, idOrFullName, id}); break; } } if (id == null) { throw new IllegalStateException("The user id should be always non-null thanks to DefaultUserCanonicalIdResolver"); } return getOrCreate(id, idOrFullName, create); }
Source:
private void checkNullableAssertion(Tree issueLocation, Argument actual) { if (actual.isPrimitive()) { reportIssue(issueLocation, MESSAGE); } }

Target:
private void checkNullableAssertion(Tree issueLocation, Argument actual) { if (actual.isPrimitive()) { reportIssue(issueLocation, "Change the assertion arguments to not compare a primitive value with null."); } }
Source:
public void testBuildStates() { final List<CramCompressionRecord> records = new ArrayList<>(); final CramCompressionRecord record1 = createRecord(0, 0); records.add(record1); final CompressionHeader header1 = new CompressionHeaderFactory().build(records, null, true); final Slice slice1 = Slice.buildSlice(records, header1); assertSliceState(slice1, 1, 0, 1, 3); final CramCompressionRecord record2 = createRecord(1, 1); records.add(record2); final CompressionHeader header2 = new CompressionHeaderFactory().build(records, null, true); final Slice slice2 = Slice.buildSlice(records, header2); assertSliceState(slice2, 2, Slice.MULTI_REFERENCE, Slice.NO_ALIGNMENT_START, Slice.NO_ALIGNMENT_SPAN); final CramCompressionRecord record3 = createRecord(2, 2); records.add(record3); final CompressionHeader header3 = new CompressionHeaderFactory().build(records, null, true); final Slice slice3 = Slice.buildSlice(records, header3); assertSliceState(slice3, 3, Slice.MULTI_REFERENCE, Slice.NO_ALIGNMENT_START, Slice.NO_ALIGNMENT_SPAN); final CramCompressionRecord unmapped = createRecord(3, SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); unmapped.alignmentStart = SAMRecord.NO_ALIGNMENT_START; unmapped.setSegmentUnmapped(true); records.add(unmapped); final CompressionHeader header4 = new CompressionHeaderFactory().build(records, null, true); final Slice slice4 = Slice.buildSlice(records, header4); assertSliceState(slice4, 4, Slice.MULTI_REFERENCE, Slice.NO_ALIGNMENT_START, Slice.NO_ALIGNMENT_SPAN); }

Target:
public void testBuildStates() { final List<CramCompressionRecord> records = new ArrayList<>(); final CramCompressionRecord record1 = createRecord(0, 0); records.add(record1); assertSliceStateFromRecords(records, 1, 0, 1, 3); final CramCompressionRecord record2 = createRecord(1, 1); records.add(record2); assertSliceStateFromRecords(records, 2, Slice.MULTI_REFERENCE, Slice.NO_ALIGNMENT_START, Slice.NO_ALIGNMENT_SPAN); final CramCompressionRecord record3 = createRecord(2, 2); records.add(record3); assertSliceStateFromRecords(records, 3, Slice.MULTI_REFERENCE, Slice.NO_ALIGNMENT_START, Slice.NO_ALIGNMENT_SPAN); final CramCompressionRecord unmapped = createRecord(3, SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); unmapped.alignmentStart = SAMRecord.NO_ALIGNMENT_START; unmapped.setSegmentUnmapped(true); records.add(unmapped); assertSliceStateFromRecords(records, 4, Slice.MULTI_REFERENCE, Slice.NO_ALIGNMENT_START, Slice.NO_ALIGNMENT_SPAN); }
Source:
private void checkWhetherToDisplayUserProjectRegistrationWizard() { ProjectPreferenceSetting projectSetting = preferences .getOrCreateProjectSetting(workspaceName); if (!WatchDogUtils.isEmpty(preferences.getUserid()) || (projectSetting.startupQuestionAsked && !projectSetting.enableWatchdog)) return; UserRegistrationWizardDialogHandler newUserWizardHandler = new UserRegistrationWizardDialogHandler(); try { int statusCode = (int) newUserWizardHandler .execute(new ExecutionEvent()); savePreferenceStoreIfNeeded(); if (statusCode == Window.CANCEL) { if (MessageDialog.openQuestion(null, "WatchDog not active!", WATCHDOG_INACTIVE_WARNING)) { makeSilentRegistration(); } else { userProjectRegistrationCancelled = true; preferences.registerProjectUse( WatchDogUtils.getWorkspaceName(), false); } } } catch (ExecutionException exception) { WatchDogLogger.getInstance().logSevere(exception); } }

Target:
private void checkWhetherToDisplayUserProjectRegistrationWizard() { ProjectPreferenceSetting projectSetting = preferences .getOrCreateProjectSetting(workspaceName); if (!WatchDogUtils.isEmpty(preferences.getUserid()) || (projectSetting.startupQuestionAsked && !projectSetting.enableWatchdog)) return; UserRegistrationWizardDialogHandler newUserWizardHandler = new UserRegistrationWizardDialogHandler(); try { int statusCode = (int) newUserWizardHandler .execute(new ExecutionEvent()); savePreferenceStoreIfNeeded(); if (statusCode == Window.CANCEL) { boolean shouldRegisterAnonymously = MessageDialog .openQuestion(null, "WatchDog not active!", WATCHDOG_INACTIVE_WARNING); if (shouldRegisterAnonymously) { makeSilentRegistration(); } else { userProjectRegistrationCancelled = true; preferences.registerProjectUse( WatchDogUtils.getWorkspaceName(), false); } } } catch (ExecutionException exception) { WatchDogLogger.getInstance().logSevere(exception); } }
Source:
public Object toJson() { JSONObject json = JsonObjectUtility.newOrderedJSONObject(); json.put("pattern", getDecimalFormat().toPattern()); json.put("multiplier", getDecimalFormat().getMultiplier()); json.put("roundingMode", getDecimalFormat().getRoundingMode()); return json; }

Target:
public Object toJson() { if (getDecimalFormat() == null) { return null; } JSONObject json = JsonObjectUtility.newOrderedJSONObject(); json.put("pattern", getDecimalFormat().toPattern()); json.put("multiplier", getDecimalFormat().getMultiplier()); json.put("roundingMode", getDecimalFormat().getRoundingMode().name()); return json; }
Source:
public Map<String, BuilderEnvironment> getBuilderEnvironment(){ return this.environmentMap; }

Target:
public Map<String, BuilderEnvironment> getBuilderEnvironment(){ return Collections.unmodifiableMap(this.environmentMap); }
Source:
public ObjectColumnSelector makeObjectColumnSelector( final DimensionSpec spec, final IncrementalIndexStorageAdapter.EntryHolder currEntry, final IncrementalIndex.DimensionDesc desc ) { final int dimIndex = desc.getIndex(); class IndexerObjectColumnSelector implements ObjectColumnSelector { @Override public Class classOfObject() { return Float.class; } @Override public Object get() { final Object[] dims = currEntry.getKey().getDims(); if (dimIndex >= dims.length) { return 0.0f; } return dims[dimIndex]; } } return new IndexerObjectColumnSelector(); }

Target:
public ObjectColumnSelector makeObjectColumnSelector( final DimensionSpec spec, final IncrementalIndexStorageAdapter.EntryHolder currEntry, final IncrementalIndex.DimensionDesc desc ) { final int dimIndex = desc.getIndex(); class IndexerObjectColumnSelector implements ObjectColumnSelector { @Override public Class classOfObject() { return Float.class; } @Override public Object get() { final Object[] dims = currEntry.getKey().getDims(); if (dimIndex >= dims.length) { return DimensionHandlerUtils.ZERO_FLOAT; } return dims[dimIndex]; } } return new IndexerObjectColumnSelector(); }
Source:
public String getInstructorsDataAsString() { return Sanitizer.sanitizeForHtml(Sanitizer.sanitizeListForCsv(instructorsData).toString()); }

Target:
public String getInstructorsDataAsString() { return Sanitizer.sanitizeForHtml(Sanitizer.sanitizeListForCsv(instructorsData)).toString(); }
Source:
private static Map<SchemaTableName, ElasticsearchTableDescription> createTableDescriptions(Metadata metadata, Iterable<TpchTable<?>> tables) throws Exception { JsonCodec<ElasticsearchTableDescription> codec = new CodecSupplier<>(ElasticsearchTableDescription.class, metadata).get(); URL metadataUrl = Resources.getResource(ElasticsearchQueryRunner.class, "/queryrunner"); assertNotNull(metadataUrl, "metadataUrl is null"); URI metadataUri = metadataUrl.toURI(); ImmutableSet.Builder<String> tableNames = ImmutableSet.builder(); for (TpchTable<?> table : tables) { tableNames.add(TPCH_SCHEMA + "." + table.getTableName()); } return createElasticsearchTableDescriptions(new File(metadataUri), TPCH_SCHEMA, tableNames.build(), codec); }

Target:
private static Map<SchemaTableName, ElasticsearchTableDescription> createTableDescriptions(Metadata metadata, Iterable<TpchTable<?>> tables) throws Exception { JsonCodec<ElasticsearchTableDescription> codec = new CodecSupplier<>(ElasticsearchTableDescription.class, metadata).get(); URL metadataUrl = getResource(ElasticsearchQueryRunner.class, "/queryrunner"); assertNotNull(metadataUrl, "metadataUrl is null"); URI metadataUri = metadataUrl.toURI(); ImmutableSet.Builder<String> tableNames = ImmutableSet.builder(); for (TpchTable<?> table : tables) { tableNames.add(TPCH_SCHEMA + "." + table.getTableName()); } return createElasticsearchTableDescriptions(new File(metadataUri), TPCH_SCHEMA, tableNames.build(), codec); }
Source:
public void loadSettings(TuningContext context) { this.toteDistance = context.getFloat("Auto Mode Container Tote Tote Distance +A", 28.0f); this.autoZoneDistance = context.getFloat("Auto Mode Container Tote Auto Zone Distance +A", 60.0f); this.secondDistance = context.getFloat("Auto Mode Container Tote Second Distance +A", 24.0f); this.nudge = context.getFloat("Auto Mode Container Tote Nudge +A", 12.0f); this.containerTurnTime = context.getFloat("Auto Mode Container Tote Container Turn Time +A", 0.5f); this.autoZoneAngle = context.getFloat("Auto Mode Container Tote Auto Zone Angle +A", 90.0f); this.containerHeight = context.getFloat("Auto Mode Container Tote Container Height +A", 0.0f); this.autoZoneSpeed = context.getFloat("Auto Mode Container Tote Auto Zone Speed", 1.0f); this.topClampHeight = context.getFloat("Auto Mode Single Tote Top Clamp Height", 0.75f); }

Target:
public void loadSettings(TuningContext context) { this.toteDistance = context.getFloat("Auto Mode Container Tote Tote Distance +A", 28.0f); this.autoZoneDistance = context.getFloat("Auto Mode Container Tote Auto Zone Distance +A", 60.0f); this.secondDistance = context.getFloat("Auto Mode Container Tote Second Distance +A", 24.0f); this.nudge = context.getFloat("Auto Mode Container Tote Nudge +A", 12.0f); this.containerTurnTime = context.getFloat("Auto Mode Container Tote Container Turn Time +A", 0.5f); this.autoZoneAngle = context.getFloat("Auto Mode Container Tote Auto Zone Angle +A", 90.0f); this.containerHeight = context.getFloat("Auto Mode Container Tote Container Height +A", 0.0f); this.autoZoneSpeed = context.getFloat("Auto Mode Container Tote Auto Zone Speed +A", 1.0f); this.topClampHeight = context.getFloat("Auto Mode Container Tote Top Clamp Height +A", 0.75f); }
Source:
public void fireEvent(GwtEvent<?> event) { getEventBus().fireEventFromSource(event, this); }

Target:
public void fireEvent(GwtEvent<?> event) { fireEvent((Event<?>) event); }