auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public VFSResourceLoader(final String rootName, final VirtualFile root, final boolean usePhysicalCodeSource) throws IOException { final SecurityManager sm = System.getSecurityManager(); final boolean checking = WildFlySecurityManager.isChecking(); if (checking) { sm.checkPermission(new VirtualFilePermission(root.getPathName(), "read")); } this.root = root; this.rootName = rootName; try { manifest = checking ? doPrivileged(new PrivilegedExceptionAction<Manifest>() { public Manifest run() throws IOException { return VFSUtils.getManifest(root); } }) : VFSUtils.getManifest(root); } catch (PrivilegedActionException pe) { try { throw pe.getException(); } catch (IOException | RuntimeException e) { throw e; } catch (Exception e) { throw new UndeclaredThrowableException(e); } } multiRelease = manifest != null && manifest.getMainAttributes().containsKey("Multi-Release"); rootUrl = usePhysicalCodeSource ? VFSUtils.getRootURL(root) : root.asFileURL(); }

Target:
public VFSResourceLoader(final String rootName, final VirtualFile root, final boolean usePhysicalCodeSource) throws IOException { final SecurityManager sm = System.getSecurityManager(); final boolean checking = WildFlySecurityManager.isChecking(); if (checking) { sm.checkPermission(new VirtualFilePermission(root.getPathName(), "read")); } this.root = root; this.rootName = rootName; try { manifest = checking ? doPrivileged(new PrivilegedExceptionAction<Manifest>() { public Manifest run() throws IOException { return VFSUtils.getManifest(root); } }) : VFSUtils.getManifest(root); } catch (PrivilegedActionException pe) { try { throw pe.getException(); } catch (IOException | RuntimeException e) { throw e; } catch (Exception e) { throw new UndeclaredThrowableException(e); } } multiRelease = manifest != null && manifest.getMainAttributes().containsKey(MULTI_RELEASE_NAME); rootUrl = usePhysicalCodeSource ? VFSUtils.getRootURL(root) : root.asFileURL(); }
Source:
public IdentityProvider getIdPByName(String idPName) throws IdentityProviderManagementException { if (StringUtils.isEmpty(idPName)) { throw new IllegalArgumentException("Provided IdP name is empty"); } String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); return IdentityProviderManager.getInstance().getIdPByName(idPName, tenantDomain, true); }

Target:
public IdentityProvider getIdPByName(String idPName) throws IdentityProviderManagementException { if (StringUtils.isBlank(idPName)) { throw new IllegalArgumentException("Provided IdP name is empty"); } String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); return IdentityProviderManager.getInstance().getIdPByName(idPName, tenantDomain, true); }
Source:
public void setPendingRequestEntity() { while (lastStatus == TestEnvironmentStatus.RUNNING && !runningStatusSent) { try { TimeUnit.MILLISECONDS.sleep(100); } catch (InterruptedException e) { LOGGER.error("Error occurred while sleeping", e); } } this.requestEntity = buildPendingRequestEntity(); setLastStatus(TestEnvironmentStatus.PENDING); }

Target:
public void setPendingRequestEntity() { ENDING status until RUNNING status is sent in cases when load scenario lasts less while (standBy && lastStatus == TestEnvironmentStatus.RUNNING && !runningStatusSent) { try { TimeUnit.MILLISECONDS.sleep(100); } catch (InterruptedException e) { LOGGER.error("Error occurred while sleeping", e); standBy = false; } } this.requestEntity = buildPendingRequestEntity(); setLastStatus(TestEnvironmentStatus.PENDING); }
Source:
Request build() throws UnsupportedEncodingException { String apiUrl = this.apiUrl; StringBuilder url = new StringBuilder(apiUrl); if (apiUrl.endsWith("/")) { url.deleteCharAt(url.length() - 1); } url.append(buildRelativeUrl()); if (methodInfo.hasQueryParams) { boolean first = true; String requestQuery = methodInfo.requestQuery; if (requestQuery != null) { url.append(requestQuery); first = false; } String[] requestQueryName = methodInfo.requestQueryName; for (int i = 0; i < requestQueryName.length; i++) { String query = requestQueryName[i]; if (query != null) { String value = URLEncoder.encode(String.valueOf(args[i]), "UTF-8"); url.append(first ? '?' : '&').append(query).append('=').append(value); first = false; } } } List<retrofit.http.client.Header> headers = new ArrayList<retrofit.http.client.Header>(); if (this.headers != null) { headers.addAll(this.headers); } if (methodInfo.headers != null) { headers.addAll(methodInfo.headers); } List<String> lcHeadersToRemove = new ArrayList<String>(); if (methodInfo.requestParamHeader != null) { for (int i = 0; i < methodInfo.requestParamHeader.length; i++) { String name = methodInfo.requestParamHeader[i]; if (name == null) continue; Object arg = args[i]; if (arg != null) { headers.add(new retrofit.http.client.Header(name, arg.toString())); } else { lcHeadersToRemove.add(name.toLowerCase()); } } } for (Iterator<retrofit.http.client.Header> header = headers.iterator(); header.hasNext();) { if (lcHeadersToRemove.contains(header.next().getName().toLowerCase())) header.remove(); } return new Request(methodInfo.requestMethod, url.toString(), headers, buildBody()); }

Target:
Request build() throws UnsupportedEncodingException { String apiUrl = this.apiUrl; StringBuilder url = new StringBuilder(apiUrl); if (apiUrl.endsWith("/")) { url.deleteCharAt(url.length() - 1); } url.append(buildRelativeUrl()); if (methodInfo.hasQueryParams) { boolean first = true; String requestQuery = methodInfo.requestQuery; if (requestQuery != null) { url.append(requestQuery); first = false; } String[] requestQueryName = methodInfo.requestQueryName; for (int i = 0; i < requestQueryName.length; i++) { String query = requestQueryName[i]; if (query != null) { String value = URLEncoder.encode(String.valueOf(args[i]), "UTF-8"); url.append(first ? '?' : '&').append(query).append('=').append(value); first = false; } } } List<retrofit.http.client.Header> headers = new ArrayList<retrofit.http.client.Header>(); if (this.headers != null) { headers.addAll(this.headers); } List<Header> methodHeaders = methodInfo.headers; if (methodHeaders != null) { headers.addAll(methodHeaders); } String[] requestParamHeader = methodInfo.requestParamHeader; if (requestParamHeader != null) { for (int i = 0; i < requestParamHeader.length; i++) { String name = requestParamHeader[i]; if (name == null) continue; Object arg = args[i]; if (arg != null) { headers.add(new retrofit.http.client.Header(name, String.valueOf(arg))); } } } return new Request(methodInfo.requestMethod, url.toString(), headers, buildBody()); }
Source:
default Set<ContainerModel> group(Set<TaskModel> tasks, List<Integer> containersIds) { return null; }

