auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private MarshallableEntry<K, V> load(Object key, boolean fetchValue, boolean fetchMetadata) { RestResponse response = null; try { response = CompletionStages.join(cacheClient.get(encodeKey(key))); if (isSuccessful(response.getStatus())) { String contentType = getHeader("Content-Type", response); Metadata metadata; long created, lastUsed; if (fetchMetadata) { long ttl = timeHeaderToLong(getHeader(TIME_TO_LIVE_SECONDS, response)); long maxidle = timeHeaderToLong(getHeader(MAX_IDLE_TIME_SECONDS, response)); metadata = metadataHelper.buildMetadata(contentType, ttl, TimeUnit.SECONDS, maxidle, TimeUnit.SECONDS); created = timeHeaderToLong(getHeader(CREATED, response)); lastUsed = timeHeaderToLong(getHeader(LAST_USED, response)); } else { metadata = null; created = -1; lastUsed = -1; } Object value; if (fetchValue) { byte[] bytes = response.getBodyAsByteArray(); value = unmarshall(contentType, bytes); } else { value = null; } return entryFactory.create(key, value, metadata, created, lastUsed); } else if (response.getStatus() == 404) { return null; } else { throw log.httpError(String.valueOf(response.getStatus())); } } catch (IOException e) { throw log.httpError(e); } catch (Exception e) { throw new PersistenceException(e); } finally { if (response != null) { response.close(); } } }

Target:
private MarshallableEntry<K, V> load(Object key, boolean fetchValue, boolean fetchMetadata) { try (RestResponse response = CompletionStages.join(cacheClient.get(encodeKey(key)))) { if (isSuccessful(response.getStatus())) { String contentType = getHeader("Content-Type", response); Metadata metadata; long created, lastUsed; if (fetchMetadata) { long ttl = timeHeaderToLong(getHeader(TIME_TO_LIVE_SECONDS, response)); long maxidle = timeHeaderToLong(getHeader(MAX_IDLE_TIME_SECONDS, response)); metadata = metadataHelper.buildMetadata(contentType, ttl, TimeUnit.SECONDS, maxidle, TimeUnit.SECONDS); created = timeHeaderToLong(getHeader(CREATED, response)); lastUsed = timeHeaderToLong(getHeader(LAST_USED, response)); } else { metadata = null; created = -1; lastUsed = -1; } Object value; if (fetchValue) { byte[] bytes = response.getBodyAsByteArray(); value = unmarshall(contentType, bytes); } else { value = null; } return entryFactory.create(key, value, metadata, created, lastUsed); } else if (response.getStatus() == 404) { return null; } else { throw log.httpError(String.valueOf(response.getStatus())); } } catch (IOException e) { throw log.httpError(e); } catch (Exception e) { throw new PersistenceException(e); } }
Source:
public void send(Send request) throws IOException { System.out.println("send"); ByteBufferChannel byteBufferChannel = new ByteBufferChannel(ByteBuffer.allocate((int) request.sizeInBytes())); while (!request.isSendComplete()) { request.writeTo(byteBufferChannel); } byteBufferChannel.getBuffer().position(0); ByteBuf byteBuf = Unpooled.wrappedBuffer(byteBufferChannel.getBuffer()); Http2StreamChannel childChannel = http2StreamChannelBootstrap.open().syncUninterruptibly().getNow(); Http2Headers http2Headers = new DefaultHttp2Headers().method(HttpMethod.POST.asciiName()).scheme("https").path("/"); http2Headers.set(RestUtils.Headers.HTTP2_FRONTEND_REQUEST, "true"); channelPromise = childChannel.newPromise(); childChannel.attr(Http2ResponseHandler.RESPONSE_CALLBACK).set(new Callback<ByteBuf>() { @Override public void onCompletion(ByteBuf result, Exception exception) { responseByteBuf = result; channelPromise.setSuccess(); } }); DefaultHttp2HeadersFrame headersFrame = new DefaultHttp2HeadersFrame(http2Headers, false); DefaultHttp2DataFrame dataFrame = new DefaultHttp2DataFrame(byteBuf, true); childChannel.write(headersFrame); childChannel.write(dataFrame); childChannel.flush(); }

Target:
public void send(Send request) throws IOException { ByteBufferChannel byteBufferChannel = new ByteBufferChannel(ByteBuffer.allocate((int) request.sizeInBytes())); while (!request.isSendComplete()) { request.writeTo(byteBufferChannel); } byteBufferChannel.getBuffer().position(0); ByteBuf byteBuf = Unpooled.wrappedBuffer(byteBufferChannel.getBuffer()); Http2StreamChannel childChannel = http2StreamChannelBootstrap.open().syncUninterruptibly().getNow(); Http2Headers http2Headers = new DefaultHttp2Headers().method(HttpMethod.POST.asciiName()).scheme("https").path("/"); responsePromise = childChannel.eventLoop().newPromise(); childChannel.attr(Http2ResponseHandler.RESPONSE_PROMISE).set(responsePromise); DefaultHttp2HeadersFrame headersFrame = new DefaultHttp2HeadersFrame(http2Headers, false); DefaultHttp2DataFrame dataFrame = new DefaultHttp2DataFrame(byteBuf, true); childChannel.write(headersFrame); childChannel.write(dataFrame); childChannel.flush(); }
Source:
private String getLabel(final EObject eObject) { String label = "Element whithout name"; if (eObject instanceof IdentifiedElement) { label = new IdentifiedElementQuery((IdentifiedElement) eObject).getLabel(); } else if (eObject instanceof RepresentationExtensionDescription) { label = ((RepresentationExtensionDescription) eObject).getName(); } else { label = eObject.eClass().getName(); } return label; }

Target:
protected String getLabel(final EObject eObject) { String label = "Element whithout name"; if (eObject instanceof IdentifiedElement) { label = new IdentifiedElementQuery((IdentifiedElement) eObject).getLabel(); } else if (eObject instanceof RepresentationExtensionDescription) { label = ((RepresentationExtensionDescription) eObject).getName(); } else { label = eObject.eClass().getName(); } return label; }
Source:
public void setPlayersInTeam(String team, List<Player> playerList, Function<Player, Rating> ratingProvider) { int totalRating = 0; for (Player player : playerList) { if (player == null) { continue; } PlayerCardTooltipController playerCardTooltipController = uiService.loadFxml("theme/player_card_tooltip.fxml"); playerCardTooltipController.setPlayer(player); RatingChangedLabelController ratingChangedLabelController = uiService.loadFxml("theme/rating_changed_label.fxml"); ratingChange.put(player.getId(), ratingChangedLabelController); HBox container = new HBox(playerCardTooltipController.getRoot(), ratingChangedLabelController.getRoot()); teamPane.getChildren().add(container); totalRating += RatingUtil.getRating(ratingProvider.apply(player)); } String teamTitle; if ("1".equals(team) || "-1".equals(team)) { teamTitle = i18n.get("game.tooltip.teamTitleNoTeam"); } else if ("null".equals(team)) { teamTitle = i18n.get("game.tooltip.observers"); } else { teamTitle = i18n.get("game.tooltip.teamTitle", Integer.valueOf(team) - 1, totalRating); } teamNameLabel.setText(teamTitle); }

