Name: dkR10074 Date: 04/12/2002
###@###.###
The bug is demonstrated by the following testcase:
-----------------------------------------
import java.awt.*;
import java.awt.event.*;
import java.util.*;
public class PrintInLandscapeModeTest extends Frame
implements ActionListener {
public PrintInLandscapeModeTest() {
Button buttonPrinter = new Button("Print to Printer...");
buttonPrinter.addActionListener(this);
add(buttonPrinter);
}
public void actionPerformed(ActionEvent ev) {
Properties props = new Properties();
PrintJob pj = getToolkit().getPrintJob(this, "Print test!",props);
if (pj == null)
return;
Graphics g = pj.getGraphics();
printComponents(g);
g.dispose();
pj.end();
}
public static void main(String args[]) {
Frame f = new PrintInLandscapeModeTest();
f.setSize(300, 200);
f.setVisible(true);
}
}
-----------------------------------------
If you run it and try to print something in *landscape* mode
(portrait mode works fine), you will get the following
exception:
--------------------------------------------------------------------------------------
java.lang.ClassNotFoundException: sun/java2d/loops/SetDrawLineANY
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:130)
at sun.java2d.loops.GraphicsPrimitiveProxy.instantiate(GraphicsPrimitiveProxy.java:64)
at sun.java2d.loops.GraphicsPrimitiveMgr.locate(GraphicsPrimitiveMgr.java:254)
at sun.java2d.loops.GraphicsPrimitiveMgr.locatePrim(GraphicsPrimitiveMgr.java:211)
at sun.java2d.loops.GraphicsPrimitiveMgr.locate(GraphicsPrimitiveMgr.java:161)
at sun.java2d.loops.DrawLine.locate(DrawLine.java:38)
at sun.java2d.SurfaceData.makeRenderLoops(SurfaceData.java:472)
at sun.awt.image.BufImgSurfaceData.getSolidLoops(BufImgSurfaceData.java:350)
at sun.awt.image.BufImgSurfaceData.initSolidLoops(BufImgSurfaceData.java:335)
at sun.awt.image.BufImgSurfaceData.createData(BufImgSurfaceData.java:212)
at sun.java2d.loops.BlitBg$General.BlitBg(BlitBg.java:141)
at sun.java2d.pipe.DrawImage.blitSurfaceData(DrawImage.java:634)
at sun.java2d.pipe.DrawImage.renderSurfaceData(DrawImage.java:359)
at sun.java2d.pipe.DrawImage.clipAndRenderSurfaceData(DrawImage.java:337)
at sun.java2d.pipe.DrawImage.transformImage(DrawImage.java:299)
at sun.java2d.pipe.DrawImage.scaleBufferedImage(DrawImage.java:426)
at sun.java2d.pipe.DrawImage.scaleImage(DrawImage.java:504)
at sun.java2d.pipe.DrawImage.scaleImage(DrawImage.java:774)
at sun.java2d.pipe.ValidatePipe.scaleImage(ValidatePipe.java:171)
at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:2854)
at sun.awt.windows.WPathGraphics.drawImageToGDI(WPathGraphics.java:1270)
at sun.awt.windows.WPathGraphics.drawImage(WPathGraphics.java:766)
at sun.awt.windows.WPathGraphics.drawImage(WPathGraphics.java:681)
at sun.awt.windows.WPathGraphics.drawImage(WPathGraphics.java:620)
at sun.awt.windows.WPathGraphics.drawImage(WPathGraphics.java:563)
at sun.awt.windows.WPathGraphics.drawImage(WPathGraphics.java:472)
at sun.print.ProxyGraphics.drawImage(ProxyGraphics.java:814)
at sun.awt.windows.WComponentPeer.print(WComponentPeer.java:218)
at java.awt.GraphicsCallback$PeerPrintCallback.run(GraphicsCallback.java:85)
at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
at java.awt.Component.printAll(Component.java:2534)
at java.awt.GraphicsCallback$PrintHeavyweightComponentsCallback.run(GraphicsCallback.java:121)
at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
at java.awt.Container.printHeavyweightComponents(Container.java:1394)
at java.awt.Container.lightweightPrint(Container.java:1386)
at java.awt.GraphicsCallback$PeerPrintCallback.run(GraphicsCallback.java:83)
at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
at java.awt.Component.printAll(Component.java:2534)
at java.awt.GraphicsCallback$PrintAllCallback.run(GraphicsCallback.java:54)
at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:90)
at java.awt.Container.printComponents(Container.java:1372)
at MainFrame$ActionPrint.actionPerformed(EmbedPrintTest.java:266)
at java.awt.Button.processActionEvent(Button.java:381)
at java.awt.Button.processEvent(Button.java:350)
at java.awt.Component.dispatchEventImpl(Component.java:3598)
at java.awt.Component.dispatchEvent(Component.java:3439)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:197)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
--------------------------------------------------------------------------------------
This bug can be reproduced using Hopper build 6.
I run the test on Windows 2000.
======================================================================
- duplicates
-
JDK-4648973 compiler does not emit code for second class in source file
-
- Closed
-