auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void save(@RequestParam(value = "cdmVersion", defaultValue = "5") float version, @RequestParam(value = "ids") List<Long> idV4s, @RequestParam(value = "name") String bundleName, HttpServletResponse response) throws IOException, PermissionDeniedException { if (notExist(version)) { response.sendError(SC_BAD_REQUEST, "No supported version " + version); return; } if (isEmpty(bundleName)) { response.sendError(SC_BAD_REQUEST, "Name cannot be empty"); return; } AthenaUser currentUser = userService.getCurrentUser(); ENDING licenses are not active boolean noLicence = vocabularyConversionService.missingAvailableForDownloadingLicenses(currentUser.getId(), false).stream() .map(VocabularyDTO::getId) .map(Long::new) .anyMatch(idV4s::contains); if (noLicence) { throw new PermissionDeniedException("User must have licenses for all vocabularies"); } DownloadBundle bundle = vocabularyService.saveBundle(bundleName, idV4s, currentUser, getByValue(version)); vocabularyService.saveContent(bundle, currentUser); LOGGER.info("Vocabulary saving is started, bundle name: {}, user id: {}", bundleName, currentUser.getId()); }

Target:
public void save(@RequestParam(value = "cdmVersion", defaultValue = "5") float version, @RequestParam(value = "ids") List<Long> idV4s, @RequestParam(value = "name") String bundleName, HttpServletResponse response) throws IOException, PermissionDeniedException { if (notExist(version)) { response.sendError(SC_BAD_REQUEST, "No supported version " + version); return; } if (isEmpty(bundleName)) { response.sendError(SC_BAD_REQUEST, "Name cannot be empty"); return; } AthenaUser currentUser = userService.getCurrentUser(); ENDING licenses are not active boolean noLicence = vocabularyConversionService.getUnavailableVocabularies(currentUser.getId(), false).stream() .map(VocabularyDTO::getId) .map(Long::new) .anyMatch(idV4s::contains); if (noLicence) { throw new PermissionDeniedException("User must have licenses for all vocabularies"); } DownloadBundle bundle = vocabularyService.saveBundle(bundleName, idV4s, currentUser, getByValue(version)); vocabularyService.saveContent(bundle, currentUser); LOGGER.info("Vocabulary saving is started, bundle name: {}, user id: {}", bundleName, currentUser.getId()); }
Source:
private void deleteMarkers(String suffix) throws CoreException { final File localDeploymentDirectory = new File(getDeploymentOptions().getDeploymentsRootFolder(true)); Stream.of(localDeploymentDirectory.listFiles()) .filter(p->p.getName().endsWith(suffix)) .forEach(File::delete); }

Target:
private void deleteMarkers(String suffix) throws CoreException { final File localDeploymentDirectory = new File(getDeploymentOptions().getDeploymentsRootFolder(true)); Stream.of(localDeploymentDirectory.listFiles()) .filter(p->p.getName().endsWith(suffix)) .forEach(p->p.delete()); }
Source:
private BooleanWrapper internalSetFree(final RMNode rmNode) { if (logger.isDebugEnabled()) { logger.debug("Current node state " + rmNode.getState() + " " + rmNode.getNodeURL()); logger.debug("Setting node state to free " + rmNode.getNodeURL()); } if (rmNode.isFree()) { return new BooleanWrapper(true); } final NodeState previousNodeState = rmNode.getState(); Client client = rmNode.getOwner(); if (client == null) { client = rmNode.getProvider(); } rmNode.setFree(); if (!rmNode.isLocked()) { this.freeNodes.add(rmNode); } this.registerAndEmitNodeEvent( rmNode.createNodeEvent( RMEventType.NODE_STATE_CHANGED, previousNodeState, client.getName())); return new BooleanWrapper(true); }

