auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static Optional<Long> getCorporateCardSurchargeFor(AuthCardDetails authCardDetails, ChargeEntity chargeEntity) { if (authCardDetails.isCorporateCard()) { if (isCreditSurcharge(authCardDetails, chargeEntity)) { return Optional.of(chargeEntity.getGatewayAccount().getCorporateCreditCardSurchargeAmount()); } if (isDebitSurcharge(authCardDetails, chargeEntity)) { return Optional.of(chargeEntity.getGatewayAccount().getCorporateDebitCardSurchargeAmount()); } if (isPrepaidCreditSurcharge(authCardDetails, chargeEntity)) { return Optional.of(chargeEntity.getGatewayAccount().getCorporatePrepaidCreditCardSurchargeAmount()); } if (isPrepaidDebitSurcharge(authCardDetails, chargeEntity)) { return Optional.of(chargeEntity.getGatewayAccount().getCorporatePrepaidDebitCardSurchargeAmount()); } } return Optional.empty(); }

Target:
public static Optional<Long> getCorporateCardSurchargeFor(AuthCardDetails authCardDetails, ChargeEntity chargeEntity) { long surcharge = FixedCorporateCardSurchargeCalculator.calculate(authCardDetails, chargeEntity); return surcharge > 0 ? Optional.of(surcharge) : Optional.empty(); }
Source:
public Builder withCreatedAt(Date createdAt) { Date dateToAdd = (createdAt == null) ? Const.TIME_REPRESENTS_DEFAULT_TIMESTAMP : createdAt; studentAttributes.setCreatedAt(dateToAdd); return this; }

Target:
public Builder withCreatedAt(Date createdAt) { Date dateToAdd = createdAt == null ? Const.TIME_REPRESENTS_DEFAULT_TIMESTAMP : createdAt; studentAttributes.setCreatedAt(dateToAdd); return this; }
Source:
protected void buildScript(int age, WikiSite wiki) { boolean restBaseEnabled = RbSwitch.INSTANCE.isRestBaseEnabled(WikiSite.forLanguageCode(wiki.languageCode())); if (age == 0) { addPendingClient(new SearchClient()); if (restBaseEnabled) { addPendingClient(new AnnouncementClient()); } } if (restBaseEnabled) { addPendingClient(new AggregatedFeedContentClient()); } addPendingClient(new ContinueReadingClient()); if (age == 0) { addPendingClient(new MainPageClient()); } addPendingClient(new BecauseYouReadClient()); if (age == 0) { addPendingClient(new RandomClient()); } }

Target:
protected void buildScript(int age, WikiSite wiki) { boolean restBaseEnabled = RbSwitch.INSTANCE.isRestBaseEnabled(wiki); if (age == 0) { addPendingClient(new SearchClient()); if (restBaseEnabled) { addPendingClient(new AnnouncementClient()); } } if (restBaseEnabled) { addPendingClient(new AggregatedFeedContentClient()); } addPendingClient(new ContinueReadingClient()); if (age == 0) { addPendingClient(new MainPageClient()); } addPendingClient(new BecauseYouReadClient()); if (age == 0) { addPendingClient(new RandomClient()); } }
Source:
public void testCompatibility() throws Exception { DocumentModel root = session.getDocument(new PathRef("/")); JsonAssert json = jsonAssert(root, CtxBuilder.enrichDoc("acls").get()); json = json.has("contextParameters").isObject(); json.properties(1); json = json.has("acls").length(1).has(0); json.has("name").isEquals("local"); json.has("aces").isArray(); json.hasNot("ace"); try { harness.deployContrib("org.nuxeo.ecm.permissions", "test-acl-enricher-compat-config.xml"); json = jsonAssert(root, CtxBuilder.enrichDoc("acls").get()); json = json.has("contextParameters").isObject(); json.properties(1); json = json.has("acls").length(1).has(0); json.has("name").isEquals("local"); json.has("aces").isArray(); JsonAssert aces = json.has("ace").get(0); aces.has("username").isText(); aces.has("creator").isNull(); json.has("ace").isArray(); JsonAssert ace = json.has("ace").get(0); ace.has("username").isText(); ace.has("creator").isNull(); } finally { harness.undeployContrib("org.nuxeo.ecm.permissions", "test-acl-enricher-compat-config.xml"); } }

Target:
public void testCompatibility() throws Exception { DocumentModel root = session.getDocument(new PathRef("/")); JsonAssert json = jsonAssert(root, CtxBuilder.enrichDoc("acls").get()); json = json.has("contextParameters").isObject(); json.properties(1); json = json.has("acls").length(1).has(0); json.has("name").isEquals("local"); json.has("aces").isArray(); JsonAssert aces = json.has("ace").get(0); aces.has("username").isText(); aces.has("creator").isNull(); json.has("ace").isArray(); JsonAssert ace = json.has("ace").get(0); ace.has("username").isText(); ace.has("creator").isNull(); }
Source:
public Collection<Object> getAttributeValues(IAtsObject atsObject, IAttributeType attributeType) throws OseeCoreException { try { Artifact artifact = WorkItemUtil.get(atsObject); Conditions.checkNotNull(artifact, "workItem", "Can't Find Artifact matching " + atsObject.toStringWithId()); return artifact.getAttributeValues(attributeType); } catch (ArtifactDoesNotExist ex) { return Collections.emptyList(); } }

Target:
public Collection<Object> getAttributeValues(IAtsObject atsObject, IAttributeType attributeType) throws OseeCoreException { Artifact artifact = null; try { artifact = WorkItemUtil.get(atsObject); } catch (ArtifactDoesNotExist ex) { return Collections.emptyList(); } Conditions.checkNotNull(artifact, "workItem", "Can't Find Artifact matching " + atsObject.toStringWithId()); return artifact.getAttributeValues(attributeType); }
Source:
public int getLineOfText(final String text) { return TextEditorHandler.getInstance().getLineOfText((ITextEditor)getEditorPart(), text); }

