Ignore:
Timestamp:
06/06/08 16:42:37 (16 years ago)
Author:
ra33
Message:

Added a couple of tests for AttributeUtils class

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/gui/FrameIO.java

    r90 r95  
    764764                        // check if this was the profile frame (and thus needs
    765765                        // re-parsing)
    766                         if (toSave.getFramesetName().toLowerCase().equals(
    767                                         UserSettings.Username.toLowerCase())) {
    768                                 FrameUtils.ParseProfile(FrameIO.LoadFrame(toSave
    769                                                 .getFramesetName()
    770                                                 + "1"));
     766                        if (isProfileFrame(toSave)) {
     767                                Frame profile = FrameIO.LoadFrame(toSave.getFramesetName()+ "1");
     768                                assert(profile != null);
     769                                FrameUtils.ParseProfile(profile);
    771770                        }
    772771                } catch (IOException ioe) {
    773                         // ioe.printStackTrace();
     772                        ioe.getStackTrace();
    774773                        Logger.Log(ioe);
    775774                        return null;
     
    777776
    778777                return writer.getFileContents();
     778        }
     779
     780        /**
     781         * Checks if a frame is in the current user profile frameset.
     782         * @param toCheck the frame to check
     783         * @return true if the frame is in the current user profile frameset
     784         */
     785        public static boolean isProfileFrame(Frame toCheck) {
     786                if(toCheck.getNumber() == 0)
     787                        return false;
     788                return toCheck.getFramesetName()
     789                .equalsIgnoreCase(UserSettings.Username);
    779790        }
    780791
Note: See TracChangeset for help on using the changeset viewer.