auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void checkInitialData(final INattableModelManager currentManager) { final List<Object> rowElements = currentManager.getRowElementsList(); final Object firstRowRepresentedElement = rowElements.get(0); Assert.assertEquals("The first row element is not the expected one", REQUIREMENT_1, ((org.eclipse.uml2.uml.NamedElement) firstRowRepresentedElement).getName()); final Object secondRowRepresentedElement = rowElements.get(1); Assert.assertEquals("The second row element is not the expected one", REQUIREMENT_2, ((org.eclipse.uml2.uml.NamedElement) secondRowRepresentedElement).getName()); final Object thirdRowRepresentedElement = rowElements.get(2); Assert.assertEquals("The third row element is not the expected one", REQUIREMENT_3, ((org.eclipse.uml2.uml.NamedElement) thirdRowRepresentedElement).getName()); final Object fourthRowRepresentedElement = rowElements.get(3); Assert.assertEquals("The fourth row element is not the expected one", REQUIREMENT_4, ((org.eclipse.uml2.uml.NamedElement) fourthRowRepresentedElement).getName()); }

Target:
protected void checkInitialData(final INattableModelManager currentManager) { final List<Object> rowElements = currentManager.getRowElementsList(); final Object firstRowRepresentedElement = rowElements.get(0); Assert.assertEquals("The first row element is not the expected one", REQUIREMENT_1, ((NamedElement) firstRowRepresentedElement).getName()); final Object secondRowRepresentedElement = rowElements.get(1); Assert.assertEquals("The second row element is not the expected one", REQUIREMENT_2, ((NamedElement) secondRowRepresentedElement).getName()); final Object thirdRowRepresentedElement = rowElements.get(2); Assert.assertEquals("The third row element is not the expected one", REQUIREMENT_3, ((NamedElement) thirdRowRepresentedElement).getName()); final Object fourthRowRepresentedElement = rowElements.get(3); Assert.assertEquals("The fourth row element is not the expected one", REQUIREMENT_4, ((NamedElement) fourthRowRepresentedElement).getName()); }
Source:
public void testShouldSelectPoolWhenRoleMatchesButOtherSysPurposeAttributesAndSocketsRamCoresMismatch() { Product product69 = new Product(); product69.setId("compliant-69"); consumer.setRole("myrole"); consumer.setFact("cpu.cpu_socket(s)", "1"); consumer.setFact("cpu.core(s)_per_socket", "1"); consumer.setFact("memory.memtotal", "9980456"); ConsumerInstalledProduct consumerInstalledProduct = new ConsumerInstalledProduct(product69); consumer.addInstalledProduct(consumerInstalledProduct); Product prodMCT1650 = createSysPurposeProduct(null, "myrole", "random_addon", "random_sla", "random_usage"); prodMCT1650.setAttribute(Product.Attributes.SOCKETS, "32"); prodMCT1650.setAttribute(Product.Attributes.CORES, "32"); prodMCT1650.setAttribute(Product.Attributes.RAM, "19960912"); Pool MCT1650 = TestUtil.createPool(owner, prodMCT1650); MCT1650.setId("MCT1650"); MCT1650.getProduct().addProvidedProduct(product69); MCT1650.setQuantity(1L); Product genericProduct = createSysPurposeProduct(null, null, null, null, null); Pool genericPool = TestUtil.createPool(owner, genericProduct); genericPool.setId("genericPool"); genericPool.setQuantity(1L); genericPool.getProduct().addProvidedProduct(product69); List<Pool> pools = new ArrayList<>(); pools.add(MCT1650); pools.add(genericPool); List<PoolQuantity> bestPools = autobindRules.selectBestPools(consumer, new String[]{"compliant-69"}, pools, compliance, null, new HashSet<>(), false); assertEquals(1, bestPools.size()); assertTrue(bestPools.contains(new PoolQuantity(MCT1650, 1))); }

Target:
public void testShouldSelectPoolWhenRoleMatchesButOtherSysPurposeAttributesAndSocketsRamCoresMismatch() { Product product69 = new Product(); product69.setId("compliant-69"); consumer.setRole("myrole"); consumer.setFact("cpu.cpu_socket(s)", "1"); consumer.setFact("cpu.core(s)_per_socket", "1"); consumer.setFact("memory.memtotal", "9980456"); ConsumerInstalledProduct consumerInstalledProduct = new ConsumerInstalledProduct(product69); consumer.addInstalledProduct(consumerInstalledProduct); Product prodMCT1650 = createSysPurposeProduct(null, "myrole", "random_addon", "random_sla", "random_usage"); prodMCT1650.setAttribute(Product.Attributes.SOCKETS, "32"); prodMCT1650.setAttribute(Product.Attributes.CORES, "32"); prodMCT1650.setAttribute(Product.Attributes.RAM, "19960912"); prodMCT1650.addProvidedProduct(product69); Pool MCT1650 = TestUtil.createPool(owner, prodMCT1650); MCT1650.setId("MCT1650"); MCT1650.setQuantity(1L); Product genericProduct = createSysPurposeProduct(null, null, null, null, null); Pool genericPool = TestUtil.createPool(owner, genericProduct); genericPool.setId("genericPool"); genericPool.setQuantity(1L); genericPool.getProduct().addProvidedProduct(product69); List<Pool> pools = new ArrayList<>(); pools.add(MCT1650); pools.add(genericPool); List<PoolQuantity> bestPools = autobindRules.selectBestPools(consumer, new String[]{"compliant-69"}, pools, compliance, null, new HashSet<>(), false); assertEquals(1, bestPools.size()); assertTrue(bestPools.contains(new PoolQuantity(MCT1650, 1))); }
Source:
public String getIdentityKeystorePath() { return getGatewayKeystoreDir() + "/" + DEFAULT_GATEWAY_KEYSTORE_NAME; }

Target:
public String getIdentityKeystorePath() { return getGatewayKeystorePath().resolve(DEFAULT_GATEWAY_KEYSTORE_NAME).toString(); }
Source:
protected void moveTo(int index) { super.moveTo(index); if (index > -1) { ((ResettableIterator<T>) get(index)).reset(); } }