Target:
public void setPlayersInTeam(String team, List<Player> playerList, Function<Player, Rating> ratingProvider) { int totalRating = 0; for (Player player : playerList) { if (player == null) { continue; } PlayerCardTooltipController playerCardTooltipController = uiService.loadFxml("theme/player_card_tooltip.fxml"); playerCardTooltipController.setPlayer(player); RatingChangeLabelController ratingChangeLabelController = uiService.loadFxml("theme/rating_change_label.fxml"); ratingChangeControllersByPlayerId.put(player.getId(), ratingChangeLabelController); HBox container = new HBox(playerCardTooltipController.getRoot(), ratingChangeLabelController.getRoot()); teamPane.getChildren().add(container); totalRating += RatingUtil.getRating(ratingProvider.apply(player)); } String teamTitle; if ("1".equals(team) || "-1".equals(team)) { teamTitle = i18n.get("game.tooltip.teamTitleNoTeam"); } else if ("null".equals(team)) { teamTitle = i18n.get("game.tooltip.observers"); } else { teamTitle = i18n.get("game.tooltip.teamTitle", Integer.valueOf(team) - 1, totalRating); } teamNameLabel.setText(teamTitle); }
Source:
public final Iterable<N> toDepthFirstIterable() { return () -> AbstractTree.this.depthFirstIterator(); }

Target:
public final Iterable<N> toDepthFirstIterable() { return () -> this.depthFirstIterator(); }
Source:
public boolean check(final VDS host) { final int checks = VDSM_RESPONSIVENESS_PERIOD_IN_SECONDS / Config.<Integer> getValue(ConfigValues.SetupNetworksPollingTimeout); HostSetupNetworkPoller poller = new HostSetupNetworkPoller(); for (int i = 0; i < checks; i++) { if (poller.poll(host.getId())) { log.info("Engine managed to communicate with VDSM agent on host '{}' ('{}')", host.getName(), host.getId()); return true; } } return false; }

Target:
public boolean check(final VDS host) { final int checks = VDSM_RESPONSIVENESS_PERIOD_IN_SECONDS / Config.<Integer> getValue(ConfigValues.SetupNetworksPollingTimeout); HostSetupNetworkPoller poller = new HostSetupNetworkPoller(); for (int i = 0; i < checks; i++) { if (poller.poll(host.getId())) { log.info("Engine managed to communicate with VDSM agent on host '{}' with address '{}' ('{}')", host.getName(), host.getHostName(), host.getId()); return true; } } return false; }
Source:
public T toRoot() { if (breadcrumbs.size() == 0 && modificationType != ModificationType.DELETE) { return this.curNode; } if (breadcrumbs.size() == 0 && modificationType == ModificationType.DELETE) { return null; } T curNode = this.curNode; Breadcrumb<T> firstBreadcrumb = breadcrumbs.get(0); Map<String, List<T>> childrenForParent = new LinkedHashMap<>(nodeAdapter.getNamedChildren(firstBreadcrumb.getNode())); NodeLocation locationInParent = firstBreadcrumb.getLocation(); int ix = locationInParent.getIndex(); String name = locationInParent.getName(); List<T> childList = new ArrayList<>(childrenForParent.get(name)); switch (modificationType) { case REPLACE: childList.set(ix, curNode); break; case DELETE: childList.remove(ix); break; case INSERT_BEFORE: childList.add(ix, curNode); break; case INSERT_AFTER: childList.add(ix + 1, curNode); break; } childrenForParent.put(name, childList); curNode = nodeAdapter.withNewChildren(firstBreadcrumb.getNode(), childrenForParent); if (breadcrumbs.size() == 1) { return curNode; } for (Breadcrumb<T> breadcrumb : breadcrumbs.subList(1, breadcrumbs.size())) { Map<String, List<T>> newChildren = new LinkedHashMap<>(nodeAdapter.getNamedChildren(breadcrumb.getNode())); final T newChild = curNode; NodeLocation location = breadcrumb.getLocation(); List<T> list = new ArrayList<>(newChildren.get(location.getName())); list.set(location.getIndex(), newChild); newChildren.put(location.getName(), list); curNode = nodeAdapter.withNewChildren(breadcrumb.getNode(), newChildren); } return curNode; }

Target:
public T toRoot() { if (breadcrumbs.size() == 0 && modificationType != ModificationType.DELETE) { return this.curNode; } if (breadcrumbs.size() == 0 && modificationType == ModificationType.DELETE) { return null; } T curNode = this.curNode; Breadcrumb<T> firstBreadcrumb = breadcrumbs.get(0); Map<String, List<T>> childrenForParent = new HashMap<>(nodeAdapter.getNamedChildren(firstBreadcrumb.getNode())); NodeLocation locationInParent = firstBreadcrumb.getLocation(); int ix = locationInParent.getIndex(); String name = locationInParent.getName(); List<T> childList = new ArrayList<>(childrenForParent.get(name)); switch (modificationType) { case REPLACE: childList.set(ix, curNode); break; case DELETE: childList.remove(ix); break; case INSERT_BEFORE: childList.add(ix, curNode); break; case INSERT_AFTER: childList.add(ix + 1, curNode); break; } childrenForParent.put(name, childList); curNode = nodeAdapter.withNewChildren(firstBreadcrumb.getNode(), childrenForParent); if (breadcrumbs.size() == 1) { return curNode; } for (Breadcrumb<T> breadcrumb : breadcrumbs.subList(1, breadcrumbs.size())) { Map<String, List<T>> newChildren = new LinkedHashMap<>(nodeAdapter.getNamedChildren(breadcrumb.getNode())); final T newChild = curNode; NodeLocation location = breadcrumb.getLocation(); List<T> list = new ArrayList<>(newChildren.get(location.getName())); list.set(location.getIndex(), newChild); newChildren.put(location.getName(), list); curNode = nodeAdapter.withNewChildren(breadcrumb.getNode(), newChildren); } return curNode; }
Source:
private void removeQuestionsAndResponsesIfNotAllowed(FeedbackSessionResultsBundle bundle) { Iterator<FeedbackResponseAttributes> iter = bundle.responses.iterator(); while (iter.hasNext()) { FeedbackResponseAttributes fdr = iter.next(); if (!(instructor != null && instructor.isAllowedForPrivilege(fdr.giverSection, fdr.feedbackSessionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS) && instructor.isAllowedForPrivilege(fdr.recipientSection, fdr.feedbackSessionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS))) { iter.remove(); } } }