Target:
public int getLineOfText(final String text) { return getLineOfText(text, 0); }
Source:
private void createSwitchBody(IDecisionNode switchNode, IConnectorNode mergeNode, IASTStatement body) { if (!(body instanceof IASTCompoundStatement)) return; IASTCompoundStatement comp = (IASTCompoundStatement) body; IBasicBlock prev = switchNode; IConnectorNode savedBreak = outerBreak; outerBreak = mergeNode; for (IASTStatement statement : comp.getStatements()) { if (statement instanceof IASTCaseStatement || statement instanceof IASTDefaultStatement) { IBranchNode lbl = null; if (statement instanceof IASTCaseStatement) { lbl = factory.createBranchNode(statement); } else if (statement instanceof IASTDefaultStatement) { lbl = factory.createBranchNode(IBranchNode.DEFAULT); } if (!(prev instanceof IExitNode) && prev != switchNode) { IConnectorNode here = factory.createConnectorNode(); addJump(prev, here); addOutgoing(lbl, here); prev = here; } else { prev = lbl; } addOutgoing(switchNode, lbl); continue; } IBasicBlock last = createSubGraph(prev, statement); prev = last; } outerBreak = savedBreak; addJump(prev, mergeNode); }

Target:
private void createSwitchBody(IDecisionNode switchNode, IConnectorNode mergeNode, IASTStatement body) { if (!(body instanceof IASTCompoundStatement)) return; IASTCompoundStatement comp = (IASTCompoundStatement) body; IBasicBlock prev = switchNode; IConnectorNode savedBreak = outerBreak; outerBreak = mergeNode; try { for (IASTStatement statement : comp.getStatements()) { if (statement instanceof IASTCaseStatement || statement instanceof IASTDefaultStatement) { IBranchNode lbl = null; if (statement instanceof IASTCaseStatement) { lbl = factory.createBranchNode(statement); } else if (statement instanceof IASTDefaultStatement) { lbl = factory.createBranchNode(IBranchNode.DEFAULT); } if (!(prev instanceof IExitNode) && prev != switchNode) { IConnectorNode here = factory.createConnectorNode(); addJump(prev, here); addOutgoing(lbl, here); prev = here; } else { prev = lbl; } addOutgoing(switchNode, lbl); continue; } prev = createSubGraph(prev, statement); } } finally { outerBreak = savedBreak; } addJump(prev, mergeNode); }
Source:
public synchronized void requestStop() { LOGGER.info(description + " requestStop() called (in state: " + state + ")"); if (state == RunState.RUNNING) { this.state = RunState.REQUEST_STOP; } }

Target:
public synchronized void requestStop() { LOGGER.info(description + " requestStop() called (in state: " + state + ")"); if (isRunning()) { this.state = RunState.REQUEST_STOP; } }
Source:
public void prepareInternalPool() { try { this.internalPool.preparePool(); } catch (Exception e) { logger.warn("failed to initialize minIdle connections in the internal jedis connection pool", e); } }

Target:
public void prepareInternalPool() { try { this.internalPool.preparePool(); } catch (Exception e) { logger.warn("Could not initialize minimum number of idle resources", e); } }
Source:
public static Long getOldestTimestamp(String zookeepers, String zkPath) { Long oldestTs = Long.MAX_VALUE; boolean nodeFound = false; ZooKeeper zk; try { zk = new ZooKeeper(zookeepers, 30000, null); } catch (IOException e) { throw new IllegalStateException(e); } String tsRootPath = ZookeeperConstants.transactorTsRoot(zkPath); try { if (zk.exists(tsRootPath, false) != null) { for (String child : zk.getChildren(tsRootPath, false)) { Long ts = LongUtil.fromByteArray(zk.getData(tsRootPath+"/"+child, false, null)); nodeFound = true; if (ts < oldestTs) { oldestTs = ts; } } } } catch (Exception e) { log.error("Failed to get oldest timestamp of transactors from Zookeeper"); e.printStackTrace(); return OLDEST_POSSIBLE; } if (nodeFound == false) { try { byte[] d = zk.getData(ZookeeperConstants.oracleCurrentTimestampPath(zkPath), false, null); oldestTs = LongUtil.fromByteArray(d); nodeFound = true; } catch (KeeperException | InterruptedException e) { log.error("Failed to get oldest timestamp of Oracle from Zookeeper"); e.printStackTrace(); return OLDEST_POSSIBLE; } } if (!nodeFound) { return OLDEST_POSSIBLE; } return oldestTs; }

Target:
public static long getOldestTimestamp(String zookeepers, String zkPath) { long oldestTs = Long.MAX_VALUE; boolean nodeFound = false; ZooKeeper zk = null; try { zk = new ZooKeeper(zookeepers, 30000, null); String tsRootPath = ZookeeperConstants.transactorTsRoot(zkPath); try { if (zk.exists(tsRootPath, false) != null) { for (String child : zk.getChildren(tsRootPath, false)) { Long ts = LongUtil.fromByteArray(zk.getData(tsRootPath+"/"+child, false, null)); nodeFound = true; if (ts < oldestTs) { oldestTs = ts; } } } } catch (Exception e) { log.error("Failed to get oldest timestamp of transactors from Zookeeper", e); return OLDEST_POSSIBLE; } if (nodeFound == false) { try { byte[] d = zk.getData(ZookeeperConstants.oracleCurrentTimestampPath(zkPath), false, null); oldestTs = LongUtil.fromByteArray(d); nodeFound = true; } catch (KeeperException | InterruptedException e) { log.error("Failed to get oldest timestamp of Oracle from Zookeeper", e); return OLDEST_POSSIBLE; } } if (!nodeFound) { return OLDEST_POSSIBLE; } return oldestTs; } catch (IOException e) { throw new IllegalStateException(e); } finally { if (zk != null) { try { zk.close(); } catch (InterruptedException e) { log.error("Failed to close zookeeper client", e); } } } }
Source:
public void testValidateSetAnswer_sameValues_shouldReturnTrue() { String testValue = "Hello World"; String emptyString = ""; FeedbackTextResponseDetails feedbackTextResponseDetails = new FeedbackTextResponseDetails(); assertEquals(feedbackTextResponseDetails.getAnswerString(), SanitizationHelper.sanitizeForRichText(emptyString)); feedbackTextResponseDetails.setAnswer(testValue); assertEquals(feedbackTextResponseDetails.getAnswerString(), SanitizationHelper.sanitizeForRichText(testValue)); }

Target:
public void testValidateSetAnswer_sameValues_shouldReturnTrue() { String testValue = "Hello World"; FeedbackTextResponseDetails feedbackTextResponseDetails = new FeedbackTextResponseDetails(); assertNotEquals(feedbackTextResponseDetails.getAnswerString(), SanitizationHelper.sanitizeForRichText(testValue)); feedbackTextResponseDetails.setAnswer(testValue); assertEquals(feedbackTextResponseDetails.getAnswerString(), SanitizationHelper.sanitizeForRichText(testValue)); }
Source:
protected void applyMutation(Mutation uncastMutation) { AssociatedMutation mutation = (AssociatedMutation) uncastMutation; MutatableCode mutatableCode = mutation.mutatableCode; generateCachedNewInstanceInsns(mutatableCode); MInsn newInstanceInsnInCache = newInstanceCachedInsns.get(mutation.newInstanceToChangeIdx); long typeIdx = newInstanceInsnInCache.insn.vregB; newInstanceInsnInCache.insn.vregB = mutation.newInstanceTypeIdx; Log.info("Changed " + typeIdx + " to " + mutation.newInstanceTypeIdx); stats.incrementStat("Changed new instance."); newInstanceCachedInsns = null; }

