auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean checkDomainMetadataDevices(StorageDomain domain) { if (domain.getVgMetadataDevice() == null || domain.getFirstMetadataDevice() == null) { AuditLogable logable = new AuditLogableImpl(); logable.setStorageDomainName(domain.getName()); auditLogDirector.log(logable, AuditLogType.FAILED_DETERMINE_STORAGE_DOMAIN_METADATA_DEVICES); return false; } return true; }

Target:
public boolean checkDomainMetadataDevices(StorageDomain domain) { if (domain.getVgMetadataDevice() == null || domain.getFirstMetadataDevice() == null) { AuditLogable logable = new AuditLogableImpl(); logable.setStorageDomainName(domain.getName()); logable.setStorageDomainId(domain.getId()); auditLogDirector.log(logable, AuditLogType.FAILED_DETERMINE_STORAGE_DOMAIN_METADATA_DEVICES); return false; } return true; }
Source:
private void fetchMediaList() { if (!NetworkUtils.isNetworkAvailable(this)) { return; } FetchMediaListPayload payload = new FetchMediaListPayload(mSite, MediaStore.DEFAULT_NUM_MEDIA_PER_FETCH, false); mDispatcher.dispatch(MediaActionBuilder.newFetchMediaListAction(payload)); }

Target:
private void fetchMediaList() { if (!NetworkUtils.isNetworkAvailable(this)) { mNetworkErrorOnLastMediaFetchAttempt = true; return; } FetchMediaListPayload payload = new FetchMediaListPayload(mSite, MediaStore.DEFAULT_NUM_MEDIA_PER_FETCH, false); mDispatcher.dispatch(MediaActionBuilder.newFetchMediaListAction(payload)); }
Source:
public F.Promise<Result> getHeaderViewModel() { return F.Promise.pure(ok(views.html.HeaderViewModel.render( _telemetryEnabled, _liveLoggingEnabled, _hostRegistryEnabled, _expressionsEnabled, _alertsEnabled))); }

Target:
public F.Promise<Result> getHeaderViewModel() { return F.Promise.pure(ok(views.html.HeaderViewModel.render(_features))); }
Source:
public boolean updateFragment(String fragmentId, boolean isGuaranteed) { synchronized (lock) { TaskWrapper taskWrapper = knownTasks.get(fragmentId); if (taskWrapper == null) { LOG.debug("Fragment not found {}", fragmentId); return false; } if (taskWrapper.isGuaranteed() == isGuaranteed) return true; LOG.debug("Fragment guaranteed state changed to {}; finishable {}, in wait queue {}, " + "in preemption queue {}", taskWrapper.getRequestId(), isGuaranteed, taskWrapper.canFinishForPriority(), taskWrapper.isInWaitQueue(), taskWrapper.isInPreemptionQueue()); if (taskWrapper.isInWaitQueue()) { boolean isRemoved = waitQueue.remove(taskWrapper); taskWrapper.updateIsGuaranteed(isGuaranteed); forceReinsertIntoQueue(taskWrapper, isRemoved); } else { if (isGuaranteed) { removeFromPreemptionQueue(taskWrapper); } else { removeFromPreemptionQueue(taskWrapper); taskWrapper.updateIsGuaranteed(false); addToPreemptionQueue(taskWrapper); } } lock.notifyAll(); return true; } }

Target:
public boolean updateFragment(String fragmentId, boolean isGuaranteed) { synchronized (lock) { TaskWrapper taskWrapper = knownTasks.get(fragmentId); if (taskWrapper == null) { LOG.debug("Fragment not found {}", fragmentId); return false; } if (taskWrapper.isGuaranteed() == isGuaranteed) return true; LOG.debug("Fragment guaranteed state changed to {}; finishable {}, in wait queue {}, " + "in preemption queue {}", taskWrapper.getRequestId(), isGuaranteed, taskWrapper.canFinishForPriority(), taskWrapper.isInWaitQueue(), taskWrapper.isInPreemptionQueue()); if (isGuaranteed && taskWrapper.isInPreemptionQueue() && taskWrapper.canFinishForPriority()) { removeFromPreemptionQueue(taskWrapper); } if (taskWrapper.isInWaitQueue()) { boolean isRemoved = waitQueue.remove(taskWrapper); taskWrapper.updateIsGuaranteed(isGuaranteed); forceReinsertIntoQueue(taskWrapper, isRemoved); } else { taskWrapper.updateIsGuaranteed(isGuaranteed); if (!isGuaranteed && !taskWrapper.isInPreemptionQueue()) { addToPreemptionQueue(taskWrapper); } } lock.notifyAll(); return true; } }
Source:
public GetSessionInfoResponse getSession(final String iccid) { final GetSessionInfoRequest getSessionInfoRequest = WS_CLIENT_FACTORY.createGetSessionInfoRequest(); getSessionInfoRequest.setLicenseKey(this.jasperWirelessTerminalAccess.getLicenseKey()); getSessionInfoRequest.setMessageId(this.correlationIdProviderService.getCorrelationId("messageID", iccid)); getSessionInfoRequest.setVersion(this.jasperWirelessTerminalAccess.getApiVersion()); getSessionInfoRequest.getIccid().add(iccid); for (final ClientInterceptor interceptor : this.webServiceTemplate.getInterceptors()) { if (interceptor instanceof Wss4jSecurityInterceptor) { setUsernameToken((Wss4jSecurityInterceptor) interceptor, this.jasperWirelessTerminalAccess.getUsername(), this.jasperWirelessTerminalAccess.getPassword()); } } this.webServiceTemplate.setDefaultUri(this.jasperWirelessTerminalAccess.getTerminalUri()); return (GetSessionInfoResponse) this.webServiceTemplate.marshalSendAndReceive(getSessionInfoRequest, new SoapActionCallback("<LINK_0>")); }

