auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public VoltXMLElement getXMLCompiledStatement(String sql) throws HSQLParseException { Statement cs = null; sessionProxy.resetVoltNodeIds(); try { cs = sessionProxy.compileStatement(sql); } catch (HsqlException hex) { switch( hex.getErrorCode()) { case -ErrorCode.X_42581: throw new HSQLParseException( "SQL Syntax error in \"" + sql + "\" " + hex.getMessage()); default: throw new HSQLParseException(hex.getMessage()); } } catch (Throwable t) { m_logger.error("Unexpected error in the SQL parser", t); throw new HSQLParseException( "An unexpected system error was logged by the SQL parser"); } Result result = Result.newPrepareResponse(cs); if (result.hasError()) { throw new HSQLParseException(result.getMainString()); } VoltXMLElement xml = null; xml = cs.voltGetStatementXML(sessionProxy); if (m_logger.isDebugEnabled()) { try { m_logger.debug(String.format("SQL: %s\n", sql));; m_logger.debug(String.format("HSQLDB:\n%s", (cs == null) ? "<NULL>" : cs.describe(sessionProxy))); m_logger.debug(String.format("VOLTDB:\n%s", (xml == null) ? "<NULL>" : xml)); } catch (Exception ex) { System.out.printf("Exception: %s\n", ex.getMessage()); ex.printStackTrace(System.out); } } sessionProxy.sessionData.persistentStoreCollection.clearAllTables(); fixupInStatementExpressions(xml); assert(xml != null); return xml; }

Target:
public VoltXMLElement getXMLCompiledStatement(String sql) throws HSQLParseException { Statement cs = null; sessionProxy.resetVoltNodeIds(); try { cs = sessionProxy.compileStatement(sql); } catch (HsqlException caught) { switch(caught.getErrorCode()) { case -ErrorCode.X_42581: throw new HSQLParseException( "SQL Syntax error in \"" + sql + "\" " + caught.getMessage(), caught); default: throw new HSQLParseException("Error in \"" + sql + "\" " + caught.getMessage(), caught); } } catch (Throwable caught) { m_logger.error("Unexpected error in the SQL parser for statement \"" + sql + "\" ", caught); throw new HSQLParseException( "An unexpected system error was logged by the SQL parser for statement \"" + sql + "\" ", caught); } Result result = Result.newPrepareResponse(cs); if (result.hasError()) { throw new HSQLParseException(result.getMainString()); } VoltXMLElement xml = null; xml = cs.voltGetStatementXML(sessionProxy); if (m_logger.isDebugEnabled()) { try { m_logger.debug(String.format("SQL: %s\n", sql));; m_logger.debug(String.format("HSQLDB:\n%s", (cs == null) ? "<NULL>" : cs.describe(sessionProxy))); m_logger.debug(String.format("VOLTDB:\n%s", (xml == null) ? "<NULL>" : xml)); } catch (Exception caught) { m_logger.warn("Unexpected error in the SQL parser", caught); caught.printStackTrace(System.out); } } sessionProxy.sessionData.persistentStoreCollection.clearAllTables(); fixupInStatementExpressions(xml); assert(xml != null); return xml; }
Source:
private static void fillReferencePointManager( IReferencePointManager referencePointManager, Set<IProject> projects) { referencePointManager.putSetOfProjects(projects); for (IProject project : projects) { intelliJReferencePointManager.putIfAbsent( project.getReferencePoint(), ((IntelliJProjectImpl) project).getModule()); } }

Target:
private static void fillReferencePointManager( IReferencePointManager referencePointManager, Set<IProject> projects) { referencePointManager.putSetOfProjects(projects); for (IProject project : projects) { intelliJReferencePointManager.putIfAbsent( project.getReferencePoint(), project.adaptTo(IntelliJProjectImpl.class).getModule()); } }
Source:
private EntityView(Context context, Detail d, Entity e, String[] searchTerms, long rowId, boolean mFuzzySearchEnabled, String extraData) { super(context); mIsAsynchronous = e instanceof AsyncEntity; this.searchTerms = searchTerms; this.renderedGraphsCache = new Hashtable<>(); this.rowId = rowId; this.views = new ArrayList<>(e.getNumFields()); this.forms = new ArrayList<>(Arrays.asList(d.getTemplateForms())); this.mHints = new ArrayList<>(Arrays.asList(d.getTemplateSizeHints())); for (int col = 0; col < e.getNumFields(); ++col) { Object field = e.getField(col); String sortField = e.getSortField(col); views.add(addCell(col, field, forms.get(col), mHints.get(col), sortField, -1, true)); } addExtraData(d.getCallout().getResponseDetail(), extraData); this.mFuzzySearchEnabled = mFuzzySearchEnabled; }

Target:
private EntityView(Context context, Detail d, Entity e, String[] searchTerms, long rowId, boolean mFuzzySearchEnabled, String extraData) { super(context); mIsAsynchronous = e instanceof AsyncEntity; this.searchTerms = searchTerms; this.renderedGraphsCache = new Hashtable<>(); this.rowId = rowId; this.views = new ArrayList<>(e.getNumFields()); this.forms = new ArrayList<>(Arrays.asList(d.getTemplateForms())); this.mHints = new ArrayList<>(Arrays.asList(d.getTemplateSizeHints())); for (int col = 0; col < e.getNumFields(); ++col) { Object field = e.getField(col); String sortField = e.getSortField(col); views.add(addCell(col, field, forms.get(col), mHints.get(col), sortField, -1, true)); } addExtraData(d.getCallout().getResponseDetailField(), extraData); this.mFuzzySearchEnabled = mFuzzySearchEnabled; }
Source:
protected void determineDebuggerPath(IDMContext dmc, String hostPath, final DataRequestMonitor<String> rm) { final MIBreakpoints breakpoints = getServicesTracker().getService(MIBreakpoints.class); if (breakpoints == null) { rm.done(hostPath); return; } ISourceLookup sourceLookup = getServicesTracker().getService(ISourceLookup.class); ISourceLookupDMContext srcDmc = DMContexts.getAncestorOfType(dmc, ISourceLookupDMContext.class); if (sourceLookup == null || srcDmc == null) { rm.done(breakpoints.adjustDebuggerPath(hostPath)); return; } sourceLookup.getDebuggerPath(srcDmc, hostPath, new DataRequestMonitor<String>(getExecutor(), rm) { @Override protected void handleSuccess() { rm.done(breakpoints.adjustDebuggerPath(getData())); } }); }

