Example #1
0
 @Override
 public int hashCode() {
   int result = id != null ? id.hashCode() : 0;
   result = 31 * result + (name != null ? name.hashCode() : 0);
   result = 31 * result + (url != null ? url.hashCode() : 0);
   result = 31 * result + (controllerUrl != null ? controllerUrl.hashCode() : 0);
   result = 31 * result + (controllerJson != null ? controllerJson.hashCode() : 0);
   result = 31 * result + (extractCmd != null ? extractCmd.hashCode() : 0);
   result = 31 * result + (offline ? 1 : 0);
   result =
       31 * result
           + (optionalDependencyPatterns != null
               ? Arrays.hashCode(optionalDependencyPatterns)
               : 0);
   result =
       31 * result
           + (excludeDependencyFilterPatterns != null
               ? Arrays.hashCode(excludeDependencyFilterPatterns)
               : 0);
   result = 31 * result + (mainClass != null ? mainClass.hashCode() : 0);
   result = 31 * result + (properties != null ? properties.hashCode() : 0);
   result = 31 * result + (environment != null ? environment.hashCode() : 0);
   result = 31 * result + (jvmOptions != null ? Arrays.hashCode(jvmOptions) : 0);
   result = 31 * result + (jarFiles != null ? jarFiles.hashCode() : 0);
   return result;
 }
 @Override
 public int hashCode() {
   int result = url.hashCode();
   result = 31 * result + statusCode;
   result = 31 * result + payload.hashCode();
   return result;
 }
    /** {@inheritDoc} */
    @SuppressWarnings("EqualsHashCodeCalledOnUrl")
    @Override
    public int hashCode() {
      int res = id;

      res = 31 * res + (boolVal != null ? boolVal.hashCode() : 0);
      res = 31 * res + (byteVal != null ? byteVal.hashCode() : 0);
      res = 31 * res + (shortVal != null ? shortVal.hashCode() : 0);
      res = 31 * res + (intVal != null ? intVal.hashCode() : 0);
      res = 31 * res + (longVal != null ? longVal.hashCode() : 0);
      res = 31 * res + (floatVal != null ? floatVal.hashCode() : 0);
      res = 31 * res + (doubleVal != null ? doubleVal.hashCode() : 0);
      res = 31 * res + (bigVal != null ? bigVal.hashCode() : 0);
      res = 31 * res + (strVal != null ? strVal.hashCode() : 0);
      res = 31 * res + (arrVal != null ? Arrays.hashCode(arrVal) : 0);
      res = 31 * res + (dateVal != null ? dateVal.hashCode() : 0);
      res = 31 * res + (timeVal != null ? timeVal.hashCode() : 0);
      res = 31 * res + (tsVal != null ? tsVal.hashCode() : 0);
      res = 31 * res + (urlVal != null ? urlVal.hashCode() : 0);
      res = 31 * res + (f1 != null ? f1.hashCode() : 0);
      res = 31 * res + (f2 != null ? f2.hashCode() : 0);
      res = 31 * res + (f3 != null ? f3.hashCode() : 0);

      return res;
    }
Example #4
0
 public synchronized String getPath(URL url) throws IOException {
   String name = String.format("%08x", url.hashCode());
   File file = new File(mResourceDirectory, name);
   if (!file.exists()) {
     copy(file, url);
   }
   return file.getAbsolutePath();
 }
Example #5
0
 @Override
 public int hashCode() {
   int result = id.hashCode();
   if (callback != null) {
     result = 31 * result + callback.hashCode();
   }
   return result;
 }
Example #6
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((defaultGraphURIs == null) ? 0 : defaultGraphURIs.hashCode());
   result = prime * result + ((namedGraphURIs == null) ? 0 : namedGraphURIs.hashCode());
   result = prime * result + ((url == null) ? 0 : url.hashCode());
   return result;
 }
Example #7
0
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((bundleId == null) ? 0 : bundleId.hashCode());
   result = prime * result + ((label == null) ? 0 : label.hashCode());
   result = prime * result + ((url == null) ? 0 : url.hashCode());
   return result;
 }
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((ratings == null) ? 0 : ratings.hashCode());
   result = prime * result + sizeKb;
   result = prime * result + ((url == null) ? 0 : url.hashCode());
   return result;
 }
 @Override
 public int hashCode() {
   final int prime = 31;
   int result = 1;
   result = prime * result + ((date == null) ? 0 : date.hashCode());
   result = prime * result + ((description == null) ? 0 : description.hashCode());
   result = prime * result + ((link == null) ? 0 : link.hashCode());
   result = prime * result + ((title == null) ? 0 : title.hashCode());
   return result;
 }
