Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 197569

Summary: [assist] Default proposal clone() method on array reports to belong to primitive
Product: [Eclipse Project] JDT Reporter: Evan O'Dorney <Emo916math>
Component: CoreAssignee: David Audel <david_audel>
Status: CLOSED DUPLICATE QA Contact:
Severity: minor    
Priority: P3 CC: daniel_megert
Version: 3.3   
Target Milestone: 3.4 M1   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Evan O'Dorney CLA 2007-07-23 21:52:51 EDT
I am running Eclipse Europa on Gentoo Linux and have installed only PMD and the Europa Discovery Site onto my Eclipse system. When I type

    class A {
      int[] a; // analogous problems with float[], Object[] or int[][]
      a.

a proposal window pops up. The problem line is:

   clone() int[] - int

You can't clone an int. clone() should be a method of class int[]
Comment 1 David Audel CLA 2007-07-26 07:18:22 EDT
public class Test {
  {
    int[] a = new int[]{1};
    int[] b = a.clone();
    a.clone()[0] = 0;
  }
}

This example is valid so the proposal of 'clone() int[] - int' is valid.

I close this bug as INVALID.
Comment 2 Frederic Fusier CLA 2007-12-20 06:43:46 EST
Verified for 3.4M1
Comment 3 Dani Megert CLA 2015-07-22 04:09:30 EDT
.

*** This bug has been marked as a duplicate of bug 473101 ***