Target:
private void removeQuestionsAndResponsesIfNotAllowed(FeedbackSessionResultsBundle bundle) { Iterator<FeedbackResponseAttributes> iter = bundle.responses.iterator(); while (iter.hasNext()) { FeedbackResponseAttributes fdr = iter.next(); boolean instructorCanViewSessionInGiverSection = instructor.isAllowedForPrivilege(fdr.giverSection, fdr.feedbackSessionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS); boolean instructorCanViewSessionInRecipientSection = instructor.isAllowedForPrivilege(fdr.recipientSection, fdr.feedbackSessionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS); boolean instructorDoesNotHaveSessionViewingPrivileges = !(instructorCanViewSessionInGiverSection && instructorCanViewSessionInRecipientSection); if (instructorDoesNotHaveSessionViewingPrivileges) { iter.remove(); } } }
Source:
public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); if (username == null || password == null || username.length() == 0 || password.length() == 0) { throw new LoginException(res.getText(R.string.invalid_username_password).toString()); } urlopen = login(); String response = null; Matcher matcher; try { response = urlopen.open("<LINK_0>"); matcher = reAccounts.matcher(response); while (matcher.find()) { Account acc = new Account(Html.fromHtml(matcher.group(1)).toString().trim(), Helpers.parseBalance(matcher.group(2)), ("fund".equals(matcher.group(4)) ? "f:" : "")+matcher.group(3).trim()); if ("fund".equals(matcher.group(4))) { acc.setType(Account.FUNDS); } else { balance = balance.add(Helpers.parseBalance(matcher.group(3))); } accounts.add(acc); } if (accounts.isEmpty()) { throw new BankException(res.getText(R.string.no_accounts_found).toString()); } } finally { super.updateComplete(); } }

Target:
public void update() throws BankException, LoginException, BankChoiceException, IOException { super.update(); if (username == null || password == null || username.length() == 0 || password.length() == 0) { throw new LoginException(res.getText(R.string.invalid_username_password).toString()); } urlopen = login(); String response = urlopen.open("<LINK_0>"); Matcher matcher = reAccounts.matcher(response); while (matcher.find()) { Account acc = new Account(Html.fromHtml(matcher.group(1)).toString().trim(), Helpers.parseBalance(matcher.group(2)), ("fund".equals(matcher.group(4)) ? "f:" : "")+matcher.group(3).trim()); if ("fund".equals(matcher.group(4))) { acc.setType(Account.FUNDS); } else { balance = balance.add(Helpers.parseBalance(matcher.group(3))); } accounts.add(acc); } if (accounts.isEmpty()) { throw new BankException(res.getText(R.string.no_accounts_found).toString()); } super.updateComplete(); }
Source:
public void start() throws Exception { if (this.jettyConfiguration != null && this.jettyConfiguration.length() > 0) { String[] configs = this.jettyConfiguration.split(","); for (String config : configs) { server = createServerOrApplyConfiguration(config, server); } } else { server = new Server(); ServerConnector http = new ServerConnector(server); http.setPort(port); if (host != null) { http.setHost(host); } server.addConnector(http); } context = new ServletContextHandler(server, ninjaContextPath); ninjaProperties = new NinjaPropertiesImpl(ninjaMode); String serverName = (this.serverUri != null ? this.serverUri.toString() : createServerName()); ninjaProperties.setProperty(NinjaConstant.serverName, serverName); ninjaServletListener.setNinjaProperties(ninjaProperties); ninjaServletListener.setLogInjectorException(false); context.addEventListener(ninjaServletListener); context.addFilter(GuiceFilter.class, "/*", null); context.addServlet(DefaultServlet.class, "/"); try { server.start(); } catch (Exception cause) { if (ninjaServletListener.getNinjaBootstrap() != null && ninjaServletListener.getNinjaBootstrap().getInjectorException() != null) { throw ninjaServletListener.getNinjaBootstrap().getInjectorException(); } else { throw cause; } } }

Target:
public void start() throws Exception { if (this.jettyConfiguration != null && this.jettyConfiguration.length() > 0) { String[] configs = this.jettyConfiguration.split(","); for (String config : configs) { server = createServerOrApplyConfiguration(config, server); } } else { server = new Server(); ServerConnector http = new ServerConnector(server); http.setPort(port); if (host != null) { http.setHost(host); } server.addConnector(http); } context = new ServletContextHandler(server, ninjaContextPath); ninjaProperties = new NinjaPropertiesImpl(ninjaMode); String serverName = (this.serverUri != null ? this.serverUri.toString() : createServerName()); ninjaProperties.setProperty(NinjaConstant.serverName, serverName); ninjaServletListener.setNinjaProperties(ninjaProperties); context.addEventListener(ninjaServletListener); context.addFilter(GuiceFilter.class, "/*", null); context.addServlet(DefaultServlet.class, "/"); try { server.start(); } catch (Exception e) { if (e.getCause() != null && e.getCause() instanceof CreationException) { throw (CreationException)e.getCause(); } else { throw e; } } }
Source:
public void run() { String sessionID = null; try { LOG.info("To read message from adf..."); ReceiveQueueMessageResult resultQM = service.receiveQueueMessage(requestQueueName, opts); BrokeredMessage message = resultQM.getValue(); if (message != null && message.getMessageId() != null) { sessionID = message.getReplyToSessionId(); BufferedReader rd = new BufferedReader( new InputStreamReader(message.getBody())); StringBuilder sb = new StringBuilder(); String line; while ((line = rd.readLine()) != null) { sb.append(line); } rd.close(); String msg = sb.toString(); LOG.info("ADF message: " + msg); service.deleteMessage(message); ADFJob.JobType jobType = ADFJob.getJobType(msg); switch (jobType) { case REPLICATION: ADFReplicationJob job = new ADFReplicationJob(msg, sessionID); job.startJob(); break; case HIVE: ADFHiveJob hiveJob = new ADFHiveJob(msg, sessionID); hiveJob.startJob(); break; case PIG: ADFPigJob pigJob = new ADFPigJob(msg, sessionID); pigJob.startJob(); break; default: } } else { LOG.info("No message from adf"); } } catch (FalconException e) { if (sessionID != null) { sendErrorMessage(sessionID, e.toString()); } LOG.info(e.toString()); } catch (ServiceException | IOException e) { LOG.info(e.toString()); } }