Target:
public GetSessionInfoResponse getSession(final String iccid) { final GetSessionInfoRequest getSessionInfoRequest = WS_CLIENT_FACTORY.createGetSessionInfoRequest(); getSessionInfoRequest.setLicenseKey(this.jasperWirelessTerminalAccess.getLicenseKey()); getSessionInfoRequest.setMessageId(this.correlationIdProviderService.getCorrelationId("messageID", iccid)); getSessionInfoRequest.setVersion(this.jasperWirelessTerminalAccess.getApiVersion()); getSessionInfoRequest.getIccid().add(iccid); for (final ClientInterceptor interceptor : this.webServiceTemplate.getInterceptors()) { if (interceptor instanceof Wss4jSecurityInterceptor) { setUsernameToken((Wss4jSecurityInterceptor) interceptor, this.jasperWirelessTerminalAccess.getUsername(), this.jasperWirelessTerminalAccess.getPassword()); } } this.webServiceTemplate.setDefaultUri(this.jasperWirelessTerminalAccess.getUri()); return (GetSessionInfoResponse) this.webServiceTemplate.marshalSendAndReceive(getSessionInfoRequest, new SoapActionCallback("<LINK_0>")); }
Source:
public AttemptResult<Void> process() { if (stack == null || instanceMetaDataSet == null || instanceMetaDataSet.isEmpty()) { return AttemptResults.breakFor("stack or instance data is empty"); } Optional<PollGroup> pollGroup = Optional.ofNullable(InMemoryStateStore.getStack(stack.getId())); if (pollGroup.isEmpty() || PollGroup.CANCELLED.equals(pollGroup.get())) { LOGGER.info("FreeIpa polling cancelled in inMemory store."); return AttemptResults.breakFor("FreeIpa polling cancelled in inMemory store"); } for (InstanceMetaData instanceMetaData : instanceMetaDataSet) { try { RPCResponse<Boolean> result = checkedMeasure(() -> freeIpaHealthDetailsService.checkFreeIpaHealth(stack, instanceMetaData), LOGGER, ":::Freeipa start::: FreeIPA health check ran in {}ms"); if (result.getResult()) { LOGGER.debug("Freeipa services are available and freeipa is working (on instance: {})", instanceMetaData.getInstanceId()); return AttemptResults.finishWith(null); } else { LOGGER.debug("Freeipa services are available, but freeipa is not working (on instance: {})", instanceMetaData.getInstanceId()); } } catch (Exception e) { LOGGER.debug("Freeipa services have not been available yet (on instance: {})", instanceMetaData.getInstanceId()); } } return AttemptResults.justContinue(); }

Target:
public AttemptResult<Void> process() { Optional<PollGroup> pollGroup = Optional.ofNullable(InMemoryStateStore.getStack(stack.getId())); if (pollGroup.isEmpty() || PollGroup.CANCELLED.equals(pollGroup.get())) { LOGGER.info("FreeIpa polling cancelled in inMemory store."); return AttemptResults.breakFor("FreeIpa polling cancelled in inMemory store"); } for (InstanceMetaData instanceMetaData : instanceMetaDataSet) { try { RPCResponse<Boolean> result = checkedMeasure(() -> freeIpaHealthDetailsService.checkFreeIpaHealth(stack, instanceMetaData), LOGGER, ":::Freeipa start::: FreeIPA health check ran in {}ms"); if (result.getResult()) { LOGGER.debug("Freeipa services are available and freeipa is working (on instance: {})", instanceMetaData.getInstanceId()); return AttemptResults.finishWith(null); } else { LOGGER.debug("Freeipa services are available, but freeipa is not working (on instance: {})", instanceMetaData.getInstanceId()); } } catch (Exception e) { LOGGER.debug("Freeipa services have not been available yet (on instance: {})", instanceMetaData.getInstanceId()); } } return AttemptResults.justContinue(); }
Source:
public ResponseEntity<String> update(@PathVariable("id") Long id, @RequestBody @Valid Counterparty counterparty) { Counterparty oldCounterparty = counterpartyDao.findOne(id); if (oldCounterparty == null) { throw new NotFoundException("Counterparty not found"); } counterparty.setId(id); counterpartyDao.saveAndFlush(counterparty); return new ResponseEntity<>("Counterparty updated", HttpStatus.NO_CONTENT); }

Target:
public ResponseEntity<String> update(@PathVariable("id") Long id, @RequestBody @Valid Counterparty counterparty) { Counterparty oldCounterparty = counterpartyDao.findOne(id); if (oldCounterparty == null) { throw new NotFoundException("Counterparty not found"); } AppUser loggedUser = userUtil.extractLoggedAppUserFromDatabase(); if(loggedUser.getUserId() != oldCounterparty.getUser().getUserId()){ throw new BadRequestException("Bad request!"); } counterparty.setUser(loggedUser); counterparty.setId(id); counterpartyDao.saveAndFlush(counterparty); return new ResponseEntity<>("Counterparty updated", HttpStatus.NO_CONTENT); }
Source:
public void generateAlarms() { int warning = Integer.parseInt(sp.getString("notification_warning", "3")); AccountDataSource data = new AccountDataSource(app); data.open(); List<LentItem> items = data.getAllLentItems(); Map<LocalDate, List<Long>> arrangedIds = new HashMap<>(); for (LentItem item : items) { LocalDate deadline = item.getDeadline(); if (!arrangedIds.containsKey(deadline)) { arrangedIds.put(deadline, new ArrayList<Long>()); } arrangedIds.get(deadline).add(item.getDbId()); } for (Alarm alarm : data.getAllAlarms()) { if (!arrangedIds.containsKey(alarm.deadline)) { data.removeAlarm(alarm); } } for (Map.Entry<LocalDate, List<Long>> entry : arrangedIds.entrySet()) { LocalDate deadline = entry.getKey(); long[] media = toArray(entry.getValue()); Alarm alarm = data.getAlarmByDeadline(deadline); if (alarm != null) { if (!Arrays.equals(media, alarm.media)) { alarm.media = media; data.updateAlarm(alarm); } } else { if (BuildConfig.DEBUG) { Log.i("OpacClient", "scheduling alarm for " + media.length + " items with deadline on " + DateTimeFormat.shortDate().print(deadline) + " on " + DateTimeFormat.shortDate().print(deadline.minusDays(warning))); } data.addAlarm(deadline, media, deadline.minusDays(warning).toDateTimeAtStartOfDay()); } } data.close(); scheduleAlarms(); }

Target:
public void generateAlarms() { generateAlarms(-1, null); }
Source:
protected boolean isValidVersion(WorkflowVersion version) { SortedSet<VersionValidation> versionValidations = version.getValidations(); boolean isValid = true; for (VersionValidation versionValidation : versionValidations) { if (!versionValidation.isValid()) { isValid = false; break; } } return isValid; }

Target:
protected boolean isValidVersion(WorkflowVersion version) { return !version.getValidations().stream().filter(Validation -> !Validation.isValid()).findFirst().isPresent(); }
Source:
private void sendMessage(final RawData message, final Connection connection, final DTLSSession session) { try { LOGGER.trace("send {}-{} using {}-{}", connection.getConnectionId(), connection.getPeerAddress(), session.getSessionIdentifier(), session.getPeer()); final EndpointContext ctx = session.getConnectionWriteContext(); if (!checkOutboundEndpointContext(message, ctx)) { return; } message.onContextEstablished(ctx); Record record = new Record( ContentType.APPLICATION_DATA, session.getWriteEpoch(), session.getSequenceNumber(), new ApplicationMessage(message.getBytes(), message.getInetSocketAddress()), session, true, TLS12_CID_PADDING); sendRecord(record); message.onSent(); connection.refreshAutoResumptionTime(); } catch (IOException e) { message.onError(e); } catch (GeneralSecurityException e) { DROP_LOGGER.debug("Cannot send APPLICATION record to peer [{}]", message.getInetSocketAddress(), e); message.onError(e); } }

