Skip to content

Commit

Permalink
progress
Browse files Browse the repository at this point in the history
  • Loading branch information
paultuckey committed Jul 2, 2023
1 parent b936cba commit db09b69
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
Expand Up @@ -75,9 +75,7 @@ private void value(Object object) {
}

private boolean cyclic(Object object) {
Iterator it = calls.iterator();
while (it.hasNext()) {
Object called = it.next();
for (Object called : calls) {
if (object == called) return true;
}
return false;
Expand All @@ -90,19 +88,18 @@ private void bean(Object object) {
try {
info = Introspector.getBeanInfo(object.getClass());
PropertyDescriptor[] props = info.getPropertyDescriptors();
for (int i = 0; i < props.length; ++i) {
PropertyDescriptor prop = props[i];
for (PropertyDescriptor prop : props) {
String name = prop.getName();
// ignore stacktraces
if ( object instanceof Throwable && "stackTrace".equals(name) ) continue;
if (object instanceof Throwable && "stackTrace".equals(name)) continue;
// ignore class element of JSONRPCErrorBean
if ( object instanceof JsonRpcErrorBean && "class".equals(name) ) continue;
if (object instanceof JsonRpcErrorBean && "class".equals(name)) continue;
// for JSONRPCBean ignore result or error depending on weather error present
if ( object instanceof JsonRpcBean) {
if ("class".equals(name) ) continue;
if (object instanceof JsonRpcBean) {
if ("class".equals(name)) continue;
JsonRpcBean rpcBean = (JsonRpcBean) object;
if (rpcBean.getError() == null && "error".equals(name) ) continue;
if (rpcBean.getError() != null && "result".equals(name) ) continue;
if (rpcBean.getError() == null && "error".equals(name)) continue;
if (rpcBean.getError() != null && "result".equals(name)) continue;
}
Method accessor = prop.getReadMethod();
if ((emitClassName || !"class".equals(name)) && accessor != null) {
Expand All @@ -114,8 +111,7 @@ private void bean(Object object) {
}
}
Field[] ff = object.getClass().getFields();
for (int i = 0; i < ff.length; ++i) {
Field field = ff[i];
for (Field field : ff) {
if (addedSomething) add(',');
add(field.getName(), field.get(object));
addedSomething = true;
Expand Down
Expand Up @@ -37,7 +37,7 @@ a:link, a:visited {
color: blue;
}

a:active, a:hover, {
a:active, a:hover {
color: #f30 !important;
}

Expand Down

0 comments on commit db09b69

Please sign in to comment.