svn commit: r15229 - branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/UserDefinedProfile.java

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: maurelio1234
Date: 2008-07-10 01:50:28-0700
New Revision: 15229

Modified:
   branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/UserDefinedProfile.java

Log:

removing unused constructors and correcting minor bugs

Modified: branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/UserDefinedProfile.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/UserDefinedProfile.java?view=diff&rev=15229&p1=branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/UserDefinedProfile.java&p2=branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/UserDefinedProfile.java&r1=15228&r2=15229
==============================================================================
--- branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/UserDefinedProfile.java	(original)
+++ branches/gsoc2008/work_criticsprofiles_maurelio1234/src/org/argouml/profile/UserDefinedProfile.java	2008-07-10 01:50:28-0700
@@ -29,7 +29,6 @@
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.IOException;
-import java.io.Reader;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.ArrayList;
@@ -125,31 +124,6 @@
     }
 
     /**
-     * A constructor that takes a file name and a reader, being the reader the
-     * input method to get the profile model.
-     * 
-     * @param fileName name of the profile model file.
-     * @param reader a reader opened from where the profile model will be
-     *            loaded.
-     * @throws ProfileException if something goes wrong in initializing the
-     *             profile.
-     */
-    public UserDefinedProfile(String fileName, Reader reader)
-        throws ProfileException {
-        LOG.info("load " + fileName);
-        displayName = fileName;
-        ProfileReference reference = null;
-        try {
-            reference = new UserProfileReference(fileName);
-        } catch (MalformedURLException e) {
-            throw new ProfileException(
-                    "Failed to create the ProfileReference.", e);
-        }
-        model = new ReaderModelLoader(reader).loadModel(reference);
-        finishLoading();
-    }
-
-    /**
      * A constructor that reads a file from an URL
      * 
      * @param url the URL
@@ -205,13 +179,14 @@
             if (Model.getExtensionMechanismsHelper().hasStereotype(obj,
                     "profile")) {
 
-
                 // load profile name
                 String name = Model.getFacade().getName(obj);
                 if (name != null) {
                     displayName = name;
                 } else {
-                    displayName = Translator.localize("misc.profile.unnamed");
+                    if (displayName == null) {
+                        displayName = Translator.localize("misc.profile.unnamed");
+                    }
                 }
                 LOG.info("profile " + displayName);
 
@@ -222,14 +197,14 @@
 
                 String profile = null;
 
-                do {
+                while (st.hasMoreTokens()) {
                     profile = st.nextToken();
                     if (profile != null) {
                       LOG.debug("AddingDependency " + profile);
                       this.
                         addProfileDependency(ProfileFacade.getManager().lookForRegisteredProfile(profile));
                     }
-                } while (st.hasMoreTokens());
+                }
 
             }
         }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.