auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void exportJobXML(String jobId) { String jobXmlUrl = GWT.getModuleBaseURL() + "downloadjobxml?jobId=" + jobId + "&sessionId=" + LoginModel.getInstance().getSessionId(); XMLHttpRequest req = XMLHttpRequest.create(); req.open("HEAD", jobXmlUrl); req.setOnReadyStateChange(xhr -> { if (xhr.getReadyState() == XMLHttpRequest.DONE) { if (xhr.getStatus() == Response.SC_OK) { LogModel.getInstance().logMessage("Downloading XML for job: " + jobId); Window.open(jobXmlUrl, "Download Job XML", ""); } else { String error = xhr.getResponseHeader(HEADER_PA_ERROR); if (xhr.getResponseHeader(HEADER_PA_ERROR) != null) { SC.warn("Could not export job's XML:\n" + error); } else { LogModel.getInstance() .logMessage("Could not download Job XML. Got HTTP response code: " + xhr.getStatus()); } } } }); req.send(); }

Target:
public void exportJobXML(String jobId) { String jobXmlUrl = GWT.getModuleBaseURL() + "downloadjobxml?jobId=" + jobId + "&sessionId=" + LoginModel.getInstance().getSessionId(); XMLHttpRequest req = XMLHttpRequest.create(); req.open("HEAD", jobXmlUrl); req.setOnReadyStateChange(xhr -> { if (xhr.getReadyState() == XMLHttpRequest.DONE) { if (xhr.getStatus() == Response.SC_OK) { LogModel.getInstance().logMessage("Downloading XML for job: " + jobId); Window.open(jobXmlUrl, "Download Job XML", ""); } else { String error = xhr.getResponseHeader(HEADER_PA_ERROR); if (error != null) { SC.warn("Could not export job's XML:\n" + error); } else { LogModel.getInstance() .logMessage("Could not download Job XML. Got HTTP response code: " + xhr.getStatus()); } } } }); req.send(); }
Source:
public boolean incompleteTransactionsContain(String gtid, long seqNo) { Long s = incompleteTransactions.get(gtid); if (s != null) { return s >= seqNo; } return false; }

Target:
public boolean incompleteTransactionsContain(String gtid, long seqNo) { Long s = incompleteTransactions.get(gtid); return s != null && s >= seqNo; }
Source:
public void testOneOf() throws Exception { final InferenceEngine inferenceEngine = mock(InferenceEngine.class); final Map<Resource, Set<Resource>> enumerations = new HashMap<>(); enumerations.put(SUITS, CARD_SUIT_ENUMERATION); when(inferenceEngine.isEnumeratedType(SUITS)).thenReturn(true); when(inferenceEngine.getEnumeration(SUITS)).thenReturn(CARD_SUIT_ENUMERATION); enumerations.put(RANKS, CARD_RANK_ENUMERATION); when(inferenceEngine.isEnumeratedType(RANKS)).thenReturn(true); when(inferenceEngine.getEnumeration(RANKS)).thenReturn(CARD_RANK_ENUMERATION); final Projection query = new Projection( new StatementPattern(new Var("s"), new Var("p", RDF.TYPE), new Var("o", SUITS)), new ProjectionElemList(new ProjectionElem("s", "subject"))); query.visit(new OneOfVisitor(conf, inferenceEngine)); assertTrue(query.getArg() instanceof BindingSetAssignment); final BindingSetAssignment bsa = (BindingSetAssignment) query.getArg(); final Iterable<BindingSet> iterable = bsa.getBindingSets(); final Iterator<BindingSet> iter = iterable.iterator(); assertBindingSet(iter, CARD_SUIT_ENUMERATION.iterator()); final Projection query2 = new Projection( new StatementPattern(new Var("s"), new Var("p", RDF.TYPE), new Var("o", RANKS)), new ProjectionElemList(new ProjectionElem("s", "subject"))); query2.visit(new OneOfVisitor(conf, inferenceEngine)); assertTrue(query2.getArg() instanceof BindingSetAssignment); final BindingSetAssignment bsa2 = (BindingSetAssignment) query2.getArg(); final Iterable<BindingSet> iterable2 = bsa2.getBindingSets(); final Iterator<BindingSet> iter2 = iterable2.iterator(); assertBindingSet(iter2, CARD_RANK_ENUMERATION.iterator()); }

Target:
public void testOneOf() throws Exception { final InferenceEngine inferenceEngine = mock(InferenceEngine.class); when(inferenceEngine.isEnumeratedType(SUITS)).thenReturn(true); when(inferenceEngine.getEnumeration(SUITS)).thenReturn(CARD_SUIT_ENUMERATION); when(inferenceEngine.isEnumeratedType(RANKS)).thenReturn(true); when(inferenceEngine.getEnumeration(RANKS)).thenReturn(CARD_RANK_ENUMERATION); final Projection query = new Projection( new StatementPattern(new Var("s"), new Var("p", RDF.TYPE), new Var("o", SUITS)), new ProjectionElemList(new ProjectionElem("s", "subject"))); query.visit(new OneOfVisitor(conf, inferenceEngine)); assertTrue(query.getArg() instanceof BindingSetAssignment); final BindingSetAssignment bsa = (BindingSetAssignment) query.getArg(); final Iterable<BindingSet> iterable = bsa.getBindingSets(); final Iterator<BindingSet> iter = iterable.iterator(); assertBindingSet(iter, CARD_SUIT_ENUMERATION.iterator()); final Projection query2 = new Projection( new StatementPattern(new Var("s"), new Var("p", RDF.TYPE), new Var("o", RANKS)), new ProjectionElemList(new ProjectionElem("s", "subject"))); query2.visit(new OneOfVisitor(conf, inferenceEngine)); assertTrue(query2.getArg() instanceof BindingSetAssignment); final BindingSetAssignment bsa2 = (BindingSetAssignment) query2.getArg(); final Iterable<BindingSet> iterable2 = bsa2.getBindingSets(); final Iterator<BindingSet> iter2 = iterable2.iterator(); assertBindingSet(iter2, CARD_RANK_ENUMERATION.iterator()); }
Source:
public void registerIntent(Plugin plugin) { Preconditions.checkState( !fired.get(), "Event %s has already been fired", this ); if ( !intents.containsKey( plugin ) ) { intents.put( plugin, new AtomicInteger( 1 ) ); latch.incrementAndGet(); } else if ( intents.get( plugin ).getAndIncrement() == 0 ) { latch.incrementAndGet(); } }