Target:
default Set<ContainerModel> group(Set<TaskModel> tasks, List<Integer> containersIds) { return group(tasks); }
Source:
public String login(ModelMap model) throws QuadrigaStorageException { logger.info("Inside Login: GET request"); List<IProject> projectList = retrieveProjectManager.getProjectListByAccessibility(EProjectAccessibility.PUBLIC); Collections.sort(projectList, new Comparator<IProject>() { @Override public int compare(IProject o1, IProject o2) { return o1.getUpdatedDate().compareTo(o2.getUpdatedDate()); } }); int size = projectList.size() > 4 ? 4 : projectList.size(); model.addAttribute("latestProjects", projectList.subList(0, size)); return "login"; }

Target:
public String login(ModelMap model) throws QuadrigaStorageException { List<IProject> projectList = retrieveProjectManager.getProjectListByAccessibility(EProjectAccessibility.PUBLIC); Collections.sort(projectList, new Comparator<IProject>() { @Override public int compare(IProject o1, IProject o2) { return o1.getUpdatedDate().compareTo(o2.getUpdatedDate()); } }); int size = projectList.size() > 4 ? 4 : projectList.size(); model.addAttribute("latestProjects", projectList.subList(0, size)); return "login"; }
Source:
public void fillWithInvalidAddress() throws Throwable { SyncUtil.runToLocation("MemoryTestApp.cc:zeroBlocks"); SyncUtil.step(StepType.STEP_RETURN); long offset = 0; int count = 1; byte[] pattern = ByteBuffer.allocate(count * fWordSize).put(valueToBytes(count)).array(); fBaseAddress = new Addr64("0"); String expectedStr1 = "Cannot access memory at address"; String expectedStr2 = "Could not write memory"; expectedException.expect(ExecutionException.class); expectedException.expectMessage(CoreMatchers.anyOf( CoreMatchers.containsString(expectedStr1), CoreMatchers.containsString(expectedStr2))); try { SyncUtil.fillMemory(fMemoryDmc, fBaseAddress, offset, fWordSize, count, pattern); } finally { assertEquals("MemoryChangedEvent problem: expected 0 events", 0, getEventCount()); } }

Target:
public void fillWithInvalidAddress() throws Throwable { SyncUtil.runToLocation("MemoryTestApp.cc:zeroBlocks"); SyncUtil.step(StepType.STEP_RETURN); long offset = 0; int count = 1; byte[] pattern = valueToBytes(1); fBaseAddress = new Addr64("0"); String expectedStr1 = "Cannot access memory at address"; String expectedStr2 = "Could not write memory"; expectedException.expect(ExecutionException.class); expectedException.expectMessage(CoreMatchers.anyOf( CoreMatchers.containsString(expectedStr1), CoreMatchers.containsString(expectedStr2))); try { SyncUtil.fillMemory(fMemoryDmc, fBaseAddress, offset, fWordSize, count, pattern); } finally { assertEquals("MemoryChangedEvent problem: expected 0 events", 0, getEventCount()); } }
Source:
private void replyToComment() { if (mNote == null) { return; } AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATION_QUICK_ACTIONS_REPLIED_TO); if (!TextUtils.isEmpty(mReplyText)) { SiteModel site = mSiteStore.getSiteBySiteId(mNote.getSiteId()); if (site == null) { AppLog.e(T.NOTIFS, "Impossible to reply a comment on a site that is not in the App. SiteId: " + mNote.getSiteId()); requestFailed(ARG_ACTION_APPROVE); return; } CommentModel comment = mNote.buildComment(); CommentModel reply = new CommentModel(); reply.setContent(mReplyText); RemoteCreateCommentPayload payload = new RemoteCreateCommentPayload(site, comment, reply); mDispatcher.dispatch(CommentActionBuilder.newCreateNewCommentAction(payload)); } else { dismissNotification(mPushId); hideStatusBar(); startReplyToCommentActivity(); } }

Target:
private void replyToComment() { if (mNote == null) { requestFailed(ARG_ACTION_APPROVE); return; } AnalyticsTracker.track(AnalyticsTracker.Stat.NOTIFICATION_QUICK_ACTIONS_REPLIED_TO); if (!TextUtils.isEmpty(mReplyText)) { SiteModel site = mSiteStore.getSiteBySiteId(mNote.getSiteId()); if (site == null) { AppLog.e(T.NOTIFS, "Impossible to reply to a comment on a site that is not in the App. SiteId: " + mNote.getSiteId()); requestFailed(ARG_ACTION_APPROVE); return; } CommentModel comment = mNote.buildComment(); CommentModel reply = new CommentModel(); reply.setContent(mReplyText); RemoteCreateCommentPayload payload = new RemoteCreateCommentPayload(site, comment, reply); mDispatcher.dispatch(CommentActionBuilder.newCreateNewCommentAction(payload)); } else { dismissNotification(mPushId); hideStatusBar(); startReplyToCommentActivity(); } }
Source:
public EMFCompareBuilderConfigurator(IEclipsePreferences enginePreferences, IMatchEngine.Factory.Registry matchEngineFactoryRegistry) { Assert.isNotNull(enginePreferences); this.enginePreferences = enginePreferences; this.matchEngineFactoryRegistry = matchEngineFactoryRegistry; }

Target:
public EMFCompareBuilderConfigurator(IEclipsePreferences enginePreferences, IMatchEngine.Factory.Registry matchEngineFactoryRegistry) { Preconditions.checkNotNull(enginePreferences); this.enginePreferences = enginePreferences; this.matchEngineFactoryRegistry = matchEngineFactoryRegistry; }
Source:
public void setupMocks() { dataStore = mock(DataStore.class); asyncQuery = mock(AsyncQuery.class); asyncQueryResult = mock(AsyncQueryResult.class); filter = mock(FilterExpression.class); tx = mock(DataStoreTransaction.class); Map<String, Class<? extends Check>> checkMappings = new HashMap<>(); EntityDictionary dictionary = new EntityDictionary(checkMappings); dictionary.bindEntity(getType(AsyncQuery.class)); dictionary.bindEntity(getType(AsyncQueryResult.class)); ElideSettings elideSettings = new ElideSettingsBuilder(dataStore) .withEntityDictionary(dictionary) .withJoinFilterDialect(new RSQLFilterDialect(dictionary)) .withSubqueryFilterDialect(new RSQLFilterDialect(dictionary)) .withISO8601Dates("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC")) .build(); elide = new Elide(elideSettings); when(dataStore.beginTransaction()).thenReturn(tx); asyncAPIDAO = new DefaultAsyncAPIDAO(elide.getElideSettings(), dataStore); }

