Package aQute.bnd.service.diff

Examples of aQute.bnd.service.diff.Tree$Data


            // Skip deltas that have lesser significance than the overall package delta
            if (pkgMemberDiff.getDelta().ordinal() < packageDelta.ordinal())
                continue;

            if (Delta.ADDED == pkgMemberDiff.getDelta()) {
                @SuppressWarnings("unused")
                Tree pkgMember = pkgMemberDiff.getNewer();
                //                markers.addAll(generateAddedTypeMarker(javaProject, pkgMember.getName(), pkgMember.ifAdded()));
            } else if (Delta.REMOVED == pkgMemberDiff.getDelta()) {} else {
                Tree pkgMember = pkgMemberDiff.getOlder();
                if (pkgMember != null && (Type.INTERFACE == pkgMember.getType() || Type.CLASS == pkgMember.getType())) {
                    String className = pkgMember.getName();

                    // Iterate into the class member diffs
                    for (Diff classMemberDiff : pkgMemberDiff.getChildren()) {
                        // Skip deltas that have lesser significance than the overall package delta (again)
                        if (classMemberDiff.getDelta().ordinal() < packageDelta.ordinal())
                            continue;

                        if (Delta.ADDED == classMemberDiff.getDelta()) {
                            Tree classMember = classMemberDiff.getNewer();
                            if (Type.METHOD == classMember.getType())
                                markers.addAll(generateAddedMethodMarker(javaProject, className, classMember.getName(), classMember.ifAdded()));
                        } else if (Delta.REMOVED == classMemberDiff.getDelta()) {
                            Tree classMember = classMemberDiff.getOlder();
                            if (Type.METHOD == classMember.getType()) {
                                markers.addAll(generateRemovedMethodMarker(javaProject, className, classMember.getName(), classMember.ifRemoved()));
                            }
                        }
                    }
                }
            }
View Full Code Here


            // Skip deltas that have lesser significance than the overall package delta
            if (pkgMemberDiff.getDelta().ordinal() < packageDelta.ordinal())
                continue;

            if (Delta.ADDED == pkgMemberDiff.getDelta()) {
                Tree pkgMember = pkgMemberDiff.getNewer();
                //                markers.addAll(generateAddedTypeMarker(javaProject, pkgMember.getName(), pkgMember.ifAdded()));
            } else if (Delta.REMOVED == pkgMemberDiff.getDelta()) {} else {
                Tree pkgMember = pkgMemberDiff.getOlder();
                if (pkgMember != null && (Type.INTERFACE == pkgMember.getType() || Type.CLASS == pkgMember.getType())) {
                    String className = pkgMember.getName();

                    // Iterate into the class member diffs
                    for (Diff classMemberDiff : pkgMemberDiff.getChildren()) {
                        // Skip deltas that have lesser significance than the overall package delta (again)
                        if (classMemberDiff.getDelta().ordinal() < packageDelta.ordinal())
                            continue;

                        if (Delta.ADDED == classMemberDiff.getDelta()) {
                            Tree classMember = classMemberDiff.getNewer();
                            if (Type.METHOD == classMember.getType())
                                markers.addAll(generateAddedMethodMarker(javaProject, className, classMember.getName(), classMember.ifAdded()));
                        } else if (Delta.REMOVED == classMemberDiff.getDelta()) {
                            Tree classMember = classMemberDiff.getOlder();
                            if (Type.METHOD == classMember.getType()) {
                                markers.addAll(generateRemovedMethodMarker(javaProject, className, classMember.getName(), classMember.ifRemoved()));
                            }
                        }
                    }
                }
            }
View Full Code Here

      default:
        return diff.getName();
      }
    }
    if (element instanceof Tree) {
      Tree tree = (Tree) element;
      switch (tree.getType()) {
      case API:
        return Type.API.toString();
      case MANIFEST:
        return Type.MANIFEST.toString();
      case RESOURCES:
        return Type.RESOURCES.toString();
      case RESOURCE:
                return tree.getName();
      default:
        return tree.getName();
      }
    }
    return "";
  }
View Full Code Here

        }
      }
      return BundleTreeImages.resolveImage(type, strDelta, impExp, null);
    }
    if (element instanceof Tree) {
      Tree tree = (Tree) element;
      String type = tree.getType().toString().toLowerCase();
      String impExp = null;
      if (tree.getType() == Type.PACKAGE) {
        impExp = "export"; //$NON-NLS-1$
      } else if (tree.getType() == Type.RESOURCE) {
                String name = tree.getName();
        int idx = name.lastIndexOf('.');
        if (idx > 0) {
          type = "dot_" + name.substring(idx + 1); //$NON-NLS-1$
        }
      }
View Full Code Here

     * @throws Exception
     *             On failure
     */
    public static boolean jarsDiffer(File first, File second) throws Exception {
        Differ di = new DiffPluginImpl();
        Tree n = di.tree(new Jar(second));
        Tree o = di.tree(new Jar(first));
        Diff diff = n.diff(o);
        for (Diff child : diff.getChildren()) {
            for (Diff childc : child.getChildren()) {
                if (childc.getDelta() == Delta.UNCHANGED || childc.getDelta() == Delta.IGNORED) {
                    continue;
View Full Code Here

     *
     * @return Contentinfo with contentType Data.
     */
    private ContentInfo makeData(SafeContents safe) throws IOException,
      ASN1Exception {
  Data data = null;
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  DEREncoder encoder = new DEREncoder(baos);
  safe.encode(encoder);
  data = new Data(baos.toByteArray());
  baos.close();
  ContentInfo cInfo = new ContentInfo(data);
  return cInfo;
    }
View Full Code Here

  // check version before any other operations
  Request request = new Request (display, major_opcode, 0, 3);
  request.write4 (CLIENT_MAJOR_VERSION);
  request.write4 (CLIENT_MINOR_VERSION);

  Data reply = display.read_reply (request);
  server_major_version = reply.read4 (8);
  server_minor_version = reply.read4 (12);
    }
View Full Code Here

     */
    public long getOverlayWindow (Window win) {
  Request request = new Request (display, major_opcode, 7, 2);
  request.write4 (win.id);

  Data reply = display.read_reply (request);
  if (reply == null) {
      return -1;
  }

  return reply.read4(8);
    }
View Full Code Here

    // check version before any other operations
    Request request = new Request (display, major_opcode, 0, 3);
    request.write4 (CLIENT_MAJOR_VERSION);
    request.write4 (CLIENT_MINOR_VERSION);
 
    Data reply = display.read_reply (request);
    server_major_version = reply.read2 (8);
    server_minor_version = reply.read2 (10);
  }
View Full Code Here

      Configuration configuration = project.getConfiguration();

      if (configuration != null)
      {
        Data data = configuration.getData();

        if (data != null)
        {
          ModuleDependencies moduleDependencies = data.getModuleDependencies();

          if (moduleDependencies != null)
          {
            dependencies = moduleDependencies.getDependency();
          }
View Full Code Here

TOP

Related Classes of aQute.bnd.service.diff.Tree$Data

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.