Target:
protected void determineDebuggerPath(IDMContext dmc, String hostPath, final DataRequestMonitor<String> rm) { final IBreakpoints breakpoints = getServicesTracker().getService(IBreakpoints.class); if (!(breakpoints instanceof MIBreakpoints)) { rm.done(hostPath); return; } ISourceLookup sourceLookup = getServicesTracker().getService(ISourceLookup.class); ISourceLookupDMContext srcDmc = DMContexts.getAncestorOfType(dmc, ISourceLookupDMContext.class); if (sourceLookup == null || srcDmc == null) { rm.done(((MIBreakpoints)breakpoints).adjustDebuggerPath(hostPath)); return; } sourceLookup.getDebuggerPath(srcDmc, hostPath, new DataRequestMonitor<String>(getExecutor(), rm) { @Override protected void handleSuccess() { rm.done(((MIBreakpoints)breakpoints).adjustDebuggerPath(getData())); } }); }
Source:
public View getView(int position, View convertView, ViewGroup parent) { int viewType = getItemViewType(position); View v = null; if (viewType == VIEW_TYPE_NAV) { v = getNavView((String) getItem(position), position, convertView, parent); } else if (viewType == VIEW_TYPE_SECTION_DIVIDER) { v = getSectionDividerView(parent); } else { v = getFeedView(position, convertView, parent); } if (v != null && (viewType != VIEW_TYPE_SECTION_DIVIDER || UserPreferences.getFeedFilter() != UserPreferences.FEED_FILTER_NONE)) { TypedValue typedValue = new TypedValue(); if (position == itemAccess.getSelectedItemIndex()) { v.getContext().getTheme().resolveAttribute(R.attr.drawer_activated_color, typedValue, true); v.setBackgroundResource(typedValue.resourceId); } else { v.getContext().getTheme().resolveAttribute(android.R.attr.windowBackground, typedValue, true); v.setBackgroundResource(typedValue.resourceId); } } return v; }

Target:
public View getView(int position, View convertView, ViewGroup parent) { int viewType = getItemViewType(position); View v = null; if (viewType == VIEW_TYPE_NAV) { v = getNavView((String) getItem(position), position, convertView, parent); } else if (viewType == VIEW_TYPE_SECTION_DIVIDER) { v = getSectionDividerView(convertView, parent); } else { v = getFeedView(position, convertView, parent); } if (v != null && viewType != VIEW_TYPE_SECTION_DIVIDER) { TypedValue typedValue = new TypedValue(); if (position == itemAccess.getSelectedItemIndex()) { v.getContext().getTheme().resolveAttribute(R.attr.drawer_activated_color, typedValue, true); v.setBackgroundResource(typedValue.resourceId); } else { v.getContext().getTheme().resolveAttribute(android.R.attr.windowBackground, typedValue, true); v.setBackgroundResource(typedValue.resourceId); } } return v; }
Source:
public boolean checkExistingPatients(String first_name, String last_name, Date age,String city){ List<? extends IPatient> allPatients; allPatients = QueryHelper.retrievePatients(patientRepository); for (IPatient patient : allPatients) { if ((patient.getFirstName().equals(first_name)) && (patient.getLastName().equals(last_name)) && (patient.getAge().equals(age)) && (patient.getCity().equals(city))) { return true; } } return false; }

Target:
public boolean checkExistingPatients(String first_name, String last_name, Date age,String city){ try { List<? extends IPatient> allPatients; allPatients = QueryHelper.retrievePatients(patientRepository); for (IPatient patient : allPatients) { if ((patient.getFirstName().equals(first_name)) && (patient.getLastName().equals(last_name)) && (patient.getAge().equals(age)) && (patient.getCity().equals(city))) { return true; } } return false; } catch (Exception ex) { return false; } }
Source:
public List<CallStackEdge> getLinks(long start, long end, IProgressMonitor monitor) { ITmfStateSystem ss = getStateSystem(); if (ss == null) { return Collections.emptyList(); } int edgeQuark = ss.optQuarkAbsolute("EDGES"); if (edgeQuark == ITmfStateSystem.INVALID_ATTRIBUTE) { return Collections.emptyList(); } List<Integer> quarks = ss.getSubAttributes(edgeQuark, false); List<CallStackEdge> list = new ArrayList<>(); try { for (ITmfStateInterval interval : ss.query2D(quarks, start, end)) { Object value = interval.getValue(); if (monitor.isCanceled()) { return Collections.emptyList(); } else if (value instanceof EdgeStateValue) { EdgeStateValue edge = (EdgeStateValue) value; list.add(new CallStackEdge(edge.getSource(), edge.getDestination(), interval.getStartTime(), interval.getEndTime() - interval.getStartTime() + 1, edge.getId())); } } } catch (IndexOutOfBoundsException | TimeRangeException | StateSystemDisposedException e) { return Collections.emptyList(); } return list; }

Target:
public List<ITmfStateInterval> getLinks(long start, long end, IProgressMonitor monitor) { ITmfStateSystem ss = getStateSystem(); if (ss == null) { return Collections.emptyList(); } Collection<Integer> quarks = getEdgeQuarks(); if (quarks.isEmpty()) { return Collections.emptyList(); } List<ITmfStateInterval> list = new ArrayList<>(); try { for (ITmfStateInterval interval : ss.query2D(quarks, start, end)) { Object value = interval.getValue(); if (monitor.isCanceled()) { return Collections.emptyList(); } else if (value instanceof EdgeStateValue) { list.add(interval); } } } catch (IndexOutOfBoundsException | TimeRangeException | StateSystemDisposedException e) { return Collections.emptyList(); } return list; }
Source:
public void backoffTime() throws RetryableException { Instant startTime = Instant.now(); RecentChangesPoller poller = new RecentChangesPoller(repository, startTime, batchSize, new MetricRegistry()); Instant nextStartTime = startTime.plusSeconds(20); String error = null; Continue aContinue = null; List<RecentChange> recentChanges = new ArrayList<>(); recentChanges.add(new RecentChange(0L, "Q424242", nextStartTime, 42L, 42L, "edit")); Query query = new Query(recentChanges); RecentChangeResponse result = new RecentChangeResponse(error, aContinue, query); ArgumentCaptor<Instant> argument = ArgumentCaptor.forClass(Instant.class); when(repository.fetchRecentChangesByTime(argument.capture(), eq(batchSize))).thenReturn(result); when(repository.isEntityNamespace(0)).thenReturn(true); when(repository.isValidEntity(any(String.class))).thenReturn(true); Batch batch = poller.firstBatch(); assertThat(argument.getValue()).isBefore(startTime.minusSeconds(7)); assertThat(argument.getValue()).isAfter(startTime.minusSeconds(20)); batch = poller.nextBatch(batch); assertThat(batch).isNull(); assertThat(argument.getValue()).isBefore(nextStartTime.minusSeconds(7)); assertThat(argument.getValue()).isAfter(nextStartTime.minusSeconds(20)); }