Target:
private void sendMessage(final RawData message, final Connection connection, final DTLSSession session) { try { LOGGER.trace("send {}-{} using {}-{}", connection.getConnectionId(), connection.getPeerAddress(), session.getSessionIdentifier(), session.getPeer()); final EndpointContext ctx = session.getConnectionWriteContext(); if (!checkOutboundEndpointContext(message, ctx)) { return; } message.onContextEstablished(ctx); Record record = new Record( ContentType.APPLICATION_DATA, session.getWriteEpoch(), session.getSequenceNumber(), new ApplicationMessage(message.getBytes(), message.getInetSocketAddress()), session, true, TLS12_CID_PADDING); sendRecord(record); message.onSent(); connection.refreshAutoResumptionTime(); } catch (IOException e) { message.onError(e); } catch (GeneralSecurityException e) { DROP_LOGGER.warn("Cannot send APPLICATION record to peer [{}]", message.getInetSocketAddress(), e); message.onError(e); } }
Source:
void createSymbolsFromWildcardImport(Set<Symbol> importedSymbols, ImportFrom importFrom, Map<String, Symbol> globalSymbolsByFQN) { importedSymbols.forEach(symbol -> { Symbol importedSymbol = copySymbol(symbol.name(), symbol, globalSymbolsByFQN); if (!isExistingSymbol(importedSymbol.name())) { symbols.add(importedSymbol); symbolsByName.put(symbol.name(), importedSymbol); } else { SymbolImpl originalSymbol = resolve(symbol.name()); if (originalSymbol != null) { resetSymbolInfo(importedSymbol.fullyQualifiedName(), originalSymbol); originalSymbol.addUsage(importFrom, Usage.Kind.IMPORT); } } }); }

Target:
void createSymbolsFromWildcardImport(Set<Symbol> importedSymbols, ImportFrom importFrom, Map<String, Symbol> globalSymbolsByFQN) { importedSymbols.forEach(symbol -> { Symbol importedSymbol = copySymbol(symbol.name(), symbol, globalSymbolsByFQN); if (!isExistingSymbol(importedSymbol.name())) { symbols.add(importedSymbol); symbolsByName.put(symbol.name(), importedSymbol); ((SymbolImpl) importedSymbol).addUsage(importFrom, Usage.Kind.IMPORT); } else { SymbolImpl originalSymbol = resolve(symbol.name()); if (originalSymbol != null) { resetSymbolInfo(importedSymbol.fullyQualifiedName(), originalSymbol); originalSymbol.addUsage(importFrom, Usage.Kind.IMPORT); } } }); }
Source:
public void run() { m_verbotenThreads.add(Thread.currentThread().getId()); try { m_ih.starting(this); m_ih.started(this); while (m_shouldStop == false) { LatencyWatchdog.pet(); if (m_hadWork) { m_selector.selectNow(); } else { m_selector.select(); } m_hadWork = false; Runnable task = null; while ((task = m_tasks.poll()) != null) { m_hadWork = true; task.run(); } dispatchReadStream(); drainWriteStream(); } } catch (CancelledKeyException e) { networkLog.warn( "Had a cancelled key exception for " + m_threadName, e); } catch (IOException e) { final String trimmed = e.getMessage() == null ? "" : e.getMessage().trim(); if ((e instanceof IOException && (trimmed.equalsIgnoreCase("Connection reset by peer") || trimmed.equalsIgnoreCase("broken pipe"))) || e instanceof AsynchronousCloseException || e instanceof ClosedChannelException || e instanceof ClosedByInterruptException) { if (m_logger.isDebugEnabled()) { m_logger.debug( "PicoNetwork died, probably of natural causes", e); } } else { e.printStackTrace(); networkLog.error( "PicoNetwork died due to an unexpected exception", e); } } catch (Throwable ex) { ex.printStackTrace(); m_logger.error(null, ex); m_shouldStop = true; } finally { m_verbotenThreads.remove(Thread.currentThread().getId()); try { p_shutdown(); } catch (Throwable t) { m_logger.error("Error shutting down Volt Network", t); t.printStackTrace(); } } }

Target:
public void run() { m_verbotenThreads.add(Thread.currentThread().getId()); try { m_ih.starting(this); m_ih.started(this); while (m_shouldStop == false) { LatencyWatchdog.pet(); if (m_hadWork) { m_selector.selectNow(); } else { m_selector.select(); } m_hadWork = false; Runnable task = null; while ((task = m_tasks.poll()) != null) { m_hadWork = true; task.run(); } dispatchReadStream(); drainWriteStream(); } } catch (CancelledKeyException e) { networkLog.warn( "Had a cancelled key exception for " + m_threadName, e); } catch (IOException e) { final String trimmed = e.getMessage() == null ? "" : e.getMessage().trim(); if ((e instanceof IOException && (trimmed.equalsIgnoreCase("Connection reset by peer") || trimmed.equalsIgnoreCase("broken pipe"))) || e instanceof AsynchronousCloseException || e instanceof ClosedChannelException || e instanceof ClosedByInterruptException) { if (m_logger.isDebugEnabled()) { m_logger.debug( "PicoNetwork died, probably of natural causes", e); } } else { networkLog.error( "PicoNetwork died due to an unexpected exception", e); } } catch (Throwable ex) { m_logger.error(null, ex); m_shouldStop = true; } finally { m_verbotenThreads.remove(Thread.currentThread().getId()); try { p_shutdown(); } catch (Throwable t) { m_logger.error("Error shutting down Volt Network", t); } } }
Source:
public ResponseEntity<?> getSchemas( @PathVariable("name") final String name, @RequestParam(value = "offset", required = false, defaultValue = "0") final int offset, @RequestParam(value = "limit", required = false, defaultValue = "20") final int limit, final NativeWebRequest request) throws InvalidLimitException { final EventType eventType = eventTypeService.get(name); final PaginationWrapper schemas = schemaService.getSchemas(name, offset, limit); return ResponseEntity.status(HttpStatus.OK).body(schemas); }

