auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void forEach(InputObjectState uids, Consumer<Uid> consumer) { do { try { Uid uid = new Uid(uids.unpackBytes()); if (uid.equals(Uid.nullUid())) { return; } consumer.accept(uid); } catch (IOException e) { if (LRALogger.logger.isTraceEnabled()) { <START> LRALogger.logger.tracef( <END> "LRARecoverModule: Exception while unpacking records of type %s", _transactionType, e); } else if (LRALogger.logger.isInfoEnabled()) { LRALogger.logger.infof("LRARecoverModule: Exception while unpacking records of type: %s", e.getMessage()); } return; } } while (true); }</code><technical_language>above, please tracef(Throwable t, String format, Object... params)</technical_language>

Target:
private void forEach(InputObjectState uids, Consumer<Uid> consumer) { do { try { Uid uid = new Uid(uids.unpackBytes()); if (uid.equals(Uid.nullUid())) { return; } consumer.accept(uid); } catch (IOException e) { if (LRALogger.logger.isTraceEnabled()) { LRALogger.logger.tracef(e, "LRARecoverModule: Object store exception %s while unpacking a record of type %s", e.getMessage(), _transactionType); } else if (LRALogger.logger.isInfoEnabled()) { LRALogger.logger.infof( "LRARecoverModule: Object store exception %s while unpacking a record of type: %s", e.getMessage()); } return; } } while (true); }
Source:
<code>private static void asyncRename( HdfsEnvironment hdfsEnvironment, ListeningExecutorService executor, AtomicBoolean cancelled, List<ListenableFuture<?>> fileRenameFutures, HdfsContext context, Path currentPath, Path targetPath, List<String> fileNames) { FileSystem fileSystem = getFileSystem(hdfsEnvironment, context, currentPath); for (String fileName : fileNames) { Path source = new Path(currentPath, fileName); Path target = new Path(targetPath, fileName); <START> fileRenameFutures.add(executor.submit(() -> renameFile(fileSystem, source, target, cancelled::get))); <END> } }</code><technical_language>dropped cancelled parameter rename method, this be: java fileRenameFutures.add(executor.submit(() -> { if (cancelled.get()) { return; } renameFile(fileSystem, source, target))); }</technical_language>

Target:
private static void asyncRename( HdfsEnvironment hdfsEnvironment, ListeningExecutorService executor, AtomicBoolean cancelled, List<ListenableFuture<?>> fileRenameFutures, HdfsContext context, Path currentPath, Path targetPath, List<String> fileNames) { FileSystem fileSystem = getFileSystem(hdfsEnvironment, context, currentPath); for (String fileName : fileNames) { Path source = new Path(currentPath, fileName); Path target = new Path(targetPath, fileName); fileRenameFutures.add(executor.submit(() -> { if (cancelled.get()) { return; } renameFile(fileSystem, source, target); })); } }
Source:
<code>public void testToDateWithIncorrectFormatPattern() throws Exception { String sqlText = "values to_date('2018-12','MM-DDD')"; try (ResultSet rs = methodWatcher.executeQuery(sqlText)) { fail("Expected exception the syntax of the string representation of a datetime value is incorrect"); } catch (SQLDataException e) { <START> assertEquals("The syntax of the string representation of a datetime value is incorrect.", e.getLocalizedMessage()); <END> } }</code><technical_language>Please check SQLState message (which locale dependant)</technical_language>

Target:
public void testToDateWithIncorrectFormatPattern() throws Exception { String sqlText = "values to_date('2018-12','MM-DDD')"; try (ResultSet rs = methodWatcher.executeQuery(sqlText)) { fail("Expected exception the syntax of the string representation of a datetime value is incorrect"); } catch (SQLDataException e) { assertEquals("22007", e.getSQLState()); } }
Source:
<code>public static TimeLockAgent create(MetricsManager metricsManager, TimeLockInstallConfiguration install, Supplier<TimeLockRuntimeConfiguration> runtime, UserAgent userAgent, int threadPoolSize, long blockingTimeoutMs, Consumer<Object> registrar, Optional<Consumer<UndertowService>> undertowRegistrar, OrderableSlsVersion timeLockVersion) { TimeLockDialogueServiceProvider timeLockDialogueServiceProvider = createTimeLockDialogueServiceProvider( metricsManager, install, userAgent); PaxosResourcesFactory.TimelockPaxosInstallationContext installationContext = ImmutableTimelockPaxosInstallationContext .of(install, userAgent, timeLockDialogueServiceProvider, timeLockVersion); PaxosResources paxosResources = PaxosResourcesFactory.create( installationContext, metricsManager, Suppliers.compose(TimeLockRuntimeConfiguration::paxos, runtime::get)); PersistedSchemaVersion persistedSchemaVersion = PersistedSchemaVersion .create(installationContext.sqliteDataSource()); persistedSchemaVersion.upgradeVersion(SCHEMA_VERSION); <START> verifySchemaVersion(persistedSchemaVersion); <END> TimeLockAgent agent = new TimeLockAgent( metricsManager, install, runtime, undertowRegistrar, threadPoolSize, blockingTimeoutMs, registrar, paxosResources, userAgent, persistedSchemaVersion, installationContext.sqliteDataSource()); agent.createAndRegisterResources(); return agent; }</code><technical_language>this need setting of PaxosResources etc.? this currently migration happens</technical_language>

