diff -r f59e600a848d lib.cvsclient/nbproject/project.properties --- a/lib.cvsclient/nbproject/project.properties Fri Apr 09 22:32:02 2010 +0200 +++ b/lib.cvsclient/nbproject/project.properties Mon Apr 12 21:17:05 2010 +0100 @@ -38,5 +38,6 @@ # made subject to such option by the copyright holder. is.autoload=true +javac.compilerargs=-Xlint -Xlint:-serial test-unit-sys-prop.test.junit.jar=${junit.dir}/modules/ext/junit-3.8.1.jar disable.qa-functional.tests=true diff -r f59e600a848d lib.cvsclient/src/org/netbeans/lib/cvsclient/Client.java --- a/lib.cvsclient/src/org/netbeans/lib/cvsclient/Client.java Fri Apr 09 22:32:02 2010 +0200 +++ b/lib.cvsclient/src/org/netbeans/lib/cvsclient/Client.java Mon Apr 12 21:17:05 2010 +0100 @@ -377,13 +377,13 @@ /** * Process all the requests. The connection must have been opened and * set first. - * @param requests the requets to process + * @param requests the request to process */ public void processRequests(List requests) throws IOException, UnconfiguredRequestException, ResponseException, CommandAbortedException { - if (requests == null || requests.size() == 0) { + if (requests == null || requests.isEmpty()) { throw new IllegalArgumentException("[processRequests] requests " + // NOI18N "was either null or empty."); // NOI18N } @@ -595,7 +595,7 @@ String responseString = responseNameBuffer.toString(); Response response = getResponseFactory().createResponse(responseString); - //Logger.logInput(new String("<" + responseString + " processing start>\n").getBytes()); // NOI18N + Logger.logInput(("<" + responseString + " processing start>\n").getBytes()); // NOI18N response.process(dis, this); boolean terminal = response.isTerminalResponse(); @@ -605,7 +605,7 @@ String errMsg = errorResponce.getMessage(); throw new CommandAbortedException(errMsg, errMsg); } - //Logger.logInput(new String("<" + responseString + " processed " + terminal + ">\n").getBytes()); // NOI18N + Logger.logInput(("<" + responseString + " processed " + terminal + ">\n").getBytes()); // NOI18N if (terminal || abort) { break; } diff -r f59e600a848d lib.cvsclient/src/org/netbeans/lib/cvsclient/command/edit/EditCommand.java --- a/lib.cvsclient/src/org/netbeans/lib/cvsclient/command/edit/EditCommand.java Fri Apr 09 22:32:02 2010 +0200 +++ b/lib.cvsclient/src/org/netbeans/lib/cvsclient/command/edit/EditCommand.java Mon Apr 12 21:17:05 2010 +0100 @@ -41,8 +41,6 @@ package org.netbeans.lib.cvsclient.command.edit; import java.io.*; -import java.util.*; - import org.netbeans.lib.cvsclient.*; import org.netbeans.lib.cvsclient.admin.*; import org.netbeans.lib.cvsclient.command.*; @@ -122,14 +120,14 @@ } protected void addRequestForFile(File file, Entry entry) { - String temporaryWatch = Watch.getWatchString(getTemporaryWatch()); - requests.add(new NotifyRequest(file, "E", temporaryWatch)); // NOI18N + String temporaryWatchText = Watch.getWatchString(getTemporaryWatch()); + requests.add(new NotifyRequest(file, "E", temporaryWatchText)); // NOI18N try { editFile(clientServices, file); } catch (IOException ex) { - // ignore + ex.printStackTrace(); } } diff -r f59e600a848d versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/Annotator.java --- a/versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/Annotator.java Fri Apr 09 22:32:02 2010 +0200 +++ b/versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/Annotator.java Mon Apr 12 21:17:05 2010 +0100 @@ -80,6 +80,8 @@ import org.netbeans.modules.versioning.util.SystemActionBridge; import org.netbeans.modules.diff.PatchAction; import org.netbeans.modules.versioning.system.cvss.options.AnnotationColorProvider; +import org.netbeans.modules.versioning.system.cvss.ui.actions.edit.EditAction; +import org.netbeans.modules.versioning.system.cvss.ui.actions.edit.UneditAction; import org.openide.util.ImageUtilities; /** @@ -90,12 +92,12 @@ */ public class Annotator { - private static String badgeModified = "org/netbeans/modules/versioning/system/cvss/resources/icons/modified-badge.png"; - private static String badgeConflicts = "org/netbeans/modules/versioning/system/cvss/resources/icons/conflicts-badge.png"; + private static final String badgeModified = "org/netbeans/modules/versioning/system/cvss/resources/icons/modified-badge.png"; + private static final String badgeConflicts = "org/netbeans/modules/versioning/system/cvss/resources/icons/conflicts-badge.png"; - private static String toolTipModified = " " + private static final String toolTipModified = " " + NbBundle.getMessage(Annotator.class, "MSG_Contains_Modified_Locally"); - private static String toolTipConflict = " " + private static final String toolTipConflict = " " + NbBundle.getMessage(Annotator.class, "MSG_Contains_Conflicts"); private static final int STATUS_TEXT_ANNOTABLE = FileInformation.STATUS_NOTVERSIONED_EXCLUDED | @@ -336,6 +338,9 @@ actions.add(new ViewRevisionAction(ctx)); actions.add(SystemAction.get(SearchHistoryAction.class)); actions.add(null); + actions.add(SystemAction.get(EditAction.class)); + actions.add(SystemAction.get(UneditAction.class)); + actions.add(null); actions.add(SystemAction.get(GetCleanAction.class)); actions.add(SystemAction.get(ResolveConflictsAction.class)); actions.add(SystemAction.get(IgnoreAction.class)); @@ -373,6 +378,9 @@ actions.add(new ViewRevisionAction(loc.getString("CTL_PopupMenuItem_ViewRevision"), ctx)); // NOI18N actions.add(SystemActionBridge.createAction(SystemAction.get(SearchHistoryAction.class), loc.getString("CTL_PopupMenuItem_SearchHistory"), context)); actions.add(null); + actions.add(SystemActionBridge.createAction(SystemAction.get(EditAction.class), loc.getString("CTL_PopupMenuItem_Edit"), context)); + actions.add(SystemActionBridge.createAction(SystemAction.get(UneditAction.class), loc.getString("CTL_PopupMenuItem_Unedit"), context)); + actions.add(null); actions.add(SystemActionBridge.createAction(SystemAction.get(GetCleanAction.class), loc.getString("CTL_PopupMenuItem_GetClean"), context)); actions.add(SystemActionBridge.createAction(SystemAction.get(ResolveConflictsAction.class), loc.getString("CTL_PopupMenuItem_ResolveConflicts"), context)); if (!onlyProjects) { @@ -504,7 +512,6 @@ } private Image annotateFolderIcon(VCSContext context, Image icon) { - FileStatusCache cache = CvsVersioningSystem.getInstance().getStatusCache(); boolean isVersioned = false; for (Iterator i = context.getRootFiles().iterator(); i.hasNext();) { File file = i.next(); diff -r f59e600a848d versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/Bundle.properties --- a/versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/Bundle.properties Fri Apr 09 22:32:02 2010 +0200 +++ b/versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/Bundle.properties Mon Apr 12 21:17:05 2010 +0100 @@ -61,6 +61,8 @@ CTL_PopupMenuItem_ViewRevision = View Rev&ision... CTL_PopupMenuItem_SearchHistory = Search &History... +CTL_PopupMenuItem_Edit = &Edit +CTL_PopupMenuItem_Unedit = U&nedit CTL_PopupMenuItem_ShowAnnotations = Show &Annotations CTL_PopupMenuItem_HideAnnotations = Hide &Annotations CTL_PopupMenuItem_GetClean = Re&vert Modifications diff -r f59e600a848d versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/CvsLiteFileHandler.java --- a/versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/CvsLiteFileHandler.java Fri Apr 09 22:32:02 2010 +0200 +++ b/versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/CvsLiteFileHandler.java Mon Apr 12 21:17:05 2010 +0100 @@ -54,20 +54,21 @@ import java.io.FileOutputStream; /** - * Cvs client library FileHandler that performs + * CVS client library FileHandler that performs * operations using openide filesystems. * *

