@Test public void noProject() { final org.uberfire.java.nio.file.Path root = fileSystemProvider.getPath(URI.create("default: final Path path = Paths.convert(root); doThrow(new IllegalArgumentException()).when(projectService).resolveProject(path); final Set<String> result = packageServiceLoader.find(path); verify(refactoringQueryService, never()).query(eq(FindPackageNamesQuery.NAME), any()); assertEquals(0, result.size()); }
public Set<String> find(final Path path) { final Set<String> result = new HashSet<>(); try { final WorkspaceProject workspaceProject = projectService.resolveProject(path); final List<RefactoringPageRow> rows = refactoringQueryService.query(FindPackageNamesQuery.NAME, getValueIndexTerms(workspaceProject)); for (RefactoringPageRow row : rows) { result.add(row.getValue().toString()); } } catch (Exception e) { return result; } return result; }
PackageServiceLoaderImpl implements PackageServiceLoader { public Set<String> find(final Path path) { final Set<String> result = new HashSet<>(); try { final WorkspaceProject workspaceProject = projectService.resolveProject(path); final List<RefactoringPageRow> rows = refactoringQueryService.query(FindPackageNamesQuery.NAME, getValueIndexTerms(workspaceProject)); for (RefactoringPageRow row : rows) { result.add(row.getValue().toString()); } } catch (Exception e) { return result; } return result; } }
PackageServiceLoaderImpl implements PackageServiceLoader { public Set<String> find(final Path path) { final Set<String> result = new HashSet<>(); try { final WorkspaceProject workspaceProject = projectService.resolveProject(path); final List<RefactoringPageRow> rows = refactoringQueryService.query(FindPackageNamesQuery.NAME, getValueIndexTerms(workspaceProject)); for (RefactoringPageRow row : rows) { result.add(row.getValue().toString()); } } catch (Exception e) { return result; } return result; }  }
PackageServiceLoaderImpl implements PackageServiceLoader { public Set<String> find(final Path path) { final Set<String> result = new HashSet<>(); try { final WorkspaceProject workspaceProject = projectService.resolveProject(path); final List<RefactoringPageRow> rows = refactoringQueryService.query(FindPackageNamesQuery.NAME, getValueIndexTerms(workspaceProject)); for (RefactoringPageRow row : rows) { result.add(row.getValue().toString()); } } catch (Exception e) { return result; } return result; }  Set<String> find(final Path path); }
PackageServiceLoaderImpl implements PackageServiceLoader { public Set<String> find(final Path path) { final Set<String> result = new HashSet<>(); try { final WorkspaceProject workspaceProject = projectService.resolveProject(path); final List<RefactoringPageRow> rows = refactoringQueryService.query(FindPackageNamesQuery.NAME, getValueIndexTerms(workspaceProject)); for (RefactoringPageRow row : rows) { result.add(row.getValue().toString()); } } catch (Exception e) { return result; } return result; }  Set<String> find(final Path path);  }