Target:
public static TimeLockAgent create( MetricsManager metricsManager, TimeLockInstallConfiguration install, Supplier<TimeLockRuntimeConfiguration> runtime, UserAgent userAgent, int threadPoolSize, long blockingTimeoutMs, Consumer<Object> registrar, Optional<Consumer<UndertowService>> undertowRegistrar, OrderableSlsVersion timeLockVersion) { TimeLockDialogueServiceProvider timeLockDialogueServiceProvider = createTimeLockDialogueServiceProvider(metricsManager, install, userAgent); PaxosResourcesFactory.TimelockPaxosInstallationContext installationContext = ImmutableTimelockPaxosInstallationContext.of( install, userAgent, timeLockDialogueServiceProvider, timeLockVersion); PersistedSchemaVersion persistedSchemaVersion = PersistedSchemaVersion.create(installationContext.sqliteDataSource()); persistedSchemaVersion.upgradeVersion(SCHEMA_VERSION); verifySchemaVersion(persistedSchemaVersion); PaxosResources paxosResources = PaxosResourcesFactory.create( installationContext, metricsManager, Suppliers.compose(TimeLockRuntimeConfiguration::paxos, runtime::get)); TimeLockAgent agent = new TimeLockAgent( metricsManager, install, runtime, undertowRegistrar, threadPoolSize, blockingTimeoutMs, registrar, paxosResources, userAgent, persistedSchemaVersion, installationContext.sqliteDataSource()); agent.createAndRegisterResources(); return agent; }
Source:
<code>public VirtualFile[] getFiles(String s) throws TranslatorException { <START> if (s == null || s.isEmpty()) { <END> return null; } if(s3Client.doesObjectExist(s3Config.getBucket(), s)){ ListObjectsRequest listObjectsRequest = new ListObjectsRequest() .withBucketName(s3Config.getBucket()) .withPrefix(s); ObjectListing objectListing = s3Client.listObjects(listObjectsRequest); return new VirtualFile[] {new S3VirtualFile(s3Client, objectListing.getObjectSummaries().get(0), s3Config)}; } if(isDirectory(s)){ if(!s.endsWith(SLASH)) { s += SLASH; } return convert(s); } String parentPath; if(s.contains(SLASH)) { parentPath = s.substring(0, s.lastIndexOf(SLASH) + 1); } else { parentPath = ""; } if(!isDirectory(parentPath)) { return null; } if(s.contains(STAR)) { return globSearch(parentPath, s); } return null; }</code><technical_language>If return null for empty string, able return files initial level of hierarchy. need that</technical_language>

Target:
public VirtualFile[] getFiles(String s) throws TranslatorException { if (s == null) { return null; } if(s3Client.doesObjectExist(s3Config.getBucket(), s)){ ListObjectsRequest listObjectsRequest = new ListObjectsRequest() .withBucketName(s3Config.getBucket()) .withPrefix(s); ObjectListing objectListing = s3Client.listObjects(listObjectsRequest); return new VirtualFile[] {new S3VirtualFile(s3Client, objectListing.getObjectSummaries().get(0), s3Config)}; } if(isDirectory(s)){ if(!s.isEmpty() && !s.endsWith(SLASH)) { s += SLASH; } return convert(s); } String parentPath = ""; if(s.contains(SLASH)) { parentPath = s.substring(0, s.lastIndexOf(SLASH) + 1); } if(!isDirectory(parentPath)) { return null; } if(s.contains(STAR)) { return globSearch(parentPath, s); } return null; }
Source:
<code>protected void activate(ComponentContext context) { TenantMgtService tenantMgt = new TenantMgtImpl(); context.getBundleContext().registerService(TenantMgtService.class.getName(), tenantMgt, null); if (log.isDebugEnabled()) { <START> log.debug("*************Tenant management component is activated.**************"); <END> } }</code><technical_language>Remove *************</technical_language>

Target:
protected void activate(ComponentContext context) { TenantMgtService tenantMgt = new TenantMgtImpl(); context.getBundleContext().registerService(TenantMgtService.class.getName(), tenantMgt, null); if (log.isDebugEnabled()) { log.debug("Tenant management component is activated."); } }
Source:
<code>public void serveNotFoundIndexHtml_requestWithRootPath_failsWithIOException() { VaadinServletRequest vaadinServletRequest = createVaadinRequest("/"); VaadinService vaadinService = vaadinServletRequest.getService(); String indexHtmlPathInProductionMode = VAADIN_SERVLET_RESOURCES + INDEX_HTML; URL url = vaadinService.getClassLoader().getResource(indexHtmlPathInProductionMode); try { Objects.requireNonNull(url); File indexHtmlFile = new File(url.getPath()); indexHtmlFile.delete(); } catch (Exception ignored) try { <START> indexHtmlRequestHandler.synchronizedHandleRequest(session, <END> vaadinServletRequest, response); throw new IllegalStateException("Must not reach to this point since index.html is not found"); } catch (IOException iOExeption) { String expectedError = "Failed to load content of './frontend/index.html'." + "It is required to have './frontend/index.html' file " + "when using client side bootstrapping."; assertEquals(expectedError, iOExeption.getMessage()); } }</code><technical_language>I @Rule ExpectedException exceptionRule expect() exceptionRule.expectMessage() here. Flow project examples of a usage</technical_language>

Target:
public void serveNotFoundIndexHtml_requestWithRootPath_failsWithIOException() throws IOException { VaadinServletRequest vaadinServletRequest = createVaadinRequest("/"); VaadinService vaadinService = vaadinServletRequest.getService(); String indexHtmlPathInProductionMode = VAADIN_SERVLET_RESOURCES + INDEX_HTML; URL url = vaadinService.getClassLoader().getResource(indexHtmlPathInProductionMode); assertNotNull(url); File indexHtmlFile = new File(url.getPath()); File indexHtmlFileTmp = new File(url.getPath() + "_tmp"); try { boolean renamed = indexHtmlFile.renameTo(indexHtmlFileTmp); assertTrue(renamed); String expectedError = "Failed to load content of './frontend/index.html'. " + "It is required to have './frontend/index.html' file " + "when using client side bootstrapping."; exceptionRule.expect(IOException.class); exceptionRule.expectMessage(expectedError); indexHtmlRequestHandler.synchronizedHandleRequest(session, vaadinServletRequest, response); } finally { boolean renamed = indexHtmlFileTmp.renameTo(indexHtmlFile); assertTrue(renamed); } }
Source:
<code>public void start(final Environment env) throws IOException { try { parseCommandLine(); final Provider<Command> p = commands.get(commandName); if (p == null) { String msg = (prefix.isEmpty() ? "Gerrit Code Review" : prefix) + ": " + commandName + ": not found"; throw new UnloggedFailure(1, msg); } final Command cmd = p.get(); if (isAdminCommand(cmd) && !currentUser.get().isAdministrator()) { final String msg = "fatal: Not a Gerrit administrator"; throw new UnloggedFailure(BaseCommand.STATUS_NOT_ADMIN, msg); <START> } else if (isStreamCommand(cmd) && !currentUser.get().isAllowedToStream()) { <END> final String msg = "fatal: Not allowed to run streaming commands"; throw new UnloggedFailure(BaseCommand.STATUS_NO_STREAMING, msg); } if (cmd instanceof BaseCommand) { final BaseCommand bc = (BaseCommand) cmd; if (prefix.isEmpty()) bc.setName(commandName); else bc.setName(prefix + " " + commandName); bc.setArguments(args.toArray(new String[args.size()])); } else if (!args.isEmpty()) { throw new UnloggedFailure(1, commandName + " does not take arguments"); } provideStateTo(cmd); synchronized (this) { this.cmd = cmd; } cmd.start(env); } catch (UnloggedFailure e) { String msg = e.getMessage(); if (!msg.endsWith("\n")) { msg += "\n"; } err.write(msg.getBytes(ENC)); err.flush(); onExit(e.exitCode); } }</code><technical_language>Style-nit: Please insert a blank line this else if</technical_language>