Target:
protected void applyMutation(Mutation uncastMutation) { AssociatedMutation mutation = (AssociatedMutation) uncastMutation; MutatableCode mutatableCode = mutation.mutatableCode; generateCachedNewInstanceInsns(mutatableCode); MInsn newInstanceInsn = newInstanceCachedInsns.get(mutation.newInstanceToChangeIdx); long oldTypeIdx = ((ContainsPoolIndex)newInstanceInsn.insn.info.format).getPoolIndex(newInstanceInsn.insn); ((ContainsPoolIndex)newInstanceInsn.insn.info.format). setPoolIndex(newInstanceInsn.insn, mutation.newInstanceTypeIdx); Log.info("Changed " + oldTypeIdx + " to " + mutation.newInstanceTypeIdx); stats.incrementStat("Changed new instance."); newInstanceCachedInsns = null; }
Source:
public Optional<SymbolicValue> getValueForOwnProperty(String name) { Constraint constraint = type.builtInProperties().getOwnPropertiesConstraints().get(name); if (constraint != null) { return Optional.of(new SymbolicValueWithConstraint(constraint)); } SymbolicValue value = type.builtInProperties().getOwnMethods().get(name); if (value != null) { return Optional.of(value); } return Optional.empty(); }

Target:
public Optional<SymbolicValue> getValueForOwnProperty(String name) { return type.getValueForOwnProperty(name); }
Source:
public static String getValue(Object obj, String field, final String defaultValue) { BroadleafRequestContext requestContext = BroadleafRequestContext.getBroadleafRequestContext(); String valueToReturn = defaultValue; if (TranslationConsiderationContext.hasTranslation() && !requestContext.getLocale().getDefaultFlag()) { TranslationService translationService = TranslationConsiderationContext.getTranslationService(); Locale locale = requestContext.getJavaLocale(); String translatedValue = translationService.getTranslatedValue(obj, field, locale); if (StringUtils.isNotBlank(translatedValue)) { valueToReturn = translatedValue; } else { valueToReturn = translationService.getDefaultTranslationValue(obj, field, locale, defaultValue); } } return valueToReturn; }

Target:
public static String getValue(Object obj, String field, final String defaultValue) { BroadleafRequestContext requestContext = BroadleafRequestContext.getBroadleafRequestContext(); String valueToReturn = defaultValue; if (TranslationConsiderationContext.hasTranslation()) { TranslationService translationService = TranslationConsiderationContext.getTranslationService(); Locale locale = requestContext.getJavaLocale(); String translatedValue = translationService.getTranslatedValue(obj, field, locale); if (StringUtils.isNotBlank(translatedValue)) { valueToReturn = translatedValue; } else { valueToReturn = translationService.getDefaultTranslationValue(obj, field, locale, defaultValue); } } return valueToReturn; }
Source:
private HashBuilderOperator( OperatorContext operatorContext, PartitionedLookupSourceFactory lookupSourceFactory, int partitionIndex, List<Integer> outputChannels, List<Integer> hashChannels, OptionalInt preComputedHashChannel, Optional<JoinFilterFunctionFactory> filterFunctionFactory, Optional<Integer> sortChannel, List<JoinFilterFunctionFactory> searchFunctionFactories, int expectedPositions, PagesIndex.Factory pagesIndexFactory, boolean spillEnabled, SingleStreamSpillerFactory singleStreamSpillerFactory) { requireNonNull(pagesIndexFactory, "pagesIndexFactory is null"); this.operatorContext = operatorContext; this.partitionIndex = partitionIndex; this.filterFunctionFactory = filterFunctionFactory; this.sortChannel = sortChannel; this.searchFunctionFactories = searchFunctionFactories; this.localUserMemoryContext = operatorContext.localUserMemoryContext(); this.localRevocableMemoryContext = operatorContext.localRevocableMemoryContext(); this.index = pagesIndexFactory.newPagesIndex(lookupSourceFactory.getTypes(), expectedPositions); this.lookupSourceFactory = lookupSourceFactory; lookupSourceFactoryDestroyed = lookupSourceFactory.isDestroyed(); this.outputChannels = outputChannels; this.hashChannels = hashChannels; this.preComputedHashChannel = preComputedHashChannel; this.hashCollisionsCounter = new HashCollisionsCounter(operatorContext); operatorContext.setInfoSupplier(hashCollisionsCounter); this.spillEnabled = spillEnabled; this.singleStreamSpillerFactory = requireNonNull(singleStreamSpillerFactory, "singleStreamSpillerFactory is null"); }

Target:
public HashBuilderOperator( OperatorContext operatorContext, PartitionedLookupSourceFactory lookupSourceFactory, int partitionIndex, List<Integer> outputChannels, List<Integer> hashChannels, OptionalInt preComputedHashChannel, Optional<JoinFilterFunctionFactory> filterFunctionFactory, Optional<Integer> sortChannel, List<JoinFilterFunctionFactory> searchFunctionFactories, int expectedPositions, PagesIndex.Factory pagesIndexFactory, boolean spillEnabled, SingleStreamSpillerFactory singleStreamSpillerFactory) { requireNonNull(pagesIndexFactory, "pagesIndexFactory is null"); this.operatorContext = operatorContext; this.partitionIndex = partitionIndex; this.filterFunctionFactory = filterFunctionFactory; this.sortChannel = sortChannel; this.searchFunctionFactories = searchFunctionFactories; this.localUserMemoryContext = operatorContext.localUserMemoryContext(); this.localRevocableMemoryContext = operatorContext.localRevocableMemoryContext(); this.index = pagesIndexFactory.newPagesIndex(lookupSourceFactory.getTypes(), expectedPositions); this.lookupSourceFactory = lookupSourceFactory; lookupSourceFactoryDestroyed = lookupSourceFactory.isDestroyed(); this.outputChannels = outputChannels; this.hashChannels = hashChannels; this.preComputedHashChannel = preComputedHashChannel; this.hashCollisionsCounter = new HashCollisionsCounter(operatorContext); operatorContext.setInfoSupplier(hashCollisionsCounter); this.spillEnabled = spillEnabled; this.singleStreamSpillerFactory = requireNonNull(singleStreamSpillerFactory, "singleStreamSpillerFactory is null"); }
Source:
public void handle(Request request, Response response) throws Exception { userSession.checkLoggedIn(); String login = userSession.getLogin(); HomepageTypes type = valueOf(request.mandatoryParam(PARAM_TYPE)); String componentParameter = request.param(PARAM_COMPONENT); String organizationParameter = request.param(PARAM_ORGANIZATION); try (DbSession dbSession = dbClient.openSession(false)) { String parameter = getHomepageParameter(dbSession, type, componentParameter, organizationParameter); UserDto user = dbClient.userDao().selectActiveUserByLogin(dbSession, login); checkState(user != null, "User login '%s' cannot be found", login); user.setHomepageType(type.name()); user.setHomepageParameter(parameter); dbClient.userDao().update(dbSession, user); dbSession.commit(); } response.noContent(); }

