Skip to content

Commit

Permalink
[performance] Cannot import maven project from workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
snjeza committed Dec 12, 2023
1 parent 1643491 commit 5877164
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.internal.filesystem.local.LocalFile;
import org.eclipse.core.internal.preferences.EclipsePreferences;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
Expand Down Expand Up @@ -50,6 +51,9 @@ public String[] childNames(int options, IProgressMonitor monitor) {
}

IPath filePath = new Path(this.filePath);
if (!JLSFsUtils.isProjectMetadataFile(filePath)) {
return childNames;
}
String projectName = JLSFsUtils.getProjectNameIfLocationIsProjectRoot(filePath);
if (projectName == null) {
return childNames;
Expand All @@ -69,7 +73,7 @@ public String[] childNames(int options, IProgressMonitor monitor) {
@Override
public IFileStore getChild(String name) {
IPath path = new Path(this.filePath).append(name);
if (JLSFsUtils.shouldStoreInMetadataArea(path)) {
if (JLSFsUtils.shouldStoreInMetadataArea(path) && JLSFsUtils.isProjectMetadataFile(path)) {
IPath containerPath = JLSFsUtils.getContainerPath(path);
String projectName = JLSFsUtils.getProjectNameIfLocationIsProjectRoot(containerPath);
if (projectName == null) {
Expand All @@ -87,7 +91,7 @@ public IFileStore getChild(String name) {
@Override
public IFileStore getFileStore(IPath path) {
IPath fullPath = new Path(this.filePath).append(path);
if (JLSFsUtils.shouldStoreInMetadataArea(fullPath)) {
if (JLSFsUtils.shouldStoreInMetadataArea(fullPath) && JLSFsUtils.isProjectMetadataFile(fullPath)) {
IPath containerPath = JLSFsUtils.getContainerPath(fullPath);
String projectName = JLSFsUtils.getProjectNameIfLocationIsProjectRoot(containerPath);
if (projectName == null) {
Expand Down

0 comments on commit 5877164

Please sign in to comment.