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

Bug 94755

Summary: [quick fix] offers to raise visibility of method instead of class
Product: [Eclipse Project] JDT Reporter: David Saff <david>
Component: UIAssignee: rgra Missing name <rgransberger>
Status: CLOSED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, Sebastian.Dietrich
Version: 3.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description David Saff CLA 2005-05-11 11:31:29 EDT
Against I20050509-2010.from20050511_1145

Given three files in two packages

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

package net.saff.flashcards.language;

import net.saff.flashcards.Card;

public enum TheLanguage {
	QUEENS_ENGLISH, FRENCH, GERMAN;

	public Object getSide(Card card) {
		return card.getSides().get(this);
	}
}

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

package net.saff.flashcards;

public class Card {
	LanguageMap _theSides = new LanguageMap();

	public LanguageMap getSides() {
		return _theSides;
	}
}

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

package net.saff.flashcards;

import java.util.EnumMap;

import net.saff.flashcards.language.TheLanguage;

class LanguageMap extends EnumMap<TheLanguage, String> {
	private static final long serialVersionUID = 1L;

	LanguageMap() {
		super(TheLanguage.class);
	}
}

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

There is a compile error in TheLanguage.getSide, because LanguageMap is not
visible.  The quick fix, instead of offering to make LanguageMap public, offers
to make Card.getSides public (it already is).
Comment 1 Deepak Azad CLA 2012-11-21 15:16:16 EST
*** Bug 336390 has been marked as a duplicate of this bug. ***
Comment 2 Dani Megert CLA 2013-03-12 08:27:07 EDT

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