Target:
public ResponseEntity<?> getSchemas( @PathVariable("name") final String name, @RequestParam(value = "offset", required = false, defaultValue = "0") final int offset, @RequestParam(value = "limit", required = false, defaultValue = "20") final int limit, final NativeWebRequest request) throws InvalidLimitException, NoSuchEventTypeException, InternalNakadiException { final EventType eventType = eventTypeService.get(name); final PaginationWrapper schemas = schemaService.getSchemas(name, offset, limit); return ResponseEntity.status(HttpStatus.OK).body(schemas); }
Source:
protected void recordCapabilitiesAndRequirements(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException { super.recordCapabilitiesAndRequirements(context, operation, resource); ModelNode defaultTracer = DEFAULT_TRACER.resolveModelAttribute(context, operation); if (defaultTracer.isDefined()) { context.registerCapability(RuntimeCapability.Builder.of(DEFAULT_TRACER_CAPABILITY.getDynamicName(defaultTracer.asString()), false).build()); } }

Target:
protected void recordCapabilitiesAndRequirements(OperationContext context, ModelNode operation, Resource resource) throws OperationFailedException { ModelNode defaultTracer = DEFAULT_TRACER.resolveModelAttribute(context, operation); if (defaultTracer.isDefined()) { context.registerCapability(DEFAULT_TRACER_CAPABILITY); } }
Source:
public static ViewTypes getViewType(String viewName) { switch (viewName) { case TOKENS: case LEMMA: case POS: case VERB_SENSE: return ViewTypes.TOKEN_LABEL_VIEW; case SENTENCE: case PARAGRAPH: case MENTION_ACE: case MENTION_ERE: case NER_CONLL: case NER_ONTONOTES: case NER_ERE: case SHALLOW_PARSE: case QUANTITIES: case WIKIFIER: case CLAUSES_CHARNIAK: case CLAUSES_STANFORD: case CLAUSES_BERKELEY: case BROWN_CLUSTERS: case GAZETTEER: case TREE_GAZETTEER: case GAZETTEER_NE: case POST_ERE: case EVENT_ERE: return ViewTypes.SPAN_LABEL_VIEW; case DEPENDENCY: case DEPENDENCY_STANFORD: case DEPENDENCY_HEADFINDER: return ViewTypes.DEPENDENCY_VIEW; case PARSE_GOLD: case PARSE_CHARNIAK: case PARSE_CHARNIAK_KBEST: case PSEUDO_PARSE_CHARNIAK: case PARSE_STANFORD: case PARSE_STANFORD_KBEST: case PSEUDO_PARSE_STANFORD: case PARSE_BERKELEY: case PSEUDO_PARSE_BERKELEY: return ViewTypes.PARSE_VIEW; case SRL_VERB: case SRL_NOM: case SRL_PREP: case SRL_COMMA: return ViewTypes.PREDICATE_ARGUMENT_VIEW; case COREF: case COREF_HEAD: case COREF_EXTENT: case COREF_ERE: return ViewTypes.COREF_VIEW; case TIMEX3: } return null; }

Target:
public static ViewTypes getViewType(String viewName) { switch (viewName) { case TOKENS: case LEMMA: case POS: case VERB_SENSE: return ViewTypes.TOKEN_LABEL_VIEW; case SENTENCE: case PARAGRAPH: case MENTION: case MENTION_ACE: case MENTION_ERE: case NER_CONLL: case NER_ONTONOTES: case NER_ERE: case SHALLOW_PARSE: case QUANTITIES: case WIKIFIER: case CLAUSES_CHARNIAK: case CLAUSES_STANFORD: case CLAUSES_BERKELEY: case BROWN_CLUSTERS: case GAZETTEER: case TREE_GAZETTEER: case GAZETTEER_NE: case POST_ERE: case EVENT_ERE: case TIMEX3: return ViewTypes.SPAN_LABEL_VIEW; case DEPENDENCY: case DEPENDENCY_STANFORD: case DEPENDENCY_HEADFINDER: return ViewTypes.DEPENDENCY_VIEW; case PARSE_GOLD: case PARSE_CHARNIAK: case PARSE_CHARNIAK_KBEST: case PSEUDO_PARSE_CHARNIAK: case PARSE_STANFORD: case PARSE_STANFORD_KBEST: case PSEUDO_PARSE_STANFORD: case PARSE_BERKELEY: case PSEUDO_PARSE_BERKELEY: return ViewTypes.PARSE_VIEW; case SRL_VERB: case SRL_NOM: case SRL_PREP: case SRL_COMMA: return ViewTypes.PREDICATE_ARGUMENT_VIEW; case COREF: case COREF_HEAD: case COREF_EXTENT: case COREF_ERE: return ViewTypes.COREF_VIEW; } return null; }
Source:
public Curve apply(Curve curve) { return ParallelShiftedCurve.builder().curve(curve).adjustment(adjustment).build(); }

Target:
public Curve apply(Curve curve) { return ParallelShiftedCurve.of(curve, shiftType, shiftAmount); }
Source:
public void check(Options options) { if ((options.curvePublicKey == null ^ options.curveSecretKey == null)) { throw new IllegalStateException("Curve mechanism definition incomplete"); } if (options.curvePublicKey != null && options.curvePublicKey.length != Options.CURVE_KEYSIZE) { throw new IllegalStateException("Curve mechanism definition incomplete"); } if (options.curveSecretKey != null && options.curveSecretKey.length != Options.CURVE_KEYSIZE) { throw new IllegalStateException("Curve mechanism definition incomplete"); } if (!options.asServer && options.curveServerKey == null) { throw new IllegalStateException("Curve mechanism definition incomplete"); } }

Target:
public void check(Options options) { }
Source:
private List<String> getAdmins() throws KeeperException { String adminsPath = "/" + zkNamespace + "/" + XD_ADMINS; List<String> results = new ArrayList<String>(); try { Stat stat = zk.exists(adminsPath, false); if (stat != null) { List<String> admins = zk.getChildren(adminsPath, false); for (String admin : admins) { Stat dataStat = new Stat(); byte[] data = zk.getData(adminsPath + "/" + admin, false, dataStat); try { HashMap<String,Object> dataValues = new ObjectMapper().readValue(new String(data), HashMap.class); results.add("http://" + dataValues.get("host") + ":" + dataValues.get("port")); } catch (IOException e) } } } catch (InterruptedException ignore) return results; }

Target:
private List<String> getAdmins() throws KeeperException { String adminsPath = "/" + zkNamespace + "/" + XD_ADMINS; List<String> results = new ArrayList<String>(); try { Stat stat = zk.exists(adminsPath, false); if (stat != null) { List<String> admins = zk.getChildren(adminsPath, false); for (String admin : admins) { byte[] data = zk.getData(adminsPath + "/" + admin, false, null); try { HashMap<String,Object> dataValues = new ObjectMapper().readValue(new String(data), HashMap.class); results.add("http://" + dataValues.get("host") + ":" + dataValues.get("port")); } catch (IOException e) { Log.error("IOException while retrieving data for " + admin + ": " + e.getMessage()); } } } } catch (InterruptedException ignore) return results; }
Source:
public GZIPRequestStream(HttpServletRequest request) throws IOException { super(); closed = false; this.request = request; this.input = request.getInputStream(); this.zipInput = new GZIPInputStream(input); bufferedOutput = new ByteArrayOutputStream(); }

Target:
public GZIPRequestStream(HttpServletRequest request) throws IOException { super(); this.zipInput = new GZIPInputStream(request.getInputStream()); }
Source:
public void testCRCChecksum() throws Exception { EventDeserializer eventDeserializer = new EventDeserializer(); BinaryLogFileReader reader = new BinaryLogFileReader( new FileInputStream("/data/mysql-bin.000001"), eventDeserializer); readAll(reader, 303); }

Target:
public void testCRCChecksum() throws Exception { EventDeserializer eventDeserializer = new EventDeserializer(); BinaryLogFileReader reader = new BinaryLogFileReader( new FileInputStream("src/test/resources/mysql-bin.000001"), eventDeserializer); readAll(reader, 303); }
Source:
private MavenSettingsConfig createSettings(MavenSettingsConfigProvider provider) throws Exception { CredentialsStore store = CredentialsProvider.lookupStores(j.getInstance()).iterator().next(); store.addCredentials(Domain.global(), new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, "credid", "dummy desc", "foo", "bar")); ServerCredentialMapping mapping = new ServerCredentialMapping("myserver", "credid"); List<ServerCredentialMapping> mappings = new ArrayList<ServerCredentialMapping>(); mappings.add(mapping); MavenSettingsConfig c1 = (MavenSettingsConfig) provider.newConfig(null); MavenSettingsConfig c2 = new MavenSettingsConfig(c1.id + "dummy", c1.name, c1.comment, c1.content, MavenSettingsConfig.isReplaceAllDefault, mappings); provider.save(c2); return c2; }

Target:
private MavenSettingsConfig createSettings(MavenSettingsConfigProvider provider) throws Exception { CredentialsStore store = CredentialsProvider.lookupStores(j.getInstance()).iterator().next(); store.addCredentials(Domain.global(), new UsernamePasswordCredentialsImpl(CredentialsScope.GLOBAL, "credid", "dummy desc", "foo", "bar")); ServerCredentialMapping mapping = new ServerCredentialMapping("myserver", "credid"); List<ServerCredentialMapping> mappings = new ArrayList<ServerCredentialMapping>(); mappings.add(mapping); MavenSettingsConfig c1 = (MavenSettingsConfig) provider.newConfig(String.valueOf(System.currentTimeMillis())); MavenSettingsConfig c2 = new MavenSettingsConfig(c1.id + "dummy", c1.name, c1.comment, c1.content, MavenSettingsConfig.isReplaceAllDefault, mappings); provider.save(c2); return c2; }
Source:
private static Value base64encode(byte[] data, String algorithm) { final EncodingAlgorithm algorithmImpl = EncodingFactory.getEncodingAlgorithm(algorithm); final String result = algorithmImpl.encode(data); return ValueVarchar.get(result); }

Target:
private static Value base64encode(byte[] data, String algorithm) { if (data!=null){ final String result; if (algorithm == null || algorithm.isEmpty() || "BASE64".equalsIgnoreCase(algorithm)) { result = Base64.getEncoder().encodeToString(data); } else if ("URL".equalsIgnoreCase(algorithm)) { result = Base64.getUrlEncoder().encodeToString(data); } else { throw DbException.getInvalidValueException("algorithmString, valid value: 'BASE64' or not set, 'URL'", algorithm); } return ValueVarchar.get(result); }else{ return ValueNull.INSTANCE; } }
Source:
private void configureModuleConverters(String contentTypeString, Module module, boolean isInput) { if (logger.isDebugEnabled()) { logger.debug("module " + (isInput ? "input" : "output") + "Type is " + contentTypeString); } SimpleModule sm = (SimpleModule) module; try { MimeType contentType = resolveContentType(contentTypeString, module); AbstractMessageChannel channel = getChannel(module, isInput); CompositeMessageConverter converters = null; try { converters = converterFactory.newInstance(contentType); } catch (ConversionException e) { throw new ModuleConfigurationException(e.getMessage() + "(" + module.getName() + " --" + (isInput ? "input" : "output") + "Type=" + contentTypeString + ")"); } Class<?> dataType = MessageConverterUtils.getJavaTypeForContentType(contentType, sm.getApplicationContext().getClassLoader()); if (dataType == null) { throw new ModuleConfigurationException("Content type is not supported for " + module.getName() + " --" + (isInput ? "input" : "output") + "Type=" + contentTypeString); } else { channel.setDatatypes(dataType); channel.setMessageConverter(converters); } if (this.pretty_print == true) { if ("application/json".equals(contentTypeString)) { for (MessageConverter messageConverter : converters.getConverters()) { if (messageConverter instanceof PojoToJsonMessageConverter) { ((PojoToJsonMessageConverter) messageConverter).setPrettyPrint(true); } else if (messageConverter instanceof TupleToJsonMessageConverter) { ((TupleToJsonMessageConverter) messageConverter).setPrettyPrint(true); } } } } } catch (Throwable t) { throw new ModuleConfigurationException(t.getMessage(), t); } }

Target:
private void configureModuleConverters(String contentTypeString, Module module, boolean isInput) { if (logger.isDebugEnabled()) { logger.debug("module " + (isInput ? "input" : "output") + "Type is " + contentTypeString); } SimpleModule sm = (SimpleModule) module; try { MimeType contentType = resolveContentType(contentTypeString, module); AbstractMessageChannel channel = getChannel(module, isInput); CompositeMessageConverter converters = null; try { converters = converterFactory.newInstance(contentType); } catch (ConversionException e) { throw new ModuleConfigurationException(e.getMessage() + "(" + module.getName() + " --" + (isInput ? "input" : "output") + "Type=" + contentTypeString + ")"); } Class<?> dataType = MessageConverterUtils.getJavaTypeForContentType(contentType, sm.getApplicationContext().getClassLoader()); if (dataType == null) { throw new ModuleConfigurationException("Content type is not supported for " + module.getName() + " --" + (isInput ? "input" : "output") + "Type=" + contentTypeString); } else { channel.setDatatypes(dataType); channel.setMessageConverter(converters); } } catch (Throwable t) { throw new ModuleConfigurationException(t.getMessage(), t); } }
Source:
private void onAsyncExecutionFailure(String reason) { mLastExecutionStatus = STATUS_FAILED; if (mActivity != null) { Logger.log(LogTypes.TYPE_MAINTENANCE, String.format( "%s failed with %s for recovery measure %s", mCurrentMeasure.getType(), reason, mCurrentMeasure.getSequenceNumber())); mActivity.disableLoadingIndicator(); mActivity.enableRetry(); } }