Target:
public void run() { String sessionID = null; try { LOG.info("To read message from adf..."); ReceiveQueueMessageResult resultQM = service.receiveQueueMessage(requestQueueName, opts); BrokeredMessage message = resultQM.getValue(); if (message != null && message.getMessageId() != null) { sessionID = message.getReplyToSessionId(); BufferedReader rd = new BufferedReader( new InputStreamReader(message.getBody())); StringBuilder sb = new StringBuilder(); String line; while ((line = rd.readLine()) != null) { sb.append(line); } rd.close(); String msg = sb.toString(); LOG.info("ADF message: " + msg); service.deleteMessage(message); ADFJob job = ADFJobFactory.buildADFJob(msg, sessionID); job.startJob(); } else { LOG.info("No message from adf"); } } catch (FalconException e) { if (sessionID != null) { sendErrorMessage(sessionID, e.toString()); } LOG.info(e.toString()); } catch (ServiceException | IOException e) { LOG.info(e.toString()); } }
Source:
public List<FeedbackQuestionAttributes> getCopiableFeedbackQuestionsForInstructor(String googleId) throws EntityDoesNotExistException { List<FeedbackQuestionAttributes> copiableQuestions = new ArrayList<>(); List<CourseAttributes> courses = coursesLogic.getCoursesForInstructor(googleId); for (CourseAttributes course : courses) { List<FeedbackSessionAttributes> sessions = fsLogic.getFeedbackSessionsForCourse(course.getId()); for (FeedbackSessionAttributes session : sessions) { List<FeedbackQuestionAttributes> questions = getFeedbackQuestionsForSession(session.getFeedbackSessionName(), course.getId()); copiableQuestions.addAll(questions); } } copiableQuestions.sort(Comparator.comparing((FeedbackQuestionAttributes copiableQuestion) -> copiableQuestion.courseId) .thenComparing(copiableQuestion -> copiableQuestion.getQuestionDetails().getQuestionTypeDisplayName())); return copiableQuestions; }

Target:
public List<FeedbackQuestionAttributes> getCopiableFeedbackQuestionsForInstructor(String googleId) throws EntityDoesNotExistException { List<FeedbackQuestionAttributes> copiableQuestions = new ArrayList<>(); List<CourseAttributes> courses = coursesLogic.getCoursesForInstructor(googleId); for (CourseAttributes course : courses) { List<FeedbackSessionAttributes> sessions = fsLogic.getFeedbackSessionsForCourse(course.getId()); for (FeedbackSessionAttributes session : sessions) { List<FeedbackQuestionAttributes> questions = getFeedbackQuestionsForSession(session.getFeedbackSessionName(), course.getId()); copiableQuestions.addAll(questions); } } copiableQuestions.sort(Comparator.comparing((FeedbackQuestionAttributes question) -> question.courseId) .thenComparing(question -> question.feedbackSessionName) .thenComparing(question -> question.getQuestionDetails().getQuestionTypeDisplayName()) .thenComparing(question -> question.getQuestionDetails().getQuestionText())); return copiableQuestions; }
Source:
public boolean isBucketEmpty(String volume, String bucket) throws IOException { String keyPrefix = getBucketKey(volume, bucket); Iterator<Map.Entry<CacheKey<String>, CacheValue<OmKeyInfo>>> iterator = ((TypedTable< String, OmKeyInfo>) keyTable).cacheIterator(); while (iterator.hasNext()) { Map.Entry< CacheKey<String>, CacheValue<OmKeyInfo>> entry = iterator.next(); String key = entry.getKey().getCacheKey(); OmKeyInfo omKeyInfo = entry.getValue().getCacheValue(); if (key.startsWith(keyPrefix) && omKeyInfo != null) { return false; } } try (TableIterator<String, ? extends KeyValue<String, OmKeyInfo>> keyIter = keyTable.iterator()) { KeyValue<String, OmKeyInfo> kv = keyIter.seek(keyPrefix); if (kv != null && kv.getKey().startsWith(keyPrefix) && keyTable.get(kv.getKey()) != null) { return false; } } return true; }

Target:
public boolean isBucketEmpty(String volume, String bucket) throws IOException { String keyPrefix = getBucketKey(volume, bucket); Iterator<Map.Entry<CacheKey<String>, CacheValue<OmKeyInfo>>> iterator = ((TypedTable< String, OmKeyInfo>) keyTable).cacheIterator(); while (iterator.hasNext()) { Map.Entry< CacheKey<String>, CacheValue<OmKeyInfo>> entry = iterator.next(); String key = entry.getKey().getCacheKey(); OmKeyInfo omKeyInfo = entry.getValue().getCacheValue(); if (key.startsWith(keyPrefix) && omKeyInfo != null) { return false; } } try (TableIterator<String, ? extends KeyValue<String, OmKeyInfo>> keyIter = keyTable.iterator()) { KeyValue<String, OmKeyInfo> kv = keyIter.seek(keyPrefix); if (kv != null) { CacheValue<OmKeyInfo> cacheValue = keyTable.getCacheValue(new CacheKey(kv.getKey())); if (cacheValue != null) { if (kv.getKey().startsWith(keyPrefix) && cacheValue.getCacheValue() != null) { return false; } } else { if (kv.getKey().startsWith(keyPrefix)) { return false; } } } } return true; }
Source:
protected void activate(final EndpointConfiguration config) throws AdobeioException { LOGGER.debug("Start ACTIVATE Endpoint {}", config.getId()); this.config = config; this.endpointId = config.getId(); LOGGER.debug("End ACTIVATE Endpoint {}", endpointId); if (null == this.integrationService) { throw new AdobeioException("Integration-service not defined"); } }

