summaryrefslogtreecommitdiffstats
path: root/jrt/src
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@verizonmedia.com>2019-05-23 21:27:02 +0200
committerBjørn Christian Seime <bjorncs@verizonmedia.com>2019-05-23 22:01:21 +0200
commit3cf7a16ab281cc5a2bde4dd608f25e8b074efd7e (patch)
tree6368e1303ec54610c2bcefd0e4956a8013b9f639 /jrt/src
parentf2aaa615ebab15c614d52617268920c8fdfd1a84 (diff)
Remove usage of deprecated Method constructor
Diffstat (limited to 'jrt/src')
-rw-r--r--jrt/src/com/yahoo/jrt/MandatoryMethods.java15
1 files changed, 6 insertions, 9 deletions
diff --git a/jrt/src/com/yahoo/jrt/MandatoryMethods.java b/jrt/src/com/yahoo/jrt/MandatoryMethods.java
index 1176884eed5..57dd40c324b 100644
--- a/jrt/src/com/yahoo/jrt/MandatoryMethods.java
+++ b/jrt/src/com/yahoo/jrt/MandatoryMethods.java
@@ -3,7 +3,6 @@ package com.yahoo.jrt;
import java.util.Collection;
-import java.util.Iterator;
class MandatoryMethods {
@@ -15,21 +14,19 @@ class MandatoryMethods {
//---------------------------------------------------------------------
Method m;
//---------------------------------------------------------------------
- m = new Method("frt.rpc.ping", "", "", this, "ping");
+ m = new Method("frt.rpc.ping", "", "", this::ping);
m.methodDesc("Method that may be used to "
+ "check if the server is online");
parent.addMethod(m);
//---------------------------------------------------------------------
- m = new Method("frt.rpc.getMethodList", "", "SSS", this,
- "getMethodList");
+ m = new Method("frt.rpc.getMethodList", "", "SSS", this::getMethodList);
m.methodDesc("Obtain a list of all available methods");
m.returnDesc(0, "names", "Method names");
m.returnDesc(1, "params", "Method parameter types");
m.returnDesc(2, "return", "Method return types");
parent.addMethod(m);
//---------------------------------------------------------------------
- m = new Method("frt.rpc.getMethodInfo", "s", "sssSSSS", this,
- "getMethodInfo");
+ m = new Method("frt.rpc.getMethodInfo", "s", "sssSSSS", this::getMethodInfo);
m.methodDesc("Obtain detailed information about a single method");
m.paramDesc (0, "methodName", "The method we want information about");
m.returnDesc(0, "desc", "Description of what the method does");
@@ -43,11 +40,11 @@ class MandatoryMethods {
//---------------------------------------------------------------------
}
- public void ping(Request req) {
+ private void ping(Request req) {
// no code needed :)
}
- public void getMethodList(Request req) {
+ private void getMethodList(Request req) {
Collection<Method> methods = parent.methodMap().values();
int cnt = methods.size();
String[] ret0_names = new String[cnt];
@@ -66,7 +63,7 @@ class MandatoryMethods {
req.returnValues().add(new StringArray(ret2_return));
}
- public void getMethodInfo(Request req) {
+ private void getMethodInfo(Request req) {
Method method = parent.methodMap().get(req.parameters().get(0).asString());
if (method == null) {
req.setError(ErrorCode.METHOD_FAILED, "No Such Method");