JDK-4699949 : error in constructor in java.text.DictionaryBasedBreakIterator.Builder
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.text
  • Affected Version: 1.4.2
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris_8
  • CPU: generic
  • Submitted: 2002-06-10
  • Updated: 2002-06-13
  • Resolved: 2002-06-13
Related Reports
Duplicate :  
Description
We are in the process of fixing a compiler bug (4635044) that exposes a bug
in the constructor for java.text.DictionaryBasedBreakIterator.Builder.  The
relevant portions of all participating classes are

     1  package java.text;
     2
     3  class RuleBasedBreakIterator {
     4      protected class Builder {
     5          public Builder() {
     6          }
     7      }
     8  }
     9
    10  class DictionaryBasedBreakIterator extends RuleBasedBreakIterator {
    11      protected class Builder extends RuleBasedBreakIterator.Builder {
    12          public Builder() {
    13              
    14          }
    15      }
    16  }

The constructor on line 12 is implicitly the same (by JLS2 8.8.5) as

	public Builder() {
	    super();
	}

Since the superclass is an inner member class, by 8.8.5.1, (about a third 
of the way down page 195) it is a compile-time error if the superclass is
not a member of a lexically enclosing class.  The superclass,
RuleBasedBreakIterator.Builder, is not a member of the lexically enclosing
class, DictionaryBasedBreakIterator, because it is HIDDEN in that class
by the declaration of the member DictionaryBasedBreakIterator.Builder.
Therefore the compiler is required to reject this code.

The code can easily be corrected by adding the following in line 13:

		DictionaryBasedBreakIterator.this.super();

I am doing that in my own copy of the code so that I can proceed with
my compiler bug fixes, but I'd like your blessing (please) on the
correctness of this change in the java.text package.  If you approve then
please assign this bug to me (gafter) and
I will put this correction back with my compiler changes.


Comments
PUBLIC COMMENTS ...
10-06-2004

EVALUATION Will be fixed with the affected compiler changes, so I am marking it as a dup. ###@###.### 2002-06-13
13-06-2002