Changeset 313 for trunk/src/org/expeditee/actions/Actions.java
- Timestamp:
- 09/23/08 15:05:41 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/expeditee/actions/Actions.java
r311 r313 7 7 import java.lang.reflect.Modifier; 8 8 import java.net.URL; 9 import java.rmi.UnexpectedException; 9 10 import java.util.ArrayList; 10 11 import java.util.Collection; … … 506 507 params = new Object[paramCount]; 507 508 String[] paramStrings = parameters.split("\\s+"); 508 if (paramCount != paramStrings.length) 509 /** 510 * Any extra parametres will be treated as the rest of the 511 * string if the last param is a string 512 */ 513 if (paramCount > paramStrings.length) 509 514 continue; 510 for (int i = 0; i < paramCount; i++) { 511 SString nextParam = new SString(paramStrings[i]); 512 try { 515 /** 516 * If there are extra parametres the last param must be a 517 * String 518 */ 519 int lastParam = paramTypes.length - 1; 520 521 if (paramCount < paramStrings.length 522 && !paramTypes[lastParam].equals(String.class)) 523 continue; 524 try { 525 for (int i = 0; i < paramCount; i++) { 526 SString nextParam = new SString(paramStrings[i]); 513 527 params[i] = null; 514 528 if (paramTypes[i].equals(int.class) … … 531 545 params[i] = nextParam.stringValue(); 532 546 } else { 533 continue; 547 throw new UnexpectedException( 548 "Unexpected type " 549 + paramTypes[i].getClass() 550 .toString()); 534 551 } 535 } catch (Exception e) {536 continue;537 552 } 553 } catch (Exception e) { 554 continue; 538 555 } 556 /** Append extra params on the end of the last string param */ 557 String s = params[lastParam].toString(); 558 for (int i = paramCount; i < paramStrings.length; i++) { 559 s += ' ' + paramStrings[i]; 560 } 561 params[lastParam] = s; 562 539 563 con = c; 540 564 break; … … 861 885 try { 862 886 return PerformAction(current, launcher, command); 863 } catch (RuntimeException e) {887 } catch (RuntimeException e) { 864 888 MessageBay.errorMessage("Action failed: " + e.getMessage()); 865 889 } catch (Exception e) { 866 MessageBay.errorMessage("Action failed: " + e.getClass().getSimpleName()); 890 MessageBay.errorMessage("Action failed: " 891 + e.getClass().getSimpleName()); 867 892 } 868 893 return null;
Note:
See TracChangeset
for help on using the changeset viewer.