Ignore:
Timestamp:
10/31/18 10:22:56 (6 years ago)
Author:
bln4
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/expeditee/io/ExpReader.java

    r1144 r1189  
    8181         *             Any exceptions occured by the BufferedReader.
    8282         */
     83        @Override
    8384        public Frame readFrame(BufferedReader reader) throws IOException {
    8485                _reader = reader;
     
    133134                                        Point idtype = separateValues(next.substring(2));
    134135                                        // The next line must be the endpoints
    135                                         if (!_reader.ready())
     136                                        if (!_reader.ready()) {
    136137                                                throw new Exception("Unexpected end of file");
     138                                        }
    137139                                        next = _reader.readLine();
    138140                                        Point startend = separateValues(next.substring(2));
     
    156158                                        Point idtype = separateValues(next.substring(2));
    157159                                        // The next line must be the endpoints
    158                                         if (!_reader.ready())
     160                                        if (!_reader.ready()) {
    159161                                                throw new Exception("Unexpected end of file");
     162                                        }
    160163                                        next = _reader.readLine();
    161164                                        Point startend = separateValues(next.substring(2));
     
    168171                        }
    169172                       
    170                         for(DelayedAction action: delayedActions)
     173                        for(DelayedAction action: delayedActions) {
    171174                                action.exec();
     175                        }
    172176
    173177                        // Read the stats
     
    234238
    235239                Method toRun = _ItemTags.get(tag);
    236                 if (toRun == null) System.out.println("Error accessing tag method: " + tag);
     240                if (toRun == null) {
     241                        System.out.println("Error accessing tag method: " + tag);
     242                }
    237243                Object[] vals = Conversion.Convert(toRun, value);
    238244
    239245                try {
    240                         if (vals != null) toRun.invoke(item, vals);
     246                        if (vals != null) {
     247                                toRun.invoke(item, vals);
     248                        }
    241249                } catch (Exception e) {
    242250                        System.out.println("Error running tag method: " + tag);
     
    251259
    252260        protected static String getValue(String line) {
    253                 if (line.length() > 2)
     261                if (line.length() > 2) {
    254262                        return line.substring(2);
    255                 else
     263                } else {
    256264                        return "";
     265                }
    257266        }
    258267       
     
    312321                                        Character tag = getTag(next);
    313322                                        String value = getValue(next);
    314                                         if (tag.equals('V'))
     323                                        if (tag.equals('V')) {
    315324                                                return Integer.parseInt(value);
     325                                        }
    316326                                }
    317327                        }
Note: See TracChangeset for help on using the changeset viewer.