Target:
public void registerIntent(Plugin plugin) { Preconditions.checkState( !fired.get(), "Event %s has already been fired", this ); AtomicInteger intentCount = intents.get( plugin ); if ( intentCount == null ) { intents.put( plugin, new AtomicInteger( 1 ) ); } else { intentCount.incrementAndGet(); } latch.incrementAndGet(); }
Source:
private void doCheck(File[] replicas, ArrayList<String> replicasList, ConcurrentHashMap<String, BlobStatus> blobIdToStatusMap, AtomicLong totalKeysProcessed) throws IOException, InterruptedException { DumpData dumpData = new DumpData(outFile, fileWriter, map); CountDownLatch countDownLatch = new CountDownLatch(replicas.length); AtomicLong totalPutRecords = new AtomicLong(0); AtomicLong totalDeleteRecords = new AtomicLong(0); AtomicLong totalDuplicatePutRecords = new AtomicLong(0); AtomicLong totalDeleteBeforePutRecords = new AtomicLong(0); AtomicLong totalPutAfterDeleteRecords = new AtomicLong(0); AtomicLong totalDuplicateDeleteRecords = new AtomicLong(0); for (File replica : replicas) { Thread thread = new Thread( new ReplicaProcessorForBlobs(replica, replicasList, blobIdToStatusMap, totalKeysProcessed, dumpData, countDownLatch, totalPutRecords, totalDeleteRecords, totalDuplicatePutRecords, totalDeleteBeforePutRecords, totalPutAfterDeleteRecords, totalDuplicateDeleteRecords)); thread.start(); thread.join(); } countDownLatch.await(); logOutput("Total Keys Processed " + totalKeysProcessed.get()); logOutput("Total Put Records " + totalPutRecords.get()); logOutput("Total Delete Records " + totalDeleteRecords.get()); logOutput("Total Duplicate Put Records " + totalDuplicatePutRecords.get()); logOutput("Total Delete before Put Records " + totalDeleteBeforePutRecords.get()); logOutput("Total Put after Delete Records " + totalPutAfterDeleteRecords.get()); }

Target:
private void doCheck(File[] replicas, ArrayList<String> replicasList, ConcurrentHashMap<String, BlobStatus> blobIdToStatusMap, AtomicLong totalKeysProcessed) throws IOException, InterruptedException { DumpData dumpData = new DumpData(outFile, fileWriter, map); CountDownLatch countDownLatch = new CountDownLatch(replicas.length); IndexStats indexStats = new IndexStats(); for (File replica : replicas) { Thread thread = new Thread( new ReplicaProcessorForBlobs(replica, replicasList, blobIdToStatusMap, totalKeysProcessed, dumpData, countDownLatch, indexStats)); thread.start(); thread.join(); } countDownLatch.await(); logOutput("Total Keys Processed " + totalKeysProcessed.get()); logOutput("Total Put Records " + indexStats.getTotalPutRecords().get()); logOutput("Total Delete Records " + indexStats.getTotalDeleteRecords().get()); logOutput("Total Duplicate Put Records " + indexStats.getTotalDuplicatePutRecords().get()); logOutput("Total Delete before Put Records " + indexStats.getTotalDeleteBeforePutRecords().get()); logOutput("Total Put after Delete Records " + indexStats.getTotalPutAfterDeleteRecords().get()); logOutput("Total Duplicate Delete Records " + indexStats.getTotalDuplicateDeleteRecords().get()); }
Source:
public void start(Future<Void> startFuture) throws Exception { super.start(startFuture); try { PORT = Integer.parseInt(System.getenv("PORT")); } catch (Exception e) { logger.warn("Environment variable PORT not found or not valid. Defautling to: " + PORT); } HttpServer httpServer = getVertx().createHttpServer(); Router mainRouter = Router.router(getVertx()); mainRouter.route("/*") .handler(StaticHandler.create()); httpServer.requestHandler(mainRouter::accept); httpServer.listen(PORT, handler -> { if (handler.succeeded()) { logger.info("Listening on port: " + PORT); } else { logger.error("Failed to bind on port " + PORT + ". Is it being used?"); } }); }

Target:
public void start(Future<Void> startFuture) throws Exception { try { PORT = Integer.parseInt(System.getenv("PORT")); } catch (Exception e) { logger.warn("Environment variable PORT not found or not valid. Defautling to: " + PORT); } HttpServer httpServer = getVertx().createHttpServer(); Router mainRouter = Router.router(getVertx()); mainRouter.route("/*") .handler(StaticHandler.create()); httpServer.requestHandler(mainRouter::accept); httpServer.listen(PORT, asyncResult -> { if (asyncResult.succeeded()) { logger.info("Listening on port: " + PORT); startFuture.complete(); } else { logger.error("Failed to bind on port " + PORT + ". Is it being used?"); startFuture.fail(asyncResult.cause()); } }); }
Source:
private synchronized MessageIdTracker getTracker(final InetSocketAddress destination) { MessageIdTracker tracker = trackers.get(destination); if (tracker == null) { tracker = new MessageIdTracker(config); if (!trackers.put(destination, tracker)) { return null; } } return tracker; }

Target:
private synchronized MessageIdTracker getTracker(final InetSocketAddress destination) { MessageIdTracker tracker = trackers.get(destination); if (tracker == null && 0 < trackers.remainingCapacity()) { tracker = new MessageIdTracker(config); trackers.put(destination, tracker); } return tracker; }
Source:
public InterfaceParams(String name, int index, MacAddress macAddr, int defaultMtu) { checkArgument((index >= 0), "invalid interface index"); this.name = name; this.index = index; this.macAddr = (macAddr != null) ? macAddr : ALL_ZEROS_ADDRESS; this.defaultMtu = (defaultMtu > IPV6_MIN_MTU) ? defaultMtu : IPV6_MIN_MTU; }

Target:
public InterfaceParams(String name, int index, MacAddress macAddr, int defaultMtu) { checkArgument((!TextUtils.isEmpty(name)), "impossible interface name"); checkArgument((index > 0), "invalid interface index"); this.name = name; this.index = index; this.macAddr = (macAddr != null) ? macAddr : ALL_ZEROS_ADDRESS; this.defaultMtu = (defaultMtu > IPV6_MIN_MTU) ? defaultMtu : IPV6_MIN_MTU; }
Source:
public void testCreateSchema() { analyze("CREATE SCHEMA test"); analyze("CREATE SCHEMA test WITH (p1 = 'p1')"); assertFails(DUPLICATE_TABLE_PROPERTIES, "CREATE SCHEMA test WITH (p1 = 'p1', p2 = 'p2', p1 = 'p3')"); assertFails(DUPLICATE_TABLE_PROPERTIES, "CREATE SCHEMA test WITH (p1 = 'p1', \"p1\" = 'p2')"); }