Target:
protected void activate(final EndpointConfiguration config) throws Exception { LOGGER.debug("Start ACTIVATE Endpoint {}", config.id()); this.id = config.id(); this.url = config.endpoint(); this.method = config.method(); this.config = config; this.specificServiceHeaders = convertServiceSpecificHeaders(config.specificServiceHeaders()); LOGGER.debug("End ACTIVATE Endpoint {}", id); }
Source:
private IPersonAttributesGroupDefinition getOrCreateGroup(IPersonAttributesGroupStoreDefinition store, String name, String description) { List<IPersonAttributesGroupDefinition> groups = personAttributesGroupDefinitionDao.getPersonAttributesGroupDefinitionByName(name); if (groups.size() == 0) { return personAttributesGroupDefinitionDao.createPersonAttributesGroupDefinition(store, name, description); } else { groups.get(0).setDescription(description); personAttributesGroupDefinitionDao.updatePersonAttributesGroupDefinition(groups.get(0)); return groups.get(0); } }

Target:
private IPersonAttributesGroupDefinition getOrCreateGroup(IPersonAttributesGroupStoreDefinition store, String name, String description) { Set<IPersonAttributesGroupDefinition> groups = personAttributesGroupDefinitionDao.getPersonAttributesGroupDefinitionByName(name); if (groups.size() == 0) { return personAttributesGroupDefinitionDao.createPersonAttributesGroupDefinition(store, name, description); } else { groups.iterator().next().setDescription(description); personAttributesGroupDefinitionDao.updatePersonAttributesGroupDefinition(groups.iterator().next()); return groups.iterator().next(); } }
Source:
protected void initialize() { speed = speedSupply.get() * scale + offset; motor.set(speed); }

Target:
protected void initialize() { speed = speedSupply.get(); motor.set(speed); }
Source:
@Override public void removeType(int typeId) { if (metadataLocCache.computeIfAbsent(typeId, (id) -> { throw new IgniteException("Failed to remove metadata, type not found: " + id); }) .removing()) throw new IgniteException("Failed to remove metadata, type is being removed: " + typeId); if (!IgniteFeatures.allNodesSupports(ctx.discovery().allNodes(), IgniteFeatures.REMOVE_METADATA)) { throw new IgniteException("Failed to remove metadata, " + "all cluster nodes must support the remove type feature"); } try { GridFutureAdapter<MetadataUpdateResult> fut = transport.requestMetadataRemove(typeId); MetadataUpdateResult res = fut.get(); if (res.rejected()) throw res.error(); } catch (IgniteCheckedException e) { IgniteCheckedException ex = e; if (ctx.isStopping()) { ex = new NodeStoppingException("Node is stopping."); ex.addSuppressed(e); } throw new BinaryObjectException("Failed to remove metadata for type: " + typeId, ex); } }

Target:
@Override public void removeType(int typeId) { BinaryMetadataHolder oldHld = metadataLocCache.get(typeId); if (oldHld == null) throw new IgniteException("Failed to remove metadata, type not found: " + typeId); if (oldHld.removing()) throw new IgniteException("Failed to remove metadata, type is being removed: " + typeId); if (!IgniteFeatures.allNodesSupports(ctx.discovery().allNodes(), IgniteFeatures.REMOVE_METADATA)) { throw new IgniteException("Failed to remove metadata, " + "all cluster nodes must support the remove type feature"); } try { GridFutureAdapter<MetadataUpdateResult> fut = transport.requestMetadataRemove(typeId); MetadataUpdateResult res = fut.get(); if (res.rejected()) throw res.error(); } catch (IgniteCheckedException e) { IgniteCheckedException ex = e; if (ctx.isStopping()) { ex = new NodeStoppingException("Node is stopping."); ex.addSuppressed(e); } throw new BinaryObjectException("Failed to remove metadata for type: " + typeId, ex); } }
Source:
private List<String> readTextOutput(Location outputLocation) throws IOException { String data = ""; for (Location file : outputLocation.list()) { String fileName = file.getName(); if (fileName.startsWith("part")) { String partData = CharStreams.toString(new InputStreamReader(file.getInputStream(), Charsets.UTF_8)); data += partData; } } List<String> records = new ArrayList<>(); Collections.addAll(records, data.split("\n")); return records; }

Target:
private Set<String> readTextOutput(Location outputLocation) throws IOException { Set<String> records = new HashSet<>(); for (Location file : outputLocation.list()) { String fileName = file.getName(); if (fileName.startsWith("part")) { Scanner scanner = new Scanner(new InputStreamReader(file.getInputStream(), Charsets.UTF_8)); while (scanner.hasNext()) { records.add(scanner.nextLine()); } scanner.close(); } } return records; }
Source:
public void performOperations(List<LuceneWork> workList, IndexingMonitor monitor) { List<ElasticsearchWork<?>> elasticsearchWorks = new ArrayList<>( workList.size() ); for ( LuceneWork luceneWork : workList ) { elasticsearchWorks.add( luceneWork.acceptIndexWorkVisitor( visitor, monitor ) ); } if ( sync ) { workProcessor.executeSyncSafe( elasticsearchWorks ); } else { for ( ElasticsearchWork<?> work : elasticsearchWorks ) { workProcessor.executeAsync( work ); } } }

Target:
public void performOperations(List<LuceneWork> workList, IndexingMonitor monitor) { List<ElasticsearchWork<?>> elasticsearchWorks = new ArrayList<>( workList.size() ); for ( LuceneWork luceneWork : workList ) { elasticsearchWorks.add( luceneWork.acceptIndexWorkVisitor( visitor, monitor ) ); } if ( sync ) { workProcessor.executeSyncSafe( elasticsearchWorks ); } else { workProcessor.executeAsync( elasticsearchWorks ); } }
Source:
public EapAuthenticator( Looper looper, IEapCallback cb, Context context, EapSessionConfig eapSessionConfig) { this(looper, cb, context, eapSessionConfig, new SecureRandom()); }

Target:
public EapAuthenticator( Looper looper, IEapCallback cb, Context context, EapSessionConfig eapSessionConfig) { this(looper, cb, context, eapSessionConfig, DEFAULT_RANDOM_FACTORY); }
Source:
public String getName() { return getFileName(miInfo.getFile()); }

Target:
public String getName() { String name = miInfo != null ? miInfo.getFile() : null; if (name == null) return name; try { Path p = Paths.get(name); name = p.getFileName().toString(); } catch (InvalidPathException e) { } return name; }
Source:
public void cleanup() throws DBException { try { client.close(); } catch (IOException e) { e.printStackTrace(); } }

Target:
public void cleanup() throws DBException { try { client.close(); } catch (IOException e) { throw new DBException(e); } }
Source:
private TopologyInfo getTopologyInfoByNameImpl(String name, GetInfoOptions options) throws NotAliveException, AuthorizationException, TException { IStormClusterState state = stormClusterState; String id = state.getTopoId(name).orElseThrow(() -> new WrappedNotAliveException(name + " is not alive")); return getTopologyInfoWithOpts(id, options); }

