Clean up FIXME - adding more information to the warning message.
authorkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Thu, 23 Aug 2012 02:20:21 +0000 (02:20 +0000)
committerkruland2607 <kruland2607@180e2498-e6e9-4542-8430-84ac67f01cd8>
Thu, 23 Aug 2012 02:20:21 +0000 (02:20 +0000)
git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@979 180e2498-e6e9-4542-8430-84ac67f01cd8

core/src/net/sf/openrocket/file/openrocket/importt/OpenRocketLoader.java

index d6c4e249347ded9bdac0d6a8c8a0f9361ff80b24..39845c7f3733075cc9316ab0707824ed1348a71f 100644 (file)
@@ -2087,27 +2087,26 @@ public ComponentPresetSetter(Reflection.Method set) {
 @Override
 public void set(RocketComponent c, String name, HashMap<String, String> attributes,
                WarningSet warnings) {
-       // FIXME - probably need more data in the warning messages - like what component preset...
        String manufacturerName = attributes.get("manufacturer");
        if ( manufacturerName == null ) {
-               warnings.add(Warning.fromString("Invalid ComponentPreset, no manufacturer specified.  Ignored"));
+               warnings.add(Warning.fromString("Invalid ComponentPreset for component " + c.getName() + ", no manufacturer specified.  Ignored"));
                return;
        }
 
        String productNo = attributes.get("partno");
        if ( productNo == null ) {
-               warnings.add(Warning.fromString("Invalid ComponentPreset, no partno specified.  Ignored"));
+               warnings.add(Warning.fromString("Invalid ComponentPreset for component " + c.getName() + ", no partno specified.  Ignored"));
                return;
        }
 
        String digest = attributes.get("digest");
        if ( digest == null ) {
-               warnings.add(Warning.fromString("Invalid ComponentPreset, no digest specified."));
+               warnings.add(Warning.fromString("Invalid ComponentPreset for component " + c.getName() + ", no digest specified."));
        }
 
        String type = attributes.get("type");
        if ( type == null ) {
-               warnings.add(Warning.fromString("Invalid ComponentPreset, no type specified."));
+               warnings.add(Warning.fromString("Invalid ComponentPreset for component " + c.getName() + ", no type specified."));
        }
 
        List<ComponentPreset> presets = Application.getComponentPresetDao().find( manufacturerName, productNo );
@@ -2128,12 +2127,12 @@ public void set(RocketComponent c, String name, HashMap<String, String> attribut
 
        // Was any found?
        if ( matchingPreset == null ) {
-               warnings.add(Warning.fromString("No matching ComponentPreset found " + manufacturerName + " " + productNo));
+               warnings.add(Warning.fromString("No matching ComponentPreset for component " + c.getName() + " found matching " + manufacturerName + " " + productNo));
                return;
        }
 
        if ( digest != null && !matchingPreset.getDigest().equals(digest) ) {
-               warnings.add(Warning.fromString("ComponentPreset has wrong digest"));
+               warnings.add(Warning.fromString("ComponentPreset for component " + c.getName() + " has wrong digest"));
        }
 
        setMethod.invoke(c, matchingPreset);