Target:
public void backoffTime() throws RetryableException { Instant startTime = Instant.now(); RecentChangesPoller poller = new RecentChangesPoller(repository, startTime, batchSize, new MetricRegistry()); Instant nextStartTime = startTime.plusSeconds(20); String error = null; Continue aContinue = null; List<RecentChange> recentChanges = new ArrayList<>(); recentChanges.add(new RecentChange(0L, "Q424242", nextStartTime, 42L, 42L, "edit")); Query query = new Query(recentChanges); RecentChangeResponse result = new RecentChangeResponse(error, aContinue, query); ArgumentCaptor<Instant> argument = ArgumentCaptor.forClass(Instant.class); when(repository.fetchRecentChangesByTime(argument.capture(), eq(batchSize))).thenReturn(result); when(repository.isEntityNamespace(0)).thenReturn(true); when(repository.isValidEntity(any(String.class))).thenReturn(true); Batch batch = poller.firstBatch(); assertThat(argument.getValue()).isBefore(startTime.minusSeconds(7)); assertThat(argument.getValue()).isAfter(startTime.minusSeconds(20)); batch = poller.nextBatch(batch); assertThat(batch).isNotNull(); assertThat(argument.getValue()).isBefore(nextStartTime.minusSeconds(7)); assertThat(argument.getValue()).isAfter(nextStartTime.minusSeconds(20)); }
Source:
private void showShareDialog() { EditText text = (EditText) findViewById(R.id.text); EditText title = (EditText) findViewById(R.id.title); EditText mimeType = (EditText) findViewById(R.id.mime_type); EditText dataUri = (EditText) findViewById(R.id.data_uri); Switch showMru = (Switch) findViewById(R.id.show_most_recently_used); new PrioritySharer.Builder() .setTargets(TARGET_APPS[targetApps.getSelectedItemPosition()]) .setText(text.getText().toString()) .setTitle(title.getText().toString()) .setMimeType(mimeType.getText().toString()) .showMru(showMru.isChecked()) .setDataUri(getDataUriOrNull(dataUri)) .setOnPrepareSharingIntentListener(listener) .show(this); }

Target:
private void showShareDialog() { EditText text = (EditText) findViewById(R.id.text); EditText title = (EditText) findViewById(R.id.title); EditText mimeType = (EditText) findViewById(R.id.mime_type); EditText dataUri = (EditText) findViewById(R.id.data_uri); Switch showMostRecentlyUsed = (Switch) findViewById(R.id.show_most_recently_used); new PrioritySharer.Builder() .setTargets(TARGET_APPS[targetApps.getSelectedItemPosition()]) .setText(text.getText().toString()) .setTitle(title.getText().toString()) .setMimeType(mimeType.getText().toString()) .showMru(showMostRecentlyUsed.isChecked()) .setDataUri(getDataUriOrNull(dataUri)) .setOnPrepareSharingIntentListener(listener) .show(this); }
Source:
public Response clear() { try { final IPluginCacheManager iPluginCacheManager = PentahoSystem.get( IPluginCacheManager.class ); final IReportContentCache cache = iPluginCacheManager.getCache(); cache.cleanupCurrentSession(); final ICacheManager cacheManager = PentahoSystem.get( ICacheManager.class ); cacheManager.clearRegionCache( "report-dataset-cache" ); cacheManager.clearRegionCache( "report-output-handlers" ); return Response.ok().build(); } catch ( final Exception e ) { return Response.serverError().build(); } }

Target:
public Response clear() { try { final IPluginCacheManager iPluginCacheManager = PentahoSystem.get( IPluginCacheManager.class ); final IReportContentCache cache = iPluginCacheManager.getCache(); cache.cleanupCurrentSession(); final ICacheManager cacheManager = PentahoSystem.get( ICacheManager.class ); cacheManager.clearRegionCache( "report-output-handlers" ); DataCacheFactory.getCache().getCacheManager().clearAll(); return Response.ok().build(); } catch ( final Exception e ) { return Response.serverError().build(); } }
Source:
public long getCurrentTimestamp(AtlasReplInfo atlasReplInfo, String entityGuid) throws SemanticException { AtlasServer atlasServer = atlasRestClient.getServer(atlasReplInfo.getSrcCluster()); long ret = (atlasServer == null || atlasServer.getAdditionalInfoRepl(entityGuid) == null) ? 0L : (long) atlasServer.getAdditionalInfoRepl(entityGuid); LOG.debug("HiveAtlasPlugin: fromTimestamp: {}", ret); return ret; }

Target:
private long getCurrentTimestamp(AtlasReplInfo atlasReplInfo, String entityGuid) throws SemanticException { AtlasServer atlasServer = atlasRestClient.getServer(atlasReplInfo.getSrcCluster()); long ret = (atlasServer == null || atlasServer.getAdditionalInfoRepl(entityGuid) == null) ? 0L : (long) atlasServer.getAdditionalInfoRepl(entityGuid); LOG.debug("Current timestamp is: {}", ret); return ret; }
Source:
public FileUploader(String name, AsyncReader fileData, int offsetHi, int offsetLow, int lengthHi, int lengthLow, SymmetricKey baseKey, SymmetricKey metaKey, Location parentLocation, SymmetricKey parentparentKey, ProgressConsumer<Long> monitor, FileProperties fileProperties, int nOriginalFragments, int nAllowedFalures) { long length = lengthLow + ((lengthHi & 0xFFFFFFFFL) << 32); if (fileProperties == null) this.props = new FileProperties(name, length, LocalDateTime.now(), false, Optional.empty()); else this.props = fileProperties; if (baseKey == null) baseKey = SymmetricKey.random(); fragmenter = Fragmenter.getInstance(); long offset = offsetLow + ((offsetHi & 0xFFFFFFFFL) << 32); this.nchunks = length > 0 ? (length + Chunk.MAX_SIZE - 1) / Chunk.MAX_SIZE : 1; this.name = name; this.offset = offset; this.length = length; this.reader = fileData; this.baseKey = baseKey; this.metaKey = metaKey; this.parentLocation = parentLocation; this.parentparentKey = parentparentKey; this.monitor = monitor; this.nOriginalFragments = nOriginalFragments != -1 ? nOriginalFragments : EncryptedChunk.ERASURE_ORIGINAL; this.nAllowedFalures = nAllowedFalures != -1 ? nAllowedFalures : EncryptedChunk.ERASURE_ALLOWED_FAILURES; }