Target:
private TopologyInfo getTopologyInfoByNameImpl(String name, GetInfoOptions options) throws NotAliveException, AuthorizationException, Exception { IStormClusterState state = stormClusterState; String id = state.getTopoId(name).orElseThrow(() -> new WrappedNotAliveException(name + " is not alive")); return getTopologyInfoWithOptsImpl(id, options); }
Source:
public void reflow() { getTaskEditorPage().reflow(); }

Target:
public void reflow() { if (!isReflowSupressed()) { getTaskEditorPage().reflow(); } }
Source:
public List<String> getResourceCrnListByResourceNameList(List<String> resourceNames) { return repository.findByNameIn(resourceNames).stream() .map(db -> db.getResourceCrn().toString()).collect(Collectors.toList()); }

Target:
public List<String> getResourceCrnListByResourceNameList(List<String> resourceNames) { return repository.findResourceCrnsByNames(resourceNames) .stream().map(Crn::toString).collect(Collectors.toList()); }
Source:
private void handleStateChange(ConnectionState newState) { switch ( newState ) { case SUSPENDED: publishEvent(TreeCacheEvent.Type.CONNECTION_SUSPENDED); break; case LOST: publishEvent(TreeCacheEvent.Type.CONNECTION_LOST); break; case RECONNECTED: try { root.wasReconnected(); publishEvent(TreeCacheEvent.Type.CONNECTION_RECONNECTED); } catch ( Exception e ) { handleException(e); } break; } }

Target:
private void handleStateChange(ConnectionState newState) { switch ( newState ) { case SUSPENDED: publishEvent(TreeCacheEvent.Type.CONNECTION_SUSPENDED); break; case LOST: publishEvent(TreeCacheEvent.Type.CONNECTION_LOST); break; case CONNECTED: try { root.wasCreated(); } catch ( Exception e ) { handleException(e); } break; case RECONNECTED: try { root.wasReconnected(); publishEvent(TreeCacheEvent.Type.CONNECTION_RECONNECTED); } catch ( Exception e ) { handleException(e); } break; } }
Source:
protected ProcessingResult process(List<KnowledgeMotionDataRow> rows, ProcessingResult processingResult) { for (KnowledgeMotionDataRow row : rows) { try { Optional<Content> written = dataHandler.handle(row); if (written.isPresent()) { seenUris.add(written.get().getCanonicalUri()); } } catch (RuntimeException e) { processingResult.error(row.getId(), e.getMessage()); } } Iterator<Content> allStoredKmContent = contentLister.listContent(ContentListingCriteria.defaultCriteria().forContent(ContentCategory.TOP_LEVEL_ITEM).forPublishers(allKmPublishers).build()); while (allStoredKmContent.hasNext()) { Content item = allStoredKmContent.next(); if (! seenUris.contains(item.getCanonicalUri())) { item.setActivelyPublished(false); dataHandler.write(item); } } return processingResult; }

Target:
protected ProcessingResult process(List<KnowledgeMotionDataRow> rows, ProcessingResult processingResult) { boolean allRowsSuccess = true; for (KnowledgeMotionDataRow row : rows) { try { Optional<Content> written = dataHandler.handle(row); if (written.isPresent()) { seenUris.add(written.get().getCanonicalUri()); } } catch (RuntimeException e) { allRowsSuccess = false; processingResult.error(row.getId(), e.getMessage()); } } if (allRowsSuccess) { Iterator<Content> allStoredKmContent = contentLister.listContent(ContentListingCriteria.defaultCriteria().forContent(ContentCategory.TOP_LEVEL_ITEM).forPublishers(allKmPublishers).build()); while (allStoredKmContent.hasNext()) { Content item = allStoredKmContent.next(); if (!seenUris.contains(item.getCanonicalUri())) { item.setActivelyPublished(false); dataHandler.write(item); } } } return processingResult; }
Source:
private void requestRoutingTable() { LOG.log(Level.FINE, "Sends a request for the routing table"); try (final TraceScope traceScope = Trace.startSpan("ROUTING_INIT_REQUEST")) { final TraceInfo traceInfo = TraceInfo.fromSpan(traceScope.getSpan()); msgSender.get().sendRoutingTableInitReqMsg(traceInfo); } }

Target:
private void requestRoutingTable() { LOG.log(Level.FINE, "Sends a request for the routing table"); try (final TraceScope traceScope = Trace.startSpan("ROUTING_TABLE_REQUEST")) { final TraceInfo traceInfo = TraceInfo.fromSpan(traceScope.getSpan()); msgSender.get().sendRoutingTableInitReqMsg(traceInfo); } }
Source:
public Record afterRead(Record record, LogOffset offset) { for (RecordFilter filter : filters) { if (record != null) { record = filter.afterRead(record, offset); } } return record; }

Target:
public Record afterRead(Record record, LogOffset offset) { for (Iterator iterator = filters.descendingIterator(); record != null && iterator.hasNext();) { RecordFilter filter = (RecordFilter) iterator.next(); record = filter.afterRead(record, offset); } return record; }
Source:
protected boolean executeAnalysis(@NonNull IProgressMonitor monitor) throws TmfAnalysisException { ITmfTrace trace = getTrace(); if (trace == null) { initialize(false); return false; } File segmentStoreFile = getSupplementaryFile(getSegmentStoreFileName()); File stateSystemFile = getSupplementaryFile(getStateSystemFileName()); if (segmentStoreFile == null || stateSystemFile == null) { return false; } if (!segmentStoreFile.exists()) { fStateSystemModule.cancel(); stateSystemFile.delete(); } IStatus segmentStoreStatus = fSegmentStoreModule.schedule(); IStatus stateSystemStatus = fStateSystemModule.schedule(); if (!(segmentStoreStatus.isOK() && stateSystemStatus.isOK())) { cancelSubAnalyses(); initialize(false); return false; } if (!fStateSystemModule.waitForInitialization()) { initialize(false); return false; } ITmfStateSystem stateSystem = fStateSystemModule.getStateSystem(); if (stateSystem == null) { initialize(false); return false; } initialize(true); return fStateSystemModule.waitForCompletion(monitor) && fSegmentStoreModule.waitForCompletion(monitor); }

Target:
protected boolean executeAnalysis(@NonNull IProgressMonitor monitor) throws TmfAnalysisException { ITmfTrace trace = getTrace(); if (trace == null) { analysisReady(false); return false; } File segmentStoreFile = getSupplementaryFile(getSegmentStoreFileName()); File stateSystemFile = getSupplementaryFile(getStateSystemFileName()); if (segmentStoreFile == null || stateSystemFile == null) { analysisReady(false); return false; } if (!segmentStoreFile.exists()) { fStateSystemModule.cancel(); stateSystemFile.delete(); } IStatus segmentStoreStatus = fSegmentStoreModule.schedule(); IStatus stateSystemStatus = fStateSystemModule.schedule(); if (!(segmentStoreStatus.isOK() && stateSystemStatus.isOK())) { cancelSubAnalyses(); analysisReady(false); return false; } if (!fStateSystemModule.waitForInitialization()) { analysisReady(false); cancelSubAnalyses(); return false; } ITmfStateSystem stateSystem = fStateSystemModule.getStateSystem(); if (stateSystem == null) { analysisReady(false); throw new IllegalStateException("Initialization of the state system module succeeded but the statesystem is null"); } analysisReady(true); return fStateSystemModule.waitForCompletion(monitor) && fSegmentStoreModule.waitForCompletion(monitor); }
Source:
public static String getString(IMolecularFormula formula, String[] orderElements, boolean setOne, boolean setMassNumber) { StringBuffer stringMF = new StringBuffer(); List<IIsotope> isotopesList = putInOrder(orderElements, formula); List<String> elemSet = new ArrayList<String>(); for (IIsotope isotope : isotopesList) { String symbol = isotope.getSymbol(); if (!elemSet.contains(symbol)) elemSet.add(symbol); } if (!setMassNumber) { for (String elem : elemSet) { int count = 0; for (IIsotope isotope : formula.isotopes()) { if (isotope.getSymbol().equals(elem)) count += formula.getIsotopeCount(isotope); } stringMF.append(elem); if (!(count == 1 && !setOne)) stringMF.append(count); } } else { for (IIsotope isotope : isotopesList) { int count = formula.getIsotopeCount(isotope); try { IIsotope major = Isotopes.getInstance().getMajorIsotope(isotope.getSymbol()); if (Objects.equals(isotope.getMassNumber(), major.getMassNumber())) stringMF.append(isotope.getSymbol()); else stringMF.append("["+isotope.getMassNumber()+isotope.getSymbol()+"]"); } catch (IOException e) { e.printStackTrace(); } if (!(count == 1 && !setOne)) stringMF.append(count); } } return stringMF.toString(); }

Target:
public static String getString(IMolecularFormula formula, String[] orderElements, boolean setOne, boolean setMassNumber) { StringBuffer stringMF = new StringBuffer(); List<IIsotope> isotopesList = putInOrder(orderElements, formula); List<String> elemSet = new ArrayList<String>(); for (IIsotope isotope : isotopesList) { String symbol = isotope.getSymbol(); if (!elemSet.contains(symbol)) elemSet.add(symbol); } if (!setMassNumber) { for (String elem : elemSet) { int count = 0; for (IIsotope isotope : formula.isotopes()) { if (isotope.getSymbol().equals(elem)) count += formula.getIsotopeCount(isotope); } stringMF.append(elem); if (!(count == 1 && !setOne)) stringMF.append(count); } } else { for (IIsotope isotope : isotopesList) { int count = formula.getIsotopeCount(isotope); try { IIsotope major = Isotopes.getInstance().getMajorIsotope(isotope.getSymbol()); if (isotope.getMassNumber() == null) stringMF.append(isotope.getSymbol()); else stringMF.append("[") .append(isotope.getMassNumber()) .append(isotope.getSymbol()) .append("]"); } catch (IOException e) { e.printStackTrace(); } if (!(count == 1 && !setOne)) stringMF.append(count); } } return stringMF.toString(); }
Source:
public void onConnectionStateChange(String newConnectionState) { switch (newConnectionState) { case CONNECTION_LOST: updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "The connection to the digitalSTROM-Server can't established"); devStatMan.stop(); break; case CONNECTION_RESUMED: setStatus(ThingStatus.ONLINE); devStatMan.start(); sceneMan.start(); break; case APPLICATION_TOKEN_GENERATED: if (connMan != null) { Configuration config = this.getConfig(); if (config != null) { config.remove(USER_NAME); config.remove(PASSWORD); config.put(APPLICATION_TOKEN, connMan.getApplicationToken()); this.updateConfiguration(config); } } default: } }

Target:
public void onConnectionStateChange(String newConnectionState) { switch (newConnectionState) { case CONNECTION_LOST: updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "The connection to the digitalSTROM-Server cannot be established."); devStatMan.stop(); break; case CONNECTION_RESUMED: if (connectionTimeoutCounter > 0) { setStatus(ThingStatus.ONLINE); devStatMan.start(); } break; case APPLICATION_TOKEN_GENERATED: if (connMan != null) { Configuration config = this.getConfig(); if (config != null) { config.remove(USER_NAME); config.remove(PASSWORD); config.put(APPLICATION_TOKEN, connMan.getApplicationToken()); this.updateConfiguration(config); } } return; default: } connectionTimeoutCounter = 0; }
Source:
GridUserInterface decode(Map<String, Object> inputParam) { String member_DN = new String("userDN"); String member_Fqans = new String("userFQANS"); String dnString = (String) inputParam.get(member_DN); List<Object> fqansList = null; try { fqansList = Arrays.asList((Object[]) inputParam.get(member_Fqans)); } catch (NullPointerException e) { log.debug("Empty FQAN[] found.", e); } FQAN[] fqans = null; if (fqansList != null) { fqans = new FQAN[fqansList.size()]; log.debug("fqans_vector Size: {}" , fqansList.size()); for (int i = 0; i < fqansList.size(); i++) { String fqan_string = (String) fqansList.get(i); log.debug("FQAN[{}]: {}",i, fqan_string); FQAN fq = new FQAN(fqan_string); fqans[i] = fq; } } if (dnString != null) { log.debug("DN: {}" , dnString); if (fqans != null && fqans.length > 0) { log.debug("VomsGU with FQAN"); try { return createGridUser(dnString, fqans); } catch (IllegalArgumentException e) { log.error(e.getMessage(), e); } } else { return createGridUser(dnString); } } return null; }

Target:
GridUserInterface decode(Map<String, Object> inputParam) { String member_DN = new String("userDN"); String member_Fqans = new String("userFQANS"); String dnString = (String) inputParam.get(member_DN); Object[] fqansArr = (Object[]) inputParam.get(member_Fqans); FQAN[] fqans = null; if (fqansArr != null) { fqans = new FQAN[fqansArr.length]; log.debug("fqans_vector Size: {}" , fqansArr.length); for (int i = 0; i < fqansArr.length; i++) { log.debug("FQAN[{}]: {}",i, (String) fqansArr[i]); fqans[i] = new FQAN((String) fqansArr[i]); } } if (dnString != null) { log.debug("DN: {}" , dnString); if (fqans != null && fqans.length > 0) { log.debug("VomsGU with FQAN"); try { return createGridUser(dnString, fqans); } catch (IllegalArgumentException e) { log.error(e.getMessage(), e); } } else { return createGridUser(dnString); } } return null; }
Source:
public List<PermissionSubject> getPermissionCheckSubjects() { if (getNetwork() == null) { return Collections.<PermissionSubject> emptyList(); } NGuid dataCenterId = getNetwork().getDataCenterId(); return Collections.singletonList(new PermissionSubject(dataCenterId == null ? null : dataCenterId.getValue(), VdcObjectType.StoragePool, getActionType().getActionGroup())); }

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { Network network = getNetwork(); NGuid dataCenterId = network == null ? null : network.getDataCenterId(); return Collections.singletonList(new PermissionSubject(dataCenterId == null ? null : dataCenterId.getValue(), VdcObjectType.StoragePool, getActionType().getActionGroup())); }
Source:
private void closeAllActivities() { if (!shutdown) { Intent intent = null; if (BuildConfig.CREATE_AT_SCHOOL) { try { intent = new Intent(currentActivity.getApplicationContext(), Class.forName("org.catrobat.catroid.createatschool.ui" + ".CreateAtSchoolMainMenuActivity")); } catch (ClassNotFoundException e) { Log.e(TAG, e.getMessage()); } } else if (BuildConfig.PHIRO_CODE) { try { intent = new Intent(currentActivity.getApplicationContext(), Class.forName("org.catrobat.catroid.phiro.ui" + ".PhiroMainMenuActivity")); } catch (ClassNotFoundException e) { Log.e(TAG, e.getMessage()); } } else { intent = new Intent(currentActivity.getApplicationContext(), MainMenuActivity.class); } intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); currentActivity.startActivity(intent); } }

Target:
private void closeAllActivities() { if (!shutdown) { Intent intent = new Intent(currentActivity.getApplicationContext(), MainMenuActivity.class); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); currentActivity.startActivity(intent); } }
Source:
default Map<String, Object> getStats() { return null; }

Target:
default Map<String, Map<String, Object>> getStats() { return ImmutableMap.of(); }
Source:
public List<HistoryToken> findByIdInSerializedValueAndElementType(Integer id, String elementTypeTableName, boolean lastOnly) { return em().createNativeQuery("" + "SELECT ht.* " + "FROM " + EntityConstants.HISTORY_TOKEN_TABLE + " ht " + "WHERE (ht." + EntityConstants.HISTORY_TOKEN_COLUMN_VALUE + " = :id " + "OR ht." + EntityConstants.HISTORY_TOKEN_COLUMN_VALUE + " ~ ('^(.*~)?'||:id||'(~.*)?$') ) " + (elementTypeTableName == null ? "" : "AND EXISTS (SELECT * FROM " + elementTypeTableName + ") ") + "ORDER BY ht." + EntityConstants.HISTORY_TOKEN_COLUMN_DATE + " DESC" + (lastOnly ? " LIMIT 1" : ""), HistoryToken.class) .setParameter("id", String.valueOf(id)) .getResultList(); }

Target:
public List<HistoryToken> findByIdInSerializedValueAndElementType(Integer id, String elementTypeTableName, boolean lastOnly) { Query q = em().createNativeQuery("" + "SELECT ht.* " + "FROM " + EntityConstants.HISTORY_TOKEN_TABLE + " ht " + "WHERE (ht." + EntityConstants.HISTORY_TOKEN_COLUMN_VALUE + " = :id " + "OR ht." + EntityConstants.HISTORY_TOKEN_COLUMN_VALUE + " ~ ('^(.*~)?'||:id||'(~.*)?$') ) " + (elementTypeTableName == null ? "" : "AND EXISTS (SELECT * FROM " + elementTypeTableName + ") ") + "ORDER BY ht." + EntityConstants.HISTORY_TOKEN_COLUMN_DATE + " DESC", HistoryToken.class) .setParameter("id", String.valueOf(id)); if (lastOnly) { q = q.setMaxResults(1); } return q.getResultList(); }
Source:
public synchronized AuthAwareConfigContext reload() { final int newFingerprint = calculateAuthParamsFingerprint(this); if (newFingerprint == parametersFingerprint) { return this; } if (this.authContext != null) { final ThreadLocalSigner signer = authContext.signer; if (signer != null) { signer.clearAll(); } this.authContext = null; } if (BooleanUtils.isNotTrue(noAuth())) { this.authContext = doLoad(); } parametersFingerprint = newFingerprint; return this; }

Target:
public AuthAwareConfigContext reload() { synchronized (lock) { final int newParamsFingerprint = calculateAuthParamsFingerprint(this); if (authContext != null) { if (authContext.paramsFingerprint == newParamsFingerprint) { return this; } else { authContext.signer.clearAll(); authContext = null; } } if (BooleanUtils.isNotTrue(noAuth())) { authContext = doLoad(newParamsFingerprint); } } return this; }
Source:
public String getUnstableTotalAll() { return thresholds.unstableTotalHigh; }

Target:
public String getUnstableTotalAll() { return thresholds.unstableTotalAll; }
Source:
protected void validationStatusChanged(final IStatus status) { updateTextEditorFeedback(status); messageManager.removeAllMessages(); if (!status.isOK() && getViewer().isCellEditorActive()) { messageManager.addMessage("", status.getMessage(), null, new StatusToMessageSeverity(status).toMessageSeverity()); } }

Target:
protected void validationStatusChanged(final IStatus status) { updateTextEditorFeedback(status); messageManager.removeAllMessages(); if (!status.isOK() && getViewer().isCellEditorActive()) { messageManager.addMessage(null, status.getMessage(), null, new StatusToMessageSeverity(status).toMessageSeverity()); } }
Source:
protected BufferedReader getHtml(ClientConnection connection) { if (connection.inputStream == null) { return null; } BufferedReader br = new BufferedReader( new InputStreamReader(connection.inputStream, StandardCharsets.UTF_8)); return br; }

Target:
public BufferedReader getHtml(ClientConnection connection) { if (connection.inputStream == null) { return null; } BufferedReader br = new BufferedReader( new InputStreamReader(connection.inputStream, StandardCharsets.UTF_8)); return br; }