Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 58638 Details for
Bug 167600
WSDM Tooling: No validation, When Creating Duplicate Capability,MRT and DD files (when it is Case-insensitive)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch for this issue
patch.txt (text/plain), 3.19 KB, created by
Saurabh Dravid
on 2007-02-09 04:19:38 EST
(
hide
)
Description:
Patch for this issue
Filename:
MIME Type:
Creator:
Saurabh Dravid
Created:
2007-02-09 04:19:38 EST
Size:
3.19 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.wsdm.editor >Index: src/org/eclipse/tptp/wsdm/tooling/util/internal/Validation.java >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.wsdm.editor/src/org/eclipse/tptp/wsdm/tooling/util/internal/Validation.java,v >retrieving revision 1.1 >diff -u -r1.1 Validation.java >--- src/org/eclipse/tptp/wsdm/tooling/util/internal/Validation.java 8 Feb 2007 19:40:13 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/util/internal/Validation.java 9 Feb 2007 09:15:06 -0000 >@@ -20,6 +20,7 @@ > import org.eclipse.core.resources.IResource; > import org.eclipse.core.resources.IWorkspaceRoot; > import org.eclipse.core.resources.ResourcesPlugin; >+import org.eclipse.core.runtime.CoreException; > import org.eclipse.core.runtime.Path; > import org.eclipse.tptp.wsdm.tooling.nls.messages.capability.internal.Messages; > >@@ -129,6 +130,7 @@ > > /** > * Is file already exists inside container. >+ * Comparison is done case insensitively. > */ > public static boolean alreadyExists(String containerName, String fileName) > { >@@ -142,8 +144,25 @@ > } > > IContainer container = (IContainer) resource; >- IFile file = container.getFile(new Path(fileName)); >- return file.exists(); >+ IResource[] resources; >+ try >+ { >+ resources = container.members(); >+ } >+ catch (CoreException e) >+ { >+ return false; >+ } >+ for(int i=0;i<resources.length;i++) >+ { >+ if(resources[i] instanceof IFile) >+ { >+ IFile ifile = (IFile) resources[i]; >+ if(ifile.getName().equalsIgnoreCase(fileName) && ifile.exists()) >+ return true; >+ } >+ } >+ return false; > } > > } // end class Validation >Index: src/org/eclipse/tptp/wsdm/tooling/editor/dde/internal/DescriptorModelWizard.java >=================================================================== >RCS file: /cvsroot/ganges/org.eclipse.tptp.wsdm.editor/src/org/eclipse/tptp/wsdm/tooling/editor/dde/internal/DescriptorModelWizard.java,v >retrieving revision 1.1 >diff -u -r1.1 DescriptorModelWizard.java >--- src/org/eclipse/tptp/wsdm/tooling/editor/dde/internal/DescriptorModelWizard.java 8 Feb 2007 19:40:12 -0000 1.1 >+++ src/org/eclipse/tptp/wsdm/tooling/editor/dde/internal/DescriptorModelWizard.java 9 Feb 2007 09:15:06 -0000 >@@ -62,7 +62,9 @@ > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Label; > import org.eclipse.tptp.wsdm.tooling.editor.internal.Activator; >+import org.eclipse.tptp.wsdm.tooling.nls.messages.mrt.internal.Messages; > import org.eclipse.tptp.wsdm.tooling.util.internal.MyDescriptorResourceFactoryImpl; >+import org.eclipse.tptp.wsdm.tooling.util.internal.Validation; > import org.eclipse.ui.INewWizard; > import org.eclipse.ui.IWorkbench; > import org.eclipse.ui.IWorkbenchPage; >@@ -367,10 +369,14 @@ > new Object[] { requiredExt })); > return false; > } >- else >+ >+ // Make sure file didn't exists in selected project >+ if(Validation.alreadyExists(getContainerFullPath().toString(), getFileName())) > { >- return true; >- } >+ setErrorMessage(Messages.MEP_WIZARDPAGE_ERROR_11); >+ return false; >+ } >+ return true; > } > else > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 167600
:
55945
| 58638