Target:
protected void moveTo(int index) { super.moveTo(index); if (index > -1) { get(index).reset(); } }
Source:
public void generatePage_onJenkinsConfiguration_generatesSummaryTableWithBuildNumber() { setUpWithJson(SAMPLE_JSON); configuration.setRunWithJenkins(true); configuration.setBuildNumber("123"); page = new StepsOverviewPage(); initPageGeneartor().generatePage(page); DocumentAssertion document = documentFrom(page.getWebPage()); BuildInfoAssertion buildInfo = document.getBuildInfo(); TableRowAssertion headValues = buildInfo.getHeaderRow(); headValues.hasExactValues("Project", "Number", "Date"); assertThat(buildInfo.getProjectName()).isEqualTo(configuration.getProjectName()); assertThat(buildInfo.getBuildNumber()).isEqualTo(configuration.getBuildNumber()); buildInfo.hasBuildDate(true); }

Target:
public void generatePage_onJenkinsConfiguration_generatesSummaryTableWithBuildNumber() { setUpWithJson(SAMPLE_JSON); configuration.setRunWithJenkins(true); configuration.setBuildNumber("123"); page = new StepsOverviewPage(); generatePage(page); DocumentAssertion document = documentFrom(page.getWebPage()); BuildInfoAssertion buildInfo = document.getBuildInfo(); TableRowAssertion headValues = buildInfo.getHeaderRow(); headValues.hasExactValues("Project", "Number", "Date"); assertThat(buildInfo.getProjectName()).isEqualTo(configuration.getProjectName()); assertThat(buildInfo.getBuildNumber()).isEqualTo(configuration.getBuildNumber()); buildInfo.hasBuildDate(true); }
Source:
public void addConnector(String connectorName, Connector connector, AssignmentStrategy strategy, boolean customCheckpointing, DatastreamDeduper deduper, String authorizerName) { Validate.notNull(strategy, "strategy cannot be null"); Validate.notEmpty(connectorName, "connectorName cannot be empty"); Validate.notNull(connector, "Connector cannot be null"); _log.info(String.format("Add new connector of type %s, strategy %s with custom checkpointing %s to coordinator", connectorName, strategy.getClass().getTypeName(), customCheckpointing)); if (_connectors.containsKey(connectorName)) { String err = "A connector of type " + connectorName + " already exists."; _log.error(err); throw new IllegalArgumentException(err); } Optional<List<BrooklinMetricInfo>> connectorMetrics = Optional.ofNullable(connector.getMetricInfos()); connectorMetrics.ifPresent(_metrics::addAll); ConnectorInfo connectorInfo = new ConnectorInfo(connectorName, connector, strategy, customCheckpointing, deduper, authorizerName); _connectors.put(connectorName, connectorInfo); Class<?> connectorClass = connector.getClass(); _dynamicMetricsManager.registerGauge(connectorClass, NUM_DATASTREAMS, () -> connectorInfo.getConnector().getNumDatastreams()); _dynamicMetricsManager.registerGauge(connectorClass, NUM_DATASTREAM_TASKS, () -> connectorInfo.getConnector().getNumDatastreamTasks()); String className = connectorClass.getSimpleName(); _metrics.add(new BrooklinGaugeInfo(MetricRegistry.name(className, NUM_DATASTREAMS))); _metrics.add(new BrooklinGaugeInfo(MetricRegistry.name(className, NUM_DATASTREAM_TASKS))); }

Target:
public void addConnector(String connectorName, Connector connector, AssignmentStrategy strategy, boolean customCheckpointing, DatastreamDeduper deduper, String authorizerName) { Validate.notNull(strategy, "strategy cannot be null"); Validate.notEmpty(connectorName, "connectorName cannot be empty"); Validate.notNull(connector, "Connector cannot be null"); _log.info(String.format("Add new connector of type %s, strategy %s with custom checkpointing %s to coordinator", connectorName, strategy.getClass().getTypeName(), customCheckpointing)); if (_connectors.containsKey(connectorName)) { String err = "A connector of type " + connectorName + " already exists."; _log.error(err); throw new IllegalArgumentException(err); } Optional<List<BrooklinMetricInfo>> connectorMetrics = Optional.ofNullable(connector.getMetricInfos()); connectorMetrics.ifPresent(_metrics::addAll); ConnectorInfo connectorInfo = new ConnectorInfo(connectorName, connector, strategy, customCheckpointing, deduper, authorizerName); _connectors.put(connectorName, connectorInfo); String className = connector.getClass().getSimpleName(); _dynamicMetricsManager.registerGauge(className, NUM_DATASTREAMS, () -> connectorInfo.getConnector().getNumDatastreams()); _dynamicMetricsManager.registerGauge(className, NUM_DATASTREAM_TASKS, () -> connectorInfo.getConnector().getNumDatastreamTasks()); _metrics.add(new BrooklinGaugeInfo(MetricRegistry.name(className, NUM_DATASTREAMS))); _metrics.add(new BrooklinGaugeInfo(MetricRegistry.name(className, NUM_DATASTREAM_TASKS))); }
Source:
public boolean applies(GameEvent event, Ability source, Game game) { CavernOfSoulsWatcher watcher = game.getState().getWatcher(CavernOfSoulsWatcher.class, source.getSourceId()); Spell spell = game.getStack().getSpell(event.getTargetId()); Integer currentZCC = game.getObject(event.getTargetId()).getZoneChangeCounter(game); return spell != null && watcher != null && watcher.spellCantBeCountered(spell.getId(), currentZCC); }

Target:
public boolean applies(GameEvent event, Ability source, Game game) { CavernOfSoulsWatcher watcher = game.getState().getWatcher(CavernOfSoulsWatcher.class, source.getSourceId()); Spell spell = game.getStack().getSpell(event.getTargetId()); return spell != null && watcher != null && watcher.spellCantBeCountered(new MageObjectReference(spell, game)); }
Source:
private static ProductExpr fromXtext(final org.abs_models.xtext.abs.ProductExpression xtext_exp) { ProductExpr result = null; if (xtext_exp == null) { result = new ProductFeatureSet(); } if (xtext_exp instanceof org.abs_models.xtext.abs.ProductExprDifference) { result = new ProductDifference(fromXtext(xtext_exp.getLeft()), fromXtext(xtext_exp.getRight())); } else if (xtext_exp instanceof org.abs_models.xtext.abs.ProductExprUnion) { result = new ProductUnion(fromXtext(xtext_exp.getLeft()), fromXtext(xtext_exp.getRight())); } else if (xtext_exp instanceof org.abs_models.xtext.abs.ProductExprIntersect) { result = new ProductIntersect(fromXtext(xtext_exp.getLeft()), fromXtext(xtext_exp.getRight())); } else { if (xtext_exp.getProdname() != null) { result = new ProductName(xtext_exp.getProdname()); } else if (xtext_exp.getParen() != null) { return fromXtext(xtext_exp.getParen()); } else { result = new ProductFeatureSet(); for (final org.abs_models.xtext.abs.ProductFeature feat : xtext_exp.getFeatures()) { ((ProductFeatureSet)result).addFeature(fromXtext(feat)); } } } return nodeWithLocation(result, xtext_exp); }

