X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=auth%2Fauth-core%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Faaf%2Fauth%2Frserv%2FAcceptor.java;h=52b86ccbf3c29fbeb056631905de7c5221916ce5;hb=bdb54b7c8a5df0e686490658067c9013ee43dd7a;hp=bd718e4623911fb25d683bd0288b130653112f2c;hpb=1296352d8eafee57f982a4342ad79ada4aa56d28;p=aaf%2Fauthz.git 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..52b86ccb 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 { @@ -123,10 +106,14 @@ class Acceptor { * @return */ protected boolean parse(HttpCode code, String cntnt) { - byte bytes[] = cntnt.getBytes(); + byte[] bytes = cntnt.getBytes(); - int cis,cie=-1,cend; - int sis,sie,send; + int cis; + int cie=-1; + int cend; + int sis; + int sie; + int send; String name; ArrayList props = new ArrayList<>(); do {