United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-4890577 JCK1.5-runtime api/java_awt/GridBagLayout/index.html#AddLayoutComponent failed
JDK-4890577 : JCK1.5-runtime api/java_awt/GridBagLayout/index.html#AddLayoutComponent failed

Details
Type:
Bug
Submit Date:
2003-07-15
Status:
Closed
Updated Date:
2004-01-30
Project Name:
JDK
Resolved Date:
2003-10-23
Component:
client-libs
OS:
generic
Sub-Component:
java.awt
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:
5.0 (b26)

Related Reports

Sub Tasks

Description

Name: aaR10208			Date: 07/15/2003


Filed By       : J2SE-SQA [###@###.###
JDK            : JDK1.5.0-b10 (also fails with 1.2.2-1.4.2)
JCK            : JCK1.5-runtime (b01)
Platform[s]    : generic
JCK test owner : http://javaweb.eng/jck/usr/owners.jto
Falling test[s]: api/java_awt/GridBagLayout/index.html#AddLayoutComponent [aLC_String]

JCK1.5-runtime api/java_awt/GridBagLayout/index.html#AddLayoutComponent test fails on JDK1.5.0-b10.

The test tests GridBagLayout.addLayoutComponent(String,Component) and expects that the component will
added to layout. The J2SE API Spec for LayoutManager.addLayoutComponent(String,Component) (which provides
this method to GridBagLayout) states that "**if the layout manager uses a per-component string**, adds the component".

The test fails at least as far back as 1.2.2.

Test source location:
=====================
/java/re/jck/1.5/promoted/latest/binaries/JCK-runtime-5/tests/api/java_awt/GridBagLayout/AddLayoutComponentTests.java

jtr file location:
==================
/net/jtgb4u4c.sfbay/export/sail15/results/tiger/b10/jck15/sparc/sol10_sparc_gnomeclient_incgc_linux-8/workDir/api/java_awt/GridBagLayout/index_AddLayoutComponent.jtr

How to reproduce:
=================
Run the following script (you may need to change its variables)

--- script start ---
#!/bin/sh
JCK="/java/re/jck/1.5/promoted/latest/binaries/JCK-runtime-15"
JDK="/java/re/jdk/1.5.0/promoted/latest/binaries/solaris-sparc"
#JCK="/net/linux-15/export/home/java/jck1.5/JCK-runtime-15"
#JDK="/net/linux-15/export/home/java/jdk1.5.0/sparc"
switches="-showversion"
CLASSPATH="$JCK/classes:$JCK/lib/javatest.jar"

$JDK/bin/java $switches -cp $CLASSPATH javasoft.sqe.tests.api.java.awt.GridBagLayout.AddLayoutComponentTests -TestCaseID aLC_String

--- script end ---

Test output:
============
java version "1.5.0-beta"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-beta-b10)
Java HotSpot(TM) Client VM (build 1.5.0-beta-b10, mixed mode)

Component with name "" was not added
Component with name "a" was not added
Component with name "ab" was not added
Component with name "name" was not added
aLC_String: Failed. Failed, please see log output
STATUS:Failed.test cases: 1; all failed; first test case failure: aLC_String


======================================================================

                                    

Comments
EVALUATION



Name: sdR10048			Date: 09/24/2003

As it turned out GridBadLayout.addLayoutComponent(String name, Component comp)
has no implementaion. See GridBagLayout.java:
  /**
   * Adds the specified component with the specified name to the layout.
   * @param      name         the name of the component
   * @param      comp         the component to be added
   */
  public void addLayoutComponent(String name, Component comp) {
  }

So I reassign it to JDK bug.


======================================================================

Name: agR10216			Date: 09/26/2003


The method GridBadLayout.addLayoutComponent(String name, Component
comp) does nothing indeed. The javadoc for this method should say
that it is "not used by this class" as in
FlowLayout.addLayoutComponent(String name, Component comp).

But the test calls directly GridBadLayout.addLayoutComponent(String
name, Component comp). Such a use isn't supposed. One should call
Container.add(String name, Component comp) instead. The test should be
revised. For example see the test
api/java_awt/GridLayout/index.html#AddLayoutComponent and note that
GridLayout.addLayoutComponent(String name, Component comp) does
nothing (and it isn't explicitly specified) either.

###@###.### 2003-09-26
======================================================================

Name: agR10216			Date: 10/08/2003


The following CCC request was approved:

 4890577 : JCK1.5-runtime api/java_awt/GridBagLayout/index.html#AddLayoutComponent failed
 Release: Tiger
 Type: bug-fix
 Manager: Jeff.Dinkins
 Engineer: ###@###.###
 
 Problem
 
 The JCK1.5 test
 api/java_awt/GridBagLayout/index.html#AddLayoutComponent fails because
 it verifies the method
 java.awt.GridBadLayout.addLayoutComponent(String name, Component comp),
 which does nothing but the specification says that this method "Adds
 the specified component with the specified name to the layout."
 
 This method inherited from the interface java.awt.LayoutManager. The
 specification of LayoutManager.addLayoutComponent(String name, Component comp)
 says: "If the layout manager uses a per-component string, adds the
 component comp to the layout, associating it with the string specified
 by name."
 
 GridBagLayout does not use a per-component string, so it should be
 specified that this method has no effect (as in
 javax.swing.SpringLayout, javax.swing.BoxLayout and
 java.awt.FlowLayout). This change affects only documentation.
 
 Requestors
 Java AWT team
 
 
 Solution
 
 According to the implementation, specify that the method
 java.awt.GridBadLayout.addLayoutComponent(String name, Component comp)
 has no effect.
 
 
 Interface summary
 
 exported  external  method  java.awt.GridBadLayout.addLayoutComponent(String name, Component comp)
 
 
 Specification
 
 java.awt.GridBadLayout:
 
     /**
 !    * Has no effect, since this layout manager does not use a per-component string.
      */
     public void addLayoutComponent(String name, Component comp) {
     }
 
     
 Compatibility risk: minimal
 
 Engineering commitments
 Request will be finalized by: date-of-submission (FAST-TRACK request)
 Change will be integrated by: 2003-10-17
 
 Request reviewed by: ###@###.###

###@###.### 2003-10-08


======================================================================
                                     
2004-08-24
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
tiger-beta

FIXED IN:
tiger-beta

INTEGRATED IN:
tiger-b26
tiger-beta

VERIFIED IN:
tiger-beta


                                     
2004-08-24



Hardware and Software, Engineered to Work Together