Target:
public void testCreateSchema() throws Exception { analyze("CREATE SCHEMA test"); analyze("CREATE SCHEMA test WITH (p1 = 'p1')"); assertFails(MISSING_ATTRIBUTE, ".*Column 'y' cannot be resolved", "CREATE SCHEMA test WITH (p1 = y)"); assertFails(DUPLICATE_PROPERTY, ".* Duplicate property: p1", "CREATE SCHEMA test WITH (p1 = 'p1', p2 = 'p2', p1 = 'p3')"); assertFails(DUPLICATE_PROPERTY, ".* Duplicate property: p1", "CREATE SCHEMA test WITH (p1 = 'p1', \"p1\" = 'p2')"); }
Source:
public String getJobName() { if (this.jobName == null) { String jobName; if (this.isDeletingAllViews) { jobName = DELETE_ALL_VIEWS; } else if (this.getViewName() != null) { jobName = this.getViewName(); } else { jobName = this.tenantId; } this.jobName = "ViewTTLTool-" + jobName + "-"; } return this.jobName; }

Target:
public String getJobName() { if (this.jobName == null) { String jobName; if (this.isDeletingAllViews) { jobName = DELETE_ALL_VIEWS; } else if (this.getViewName() != null) { jobName = this.getViewName(); } else { jobName = this.tenantId; } this.jobName = "PhoenixTTLTool-" + jobName + "-"; } return this.jobName; }
Source:
SymbolStatistics(String symbolName, SymbolStatsEstimate estimate) { this.symbol = new Symbol(symbolName); this.estimate = estimate; }

Target:
SymbolStatistics(String symbolName, SymbolStatsEstimate estimate) { this(new Symbol(symbolName), estimate); }
Source:
public static JobDetails createDetailsForJob(AccessExecutionGraph job) { JobStatus status = job.getState(); long started = job.getStatusTimestamp(JobStatus.INITIALIZING); long finished = status.isGloballyTerminalState() ? job.getStatusTimestamp(status) : -1L; long duration = (finished >= 0L ? finished : System.currentTimeMillis()) - started; int[] countsPerStatus = new int[ExecutionState.values().length]; long lastChanged = 0; int numTotalTasks = 0; for (AccessExecutionJobVertex ejv : job.getVerticesTopologically()) { AccessExecutionVertex[] vertices = ejv.getTaskVertices(); numTotalTasks += vertices.length; for (AccessExecutionVertex vertex : vertices) { ExecutionState state = vertex.getExecutionState(); countsPerStatus[state.ordinal()]++; lastChanged = Math.max(lastChanged, vertex.getStateTimestamp(state)); } } lastChanged = Math.max(lastChanged, finished); return new JobDetails( job.getJobID(), job.getJobName(), started, finished, duration, status, lastChanged, countsPerStatus, numTotalTasks); }

Target:
public static JobDetails createDetailsForJob(AccessExecutionGraph job) { JobStatus status = job.getState(); long started = job.getStatusTimestamp(JobStatus.INITIALIZING); long finished = status.isGloballyTerminalState() ? job.getStatusTimestamp(status) : -1L; long duration = (finished >= 0L ? finished : System.currentTimeMillis()) - started; int[] countsPerStatus = new int[ExecutionState.values().length]; long lastChanged = 0; int numTotalTasks = 0; for (AccessExecutionJobVertex ejv : job.getVerticesTopologically()) { AccessExecutionVertex[] taskVertices = ejv.getTaskVertices(); numTotalTasks += taskVertices.length; for (AccessExecutionVertex taskVertex : taskVertices) { ExecutionState state = taskVertex.getExecutionState(); countsPerStatus[state.ordinal()]++; lastChanged = Math.max(lastChanged, taskVertex.getStateTimestamp(state)); } } lastChanged = Math.max(lastChanged, finished); return new JobDetails( job.getJobID(), job.getJobName(), started, finished, duration, status, lastChanged, countsPerStatus, numTotalTasks); }
Source:
protected boolean addedValid(IConfigurationElement element) { try { String nsURI = element.getAttribute(ATT_NS_URI); int rank = Integer.parseInt(element.getAttribute(ATT_RANKING)); WeightProvider.Descriptor descriptor = new WeightProviderDescriptorImpl((WeightProvider)element .createExecutableExtension(ATT_CLASS), rank, Pattern.compile(nsURI)); WeightProvider.Descriptor previous = weightProviderRegistry.put(nsURI, descriptor); if (previous != null) { log(IStatus.WARNING, element, EMFCompareRCPMessages.getString( "duplicate.extension", weightProviderRegistry.getClass().getName())); } } catch (CoreException e) { log(IStatus.ERROR, element, e.getMessage()); return false; } return true; }

Target:
protected boolean addedValid(IConfigurationElement element) { String className = element.getAttribute(ATT_CLASS); String nsURI = element.getAttribute(ATT_NS_URI); int rank = Integer.parseInt(element.getAttribute(ATT_RANKING)); WeightProvider.Descriptor descriptor = new WeightProviderDescriptorRCPImpl(element, rank, Pattern .compile(nsURI)); WeightProvider.Descriptor previous = weightProviderRegistry.put(className, descriptor); if (previous != null) { log(IStatus.WARNING, element, EMFCompareRCPMessages.getString( "duplicate.extension", weightProviderRegistry.getClass().getName())); } return true; }
Source:
public void afterPropertiesSet() { this.evaluationContext = IntegrationContextUtils.getEvaluationContext(beanFactory); }

Target:
public void afterPropertiesSet() { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(beanFactory); }
Source:
public ClientConfiguration setAddresses(String... addrs) { if (addrs != null) { this.addrs = Arrays.copyOf(addrs, addrs.length); addrFinder = () -> this.addrs; } return this; }

Target:
public ClientConfiguration setAddresses(String... addrs) { if (addrs != null) this.addrs = Arrays.copyOf(addrs, addrs.length); return this; }
Source:
public SpecificFunctionReference getFunctionType() { return (SpecificFunctionReference)type; }

Target:
public SpecificFunctionReference getFunctionType() { return (type instanceof SpecificFunctionReference) ? (SpecificFunctionReference)type : null; }
Source:
public Object parse(ElementInstance instance, Node node, Object value) throws Exception { String wkName = (String) node.getChildValue("WellKnownName"); Stroke stroke = (Stroke) node.getChildValue("Stroke"); Fill fill = (Fill) node.getChildValue("Fill"); Mark mark = styleFactory.createMark(); if (wkName != null) { if (wkName.startsWith("file://")) { URL url = resourceLocator.locateResource(wkName); if (url != null) { wkName = url.toExternalForm(); } } mark.setWellKnownName(filterFactory.literal(wkName)); } mark.setStroke(stroke); mark.setFill(fill); return mark; }

