home *** CD-ROM | disk | FTP | other *** search
/ CD Actual Thematic 7: Programming / CDAT7.iso / demos / VisualAge for Java 2.0 Entry / setup / data1.cab / ide-e / IDE / RELNOTES / JCL.TXT < prev    next >
Encoding:
Text File  |  1998-09-16  |  29.7 KB  |  719 lines

  1.  
  2. ============================================================================
  3.  
  4.                           VisualAge for Java
  5.                              Version 2.0
  6.  
  7.            Java Class Libraries and Program Execution
  8.  
  9.                           RELEASE NOTES
  10.  
  11. ============================================================================
  12.  
  13. Table of Contents
  14.  
  15. 1.0 Introduction
  16.  
  17. 2.0 The Class Libraries
  18.   2.1 General Notes
  19.   2.2 package java.lang
  20.     2.2.1 Math
  21.     2.2.2 Exceptions
  22.     2.2.3 Class Loader
  23.     2.2.4 Special case for Runtime.getRuntime().exec (...);
  24.   2.3 package java.awt
  25.     2.3.1 Fonts
  26.     2.3.2 Graphics
  27.     2.3.3 Widgets
  28.   2.4 package java.applet
  29.     2.4.1 Applet security
  30.   2.5 package sun.jdbc.odbc
  31.   2.6 package sun.tools.jar
  32.   2.7 package java.io
  33.   2.8 package java.util
  34.     2.8.1 package java.util.zip
  35.   2.9 package java.net
  36.   2.10 RMI
  37. 3.0 Program Execution
  38.   3.1 Java threads
  39.     3.1.1 Threads and JNI
  40.     3.1.2 Terminating threads in the Debugger
  41.   3.2 Simulating multiple virtual machines
  42.   3.3 Running Java Programs and Changing a Type
  43.   3.4 Object finalization
  44.   3.5 Memory Limit
  45.   3.6 JNI
  46.     3.6.1 Unsupported JNI API
  47.     3.6.2 JNI on OS/2
  48.  
  49. 1.0 Introduction
  50.  
  51. This release note provides information, which can not be found
  52. elsewhere, on the class libraries provided with VisualAge
  53. Version 2.0 . In addition, it describes how programs are executed
  54. within the VisualAge environment.
  55.  
  56.  
  57. 2.0 The Class Libraries
  58.  
  59. 2.1 General Notes
  60.  
  61. This release is based on the Sun JDK 1.1.6 class libraries. In
  62. general, there is a very high degree of compatibility between the Sun
  63. JDK and VisualAge implementations. However, there are some
  64. differences. In the following sections, they will be described.  They
  65. can be broken down into the following major areas:
  66.  
  67.     - The AWT peer classes provided with VisualAge are based on a
  68.       stable, multi-platform class library which uses real platform
  69.       widgets as the underlying implementation. This allows us to provide
  70.       capabilities such as execution of multiple simultaneous Java
  71.       programs within a single execution environment, live edit of AWT
  72.       widgets within the development tools, and correct platform specific
  73.       behavior from portable application code.
  74.  
  75.     - All native methods provided with VisualAge have been
  76.       implemented by the VisualAge team. In the few cases where the Sun
  77.       JDK 1.1.6 implementation differs from the Sun specified behavior, we
  78.       have attempted to follow the spec. In cases where the spec was
  79.       ambiguous, VisualAge have attempted to match the Sun JDK 1.1.6 behavior.
  80.  
  81.     - A small number of changes were made to the JDK libraries to address
  82.       bugs which would have significant impact on the usability of the
  83.       system.
  84.  
  85.  
  86. 2.2 package java.lang
  87.  
  88. 2.2.1 Math
  89.  
  90. VisualAge 2.0 uses the standard IEEE representation as
  91. defined in the Java specification. The previous release (VisualAge
  92. for Java 1.0) had a limitation where all floating point values were
  93. double (i.e. 8 byte IEEE). This was a known limitation which has been
  94. removed in this release.
  95.  
  96. 2.2.2 Exceptions
  97.  
  98. The stack trace information which is provided by the
  99. Throwable.printStackTrace(...) method will not match exactly the
  100. output from a Sun VM's stack trace. This reflects different
  101. underlying implementations, and is not a defect.
  102.  
  103. When an uncaught exception causes the debugger to open, only the
  104. stack between the last place where the exception was caught (for
  105. example, by a "synchronize (...) { ... }" statement) and the root of
  106. the stack trace will be visible. There are two possible strategies
  107. for debugging under this scenario. One is to breakpoint the method
  108. causing the problem and manually step through the offending code. The
  109. other strategy is to place a breakpoint where a particular exception
  110. is thrown and just let the code run. You can activate this feature
  111. from the Debugger (Caught Exceptions) or from another browser, using
  112. Window->Debug->Caught Exceptions.
  113.  
  114. The ThreadDeath exception does not provide interesting stack trace
  115. information.
  116.  
  117. 2.2.3 ClassLoader
  118.  
  119. As per a standard Java virtual machine the classPath variable is used
  120. to specify which locations are examined when trying to load classes
  121. or resources.  The IDE adds the ability to treat projects loaded into
  122. the workspace as elements of the classPath.  When a program attempts
  123. to locate a class or resource the search proceeds as follows:
  124.  
  125.     1) search the projects in the IDE workspace as specified by the classPath
  126.     2) dynamically load class/resource from a jar/directory on the classPath
  127.     3) dynamically load class/resource from the project resources directory
  128.  
  129. The ClassLoaders included with VisualAge are constructed in
  130. such a way that they respect both the user-specified classPath and
  131. the rules of the development environment concerning how classes are
  132. brought into the workspace and code repository.  This leads to the
  133. following restrictions:
  134.  
  135.     - ClassLoaders obey the classPath specified for the program, any call
  136.     to the default loadClass(...) methods in ClassLoader, or
  137.     Class.forName(...) will throw a ClassNotFoundException if the type is
  138.     not reachable on the specified classPath.
  139.  
  140.     - When a program that has dynamically loaded classes completes or is
  141.     terminated all dynamically loaded classes are unloaded.
  142.  
  143.     - The IDE allows a class of a given fully-qualified name to be
  144.     dynamically loaded even if a like-named class exists in the IDE
  145.     workspace.  However, the workspace and dynamically loaded versions of
  146.     these classes cannot be run concurrently.  The program that loaded
  147.     the dynamically loaded version must run to completion or be
  148.     terminated before the workspace version can be invoked.
  149.  
  150.     - The IDE only safely supports one instance of a class with a given name
  151.     across all default packages.  For example, having a class named 'A' in the
  152.     default package of projects ProjA and ProjB can lead to unpredictable results.
  153.  
  154.     - It is not possible to use defineClass(...) to *redefine* an
  155.     existing class in the workspace.
  156.  
  157.  
  158. 2.2.4 Special case for Runtime.getRuntime().exec (...);
  159.  
  160. You can launch an external program by the use of
  161. Runtime.getRuntime().exec (...).  If that program happens to be the
  162. "java" executable, the IDE will recognize it and will automatically
  163. redirect this and run the java program in the IDE itself.  For
  164. instance, load project "IBM Java Examples" and try the following in
  165. the Scrapbook
  166.  
  167.     Runtime.getRuntime().exec ("java com.ibm.ivj.examples.awttests.AwtRollingOTI");
  168.  
  169. If you go to the Debugger you will see that the new Java program is
  170. running in the IDE itself.  As part of the name listed in the
  171. Debugger you will see the extra text "<unnamed>".
  172.  
  173. If you need to launch "java" outside the IDE, make sure you give
  174. it a different name or simply use an absolute file path to it (e.g.
  175. "c:\bin\java ..." instead of "java ...").
  176.  
  177. 2.3 package java.awt
  178.  
  179. 2.3.1 Fonts
  180.  
  181. The following are the known limitations and omissions in the AWT font
  182. support as provided by the VisualAge Version 2.0 class libraries.
  183. Some of these cases describe platform behavior which application
  184. programmers should be aware of.
  185.  
  186. 2.3.1 Fonts
  187.  
  188. * Japanese characters specified in .properties files do not display
  189.     correctly on Solaris.
  190.  
  191.     When Japanese characters are specified in a .properties file using
  192.     the JavaSoft recommended approach of using a 6 character ASCII
  193.     unicode escape string (e.g. \u3058) per Japanese character, the
  194.     characters do not display correctly when the properties file is used
  195.     in VisualAge.  This is due to the difference in the way font
  196.     sets are created and used on Solaris between VisualAge and JavaSoft.
  197.  
  198. * BeanBox dialog and menu fonts are hard to read on Japanese AIX
  199.     The fonts used for the BeanBox dialogs and menus do not scale
  200.     to a small size well on Japanese AIX, which makes the dialogs
  201.     and menus hard to read.
  202.  
  203. * Font names lowercased
  204.     Font names returned by java.awt.Toolkit.getFontList() are in lower
  205.     case. This is correct behavior because they appear as lower case in
  206.     the resource file named 'font.properties'. Sun's VM returns mixed
  207.     case names because they have hardcoded font names and do not use the
  208.     font.properties resources.
  209.  
  210. * On Japanese AIX, bold and italic versions of fonts are not bold or italic
  211.     On Japanese AIX, some of the fonts in the default font.properties
  212.     file do not correctly display bold or italic.  It is possible that if
  213.     your application uses its own .properties file(s), you could specify
  214.     a font for which bold and italic work.  The problem is due to the way
  215.     font sets are created by Motif versus the way the JDK supports font
  216.     sets.
  217.  
  218. 2.3.2 Graphics
  219.  
  220. The following are the known limitations and omissions in the AWT
  221. graphics support as provided by the VisualAge Version 2.0 class
  222. libraries.  Some of these cases describe platform behavior which
  223. application programmers should be aware of.
  224.  
  225.  
  226. * No support for PM Palette Manager (OS/2 only)
  227.     Using the PM Palette Manager can cause other applications to display
  228.     with incorrect colors. Applications which do use the PM Palette
  229.     Manager, such as Netscape, can cause VisualAge to draw with
  230.     incorrect colors. We recommend disabling the 'Palette Aware' option
  231.     of Netscape, located on the Colors page of Netscape's Options / General
  232.     Preferences dialog.
  233.  
  234. * VisualAge running at 256 colors on UNIX has incorrect colors
  235.     when Netscape is running
  236.  
  237.     When running Netscape simultaneously with the VisualAge IDE, VisualAge
  238.     may not be able to obtain all the colors it requires, which results in
  239.     various colors being incorrect.
  240.  
  241.     Workaround:
  242.     If the incorrect colors create a problem, do not run Netscape at the same
  243.     time as VisualAge
  244.  
  245. * Image dithering quality (OS/2 only)
  246.     Image dithering has lower quality on OS/2 WARP than on Windows.  This
  247.     is due to the limitation on the number of colours available in 256
  248.     colour mode on OS/2 WARP when not using the PM Palette Manager. In
  249.     addition, ordered dithering of images produces images that are too
  250.     light in the OS/2 WARP implementation. Ordered dithering is only used
  251.     when an ImageProducer sends data in random (i.e. not in top-down,
  252.     left-right) order.  This latter problem does not appear when loading
  253.     .GIF and .JPEG files.
  254.  
  255. * Arc/oval dimensions
  256.     Arcs and ovals draw one pixel too large in some situations.  This is
  257.     more likely when the dimensions are even.
  258.  
  259. * Internal Error running image loading code.
  260.  
  261.     VisualAge can get internal errors under high stress conditions -
  262.     typically while running multiple programs that load images.  Code
  263.     which fetches images must call back to Java from native code, and
  264.     this can fail occasionally when the system is very busy.
  265.  
  266. * Large Bold characters added when printing from OS/2 Japanese.
  267.  
  268.     There is an OS/2 printer driver bug when printing from OS/2 Warp 4
  269.     Japanese to a 'Hewlett Packard Laser Jet III Si' printer.  Occasionally
  270.     large bold characters are added to the text that is printed.
  271.  
  272. * Non-black text is not printed on 'Hewlett Packard Laser Jet III Si' printer
  273.     from Windows NT.
  274.  
  275.     Printing text using the java.awt.Graphics.drawString(String g, int x, int y)
  276.     method will map all non-black text to white giving the appearance that the
  277.     text is not printed.
  278.  
  279.     Workaround: print only black text.
  280.  
  281. * Printing Japanese characters from Windows 95 can cause Windows
  282.     General Protection Faults
  283.  
  284.     For some printers, printing Japanese characters from certain Japanese
  285.     fonts from Windows 95 can cause General Protection Faults which will
  286.     terminate VisualAge.  The same problem will happen when using
  287.     the same font and printer with other Windows applications as well.
  288.  
  289.     Workaround: do not allow your application to use that font and
  290.     printer combination.
  291.  
  292. * Off screen images are not printed on Postscript printers from Windows NT
  293.     when image files, such as GIF or JPEG, are drawn on top of it using
  294.     the java.awt.Graphics.drawImage() methods.
  295.  
  296.     Workaround: print in two steps:
  297.             - first print the off-screen image without drawing any
  298.                 file images on top of it;
  299.             - then print the file images directly to the printer.
  300.  
  301. 2.3.3 Widgets
  302.  
  303. The following are the known limitations and omissions in the AWT
  304. widget peer classes as provided by the VisualAge Version 2.0 class
  305. libraries.  Some of these cases describe platform behavior which
  306. application programmers should be aware of.
  307.  
  308.  
  309.  
  310. * Sun JDK 1.1.6 API missing features
  311.     All API for the Java AWT peer interfaces are implemented, with the
  312.     exception of the following:
  313.  
  314.         ALL Platforms.
  315.             ii) java.awt.peer.FileDialogPeer
  316.                 setFilenameFilter(java.io.FilenameFilter)
  317.  
  318. * Color limitation (Windows 95/NT only)
  319.     When running the VisualAge IDE on Windows in 256 color mode it is
  320.     possible that widgets will not be drawn using the exact color that was
  321.     requested. On Windows, in 256 color mode, only the 20 system colors are
  322.     used by the operating system to draw the background and foreground of
  323.     widgets.
  324.  
  325.     Workaround:
  326.         Use 16-bit color mode.
  327.  
  328. * Button Color limitation (Windows 95/NT only)
  329.  
  330.     The background and foreground colours for java.awt.Buttons can not
  331.     be changed.
  332.  
  333. * Color limitation (OS/2 only)
  334.     On OS/2 Warp 4 in 256 color mode when running Netscape 2.02
  335.     simultaneously with the VisualAge IDE, the IDE is unable to get all
  336.     the colors needed to draw widgets and graphics.
  337.  
  338.     Possible workarounds:
  339.         1) Disable palette awareness in Netscape.  (i.e. Unchecking the
  340.            palette aware option on the General Preferences Color page.)
  341.         2) Use 16-bit color mode.
  342.         3) Do not run Netscape when using the IDE in 256 color mode.
  343.  
  344. * Button has extra border (OS/2 only)
  345.     Buttons have an extra border around them which is drawn in black when
  346.     they are selected, and in the background color when they are not.  This
  347.     can give the appearances of extra space during layout relative to the
  348.     appearance on other platforms, but is not a bug.
  349.  
  350. * Cursors in lightweight components (OS2 only)
  351.     If the cursor is inside a lightweight component and the cursor type for
  352.     this component is changed, it will not be updated until the mouse
  353.     pointer is moved out of the component and back in.
  354.  
  355. * Fonts in menus
  356.     Setting fonts in menus (using MenuComponent.setFont(...)) will not
  357.     change the font.
  358.  
  359. * Paint and update events
  360.     Paint and update events are sent right after showing a window.
  361.     Application code which sends show() or setVisible() to a window before
  362.     ensuring that all initialization required to handle the paint() and
  363.     update() methods is complete may be unprepared for the first paint or
  364.     update call. For example, code like the following which needs
  365.     paintColor to be non-nil in the paint() method may fail.
  366.  
  367.         MyFrame mf = new MyFrame("Not Initialized");
  368.         mf.show();
  369.         // paint method uses paintColor to draw things
  370.         // but initializes it after sending show() (*wrong!*)
  371.         Color paintColor = Color.red;
  372.  
  373. * Scrollpane scrollbars jump
  374.     Clicking on a scroll bar within the scrollpane to page up or down can
  375.     cause the scroll bar to jump once after the block increment is set.
  376.  
  377. * FileDialog save (Windows 95, NT only)
  378.     FileDialog does not prompt to overwrite files by default. When opening
  379.     a FileDialog for saving a file, the VisualAge AWT file dialog does not
  380.     prompt the user if they want to overwrite an existing file of the
  381.     same name.
  382.  
  383. * Initial Frame sizes
  384.     When the width and height are not specified for Frames in
  385.     VisualAge they will not open so small that widgets are not
  386.     visible.  VisualAge Java picks a minimum size which makes widgets
  387.     visible in the Frame.
  388.  
  389. * Clipboard lost ownership notifications
  390.     Clipboard owners are not notified via #lostOwnership() when the
  391.     clipboard contents change.
  392.  
  393. * F1 and F10 keys are not captured using a java.awt.event.KeyListener on OS/2.
  394.     F10 triggers the system menu or the first menu of a menu bar and
  395.     F1 starts up on-line help.
  396.  
  397. 2.4 package java.applet
  398.  
  399. 2.4.1 Applet security
  400.  
  401. Applets are run from within the environment with an AppletSecurity
  402. manager active. By default this security manager will provide only very
  403. restrictive network access. This access can be changed using the
  404. AppletViewer properties menu.
  405.  
  406. 2.5 package sun.jdbc.odbc
  407.  
  408. The following are the known limitations and omissions in the sun.jdbc.odbc
  409. package as provided by the VisualAge Version 2.0 class libraries.
  410.  
  411. * OS/2 JDBC-ODBC Bridge
  412.     At the time of product availability, the Bridge was not included
  413.     in the 1.1.6 OS/2 JDK.   JDBC data access via OS/2 ODBC drivers is
  414.     not supported in the VisualAge for OS/2 development environment.
  415.  
  416. 2.6 package sun.tools.jar
  417.  
  418. * Running the jar utility from the IDE does not convert wildcard arguments
  419. as in the following:
  420.  
  421.     jar cvf test.jar *.class
  422.  
  423. This is correct behavior -- in the Sun implementation it is the JAR.EXE
  424. file which provides wildcarding, not the Java code.
  425.  
  426. Under OS/2, the jar utility does not support specifying options such as
  427.  
  428.     jar cvf test.jar .
  429.  
  430. 2.7 package java.io
  431.  
  432. * The API lastModified() will return zero when the file has a name with
  433.     double byte characters.
  434.  
  435. *java.io.FileStreams
  436.     The bytes written in a file are flushed only when the file
  437.     is closed. A program that writes bytes on a FileOutputStream and,
  438.     without closing it, opens a FileInputStream on the same file
  439.     will not be able to read the bytes because they were not flushed yet.
  440.  
  441. 2.8 package java.util
  442.  
  443. * java.util.TimeZone ( OS/2 )
  444.     If the field java.util.TimeZoneData.zones does not include the time
  445.     zone taken from the Operating System another one with the same
  446.     offset will be chosen.
  447.  
  448.     On OS/2 German the TZ var is set as 'MEZ-1' which is not
  449.     in the TimeZoneData table; consequently the user.time zone will be
  450.     set as "Europe/Paris" (GMT). In this case the API currentTimeMillis
  451.     will answer a number with a one hour difference.
  452.  
  453.     Workaround: change the TZ var before starting VisualAge
  454.  
  455. 2.8.1 package java.util.zip
  456.  
  457. *ZipOutputStream.write(...) fails to zip all bytes
  458.     ZipOutputStream.write(...) is failing to zip all bytes into the
  459.     stream if the buffer passed as a parameter is bigger than 32K.
  460.     The zip entry will be truncated to 32K if a program opens a file, reads
  461.     it into a byte array (bigger than 32K) and trys to zip it into a zip file.
  462.  
  463.     Workaround: write into the zip stream using a small buffer (4K
  464.         for example) in a loop.
  465.  
  466. 2.9 package java.net
  467.  
  468. The following behaviour can be observed in the VisualAge
  469. version 2.0 java.net classes:
  470.  
  471. In general, the return errors vary slightly from the jdk.
  472. For example, errors in attempting to connect to a socket address/port
  473. will generate a  SocketException with the error Connection Refused
  474. instead of a ConnectException.
  475.  
  476. AIX/Solaris
  477. ===========
  478.  
  479. java.net.ServerSocket does not free the socket properly in the
  480. following case:
  481.     The server socket is waiting on an accept call with no timeout
  482.     specified and an attempt is made to close the socket from another
  483.     thread. It will not be possible to re-use that address/port pair
  484.     until you exit the VisualAge and restart it.  This problem stems from
  485.     an underlying tcp stack problem, so it may occur differently
  486.     depending upon the OS version.
  487.  
  488. 2.10 RMI
  489.  
  490. * RMIRegistry (AIX and Solaris) only starts once
  491.     The RMI Registry will start once but it fails to close the
  492.     server socket and the pair address/port will not be freed starting
  493.     the RMI Registry a second time in the same port will fail.  The
  494.     status message will say that rmi registry is started, but
  495.     an exception will be printed in the console and the
  496.     status message will not be updated.
  497.  
  498.     There are two possible workarounds for this
  499.         1) re-start VisualAge.
  500.         2) start the RMI registry on another port.
  501.  
  502. * RMIRegistry class path (all platforms) required
  503.     The RMI Registry is using the workspace class path which needs
  504.     to include the project that has the stub/skeleton classes otherwise
  505.     a NoClassDefFoundError exception will be thrown.
  506.     As a side effect other programs started after changing the workspace
  507.     classPath will have that entry in the classPath as well.
  508.  
  509.  
  510. 3.0 Program Execution
  511.  
  512. Warning: The aspects of the execution environment described in this
  513. section may change in future releases.  Therefore, you should avoid
  514. implementing code that relies on the behavior described here.
  515.  
  516. 3.1 Java threads
  517.  
  518. Java threads are not implemented as OS threads. Roughly speaking, the
  519. whole environment runs as a single OS thread, and Java threads are
  520. implemented in software by the environment itself. Threads are
  521. scheduled based on time slices of approximately 10 milliseconds. You
  522. cannot change this value.
  523.  
  524. Although priorities of Java threads can be changed by the API
  525. available in java.lang.Thread, internally they are scheduled as
  526. though they all have the same priority. The IDE itself also runs as a
  527. thread (which is not visible to application code), but at a higher
  528. priority.  This may cause the other threads to "freeze" when IDE
  529. operations are being performed.
  530.  
  531. This approach allows the IDE UI to be more responsive to user
  532. actions.  However, it also means that if the IDE UI blocks for some
  533. reason (and it can), the environment will feel as though it has hung.
  534. Typical actions that cause this are waiting on OS blocking calls or
  535. blocking on monitors (i.e., synchronized methods). Therefore, Java
  536. code that is run from within the IDE UI thread can potentially lock
  537. the environment. Typically, this does not happen, but it can occur
  538. when evaluating synchronized methods from the debugger and during
  539. certain operations performed by the visual composition editor.
  540.  
  541. 3.1.1 Threads and JNI
  542.  
  543. Even though Threads in the IDE are not implemented with real OS
  544. threads, a JNI call that may end up making an OS blocking call will
  545. not lock the whole VM. A proprietary mechanism is used so that the
  546. other Java threads still run, simulating the concurrency of real OS
  547. threads.
  548.  
  549. 3.1.2 Terminating threads in the Debugger
  550.  
  551. Caution should be used when terminating threads in the debugger,
  552. since this may cause deadlocks or prevent an application from
  553. processing events. For instance, the standard AWT event dispatch
  554. thread for a Java program (that has AWT windows) shows up in the list
  555. of available threads, and if it is terminated, that particular
  556. program will no longer respond to UI events (mouse move/enter/click,
  557. etc ). You will have to terminate that Java program using the
  558. Debugger to get the window(s) to close.
  559.  
  560. If you use the Visual Composition Editor (VCE) and you have enabled
  561. "Show system programs" from the Debugging page of the Options dialog,
  562. you will be able to see the AWT EventQueue thread for the program you
  563. are building visually. The same restrictions apply here - make sure
  564. you do not terminate any of the threads or the program itself. Make
  565. sure you use just the VCE itself for that particular program.
  566. Internal errors may happen if you fail to do so.
  567.  
  568. 3.2 Simulating multiple virtual machines
  569.  
  570. The Scrapbook can have multiple pages, each of which behaves like a
  571. completely separate Java program running in its own virtual machine.
  572. Code that is run in one page has no side-effects on code running in
  573. other pages. Therefore, if you have client/server programs for
  574. example, and you want to test them in the same machine, there is no
  575. need to start two separate environments. All you need to do is open a
  576. page in the Scrapbook and type in code to launch your server. Then go
  577. to another page and type the code to launch your client code. They
  578. behave just as they were launched from two separate virtual machines.
  579.  
  580. Here is a simpler example. If you have class X with static slot y,
  581. and it is initialized with null as shown below:
  582.  
  583.    public static String y = null;
  584.  
  585. and you go to one new page of the Scrapbook and run:
  586.  
  587.    X.y = "abc"; com.ibm.uvm.tools.DebugSupport.inspect (X.y);
  588.  
  589. you get an Inspector showing:
  590.  
  591.    "abc"
  592.  
  593. Now go to another new page of the Scrapbook and run:
  594.  
  595.    com.ibm.uvm.tools.DebugSupport.inspect (X.y);
  596.  
  597. In this Inspector the value of y is still null.
  598.  
  599. Note, however, that if you add, modify or delete methods or classes,
  600. the changes are global to the environment. That is, any changes in
  601. the code either in methods, or the shape of the classes, are
  602. immediately visible in all Scrapbook pages where these classes are
  603. used (and in all associated inspectors, debuggers, and so on). In
  604. some cases, depending on the change, the Scrapbook page may be reset
  605. - see the section: 'Running Java Programs and Changing a Type'.
  606.  
  607. As you would expect, code which is run from the Run -> In Applet
  608. Viewer... and Run -> Run Main... menu items also behaves like a
  609. completely separate Java program running in its own virtual machine.
  610.  
  611. 3.3 Running Java Programs and Changing a Type
  612.  
  613. You can change methods as a Java program runs, and this will have
  614. immediate impact on the behavior of the application, so that you can
  615. experiment with changes. However, if you change a type significantly
  616. (adding/removing fields, etc.) all programs where that type has
  617. been initialized will be terminated. In the case of Scrapbook pages,
  618. the pages will be reset.
  619.  
  620. Changes in static fields do not cause program termination or Scrapbook pages
  621. to be reset.
  622.  
  623. A special case of this behaviour is the finalize() method. An object
  624. will only be finalized if a finalize() method (other than the one in
  625. Object) was defined at the time the object was instantiated. Adding a
  626. finalizer to running code will allow any new objects to be finalized
  627. when they become garbage, but any pre-existing objects will not be
  628. finalized.  If a finalizer is deleted, when the objects are collected
  629. the nearest superclass finalize() implementation is used (potentially
  630. the one in Object).
  631.  
  632. 3.4 Object finalization
  633.  
  634. Objects that are no longer referenced may be finalized if they
  635. implement the finalize() method. However, it is important to note
  636. that nothing prevents users from writing finalizers that can,
  637. potentially, loop forever. For instance, a finalizer can be
  638. implemented to do
  639.  
  640.     while (true) {};
  641.  
  642. This would make the finalizer thread loop forever,
  643. being unable to finalize any other objects.
  644.  
  645. Another obvious case is deadlock, where a finalizer attempts to call
  646. a synchronized method, and there is already a different thread in the
  647. monitor associated with the object. In this case the finalizer will
  648. have to wait until the monitor is released. If the monitor is never
  649. released due to program bugs, the finalizer will also block forever.
  650.  
  651. Programs can also generate garbage at a high rate, in which case the
  652. finalizers have to be run more often. Running finalizers is very
  653. important in an integrated environment like the IDE, since it can
  654. host multiple programs running (for instance, multiple applets, or
  655. multiple pages in the Scrapbook), simulating multiple virtual
  656. machines as described in section 3.2.
  657.  
  658. Not running finalizers could mean leaking OS resources, which
  659. is why the IDE is careful about finalizing as much as possible.
  660.  
  661. In order to cope with the constraints above, the IDE reserves a
  662. finalizer thread with an internal priority higher than the priority
  663. at which the Java programs usually run (See the section: 'Java
  664. threads').  This thread sleeps for a while, then it wakes up and
  665. finalizes some objects, then it sleeps again. If the garbage creation
  666. rate is high, it will run longer (finalizing) between sleeps.  It
  667. also has a timeout to run finalization. If objects cannot be
  668. finalized in that particular interval the finalizer thread is
  669. terminated and a new one is created, and the whole finalization
  670. mechanism is restarted. Currently the finalization timeout is five
  671. seconds, and the finalizer sleeps/wakes up every one second. These
  672. values cannot be changed.
  673.  
  674. 3.5 Memory Limit
  675.  
  676. This release of VisualAge has an aggressive memory allocation scheme
  677. that attempts to compact the heap several times before asking the OS
  678. for more memory.  In addition, there is a relatively high limit on
  679. how much memory can be allocated from the OS.  If the machine has
  680. overcommitted on memory allocation, the compaction algorithm will
  681. cause swapping.  If the user wishes to manually cut down the amount
  682. of memory available to the product (ie: cause OutOfMemoryError
  683. exception to be thrown earlier), please add the following two lines
  684. of text to the end of the ide.ini file in the program directory:
  685.  
  686. [VM Options]
  687. maximumMemoryLimit=ZZZ
  688.  
  689. Where ZZZ is the maximum number of BYTES the product should be
  690. allowed to allocate. (e.g.: maximumMemoryLimit=128000000 for approx.
  691. 128MB memory limit).
  692.  
  693. Note also that the VM behaves differently than the Sun JDK when
  694. dealing with OutOfMemoryError.  Attempting to allocate many more
  695. objects after the exception has been thrown can lead to the abrupt
  696. termination of the whole IDE.
  697.  
  698. 3.6 JNI
  699.  
  700. 3.6.1 Unsupported JNI API
  701.  
  702. * The JNI Invocation API methods are not implemented.
  703.  
  704.     This is a known limitation in R2.0 of VisualAge.
  705.  
  706. 3.6.2 JNI on OS/2
  707.  
  708. * JNI on OS/2 requires IBM VisualAge C++ for OS/2, Version 3 CSD level
  709.     CTC306 or later.
  710.  
  711.     The following system error, which prematurely terminates the IDE,
  712.     may occur with prior CSD levels of the C compiler when a JNI native C
  713.     implementation contains a printf() and console output is not redirected
  714.     (i.e. IDE > trace).
  715.  
  716.     OS/2 - SYS-147
  717.     Not enough resources are available to process this command.
  718.     The process for which this pop-up is displayed will end.
  719.