From c4679e1c9264eb4f105bf458ee16a0353b87b7e0 Mon Sep 17 00:00:00 2001 From: manisha07 Date: Thu, 7 Nov 2019 13:55:07 +0530 Subject: moving string literals on left side Issue-ID: AAF-1031 Change-Id: I3eed2897ca203585ed380638fff03801c35d0f79 Signed-off-by: manisha07 --- .../java/org/onap/aaf/auth/rserv/Acceptor.java | 25 ++++------------------ 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'auth/auth-core') diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Acceptor.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Acceptor.java index bd718e46..bf9f57e3 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Acceptor.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Acceptor.java @@ -45,8 +45,7 @@ class Acceptor { } private boolean eval(HttpCode code, String str, List props) { -// int plus = str.indexOf('+'); -// if (plus<0) { + boolean ok = false; boolean any = false; for (Pair, List>>> type : types) { @@ -61,23 +60,7 @@ class Acceptor { } } } -// } else { // Handle Accepts with "+" as in application/xaml+xml -// int prev = str.indexOf('/')+1; -// String first = str.substring(0,prev); -// String nstr; -// while (prev!=0) { -// nstr = first + (plus<0?str.substring(prev):str.substring(prev,plus)); -// -// for (Pair, List>>> type : types) { -// if (type.x.equals(nstr)) { -// acceptable.add(type); -// return type; -// } -// } -// prev = plus+1; -// plus=str.indexOf('+', prev); -// }; -// } + return any; } @@ -93,9 +76,9 @@ class Acceptor { if (type.y!=null) { for (Pair prop : type.y.y){ if (tag.equals(prop.x)) { - if (tag.equals("charset")) { + if ( "charset".equals(tag)) { return prop.x==null?false:prop.y.equals(value.toLowerCase()); // return True if Matched - } else if (tag.equals("version")) { + } else if ("version".equals(tag)) { return prop.y.equals(new Version(value)); // Note: Version Class knows Minor Version encoding } else if (tag.equals(Content.Q)) { // replace Q value try { -- cgit 1.2.3-korg