Target:
public Object parse(ElementInstance instance, Node node, Object value) throws Exception { String wkName = (String) node.getChildValue("WellKnownName"); Stroke stroke = (Stroke) node.getChildValue("Stroke"); Fill fill = (Fill) node.getChildValue("Fill"); Mark mark = styleFactory.createMark(); if (wkName != null) { if (wkName.startsWith("file://")) { URL url = resourceLocator.locateResource(wkName); if (url != null) { wkName = url.toExternalForm(); } else { LOGGER.log(Level.WARNING, "Could not resolve location of " + wkName); } } mark.setWellKnownName(filterFactory.literal(wkName)); } mark.setStroke(stroke); mark.setFill(fill); return mark; }
Source:
public MetricPublicationArbiter( Map<MetricName, Set<DeduplicatingFilterHolder>> singleMetricFilters) { this.singleMetricFilters = singleMetricFilters; }

Target:
MetricPublicationArbiter(Map<MetricName, Set<DeduplicatingFilterHolder>> singleMetricFilters) { this.singleMetricFilters = singleMetricFilters; }
Source:
private HashMap<String, String> buildConfirmationEmailPersonalisationFrom(ChargeEntity charge) { GatewayAccountEntity gatewayAccount = charge.getGatewayAccount(); EmailNotificationEntity emailNotification = gatewayAccount .getEmailNotifications().get(EmailNotificationType.PAYMENT_CONFIRMED); String customParagraph = emailNotification != null ? emailNotification.getTemplateBody() : ""; HashMap<String, String> map = new HashMap<>(); map.put("serviceReference", charge.getReference().toString()); map.put("date", DateTimeUtils.toUserFriendlyDate(charge.getCreatedDate())); Long amount = charge.getCorporateSurcharge() .map(corporateSurcharge -> CorporateCardSurchargeCalculator.getTotalAmountFor(charge)) .orElse(charge.getAmount()); map.put("amount", formatToPounds(amount)); map.put("description", charge.getDescription()); map.put("customParagraph", isBlank(customParagraph) ? "" : "^ " + customParagraph); map.put("serviceName", StringUtils.defaultString(gatewayAccount.getServiceName())); String corporateSurchargeMsg = charge.getCorporateSurcharge() .map(corporateSurcharge -> String.format("Your payment includes a fee of £%s for using a corporate credit or debit card.", formatToPounds(corporateSurcharge))) .orElse(""); map.put("corporateCardSurcharge", corporateSurchargeMsg); return map; }

Target:
private HashMap<String, String> buildConfirmationEmailPersonalisationFrom(ChargeEntity charge) { GatewayAccountEntity gatewayAccount = charge.getGatewayAccount(); EmailNotificationEntity emailNotification = gatewayAccount .getEmailNotifications().get(EmailNotificationType.PAYMENT_CONFIRMED); String customParagraph = emailNotification != null ? emailNotification.getTemplateBody() : ""; HashMap<String, String> map = new HashMap<>(); map.put("serviceReference", charge.getReference().toString()); map.put("date", DateTimeUtils.toUserFriendlyDate(charge.getCreatedDate())); map.put("amount", formatToPounds(CorporateCardSurchargeCalculator.getTotalAmountFor(charge))); map.put("description", charge.getDescription()); map.put("customParagraph", isBlank(customParagraph) ? "" : "^ " + customParagraph); map.put("serviceName", StringUtils.defaultString(gatewayAccount.getServiceName())); String corporateSurchargeMsg = charge.getCorporateSurcharge() .map(corporateSurcharge -> String.format("Your payment includes a fee of £%s for using a corporate credit or debit card.", formatToPounds(corporateSurcharge))) .orElse(""); map.put("corporateCardSurcharge", corporateSurchargeMsg); return map; }
Source:
protected DefaultHttpRequestRetryStrategy( final int maxRetries, final TimeValue defaultRetryInterval, final Collection<Class<? extends IOException>> clazzes, final Collection<Integer> codes) { Args.notNegative(maxRetries, "maxRetries"); Args.positive(defaultRetryInterval.getDuration(), "defaultRetryInterval"); this.maxRetries = maxRetries; this.defaultRetryInterval = defaultRetryInterval; this.nonRetriableClasses = new HashSet<>(); this.nonRetriableClasses.addAll(clazzes); this.retriableCodes = new HashSet<>(); this.retriableCodes.addAll(codes); }

Target:
protected DefaultHttpRequestRetryStrategy( final int maxRetries, final TimeValue defaultRetryInterval, final Collection<Class<? extends IOException>> clazzes, final Collection<Integer> codes) { Args.notNegative(maxRetries, "maxRetries"); Args.positive(defaultRetryInterval.getDuration(), "defaultRetryInterval"); this.maxRetries = maxRetries; this.defaultRetryInterval = defaultRetryInterval; this.nonRetriableIOExceptionClasses = new HashSet<>(clazzes); this.retriableCodes = new HashSet<>(codes); }
Source:
public void validate(IValidatable<String> iv) { String name = (String) iv.getValue(); LayerGroupInfo other = getCatalog().getLayerGroupByName(name); if(other != null && (layerGroupId == null || !other.getId().equals(layerGroupId))) { iv.error(new ValidationError("duplicateGroupNameError")); } }

Target:
public void validate(IValidatable<String> iv) { String name = (String) iv.getValue(); LayerGroupInfo other = getCatalog().getLayerGroupByName(name); if(other != null && (layerGroupId == null || !other.getId().equals(layerGroupId))) { iv.error(new ValidationError("duplicateGroupNameError").setVariable("name", name)); } }
Source:
private String getLocalHCID() { String localHCID = null; try { localHCID = propertyAccessor.getProperty(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.HOME_COMMUNITY_ID_PROPERTY); } catch (PropertyAccessException ex) { LOG.error("Exception while retrieving home community ID", ex); } return localHCID; }

Target:
private String getLocalHCID() { String localHCID = null; try { localHCID = propertyAccessor.getProperty(NhincConstants.GATEWAY_PROPERTY_FILE, NhincConstants.HOME_COMMUNITY_ID_PROPERTY); } catch (PropertyAccessException ex) { LOG.error("Exception while retrieving home community ID : " + ex.getLocalizedMessage(), ex); } return localHCID; }
Source:
void assignExclusiveSegments() throws IOException { bufferManager.requestExclusiveBuffers(); }