Target:
private static ProductExpr fromXtext(final org.abs_models.xtext.abs.ProductExpression xtext_exp) { ProductExpr result = null; if (xtext_exp instanceof org.abs_models.xtext.abs.ProductExprDifference) { result = new ProductDifference(fromXtext(xtext_exp.getLeft()), fromXtext(xtext_exp.getRight())); } else if (xtext_exp instanceof org.abs_models.xtext.abs.ProductExprUnion) { result = new ProductUnion(fromXtext(xtext_exp.getLeft()), fromXtext(xtext_exp.getRight())); } else if (xtext_exp instanceof org.abs_models.xtext.abs.ProductExprIntersect) { result = new ProductIntersect(fromXtext(xtext_exp.getLeft()), fromXtext(xtext_exp.getRight())); } else { if (xtext_exp.getProdname() != null) { result = new ProductName(xtext_exp.getProdname()); } else if (xtext_exp.getParen() != null) { return fromXtext(xtext_exp.getParen()); } else { result = new ProductFeatureSet(); for (final org.abs_models.xtext.abs.ProductFeature feat : xtext_exp.getFeatures()) { ((ProductFeatureSet)result).addFeature(fromXtext(feat)); } } } return nodeWithLocation(result, xtext_exp); }
Source:
private static void assertFilterIfNotMIssingMatches( byte[] family, byte[] qualifier, byte[] value, boolean latestOnly, Filters.Filter adaptedFilter) throws IOException { Condition cellSetCondition = adaptedFilter.toProto().getInterleave().getFilters(0).getCondition(); Condition cellUnsetCondition = adaptedFilter.toProto().getInterleave().getFilters(1).getCondition(); assertColumnSpecification( family, qualifier, latestOnly, cellSetCondition.getPredicateFilter()); ByteString valueBS = ByteString.copyFrom(value); Assert.assertEquals( FILTERS.value().range() .startClosed(valueBS) .endClosed(valueBS) .toProto(), getValueRangeFilter(cellSetCondition.getPredicateFilter().getChain())); assertColumnSpecification( family, qualifier, latestOnly, cellUnsetCondition.getPredicateFilter()); Assert.assertEquals( FILTERS.pass().toProto(), cellSetCondition.getTrueFilter()); Assert.assertFalse(cellSetCondition.hasFalseFilter()); Assert.assertEquals( FILTERS.pass().toProto(), cellUnsetCondition.getFalseFilter()); Assert.assertFalse(cellUnsetCondition.hasTrueFilter()); }

Target:
private static void assertFilterIfNotMIssingMatches( byte[] family, byte[] qualifier, byte[] value, boolean latestOnly, Filters.Filter adaptedFilter) throws IOException { Interleave interleaveFilter = adaptedFilter.toProto().getInterleave(); Condition cellSetCondition = interleaveFilter.getFilters(0).getCondition(); Condition cellUnsetCondition = interleaveFilter.getFilters(1).getCondition(); assertColumnSpecification( family, qualifier, latestOnly, cellSetCondition.getPredicateFilter()); ByteString valueBS = ByteString.copyFrom(value); Assert.assertEquals( FILTERS.value().range() .startClosed(valueBS) .endClosed(valueBS) .toProto(), getValueRangeFilter(cellSetCondition.getPredicateFilter().getChain())); assertColumnSpecification( family, qualifier, latestOnly, cellUnsetCondition.getPredicateFilter()); Assert.assertEquals( FILTERS.pass().toProto(), cellSetCondition.getTrueFilter()); Assert.assertFalse(cellSetCondition.hasFalseFilter()); Assert.assertEquals( FILTERS.pass().toProto(), cellUnsetCondition.getFalseFilter()); Assert.assertFalse(cellUnsetCondition.hasTrueFilter()); }
Source:
protected void updateCursor(final PatchLineComment newComment) { if (newComment.getLine() == R_HEAD) { final PatchSet.Id psId = newComment.getKey().getParentKey().getParentKey(); switch (newComment.getSide()) { case FILE_SIDE_A: if (idSideA == null && idSideB.equals(psId)) { rowOfTableHeaderB++; borderRowOfFileComment++; return; } break; case FILE_SIDE_B: if (idSideA != null && idSideA.equals(psId)) { rowOfTableHeaderB++; borderRowOfFileComment++; return; } if (idSideB.equals(psId)) { borderRowOfFileComment++; } } } }

Target:
protected void updateCursor(final PatchLineComment newComment) { if (newComment.getLine() == R_HEAD) { final PatchSet.Id psId = newComment.getKey().getParentKey().getParentKey(); switch (newComment.getSide()) { case FILE_SIDE_A: if (idSideA == null && idSideB.equals(psId)) { rowOfTableHeaderB++; borderRowOfFileComment++; return; } break; case FILE_SIDE_B: if (idSideA != null && idSideA.equals(psId)) { rowOfTableHeaderB++; borderRowOfFileComment++; } else if (idSideB.equals(psId)) { borderRowOfFileComment++; } } } }
Source:
public void restartTask(final ConnectorTaskId id, final Callback<Void> callback) { addRequest(new Callable<Void>() { @Override public Void call() throws Exception { if (checkRebalanceNeeded(callback)) return null; if (!configState.connectors().contains(id.connector())) { callback.onCompletion(new NotFoundException("Unknown connector: " + id.connector()), null); return null; } if (configState.taskConfig(id) == null) { callback.onCompletion(new NotFoundException("Unknown task: " + id), null); return null; } if (assignment.tasks().contains(id)) { try { worker.stopAndAwaitTask(id); if (startTask(id)) callback.onCompletion(null, null); else callback.onCompletion(new ConnectException("Failed to start task: " + id), null); } catch (Throwable t) { callback.onCompletion(t, null); } } else if (isLeader()) { callback.onCompletion(new NotAssignedException("Cannot restart task since it is not assigned to this member", member.ownerUrl(id)), null); } else { callback.onCompletion(new NotLeaderException("Cannot restart task since it is not leader", leaderUrl()), null); } return null; } }, forwardErrorCallback(callback)); }