Target:
private void onAsyncExecutionFailure(String reason) { try { mLastExecutionStatus = STATUS_FAILED; Logger.log(LogTypes.TYPE_MAINTENANCE, String.format( "%s failed with %s for recovery measure %s", mCurrentMeasure.getType(), reason, mCurrentMeasure.getSequenceNumber())); if (mActivity != null) { mActivity.disableLoadingIndicator(); mActivity.enableRetry(); } } catch (Exception e) { handleException(e); } }
Source:
public static boolean checkImagesConfiguration(Guid storageDomainId, Collection<? extends Disk> disksConfigList, List<String> messages) { StorageDomainStatic storageDomain = DbFacade.getInstance().getStorageDomainStaticDao().get(storageDomainId); return !disksConfigList.stream().filter(disk -> DiskStorageType.IMAGE == disk.getDiskStorageType()) .anyMatch(disk -> !checkImageConfiguration(storageDomain, (DiskImage) disk, messages)); }

Target:
public static boolean checkImagesConfiguration(Guid storageDomainId, Collection<? extends Disk> disksConfigList, List<String> messages) { StorageDomainStatic storageDomain = DbFacade.getInstance().getStorageDomainStaticDao().get(storageDomainId); return !disksConfigList.stream().filter(DisksFilter.ONLY_IMAGES) .anyMatch(disk -> !checkImageConfiguration(storageDomain, (DiskImage) disk, messages)); }
Source:
public String getMaxConnections() { return maxConnections == null ? Integer.valueOf(DEFAULT_CONNECTIONS).toString() : maxConnections; }

Target:
public String getMaxConnections() { return maxConnections == null ? String.valueOf(DEFAULT_CONNECTIONS) : maxConnections; }
Source:
public void test002_CreateBadTree() throws IOException { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("Can't append a tree entry with zero-length name"); final TreeFormatter formatter = new TreeFormatter(); formatter.append("", FileMode.TREE, ObjectId.fromString("4b825dc642cb6eb9a060e54bf8d69288fbee4904")); }

Target:
public void test002_CreateBadTree() throws Exception { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage(JGitText.get().invalidTreeZeroLengthName); final TreeFormatter formatter = new TreeFormatter(); formatter.append("", FileMode.TREE, ObjectId.fromString("4b825dc642cb6eb9a060e54bf8d69288fbee4904")); }
Source:
protected boolean canDoAction() { if (getParameters().getClusterId() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID); return false; } if(!super.canDoAction()) { return false; } return true; }

Target:
protected boolean canDoAction() { if (getParameters().getClusterId() == null || getVdsGroup() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_IS_NOT_VALID); return false; } if(!super.canDoAction()) { return false; } return true; }
Source:
private void checkYearInFile( File gplFile ) throws FileNotFoundException { try ( Scanner scanner = new Scanner( gplFile ) ) { scanner.nextLine(); String yearLine = scanner.nextLine(); Pattern p = Pattern.compile( "Copyright © 2002-(\\d\\d\\d\\d) Network Engine for Objects in Lund AB" ); Matcher m = p.matcher( yearLine ); if ( m.find() ) { String yearInFile = m.group( 1 ); int realYear = Calendar.getInstance().get( Calendar.YEAR ); assertThat( Integer.parseInt( yearInFile ), equalTo( realYear ) ); } else { fail( "No year found in NOTICE header!" ); } } }

Target:
private void checkYearInFile( File gplFile ) throws FileNotFoundException { try ( Scanner scanner = new Scanner( gplFile ) ) { scanner.nextLine(); String yearLine = scanner.nextLine(); Pattern p = Pattern.compile( "Copyright © 2002-(\\d\\d\\d\\d) Network Engine for Objects in Lund AB" ); Matcher m = p.matcher( yearLine ); if ( m.find() ) { String yearInFile = m.group( 1 ); int realYear = Calendar.getInstance().get( Calendar.YEAR ); assertThat( "The year field in the NOTICE file header template needs to be updated. " + "If you are building an old version of Neo4j, and/or do not care about the copyright " + "year of its modules, set the maven parameter `-DignoreNoticeYear`", Integer.parseInt( yearInFile ), equalTo( realYear ) ); } else { fail( "No year found in NOTICE header!" ); } } }
Source:
public void testValidURI() { URI uri = URI.create("hello://localhost:9540"); ClusteringServiceConfiguration serviceConfiguration = new ClusteringServiceConfiguration(uri); assertThat(serviceConfiguration.getClusterUri(), is(uri)); }

Target:
public void testValidURI() { URI uri = URI.create("terracotta://localhost:9540"); ClusteringServiceConfiguration serviceConfiguration = new ClusteringServiceConfiguration(uri); assertThat(serviceConfiguration.getClusterUri(), is(uri)); }
Source:
public String getName() { return "dijkstrabinosod|ch"; }