Target:
void assignExclusiveSegments() throws IOException { checkState(bufferManager.unsynchronizedGetAvailableExclusiveBuffers() == 0, "Bug in input channel setup logic: exclusive buffers have already been set for this input channel."); if (initialCredit > 0) { bufferManager.requestExclusiveBuffers(); } }
Source:
public void designDocSync() throws MalformedURLException { DesignDocument designDoc = DesignDocumentManager.fromFile(designDocExample); db.getDesignDocumentManager().put(designDoc); }

Target:
public void designDocSync() throws Exception { DesignDocument designDoc = DesignDocumentManager.fromFile(designDocExample); db.getDesignDocumentManager().put(designDoc); }
Source:
public ObaStopResponse getStopDetails(String stopId) { ObaStopResponse response = new ObaStopRequest.Builder(stopId).build().call(); log.debug("ObaStopRequest returned " + response.toString()); return response; }

Target:
public ObaStopResponse getStopDetails(String stopId) throws SpeechletException { ObaStopResponse response = new ObaStopRequest.Builder(stopId).build().call(); log.debug("ObaStopRequest returned " + response.toString()); if (response.getCode() == ObaApi.OBA_OK) { return response; } else { throw new SpeechletException(String.format("Error getting stop details for %s", stopId)); } }
Source:
public HttpConnectionInterceptorContext interceptResponse(HttpConnectionInterceptorContext context) { try { HttpURLConnection urlConnection = context.connection.getConnection(); int code = urlConnection.getResponseCode(); if (code != 429) { return context; } AtomicInteger attemptCounter = context.getState(this, "attempt", AtomicInteger.class); if (attemptCounter == null) { context.setState(this, "attempt", (attemptCounter = new AtomicInteger())); } int attempt = attemptCounter.getAndIncrement(); if (attempt < numberOfReplays && context.connection.getNumberOfRetriesRemaining() > 0) { long sleepTime = 0l; String retryAfter = (preferRetryAfter) ? urlConnection.getHeaderField ("Retry-After") : null; if (retryAfter != null) { sleepTime = Long.parseLong(retryAfter) * 1000; } else { sleepTime = initialSleep * Math.round(Math.pow(2, attempt)); } InputStream errorStream = urlConnection.getErrorStream(); try { String errorString = IOUtils.toString(errorStream, "UTF-8"); logger.warning(errorString + " will retry in " + sleepTime + " ms"); } finally { errorStream.close(); } logger.fine("Too many requests backing off for " + sleepTime + " ms."); try { TimeUnit.MILLISECONDS.sleep(sleepTime); } catch (InterruptedException e) { logger.fine("Interrupted during 429 backoff wait."); } context.replayRequest = true; return context; } else { return context; } } catch (IOException e) { throw new HttpConnectionInterceptorException(e); } }

Target:
public HttpConnectionInterceptorContext interceptResponse(HttpConnectionInterceptorContext context) { try { HttpURLConnection urlConnection = context.connection.getConnection(); int code = urlConnection.getResponseCode(); if (code != 429) { return context; } AtomicInteger attemptCounter = context.getState(this, ATTEMPT, AtomicInteger.class); if (attemptCounter == null) { context.setState(this, ATTEMPT, (attemptCounter = new AtomicInteger())); } int attempt = attemptCounter.getAndIncrement(); if (attempt < numberOfReplays && context.connection.getNumberOfRetriesRemaining() > 0) { long sleepTime = initialSleep * Math.round(Math.pow(2, attempt)); String retryAfter = preferRetryAfter ? urlConnection.getHeaderField ("Retry-After") : null; if (retryAfter != null) { try { sleepTime = Long.parseLong(retryAfter) * 1000; if (sleepTime > RETRY_AFTER_CAP) { sleepTime = RETRY_AFTER_CAP; logger.severe("Server specified Retry-After value in excess of one " + "hour, capping retry."); } } catch (NumberFormatException nfe) { logger.warning("Invalid Retry-After value from server falling back to " + "default backoff."); } } InputStream errorStream = urlConnection.getErrorStream(); try { String errorString = IOUtils.toString(errorStream, "UTF-8"); logger.warning(errorString + " will retry in " + sleepTime + " ms"); } finally { errorStream.close(); } logger.fine("Too many requests backing off for " + sleepTime + " ms."); try { TimeUnit.MILLISECONDS.sleep(sleepTime); } catch (InterruptedException e) { logger.fine("Interrupted during 429 backoff wait."); } context.replayRequest = true; return context; } else { return context; } } catch (IOException e) { throw new HttpConnectionInterceptorException(e); } }
Source:
public void test_evaluate_array_strings () { final AtomicReferenceArray<String> atomicStringArray = new AtomicReferenceArray<>(3); atomicStringArray.set(0, "executing"); browser.addProgressListener(new ProgressListener() { @Override public void changed(ProgressEvent event) { } @Override public void completed(ProgressEvent event) { Object[] evalResult = (Object[]) browser.evaluate("return new Array(\"str1\", \"str2\", \"str3\")"); atomicStringArray.set(0, (String) evalResult[0]); atomicStringArray.set(1, (String) evalResult[1]); atomicStringArray.set(2, (String) evalResult[2]); if (browser_debug) System.out.println("Node value: "+ evalResult); } }); browser.setText("<html><body><p id='myid'>HelloWorld</p></body></html>"); shell.open(); for (int i = 0; i < (loopMultipier * secondsToWaitTillFail); i++) { runLoopTimer(waitMS); if (! "executing".equals(atomicStringArray.get(0))) { if (atomicStringArray.get(0).equals("str1") && atomicStringArray.get(1).equals("str2") && atomicStringArray.get(2).equals("str3")) { return; } else { System.err.println("ERROR: test_evaluate_array_strings, resulting strings not as expected"); } } } fail(name.getMethodName() + " failed. Excpected an array of strings, but did not receive array or got the wrong result."); }