Target:
public FileUploader(String name, AsyncReader fileData, int offsetHi, int offsetLow, int lengthHi, int lengthLow, SymmetricKey baseKey, SymmetricKey metaKey, Location parentLocation, SymmetricKey parentparentKey, ProgressConsumer<Long> monitor, FileProperties fileProperties, int nOriginalFragments, int nAllowedFalures) { long length = lengthLow + ((lengthHi & 0xFFFFFFFFL) << 32); if (fileProperties == null) this.props = new FileProperties(name, length, LocalDateTime.now(), false, Optional.empty()); else this.props = fileProperties; if (baseKey == null) baseKey = SymmetricKey.random(); fragmenter = nAllowedFalures == 0 ? new SplitFragmenter() : new peergos.shared.user.fs.ErasureFragmenter(nOriginalFragments, nAllowedFalures); long offset = offsetLow + ((offsetHi & 0xFFFFFFFFL) << 32); this.nchunks = length > 0 ? (length + Chunk.MAX_SIZE - 1) / Chunk.MAX_SIZE : 1; this.name = name; this.offset = offset; this.length = length; this.reader = fileData; this.baseKey = baseKey; this.metaKey = metaKey; this.parentLocation = parentLocation; this.parentparentKey = parentparentKey; this.monitor = monitor; this.nOriginalFragments = nOriginalFragments != -1 ? nOriginalFragments : EncryptedChunk.ERASURE_ORIGINAL; this.nAllowedFalures = nAllowedFalures != -1 ? nAllowedFalures : EncryptedChunk.ERASURE_ALLOWED_FAILURES; }
Source:
private StorageDomainValidator getStorageDomainValidator(Map.Entry<Guid, StorageDomainValidator> entry) { if (entry.getValue() == null) { entry.setValue(new StorageDomainValidator(getStorageDomainDAO().getForStoragePool(entry.getKey(), spId))); } return entry.getValue(); }

Target:
private StorageDomainValidator getStorageDomainValidator(Map.Entry<Guid, StorageDomainValidator> entry) { if (entry.getValue() == null) { entry.setValue(new StorageDomainValidator(getStorageDomainDAO().getForStoragePool(entry.getKey(), storagePoolId))); } return entry.getValue(); }
Source:
public Response interceptWmtsRequest(HttpServletRequest request, String serviceId) throws UnsupportedEncodingException, InterceptorException, HttpException, URISyntaxException { Matcher matcher = WMTS_PATTERN.matcher(request.getRequestURI()); int id = Integer.parseInt(serviceId); if (!matcher.matches()) { throw new InterceptorException("No WMTS request path found!"); } String path = matcher.group(1); List<Layer> layers = layerService.findAll(); WmtsLayerDataSource dataSource = null; for (Layer layer : layers) { if (layer.getSource() instanceof WmtsLayerDataSource) { WmtsLayerDataSource source = (WmtsLayerDataSource) layer.getSource(); if (source.getId().equals(id)) { dataSource = source; } } } if (dataSource == null) { Response response = new Response(HttpStatus.FORBIDDEN, null, new byte[0]); return response; } String baseUrl = dataSource.getUrl(); Response response = HttpUtil.get(baseUrl + "/" + path); HttpHeaders forwardingHeaders = getResponseHeadersToForward(response.getHeaders()); response.setHeaders(forwardingHeaders); return response; }

Target:
public Response interceptWmtsRequest(HttpServletRequest request, String serviceId) throws UnsupportedEncodingException, InterceptorException, HttpException, URISyntaxException { Matcher matcher = WMTS_PATTERN.matcher(request.getRequestURI()); int id = Integer.parseInt(serviceId); if (!matcher.matches()) { throw new InterceptorException("No WMTS request path found!"); } String path = matcher.group(1); List<Layer> layers = layerService.findAll(); WmtsLayerDataSource dataSource = null; for (Layer layer : layers) { if (layer.getSource() instanceof WmtsLayerDataSource) { WmtsLayerDataSource source = (WmtsLayerDataSource) layer.getSource(); if (source.getId().equals(id)) { dataSource = source; break; } } } if (dataSource == null) { return new Response(HttpStatus.FORBIDDEN, null, new byte[0]); } String baseUrl = dataSource.getUrl(); Response response = HttpUtil.get(baseUrl + "/" + path); HttpHeaders forwardingHeaders = getResponseHeadersToForward(response.getHeaders()); response.setHeaders(forwardingHeaders); return response; }
Source:
public Environment findOne(String application, String profile, String label, boolean includeOrigin) { Environment env = new Environment(application, new String[] { profile }, label, null, null); if (this.environmentRepositories.size() == 1) { Environment envRepo = this.environmentRepositories.get(0).findOne(application, profile, label, includeOrigin); env.addAll(envRepo.getPropertySources()); env.setVersion(envRepo.getVersion()); env.setState(envRepo.getState()); } else { for (EnvironmentRepository repo : environmentRepositories) { try { env.addAll(repo.findOne(application, profile, label, includeOrigin).getPropertySources()); } catch (Exception e) { log.info("Error adding environment for " + repo); } } } return env; }