Target:
public void restartTask(final ConnectorTaskId id, final Callback<Void> callback) { addRequest(new Callable<Void>() { @Override public Void call() throws Exception { if (checkRebalanceNeeded(callback)) return null; if (!configState.connectors().contains(id.connector())) { callback.onCompletion(new NotFoundException("Unknown connector: " + id.connector()), null); return null; } if (configState.taskConfig(id) == null) { callback.onCompletion(new NotFoundException("Unknown task: " + id), null); return null; } if (assignment.tasks().contains(id)) { try { worker.stopAndAwaitTask(id); if (startTask(id)) callback.onCompletion(null, null); else callback.onCompletion(new ConnectException("Failed to start task: " + id), null); } catch (Throwable t) { callback.onCompletion(t, null); } } else if (isLeader()) { callback.onCompletion(new NotAssignedException("Cannot restart task since it is not assigned to this member", member.ownerUrl(id)), null); } else { callback.onCompletion(new NotLeaderException("Cannot restart task since it is not assigned to this member", leaderUrl()), null); } return null; } }, forwardErrorCallback(callback)); }
Source:
public final void setupAbstractTest() { DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("takesScreenshot", false); driver = new PhantomJSDriver(capabilities); driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS); driver.manage().timeouts().setScriptTimeout(30, TimeUnit.SECONDS); driver.manage().timeouts().implicitlyWait(0, TimeUnit.SECONDS); driver.manage().window().setSize(new Dimension(2560, 1440)); }

Target:
public final void setupAbstractTest() { ChromeOptions opts = new ChromeOptions(); opts.addArguments("--headless", "--disable-gpu", "--window-size=2560x1440"); DesiredCapabilities caps = new DesiredCapabilities(); caps.setCapability(ChromeOptions.CAPABILITY, opts); driver = new ChromeDriver(caps); driver.manage().timeouts().pageLoadTimeout(15, TimeUnit.SECONDS); driver.manage().timeouts().setScriptTimeout(15, TimeUnit.SECONDS); }
Source:
public void authenticate(String user, String password) { String adminUser = ((Properties)context.get(ExtensionProperties.CONFIGURATION)).getProperty("config.authn.user.name"); String adminPassword = ((Properties)context.get(ExtensionProperties.CONFIGURATION)).getProperty("config.authn.user.password"); if (!ObjectUtils.equals(user, adminUser) || !ObjectUtils.equals(password, adminPassword)) { throw new AAAExtensionException(AAAExtensionException.AAAExtensionError.INCORRECT_CREDENTIALS, ""); } }

Target:
public void authenticate(String user, String password) { String adminUser = ((Properties)context.get(ExtensionProperties.CONFIGURATION)).getProperty("config.authn.user.name"); String adminPassword = ((Properties)context.get(ExtensionProperties.CONFIGURATION)).getProperty("config.authn.user.password"); if (!user.equals(adminUser) || !password.equals(adminPassword)) { throw new AAAExtensionException(AAAExtensionException.AAAExtensionError.INCORRECT_CREDENTIALS, ""); } }
Source:
public Set<SecurityGroup> listSecurityGroupsInLocation(final Location location) { String region = AWSUtils.getRegionFromLocationOrNull(location); if (region != null) { return listSecurityGroupsInLocation(region); } else { return ImmutableSet.of(); } }

Target:
public Set<SecurityGroup> listSecurityGroupsInLocation(final Location location) { String region = AWSUtils.getRegionFromLocationOrNull(location); if (region == null) { return ImmutableSet.of(); } return listSecurityGroupsInLocation(region); }
Source:
public void shouldGetActiveDiagnoses() { Patient patient = new Patient(2); List<Diagnosis> activeDiagnosis = diagnosisDAO.getActiveDiagnoses(patient); assertEquals(2, activeDiagnosis.size()); }

Target:
public void shouldGetActiveDiagnoses() { assertEquals(2, diagnosisDAO.getActiveDiagnoses(new Patient(2)).size()); }
Source:
public static boolean hasAnyPermission(Object object, Permission[] permissions) throws IOException, ServletException { if (permissions == null || permissions.length == 0) { return true; } if (object instanceof AccessControlled) return hasAnyPermission((AccessControlled) object, permissions); else { List<Ancestor> ancs = Stapler.getCurrentRequest().getAncestors(); for (Ancestor anc : Iterators.reverse(ancs)) { Object o = anc.getObject(); if (o instanceof AccessControlled) { return hasAnyPermission((AccessControlled) o, permissions); } } return hasAnyPermission(Jenkins.get(), permissions); } }

Target:
public static boolean hasAnyPermission(Object object, Permission[] permissions) throws IOException, ServletException { if (permissions == null || permissions.length == 0) { return true; } if (object instanceof AccessControlled) return hasAnyPermission((AccessControlled) object, permissions); else { AccessControlled ac = Stapler.getCurrentRequest().findAncestorObject(AccessControlled.class); if (ac != null) { return hasAnyPermission(ac, permissions); } return hasAnyPermission(Jenkins.get(), permissions); } }
Source:
protected void executeCommand() { DbUser dbUser = getDbUser(); setCurrentUser(dbUser); String engineSessionId = loginOnBehalf(dbUser); if (StringUtils.isNotEmpty(engineSessionId)) { getReturnValue().setActionReturnValue(engineSessionId); } setSucceeded(true); }

Target:
protected void executeCommand() { try { getReturnValue().setActionReturnValue(loginOnBehalf()); } catch (Exception ex) { log.error("Unable to create engine session: {}", ex.getMessage()); log.debug("Unable to create engine session", ex); } setSucceeded(true); }
Source:
private void updateDiskImageDynamic() { VDSReturnValue ret = Backend.getInstance().getResourceManager().RunVdsCommand( VDSCommandType.GetImageInfo, new GetImageInfoVDSCommandParameters(getDestinationDiskImage().getStoragePoolId().getValue(), getDestinationDiskImage().getStorageIds().get(0), getDestinationDiskImage().getId(), getDestinationDiskImage().getImageId())); DiskImage imageFromIRS = (DiskImage) ret.getReturnValue(); DiskImageDynamic diskImageDynamic = getDiskImageDynamicDAO().get(getDestinationDiskImage().getImageId()); if (imageFromIRS != null && diskImageDynamic != null) { diskImageDynamic.setactual_size(imageFromIRS.getActualSizeFromDiskImage()); getDiskImageDynamicDAO().update(diskImageDynamic); } }

