Skip to content

Commit 62d6697

Browse files
committed
#457: added UTs for Operand methods and filled in some gaps in type conversion functionality; fixed bug in Java method execution re: instance object handling vs first parameter in VeLa function; unrelated but added uppercase options for special keystroke characters
1 parent c272afb commit 62d6697

File tree

6 files changed

+513
-168
lines changed

6 files changed

+513
-168
lines changed

src/org/aavso/tools/vstar/ui/vela/VeLaDialog.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,22 +182,27 @@ public void keyTyped(KeyEvent e) {
182182
if (escapeMode) {
183183
switch (ch) {
184184
case 'b':
185+
case 'B':
185186
// Boolean set
186187
newCh = "\uD835\uDD39";
187188
break;
188189
case 'l':
190+
case 'L':
189191
// lambda
190192
newCh = "\u03BB";
191193
break;
192194
case 'p':
195+
case 'P':
193196
// pi
194197
newCh = "\u03C0";
195198
break;
196199
case 'r':
200+
case 'R':
197201
// real number set
198202
newCh = "\u211D";
199203
break;
200204
case 'z':
205+
case 'Z':
201206
// integer number set
202207
newCh = "\u2124";
203208
break;
@@ -266,6 +271,8 @@ private void execute() {
266271
output += result.get().toHumanReadableString();
267272
}
268273
} catch (Exception e) {
274+
// e.printStackTrace();
275+
269276
// Show error in text area.
270277
String msg = e.getLocalizedMessage();
271278
if (msg != null) {

src/org/aavso/tools/vstar/vela/JavaMethodExecutor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818
package org.aavso.tools.vstar.vela;
1919

20-
import java.lang.reflect.InvocationTargetException;
2120
import java.lang.reflect.Method;
2221
import java.lang.reflect.Modifier;
2322
import java.util.ArrayList;
@@ -76,7 +75,8 @@ private Optional<Operand> invokeJavaMethod(Method method, List<Operand> operands
7675
// For non-static methods, if instance is null, assume the first
7776
// operand is an object instance.
7877
if (instance == null) {
79-
obj = operands.get(0).toObject(method.getClass());
78+
Operand op = operands.get(0);
79+
obj = operands.get(0).toObject(Type.vela2Java(op.getType()));
8080
operands.remove(0);
8181
} else {
8282
// ...otherwise, use what's been passed in.

0 commit comments

Comments
 (0)