Example #10
0
 @Override
 public int hashCode() {
   int result = url.hashCode();
   result = 31 * result + (suffix != null ? suffix.hashCode() : 0);
   result = 31 * result + params.hashCode();
   result = 31 * result + (saveInCache ? 1 : 0);
   result = 31 * result + (archiveResult ? 1 : 0);
   result = 31 * result + (withParams ? 1 : 0);
   result = 31 * result + (encoding != null ? encoding.hashCode() : 0);
   result = 31 * result + (content != null ? content.hashCode() : 0);
   result = 31 * result + headers.hashCode();
   result = 31 * result + method.hashCode();
   return result;
 }
Example #11
0
 /**
  * {@inheritDoc}
  *
  * @see java.net.URLStreamHandler#setURL(java.net.URL, java.lang.String, java.lang.String, int,
  *     java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
  */
 @Override
 protected void setURL(
     URL u,
     String protocol,
     String host,
     int port,
     String authority,
     String userInfo,
     String path,
     String query,
     String ref) {
   if (path == null || path.trim().isEmpty()) {
     path = "" + counter.incrementAndGet();
   }
   if (host == null || host.trim().isEmpty()) {
     host = "localhost";
   }
   super.setURL(u, protocol, host, port, authority, userInfo, path, query, ref);
   u.hashCode();
   BufferManager.getInstance().registerMemBuffer(u);
 }
Example #12
0
  /**
   * Handles the object invocation.
   *
   * @param proxy the proxy object to invoke
   * @param method the method to call
   * @param args the arguments to the proxy object
   */
  public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
    String methodName = method.getName();
    Class[] params = method.getParameterTypes();

    // equals and hashCode are special cased
    if (methodName.equals("equals") && params.length == 1 && params[0].equals(Object.class)) {
      Object value = args[0];
      if (value == null || !Proxy.isProxyClass(value.getClass())) return new Boolean(false);

      BurlapProxy handler = (BurlapProxy) Proxy.getInvocationHandler(value);

      return new Boolean(_url.equals(handler.getURL()));
    } else if (methodName.equals("hashCode") && params.length == 0)
      return new Integer(_url.hashCode());
    else if (methodName.equals("getBurlapType"))
      return proxy.getClass().getInterfaces()[0].getName();
    else if (methodName.equals("getBurlapURL")) return _url.toString();
    else if (methodName.equals("toString") && params.length == 0)
      return "[BurlapProxy " + _url + "]";

    InputStream is = null;

    URLConnection conn = null;
    HttpURLConnection httpConn = null;
    try {
      conn = _factory.openConnection(_url);
      conn.setRequestProperty("Content-Type", "text/xml");

      OutputStream os;

      try {
        os = conn.getOutputStream();
      } catch (Exception e) {
        throw new BurlapRuntimeException(e);
      }

      BurlapOutput out = _factory.getBurlapOutput(os);

      if (!_factory.isOverloadEnabled()) {
      } else if (args != null) methodName = methodName + "__" + args.length;
      else methodName = methodName + "__0";

      if (log.isLoggable(Level.FINE))
        log.fine(this + " calling " + methodName + " (" + method + ")");

      out.call(methodName, args);

      try {
        os.flush();
      } catch (Exception e) {
        throw new BurlapRuntimeException(e);
      }

      if (conn instanceof HttpURLConnection) {
        httpConn = (HttpURLConnection) conn;
        int code = 500;

        try {
          code = httpConn.getResponseCode();
        } catch (Exception e) {
        }

        if (code != 200) {
          StringBuffer sb = new StringBuffer();
          int ch;

          try {
            is = httpConn.getInputStream();

            if (is != null) {
              while ((ch = is.read()) >= 0) sb.append((char) ch);

              is.close();
            }

            is = httpConn.getErrorStream();
            if (is != null) {
              while ((ch = is.read()) >= 0) sb.append((char) ch);
            }
          } catch (FileNotFoundException e) {
            throw new BurlapRuntimeException(code + ": " + String.valueOf(e));
          } catch (IOException e) {
          }

          if (is != null) is.close();

          throw new BurlapProtocolException(code + ": " + sb.toString());
        }
      }

      is = conn.getInputStream();

      AbstractBurlapInput in = _factory.getBurlapInput(is);

      return in.readReply(method.getReturnType());
    } catch (BurlapProtocolException e) {
      throw new BurlapRuntimeException(e);
    } finally {
      try {
        if (is != null) is.close();
      } catch (IOException e) {
      }

      if (httpConn != null) httpConn.disconnect();
    }
  }
Example #13
0
 public int hashCode() {
   if (location != null) return location.hashCode();
   else return 0;
 }
 public final int hashCode() {
   return codeSource.hashCode();
 }
 public static void main(String[] args) throws Exception {
   URL url = new URL("http", null, 80, "test");
   int code = url.hashCode();
 }
Example #16
0
 public int hashCode() {
   return url.hashCode();
 }
 @Override
 public int hashCode() {
   return url.hashCode();
 }