Target:
public void test_evaluate_array_strings () { assumeFalse(webkit1SkipMsg(), isWebkit1); final AtomicReferenceArray<String> atomicStringArray = new AtomicReferenceArray<>(3); atomicStringArray.set(0, "executing"); browser.addProgressListener(new ProgressListener() { @Override public void changed(ProgressEvent event) { } @Override public void completed(ProgressEvent event) { Object[] evalResult = (Object[]) browser.evaluate("return new Array(\"str1\", \"str2\", \"str3\")"); atomicStringArray.set(0, (String) evalResult[0]); atomicStringArray.set(1, (String) evalResult[1]); atomicStringArray.set(2, (String) evalResult[2]); if (browser_debug) System.out.println("Node value: "+ evalResult); } }); browser.setText("<html><body><p id='myid'>HelloWorld</p></body></html>"); shell.open(); for (int i = 0; i < (loopMultipier * secondsToWaitTillFail); i++) { runLoopTimer(waitMS); if (! "executing".equals(atomicStringArray.get(0))) { if (atomicStringArray.get(0).equals("str1") && atomicStringArray.get(1).equals("str2") && atomicStringArray.get(2).equals("str3")) { return; } else { fail("Resulting strings in array are not as expected"); } } } fail("Expected an array of strings, but did not receive array or got the wrong result."); }
Source:
protected String getRequestParameterAsString( String parameter, String defaultValue, String encoding ) throws UnsupportedEncodingException { String enc = StringUtils.isEmpty( encoding ) ? CharsetHelper.getEncoding() : encoding; if( getRequestParameters() != null && getRequestParameters().hasParameter( parameter ) ){ return URLDecoder.decode( getRequestParameters().getStringParameter( parameter, defaultValue ) ); } return defaultValue; }

Target:
protected String getRequestParameterAsString( String parameter, String defaultValue, String encoding ) throws UnsupportedEncodingException { String enc = StringUtils.isEmpty( encoding ) ? CharsetHelper.getEncoding() : encoding; if( getRequestParameters() != null && getRequestParameters().hasParameter( parameter ) ){ return URLDecoder.decode( getRequestParameters().getStringParameter( parameter, defaultValue ), enc ); } return defaultValue; }
Source:
public KlvNumericalDataElement( final byte[] key, final String name, Optional<T> errorIndicatorValue) { super(key, name); Preconditions.checkArgument( errorIndicatorValue.isPresent(), "The errorIndicatorValue cannot be null."); this.errorIndicatorValue = errorIndicatorValue; }

Target:
public KlvNumericalDataElement( final byte[] key, final String name, Optional<T> errorIndicatorValue) { super(key, name); this.errorIndicatorValue = errorIndicatorValue; }
Source:
public void updateUploadItem(int index, UploadItem uploadItem) { UploadItem uploadItem1 = items.get(index); uploadItem1.setDescriptions(uploadItem.descriptions); uploadItem1.setTitle(uploadItem.title); store.putString("Title", uploadItem.place.getName()); }

Target:
public void updateUploadItem(int index, UploadItem uploadItem) { UploadItem uploadItem1 = items.get(index); uploadItem1.setDescriptions(uploadItem.descriptions); uploadItem1.setTitle(uploadItem.title); }
Source:
public void zap(Entity entity, Charge.DamageOrigin origin, float damage) { if (Game.isClient(entity.world)) return; if (!RCEntitySelectors.KILLABLE.test(entity)) return; double chargeCost = damage * CHARGE_PER_DAMAGE; if (hasCapacity(chargeCost)) { float remainingDamage = damage; if (entity instanceof EntityLivingBase) { EntityLivingBase livingEntity = (EntityLivingBase) entity; EnumMap<EntityEquipmentSlot, IChargeProtectionItem> protections = new EnumMap<>(EntityEquipmentSlot.class); EnumSet.allOf(EntityEquipmentSlot.class).forEach(slot -> { IChargeProtectionItem protection = getChargeProtection(livingEntity, slot); if (protection != null) protections.put(slot, protection); } ); for (Map.Entry<EntityEquipmentSlot, IChargeProtectionItem> e : protections.entrySet()) { if (remainingDamage > 0.1) { IChargeProtectionItem.ZapResult result = e.getValue().zap(livingEntity.getItemStackFromSlot(e.getKey()), livingEntity, remainingDamage); entity.setItemStackToSlot(e.getKey(), result.stack); remainingDamage -= result.damagePrevented; } else break; } } if (remainingDamage > 0.1 && entity.attackEntityFrom(origin == Charge.DamageOrigin.BLOCK ? RailcraftDamageSource.ELECTRIC : RailcraftDamageSource.TRACK_ELECTRIC, remainingDamage)) { removeCharge(chargeCost); HostEffects.INSTANCE.zapEffectDeath(entity.world, entity); } } }

Target:
public void zap(Entity entity, Charge.DamageOrigin origin, float damage) { if (Game.isClient(entity.world)) return; if (!RCEntitySelectors.KILLABLE.test(entity)) return; double chargeCost = damage * CHARGE_PER_DAMAGE; if (hasCapacity(chargeCost)) { float remainingDamage = damage; if (entity instanceof EntityLivingBase) { EntityLivingBase livingEntity = (EntityLivingBase) entity; EnumMap<EntityEquipmentSlot, IChargeProtectionItem> protections = new EnumMap<>(EntityEquipmentSlot.class); EnumSet.allOf(EntityEquipmentSlot.class).forEach(slot -> { IChargeProtectionItem protection = getChargeProtection(livingEntity, slot); if (protection != null) protections.put(slot, protection); } ); for (Map.Entry<EntityEquipmentSlot, IChargeProtectionItem> e : protections.entrySet()) { if (remainingDamage > 0.1) { IChargeProtectionItem.ZapResult result = e.getValue().zap(livingEntity.getItemStackFromSlot(e.getKey()), livingEntity, remainingDamage); entity.setItemStackToSlot(e.getKey(), result.stack); remainingDamage -= result.damagePrevented; } else break; } } if (remainingDamage > 0.1 && entity.attackEntityFrom(origin == Charge.DamageOrigin.BLOCK ? RailcraftDamageSource.ELECTRIC : RailcraftDamageSource.TRACK_ELECTRIC, remainingDamage)) { removeCharge(chargeCost); Charge.hostEffects().zapEffectDeath(entity.world, entity); } } }
Source:
public byte[] toByteArray() { if (rawMessage != null) { return rawMessage; } if (byteArray == null) { DatagramWriter writer = new DatagramWriter(); writer.write(getMessageType().getCode(), MESSAGE_TYPE_BITS); writer.write(getMessageLength(), MESSAGE_LENGTH_BITS); writer.write(messageSeq, MESSAGE_SEQ_BITS); writer.write(getFragmentOffset(), FRAGMENT_OFFSET_BITS); writer.write(getFragmentLength(), FRAGMENT_LENGTH_BITS); byte[] fragmentByteArray = fragmentToByteArray(); writer.writeBytes(fragmentByteArray); byteArray = writer.toByteArray(); } return byteArray; }