Target:
public Environment findOne(String application, String profile, String label, boolean includeOrigin) { Environment env = new Environment(application, new String[] { profile }, label, null, null); if (this.environmentRepositories.size() == 1) { Environment envRepo = this.environmentRepositories.get(0).findOne(application, profile, label, includeOrigin); env.addAll(envRepo.getPropertySources()); env.setVersion(envRepo.getVersion()); env.setState(envRepo.getState()); } else { for (EnvironmentRepository repo : environmentRepositories) { try { env.addAll(repo.findOne(application, profile, label, includeOrigin).getPropertySources()); } catch (Exception e) { if (failOnError) { throw e; } else { log.info("Error adding environment for " + repo); } } } } return env; }
Source:
public void replaceMilestoneAliasesTestNoOpenMilestone() { TurboMilestone msClose1 = new TurboMilestone(REPO, 1, "future1"); msClose1.setOpen(false); msClose1.setDueDate(Optional.of(LocalDate.now().plusMonths(2))); TurboMilestone msClose2 = new TurboMilestone(REPO, 2, "future2"); msClose2.setOpen(false); msClose2.setDueDate(Optional.of(LocalDate.now().plusMonths(3))); TurboMilestone msClose3 = new TurboMilestone(REPO, 3, "future3"); msClose3.setOpen(false); msClose3.setDueDate(Optional.of(LocalDate.now().plusMonths(4))); model = TestUtils.singletonModel(new Model(REPO, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(Arrays.asList(msClose1, msClose2, msClose3)), new ArrayList<>())); FilterExpression noMilestoneAlias; List<Qualifier> milestoneQualifiers; noMilestoneAlias = Qualifier.replaceMilestoneAliases(model, Parser.parse("milestone:current")); assertEquals(noMilestoneAlias.getQualifierNames().size(), 1); assertEquals(noMilestoneAlias.getQualifierNames().get(0), "false"); milestoneQualifiers = noMilestoneAlias.find(Qualifier::isMilestoneQualifier); assertEquals(milestoneQualifiers.size(), 0); noMilestoneAlias = Qualifier.replaceMilestoneAliases(model, Parser.parse("milestone:current-1")); assertEquals(noMilestoneAlias.getQualifierNames().size(), 1); assertEquals(noMilestoneAlias.getQualifierNames().get(0), "false"); milestoneQualifiers = noMilestoneAlias.find(Qualifier::isMilestoneQualifier); assertEquals(milestoneQualifiers.size(), 0); noMilestoneAlias = Qualifier.replaceMilestoneAliases(model, Parser.parse("milestone:current+1")); assertEquals(noMilestoneAlias.getQualifierNames().size(), 1); assertEquals(noMilestoneAlias.getQualifierNames().get(0), "false"); milestoneQualifiers = noMilestoneAlias.find(Qualifier::isMilestoneQualifier); assertEquals(milestoneQualifiers.size(), 0); }

Target:
public void replaceMilestoneAliasesTestNoOpenMilestone() { TurboMilestone msClose1 = new TurboMilestone(REPO, 1, "future1"); msClose1.setOpen(false); msClose1.setDueDate(Optional.of(LocalDate.now().plusMonths(2))); TurboMilestone msClose2 = new TurboMilestone(REPO, 2, "future2"); msClose2.setOpen(false); msClose2.setDueDate(Optional.of(LocalDate.now().plusMonths(3))); TurboMilestone msClose3 = new TurboMilestone(REPO, 3, "future3"); msClose3.setOpen(false); msClose3.setDueDate(Optional.of(LocalDate.now().plusMonths(4))); model = TestUtils.singletonModel(new Model(REPO, new ArrayList<>(), new ArrayList<>(), new ArrayList<>(Arrays.asList(msClose1, msClose2, msClose3)), new ArrayList<>())); assertMilestoneAliasFalseQualifierSize1("milestone:current"); assertMilestoneAliasFalseQualifierSize1("milestone:current+1"); FilterExpression noMilestoneAlias; List<Qualifier> milestoneQualifiers; noMilestoneAlias = Qualifier.replaceMilestoneAliases(model, Parser.parse("milestone:current-1")); milestoneQualifiers = noMilestoneAlias.find(Qualifier::isMilestoneQualifier); milestoneQualifiers.stream().forEach(msQ -> { assertEquals(true, msQ.getContent().get().equalsIgnoreCase("future3")); }); }
Source:
@Test public void triggersNewBuild() throws Exception { TaskListener listener = new StreamTaskListener(System.out, Charset.defaultCharset()); Launcher launcher = j.jenkins.createLauncher(listener); FreeStyleProject project = j.createFreeStyleProject(); MercurialSCM scm = new MercurialSCM(null, tmp.getRoot().getPath(), null, null, null, null, false, null); project.setScm(scm); File repo = tmp.getRoot(); m.hg(repo, "init"); m.touchAndCommit(repo, "x"); PollingResult pr = scm.compare( launcher, listener, new MercurialTagAction("tip","",null,null), listener.getLogger(), Jenkins.getInstance().toComputer().getNode(), new FilePath(tmp.getRoot()), project); assertEquals(PollingResult.Change.SIGNIFICANT, pr.change); }

Target:
@Test public void triggersNewBuild() throws Exception { TaskListener listener = new StreamTaskListener(System.out, Charset.defaultCharset()); Launcher launcher = j.jenkins.createLauncher(listener); FreeStyleProject project = j.createFreeStyleProject(); MercurialSCM scm = new MercurialSCM(null, tmp.getRoot().getPath(), null, null, null, null, false, null); project.setScm(scm); File repo = tmp.getRoot(); m.hg(repo, "init"); m.touchAndCommit(repo, "x"); PollingResult pr = scm.compare( launcher, listener, new MercurialTagAction("tip","",null,null), listener.getLogger(), j.jenkins, new FilePath(tmp.getRoot()), project); assertEquals(PollingResult.Change.SIGNIFICANT, pr.change); }
Source:
private void processVariables() { final Arguments args1 = (Arguments) this.getUserDefinedVariablesAsProperty().getObjectValue(); Arguments args = (Arguments) args1.clone(); final JMeterVariables vars = JMeterContextService.getContext().getVariables(); Iterator<Map.Entry<String, String>> it = args.getArgumentsAsMap().entrySet().iterator(); Map.Entry<String, String> var; while (it.hasNext()) { var = it.next(); log.debug("Setting " + var.getKey() + "=" + var.getValue()); vars.put(var.getKey(), var.getValue()); } }

Target:
private void processVariables() { final Arguments args1 = (Arguments) this.getUserDefinedVariablesAsProperty().getObjectValue(); Arguments args = (Arguments) args1.clone(); final JMeterVariables vars = JMeterContextService.getContext().getVariables(); Iterator<Map.Entry<String, String>> it = args.getArgumentsAsMap().entrySet().iterator(); Map.Entry<String, String> var; while (it.hasNext()) { var = it.next(); if (log.isDebugEnabled()) { log.debug("Setting " + var.getKey() + "=" + var.getValue()); } vars.put(var.getKey(), var.getValue()); } }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; HostStateEntity that = (HostStateEntity) o; if (hostId != null ? !hostId.equals(that.hostId) : that.hostId != null) return false; if (availableMem != null ? !availableMem.equals(that.availableMem) : that.availableMem != null) return false; if (timeInState != null ? !timeInState.equals(that.timeInState) : that.timeInState!= null) return false; if (agentVersion != null ? !agentVersion.equals(that.agentVersion) : that.agentVersion != null) return false; if (currentState != null ? !currentState.equals(that.currentState) : that.currentState != null) return false; return true; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; HostStateEntity that = (HostStateEntity) o; return Objects.equals(hostId, that.hostId) && Objects.equals(availableMem, that.availableMem) && Objects.equals(timeInState, that.timeInState) && Objects.equals(agentVersion, that.agentVersion) && currentState == that.currentState; }
Source:
private void prepareTestFiles() throws IOException { final AzureBlobFileSystem fs = getFileSystem(); for (String levelOneFolder : SORTED_ENTRY_NAMES) { Path levelOnePath = new Path("/" + levelOneFolder); Assert.assertTrue(fs.mkdirs(levelOnePath)); for (String fileName : SORTED_ENTRY_NAMES) { Path filePath = new Path(levelOnePath, fileName); fs.create(filePath); Assert.assertTrue(fs.exists(filePath)); } } }

