call_mode_patch.diff
new/src/com/goldencode/p2j/oo/lang/ParameterList.java 2023-11-07 09:29:26 +0000 | ||
---|---|---|
19 | 19 |
** ME 20230905 Make getModes/getArgs methods public (used by reflection). |
20 | 20 |
** Add isComplete method for validation on reflection invoke. |
21 | 21 |
** ME 20230919 Added `return` after throwing errors through the ErrorManager. |
22 |
** 012 CA 20231107 Fixed string representation of the call mode, which must not include any option. |
|
22 | 23 |
*/ |
23 | 24 | |
24 | 25 |
/* |
... | ... | |
368 | 369 |
String modes = ""; |
369 | 370 |
for (CallParameter cparam : parameters) |
370 | 371 |
{ |
371 |
modes = modes + cparam.mode.toString();
|
|
372 |
modes = modes + cparam.mode.asString();
|
|
372 | 373 |
} |
373 | 374 |
return modes; |
374 | 375 |
} |
new/src/com/goldencode/p2j/testengine/TestExecutionSupport.java 2023-11-07 09:29:26 +0000 | ||
---|---|---|
9 | 9 |
** 002 VVT 20230418 Legacy method name is now used in callClassMethod. |
10 | 10 |
** 003 VVT 20230512 Fixed error propagation (See #3827-350) and source formatting. |
11 | 11 |
** Class members sorted. Removed now unused ExecutionResult inner class. |
12 |
** 004 CA 20231107 Fixed string representation of the call mode, which must not include any option. |
|
12 | 13 |
*/ |
13 | 14 |
/* |
14 | 15 |
** This program is free software: you can redistribute it and/or modify |
... | ... | |
116 | 117 |
{ |
117 | 118 |
final CallParameter p = parameters[i]; |
118 | 119 |
plainArgs[i] = p.initialValue; |
119 |
modeStringBuilder.append(p.mode.toString());
|
|
120 |
modeStringBuilder.append(p.mode.asString());
|
|
120 | 121 |
} |
121 | 122 |
} |
122 | 123 |
else |
new/src/com/goldencode/p2j/util/Call.java 2023-11-07 09:29:26 +0000 | ||
---|---|---|
44 | 44 |
** 012 CA 20230802 Reset the OutputParameterAssigner after invoke finishes, as the parameters are copied |
45 | 45 |
** explicitly, without the OutputParameterAssigner support. |
46 | 46 |
** 013 CA 20231031 Fixed unknown literal parameter. |
47 |
** 014 CA 20231107 Fixed string representation of the call mode, which must not include any option. |
|
47 | 48 |
*/ |
48 | 49 | |
49 | 50 |
/* |
... | ... | |
2959 | 2960 |
{ |
2960 | 2961 |
CallParameter cparam = parameters[i]; |
2961 | 2962 |
|
2962 |
modes = modes + cparam.mode.toString();
|
|
2963 |
modes = modes + cparam.mode.asString();
|
|
2963 | 2964 |
|
2964 | 2965 |
args[i] = cparam.getArgument(); |
2965 | 2966 |
} |
new/src/com/goldencode/p2j/util/CallMode.java 2023-11-07 09:29:26 +0000 | ||
---|---|---|
5 | 5 |
** |
6 | 6 |
** Copyright (c) 2019-2023, Golden Code Development Corporation. |
7 | 7 |
** |
8 |
** -#- -I- --Date-- -------------------------------Description--------------------------------
|
|
8 |
** -#- -I- --Date-- ---------------------------------------Description----------------------------------------
|
|
9 | 9 |
** 001 CA 20190710 Extracted from Call.java. |
10 | 10 |
** 002 GES 20210430 Moved APPEND into the ParameterOption. |
11 | 11 |
** 003 OM 20221205 Improved toString() method. |
12 |
** 004 CA 20231107 Fixed string representation of the call mode, which must not include any option. |
|
12 | 13 |
*/ |
13 | 14 | |
14 | 15 |
/* |
... | ... | |
157 | 158 |
} |
158 | 159 |
|
159 | 160 |
/** |
161 |
* Get the string representation of the mode. |
|
162 |
* |
|
163 |
* @return One of the 'I', 'O' or 'U' values. |
|
164 |
*/ |
|
165 |
public String asString() |
|
166 |
{ |
|
167 |
return (input ? "I" : output ? "O" : "U"); |
|
168 |
} |
|
169 |
|
|
170 |
/** |
|
160 | 171 |
* Create a 1-char representation of this mode, as used by the {@link ControlFlowOps} APIs. |
161 | 172 |
* |
162 | 173 |
* @return "I" for INPUT, "O" for OUTPUT, "U" for INPUT-OUTPUT. |
... | ... | |
164 | 175 |
@Override |
165 | 176 |
public String toString() |
166 | 177 |
{ |
167 |
return (input ? "I" : output ? "O" : "U") + (mode == ParameterOption.APPEND ? "a" : "") +
|
|
168 |
(mode == ParameterOption.BY_VALUE ? "v" : |
|
178 |
return asString() + (mode == ParameterOption.APPEND ? "a" : "") +
|
|
179 |
(mode == ParameterOption.BY_VALUE ? "v" :
|
|
169 | 180 |
mode == ParameterOption.BY_REFERENCE ? "r" : |
170 | 181 |
mode == ParameterOption.BIND ? "b" : ""); |
171 | 182 |
} |