Target:
private void updateDiskImageDynamic() { VDSReturnValue ret = runVdsCommand( VDSCommandType.GetImageInfo, new GetImageInfoVDSCommandParameters(getDestinationDiskImage().getStoragePoolId().getValue(), getDestinationDiskImage().getStorageIds().get(0), getDestinationDiskImage().getId(), getDestinationDiskImage().getImageId())); DiskImage imageFromIRS = (DiskImage) ret.getReturnValue(); DiskImageDynamic diskImageDynamic = getDiskImageDynamicDAO().get(getDestinationDiskImage().getImageId()); if (imageFromIRS != null && diskImageDynamic != null) { diskImageDynamic.setactual_size(imageFromIRS.getActualSizeFromDiskImage()); getDiskImageDynamicDAO().update(diskImageDynamic); } }
Source:
public void mustEvaluateTrueEquality() throws Exception { new Assertion<>( "Must evaluate true equality", new RsPrettyJson( new RsWithBody("{\"person\":{\"name\":\"John\"}}") ), new IsEqual<>( new RsPrettyJson( new RsWithBody("{\"person\":{\"name\":\"John\"}}") ) ) ).affirm(); }

Target:
public void mustEvaluateTrueEquality() throws Exception { final String body = "{\"person\":{\"name\":\"John\"}}"; new Assertion<>( "Must evaluate true equality", new RsPrettyJson( new RsWithBody(body) ), new IsEqual<>( new RsPrettyJson( new RsWithBody(body) ) ) ).affirm(); }
Source:
public void testReadListViaFluentAPI() { List<PGobject> result = handle.createQuery("SELECT get_foo_bars()") .map(new PGObjectColumnMapper()) .list(); List<FooBarPGType> fooBars = (List<FooBarPGType>) (List<?>) result; assertThat(fooBars).isEqualTo(ImmutableList.of( new FooBarPGType(1, "foo1", "bar1"), new FooBarPGType(2, "foo2", "bar2") )); }

Target:
public void testReadListViaFluentAPI() { List<FooBarPGType> result = handle.createQuery("SELECT get_foo_bars()") .mapTo(FooBarPGType.class) .list(); assertThat(result).containsExactlyInAnyOrder( new FooBarPGType(1, "foo1", "bar1"), new FooBarPGType(2, "foo2", "bar2") ); }
Source:
public void testBuilderWithDefaultValues() { FeedbackResponseCommentAttributes feedbackAttributes = FeedbackResponseCommentAttributes .builder("course", "name", "questionId", "responseId", "email") .build(); assertEquals(feedbackAttributes.giverSection, "None"); assertEquals(feedbackAttributes.receiverSection, "None"); assertEquals(feedbackAttributes.showCommentTo, new ArrayList<>()); assertEquals(feedbackAttributes.showGiverNameTo, new ArrayList<>()); assertEquals(feedbackAttributes.commentText, new Text("")); assertTrue(feedbackAttributes.isVisibilityFollowingFeedbackQuestion); }

Target:
public void testBuilderWithDefaultValues() { FeedbackResponseCommentAttributes feedbackAttributes = FeedbackResponseCommentAttributes .builder("course", "name", "email", new Text("")) .build(); assertEquals(feedbackAttributes.giverSection, "None"); assertEquals(feedbackAttributes.receiverSection, "None"); assertEquals(feedbackAttributes.showCommentTo, new ArrayList<>()); assertEquals(feedbackAttributes.showGiverNameTo, new ArrayList<>()); assertTrue(feedbackAttributes.isVisibilityFollowingFeedbackQuestion); }
Source:
public void interruptedExecution(CheckerContext context) { reportIssues(); }

Target:
public void interruptedExecution(CheckerContext context) { methodInvariantContexts.pop(); }
Source:
public String identify() { return "bigdoor@" + door.getDoorUID() + PropertyParser.getPropertiesString(this); }

Target:
public String identify() { return "bigdoor@" + door.getDoorUID(); }
Source:
final void markCommitStateDirty() { if (isAutoCommit || isReadOnly) { lastAccess = clockSource.currentTime(); } else { isCommitStateDirty = true; } }

Target:
final void markCommitStateDirty() { isCommitStateDirty = true; }
Source:
private void removeOffendingMprHashFragment(JsonObject uidl) { if (!uidl.hasKey(EXECUTE)) { return; } JsonArray exec = uidl.getArray(EXECUTE); String hash = null; int idx = -1; for (int i = 0; i < exec.length(); i++) { JsonArray arr = exec.get(i); for (int j = 0; j < arr.length(); j++) { if (!arr.get(j).getType().equals(JsonType.STRING)) { continue; } String script = arr.getString(j); if (script.contains("history.pushState")) { idx = i; continue; } if (!script.startsWith(SYNC_ID)) { continue; } JsonObject json = JsonUtil.parse("{" + script + "}"); hash = replaceHashFragment(json); if (hash != null) { script = JsonUtil.stringify(json); script = script.substring(1, script.length() - 1); arr.set(j, script); } } } if (hash != null) { idx = idx >= 0 ? idx : exec.length(); JsonArray arr = Json.createArray(); arr.set(0, ""); arr.set(1, String.format(PUSH_STATE, hash)); exec.set(idx, arr); } }

Target:
private void removeOffendingMprHashFragment(JsonObject uidl) { if (!uidl.hasKey(EXECUTE)) { return; } JsonArray exec = uidl.getArray(EXECUTE); String hash = null; int idx = -1; for (int i = 0; i < exec.length(); i++) { JsonArray arr = exec.get(i); for (int j = 0; j < arr.length(); j++) { if (!arr.get(j).getType().equals(JsonType.STRING)) { continue; } String script = arr.getString(j); if (script.contains("history.pushState")) { idx = i; continue; } if (!script.startsWith(SYNC_ID)) { continue; } JsonObject json = JsonUtil.parse("{" + script + "}"); hash = removeHashInV7Uidl(json); if (hash != null) { script = JsonUtil.stringify(json); script = script.substring(1, script.length() - 1); arr.set(j, script); } } } if (hash != null) { idx = idx >= 0 ? idx : exec.length(); JsonArray arr = Json.createArray(); arr.set(0, ""); arr.set(1, String.format(PUSH_STATE, hash)); exec.set(idx, arr); } }
Source:
public void closesAllParts() throws Exception { final String body = "RqMtFakeTest.closesAllParts"; final RqMultipart request = new RqMtFake( new RqFake(), new RqWithHeaders( new RqFake("", "", body), RqMtFakeTest.contentLengthHeader( (long) body.getBytes().length ), RqMtFakeTest.contentDispositionHeader( "form-data; name=\"name\"" ) ), new RqWithHeaders( new RqFake("", "", body), RqMtFakeTest.contentLengthHeader(0L), RqMtFakeTest.contentDispositionHeader( "form-data; name=\"content\"; filename=\"a.bin\"" ) ) ); final String exmessage = "An IOException was expected since the Stream is closed"; final String name = "name"; final String content = "content"; final RqMtBase multi = new RqMtBase(request); multi.part(name).iterator().next().body().read(); multi.part(content).iterator().next().body().read(); multi.body().close(); MatcherAssert.assertThat( multi.part(name).iterator().next(), Matchers.notNullValue() ); try { multi.part(name).iterator().next().body().read(); Assert.fail(exmessage); } catch (final IOException ex) { MatcherAssert.assertThat( ex, Matchers.instanceOf(ClosedChannelException.class) ); } MatcherAssert.assertThat( multi.part(content).iterator().next(), Matchers.notNullValue() ); try { multi.part(content).iterator().next().body().read(); Assert.fail(exmessage); } catch (final IOException ex) { MatcherAssert.assertThat( ex, Matchers.instanceOf(ClosedChannelException.class) ); } }

Target:
public void closesAllParts() throws Exception { final String body = "RqMtFakeTest.closesAllParts"; final RqMultipart request = new RqMtFake( new RqFake(), new RqWithHeaders( new RqFake("", "", body), RqMtFakeTest.contentLengthHeader( (long) body.getBytes().length ), RqMtFakeTest.contentDispositionHeader( "form-data; name=\"name\"" ) ), new RqWithHeaders( new RqFake("", "", body), RqMtFakeTest.contentLengthHeader(0L), RqMtFakeTest.contentDispositionHeader( "form-data; name=\"content\"; filename=\"a.bin\"" ) ) ); final String exmessage = "An IOException was expected since the Stream is closed"; final String name = "name"; final String content = "content"; final RqMtBase multi = new RqMtBase(request); multi.part(name).iterator().next().body().read(); multi.part(content).iterator().next().body().read(); multi.body().close(); MatcherAssert.assertThat( multi.part(name).iterator().next(), Matchers.notNullValue() ); try { multi.part(name).iterator().next().body().read(); Assert.fail(exmessage); } catch (final IOException ex) { MatcherAssert.assertThat( ex, new IsInstanceOf(ClosedChannelException.class) ); } MatcherAssert.assertThat( multi.part(content).iterator().next(), Matchers.notNullValue() ); try { multi.part(content).iterator().next().body().read(); Assert.fail(exmessage); } catch (final IOException ex) { MatcherAssert.assertThat( ex, new IsInstanceOf(ClosedChannelException.class) ); } }
Source:
public Optional<NorthAmericaRegion> getState(String normalisedZipCode) { var wellFormedZipCodeAndOptionalPlusFourMatcher = WELL_FORMED_STATE_WITH_ZIP_CODE_AND_OPTIONAL_PLUS_FOUR.matcher(normalisedZipCode); var wellFormedStateWithZipAndOptionalPlusFourMatcher = WELL_FORMED_ZIP_CODE_AND_OPTIONAL_PLUS_FOUR.matcher(normalisedZipCode); if (wellFormedStateWithZipAndOptionalPlusFourMatcher.matches()) { String stateAbbreviation = wellFormedStateWithZipAndOptionalPlusFourMatcher.group(1); return Optional.ofNullable(UsZipCodeToStateMap.ZIP_CODE_TO_US_STATE_ABBREVIATIONS.get(stateAbbreviation)); } else if (wellFormedZipCodeAndOptionalPlusFourMatcher.matches()) { String firstThreeCharacters = wellFormedZipCodeAndOptionalPlusFourMatcher.group(1); return Optional.ofNullable(US_STATE_ABBREVIATIONS_MAPPING.get(firstThreeCharacters)); } return Optional.empty(); }

Target:
public Optional<UsState> getState(String normalisedZipCode) { var wellFormedZipCodeAndOptionalPlusFourMatcher = WELL_FORMED_STATE_WITH_ZIP_CODE_AND_OPTIONAL_PLUS_FOUR.matcher(normalisedZipCode); var wellFormedStateWithZipAndOptionalPlusFourMatcher = WELL_FORMED_ZIP_CODE_AND_OPTIONAL_PLUS_FOUR.matcher(normalisedZipCode); if (wellFormedStateWithZipAndOptionalPlusFourMatcher.matches()) { String stateAbbreviation = wellFormedStateWithZipAndOptionalPlusFourMatcher.group(1); return Optional.ofNullable(UsZipCodeToStateMap.ZIP_CODE_TO_US_STATE_ABBREVIATIONS.get(stateAbbreviation)); } else if (wellFormedZipCodeAndOptionalPlusFourMatcher.matches()) { String firstThreeCharacters = wellFormedZipCodeAndOptionalPlusFourMatcher.group(1); return Optional.ofNullable(US_STATE_ABBREVIATIONS_MAPPING.get(firstThreeCharacters)); } return Optional.empty(); }
Source:
private Charts createCharts(List<Metric> metrics) { Charts charts = new Flotr2Charts(); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); String displayFormat = "MMM dd"; if(metrics.size() > 0 && metrics.get(0).name.length() == 7){ df = new SimpleDateFormat("yyyy-MM"); displayFormat = "MMM"; } df.setTimeZone(getTimeZone()); Chart chart = charts.createLineChart("commitsChart", getString("gb.activity"), "day", getString("gb.commits")); chart.setDateFormat(displayFormat); for (Metric metric : metrics) { Date date; try { date = df.parse(metric.name); } catch (ParseException e) { logger.error("Unable to parse date: " + metric.name); return charts; } chart.addValue(date, (int)metric.count); } charts.addChart(chart); return charts; }

