1.1 --- a/PLSQL/Navigator/src/org/netbeans/modules/plsql/navigator/PlsqlSearchProvider.java Tue Jun 26 14:00:18 2012 +0530
1.2 +++ b/PLSQL/Navigator/src/org/netbeans/modules/plsql/navigator/PlsqlSearchProvider.java Fri Jun 29 10:46:09 2012 +0530
1.3 @@ -49,14 +49,16 @@
1.4 }
1.5
1.6 for (Project project : projects) {
1.7 - //For Local Files
1.8 + //For Local Files
1.9 Collection<File> allObjects = locatorService.getAllPlsqlFiles(project);
1.10 - for (File fileObj : allObjects) {
1.11 - String name = fileObj.getName().toLowerCase().substring(0, fileObj.getName().indexOf("."));
1.12 - boolean match = useRegExp ? Pattern.matches(query, name) : name.contains(query);
1.13 - if (match) {
1.14 - if (!response.addResult(new OpenLocalPlsqlFile(fileObj.getPath()), fileObj.getName() + "(" + project.getProjectDirectory().getName() + ")")) {
1.15 - return;
1.16 + if (allObjects != null) {
1.17 + for (File fileObj : allObjects) {
1.18 + String name = fileObj.getName().toLowerCase().substring(0, fileObj.getName().indexOf("."));
1.19 + boolean match = useRegExp ? Pattern.matches(query, name) : name.contains(query);
1.20 + if (match) {
1.21 + if (!response.addResult(new OpenLocalPlsqlFile(fileObj.getPath()), fileObj.getName() + "(" + project.getProjectDirectory().getName() + ")")) {
1.22 + return;
1.23 + }
1.24 }
1.25 }
1.26 }
1.27 @@ -75,11 +77,13 @@
1.28 }
1.29
1.30 private Set<String> getPlsqlFilesFromDB(Project project) {
1.31 + Set<String> allPackages = new HashSet<String>();
1.32 DatabaseConnectionManager connectionProvider = project.getLookup().lookup(DatabaseConnectionManager.class);
1.33 - DatabaseContentManager cache = DatabaseContentManager.getInstance(connectionProvider.getTemplateConnection());
1.34 - Set<String> allPackages = new HashSet<String>();
1.35 - if (cache != null) {
1.36 - allPackages = (Set<String>) cache.getAllPackages();
1.37 + if (connectionProvider != null) {
1.38 + DatabaseContentManager cache = DatabaseContentManager.getInstance(connectionProvider.getTemplateConnection());
1.39 + if (cache != null) {
1.40 + allPackages = (Set<String>) cache.getAllPackages();
1.41 + }
1.42 }
1.43 return allPackages;
1.44 }
2.1 --- a/PLSQL/Utilities/src/org/netbeans/modules/plsql/utilities/localization/PlsqlFileLocatorServiceImpl.java Tue Jun 26 14:00:18 2012 +0530
2.2 +++ b/PLSQL/Utilities/src/org/netbeans/modules/plsql/utilities/localization/PlsqlFileLocatorServiceImpl.java Fri Jun 29 10:46:09 2012 +0530
2.3 @@ -183,13 +183,14 @@
2.4
2.5 @Override
2.6 public Collection<File> getAllPlsqlFiles(Project project) {
2.7 + Collection<File> allPlsqlFiles = null;
2.8 if (project != null) {
2.9 PlsqlProjectFileCacheManager fileCache = cachePerProject.get(getProjectName(project));
2.10 if (fileCache != null) {
2.11 - Collection<File> allPlsqlFiles = fileCache.getAllPlsqlObjects();
2.12 + allPlsqlFiles = fileCache.getAllPlsqlObjects();
2.13 return allPlsqlFiles;
2.14 }
2.15 }
2.16 - return null;
2.17 + return allPlsqlFiles;
2.18 }
2.19 }