Changeset 1189
- Timestamp:
- 10/31/18 10:22:56 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/io/ExpReader.java
r1144 r1189 81 81 * Any exceptions occured by the BufferedReader. 82 82 */ 83 @Override 83 84 public Frame readFrame(BufferedReader reader) throws IOException { 84 85 _reader = reader; … … 133 134 Point idtype = separateValues(next.substring(2)); 134 135 // The next line must be the endpoints 135 if (!_reader.ready()) 136 if (!_reader.ready()) { 136 137 throw new Exception("Unexpected end of file"); 138 } 137 139 next = _reader.readLine(); 138 140 Point startend = separateValues(next.substring(2)); … … 156 158 Point idtype = separateValues(next.substring(2)); 157 159 // The next line must be the endpoints 158 if (!_reader.ready()) 160 if (!_reader.ready()) { 159 161 throw new Exception("Unexpected end of file"); 162 } 160 163 next = _reader.readLine(); 161 164 Point startend = separateValues(next.substring(2)); … … 168 171 } 169 172 170 for(DelayedAction action: delayedActions) 173 for(DelayedAction action: delayedActions) { 171 174 action.exec(); 175 } 172 176 173 177 // Read the stats … … 234 238 235 239 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 } 237 243 Object[] vals = Conversion.Convert(toRun, value); 238 244 239 245 try { 240 if (vals != null) toRun.invoke(item, vals); 246 if (vals != null) { 247 toRun.invoke(item, vals); 248 } 241 249 } catch (Exception e) { 242 250 System.out.println("Error running tag method: " + tag); … … 251 259 252 260 protected static String getValue(String line) { 253 if (line.length() > 2) 261 if (line.length() > 2) { 254 262 return line.substring(2); 255 else263 } else { 256 264 return ""; 265 } 257 266 } 258 267 … … 312 321 Character tag = getTag(next); 313 322 String value = getValue(next); 314 if (tag.equals('V')) 323 if (tag.equals('V')) { 315 324 return Integer.parseInt(value); 325 } 316 326 } 317 327 }
Note:
See TracChangeset
for help on using the changeset viewer.