Target:
public void start(final Environment env) throws IOException { try { parseCommandLine(); final Provider<Command> p = commands.get(commandName); if (p == null) { String msg = (prefix.isEmpty() ? "Gerrit Code Review" : prefix) + ": " + commandName + ": not found"; throw new UnloggedFailure(1, msg); } final Command cmd = p.get(); if (isAdminCommand(cmd) && !currentUser.get().isAdministrator()) { final String msg = "fatal: Not a Gerrit administrator"; throw new UnloggedFailure(BaseCommand.STATUS_NOT_ADMIN, msg); } if (cmd instanceof BaseCommand) { final BaseCommand bc = (BaseCommand) cmd; if (prefix.isEmpty()) bc.setName(commandName); else bc.setName(prefix + " " + commandName); bc.setArguments(args.toArray(new String[args.size()])); } else if (!args.isEmpty()) { throw new UnloggedFailure(1, commandName + " does not take arguments"); } provideStateTo(cmd); synchronized (this) { this.cmd = cmd; } cmd.start(env); } catch (UnloggedFailure e) { String msg = e.getMessage(); if (!msg.endsWith("\n")) { msg += "\n"; } err.write(msg.getBytes(ENC)); err.flush(); onExit(e.exitCode); } }
Source:
<code>private String getColumnText(Object element, int columnIndex) { <START> <END> TaskReview reviewContainer = (TaskReview) element; switch (columnIndex) { case 0: return reviewContainer.getSummary(); case 1: return reviewContainer.getCr(); case 2: return reviewContainer.getV(); case 3: return reviewContainer.getIncomingChanges(); default: return "unrecognized column"; } }</code><technical_language>Unneeded line break</technical_language>

Target:
private String getColumnText(Object element, int columnIndex) { TaskReview reviewContainer = (TaskReview) element; switch (columnIndex) { case 0: return reviewContainer.getSummary(); case 1: return reviewContainer.getCrString(); case 2: return reviewContainer.getVString(); case 3: return reviewContainer.getIncomingChanges(); default: return ""; } }
Source:
<code>protected void setupLocale(Locale locale) { FacesContext ctx = FacesContext.getCurrentInstance(); <START> if (locale == null && ctx != null) { <END> if (log.isDebugEnabled()) { log.debug("Locale not set, falling back to request locale"); } locale = ctx.getExternalContext().getRequestLocale(); } if (locale == null && ctx != null) { if (log.isDebugEnabled()) { log.debug("Locale not set, falling back to default JSF locale"); } locale = ctx.getApplication().getDefaultLocale(); } if (locale == null) { if (log.isDebugEnabled()) { log.debug("Locale not set, falling back to default locale"); } locale = Locale.getDefault(); } LocaleSelector localeSelector = LocaleSelector.instance(); boolean set = false; if (ctx != null) { Locale jsfDefault = ctx.getApplication().getDefaultLocale(); if (jsfDefault != null && jsfDefault.getLanguage().equals(locale)) { set = true; } else { Iterator<Locale> it = ctx.getApplication().getSupportedLocales(); while (it.hasNext()) { Locale current = it.next(); if (current.equals(locale)) { set = true; break; } } } } if (!set) { if (log.isDebugEnabled()) { log.debug( "Locale was not set to '" + locale + "' as it could not be validated as a supported language."); } } else { localeSelector.setLocale(locale); localeSelector.setCookieEnabled(true); localeSelector.select(); } }</code><technical_language>factorize ctx != null condition for l.113 l.119</technical_language>

Target:
protected void setupLocale(Locale locale) { FacesContext ctx = FacesContext.getCurrentInstance(); if (locale == null && ctx != null) { log.debug("Locale not set, falling back to request locale"); locale = ctx.getExternalContext().getRequestLocale(); } if (locale == null && ctx != null) { log.debug("Locale not set, falling back to default JSF locale"); locale = ctx.getApplication().getDefaultLocale(); } if (locale == null) { log.debug("Locale not set, falling back to default locale"); locale = Locale.getDefault(); } LocaleSelector localeSelector = LocaleSelector.instance(); boolean set = false; if (ctx != null) { Locale jsfDefault = ctx.getApplication().getDefaultLocale(); if (jsfDefault != null && jsfDefault.getLanguage().equals(locale)) { set = true; } else { Iterator<Locale> it = ctx.getApplication().getSupportedLocales(); while (it.hasNext()) { Locale current = it.next(); if (current.equals(locale)) { set = true; break; } } } } if (!set) { if (log.isDebugEnabled()) { log.debug( "Locale was not set to '" + locale + "' as it could not be validated as a supported language."); } } else { localeSelector.setLocale(locale); localeSelector.setCookieEnabled(true); localeSelector.select(); } }
Source:
<code>public String getLabel(Object o) { if (o instanceof ICBreakpointContext) { ICBreakpoint bp = ((ICBreakpointContext) o).getBreakpoint(); <START> return getBreakpointMainLabel(bp, (ICBreakpointContext) o); <END> } return ""; }</code><technical_language>I ICBreakpointContext context = (ICBreakpointContext) o; return getBreakpointMainLabel(context.gettBreakpoint(), context) another access PreferenceStor, note below</technical_language>

Target:
public String getLabel(Object o) { if (o instanceof ICBreakpointContext) { ICBreakpointContext context = (ICBreakpointContext) o; return getBreakpointMainLabel(context.getBreakpoint(), context); } return ""; }
Source:
<code>public MkSocket(final InputStream input) throws IOException { super(); <START> this.address = InetAddress.getLocalHost(); <END> this.output = new ByteArrayOutputStream(); this.input = input; }</code><technical_language>@essobedo InetAddress.getLoopbackAddress() remove throws IOException</technical_language>

