Example #1
0
 static {
   _jspx_imports_packages = new java.util.HashSet<>();
   _jspx_imports_packages.add("javax.servlet");
   _jspx_imports_packages.add("java.util");
   _jspx_imports_packages.add("java.io");
   _jspx_imports_packages.add("javax.servlet.jsp");
   _jspx_imports_packages.add("javax.servlet.http");
   _jspx_imports_classes = null;
 }
Example #2
0
 @SuppressWarnings({"unchecked", "cast"})
 public boolean subtype(TypeDecl type) {
   Object _parameters = type;
   if (subtype_TypeDecl_visited == null) subtype_TypeDecl_visited = new java.util.HashMap(4);
   if (subtype_TypeDecl_values == null) subtype_TypeDecl_values = new java.util.HashMap(4);
   if (subtype_TypeDecl_computed.contains(_parameters))
     return ((Boolean) subtype_TypeDecl_values.get(_parameters)).booleanValue();
   if (!subtype_TypeDecl_initialized.contains(_parameters)) {
     subtype_TypeDecl_initialized.add(_parameters);
     subtype_TypeDecl_values.put(_parameters, Boolean.valueOf(true));
   }
   if (!IN_CIRCLE) {
     IN_CIRCLE = true;
     int num = boundariesCrossed;
     boolean isFinal = this.is$Final();
     CIRCLE_INDEX = 1;
     boolean new_subtype_TypeDecl_value;
     do {
       subtype_TypeDecl_visited.put(_parameters, new Integer(CIRCLE_INDEX));
       CHANGE = false;
       new_subtype_TypeDecl_value = subtype_compute(type);
       if (new_subtype_TypeDecl_value
           != ((Boolean) subtype_TypeDecl_values.get(_parameters)).booleanValue()) CHANGE = true;
       subtype_TypeDecl_values.put(_parameters, Boolean.valueOf(new_subtype_TypeDecl_value));
       CIRCLE_INDEX++;
     } while (CHANGE);
     if (isFinal && num == boundariesCrossed) {
       subtype_TypeDecl_computed.add(_parameters);
     } else {
       RESET_CYCLE = true;
       subtype_compute(type);
       RESET_CYCLE = false;
       subtype_TypeDecl_computed.remove(_parameters);
       subtype_TypeDecl_initialized.remove(_parameters);
     }
     IN_CIRCLE = false;
     return new_subtype_TypeDecl_value;
   }
   if (!new Integer(CIRCLE_INDEX).equals(subtype_TypeDecl_visited.get(_parameters))) {
     subtype_TypeDecl_visited.put(_parameters, new Integer(CIRCLE_INDEX));
     if (RESET_CYCLE) {
       subtype_TypeDecl_computed.remove(_parameters);
       subtype_TypeDecl_initialized.remove(_parameters);
       return ((Boolean) subtype_TypeDecl_values.get(_parameters)).booleanValue();
     }
     boolean new_subtype_TypeDecl_value = subtype_compute(type);
     if (new_subtype_TypeDecl_value
         != ((Boolean) subtype_TypeDecl_values.get(_parameters)).booleanValue()) CHANGE = true;
     subtype_TypeDecl_values.put(_parameters, Boolean.valueOf(new_subtype_TypeDecl_value));
     return new_subtype_TypeDecl_value;
   }
   return ((Boolean) subtype_TypeDecl_values.get(_parameters)).booleanValue();
 }
 static {
   _jspx_imports_packages = new java.util.HashSet<>();
   _jspx_imports_packages.add("com.oreilly.servlet");
   _jspx_imports_packages.add("javax.servlet");
   _jspx_imports_packages.add("java.util");
   _jspx_imports_packages.add("javax.servlet.http");
   _jspx_imports_packages.add("java.io");
   _jspx_imports_packages.add("org.apache.jasper");
   _jspx_imports_packages.add("javax.servlet.jsp");
   _jspx_imports_classes = new java.util.HashSet<>();
   _jspx_imports_classes.add("com.oreilly.servlet.multipart.DefaultFileRenamePolicy");
 }
Example #4
0
  /**
   * This method implements the interface defined in DefinitionHandler to save definition to
   * database backend.
   *
   * @param d is the Definition that is ready to be stored.
   * @return true, if new version was stored and database modified, false, if the definition was
   *     rejected for any reason.
   */
  public boolean store(Definition d) {
    boolean result = false;
    VDC vdc = (VDC) m_dbschema;

    // NEW: remember all DVs we came across
    if (m_derivations != null && d instanceof Derivation) m_derivations.add(d.shortID());

    try {
      if (m_rejects == null) {
        // rely on saveDefinition to do "the right thing"
        result = vdc.saveDefinition(d, m_overwrite);
      } else {
        // Is the Definition already in the database?
        if (vdc.containsDefinition(d)) {
          if (m_overwrite) {
            // this is time-consuming and ineffective
            Definition old =
                vdc.loadDefinition(d.getNamespace(), d.getName(), d.getVersion(), d.getType());
            old.toXML(m_rejects, "  ");
            result = vdc.saveDefinition(d, true);
          } else {
            // skip, if not forced to overwrite, but save rejects
            d.toXML(m_rejects, "  ");
          }
        } else {
          // not found, insert unconditionally
          result = vdc.saveDefinition(d, true);
        }
      }
    } catch (SQLException sql) {
      // database problems
      for (int i = 0; sql != null; ++i) {
        m_logger.log(
            "database", 0, "SQL error " + i + ": " + sql.getErrorCode() + ": " + sql.getMessage());
        sql = sql.getNextException();
      }
      m_logger.log("database", 0, "ignoring SQL exception(s)");
    } catch (Exception e) {
      m_logger.log("database", 0, "caught " + e + ", ignoring");
      result = false;
    }

    if (result) m_count++;
    else m_rejected++;
    return result;
  }