Target:
private void prepareTestFiles() throws IOException { final AzureBlobFileSystem fs = getFileSystem(); for (String levelOneFolder : SORTED_ENTRY_NAMES) { Path levelOnePath = new Path("/" + levelOneFolder); Assert.assertTrue(fs.mkdirs(levelOnePath)); for (String fileName : SORTED_ENTRY_NAMES) { Path filePath = new Path(levelOnePath, fileName); ContractTestUtils.touch(fs, filePath); ContractTestUtils.assertIsFile(fs, filePath); } } }
Source:
private void read(SelectionKey key, Transmissions transmissions) throws InterruptedException, IOException { long startTimeToReadInMs = time.milliseconds(); try { if (!transmissions.hasReceive()) { transmissions.receive = new NetworkReceive(transmissions.getConnectionId(), new BoundedByteBufferReceive(), time); } SocketChannel socketChannel = channel(key); long bytesRead = transmissions.receive.getReceivedBytes().readFrom(socketChannel); if (bytesRead == -1) { close(key); return; } metrics.selectorBytesReceived.update(bytesRead); metrics.selectorBytesReceivedCount.inc(bytesRead); if (transmissions.receive.getReceivedBytes().isReadComplete()) { this.completedReceives.add(transmissions.receive); metrics.updateNodeReceiveMetric(transmissions.remoteHostName, transmissions.remotePort, transmissions.receive.getReceivedBytes().getPayload().limit(), time.milliseconds() - transmissions.receive.getReceiveStartTimeInMs()); transmissions.clearReceive(); } } finally { if (logger.isTraceEnabled()) { long readTime = time.milliseconds() - startTimeToReadInMs; logger.trace("SocketServer time spent on read per key = {}", transmissions.connectionId, readTime); } } }

Target:
private void read(SelectionKey key, Transmissions transmissions) throws IOException { long startTimeToReadInMs = time.milliseconds(); try { if (!transmissions.hasReceive()) { transmissions.receive = new NetworkReceive(transmissions.getConnectionId(), new BoundedByteBufferReceive(), time); } SocketChannel socketChannel = channel(key); long bytesRead = transmissions.receive.getReceivedBytes().readFrom(socketChannel); if (bytesRead == -1) { close(key); return; } metrics.selectorBytesReceived.update(bytesRead); metrics.selectorBytesReceivedCount.inc(bytesRead); if (transmissions.receive.getReceivedBytes().isReadComplete()) { this.completedReceives.add(transmissions.receive); metrics.updateNodeReceiveMetric(transmissions.remoteHostName, transmissions.remotePort, transmissions.receive.getReceivedBytes().getPayload().limit(), time.milliseconds() - transmissions.receive.getReceiveStartTimeInMs()); transmissions.clearReceive(); } } finally { long readTime = time.milliseconds() - startTimeToReadInMs; logger.trace("SocketServer time spent on read per key = {}", transmissions.connectionId, readTime); } }
Source:
private void contactsRemoved(Collection<String> addresses) { if (roster == null) return; for (String address : addresses) { XMPPContact removedContact = contacts.remove(address); if (removedContact == null) { log.info("Strange behaviour: Contact for " + address + " not found!"); continue; } removedContact.removeResources(); removedContact.setBaseStatus(ContactStatus.TYPE_REMOVED); notifyListeners(removedContact, UpdateType.REMOVED); } }

Target:
private void contactsRemoved(Collection<String> addresses) { if (roster == null) return; for (String address : addresses) { XMPPContact removedContact = contacts.remove(address); if (removedContact == null) { log.warn("Strange behaviour: Contact for " + address + " not found!"); continue; } discoveryService.removeResources(removedContact.getResources()); removedContact.removeResources(); removedContact.setBaseStatus(ContactStatus.TYPE_REMOVED); notifyListeners(removedContact, UpdateType.REMOVED); } }
Source:
private URL getUrl() { String urlString = null; URL url = null; try { urlString = oProxyHelper .getAdapterEndPointFromConnectionManager(DIRECT_CONFIG_SERVICE_NAME); } catch (ConnectionManagerException ex) { LOG.error("Error reading directConfig Url cannot be found: {}", ex.getLocalizedMessage(), ex); } try { url = new URL(urlString); } catch (MalformedURLException ex) { LOG.error("Error while converting urlString into Url format {}", ex.getMessage(), ex); } return url; }

Target:
private URL getUrl() { String urlString = null; URL url = null; try { urlString = oProxyHelper .getAdapterEndPointFromConnectionManager(DIRECT_CONFIG_SERVICE_NAME); } catch (ConnectionManagerException ex) { LOG.error("Error reading directConfig Url cannot be found: {}", ex.getLocalizedMessage(), ex); } try { url = new URL(urlString); } catch (MalformedURLException ex) { LOG.error("Error while converting urlString into Url format {}", ex.getLocalizedMessage(), ex); } return url; }
Source:
public int executeBackendUpdateQuery(BackendQuery<String> query, QueryParameters queryParameters, TupleContext tupleContext) { Map<String, Object> parameters = getParameters( queryParameters ); String nativeQuery = buildNativeQuery( query, queryParameters ); Statement statement = new Statement( nativeQuery, parameters ); statement.setResultDataContents( Arrays.asList( Statement.AS_ROW ) ); Statements statements = new Statements(); statements.addStatement( statement ); Long txId = transactionId( tupleContext.getTransactionContext() ); StatementsResponse response = client.executeQueriesInOpenTransaction( txId, statements ); return 0; }