Target:
private Charts createCharts(List<Metric> metrics) { Charts charts = new Flotr2Charts(); SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); String displayFormat = "MMM dd"; if(metrics.size() > 0 && metrics.get(0).name.length() == 7){ df = new SimpleDateFormat("yyyy-MM"); displayFormat = "yyyy MMM"; } df.setTimeZone(getTimeZone()); Chart chart = charts.createLineChart("commitsChart", getString("gb.activity"), "day", getString("gb.commits")); chart.setDateFormat(displayFormat); for (Metric metric : metrics) { Date date; try { date = df.parse(metric.name); } catch (ParseException e) { logger.error("Unable to parse date: " + metric.name); return charts; } chart.addValue(date, (int)metric.count); if(metric.tag > 0 ){ chart.addHighlight(date, (int)metric.count); } } charts.addChart(chart); return charts; }
Source:
public static void setBundlesLevels(Q7Target target, Map<String, String> levelMap) { final ProfileBundleContainer profileBundleContainer = target.getInstall().container; if (profileBundleContainer != null) { for (TargetBundle bundle : target.getInstall().getBundles()) { String bundleLevels = levelMap.get(bundle.getBundleInfo().getSymbolicName()); if (bundleLevels != null) { String[] strings = bundleLevels.split(":"); int level = Integer.parseInt(strings[0]); boolean started = Boolean.parseBoolean(strings[1]); bundle.getBundleInfo().setStartLevel(level); bundle.getBundleInfo().setMarkedAsStarted(started); } } } else { log(status("Profile Bundle Container is EMPTY.")); } }

Target:
public static void setBundlesLevels(Q7Target target, Map<String, String> levelMap) { final ProfileBundleContainer profileBundleContainer = target.getInstall().container; if (profileBundleContainer != null) { for (TargetBundle bundle : target.getInstall().getBundles()) { String bundleLevels = levelMap.get(bundle.getBundleInfo().getSymbolicName()); if (bundleLevels != null) { try { String[] strings = bundleLevels.split(":"); int level = Integer.parseInt(strings[0]); boolean started = Boolean.parseBoolean(strings[1]); bundle.getBundleInfo().setStartLevel(level); bundle.getBundleInfo().setMarkedAsStarted(started); } catch (Exception e) { } } } } else { log(status("Profile Bundle Container is EMPTY.")); } }
Source:
public void checkDocuments() throws XWikiException { LOGGER.info("executing XWikiRecycleBinIndexes"); if (queryExecService.existsConstraint("prefix_db", "xwikirecyclebin", "dateIDX")) { queryExecService.executeWriteSQL(getSQLIndexToRecycleBin()); } }

Target:
public void checkDocuments() throws XWikiException { LOGGER.info("executing XWikiRecycleBinIndexes"); String prefixAndDb = modelContext.getXWikiContext().getWiki().Param("xwiki.db.prefix") + modelContext.getWikiRef().getName(); if (!queryExecService.existsIndex(prefixAndDb, "xwikirecyclebin", "dateIDX")) { queryExecService.executeWriteSQL(getSQLIndexToRecycleBin()); } }
Source:
public String getName() { return this.key.replace("options.mainHand.", ""); }

Target:
public String getName() { return this.name; }
Source:
private void initChartMenu() { List<Chart> charts = mController.getCharts(); String[] menuArray = new String[charts.size()]; int i = 0; for (Chart chart : charts) { menuArray[i] = chart.name; i++; } mAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, menuArray); mDrawerList.setAdapter(mAdapter); final Activity that = this; mDrawerList.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { mController.updatePatientObsUi(position); mDrawerLayout.closeDrawer(mDrawerList); } }); }

Target:
private void initChartMenu() { final ActionBar actionBar = getActionBar(); actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); ActionBar.TabListener tabListener = new ActionBar.TabListener() { @Override public void onTabSelected(ActionBar.Tab tab, android.app.FragmentTransaction ft) { mController.updatePatientObsUi(tab.getPosition()); } @Override public void onTabUnselected(ActionBar.Tab tab, android.app.FragmentTransaction ft) @Override public void onTabReselected(ActionBar.Tab tab, android.app.FragmentTransaction ft) }; List<Chart> charts = mController.getCharts(); String[] menuArray = new String[charts.size()]; for (int i = 0; i < charts.size(); i++) { menuArray[i] = charts.get(i).name; actionBar.addTab( actionBar.newTab() .setText(charts.get(i).name) .setTabListener(tabListener)); } }
Source:
public ArrayInterface setInt(int index, int value) { return setObject(index, value); }

Target:
public Array setInt(int index, int value) { return setObject(index, value); }
Source:
private void submitFeedback() { PreferenceUtils.saveBoolean(NavigationServiceProvider.FIRST_FEEDBACK, false); Log.d(TAG, "First Feedback : " + String.valueOf(Application.getPrefs() .getBoolean(NavigationServiceProvider.FIRST_FEEDBACK, true))); String feedback = ((EditText) this.findViewById(R.id.editFeedbackText)).getText().toString(); if (Application.getPrefs() .getBoolean(getString(R.string.preferences_key_user_share_logs), true)) { moveLog(feedback); } else { deleteLog(); } Log.d(TAG,"Feedback send : " + feedback); Toast.makeText(FeedbackActivity.this, getString(R.string.feedback_notify_confirmation), Toast.LENGTH_SHORT).show(); }

Target:
private void submitFeedback() { PreferenceUtils.saveBoolean(NavigationService.FIRST_FEEDBACK, false); Log.d(TAG, "First Feedback : " + String.valueOf(Application.getPrefs() .getBoolean(NavigationService.FIRST_FEEDBACK, true))); String feedback = ((EditText) this.findViewById(R.id.editFeedbackText)).getText().toString(); if (Application.getPrefs() .getBoolean(getString(R.string.preferences_key_user_share_logs), true)) { moveLog(feedback); } else { deleteLog(); } Log.d(TAG,"Feedback send : " + feedback); Toast.makeText(FeedbackActivity.this, getString(R.string.feedback_notify_confirmation), Toast.LENGTH_SHORT).show(); }
Source:
public void testValidationInvalidPassword() throws Exception { EditRepositoryWizard wizard = new EditRepositoryWizard(repository, TasksUiPlugin.getConnectorUi(repository.getConnectorKind())); WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), wizard); dialog.create(); BugzillaRepositorySettingsPage page = (BugzillaRepositorySettingsPage) wizard.getSettingsPage(); page.setPassword("bogus"); try { BugzillaClient client = createClient(page.getRepositoryUrl(), page.getUserName(), page.getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), page.getCharacterEncoding()); client.validate(null); } catch (CoreException e) { return; } fail("LoginException didn't occur!"); }

Target:
public void testValidationInvalidPassword() throws Exception { WizardDialog dialog = new WizardDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell(), wizard); dialog.create(); BugzillaRepositorySettingsPage page = (BugzillaRepositorySettingsPage) wizard.getSettingsPage(); page.setPassword("bogus"); try { BugzillaClient client = createClient(page.getRepositoryUrl(), page.getUserName(), page.getPassword(), page.getHttpAuthUserId(), page.getHttpAuthPassword(), page.getCharacterEncoding()); client.validate(null); } catch (CoreException e) { return; } fail("LoginException didn't occur!"); }
Source:
private void writeHostSpec(HostSpecificationImpl host, DataOutputStream out, boolean force) throws IOException { if (host != null && force && !forcedWrite.contains(host)) { int index = addToObjectTable(host); out.writeByte(StateReader.OBJECT); out.writeInt(index); forcedWrite.add(host); } else if (writePrefix(host, out)) return; writeVersionConstraint(host, out); BundleDescription[] hosts = host.getHosts(); if (hosts == null) { out.writeInt(0); return; } out.writeInt(hosts.length); for (BundleDescription host1 : hosts) { writeBundleDescription(host1, out, force); } writeMap(out, host.getAttributes()); writeMap(out, host.getArbitraryDirectives()); }

Target:
private void writeHostSpec(HostSpecificationImpl host, DataOutputStream out, boolean force) throws IOException { if (host != null && force && !forcedWrite.contains(host)) { int index = addToObjectTable(host); out.writeByte(StateReader.OBJECT); out.writeInt(index); forcedWrite.add(host); } else if (writePrefix(host, out)) return; writeVersionConstraint(host, out); BundleDescription[] hosts = host.getHosts(); if (hosts == null) { out.writeInt(0); return; } out.writeInt(hosts.length); for (BundleDescription h : hosts) { writeBundleDescription(h, out, force); } writeMap(out, host.getAttributes()); writeMap(out, host.getArbitraryDirectives()); }
Source:
private static Credential.UserCredential buildUserCredentialFromEnterpriseConfig( WifiEnterpriseConfig config) { Credential.UserCredential userCredential = new Credential.UserCredential(); userCredential.setEapType(EAPConstants.EAP_TTLS); if (TextUtils.isEmpty(config.getIdentity())) { Log.e(TAG, "Missing username for user credential"); return null; } userCredential.setUsername(config.getIdentity()); if (TextUtils.isEmpty(config.getPassword())) { Log.e(TAG, "Missing password for user credential"); return null; } String encodedPassword = new String(Base64.encode(config.getPassword().getBytes(StandardCharsets.UTF_8), Base64.DEFAULT), StandardCharsets.UTF_8); userCredential.setPassword(encodedPassword); switch(config.getPhase2Method()) { case WifiEnterpriseConfig.Phase2.PAP: userCredential.setNonEapInnerMethod("PAP"); break; case WifiEnterpriseConfig.Phase2.MSCHAP: userCredential.setNonEapInnerMethod("MS-CHAP"); break; case WifiEnterpriseConfig.Phase2.MSCHAPV2: userCredential.setNonEapInnerMethod("MS-CHAP-V2"); break; default: Log.e(TAG, "Unsupported phase2 method for TTLS: " + config.getPhase2Method()); return null; } return userCredential; }

Target:
private static Credential.UserCredential buildUserCredentialFromEnterpriseConfig( WifiEnterpriseConfig config) { Credential.UserCredential userCredential = new Credential.UserCredential(); userCredential.setEapType(EAPConstants.EAP_TTLS); if (TextUtils.isEmpty(config.getIdentity())) { Log.e(TAG, "Missing username for user credential"); return null; } userCredential.setUsername(config.getIdentity()); if (TextUtils.isEmpty(config.getPassword())) { Log.e(TAG, "Missing password for user credential"); return null; } String encodedPassword = new String(Base64.encode(config.getPassword().getBytes(StandardCharsets.UTF_8), Base64.DEFAULT), StandardCharsets.UTF_8); userCredential.setPassword(encodedPassword); switch(config.getPhase2Method()) { case WifiEnterpriseConfig.Phase2.PAP: userCredential.setNonEapInnerMethod(Credential.UserCredential.AUTH_METHOD_PAP); break; case WifiEnterpriseConfig.Phase2.MSCHAP: userCredential.setNonEapInnerMethod(Credential.UserCredential.AUTH_METHOD_MSCHAP); break; case WifiEnterpriseConfig.Phase2.MSCHAPV2: userCredential.setNonEapInnerMethod(Credential.UserCredential.AUTH_METHOD_MSCHAPV2); break; default: Log.e(TAG, "Unsupported phase2 method for TTLS: " + config.getPhase2Method()); return null; } return userCredential; }
Source:
public void parseData() throws BasicModel.FieldNotDefinedException { mDataToBind.clear(); for (StoredNotification notification : mAPIData) { mDataToBind.add(new RecentNotificationListItem(notification.getTitle(), notification.getBody(), notification.getIntent())); } }

Target:
public void parseData() throws BasicModel.FieldNotDefinedException { mDataToBind.clear(); for (int i = 0; i < mAPIData.size(); i++) { StoredNotification notification = mAPIData.get(i); mDataToBind.add(new RecentNotificationListItem(notification.getTitle(), notification.getBody(), notification.getIntent())); } }
Source:
public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append(operator == null ? "" : operator.toString()); buffer.append(" " + super.toString()); buffer.append(":" + value == null ? "" : value); buffer.append(" " + type == null ? "" : type.toString()); buffer.append("^" + boost); return buffer.toString(); }

Target:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append(operator == null ? "" : operator.toString()); builder.append(" ").append(super.toString()); builder.append(value == null ? "" : value); builder.append(" ").append(type == null ? "" : type.toString()); builder.append("^").append(boost); return builder.toString(); }
Source:
public ListBoxModel doFillTokenCredentialIdItems(@AncestorInPath Item context) { Jenkins j = Jenkins.getInstance(); if (j == null) { throw new IllegalStateException(); } if(context == null && !j.hasPermission(Jenkins.ADMINISTER) || context != null && !context.hasPermission(Item.EXTENDED_READ)) { return new StandardListBoxModel(); } return new StandardListBoxModel() .withEmptySelection() .withAll(lookupCredentials( StringCredentials.class, context, ACL.SYSTEM, new HostnameRequirement("*.slack.com")) ); }

Target:
public ListBoxModel doFillTokenCredentialIdItems(@AncestorInPath Item context) { Jenkins jenkins = Jenkins.getActiveInstance(); if(context == null && !jenkins.hasPermission(Jenkins.ADMINISTER) || context != null && !context.hasPermission(Item.EXTENDED_READ)) { return new StandardListBoxModel(); } return new StandardListBoxModel() .withEmptySelection() .withAll(lookupCredentials( StringCredentials.class, context, ACL.SYSTEM, new HostnameRequirement("*.slack.com")) ); }