Target:
public String getName() { return "dijkstrabi|ch"; }
Source:
public static Serializable fromBase64String(String base64String) { byte[] bytes = Base64.decode(base64String,0); Serializable object = null; try { ObjectInputStream objectInputStream = new ObjectInputStream( new ByteArrayInputStream(bytes) ); object = (Serializable)objectInputStream.readObject(); } catch (IOException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (ClassCastException e) { e.printStackTrace(); } return object; }

Target:
public static Serializable fromBase64String(String base64String) { byte[] bytes = Base64.decode(base64String,0); Serializable object = null; try { ObjectInputStream objectInputStream = new ObjectInputStream( new ByteArrayInputStream(bytes) ); object = (Serializable)objectInputStream.readObject(); } catch (IOException e) { LogExt.e(SerializableUtils.class, e.getLocalizedMessage()); } catch (ClassNotFoundException e) { LogExt.e(SerializableUtils.class, e.getLocalizedMessage()); } catch (ClassCastException e) { LogExt.e(SerializableUtils.class, e.getLocalizedMessage()); } return object; }
Source:
private List<DeviceAdmin> getSensesByAccountId(final Long accountId) { final ImmutableList<DeviceAccountPair> senseAccountPairs = deviceDAO.getSensesForAccountId(accountId); final List<DeviceAdmin> senses = new ArrayList<>(); for (final DeviceAccountPair senseAccountPair: senseAccountPairs) { final Optional<DeviceData> deviceDataOptional = sensorsViewsDynamoDB.lastSeen(senseAccountPair.externalDeviceId, accountId, senseAccountPair.internalDeviceId); if (!deviceDataOptional.isPresent()) { senses.add(DeviceAdmin.create(senseAccountPair)); } else { final DeviceData deviceData = deviceDataOptional.get(); LOGGER.info("device data {}", deviceData); senses.add(DeviceAdmin.create(senseAccountPair, DeviceStatus.sense(deviceData.deviceId, Integer.toHexString(deviceData.firmwareVersion), deviceData.dateTimeUTC))); } } return senses; }

Target:
private List<DeviceAdmin> getSensesByAccountId(final Long accountId) { final ImmutableList<DeviceAccountPair> senseAccountPairs = deviceDAO.getSensesForAccountId(accountId); final List<DeviceAdmin> senses = new ArrayList<>(); for (final DeviceAccountPair senseAccountPair: senseAccountPairs) { final Optional<DeviceData> deviceDataOptional = sensorsViewsDynamoDB.lastSeen(senseAccountPair.externalDeviceId, accountId, senseAccountPair.internalDeviceId); if (!deviceDataOptional.isPresent()) { senses.add(DeviceAdmin.create(senseAccountPair)); } else { final DeviceData deviceData = deviceDataOptional.get(); LOGGER.debug("device data {}", deviceData); senses.add(DeviceAdmin.create(senseAccountPair, DeviceStatus.sense(deviceData.deviceId, Integer.toHexString(deviceData.firmwareVersion), deviceData.dateTimeUTC))); } } return senses; }
Source:
public void testRayCasting(){ final double[][] platform = {{ 59.8925348, 10.5242855}, { 59.8927012, 10.524743}, { 59.8926397, 10.5248089}, {59.8924888, 10.5243485}}; double[] testPointInside = { 59.8926474, 10.524729}; double[] testPointOutside = { 59.8925344, 10.5249007}; assert(PlatformLinker.contains(platform, testPointInside)); assert(!PlatformLinker.contains(platform, testPointOutside)); }

Target:
public void testRayCasting(){ final double[][] platform = {{10.5242855, 59.8925348}, {10.524743, 59.8927012}, { 10.5248089, 59.8926397}, {10.5243485, 59.8924888}}; double[] testPointInside = { 10.524729, 59.8926474}; double[] testPointOutside = { 10.5249007, 59.8925344}; assert(PlatformLinker.contains(platform, testPointInside)); assert(!PlatformLinker.contains(platform, testPointOutside)); }
Source:
protected void commitSingleEntry(CacheEntry entry, FlagAffectedCommand command, InvocationContext ctx, Flag trackFlag, boolean l1Invalidation) { int segment; Object key = entry.getKey(); if (command instanceof SegmentSpecificCommand) { segment = ((SegmentSpecificCommand) command).getSegment(); } else { segment = distributionManager.getCacheTopology().getSegment(key); } stateTransferLock.acquireSharedTopologyLock(); try { Commit doCommit = commitType(command, ctx, segment, entry.isRemoved()); if (doCommit.isCommit()) { boolean created = false; boolean removed = false; boolean expired = false; if (doCommit.isLocal()) { created = entry.isCreated(); removed = entry.isRemoved(); if (removed && entry instanceof MVCCEntry) { expired = ((MVCCEntry) entry).isExpired(); } } InternalCacheEntry previousEntry; if (segment != -1) { previousEntry = ((InternalDataContainer) dataContainer).peek(segment, key); } else { previousEntry = dataContainer.peek(key); } Object previousValue = null; Metadata previousMetadata = null; if (previousEntry != null) { previousValue = previousEntry.getValue(); previousMetadata = previousEntry.getMetadata(); } commitManager.commit(entry, trackFlag, segment, l1Invalidation, ctx); if (doCommit.isLocal()) { NotifyHelper.entryCommitted(notifier, functionalNotifier, created, removed, expired, entry, ctx, command, previousValue, previousMetadata); } } } finally { stateTransferLock.releaseSharedTopologyLock(); } }

Target:
protected void commitSingleEntry(CacheEntry entry, FlagAffectedCommand command, InvocationContext ctx, Flag trackFlag, boolean l1Invalidation) { Object key = entry.getKey(); int segment = SegmentSpecificCommand.extractSegment(command, key, keyPartitioner); stateTransferLock.acquireSharedTopologyLock(); try { Commit doCommit = commitType(command, ctx, segment, entry.isRemoved()); if (doCommit.isCommit()) { boolean created = false; boolean removed = false; boolean expired = false; if (doCommit.isLocal()) { created = entry.isCreated(); removed = entry.isRemoved(); if (removed && entry instanceof MVCCEntry) { expired = ((MVCCEntry) entry).isExpired(); } } InternalCacheEntry previousEntry = dataContainer.peek(segment, key); Object previousValue = null; Metadata previousMetadata = null; if (previousEntry != null) { previousValue = previousEntry.getValue(); previousMetadata = previousEntry.getMetadata(); } commitManager.commit(entry, trackFlag, segment, l1Invalidation, ctx); if (doCommit.isLocal()) { NotifyHelper.entryCommitted(notifier, functionalNotifier, created, removed, expired, entry, ctx, command, previousValue, previousMetadata); } } } finally { stateTransferLock.releaseSharedTopologyLock(); } }
Source:
public T open() { if (streamName != null) { streamID = CorfuRuntime.getStreamID(streamName); log.info("CorfuObject: creating stream id {}", streamName, streamID); } try { if (options.contains(ObjectOpenOptions.NO_CACHE)) { return CorfuCompileWrapperBuilder.getWrapper(type, runtime, streamID, arguments, serializer); } else { ObjectsView.ObjectID<T> oid = new ObjectsView.ObjectID(streamID, type); return (T) runtime.getObjectsView().objectCache.computeIfAbsent(oid, x -> { try { T result = CorfuCompileWrapperBuilder.getWrapper(type, runtime, streamID, arguments, serializer); ISerializer objectSerializer = ((CorfuCompileProxy) ((ICorfuSMR) result). getCorfuSMRProxy()) .getSerializer(); if (serializer != objectSerializer) { log.warn("open: Attempt to open an existing object with a different serializer {}. " + "Object opened with original serializer {}.", serializer.getClass().getSimpleName(), oid, objectSerializer.getClass().getSimpleName()); } return result; } catch (Exception ex) { throw new UnrecoverableCorfuError(ex); } } ); } } catch (Exception ex) { log.error("Runtime instrumentation no longer supported and no compiled class found" + " for {}", type); throw new UnrecoverableCorfuError(ex); } }

Target:
public T open() { if (streamName != null) { streamID = CorfuRuntime.getStreamID(streamName); } log.info("ObjectBuilder: open Corfu stream id {}", streamName, streamID); try { if (options.contains(ObjectOpenOptions.NO_CACHE)) { return CorfuCompileWrapperBuilder.getWrapper(type, runtime, streamID, arguments, serializer); } else { ObjectsView.ObjectID<T> oid = new ObjectsView.ObjectID(streamID, type); return (T) runtime.getObjectsView().objectCache.computeIfAbsent(oid, x -> { try { T result = CorfuCompileWrapperBuilder.getWrapper(type, runtime, streamID, arguments, serializer); ISerializer objectSerializer = ((CorfuCompileProxy) ((ICorfuSMR) result). getCorfuSMRProxy()) .getSerializer(); if (serializer != objectSerializer) { log.warn("open: Attempt to open an existing object with a different serializer {}. " + "Object opened with original serializer {}.", serializer.getClass().getSimpleName(), oid, objectSerializer.getClass().getSimpleName()); } return result; } catch (Exception ex) { throw new UnrecoverableCorfuError(ex); } } ); } } catch (Exception ex) { log.error("Runtime instrumentation no longer supported and no compiled class found" + " for {}", type); throw new UnrecoverableCorfuError(ex); } }
Source:
private Mono<Void> isAuthorized(String operation) { return tokenManager.getAuthorizationResults() .next() .handle((response, sink) -> { if (response != AmqpResponseCode.ACCEPTED && response != AmqpResponseCode.OK) { final String message = String.format("User does not have authorization to perform operation " + "[%s] on entity [%s]. Response: [%s]", operation, entityPath, response); final Throwable exc = new AmqpException(false, AmqpErrorCondition.UNAUTHORIZED_ACCESS, message, getErrorContext()); sink.error(new ServiceBusException(exc, ServiceBusErrorSource.MANAGEMENT)); } else { sink.complete(); } }) .onErrorMap(this::mapError) .then(); }

Target:
private Mono<Void> isAuthorized(String operation) { return tokenManager.getAuthorizationResults() .onErrorMap(this::mapError) .next() .handle((response, sink) -> { if (response != AmqpResponseCode.ACCEPTED && response != AmqpResponseCode.OK) { final String message = String.format("User does not have authorization to perform operation " + "[%s] on entity [%s]. Response: [%s]", operation, entityPath, response); final Throwable exc = new AmqpException(false, AmqpErrorCondition.UNAUTHORIZED_ACCESS, message, getErrorContext()); sink.error(new ServiceBusException(exc, ServiceBusErrorSource.MANAGEMENT)); } else { sink.complete(); } }); }
Source:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.FUNCDEF, ctx -> { PyFunctionDefTree func = ((PyFunctionDefTree) ctx.syntaxNode()); ReturnCountVisitor returnCountVisitor = new ReturnCountVisitor(); func.body().accept(returnCountVisitor); if (returnCountVisitor.returnStatements.size() > max) { PreciseIssue preciseIssue = ctx.addIssue(func.name(), String.format(MESSAGE, returnCountVisitor.returnStatements.size(), max)); returnCountVisitor.returnStatements.forEach(r -> { preciseIssue.secondary(r, null); }); } }); }