Target:
public byte[] toByteArray() { if (rawMessage != null) { return rawMessage; } if (byteArray == null) { int fragmentLength = getFragmentLength(); DatagramWriter writer = new DatagramWriter(fragmentLength + MESSAGE_HEADER_LENGTH_BYTES); writer.write(getMessageType().getCode(), MESSAGE_TYPE_BITS); writer.write(getMessageLength(), MESSAGE_LENGTH_BITS); writer.write(messageSeq, MESSAGE_SEQ_BITS); writer.write(getFragmentOffset(), FRAGMENT_OFFSET_BITS); writer.write(fragmentLength, FRAGMENT_LENGTH_BITS); writer.writeBytes(fragmentToByteArray()); byteArray = writer.toByteArray(); } return byteArray; }
Source:
public Docs docs() { return new MkDocs(this.dir, this.name.replace("[^a-z0-9]", "/")); }

Target:
public Docs docs() { return new MkDocs(this.dir, this.name.replaceAll("[^a-z0-9]", "/")); }
Source:
public void dispose() { super.dispose(); fBuildThreadMap.values().forEach(buildThread -> { buildThread.cancel(); }); if (fZoomThread != null) { fZoomThread.cancel(); } ResourcesPlugin.getWorkspace().removeResourceChangeListener(this); getSite().getPage().removePartListener(fPartListener); }

Target:
public void dispose() { super.dispose(); synchronized (fBuildThreadMap) { fBuildThreadMap.values().forEach(buildThread -> { buildThread.cancel(); }); } if (fZoomThread != null) { fZoomThread.cancel(); } ResourcesPlugin.getWorkspace().removeResourceChangeListener(this); getSite().getPage().removePartListener(fPartListener); }
Source:
public static void createDatanodeIdFile(DatanodeDetails datanodeDetails, File path) throws IOException { Preconditions.checkNotNull(path); DumperOptions options = new DumperOptions(); options.setPrettyFlow(true); options.setDefaultFlowStyle(DumperOptions.FlowStyle.FLOW); Yaml yaml = new Yaml(options); try (Writer writer = new OutputStreamWriter( new FileOutputStream(path), "UTF-8")) { yaml.dump(getDatanodeDetailsYaml(datanodeDetails), writer); } }