Target:
public int executeBackendUpdateQuery(BackendQuery<String> query, QueryParameters queryParameters, TupleContext tupleContext) { Map<String, Object> parameters = getParameters( queryParameters ); String nativeQuery = buildNativeQuery( query, queryParameters ); Statement statement = new Statement( nativeQuery, parameters ); statement.setResultDataContents( Arrays.asList( Statement.AS_ROW ) ); Statements statements = new Statements(); statements.addStatement( statement ); Long txId = transactionId( tupleContext.getTransactionContext() ); StatementsResponse response = client.executeQueriesInOpenTransaction( txId, statements ); validate( response, nativeQuery ); return UNKNOWN_UPDATES; }
Source:
public String getLog() throws IOException { File logFile = getLogFile(); if (null == logFile) { return ""; } return Util.loadFile(logFile); }

Target:
public String getLog() throws IOException { return Util.loadFile(getLogFileForJob(job)); }
Source:
public StreamManager(@Nonnull CorfuRuntime runtime, int maxSubscribers) { this.runtime = runtime; this.maxSubscribers = maxSubscribers; this.subscriptions = new HashMap<>(); this.scheduledExecutorService = Executors.newScheduledThreadPool(maxSubscribers); }

Target:
public StreamManager(@Nonnull CorfuRuntime runtime, int maxSubscribers) { this.runtime = runtime; this.subscriptions = new HashMap<>(); this.scheduledExecutorService = Executors.newScheduledThreadPool(maxSubscribers); }
Source:
public void verifyNoAsyncErrors() { for (Throwable e : asyncErrors) { if (e instanceof AssertionError) { throw (AssertionError) e; } else { fail("Async error during test execution: " + e, e); } } }

Target:
public void verifyNoAsyncErrors() { for (Throwable e : asyncErrors) { if (e instanceof AssertionError) { throw (AssertionError) e; } else { fail("Async error during test execution: " + e.getMessage(), e); } } }
Source:
public Value evaluate(DataSourceFactory dsf, Value... args) throws FunctionException { final CoordinateReferenceSystem crs = args[0].getCRS(); if (crs == null) { return ValueFactory.createNullValue(); } else { String identifiers = crs.getName(); return ValueFactory.createValue(identifiers); } }

Target:
public Value evaluate(DataSourceFactory dsf, Value... args) throws FunctionException { final CoordinateReferenceSystem crs = args[0].getCRS(); if (crs == null) { return ValueFactory.createNullValue(); } else { String authorityName = crs.getAuthorityName(); String authorityKey= crs.getAuthorityKey(); return ValueFactory.createValue(authorityName+":"+authorityKey); } }
Source:
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { inflater.inflate(R.menu.menu_main, menu); viewPager.post(new Runnable() { @Override public void run() { setUpOverflowButton(); } }); }

Target:
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) { super.onCreateOptionsMenu(menu, inflater); inflater.inflate(R.menu.menu_main, menu); viewPager.post(new Runnable() { @Override public void run() { setUpOverflowButton(); } }); }
Source:
public AuthenticationConfiguration(Predicate<HttpServerExchange> isAuthenticationRequiredPredicate, List<AuthenticationMechanism> authMechanisms, IdentityManager identityManager) { Preconditions.checkNotNull(isAuthenticationRequiredPredicate, "Authentication constraint predicate has to be provided"); Preconditions.checkArgument(!authMechanisms.isEmpty(), "At least one AuthenticationMechanism has to be provided."); Preconditions.checkNotNull(identityManager, "IdentityManager has to be provided"); this.isAuthenticationRequiredPredicate = isAuthenticationRequiredPredicate; this.authMechanisms = authMechanisms; this.identityManager = identityManager; }

Target:
public AuthenticationConfiguration(Predicate<HttpServerExchange> isAuthenticationRequiredPredicate, List<AuthenticationMechanism> authMechanisms, IdentityManager identityManager) { Preconditions.checkNotNull(isAuthenticationRequiredPredicate, "IsAuthenticationRequired predicate has to be provided"); Preconditions.checkArgument(!authMechanisms.isEmpty(), "At least one AuthenticationMechanism has to be provided."); Preconditions.checkNotNull(identityManager, "IdentityManager has to be provided"); this.isAuthenticationRequiredPredicate = isAuthenticationRequiredPredicate; this.authMechanisms = authMechanisms; this.identityManager = identityManager; }
Source:
public static String getGoExecutablePath(@Nullable String sdkHomePath) { if (sdkHomePath != null) { if (isAppEngineSdkPath(sdkHomePath)) { String executable = GoEnvironmentUtil.getBinaryFileNameForPath(GoConstants.GAE_EXECUTABLE_NAME); sdkHomePath = StringUtil.trimEnd(sdkHomePath, GoConstants.APP_ENGINE_GO_ROOT_DIRECTORY_PATH); return sdkHomePath.endsWith(GoConstants.GCLOUD_APP_ENGINE_DIRECTORY_PATH) ? FileUtil.join(StringUtil.trimEnd(sdkHomePath, GoConstants.GCLOUD_APP_ENGINE_DIRECTORY_PATH), "bin", executable) : FileUtil.join(sdkHomePath, SystemInfo.isWindows ? StringUtil.replace(executable, ".exe", ".bat") : executable); } else { return FileUtil.join(sdkHomePath, "bin", GoEnvironmentUtil.getBinaryFileNameForPath(GoConstants.GO_EXECUTABLE_NAME)); } } return null; }

Target:
public static String getGoExecutablePath(@Nullable String sdkHomePath) { if (sdkHomePath != null) { if (isAppEngineSdkPath(sdkHomePath)) { sdkHomePath = StringUtil.trimEnd(PathUtil.toSystemIndependentName(sdkHomePath), GoConstants.APP_ENGINE_GO_ROOT_DIRECTORY_PATH); return sdkHomePath.endsWith(GoConstants.GCLOUD_APP_ENGINE_DIRECTORY_PATH) ? FileUtil.join(StringUtil.trimEnd(sdkHomePath, GoConstants.GCLOUD_APP_ENGINE_DIRECTORY_PATH), "bin", SystemInfo.isWindows ? GoConstants.GAE_CMD_EXECUTABLE_NAME : GoConstants.GAE_EXECUTABLE_NAME) : FileUtil.join(sdkHomePath, SystemInfo.isWindows ? GoConstants.GAE_BAT_EXECUTABLE_NAME : GoConstants.GAE_EXECUTABLE_NAME); } else { return FileUtil.join(sdkHomePath, "bin", GoEnvironmentUtil.getBinaryFileNameForPath(GoConstants.GO_EXECUTABLE_NAME)); } } return null; }
Source:
private static void verify(String methodName, boolean expectPass, int guessing, char... laResults) throws Exception { final AssertGenTextBlockLexer instance = new AssertGenTextBlockLexer(); instance.laPosition = 0; instance.laResults = laResults.clone(); instance.inputState.guessing = guessing; final Method method = GeneratedTextBlockLexer.class.getDeclaredMethod(methodName, boolean.class); boolean exception; try { method.invoke(instance, true); exception = false; } catch (InvocationTargetException ex) { if (expectPass) { throw ex; } final Class<?> clss = ex.getTargetException().getClass(); if (clss != NoViableAltForCharException.class && clss != SemanticException.class) { throw ex; } exception = true; } if (expectPass) { assertFalse(exception, "Call to GeneratedJava14TextBlockLexer." + methodName + " resulted in an exception"); } else { assertTrue(exception, "Call to GeneratedJava14TextBlockLexer." + methodName + " did not result in an exception"); } }