Target:
public void setupMocks() { dataStore = mock(DataStore.class); asyncQuery = mock(AsyncQuery.class); asyncQueryResult = mock(AsyncQueryResult.class); filter = mock(FilterExpression.class); tx = mock(DataStoreTransaction.class); Map<String, Class<? extends Check>> checkMappings = new HashMap<>(); EntityDictionary dictionary = new EntityDictionary(checkMappings); dictionary.bindEntity(AsyncQuery.class); dictionary.bindEntity(AsyncQueryResult.class); ElideSettings elideSettings = new ElideSettingsBuilder(dataStore) .withEntityDictionary(dictionary) .withJoinFilterDialect(new RSQLFilterDialect(dictionary)) .withSubqueryFilterDialect(new RSQLFilterDialect(dictionary)) .withISO8601Dates("yyyy-MM-dd'T'HH:mm'Z'", TimeZone.getTimeZone("UTC")) .build(); elide = new Elide(elideSettings); when(dataStore.beginTransaction()).thenReturn(tx); asyncAPIDAO = new DefaultAsyncAPIDAO(elide.getElideSettings(), dataStore); }
Source:
public void start() { boolean newlyDownloaded = false; if (!metricFile.exists()) { info(REPO_NAME + " does not exist, downloading..."); download(getLatestVersion()); newlyDownloaded = true; } try { moduleClassLoader = URLClassLoader.newInstance(new URL[] { metricFile.toURI().toURL() }, plugin.getClass().getClassLoader()); Class<?> cl = moduleClassLoader.loadClass("dev.walshy.sfmetrics.MetricsModule"); metricVersion = cl.getPackage().getImplementationVersion(); if (!newlyDownloaded && plugin.getConfig().getBoolean("metrics.auto-update") && checkForUpdate(metricVersion) ) { info("Cleaning up and re-loading Metrics."); cleanUp(); start(); return; } Method start = cl.getDeclaredMethod("start"); String s = cl.getPackage().getImplementationVersion(); Slimefun.runSync(() -> { try { start.invoke(null); info("Metrics v" + s + " started."); } catch (Exception e) { plugin.getLogger().log(Level.WARNING, "Failed to start metrics.", e); } }); } catch (Exception e) { plugin.getLogger().log(Level.WARNING, "Failed to load the metrics module. Maybe the jar is corrupt?", e); } }

Target:
public void start() { if (!metricFile.exists()) { plugin.getLogger().info(REPO_NAME + " does not exist, downloading..."); if (!download(getLatestVersion())) { plugin.getLogger().warning("Failed to start metrics as the file could not be downloaded."); return; } } try { moduleClassLoader = URLClassLoader.newInstance(new URL[] { metricFile.toURI().toURL() }, plugin.getClass().getClassLoader()); Class<?> cl = moduleClassLoader.loadClass("dev.walshy.sfmetrics.MetricsModule"); metricVersion = cl.getPackage().getImplementationVersion(); if (!newlyDownloaded && hasAutoUpdates() && checkForUpdate(metricVersion) ) { plugin.getLogger().info("Cleaning up and re-loading Metrics."); cleanUp(); start(); return; } Method start = cl.getDeclaredMethod("start"); String version = cl.getPackage().getImplementationVersion(); Slimefun.runSync(() -> { try { start.invoke(null); plugin.getLogger().info("Metrics build #" + version + " started."); } catch (Exception e) { plugin.getLogger().log(Level.WARNING, "Failed to start metrics.", e); } }); } catch (Exception e) { plugin.getLogger().log(Level.WARNING, "Failed to load the metrics module. Maybe the jar is corrupt?", e); } }
Source:
protected Set<LockDescriptor> getLocksForWrites() { Set<LockDescriptor> result = Sets.newHashSet(); Iterable<TableReference> allTables = IterableUtils.append( writesByTable.keySet(), TransactionConstants.TRANSACTION_TABLE); for (TableReference tableRef : allTables) { if (tableRef.equals(TransactionConstants.TRANSACTION_TABLE)) { result.add( AtlasRowLockDescriptor.of( TransactionConstants.TRANSACTION_TABLE.getQualifiedName(), TransactionConstants.getValueForTimestamp(getStartTimestamp()))); continue; } ConflictHandler conflictHandler = getConflictHandlerForTable(tableRef); if (conflictHandler == ConflictHandler.RETRY_ON_WRITE_WRITE_CELL || conflictHandler == ConflictHandler.SERIALIZABLE_CELL) { for (Cell cell : getLocalWrites(tableRef).keySet()) { result.add( AtlasCellLockDescriptor.of( tableRef.getQualifiedName(), cell.getRowName(), cell.getColumnName())); } } else if (conflictHandler != ConflictHandler.IGNORE_ALL) { Cell lastCell = null; for (Cell cell : getLocalWrites(tableRef).keySet()) { if (lastCell == null || !Arrays.equals(lastCell.getRowName(), cell.getRowName())) { result.add( AtlasRowLockDescriptor.of(tableRef.getQualifiedName(), cell.getRowName())); } lastCell = cell; } } } return result; }

Target:
protected Set<LockDescriptor> getLocksForWrites() { Set<LockDescriptor> result = Sets.newHashSet(); Iterable<TableReference> allTables = IterableUtils.append( writesByTable.keySet(), TransactionConstants.TRANSACTION_TABLE); for (TableReference tableRef : allTables) { if (tableRef.equals(TransactionConstants.TRANSACTION_TABLE)) { result.add( AtlasRowLockDescriptor.of( TransactionConstants.TRANSACTION_TABLE.getQualifiedName(), TransactionConstants.getValueForTimestamp(getStartTimestamp()))); continue; } ConflictHandler conflictHandler = getConflictHandlerForTable(tableRef); if (conflictHandler.lockCellsForConflicts()) { for (Cell cell : getLocalWrites(tableRef).keySet()) { result.add( AtlasCellLockDescriptor.of( tableRef.getQualifiedName(), cell.getRowName(), cell.getColumnName())); } } if (conflictHandler.lockRowsForConflicts()) { Cell lastCell = null; for (Cell cell : getLocalWrites(tableRef).keySet()) { if (lastCell == null || !Arrays.equals(lastCell.getRowName(), cell.getRowName())) { result.add( AtlasRowLockDescriptor.of(tableRef.getQualifiedName(), cell.getRowName())); } lastCell = cell; } } } return result; }
Source:
protected void closeEhcache(final String alias, final Ehcache<?, ?> ehcache) { boolean diskTransient = isDiskTransient(ehcache); if (diskTransient) { try { destroyPersistenceSpace(alias); } catch (CachePersistenceException e) { this.getLogger().debug("Unable to clear persistence space for cache {}", alias, e); } } }

Target:
protected void closeEhcache(final String alias, final Ehcache<?, ?> ehcache) { boolean diskTransient = isDiskTransient(ehcache); if (diskTransient) { try { destroyPersistenceSpace(alias); } catch (CachePersistenceException e) { this.getLogger().warn("Unable to clear persistence space for cache {}", alias, e); } } }
Source:
public byte[] getServerCookie() { return serverCookie; }

Target:
public Optional<byte[]> getServerCookie() { return serverCookie; }
Source:
public final String getCountryCode(final String ip) { try { InetAddress ipAddress = InetAddress.getByName(ip); CityResponse response = databaseReader.city(ipAddress); Country country = response.getCountry(); return country.getIsoCode(); } catch (UnknownHostException hEx) { return UNKNOWN_CODE; } catch (IOException iEx) { return UNKNOWN_CODE; } catch (GeoIp2Exception gEx) { return UNKNOWN_CODE; } }

Target:
public final String getCountryCode(final String ip) { try { InetAddress ipAddress = InetAddress.getByName(ip); CountryResponse response = databaseReader.country(ipAddress); Country country = response.getCountry(); return country.getIsoCode(); } catch (UnknownHostException hEx) { Log.warn(hEx); return UNKNOWN_COUNTRY_CODE; } catch (IOException iEx) { Log.warn(iEx); return UNKNOWN_COUNTRY_CODE; } catch (GeoIp2Exception gEx) { Log.warn(gEx); return UNKNOWN_COUNTRY_CODE; } }
Source:
public AbstractSegmentStoreDensityViewer getDensityViewer() { return fDensityViewer; }

Target:
public @Nullable AbstractSegmentStoreDensityViewer getDensityViewer() { return fDensityViewer; }
Source:
public void apply(final List<StringBuilder> values, final AdvancingSource source, final String capturedText) { if (source.isForceUniqueNameGeneration()) { for (StringBuilder container : values) { this.replaceExpressionWithValue(container, "(" + (source.getCurrentMaxSequence() + 1) + ")"); } return; } if (source.isBulk()) { for (StringBuilder container : values) { if (source.getPlantsSelected() != null && source.getPlantsSelected() > 1) { Integer newValue = source.getPlantsSelected(); this.replaceExpressionWithValue(container, newValue != null ? newValue.toString() : ""); } else { this.replaceExpressionWithValue(container, ""); } } } else { List<StringBuilder> newNames = new ArrayList<StringBuilder>(); int startCount = 1; if (source.getCurrentMaxSequence() > -1) { startCount = source.getCurrentMaxSequence() + 1; } for (StringBuilder value : values) { if (source.getPlantsSelected() != null && source.getPlantsSelected() > 0) { for (int i = startCount; i < startCount + source.getPlantsSelected(); i++) { StringBuilder newName = new StringBuilder(value); this.replaceExpressionWithValue(newName, String.valueOf(i)); newNames.add(newName); } } else { this.replaceExpressionWithValue(value, ""); newNames.add(value); } } values.clear(); values.addAll(newNames); } }

Target:
public void apply(final List<StringBuilder> values, final AdvancingSource source, final String capturedText) { if (source.isForceUniqueNameGeneration()) { for (final StringBuilder container : values) { this.replaceExpressionWithValue(container, "(" + (source.getCurrentMaxSequence() + 1) + ")"); } return; } if (source.isBulk()) { for (final StringBuilder container : values) { if (source.getPlantsSelected() != null && source.getPlantsSelected() > 1) { final Integer newValue = source.getPlantsSelected(); this.replaceExpressionWithValue(container, newValue != null ? newValue.toString() : ""); } else { this.replaceExpressionWithValue(container, ""); } } } else { final List<StringBuilder> newNames = new ArrayList<>(); int startCount = 1; if (source.getCurrentMaxSequence() > -1) { startCount = source.getCurrentMaxSequence() + 1; } for (final StringBuilder value : values) { if (source.getPlantsSelected() != null && source.getPlantsSelected() > 0) { for (int i = startCount; i < startCount + source.getPlantsSelected(); i++) { final StringBuilder newName = new StringBuilder(value); this.replaceExpressionWithValue(newName, String.valueOf(i)); newNames.add(newName); } } else { this.replaceExpressionWithValue(value, ""); newNames.add(value); } } values.clear(); values.addAll(newNames); } }
Source:
public Maybe<Location> extract(ItunesEpfPricingSource source) { String countryCode = iso3Code(source.getCountry()); Integer storefrontId = source.getCountryCodes().get(countryCode); Integer extractedStorefrontId = source.getRow().get(EpfPricing.STOREFRONT_ID); if (extractedStorefrontId.equals(storefrontId)) { BigDecimal sdPrice = source.getRow().get(EpfPricing.SD_PRICE); if (sdPrice == null) { return Maybe.nothing(); } Location location = new Location(); location.setTransportType(TransportType.APPLICATION); location.setTransportSubType(TransportSubType.ITUNES); location.setEmbedId(source.getRow().get(EpfPricing.VIDEO_ID).toString()); Policy policy = new Policy(); policy.addAvailableCountry(source.getCountry()); policy.setRevenueContract(RevenueContract.PAY_TO_BUY); Currency currency = Currency.getInstance(new Locale("en", source.getCountry().code())); policy.setPrice(new Price(currency, sdPrice.movePointRight(currency.getDefaultFractionDigits()).intValue())); location.setPolicy(policy); return Maybe.just(location); } else { return Maybe.nothing(); } }

