Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,15 @@ public IResource getResource() {
if (path != null) {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IResource resource = root.findMember(path);
if (resource != null && resource instanceof IContainer) {
if (resource instanceof IContainer container) {
String resourceName = resourceGroup.getResource();
if (resourceName.length() > 0) {
if (!resourceName.isEmpty()) {
try {
return ((IContainer) resource).getFolder(IPath.fromOSString(resourceName));
return container.getFolder(IPath.fromOSString(resourceName));
} catch (IllegalArgumentException e) {
// continue below.
}
}
return resource;
}
return resource;
}
Expand Down Expand Up @@ -238,7 +237,7 @@ private void setupLinkedResourceTarget() {
} else {
IPath path = URIUtil.toPath(existingLink);
if (path != null) {
setDefaultLinkValue = path.toPortableString().length() > 0;
setDefaultLinkValue = !path.toPortableString().isEmpty();
}
}

Expand Down Expand Up @@ -450,10 +449,10 @@ public IFolder createNewFolder() {
op1.execute(monitor, WorkspaceUndoUtil.getUIInfoAdapter(getShell()));
} catch (final ExecutionException e) {
getContainer().getShell().getDisplay().syncExec(() -> {
if (e.getCause() instanceof CoreException) {
if (e.getCause() instanceof CoreException coreException) {
ErrorDialog.openError(getContainer().getShell(), // Was Utilities.getFocusShell()
IDEWorkbenchMessages.WizardNewFolderCreationPage_errorTitle, null, // no special message
((CoreException) e.getCause()).getStatus());
coreException.getStatus());
} else {
IDEWorkbenchPlugin.log(getClass(), "createNewFolder()", e.getCause()); //$NON-NLS-1$
MessageDialog.openError(getContainer().getShell(),
Expand Down Expand Up @@ -771,7 +770,7 @@ private boolean isFilteredByParent() {
if (createVirtualFolder) {
return false;
}
if ((linkedResourceGroup == null) || linkedResourceGroup.isEnabled()) {
if (linkedResourceGroup == null || linkedResourceGroup.isEnabled()) {
return false;
}
IPath containerPath = resourceGroup.getContainerFullPath();
Expand All @@ -782,7 +781,7 @@ private boolean isFilteredByParent() {
if (resourceName == null) {
return false;
}
if (resourceName.length() > 0) {
if (!resourceName.isEmpty()) {
IPath newFolderPath = containerPath.append(resourceName);
if (newFolderPath.segmentCount() < 2) {
return false;
Expand Down
Loading