Target:
public MkSocket(final InputStream input) { super(); this.address = InetAddress.getLoopbackAddress(); this.output = new ByteArrayOutputStream(); this.input = input; }
Source:
<code>private void analyseSomeReferencedPackages(PackageVisibilityStatement[] stats, CompilationUnitScope skope) { for (PackageVisibilityStatement <START> export : <END> stats) { PackageBinding pb = export.resolvedPackage; if (pb == null) continue; pb = pb.getIncarnation(this.binding); if (pb != null && pb.hasCompilationUnit(true)) continue; skope.problemReporter().invalidPackageReference(IProblem.PackageDoesNotExistOrIsEmpty, export); } }</code><technical_language>renamed, is for opens</technical_language>

Target:
private void analyseSomeReferencedPackages(PackageVisibilityStatement[] stats, CompilationUnitScope skope) { for (PackageVisibilityStatement stat : stats) { PackageBinding pb = stat.resolvedPackage; if (pb == null) continue; pb = pb.getIncarnation(this.binding); if (pb != null && pb.hasCompilationUnit(true)) continue; skope.problemReporter().invalidPackageReference(IProblem.PackageDoesNotExistOrIsEmpty, stat); } }
Source:
<code>public void assertArguments() { ServerConfigurationProvider config = mock(ServerConfigurationProvider.class); <START> when(config.getUrl()).thenReturn("https END> when(config.getUserName()).thenReturn("snd\\user_cp"); when(config.getUserPassword()).thenReturn("password"); MaskedArgumentListBuilder arguments = new LabelCommand(config, "LABEL", "WORKSPACE", "PATH").getArguments(); assertNotNull("Arguments were null", arguments); assertEquals("label LABEL PATH -version:WWORKSPACE -noprompt -recursive -server:https }</code><technical_language>Missing : in URL</technical_language>

Target:
public void assertArguments() { ServerConfigurationProvider config = mock(ServerConfigurationProvider.class); when(config.getUrl()).thenReturn("<LINK_0>"); when(config.getUserName()).thenReturn("snd\\user_cp"); when(config.getUserPassword()).thenReturn("password"); MaskedArgumentListBuilder arguments = new LabelCommand(config, "int_build.10", "Jenkins-JOB-MASTER", ".").getArguments(); assertNotNull("Arguments were null", arguments); assertEquals("label int_build.10 . -version:WJenkins-JOB-MASTER -comment:Automatically_applied_by_Jenkins_TFS_plugin -noprompt -recursive -server:<LINK_0> -login:snd\\user_cp,password", arguments.toStringWithQuote()); }
Source:
<code>public void toHeapData() { HeapData anotherHeapData = new HeapData(); Data toOnHeap = anotherHeapData.toHeap(); <START> assertInstanceOf(HeapData.class, toOnHeap); <END> }</code><technical_language>I do assertSame</technical_language>

Target:
public void toHeapData() { Data data = new HeapData(); Data toHeap = data.toHeap(); assertEquals(data, toHeap); }
Source:
<code>private List<File> scanPath(Path path, int pathIndex) { final String[] resources = path.list(); log(pathIndex + ") Scanning path " + path, Project.MSG_VERBOSE); final List<File> allFiles = new ArrayList<>(); <START> final List<File> concreteFiles = new ArrayList<>(); <END> for (String resource : resources) { final File file = new File(resource); if (file.isFile()) { concreteFiles.add(file); } else { final DirectoryScanner scanner = new DirectoryScanner(); scanner.setBasedir(file); scanner.scan(); final List<File> scannedFiles = retrieveAllScannedFiles(scanner, pathIndex); allFiles.addAll(scannedFiles); } } if (!concreteFiles.isEmpty()) { log(String.format(Locale.ROOT, "%d) Adding %d files from path %s", pathIndex, concreteFiles.size(), path), Project.MSG_VERBOSE); allFiles.addAll(concreteFiles); } return allFiles; }</code><technical_language>do need separate array list for concreteFiles? for log purposes</technical_language>

Target:
private List<File> scanPath(Path path, int pathIndex) { final String[] resources = path.list(); log(pathIndex + ") Scanning path " + path, Project.MSG_VERBOSE); final List<File> allFiles = new ArrayList<>(); int concreteFilesCount = 0; for (String resource : resources) { final File file = new File(resource); if (file.isFile()) { concreteFilesCount++; allFiles.add(file); } else { final DirectoryScanner scanner = new DirectoryScanner(); scanner.setBasedir(file); scanner.scan(); final List<File> scannedFiles = retrieveAllScannedFiles(scanner, pathIndex); allFiles.addAll(scannedFiles); } } if (concreteFilesCount > 0) { log(String.format(Locale.ROOT, "%d) Adding %d files from path %s", pathIndex, concreteFilesCount, path), Project.MSG_VERBOSE); } return allFiles; }
Source:
<code><START> public static int convertMediaTypeToConstant(Media.MediaType mediaType) { <END> if (mediaType.equals(Media.MediaType.PICTURE)){ return Constants.MEDIA_TYPE_IMAGE; } else if (mediaType.equals(Media.MediaType.VIDEO)){ return Constants.MEDIA_TYPE_VIDEO; } return 0; }</code><technical_language>this method static</technical_language>

Target:
public int convertMediaTypeToConstant(Media.MediaType mediaType) { if (mediaType.equals(Media.MediaType.PICTURE)){ return Constants.MEDIA_TYPE_IMAGE; } else if (mediaType.equals(Media.MediaType.VIDEO)){ return Constants.MEDIA_TYPE_VIDEO; } return 0; }
Source:
<code>private Stream<CompilationMessage> validateInjectedTypes( VariableElement field ) { TypeMirror fieldType = field.asType(); if ( injectsAllowedType( fieldType ) ) { return Stream.empty(); } if ( injectsRestrictedType( fieldType ) ) { if ( ignoresWarnings ) { return Stream.empty(); } <START> return Stream.of( new ContextFieldWarning( field, "@%s usage warning: found restricted type <%s> on %s.\n" + <END> "The procedure will not load unless declared via the configuration option 'dbms.security.procedures.unrestricted'.\n" + "You can ignore this warning by passing the option -A%s to the Java compiler", Context.class.getName(), fieldType.toString(), fieldFullName( field ), ProcedureProcessor.IGNORE_CONTEXT_WARNINGS_OPTION ) ); } return Stream.of( new ContextFieldError( field, "@%s usage error: found unsupported type <%s> on field %s, expected one of: %s", Context.class.getName(), fieldType.toString(), fieldFullName( field ), joinTypes( SUPPORTED_TYPES ) ) ); }</code><technical_language>This changed @%s usage warning: unsupported restricted type <%s> %s. instead, similar, APIs official supported APIs subject change time</technical_language>

Target:
private Stream<CompilationMessage> validateInjectedTypes( VariableElement field ) { TypeMirror fieldType = field.asType(); if ( injectsAllowedType( fieldType ) ) { return Stream.empty(); } if ( injectsRestrictedType( fieldType ) ) { if ( ignoresWarnings ) { return Stream.empty(); } return Stream.of( new ContextFieldWarning( field, "@%s usage warning: found unsupported restricted type <%s> on %s.\n" + "The procedure will not load unless declared via the configuration option 'dbms.security.procedures.unrestricted'.\n" + "You can ignore this warning by passing the option -A%s to the Java compiler", Context.class.getName(), fieldType.toString(), fieldFullName( field ), IGNORE_CONTEXT_WARNINGS_OPTION ) ); } return Stream.of( new ContextFieldError( field, "@%s usage error: found unknown type <%s> on field %s, expected one of: %s", Context.class.getName(), fieldType.toString(), fieldFullName( field ), joinTypes( SUPPORTED_TYPES ) ) ); }
Source:
<code><START> public static DescriptionBuilder forClass(Class<?> testClass) { <END> return new DescriptionBuilder(testClass); }</code><technical_language>I build a description map a Java class? another public static method named forNamedDescription(String displayName)? (if do this, I understand if decide describing defaults in methods longer a good idea)</technical_language>

Target:
public static ClassBasedDescriptionBuilder forClass(Class<?> testClass) { return new ClassBasedDescriptionBuilder(testClass); }
Source:
<code>private void check(ProgramState state, BinaryExpressionTree element) { Constraint leftConstraint = state.getConstraint(state.peekStack(1)); Constraint rightConstraint = state.getConstraint(state.peekStack(0)); boolean leftIsUndefined = leftConstraint.isStricterOrEqualTo(Constraint.UNDEFINED); boolean rightIsUndefined = rightConstraint.isStricterOrEqualTo(Constraint.UNDEFINED); <START> final boolean leftIsNan = leftConstraint.isStricterOrEqualTo(Constraint.NAN); <END> final boolean rightIsNan = rightConstraint.isStricterOrEqualTo(Constraint.NAN); if (checkObjectIsComparedNumerically(leftConstraint, rightConstraint)) { raiseIssue(element, true, false, "an Object"); } else if (checkObjectIsComparedNumerically(rightConstraint, leftConstraint)) { raiseIssue(element, false, true, "an Object"); } else if (leftIsUndefined || rightIsUndefined) { raiseIssue(element, leftIsUndefined, rightIsUndefined, "\"undefined\""); } else if (leftIsNan || rightIsNan) { raiseIssue(element, leftIsNan, rightIsNan, "NaN"); } }</code><technical_language>@inverno If a fan of final, add for variable</technical_language>

Target:
private void check(ProgramState state, BinaryExpressionTree element) { final Constraint leftConstraint = state.getConstraint(state.peekStack(1)); final Constraint rightConstraint = state.getConstraint(state.peekStack(0)); final boolean leftIsUndefined = leftConstraint.isStricterOrEqualTo(Constraint.UNDEFINED); final boolean rightIsUndefined = rightConstraint.isStricterOrEqualTo(Constraint.UNDEFINED); final boolean leftIsNan = leftConstraint.isStricterOrEqualTo(Constraint.NAN); final boolean rightIsNan = rightConstraint.isStricterOrEqualTo(Constraint.NAN); if (checkObjectIsComparedNumerically(leftConstraint, rightConstraint)) { raiseIssue(element, true, false, "an Object"); } else if (checkObjectIsComparedNumerically(rightConstraint, leftConstraint)) { raiseIssue(element, false, true, "an Object"); } else if (leftIsUndefined || rightIsUndefined) { raiseIssue(element, leftIsUndefined, rightIsUndefined, "\"undefined\""); } else if (leftIsNan || rightIsNan) { raiseIssue(element, leftIsNan, rightIsNan, "NaN"); } }
Source:
<code>public void testGetSolverState() throws Exception { KieServerAssert.assertSuccess( solverClient.createSolver( CONTAINER_1_ID, SOLVER_1_ID, SOLVER_1_CONFIG ) ); ServiceResponse<SolverInstance> solverState = solverClient.getSolverState(CONTAINER_1_ID, SOLVER_1_ID); KieServerAssert.assertSuccess(solverState); SolverInstance returnedInstance = solverState.getResult(); assertEquals(CONTAINER_1_ID, returnedInstance.getContainerId()); assertEquals( SOLVER_1_CONFIG, returnedInstance.getSolverConfigFile() ); assertEquals( SOLVER_1_ID, returnedInstance.getSolverId() ); assertEquals( SolverInstance.getSolverInstanceKey( CONTAINER_1_ID, SOLVER_1_ID ), returnedInstance.getSolverInstanceKey()); assertEquals( SolverInstance.SolverStatus.NOT_SOLVING, returnedInstance.getStatus()); <START> assertNull( returnedInstance.getScoreWrapper() ); <END> }</code><technical_language>assert returnedInstance.getScoreWrapper().getScore() is null</technical_language>

Target:
public void testGetSolverState() throws Exception { KieServerAssert.assertSuccess( solverClient.createSolver( CONTAINER_1_ID, SOLVER_1_ID, SOLVER_1_CONFIG ) ); ServiceResponse<SolverInstance> solverState = solverClient.getSolverState(CONTAINER_1_ID, SOLVER_1_ID); KieServerAssert.assertSuccess(solverState); SolverInstance returnedInstance = solverState.getResult(); assertEquals(CONTAINER_1_ID, returnedInstance.getContainerId()); assertEquals( SOLVER_1_CONFIG, returnedInstance.getSolverConfigFile() ); assertEquals( SOLVER_1_ID, returnedInstance.getSolverId() ); assertEquals( SolverInstance.getSolverInstanceKey( CONTAINER_1_ID, SOLVER_1_ID ), returnedInstance.getSolverInstanceKey()); assertEquals( SolverInstance.SolverStatus.NOT_SOLVING, returnedInstance.getStatus()); assertNotNull( returnedInstance.getScoreWrapper() ); assertNull( returnedInstance.getScoreWrapper().toScore() ); }
Source:
<code>private List<Long> getInstancesToMigrate(Migration migration) throws InvalidKieServerException, PlanNotFoundException { List<Long> instanceIds = migration.getDefinition().getProcessInstanceIds(); Plan plan = planService.get(migration.getDefinition().getPlanId()); if (instanceIds == null || instanceIds.isEmpty()) { boolean allFetched = false; int page = 0; while (!allFetched) { List<ProcessInstance> instances = kieService.getQueryServicesClient(migration.getDefinition().getKieserverId()) <START> .findProcessInstancesByContainerId(plan.getSourceContainerId(), QUERY_PROCESS_INSTANCE_STATUSES, page++, QUERY_PAGE_SIZE); <END> instances.stream().forEach(p -> instanceIds.add(p.getId())); if (instances.size() < QUERY_PAGE_SIZE) { allFetched = true; } } } if (migration.getReports() == null || migration.getReports().isEmpty()) { return instanceIds; } List<Long> migratedInstances = migration.getReports().stream().map(r -> r.getMigrationId()).collect(Collectors.toList()); return instanceIds.stream().filter(id -> !migratedInstances.contains(id)).collect(Collectors.toList()); }</code><technical_language>change for InvalidMigrationException message is consistent other cases MigrationDefinition is corrupted</technical_language>

Target:
private List<Long> getInstancesToMigrate(Migration migration) throws InvalidKieServerException, PlanNotFoundException { List<Long> instanceIds = migration.getDefinition().getProcessInstanceIds(); List<Long> migratedInstances = new ArrayList<>(); if (migration.getReports() != null && !migration.getReports().isEmpty()) { migration.getReports().stream().map(r -> r.getProcessInstanceId()).forEach(id -> migratedInstances.add(id)); } Plan plan = planService.get(migration.getDefinition().getPlanId()); if (instanceIds == null || instanceIds.isEmpty()) { boolean allFetched = false; int page = 0; while (!allFetched) { List<ProcessInstance> instances = kieService.getQueryServicesClient(migration.getDefinition().getKieserverId()) .findProcessInstancesByContainerId(plan.getSourceContainerId(), QUERY_PROCESS_INSTANCE_STATUSES, page++, QUERY_PAGE_SIZE); instances.stream().forEach(p -> instanceIds.add(p.getId())); if (instances.size() < QUERY_PAGE_SIZE) { allFetched = true; } } } return instanceIds.stream().filter(id -> !migratedInstances.contains(id)).collect(Collectors.toList()); }
Source:
<code>public IgniteInternalFuture<Void> purgePartitionsExclusively(CacheGroupContext grp, List<GridDhtLocalPartition> parts) throws IgniteCheckedException { validateCacheGroupForExclusivePurge(grp); if (F.isEmpty(parts)) return new GridFinishedFuture<>(); GroupEvictionContext grpEvictionCtx = evictionGroupsMap.computeIfAbsent( grp.groupId(), (k) -> new GroupEvictionContext(grp)); ExclusivePurgeFuture fut = new ExclusivePurgeFuture(grpEvictionCtx, parts); synchronized (mux) { <START> if (grpEvictionCtx.exclPurgeFut != null) <END> throw new IgniteCheckedException("Only one exclusive purge can be scheduled for the same cache group." + " [grpId=" + grp.groupId() + "]"); Set<Integer> res = new HashSet<>(); for (TaskId taskId : grpEvictionCtx.taskIds) res.add(taskId.part); res.retainAll(fut.partIds); if (!res.isEmpty()) throw new IgniteCheckedException("Can't schedule exclusive purge for a partition " + "due to scheduled regular clear for the same partition. [grpId=" + grp.groupId() + ", partIds=" + Arrays.toString(U.toIntArray(res)) + "]"); grpEvictionCtx.exclPurgeFut = fut; fut.listen(f -> { synchronized (mux) { grpEvictionCtx.exclPurgeFut = null; } }); } for (GridDhtLocalPartition part : parts) { if (part.exclusivePurgeAsync(fut.resFut)) fut.onInit(part); } return fut; }</code><technical_language>1. add braces for multi-line if branch. 2. expect callee handle IgniteCheckedException throw</technical_language>

Target:
public IgniteInternalFuture<Void> purgePartitionsExclusively(CacheGroupContext grp, List<GridDhtLocalPartition> parts) throws IgniteCheckedException { validateCacheGroupForExclusivePurge(grp); if (F.isEmpty(parts)) return new GridFinishedFuture<>(); GroupEvictionContext grpEvictionCtx = evictionGroupsMap.computeIfAbsent( grp.groupId(), (k) -> new GroupEvictionContext(grp)); ExclusivePurgeFuture fut = new ExclusivePurgeFuture(grpEvictionCtx, parts); synchronized (mux) { if (grpEvictionCtx.exclPurgeFut != null) { throw new IgniteCheckedException("Only one exclusive purge can be scheduled for the same cache group." + " [grpId=" + grp.groupId() + "]"); } Set<Integer> res = new HashSet<>(); for (TaskId taskId : grpEvictionCtx.taskIds) res.add(taskId.part); res.retainAll(fut.partIds); if (!res.isEmpty()) { throw new IgniteCheckedException("Can't schedule exclusive purge for a partition " + "due to scheduled regular clear for the same partition. [grpId=" + grp.groupId() + ", partIds=" + Arrays.toString(U.toIntArray(res)) + "]"); } grpEvictionCtx.exclPurgeFut = fut; fut.listen(f -> { synchronized (mux) { grpEvictionCtx.exclPurgeFut = null; } }); } for (GridDhtLocalPartition part : parts) { if (part.exclusivePurgeAsync(fut.resFut)) fut.onInit(part); } return fut; }
Source:
<code>public void test1() throws Exception { final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegression1.java")); final DefaultConfiguration moduleConfig = createModuleConfig(PackageDeclarationCheck.class); final String[] expectedViolation = { "1:1: " + getCheckMessage(PackageDeclarationCheck.class, <START> PackageDeclarationCheck.MSG_KEY_MISMATCH), <END> }; final List<String> expectedXpathQueries = Collections.singletonList( "/PACKAGE_DEF" ); runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); }</code><technical_language>Indentation wrong compared other test</technical_language>

Target:
public void test1() throws Exception { final File fileToProcess = new File(getNonCompilablePath("SuppressionXpathRegression1.java")); final DefaultConfiguration moduleConfig = createModuleConfig(PackageDeclarationCheck.class); final String[] expectedViolation = { "2:1: " + getCheckMessage(PackageDeclarationCheck.class, PackageDeclarationCheck.MSG_KEY_MISMATCH), }; final List<String> expectedXpathQueries = Collections.singletonList( "/PACKAGE_DEF" ); runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); }
Source:
<code>private RegisteredUserDTO convertUserDOToUserDTO(final RegisteredUser user) { if (null == user) { return null; } RegisteredUserDTO userDTO = this.dtoMapper.map(user, RegisteredUserDTO.class); try { userDTO.setLinkedAccounts(this.database.getAuthenticationProvidersByUser(user)); userDTO.setHasSegueAccount(this.userAuthenticationManager.hasLocalCredentials(user)); } catch (SegueDatabaseException e) { log.error("Unable to set linked accounts or local account property for user due to a database error."); } <START> return userDTO; <END> }</code><technical_language>done is speed hitting database less. But, logic is duplicated ConvertUserDOToUserDTO converUserDOsToUserDTOs. Changing body of convertUserDOToDTO call other a list of size eliminate this duplication avoid future bugs update other. for getAuthenticationProvidersByUsers getSegueAccountExistenceByUsers</technical_language>

Target:
private RegisteredUserDTO convertUserDOToUserDTO(final RegisteredUser user) { if (null == user) { return null; } return this.convertUserDOsToUserDTOs(Collections.singletonList(user)).get(0); }
Source:
<code>public HTableDescriptor getTableDescriptor(TableName tableName) throws TableNotFoundException, IOException { if (tableName == null) { return null; } String bigtableTableName = TableMetadataSetter.getBigtableName(tableName, options); GetTableRequest request = GetTableRequest.newBuilder().setName(bigtableTableName).build(); Table response; try { response = bigtableAdminClient.getTable(request); } catch (Throwable throwable) { <START> throw new IOException("Failed to listTables", throwable); <END> } if (response == null) { return null; } else { return tableAdapter.adapt(response); } }</code><technical_language>Failed getTable</technical_language>

Target:
public HTableDescriptor getTableDescriptor(TableName tableName) throws TableNotFoundException, IOException { if (tableName == null) { return null; } String bigtableTableName = TableMetadataSetter.getBigtableName(tableName, options); GetTableRequest request = GetTableRequest.newBuilder().setName(bigtableTableName).build(); try { return tableAdapter.adapt(bigtableAdminClient.getTable(request)); } catch (UncheckedExecutionException e) { if (e.getCause() != null && e.getCause() instanceof OperationRuntimeException) { Status status = ((OperationRuntimeException) e.getCause()).getStatus(); if (status.getCode() == Status.NOT_FOUND.getCode()) { throw new TableNotFoundException(tableName); } } throw new IOException("Failed to getTableDescriptor() on " + tableName, e); } catch (Throwable throwable) { throw new IOException("Failed to getTableDescriptor() on " + tableName, throwable); } }
Source:
<code>public Project fetchProjectByName(final String name) throws ProjectManagerException { Project project = null; final ProjectResultHandler handler = new ProjectResultHandler(); try { final List<Project> projects = this.dbOperator .query(ProjectResultHandler.SELECT_ACTIVE_PROJECT_BY_NAME, handler, name); if (projects.isEmpty()) { <START> throw new ProjectManagerException("No active project with name " + name + " exists in db."); <END> } project = projects.get(0); for (final Triple<String, Boolean, Permission> perm : fetchPermissionsForProject(project)) { if (perm.getThird().toFlags() != 0) { setProjectPermission(project, perm); } } } catch (final SQLException ex) { logger.error(ProjectResultHandler.SELECT_ACTIVE_PROJECT_BY_NAME + " failed.", ex); throw new ProjectManagerException( ProjectResultHandler.SELECT_ACTIVE_PROJECT_BY_NAME + " failed.", ex); } return project; }</code><technical_language>return null instead of throwing exception</technical_language>

Target:
public Project fetchProjectByName(final String name) throws ProjectManagerException { Project project = null; final ProjectResultHandler handler = new ProjectResultHandler(); try { final List<Project> projects = this.dbOperator .query(ProjectResultHandler.SELECT_ACTIVE_PROJECT_BY_NAME, handler, name); if (projects.isEmpty()) { return null; } project = projects.get(0); for (final Triple<String, Boolean, Permission> perm : fetchPermissionsForProject(project)) { if (perm.getThird().toFlags() != 0) { setProjectPermission(project, perm); } } } catch (final SQLException ex) { logger.error(ProjectResultHandler.SELECT_ACTIVE_PROJECT_BY_NAME + " failed.", ex); throw new ProjectManagerException( ProjectResultHandler.SELECT_ACTIVE_PROJECT_BY_NAME + " failed.", ex); } return project; }
Source:
<code>public Builder(String code, String name) { if (code == null) { throw new IllegalArgumentException("Code of the authorization module must be specified as non null " <START> + "value"); <END> } if (name == null) { throw new IllegalArgumentException("Name of the authorization module must be specified as non null " + "value"); } if (code.isEmpty()) { throw new IllegalArgumentException("Code of the authorization module must not be empty value"); } if (name.isEmpty()) { throw new IllegalArgumentException("Name of the authorization module must not be empty value"); } this.code = code; this.name = name; }</code><technical_language>need do this, long strings common checkstyle configuration accounts for them, trigger a warning</technical_language>

Target:
public Builder(String code, String name) { if (code == null) { throw new IllegalArgumentException("Code of the authorization module must be specified as non null value"); } if (name == null) { throw new IllegalArgumentException("Name of the authorization module must be specified as non null value"); } if (code.isEmpty()) { throw new IllegalArgumentException("Code of the authorization module must not be empty value"); } if (name.isEmpty()) { throw new IllegalArgumentException("Name of the authorization module must not be empty value"); } this.code = code; this.name = name; }
Source:
<code>public String getPid() { <START> if(this.pid == null) { <END> return null; } return this.pid; }</code><technical_language>This if is useless, if remove get exact behaviour</technical_language>

Target:
public String getPid() { return this.pid; }
Source:
<code><START> private Property findPropertyById(String id) { <END> return variableScope.lookup(id) .map(VariableScope.Variable::getTypedIdentifier) .orElse(null); }</code><technical_language>yes, I a null is returned. question is, this affect callers of this method. a null es returned, callers of this method fail returning a NPE. before, exception thrown expected variable XXX</technical_language>

Target:
private Optional<Property> findPropertyById(String id) { return variableScope.lookup(id) .map(VariableScope.Variable::getTypedIdentifier); }
Source:
<code>public int toIntRange(BoltProtocolVersion minVersion) { if(majorVersion != minVersion.majorVersion) { <START> throw new IllegalArgumentException( "Versions should be from the same version" ); <END> } else if (minorVersion < minVersion.minorVersion) { throw new IllegalArgumentException("Max version should be newest than min version"); } int range = minorVersion - minVersion.minorVersion; int shiftedRange = range << 16; return shiftedRange | toInt(); }</code><technical_language>suggestion throw new IllegalArgumentException( "Versions major version" );</technical_language>

Target:
public int toIntRange( BoltProtocolVersion minVersion ) { if ( majorVersion != minVersion.majorVersion ) { throw new IllegalArgumentException( "Versions should be from the same major version" ); } else if ( minorVersion < minVersion.minorVersion ) { throw new IllegalArgumentException( "Max version should be newer than min version" ); } int range = minorVersion - minVersion.minorVersion; int shiftedRange = range << 16; return shiftedRange | toInt(); }
Source:
<code>public static Status ofCode(int code) { <START> return Arrays.stream(Status.values()) <END> .filter(s -> s.getStatusCode() == code) .findFirst() .orElseThrow(() -> new IllegalArgumentException("There is no known status for this code (" + code + ").")); }</code><technical_language>Personally a big fan of linear search. constructing a map in a static initializer here</technical_language>

Target:
public static Status ofCode(int code) { return Arrays.stream(Status.values()) .filter(status -> status.getStatusCode() == code) .findFirst() .orElseThrow(() -> new IllegalArgumentException("There is no known status for this code (" + code + ").")); }
Source:
<code>@Nonnull private Set<SourceExpression> parseSourceList() throws DirectiveParseException { Set<SourceExpression> sourceExpressions = new LinkedHashSet<>(); if (this.hasNext(DirectiveValueToken.class)) { boolean parseException = false; Token dv = this.advance(); <START> if (trimRHSWS(dv.value).equalsIgnoreCase("'none'")) { <END> sourceExpressions.add(None.INSTANCE); return sourceExpressions; } for (SubDirectiveValueToken subdv : splitByWSP(dv)) { try { sourceExpressions.add(this.parseSourceExpression(subdv)); } catch (DirectiveValueParseException e) { parseException = true; } } if (parseException) { throw INVALID_SOURCE_LIST; } } return sourceExpressions; }</code><technical_language>get rid of this exceptional condition keeping track of values returned parseSourceExpression in loop below. I more DRY</technical_language>

Target:
@Nonnull private Set<SourceExpression> parseSourceList() throws DirectiveParseException { Set<SourceExpression> sourceExpressions = new LinkedHashSet<>(); if (this.hasNext(DirectiveValueToken.class)) { boolean parseException = false; boolean seenNone = false; Token dv = this.advance(); for (SubDirectiveValueToken subdv : splitByWSP(dv)) { try { SourceExpression se = this.parseSourceExpression(subdv); if (seenNone || se == None.INSTANCE && !sourceExpressions.isEmpty()) { this.error(subdv, "'none' must not be combined with any other source-expression"); throw INVALID_SOURCE_EXPR; } if (se == None.INSTANCE) { seenNone = true; } sourceExpressions.add(se); } catch (DirectiveValueParseException e) { parseException = true; } } if (parseException) { throw INVALID_SOURCE_LIST; } } return sourceExpressions; }
Source:
<code>public static List<ITmfStateInterval> queryHistoryRange(ITmfStateSystem ss, int attributeQuark, long t1, long t2, long resolution, @Nullable IProgressMonitor monitor) throws AttributeNotFoundException, StateSystemDisposedException { List<ITmfStateInterval> intervals = new LinkedList<>(); ITmfStateInterval currentInterval = null; long ts, tEnd; if (t2 < t1 || resolution <= 0) { throw new <START> TimeRangeException("Start:" <END> + t1 + ", End:" + t2 + ", Resolution:" + resolution); } if (t2 > ss.getCurrentEndTime()) { tEnd = ss.getCurrentEndTime(); } else { tEnd = t2; } IProgressMonitor mon = monitor; if (mon == null) { mon = new NullProgressMonitor(); } for (ts = t1; ts <= tEnd; ts += ((currentInterval.getEndTime() - ts) / resolution + 1) * resolution) { if (mon.isCanceled()) { return intervals; } currentInterval = ss.querySingleState(ts, attributeQuark); intervals.add(currentInterval); } if (currentInterval != null && currentInterval.getEndTime() < tEnd) { currentInterval = ss.querySingleState(tEnd, attributeQuark); intervals.add(currentInterval); } return intervals; }</code><technical_language>add quark, state system here? from</technical_language>

Target:
public static List<ITmfStateInterval> queryHistoryRange(ITmfStateSystem ss, int attributeQuark, long t1, long t2, long resolution, @Nullable IProgressMonitor monitor) throws AttributeNotFoundException, StateSystemDisposedException { List<ITmfStateInterval> intervals = new LinkedList<>(); ITmfStateInterval currentInterval = null; long ts, tEnd; if (t2 < t1 || resolution <= 0) { throw new TimeRangeException(ss.getSSID() + " Start:" + t1 + ", End:" + t2 + ", Resolution:" + resolution); } if (t2 > ss.getCurrentEndTime()) { tEnd = ss.getCurrentEndTime(); } else { tEnd = t2; } IProgressMonitor mon = monitor; if (mon == null) { mon = new NullProgressMonitor(); } for (ts = t1; ts <= tEnd; ts += ((currentInterval.getEndTime() - ts) / resolution + 1) * resolution) { if (mon.isCanceled()) { return intervals; } currentInterval = ss.querySingleState(ts, attributeQuark); intervals.add(currentInterval); } if (currentInterval != null && currentInterval.getEndTime() < tEnd) { currentInterval = ss.querySingleState(tEnd, attributeQuark); intervals.add(currentInterval); } return intervals; }