Target:
private BooleanWrapper internalSetFree(final RMNode rmNode) { if (logger.isDebugEnabled()) { logger.debug("Current node state " + rmNode.getState() + " " + rmNode.getNodeURL()); logger.debug("Setting node state to free " + rmNode.getNodeURL()); } if (rmNode.isFree()) { return new BooleanWrapper(true); } final NodeState previousNodeState = rmNode.getState(); Client client = rmNode.getOwner(); if (client == null) { client = rmNode.getProvider(); } rmNode.setFree(); if (!rmNode.isLocked()) { this.eligibleNodes.add(rmNode); } this.registerAndEmitNodeEvent( rmNode.createNodeEvent( RMEventType.NODE_STATE_CHANGED, previousNodeState, client.getName())); return new BooleanWrapper(true); }
Source:
public void getTextTest() throws Exception { String craigsUrl = "<LINK_1>"; iface.go(craigsUrl); String banner = "craigslist"; WebDriverElement bannerDiv = ((WebDriverElement) iface.getWebDriverElement(Strategy.ID, "logo")); WebDriverElement bannerLogo = ((WebDriverElement) bannerDiv.getElement(new Hook(Strategy.TAG, "a"), 0)); String bannerText = bannerLogo.getText(); Assert.assertEquals(bannerText,banner); String meanUrl = "<LINK_3>"; iface.go(meanUrl); String banner1 = "The Friendly"; WebDriverElement bannerElement = ((WebDriverElement) iface.getWebDriverElement(Strategy.CLASS, "banner-top-title")); String bannerElementText = bannerElement.getText(); Assert.assertTrue(bannerElementText.contains(banner1)); String url = "<LINK_2>"; iface.go(url); String actChapterText = iface.getWebDriverElement(Strategy.NAME, "shorttext").getText(); String expChapterText = "Hit Me!"; Assert.assertEquals(expChapterText, actChapterText); url = "<LINK_0>"; iface.go(url); actChapterText = iface.getWebDriverElement(Strategy.XPATH, " expChapterText = "Generic Button"; Assert.assertEquals(expChapterText, actChapterText); }

Target:
public void getTextTest() throws Exception { String craigsUrl = "<LINK_1>"; iface.go(craigsUrl); String banner = "craigslist"; WebDriverElement bannerDiv = iface.getWebDriverElement(Strategy.ID, "logo"); WebDriverElement bannerLogo = ((WebDriverElement) bannerDiv.getElement(new Hook(Strategy.TAG, "a"), 0)); String bannerText = bannerLogo.getText(); Assert.assertEquals(bannerText,banner); String meanUrl = "<LINK_3>"; iface.go(meanUrl); String banner1 = "The Friendly"; WebDriverElement bannerElement = iface.getWebDriverElement(Strategy.CLASS, "banner-top-title"); String bannerElementText = bannerElement.getText(); Assert.assertTrue(bannerElementText.contains(banner1)); String url = "<LINK_2>"; iface.go(url); String actChapterText = iface.getWebDriverElement(Strategy.NAME, "shorttext").getText(); String expChapterText = "Hit Me!"; Assert.assertEquals(expChapterText, actChapterText); url = "<LINK_0>"; iface.go(url); actChapterText = iface.getWebDriverElement(Strategy.XPATH, " expChapterText = "Generic Button"; Assert.assertEquals(expChapterText, actChapterText); }
Source:
private void createManagementNetworkIfRequired(VDS host) { if (host != null) { Network managementNetwork = getNetworkDAO().getByNameAndDataCenter(Config.<String> GetValue(ConfigValues.ManagementNetwork), host.getStoragePoolId()); VdsNetworkInterface nic = findNicForManagementNetwork(host, managementNetwork); if (nic != null) { List<VdsNetworkInterface> interfaces = filterBondsWithoutSlaves(host.getInterfaces()); if (interfaces.contains(nic)) { nic.setNetworkName(managementNetwork.getName()); SetupNetworksParameters parameters = new SetupNetworksParameters(); parameters.setVdsId(host.getId()); parameters.setInterfaces(interfaces); parameters.setCheckConnectivity(true); createAndPersistManagementNetwork(parameters); } else { addCustomValue("InterfaceName", nic.getName()); AuditLogDirector.log(this, AuditLogType.INVALID_INTERFACE_FOR_MANAGEMENT_NETWORK_CONFIGURATION); } } } }

Target:
private void createManagementNetworkIfRequired(VDS host) { if (host != null) { VdsNetworkInterface nic = findNicForManagementNetwork(host); if (nic != null) { List<VdsNetworkInterface> interfaces = filterBondsWithoutSlaves(host.getInterfaces()); if (interfaces.contains(nic)) { nic.setNetworkName(Config.<String> GetValue(ConfigValues.ManagementNetwork)); SetupNetworksParameters parameters = new SetupNetworksParameters(); parameters.setVdsId(host.getId()); parameters.setInterfaces(interfaces); parameters.setCheckConnectivity(true); createAndPersistManagementNetwork(parameters); } else { addCustomValue("InterfaceName", nic.getName()); AuditLogDirector.log(this, AuditLogType.INVALID_INTERFACE_FOR_MANAGEMENT_NETWORK_CONFIGURATION); } } } }
Source:
public Response<BlockBlobItem> uploadWithResponse(InputStream data, long length, BlobHTTPHeaders headers, Metadata metadata, BlobAccessConditions accessConditions, Duration timeout, Context context) throws IOException { Flux<ByteBuffer> fbb = Utility.convertStreamToByteBuffer(data, length, BlockBlobAsyncClient.BLOB_DEFAULT_UPLOAD_BLOCK_SIZE); Mono<Response<BlockBlobItem>> upload = blockBlobAsyncClient .uploadWithResponse(fbb, length, headers, metadata, accessConditions, context); try { return Utility.blockWithOptionalTimeout(upload, timeout); } catch (UncheckedIOException e) { throw e.getCause(); } }

Target:
public Response<BlockBlobItem> uploadWithResponse(InputStream data, long length, BlobHTTPHeaders headers, Metadata metadata, BlobAccessConditions accessConditions, Duration timeout, Context context) throws IOException { Objects.requireNonNull(data); Flux<ByteBuffer> fbb = Utility.convertStreamToByteBuffer(data, length, BlockBlobAsyncClient.BLOB_DEFAULT_UPLOAD_BLOCK_SIZE); Mono<Response<BlockBlobItem>> upload = blockBlobAsyncClient .uploadWithResponse(fbb.subscribeOn(Schedulers.elastic()), length, headers, metadata, accessConditions, context); try { return Utility.blockWithOptionalTimeout(upload, timeout); } catch (UncheckedIOException e) { throw e.getCause(); } }
Source:
public String getShortDescription() { return "Export and Import credentials as XML"; }

Target:
public String getShortDescription() { return "Export credentials as XML. The output of this command can be used as input for \"import-credentials-as-xml\" as is, the only needed change is to set the actual Secrets which are redacted in the output."; }
Source:
private static boolean isBalloonEnabled(VmManagementParametersBase params) { Boolean balloonEnabled = params.isBalloonEnabled(); return balloonEnabled != null ? balloonEnabled : VmDeviceUtils.isBalloonEnabled(params.getVmStaticData().getId()); }

Target:
private static boolean isBalloonEnabled(VmManagementParametersBase params) { Boolean balloonEnabled = params.isBalloonEnabled(); return (balloonEnabled != null) ? balloonEnabled : isBalloonEnabled(params.getVmStaticData().getId()); }
Source:
public List<PlanNode> getSources(PlanNode node) { if (node instanceof RemoteSourceNode) { return ((RemoteSourceNode) node).getSourceFragmentIds().stream() .map(id -> { verify(fragmentMap.containsKey(id), "fragment id not in map"); return fragmentMap.get(id).getRoot(); }) .collect(toImmutableList()); } return node.getSources(); }

Target:
public List<PlanNode> getSources(PlanNode node) { if (node instanceof RemoteSourceNode) { return ((RemoteSourceNode) node).getSourceFragmentIds().stream() .map(id -> { verify(fragments.containsKey(id), "fragment id not in map: %s", id); return fragments.get(id).getRoot(); }) .collect(toImmutableList()); } return node.getSources(); }
Source:
private Folder computeRootFolder(String path) { return rootFolders.computeIfAbsent(path, key -> { Folder newFolder = new Folder(key); return newFolder; }); }

Target:
private Folder computeRootFolder(String path) { return rootFolders.computeIfAbsent(path, Folder::new); }
Source:
private void verifyResource(String v) throws IOException, InterruptedException { Assert.assertThat(v, StringStartsWith.startsWith("jar:file:")); Assert.assertThat(v, StringContains.containsString(dir.toURI().getPath())); Assert.assertThat(v, StringEndsWith.endsWith("::hello")); }

Target:
private void verifyResource(String v) throws IOException, InterruptedException { Assert.assertThat(v, allOf(startsWith("jar:file:"), containsString(dir.toURI().getPath()), endsWith("::hello"))); }
Source:
public ConsoleProperties createConsoleProperties(PerfTest perfTest) { ConsoleProperties consoleProperties = ConsolePropertiesFactory.createEmptyConsoleProperties(); try { removePerftestResultDistributedFolderIfExist(perfTest); consoleProperties.setAndSaveDistributionDirectory(new Directory(getDistributionPath(perfTest))); consoleProperties.setConsoleHost(config.getCurrentIP()); consoleProperties.setIgnoreSampleCount(getSafe(perfTest.getIgnoreSampleCount())); consoleProperties.setSampleInterval(1000 * getSafe(perfTest.getSamplingInterval())); } catch (Exception e) { throw processException("Error while setting console properties", e); } return consoleProperties; }

Target:
public ConsoleProperties createConsoleProperties(PerfTest perfTest) { ConsoleProperties consoleProperties = ConsolePropertiesFactory.createEmptyConsoleProperties(); try { consoleProperties.setAndSaveDistributionDirectory(new Directory(getDistributionPath(perfTest))); consoleProperties.setConsoleHost(config.getCurrentIP()); consoleProperties.setIgnoreSampleCount(getSafe(perfTest.getIgnoreSampleCount())); consoleProperties.setSampleInterval(1000 * getSafe(perfTest.getSamplingInterval())); } catch (Exception e) { throw processException("Error while setting console properties", e); } return consoleProperties; }
Source:
public Builder withModifiedDate(Date modifiedDate) { profileAttributes.modifiedDate = modifiedDate; return this; }

Target:
public Builder withModifiedDate(Date modifiedDate) { profileAttributes.modifiedDate = modifiedDate == null ? new Date() : modifiedDate; return this; }
Source:
public static ClientPrefs getInstance() { assert(sInstance != null); assert(sInstance.getClass().isInstance(ClientPrefs.class)); return (ClientPrefs)sInstance; }

Target:
public static synchronized ClientPrefs getInstance() { assert(sInstance != null); assert(sInstance.getClass().isInstance(ClientPrefs.class)); return (ClientPrefs)sInstance; }
Source:
protected PocketAuthInfo buildInfo(Response r) throws AccessTokenException { String body = r.getBody(); String accessToken = body.substring(body.indexOf("=") + 1, body.indexOf("&")); String userName = body.substring(body.indexOf("=", body.indexOf("=") + 1) + 1); PocketAuthInfo info = new PocketAuthInfo(accessToken, requestToken, userName); return info; }

Target:
protected PocketAuthInfo buildInfo(Response r) throws AccessTokenException { if (r.getStatus() >= 400) { throw new AccessTokenException(r.asJson() .asText()); } else { JsonNode response = r.asJson(); String accessToken = response.get("access_token") .asText(); String userName = response.get("username") .asText(); PocketAuthInfo info = new PocketAuthInfo(accessToken, requestToken, userName); return info; } }
Source:
public void readLac(final BookieSocketAddress addr, final long ledgerId, final ReadLacCallback cb, final Object ctx) { final PerChannelBookieClientPool client = lookupClient(addr); if (client == null) { cb.readLacComplete(getRc(BKException.Code.BookieHandleNotAvailableException), ledgerId, null, null, ctx); return; } client.obtain(new GenericCallback<PerChannelBookieClient>() { @Override public void operationComplete(final int rc, PerChannelBookieClient pcbc) { if (rc != BKException.Code.OK) { try { executor.submitOrdered(ledgerId, new SafeRunnable() { @Override public void safeRun() { cb.readLacComplete(rc, ledgerId, null, null, ctx); } }); } catch (RejectedExecutionException re) { cb.readLacComplete(getRc(BKException.Code.InterruptedException), ledgerId, null, null, ctx); } return; } pcbc.readLac(ledgerId, cb, ctx); } }, ledgerId); }

Target:
public void readLac(final BookieSocketAddress addr, final long ledgerId, final ReadLacCallback cb, final Object ctx) { final PerChannelBookieClientPool client = lookupClient(addr); if (client == null) { cb.readLacComplete(getRc(BKException.Code.BookieHandleNotAvailableException), ledgerId, null, null, ctx); return; } client.obtain((rc, pcbc) -> { if (rc != BKException.Code.OK) { try { executor.submitOrdered(ledgerId, safeRun(() -> { cb.readLacComplete(rc, ledgerId, null, null, ctx); })); } catch (RejectedExecutionException re) { cb.readLacComplete(getRc(BKException.Code.InterruptedException), ledgerId, null, null, ctx); } } else { pcbc.readLac(ledgerId, cb, ctx); } }, ledgerId); }
Source:
public void validateRpd9s1() { if (!isPage("XWiki", "XWikiSyntax") && !isPage("XWiki", "XWikiSyntaxHorizontalLine") && !isPage("XWiki", "XWikiSyntaxTables") && !isPage("XWiki", "XWikiSyntaxLinks") && !isPage("XWiki", "XWikiSyntaxParagraphs") && !isPage("XWiki", "XWikiSyntaxMacros") && !isPage("XWiki", "XWikiSyntaxDefinitionLists") && !isPage("XWiki", "XWikiSyntaxHeadings") && !isPage("XWiki", "XWikiSyntaxLists") && !isPage("XWiki", "XWikiSyntaxParameters") && !isPage("Panels", "PanelWizard") && !isPage("XWiki", "Treeview") && !isPage("Invitation", "WebHome") && !isPage("XWiki", "XWikiSyntaxGroups")) { assertTrue(Type.ERROR, "rpd9s1.attr", getElement(ELEM_BODY).getElementsByAttribute(STYLE).isEmpty()); } assertTrue(Type.ERROR, "rpd9s1.tag", getElement(ELEM_BODY).getElementsByTag(STYLE).isEmpty()); }

Target:
public void validateRpd9s1() { if (!isPage("XWiki", "XWikiSyntax") && !isPage("XWiki", "XWikiSyntaxHorizontalLine") && !isPage("XWiki", "XWikiSyntaxTables") && !isPage("XWiki", "XWikiSyntaxLinks") && !isPage("XWiki", "XWikiSyntaxParagraphs") && !isPage("XWiki", "XWikiSyntaxMacros") && !isPage("XWiki", "XWikiSyntaxDefinitionLists") && !isPage("XWiki", "XWikiSyntaxHeadings") && !isPage("XWiki", "XWikiSyntaxLists") && !isPage("XWiki", "XWikiSyntaxParameters") && !isPage("XWiki", "XWikiSyntaxGroups") && !isPage("XWiki", "Treeview") && !isPage("Panels", "PanelWizard") && !isPage("Invitation", "WebHome")) { assertTrue(Type.ERROR, "rpd9s1.attr", getElement(ELEM_BODY).getElementsByAttribute(STYLE).isEmpty()); } assertTrue(Type.ERROR, "rpd9s1.tag", getElement(ELEM_BODY).getElementsByTag(STYLE).isEmpty()); }
Source:
public void onSuccess(SshPollValue val) { String stdout = val.getStdout(); int jsonStarts = stdout.indexOf('{'); if (jsonStarts > 0) stdout = stdout.substring(jsonStarts); JsonElement jsonElement = new Gson().fromJson(stdout, JsonElement.class); final Iterable<String> prefixes = Lists.newArrayList("", "automatic", "force_override", "override", "normal", "force_default", "default"); for (AttributeSensor attribute : chefAttributeSensors) { if (!attribute.getName().startsWith(CHEF_ATTRIBUTE_PREFIX)) continue; log.debug("Finding value for attribute sensor "+attribute.getName()); Iterable<String> path = Lists.newArrayList(attribute.getName().substring(CHEF_ATTRIBUTE_PREFIX.length()).split("\\.")); JsonElement elementForSensor = null; for(String prefix : prefixes) { Iterable<String> prefixedPath = !Strings.isNullOrEmpty(prefix) ? Iterables.concat(ImmutableList.of(prefix), path) : path; elementForSensor = getElementByPath(jsonElement.getAsJsonObject(), prefixedPath); if (elementForSensor != null) { log.debug("Found a value with attribute "+ Joiner.on('.').join(prefixedPath)); break; } } log.debug("Attribute sensor value is {}", new Object[]{attribute.getName(), elementForSensor}); entity.setAttribute(attribute, elementForSensor != null ? elementForSensor.getAsString() : null); } }

Target:
public void onSuccess(SshPollValue val) { String stdout = val.getStdout(); int jsonStarts = stdout.indexOf('{'); if (jsonStarts > 0) stdout = stdout.substring(jsonStarts); JsonElement jsonElement = new Gson().fromJson(stdout, JsonElement.class); for (Map.Entry<String, AttributeSensor> attribute : chefAttributeSensors.entrySet()) { String chefAttributeName = attribute.getKey(); AttributeSensor sensor = attribute.getValue(); log.trace("Finding value for attribute sensor " + sensor.getName()); Iterable<String> path = SPLITTER.split(chefAttributeName); JsonElement elementForSensor = null; for(String prefix : PREFIXES) { Iterable<String> prefixedPath = !Strings.isNullOrEmpty(prefix) ? Iterables.concat(ImmutableList.of(prefix), path) : path; try { elementForSensor = getElementByPath(jsonElement.getAsJsonObject(), prefixedPath); } catch(IllegalArgumentException e) { log.error("Entity {}: bad Chef attribute for sensor {}: {}", new Object[]{ entity.getDisplayName(), Joiner.on('.').join(prefixedPath), sensor.getName(), e.getMessage()}); throw Throwables.propagate(e); } if (elementForSensor != null) { log.debug("Entity {}: apply Chef attribute to sensor with value {}", new Object[]{ entity.getDisplayName(), Joiner.on('.').join(prefixedPath), sensor.getName(), elementForSensor.getAsString()}); break; } } if (elementForSensor != null) { entity.setAttribute(sensor, TypeCoercions.coerce(elementForSensor.getAsString(), sensor.getType())); } else { log.debug("Entity {}: no Chef attribute matching {}; setting sensor to null", new Object[]{ entity.getDisplayName(), chefAttributeName, sensor.getName()}); entity.setAttribute(sensor, null); } } }
Source:
public synchronized Object getProperty(Object key) { return properties.get(key); }

Target:
public Object getProperty(Object key) { return properties.get(key); }
Source:
private synchronized void onUpdate() { if (bridge != null) { if (pollingJob == null || pollingJob.isCancelled()) { int pollingInterval = DEFAULT_POLLING_INTERVAL; try { pollingInterval = ((BigDecimal) getConfig().get(POLLING_INTERVAL)).intValue(); } catch(NumberFormatException ex) pollingJob = scheduler.scheduleAtFixedRate(pollingRunnable, 1, pollingInterval, TimeUnit.SECONDS); } } }

Target:
private synchronized void onUpdate() { if (bridge != null) { if (pollingJob == null || pollingJob.isCancelled()) { int pollingInterval = DEFAULT_POLLING_INTERVAL; try { Object pollingIntervalConfig = getConfig().get(POLLING_INTERVAL); if (pollingIntervalConfig != null) { pollingInterval = ((BigDecimal) pollingIntervalConfig).intValue(); } else { logger.info("Polling interval not configured for this hue bridge. Using default value: {}s", pollingInterval); } } catch (NumberFormatException ex) { logger.info("Wrong configuration value for polling interval. Using default value: {}s", pollingInterval); } pollingJob = scheduler.scheduleAtFixedRate(pollingRunnable, 1, pollingInterval, TimeUnit.SECONDS); } } }
Source:
private SentMessageDetails sendMessageToNicos(NICOSMessage<?> nicosMessage) { SentMessageDetails response = session.sendMessage(nicosMessage); if (!response.isSent()) { disconnect(); } return response; }

Target:
private SentMessageDetails sendMessageToNicos(NICOSMessage<?> nicosMessage) { SentMessageDetails messageSentMessageDetails = session.sendMessage(nicosMessage); if (!messageSentMessageDetails.isSent()) { disconnect(); } return messageSentMessageDetails; }
Source:
private void dumpChanges() { ArrayList<Object[]> adjustedChanges = getAdjustedTemplateChanges(); for (int i = 0; i < mTemplateChanges.size(); i++) { Object[] change = mTemplateChanges.get(i); Object[] adjustedChange = adjustedChanges.get(i); Timber.d("dumpChanges() Change %s is ord/type %s/%s", i, change[0], change[1]); Timber.d("dumpChanges() During save change %s will be ord/type %s/%s", i, adjustedChange[0], adjustedChange[1]); } }

Target:
private void dumpChanges() { if (!BuildConfig.DEBUG) { return; } ArrayList<Object[]> adjustedChanges = getAdjustedTemplateChanges(); for (int i = 0; i < mTemplateChanges.size(); i++) { Object[] change = mTemplateChanges.get(i); Object[] adjustedChange = adjustedChanges.get(i); Timber.d("dumpChanges() Change %s is ord/type %s/%s", i, change[0], change[1]); Timber.d("dumpChanges() During save change %s will be ord/type %s/%s", i, adjustedChange[0], adjustedChange[1]); } }
Source:
public void stateChanged(CuratorFramework client, ConnectionState newState) { if (newState.equals(ConnectionState.RECONNECTED)) { LOG.info("Reconnected to zookeeper, checking if configs are still in sync"); Optional<String> maybeLastReuqestForGroup = loadBalancerDatastore.getLastRequestForGroup(configuration.getLoadBalancerConfiguration().getName()); if (!maybeLastReuqestForGroup.isPresent() || !maybeLastReuqestForGroup.get().equals(mostRecentRequestId.get())) { reapplyConfigsWithRetry(); } } }

Target:
public void stateChanged(CuratorFramework client, ConnectionState newState) { if (newState == ConnectionState.RECONNECTED) { LOG.info("Reconnected to zookeeper, checking if configs are still in sync"); Optional<String> maybeLastRequestForGroup = loadBalancerDatastore.getLastRequestForGroup(configuration.getLoadBalancerConfiguration().getName()); if (!maybeLastRequestForGroup.isPresent() || !maybeLastRequestForGroup.get().equals(mostRecentRequestId.get())) { reapplyConfigsWithRetry(); } } }
Source:
public static ByteString bitAnd(ByteString b0, ByteString b1) { if (b0.length() != b1.length()) { throw RESOURCE.invalidInputForBitwiseBinaryValue().ex(); } byte[] bytes0 = b0.getBytes(); byte[] bytes1 = b1.getBytes(); byte[] result = new byte[b0.length()]; IntStream.range(0, bytes0.length).forEach(i -> { result[i] = (byte) (bytes0[i] & bytes1[i]); }); return new ByteString(result); }

Target:
public static ByteString bitAnd(ByteString b0, ByteString b1) { return binaryOperator(b0, b1, (x, y) -> (byte) (x & y)); }
Source:
public Channel createChannel(String id) throws Exception { JGroupsLogger.ROOT_LOGGER.debugf("Creating fork channel %s from channel %s", id, this.channel.getClusterName()); String stackName = this.protocols.isEmpty() ? this.channel.getClusterName() : id; List<Protocol> list = new ArrayList<>(); for (ProtocolConfiguration<? extends Protocol> pc : this.protocols) { Protocol pcProtocol = pc.createProtocol(this.parentFactory.getProtocolStackConfiguration()); list.add(pcProtocol); } return new ForkChannel(this.channel, stackName, id, list.toArray(new Protocol[0])); }

Target:
public Channel createChannel(String id) throws Exception { JGroupsLogger.ROOT_LOGGER.debugf("Creating fork channel %s from channel %s", id, this.channel.getClusterName()); final List<ProtocolConfiguration<? extends Protocol>> protocols = this.protocols; String stackName = protocols.isEmpty() ? this.channel.getClusterName() : id; Protocol[] array = new Protocol[protocols.size()]; for (int i = 0; i < protocols.size(); i++) { array[i] = protocols.get(i).createProtocol(this.parentFactory.getProtocolStackConfiguration()); } return new ForkChannel(this.channel, stackName, id, array); }
Source:
private void assertArea(String wkt, double expectedArea) { assertFunctionImprecise(format("ST_Area(to_spherical_geography(ST_GeometryFromText('%s')))", wkt), expectedArea, 1e-4); }

Target:
private void assertArea(String wkt, double expectedArea) { assertFunction(format("ABS(ROUND((ST_Area(to_spherical_geography(ST_GeometryFromText('%s'))) / %f - 1 ) * %d, 0))", wkt, expectedArea, 10000), DOUBLE, 0.0); }
Source:
public void testCreateAccountWithExternalKeyOverLimit() throws Exception { AccountModelDao accountModelDao = createTestAccount(); accountModelDao.setExternalKey("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis,."); final AccountData accountData = new DefaultAccount(accountModelDao); try { accountUserApi.createAccount(accountData, callContext); } catch (final AccountApiException e) { assertEquals(e.getCode(), ErrorCode.EXTERNAL_KEY_LIMIT_EXCEEDED.getCode()); } }

Target:
public void testCreateAccountWithExternalKeyOverLimit() throws Exception { AccountModelDao accountModelDao = createTestAccount(); accountModelDao.setExternalKey("Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis,."); final AccountData accountData = new DefaultAccount(accountModelDao); try { accountUserApi.createAccount(accountData, callContext); Assert.fail(); } catch (final AccountApiException e) { assertEquals(e.getCode(), ErrorCode.EXTERNAL_KEY_LIMIT_EXCEEDED.getCode()); } }
Source:
private void loadRevision() { AnalyticsTracker.track(Stat.REVISIONS_REVISION_LOADED); showDialogProgress(true); mPostForUndo = mPost.clone(); mPost.setTitle(mRevision.getPostTitle()); mPost.setContent(mRevision.getPostContent()); mPost.setIsLocallyChanged(true); mPost.setDateLocallyChanged(DateTimeUtils.iso8601FromTimestamp(System.currentTimeMillis() / 1000)); refreshEditorContent(); Snackbar.make(mViewPager, getString(R.string.history_loaded_revision), AccessibilityUtils.getSnackbarDuration(EditPostActivity.this, 4000)) .setAction(getString(R.string.undo), new OnClickListener() { @Override public void onClick(View view) { AnalyticsTracker.track(Stat.REVISIONS_LOAD_UNDONE); RemotePostPayload payload = new RemotePostPayload(mPostForUndo, mSite); mDispatcher.dispatch(PostActionBuilder.newFetchPostAction(payload)); mPost = mPostForUndo.clone(); refreshEditorContent(); } }) .show(); showDialogProgress(false); }

Target:
private void loadRevision() { showDialogProgress(true); mPostForUndo = mPost.clone(); mPost.setTitle(mRevision.getPostTitle()); mPost.setContent(mRevision.getPostContent()); mPost.setIsLocallyChanged(true); mPost.setDateLocallyChanged(DateTimeUtils.iso8601FromTimestamp(System.currentTimeMillis() / 1000)); refreshEditorContent(); Snackbar.make(mViewPager, getString(R.string.history_loaded_revision), AccessibilityUtils.getSnackbarDuration(EditPostActivity.this, 4000)) .setAction(getString(R.string.undo), new OnClickListener() { @Override public void onClick(View view) { AnalyticsTracker.track(Stat.REVISIONS_LOAD_UNDONE); RemotePostPayload payload = new RemotePostPayload(mPostForUndo, mSite); mDispatcher.dispatch(PostActionBuilder.newFetchPostAction(payload)); mPost = mPostForUndo.clone(); refreshEditorContent(); } }) .show(); showDialogProgress(false); }
Source:
public void testCountByChromosomeAndStartAndTypeAndStudy() { List<String> studies = new ArrayList<>(); studies.add("PRJX00001"); Long count = variantEntityRepository.countByChromosomeAndStartAndTypeAndStudyIn("11", 180077, Variant.VariantType.INDEL, studies); assertEquals(new Long(1), count); }

Target:
public void testCountByChromosomeAndStartAndTypeAndStudy() { List<String> studies = new ArrayList<>(); studies.add("PRJX00001"); Long count = (long) variantEntityRepository.findByChromosomeAndStartAndTypeAndStudyIn("11", 180077, Variant.VariantType.INDEL, studies) .size(); assertEquals(new Long(1), count); }
Source:
protected void executeCommand() { getParameters().setEntityInfo(new EntityInfo(VdcObjectType.Disk, getParameters().getImageList().stream().findFirst().get())); List<Guid> failedGuids = getFailedVolumeIds(); if (failedGuids.isEmpty()) { log.info("Requested images were successfully removed"); setSucceeded(true); persistCommand(getParameters().getParentCommand()); } else { log.error("The following images were not removed: {}", failedGuids); } }

Target:
protected void executeCommand() { getParameters().setEntityInfo(new EntityInfo(VdcObjectType.Disk, getParameters().getImageGroupId())); List<Guid> failedGuids = getFailedVolumeIds(); if (failedGuids.isEmpty()) { log.info("Requested images were successfully removed"); setSucceeded(true); persistCommand(getParameters().getParentCommand()); } else { log.error("The following images were not removed: {}", failedGuids); } }
Source:
private void writeNetworkInterfaceMetadata() { vnicMetadata.forEach((mac, data) -> { writer.writeStartElement(OVIRT_VM_URI, "device"); writer.writeAttributeString("mac_address", mac); List<String> portMirroring = (List<String>) data.get("portMirroring"); if (portMirroring != null) { writer.writeStartElement(OVIRT_VM_URI, "portMirroring"); portMirroring.forEach(network -> writer.writeElement(OVIRT_VM_URI, "network", network)); writer.writeEndElement(); } writer.writeEndElement(); }); }

Target:
private void writeNetworkInterfaceMetadata() { vnicMetadata.forEach((mac, data) -> { writer.writeStartElement("device"); writer.writeAttributeString("mac_address", mac); List<String> portMirroring = (List<String>) data.get("portMirroring"); if (portMirroring != null) { writer.writeStartElement("portMirroring"); portMirroring.forEach(network -> writer.writeElement("network", network)); writer.writeEndElement(); } writer.writeEndElement(); }); }
Source:
public void clearDataTable() { getDatabaseService().runPreparedUpdate(getConnection(), "DELETE FROM " + getMetaData().getTableName() + " WHERE NOT branch_type = ?", BranchType.SYSTEM_ROOT); }

Target:
public void clearDataTable() { getDatabaseService().runPreparedUpdate(getConnection(), String.format("DELETE FROM %s where NOT branch_type = ?", getMetaData().getTableName()), BranchType.SYSTEM_ROOT); }
Source:
public void showStoragePermissionRevokedNotification() { Intent intent = new Intent(mContext, FirstStartActivity.class); Notification n = getNotificationBuilder(mInfoChannel) .setContentTitle(mContext.getString(R.string.syncthing_terminated)) .setContentText(mContext.getString(R.string.toast_write_storage_permission_required)) .setSmallIcon(R.drawable.ic_stat_notify) .setContentIntent(PendingIntent.getActivity(mContext, 0, intent, 0)) .setAutoCancel(true) .setOnlyAlertOnce(true) .build(); mNotificationManager.notify(ID_MISSINGPERM, n); }

Target:
public void showStoragePermissionRevokedNotification() { Intent intent = new Intent(mContext, FirstStartActivity.class); Notification n = getNotificationBuilder(mInfoChannel) .setContentTitle(mContext.getString(R.string.syncthing_terminated)) .setContentText(mContext.getString(R.string.toast_write_storage_permission_required)) .setSmallIcon(R.drawable.ic_stat_notify) .setContentIntent(PendingIntent.getActivity(mContext, 0, intent, 0)) .setAutoCancel(true) .setOnlyAlertOnce(true) .build(); mNotificationManager.notify(ID_MISSING_PERM, n); }
Source:
public static void initialize() { assumeTrue(testTrace.exists()); stateFile = new File(TmfTraceManager.getSupplementaryFileDir(testTrace.getTrace()) + TEST_FILE_NAME); TestLttngKernelAnalysisModule module = new TestLttngKernelAnalysisModule(TEST_FILE_NAME); try { module.setTrace(testTrace.getTrace()); } catch (TmfAnalysisException e) { fail(); } module.schedule(); assertTrue(module.waitForCompletion(new NullProgressMonitor())); ssq = module.getStateSystem(); assertNotNull(ssq); }

Target:
public static void initialize() { assumeTrue(testTrace.exists()); try { stateFile = File.createTempFile("test-partial", ".ht"); input = new LttngKernelStateProvider(testTrace.getTrace()); ssq = TmfStateSystemFactory.newPartialHistory(stateFile, input, true); } catch (IOException e) { fail(); } catch (TmfTraceException e) { fail(); } }
Source:
private static void speedUpDcoumentBuilderFactory() { String className = System.getProperty(DOCUMENT_BUILDER_FACTORY_PROP_NAME); if (className == null) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); if (DOCUMENT_BUILDER_FACTORY_IMPL_CLASS_NAME.equals(factory.getClass().getName())) { System.setProperty(DOCUMENT_BUILDER_FACTORY_PROP_NAME, DOCUMENT_BUILDER_FACTORY_IMPL_CLASS_NAME); } } }

Target:
private static void speedUpDcoumentBuilderFactory() { if (System.getProperty(DOCUMENT_BUILDER_FACTORY_PROP_NAME) == null) { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); if (DOCUMENT_BUILDER_FACTORY_IMPL_CLASS_NAME.equals(factory.getClass().getName())) { System.setProperty(DOCUMENT_BUILDER_FACTORY_PROP_NAME, DOCUMENT_BUILDER_FACTORY_IMPL_CLASS_NAME); } } }
Source:
public void generateSpreadsheet(HttpServletResponse response, String filename) { Set<Attends> attends = executionCourse.getAttendsSet(); final SpreadsheetBuilder builder = new SpreadsheetBuilder(); builder.addSheet(executionCourse.getPrettyAcronym().concat("Attends"), new SheetData<Attends>(attends) { protected String getLabel(final String key) { return BundleUtil.getString(Bundle.APPLICATION, key); } @Override protected void makeLine(final Attends attends) { addCell(getLabel("label.username"), attends.getRegistration().getPerson().getUsername()); addCell(getLabel("label.number"), attends.getRegistration().getNumber()); addCell(getLabel("label.name"), attends.getRegistration().getPerson().getPresentationName()); addCell(getLabel("label.Degree"), attends.getStudentCurricularPlanFromAttends().getDegreeCurricularPlan() .getPresentationName()); addCell(getLabel("label.attends.enrollmentState"), BundleUtil.getString(Bundle.ENUMERATION, attends.getAttendsStateType().getQualifiedName())); executionCourse.getAssociatedEvaluationsSet().forEach( ev -> addCell( ev.getPresentationName(), attends.getAssociatedMarksSet().stream().filter(mark -> mark.getEvaluation() == ev) .map(Mark::getMark).findAny().orElse(""))); } }); try { builder.build(WorkbookExportFormat.EXCEL, response.getOutputStream()); response.setHeader("Content-disposition", "attachment; filename=" + filename); response.setContentType("application/vnd.ms-excel"); response.flushBuffer(); } catch (IOException e) { e.printStackTrace(); } }

Target:
public void generateSpreadsheet(HttpServletResponse response, String filename) throws IOException { Set<Attends> attends = executionCourse.getAttendsSet(); final SpreadsheetBuilder builder = new SpreadsheetBuilder(); builder.addSheet(executionCourse.getPrettyAcronym().concat("Attends"), new SheetData<Attends>(attends) { protected String getLabel(final String key) { return BundleUtil.getString(Bundle.APPLICATION, key); } @Override protected void makeLine(final Attends attends) { addCell(getLabel("label.username"), attends.getRegistration().getPerson().getUsername()); addCell(getLabel("label.number"), attends.getRegistration().getNumber()); addCell(getLabel("label.name"), attends.getRegistration().getPerson().getPresentationName()); addCell(getLabel("label.Degree"), attends.getStudentCurricularPlanFromAttends().getDegreeCurricularPlan() .getPresentationName()); addCell(getLabel("label.attends.enrollmentState"), BundleUtil.getString(Bundle.ENUMERATION, attends.getAttendsStateType().getQualifiedName())); executionCourse.getAssociatedEvaluationsSet().forEach( ev -> addCell( ev.getPresentationName(), attends.getAssociatedMarksSet().stream().filter(mark -> mark.getEvaluation() == ev) .map(Mark::getMark).findAny().orElse(""))); } }); builder.build(WorkbookExportFormat.EXCEL, response.getOutputStream()); response.setHeader("Content-disposition", "attachment; filename=" + filename); response.setContentType("application/vnd.ms-excel"); response.flushBuffer(); }
Source:
public boolean supports(int capability) { if (mBridge != null) { if (mBridge.getApiLevel() > 12) { return mBridge.getFeatures().contains(capability); } else { return capability < 14 && mBridge.getCapabilities().contains(Capability.values()[capability]); } } if (mLegacyBridge != null) { if (capability == Features.UNBOUND_RENDERING) { return getLegacyApiLevel() == 4; } } return false; }

Target:
public boolean supports(int capability) { if (mBridge != null) { if (mBridge.getApiLevel() > 12) { return mBridge.supports(capability); } else { return capability <= Features.SIMULATE_PLATFORM && mBridge.getCapabilities().contains(Capability.values()[capability]); } } if (mLegacyBridge != null) { if (capability == Features.UNBOUND_RENDERING) { return getLegacyApiLevel() == 4; } } return false; }
Source:
private ICPPClassType getFirstCandidateForNamingClass(IASTName name) throws DOMException { LookupData data = new LookupData(name); isUnqualifiedLookup= !data.qualified; ICPPScope scope = CPPSemantics.getLookupScope(name); while (scope != null && !(scope instanceof ICPPClassScope)) { if (scope instanceof ICPPInternalUnknownScope) { IType scopeType = ((ICPPInternalUnknownScope) scope).getScopeType(); if (scopeType instanceof ICPPDeferredClassInstance) { return ((ICPPDeferredClassInstance) scopeType).getClassTemplate(); } if (scopeType instanceof ICPPUnknownMemberClass && isPrefixLookup) { scopeType = HeuristicResolver.resolveUnknownType((ICPPUnknownMemberClass) scopeType, name.getParent()); if (scopeType instanceof ICPPClassType) { return (ICPPClassType) scopeType; } } break; } scope = CPPSemantics.getParentScope(scope, data.getTranslationUnit()); } if (scope instanceof ICPPClassScope) { return ((ICPPClassScope) scope).getClassType(); } return null; }

Target:
private ICPPClassType getFirstCandidateForNamingClass(IASTName name) throws DOMException { LookupData data = new LookupData(name); isUnqualifiedLookup= !data.qualified; ICPPScope scope = CPPSemantics.getLookupScope(name); while (scope != null && !(scope instanceof ICPPClassScope)) { if (scope instanceof ICPPInternalUnknownScope) { IType scopeType = ((ICPPInternalUnknownScope) scope).getScopeType(); if (scopeType instanceof ICPPDeferredClassInstance) { return ((ICPPDeferredClassInstance) scopeType).getClassTemplate(); } if (scopeType instanceof ICPPUnknownMemberClass && isPrefixLookup) { scopeType = HeuristicResolver.resolveUnknownType((ICPPUnknownMemberClass) scopeType, name.getParent()); if (scopeType instanceof ICPPClassType) { return (ICPPClassType) scopeType; } } } scope = CPPSemantics.getParentScope(scope, data.getTranslationUnit()); } if (scope instanceof ICPPClassScope) { return ((ICPPClassScope) scope).getClassType(); } return null; }
Source:
public JSONArray toFlatJson(String[] selectedResults) { JSONArray results = new JSONArray(); if (selectedResults == null || selectedResults.length == 0) { for (HashMap.Entry<String, MetricInfo> entry : metrics.entrySet()) { MetricInfo metric = entry.getValue(); if (metric.metric == null) { continue; } JSONObject obj = serializeMetric(metric, true); results.put(obj); } } else { for (int i = 0; i < selectedResults.length; i++) { MetricInfo metric = metrics.get(selectedResults[i]); if (metric == null || metric.metric == null) { continue; } JSONObject obj = serializeMetric(metric,true); results.put(obj); } } return results; }

Target:
public JSONArray toFlatJson(String[] selectedResults) { JSONArray results = new JSONArray(); if (selectedResults == null || selectedResults.length == 0) { for (HashMap.Entry<String, MetricInfo> entry : metrics.entrySet()) { MetricInfo metricInfo = entry.getValue(); if (metricInfo == null || metricInfo.metric == null) { continue; } JSONObject obj = serializeMetric(metricInfo, true); results.put(obj); } } else { for (int i = 0; i < selectedResults.length; i++) { MetricInfo metricInfo = metrics.get(selectedResults[i]); if (metricInfo == null || metricInfo.metric == null) { continue; } JSONObject obj = serializeMetric(metricInfo,true); results.put(obj); } } return results; }
Source:
public Void perform(TaskActionToolbox toolbox) { final List<TaskLock> taskLocks = toolbox.getTaskLockbox().findLocksForTask(task); for(final DataSegment segment : segments) { final boolean ok = Iterables.any( taskLocks, new Predicate<TaskLock>() { @Override public boolean apply(TaskLock taskLock) { return taskLock.getVersion().equals(segment.getVersion()) && taskLock.getDataSource().equals(segment.getDataSource()) && taskLock.getInterval().contains(segment.getInterval()); } } ); if(!ok) { throw new ISE("No currently-held lock covers segment: %s", segment); } } try { toolbox.getMergerDBCoordinator().announceHistoricalSegments(segments); final ServiceMetricEvent.Builder metricBuilder = new ServiceMetricEvent.Builder() .setUser2(task.getDataSource()) .setUser4(task.getType()); for (DataSegment segment : segments) { metricBuilder.setUser5(segment.getInterval().toString()); toolbox.getEmitter().emit(metricBuilder.build("indexer/segment/bytes", segment.getSize())); } return null; } catch (Exception e) { throw Throwables.propagate(e); } }

Target:
public Void perform(TaskActionToolbox toolbox) { if(!toolbox.taskLockCoversSegments(task, segments, false)) { throw new ISE("Segments not covered by locks for task: %s", task.getId()); } try { toolbox.getMergerDBCoordinator().announceHistoricalSegments(segments); final ServiceMetricEvent.Builder metricBuilder = new ServiceMetricEvent.Builder() .setUser2(task.getDataSource()) .setUser4(task.getType()); for (DataSegment segment : segments) { metricBuilder.setUser5(segment.getInterval().toString()); toolbox.getEmitter().emit(metricBuilder.build("indexer/segment/bytes", segment.getSize())); } return null; } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
public void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); FeedbackSessionAttributes feedbackSession = getFeedbackSession(feedbackSessionName, courseId); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.getId()); gateKeeper.verifyAccessible(instructor, feedbackSession, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); }