It writes user's data files. Folders, temporary * files and metadata files are written directly by * the cvsclient library. * - *

It supresses FilesystemHandler event propagating + *

It surpresses FilesystemHandler event propagating * to cache to avoid * * @author Petr Kuzel */ class CvsLiteFileHandler extends DefaultFileHandler implements FileReadOnlyHandler { + @Override protected boolean createNewFile(File file) throws IOException { boolean exists = file.isFile(); if (exists) { @@ -90,6 +91,7 @@ } } + @Override protected OutputStream createOutputStream(File file) throws IOException { file = FileUtil.normalizeFile(file); FileObject fo = FileUtil.toFileObject(file); @@ -108,6 +110,7 @@ return new LockedOutputStream(lock, stream); } + @Override public void removeLocalFile(String pathname) throws IOException { File fileToDelete = new File(pathname); fileToDelete = FileUtil.normalizeFile(fileToDelete); @@ -125,8 +128,9 @@ } } + @Override public void setFileReadOnly(File file, boolean readOnly) throws IOException { - file.setWritable(readOnly); + file.setWritable(!readOnly); } private static class LockedOutputStream extends OutputStream { @@ -139,6 +143,7 @@ this.peer = peer; } + @Override public void close() throws IOException { lock.releaseLock(); try { @@ -149,18 +154,22 @@ } } + @Override public void flush() throws IOException { peer.flush(); } + @Override public void write(byte b[]) throws IOException { peer.write(b); } + @Override public void write(byte b[], int off, int len) throws IOException { peer.write(b, off, len); } + @Override public void write(int b) throws IOException { peer.write(b); } diff -r f59e600a848d versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/ExecutorSupport.java --- a/versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/ExecutorSupport.java Fri Apr 09 22:32:02 2010 +0200 +++ b/versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/ExecutorSupport.java Mon Apr 12 21:17:05 2010 +0100 @@ -151,6 +151,13 @@ this.nonInteractive = nonInteractive; } + private void ensureGroupExists() { + if (group == null) { + group = new ExecutorGroup(getDisplayName()); + group.setNonInteractive(nonInteractive); + } + } + /** * Async execution. @@ -160,10 +167,7 @@ public void execute() { assert executed == false; executed = true; - if (group == null) { - group = new ExecutorGroup(getDisplayName()); - group.setNonInteractive(nonInteractive); - } + ensureGroupExists(); setup(); executeImpl(); @@ -359,13 +363,14 @@ } /** - * Associates this executor with actualy enqueued runnable + * Associates this executor with actually enqueued runnable * (ClientRunnable created by ClientRuntime) performing the command. * - *

Adds the runnable into group cancelable chain. + *

Adds the runnable into group cancellable chain. */ public void commandEnqueued(CommandRunnable commandRunnable) { this.commandRunnable = commandRunnable; + ensureGroupExists(); group.enqueued(cvs.getClientRuntime(cmd, options), this); group.addCancellable(commandRunnable); } diff -r f59e600a848d versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/FilesystemHandler.java --- a/versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/FilesystemHandler.java Fri Apr 09 22:32:02 2010 +0200 +++ b/versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/FilesystemHandler.java Mon Apr 12 21:17:05 2010 +0100 @@ -1,7 +1,7 @@ /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. * - * Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved. + * Copyright 1997-2010 Sun Microsystems, Inc. All rights reserved. * * The contents of this file are subject to the terms of either the GNU * General Public License Version 2 only ("GPL") or the Common @@ -41,6 +41,8 @@ package org.netbeans.modules.versioning.system.cvss; +import org.netbeans.lib.cvsclient.command.CommandException; +import org.netbeans.lib.cvsclient.connection.AuthenticationException; import org.netbeans.modules.versioning.spi.VCSInterceptor; import org.netbeans.modules.versioning.util.Utils; import org.netbeans.lib.cvsclient.admin.StandardAdminHandler; @@ -51,19 +53,21 @@ import java.io.File; import java.io.IOException; import java.util.*; -import javax.swing.SwingUtilities; import org.netbeans.lib.cvsclient.command.GlobalOptions; +import org.netbeans.lib.cvsclient.command.Watch; +import org.netbeans.lib.cvsclient.command.edit.EditCommand; import org.netbeans.lib.cvsclient.command.update.UpdateCommand; +import org.netbeans.modules.versioning.system.cvss.ui.actions.edit.EditExecutor; import org.netbeans.modules.versioning.system.cvss.ui.actions.update.UpdateExecutor; -import org.openide.util.RequestProcessor; +import org.openide.util.Exceptions; /** * Handles events fired from the filesystem such as file/folder create/delete/move. - * + * * @author Maros Sandor */ class FilesystemHandler extends VCSInterceptor { - + private final FileStatusCache cache; private static Thread ignoredThread; @@ -73,19 +77,21 @@ /** * We save all CVS metadata to be able to commit files that were in that directory. - * + * * @param file File, we are only interested in files inside CVS directory - */ + */ + @Override public boolean beforeDelete(File file) { return !ignoringEvents(); } + @Override public void doDelete(File file) throws IOException { if (file.isDirectory() && hasMetadata(file)) { CvsVisibilityQuery.hideFolder(file); cache.refresh(file, FileStatusCache.REPOSITORY_STATUS_UNKNOWN, true); } else if (org.netbeans.modules.versioning.system.cvss.util.Utils.isPartOfCVSMetadata(file)) { - // medatada are never deleted + // metadata are never deleted } else { if (!file.delete()) { throw new IOException("Failed to delete file: " + file.getAbsolutePath()); @@ -94,10 +100,11 @@ } } + @Override public void afterDelete(File file) { refreshDeleted(file, false); } - + private void refreshDeleted(File file, boolean refreshNow) { if (refreshNow) { cache.refreshNow(file, FileStatusCache.REPOSITORY_STATUS_UNKNOWN, false); @@ -110,17 +117,19 @@ /** * We handle directory renames that are managed by CVS. */ + @Override public boolean beforeMove(File from, File to) { File destDir = to.getParentFile(); return from != null && destDir != null && org.netbeans.modules.versioning.system.cvss.util.Utils.containsMetadata(from); } - + /** * We only handle directories, file renames are examined ex post. Both directories share the same parent. - * + * * @param from source directory to be renamed - * @param to new directory to be created + * @param to new directory to be created */ + @Override public void doMove(File from, File to) throws IOException { List affectedFiles = new ArrayList(); moveRecursively(affectedFiles, from, to); @@ -161,7 +170,7 @@ } catch (IOException e) { // the Entry is not available, continue with no Entry } - + if (entries != null) { for (Entry entry : entries) { if (entry != null && !entry.isDirectory() && !entry.isUserFileToBeRemoved()) { @@ -170,28 +179,32 @@ } } } - + File [] files = dir.listFiles(); for (File file : files) { if (file.isDirectory()) cvsRemoveRecursively(file); } } + @Override public void afterMove(final File from, final File to) { if (ignoringEvents()) return; Utils.post(new Runnable() { + @Override public void run() { fileDeletedImpl(from, true); fileCreatedImpl(to); } }); } - + + @Override public boolean beforeCreate(File file, boolean isDirectory) { if (ignoringEvents()) return false; return isDirectory && file.getName().equals(CvsVersioningSystem.FILENAME_CVS); } + @Override public void doCreate(File file, boolean isDirectory) throws IOException { file.mkdir(); File f = new File(file, CvsLiteAdminHandler.INVALID_METADATA_MARKER); @@ -202,18 +215,22 @@ } } + @Override public void afterCreate(final File file) { if (ignoringEvents()) return; Utils.post(new Runnable() { + @Override public void run() { fileCreatedImpl(file); } }); } + @Override public void afterChange(final File file) { if (ignoringEvents()) return; Utils.post(new Runnable() { + @Override public void run() { cache.refreshCached(file, FileStatusCache.REPOSITORY_STATUS_UNKNOWN); if (file.getName().equals(CvsVersioningSystem.FILENAME_CVSIGNORE)) cache.directoryContentChanged(file.getParentFile()); @@ -225,6 +242,7 @@ public Object getAttribute(final File file, String attrName) { if("ProvidedExtensions.Refresh".equals(attrName)) { return new Runnable() { + @Override public void run() { UpdateCommand cmd = new UpdateCommand(); GlobalOptions options = CvsVersioningSystem.createGlobalOptions(); @@ -238,11 +256,12 @@ final ExecutorGroup refreshCommandGroup = new ExecutorGroup(null); refreshCommandGroup.addExecutors(UpdateExecutor.splitCommand(cmd, CvsVersioningSystem.getInstance(), options, null)); CvsVersioningSystem.getInstance().getParallelRequestProcessor().post(new Runnable() { + @Override public void run() { refreshCommandGroup.execute(); } }); - + } }; } else { @@ -250,6 +269,30 @@ } } + @Override + public void beforeEdit(File file) { + EditCommand cmd = new EditCommand(); + cmd.setDisplayName("CVS edit"); + cmd.setFiles(new File[]{file}); + cmd.setTemporaryWatch(Watch.EDIT); + + CvsVersioningSystem cvs = CvsVersioningSystem.getInstance(); + EditExecutor[] executors = EditExecutor.splitCommand(cmd, cvs, null); + try { + cvs.post(cmd, executors[0]); + } catch (CommandException ex) { + Exceptions.printStackTrace(ex); + } catch (AuthenticationException ex) { + Exceptions.printStackTrace(ex); + } catch (NotVersionedException ex) { + Exceptions.printStackTrace(ex); + } catch (IllegalCommandException ex) { + Exceptions.printStackTrace(ex); + } catch (IOException ex) { + Exceptions.printStackTrace(ex); + } + } + // private methods --------------------------- private void fileCreatedImpl(File file) { @@ -267,7 +310,7 @@ // the Entry is not available, continue with no Entry } if (entry != null && !entry.isDirectory() && entry.isUserFileToBeRemoved()) { - cvsUndoRemoveLocally(sah, file, entry); + cvsUndoRemoveLocally(sah, file, entry); } cache.refresh(file, FileStatusCache.REPOSITORY_STATUS_UNKNOWN); } @@ -277,12 +320,12 @@ /** * If a regular file is deleted then update its Entries as if it has been removed. - * + * * @param file deleted file - */ + */ private void fileDeletedImpl(File file, boolean refreshNow) { if (file == null) return; - + StandardAdminHandler sah = new StandardAdminHandler(); Entry entry = null; try { @@ -291,20 +334,20 @@ // the Entry is not available, continue with no Entry } if (entry != null && !entry.isDirectory() && !entry.isUserFileToBeRemoved()) { - cvsRemoveLocally(sah, file, entry); + cvsRemoveLocally(sah, file, entry); } refreshDeleted(file, refreshNow); } - + /** * Emulates the 'cvs remove' command by modifying Entries. We do this to avoid contacting the * server. - * + * * @param ah * @param file * @param entry - */ + */ private void cvsRemoveLocally(AdminHandler ah, File file, Entry entry) { try { if (entry.isNewUserFile()) { @@ -328,17 +371,17 @@ // failed to set entry, the file will be probably resurrected during update } } - + private void refresh(List files) { for (File file : files) { - cache.refresh(file, FileStatusCache.REPOSITORY_STATUS_UNKNOWN, true); + cache.refresh(file, FileStatusCache.REPOSITORY_STATUS_UNKNOWN, true); } } private boolean hasMetadata(File file) { return new File(file, "CVS/Repository").canRead(); } - + /** * Ignores (internal) events from current thread. E.g.: *

@@ -364,7 +407,7 @@
 
     /**
      * @return true if filesystem events are ignored in current thread, false otherwise
-     */ 
+     */
     private static boolean ignoringEvents() {
         return ignoredThread == Thread.currentThread();
     }
diff -r f59e600a848d versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/util/Utils.java
--- a/versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/util/Utils.java	Fri Apr 09 22:32:02 2010 +0200
+++ b/versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/util/Utils.java	Mon Apr 12 21:17:05 2010 +0100
@@ -106,7 +106,7 @@
 
     /**
      * Validates annotation format text
-     * @param format format to be validatet
+     * @param format format to be validated
      * @return true if the format is correct, false otherwise.
      */
     public static boolean isAnnotationFormatValid(final String format) {
@@ -124,7 +124,7 @@
     
     /**
      * Semantics is similar to {@link org.openide.windows.TopComponent#getActivatedNodes()} except that this
-     * method returns File objects instead od Nodes. Every node is examined for Files it represents. File and Folder
+     * method returns File objects instead of Nodes. Every node is examined for Files it represents. File and Folder
      * nodes represent their underlying files or folders. Project nodes are represented by their source groups. Other
      * logical nodes must provide FileObjects in their Lookup.
      *   
@@ -142,7 +142,7 @@
     
     /**
      * Semantics is similar to {@link org.openide.windows.TopComponent#getActivatedNodes()} except that this
-     * method returns File objects instead od Nodes. Every node is examined for Files it represents. File and Folder
+     * method returns File objects instead of Nodes. Every node is examined for Files it represents. File and Folder
      * nodes represent their underlying files or folders. Project nodes are represented by their source groups. Other
      * logical nodes must provide FileObjects in their Lookup.
      *
@@ -165,7 +165,7 @@
             }
         }
         // if there are no exclusions, we may safely return this context because filtered files == root files
-        if (context.getExclusions().size() == 0) return context;
+        if (context.getExclusions().isEmpty()) return context;
 
         // in this code we remove files from filteredFiles to NOT include any files that do not have required status
         // consider a freeform project that has 'build' in filteredFiles, the Branch action would try to branch it
@@ -294,7 +294,7 @@
     }
 
     /**
-     * Returns the widest possible versioned context for the given file, the outter boundary is the file's Project.
+     * Returns the widest possible versioned context for the given file, the outer boundary is the file's Project.
      * 
      * @param file a file
      * @return Context a context 
@@ -380,7 +380,7 @@
      * Computes path of this file to repository root.
      *
      * @param file a file
-     * @return String path of this file in repsitory. If this path does not describe a
+     * @return String path of this file in repository. If this path does not describe a
      * versioned file, this method returns an empty string 
      */
     public static String getRelativePath(File file) {
@@ -453,7 +453,7 @@
         } else {
             int rev = Integer.parseInt(nums[lastIndex]);
             if (!cutoff) rev--;
-            StringBuffer sb = new StringBuffer(nums[0]);
+            StringBuilder sb = new StringBuilder(nums[0]);
             for (int i = 1; i prefixes = getPrefixes(context, axi, cm);
-        if (prefixes.size() == 0) {
+        if (prefixes.isEmpty()) {
            prefixes.add(null);
         }
         for (String prefix: prefixes) {
diff -r f59e600a848d xml.schema.model/src/org/netbeans/modules/xml/schema/model/LocalElement.java
--- a/xml.schema.model/src/org/netbeans/modules/xml/schema/model/LocalElement.java	Fri Apr 09 22:32:02 2010 +0200
+++ b/xml.schema.model/src/org/netbeans/modules/xml/schema/model/LocalElement.java	Mon Apr 12 21:17:05 2010 +0100
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 1997-2010 Sun Microsystems, Inc. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common
@@ -79,5 +79,5 @@
     void setMinOccurs(Integer min);
     int getMinOccursDefault();
     int getMinOccursEffective();
-    
+    String getMinOccursText();
 }
diff -r f59e600a848d xml.schema.model/src/org/netbeans/modules/xml/schema/model/impl/LocalElementBaseImpl.java
--- a/xml.schema.model/src/org/netbeans/modules/xml/schema/model/impl/LocalElementBaseImpl.java	Fri Apr 09 22:32:02 2010 +0200
+++ b/xml.schema.model/src/org/netbeans/modules/xml/schema/model/impl/LocalElementBaseImpl.java	Mon Apr 12 21:17:05 2010 +0100
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 1997-2010 Sun Microsystems, Inc. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common
@@ -100,12 +100,16 @@
     public NamedComponentReference getRef() {
         return resolveGlobalReference(GlobalElement.class, SchemaAttributes.REF);
     }
-    
+
+    public String getMinOccursText() {
+        return getAttribute(SchemaAttributes.MIN_OCCURS);
+    }
+
     /**
      *
      */
     public Integer getMinOccurs() {
-        String s = getAttribute(SchemaAttributes.MIN_OCCURS);
+        String s = getMinOccursText();
         return s == null ? null : Integer.valueOf(s);
     }
     
diff -r f59e600a848d xml.schema.ui.basic/src/org/netbeans/modules/xml/schema/ui/nodes/categorized/AdvancedLocalElementNode.java
--- a/xml.schema.ui.basic/src/org/netbeans/modules/xml/schema/ui/nodes/categorized/AdvancedLocalElementNode.java	Fri Apr 09 22:32:02 2010 +0200
+++ b/xml.schema.ui.basic/src/org/netbeans/modules/xml/schema/ui/nodes/categorized/AdvancedLocalElementNode.java	Mon Apr 12 21:17:05 2010 +0100
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright 1997-2009 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 1997-2010 Sun Microsystems, Inc. All rights reserved.
  *
  * The contents of this file are subject to the terms of either the GNU
  * General Public License Version 2 only ("GPL") or the Common
@@ -81,8 +81,15 @@
         String max=element.getMaxOccursEffective();
         if (max.equals("unbounded"))
             max="*";
+
+        String minimum;
+        try {
+            minimum = Integer.toString(element.getMinOccursEffective());
+        } catch (NumberFormatException ex) {
+            minimum = ""+element.getMinOccursText()+"";
+        }
         
-        String decoration="["+element.getMinOccursEffective()+".."+max+"]";
+        String decoration="["+minimum+".."+max+"]";
         if(element.getType()!=null && element.getType().get()!=null) {
             String supertypeLabel = NbBundle.getMessage(
                     AdvancedLocalElementNode.class, "LBL_InstanceOf",