Target:
private static void verify(String methodName, boolean expectPass, int guessing, char... laResults) throws Exception { final AssertGenTextBlockLexer instance = new AssertGenTextBlockLexer(); instance.laPosition = 0; instance.laResults = laResults.clone(); instance.inputState.guessing = guessing; final Method method = GeneratedTextBlockLexer.class.getDeclaredMethod(methodName, boolean.class); boolean exception; try { method.invoke(instance, true); exception = false; } catch (InvocationTargetException ex) { if (expectPass) { throw ex; } final Class<?> clss = ex.getTargetException().getClass(); if (clss != NoViableAltForCharException.class && clss != SemanticException.class) { throw ex; } exception = true; } if (expectPass) { assertFalse(exception, "Call to GeneratedTextBlockLexer." + methodName + " resulted in an exception"); } else { assertTrue(exception, "Call to GeneratedTextBlockLexer." + methodName + " did not result in an exception"); } }
Source:
void refreshConstraintComponent() { if (isBooleanType() || isStructureType() || isContextType() || isList() || isIndirectTypeOf(CAN_NOT_HAVE_CONSTRAINT)) { dataTypeConstraintComponent.disable(); } else { dataTypeConstraintComponent.enable(); } }

Target:
void refreshConstraintComponent() { if (canNotHaveConstraint()) { dataTypeConstraintComponent.disable(); } else { dataTypeConstraintComponent.enable(); } }
Source:
private void runProducer() { for (int i = 0; i < numThreads; i++) { CorfuRuntime rt = rts[i % rts.length]; CorfuTableOperations corfuTableOperations = new CorfuTableOperations(operationName, rt, numRequests, ratio,false, false); runProducer(corfuTableOperations); } }

Target:
private void runProducer() { for (int i = 0; i < numThreads; i++) { CorfuRuntime runtime = runtimes.getRuntime(i); UUID uuid = streams.getStreamID(i); CorfuTable<String, String> table = corfuTables.getTable(uuid); CorfuTableOperations corfuTableOperations = new CorfuTableOperations(operationName, runtime, table, numRequests, ratio); runProducer(corfuTableOperations); } }
Source:
public void idle() { if (lastSendInterval++ >= sendIntervals) { lastSendInterval = 0; Iterator<DispatchAttempt> iterator = sendQueue.iterator(); while (iterator.hasNext()) { DispatchAttempt attempt = iterator.next(); try { EventMessageContent message = new EventMessageContent(); message.prepareMessage(hostName, attempt.event, isBodyHtml); log.info("Sending mail subject='{}' to='{}'", message.getMessageSubject(), attempt.address); log.debug("Send mail body='{}'", message.getMessageBody()); sendMail(attempt.address, message.getMessageSubject(), message.getMessageBody()); log.info( "E-mail subject='{}' to='{}' sent successfully", message.getMessageSubject(), attempt.address ); notifyObservers(DispatchResult.success(attempt.event, attempt.address, EventNotificationMethod.SMTP)); iterator.remove(); } catch (Exception ex) { attempt.retries++; if (attempt.retries >= retries) { notifyObservers(DispatchResult.failure(attempt.event, attempt.address, EventNotificationMethod.SMTP, ex.getMessage())); iterator.remove(); } } } } }

Target:
public void idle() { if (lastSendInterval++ >= sendIntervals) { lastSendInterval = 0; Iterator<DispatchAttempt> iterator = sendQueue.iterator(); while (iterator.hasNext()) { DispatchAttempt attempt = iterator.next(); try { EventMessageContent message = new EventMessageContent(); message.prepareMessage(hostName, attempt.event, isBodyHtml); log.info("Send mail subject='{}' to='{}'", message.getMessageSubject(), attempt.address); log.debug("Send mail body='{}'", message.getMessageBody()); sendMail(attempt.address, message.getMessageSubject(), message.getMessageBody()); log.info( "Mail subject='{}' to='{}' sent successfully", message.getMessageSubject(), attempt.address ); notifyObservers(DispatchResult.success(attempt.event, attempt.address, EventNotificationMethod.SMTP)); iterator.remove(); } catch (Exception ex) { attempt.retries++; if (attempt.retries >= retries) { notifyObservers(DispatchResult.failure(attempt.event, attempt.address, EventNotificationMethod.SMTP, ex.getMessage())); iterator.remove(); } } } } }
Source:
private static Stream<Profile> parseProfileName( File profile ) { File profileFolder = profile.getParentFile(); File dir = profileFolder.getParentFile(); String name = profile.getName(); if ( !name.endsWith( SUFFIX_CACHEPROF ) ) { return Stream.empty(); } int lastDot = name.lastIndexOf( '.' ); int secondLastDot = name.lastIndexOf( '.', lastDot - 1 ); String countStr = name.substring( secondLastDot + 1, lastDot ); try { long sequenceId = Long.parseLong( countStr, 16 ); String mappedFileName = name.substring( 0, secondLastDot ); return Stream.of( new Profile( profile, new File( dir, mappedFileName ), sequenceId ) ); } catch ( NumberFormatException e ) { return Stream.empty(); } }

Target:
private static Stream<Profile> parseProfileName( File profile ) { File profileFolder = profile.getParentFile(); File dir = profileFolder.getParentFile(); String name = profile.getName(); if ( !name.endsWith( SUFFIX_CACHEPROF ) ) { return Stream.empty(); } int lastDot = name.lastIndexOf( '.' ); int secondLastDot = name.lastIndexOf( '.', lastDot - 1 ); String countStr = name.substring( secondLastDot + 1, lastDot ); try { long sequenceId = Long.parseLong( countStr, 10 ); String mappedFileName = name.substring( 0, secondLastDot ); return Stream.of( new Profile( profile, new File( dir, mappedFileName ), sequenceId ) ); } catch ( NumberFormatException e ) { return Stream.empty(); } }