CloneSet483


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
59260.979compilation_unit
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
15911
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/RuntimeInvisibleParameterAnnotationsAttribute.java
25911
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/RuntimeVisibleParameterAnnotationsAttribute.java
Clone Instance
1
Line Count
59
Source Line
11
Source File
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/RuntimeInvisibleParameterAnnotationsAttribute.java

/*******************************************************************************
 * Copyright (c) 2004, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.internal.core.util;

import org.eclipse.jdt.core.util.ClassFormatException;
import org.eclipse.jdt.core.util.IConstantPool;
import org.eclipse.jdt.core.util.IParameterAnnotation;
import org.eclipse.jdt.core.util.IRuntimeInvisibleParameterAnnotationsAttribute;

/**
 * Default implementation of IRuntimeInvisibleParameterAnnotations
 */
public class RuntimeInvisibleParameterAnnotationsAttribute extends
                ClassFileAttribute implements
                   IRuntimeInvisibleParameterAnnotationsAttribute {

        private static final IParameterAnnotation[] NO_ENTRIES = new IParameterAnnotation[0];

        private IParameterAnnotation[] parameterAnnotations;

        private int parametersNumber;

        /**
         * Constructor for RuntimeVisibleParameterAnnotations.
         * @param classFileBytes
         * @param constantPool
         * @param offset
         * @throws ClassFormatException
         */
        public RuntimeInvisibleParameterAnnotationsAttribute(
                byte[] classFileBytes,
                IConstantPool constantPool,
                int offset                                  ) throws
                       ClassFormatException {
                super(classFileBytes, constantPool, offset);
                final int length = u1At(classFileBytes, 6, offset);
                this.parametersNumber = length;
                if (length != 0) {
                        int readOffset = 7;
                        this.parameterAnnotations = new IParameterAnnotation[length];
                        for (int i = 0; i < length; i++) {
                                ParameterAnnotation parameterAnnotation = new ParameterAnnotation(classFileBytes, constantPool, offset + readOffset);
                                this.parameterAnnotations[i] = parameterAnnotation;
                                readOffset += parameterAnnotation.sizeInBytes();
                        }
                }
                else   {
                        this.parameterAnnotations = NO_ENTRIES;
                }
        }

        /* (non-Javadoc)
         * @see org.eclipse.jdt.core.util.IRuntimeInvisibleParameterAnnotations#getAnnotations()
         */
        public IParameterAnnotation[] getParameterAnnotations() {
                return this.parameterAnnotations;
        }

        /* (non-Javadoc)
         * @see org.eclipse.jdt.core.util.IRuntimeInvisibleParameterAnnotations#getParametersNumber()
         */
        public int getParametersNumber() {
                return this.parametersNumber;
        }
}




Clone Instance
2
Line Count
59
Source Line
11
Source File
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/RuntimeVisibleParameterAnnotationsAttribute.java

/*******************************************************************************
 * Copyright (c) 2004, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.internal.core.util;

import org.eclipse.jdt.core.util.ClassFormatException;
import org.eclipse.jdt.core.util.IConstantPool;
import org.eclipse.jdt.core.util.IParameterAnnotation;
import org.eclipse.jdt.core.util.IRuntimeVisibleParameterAnnotationsAttribute;

/**
 * Default implementation of IRuntimeVisibleAnnotations
 */
public class RuntimeVisibleParameterAnnotationsAttribute extends
                ClassFileAttribute implements
                   IRuntimeVisibleParameterAnnotationsAttribute {

        private static final IParameterAnnotation[] NO_ENTRIES = new IParameterAnnotation[0];

        private int parametersNumber;

        private IParameterAnnotation[] parameterAnnotations;

        /**
         * Constructor for RuntimeVisibleParameterAnnotations.
         * @param classFileBytes
         * @param constantPool
         * @param offset
         * @throws ClassFormatException
         */
        public RuntimeVisibleParameterAnnotationsAttribute(
                byte[] classFileBytes,
                IConstantPool constantPool,
                int offset                                ) throws
                       ClassFormatException {
                super(classFileBytes, constantPool, offset);
                final int length = u1At(classFileBytes, 6, offset);
                this.parametersNumber = length;
                if (length != 0) {
                        int readOffset = 7;
                        this.parameterAnnotations = new IParameterAnnotation[length];
                        for (int i = 0; i < length; i++) {
                                ParameterAnnotation parameterAnnotation = new ParameterAnnotation(classFileBytes, constantPool, offset + readOffset);
                                this.parameterAnnotations[i] = parameterAnnotation;
                                readOffset += parameterAnnotation.sizeInBytes();
                        }
                }
                else   {
                        this.parameterAnnotations = NO_ENTRIES;
                }
        }

        /* (non-Javadoc)
         * @see org.eclipse.jdt.core.util.IRuntimeVisibleParameterAnnotations#getAnnotations()
         */
        public IParameterAnnotation[] getParameterAnnotations() {
                return this.parameterAnnotations;
        }

        /* (non-Javadoc)
         * @see org.eclipse.jdt.core.util.IRuntimeVisibleParameterAnnotations#getParametersNumber()
         */
        public int getParametersNumber() {
                return this.parametersNumber;
        }
}