Target:
public Maybe<Location> extract(ItunesEpfPricingSource source) { String countryCode = iso3Code(source.getCountry()); Integer storefrontId = source.getCountryCodes().get(countryCode); Integer extractedStorefrontId = source.getRow().get(EpfPricing.STOREFRONT_ID); if (!Objects.equal(extractedStorefrontId, storefrontId)) { return Maybe.nothing(); } BigDecimal sdPrice = source.getRow().get(EpfPricing.SD_PRICE); if (sdPrice == null) { return Maybe.nothing(); } Location location = new Location(); location.setTransportType(TransportType.APPLICATION); location.setTransportSubType(TransportSubType.ITUNES); location.setEmbedId(source.getRow().get(EpfPricing.VIDEO_ID).toString()); Policy policy = new Policy(); policy.addAvailableCountry(source.getCountry()); policy.setRevenueContract(RevenueContract.PAY_TO_BUY); Currency currency = Currency.getInstance(new Locale("en", source.getCountry().code())); policy.setPrice(new Price(currency, sdPrice.movePointRight(currency.getDefaultFractionDigits()).intValue())); location.setPolicy(policy); return Maybe.just(location); }
Source:
private FeedbackResultsResponseTable createResponseTable(FeedbackQuestionAttributes question, List<FeedbackResponseAttributes> responsesBundleForRecipient, String recipientNameParam) { List<FeedbackResultsResponse> responses = new ArrayList<>(); FeedbackQuestionDetails questionDetails = question.getQuestionDetails(); String recipientName = recipientNameParam; for (FeedbackResponseAttributes response : responsesBundleForRecipient) { String giverName = bundle.getGiverNameForResponse(response); String displayedGiverName; boolean isUserGiver = student.email.equals(response.giver); boolean isUserPartOfGiverTeam = student.team.equals(giverName); if (question.giverType == FeedbackParticipantType.TEAMS && isUserPartOfGiverTeam) { displayedGiverName = "Your Team (" + giverName + ")"; } else if (isUserGiver) { displayedGiverName = "You"; } else { displayedGiverName = removeAnonymousHash(giverName); } boolean isUserRecipient = student.email.equals(response.recipient); if (isUserGiver && !isUserRecipient) { recipientName = bundle.getNameForEmail(response.recipient); } else { recipientName = removeAnonymousHash(recipientName); } String answer = response.getResponseDetails().getAnswerHtmlStudentView(questionDetails); List<FeedbackResponseCommentRow> comments = createStudentFeedbackResultsResponseComments( response.getId()); responses.add(new FeedbackResultsResponse(displayedGiverName, answer, comments)); } return new FeedbackResultsResponseTable(recipientName, responses); }

Target:
private FeedbackResultsResponseTable createResponseTable(FeedbackQuestionAttributes question, List<FeedbackResponseAttributes> responsesBundleForRecipient, String recipientNameParam) { List<FeedbackResultsResponse> responses = new ArrayList<>(); FeedbackQuestionDetails questionDetails = question.getQuestionDetails(); String recipientName = removeAnonymousHash(recipientNameParam); for (FeedbackResponseAttributes response : responsesBundleForRecipient) { String giverName = bundle.getGiverNameForResponse(response); String displayedGiverName; boolean isUserGiver = student.email.equals(response.giver); boolean isUserPartOfGiverTeam = student.team.equals(giverName); if (question.giverType == FeedbackParticipantType.TEAMS && isUserPartOfGiverTeam) { displayedGiverName = "Your Team (" + giverName + ")"; } else if (isUserGiver) { displayedGiverName = "You"; } else { displayedGiverName = removeAnonymousHash(giverName); } boolean isUserRecipient = student.email.equals(response.recipient); if (isUserGiver && !isUserRecipient) { recipientName = bundle.getNameForEmail(response.recipient); } String answer = response.getResponseDetails().getAnswerHtmlStudentView(questionDetails); List<FeedbackResponseCommentRow> comments = createStudentFeedbackResultsResponseComments( response.getId()); responses.add(new FeedbackResultsResponse(displayedGiverName, answer, comments)); } return new FeedbackResultsResponseTable(recipientName, responses); }
Source:
protected Optional<Page> computeNext() { int batchSize; while (true) { if (selectedPositions.isEmpty()) { updateRetainedSize(); verify(!previousYieldFinish); return endOfData(); } if (previousYieldFinish) { verify(previousBatchSize > 0); batchSize = previousBatchSize; previousYieldFinish = false; } else { batchSize = Math.min(selectedPositions.size(), projectBatchSize); } ProcessBatchResult result = processBatch(batchSize); if (result.isYieldFinish()) { previousYieldFinish = true; previousBatchSize = batchSize; return Optional.empty(); } if (result.isPageTooLarge()) { verify(batchSize > 1); projectBatchSize = projectBatchSize / 2; continue; } verify(result.isSuccess()); Page page = result.getPage(); long pageSize = page.getSizeInBytes(); if (page.getPositionCount() > 1 && pageSize > MAX_PAGE_SIZE_IN_BYTES) { projectBatchSize = projectBatchSize / 2; } if (pageSize < MIN_PAGE_SIZE_IN_BYTES && projectBatchSize < MAX_BATCH_SIZE) { projectBatchSize = projectBatchSize * 2; } selectedPositions = selectedPositions.subRange(batchSize, selectedPositions.size()); for (int i = 0; i < previouslyComputedResults.length; i++) { if (previouslyComputedResults[i] != null && previouslyComputedResults[i].getPositionCount() > batchSize) { previouslyComputedResults[i] = previouslyComputedResults[i].getRegion(batchSize, previouslyComputedResults[i].getPositionCount() - batchSize); } else { previouslyComputedResults[i] = null; } } updateRetainedSize(); return Optional.of(page); } }

Target:
protected Optional<Page> computeNext() { int batchSize; while (true) { if (selectedPositions.isEmpty()) { updateRetainedSize(); verify(!lastComputeYielded); return endOfData(); } if (lastComputeYielded) { verify(lastComputeBatchSize > 0); batchSize = lastComputeBatchSize; lastComputeYielded = false; lastComputeBatchSize = 0; } else { batchSize = Math.min(selectedPositions.size(), projectBatchSize); } ProcessBatchResult result = processBatch(batchSize); if (result.isYieldFinish()) { lastComputeYielded = true; lastComputeBatchSize = batchSize; return Optional.empty(); } if (result.isPageTooLarge()) { verify(batchSize > 1); projectBatchSize = projectBatchSize / 2; continue; } verify(result.isSuccess()); Page page = result.getPage(); long pageSize = page.getSizeInBytes(); if (page.getPositionCount() > 1 && pageSize > MAX_PAGE_SIZE_IN_BYTES) { projectBatchSize = projectBatchSize / 2; } if (pageSize < MIN_PAGE_SIZE_IN_BYTES && projectBatchSize < MAX_BATCH_SIZE) { projectBatchSize = projectBatchSize * 2; } selectedPositions = selectedPositions.subRange(batchSize, selectedPositions.size()); for (int i = 0; i < previouslyComputedResults.length; i++) { if (previouslyComputedResults[i] != null && previouslyComputedResults[i].getPositionCount() > batchSize) { previouslyComputedResults[i] = previouslyComputedResults[i].getRegion(batchSize, previouslyComputedResults[i].getPositionCount() - batchSize); } else { previouslyComputedResults[i] = null; } } updateRetainedSize(); return Optional.of(page); } }
Source:
public static boolean isDynamicTabbar() { return isJuno4Platform() || isKeplerPlatform(); }