Target:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.FUNCDEF, ctx -> { PyFunctionDefTree func = ((PyFunctionDefTree) ctx.syntaxNode()); ReturnCountVisitor returnCountVisitor = new ReturnCountVisitor(); func.body().accept(returnCountVisitor); if (returnCountVisitor.returnStatements.size() > max) { PreciseIssue preciseIssue = ctx.addIssue(func.name(), String.format(MESSAGE, returnCountVisitor.returnStatements.size(), max)); returnCountVisitor.returnStatements.forEach(r -> preciseIssue.secondary(r, null)); } }); }
Source:
public void onReplicaError(ReplicaId replicaId, ReplicaFailureType error) { switch (error) { case Disk_Error: replicaId.getDiskId().onDiskError(); case Node_Timeout: replicaId.getDataNodeId().onNodeTimeout(); case Partition_ReadOnly: replicaId.getPartitionId().onPartitionReadOnly(); } }

Target:
public void onReplicaError(ReplicaId replicaId, ReplicaFailureType error) { switch (error) { case Disk_Error: ((Disk) replicaId.getDiskId()).onDiskError(); case Node_Timeout: ((DataNode) replicaId.getDataNodeId()).onNodeTimeout(); case Partition_ReadOnly: ((Partition) replicaId.getPartitionId()).onPartitionReadOnly(); } }
Source:
public EchoResponse.Void handle(Notification notification) { if (log.isDebugEnabled()) { try { log.debug("Notification received: " + mapper.writerWithDefaultPrettyPrinter() .writeValueAsString(notification)); } catch (JsonProcessingException jpe) { log.warn("Error parsing notification", jpe); } } if (notification.getTo() == null || notification.getTo().isEmpty()) { return new Void(); } String topic = notification.getTo().iterator().next(); publishers.publishersMatchingType(PubsubSystem.GOOGLE) .stream() .map(p -> (GooglePubsubPublisher) p) .filter(p -> StringUtils.equalsIgnoreCase(topic, p.getTopicName())) .forEach(p -> publishNotification(p, notification)); return new EchoResponse.Void(); }

Target:
public EchoResponse.Void handle(Notification notification) { if (log.isDebugEnabled() && mapper != null) { try { log.debug("Notification received: " + mapper.writerWithDefaultPrettyPrinter() .writeValueAsString(notification)); } catch (JsonProcessingException jpe) { log.warn("Error parsing notification", jpe); } } if (notification.getTo() == null || notification.getTo().isEmpty()) { return new Void(); } String topic = notification.getTo().iterator().next(); publishers.publishersMatchingType(PubsubSystem.GOOGLE) .stream() .map(p -> (GooglePubsubPublisher) p) .filter(p -> StringUtils.equalsIgnoreCase(topic, p.getTopicName())) .forEach(p -> publishNotification(p, notification)); return new EchoResponse.Void(); }
Source:
public final void collect(T record) { collect(record, Long.MIN_VALUE); }

Target:
public final void collect(T record) { collect(record, TimestampAssigner.NO_TIMESTAMP); }
Source:
} catch (Exception e) { throw new XmlBeanDefinitionException("Error occurred to initialize xmlReader", e); }

Target:
} catch (Exception e) { throw new XmlBeanDefinitionException("Error occurred while initializing DocumentBuilderFactory", e); }