Target:
public void handle(Request request, Response response) throws Exception { userSession.checkLoggedIn(); HomepageTypes.Type type = request.mandatoryParamAsEnum(PARAM_TYPE, HomepageTypes.Type.class); String componentParameter = request.param(PARAM_COMPONENT); String organizationParameter = request.param(PARAM_ORGANIZATION); try (DbSession dbSession = dbClient.openSession(false)) { String parameter = getHomepageParameter(dbSession, type, componentParameter, request.param(PARAM_BRANCH), organizationParameter); UserDto user = dbClient.userDao().selectActiveUserByLogin(dbSession, userSession.getLogin()); checkState(user != null, "User login '%s' cannot be found", userSession.getLogin()); user.setHomepageType(type.name()); user.setHomepageParameter(parameter); dbClient.userDao().update(dbSession, user); dbSession.commit(); } response.noContent(); }
Source:
public Boolean usePillPairedTimeAsLastSeen(final Optional<PillHeartBeat> pillStatusOptional, final DateTime pairedDateTime, final DateTime now) { final DateTime lastHeartBeatThreshold = now.minusMinutes(RECENTLY_PAIRED_PILL_UNSEEN_THRESHOLD); if (pillStatusOptional.isPresent()) { if (pillStatusOptional.get().createdAtUTC.isBefore(pairedDateTime)) { return pairedDateTime.isAfter(lastHeartBeatThreshold); } } else if (pairedDateTime.isAfter(lastHeartBeatThreshold)) { return true; } return false; }

Target:
public static Boolean usePillPairedTimeAsLastSeen(final Optional<PillHeartBeat> pillStatusOptional, final DateTime pairedDateTime, final DateTime now) { final DateTime lastHeartBeatThreshold = now.minusMinutes(RECENTLY_PAIRED_PILL_UNSEEN_THRESHOLD); if (pillStatusOptional.isPresent()) { if (pillStatusOptional.get().createdAtUTC.isBefore(pairedDateTime)) { return pairedDateTime.isAfter(lastHeartBeatThreshold); } } else if (pairedDateTime.isAfter(lastHeartBeatThreshold)) { return true; } return false; }
Source:
RemotePartitioningMasterStepBuilder beanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; return this; }