Target:
public void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.getId()); FeedbackSessionAttributes feedbackSession = getNonNullFeedbackSession(feedbackSessionName, courseId); gateKeeper.verifyAccessible(instructor, feedbackSession, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); }
Source:
public synchronized void syncTask(Host host, Task task){ if (host == null){ host = getActiveHost(); log.warn("host is null, task will be sync by any active host {}", task.getName(), host.getName()); } try { host.getRunningTasks().put(task.getId(), task); log.debug("sync task:{} to host:{}", task.getName(), host.getName()); TaskProcessor.setTasksMap(host.getName(), task.getId()); }catch (Exception e){ log.error("something went wrong durring task sync {}", e); } }

Target:
public synchronized void syncTask(Host host, Task task){ if (host == null){ host = getActiveHost(); log.debug("host is null, task will be sync by any active host {}", task.getName(), host.getName()); } try { host.getRunningTasks().put(task.getId(), task); log.debug("sync task:{} to host:{}", task.getName(), host.getName()); TaskProcessor.setTasksMap(host.getName(), task.getId()); }catch (Exception e){ log.error("something went wrong durring task sync {}", e); } }
Source:
public void dispatchEvent(final Object sink, final IEvent<?> event, final Component component) { AnnotationEventSink eventSink = eventSinkByClass.get(sink.getClass()); AnnotationEventDispatcherConfig config = Application.get().getMetaData( Initializer.ANNOTATION_EVENT_DISPATCHER_CONFIG_CONTEXT_KEY); if (eventSink != null && eventSink != EMPTY_SINK && (config.getEventFilter() == null || config.getEventFilter().isAssignableFrom( event.getPayload().getClass())) && (config.isDispatchToNonVisibleComponents() || isVisible(sink))) { eventSink.onEvent(sink, event); } }