Target:
public static void createDatanodeIdFile(DatanodeDetails datanodeDetails, File path) throws IOException { DumperOptions options = new DumperOptions(); options.setPrettyFlow(true); options.setDefaultFlowStyle(DumperOptions.FlowStyle.FLOW); Yaml yaml = new Yaml(options); try (Writer writer = new OutputStreamWriter( new FileOutputStream(path), "UTF-8")) { yaml.dump(getDatanodeDetailsYaml(datanodeDetails), writer); } }
Source:
private Entity toEntity(EntityType entityType, Entity emxEntity) { Entity entity = entityManager.create(entityType, POPULATE); for (Attribute attr : entityType.getAtomicAttributes()) { if (attr.getExpression() == null && !attr.isMappedBy()) { String attrName = attr.getName(); Object emxValue = emxEntity.get(attrName); AttributeType attrType = attr.getDataType(); switch (attrType) { case BOOL: case DATE: case DATE_TIME: case DECIMAL: case EMAIL: case ENUM: case HTML: case HYPERLINK: case INT: case LONG: case SCRIPT: case STRING: case TEXT: Object value = emxValue != null ? DataConverter.convert(emxValue, attr) : null; if ((!attr.isAuto() || value != null) && (!attr.hasDefaultValue() || value != null)) { entity.set(attrName, value); } break; case CATEGORICAL: case FILE: case XREF: Entity refEntity = toRefEntity(attr, emxValue); if ((!attr.isAuto() || refEntity != null) && (!attr.hasDefaultValue() || refEntity != null)) { entity.set(attrName, refEntity); } break; case CATEGORICAL_MREF: case MREF: List<Entity> refEntities = toRefEntities(attr, emxValue); if (!refEntities.isEmpty()) { entity.set(attrName, refEntities); } break; case COMPOUND://Since this is inside a "atomic attributes" loop this should not be possible default: throw new UnexpectedEnumException(attrType); } } } return entity; }

Target:
private Entity toEntity(EntityType entityType, Entity emxEntity) { Entity entity = entityManager.create(entityType, POPULATE); for (Attribute attr : entityType.getAtomicAttributes()) { if (attr.getExpression() == null && !attr.isMappedBy()) { String attrName = attr.getName(); Object emxValue = emxEntity.get(attrName); AttributeType attrType = attr.getDataType(); switch (attrType) { case BOOL: case DATE: case DATE_TIME: case DECIMAL: case EMAIL: case ENUM: case HTML: case HYPERLINK: case INT: case LONG: case SCRIPT: case STRING: case TEXT: Object value = emxValue != null ? DataConverter.convert(emxValue, attr) : null; if ((!attr.isAuto() || value != null) && (!attr.hasDefaultValue() || value != null)) { entity.set(attrName, value); } break; case CATEGORICAL: case FILE: case XREF: Entity refEntity = toRefEntity(attr, emxValue); if ((!attr.isAuto() || refEntity != null) && (!attr.hasDefaultValue() || refEntity != null)) { entity.set(attrName, refEntity); } break; case CATEGORICAL_MREF: case MREF: List<Entity> refEntities = toRefEntities(attr, emxValue); if (!refEntities.isEmpty()) { entity.set(attrName, refEntities); } break; case COMPOUND://Since this is inside a "atomic attributes" loop this should not be possible throw new IllegalStateException("COMPOUND should never occur inside a 'atomic' loop"); default: throw new UnexpectedEnumException(attrType); } } } return entity; }
Source:
private static PatternCondition<PsiElement> positionInTuple(final int position) { return new PatternCondition<PsiElement>("positionInTuple") { @Override public boolean accepts(@NotNull PsiElement element, ProcessingContext context) { ErlangTupleExpression tuple = PsiTreeUtil.getParentOfType(element, ErlangTupleExpression.class); ErlangExpression expression = PsiTreeUtil.getParentOfType(element, ErlangExpression.class); List<ErlangExpression> expressions = tuple != null ? tuple.getExpressionList() : ContainerUtil.<ErlangExpression>emptyList(); return expressions.size() > position && expressions.get(position).equals(expression); } }; }

Target:
private static PatternCondition<PsiElement> positionInTuple(final int position) { return new PatternCondition<PsiElement>("positionInTuple") { @Override public boolean accepts(@NotNull PsiElement element, ProcessingContext context) { ErlangTupleExpression tuple = PsiTreeUtil.getParentOfType(element, ErlangTupleExpression.class); ErlangExpression expression = PsiTreeUtil.getParentOfType(element, ErlangExpression.class); List<ErlangExpression> expressions = tuple != null ? tuple.getExpressionList() : ContainerUtil.<ErlangExpression>emptyList(); return expressions.size() > position && expressions.get(position) == expression; } }; }
Source:
private synchronized void loadConfig() throws IOException { Resource configFile = findConfigFile(); checkNotNull(configFile, "gwc config file does not exist: ", GWC_CONFIG_FILE); XStreamPersister xmlPersister = this.persisterFactory.createXMLPersister(); configureXstream(xmlPersister.getXStream()); try { InputStream in = configFile.in(); try { this.config = xmlPersister.load(in, GWCConfig.class); } finally { in.close(); } LOGGER.fine("GWC GeoServer specific configuration loaded from " + GWC_CONFIG_FILE); } catch (Exception e) { LOGGER.log( Level.WARNING, "Error loading GWC GeoServer specific " + "configuration from " + configFile.path() + ". Applying defaults.", e); this.config = new GWCConfig(); } }

Target:
private synchronized void loadConfig() throws IOException { Resource configFile = findConfigFile(); checkNotNull(configFile, "gwc config file does not exist: ", GWC_CONFIG_FILE); XStreamPersister xmlPersister = this.persisterFactory.createXMLPersister(); configureXstream(xmlPersister.getXStream()); try { try (InputStream in = configFile.in()) { this.config = xmlPersister.load(in, GWCConfig.class); } LOGGER.fine("GWC GeoServer specific configuration loaded from " + GWC_CONFIG_FILE); } catch (Exception e) { LOGGER.log( Level.WARNING, "Error loading GWC GeoServer specific " + "configuration from " + configFile.path() + ". Applying defaults.", e); this.config = new GWCConfig(); } }
Source:
public void exit() { mOffload.stop(); mUpstreamNetworkMonitor.stop(); notifyDownstreamsOfNewUpstreamIface(null); handleNewUpstreamNetworkState(null); if (mTetherUpstream != null) { mTetherUpstream = null; reportUpstreamChanged(null); } mBpfTetheringCoordinator.stop(); }

Target:
public void exit() { mOffload.stop(); mUpstreamNetworkMonitor.stop(); notifyDownstreamsOfNewUpstreamIface(null); handleNewUpstreamNetworkState(null); if (mTetherUpstream != null) { mTetherUpstream = null; reportUpstreamChanged(null); } mBpfCoordinator.stop(); }
Source:
private Class<?> loadPdxClass(String className) { try { return loadClass(className); } catch (ClassNotFoundException ex) { throw new JdbcConnectorException( "The pdx class \"" + className + "\" could not be loaded because: " + ex); } }

Target:
private Class<?> loadPdxClass(String className) { try { return ClassPathLoader.getLatest().forName(className); } catch (ClassNotFoundException ex) { throw new JdbcConnectorException( "The pdx class \"" + className + "\" could not be loaded because: " + ex); } }
Source:
private Boolean compareValues(Session session, Object left, Object right) { if (left == null) { if (right == null && opType == OpTypes.NOT_DISTINCT) { return Boolean.TRUE; } return null; } if (right == null) { return null; } int result = nodes[LEFT].dataType.compare(left, right); switch (opType) { case OpTypes.EQUAL : case OpTypes.NOT_DISTINCT : return result == 0 ? Boolean.TRUE : Boolean.FALSE; case OpTypes.NOT_EQUAL : return result != 0 ? Boolean.TRUE : Boolean.FALSE; case OpTypes.GREATER : return result > 0 ? Boolean.TRUE : Boolean.FALSE; case OpTypes.GREATER_EQUAL : return result >= 0 ? Boolean.TRUE : Boolean.FALSE; case OpTypes.SMALLER_EQUAL : return result <= 0 ? Boolean.TRUE : Boolean.FALSE; case OpTypes.SMALLER : return result < 0 ? Boolean.TRUE : Boolean.FALSE; default : throw Error.runtimeError(ErrorCode.U_S0500, "Expression"); } }

Target:
private Boolean compareValues(Session session, Object left, Object right) { if (left == null) { if (opType == OpTypes.NOT_DISTINCT) { return right == null; } return null; } if (right == null) { return (opType == OpTypes.NOT_DISTINCT) ? Boolean.FALSE : null; } int result = nodes[LEFT].dataType.compare(left, right); switch (opType) { case OpTypes.EQUAL : case OpTypes.NOT_DISTINCT : return result == 0 ? Boolean.TRUE : Boolean.FALSE; case OpTypes.NOT_EQUAL : return result != 0 ? Boolean.TRUE : Boolean.FALSE; case OpTypes.GREATER : return result > 0 ? Boolean.TRUE : Boolean.FALSE; case OpTypes.GREATER_EQUAL : return result >= 0 ? Boolean.TRUE : Boolean.FALSE; case OpTypes.SMALLER_EQUAL : return result <= 0 ? Boolean.TRUE : Boolean.FALSE; case OpTypes.SMALLER : return result < 0 ? Boolean.TRUE : Boolean.FALSE; default : throw Error.runtimeError(ErrorCode.U_S0500, "Expression"); } }
Source:
public HypervisorUpdateJobConfig() { this.setJobKey(JOB_KEY) .setJobName(JOB_NAME); }

Target:
public HypervisorUpdateJobConfig() { this.setJobKey(JOB_KEY) .setJobName(JOB_NAME) .addConstraint(JobConstraints.uniqueByArgument(OWNER_KEY)); }
Source:
public Response setRoutingData(String jsonContent) { try { Map<String, List<String>> routingData = new ObjectMapper() .readValue(jsonContent, new TypeReference<HashMap<String, List<String>>>() { }); _metadataStoreDirectory.setNamespaceRoutingData(_namespace, routingData); } catch (JsonMappingException | JsonParseException | IllegalArgumentException e) { return badRequest(e.getMessage()); } catch (IOException e) { return serverError(e); } return created(); }

Target:
public Response setRoutingData(String jsonContent) { try { Map<String, List<String>> routingData = OBJECT_MAPPER.readValue(jsonContent, new TypeReference<HashMap<String, List<String>>>() { }); _metadataStoreDirectory.setNamespaceRoutingData(_namespace, routingData); } catch (JsonMappingException | JsonParseException | IllegalArgumentException e) { return badRequest(e.getMessage()); } catch (IOException e) { return serverError(e); } return created(); }