Target:
public RemotePartitioningMasterStepBuilder beanFactory(BeanFactory beanFactory) { this.beanFactory = beanFactory; return this; }
Source:
protected Date convertFromString(final String value) { if ("now()".equalsIgnoreCase(value)) { return new NowDate(); } if ("today()".equalsIgnoreCase(value)) { return new TodayDate(); } if ("yesterday()".equalsIgnoreCase(value)) { return new YesterdayDate(); } if (value.matches("shifted_today(.+)")) { return new ShiftedToday(value); } for (DateTimeFormatter formatter : _dateTimeFormatters) { try { return formatter.parseDateTime(value).toDate(); } catch (Exception e) { } } try { long longValue = Long.parseLong(value); return convertFromNumber(longValue, false); } catch (NumberFormatException e) { } final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.S"); format.setTimeZone(TimeZone.getTimeZone(timeZone)); try { return format.parse(value); } catch (ParseException e) { } return null; }

Target:
protected Date convertFromString(final String value) { if (value == null) { return null; } if ("now()".equalsIgnoreCase(value)) { return new NowDate(); } if ("today()".equalsIgnoreCase(value)) { return new TodayDate(); } if ("yesterday()".equalsIgnoreCase(value)) { return new YesterdayDate(); } if (value.matches("shifted_today(.+)")) { return new ShiftedToday(value); } for (DateTimeFormatter formatter : _dateTimeFormatters) { try { return formatter.parseDateTime(value).toDate(); } catch (Exception e) { } } try { long longValue = Long.parseLong(value); return convertFromNumber(longValue, false); } catch (NumberFormatException e) { } final SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss.S"); format.setTimeZone(TimeZone.getTimeZone(timeZone)); try { return format.parse(value); } catch (ParseException e) { } return null; }
Source:
private static boolean isValidRange(byte[] startCol, byte[] endCol) { return RangeRequests.isValidRange(false, startCol, endCol); }

Target:
public static boolean isValidRange(byte[] startCol, byte[] endCol) { return RangeRequests.isContiguousRange(false, startCol, endCol) && !RangeRequests.isExactlyEmptyRange(startCol, endCol); }
Source:
public static Map<String, String> getCustomAttributes(XmlPullParser parser) { Map<String, String> customAttributes = new LinkedHashMap<>(); List<String> standardAttributes = Arrays.asList(new String[] {"xml:lang", "id", "to", "from", "type"}); for (int i = 0; i < parser.getAttributeCount(); i++) { String attributeName = parser.getAttributeName(i); boolean isLangAttribute = "lang".equals(attributeName) && "xml".equals(parser.getAttributePrefix(i)); if (!standardAttributes.contains(attributeName) && !isLangAttribute) { String attributeValue = parser.getAttributeValue(i); customAttributes.put(attributeName, attributeValue); } } return customAttributes; }

Target:
public static Map<String, String> getCustomAttributes(XmlPullParser parser) { Map<String, String> customAttributes = new LinkedHashMap<>(); for (int i = 0; i < parser.getAttributeCount(); i++) { String attributeName = parser.getAttributeName(i); boolean isLangAttribute = "lang".equals(attributeName) && "xml".equals(parser.getAttributePrefix(i)); if (!Stanza.REGISTERED_ATTRIBUTES.contains(attributeName) && !isLangAttribute) { String attributeValue = parser.getAttributeValue(i); customAttributes.put(attributeName, attributeValue); } } return customAttributes; }
Source:
public QueryMessage<Q, I> withMetaData(Map<String, ?> metaData) { return new GenericSubscriptionQueryMessage<>(getDelegate().withMetaData(metaData), getQueryName(), getResponseType(), updateResponseType); }

Target:
public GenericSubscriptionQueryMessage<Q, I, U> withMetaData(Map<String, ?> metaData) { return new GenericSubscriptionQueryMessage<>(getDelegate().withMetaData(metaData), getQueryName(), getResponseType(), updateResponseType); }
Source:
public QuerySystemTable(QueryManager queryManager, NodeInfo nodeInfo, TypeManager typeManager) { this.queryManager = queryManager; this.nodeId = nodeInfo.getNodeId(); this.sessionPropertiesType = (MapType) typeManager.getParameterizedType(StandardTypes.MAP, ImmutableList.<TypeSignatureParameter>builder() .add(TypeSignatureParameter.of(createUnboundedVarcharType().getTypeSignature())) .add(TypeSignatureParameter.of(createUnboundedVarcharType().getTypeSignature())) .build()); this.queryTable = tableMetadataBuilder(QUERY_TABLE_NAME) .column("node_id", createUnboundedVarcharType()) .column("query_id", createUnboundedVarcharType()) .column("state", createUnboundedVarcharType()) .column("user", createUnboundedVarcharType()) .column("source", createUnboundedVarcharType()) .column("query", createUnboundedVarcharType()) .column("resource_group_id", new ArrayType(createUnboundedVarcharType())) .column("session_properties", sessionPropertiesType) .column("queued_time_ms", BIGINT) .column("analysis_time_ms", BIGINT) .column("distributed_planning_time_ms", BIGINT) .column("created", TIMESTAMP) .column("started", TIMESTAMP) .column("last_heartbeat", TIMESTAMP) .column("end", TIMESTAMP) .build(); }

Target:
public QuerySystemTable(QueryManager queryManager, NodeInfo nodeInfo, TypeManager typeManager) { requireNonNull(typeManager, "typeManager is null"); requireNonNull(nodeInfo, "nodeInfo is null"); this.queryManager = requireNonNull(queryManager, "queryManager is null"); this.nodeId = nodeInfo.getNodeId(); this.sessionPropertiesType = (MapType) typeManager.getParameterizedType(StandardTypes.MAP, ImmutableList.<TypeSignatureParameter>builder() .add(TypeSignatureParameter.of(createUnboundedVarcharType().getTypeSignature())) .add(TypeSignatureParameter.of(createUnboundedVarcharType().getTypeSignature())) .build()); this.queryTableMetadata = tableMetadataBuilder(QUERY_TABLE_NAME) .column("node_id", createUnboundedVarcharType()) .column("query_id", createUnboundedVarcharType()) .column("state", createUnboundedVarcharType()) .column("user", createUnboundedVarcharType()) .column("source", createUnboundedVarcharType()) .column("query", createUnboundedVarcharType()) .column("resource_group_id", new ArrayType(createUnboundedVarcharType())) .column("session_properties", sessionPropertiesType) .column("queued_time_ms", BIGINT) .column("analysis_time_ms", BIGINT) .column("distributed_planning_time_ms", BIGINT) .column("created", TIMESTAMP) .column("started", TIMESTAMP) .column("last_heartbeat", TIMESTAMP) .column("end", TIMESTAMP) .build(); }
Source:
private void placeFenceBlocks(Region3i region, boolean placeTorch) { int minX = region.minX(); int maxX = region.maxX(); int minZ = region.minZ(); int maxZ = region.maxZ(); int y = region.minY(); Block block = blockManager.getBlock("Fences:fence.0"); for (int x = minX; x <= maxX; x++) { for (int z = minZ; z <= maxZ; z++) { blockEntityRegistry.setBlockForceUpdateEntity(new Vector3i(x, y + 1, z), block); } } if (placeTorch) { block = blockManager.getBlock("Core:Torch.TOP"); blockEntityRegistry.setBlockForceUpdateEntity(new Vector3i(minX, y + 2, minZ), block); blockEntityRegistry.setBlockForceUpdateEntity(new Vector3i(maxX, y + 2, maxZ), block); } }

Target:
private void placeFenceBlocks(Region3i region, boolean placeTorch) { int minX = region.minX(); int maxX = region.maxX(); int minZ = region.minZ(); int maxZ = region.maxZ(); int y = region.minY(); Block block = blockManager.getBlock(Constants.FENCE_BLOCK_URI); for (int x = minX; x <= maxX; x++) { for (int z = minZ; z <= maxZ; z++) { blockEntityRegistry.setBlockForceUpdateEntity(new Vector3i(x, y + 1, z), block); } } if (placeTorch) { block = blockManager.getBlock(Constants.TORCH_BLOCK_URI); blockEntityRegistry.setBlockForceUpdateEntity(new Vector3i(minX, y + 2, minZ), block); blockEntityRegistry.setBlockForceUpdateEntity(new Vector3i(maxX, y + 2, maxZ), block); } }
Source:
protected ResourceManager registerInRM(final Credentials credentials, final String rmURL, final String nodeName, final List<Node> nodes) { RMAuthentication auth = joinResourceManager(rmURL); final ResourceManager rm = loginToResourceManager(credentials, auth); if(!disabledMonitoring) { SigarExposer sigarExposer = new SigarExposer(nodeName); final RMAuthentication rmAuth = auth; sigarExposer.boot(auth, false, new PermissionChecker() { @Override public boolean checkPermission(Credentials cred) { ResourceManager rm = null; try { rm = rmAuth.login(cred); if (NB_OF_ADD_NODE_ATTEMPTS == 0) return true; boolean isAdmin = rm.isNodeAdmin(nodes.get(0).getNodeInformation().getURL()) .getBooleanValue(); if (!isAdmin) { throw new SecurityException("Permission denied"); } return true; } catch (LoginException e) { throw new SecurityException(e); } finally { if (rm != null) { rm.disconnect(); } } } }); for (final Node node : nodes) { try { node.setProperty(JMX_URL + JMXTransportProtocol.RMI, sigarExposer.getAddress( JMXTransportProtocol.RMI).toString()); node.setProperty(JMX_URL + JMXTransportProtocol.RO, sigarExposer.getAddress( JMXTransportProtocol.RO).toString()); } catch (Exception e) { logger.error("", e); } } }else { logger.info("The monitoring is disabled!"); } for (final Node node : nodes) { addNodeToResourceManager(rmURL, node, rm); } return rm; }

Target:
protected ResourceManager registerInRM(final Credentials credentials, final String rmURL, final String nodeName, final List<Node> nodes) { RMAuthentication auth = joinResourceManager(rmURL); final ResourceManager rm = loginToResourceManager(credentials, auth); if(!disabledMonitoring) { SigarExposer sigarExposer = new SigarExposer(nodeName); final RMAuthentication rmAuth = auth; sigarExposer.boot(auth, false, new PermissionChecker() { @Override public boolean checkPermission(Credentials cred) { ResourceManager rm = null; try { rm = rmAuth.login(cred); if (NB_OF_ADD_NODE_ATTEMPTS == 0) return true; boolean isAdmin = rm.isNodeAdmin(nodes.get(0).getNodeInformation().getURL()) .getBooleanValue(); if (!isAdmin) { throw new SecurityException("Permission denied"); } return true; } catch (LoginException e) { throw new SecurityException(e); } finally { if (rm != null) { rm.disconnect(); } } } }); for (final Node node : nodes) { try { node.setProperty(JMX_URL + JMXTransportProtocol.RMI, sigarExposer.getAddress( JMXTransportProtocol.RMI).toString()); node.setProperty(JMX_URL + JMXTransportProtocol.RO, sigarExposer.getAddress( JMXTransportProtocol.RO).toString()); } catch (Exception e) { logger.error("", e); } } }else { logger.info("JMX monitoring is disabled."); } for (final Node node : nodes) { addNodeToResourceManager(rmURL, node, rm); } return rm; }
Source:
private void deleteFiles(long endSegment) { int numFiles = 0; long freedBytes = 0; File dir = logDir.toFile(); File[] files = dir.listFiles(file -> { try { String segmentNum = file.getName().split("\\.")[0]; return Long.parseLong(segmentNum) < endSegment; } catch (Exception e) { log.warn("trimPrefix: ignoring file {}", file.getName()); return false; } }); if (files == null) { return; } for (File file : files) { long delta = file.length(); if (!file.delete()) { log.error("deleteFiles: Couldn't delete file {}", file.getName()); } else { freedBytes += delta; numFiles++; } } log.info("deleteFiles: completed, deleted files, freed bytes", numFiles, freedBytes); }

Target:
private void deleteFiles(long endSegment) { int numFiles = 0; long freedBytes = 0; File dir = logDir.toFile(); File[] files = dir.listFiles(file -> { try { String segmentNum = file.getName().split("\\.")[0]; return Long.parseLong(segmentNum) <= endSegment; } catch (Exception e) { log.warn("trimPrefix: ignoring file {}", file.getName()); return false; } }); if (files == null) { return; } for (File file : files) { long delta = file.length(); if (!file.delete()) { log.error("deleteFiles: Couldn't delete file {}", file.getName()); } else { freedBytes += delta; numFiles++; } } log.info("deleteFiles: completed, deleted files, freed bytes", numFiles, freedBytes); }
Source:
protected Object handleRequestMessage(Message<?> message) { Object value = message; if (this.extractPayload) { value = message.getPayload(); } value = SerializerUtil.serialize(value, this.serializerExplicitlySet, this.serializer); String queueName = this.queueNameExpression.getValue(this.evaluationContext, message, String.class); if (this.expectReply) { long uuid = generateRandomUUID(); this.template.boundListOps(queueName).leftPush(SerializerUtil.serialize(uuid+"", this.serializerExplicitlySet, this.serializer)); this.template.boundListOps(uuid + "").leftPush(value); this.boundListOperations = template.boundListOps(uuid + MESSAGESUFFIX); byte[] reply = (byte[]) this.boundListOperations.rightPop(this.timeout, TimeUnit.MILLISECONDS); Object replyMessage = this.serializer.deserialize(reply); if (replyMessage == null) { return null; } return this.getMessageBuilderFactory().withPayload(replyMessage).build(); } else { this.template.boundListOps(queueName).leftPush(value); return null; } }

Target:
protected Object handleRequestMessage(Message<?> message) { Object value = message; if (this.extractPayload) { value = message.getPayload(); } if (!(value instanceof byte[])) { if (value instanceof String && !serializerExplicitlySet) { value = stringSerializer.serialize((String) value); } else { value = ((RedisSerializer<Object>) serializer).serialize(value); } } String uuid = defaultIdGenerator.generateId().toString(); byte[] uuidByte; if (!serializerExplicitlySet) { uuidByte = stringSerializer.serialize(uuid); } else { uuidByte = ((RedisSerializer<Object>) serializer).serialize(uuid); } this.template.boundListOps(this.queueName).leftPush(uuidByte); this.template.boundListOps(uuid).leftPush(value); this.boundListOperations = template.boundListOps(uuid + MESSAGESUFFIX); byte[] reply = (byte[]) this.boundListOperations.rightPop(this.timeout, TimeUnit.MILLISECONDS); if(reply != null && reply.length > 0) { Object replyMessage = this.serializer.deserialize(reply); if (replyMessage == null) { return null; } return this.getMessageBuilderFactory().withPayload(replyMessage).build(); } return null; }
Source:
public Password(String password) { super(); this.password = password; }

Target:
public Password(String password) { this.password = password; }
Source:
public abstract FileSegment<T> createFileSegment(Path p) throws IOException; @Override public final Iterator<FileSegment<T>> iterator(){ List<Path> paths = discover(this.path); Iterator<Path> pathsIterator = paths.iterator(); return new Iterator<FileSegment<T>>(){ Path segmentPath; FileSegment<T> segment; @Override public boolean hasNext(){ if (segment != null){ return true; } if (!pathsIterator.hasNext()){ return false; } else { try { Path segmentPath = pathsIterator.next(); segment = createFileSegment(segmentPath); } catch (IOException e){ return false; } } return true; } @Override public FileSegment<T> next() throws NoSuchElementException { if (!hasNext()){ throw new NoSuchElementException("No more file segments to read."); } else { FileSegment<T> seg = segment; segment = null; return seg; } } @Override public void remove(){ throw new UnsupportedOperationException(); } }; }

Target:
public abstract FileSegment<T> createFileSegment(Path p) throws IOException; @Override public final Iterator<FileSegment<T>> iterator(){ List<Path> paths = discover(this.path); Iterator<Path> pathsIterator = paths.iterator(); return new Iterator<FileSegment<T>>(){ Path segmentPath; FileSegment<T> segment; @Override public boolean hasNext(){ if (segment != null){ return true; } if (!pathsIterator.hasNext()){ return false; } else { try { segmentPath = pathsIterator.next(); segment = createFileSegment(segmentPath); } catch (IOException e){ return false; } } return true; } @Override public FileSegment<T> next() throws NoSuchElementException { if (!hasNext()){ throw new NoSuchElementException("No more file segments to read."); } else { FileSegment<T> seg = segment; segment = null; return seg; } } @Override public void remove(){ throw new UnsupportedOperationException(); } }; }
Source:
public void onDeleted(MatrixConfiguration item) throws IOException { if(activeConfigurations.contains(item)){ LOGGER.warning("Tring of delete active configuration " + item.getDisplayName() + " of job " + getDisplayName() + ". Active configurations should not be deleted."); } else{ configurations.remove(item.getCombination()); } }

Target:
public void onDeleted(MatrixConfiguration item) throws IOException { if(activeConfigurations.contains(item)){ LOGGER.warning("Trying to delete active configuration " + item.getDisplayName() + " of job " + getDisplayName() + ". Active configurations should not be deleted."); } else{ configurations.remove(item.getCombination()); } }
Source:
private void testClientContext() throws Exception { CountDownLatch serverLatch = new CountDownLatch(1); server.requestHandler(req -> { req.response().end(); } ).listen(ar -> { assertTrue(ar.succeeded()); serverLatch.countDown();; }); awaitLatch(serverLatch); CountDownLatch req1Latch = new CountDownLatch(1); AtomicReference<Context> c = new AtomicReference<>(); HttpClientRequest req1 = client.get(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, "/1"); req1.handler(res -> { c.set(Vertx.currentContext()); res.endHandler(v -> req1Latch.countDown()); }); req1.end(); Consumer<HttpClientRequest> checker = req -> { if (req1.connection() == req.connection()) { assertSame(Vertx.currentContext(), c.get()); } else { } }; awaitLatch(req1Latch); CountDownLatch req2Latch = new CountDownLatch(2); HttpClientRequest req2 = client.get(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, "/2"); req2.handler(res -> { checker.accept(req2); req2Latch.countDown(); }).exceptionHandler(err -> { fail(err); }).sendHead(); HttpClientRequest req3 = client.get(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, "/3"); req3.handler(res -> { checker.accept(req3); req2Latch.countDown(); }).exceptionHandler(err -> { fail(err); }); req3.end(); req2.end(); awaitLatch(req2Latch); vertx.getOrCreateContext().runOnContext(v -> { HttpClientRequest req4 = client.get(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, "/4"); req4.handler(res -> { checker.accept(req4); testComplete(); }); req4.exceptionHandler(err -> { fail(err); }); req4.end(); }); await(); }

Target:
private void testClientContext() throws Exception { CountDownLatch serverLatch = new CountDownLatch(1); server.requestHandler(req -> { req.response().end(); } ).listen(ar -> { assertTrue(ar.succeeded()); serverLatch.countDown();; }); awaitLatch(serverLatch); CountDownLatch req1Latch = new CountDownLatch(1); AtomicReference<Context> c = new AtomicReference<>(); HttpClientRequest req1 = client.get(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, "/1"); req1.handler(res -> { c.set(Vertx.currentContext()); res.endHandler(v -> req1Latch.countDown()); }); req1.end(); Consumer<HttpClientRequest> checker = req -> { assertSame(Vertx.currentContext(), c.get()); assertSame(req1.connection(), req.connection()); }; awaitLatch(req1Latch); CountDownLatch req2Latch = new CountDownLatch(2); HttpClientRequest req2 = client.get(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, "/2"); req2.handler(res -> { checker.accept(req2); req2Latch.countDown(); }).exceptionHandler(err -> { fail(err); }).sendHead(); HttpClientRequest req3 = client.get(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, "/3"); req3.handler(res -> { checker.accept(req3); req2Latch.countDown(); }).exceptionHandler(err -> { fail(err); }); req3.end(); req2.end(); awaitLatch(req2Latch); vertx.getOrCreateContext().runOnContext(v -> { HttpClientRequest req4 = client.get(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, "/4"); req4.handler(res -> { checker.accept(req4); testComplete(); }); req4.exceptionHandler(err -> { fail(err); }); req4.end(); }); await(); }
Source:
static CompletableFuture<byte[]> sendrecv( InetSocketAddress local, InetSocketAddress remote, Message query, byte[] data, Duration timeout) { CompletableFuture<byte[]> f = new CompletableFuture<>(); try { startTcp(); long endTime = System.nanoTime() + timeout.toNanos(); ChannelState channel = channelMap.computeIfAbsent( new ChannelKey(local, remote), key -> { try { log.trace("Opening async channel for l={}/r={}", local, remote); SocketChannel c = SocketChannel.open(); c.configureBlocking(false); if (local != null) { c.bind(local); } final ChannelState channelState = new ChannelState(c); c.register(selector, SelectionKey.OP_CONNECT, channelState); c.connect(remote); return channelState; } catch (IOException e) { f.completeExceptionally(e); return null; } }); if (channel != null) { log.trace( "Creating transaction for {}/{}", query.getQuestion().getName(), Type.string(query.getQuestion().getType())); Transaction t = new Transaction(query, data, endTime, channel.channel, f); channel.pendingTransactions.add(t); final SelectionKey selectionKey = channel.channel.keyFor(selector); selectionKey.interestOps(selectionKey.interestOps() | SelectionKey.OP_WRITE); selector.wakeup(); } } catch (IOException e) { f.completeExceptionally(e); } return f; }

Target:
static CompletableFuture<byte[]> sendrecv( InetSocketAddress local, InetSocketAddress remote, Message query, byte[] data, Duration timeout) { CompletableFuture<byte[]> f = new CompletableFuture<>(); try { startTcp(); long endTime = System.nanoTime() + timeout.toNanos(); ChannelState channel = channelMap.computeIfAbsent( new ChannelKey(local, remote), key -> { try { log.trace("Opening async channel for l={}/r={}", local, remote); SocketChannel c = SocketChannel.open(); c.configureBlocking(false); if (local != null) { c.bind(local); } c.connect(remote); return new ChannelState(c); } catch (IOException e) { f.completeExceptionally(e); return null; } }); if (channel != null) { log.trace( "Creating transaction for {}/{}", query.getQuestion().getName(), Type.string(query.getQuestion().getType())); Transaction t = new Transaction(query, data, endTime, channel.channel, f); channel.pendingTransactions.add(t); registrationQueue.add(channel); selector.wakeup(); } } catch (IOException e) { f.completeExceptionally(e); } return f; }
Source:
public Future<AppSearchBatchResult<String, AppSearchDocument>> getDocuments( @NonNull List<String> uris) { Callable<AppSearchBatchResult<String, AppSearchDocument>> callableTask = () -> { AppSearchBatchResult.Builder<String, AppSearchDocument> resultBuilder = new AppSearchBatchResult.Builder<>(); for (int i = 0; i < uris.size(); i++) { String uri = uris.get(i); try { DocumentProto documentProto = mAppSearchImpl.getDocument(uri); if (documentProto == null) { resultBuilder.setFailure( uri, AppSearchResult.RESULT_NOT_FOUND, null); } else { AppSearchDocument document; try { document = new AppSearchDocument(documentProto); resultBuilder.setSuccess(uri, document); } catch (Throwable t) { resultBuilder.setFailure( uri, AppSearchResult.RESULT_INTERNAL_ERROR, t.getMessage()); } } } catch (Throwable t) { resultBuilder.setResult(uri, throwableToFailedResult(t)); } } return resultBuilder.build(); }; return mExecutor.submit(callableTask); }

Target:
public Future<AppSearchBatchResult<String, AppSearchDocument>> getDocuments( @NonNull List<String> uris) { Callable<AppSearchBatchResult<String, AppSearchDocument>> callableTask = () -> { AppSearchBatchResult.Builder<String, AppSearchDocument> resultBuilder = new AppSearchBatchResult.Builder<>(); for (int i = 0; i < uris.size(); i++) { String uri = uris.get(i); try { DocumentProto documentProto = mAppSearchImpl.getDocument(uri); if (documentProto == null) { resultBuilder.setFailure( uri, AppSearchResult.RESULT_NOT_FOUND, null); } else { try { AppSearchDocument document = new AppSearchDocument(documentProto); resultBuilder.setSuccess(uri, document); } catch (Throwable t) { resultBuilder.setFailure( uri, AppSearchResult.RESULT_INTERNAL_ERROR, t.getMessage()); } } } catch (Throwable t) { throw throwableToAppSearchException(t); } } return resultBuilder.build(); }; return mExecutor.submit(callableTask); }
Source:
protected String createPassFile(String value) throws IOException { File temp = File.createTempFile("ovirt", ".tmp"); String filePath = temp.getAbsolutePath(); temp.setReadable(true, true); temp.setWritable(true, true); BufferedWriter out = new BufferedWriter(new FileWriter(temp)); out.write(value); out.close(); return filePath; }

Target:
protected String createPassFile(String value) throws IOException { File temp = File.createTempFile("ovirt", ".tmp"); String filePath = temp.getAbsolutePath(); File chmodFile = new File("/usr/bin/chmod"); if (!chmodFile.exists()) { throw new IOException("Can't find the chmod command in order to change the permissions of file \"" + filePath + "\"."); } Process chmodProcess = Runtime.getRuntime().exec(chmodFile.getAbsolutePath() + " 600 " + filePath); try { int chmodExitCode = chmodProcess.waitFor(); if (chmodExitCode != 0) { throw new IOException("Failed to change permissions for file \"" + filePath + "\", the chmod command returns exit code " + chmodExitCode + "\"."); } } catch (InterruptedException ie) { throw new IOException("Failed to change permissions for file \"" + filePath + "\"", ie); } BufferedWriter out = new BufferedWriter(new FileWriter(temp)); out.write(value); out.close(); return filePath; }
Source:
private synchronized List<TileLayer> getTileLayers(boolean reload) throws GeoWebCacheException { List<TileLayer> layers = null; WebMapServer wms = null; try { wms = getWMS(); } catch (ServiceException | IOException e) { throw new ConfigurationException("Unable to connect to " + this.url + " :"+e.getMessage(), e); } String wmsUrl = getWMSUrl(wms); log.info("Using " + wmsUrl + " to generate URLs for WMS requests"); String urlVersion = parseVersion(url); layers = getLayers(wms, wmsUrl, urlVersion); if (layers == null || layers.size() < 1) { log.error("Unable to find any layers based on " + url); } else { log.info("Loaded " + layers.size() + " layers from " + url); } return layers; }

Target:
private synchronized List<TileLayer> getTileLayers(boolean reload) throws GeoWebCacheException { List<TileLayer> layers = null; WebMapServer wms = null; try { wms = getWMS(); } catch (ServiceException | IOException e) { throw new ConfigurationException("Could not retrieve (or parse) GetCapaibilities " + this.url + " :"+e.getMessage(), e); } String wmsUrl = getWMSUrl(wms); log.info("Using GetCapabilities " + wmsUrl + " to generate URLs for WMS requests"); String urlVersion = parseVersion(url); layers = getLayers(wms, wmsUrl, urlVersion); if (layers == null || layers.size() < 1) { log.error("Unable to find any layers based on " + url); } else { log.info("Loaded " + layers.size() + " layers from " + url); } return layers; }
Source:
protected void printUsageSummary(PrintStream stderr) { stderr.println(Messages.DisablePluginCommand_PrintUsageSummary()); }

Target:
protected void printUsageSummary(PrintStream stderr) { super.printUsageSummary(stderr); stderr.println(Messages.DisablePluginCommand_PrintUsageSummary()); }
Source:
public void run(final int iteration) { final int workload = memoryStore.getElasticStore().getNumUnits(SleepParameters.KEY); final long sleepTime = (long)(workload * computationSpeed); try { Thread.sleep(sleepTime); } catch (final InterruptedException e) { throw new RuntimeException("InterruptedException during sleeping", e); } }

Target:
public void run(final int iteration) { final int workload = memoryStore.getElasticStore().getNumUnits(SleepParameters.KEY); final long sleepTime = workload * computationRate; LOG.log(Level.INFO, "iteration start: {0}, workload: {1}, computationRate: {2}, sleepTime: {3}", new Object[]{iteration, workload, computationRate, sleepTime}); try { Thread.sleep(sleepTime); } catch (final InterruptedException e) { throw new RuntimeException("InterruptedException during sleeping", e); } final int finWorkload = memoryStore.getElasticStore().getNumUnits(SleepParameters.KEY); LOG.log(Level.INFO, "iteration finish: {0}, finWorkload: {1}", new Object[]{iteration, finWorkload}); }