Target:
public static boolean isDynamicTabbar() { return !(isJuno4Platform() || isKeplerPlatform()); }
Source:
private static Throwable getConfigFailureException(ITestContext context) { Throwable t = null; for (IInvokedMethod method : context.getSuite().getAllInvokedMethods()) { ITestNGMethod m = method.getTestMethod(); if (m.isBeforeSuiteConfiguration() && (!method.getTestResult().isSuccess())) { return method.getTestResult().getThrowable(); } } return t; }

Target:
private static Throwable getConfigFailureException(ITestContext context) { for (IInvokedMethod method : context.getSuite().getAllInvokedMethods()) { ITestNGMethod m = method.getTestMethod(); if (m.isBeforeSuiteConfiguration() && (!method.getTestResult().isSuccess())) { return method.getTestResult().getThrowable(); } } return null; }
Source:
public void backupDatabase(GatewayConfig primaryGateway, Set<String> target, Set<Node> allNodes, SaltConfig saltConfig, ExitCriteriaModel exitModel) throws CloudbreakOrchestratorFailedException { try (SaltConnector sc = createSaltConnector(primaryGateway)) { for (Entry<String, SaltPillarProperties> propertiesEntry : saltConfig.getServicePillarConfig().entrySet()) { OrchestratorBootstrap pillarSave = new PillarSave(sc, Sets.newHashSet(primaryGateway.getPrivateAddress()), propertiesEntry.getValue()); Callable<Boolean> saltPillarRunner = saltRunner.runner(pillarSave, exitCriteria, exitModel); saltPillarRunner.call(); } StateRunner stateRunner = new StateRunner(target, allNodes, DATABASE_BACKUP); OrchestratorBootstrap saltJobIdTracker = new SaltJobIdTracker(sc, stateRunner); Callable<Boolean> saltJobRunBootstrapRunner = saltRunner.runner(saltJobIdTracker, exitCriteria, exitModel, maxRetry, false); saltJobRunBootstrapRunner.call(); } catch (Exception e) { LOGGER.info("Error occurred during database backup", e); throw new CloudbreakOrchestratorFailedException(e); } }

Target:
public void backupDatabase(GatewayConfig primaryGateway, Set<String> target, Set<Node> allNodes, SaltConfig saltConfig, ExitCriteriaModel exitModel) throws CloudbreakOrchestratorFailedException { callBackupRestore(primaryGateway, target, allNodes, saltConfig, exitModel, DATABASE_BACKUP); }
Source:
public void testOutputForPageWithRunLengthAndReplication() { PartitionedOutputOperator partitionedOutputOperator = createPartitionedOutputOperator(true); for (int i = 0; i < NUM_OF_ITERATIONS; i++) { partitionedOutputOperator.addInput(createPageWithRunLengthAndNullBlock()); } partitionedOutputOperator.finish(); OperatorContext operatorContext = partitionedOutputOperator.getOperatorContext(); long outputSize = operatorContext.getOutputDataSize().getTotalCount(); long outputPositionCount = operatorContext.getOutputPositions().getTotalCount(); assertEquals(outputSize, 461_260_800); assertEquals(outputPositionCount, 51_200_000); assertTrue(outputSize > createPageWithRunLength().getSizeInBytes() * NUM_OF_ITERATIONS); }

Target:
public void testOutputForPageWithRunLengthAndReplication() { PartitionedOutputOperator partitionedOutputOperator = createPartitionedOutputOperator(true); for (int i = 0; i < PAGE_COUNT; i++) { partitionedOutputOperator.addInput(new Page(POSITIONS_PER_PAGE, NULL_BLOCK, TESTING_RLE_BLOCK)); } partitionedOutputOperator.finish(); OperatorContext operatorContext = partitionedOutputOperator.getOperatorContext(); assertEquals(operatorContext.getOutputDataSize().getTotalCount(), PAGE_COUNT * PARTITION_COUNT * TESTING_PAGE_WITH_NULL_BLOCK.getSizeInBytes()); assertEquals(operatorContext.getOutputPositions().getTotalCount(), PAGE_COUNT * PARTITION_COUNT * TESTING_PAGE_WITH_NULL_BLOCK.getPositionCount()); }
Source:
private void writeClosedAccountsToCsvFile(List<LaborClosedAccount> laborClosedAccountsDataList) { String fullyQualifiedOutputFileName = generateFullyQualifiedOutputFileName(); LOG.info("writeClosedAccountsToCsvFile: fullyQualifiedOutputFile = " + fullyQualifiedOutputFileName); File outputFile = new File(fullyQualifiedOutputFileName); FileWriter outputFileWriter; try { outputFileWriter = new FileWriter(outputFile); for (LaborClosedAccount closedAccount : laborClosedAccountsDataList) { outputFileWriter.write(closedAccount.toCsvString()); outputFileWriter.write(KFSConstants.NEWLINE); } outputFileWriter.close(); } catch (IOException io) { LOG.error("writeClosedAccountsToCsvFile: Caught IOException = " + io.getMessage()); io.getStackTrace(); } }

Target:
private void writeClosedAccountsToCsvFile(List<LaborClosedAccount> laborClosedAccountsDataList) throws IOException { String fullyQualifiedOutputFileName = generateFullyQualifiedOutputFileName(); LOG.info("writeClosedAccountsToCsvFile: fullyQualifiedOutputFile = " + fullyQualifiedOutputFileName); File outputFile = new File(fullyQualifiedOutputFileName); FileWriter outputFileWriter; try { outputFileWriter = new FileWriter(outputFile); for (LaborClosedAccount closedAccount : laborClosedAccountsDataList) { outputFileWriter.write(closedAccount.toCsvString()); outputFileWriter.write(KFSConstants.NEWLINE); } outputFileWriter.close(); } catch (IOException io) { LOG.error("writeClosedAccountsToCsvFile: Caught IOException => ", io); throw io; } }
Source:
public Void call() throws Exception { Objects.requireNonNull(acl, "New acl to be added not specified."); OzoneAddress address = new OzoneAddress(uri); address.ensureBucketAddress(); OzoneClient client = address.createClient(createOzoneConfiguration()); String volumeName = address.getVolumeName(); String bucketName = address.getBucketName(); if (isVerbose()) { System.out.printf("Volume Name : %s%n", volumeName); System.out.printf("Bucket Name : %s%n", bucketName); } OzoneObj obj = OzoneObjInfo.Builder.newBuilder() .setBucketName(bucketName) .setVolumeName(volumeName) .setResType(OzoneObj.ResourceType.BUCKET) .setStoreType(storeType == null ? OZONE : OzoneObj.StoreType.valueOf(storeType)) .build(); boolean result = client.getObjectStore().removeAcl(obj, OzoneAcl.parseAcl(acl)); System.out.printf("%s%n", JsonUtils.toJsonStringWithDefaultPrettyPrinter( JsonUtils.toJsonString("Acl set successfully: " + result))); return null; }