Clone AbstractionParameter Count: 6Parameter Bindings

/*******************************************************************************
 * Copyright (c) 2004, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.internal.core.util;

import org.eclipse.jdt.core.util.ClassFormatException;
import org.eclipse.jdt.core.util.IConstantPool;
import org.eclipse.jdt.core.util.IParameterAnnotation;
import org.eclipse.jdt.core.util. [[#variable91bab9c0]];

/**
 * Default implementation of IRuntimeInvisibleParameterAnnotations
 */
/**
 * Default implementation of IRuntimeVisibleAnnotations
 */
public class [[#variable91bab940]]extends ClassFileAttribute implements [[#variable91bab9c0]]{
  private static final IParameterAnnotation[] NO_ENTRIES = new IParameterAnnotation[0];

  private [[#variable91bab880]]  [[#variable91bab7e0]];

  private [[#variable91bab740]]  [[#variable91bab6c0]];

  /**
           * Constructor for RuntimeVisibleParameterAnnotations.
           * @param classFileBytes
           * @param constantPool
           * @param offset
           * @throws ClassFormatException
           */
  public [[#variable91bab940]](byte[] classFileBytes, IConstantPool constantPool, int offset) throws ClassFormatException {
    super(classFileBytes, constantPool, offset);
    final int length = u1At(classFileBytes, 6, offset);
    this.parametersNumber = length;
    if (length != 0) {
      int readOffset = 7;
      this.parameterAnnotations = new IParameterAnnotation[length];
      for (int i = 0; i < length; i++) {
        ParameterAnnotation parameterAnnotation = new ParameterAnnotation(classFileBytes, constantPool, offset + readOffset);
        this.parameterAnnotations[i] = parameterAnnotation;
        readOffset += parameterAnnotation.sizeInBytes();
      }
    }
    else {
      this.parameterAnnotations = NO_ENTRIES;
    }
  }

  /* (non-Javadoc)
           * @see org.eclipse.jdt.core.util.IRuntimeInvisibleParameterAnnotations#getAnnotations()
           */
  /* (non-Javadoc)
           * @see org.eclipse.jdt.core.util.IRuntimeVisibleParameterAnnotations#getAnnotations()
           */
  public IParameterAnnotation[] getParameterAnnotations() {
    return this.parameterAnnotations;
  }

  /* (non-Javadoc)
           * @see org.eclipse.jdt.core.util.IRuntimeInvisibleParameterAnnotations#getParametersNumber()
           */
  /* (non-Javadoc)
           * @see org.eclipse.jdt.core.util.IRuntimeVisibleParameterAnnotations#getParametersNumber()
           */
  public int getParametersNumber() {
    return this.parametersNumber;
  }
}


 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#91bab9c0]]
IRuntimeInvisibleParameterAnnotationsAttribute 
12[[#91bab9c0]]
IRuntimeVisibleParameterAnnotationsAttribute 
21[[#91bab940]]
RuntimeInvisibleParameterAnnotationsAttribute 
22[[#91bab940]]
RuntimeVisibleParameterAnnotationsAttribute 
31[[#91bab880]]
IParameterAnnotation[] 
32[[#91bab880]]
int 
41[[#91bab7e0]]
parameterAnnotations 
42[[#91bab7e0]]
parametersNumber 
51[[#91bab740]]
int 
52[[#91bab740]]
IParameterAnnotation[] 
61[[#91bab6c0]]
parametersNumber 
62[[#91bab6c0]]
parameterAnnotations