Target:
public void dispatchEvent(final Object sink, final IEvent<?> event, final Component component) { AnnotationEventSink eventSink = eventSinkByClass.get(sink.getClass()); AnnotationEventDispatcherConfig config = Application.get().getMetaData( Initializer.ANNOTATION_EVENT_DISPATCHER_CONFIG_CONTEXT_KEY); if (eventSink != null && eventSink != EMPTY_SINK && (config.getEventFilter() == null || config.getEventFilter().isAssignableFrom( event.getPayload().getClass()))) { eventSink.onEvent(sink, event); } }
Source:
public Configuration getConfiguration(GraphContext context) { return ConfigurationBuilder.begin() .addRule() .when(Query.fromType(WindupConfigurationModel.class).withProperty(WindupConfigurationModel.CSV_MODE,true) .and(Query.fromType(ClassificationModel.class).as("classifications") .and(Query.fromType(InlineHintModel.class).as("hints") .and(Query.fromType(ProjectModel.class).as("projects"))))) .perform( Iteration.over(Iteration.DEFAULT_VARIABLE_LIST_STRING).perform( new ExportCSVReportOperation()).endIteration()); }

Target:
public Configuration getConfiguration(GraphContext context) { return ConfigurationBuilder.begin() .addRule() .when(Query.fromType(WindupConfigurationModel.class).withProperty(WindupConfigurationModel.CSV_MODE,true)) .perform( Iteration.over(Iteration.DEFAULT_VARIABLE_LIST_STRING).perform( new ExportCSVReportOperation()).endIteration()); }
Source:
public long getFrom( TemporalAccessor temporal ) { throw new UnsupportedTemporalTypeException( "We don't support anything." ); }

Target:
public long getFrom( TemporalAccessor temporal ) { throw new UnsupportedOperationException( "Getting a " + this.name + " from temporal values is not supported." ); }