Target:
public Void call() throws Exception { Objects.requireNonNull(acl, "New acl to be added not specified."); OzoneAddress address = new OzoneAddress(uri); address.ensureBucketAddress(); OzoneClient client = address.createClient(createOzoneConfiguration()); String volumeName = address.getVolumeName(); String bucketName = address.getBucketName(); if (isVerbose()) { System.out.printf("Volume Name : %s%n", volumeName); System.out.printf("Bucket Name : %s%n", bucketName); } OzoneObj obj = OzoneObjInfo.Builder.newBuilder() .setBucketName(bucketName) .setVolumeName(volumeName) .setResType(OzoneObj.ResourceType.BUCKET) .setStoreType(storeType == null ? OZONE : OzoneObj.StoreType.valueOf(storeType)) .build(); boolean result = client.getObjectStore().removeAcl(obj, OzoneAcl.parseAcl(acl)); System.out.printf("%s%n", JsonUtils.toJsonStringWithDefaultPrettyPrinter( JsonUtils.toJsonString("Acl removed successfully: " + result))); client.close(); return null; }
Source:
public void phenotypeSetup(Set<String> enabledFields) throws Exception { String sectionName = "phenotype"; String[] fieldIds = { "phenotype", "phenotype_code", "phenotype_combined", "phenotype_code_meta", "phenotype_meta", "negative_phenotype", "negative_phenotype_code", "negative_phenotype_combined", "phenotype_by_section" }; String[][] headerIds = { { "phenotype", "positive" }, { "code", "positive" }, { "phenotype", "code", "positive" }, { "meta_code", "phenotype", "positive" }, { "meta", "phenotype", "positive" }, { "negative", "phenotype" }, { "negative", "code" }, { "negative", "code", "phenotype" }, { "category" } }; Set<String> present = new HashSet<String>(); int counter = 0; for (String fieldId : fieldIds) { if (enabledFields.remove(fieldId)) { for (String headerId : headerIds[counter]) { present.add(headerId); } } counter++; } this.enabledHeaderIdsBySection.put(sectionName, present); this.phenotypeHelper = new ConversionHelpers(); this.phenotypeHelper .featureSetUp(present.contains("positive"), present.contains("negative"), present.contains("category")); }

Target:
public void phenotypeSetup(Set<String> enabledFields) throws Exception { String sectionName = "phenotype"; String[] fieldIds = { "phenotype", "phenotype_code", "phenotype_combined", "phenotype_code_meta", "phenotype_meta", "negative_phenotype", "negative_phenotype_code", "negative_phenotype_combined", "phenotype_by_section" }; String[][] headerIds = { { "phenotype", "positive" }, { "code", "positive" }, { "phenotype", "code", "positive" }, { "meta_code", "phenotype", "positive" }, { "meta", "phenotype", "positive" }, { "negative", "phenotype" }, { "negative", "code" }, { "negative", "code", "phenotype" }, { "category" } }; Set<String> present = addHeaders(fieldIds, headerIds, enabledFields); this.enabledHeaderIdsBySection.put(sectionName, present); this.phenotypeHelper = new ConversionHelpers(); this.phenotypeHelper .featureSetUp(present.contains("positive"), present.contains("negative"), present.contains("category")); }
Source:
public boolean apply(PacketContext pktCtx) { super.apply(pktCtx); pktCtx.jlog().debug("Redirecting flow port with ID {}.", (ingress ? "IN" : "OUT"), targetPort); return true; }

Target:
public boolean apply(PacketContext pktCtx) { super.apply(pktCtx); pktCtx.jlog().debug("Redirecting flow port with ID {}.", (ingress ? "IN" : "OUT"), targetPort); pktCtx.redirect(failOpen); return true; }
Source:
public String updatedOn() { String LOCAL_TIME_FORMAT = "dd MMM, yyyy 'at' HH:mm:ss 'Local Time'"; SimpleDateFormat simpleDateFormat = new SimpleDateFormat(LOCAL_TIME_FORMAT); return simpleDateFormat.format(updatedOnTimeStamp()); }

Target:
public String updatedOn() { return ISO8601Utils.format(updatedOnTimeStamp(), false, UTC); }
Source:
public String getContingencyStateString(final TruthState truthState, final CallState callState) { return StringUtil.join(",", getConcordanceStateArray(truthState, callState)); }

Target:
public String getContingencyStateString(final TruthState truthState, final CallState callState) { final ContingencyState[] contingencyStateArray = getConcordanceStateArray(truthState, callState); return (contingencyStateArray.length == 0) ? "EMPTY" : StringUtil.join(",", contingencyStateArray); }
Source:
void startLoadJob(IExceptionHandler handler) { new Job("load project") { @Override protected IStatus run(IProgressMonitor monitor) { try { IOpenShiftConnection connection = getConnection(); List<IResource> projects = connection.getResources(ResourceKind.PROJECT); initWith(projects); state.compareAndSet(LoadingState.LOADING, LoadingState.LOADED); fireChanged(); } catch (OperationCanceledException e) { state.compareAndSet(LoadingState.LOADING, LoadingState.LOAD_STOPPED); } catch (Throwable e) { state.compareAndSet(LoadingState.LOADING, LoadingState.LOAD_STOPPED); handler.handleException(e); } return Status.OK_STATUS; } }.schedule(); }

Target:
private void startLoadJob(IExceptionHandler handler) { new Job("Load project") { @Override protected IStatus run(IProgressMonitor monitor) { try { IOpenShiftConnection connection = getWrapped(); List<IResource> projects = connection.getResources(ResourceKind.PROJECT); initWith(projects); state.compareAndSet(LoadingState.LOADING, LoadingState.LOADED); fireChanged(); } catch (OperationCanceledException e) { state.compareAndSet(LoadingState.LOADING, LoadingState.LOAD_STOPPED); } catch (Throwable e) { state.compareAndSet(LoadingState.LOADING, LoadingState.LOAD_STOPPED); handler.handleException(e); } return Status.OK_STATUS; } }.schedule(); }
Source:
public void thingUpdated(final Thing thing, ThingTrackerEvent thingTrackerEvent) { ThingUID thingUID = thing.getUID(); Thing oldThing = getThing(thingUID); if (oldThing != thing) { this.things.remove(oldThing); this.things.add(thing); } thingLinkManager.thingUpdated(thing); final ThingHandler thingHandler = thingHandlers.get(thingUID); if (thingHandler != null) { if (oldThing != thing) { thing.setHandler(thingHandler); } if (isInitialized(thing)) { try { if (!thingUpdatedLock.contains(thingUID)) { SafeMethodCaller.call(new SafeMethodCaller.ActionWithException<Void>() { @Override public Void call() throws Exception { thingHandler.thingUpdated(thing); return null; } }); } } catch (Exception ex) { logger.error("Exception occured while calling thing updated at ThingHandler '" + thingHandler + ": " + ex.getMessage(), ex); } } else { logger.warn("Cannot notify handler about updated thing {}, because thing is not initialized " + "(must be in status ONLINE or OFFLINE).", thing.getThingTypeUID()); } } else { registerHandler(thing); } if (oldThing != thing) { oldThing.setHandler(null); } }

