Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4034

Allow to use custom JSONwriter

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.14
    • Component/s: Plugin - JSON
    • Labels:

      Description

      Throws when accessing to a private inner class in that method:

      private void map(Map map, Method method) throws JSONException

      May be pass when trying to access a private class. example source code should be:

      private void map(Map map, Method method) throws JSONException {
          this.add("{");
      ...
          while (it.hasNext()) {
              Map.Entry entry = (Map.Entry) it.next();
              Object key = entry.getKey();
              String expr = null;
              if (this.buildExpr) {
                  try {
                      if (key == null) {
                          LOG.error("Cannot build expression for null key in " + this.exprStack);
                          continue;
                      } else {
                          expr = this.expandExpr(key.toString());
                          if (this.shouldExcludeProperty(expr)) {
                              continue;
                          }
                          expr = this.setExprStack(expr);
                      }
                  }
                  catch (Exception ex) {
                      LOG.error("Error: " + ex.getLocalizedMessage());
                      continue;
                  }
              }
              if (hasData) {
                  this.add(',');
              }
      ...
          this.add("}");
      }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                kodmanyagha Emir Buğra KÖKSALAN
              • Votes:
                1 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: