/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
@test
@bug 6255653
@summary REGRESSION: Override isLightweight() causes access violation in awt.dll
@author Andrei Dmitriev: area=awt-component
@run main StubPeerCrash
*/
/*
* The test may not crash for several times so iteratively continue up to some limit.
*/
public class StubPeerCrash {
{
for (int i = 0; i < ITERATIONS; i++){
showFrame(i);
}
}
private static void showFrame(int i){
f.add(new AHeavyweightComponent());
f.setVisible(true);
f.setVisible(false);
}
}
public AHeavyweightComponent(){
}
public boolean isLightweight() {
return false;
}
return peer;
}
}
public boolean isObscured(){return true;};
public boolean canDetermineObscurity(){return true;};
public void setVisible(boolean b){};
public void setEnabled(boolean b){};
public void dispose(){};
public void updateCursorImmediately(){};
boolean temporary,
boolean focusedWindowChangeAllowed,
return true;
};
public boolean isFocusable(){return true;};
public boolean handlesWheelScrolling(){return true;};
public void destroyBuffers(){};
/**
* Reparents this peer to the new parent referenced by <code>newContainer</code> peer
* Implementation depends on toolkit and container.
* @param newContainer peer of the new parent container
* @since 1.5
*/
/**
* Returns whether this peer supports reparenting to another parent withour destroying the peer
* @return true if appropriate reparent is supported, false otherwise
* @since 1.5
*/
public boolean isReparentSupported(){return true;};
/**
* Used by lightweight implementations to tell a ComponentPeer to layout
* its sub-elements. For instance, a lightweight Checkbox needs to layout
* the box, as well as the text label.
*/
public void layout(){};
/**
* Applies the shape to the native component window.
* @since 1.7
*/
/**
* DEPRECATED: Replaced by getPreferredSize().
*/
/**
* DEPRECATED: Replaced by getMinimumSize().
*/
/**
* DEPRECATED: Replaced by setVisible(boolean).
*/
public void show(){};
/**
* DEPRECATED: Replaced by setVisible(boolean).
*/
public void hide(){};
/**
* DEPRECATED: Replaced by setEnabled(boolean).
*/
public void enable(){};
/**
* DEPRECATED: Replaced by setEnabled(boolean).
*/
public void disable(){};
/**
* DEPRECATED: Replaced by setBounds(int, int, int, int).
*/
}