Target:
public void thingUpdated(final Thing thing, ThingTrackerEvent thingTrackerEvent) { ThingUID thingUID = thing.getUID(); Thing oldThing = getThing(thingUID); if (oldThing != thing) { this.things.remove(oldThing); this.things.add(thing); } thingLinkManager.thingUpdated(thing); final ThingHandler thingHandler = thingHandlers.get(thingUID); if (thingHandler != null) { if (oldThing != thing) { thing.setHandler(thingHandler); } if (isInitialized(thing)) { try { if (!thingUpdatedLock.contains(thingUID)) { SafeMethodCaller.call(new SafeMethodCaller.ActionWithException<Void>() { @Override public Void call() throws Exception { thingHandler.thingUpdated(thing); return null; } }); } } catch (Exception ex) { logger.error("Exception occured while calling thing updated at ThingHandler '" + thingHandler + ": " + ex.getMessage(), ex); } } else { logger.debug("Cannot notify handler about updated thing {}, because thing is not initialized " + "(must be in status ONLINE or OFFLINE).", thing.getThingTypeUID()); } } else { registerHandler(thing); } if (oldThing != thing) { oldThing.setHandler(null); } }
Source:
private JSONObject processStroke(JSONObject ret, Stroke stroke) { if (stroke == null) { return ret; } boolean stroked = false; if (stroke.getGraphicStroke() != null) { stroked = true; JSONObject jGraphic = new JSONObject(); jGraphic = processGraphic(jGraphic, stroke.getGraphicStroke()); ret.element(GRAPHIC_STROKE, jGraphic); } if (stroke.getGraphicFill() != null) { stroked = true; JSONObject jGraphic = new JSONObject(); jGraphic = processGraphic(jGraphic, stroke.getGraphicFill()); ret.element(GRAPHIC_FILL, jGraphic); } if (!stroked) { ret.element(STROKE, stroke.getColor().evaluate(feature)); ret.element(STROKE_WIDTH, stroke.getWidth().evaluate(feature)); } if (stroke.getOpacity() != null) { ret.element(STROKE_OPACITY, printExpression(stroke.getOpacity(), Number.class)); } if (stroke.getLineCap() != null) { ret.element(STROKE_LINECAP, printExpression(stroke.getLineCap(), String.class)); } if (stroke.getLineJoin() != null) { ret.element(STROKE_LINEJOIN, printExpression(stroke.getLineJoin(), String.class)); } List<Expression> dashArray = stroke.dashArray(); if (dashArray != null && !dashArray.isEmpty()) { JSONArray dArray = new JSONArray(); for (Expression e : dashArray) { dArray.add(e.evaluate(feature)); } ret.element(STROKE_DASHARRAY, dArray); Expression dashOffset = stroke.getDashOffset(); if (dashOffset != null) { ret.element(STROKE_DASHOFFSET, dashOffset.evaluate(feature)); } } return ret; }

Target:
private JSONObject processStroke(JSONObject ret, Stroke stroke) { if (stroke == null) { return ret; } boolean stroked = false; if (stroke.getGraphicStroke() != null) { stroked = true; JSONObject jGraphic = new JSONObject(); jGraphic = processGraphic(jGraphic, stroke.getGraphicStroke()); ret.element(GRAPHIC_STROKE, jGraphic); } if (stroke.getGraphicFill() != null) { stroked = true; JSONObject jGraphic = new JSONObject(); jGraphic = processGraphic(jGraphic, stroke.getGraphicFill()); ret.element(GRAPHIC_FILL, jGraphic); } if (!stroked) { ret.element(STROKE, stroke.getColor().evaluate(feature)); ret.element(STROKE_WIDTH, stroke.getWidth().evaluate(feature)); } if (stroke.getOpacity() != null) { ret.element(STROKE_OPACITY, toJSONValue(stroke.getOpacity(), Number.class)); } if (stroke.getLineCap() != null) { ret.element(STROKE_LINECAP, toJSONValue(stroke.getLineCap(), String.class)); } if (stroke.getLineJoin() != null) { ret.element(STROKE_LINEJOIN, toJSONValue(stroke.getLineJoin(), String.class)); } List<Expression> dashArray = stroke.dashArray(); if (dashArray != null && !dashArray.isEmpty()) { JSONArray dArray = new JSONArray(); for (Expression e : dashArray) { dArray.add(toJSONValue(e, Double.class)); } ret.element(STROKE_DASHARRAY, dArray); Expression dashOffset = stroke.getDashOffset(); if (dashOffset != null) { ret.element(STROKE_DASHOFFSET, toJSONValue(dashOffset, Double.class)); } } return ret; }
Source:
protected void updateData(double[] x, @NonNull AnalysisBaseQueryFilter filters, IProgressMonitor monitor) { if (fXYDataProvider == null) { return; } ICommonXAxisResponse response = null; ICommonXAxisModel model = null; boolean isComplete = false; long currentEnd = 0; while (!isComplete && currentEnd < filters.getQueryInterval().getEndTime()) { response = fXYDataProvider.fetch(x, filters, monitor); model = response.getModel(); if (model != null) { updateDisplay(model); } isComplete = response.getStatus() == ICommonXAxisResponse.Status.COMPLETED; } }

Target:
protected void updateData(double[] x, @NonNull AnalysisBaseQueryFilter filters, IProgressMonitor monitor) { if (fXYDataProvider == null) { return; } ICommonXAxisResponse response = null; ICommonXAxisModel model = null; boolean isComplete = false; long currentEnd = 0; while (!isComplete && currentEnd < filters.getQueryInterval().getEndTime().toNanos()) { response = fXYDataProvider.fetch(x, filters, monitor); model = response.getModel(); if (model != null) { updateDisplay(model); } isComplete = response.getStatus() == ICommonXAxisResponse.Status.COMPLETED; if(isComplete) { return; } try { finishedLatch.await(BUILD_UPDATE_TIMEOUT, TimeUnit.MILLISECONDS); } catch (InterruptedException e) { e.printStackTrace(); return; } } }