This commit is contained in:
Igor Nekrestyanov 2011-12-19 10:06:23 -08:00
commit 30c9b2b165
383 changed files with 9840 additions and 19007 deletions

View File

@ -137,3 +137,4 @@ cc1f5ce8e504d350e0b0c28c5f84333f8d540132 jdk8-b11
4cc0ef72c812943743ef4765f1100e2fbe2b1a08 jdk8-b13 4cc0ef72c812943743ef4765f1100e2fbe2b1a08 jdk8-b13
9ffaa48dbfb0f5936c2b789867d0785faec7071d jdk8-b14 9ffaa48dbfb0f5936c2b789867d0785faec7071d jdk8-b14
b5060eae3b32fd9f884a09774338cd8186d7fafa jdk8-b15 b5060eae3b32fd9f884a09774338cd8186d7fafa jdk8-b15
736a63b854f321c7824b7e47890135f80aee05e3 jdk8-b16

View File

@ -137,3 +137,5 @@ f1ec21b8142168ff40f3278d2f6b5fe4bd5f3b26 jdk8-b09
4cb2e8679b27432854690cb688ea06d3b2d8e008 jdk8-b13 4cb2e8679b27432854690cb688ea06d3b2d8e008 jdk8-b13
99632935785e2038b2fc836da9f2ede69dea294b jdk8-b14 99632935785e2038b2fc836da9f2ede69dea294b jdk8-b14
3c248d0e2c486624cc0d7aba1e4df45ae5774ff7 jdk8-b15 3c248d0e2c486624cc0d7aba1e4df45ae5774ff7 jdk8-b15
b71d1acfae5240d8c1359443cd02b5ddb587231c jdk8-b17
929597c6e777f742ad252660045ebaa4a3ea4772 jdk8-b16

View File

@ -65,5 +65,12 @@ ifdef CROSS_COMPILE_ARCH
NIO_PLATFORM_CLASSES_ROOT_DIR = $(CLOSED_PLATFORM_SRC)/classes/ NIO_PLATFORM_CLASSES_ROOT_DIR = $(CLOSED_PLATFORM_SRC)/classes/
endif endif
# For ARM sflt we need to link to a library with improved FP accuracy
# and it must be linked after fdlibm - this places it at the end after libc
# -z muldefs avoids linker errors for duplicate symbols.
ifeq ($(CROSS_COMPILE_ARCH), arm)
EXTRA_LIBS += $(EXT_LIBS_PATH)/sflt_glibc_jdk.a -Xlinker -z -Xlinker muldefs
endif
endif # JAVASE_EMBEDDED endif # JAVASE_EMBEDDED

View File

@ -202,7 +202,7 @@ endif
# #
# zlib version # zlib version
# #
ZLIB_VERSION = 1.2.3 ZLIB_VERSION = 1.2.5
# #

View File

@ -233,13 +233,15 @@ classes : $(CLASSES_INIT) .delete.classlist .compile.classlist
@$(MKDIR) -p $(CLASSDESTDIR) @$(MKDIR) -p $(CLASSDESTDIR)
@$(RM) $<.filtered @$(RM) $<.filtered
@$(CAT) $< | $(NAWK) 'length>0' | $(SORT) -u > $<.filtered @$(CAT) $< | $(NAWK) 'length>0' | $(SORT) -u > $<.filtered
@if [ `$(CAT) $<.filtered | $(WC) -l` -ge 1 ] ; then \ @numfiles=`$(WC) -l < $<.filtered` ; \
$(ECHO) "# Java sources to be compiled: (listed in file $<)"; \ if [ $$numfiles -ge 1 ] ; then \
$(CAT) $<.filtered; \ $(ECHO) "# Java sources to be compiled: (listed in file $<)"; \
$(ECHO) "# Running javac:"; \ $(CAT) $<.filtered; \
$(ECHO) $(JAVAC_CMD) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$<.filtered; \ $(ECHO) "# Running javac: $$numfiles files; in $(CURDIR)"; \
$(JAVAC_CMD) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$<.filtered; \ $(ECHO) $(JAVAC_CMD) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$<.filtered; \
fi $(JAVAC_CMD) -sourcepath "$(SOURCEPATH)" -d $(CLASSDESTDIR) @$<.filtered; \
$(ECHO) "# javac finished"; \
fi
@$(java-vm-cleanup) @$(java-vm-cleanup)
clobber clean:: clobber clean::

View File

@ -32,7 +32,10 @@ FILES_c = \
zip_util.c \ zip_util.c \
compress.c \ compress.c \
deflate.c \ deflate.c \
gzio.c \ gzclose.c \
gzlib.c \
gzread.c \
gzwrite.c \
infback.c \ infback.c \
inffast.c \ inffast.c \
inflate.c \ inflate.c \

View File

@ -30,8 +30,10 @@ SUNWprivate_1.1 {
Java_java_util_jar_JarFile_getMetaInfEntryNames; Java_java_util_jar_JarFile_getMetaInfEntryNames;
Java_java_util_zip_Adler32_update; Java_java_util_zip_Adler32_update;
Java_java_util_zip_Adler32_updateBytes; Java_java_util_zip_Adler32_updateBytes;
Java_java_util_zip_Adler32_updateByteBuffer;
Java_java_util_zip_CRC32_update; Java_java_util_zip_CRC32_update;
Java_java_util_zip_CRC32_updateBytes; Java_java_util_zip_CRC32_updateBytes;
Java_java_util_zip_CRC32_updateByteBuffer;
Java_java_util_zip_Deflater_deflateBytes; Java_java_util_zip_Deflater_deflateBytes;
Java_java_util_zip_Deflater_end; Java_java_util_zip_Deflater_end;
Java_java_util_zip_Deflater_getAdler; Java_java_util_zip_Deflater_getAdler;

View File

@ -140,71 +140,13 @@ FILES_2D_c = \
debug_trace.c \ debug_trace.c \
debug_util.c debug_util.c
# These files rely on motif to be built, and should not be included
# in a headless build.
#FILES_MOTIF_c = \
#keep awt_AWTEvent.c \
# awt_Button.c \
# awt_Canvas.c \
# awt_Checkbox.c \
#keep .h awt_Component.c \
#keep .h awt_Cursor.c \
# awt_DataTransferer.c \
# awt_DrawingSurface.c \
# awt_Event.c \
# awt_FileDialog.c \
# awt_GlobalCursorManager.c \
# awt_GraphicsEnv.c \
# awt_InputMethod.c \
#keep awt_Insets.c \
# awt_KeyboardFocusManager.c \
# awt_Label.c \
# awt_List.c \
# awt_Menu.c \
# awt_MenuBar.c \
# awt_MenuComponent.c \
# awt_MenuItem.c \
# awt_motif.c \
# awt_Plugin.c \
# awt_PopupMenu.c \
# awt_Robot.c \
# awt_Scrollbar.c \
# awt_ScrollPane.c \
# awt_Selection.c \
# awt_UNIXToolkit.c \
# awt_TextArea.c \
# awt_TextField.c \
# awt_TopLevel.c \
# awt_mgrsel.c \
# awt_util.c \
# awt_wm.c \
# awt_XmDnD.c \
# awt_dnd.c \
# awt_dnd_ds.c \
# awt_dnd_dt.c \
# canvas.c \
# cursor.c \
# multi_font.c \
# robot_common.c \
# list.c \
# multiVis.c \
# XDrawingArea.c \
# MouseInfo.c \
# awt_xembed.c \
# awt_xembed_server.c \
# gtk2_interface.c \
# swing_GTKEngine.c \
# swing_GTKStyle.c
# These files are required to be built, with or without motif. Some of # These files are required to be built, with or without motif. Some of
# these are only dependent on X11, and some contain native source that # these are only dependent on X11, and some contain native source that
# is required, even in a headless build. # is required, even in a headless build.
FILES_NO_MOTIF_c = \ FILES_NO_MOTIF_c = \
awt_Font.c \ awt_Font.c \
awt_MToolkit.c \ HeadlessToolkit.c \
fontpath.c \ fontpath.c \
VDrawingArea.c \ VDrawingArea.c \
X11Color.c \ X11Color.c \

View File

@ -61,11 +61,8 @@ FILES_export = \
sun/awt/image/BufImgSurfaceData.java \ sun/awt/image/BufImgSurfaceData.java \
sun/awt/image/DataBufferNative.java \ sun/awt/image/DataBufferNative.java \
\ \
sun/awt/motif/X11FontMetrics.java \
sun/awt/X11InputMethod.java \ sun/awt/X11InputMethod.java \
sun/awt/motif/MFontConfiguration.java \ sun/awt/motif/MFontConfiguration.java \
sun/awt/motif/MFontPeer.java \
sun/awt/motif/MToolkit.java \
sun/awt/DebugSettings.java \ sun/awt/DebugSettings.java \
sun/awt/EmbeddedFrame.java \ sun/awt/EmbeddedFrame.java \
sun/awt/PlatformFont.java \ sun/awt/PlatformFont.java \
@ -93,7 +90,6 @@ FILES_export = \
sun/java2d/cmm/ColorTransform.java \ sun/java2d/cmm/ColorTransform.java \
sun/awt/datatransfer/DataTransferer.java \ sun/awt/datatransfer/DataTransferer.java \
sun/awt/dnd/SunDragSourceContextPeer.java \ sun/awt/dnd/SunDragSourceContextPeer.java \
sun/awt/motif/MToolkitThreadBlockedHandler.java \
sun/java2d/opengl/OGLBlitLoops.java \ sun/java2d/opengl/OGLBlitLoops.java \
sun/java2d/opengl/OGLContext.java \ sun/java2d/opengl/OGLContext.java \
sun/java2d/opengl/OGLMaskFill.java \ sun/java2d/opengl/OGLMaskFill.java \

View File

@ -31,7 +31,6 @@ SUNWprivate_1.1 {
global: global:
JNI_OnLoad; JNI_OnLoad;
#Java_sun_awt_motif_MComponentPeer_restoreFocus;
Java_sun_awt_DefaultMouseInfoPeer_fillPointWithCoords; Java_sun_awt_DefaultMouseInfoPeer_fillPointWithCoords;
Java_sun_awt_DefaultMouseInfoPeer_isWindowUnderMouse; Java_sun_awt_DefaultMouseInfoPeer_isWindowUnderMouse;
Java_java_awt_AWTEvent_nativeSetSource; Java_java_awt_AWTEvent_nativeSetSource;
@ -56,230 +55,11 @@ SUNWprivate_1.1 {
Java_sun_awt_UNIXToolkit_load_1stock_1icon; Java_sun_awt_UNIXToolkit_load_1stock_1icon;
Java_sun_awt_UNIXToolkit_load_1gtk_1icon; Java_sun_awt_UNIXToolkit_load_1gtk_1icon;
Java_sun_awt_UNIXToolkit_nativeSync; Java_sun_awt_UNIXToolkit_nativeSync;
#Java_sun_awt_motif_MButtonPeer_create;
#Java_sun_awt_motif_MButtonPeer_setLabel;
#Java_sun_awt_motif_MPanelPeer_pEnsureIndex;
#Java_sun_awt_motif_MPanelPeer_pRestack;
#Java_sun_awt_motif_MCanvasPeer_create;
#Java_sun_awt_motif_MCanvasPeer_initIDs;
#Java_sun_awt_motif_MCanvasPeer_resetTargetGC;
#Java_sun_awt_motif_MCheckboxMenuItemPeer_pSetState;
#Java_sun_awt_motif_MCheckboxPeer_create;
#Java_sun_awt_motif_MCheckboxPeer_setCheckboxGroup;
#Java_sun_awt_motif_MCheckboxPeer_setLabel;
#Java_sun_awt_motif_MCheckboxPeer_pSetState;
#Java_sun_awt_motif_MCheckboxPeer_pGetState;
#Java_sun_awt_motif_MChoicePeer_addItem;
#Java_sun_awt_motif_MChoicePeer_appendItems;
#Java_sun_awt_motif_MChoicePeer_create;
#Java_sun_awt_motif_MChoicePeer_pReshape;
#Java_sun_awt_motif_MChoicePeer_remove;
#Java_sun_awt_motif_MChoicePeer_removeAll;
#Java_sun_awt_motif_MChoicePeer_setBackground;
#Java_sun_awt_motif_MChoicePeer_pSelect;
#Java_sun_awt_motif_MChoicePeer_setFont;
#Java_sun_awt_motif_MChoicePeer_setForeground;
#Java_sun_awt_motif_MComponentPeer_addNativeDropTarget;
#Java_sun_awt_motif_MComponentPeer_getNativeColor;
#Java_sun_awt_motif_MComponentPeer_getWindow;
#Java_sun_awt_motif_MComponentPeer_pDisable;
#Java_sun_awt_motif_MComponentPeer_pDispose;
#Java_sun_awt_motif_MComponentPeer_pEnable;
#Java_sun_awt_motif_MComponentPeer_pGetLocationOnScreen;
#Java_sun_awt_motif_MComponentPeer_pGetLocationOnScreen2;
#Java_sun_awt_motif_MComponentPeer_pHide;
#Java_sun_awt_motif_MComponentPeer_pInitialize;
#Java_sun_awt_motif_MComponentPeer_pMakeCursorVisible;
#Java_sun_awt_motif_MComponentPeer_pReshape;
#Java_sun_awt_motif_MComponentPeer_pShow;
#Java_sun_awt_motif_MComponentPeer_removeNativeDropTarget;
#Java_sun_awt_motif_MComponentPeer_pSetBackground;
#Java_sun_awt_motif_MComponentPeer_pSetFont;
#Java_sun_awt_motif_MComponentPeer_processSynchronousLightweightTransfer;
#Java_sun_awt_motif_MComponentPeer__1requestFocus;
#Java_sun_awt_motif_MComponentPeer_getNativeFocusedWindow;
#Java_sun_awt_motif_MCheckboxMenuItemPeer_getState;
#Java_sun_awt_motif_MComponentPeer_pSetForeground;
#Java_sun_awt_motif_MDragSourceContextPeer_startDrag;
#Java_sun_awt_motif_MDragSourceContextPeer_setNativeCursor;
#Java_sun_awt_motif_MDropTargetContextPeer_addTransfer;
#Java_sun_awt_motif_MDropTargetContextPeer_dropDone;
#Java_sun_awt_motif_MDropTargetContextPeer_startTransfer;
#Java_sun_awt_motif_X11DragSourceContextPeer_startDrag;
#Java_sun_awt_motif_X11DragSourceContextPeer_setNativeCursor;
#Java_sun_awt_motif_X11DropTargetContextPeer_sendResponse;
#Java_sun_awt_motif_X11DropTargetContextPeer_dropDone;
#Java_sun_awt_motif_X11DropTargetContextPeer_getData;
#Java_sun_awt_motif_MEmbeddedFramePeer_NEFcreate;
#Java_sun_awt_motif_MEmbeddedFramePeer_pShowImpl;
#Java_sun_awt_motif_MEmbeddedFramePeer_requestXEmbedFocus;
#Java_sun_awt_motif_MEmbeddedFramePeer_isXEmbedApplicationActive;
#Java_sun_awt_motif_MEmbeddedFramePeer_isXEmbedActive;
#Java_sun_awt_motif_MEmbeddedFramePeer_synthesizeFocusInOut;
#Java_sun_awt_motif_MEmbeddedFramePeer_pReshapePrivate;
#Java_sun_awt_motif_MEmbeddedFramePeer_getBoundsPrivate;
#Java_sun_awt_motif_MEmbeddedFrame_getWidget;
#Java_sun_awt_motif_MEmbeddedFrame_mapWidget;
#Java_sun_awt_motif_MEmbedCanvasPeer_forwardEventToEmbedded;
#Java_sun_awt_motif_MFramePeer_pSetIconImage___3B_3I_3SII;
#Java_sun_awt_motif_MFileDialogPeer_create;
#Java_sun_awt_motif_MFileDialogPeer_pDispose;
#Java_sun_awt_motif_MFileDialogPeer_pHide;
#Java_sun_awt_motif_MFileDialogPeer_pReshape;
#Java_sun_awt_motif_MFileDialogPeer_pShow;
#Java_sun_awt_motif_MFileDialogPeer_setFileEntry;
#Java_sun_awt_motif_MFileDialogPeer_setFont;
#Java_sun_awt_motif_MFramePeer_pGetIconSize;
#Java_sun_awt_motif_MGlobalCursorManager_cacheInit;
#Java_sun_awt_motif_MGlobalCursorManager_findComponentAt;
#Java_sun_awt_motif_MGlobalCursorManager_findHeavyweightUnderCursor;
#Java_sun_awt_motif_MGlobalCursorManager_getCursorPos;
#Java_sun_awt_motif_MGlobalCursorManager_getLocationOnScreen;
#Java_sun_awt_motif_MLabelPeer_create;
#Java_sun_awt_motif_MLabelPeer_setAlignment;
#Java_sun_awt_motif_MLabelPeer_setText;
#Java_sun_awt_motif_MListPeer_addItem;
#Java_sun_awt_motif_MListPeer_create;
#Java_sun_awt_motif_MListPeer_delItems;
#Java_sun_awt_motif_MListPeer_deselect;
#Java_sun_awt_motif_MListPeer_isSelected;
#Java_sun_awt_motif_MListPeer_makeVisible;
#Java_sun_awt_motif_MListPeer_nativeHandleMouseWheel;
#Java_sun_awt_motif_MListPeer_select;
#Java_sun_awt_motif_MListPeer_setMultipleSelections;
#Java_sun_awt_motif_MMenuBarPeer_create;
#Java_sun_awt_motif_MMenuItemPeer_createMenuItem;
#Java_sun_awt_motif_MMenuItemPeer_pDisable;
#Java_sun_awt_motif_MMenuItemPeer_pDispose;
#Java_sun_awt_motif_MMenuItemPeer_pEnable;
#Java_sun_awt_motif_MMenuItemPeer_pSetLabel;
#Java_sun_awt_motif_MMenuPeer_createMenu;
#Java_sun_awt_motif_MMenuPeer_createSubMenu;
#Java_sun_awt_motif_MMenuPeer_pDispose;
#Java_sun_awt_motif_MPopupMenuPeer_createMenu;
#Java_sun_awt_motif_MPopupMenuPeer_pDispose;
#Java_sun_awt_motif_MPopupMenuPeer_pShow;
#Java_sun_awt_motif_MRobotPeer_getRGBPixelsImpl;
#Java_sun_awt_motif_MRobotPeer_keyPressImpl;
#Java_sun_awt_motif_MRobotPeer_keyReleaseImpl;
#Java_sun_awt_motif_MRobotPeer_mouseMoveImpl;
#Java_sun_awt_motif_MRobotPeer_mousePressImpl;
#Java_sun_awt_motif_MRobotPeer_mouseReleaseImpl;
#Java_sun_awt_motif_MRobotPeer_mouseWheelImpl;
#Java_sun_awt_motif_MRobotPeer_setup;
#Java_sun_awt_motif_MScrollbarPeer_create;
#Java_sun_awt_motif_MScrollbarPeer_setLineIncrement;
#Java_sun_awt_motif_MScrollbarPeer_setPageIncrement;
#Java_sun_awt_motif_MScrollbarPeer_pSetValues;
#Java_sun_awt_motif_MScrollPanePeer_create;
#Java_sun_awt_motif_MScrollPanePeer_pGetBlockIncrement;
#Java_sun_awt_motif_MScrollPanePeer_pGetScrollbarSpace;
#Java_sun_awt_motif_MScrollPanePeer_pGetShadow;
#Java_sun_awt_motif_MScrollPanePeer_pInsets;
#Java_sun_awt_motif_MScrollPanePeer_pSetIncrement;
#Java_sun_awt_motif_MScrollPanePeer_pSetScrollChild;
#Java_sun_awt_motif_MScrollPanePeer_setScrollPosition;
#Java_sun_awt_motif_MScrollPanePeer_setTypedValue;
#Java_sun_awt_motif_MTextAreaPeer_initIDs;
#Java_sun_awt_motif_MTextAreaPeer_pCreate;
#Java_sun_awt_motif_MTextAreaPeer_getCaretPosition;
#Java_sun_awt_motif_MTextAreaPeer_getExtraHeight;
#Java_sun_awt_motif_MTextAreaPeer_getExtraWidth;
#Java_sun_awt_motif_MTextAreaPeer_getSelectionEnd;
#Java_sun_awt_motif_MTextAreaPeer_getSelectionStart;
#Java_sun_awt_motif_MTextAreaPeer_getText;
#Java_sun_awt_motif_MTextAreaPeer_insert;
#Java_sun_awt_motif_MTextAreaPeer_nativeHandleMouseWheel;
#Java_sun_awt_motif_MTextAreaPeer_pMakeCursorVisible;
#Java_sun_awt_motif_MTextAreaPeer_pSetEditable;
#Java_sun_awt_motif_MTextAreaPeer_pShow2;
#Java_sun_awt_motif_MTextAreaPeer_replaceRange;
#Java_sun_awt_motif_MTextAreaPeer_select;
#Java_sun_awt_motif_MTextAreaPeer_setCaretPosition;
#Java_sun_awt_motif_MTextAreaPeer_setFont;
#Java_sun_awt_motif_MTextAreaPeer_setText;
#Java_sun_awt_motif_MTextAreaPeer_setTextBackground;
#Java_sun_awt_motif_MTextFieldPeer_initIDs;
#Java_sun_awt_motif_MTextFieldPeer_pCreate;
#Java_sun_awt_motif_MTextFieldPeer_getCaretPosition;
#Java_sun_awt_motif_MTextFieldPeer_getSelectionEnd;
#Java_sun_awt_motif_MTextFieldPeer_getSelectionStart;
#Java_sun_awt_motif_MTextFieldPeer_getText;
#Java_sun_awt_motif_MTextFieldPeer_insertReplaceText;
#Java_sun_awt_motif_MTextFieldPeer_preDispose;
#Java_sun_awt_motif_MTextFieldPeer_pSetEditable;
#Java_sun_awt_motif_MTextFieldPeer_select;
#Java_sun_awt_motif_MTextFieldPeer_setCaretPosition;
#Java_sun_awt_motif_MTextFieldPeer_setEchoChar;
#Java_sun_awt_motif_MTextFieldPeer_setFont;
#Java_sun_awt_motif_MTextFieldPeer_setText;
Java_sun_awt_motif_MToolkit_beep;
Java_sun_awt_motif_MToolkit_getLockingKeyStateNative;
Java_sun_awt_motif_MToolkit_getMulticlickTime;
Java_sun_awt_motif_MToolkit_getNumMouseButtons;
Java_sun_awt_motif_MToolkit_loadXSettings;
Java_sun_awt_motif_MToolkit_getScreenHeight;
Java_sun_awt_motif_MToolkit_getScreenResolution;
Java_sun_awt_motif_MToolkit_getScreenWidth;
Java_sun_awt_motif_MToolkit_init;
Java_sun_awt_motif_MToolkit_isDynamicLayoutSupportedNative;
Java_sun_awt_motif_MToolkit_isFrameStateSupported;
Java_sun_awt_motif_MToolkit_loadSystemColors;
Java_sun_awt_motif_MToolkit_makeColorModel;
Java_sun_awt_motif_MToolkit_run;
Java_sun_awt_motif_MToolkit_isAlwaysOnTopSupported;
Java_sun_awt_motif_MToolkit_getEventNumber;
Java_sun_awt_motif_MToolkit_updateSyncSelection;
Java_sun_awt_motif_MToolkit_isSyncUpdated;
Java_sun_awt_motif_MToolkit_isSyncFailed;
Java_sun_awt_motif_MToolkit_nativeUnGrab;
Java_sun_awt_motif_MToolkit_nativeGrab;
Java_sun_awt_motif_MToolkit_getWMName;
Java_sun_awt_motif_MWindowAttributes_initIDs;
#Java_sun_awt_motif_MWindowPeer_pDispose;
#Java_sun_awt_motif_MWindowPeer_pHide;
#Java_sun_awt_motif_MWindowPeer_pReshape;
#Java_sun_awt_motif_MWindowPeer_pSetTitle;
#Java_sun_awt_motif_MWindowPeer_pShow;
#Java_sun_awt_motif_MWindowPeer_setResizable;
#Java_sun_awt_motif_MWindowPeer_toBack;
#Java_sun_awt_motif_MWindowPeer_addTextComponentNative;
#Java_sun_awt_motif_MWindowPeer_getState;
#Java_sun_awt_motif_MWindowPeer_pSetIMMOption;
#Java_sun_awt_motif_MWindowPeer_pSetMenuBar;
#Java_sun_awt_motif_MWindowPeer_pShowModal;
#Java_sun_awt_motif_MWindowPeer_removeTextComponentNative;
#Java_sun_awt_motif_MWindowPeer_setSaveUnder;
#Java_sun_awt_motif_MWindowPeer_setState;
#Java_sun_awt_motif_MWindowPeer_resetTargetGC;
#Java_sun_awt_motif_MWindowPeer_registerX11DropTarget;
#Java_sun_awt_motif_MWindowPeer_unregisterX11DropTarget;
#Java_sun_awt_motif_MWindowPeer_updateAlwaysOnTop;
#Java_sun_awt_motif_MWindowPeer_setFocusableWindow;
#Java_sun_awt_motif_MWindowPeer_pToFront;
#Java_sun_awt_motif_MCustomCursor_cacheInit;
#Java_sun_awt_motif_MCustomCursor_createCursor;
#Java_sun_awt_motif_MCustomCursor_queryBestCursor;
Java_sun_awt_motif_X11FontMetrics_bytesWidth;
Java_sun_awt_motif_X11FontMetrics_getMFCharsWidth;
Java_sun_awt_motif_X11FontMetrics_init;
Java_sun_awt_X11InputMethod_disposeXIC; Java_sun_awt_X11InputMethod_disposeXIC;
Java_sun_awt_X11InputMethod_isCompositionEnabledNative; Java_sun_awt_X11InputMethod_isCompositionEnabledNative;
Java_sun_awt_X11InputMethod_resetXIC; Java_sun_awt_X11InputMethod_resetXIC;
Java_sun_awt_X11InputMethod_setCompositionEnabledNative; Java_sun_awt_X11InputMethod_setCompositionEnabledNative;
Java_sun_awt_X11InputMethod_turnoffStatusWindow; Java_sun_awt_X11InputMethod_turnoffStatusWindow;
#Java_sun_awt_motif_MInputMethod_openXIMNative;
#Java_sun_awt_motif_MInputMethod_configureStatusAreaNative;
#Java_sun_awt_motif_MInputMethod_createXICNative;
#Java_sun_awt_motif_MInputMethod_reconfigureXICNative;
#Java_sun_awt_motif_MInputMethod_setXICFocusNative;
#Java_sun_awt_motif_X11Clipboard_getClipboardData;
#Java_sun_awt_motif_X11Clipboard_getClipboardFormats;
#Java_sun_awt_motif_X11Clipboard_registerClipboardViewer;
#Java_sun_awt_motif_X11Clipboard_unregisterClipboardViewer;
#Java_sun_awt_motif_X11Selection_init;
#Java_sun_awt_motif_X11Selection_pGetSelectionOwnership;
#Java_sun_awt_motif_X11Selection_clearNativeContext;
Java_sun_awt_SunToolkit_closeSplashScreen; Java_sun_awt_SunToolkit_closeSplashScreen;
Java_sun_awt_PlatformFont_initIDs; Java_sun_awt_PlatformFont_initIDs;
Java_sun_awt_X11GraphicsConfig_init; Java_sun_awt_X11GraphicsConfig_init;
@ -313,25 +93,6 @@ SUNWprivate_1.1 {
Java_sun_awt_X11GraphicsEnvironment_pRunningXinerama; Java_sun_awt_X11GraphicsEnvironment_pRunningXinerama;
Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterPoint; Java_sun_awt_X11GraphicsEnvironment_getXineramaCenterPoint;
Java_sun_awt_X11GraphicsEnvironment_initXRender; Java_sun_awt_X11GraphicsEnvironment_initXRender;
#Java_sun_awt_motif_MEmbedCanvasPeer_initXEmbedServer;
#Java_sun_awt_motif_MEmbedCanvasPeer_destroyXEmbedServer;
#Java_sun_awt_motif_MEmbedCanvasPeer_isXEmbedActive;
#Java_sun_awt_motif_MEmbedCanvasPeer_initDispatching;
#Java_sun_awt_motif_MEmbedCanvasPeer_endDispatching;
#Java_sun_awt_motif_MEmbedCanvasPeer_embedChild;
#Java_sun_awt_motif_MEmbedCanvasPeer_childDestroyed;
#Java_sun_awt_motif_MEmbedCanvasPeer_getEmbedPreferredSize;
#Java_sun_awt_motif_MEmbedCanvasPeer_getEmbedMinimumSize;
#Java_sun_awt_motif_MEmbedCanvasPeer_getClientBounds;
#Java_sun_awt_motif_MEmbedCanvasPeer_notifyChildEmbedded;
#Java_sun_awt_motif_MEmbedCanvasPeer_detachChild;
#Java_sun_awt_motif_MEmbedCanvasPeer_forwardKeyEvent;
#Java_sun_awt_motif_MEmbedCanvasPeer_getAWTKeyCodeForKeySym;
#Java_sun_awt_motif_MEmbedCanvasPeer_sendMessage__I;
#Java_sun_awt_motif_MEmbedCanvasPeer_sendMessage__IJJJ;
#Java_sun_awt_motif_MEmbedCanvasPeer_getWindow;
#Java_sun_awt_motif_GrabbedKey_initKeySymAndModifiers;
#Java_sun_awt_motif_MEmbeddedFramePeer_traverseOut;
Java_java_awt_AWTEvent_initIDs; Java_java_awt_AWTEvent_initIDs;
Java_java_awt_Button_initIDs; Java_java_awt_Button_initIDs;
Java_java_awt_Container_initIDs; Java_java_awt_Container_initIDs;
@ -345,41 +106,6 @@ SUNWprivate_1.1 {
Java_java_awt_Insets_initIDs; Java_java_awt_Insets_initIDs;
Java_java_awt_TextField_initIDs; Java_java_awt_TextField_initIDs;
Java_java_awt_Window_initIDs; Java_java_awt_Window_initIDs;
#Java_sun_awt_motif_MCheckboxPeer_getIndicatorSize;
#Java_sun_awt_motif_MCheckboxPeer_getSpacing;
#Java_sun_awt_motif_MChoicePeer_freeNativeData;
#Java_sun_awt_motif_MComponentPeer_getComponents_1NoClientCode;
#Java_sun_awt_motif_MComponentPeer_getParent_1NoClientCode;
#Java_sun_awt_motif_MComponentPeer_initIDs;
#Java_sun_awt_motif_MComponentPeer_nativeHandleEvent;
#Java_sun_awt_motif_MComponentPeer_pSetCursor;
#Java_sun_awt_motif_MComponentPeer_pSetInnerForeground;
#Java_sun_awt_motif_MComponentPeer_pSetScrollbarBackground;
#Java_sun_awt_motif_MComponentPeer_setTargetBackground;
#Java_sun_awt_motif_MDataTransferer_dragQueryFile;
#Java_sun_awt_motif_MDataTransferer_getAtomForTarget;
#Java_sun_awt_motif_MDataTransferer_getTargetNameForAtom;
#Java_sun_awt_motif_MFileDialogPeer_insertReplaceFileDialogText;
Java_sun_awt_motif_MFontPeer_initIDs;
#Java_sun_awt_motif_MListPeer_setBackground;
#Java_sun_awt_motif_MMenuBarPeer_initIDs;
#Java_sun_awt_motif_MMenuBarPeer_pDispose;
#Java_sun_awt_motif_MMenuItemPeer_getParent_1NoClientCode;
#Java_sun_awt_motif_MMenuItemPeer_initIDs;
#Java_sun_awt_motif_MMenuItemPeer_pSetShortcut;
#Java_sun_awt_motif_MPopupMenuPeer_initIDs;
#Java_sun_awt_motif_MScrollbarPeer_initIDs;
#Java_sun_awt_motif_MScrollPanePeer_initIDs;
#Java_sun_awt_motif_MTextAreaPeer_pSetCursor;
Java_sun_awt_motif_MToolkit_shutdown;
#Java_sun_awt_motif_MWindowPeer_initIDs;
#Java_sun_awt_motif_MWindowPeer_pCreate;
#Java_sun_awt_motif_MWindowPeer_wrapInSequenced;
Java_sun_awt_motif_X11FontMetrics_initIDs;
#Java_sun_awt_X11InputMethod_initIDs;
#Java_sun_awt_motif_X11Selection_initIDs;
Java_sun_awt_motif_MToolkitThreadBlockedHandler_enter;
Java_sun_awt_motif_MToolkitThreadBlockedHandler_exit;
Java_sun_awt_X11GraphicsConfig_init; Java_sun_awt_X11GraphicsConfig_init;
Java_sun_awt_X11GraphicsConfig_initIDs; Java_sun_awt_X11GraphicsConfig_initIDs;
Java_sun_awt_X11GraphicsConfig_makeColorModel; Java_sun_awt_X11GraphicsConfig_makeColorModel;

View File

@ -170,7 +170,6 @@ SUNWprivate_1.1 {
GrPrim_Sg2dGetPixel; GrPrim_Sg2dGetPixel;
GrPrim_Sg2dGetLCDTextContrast; GrPrim_Sg2dGetLCDTextContrast;
#Java_sun_awt_motif_MComponentPeer_restoreFocus;
Java_sun_awt_DefaultMouseInfoPeer_fillPointWithCoords; Java_sun_awt_DefaultMouseInfoPeer_fillPointWithCoords;
Java_sun_awt_DefaultMouseInfoPeer_isWindowUnderMouse; Java_sun_awt_DefaultMouseInfoPeer_isWindowUnderMouse;
Java_java_awt_AWTEvent_nativeSetSource; Java_java_awt_AWTEvent_nativeSetSource;
@ -189,216 +188,11 @@ SUNWprivate_1.1 {
Java_java_awt_ScrollPane_initIDs; Java_java_awt_ScrollPane_initIDs;
Java_java_awt_TextArea_initIDs; Java_java_awt_TextArea_initIDs;
Java_sun_awt_FontDescriptor_initIDs; Java_sun_awt_FontDescriptor_initIDs;
#Java_sun_awt_motif_MButtonPeer_create;
#Java_sun_awt_motif_MButtonPeer_setLabel;
#Java_sun_awt_motif_MCanvasPeer_create;
#Java_sun_awt_motif_MCanvasPeer_initIDs;
#Java_sun_awt_motif_MCanvasPeer_resetTargetGC;
#Java_sun_awt_motif_MCheckboxMenuItemPeer_pSetState;
#Java_sun_awt_motif_MCheckboxPeer_create;
#Java_sun_awt_motif_MCheckboxPeer_setCheckboxGroup;
#Java_sun_awt_motif_MCheckboxPeer_setLabel;
#Java_sun_awt_motif_MCheckboxPeer_pSetState;
#Java_sun_awt_motif_MCheckboxPeer_pGetState;
#Java_sun_awt_motif_MChoicePeer_addItem;
#Java_sun_awt_motif_MChoicePeer_appendItems;
#Java_sun_awt_motif_MChoicePeer_create;
#Java_sun_awt_motif_MChoicePeer_pReshape;
#Java_sun_awt_motif_MChoicePeer_remove;
#Java_sun_awt_motif_MChoicePeer_removeAll;
#Java_sun_awt_motif_MChoicePeer_setBackground;
#Java_sun_awt_motif_MChoicePeer_pSelect;
#Java_sun_awt_motif_MChoicePeer_setFont;
#Java_sun_awt_motif_MChoicePeer_setForeground;
#Java_sun_awt_motif_MComponentPeer_addNativeDropTarget;
#Java_sun_awt_motif_MComponentPeer_createBackBuffer;
#Java_sun_awt_motif_MComponentPeer_destroyBackBuffer;
#Java_sun_awt_motif_MComponentPeer_getNativeColor;
#Java_sun_awt_motif_MComponentPeer_getWindow;
#Java_sun_awt_motif_MComponentPeer_pDisable;
#Java_sun_awt_motif_MComponentPeer_pDispose;
#Java_sun_awt_motif_MComponentPeer_pEnable;
#Java_sun_awt_motif_MComponentPeer_pGetLocationOnScreen;
#Java_sun_awt_motif_MComponentPeer_pGetLocationOnScreen2;
#Java_sun_awt_motif_MComponentPeer_pHide;
#Java_sun_awt_motif_MComponentPeer_pInitialize;
#Java_sun_awt_motif_MComponentPeer_pMakeCursorVisible;
#Java_sun_awt_motif_MComponentPeer_pReshape;
#Java_sun_awt_motif_MComponentPeer_pShow;
#Java_sun_awt_motif_MComponentPeer_removeNativeDropTarget;
#Java_sun_awt_motif_MComponentPeer_swapBuffers;
#Java_sun_awt_motif_MComponentPeer_pSetBackground;
#Java_sun_awt_motif_MComponentPeer_pSetFont;
#Java_sun_awt_motif_MComponentPeer_processSynchronousLightweightTransfer;
#Java_sun_awt_motif_MComponentPeer__1requestFocus;
#Java_sun_awt_motif_MCheckboxMenuItemPeer_getState;
#Java_sun_awt_motif_MComponentPeer_pSetForeground;
#Java_sun_awt_motif_MDragSourceContextPeer_startDrag;
#Java_sun_awt_motif_MDragSourceContextPeer_setNativeCursor;
#Java_sun_awt_motif_MDropTargetContextPeer_addTransfer;
#Java_sun_awt_motif_MDropTargetContextPeer_dropDone;
#Java_sun_awt_motif_MDropTargetContextPeer_startTransfer;
#Java_sun_awt_motif_X11DragSourceContextPeer_startDrag;
#Java_sun_awt_motif_X11DragSourceContextPeer_setNativeCursor;
#Java_sun_awt_motif_X11DropTargetContextPeer_sendResponse;
#Java_sun_awt_motif_X11DropTargetContextPeer_dropDone;
#Java_sun_awt_motif_X11DropTargetContextPeer_getData;
#Java_sun_awt_motif_MEmbeddedFramePeer_NEFcreate;
#Java_sun_awt_motif_MEmbeddedFramePeer_pShowImpl;
#Java_sun_awt_motif_MEmbeddedFramePeer_pReshapePrivate;
#Java_sun_awt_motif_MEmbeddedFramePeer_getBoundsPrivate;
#Java_sun_awt_motif_MFramePeer_pSetIconImage___3B_3I_3SII;
#Java_sun_awt_motif_MEmbeddedFramePeer_requestXEmbedFocus;
#Java_sun_awt_motif_MEmbeddedFramePeer_isXEmbedApplicationActive;
#Java_sun_awt_motif_MEmbeddedFramePeer_isXEmbedActive;
#Java_sun_awt_motif_MEmbeddedFrame_getWidget;
#Java_sun_awt_motif_MEmbeddedFrame_mapWidget;
#Java_sun_awt_motif_MFileDialogPeer_create;
#Java_sun_awt_motif_MFileDialogPeer_pDispose;
#Java_sun_awt_motif_MFileDialogPeer_pHide;
#Java_sun_awt_motif_MFileDialogPeer_pReshape;
#Java_sun_awt_motif_MFileDialogPeer_pShow;
#Java_sun_awt_motif_MFileDialogPeer_setFileEntry;
#Java_sun_awt_motif_MFileDialogPeer_setFont;
#Java_sun_awt_motif_MFramePeer_pGetIconSize;
#Java_sun_awt_motif_MGlobalCursorManager_cacheInit;
#Java_sun_awt_motif_MGlobalCursorManager_findComponentAt;
#Java_sun_awt_motif_MGlobalCursorManager_findHeavyweightUnderCursor;
#Java_sun_awt_motif_MGlobalCursorManager_getCursorPos;
#Java_sun_awt_motif_MGlobalCursorManager_getLocationOnScreen;
#Java_sun_awt_motif_MLabelPeer_create;
#Java_sun_awt_motif_MLabelPeer_setAlignment;
#Java_sun_awt_motif_MLabelPeer_setText;
#Java_sun_awt_motif_MListPeer_addItem;
#Java_sun_awt_motif_MListPeer_create;
#Java_sun_awt_motif_MListPeer_delItems;
#Java_sun_awt_motif_MListPeer_deselect;
#Java_sun_awt_motif_MListPeer_isSelected;
#Java_sun_awt_motif_MListPeer_makeVisible;
#Java_sun_awt_motif_MListPeer_select;
#Java_sun_awt_motif_MListPeer_setMultipleSelections;
#Java_sun_awt_motif_MMenuBarPeer_create;
#Java_sun_awt_motif_MMenuItemPeer_createMenuItem;
#Java_sun_awt_motif_MMenuItemPeer_pDisable;
#Java_sun_awt_motif_MMenuItemPeer_pDispose;
#Java_sun_awt_motif_MMenuItemPeer_pEnable;
#Java_sun_awt_motif_MMenuItemPeer_pSetLabel;
#Java_sun_awt_motif_MMenuPeer_createMenu;
#Java_sun_awt_motif_MMenuPeer_createSubMenu;
#Java_sun_awt_motif_MMenuPeer_pDispose;
#Java_sun_awt_motif_MPopupMenuPeer_createMenu;
#Java_sun_awt_motif_MPopupMenuPeer_pDispose;
#Java_sun_awt_motif_MPopupMenuPeer_pShow;
#Java_sun_awt_motif_MRobotPeer_getRGBPixelsImpl;
#Java_sun_awt_motif_MRobotPeer_keyPressImpl;
#Java_sun_awt_motif_MRobotPeer_keyReleaseImpl;
#Java_sun_awt_motif_MRobotPeer_mouseMoveImpl;
#Java_sun_awt_motif_MRobotPeer_mousePressImpl;
#Java_sun_awt_motif_MRobotPeer_mouseReleaseImpl;
#Java_sun_awt_motif_MRobotPeer_mouseWheelImpl;
#Java_sun_awt_motif_MRobotPeer_setup;
#Java_sun_awt_motif_MScrollbarPeer_create;
#Java_sun_awt_motif_MScrollbarPeer_setLineIncrement;
#Java_sun_awt_motif_MScrollbarPeer_setPageIncrement;
#Java_sun_awt_motif_MScrollbarPeer_pSetValues;
#Java_sun_awt_motif_MScrollPanePeer_create;
#Java_sun_awt_motif_MScrollPanePeer_pGetBlockIncrement;
#Java_sun_awt_motif_MScrollPanePeer_pGetScrollbarSpace;
#Java_sun_awt_motif_MScrollPanePeer_pGetShadow;
#Java_sun_awt_motif_MScrollPanePeer_pInsets;
#Java_sun_awt_motif_MScrollPanePeer_pSetIncrement;
#Java_sun_awt_motif_MScrollPanePeer_pSetScrollChild;
#Java_sun_awt_motif_MScrollPanePeer_setScrollPosition;
#Java_sun_awt_motif_MTextAreaPeer_initIDs;
#Java_sun_awt_motif_MTextAreaPeer_pCreate;
#Java_sun_awt_motif_MTextAreaPeer_getCaretPosition;
#Java_sun_awt_motif_MTextAreaPeer_getExtraHeight;
#Java_sun_awt_motif_MTextAreaPeer_getExtraWidth;
#Java_sun_awt_motif_MTextAreaPeer_getSelectionEnd;
#Java_sun_awt_motif_MTextAreaPeer_getSelectionStart;
#Java_sun_awt_motif_MTextAreaPeer_getText;
#Java_sun_awt_motif_MTextAreaPeer_insert;
#Java_sun_awt_motif_MTextAreaPeer_pMakeCursorVisible;
#Java_sun_awt_motif_MTextAreaPeer_pSetEditable;
#Java_sun_awt_motif_MTextAreaPeer_pShow2;
#Java_sun_awt_motif_MTextAreaPeer_replaceRange;
#Java_sun_awt_motif_MTextAreaPeer_select;
#Java_sun_awt_motif_MTextAreaPeer_setCaretPosition;
#Java_sun_awt_motif_MTextAreaPeer_setFont;
#Java_sun_awt_motif_MTextAreaPeer_setText;
#Java_sun_awt_motif_MTextAreaPeer_setTextBackground;
#Java_sun_awt_motif_MTextFieldPeer_initIDs;
#Java_sun_awt_motif_MTextFieldPeer_pCreate;
#Java_sun_awt_motif_MTextFieldPeer_getCaretPosition;
#Java_sun_awt_motif_MTextFieldPeer_getSelectionEnd;
#Java_sun_awt_motif_MTextFieldPeer_getSelectionStart;
#Java_sun_awt_motif_MTextFieldPeer_getText;
#Java_sun_awt_motif_MTextFieldPeer_insertReplaceText;
#Java_sun_awt_motif_MTextFieldPeer_preDispose;
#Java_sun_awt_motif_MTextFieldPeer_pSetEditable;
#Java_sun_awt_motif_MTextFieldPeer_select;
#Java_sun_awt_motif_MTextFieldPeer_setCaretPosition;
#Java_sun_awt_motif_MTextFieldPeer_setEchoChar;
#Java_sun_awt_motif_MTextFieldPeer_setFont;
#Java_sun_awt_motif_MTextFieldPeer_setText;
Java_sun_awt_motif_MToolkit_beep;
Java_sun_awt_motif_MToolkit_getLockingKeyStateNative;
Java_sun_awt_motif_MToolkit_getMulticlickTime;
Java_sun_awt_motif_MToolkit_getNumMouseButtons;
Java_sun_awt_motif_MToolkit_getScreenHeight;
Java_sun_awt_motif_MToolkit_getScreenResolution;
Java_sun_awt_motif_MToolkit_getScreenWidth;
Java_sun_awt_motif_MToolkit_init;
Java_sun_awt_motif_MToolkit_isDynamicLayoutSupportedNative;
Java_sun_awt_motif_MToolkit_isFrameStateSupported;
Java_sun_awt_motif_MToolkit_loadSystemColors;
Java_sun_awt_motif_MToolkit_makeColorModel;
Java_sun_awt_motif_MToolkit_run;
Java_sun_awt_motif_MToolkit_sync;
Java_sun_awt_motif_MToolkit_isAlwaysOnTopSupported;
Java_sun_awt_motif_MWindowAttributes_initIDs;
#Java_sun_awt_motif_MWindowPeer_pDispose;
#Java_sun_awt_motif_MWindowPeer_pHide;
#Java_sun_awt_motif_MWindowPeer_pReshape;
#Java_sun_awt_motif_MWindowPeer_pSetTitle;
#Java_sun_awt_motif_MWindowPeer_pShow;
#Java_sun_awt_motif_MWindowPeer_setResizable;
#Java_sun_awt_motif_MWindowPeer_toBack;
#Java_sun_awt_motif_MWindowPeer_addTextComponentNative;
#Java_sun_awt_motif_MWindowPeer_getState;
#Java_sun_awt_motif_MWindowPeer_pSetIMMOption;
#Java_sun_awt_motif_MWindowPeer_pSetMenuBar;
#Java_sun_awt_motif_MWindowPeer_pShowModal;
#Java_sun_awt_motif_MWindowPeer_removeTextComponentNative;
#Java_sun_awt_motif_MWindowPeer_setSaveUnder;
#Java_sun_awt_motif_MWindowPeer_setState;
#Java_sun_awt_motif_MWindowPeer_resetTargetGC;
#Java_sun_awt_motif_MWindowPeer_registerX11DropTarget;
#Java_sun_awt_motif_MWindowPeer_unregisterX11DropTarget;
#Java_sun_awt_motif_MWindowPeer_updateAlwaysOnTop;
#Java_sun_awt_motif_X11CustomCursor_cacheInit;
#Java_sun_awt_motif_X11CustomCursor_createCursor;
#Java_sun_awt_motif_X11CustomCursor_queryBestCursor;
Java_sun_awt_motif_X11FontMetrics_bytesWidth;
Java_sun_awt_motif_X11FontMetrics_getMFCharsWidth;
Java_sun_awt_motif_X11FontMetrics_init;
Java_sun_awt_X11InputMethod_disposeXIC; Java_sun_awt_X11InputMethod_disposeXIC;
Java_sun_awt_X11InputMethod_isCompositionEnabledNative; Java_sun_awt_X11InputMethod_isCompositionEnabledNative;
Java_sun_awt_X11InputMethod_resetXIC; Java_sun_awt_X11InputMethod_resetXIC;
Java_sun_awt_X11InputMethod_setCompositionEnabledNative; Java_sun_awt_X11InputMethod_setCompositionEnabledNative;
Java_sun_awt_X11InputMethod_turnoffStatusWindow; Java_sun_awt_X11InputMethod_turnoffStatusWindow;
#Java_sun_awt_motif_MInputMethod_openXIMNative;
#Java_sun_awt_motif_MInputMethod_configureStatusAreaNative;
#Java_sun_awt_motif_MInputMethod_createXICNative;
#Java_sun_awt_motif_MInputMethod_reconfigureXICNative;
#Java_sun_awt_motif_MInputMethod_setXICFocusNative;
#Java_sun_awt_motif_X11Clipboard_getClipboardData;
#Java_sun_awt_motif_X11Clipboard_getClipboardFormats;
#Java_sun_awt_motif_X11Clipboard_registerClipboardViewer;
#Java_sun_awt_motif_X11Clipboard_unregisterClipboardViewer;
#Java_sun_awt_motif_X11Selection_init;
#Java_sun_awt_motif_X11Selection_pGetSelectionOwnership;
#Java_sun_awt_motif_X11Selection_clearNativeContext;
Java_sun_awt_SunToolkit_closeSplashScreen; Java_sun_awt_SunToolkit_closeSplashScreen;
Java_sun_awt_PlatformFont_initIDs; Java_sun_awt_PlatformFont_initIDs;
Java_sun_awt_X11GraphicsConfig_init; Java_sun_awt_X11GraphicsConfig_init;
@ -444,42 +238,7 @@ SUNWprivate_1.1 {
Java_java_awt_Insets_initIDs; Java_java_awt_Insets_initIDs;
Java_java_awt_TextField_initIDs; Java_java_awt_TextField_initIDs;
Java_java_awt_Window_initIDs; Java_java_awt_Window_initIDs;
#Java_sun_awt_motif_MCheckboxPeer_getIndicatorSize;
#Java_sun_awt_motif_MCheckboxPeer_getSpacing;
#Java_sun_awt_motif_MChoicePeer_freeNativeData;
#Java_sun_awt_motif_MComponentPeer_getComponents_1NoClientCode;
#Java_sun_awt_motif_MComponentPeer_getParent_1NoClientCode;
#Java_sun_awt_motif_MComponentPeer_initIDs;
#Java_sun_awt_motif_MComponentPeer_nativeHandleEvent;
#Java_sun_awt_motif_MComponentPeer_pSetCursor;
#Java_sun_awt_motif_MComponentPeer_pSetInnerForeground;
#Java_sun_awt_motif_MComponentPeer_pSetScrollbarBackground;
#Java_sun_awt_motif_MComponentPeer_setTargetBackground;
#Java_sun_awt_motif_MDataTransferer_dragQueryFile;
#Java_sun_awt_motif_MDataTransferer_getAtomForTarget;
#Java_sun_awt_motif_MDataTransferer_getTargetNameForAtom;
#Java_sun_awt_motif_MFileDialogPeer_insertReplaceFileDialogText;
Java_sun_awt_motif_MFontPeer_initIDs;
#Java_sun_awt_motif_MListPeer_setBackground;
#Java_sun_awt_motif_MMenuBarPeer_initIDs;
#Java_sun_awt_motif_MMenuBarPeer_pDispose;
#Java_sun_awt_motif_MMenuItemPeer_getParent_1NoClientCode;
#Java_sun_awt_motif_MMenuItemPeer_initIDs;
#Java_sun_awt_motif_MMenuItemPeer_pSetShortcut;
#Java_sun_awt_motif_MPopupMenuPeer_initIDs;
#Java_sun_awt_motif_MScrollbarPeer_initIDs;
#Java_sun_awt_motif_MScrollPanePeer_initIDs;
#Java_sun_awt_motif_MTextAreaPeer_pSetCursor;
Java_sun_awt_motif_MToolkit_shutdown;
#Java_sun_awt_motif_MWindowPeer_initIDs;
#Java_sun_awt_motif_MWindowPeer_pCreate;
#Java_sun_awt_motif_MWindowPeer_wrapInSequenced;
Java_sun_awt_motif_X11FontMetrics_initIDs;
#Java_sun_awt_X11InputMethod_initIDs;
Java_sun_awt_motif_X11OffScreenImage_updateBitmask; Java_sun_awt_motif_X11OffScreenImage_updateBitmask;
#Java_sun_awt_motif_X11Selection_initIDs;
Java_sun_awt_motif_MToolkitThreadBlockedHandler_enter;
Java_sun_awt_motif_MToolkitThreadBlockedHandler_exit;
Java_sun_awt_X11GraphicsConfig_init; Java_sun_awt_X11GraphicsConfig_init;
Java_sun_awt_X11GraphicsConfig_initIDs; Java_sun_awt_X11GraphicsConfig_initIDs;
Java_sun_awt_X11GraphicsConfig_makeColorModel; Java_sun_awt_X11GraphicsConfig_makeColorModel;
@ -505,26 +264,6 @@ SUNWprivate_1.1 {
Java_sun_awt_X11SurfaceData_isDgaAvailable; Java_sun_awt_X11SurfaceData_isDgaAvailable;
Java_sun_awt_X11SurfaceData_setInvalid; Java_sun_awt_X11SurfaceData_setInvalid;
Java_sun_awt_X11SurfaceData_flushNativeSurface; Java_sun_awt_X11SurfaceData_flushNativeSurface;
#Java_sun_awt_motif_MEmbedCanvasPeer_initXEmbedServer;
#Java_sun_awt_motif_MEmbedCanvasPeer_destroyXEmbedServer;
#Java_sun_awt_motif_MEmbedCanvasPeer_isXEmbedActive;
#Java_sun_awt_motif_MEmbedCanvasPeer_initDispatching;
#Java_sun_awt_motif_MEmbedCanvasPeer_endDispatching;
#Java_sun_awt_motif_MEmbedCanvasPeer_embedChild;
#Java_sun_awt_motif_MEmbedCanvasPeer_childDestroyed;
#Java_sun_awt_motif_MEmbedCanvasPeer_getEmbedPreferredSize;
#Java_sun_awt_motif_MEmbedCanvasPeer_getEmbedMinimumSize;
#Java_sun_awt_motif_MEmbedCanvasPeer_getClientBounds;
#Java_sun_awt_motif_MEmbedCanvasPeer_notifyChildEmbedded;
#Java_sun_awt_motif_MEmbedCanvasPeer_detachChild;
#Java_sun_awt_motif_MEmbedCanvasPeer_forwardKeyEvent;
#Java_sun_awt_motif_MEmbedCanvasPeer_getAWTKeyCodeForKeySym;
#Java_sun_awt_motif_MEmbedCanvasPeer_sendMessage__I;
#Java_sun_awt_motif_MEmbedCanvasPeer_sendMessage__IJJJ;
#Java_sun_awt_motif_MEmbedCanvasPeer_getWindow;
#Java_sun_awt_motif_MEmbedCanvasPeer_forwardEventToEmbedded;
#Java_sun_awt_motif_GrabbedKey_initKeySymAndModifiers;
#Java_sun_awt_motif_MEmbeddedFramePeer_traverseOut;
awt_display; awt_display;
awt_lock; awt_lock;
awt_Lock; awt_Lock;

View File

@ -41,13 +41,7 @@ include $(BUILDDIR)/sun/awt/FILES_export_unix.gmk
# Check which C files should be built. Headless uses only # Check which C files should be built. Headless uses only
# non-motif files. Also, a version-specific motif file is # non-motif files. Also, a version-specific motif file is
# compiled based on the motif version. # compiled based on the motif version.
ifdef HEADLESS FILES_c = $(FILES_NO_MOTIF_c)
FILES_c = $(FILES_NO_MOTIF_c)
else
# FILES_c = $(FILES_MOTIF_c) $(FILES_NO_MOTIF_c)
# XXX if in FILES_MOTIF_c there are unrelated to motif stuff, create a separate list!
FILES_c = $(FILES_NO_MOTIF_c)
endif
ifeq ($(PLATFORM), solaris) ifeq ($(PLATFORM), solaris)
ifneq ($(ARCH), amd64) ifneq ($(ARCH), amd64)
@ -116,32 +110,6 @@ CFLAGS += -DHEADLESS=$(HEADLESS)
CPPFLAGS += -DHEADLESS=$(HEADLESS) CPPFLAGS += -DHEADLESS=$(HEADLESS)
OTHER_LDLIBS = OTHER_LDLIBS =
else else
#CFLAGS += -DMOTIF_VERSION=$(MOTIF_VERSION)
#ifeq ($(STATIC_MOTIF),true)
# LIBXM = $(MOTIF_LIB)/libXm.a -lXp -lXmu
# ifeq ($(PLATFORM), linux)
# ifeq ($(ARCH_DATA_MODEL), 64)
# LIBXT = -lXt
# else
# # Allows for builds on Debian GNU Linux, X11 is in a different place
# LIBXT = $(firstword $(wildcard /usr/X11R6/lib/libXt.a) \
# $(wildcard /usr/lib/libXt.a))
# LIBSM = $(firstword $(wildcard /usr/X11R6/lib/libSM.a) \
# $(wildcard /usr/lib/libSM.a))
# LIBICE = $(firstword $(wildcard /usr/X11R6/lib/libICE.a) \
# $(wildcard /usr/lib/libICE.a))
# endif
# endif
#else
# LIBXM = -L$(MOTIF_LIB) -lXm -lXp
# ifeq ($(PLATFORM), linux)
# LIBXT = -lXt
# LIBSM =
# LIBICE =
# endif
#endif
LIBXTST = -lXtst LIBXTST = -lXtst
ifeq ($(PLATFORM), linux) ifeq ($(PLATFORM), linux)
ifeq ($(ARCH_DATA_MODEL), 64) ifeq ($(ARCH_DATA_MODEL), 64)

View File

@ -1,216 +0,0 @@
data = R0x2000;
text = LOAD ?RXO;
# Test Null
# Test Exit
# Test Hello
# Test Sleep
# Test IntToString
# Test LoadToolkit
text: .text%JNI_OnLoad;
text: .text%awt_util_debug_init;
text: .text%Java_sun_awt_X11GraphicsEnvironment_initDisplay;
text: .text%awt_init_Display;
text: .text%makeDefaultConfig: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_GraphicsEnv.o;
text: .text%awt_allocate_colors;
text: .text%alloc_col: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11Color.o;
text: .text%getVirtCubeSize;
text: .text%uname: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11Color.o;
text: .text%Java_sun_awt_font_NativeFontWrapper_getFontPath;
text: .text%getPlatformFontPathChars: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
text: .text%getSolarisFontLocations: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
text: .text%fstat: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
text: .text%AppendFont: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
text: .text%freePlatformFontPathChars: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
text: .text%checkFont: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_Font.o;
text: .text%Java_sun_awt_X11GraphicsEnvironment_getNativeFonts;
text: .text%Java_sun_awt_font_NativeFontWrapper_setNativeFontPath;
text: .text%isDisplayLocal;
text: .text%Java_sun_awt_X11GraphicsEnvironment_checkShmExt;
text: .text%TryInitMITShm: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_GraphicsEnv.o;
text: .text%awt_output_flush;
text: .text%awtJNI_TimeMillis: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%AddFontsToX11FontPath: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
text: .text%Java_sun_awt_X11GraphicsEnvironment_getNumScreens;
text: .text%Java_sun_awt_X11GraphicsEnvironment_getDefaultScreenNum;
text: .text%Java_sun_awt_X11GraphicsDevice_getConfigVisualId;
text: .text%Java_sun_awt_X11GraphicsDevice_isDBESupported;
text: .text%Java_sun_awt_X11GraphicsDevice_getDoubleBufferVisuals;
text: .text%Java_sun_awt_X11GraphicsConfig_initIDs;
text: .text%Java_sun_awt_X11GraphicsConfig_init;
text: .text%getAllConfigs: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_GraphicsEnv.o;
text: .text%Java_sun_awt_motif_MToolkit_init;
text: .text%getDefaultConfig;
text: .text%getScreenData;
text: .text%Java_sun_awt_PlatformFont_initIDs;
text: .text%Java_sun_awt_motif_MFontPeer_initIDs;
text: .text%awt_wm_init;
text: .text%awt_wm_initAtoms: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_getRunningWM;
text: .text%xerror_detect_wm: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_prepareIsIceWM: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_isNetSupporting: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_checkAnchor: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_getProperty32: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_isWinSupporting: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_isIceWM: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_isEnlightenment: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_getECommsWindowIDProperty: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_isSawfish: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_isNetWMName: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_isKDE2: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_isCDE: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_color_match;
text: .text%setup_modifier_map: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%set_mod_mask: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%awt_initialize_DataTransferer;
text: .text%awt_initialize_Xm_DnD;
text: .text%cacheDropDone: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_XmDnD.o;
text: .text%awt_motif_enableSingleDragInitiator;
text: .text%Java_java_awt_Cursor_initIDs;
text: .text%Java_sun_awt_motif_X11CustomCursor_cacheInit;
text: .text%Java_sun_awt_motif_MToolkit_run;
text: .text%awtJNI_GetCurrentThread;
text: .text%awt_MToolkit_loop: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%awt_pipe_init: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%awt_set_poll_timeout: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%awt_events_pending: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%processOneEvent: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%set_toolkit_busy;
text: .text%waitForEvents;
text: .text%performPoll: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%awt_get_poll_timeout: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%awtJNI_CleanupGlobalRefs;
text: .text%Java_java_awt_AWTEvent_initIDs;
text: .text%Java_sun_awt_SunToolkit_wakeupEventQueue;
text: .text%Java_sun_awt_motif_MToolkit_shutdown;
text: .text%X11SD_LibDispose;
text: .text%LibDisposeStub: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
# Test LoadFrame
text: .text%Java_java_awt_Component_initIDs;
text: .text%Java_java_awt_Container_initIDs;
text: .text%Java_java_awt_Window_initIDs;
text: .text%Java_java_awt_Frame_initIDs;
text: .text%Java_sun_awt_SunToolkit_getPrivateKey;
text: .text%Java_java_awt_MenuComponent_initIDs;
text: .text%Java_sun_awt_X11GraphicsConfig_pGetBounds;
text: .text%Java_java_awt_Insets_initIDs;
text: .text%Java_sun_awt_motif_MComponentPeer_initIDs;
text: .text%Java_sun_awt_motif_MWindowPeer_initIDs;
text: .text%Java_sun_awt_motif_MWindowAttributes_initIDs;
text: .text%Java_sun_awt_motif_MWindowPeer_pCreate;
text: .text%awtJNI_CreateAndSetGlobalRef;
text: .text%copyGraphicsConfigToPeer;
text: .text%awt_Frame_guessInsets;
text: .text%awtJNI_ChangeInsets: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
text: .text%getMotifFontList;
text: .text%getMotifFontStruct;
text: .text%setDeleteCallback: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
text: .text%awt_canvas_create;
text: .text%awt_util_show;
text: .text%addTopLevel;
text: .text%Java_sun_awt_motif_MWindowPeer_pHide;
text: .text%Java_sun_awt_motif_MComponentPeer_pInitialize;
text: .text%awt_addWidget;
text: .text%Java_sun_awt_motif_MComponentPeer_pSetCursor;
text: .text%getCursor;
text: .text%awt_util_setCursor;
text: .text%Java_sun_awt_motif_MComponentPeer_getParent_1NoClientCode;
text: .text%Java_sun_awt_motif_MWindowPeer_pReshape;
text: .text%reshape: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
text: .text%awtJNI_setMbAndWwHeightAndOffsets: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
text: .text%awt_wm_configureGravityBuggy;
text: .text%Java_sun_awt_X11SurfaceData_initIDs;
text: .text%Java_sun_awt_motif_MToolkit_loadSystemColors;
text: .text%colorToRGB: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%awt_allocate_systemcolors;
text: .text%Java_sun_awt_X11GraphicsConfig_makeColorModel;
text: .text%awtJNI_GetColorModel;
text: .text%Java_sun_awt_X11SurfaceData_initOps;
text: .text%Java_sun_awt_motif_MWindowPeer_pSetTitle;
text: .text%Java_sun_awt_motif_MWindowPeer_setResizable;
text: .text%Java_java_awt_Font_initIDs;
text: .text%Java_sun_awt_motif_MComponentPeer_pSetFont;
text: .text%awt_util_mapChildren;
text: .text%changeFont: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_Component.o;
text: .text%Java_sun_awt_motif_MComponentPeer_pSetBackground;
text: .text%getGraphicsConfigFromComponentPeer;
text: .text%awtJNI_GetColorForVis;
text: .text%ColorProc;
text: .text%Java_sun_awt_motif_MComponentPeer_pSetForeground;
text: .text%Java_sun_awt_motif_MWindowPeer_pShow;
text: .text%Java_sun_awt_motif_MWindowPeer_pShowModal;
text: .text%awt_wm_setExtendedState;
text: .text%awt_wm_doStateProtocolNet: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_doStateProtocolWin: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_setShellDecor;
text: .text%awt_wm_setMotifDecor: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_setOLDecor: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_normalizeMotifDecor: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_removeSizeHints;
text: .text%shellEH: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
text: .text%awt_wm_isStateChange;
text: .text%awt_wm_getWMState;
text: .text%Java_sun_awt_motif_MGlobalCursorManager_cacheInit;
text: .text%innerCanvasEH: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
text: .text%reconfigureOuterCanvas: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
text: .text%outerCanvasResizeCB: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
text: .text%Java_sun_awt_motif_MGlobalCursorManager_findHeavyweightUnderCursor;
text: .text%awt_wm_getInsetsFromProp;
text: .text%syncTopLevelPos;
text: .text%raiseInputMethodWindow;
text: .text%awt_wm_getExtendedState: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_canvas_event_handler;
text: .text%awt_canvas_handleEvent;
text: .text%HandleExposeEvent: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/canvas.o;
text: .text%checkForExpose: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/canvas.o;
text: .text%expandDamageRect: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/canvas.o;
text: .text%getCurComponent;
text: .text%Java_java_awt_KeyboardFocusManager_initIDs;
text: .text%Java_java_awt_event_InputEvent_initIDs;
text: .text%Java_java_awt_event_KeyEvent_initIDs;
text: .text%Java_java_awt_AWTKeyStroke_allocateNewInstance;
text: .text%Java_sun_awt_motif_MComponentPeer_nativeHandleEvent;
text: .text%Java_java_awt_Event_initIDs;
# Test LoadJFrame
text: .text%Java_sun_awt_motif_MToolkit_getScreenWidth;
text: .text%Java_sun_awt_motif_MToolkit_getScreenHeight;
text: .text%X11SD_Lock: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
text: .text%X11SD_InitWindow: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
text: .text%GetLockStub: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
text: .text%X11SD_GetRasInfo: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
text: .text%X11SD_Unlock: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
text: .text%X11SD_InitClip: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
text: .text%XRequestSentStub: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
# Test JHello
text: .text%AWTLoadFont;
text: .text%AWTFontMaxByte1;
text: .text%AWTFontMaxCharOrByte2;
text: .text%AWTFontMaxBounds;
text: .text%AWTCharAscent;
text: .text%AWTCharDescent;
text: .text%AWTCharWidth;
text: .text%AWTFontMinByte1;
text: .text%AWTFontMinCharOrByte2;
text: .text%AWTFontPerChar;
text: .text%AWTCharRBearing;
text: .text%AWTCharLBearing;
text: .text%Java_sun_awt_X11SurfaceData_setInvalid;
text: .text%Java_sun_awt_X11SurfaceData_nativeDispose;
text: .text%X11SurfaceData_GetOps;
# SwingSet
text: .text%Java_sun_awt_motif_MWindowPeer_setSaveUnder;
text: .text%Java_sun_awt_motif_MCanvasPeer_create;
text: .text%awt_util_insertCallback;
text: .text%Java_sun_awt_motif_MComponentPeer_getComponents_1NoClientCode;
text: .text%Java_sun_awt_motif_MComponentPeer_pReshape;
text: .text%awt_util_reshape;
text: .text%Java_sun_awt_motif_MComponentPeer_pShow;
text: .text%Java_sun_awt_motif_MDataTransferer_getAtomForTarget;
text: .text%Java_sun_awt_motif_MComponentPeer_addNativeDropTarget;
text: .text%register_drop_site;
text: .text%update_drop_site_hierarchy: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_XmDnD.o;
text: .text%AWTFontDefaultChar;
text: .text%AWTFontGenerateImage;
text: .text%CreatePixmapAndGC;
text: .text%isAncestor;
text: .text%xerror_handler;

View File

@ -1,212 +0,0 @@
data = R0x2000;
text = LOAD ?RXO;
# Test Null
# Test Exit
# Test Hello
# Test Sleep
# Test IntToString
# Test LoadToolkit
text: .text%JNI_OnLoad;
text: .text%awt_util_debug_init;
text: .text%Java_sun_awt_X11GraphicsEnvironment_initDisplay;
text: .text%awt_init_Display;
text: .text%makeDefaultConfig: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_GraphicsEnv.o;
text: .text%awt_allocate_colors;
text: .text%Java_sun_awt_font_NativeFontWrapper_getFontPath;
text: .text%getPlatformFontPathChars: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
text: .text%getSolarisFontLocations: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
text: .text%AppendFont: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
text: .text%freePlatformFontPathChars: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
text: .text%checkFont: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_Font.o;
text: .text%Java_sun_awt_X11GraphicsEnvironment_getNativeFonts;
text: .text%Java_sun_awt_font_NativeFontWrapper_setNativeFontPath;
text: .text%isDisplayLocal;
text: .text%Java_sun_awt_X11GraphicsEnvironment_checkShmExt;
text: .text%TryInitMITShm: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_GraphicsEnv.o;
text: .text%awt_output_flush;
text: .text%awtJNI_TimeMillis: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%AddFontsToX11FontPath: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/fontpath.o;
text: .text%Java_sun_awt_X11GraphicsEnvironment_getNumScreens;
text: .text%Java_sun_awt_X11GraphicsEnvironment_getDefaultScreenNum;
text: .text%Java_sun_awt_X11GraphicsDevice_getConfigVisualId;
text: .text%Java_sun_awt_X11GraphicsDevice_isDBESupported;
text: .text%Java_sun_awt_X11GraphicsDevice_getDoubleBufferVisuals;
text: .text%Java_sun_awt_X11GraphicsConfig_initIDs;
text: .text%Java_sun_awt_X11GraphicsConfig_init;
text: .text%getAllConfigs: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_GraphicsEnv.o;
text: .text%Java_sun_awt_motif_MToolkit_init;
text: .text%getDefaultConfig;
text: .text%getScreenData;
text: .text%Java_sun_awt_PlatformFont_initIDs;
text: .text%Java_sun_awt_motif_MFontPeer_initIDs;
text: .text%awt_wm_init;
text: .text%awt_wm_initAtoms: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_getRunningWM;
text: .text%xerror_detect_wm: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_prepareIsIceWM: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_isNetSupporting: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_checkAnchor: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_getProperty32: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_isWinSupporting: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_isIceWM: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_isEnlightenment: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_getECommsWindowIDProperty: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_isSawfish: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_isNetWMName: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_isKDE2: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_isCDE: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_color_matchTC;
text: .text%setup_modifier_map: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%set_mod_mask: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%awt_initialize_DataTransferer;
text: .text%awt_initialize_Xm_DnD;
text: .text%cacheDropDone: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_XmDnD.o;
text: .text%awt_motif_enableSingleDragInitiator;
text: .text%Java_java_awt_Cursor_initIDs;
text: .text%Java_sun_awt_motif_X11CustomCursor_cacheInit;
text: .text%Java_sun_awt_motif_MToolkit_run;
text: .text%awtJNI_GetCurrentThread;
text: .text%awt_MToolkit_loop: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%awt_pipe_init: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%awt_set_poll_timeout: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%awt_events_pending: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%processOneEvent: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%set_toolkit_busy;
text: .text%waitForEvents;
text: .text%performPoll: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%awt_get_poll_timeout: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%awtJNI_CleanupGlobalRefs;
text: .text%Java_java_awt_AWTEvent_initIDs;
text: .text%Java_sun_awt_SunToolkit_wakeupEventQueue;
text: .text%Java_sun_awt_motif_MToolkit_shutdown;
text: .text%X11SD_LibDispose;
text: .text%LibDisposeStub: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
# Test LoadFrame
text: .text%Java_java_awt_Component_initIDs;
text: .text%Java_java_awt_Container_initIDs;
text: .text%Java_java_awt_Window_initIDs;
text: .text%Java_java_awt_Frame_initIDs;
text: .text%Java_sun_awt_SunToolkit_getPrivateKey;
text: .text%Java_java_awt_MenuComponent_initIDs;
text: .text%Java_sun_awt_X11GraphicsConfig_pGetBounds;
text: .text%Java_java_awt_Insets_initIDs;
text: .text%Java_sun_awt_motif_MComponentPeer_initIDs;
text: .text%Java_sun_awt_motif_MWindowPeer_initIDs;
text: .text%Java_sun_awt_motif_MWindowAttributes_initIDs;
text: .text%Java_sun_awt_motif_MWindowPeer_pCreate;
text: .text%awtJNI_CreateAndSetGlobalRef;
text: .text%copyGraphicsConfigToPeer;
text: .text%awt_Frame_guessInsets;
text: .text%awtJNI_ChangeInsets: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
text: .text%getMotifFontList;
text: .text%getMotifFontStruct;
text: .text%setDeleteCallback: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
text: .text%ColorProc;
text: .text%awt_canvas_create;
text: .text%awt_util_show;
text: .text%addTopLevel;
text: .text%Java_sun_awt_motif_MWindowPeer_pHide;
text: .text%Java_sun_awt_motif_MComponentPeer_pInitialize;
text: .text%awt_addWidget;
text: .text%Java_sun_awt_motif_MComponentPeer_pSetCursor;
text: .text%getCursor;
text: .text%awt_util_setCursor;
text: .text%Java_sun_awt_motif_MComponentPeer_getParent_1NoClientCode;
text: .text%Java_sun_awt_motif_MWindowPeer_pReshape;
text: .text%reshape: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
text: .text%awtJNI_setMbAndWwHeightAndOffsets: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
text: .text%awt_wm_configureGravityBuggy;
text: .text%Java_sun_awt_X11SurfaceData_initIDs;
text: .text%Java_sun_awt_motif_MToolkit_loadSystemColors;
text: .text%colorToRGB: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_MToolkit.o;
text: .text%Java_sun_awt_X11GraphicsConfig_makeColorModel;
text: .text%awtJNI_GetColorModel;
text: .text%Java_sun_awt_X11SurfaceData_initOps;
text: .text%Java_sun_awt_motif_MWindowPeer_pSetTitle;
text: .text%Java_sun_awt_motif_MWindowPeer_setResizable;
text: .text%Java_java_awt_Font_initIDs;
text: .text%Java_sun_awt_motif_MComponentPeer_pSetFont;
text: .text%awt_util_mapChildren;
text: .text%changeFont: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_Component.o;
text: .text%Java_sun_awt_motif_MComponentPeer_pSetBackground;
text: .text%getGraphicsConfigFromComponentPeer;
text: .text%awtJNI_GetColorForVis;
text: .text%Java_sun_awt_motif_MComponentPeer_pSetForeground;
text: .text%Java_sun_awt_motif_MWindowPeer_pShow;
text: .text%Java_sun_awt_motif_MWindowPeer_pShowModal;
text: .text%awt_wm_setExtendedState;
text: .text%awt_wm_doStateProtocolNet: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_doStateProtocolWin: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_setShellDecor;
text: .text%awt_wm_setMotifDecor: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_setOLDecor: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_normalizeMotifDecor: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%awt_wm_removeSizeHints;
text: .text%Java_sun_awt_motif_MGlobalCursorManager_cacheInit;
text: .text%Java_sun_awt_motif_MGlobalCursorManager_findHeavyweightUnderCursor;
text: .text%getCurComponent;
text: .text%shellEH: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
text: .text%awt_wm_isStateChange;
text: .text%awt_wm_getWMState;
text: .text%innerCanvasEH: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
text: .text%reconfigureOuterCanvas: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
text: .text%outerCanvasResizeCB: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_TopLevel.o;
text: .text%awt_wm_getInsetsFromProp;
text: .text%syncTopLevelPos;
text: .text%raiseInputMethodWindow;
text: .text%awt_canvas_event_handler;
text: .text%awt_canvas_handleEvent;
text: .text%HandleExposeEvent: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/canvas.o;
text: .text%checkForExpose: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/canvas.o;
text: .text%awt_wm_getExtendedState: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_wm.o;
text: .text%expandDamageRect: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/canvas.o;
text: .text%Java_java_awt_KeyboardFocusManager_initIDs;
text: .text%Java_java_awt_event_InputEvent_initIDs;
text: .text%Java_java_awt_event_KeyEvent_initIDs;
text: .text%Java_java_awt_AWTKeyStroke_allocateNewInstance;
text: .text%Java_sun_awt_motif_MComponentPeer_nativeHandleEvent;
text: .text%Java_java_awt_Event_initIDs;
# Test LoadJFrame
text: .text%awtJNI_ThreadYield;
text: .text%Java_sun_awt_motif_MToolkit_getScreenWidth;
text: .text%Java_sun_awt_motif_MToolkit_getScreenHeight;
text: .text%X11SD_Lock: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
text: .text%X11SD_InitWindow: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
text: .text%GetLockStub: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
text: .text%X11SD_GetRasInfo: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
text: .text%X11SD_Unlock: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
text: .text%X11SD_InitClip: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
text: .text%XRequestSentStub: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/X11SurfaceData.o;
# Test JHello
text: .text%AWTLoadFont;
text: .text%AWTFontMaxByte1;
text: .text%AWTFontMaxCharOrByte2;
text: .text%AWTFontMaxBounds;
text: .text%AWTCharAscent;
text: .text%AWTCharDescent;
text: .text%AWTCharWidth;
text: .text%AWTFontMinByte1;
text: .text%AWTFontMinCharOrByte2;
text: .text%AWTFontPerChar;
text: .text%AWTCharRBearing;
text: .text%AWTCharLBearing;
text: .text%Java_sun_awt_X11SurfaceData_setInvalid;
# SwingSet
text: .text%Java_sun_awt_motif_MWindowPeer_setSaveUnder;
text: .text%Java_sun_awt_X11SurfaceData_nativeDispose;
text: .text%X11SurfaceData_GetOps;
text: .text%Java_sun_awt_motif_MCanvasPeer_create;
text: .text%awt_util_insertCallback;
text: .text%Java_sun_awt_motif_MComponentPeer_getComponents_1NoClientCode;
text: .text%Java_sun_awt_motif_MComponentPeer_pReshape;
text: .text%awt_util_reshape;
text: .text%Java_sun_awt_motif_MComponentPeer_pShow;
text: .text%Java_sun_awt_motif_MDataTransferer_getAtomForTarget;
text: .text%Java_sun_awt_motif_MComponentPeer_addNativeDropTarget;
text: .text%register_drop_site;
text: .text%update_drop_site_hierarchy: OUTPUTDIR/tmp/sun/sun.awt/motif12/obj/awt_XmDnD.o;
text: .text%AWTFontDefaultChar;
text: .text%isAncestor;
text: .text%xerror_handler;
text: .text%AWTFontGenerateImage;
text: .text%CreatePixmapAndGC;

View File

@ -1,233 +0,0 @@
data = R0x2000;
text = LOAD ?RXO;
# Test Null
# Test Exit
# Test Hello
# Test Sleep
# Test IntToString
# Test LoadToolkit
text: .text%JNI_OnLoad;
text: .text%awt_util_debug_init;
text: .text%Java_java_awt_Toolkit_initIDs;
text: .text%Java_sun_awt_X11GraphicsEnvironment_initDisplay;
text: .text%awt_init_Display;
text: .text%makeDefaultConfig: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_GraphicsEnv.o;
text: .text%awt_allocate_colors;
text: .text%make_uns_ordered_dither_array;
text: .text%checkFont: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_Font.o;
text: .text%Java_sun_awt_X11GraphicsEnvironment_getNativeFonts;
text: .text%Java_sun_awt_X11GraphicsEnvironment_getNumScreens;
text: .text%Java_sun_awt_X11GraphicsEnvironment_getDefaultScreenNum;
text: .text%Java_sun_awt_X11GraphicsDevice_getConfigVisualId;
text: .text%Java_sun_awt_X11GraphicsConfig_initIDs;
text: .text%Java_sun_awt_X11GraphicsConfig_init;
text: .text%getAllConfigs: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_GraphicsEnv.o;
text: .text%awt_output_flush;
text: .text%awtJNI_TimeMillis: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
text: .text%Java_sun_awt_motif_MToolkit_init;
text: .text%getDefaultConfig;
text: .text%getScreenData;
text: .text%Java_sun_awt_PlatformFont_initIDs;
text: .text%Java_sun_awt_motif_MFontPeer_initIDs;
text: .text%awt_color_matchTC;
text: .text%setup_modifier_map: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
text: .text%set_mod_mask: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
text: .text%awt_initialize_Xm_DnD;
text: .text%Java_java_awt_Cursor_initIDs;
text: .text%Java_sun_awt_motif_X11CustomCursor_cacheInit;
text: .text%Java_java_awt_Dimension_initIDs;
text: .text%Java_sun_awt_motif_MToolkit_run;
text: .text%awtJNI_GetCurrentThread;
text: .text%awt_MToolkit_loop: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
text: .text%awt_pipe_init: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
text: .text%awt_set_poll_timeout: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
text: .text%awt_events_pending: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
text: .text%processOneEvent: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
text: .text%waitForEvents: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
text: .text%performPoll: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
text: .text%awt_get_poll_timeout: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
text: .text%awtJNI_CleanupGlobalRefs;
# Test LoadFrame
text: .text%Java_java_awt_Component_initIDs;
text: .text%Java_java_awt_Container_initIDs;
text: .text%Java_java_awt_Window_initIDs;
text: .text%Java_java_awt_Frame_initIDs;
text: .text%Java_sun_awt_SunToolkit_getPrivateKey;
text: .text%Java_java_awt_MenuComponent_initIDs;
text: .text%Java_sun_awt_X11GraphicsConfig_pGetBounds;
text: .text%Java_java_awt_Rectangle_initIDs;
text: .text%Java_sun_awt_motif_MComponentPeer_initIDs;
text: .text%Java_sun_awt_motif_MWindowPeer_initIDs;
text: .text%Java_java_awt_Insets_initIDs;
text: .text%Java_sun_awt_motif_MWindowAttributes_initIDs;
text: .text%Java_sun_awt_motif_MWindowPeer_create;
text: .text%awtJNI_CreateAndSetGlobalRef;
text: .text%copyGraphicsConfigToPeer;
text: .text%awt_Frame_guessInsets;
text: .text%awt_util_runningWindowManager;
text: .text%awt_winmgrerr: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_util.o;
text: .text%awtJNI_ChangeInsets: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
text: .text%getMotifFontList;
text: .text%getMotifFontStruct;
text: .text%setDeleteCallback: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
text: .text%ColorProc;
text: .text%awt_canvas_create;
text: .text%awt_util_show;
text: .text%addTopLevel;
text: .text%Java_sun_awt_motif_MWindowPeer_pHide;
text: .text%Java_sun_awt_motif_MComponentPeer_pInitialize;
text: .text%awt_addWidget;
text: .text%Java_sun_awt_motif_MComponentPeer_setCursor;
text: .text%getCursor;
text: .text%awt_util_setCursor;
text: .text%Java_sun_awt_motif_MComponentPeer_getParent_1NoClientCode;
text: .text%Java_sun_awt_motif_MWindowPeer_pReshape;
text: .text%reshape: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
text: .text%awtJNI_setMbAndWwHeightAndOffsets: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
text: .text%awt_util_wmPositionsShellXY;
text: .text%Java_sun_awt_motif_MWindowPeer_pSetTitle;
text: .text%Java_sun_awt_motif_MWindowPeer_setResizable;
text: .text%Java_java_awt_Font_initIDs;
text: .text%Java_sun_awt_motif_MComponentPeer_pSetFont;
text: .text%awt_util_mapChildren;
text: .text%changeFont: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_Component.o;
text: .text%Java_java_awt_Color_initIDs;
text: .text%Java_sun_awt_motif_MToolkit_loadSystemColors;
text: .text%colorToRGB: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
text: .text%Java_sun_awt_motif_MComponentPeer_pSetBackground;
text: .text%getGraphicsConfigFromComponentPeer;
text: .text%awtJNI_GetColorForVis;
text: .text%Java_sun_awt_motif_MComponentPeer_pSetForeground;
text: .text%Java_sun_awt_motif_MWindowPeer_pShow;
text: .text%Java_sun_awt_motif_MWindowPeer_pShowModal;
text: .text%setStateHints: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
text: .text%awt_util_setMinMaxSizeProps;
text: .text%innerCanvasEH: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
text: .text%reconfigureOuterCanvas: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
text: .text%Java_java_awt_AWTEvent_initIDs;
text: .text%outerCanvasResizeCB: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
text: .text%Java_sun_awt_motif_MGlobalCursorManager_cacheInit;
text: .text%shellEH: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
text: .text%Java_sun_awt_motif_MGlobalCursorManager_findHeavyweightUnderCursor;
text: .text%getCurComponent;
text: .text%get_awt_TopLevelInsetsProp;
text: .text%syncTopLevelPos;
text: .text%Java_sun_awt_motif_MComponentPeer_nativeHandleEvent;
text: .text%raiseInputMethodWindow;
text: .text%getWindowState: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;
text: .text%awt_canvas_event_handler;
text: .text%awt_canvas_handleEvent;
text: .text%HandleExposeEvent: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/canvas.o;
text: .text%checkForExpose: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/canvas.o;
text: .text%Java_java_awt_Event_initIDs;
text: .text%Java_java_awt_image_ColorModel_initIDs;
text: .text%Java_sun_awt_motif_X11Graphics_cacheInit;
text: .text%InitMITShm: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_Graphics.o;
text: .text%Java_sun_java2d_loops_RasterOutputManager_getPlatformFontVar;
text: .text%Java_sun_awt_motif_X11Graphics_createFromComponent;
text: .text%Java_sun_awt_motif_X11Graphics_pSetForeground;
text: .text%awt_init_gc;
text: .text%Java_sun_awt_motif_X11Graphics_pSetFont;
text: .text%awtJNI_GetFontData;
text: .text%awtJNI_IsMultiFont;
text: .text%Java_sun_awt_FontDescriptor_initIDs;
text: .text%loadFont;
text: .text%Java_sun_awt_motif_X11Graphics_setOrigin;
text: .text%Java_sun_awt_motif_X11Graphics_setLineAttrs;
text: .text%Java_sun_awt_motif_X11Graphics_changeClip;
text: .text%Java_sun_awt_motif_X11Graphics_devClearRect;
text: .text%Java_sun_awt_motif_X11Graphics_disposeImpl;
# Test LoadJFrame
text: .text%Java_java_awt_event_InputEvent_initIDs;
text: .text%Java_java_awt_event_KeyEvent_initIDs;
text: .text%expandDamageRect: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/canvas.o;
text: .text%awtJNI_ThreadYield;
text: .text%Java_sun_awt_motif_X11Graphics_createFromGraphics;
text: .text%Java_sun_awt_motif_MToolkit_getScreenWidth;
text: .text%Java_sun_awt_motif_MToolkit_getScreenHeight;
text: .text%Java_sun_awt_X11GraphicsConfig_makeColorModel;
text: .text%awtJNI_GetColorModel;
text: .text%Java_java_awt_image_BufferedImage_initIDs;
text: .text%Java_java_awt_image_Raster_initIDs;
text: .text%Java_java_awt_image_SampleModel_initIDs;
text: .text%Java_java_awt_image_SinglePixelPackedSampleModel_initIDs;
text: .text%Java_sun_awt_image_IntegerComponentRaster_initIDs;
text: .text%Java_sun_java2d_loops_ImageData_initIDs;
text: .text%Java_sun_java2d_loops_IntDiscreteRenderer_devSetRect;
text: .text%Java_sun_awt_motif_X11Graphics_X11LockViewResources;
text: .text%X11DeferredLockViewResources: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_Graphics.o;
text: .text%getLockMethod: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_Graphics.o;
text: .text%DGA_DeferredLockViewResources;
text: .text%setLockMethod: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_Graphics.o;
text: .text%getPrimitiveType: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_Graphics.o;
text: .text%Java_sun_awt_motif_X11Graphics_X11UnLockViewResources;
text: .text%DGA_UnlockViewResources;
text: .text%Java_sun_java2d_loops_DefaultComponent_IntIsomorphicCopy;
text: .text%minImageWidths;
text: .text%minImageRows;
text: .text%getIntImageLockInfo;
text: .text%lockIntImageData;
text: .text%unlockIntImageData;
# Test JHello
text: .text%Java_java_awt_FontMetrics_initIDs;
# SwingSet
text: .text%Java_sun_awt_image_Image_initIDs;
text: .text%Java_sun_awt_image_ImageRepresentation_initIDs;
text: .text%Java_java_awt_image_IndexColorModel_initIDs;
text: .text%Java_sun_awt_motif_MWindowPeer_setSaveUnder;
text: .text%Java_java_awt_AWTEvent_freeNativeData;
text: .text%Java_sun_java2d_loops_DefaultComponent_IntRgbToXbgr;
text: .text%Java_sun_awt_motif_MCanvasPeer_create;
text: .text%awt_util_insertCallback;
text: .text%Java_sun_awt_motif_MComponentPeer_getComponents_1NoClientCode;
text: .text%Java_sun_awt_motif_MComponentPeer_pReshape;
text: .text%awt_util_reshape;
text: .text%Java_sun_awt_motif_MComponentPeer_pShow;
text: .text%Java_sun_java2d_loops_IntDiscreteRenderer_devDrawLine;
text: .text%doDrawLine: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/IntDiscreteRenderer.o;
text: .text%adjustLine: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/IntDiscreteRenderer.o;
text: .text%Java_sun_awt_image_GifImageDecoder_initIDs;
text: .text%Java_java_awt_image_ComponentSampleModel_initIDs;
text: .text%Java_sun_awt_image_ByteComponentRaster_initIDs;
text: .text%Java_sun_awt_image_GifImageDecoder_parseImage;
text: .text%Java_sun_awt_image_ImageRepresentation_setBytePixels;
text: .text%Java_sun_java2d_loops_IntDiscreteRenderer_devDrawRect;
text: .text%outcode: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/IntDiscreteRenderer.o;
text: .text%Java_sun_java2d_loops_ImageData_isAllOpaqueGrayICM;
text: .text%Java_sun_java2d_loops_GIFAcceleratorLoops_LUTcopyTo32BitXBgr;
text: .text%getByteIndexedImageLockInfo;
text: .text%lockByteIndexedImageData;
text: .text%unlockByteIndexedImageData;
text: .text%Java_sun_java2d_loops_GIFAcceleratorLoops_LUTxparTo32BitXBgr;
text: .text%shouldDispatchToWidget: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
text: .text%awtMenuIsActive;
text: .text%awt_util_focusIsOnMenu;
text: .text%awt_isModal;
text: .text%findWidgetInfo: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
text: .text%awt_copyXEvent;
text: .text%awt_post_java_mouse_event;
text: .text%Java_java_awt_event_MouseEvent_initIDs;
text: .text%sysTimeMillis;
text: .text%updateCursor;
text: .text%awt_setActivatedShell;
text: .text%handleFocusEvent;
text: .text%awt_post_java_focus_event;
text: .text%getModifiers;
text: .text%Java_java_awt_AWTEvent_copyDataFieldInto;
text: .text%Java_sun_awt_motif_X11InputMethod_initIDs;
text: .text%Java_sun_awt_motif_X11InputMethod_openXIM;
text: .text%awt_put_back_event;
text: .text%awt_get_next_put_back_event: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
text: .text%null_event_handler: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_MToolkit.o;
text: .text%Java_sun_awt_motif_MGlobalCursorManager_getCursorPos;
text: .text%Java_sun_awt_motif_MGlobalCursorManager_findComponentAt;
text: .text%Java_sun_awt_motif_MWindowPeer_hasTextComponents;
text: .text%Java_sun_awt_motif_X11InputMethod_createXICNative;
text: .text%findClass: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_InputMethod.o;
text: .text%createXIC: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_InputMethod.o;
text: .text%Java_sun_awt_motif_X11InputMethod_setXICFocus;
text: .text%setXICWindowFocus: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_InputMethod.o;
text: .text%setXICFocus: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_InputMethod.o;
text: .text%getAncestorShell;
text: .text%Java_sun_awt_motif_X11InputMethod_turnoffStatusWindow;
text: .text%Frame_quit: ../../../build/solaris-sparcv9/tmp/sun/sun.awt/motif12/obj64/awt_TopLevel.o;

View File

@ -51,7 +51,10 @@ FILES_c = \
gifalloc.c \ gifalloc.c \
compress.c \ compress.c \
deflate.c \ deflate.c \
gzio.c \ gzclose.c \
gzlib.c \
gzread.c \
gzwrite.c \
infback.c \ infback.c \
inffast.c \ inffast.c \
inflate.c \ inflate.c \

View File

@ -256,8 +256,6 @@ SUNWprivate_1.1 {
Java_sun_awt_X11_XToolkit_waitForEvents; Java_sun_awt_X11_XToolkit_waitForEvents;
Java_java_awt_Event_initIDs; Java_java_awt_Event_initIDs;
Java_sun_awt_motif_X11FontMetrics_initIDs;
Java_sun_awt_motif_X11FontMetrics_init;
Java_sun_awt_X11_XWindow_x11inputMethodLookupString; Java_sun_awt_X11_XWindow_x11inputMethodLookupString;
Java_sun_awt_X11_XWindow_haveCurrentX11InputMethodInstance; Java_sun_awt_X11_XWindow_haveCurrentX11InputMethodInstance;
Java_java_awt_AWTEvent_nativeSetSource; Java_java_awt_AWTEvent_nativeSetSource;
@ -265,7 +263,6 @@ SUNWprivate_1.1 {
Java_sun_awt_PlatformFont_initIDs; Java_sun_awt_PlatformFont_initIDs;
Java_sun_awt_FontDescriptor_initIDs; Java_sun_awt_FontDescriptor_initIDs;
Java_sun_awt_X11_XFontPeer_initIDs; Java_sun_awt_X11_XFontPeer_initIDs;
Java_sun_awt_motif_X11FontMetrics_getMFCharsWidth;
Java_sun_awt_X11InputMethod_initIDs; Java_sun_awt_X11InputMethod_initIDs;
Java_sun_awt_X11InputMethod_resetXIC; Java_sun_awt_X11InputMethod_resetXIC;
Java_sun_awt_X11InputMethod_disposeXIC; Java_sun_awt_X11InputMethod_disposeXIC;
@ -322,6 +319,8 @@ SUNWprivate_1.1 {
Java_sun_awt_X11_XlibWrapper_XSynchronize; Java_sun_awt_X11_XlibWrapper_XSynchronize;
Java_java_awt_FileDialog_initIDs; Java_java_awt_FileDialog_initIDs;
Java_sun_awt_X11_XWindow_initIDs; Java_sun_awt_X11_XWindow_initIDs;
Java_sun_awt_X11_XWindowPeer_getLocalHostname;
Java_sun_awt_X11_XWindowPeer_getJvmPID;
Java_sun_java2d_opengl_OGLContext_getOGLIdString; Java_sun_java2d_opengl_OGLContext_getOGLIdString;
Java_sun_java2d_opengl_OGLMaskFill_maskFill; Java_sun_java2d_opengl_OGLMaskFill_maskFill;

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -54,7 +54,7 @@ abstract class AbstractFinder<T> {
/** /**
* Returns an array of {@code Class} objects * Returns an array of {@code Class} objects
* that represent the formal parameter types of the method * that represent the formal parameter types of the method.
* Returns an empty array if the method takes no parameters. * Returns an empty array if the method takes no parameters.
* *
* @param method the object that represents method * @param method the object that represents method

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -87,7 +87,7 @@ public final class ConstructorFinder extends AbstractFinder<Constructor<?>> {
/** /**
* Returns an array of {@code Class} objects * Returns an array of {@code Class} objects
* that represent the formal parameter types of the constructor * that represent the formal parameter types of the constructor.
* Returns an empty array if the constructor takes no parameters. * Returns an empty array if the constructor takes no parameters.
* *
* @param constructor the object that represents constructor * @param constructor the object that represents constructor

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -190,7 +190,7 @@ public final class MethodFinder extends AbstractFinder<Method> {
/** /**
* Returns an array of {@code Class} objects * Returns an array of {@code Class} objects
* that represent the formal parameter types of the method * that represent the formal parameter types of the method.
* Returns an empty array if the method takes no parameters. * Returns an empty array if the method takes no parameters.
* *
* @param method the object that represents method * @param method the object that represents method
@ -226,6 +226,6 @@ public final class MethodFinder extends AbstractFinder<Method> {
*/ */
@Override @Override
protected boolean isValid(Method method) { protected boolean isValid(Method method) {
return Modifier.isPublic(method.getModifiers()) && method.getName().equals(this.name); return !method.isBridge() && Modifier.isPublic(method.getModifiers()) && method.getName().equals(this.name);
} }
} }

View File

@ -34,15 +34,13 @@ import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Properties; import java.util.Properties;
import java.util.ServiceLoader;
import java.security.AccessController; import java.security.AccessController;
import java.security.PrivilegedAction; import java.security.PrivilegedAction;
import javax.sound.sampled.AudioPermission; import javax.sound.sampled.AudioPermission;
import sun.misc.Service;
/** Managing security in the Java Sound implementation. /** Managing security in the Java Sound implementation.
* This class contains all code that uses and is used by * This class contains all code that uses and is used by
* SecurityManager.doPrivileged(). * SecurityManager.doPrivileged().
@ -80,8 +78,8 @@ class JSSecurityManager {
try { try {
if (hasSecurityManager()) { if (hasSecurityManager()) {
if(Printer.debug) Printer.debug("using security manager to load library"); if(Printer.debug) Printer.debug("using security manager to load library");
PrivilegedAction action = new PrivilegedAction() { PrivilegedAction<Void> action = new PrivilegedAction<Void>() {
public Object run() { public Void run() {
System.loadLibrary(libName); System.loadLibrary(libName);
return null; return null;
} }
@ -104,8 +102,8 @@ class JSSecurityManager {
if (hasSecurityManager()) { if (hasSecurityManager()) {
if(Printer.debug) Printer.debug("using JDK 1.2 security to get property"); if(Printer.debug) Printer.debug("using JDK 1.2 security to get property");
try{ try{
PrivilegedAction action = new PrivilegedAction() { PrivilegedAction<String> action = new PrivilegedAction<String>() {
public Object run() { public String run() {
try { try {
return System.getProperty(propertyName); return System.getProperty(propertyName);
} catch (Throwable t) { } catch (Throwable t) {
@ -113,7 +111,7 @@ class JSSecurityManager {
} }
} }
}; };
propertyValue = (String) AccessController.doPrivileged(action); propertyValue = AccessController.doPrivileged(action);
} catch( Exception e ) { } catch( Exception e ) {
if(Printer.debug) Printer.debug("not using JDK 1.2 security to get properties"); if(Printer.debug) Printer.debug("not using JDK 1.2 security to get properties");
propertyValue = System.getProperty(propertyName); propertyValue = System.getProperty(propertyName);
@ -142,8 +140,8 @@ class JSSecurityManager {
if(hasSecurityManager()) { if(hasSecurityManager()) {
try { try {
// invoke the privileged action using 1.2 security // invoke the privileged action using 1.2 security
PrivilegedAction action = new PrivilegedAction() { PrivilegedAction<Void> action = new PrivilegedAction<Void>() {
public Object run() { public Void run() {
loadPropertiesImpl(properties, filename); loadPropertiesImpl(properties, filename);
return null; return null;
} }
@ -197,8 +195,8 @@ class JSSecurityManager {
if(hasSecurityManager()) { if(hasSecurityManager()) {
try { try {
// invoke the privileged action using 1.2 security // invoke the privileged action using 1.2 security
PrivilegedAction action = new PrivilegedAction() { PrivilegedAction<ThreadGroup> action = new PrivilegedAction<ThreadGroup>() {
public Object run() { public ThreadGroup run() {
try { try {
return getTopmostThreadGroupImpl(); return getTopmostThreadGroupImpl();
} catch (Throwable t) { } catch (Throwable t) {
@ -206,7 +204,7 @@ class JSSecurityManager {
} }
} }
}; };
topmostThreadGroup = (ThreadGroup) AccessController.doPrivileged(action); topmostThreadGroup = AccessController.doPrivileged(action);
if(Printer.debug)Printer.debug("Got topmost thread group with JDK 1.2 security"); if(Printer.debug)Printer.debug("Got topmost thread group with JDK 1.2 security");
} catch (Exception e) { } catch (Exception e) {
if(Printer.debug)Printer.debug("Exception getting topmost thread group with JDK 1.2 security"); if(Printer.debug)Printer.debug("Exception getting topmost thread group with JDK 1.2 security");
@ -240,8 +238,8 @@ class JSSecurityManager {
final boolean doStart) { final boolean doStart) {
Thread thread = null; Thread thread = null;
if(hasSecurityManager()) { if(hasSecurityManager()) {
PrivilegedAction action = new PrivilegedAction() { PrivilegedAction<Thread> action = new PrivilegedAction<Thread>() {
public Object run() { public Thread run() {
try { try {
return createThreadImpl(runnable, threadName, return createThreadImpl(runnable, threadName,
isDaemon, priority, isDaemon, priority,
@ -251,7 +249,7 @@ class JSSecurityManager {
} }
} }
}; };
thread = (Thread) AccessController.doPrivileged(action); thread = AccessController.doPrivileged(action);
if(Printer.debug) Printer.debug("created thread with JDK 1.2 security"); if(Printer.debug) Printer.debug("created thread with JDK 1.2 security");
} else { } else {
if(Printer.debug)Printer.debug("not using JDK 1.2 security"); if(Printer.debug)Printer.debug("not using JDK 1.2 security");
@ -282,11 +280,11 @@ class JSSecurityManager {
} }
static List getProviders(final Class providerClass) { static <T> List<T> getProviders(final Class<T> providerClass) {
List p = new ArrayList(); List<T> p = new ArrayList<>();
// Service.providers(Class) just creates "lazy" iterator instance, // ServiceLoader creates "lazy" iterator instance, so it doesn't,
// so it doesn't require do be called from privileged section // require do be called from privileged section
final Iterator ps = Service.providers(providerClass); final Iterator<T> ps = ServiceLoader.load(providerClass).iterator();
// the iterator's hasNext() method looks through classpath for // the iterator's hasNext() method looks through classpath for
// the provider class names, so it requires read permissions // the provider class names, so it requires read permissions
@ -301,7 +299,7 @@ class JSSecurityManager {
// the iterator's next() method creates instances of the // the iterator's next() method creates instances of the
// providers and it should be called in the current security // providers and it should be called in the current security
// context // context
Object provider = ps.next(); T provider = ps.next();
if (providerClass.isInstance(provider)) { if (providerClass.isInstance(provider)) {
// $$mp 2003-08-22 // $$mp 2003-08-22
// Always adding at the beginning reverses the // Always adding at the beginning reverses the

View File

@ -25,50 +25,58 @@
package com.sun.net.httpserver.spi; package com.sun.net.httpserver.spi;
import java.io.FileDescriptor;
import java.io.IOException; import java.io.IOException;
import java.net.*; import java.net.*;
import java.security.AccessController; import java.security.AccessController;
import java.security.PrivilegedAction; import java.security.PrivilegedAction;
import java.util.Iterator; import java.util.Iterator;
import sun.misc.Service; import java.util.ServiceLoader;
import sun.misc.ServiceConfigurationError; import java.util.ServiceConfigurationError;
import sun.security.action.GetPropertyAction;
import com.sun.net.httpserver.*; import com.sun.net.httpserver.*;
/** /**
* Service provider class for HttpServer. * Service provider class for HttpServer.
* Sub-classes of HttpServerProvider provide an implementation of {@link HttpServer} and * Sub-classes of HttpServerProvider provide an implementation of
* associated classes. Applications do not normally use this class. * {@link HttpServer} and associated classes. Applications do not normally use
* See {@link #provider()} for how providers are found and loaded. * this class. See {@link #provider()} for how providers are found and loaded.
*/ */
public abstract class HttpServerProvider { public abstract class HttpServerProvider {
/** /**
* creates a HttpServer from this provider * creates a HttpServer from this provider
* @param addr the address to bind to. May be <code>null</code> *
* @param backlog the socket backlog. A value of <code>zero</code> means the systems default * @param addr
* the address to bind to. May be {@code null}
*
* @param backlog
* the socket backlog. A value of {@code zero} means the systems default
*/ */
public abstract HttpServer createHttpServer (InetSocketAddress addr, int backlog) throws IOException; public abstract HttpServer createHttpServer(InetSocketAddress addr,
int backlog)
throws IOException;
/** /**
* creates a HttpsServer from this provider * creates a HttpsServer from this provider
* @param addr the address to bind to. May be <code>null</code> *
* @param backlog the socket backlog. A value of <code>zero</code> means the systems default * @param addr
* the address to bind to. May be {@code null}
*
* @param backlog
* the socket backlog. A value of {@code zero} means the systems default
*/ */
public abstract HttpsServer createHttpsServer (InetSocketAddress addr, int backlog) throws IOException; public abstract HttpsServer createHttpsServer(InetSocketAddress addr,
int backlog)
throws IOException;
private static final Object lock = new Object(); private static final Object lock = new Object();
private static HttpServerProvider provider = null; private static HttpServerProvider provider = null;
/** /**
* Initializes a new instance of this class. </p> * Initializes a new instance of this class.
* *
* @throws SecurityException * @throws SecurityException
* If a security manager has been installed and it denies * If a security manager has been installed and it denies
* {@link RuntimePermission}<tt>("httpServerProvider")</tt> * {@link RuntimePermission}{@code("httpServerProvider")}
*/ */
protected HttpServerProvider() { protected HttpServerProvider() {
SecurityManager sm = System.getSecurityManager(); SecurityManager sm = System.getSecurityManager();
@ -82,21 +90,22 @@ public abstract class HttpServerProvider {
return false; return false;
try { try {
Class<?> c = Class.forName(cn, true, Class<?> c = Class.forName(cn, true,
ClassLoader.getSystemClassLoader()); ClassLoader.getSystemClassLoader());
provider = (HttpServerProvider)c.newInstance(); provider = (HttpServerProvider)c.newInstance();
return true; return true;
} catch (ClassNotFoundException | } catch (ClassNotFoundException |
IllegalAccessException | IllegalAccessException |
InstantiationException | InstantiationException |
SecurityException x) { SecurityException x) {
throw new ServiceConfigurationError(x); throw new ServiceConfigurationError(null, x);
} }
} }
private static boolean loadProviderAsService() { private static boolean loadProviderAsService() {
@SuppressWarnings("unchecked") Iterator<HttpServerProvider> i =
Iterator<HttpServerProvider> i = Service.providers(HttpServerProvider.class, ServiceLoader.load(HttpServerProvider.class,
ClassLoader.getSystemClassLoader()); ClassLoader.getSystemClassLoader())
.iterator();
for (;;) { for (;;) {
try { try {
if (!i.hasNext()) if (!i.hasNext())
@ -123,19 +132,19 @@ public abstract class HttpServerProvider {
* <ol> * <ol>
* *
* <li><p> If the system property * <li><p> If the system property
* <tt>com.sun.net.httpserver.HttpServerProvider</tt> is defined then it is * {@code com.sun.net.httpserver.HttpServerProvider} is defined then it
* taken to be the fully-qualified name of a concrete provider class. * is taken to be the fully-qualified name of a concrete provider class.
* The class is loaded and instantiated; if this process fails then an * The class is loaded and instantiated; if this process fails then an
* unspecified unchecked error or exception is thrown. </p></li> * unspecified unchecked error or exception is thrown. </p></li>
* *
* <li><p> If a provider class has been installed in a jar file that is * <li><p> If a provider class has been installed in a jar file that is
* visible to the system class loader, and that jar file contains a * visible to the system class loader, and that jar file contains a
* provider-configuration file named * provider-configuration file named
* <tt>com.sun.net.httpserver.HttpServerProvider</tt> in the resource * {@code com.sun.net.httpserver.HttpServerProvider} in the resource
* directory <tt>META-INF/services</tt>, then the first class name * directory <tt>META-INF/services</tt>, then the first class name
* specified in that file is taken. The class is loaded and * specified in that file is taken. The class is loaded and
* instantiated; if this process fails then an unspecified unchecked error or exception is * instantiated; if this process fails then an unspecified unchecked error
* thrown. </p></li> * or exception is thrown. </p></li>
* *
* <li><p> Finally, if no provider has been specified by any of the above * <li><p> Finally, if no provider has been specified by any of the above
* means then the system-default provider class is instantiated and the * means then the system-default provider class is instantiated and the

View File

@ -357,7 +357,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
// set the Reader, this maybe overridden latter // set the Reader, this maybe overridden latter
provider = provider =
(SyncProvider)SyncFactory.getInstance(DEFAULT_SYNC_PROVIDER); SyncFactory.getInstance(DEFAULT_SYNC_PROVIDER);
if (!(provider instanceof RIOptimisticProvider)) { if (!(provider instanceof RIOptimisticProvider)) {
throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidp").toString()); throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.invalidp").toString());
@ -445,11 +445,10 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
* @param env a <code>Hashtable</code> object with a list of desired * @param env a <code>Hashtable</code> object with a list of desired
* synchronization providers * synchronization providers
* @throws SQLException if the requested provider cannot be found by the * @throws SQLException if the requested provider cannot be found by the
* synchonization factory * synchronization factory
* @see SyncProvider * @see SyncProvider
*/ */
public CachedRowSetImpl(@SuppressWarnings("rawtypes") Hashtable env) throws SQLException {
public CachedRowSetImpl(Hashtable env) throws SQLException {
try { try {
@ -467,7 +466,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
// set the Reader, this maybe overridden latter // set the Reader, this maybe overridden latter
provider = provider =
(SyncProvider)SyncFactory.getInstance(providerName); SyncFactory.getInstance(providerName);
rowSetReader = provider.getRowSetReader(); rowSetReader = provider.getRowSetReader();
rowSetWriter = provider.getRowSetWriter(); rowSetWriter = provider.getRowSetWriter();
@ -525,7 +524,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
iMatchColumns = new Vector<Integer>(10); iMatchColumns = new Vector<Integer>(10);
for(int i = 0; i < 10 ; i++) { for(int i = 0; i < 10 ; i++) {
iMatchColumns.add(i,Integer.valueOf(-1)); iMatchColumns.add(i, -1);
} }
strMatchColumns = new Vector<String>(10); strMatchColumns = new Vector<String>(10);
@ -540,7 +539,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
*/ */
private void checkTransactionalWriter() { private void checkTransactionalWriter() {
if (rowSetWriter != null) { if (rowSetWriter != null) {
Class c = rowSetWriter.getClass(); Class<?> c = rowSetWriter.getClass();
if (c != null) { if (c != null) {
Class[] theInterfaces = c.getInterfaces(); Class[] theInterfaces = c.getInterfaces();
for (int i = 0; i < theInterfaces.length; i++) { for (int i = 0; i < theInterfaces.length; i++) {
@ -685,7 +684,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
obj = new SerialArray((java.sql.Array)obj); obj = new SerialArray((java.sql.Array)obj);
} }
((Row)currentRow).initColumnObject(i, obj); currentRow.initColumnObject(i, obj);
} }
rowsFetched++; rowsFetched++;
rvh.add(currentRow); rvh.add(currentRow);
@ -881,7 +880,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
cursorPos = saveCursorPos; cursorPos = saveCursorPos;
} }
if ((tXWriter) && this.COMMIT_ON_ACCEPT_CHANGES) { if (tXWriter) {
// do commit/rollback's here // do commit/rollback's here
if (!conflict) { if (!conflict) {
tWriter = (TransactionalWriter)rowSetWriter; tWriter = (TransactionalWriter)rowSetWriter;
@ -901,7 +900,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
if (success == true) { if (success == true) {
setOriginal(); setOriginal();
} else if (!(success) && !(this.COMMIT_ON_ACCEPT_CHANGES)) { } else if (!(success) ) {
throw new SyncProviderException(resBundle.handleGetObject("cachedrowsetimpl.accfailed").toString()); throw new SyncProviderException(resBundle.handleGetObject("cachedrowsetimpl.accfailed").toString());
} }
@ -938,10 +937,8 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
* @see javax.sql.rowset.spi.SyncProvider * @see javax.sql.rowset.spi.SyncProvider
*/ */
public void acceptChanges(Connection con) throws SyncProviderException{ public void acceptChanges(Connection con) throws SyncProviderException{
setConnection(con); setConnection(con);
acceptChanges(); acceptChanges();
} }
/** /**
@ -957,7 +954,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
*/ */
public void restoreOriginal() throws SQLException { public void restoreOriginal() throws SQLException {
Row currentRow; Row currentRow;
for (Iterator i = rvh.iterator(); i.hasNext();) { for (Iterator<?> i = rvh.iterator(); i.hasNext();) {
currentRow = (Row)i.next(); currentRow = (Row)i.next();
if (currentRow.getInserted() == true) { if (currentRow.getInserted() == true) {
i.remove(); i.remove();
@ -1287,7 +1284,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
TreeMap<Integer, Object> tMap = new TreeMap<>(); TreeMap<Integer, Object> tMap = new TreeMap<>();
for (int i = 0; i<numRows; i++) { for (int i = 0; i<numRows; i++) {
tMap.put(Integer.valueOf(i), rvh.get(i)); tMap.put(i, rvh.get(i));
} }
return (tMap.values()); return (tMap.values());
@ -1379,7 +1376,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
*/ */
public void setSyncProvider(String providerStr) throws SQLException { public void setSyncProvider(String providerStr) throws SQLException {
provider = provider =
(SyncProvider)SyncFactory.getInstance(providerStr); SyncFactory.getInstance(providerStr);
rowSetReader = provider.getRowSetReader(); rowSetReader = provider.getRowSetReader();
rowSetWriter = provider.getRowSetWriter(); rowSetWriter = provider.getRowSetWriter();
@ -1880,7 +1877,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
// check for SQL NULL // check for SQL NULL
if (value == null) { if (value == null) {
setLastValueNull(true); setLastValueNull(true);
return (int)0; return 0;
} }
try { try {
@ -2353,7 +2350,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
throw new SQLException(ex.getMessage()); throw new SQLException(ex.getMessage());
} }
return (java.io.InputStream)asciiStream; return asciiStream;
} }
/** /**
@ -2399,7 +2396,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
unicodeStream = new StringBufferInputStream(value.toString()); unicodeStream = new StringBufferInputStream(value.toString());
return (java.io.InputStream)unicodeStream; return unicodeStream;
} }
/** /**
@ -2454,7 +2451,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
binaryStream = new ByteArrayInputStream((byte[])value); binaryStream = new ByteArrayInputStream((byte[])value);
return (java.io.InputStream)binaryStream; return binaryStream;
} }
@ -2958,7 +2955,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
Struct s = (Struct)value; Struct s = (Struct)value;
map = getTypeMap(); map = getTypeMap();
// look up the class in the map // look up the class in the map
Class c = (Class)map.get(s.getSQLTypeName()); Class<?> c = map.get(s.getSQLTypeName());
if (c != null) { if (c != null) {
// create new instance of the class // create new instance of the class
SQLData obj = null; SQLData obj = null;
@ -3091,7 +3088,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString()); throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.dtypemismt").toString());
} }
return (java.io.Reader)charStream; return charStream;
} }
/** /**
@ -4006,7 +4003,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
switch (trgType) { switch (trgType) {
case java.sql.Types.BIT: case java.sql.Types.BIT:
Integer i = Integer.valueOf(srcObj.toString().trim()); Integer i = Integer.valueOf(srcObj.toString().trim());
return i.equals(Integer.valueOf((int)0)) ? return i.equals(0) ?
Boolean.valueOf(false) : Boolean.valueOf(false) :
Boolean.valueOf(true); Boolean.valueOf(true);
case java.sql.Types.TINYINT: case java.sql.Types.TINYINT:
@ -4173,7 +4170,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
switch (trgType) { switch (trgType) {
case java.sql.Types.BIT: case java.sql.Types.BIT:
Integer i = Integer.valueOf(srcObj.toString().trim()); Integer i = Integer.valueOf(srcObj.toString().trim());
return i.equals(Integer.valueOf((int)0)) ? return i.equals(0) ?
Boolean.valueOf(false) : Boolean.valueOf(false) :
Boolean.valueOf(true); Boolean.valueOf(true);
case java.sql.Types.BOOLEAN: case java.sql.Types.BOOLEAN:
@ -4358,7 +4355,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
checkIndex(columnIndex); checkIndex(columnIndex);
// make sure the cursor is on a valid row // make sure the cursor is on a valid row
checkCursor(); checkCursor();
Object obj = convertNumeric(Integer.valueOf(x), Object obj = convertNumeric(x,
java.sql.Types.INTEGER, java.sql.Types.INTEGER,
RowSetMD.getColumnType(columnIndex)); RowSetMD.getColumnType(columnIndex));
@ -5709,7 +5706,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
Struct s = (Struct)value; Struct s = (Struct)value;
// look up the class in the map // look up the class in the map
Class c = (Class)map.get(s.getSQLTypeName()); Class<?> c = map.get(s.getSQLTypeName());
if (c != null) { if (c != null) {
// create new instance of the class // create new instance of the class
SQLData obj = null; SQLData obj = null;
@ -6293,7 +6290,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
int colCount = RowSetMD.getColumnCount(); int colCount = RowSetMD.getColumnCount();
Row orig; Row orig;
for (Iterator i = rvh.iterator(); i.hasNext();) { for (Iterator<?> i = rvh.iterator(); i.hasNext();) {
orig = new Row(colCount, ((Row)i.next()).getOrigRow()); orig = new Row(colCount, ((Row)i.next()).getOrigRow());
crs.rvh.add(orig); crs.rvh.add(orig);
} }
@ -6379,7 +6376,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
* @throws SQLException if an error occurs * @throws SQLException if an error occurs
*/ */
public void setOriginal() throws SQLException { public void setOriginal() throws SQLException {
for (Iterator i = rvh.iterator(); i.hasNext();) { for (Iterator<?> i = rvh.iterator(); i.hasNext();) {
Row row = (Row)i.next(); Row row = (Row)i.next();
makeRowOriginal(row); makeRowOriginal(row);
// remove deleted rows from the collection. // remove deleted rows from the collection.
@ -6930,7 +6927,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
} }
for( int i = 0;i < columnIdxes.length ;i++) { for( int i = 0;i < columnIdxes.length ;i++) {
iMatchColumns.set(i,Integer.valueOf(-1)); iMatchColumns.set(i, -1);
} }
} }
@ -6998,7 +6995,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
int [] i_temp = new int[iMatchColumns.size()]; int [] i_temp = new int[iMatchColumns.size()];
int i_val; int i_val;
i_val = ((Integer)iMatchColumns.get(0)).intValue(); i_val = iMatchColumns.get(0);
if( i_val == -1 ) { if( i_val == -1 ) {
throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.setmatchcols").toString()); throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.setmatchcols").toString());
@ -7039,7 +7036,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
} }
} }
for(int i = 0 ;i < columnIdxes.length; i++) { for(int i = 0 ;i < columnIdxes.length; i++) {
iMatchColumns.add(i,Integer.valueOf(columnIdxes[i])); iMatchColumns.add(i,columnIdxes[i]);
} }
} }
@ -7094,7 +7091,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols1").toString()); throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.matchcols1").toString());
} else { } else {
// set iMatchColumn // set iMatchColumn
iMatchColumns.set(0, Integer.valueOf(columnIdx)); iMatchColumns.set(0, columnIdx);
//strMatchColumn = null; //strMatchColumn = null;
} }
} }
@ -7147,7 +7144,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch1").toString()); throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch1").toString());
} else { } else {
// that is, we are unsetting it. // that is, we are unsetting it.
iMatchColumns.set(0, Integer.valueOf(-1)); iMatchColumns.set(0, -1);
} }
} }
@ -7171,7 +7168,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
if(!((strMatchColumns.get(0)).equals(columnName))) { if(!((strMatchColumns.get(0)).equals(columnName))) {
throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch").toString()); throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch").toString());
} else if( ((Integer)(iMatchColumns.get(0))).intValue() > 0) { } else if(iMatchColumns.get(0) > 0) {
throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch2").toString()); throw new SQLException(resBundle.handleGetObject("cachedrowsetimpl.unsetmatch2").toString());
} else { } else {
strMatchColumns.set(0, null); // that is, we are unsetting it. strMatchColumns.set(0, null); // that is, we are unsetting it.
@ -7369,7 +7366,7 @@ public class CachedRowSetImpl extends BaseRowSet implements RowSet, RowSetIntern
obj = new SerialArray((java.sql.Array)obj, map); obj = new SerialArray((java.sql.Array)obj, map);
} }
((Row)currentRow).initColumnObject(i, obj); currentRow.initColumnObject(i, obj);
} }
rowsFetched++; rowsFetched++;
maxRowsreached++; maxRowsreached++;

View File

@ -66,6 +66,7 @@ public class FilteredRowSetImpl extends WebRowSetImpl implements Serializable, C
* @param env a Hashtable containing a desired synchconizatation provider * @param env a Hashtable containing a desired synchconizatation provider
* name-value pair. * name-value pair.
*/ */
@SuppressWarnings("rawtypes")
public FilteredRowSetImpl(Hashtable env) throws SQLException { public FilteredRowSetImpl(Hashtable env) throws SQLException {
super(env); super(env);
} }

View File

@ -695,6 +695,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
return ps; return ps;
} }
@SuppressWarnings("deprecation")
private void decodeParams(Object[] params, PreparedStatement ps) private void decodeParams(Object[] params, PreparedStatement ps)
throws SQLException { throws SQLException {
@ -761,14 +762,17 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
ps.setUnicodeStream(i + 1, ps.setUnicodeStream(i + 1,
(java.io.InputStream)param[0], (java.io.InputStream)param[0],
((Integer)param[1]).intValue()); ((Integer)param[1]).intValue());
break;
case JdbcRowSetImpl.BINARY_STREAM_PARAM: case JdbcRowSetImpl.BINARY_STREAM_PARAM:
ps.setBinaryStream(i + 1, ps.setBinaryStream(i + 1,
(java.io.InputStream)param[0], (java.io.InputStream)param[0],
((Integer)param[1]).intValue()); ((Integer)param[1]).intValue());
break;
case JdbcRowSetImpl.ASCII_STREAM_PARAM: case JdbcRowSetImpl.ASCII_STREAM_PARAM:
ps.setAsciiStream(i + 1, ps.setAsciiStream(i + 1,
(java.io.InputStream)param[0], (java.io.InputStream)param[0],
((Integer)param[1]).intValue()); ((Integer)param[1]).intValue());
break;
default: default:
throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.paramtype").toString()); throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.paramtype").toString());
} }
@ -3822,7 +3826,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
int [] i_temp = new int[iMatchColumns.size()]; int [] i_temp = new int[iMatchColumns.size()];
int i_val; int i_val;
i_val = ((Integer)iMatchColumns.get(0)).intValue(); i_val = iMatchColumns.get(0);
if( i_val == -1 ) { if( i_val == -1 ) {
throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.setmatchcols").toString()); throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.setmatchcols").toString());
@ -3996,7 +4000,7 @@ public class JdbcRowSetImpl extends BaseRowSet implements JdbcRowSet, Joinable {
if(!((strMatchColumns.get(0)).equals(columnName))) { if(!((strMatchColumns.get(0)).equals(columnName))) {
throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.unsetmatch").toString()); throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.unsetmatch").toString());
} else if( ((Integer)(iMatchColumns.get(0))).intValue() > 0) { } else if(iMatchColumns.get(0) > 0) {
throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.usecolid").toString()); throw new SQLException(resBundle.handleGetObject("jdbcrowsetimpl.usecolid").toString());
} else { } else {
strMatchColumns.set(0, null); // that is, we are unsetting it. strMatchColumns.set(0, null); // that is, we are unsetting it.

View File

@ -135,6 +135,7 @@ public class JdbcRowSetResourceBundle implements Serializable {
* @return an enumeration of keys which have messages tranlated to * @return an enumeration of keys which have messages tranlated to
* corresponding locales. * corresponding locales.
*/ */
@SuppressWarnings("rawtypes")
public Enumeration getKeys() { public Enumeration getKeys() {
return propResBundle.getKeys(); return propResBundle.getKeys();
} }

View File

@ -233,7 +233,7 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet {
} }
int[] indexes = new int[indices.size()]; int[] indexes = new int[indices.size()];
for(int i=0; i<indices.size();i++) for(int i=0; i<indices.size();i++)
indexes[i] = ((Integer)indices.get(i)).intValue(); indexes[i] = indices.get(i);
cRowset.setMatchColumn(indexes); cRowset.setMatchColumn(indexes);
// Set the match column here because join will be // Set the match column here because join will be
// based on columnId, // based on columnId,
@ -413,6 +413,7 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet {
* @throws SQLException if an error occours generating a collection * @throws SQLException if an error occours generating a collection
* of the originating RowSets contained within the JOIN. * of the originating RowSets contained within the JOIN.
*/ */
@SuppressWarnings("rawtypes")
public Collection getRowSets() throws SQLException { public Collection getRowSets() throws SQLException {
return vecRowSetsInJOIN; return vecRowSetsInJOIN;
} }
@ -893,7 +894,7 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet {
sz = vecRowSetsInJOIN.size(); sz = vecRowSetsInJOIN.size();
for(int i=0;i<sz; i++) { for(int i=0;i<sz; i++) {
crs = (CachedRowSetImpl)vecRowSetsInJOIN.get(i); crs = vecRowSetsInJOIN.get(i);
cols = crs.getMetaData().getColumnCount(); cols = crs.getMetaData().getColumnCount();
tabName = tabName.concat(crs.getTableName()); tabName = tabName.concat(crs.getTableName());
strTabName = strTabName.concat(tabName+", "); strTabName = strTabName.concat(tabName+", ");
@ -928,7 +929,7 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet {
// rowset1.getMatchColumnName() == rowset2.getMatchColumnName() // rowset1.getMatchColumnName() == rowset2.getMatchColumnName()
for(int i=0;i<sz; i++) { for(int i=0;i<sz; i++) {
strWhereClause = strWhereClause.concat( strWhereClause = strWhereClause.concat(
((CachedRowSetImpl)vecRowSetsInJOIN.get(i)).getMatchColumnNames()[0]); vecRowSetsInJOIN.get(i).getMatchColumnNames()[0]);
if(i%2!=0) { if(i%2!=0) {
strWhereClause = strWhereClause.concat("="); strWhereClause = strWhereClause.concat("=");
} else { } else {
@ -4175,7 +4176,7 @@ public class JoinRowSetImpl extends WebRowSetImpl implements JoinRowSet {
// Default JoinRowSet type // Default JoinRowSet type
this.setJoinType(JoinRowSet.INNER_JOIN); this.setJoinType(JoinRowSet.INNER_JOIN);
} }
Integer i = (Integer)(vecJoinType.get(vecJoinType.size()-1)); Integer i = vecJoinType.get(vecJoinType.size()-1);
return i.intValue(); return i.intValue();
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -101,6 +101,7 @@ public class WebRowSetImpl extends CachedRowSetImpl implements WebRowSet {
* synchronization providers for the relational and XML providers; or * synchronization providers for the relational and XML providers; or
* if the Hashtanle is null * if the Hashtanle is null
*/ */
@SuppressWarnings("rawtypes")
public WebRowSetImpl(Hashtable env) throws SQLException { public WebRowSetImpl(Hashtable env) throws SQLException {
try { try {
@ -117,7 +118,7 @@ public class WebRowSetImpl extends CachedRowSetImpl implements WebRowSet {
(String)env.get(javax.sql.rowset.spi.SyncFactory.ROWSET_SYNC_PROVIDER); (String)env.get(javax.sql.rowset.spi.SyncFactory.ROWSET_SYNC_PROVIDER);
// set the Reader, this maybe overridden latter // set the Reader, this maybe overridden latter
provider = (SyncProvider)SyncFactory.getInstance(providerName); provider = SyncFactory.getInstance(providerName);
// xmlReader = provider.getRowSetReader(); // xmlReader = provider.getRowSetReader();
// xmlWriter = provider.getRowSetWriter(); // xmlWriter = provider.getRowSetWriter();

View File

@ -363,6 +363,7 @@ public class CachedRowSetReader implements RowSetReader, Serializable {
* the given parameters are to be set * the given parameters are to be set
* @throws SQLException if an access error occurs * @throws SQLException if an access error occurs
*/ */
@SuppressWarnings("deprecation")
private void decodeParams(Object[] params, private void decodeParams(Object[] params,
PreparedStatement pstmt) throws SQLException { PreparedStatement pstmt) throws SQLException {
// There is a corresponding decodeParams in JdbcRowSetImpl // There is a corresponding decodeParams in JdbcRowSetImpl
@ -428,14 +429,17 @@ public class CachedRowSetReader implements RowSetReader, Serializable {
pstmt.setUnicodeStream(i + 1, pstmt.setUnicodeStream(i + 1,
(java.io.InputStream)param[0], (java.io.InputStream)param[0],
((Integer)param[1]).intValue()); ((Integer)param[1]).intValue());
break;
case CachedRowSetImpl.BINARY_STREAM_PARAM: case CachedRowSetImpl.BINARY_STREAM_PARAM:
pstmt.setBinaryStream(i + 1, pstmt.setBinaryStream(i + 1,
(java.io.InputStream)param[0], (java.io.InputStream)param[0],
((Integer)param[1]).intValue()); ((Integer)param[1]).intValue());
break;
case CachedRowSetImpl.ASCII_STREAM_PARAM: case CachedRowSetImpl.ASCII_STREAM_PARAM:
pstmt.setAsciiStream(i + 1, pstmt.setAsciiStream(i + 1,
(java.io.InputStream)param[0], (java.io.InputStream)param[0],
((Integer)param[1]).intValue()); ((Integer)param[1]).intValue());
break;
default: default:
throw new SQLException(resBundle.handleGetObject("crsreader.paramtype").toString()); throw new SQLException(resBundle.handleGetObject("crsreader.paramtype").toString());
} }

View File

@ -183,7 +183,7 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable {
/** /**
* This <code>ArrayList<code> will hold the values of SyncResolver.* * This <code>ArrayList<code> will hold the values of SyncResolver.*
*/ */
private ArrayList status; private ArrayList<Integer> status;
/** /**
* This will check whether the same field value has changed both * This will check whether the same field value has changed both
@ -305,7 +305,7 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable {
iColCount = rsmdWrite.getColumnCount(); iColCount = rsmdWrite.getColumnCount();
int sz= crs.size()+1; int sz= crs.size()+1;
status = new ArrayList(sz); status = new ArrayList<>(sz);
status.add(0,null); status.add(0,null);
rsmdResolv.setColumnCount(iColCount); rsmdResolv.setColumnCount(iColCount);
@ -338,11 +338,11 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable {
if (crs.rowDeleted()) { if (crs.rowDeleted()) {
// The row has been deleted. // The row has been deleted.
if (conflict = (deleteOriginalRow(crs, this.crsResolve)) == true) { if (conflict = (deleteOriginalRow(crs, this.crsResolve)) == true) {
status.add(rows, Integer.valueOf(SyncResolver.DELETE_ROW_CONFLICT)); status.add(rows, SyncResolver.DELETE_ROW_CONFLICT);
} else { } else {
// delete happened without any occurrence of conflicts // delete happened without any occurrence of conflicts
// so update status accordingly // so update status accordingly
status.add(rows, Integer.valueOf(SyncResolver.NO_ROW_CONFLICT)); status.add(rows, SyncResolver.NO_ROW_CONFLICT);
} }
} else if (crs.rowInserted()) { } else if (crs.rowInserted()) {
@ -350,20 +350,20 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable {
pstmtIns = con.prepareStatement(insertCmd); pstmtIns = con.prepareStatement(insertCmd);
if ( (conflict = insertNewRow(crs, pstmtIns, this.crsResolve)) == true) { if ( (conflict = insertNewRow(crs, pstmtIns, this.crsResolve)) == true) {
status.add(rows, Integer.valueOf(SyncResolver.INSERT_ROW_CONFLICT)); status.add(rows, SyncResolver.INSERT_ROW_CONFLICT);
} else { } else {
// insert happened without any occurrence of conflicts // insert happened without any occurrence of conflicts
// so update status accordingly // so update status accordingly
status.add(rows, Integer.valueOf(SyncResolver.NO_ROW_CONFLICT)); status.add(rows, SyncResolver.NO_ROW_CONFLICT);
} }
} else if (crs.rowUpdated()) { } else if (crs.rowUpdated()) {
// The row has been updated. // The row has been updated.
if ( conflict = (updateOriginalRow(crs)) == true) { if ( conflict = (updateOriginalRow(crs)) == true) {
status.add(rows, Integer.valueOf(SyncResolver.UPDATE_ROW_CONFLICT)); status.add(rows, SyncResolver.UPDATE_ROW_CONFLICT);
} else { } else {
// update happened without any occurrence of conflicts // update happened without any occurrence of conflicts
// so update status accordingly // so update status accordingly
status.add(rows, Integer.valueOf(SyncResolver.NO_ROW_CONFLICT)); status.add(rows, SyncResolver.NO_ROW_CONFLICT);
} }
} else { } else {
@ -375,7 +375,7 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable {
* that is fine. * that is fine.
**/ **/
int icolCount = crs.getMetaData().getColumnCount(); int icolCount = crs.getMetaData().getColumnCount();
status.add(rows, Integer.valueOf(SyncResolver.NO_ROW_CONFLICT)); status.add(rows, SyncResolver.NO_ROW_CONFLICT);
this.crsResolve.moveToInsertRow(); this.crsResolve.moveToInsertRow();
for(int cols=0;cols<iColCount;cols++) { for(int cols=0;cols<iColCount;cols++) {
@ -398,7 +398,7 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable {
boolean boolConf = false; boolean boolConf = false;
for (int j=1;j<status.size();j++){ for (int j=1;j<status.size();j++){
// ignore status for index = 0 which is set to null // ignore status for index = 0 which is set to null
if(! ((status.get(j)).equals(Integer.valueOf(SyncResolver.NO_ROW_CONFLICT)))) { if(! ((status.get(j)).equals(SyncResolver.NO_ROW_CONFLICT))) {
// there is at least one conflict which needs to be resolved // there is at least one conflict which needs to be resolved
boolConf = true; boolConf = true;
break; break;
@ -540,7 +540,7 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable {
// how many fields need to be updated // how many fields need to be updated
int colsNotChanged = 0; int colsNotChanged = 0;
Vector cols = new Vector(); Vector<Integer> cols = new Vector<>();
String updateExec = updateCmd; String updateExec = updateCmd;
Object orig; Object orig;
Object curr; Object curr;
@ -566,14 +566,14 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable {
* into a CachedRowSet so that comparison of the column values * into a CachedRowSet so that comparison of the column values
* from the ResultSet and CachedRowSet are possible * from the ResultSet and CachedRowSet are possible
*/ */
Map map = (crs.getTypeMap() == null)?con.getTypeMap():crs.getTypeMap(); Map<String, Class<?>> map = (crs.getTypeMap() == null)?con.getTypeMap():crs.getTypeMap();
if (rsval instanceof Struct) { if (rsval instanceof Struct) {
Struct s = (Struct)rsval; Struct s = (Struct)rsval;
// look up the class in the map // look up the class in the map
Class c = null; Class<?> c = null;
c = (Class)map.get(s.getSQLTypeName()); c = map.get(s.getSQLTypeName());
if (c != null) { if (c != null) {
// create new instance of the class // create new instance of the class
SQLData obj = null; SQLData obj = null;
@ -652,7 +652,7 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable {
updateExec += ", "; updateExec += ", ";
} }
updateExec += crs.getMetaData().getColumnName(i); updateExec += crs.getMetaData().getColumnName(i);
cols.add(Integer.valueOf(i)); cols.add(i);
updateExec += " = ? "; updateExec += " = ? ";
first = false; first = false;
@ -698,7 +698,7 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable {
updateExec += ", "; updateExec += ", ";
} }
updateExec += crs.getMetaData().getColumnName(i); updateExec += crs.getMetaData().getColumnName(i);
cols.add(Integer.valueOf(i)); cols.add(i);
updateExec += " = ? "; updateExec += " = ? ";
flag = false; flag = false;
} else { } else {
@ -749,7 +749,7 @@ public class CachedRowSetWriter implements TransactionalWriter, Serializable {
// Comments needed here // Comments needed here
for (i = 0; i < cols.size(); i++) { for (i = 0; i < cols.size(); i++) {
Object obj = crs.getObject(((Integer)cols.get(i)).intValue()); Object obj = crs.getObject(cols.get(i));
if (obj != null) if (obj != null)
pstmt.setObject(i + 1, obj); pstmt.setObject(i + 1, obj);
else else

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -27,9 +27,7 @@ package com.sun.rowset.internal;
import java.sql.*; import java.sql.*;
import java.io.*; import java.io.*;
import java.math.*;
import java.lang.*; import java.lang.*;
import java.lang.reflect.*;
import java.util.*; import java.util.*;
/** /**
@ -48,6 +46,8 @@ import java.util.*;
*/ */
public class Row extends BaseRow implements Serializable, Cloneable { public class Row extends BaseRow implements Serializable, Cloneable {
static final long serialVersionUID = 5047859032611314762L;
/** /**
* An array containing the current column values for this <code>Row</code> * An array containing the current column values for this <code>Row</code>
* object. * object.
@ -115,9 +115,7 @@ public class Row extends BaseRow implements Serializable, Cloneable {
*/ */
public Row(int numCols, Object[] vals) { public Row(int numCols, Object[] vals) {
origVals = new Object[numCols]; origVals = new Object[numCols];
for (int i=0; i < numCols; i++) { System.arraycopy(vals, 0, origVals, 0, numCols);
origVals[i] = vals[i];
}
currentVals = new Object[numCols]; currentVals = new Object[numCols];
colsChanged = new BitSet(numCols); colsChanged = new BitSet(numCols);
this.numCols = numCols; this.numCols = numCols;

View File

@ -65,7 +65,7 @@ public class SyncResolverImpl extends CachedRowSetImpl implements SyncResolver {
* This ArrayList will contain the status of a row * This ArrayList will contain the status of a row
* from the SyncResolver.* values else it will be null. * from the SyncResolver.* values else it will be null.
*/ */
private ArrayList stats; private ArrayList<?> stats;
/** /**
* The RowSetWriter associated with the original * The RowSetWriter associated with the original
@ -429,6 +429,7 @@ public class SyncResolverImpl extends CachedRowSetImpl implements SyncResolver {
* This is used to set the status of each row * This is used to set the status of each row
* to either of the values SyncResolver.*_CONFLICT * to either of the values SyncResolver.*_CONFLICT
**/ **/
@SuppressWarnings("rawtypes")
void setStatus(ArrayList status){ void setStatus(ArrayList status){
stats = status; stats = status;
} }
@ -856,6 +857,7 @@ public class SyncResolverImpl extends CachedRowSetImpl implements SyncResolver {
* @see #toCollection(String) * @see #toCollection(String)
* @see java.util.TreeMap * @see java.util.TreeMap
*/ */
@SuppressWarnings("rawtypes")
public Collection toCollection() throws SQLException { public Collection toCollection() throws SQLException {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@ -878,6 +880,7 @@ public class SyncResolverImpl extends CachedRowSetImpl implements SyncResolver {
* @see #toCollection(String) * @see #toCollection(String)
* @see java.util.Vector * @see java.util.Vector
*/ */
@SuppressWarnings("rawtypes")
public Collection toCollection(int column) throws SQLException { public Collection toCollection(int column) throws SQLException {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }
@ -900,6 +903,7 @@ public class SyncResolverImpl extends CachedRowSetImpl implements SyncResolver {
* @see #toCollection(int) * @see #toCollection(int)
* @see java.util.Vector * @see java.util.Vector
*/ */
@SuppressWarnings("rawtypes")
public Collection toCollection(String column) throws SQLException { public Collection toCollection(String column) throws SQLException {
throw new UnsupportedOperationException(); throw new UnsupportedOperationException();
} }

View File

@ -55,7 +55,7 @@ public class WebRowSetXmlWriter implements XmlWriter, Serializable {
* object will use for storing the tags to be used for writing the calling * object will use for storing the tags to be used for writing the calling
* <code>WebRowSet</code> object as an XML document. * <code>WebRowSet</code> object as an XML document.
*/ */
private java.util.Stack stack; private java.util.Stack<String> stack;
private JdbcRowSetResourceBundle resBundle; private JdbcRowSetResourceBundle resBundle;
@ -94,7 +94,7 @@ public class WebRowSetXmlWriter implements XmlWriter, Serializable {
throws SQLException { throws SQLException {
// create a new stack for tag checking. // create a new stack for tag checking.
stack = new java.util.Stack(); stack = new java.util.Stack<>();
writer = wrt; writer = wrt;
writeRowSet(caller); writeRowSet(caller);
} }
@ -127,7 +127,7 @@ public class WebRowSetXmlWriter implements XmlWriter, Serializable {
throws SQLException { throws SQLException {
// create a new stack for tag checking. // create a new stack for tag checking.
stack = new java.util.Stack(); stack = new java.util.Stack<>();
writer = new OutputStreamWriter(oStream); writer = new OutputStreamWriter(oStream);
writeRowSet(caller); writeRowSet(caller);
} }
@ -205,10 +205,10 @@ public class WebRowSetXmlWriter implements XmlWriter, Serializable {
//Changed to beginSection and endSection for maps for proper indentation //Changed to beginSection and endSection for maps for proper indentation
beginSection("map"); beginSection("map");
java.util.Map typeMap = caller.getTypeMap(); java.util.Map<?,?> typeMap = caller.getTypeMap();
if (typeMap != null) { if (typeMap != null) {
Iterator i = typeMap.keySet().iterator(); Iterator<?> i = typeMap.keySet().iterator();
Class c; Class<?> c;
String type; String type;
while (i.hasNext()) { while (i.hasNext()) {
type = (String)i.next(); type = (String)i.next();
@ -532,7 +532,7 @@ public class WebRowSetXmlWriter implements XmlWriter, Serializable {
} }
private String getTag() { private String getTag() {
return (String)stack.pop(); return stack.pop();
} }
private void writeNull() throws java.io.IOException { private void writeNull() throws java.io.IOException {

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -71,14 +71,14 @@ import java.text.MessageFormat;
public class XmlReaderContentHandler extends DefaultHandler { public class XmlReaderContentHandler extends DefaultHandler {
private HashMap propMap; private HashMap <String, Integer> propMap;
private HashMap colDefMap; private HashMap <String, Integer> colDefMap;
private HashMap dataMap; private HashMap <String, Integer> dataMap;
private HashMap typeMap; private HashMap<String,Class<?>> typeMap;
private Vector updates; private Vector<Object[]> updates;
private Vector keyCols; private Vector<String> keyCols;
private String columnValue; private String columnValue;
private String propertyValue; private String propertyValue;
@ -438,7 +438,7 @@ public class XmlReaderContentHandler extends DefaultHandler {
initMaps(); initMaps();
// allocate the collection for the updates // allocate the collection for the updates
updates = new Vector(); updates = new Vector<>();
// start out with the empty string // start out with the empty string
columnValue = ""; columnValue = "";
@ -477,21 +477,21 @@ public class XmlReaderContentHandler extends DefaultHandler {
private void initMaps() { private void initMaps() {
int items, i; int items, i;
propMap = new HashMap(); propMap = new HashMap<>();
items = properties.length; items = properties.length;
for (i=0;i<items;i++) { for (i=0;i<items;i++) {
propMap.put(properties[i], Integer.valueOf(i)); propMap.put(properties[i], Integer.valueOf(i));
} }
colDefMap = new HashMap(); colDefMap = new HashMap<>();
items = colDef.length; items = colDef.length;
for (i=0;i<items;i++) { for (i=0;i<items;i++) {
colDefMap.put(colDef[i], Integer.valueOf(i)); colDefMap.put(colDef[i], Integer.valueOf(i));
} }
dataMap = new HashMap(); dataMap = new HashMap<>();
items = data.length; items = data.length;
for (i=0;i<items;i++) { for (i=0;i<items;i++) {
@ -499,7 +499,7 @@ public class XmlReaderContentHandler extends DefaultHandler {
} }
//Initialize connection map here //Initialize connection map here
typeMap = new HashMap(); typeMap = new HashMap<>();
} }
public void startDocument() throws SAXException { public void startDocument() throws SAXException {
@ -549,14 +549,14 @@ public class XmlReaderContentHandler extends DefaultHandler {
case PROPERTIES: case PROPERTIES:
tempCommand = ""; tempCommand = "";
tag = ((Integer)propMap.get(name)).intValue(); tag = propMap.get(name);
if (tag == PropNullTag) if (tag == PropNullTag)
setNullValue(true); setNullValue(true);
else else
setTag(tag); setTag(tag);
break; break;
case METADATA: case METADATA:
tag = ((Integer)colDefMap.get(name)).intValue(); tag = colDefMap.get(name);
if (tag == MetaNullTag) if (tag == MetaNullTag)
setNullValue(true); setNullValue(true);
@ -573,10 +573,10 @@ public class XmlReaderContentHandler extends DefaultHandler {
tempUpdate = ""; tempUpdate = "";
if(dataMap.get(name) == null) { if(dataMap.get(name) == null) {
tag = NullTag; tag = NullTag;
} else if(((Integer)dataMap.get(name)).intValue() == EmptyStringTag) { } else if(dataMap.get(name) == EmptyStringTag) {
tag = EmptyStringTag; tag = EmptyStringTag;
} else { } else {
tag = ((Integer)dataMap.get(name)).intValue(); tag = dataMap.get(name);
} }
if (tag == NullTag) { if (tag == NullTag) {
@ -630,6 +630,7 @@ public class XmlReaderContentHandler extends DefaultHandler {
* *
* @exception SAXException if a general SAX error occurs * @exception SAXException if a general SAX error occurs
*/ */
@SuppressWarnings("fallthrough")
public void endElement(String uri, String lName, String qName) throws SAXException { public void endElement(String uri, String lName, String qName) throws SAXException {
int tag; int tag;
@ -644,13 +645,13 @@ public class XmlReaderContentHandler extends DefaultHandler {
} }
try { try {
tag = ((Integer)propMap.get(name)).intValue(); tag = propMap.get(name);
switch (tag) { switch (tag) {
case KeycolsTag: case KeycolsTag:
if (keyCols != null) { if (keyCols != null) {
int i[] = new int[keyCols.size()]; int i[] = new int[keyCols.size()];
for (int j = 0; j < i.length; j++) for (int j = 0; j < i.length; j++)
i[j] = Integer.parseInt((String)keyCols.elementAt(j)); i[j] = Integer.parseInt(keyCols.elementAt(j));
rs.setKeyColumns(i); rs.setKeyColumns(i);
} }
break; break;
@ -723,7 +724,7 @@ public class XmlReaderContentHandler extends DefaultHandler {
if(dataMap.get(name) == null) { if(dataMap.get(name) == null) {
tag = NullTag; tag = NullTag;
} else { } else {
tag = ((Integer)dataMap.get(name)).intValue(); tag = dataMap.get(name);
} }
switch (tag) { switch (tag) {
case ColTag: case ColTag:
@ -820,7 +821,7 @@ public class XmlReaderContentHandler extends DefaultHandler {
if (updates.size() > 0) { if (updates.size() > 0) {
try { try {
Object upd[]; Object upd[];
Iterator i = updates.iterator(); Iterator<?> i = updates.iterator();
while (i.hasNext()) { while (i.hasNext()) {
upd = (Object [])i.next(); upd = (Object [])i.next();
idx = ((Integer)upd[0]).intValue(); idx = ((Integer)upd[0]).intValue();
@ -1075,7 +1076,7 @@ public class XmlReaderContentHandler extends DefaultHandler {
break; break;
case PropColumnTag: case PropColumnTag:
if (keyCols == null) if (keyCols == null)
keyCols = new Vector(); keyCols = new Vector<>();
keyCols.add(s); keyCols.add(s);
break; break;
case MapTag: case MapTag:

View File

@ -117,7 +117,7 @@ public class Applet extends Panel {
s.checkPermission(new AWTPermission("setAppletStub")); s.checkPermission(new AWTPermission("setAppletStub"));
} }
} }
this.stub = (AppletStub)stub; this.stub = stub;
} }
/** /**
@ -210,6 +210,7 @@ public class Applet extends Panel {
* @param width the new requested width for the applet. * @param width the new requested width for the applet.
* @param height the new requested height for the applet. * @param height the new requested height for the applet.
*/ */
@SuppressWarnings("deprecation")
public void resize(int width, int height) { public void resize(int width, int height) {
Dimension d = size(); Dimension d = size();
if ((d.width != width) || (d.height != height)) { if ((d.width != width) || (d.height != height)) {
@ -225,6 +226,7 @@ public class Applet extends Panel {
* *
* @param d an object giving the new width and height. * @param d an object giving the new width and height.
*/ */
@SuppressWarnings("deprecation")
public void resize(Dimension d) { public void resize(Dimension d) {
resize(d.width, d.height); resize(d.width, d.height);
} }

View File

@ -666,9 +666,10 @@ public abstract class Component implements ImageObserver, MenuContainer,
* can lead to a deadlock if client code also uses synchronization * can lead to a deadlock if client code also uses synchronization
* by a component object. For every such situation revealed we should * by a component object. For every such situation revealed we should
* consider possibility of replacing "this" with the package private * consider possibility of replacing "this" with the package private
* objectLock object introduced below. So far there're 2 issues known: * objectLock object introduced below. So far there're 3 issues known:
* - CR 6708322 (the getName/setName methods); * - CR 6708322 (the getName/setName methods);
* - CR 6608764 (the PropertyChangeListener machinery). * - CR 6608764 (the PropertyChangeListener machinery);
* - CR 7108598 (the Container.paint/KeyboardFocusManager.clearMostRecentFocusOwner methods).
* *
* Note: this field is considered final, though readObject() prohibits * Note: this field is considered final, though readObject() prohibits
* initializing final fields. * initializing final fields.
@ -1158,6 +1159,10 @@ public abstract class Component implements ImageObserver, MenuContainer,
boolean updateGraphicsData(GraphicsConfiguration gc) { boolean updateGraphicsData(GraphicsConfiguration gc) {
checkTreeLock(); checkTreeLock();
if (graphicsConfig == gc) {
return false;
}
graphicsConfig = gc; graphicsConfig = gc;
ComponentPeer peer = getPeer(); ComponentPeer peer = getPeer();

View File

@ -1950,7 +1950,7 @@ public class Container extends Component {
*/ */
public void paint(Graphics g) { public void paint(Graphics g) {
if (isShowing()) { if (isShowing()) {
synchronized (this) { synchronized (getObjectLock()) {
if (printing) { if (printing) {
if (printingThreads.contains(Thread.currentThread())) { if (printingThreads.contains(Thread.currentThread())) {
return; return;
@ -2004,7 +2004,7 @@ public class Container extends Component {
if (isShowing()) { if (isShowing()) {
Thread t = Thread.currentThread(); Thread t = Thread.currentThread();
try { try {
synchronized (this) { synchronized (getObjectLock()) {
if (printingThreads == null) { if (printingThreads == null) {
printingThreads = new HashSet(); printingThreads = new HashSet();
} }
@ -2013,7 +2013,7 @@ public class Container extends Component {
} }
super.print(g); // By default, Component.print() calls paint() super.print(g); // By default, Component.print() calls paint()
} finally { } finally {
synchronized (this) { synchronized (getObjectLock()) {
printingThreads.remove(t); printingThreads.remove(t);
printing = !printingThreads.isEmpty(); printing = !printingThreads.isEmpty();
} }

View File

@ -34,6 +34,7 @@ import java.awt.Toolkit;
import java.awt.im.InputMethodHighlight; import java.awt.im.InputMethodHighlight;
import java.text.Annotation; import java.text.Annotation;
import java.text.AttributedCharacterIterator; import java.text.AttributedCharacterIterator;
import java.text.AttributedCharacterIterator.Attribute;
import java.util.Vector; import java.util.Vector;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -65,7 +66,7 @@ final class StyledParagraph {
// If there are multiple Decorations in the paragraph, they are // If there are multiple Decorations in the paragraph, they are
// stored in this Vector, in order. Otherwise this vector and // stored in this Vector, in order. Otherwise this vector and
// the decorationStarts array are null. // the decorationStarts array are null.
private Vector decorations; private Vector<Decoration> decorations;
// If there are multiple Decorations in the paragraph, // If there are multiple Decorations in the paragraph,
// decorationStarts[i] contains the index where decoration i // decorationStarts[i] contains the index where decoration i
// starts. For convenience, there is an extra entry at the // starts. For convenience, there is an extra entry at the
@ -76,7 +77,7 @@ final class StyledParagraph {
// they are // they are
// stored in this Vector, in order. Otherwise this vector and // stored in this Vector, in order. Otherwise this vector and
// the fontStarts array are null. // the fontStarts array are null.
private Vector fonts; private Vector<Object> fonts;
// If there are multiple Fonts/GraphicAttributes in the paragraph, // If there are multiple Fonts/GraphicAttributes in the paragraph,
// fontStarts[i] contains the index where decoration i // fontStarts[i] contains the index where decoration i
// starts. For convenience, there is an extra entry at the // starts. For convenience, there is an extra entry at the
@ -104,7 +105,7 @@ final class StyledParagraph {
final int nextRunStart = aci.getRunLimit(); final int nextRunStart = aci.getRunLimit();
final int localIndex = index-start; final int localIndex = index-start;
Map attributes = aci.getAttributes(); Map<? extends Attribute, ?> attributes = aci.getAttributes();
attributes = addInputMethodAttrs(attributes); attributes = addInputMethodAttrs(attributes);
Decoration d = Decoration.getDecoration(attributes); Decoration d = Decoration.getDecoration(attributes);
addDecoration(d, localIndex); addDecoration(d, localIndex);
@ -168,7 +169,8 @@ final class StyledParagraph {
char ch = aci.setIndex(insertPos); char ch = aci.setIndex(insertPos);
int relativePos = Math.max(insertPos - aci.getBeginIndex() - 1, 0); int relativePos = Math.max(insertPos - aci.getBeginIndex() - 1, 0);
Map attributes = addInputMethodAttrs(aci.getAttributes()); Map<? extends Attribute, ?> attributes =
addInputMethodAttrs(aci.getAttributes());
Decoration d = Decoration.getDecoration(attributes); Decoration d = Decoration.getDecoration(attributes);
if (!oldParagraph.getDecorationAt(relativePos).equals(d)) { if (!oldParagraph.getDecorationAt(relativePos).equals(d)) {
return new StyledParagraph(aci, chars); return new StyledParagraph(aci, chars);
@ -297,7 +299,7 @@ final class StyledParagraph {
return decoration; return decoration;
} }
int run = findRunContaining(index, decorationStarts); int run = findRunContaining(index, decorationStarts);
return (Decoration) decorations.elementAt(run); return decorations.elementAt(run);
} }
/** /**
@ -339,6 +341,7 @@ final class StyledParagraph {
* starts array does not have room for the index, a * starts array does not have room for the index, a
* new array is created and returned. * new array is created and returned.
*/ */
@SuppressWarnings({"rawtypes", "unchecked"})
private static int[] addToVector(Object obj, private static int[] addToVector(Object obj,
int index, int index,
Vector v, Vector v,
@ -374,7 +377,7 @@ final class StyledParagraph {
} }
else { else {
if (!decoration.equals(d)) { if (!decoration.equals(d)) {
decorations = new Vector(INITIAL_SIZE); decorations = new Vector<Decoration>(INITIAL_SIZE);
decorations.addElement(decoration); decorations.addElement(decoration);
decorations.addElement(d); decorations.addElement(d);
decorationStarts = new int[INITIAL_SIZE]; decorationStarts = new int[INITIAL_SIZE];
@ -398,7 +401,7 @@ final class StyledParagraph {
} }
else { else {
if (!font.equals(f)) { if (!font.equals(f)) {
fonts = new Vector(INITIAL_SIZE); fonts = new Vector<Object>(INITIAL_SIZE);
fonts.addElement(font); fonts.addElement(font);
fonts.addElement(f); fonts.addElement(f);
fontStarts = new int[INITIAL_SIZE]; fontStarts = new int[INITIAL_SIZE];
@ -412,7 +415,8 @@ final class StyledParagraph {
* Resolve the given chars into Fonts using FontResolver, then add * Resolve the given chars into Fonts using FontResolver, then add
* font runs for each. * font runs for each.
*/ */
private void addFonts(char[] chars, Map attributes, int start, int limit) { private void addFonts(char[] chars, Map<? extends Attribute, ?> attributes,
int start, int limit) {
FontResolver resolver = FontResolver.getInstance(); FontResolver resolver = FontResolver.getInstance();
CodePointIterator iter = CodePointIterator.create(chars, start, limit); CodePointIterator iter = CodePointIterator.create(chars, start, limit);
@ -426,7 +430,8 @@ final class StyledParagraph {
* Return a Map with entries from oldStyles, as well as input * Return a Map with entries from oldStyles, as well as input
* method entries, if any. * method entries, if any.
*/ */
static Map addInputMethodAttrs(Map oldStyles) { static Map<? extends Attribute, ?>
addInputMethodAttrs(Map<? extends Attribute, ?> oldStyles) {
Object value = oldStyles.get(TextAttribute.INPUT_METHOD_HIGHLIGHT); Object value = oldStyles.get(TextAttribute.INPUT_METHOD_HIGHLIGHT);
@ -439,7 +444,7 @@ final class StyledParagraph {
InputMethodHighlight hl; InputMethodHighlight hl;
hl = (InputMethodHighlight) value; hl = (InputMethodHighlight) value;
Map imStyles = null; Map<? extends Attribute, ?> imStyles = null;
try { try {
imStyles = hl.getStyle(); imStyles = hl.getStyle();
} catch (NoSuchMethodError e) { } catch (NoSuchMethodError e) {
@ -451,7 +456,8 @@ final class StyledParagraph {
} }
if (imStyles != null) { if (imStyles != null) {
HashMap newStyles = new HashMap(5, (float)0.9); HashMap<Attribute, Object>
newStyles = new HashMap<>(5, (float)0.9);
newStyles.putAll(oldStyles); newStyles.putAll(oldStyles);
newStyles.putAll(imStyles); newStyles.putAll(imStyles);
@ -471,7 +477,8 @@ final class StyledParagraph {
* If attributes does not contain a GraphicAttribute, Font, or * If attributes does not contain a GraphicAttribute, Font, or
* Font family entry this method returns null. * Font family entry this method returns null.
*/ */
private static Object getGraphicOrFont(Map attributes) { private static Object getGraphicOrFont(
Map<? extends Attribute, ?> attributes) {
Object value = attributes.get(TextAttribute.CHAR_REPLACEMENT); Object value = attributes.get(TextAttribute.CHAR_REPLACEMENT);
if (value != null) { if (value != null) {

View File

@ -257,7 +257,8 @@ import java.util.HashMap;
public final class TextAttribute extends Attribute { public final class TextAttribute extends Attribute {
// table of all instances in this class, used by readResolve // table of all instances in this class, used by readResolve
private static final Map instanceMap = new HashMap(29); private static final Map<String, TextAttribute>
instanceMap = new HashMap<String, TextAttribute>(29);
/** /**
* Constructs a <code>TextAttribute</code> with the specified name. * Constructs a <code>TextAttribute</code> with the specified name.
@ -280,7 +281,7 @@ public final class TextAttribute extends Attribute {
"subclass didn't correctly implement readResolve"); "subclass didn't correctly implement readResolve");
} }
TextAttribute instance = (TextAttribute) instanceMap.get(getName()); TextAttribute instance = instanceMap.get(getName());
if (instance != null) { if (instance != null) {
return instance; return instance;
} else { } else {

View File

@ -55,6 +55,7 @@ import java.awt.geom.Rectangle2D;
import java.text.AttributedString; import java.text.AttributedString;
import java.text.AttributedCharacterIterator; import java.text.AttributedCharacterIterator;
import java.text.AttributedCharacterIterator.Attribute; import java.text.AttributedCharacterIterator.Attribute;
import java.text.CharacterIterator;
import java.util.Map; import java.util.Map;
import java.util.HashMap; import java.util.HashMap;
import java.util.Hashtable; import java.util.Hashtable;
@ -382,7 +383,7 @@ public final class TextLayout implements Cloneable {
throw new IllegalArgumentException("Zero length string passed to TextLayout constructor."); throw new IllegalArgumentException("Zero length string passed to TextLayout constructor.");
} }
Map attributes = null; Map<? extends Attribute, ?> attributes = null;
if (font.hasLayoutAttributes()) { if (font.hasLayoutAttributes()) {
attributes = font.getAttributes(); attributes = font.getAttributes();
} }
@ -451,7 +452,7 @@ public final class TextLayout implements Cloneable {
private static Font singleFont(char[] text, private static Font singleFont(char[] text,
int start, int start,
int limit, int limit,
Map attributes) { Map<? extends Attribute, ?> attributes) {
if (attributes.get(TextAttribute.CHAR_REPLACEMENT) != null) { if (attributes.get(TextAttribute.CHAR_REPLACEMENT) != null) {
return null; return null;
@ -516,14 +517,17 @@ public final class TextLayout implements Cloneable {
text.first(); text.first();
char[] chars = new char[len]; char[] chars = new char[len];
int n = 0; int n = 0;
for (char c = text.first(); c != text.DONE; c = text.next()) { for (char c = text.first();
c != CharacterIterator.DONE;
c = text.next())
{
chars[n++] = c; chars[n++] = c;
} }
text.first(); text.first();
if (text.getRunLimit() == limit) { if (text.getRunLimit() == limit) {
Map attributes = text.getAttributes(); Map<? extends Attribute, ?> attributes = text.getAttributes();
Font font = singleFont(chars, 0, len, attributes); Font font = singleFont(chars, 0, len, attributes);
if (font != null) { if (font != null) {
fastInit(chars, font, attributes, frc); fastInit(chars, font, attributes, frc);
@ -561,7 +565,9 @@ public final class TextLayout implements Cloneable {
/** /**
* Initialize the paragraph-specific data. * Initialize the paragraph-specific data.
*/ */
private void paragraphInit(byte aBaseline, CoreMetrics lm, Map paragraphAttrs, char[] text) { private void paragraphInit(byte aBaseline, CoreMetrics lm,
Map<? extends Attribute, ?> paragraphAttrs,
char[] text) {
baseline = aBaseline; baseline = aBaseline;
@ -581,7 +587,10 @@ public final class TextLayout implements Cloneable {
* all renderable by one font (ie no embedded graphics) * all renderable by one font (ie no embedded graphics)
* all on one baseline * all on one baseline
*/ */
private void fastInit(char[] chars, Font font, Map attrs, FontRenderContext frc) { private void fastInit(char[] chars, Font font,
Map<? extends Attribute, ?> attrs,
FontRenderContext frc) {
// Object vf = attrs.get(TextAttribute.ORIENTATION); // Object vf = attrs.get(TextAttribute.ORIENTATION);
// isVerticalLine = TextAttribute.ORIENTATION_VERTICAL.equals(vf); // isVerticalLine = TextAttribute.ORIENTATION_VERTICAL.equals(vf);
isVerticalLine = false; isVerticalLine = false;
@ -619,7 +628,7 @@ public final class TextLayout implements Cloneable {
// and use it and its font to initialize the paragraph. // and use it and its font to initialize the paragraph.
// If not, use the first graphic to initialize. // If not, use the first graphic to initialize.
Map paragraphAttrs = text.getAttributes(); Map<? extends Attribute, ?> paragraphAttrs = text.getAttributes();
boolean haveFont = TextLine.advanceToFirstFont(text); boolean haveFont = TextLine.advanceToFirstFont(text);

View File

@ -43,6 +43,7 @@ import java.awt.im.InputMethodHighlight;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.text.Annotation; import java.text.Annotation;
import java.text.AttributedCharacterIterator; import java.text.AttributedCharacterIterator;
import java.text.AttributedCharacterIterator.Attribute;
import java.text.Bidi; import java.text.Bidi;
import java.text.CharacterIterator; import java.text.CharacterIterator;
import java.util.Hashtable; import java.util.Hashtable;
@ -318,7 +319,8 @@ final class TextLine {
for (int i = 0, n = 0; i < fComponents.length; ++i, n += 2) { for (int i = 0, n = 0; i < fComponents.length; ++i, n += 2) {
tlc = fComponents[getComponentLogicalIndex(i)]; tlc = fComponents[getComponentLogicalIndex(i)];
AffineTransform at = tlc.getBaselineTransform(); AffineTransform at = tlc.getBaselineTransform();
if (at != null && ((at.getType() & at.TYPE_TRANSLATION) != 0)) { if (at != null &&
((at.getType() & AffineTransform.TYPE_TRANSLATION) != 0)) {
double dx = at.getTranslateX(); double dx = at.getTranslateX();
double dy = at.getTranslateY(); double dy = at.getTranslateY();
builder.moveTo(tx += dx, ty += dy); builder.moveTo(tx += dx, ty += dy);
@ -903,7 +905,7 @@ final class TextLine {
char[] chars, char[] chars,
Font font, Font font,
CoreMetrics lm, CoreMetrics lm,
Map attributes) { Map<? extends Attribute, ?> attributes) {
boolean isDirectionLTR = true; boolean isDirectionLTR = true;
byte[] levels = null; byte[] levels = null;
@ -1250,7 +1252,10 @@ final class TextLine {
*/ */
static boolean advanceToFirstFont(AttributedCharacterIterator aci) { static boolean advanceToFirstFont(AttributedCharacterIterator aci) {
for (char ch = aci.first(); ch != aci.DONE; ch = aci.setIndex(aci.getRunLimit())) { for (char ch = aci.first();
ch != CharacterIterator.DONE;
ch = aci.setIndex(aci.getRunLimit()))
{
if (aci.getAttribute(TextAttribute.CHAR_REPLACEMENT) == null) { if (aci.getAttribute(TextAttribute.CHAR_REPLACEMENT) == null) {
return true; return true;

View File

@ -43,6 +43,7 @@ package java.awt.font;
import java.awt.Font; import java.awt.Font;
import java.text.AttributedCharacterIterator; import java.text.AttributedCharacterIterator;
import java.text.AttributedCharacterIterator.Attribute;
import java.text.AttributedString; import java.text.AttributedString;
import java.text.Bidi; import java.text.Bidi;
import java.text.BreakIterator; import java.text.BreakIterator;
@ -176,7 +177,7 @@ public final class TextMeasurer implements Cloneable {
throw new Error(); throw new Error();
} }
if (fComponents != null) { if (fComponents != null) {
other.fComponents = (TextLineComponent[]) fComponents.clone(); other.fComponents = fComponents.clone();
} }
return other; return other;
} }
@ -199,7 +200,10 @@ public final class TextMeasurer implements Cloneable {
fChars = new char[text.getEndIndex() - fStart]; fChars = new char[text.getEndIndex() - fStart];
int n = 0; int n = 0;
for (char c = text.first(); c != text.DONE; c = text.next()) { for (char c = text.first();
c != CharacterIterator.DONE;
c = text.next())
{
fChars[n++] = c; fChars[n++] = c;
} }
@ -211,7 +215,7 @@ public final class TextMeasurer implements Cloneable {
} }
text.first(); text.first();
Map paragraphAttrs = text.getAttributes(); Map<? extends Attribute, ?> paragraphAttrs = text.getAttributes();
NumericShaper shaper = AttributeValues.getNumericShaping(paragraphAttrs); NumericShaper shaper = AttributeValues.getNumericShaping(paragraphAttrs);
if (shaper != null) { if (shaper != null) {
shaper.shape(fChars, 0, fChars.length); shaper.shape(fChars, 0, fChars.length);
@ -243,7 +247,8 @@ public final class TextMeasurer implements Cloneable {
GraphicAttribute graphic = (GraphicAttribute) GraphicAttribute graphic = (GraphicAttribute)
paragraphAttrs.get(TextAttribute.CHAR_REPLACEMENT); paragraphAttrs.get(TextAttribute.CHAR_REPLACEMENT);
fBaseline = TextLayout.getBaselineFromGraphic(graphic); fBaseline = TextLayout.getBaselineFromGraphic(graphic);
Font dummyFont = new Font(new Hashtable(5, (float)0.9)); Hashtable<Attribute, ?> fmap = new Hashtable<>(5, (float)0.9);
Font dummyFont = new Font(fmap);
LineMetrics lm = dummyFont.getLineMetrics(" ", 0, 1, fFrc); LineMetrics lm = dummyFont.getLineMetrics(" ", 0, 1, fFrc);
fBaselineOffsets = lm.getBaselineOffsets(); fBaselineOffsets = lm.getBaselineOffsets();
} }

View File

@ -667,7 +667,8 @@ public abstract class Path2D implements Shape, Cloneable {
// Collapse out initial moveto/lineto // Collapse out initial moveto/lineto
break; break;
} }
// NO BREAK; lineTo(coords[0], coords[1]);
break;
case SEG_LINETO: case SEG_LINETO:
lineTo(coords[0], coords[1]); lineTo(coords[0], coords[1]);
break; break;
@ -1392,7 +1393,8 @@ public abstract class Path2D implements Shape, Cloneable {
// Collapse out initial moveto/lineto // Collapse out initial moveto/lineto
break; break;
} }
// NO BREAK; lineTo(coords[0], coords[1]);
break;
case SEG_LINETO: case SEG_LINETO:
lineTo(coords[0], coords[1]); lineTo(coords[0], coords[1]);
break; break;
@ -2456,7 +2458,7 @@ public abstract class Path2D implements Shape, Cloneable {
} }
} }
} }
s.writeByte((byte) SERIAL_PATH_END); s.writeByte(SERIAL_PATH_END);
} }
final void readObject(java.io.ObjectInputStream s, boolean storedbl) final void readObject(java.io.ObjectInputStream s, boolean storedbl)

View File

@ -190,6 +190,6 @@ public class InputMethodHighlight {
private boolean selected; private boolean selected;
private int state; private int state;
private int variation; private int variation;
private Map style; private Map<TextAttribute, ?> style;
}; };

View File

@ -37,8 +37,8 @@ import java.lang.ref.Reference;
public class BeanDescriptor extends FeatureDescriptor { public class BeanDescriptor extends FeatureDescriptor {
private Reference<Class> beanClassRef; private Reference<? extends Class<?>> beanClassRef;
private Reference<Class> customizerClassRef; private Reference<? extends Class<?>> customizerClassRef;
/** /**
* Create a BeanDescriptor for a bean that doesn't have a customizer. * Create a BeanDescriptor for a bean that doesn't have a customizer.
@ -59,8 +59,8 @@ public class BeanDescriptor extends FeatureDescriptor {
* the bean's Customizer. For example sun.beans.OurButtonCustomizer.class. * the bean's Customizer. For example sun.beans.OurButtonCustomizer.class.
*/ */
public BeanDescriptor(Class<?> beanClass, Class<?> customizerClass) { public BeanDescriptor(Class<?> beanClass, Class<?> customizerClass) {
this.beanClassRef = getWeakReference((Class)beanClass); this.beanClassRef = getWeakReference(beanClass);
this.customizerClassRef = getWeakReference((Class)customizerClass); this.customizerClassRef = getWeakReference(customizerClass);
String name = beanClass.getName(); String name = beanClass.getName();
while (name.indexOf('.') >= 0) { while (name.indexOf('.') >= 0) {

View File

@ -32,7 +32,6 @@ import java.applet.AppletContext;
import java.applet.AppletStub; import java.applet.AppletStub;
import java.applet.AudioClip; import java.applet.AudioClip;
import java.awt.GraphicsEnvironment;
import java.awt.Image; import java.awt.Image;
import java.beans.beancontext.BeanContext; import java.beans.beancontext.BeanContext;
@ -53,15 +52,11 @@ import java.util.Hashtable;
import java.util.Iterator; import java.util.Iterator;
import java.util.Vector; import java.util.Vector;
import sun.awt.AppContext;
/** /**
* This class provides some general purpose beans control methods. * This class provides some general purpose beans control methods.
*/ */
public class Beans { public class Beans {
private static final Object DESIGN_TIME = new Object();
private static final Object GUI_AVAILABLE = new Object();
/** /**
* <p> * <p>
@ -181,9 +176,9 @@ public class Beans {
// Try to find a serialized object with this name // Try to find a serialized object with this name
final String serName = beanName.replace('.','/').concat(".ser"); final String serName = beanName.replace('.','/').concat(".ser");
final ClassLoader loader = cls; final ClassLoader loader = cls;
ins = (InputStream)AccessController.doPrivileged ins = AccessController.doPrivileged
(new PrivilegedAction() { (new PrivilegedAction<InputStream>() {
public Object run() { public InputStream run() {
if (loader == null) if (loader == null)
return ClassLoader.getSystemResourceAsStream(serName); return ClassLoader.getSystemResourceAsStream(serName);
else else
@ -213,7 +208,7 @@ public class Beans {
if (result == null) { if (result == null) {
// No serialized object, try just instantiating the class // No serialized object, try just instantiating the class
Class cl; Class<?> cl;
try { try {
cl = ClassFinder.findClass(beanName, cls); cl = ClassFinder.findClass(beanName, cls);
@ -278,10 +273,10 @@ public class Beans {
// Now get the URL correponding to the resource name. // Now get the URL correponding to the resource name.
final ClassLoader cloader = cls; final ClassLoader cloader = cls;
objectUrl = (URL) objectUrl =
AccessController.doPrivileged AccessController.doPrivileged
(new PrivilegedAction() { (new PrivilegedAction<URL>() {
public Object run() { public URL run() {
if (cloader == null) if (cloader == null)
return ClassLoader.getSystemResource return ClassLoader.getSystemResource
(resourceName); (resourceName);
@ -326,7 +321,7 @@ public class Beans {
// now, if there is a BeanContext, add the bean, if applicable. // now, if there is a BeanContext, add the bean, if applicable.
if (beanContext != null) { if (beanContext != null) {
beanContext.add(result); unsafeBeanContextAdd(beanContext, result);
} }
// If it was deserialized then it was already init-ed. // If it was deserialized then it was already init-ed.
@ -344,12 +339,16 @@ public class Beans {
((BeansAppletStub)stub).active = true; ((BeansAppletStub)stub).active = true;
} else initializer.activate(applet); } else initializer.activate(applet);
} else if (beanContext != null) beanContext.add(result); } else if (beanContext != null) unsafeBeanContextAdd(beanContext, result);
} }
return result; return result;
} }
@SuppressWarnings("unchecked")
private static void unsafeBeanContextAdd(BeanContext beanContext, Object res) {
beanContext.add(res);
}
/** /**
* From a given bean, obtain an object representing a specified * From a given bean, obtain an object representing a specified
@ -395,8 +394,7 @@ public class Beans {
* @see DesignMode * @see DesignMode
*/ */
public static boolean isDesignTime() { public static boolean isDesignTime() {
Object value = AppContext.getAppContext().get(DESIGN_TIME); return ThreadGroupContext.getContext().isDesignTime();
return (value instanceof Boolean) && (Boolean) value;
} }
/** /**
@ -413,8 +411,7 @@ public class Beans {
* *
*/ */
public static boolean isGuiAvailable() { public static boolean isGuiAvailable() {
Object value = AppContext.getAppContext().get(GUI_AVAILABLE); return ThreadGroupContext.getContext().isGuiAvailable();
return (value instanceof Boolean) ? (Boolean) value : !GraphicsEnvironment.isHeadless();
} }
/** /**
@ -440,7 +437,7 @@ public class Beans {
if (sm != null) { if (sm != null) {
sm.checkPropertiesAccess(); sm.checkPropertiesAccess();
} }
AppContext.getAppContext().put(DESIGN_TIME, Boolean.valueOf(isDesignTime)); ThreadGroupContext.getContext().setDesignTime(isDesignTime);
} }
/** /**
@ -466,7 +463,7 @@ public class Beans {
if (sm != null) { if (sm != null) {
sm.checkPropertiesAccess(); sm.checkPropertiesAccess();
} }
AppContext.getAppContext().put(GUI_AVAILABLE, Boolean.valueOf(isGuiAvailable)); ThreadGroupContext.getContext().setGuiAvailable(isGuiAvailable);
} }
} }
@ -496,6 +493,7 @@ class ObjectInputStreamWithLoader extends ObjectInputStream
/** /**
* Use the given ClassLoader rather than using the system class * Use the given ClassLoader rather than using the system class
*/ */
@SuppressWarnings("rawtypes")
protected Class resolveClass(ObjectStreamClass classDesc) protected Class resolveClass(ObjectStreamClass classDesc)
throws IOException, ClassNotFoundException { throws IOException, ClassNotFoundException {
@ -511,7 +509,7 @@ class ObjectInputStreamWithLoader extends ObjectInputStream
class BeansAppletContext implements AppletContext { class BeansAppletContext implements AppletContext {
Applet target; Applet target;
Hashtable imageCache = new Hashtable(); Hashtable<URL,Object> imageCache = new Hashtable<>();
BeansAppletContext(Applet target) { BeansAppletContext(Applet target) {
this.target = target; this.target = target;
@ -556,8 +554,8 @@ class BeansAppletContext implements AppletContext {
return null; return null;
} }
public Enumeration getApplets() { public Enumeration<Applet> getApplets() {
Vector applets = new Vector(); Vector<Applet> applets = new Vector<>();
applets.addElement(target); applets.addElement(target);
return applets.elements(); return applets.elements();
} }
@ -583,7 +581,7 @@ class BeansAppletContext implements AppletContext {
return null; return null;
} }
public Iterator getStreamKeys(){ public Iterator<String> getStreamKeys(){
// We do nothing. // We do nothing.
return null; return null;
} }

View File

@ -76,7 +76,7 @@ abstract class ChangeListenerMap<L extends EventListener> {
*/ */
public final synchronized void add(String name, L listener) { public final synchronized void add(String name, L listener) {
if (this.map == null) { if (this.map == null) {
this.map = new HashMap<String, L[]>(); this.map = new HashMap<>();
} }
L[] array = this.map.get(name); L[] array = this.map.get(name);
int size = (array != null) int size = (array != null)
@ -146,7 +146,7 @@ abstract class ChangeListenerMap<L extends EventListener> {
public final void set(String name, L[] listeners) { public final void set(String name, L[] listeners) {
if (listeners != null) { if (listeners != null) {
if (this.map == null) { if (this.map == null) {
this.map = new HashMap<String, L[]>(); this.map = new HashMap<>();
} }
this.map.put(name, listeners); this.map.put(name, listeners);
} }
@ -167,7 +167,7 @@ abstract class ChangeListenerMap<L extends EventListener> {
if (this.map == null) { if (this.map == null) {
return newArray(0); return newArray(0);
} }
List<L> list = new ArrayList<L>(); List<L> list = new ArrayList<>();
L[] listeners = this.map.get(null); L[] listeners = this.map.get(null);
if (listeners != null) { if (listeners != null) {
@ -239,6 +239,7 @@ abstract class ChangeListenerMap<L extends EventListener> {
*/ */
public final L extract(L listener) { public final L extract(L listener) {
while (listener instanceof EventListenerProxy) { while (listener instanceof EventListenerProxy) {
@SuppressWarnings("unchecked")
EventListenerProxy<L> proxy = (EventListenerProxy<L>) listener; EventListenerProxy<L> proxy = (EventListenerProxy<L>) listener;
listener = proxy.getListener(); listener = proxy.getListener();
} }

View File

@ -95,7 +95,7 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate {
this.constructor = constructorPropertyNames; this.constructor = constructorPropertyNames;
} }
private static boolean definesEquals(Class type) { private static boolean definesEquals(Class<?> type) {
try { try {
return type == type.getMethod("equals", Object.class).getDeclaringClass(); return type == type.getMethod("equals", Object.class).getDeclaringClass();
} }
@ -153,7 +153,7 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate {
*/ */
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
int nArgs = constructor.length; int nArgs = constructor.length;
Class type = oldInstance.getClass(); Class<?> type = oldInstance.getClass();
Object[] constructorArgs = new Object[nArgs]; Object[] constructorArgs = new Object[nArgs];
for(int i = 0; i < nArgs; i++) { for(int i = 0; i < nArgs; i++) {
try { try {
@ -167,7 +167,7 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate {
return new Expression(oldInstance, oldInstance.getClass(), "new", constructorArgs); return new Expression(oldInstance, oldInstance.getClass(), "new", constructorArgs);
} }
private Method findMethod(Class type, String property) { private Method findMethod(Class<?> type, String property) {
if (property == null) { if (property == null) {
throw new IllegalArgumentException("Property name is null"); throw new IllegalArgumentException("Property name is null");
} }
@ -182,7 +182,7 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate {
return method; return method;
} }
private void doProperty(Class type, PropertyDescriptor pd, Object oldInstance, Object newInstance, Encoder out) throws Exception { private void doProperty(Class<?> type, PropertyDescriptor pd, Object oldInstance, Object newInstance, Encoder out) throws Exception {
Method getter = pd.getReadMethod(); Method getter = pd.getReadMethod();
Method setter = pd.getWriteMethod(); Method setter = pd.getWriteMethod();
@ -218,7 +218,7 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate {
} }
// Write out the properties of this instance. // Write out the properties of this instance.
private void initBean(Class type, Object oldInstance, Object newInstance, Encoder out) { private void initBean(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
for (Field field : type.getFields()) { for (Field field : type.getFields()) {
int mod = field.getModifiers(); int mod = field.getModifiers();
if (Modifier.isFinal(mod) || Modifier.isStatic(mod) || Modifier.isTransient(mod)) { if (Modifier.isFinal(mod) || Modifier.isStatic(mod) || Modifier.isTransient(mod)) {
@ -288,7 +288,7 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate {
if (d.isTransient()) { if (d.isTransient()) {
continue; continue;
} }
Class listenerType = d.getListenerType(); Class<?> listenerType = d.getListenerType();
// The ComponentListener is added automatically, when // The ComponentListener is added automatically, when
@ -318,7 +318,7 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate {
} }
catch (Exception e2) { catch (Exception e2) {
try { try {
Method m = type.getMethod("getListeners", new Class[]{Class.class}); Method m = type.getMethod("getListeners", new Class<?>[]{Class.class});
oldL = (EventListener[])MethodUtil.invoke(m, oldInstance, new Object[]{listenerType}); oldL = (EventListener[])MethodUtil.invoke(m, oldInstance, new Object[]{listenerType});
newL = (EventListener[])MethodUtil.invoke(m, newInstance, new Object[]{listenerType}); newL = (EventListener[])MethodUtil.invoke(m, newInstance, new Object[]{listenerType});
} }
@ -401,7 +401,7 @@ public class DefaultPersistenceDelegate extends PersistenceDelegate {
} }
} }
private static PropertyDescriptor getPropertyDescriptor(Class type, String property) { private static PropertyDescriptor getPropertyDescriptor(Class<?> type, String property) {
try { try {
for (PropertyDescriptor pd : Introspector.getBeanInfo(type).getPropertyDescriptors()) { for (PropertyDescriptor pd : Introspector.getBeanInfo(type).getPropertyDescriptors()) {
if (property.equals(pd.getName())) if (property.equals(pd.getName()))

View File

@ -47,10 +47,10 @@ import java.util.Map;
public class Encoder { public class Encoder {
private final PersistenceDelegateFinder finder = new PersistenceDelegateFinder(); private final PersistenceDelegateFinder finder = new PersistenceDelegateFinder();
private Map bindings = new IdentityHashMap(); private Map<Object, Expression> bindings = new IdentityHashMap<>();
private ExceptionListener exceptionListener; private ExceptionListener exceptionListener;
boolean executeStatements = true; boolean executeStatements = true;
private Map attributes; private Map<Object, Object> attributes;
/** /**
* Write the specified object to the output stream. * Write the specified object to the output stream.
@ -195,7 +195,13 @@ public class Encoder {
*/ */
public PersistenceDelegate getPersistenceDelegate(Class<?> type) { public PersistenceDelegate getPersistenceDelegate(Class<?> type) {
PersistenceDelegate pd = this.finder.find(type); PersistenceDelegate pd = this.finder.find(type);
return (pd != null) ? pd : MetaData.getPersistenceDelegate(type); if (pd == null) {
pd = MetaData.getPersistenceDelegate(type);
if (pd != null) {
this.finder.register(type, pd);
}
}
return pd;
} }
/** /**
@ -221,7 +227,7 @@ public class Encoder {
* @see #get * @see #get
*/ */
public Object remove(Object oldInstance) { public Object remove(Object oldInstance) {
Expression exp = (Expression)bindings.remove(oldInstance); Expression exp = bindings.remove(oldInstance);
return getValue(exp); return getValue(exp);
} }
@ -242,7 +248,7 @@ public class Encoder {
oldInstance.getClass() == String.class) { oldInstance.getClass() == String.class) {
return oldInstance; return oldInstance;
} }
Expression exp = (Expression)bindings.get(oldInstance); Expression exp = bindings.get(oldInstance);
return getValue(exp); return getValue(exp);
} }
@ -331,7 +337,7 @@ public class Encoder {
// Package private method for setting an attributes table for the encoder // Package private method for setting an attributes table for the encoder
void setAttribute(Object key, Object value) { void setAttribute(Object key, Object value) {
if (attributes == null) { if (attributes == null) {
attributes = new HashMap(); attributes = new HashMap<>();
} }
attributes.put(key, value); attributes.put(key, value);
} }

View File

@ -385,14 +385,14 @@ public class EventHandler implements InvocationHandler {
if (target != null) { if (target != null) {
getter = Statement.getMethod(target.getClass(), getter = Statement.getMethod(target.getClass(),
"get" + NameGenerator.capitalize(first), "get" + NameGenerator.capitalize(first),
new Class[]{}); new Class<?>[]{});
if (getter == null) { if (getter == null) {
getter = Statement.getMethod(target.getClass(), getter = Statement.getMethod(target.getClass(),
"is" + NameGenerator.capitalize(first), "is" + NameGenerator.capitalize(first),
new Class[]{}); new Class<?>[]{});
} }
if (getter == null) { if (getter == null) {
getter = Statement.getMethod(target.getClass(), first, new Class[]{}); getter = Statement.getMethod(target.getClass(), first, new Class<?>[]{});
} }
} }
if (getter == null) { if (getter == null) {
@ -450,12 +450,12 @@ public class EventHandler implements InvocationHandler {
if (eventPropertyName == null) { // Nullary method. if (eventPropertyName == null) { // Nullary method.
newArgs = new Object[]{}; newArgs = new Object[]{};
argTypes = new Class[]{}; argTypes = new Class<?>[]{};
} }
else { else {
Object input = applyGetters(arguments[0], getEventPropertyName()); Object input = applyGetters(arguments[0], getEventPropertyName());
newArgs = new Object[]{input}; newArgs = new Object[]{input};
argTypes = new Class[]{input == null ? null : argTypes = new Class<?>[]{input == null ? null :
input.getClass()}; input.getClass()};
} }
try { try {
@ -674,6 +674,7 @@ public class EventHandler implements InvocationHandler {
* *
* @see EventHandler * @see EventHandler
*/ */
@SuppressWarnings("unchecked")
public static <T> T create(Class<T> listenerInterface, public static <T> T create(Class<T> listenerInterface,
Object target, String action, Object target, String action,
String eventPropertyName, String eventPropertyName,
@ -688,7 +689,7 @@ public class EventHandler implements InvocationHandler {
"listenerInterface must be non-null"); "listenerInterface must be non-null");
} }
return (T)Proxy.newProxyInstance(target.getClass().getClassLoader(), return (T)Proxy.newProxyInstance(target.getClass().getClassLoader(),
new Class[] {listenerInterface}, new Class<?>[] {listenerInterface},
eventHandler); eventHandler);
} }
} }

View File

@ -45,7 +45,7 @@ public class EventSetDescriptor extends FeatureDescriptor {
private MethodDescriptor getMethodDescriptor; private MethodDescriptor getMethodDescriptor;
private Reference<Method[]> listenerMethodsRef; private Reference<Method[]> listenerMethodsRef;
private Reference<Class> listenerTypeRef; private Reference<? extends Class<?>> listenerTypeRef;
private boolean unicast; private boolean unicast;
private boolean inDefaultEventSet = true; private boolean inDefaultEventSet = true;
@ -91,7 +91,7 @@ public class EventSetDescriptor extends FeatureDescriptor {
} }
} }
private static String getListenerClassName(Class cls) { private static String getListenerClassName(Class<?> cls) {
String className = cls.getName(); String className = cls.getName();
return className.substring(className.lastIndexOf('.') + 1); return className.substring(className.lastIndexOf('.') + 1);
} }
@ -182,7 +182,7 @@ public class EventSetDescriptor extends FeatureDescriptor {
} }
} }
private static Method getMethod(Class cls, String name, int args) private static Method getMethod(Class<?> cls, String name, int args)
throws IntrospectionException { throws IntrospectionException {
if (name == null) { if (name == null) {
return null; return null;
@ -295,7 +295,7 @@ public class EventSetDescriptor extends FeatureDescriptor {
: null; : null;
} }
private void setListenerType(Class cls) { private void setListenerType(Class<?> cls) {
this.listenerTypeRef = getWeakReference(cls); this.listenerTypeRef = getWeakReference(cls);
} }

View File

@ -51,7 +51,7 @@ import java.util.Map.Entry;
public class FeatureDescriptor { public class FeatureDescriptor {
private static final String TRANSIENT = "transient"; private static final String TRANSIENT = "transient";
private Reference<Class> classRef; private Reference<? extends Class<?>> classRef;
/** /**
* Constructs a <code>FeatureDescriptor</code>. * Constructs a <code>FeatureDescriptor</code>.
@ -284,7 +284,7 @@ public class FeatureDescriptor {
*/ */
private Hashtable<String, Object> getTable() { private Hashtable<String, Object> getTable() {
if (this.table == null) { if (this.table == null) {
this.table = new Hashtable<String, Object>(); this.table = new Hashtable<>();
} }
return this.table; return this.table;
} }
@ -317,11 +317,11 @@ public class FeatureDescriptor {
// Package private methods for recreating the weak/soft referent // Package private methods for recreating the weak/soft referent
void setClass0(Class cls) { void setClass0(Class<?> cls) {
this.classRef = getWeakReference(cls); this.classRef = getWeakReference(cls);
} }
Class getClass0() { Class<?> getClass0() {
return (this.classRef != null) return (this.classRef != null)
? this.classRef.get() ? this.classRef.get()
: null; : null;
@ -336,7 +336,7 @@ public class FeatureDescriptor {
*/ */
static <T> Reference<T> getSoftReference(T object) { static <T> Reference<T> getSoftReference(T object) {
return (object != null) return (object != null)
? new SoftReference<T>(object) ? new SoftReference<>(object)
: null; : null;
} }
@ -349,7 +349,7 @@ public class FeatureDescriptor {
*/ */
static <T> Reference<T> getWeakReference(T object) { static <T> Reference<T> getWeakReference(T object) {
return (object != null) return (object != null)
? new WeakReference<T>(object) ? new WeakReference<>(object)
: null; : null;
} }
@ -363,7 +363,7 @@ public class FeatureDescriptor {
* @see Method#getGenericReturnType * @see Method#getGenericReturnType
* @see Method#getReturnType * @see Method#getReturnType
*/ */
static Class getReturnType(Class base, Method method) { static Class<?> getReturnType(Class<?> base, Method method) {
if (base == null) { if (base == null) {
base = method.getDeclaringClass(); base = method.getDeclaringClass();
} }
@ -380,7 +380,7 @@ public class FeatureDescriptor {
* @see Method#getGenericParameterTypes * @see Method#getGenericParameterTypes
* @see Method#getParameterTypes * @see Method#getParameterTypes
*/ */
static Class[] getParameterTypes(Class base, Method method) { static Class<?>[] getParameterTypes(Class<?> base, Method method) {
if (base == null) { if (base == null) {
base = method.getDeclaringClass(); base = method.getDeclaringClass();
} }
@ -425,7 +425,7 @@ public class FeatureDescriptor {
void appendTo(StringBuilder sb) { void appendTo(StringBuilder sb) {
} }
static void appendTo(StringBuilder sb, String name, Reference reference) { static void appendTo(StringBuilder sb, String name, Reference<?> reference) {
if (reference != null) { if (reference != null) {
appendTo(sb, name, reference.get()); appendTo(sb, name, reference.get());
} }

View File

@ -40,7 +40,7 @@ import java.lang.reflect.Method;
public class IndexedPropertyDescriptor extends PropertyDescriptor { public class IndexedPropertyDescriptor extends PropertyDescriptor {
private Reference<Class> indexedPropertyTypeRef; private Reference<? extends Class<?>> indexedPropertyTypeRef;
private Reference<Method> indexedReadMethodRef; private Reference<Method> indexedReadMethodRef;
private Reference<Method> indexedWriteMethodRef; private Reference<Method> indexedWriteMethodRef;
@ -175,14 +175,14 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor {
public synchronized Method getIndexedReadMethod() { public synchronized Method getIndexedReadMethod() {
Method indexedReadMethod = getIndexedReadMethod0(); Method indexedReadMethod = getIndexedReadMethod0();
if (indexedReadMethod == null) { if (indexedReadMethod == null) {
Class cls = getClass0(); Class<?> cls = getClass0();
if (cls == null || if (cls == null ||
(indexedReadMethodName == null && indexedReadMethodRef == null)) { (indexedReadMethodName == null && indexedReadMethodRef == null)) {
// the Indexed readMethod was explicitly set to null. // the Indexed readMethod was explicitly set to null.
return null; return null;
} }
if (indexedReadMethodName == null) { if (indexedReadMethodName == null) {
Class type = getIndexedPropertyType0(); Class<?> type = getIndexedPropertyType0();
if (type == boolean.class || type == null) { if (type == boolean.class || type == null) {
indexedReadMethodName = Introspector.IS_PREFIX + getBaseName(); indexedReadMethodName = Introspector.IS_PREFIX + getBaseName();
} else { } else {
@ -190,7 +190,7 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor {
} }
} }
Class[] args = { int.class }; Class<?>[] args = { int.class };
indexedReadMethod = Introspector.findMethod(cls, indexedReadMethodName, 1, args); indexedReadMethod = Introspector.findMethod(cls, indexedReadMethodName, 1, args);
if (indexedReadMethod == null) { if (indexedReadMethod == null) {
// no "is" method, so look for a "get" method. // no "is" method, so look for a "get" method.
@ -240,7 +240,7 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor {
public synchronized Method getIndexedWriteMethod() { public synchronized Method getIndexedWriteMethod() {
Method indexedWriteMethod = getIndexedWriteMethod0(); Method indexedWriteMethod = getIndexedWriteMethod0();
if (indexedWriteMethod == null) { if (indexedWriteMethod == null) {
Class cls = getClass0(); Class<?> cls = getClass0();
if (cls == null || if (cls == null ||
(indexedWriteMethodName == null && indexedWriteMethodRef == null)) { (indexedWriteMethodName == null && indexedWriteMethodRef == null)) {
// the Indexed writeMethod was explicitly set to null. // the Indexed writeMethod was explicitly set to null.
@ -250,14 +250,14 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor {
// We need the indexed type to ensure that we get the correct method. // We need the indexed type to ensure that we get the correct method.
// Cannot use the getIndexedPropertyType method since that could // Cannot use the getIndexedPropertyType method since that could
// result in an infinite loop. // result in an infinite loop.
Class type = getIndexedPropertyType0(); Class<?> type = getIndexedPropertyType0();
if (type == null) { if (type == null) {
try { try {
type = findIndexedPropertyType(getIndexedReadMethod(), null); type = findIndexedPropertyType(getIndexedReadMethod(), null);
setIndexedPropertyType(type); setIndexedPropertyType(type);
} catch (IntrospectionException ex) { } catch (IntrospectionException ex) {
// Set iprop type to be the classic type // Set iprop type to be the classic type
Class propType = getPropertyType(); Class<?> propType = getPropertyType();
if (propType.isArray()) { if (propType.isArray()) {
type = propType.getComponentType(); type = propType.getComponentType();
} }
@ -268,7 +268,7 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor {
indexedWriteMethodName = Introspector.SET_PREFIX + getBaseName(); indexedWriteMethodName = Introspector.SET_PREFIX + getBaseName();
} }
Class[] args = (type == null) ? null : new Class[] { int.class, type }; Class<?>[] args = (type == null) ? null : new Class<?>[] { int.class, type };
indexedWriteMethod = Introspector.findMethod(cls, indexedWriteMethodName, 2, args); indexedWriteMethod = Introspector.findMethod(cls, indexedWriteMethodName, 2, args);
if (indexedWriteMethod != null) { if (indexedWriteMethod != null) {
if (!indexedWriteMethod.getReturnType().equals(void.class)) { if (!indexedWriteMethod.getReturnType().equals(void.class)) {
@ -289,7 +289,7 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor {
throws IntrospectionException { throws IntrospectionException {
// If the indexed property type has not been set, then set it. // If the indexed property type has not been set, then set it.
Class type = findIndexedPropertyType(getIndexedReadMethod(), Class<?> type = findIndexedPropertyType(getIndexedReadMethod(),
writeMethod); writeMethod);
setIndexedPropertyType(type); setIndexedPropertyType(type);
setIndexedWriteMethod0(writeMethod); setIndexedWriteMethod0(writeMethod);
@ -319,7 +319,7 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor {
* or {@code null} if the type cannot be determined * or {@code null} if the type cannot be determined
*/ */
public synchronized Class<?> getIndexedPropertyType() { public synchronized Class<?> getIndexedPropertyType() {
Class type = getIndexedPropertyType0(); Class<?> type = getIndexedPropertyType0();
if (type == null) { if (type == null) {
try { try {
type = findIndexedPropertyType(getIndexedReadMethod(), type = findIndexedPropertyType(getIndexedReadMethod(),
@ -334,11 +334,11 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor {
// Private methods which set get/set the Reference objects // Private methods which set get/set the Reference objects
private void setIndexedPropertyType(Class type) { private void setIndexedPropertyType(Class<?> type) {
this.indexedPropertyTypeRef = getWeakReference(type); this.indexedPropertyTypeRef = getWeakReference(type);
} }
private Class getIndexedPropertyType0() { private Class<?> getIndexedPropertyType0() {
return (this.indexedPropertyTypeRef != null) return (this.indexedPropertyTypeRef != null)
? this.indexedPropertyTypeRef.get() ? this.indexedPropertyTypeRef.get()
: null; : null;
@ -356,10 +356,10 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor {
: null; : null;
} }
private Class findIndexedPropertyType(Method indexedReadMethod, private Class<?> findIndexedPropertyType(Method indexedReadMethod,
Method indexedWriteMethod) Method indexedWriteMethod)
throws IntrospectionException { throws IntrospectionException {
Class indexedPropertyType = null; Class<?> indexedPropertyType = null;
if (indexedReadMethod != null) { if (indexedReadMethod != null) {
Class params[] = getParameterTypes(getClass0(), indexedReadMethod); Class params[] = getParameterTypes(getClass0(), indexedReadMethod);
@ -389,7 +389,7 @@ public class IndexedPropertyDescriptor extends PropertyDescriptor {
} }
indexedPropertyType = params[1]; indexedPropertyType = params[1];
} }
Class propertyType = getPropertyType(); Class<?> propertyType = getPropertyType();
if (propertyType != null && (!propertyType.isArray() || if (propertyType != null && (!propertyType.isArray() ||
propertyType.getComponentType() != indexedPropertyType)) { propertyType.getComponentType() != indexedPropertyType)) {
throw new IntrospectionException("type mismatch between indexed and non-indexed methods: " throw new IntrospectionException("type mismatch between indexed and non-indexed methods: "

View File

@ -26,7 +26,6 @@
package java.beans; package java.beans;
import com.sun.beans.WeakCache; import com.sun.beans.WeakCache;
import com.sun.beans.finder.BeanInfoFinder;
import com.sun.beans.finder.ClassFinder; import com.sun.beans.finder.ClassFinder;
import java.awt.Component; import java.awt.Component;
@ -44,9 +43,7 @@ import java.util.EventListener;
import java.util.EventObject; import java.util.EventObject;
import java.util.List; import java.util.List;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.WeakHashMap;
import sun.awt.AppContext;
import sun.reflect.misc.ReflectUtil; import sun.reflect.misc.ReflectUtil;
/** /**
@ -98,18 +95,15 @@ public class Introspector {
public final static int IGNORE_ALL_BEANINFO = 3; public final static int IGNORE_ALL_BEANINFO = 3;
// Static Caches to speed up introspection. // Static Caches to speed up introspection.
private static WeakCache<Class<?>, Method[]> declaredMethodCache = private static final WeakCache<Class<?>, Method[]> declaredMethodCache = new WeakCache<>();
new WeakCache<Class<?>, Method[]>();
private static final Object BEANINFO_CACHE = new Object(); private Class<?> beanClass;
private Class beanClass;
private BeanInfo explicitBeanInfo; private BeanInfo explicitBeanInfo;
private BeanInfo superBeanInfo; private BeanInfo superBeanInfo;
private BeanInfo additionalBeanInfo[]; private BeanInfo additionalBeanInfo[];
private boolean propertyChangeSource = false; private boolean propertyChangeSource = false;
private static Class eventListenerType = EventListener.class; private static Class<EventListener> eventListenerType = EventListener.class;
// These should be removed. // These should be removed.
private String defaultEventName; private String defaultEventName;
@ -117,14 +111,14 @@ public class Introspector {
private int defaultEventIndex = -1; private int defaultEventIndex = -1;
private int defaultPropertyIndex = -1; private int defaultPropertyIndex = -1;
// Methods maps from Method objects to MethodDescriptors // Methods maps from Method names to MethodDescriptors
private Map methods; private Map<String, MethodDescriptor> methods;
// properties maps from String names to PropertyDescriptors // properties maps from String names to PropertyDescriptors
private Map properties; private Map<String, PropertyDescriptor> properties;
// events maps from String names to EventSetDescriptors // events maps from String names to EventSetDescriptors
private Map events; private Map<String, EventSetDescriptor> events;
private final static EventSetDescriptor[] EMPTY_EVENTSETDESCRIPTORS = new EventSetDescriptor[0]; private final static EventSetDescriptor[] EMPTY_EVENTSETDESCRIPTORS = new EventSetDescriptor[0];
@ -134,8 +128,6 @@ public class Introspector {
static final String SET_PREFIX = "set"; static final String SET_PREFIX = "set";
static final String IS_PREFIX = "is"; static final String IS_PREFIX = "is";
private static final Object FINDER_KEY = new Object();
//====================================================================== //======================================================================
// Public methods // Public methods
//====================================================================== //======================================================================
@ -160,20 +152,15 @@ public class Introspector {
if (!ReflectUtil.isPackageAccessible(beanClass)) { if (!ReflectUtil.isPackageAccessible(beanClass)) {
return (new Introspector(beanClass, null, USE_ALL_BEANINFO)).getBeanInfo(); return (new Introspector(beanClass, null, USE_ALL_BEANINFO)).getBeanInfo();
} }
Map<Class<?>, BeanInfo> beanInfoCache; ThreadGroupContext context = ThreadGroupContext.getContext();
BeanInfo beanInfo; BeanInfo beanInfo;
synchronized (BEANINFO_CACHE) { synchronized (declaredMethodCache) {
beanInfoCache = (Map<Class<?>, BeanInfo>) AppContext.getAppContext().get(BEANINFO_CACHE); beanInfo = context.getBeanInfo(beanClass);
if (beanInfoCache == null) {
beanInfoCache = new WeakHashMap<Class<?>, BeanInfo>();
AppContext.getAppContext().put(BEANINFO_CACHE, beanInfoCache);
}
beanInfo = beanInfoCache.get(beanClass);
} }
if (beanInfo == null) { if (beanInfo == null) {
beanInfo = new Introspector(beanClass, null, USE_ALL_BEANINFO).getBeanInfo(); beanInfo = new Introspector(beanClass, null, USE_ALL_BEANINFO).getBeanInfo();
synchronized (BEANINFO_CACHE) { synchronized (declaredMethodCache) {
beanInfoCache.put(beanClass, beanInfo); context.putBeanInfo(beanClass, beanInfo);
} }
} }
return beanInfo; return beanInfo;
@ -306,7 +293,7 @@ public class Introspector {
*/ */
public static String[] getBeanInfoSearchPath() { public static String[] getBeanInfoSearchPath() {
return getFinder().getPackages(); return ThreadGroupContext.getContext().getBeanInfoFinder().getPackages();
} }
/** /**
@ -330,7 +317,7 @@ public class Introspector {
if (sm != null) { if (sm != null) {
sm.checkPropertiesAccess(); sm.checkPropertiesAccess();
} }
getFinder().setPackages(path); ThreadGroupContext.getContext().getBeanInfoFinder().setPackages(path);
} }
@ -342,11 +329,8 @@ public class Introspector {
*/ */
public static void flushCaches() { public static void flushCaches() {
synchronized (BEANINFO_CACHE) { synchronized (declaredMethodCache) {
Map beanInfoCache = (Map) AppContext.getAppContext().get(BEANINFO_CACHE); ThreadGroupContext.getContext().clearBeanInfoCache();
if (beanInfoCache != null) {
beanInfoCache.clear();
}
declaredMethodCache.clear(); declaredMethodCache.clear();
} }
} }
@ -370,11 +354,8 @@ public class Introspector {
if (clz == null) { if (clz == null) {
throw new NullPointerException(); throw new NullPointerException();
} }
synchronized (BEANINFO_CACHE) { synchronized (declaredMethodCache) {
Map beanInfoCache = (Map) AppContext.getAppContext().get(BEANINFO_CACHE); ThreadGroupContext.getContext().removeBeanInfo(clz);
if (beanInfoCache != null) {
beanInfoCache.put(clz, null);
}
declaredMethodCache.put(clz, null); declaredMethodCache.put(clz, null);
} }
} }
@ -383,14 +364,14 @@ public class Introspector {
// Private implementation methods // Private implementation methods
//====================================================================== //======================================================================
private Introspector(Class beanClass, Class stopClass, int flags) private Introspector(Class<?> beanClass, Class<?> stopClass, int flags)
throws IntrospectionException { throws IntrospectionException {
this.beanClass = beanClass; this.beanClass = beanClass;
// Check stopClass is a superClass of startClass. // Check stopClass is a superClass of startClass.
if (stopClass != null) { if (stopClass != null) {
boolean isSuper = false; boolean isSuper = false;
for (Class c = beanClass.getSuperclass(); c != null; c = c.getSuperclass()) { for (Class<?> c = beanClass.getSuperclass(); c != null; c = c.getSuperclass()) {
if (c == stopClass) { if (c == stopClass) {
isSuper = true; isSuper = true;
} }
@ -405,7 +386,7 @@ public class Introspector {
explicitBeanInfo = findExplicitBeanInfo(beanClass); explicitBeanInfo = findExplicitBeanInfo(beanClass);
} }
Class superClass = beanClass.getSuperclass(); Class<?> superClass = beanClass.getSuperclass();
if (superClass != stopClass) { if (superClass != stopClass) {
int newFlags = flags; int newFlags = flags;
if (newFlags == IGNORE_IMMEDIATE_BEANINFO) { if (newFlags == IGNORE_IMMEDIATE_BEANINFO) {
@ -451,8 +432,8 @@ public class Introspector {
* @param beanClass the class type of the bean * @param beanClass the class type of the bean
* @return Instance of an explicit BeanInfo class or null if one isn't found. * @return Instance of an explicit BeanInfo class or null if one isn't found.
*/ */
private static BeanInfo findExplicitBeanInfo(Class beanClass) { private static BeanInfo findExplicitBeanInfo(Class<?> beanClass) {
return getFinder().find(beanClass); return ThreadGroupContext.getContext().getBeanInfoFinder().find(beanClass);
} }
/** /**
@ -501,8 +482,8 @@ public class Introspector {
continue; continue;
} }
String name = method.getName(); String name = method.getName();
Class argTypes[] = method.getParameterTypes(); Class<?>[] argTypes = method.getParameterTypes();
Class resultType = method.getReturnType(); Class<?> resultType = method.getReturnType();
int argCount = argTypes.length; int argCount = argTypes.length;
PropertyDescriptor pd = null; PropertyDescriptor pd = null;
@ -560,8 +541,8 @@ public class Introspector {
processPropertyDescriptors(); processPropertyDescriptors();
// Allocate and populate the result array. // Allocate and populate the result array.
PropertyDescriptor result[] = new PropertyDescriptor[properties.size()]; PropertyDescriptor result[] =
result = (PropertyDescriptor[])properties.values().toArray(result); properties.values().toArray(new PropertyDescriptor[properties.size()]);
// Set the default index. // Set the default index.
if (defaultPropertyName != null) { if (defaultPropertyName != null) {
@ -575,16 +556,16 @@ public class Introspector {
return result; return result;
} }
private HashMap pdStore = new HashMap(); private HashMap<String, List<PropertyDescriptor>> pdStore = new HashMap<>();
/** /**
* Adds the property descriptor to the list store. * Adds the property descriptor to the list store.
*/ */
private void addPropertyDescriptor(PropertyDescriptor pd) { private void addPropertyDescriptor(PropertyDescriptor pd) {
String propName = pd.getName(); String propName = pd.getName();
List list = (List)pdStore.get(propName); List<PropertyDescriptor> list = pdStore.get(propName);
if (list == null) { if (list == null) {
list = new ArrayList(); list = new ArrayList<>();
pdStore.put(propName, list); pdStore.put(propName, list);
} }
if (this.beanClass != pd.getClass0()) { if (this.beanClass != pd.getClass0()) {
@ -639,25 +620,25 @@ public class Introspector {
*/ */
private void processPropertyDescriptors() { private void processPropertyDescriptors() {
if (properties == null) { if (properties == null) {
properties = new TreeMap(); properties = new TreeMap<>();
} }
List list; List<PropertyDescriptor> list;
PropertyDescriptor pd, gpd, spd; PropertyDescriptor pd, gpd, spd;
IndexedPropertyDescriptor ipd, igpd, ispd; IndexedPropertyDescriptor ipd, igpd, ispd;
Iterator it = pdStore.values().iterator(); Iterator<List<PropertyDescriptor>> it = pdStore.values().iterator();
while (it.hasNext()) { while (it.hasNext()) {
pd = null; gpd = null; spd = null; pd = null; gpd = null; spd = null;
ipd = null; igpd = null; ispd = null; ipd = null; igpd = null; ispd = null;
list = (List)it.next(); list = it.next();
// First pass. Find the latest getter method. Merge properties // First pass. Find the latest getter method. Merge properties
// of previous getter methods. // of previous getter methods.
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
pd = (PropertyDescriptor)list.get(i); pd = list.get(i);
if (pd instanceof IndexedPropertyDescriptor) { if (pd instanceof IndexedPropertyDescriptor) {
ipd = (IndexedPropertyDescriptor)pd; ipd = (IndexedPropertyDescriptor)pd;
if (ipd.getIndexedReadMethod() != null) { if (ipd.getIndexedReadMethod() != null) {
@ -686,7 +667,7 @@ public class Introspector {
// Second pass. Find the latest setter method which // Second pass. Find the latest setter method which
// has the same type as the getter method. // has the same type as the getter method.
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
pd = (PropertyDescriptor)list.get(i); pd = list.get(i);
if (pd instanceof IndexedPropertyDescriptor) { if (pd instanceof IndexedPropertyDescriptor) {
ipd = (IndexedPropertyDescriptor)pd; ipd = (IndexedPropertyDescriptor)pd;
if (ipd.getIndexedWriteMethod() != null) { if (ipd.getIndexedWriteMethod() != null) {
@ -804,7 +785,7 @@ public class Introspector {
// which does not have getter and setter methods. // which does not have getter and setter methods.
// See regression bug 4984912. // See regression bug 4984912.
if ( (pd == null) && (list.size() > 0) ) { if ( (pd == null) && (list.size() > 0) ) {
pd = (PropertyDescriptor) list.get(0); pd = list.get(0);
} }
if (pd != null) { if (pd != null) {
@ -823,8 +804,8 @@ public class Introspector {
PropertyDescriptor pd) { PropertyDescriptor pd) {
PropertyDescriptor result = null; PropertyDescriptor result = null;
Class propType = pd.getPropertyType(); Class<?> propType = pd.getPropertyType();
Class ipropType = ipd.getIndexedPropertyType(); Class<?> ipropType = ipd.getIndexedPropertyType();
if (propType.isArray() && propType.getComponentType() == ipropType) { if (propType.isArray() && propType.getComponentType() == ipropType) {
if (pd.getClass0().isAssignableFrom(ipd.getClass0())) { if (pd.getClass0().isAssignableFrom(ipd.getClass0())) {
@ -858,7 +839,7 @@ public class Introspector {
if (write == null && read != null) { if (write == null && read != null) {
write = findMethod(result.getClass0(), write = findMethod(result.getClass0(),
SET_PREFIX + NameGenerator.capitalize(result.getName()), 1, SET_PREFIX + NameGenerator.capitalize(result.getName()), 1,
new Class[] { FeatureDescriptor.getReturnType(result.getClass0(), read) }); new Class<?>[] { FeatureDescriptor.getReturnType(result.getClass0(), read) });
if (write != null) { if (write != null) {
try { try {
result.setWriteMethod(write); result.setWriteMethod(write);
@ -898,7 +879,7 @@ public class Introspector {
*/ */
private EventSetDescriptor[] getTargetEventInfo() throws IntrospectionException { private EventSetDescriptor[] getTargetEventInfo() throws IntrospectionException {
if (events == null) { if (events == null) {
events = new HashMap(); events = new HashMap<>();
} }
// Check if the bean has its own BeanInfo that will provide // Check if the bean has its own BeanInfo that will provide
@ -949,9 +930,9 @@ public class Introspector {
// Find all suitable "add", "remove" and "get" Listener methods // Find all suitable "add", "remove" and "get" Listener methods
// The name of the listener type is the key for these hashtables // The name of the listener type is the key for these hashtables
// i.e, ActionListener // i.e, ActionListener
Map adds = null; Map<String, Method> adds = null;
Map removes = null; Map<String, Method> removes = null;
Map gets = null; Map<String, Method> gets = null;
for (int i = 0; i < methodList.length; i++) { for (int i = 0; i < methodList.length; i++) {
Method method = methodList[i]; Method method = methodList[i];
@ -970,8 +951,8 @@ public class Introspector {
continue; continue;
} }
Class argTypes[] = FeatureDescriptor.getParameterTypes(beanClass, method); Class<?>[] argTypes = FeatureDescriptor.getParameterTypes(beanClass, method);
Class resultType = FeatureDescriptor.getReturnType(beanClass, method); Class<?> resultType = FeatureDescriptor.getReturnType(beanClass, method);
if (name.startsWith(ADD_PREFIX) && argTypes.length == 1 && if (name.startsWith(ADD_PREFIX) && argTypes.length == 1 &&
resultType == Void.TYPE && resultType == Void.TYPE &&
@ -980,7 +961,7 @@ public class Introspector {
if (listenerName.length() > 0 && if (listenerName.length() > 0 &&
argTypes[0].getName().endsWith(listenerName)) { argTypes[0].getName().endsWith(listenerName)) {
if (adds == null) { if (adds == null) {
adds = new HashMap(); adds = new HashMap<>();
} }
adds.put(listenerName, method); adds.put(listenerName, method);
} }
@ -992,7 +973,7 @@ public class Introspector {
if (listenerName.length() > 0 && if (listenerName.length() > 0 &&
argTypes[0].getName().endsWith(listenerName)) { argTypes[0].getName().endsWith(listenerName)) {
if (removes == null) { if (removes == null) {
removes = new HashMap(); removes = new HashMap<>();
} }
removes.put(listenerName, method); removes.put(listenerName, method);
} }
@ -1005,7 +986,7 @@ public class Introspector {
if (listenerName.length() > 0 && if (listenerName.length() > 0 &&
resultType.getComponentType().getName().endsWith(listenerName)) { resultType.getComponentType().getName().endsWith(listenerName)) {
if (gets == null) { if (gets == null) {
gets = new HashMap(); gets = new HashMap<>();
} }
gets.put(listenerName, method); gets.put(listenerName, method);
} }
@ -1015,26 +996,26 @@ public class Introspector {
if (adds != null && removes != null) { if (adds != null && removes != null) {
// Now look for matching addFooListener+removeFooListener pairs. // Now look for matching addFooListener+removeFooListener pairs.
// Bonus if there is a matching getFooListeners method as well. // Bonus if there is a matching getFooListeners method as well.
Iterator keys = adds.keySet().iterator(); Iterator<String> keys = adds.keySet().iterator();
while (keys.hasNext()) { while (keys.hasNext()) {
String listenerName = (String) keys.next(); String listenerName = keys.next();
// Skip any "add" which doesn't have a matching "remove" or // Skip any "add" which doesn't have a matching "remove" or
// a listener name that doesn't end with Listener // a listener name that doesn't end with Listener
if (removes.get(listenerName) == null || !listenerName.endsWith("Listener")) { if (removes.get(listenerName) == null || !listenerName.endsWith("Listener")) {
continue; continue;
} }
String eventName = decapitalize(listenerName.substring(0, listenerName.length()-8)); String eventName = decapitalize(listenerName.substring(0, listenerName.length()-8));
Method addMethod = (Method)adds.get(listenerName); Method addMethod = adds.get(listenerName);
Method removeMethod = (Method)removes.get(listenerName); Method removeMethod = removes.get(listenerName);
Method getMethod = null; Method getMethod = null;
if (gets != null) { if (gets != null) {
getMethod = (Method)gets.get(listenerName); getMethod = gets.get(listenerName);
} }
Class argType = FeatureDescriptor.getParameterTypes(beanClass, addMethod)[0]; Class<?> argType = FeatureDescriptor.getParameterTypes(beanClass, addMethod)[0];
// generate a list of Method objects for each of the target methods: // generate a list of Method objects for each of the target methods:
Method allMethods[] = getPublicDeclaredMethods(argType); Method allMethods[] = getPublicDeclaredMethods(argType);
List validMethods = new ArrayList(allMethods.length); List<Method> validMethods = new ArrayList<>(allMethods.length);
for (int i = 0; i < allMethods.length; i++) { for (int i = 0; i < allMethods.length; i++) {
if (allMethods[i] == null) { if (allMethods[i] == null) {
continue; continue;
@ -1044,7 +1025,7 @@ public class Introspector {
validMethods.add(allMethods[i]); validMethods.add(allMethods[i]);
} }
} }
Method[] methods = (Method[])validMethods.toArray(new Method[validMethods.size()]); Method[] methods = validMethods.toArray(new Method[validMethods.size()]);
EventSetDescriptor esd = new EventSetDescriptor(eventName, argType, EventSetDescriptor esd = new EventSetDescriptor(eventName, argType,
methods, addMethod, methods, addMethod,
@ -1067,7 +1048,7 @@ public class Introspector {
} else { } else {
// Allocate and populate the result array. // Allocate and populate the result array.
result = new EventSetDescriptor[events.size()]; result = new EventSetDescriptor[events.size()];
result = (EventSetDescriptor[])events.values().toArray(result); result = events.values().toArray(result);
// Set the default index. // Set the default index.
if (defaultEventName != null) { if (defaultEventName != null) {
@ -1086,7 +1067,7 @@ public class Introspector {
if (esd.getName().equals("propertyChange")) { if (esd.getName().equals("propertyChange")) {
propertyChangeSource = true; propertyChangeSource = true;
} }
EventSetDescriptor old = (EventSetDescriptor)events.get(key); EventSetDescriptor old = events.get(key);
if (old == null) { if (old == null) {
events.put(key, esd); events.put(key, esd);
return; return;
@ -1101,7 +1082,7 @@ public class Introspector {
*/ */
private MethodDescriptor[] getTargetMethodInfo() { private MethodDescriptor[] getTargetMethodInfo() {
if (methods == null) { if (methods == null) {
methods = new HashMap(100); methods = new HashMap<>(100);
} }
// Check if the bean has its own BeanInfo that will provide // Check if the bean has its own BeanInfo that will provide
@ -1154,7 +1135,7 @@ public class Introspector {
// Allocate and populate the result array. // Allocate and populate the result array.
MethodDescriptor result[] = new MethodDescriptor[methods.size()]; MethodDescriptor result[] = new MethodDescriptor[methods.size()];
result = (MethodDescriptor[])methods.values().toArray(result); result = methods.values().toArray(result);
return result; return result;
} }
@ -1165,7 +1146,7 @@ public class Introspector {
// This method gets called a *lot, so we try to be efficient. // This method gets called a *lot, so we try to be efficient.
String name = md.getName(); String name = md.getName();
MethodDescriptor old = (MethodDescriptor)methods.get(name); MethodDescriptor old = methods.get(name);
if (old == null) { if (old == null) {
// This is the common case. // This is the common case.
methods.put(name, md); methods.put(name, md);
@ -1198,7 +1179,7 @@ public class Introspector {
// This is very rare. // This is very rare.
String longKey = makeQualifiedMethodName(name, p1); String longKey = makeQualifiedMethodName(name, p1);
old = (MethodDescriptor)methods.get(longKey); old = methods.get(longKey);
if (old == null) { if (old == null) {
methods.put(longKey, md); methods.put(longKey, md);
return; return;
@ -1269,13 +1250,13 @@ public class Introspector {
/* /*
* Internal method to return *public* methods within a class. * Internal method to return *public* methods within a class.
*/ */
private static Method[] getPublicDeclaredMethods(Class clz) { private static Method[] getPublicDeclaredMethods(Class<?> clz) {
// Looking up Class.getDeclaredMethods is relatively expensive, // Looking up Class.getDeclaredMethods is relatively expensive,
// so we cache the results. // so we cache the results.
if (!ReflectUtil.isPackageAccessible(clz)) { if (!ReflectUtil.isPackageAccessible(clz)) {
return new Method[0]; return new Method[0];
} }
synchronized (BEANINFO_CACHE) { synchronized (declaredMethodCache) {
Method[] result = declaredMethodCache.get(clz); Method[] result = declaredMethodCache.get(clz);
if (result == null) { if (result == null) {
result = clz.getMethods(); result = clz.getMethods();
@ -1299,14 +1280,14 @@ public class Introspector {
* Internal support for finding a target methodName with a given * Internal support for finding a target methodName with a given
* parameter list on a given class. * parameter list on a given class.
*/ */
private static Method internalFindMethod(Class start, String methodName, private static Method internalFindMethod(Class<?> start, String methodName,
int argCount, Class args[]) { int argCount, Class args[]) {
// For overriden methods we need to find the most derived version. // For overriden methods we need to find the most derived version.
// So we start with the given class and walk up the superclass chain. // So we start with the given class and walk up the superclass chain.
Method method = null; Method method = null;
for (Class cl = start; cl != null; cl = cl.getSuperclass()) { for (Class<?> cl = start; cl != null; cl = cl.getSuperclass()) {
Method methods[] = getPublicDeclaredMethods(cl); Method methods[] = getPublicDeclaredMethods(cl);
for (int i = 0; i < methods.length; i++) { for (int i = 0; i < methods.length; i++) {
method = methods[i]; method = methods[i];
@ -1357,7 +1338,7 @@ public class Introspector {
/** /**
* Find a target methodName on a given class. * Find a target methodName on a given class.
*/ */
static Method findMethod(Class cls, String methodName, int argCount) { static Method findMethod(Class<?> cls, String methodName, int argCount) {
return findMethod(cls, methodName, argCount, null); return findMethod(cls, methodName, argCount, null);
} }
@ -1373,7 +1354,7 @@ public class Introspector {
* @param args Array of argument types for the method. * @param args Array of argument types for the method.
* @return the method or null if not found * @return the method or null if not found
*/ */
static Method findMethod(Class cls, String methodName, int argCount, static Method findMethod(Class<?> cls, String methodName, int argCount,
Class args[]) { Class args[]) {
if (methodName == null) { if (methodName == null) {
return null; return null;
@ -1387,7 +1368,7 @@ public class Introspector {
* or "implements" b. * or "implements" b.
* Note tht either or both "Class" objects may represent interfaces. * Note tht either or both "Class" objects may represent interfaces.
*/ */
static boolean isSubclass(Class a, Class b) { static boolean isSubclass(Class<?> a, Class<?> b) {
// We rely on the fact that for any given java class or // We rely on the fact that for any given java class or
// primtitive type there is a unqiue Class object, so // primtitive type there is a unqiue Class object, so
// we can use object equivalence in the comparisons. // we can use object equivalence in the comparisons.
@ -1397,12 +1378,12 @@ public class Introspector {
if (a == null || b == null) { if (a == null || b == null) {
return false; return false;
} }
for (Class x = a; x != null; x = x.getSuperclass()) { for (Class<?> x = a; x != null; x = x.getSuperclass()) {
if (x == b) { if (x == b) {
return true; return true;
} }
if (b.isInterface()) { if (b.isInterface()) {
Class interfaces[] = x.getInterfaces(); Class<?>[] interfaces = x.getInterfaces();
for (int i = 0; i < interfaces.length; i++) { for (int i = 0; i < interfaces.length; i++) {
if (isSubclass(interfaces[i], b)) { if (isSubclass(interfaces[i], b)) {
return true; return true;
@ -1416,7 +1397,7 @@ public class Introspector {
/** /**
* Return true iff the given method throws the given exception. * Return true iff the given method throws the given exception.
*/ */
private boolean throwsException(Method method, Class exception) { private boolean throwsException(Method method, Class<?> exception) {
Class exs[] = method.getExceptionTypes(); Class exs[] = method.getExceptionTypes();
for (int i = 0; i < exs.length; i++) { for (int i = 0; i < exs.length; i++) {
if (exs[i] == exception) { if (exs[i] == exception) {
@ -1426,28 +1407,17 @@ public class Introspector {
return false; return false;
} }
private static BeanInfoFinder getFinder() {
AppContext context = AppContext.getAppContext();
Object object = context.get(FINDER_KEY);
if (object instanceof BeanInfoFinder) {
return (BeanInfoFinder) object;
}
BeanInfoFinder finder = new BeanInfoFinder();
context.put(FINDER_KEY, finder);
return finder;
}
/** /**
* Try to create an instance of a named class. * Try to create an instance of a named class.
* First try the classloader of "sibling", then try the system * First try the classloader of "sibling", then try the system
* classloader then the class loader of the current Thread. * classloader then the class loader of the current Thread.
*/ */
static Object instantiate(Class sibling, String className) static Object instantiate(Class<?> sibling, String className)
throws InstantiationException, IllegalAccessException, throws InstantiationException, IllegalAccessException,
ClassNotFoundException { ClassNotFoundException {
// First check with sibling's classloader (if any). // First check with sibling's classloader (if any).
ClassLoader cl = sibling.getClassLoader(); ClassLoader cl = sibling.getClassLoader();
Class cls = ClassFinder.findClass(className, cl); Class<?> cls = ClassFinder.findClass(className, cl);
return cls.newInstance(); return cls.newInstance();
} }
@ -1482,7 +1452,7 @@ class GenericBeanInfo extends SimpleBeanInfo {
this.properties = properties; this.properties = properties;
this.defaultProperty = defaultProperty; this.defaultProperty = defaultProperty;
this.methods = methods; this.methods = methods;
this.targetBeanInfoRef = new SoftReference<BeanInfo>(targetBeanInfo); this.targetBeanInfoRef = new SoftReference<>(targetBeanInfo);
} }
/** /**

View File

@ -93,7 +93,7 @@ class EnumPersistenceDelegate extends PersistenceDelegate {
} }
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
Enum e = (Enum) oldInstance; Enum<?> e = (Enum<?>) oldInstance;
return new Expression(e, Enum.class, "valueOf", new Object[]{e.getDeclaringClass(), e.name()}); return new Expression(e, Enum.class, "valueOf", new Object[]{e.getDeclaringClass(), e.name()});
} }
} }
@ -118,7 +118,7 @@ class ArrayPersistenceDelegate extends PersistenceDelegate {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
// System.out.println("instantiate: " + type + " " + oldInstance); // System.out.println("instantiate: " + type + " " + oldInstance);
Class oldClass = oldInstance.getClass(); Class<?> oldClass = oldInstance.getClass();
return new Expression(oldInstance, Array.class, "newInstance", return new Expression(oldInstance, Array.class, "newInstance",
new Object[]{oldClass.getComponentType(), new Object[]{oldClass.getComponentType(),
new Integer(Array.getLength(oldInstance))}); new Integer(Array.getLength(oldInstance))});
@ -152,14 +152,14 @@ class ArrayPersistenceDelegate extends PersistenceDelegate {
class ProxyPersistenceDelegate extends PersistenceDelegate { class ProxyPersistenceDelegate extends PersistenceDelegate {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
Class type = oldInstance.getClass(); Class<?> type = oldInstance.getClass();
java.lang.reflect.Proxy p = (java.lang.reflect.Proxy)oldInstance; java.lang.reflect.Proxy p = (java.lang.reflect.Proxy)oldInstance;
// This unappealing hack is not required but makes the // This unappealing hack is not required but makes the
// representation of EventHandlers much more concise. // representation of EventHandlers much more concise.
java.lang.reflect.InvocationHandler ih = java.lang.reflect.Proxy.getInvocationHandler(p); java.lang.reflect.InvocationHandler ih = java.lang.reflect.Proxy.getInvocationHandler(p);
if (ih instanceof EventHandler) { if (ih instanceof EventHandler) {
EventHandler eh = (EventHandler)ih; EventHandler eh = (EventHandler)ih;
Vector args = new Vector(); Vector<Object> args = new Vector<>();
args.add(type.getInterfaces()[0]); args.add(type.getInterfaces()[0]);
args.add(eh.getTarget()); args.add(eh.getTarget());
args.add(eh.getAction()); args.add(eh.getAction());
@ -200,7 +200,7 @@ class java_lang_Class_PersistenceDelegate extends PersistenceDelegate {
} }
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
Class c = (Class)oldInstance; Class<?> c = (Class)oldInstance;
// As of 1.3 it is not possible to call Class.forName("int"), // As of 1.3 it is not possible to call Class.forName("int"),
// so we have to generate different code for primitive types. // so we have to generate different code for primitive types.
// This is needed for arrays whose subtype may be primitive. // This is needed for arrays whose subtype may be primitive.
@ -362,8 +362,8 @@ abstract class java_util_Collections extends PersistenceDelegate {
if ((oldInstance instanceof List) || (oldInstance instanceof Set) || (oldInstance instanceof Map)) { if ((oldInstance instanceof List) || (oldInstance instanceof Set) || (oldInstance instanceof Map)) {
return oldInstance.equals(newInstance); return oldInstance.equals(newInstance);
} }
Collection oldC = (Collection) oldInstance; Collection<?> oldC = (Collection<?>) oldInstance;
Collection newC = (Collection) newInstance; Collection<?> newC = (Collection<?>) newInstance;
return (oldC.size() == newC.size()) && oldC.containsAll(newC); return (oldC.size() == newC.size()) && oldC.containsAll(newC);
} }
@ -387,21 +387,21 @@ abstract class java_util_Collections extends PersistenceDelegate {
static final class SingletonList_PersistenceDelegate extends java_util_Collections { static final class SingletonList_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
List list = (List) oldInstance; List<?> list = (List<?>) oldInstance;
return new Expression(oldInstance, Collections.class, "singletonList", new Object[]{list.get(0)}); return new Expression(oldInstance, Collections.class, "singletonList", new Object[]{list.get(0)});
} }
} }
static final class SingletonSet_PersistenceDelegate extends java_util_Collections { static final class SingletonSet_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
Set set = (Set) oldInstance; Set<?> set = (Set<?>) oldInstance;
return new Expression(oldInstance, Collections.class, "singleton", new Object[]{set.iterator().next()}); return new Expression(oldInstance, Collections.class, "singleton", new Object[]{set.iterator().next()});
} }
} }
static final class SingletonMap_PersistenceDelegate extends java_util_Collections { static final class SingletonMap_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
Map map = (Map) oldInstance; Map<?,?> map = (Map<?,?>) oldInstance;
Object key = map.keySet().iterator().next(); Object key = map.keySet().iterator().next();
return new Expression(oldInstance, Collections.class, "singletonMap", new Object[]{key, map.get(key)}); return new Expression(oldInstance, Collections.class, "singletonMap", new Object[]{key, map.get(key)});
} }
@ -409,98 +409,98 @@ abstract class java_util_Collections extends PersistenceDelegate {
static final class UnmodifiableCollection_PersistenceDelegate extends java_util_Collections { static final class UnmodifiableCollection_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
List list = new ArrayList((Collection) oldInstance); List<?> list = new ArrayList<>((Collection<?>) oldInstance);
return new Expression(oldInstance, Collections.class, "unmodifiableCollection", new Object[]{list}); return new Expression(oldInstance, Collections.class, "unmodifiableCollection", new Object[]{list});
} }
} }
static final class UnmodifiableList_PersistenceDelegate extends java_util_Collections { static final class UnmodifiableList_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
List list = new LinkedList((Collection) oldInstance); List<?> list = new LinkedList<>((Collection<?>) oldInstance);
return new Expression(oldInstance, Collections.class, "unmodifiableList", new Object[]{list}); return new Expression(oldInstance, Collections.class, "unmodifiableList", new Object[]{list});
} }
} }
static final class UnmodifiableRandomAccessList_PersistenceDelegate extends java_util_Collections { static final class UnmodifiableRandomAccessList_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
List list = new ArrayList((Collection) oldInstance); List<?> list = new ArrayList<>((Collection<?>) oldInstance);
return new Expression(oldInstance, Collections.class, "unmodifiableList", new Object[]{list}); return new Expression(oldInstance, Collections.class, "unmodifiableList", new Object[]{list});
} }
} }
static final class UnmodifiableSet_PersistenceDelegate extends java_util_Collections { static final class UnmodifiableSet_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
Set set = new HashSet((Set) oldInstance); Set<?> set = new HashSet<>((Set<?>) oldInstance);
return new Expression(oldInstance, Collections.class, "unmodifiableSet", new Object[]{set}); return new Expression(oldInstance, Collections.class, "unmodifiableSet", new Object[]{set});
} }
} }
static final class UnmodifiableSortedSet_PersistenceDelegate extends java_util_Collections { static final class UnmodifiableSortedSet_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
SortedSet set = new TreeSet((SortedSet) oldInstance); SortedSet<?> set = new TreeSet<>((SortedSet<?>) oldInstance);
return new Expression(oldInstance, Collections.class, "unmodifiableSortedSet", new Object[]{set}); return new Expression(oldInstance, Collections.class, "unmodifiableSortedSet", new Object[]{set});
} }
} }
static final class UnmodifiableMap_PersistenceDelegate extends java_util_Collections { static final class UnmodifiableMap_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
Map map = new HashMap((Map) oldInstance); Map<?,?> map = new HashMap<>((Map<?,?>) oldInstance);
return new Expression(oldInstance, Collections.class, "unmodifiableMap", new Object[]{map}); return new Expression(oldInstance, Collections.class, "unmodifiableMap", new Object[]{map});
} }
} }
static final class UnmodifiableSortedMap_PersistenceDelegate extends java_util_Collections { static final class UnmodifiableSortedMap_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
SortedMap map = new TreeMap((SortedMap) oldInstance); SortedMap<?,?> map = new TreeMap<>((SortedMap<?,?>) oldInstance);
return new Expression(oldInstance, Collections.class, "unmodifiableSortedMap", new Object[]{map}); return new Expression(oldInstance, Collections.class, "unmodifiableSortedMap", new Object[]{map});
} }
} }
static final class SynchronizedCollection_PersistenceDelegate extends java_util_Collections { static final class SynchronizedCollection_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
List list = new ArrayList((Collection) oldInstance); List<?> list = new ArrayList<>((Collection<?>) oldInstance);
return new Expression(oldInstance, Collections.class, "synchronizedCollection", new Object[]{list}); return new Expression(oldInstance, Collections.class, "synchronizedCollection", new Object[]{list});
} }
} }
static final class SynchronizedList_PersistenceDelegate extends java_util_Collections { static final class SynchronizedList_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
List list = new LinkedList((Collection) oldInstance); List<?> list = new LinkedList<>((Collection<?>) oldInstance);
return new Expression(oldInstance, Collections.class, "synchronizedList", new Object[]{list}); return new Expression(oldInstance, Collections.class, "synchronizedList", new Object[]{list});
} }
} }
static final class SynchronizedRandomAccessList_PersistenceDelegate extends java_util_Collections { static final class SynchronizedRandomAccessList_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
List list = new ArrayList((Collection) oldInstance); List<?> list = new ArrayList<>((Collection<?>) oldInstance);
return new Expression(oldInstance, Collections.class, "synchronizedList", new Object[]{list}); return new Expression(oldInstance, Collections.class, "synchronizedList", new Object[]{list});
} }
} }
static final class SynchronizedSet_PersistenceDelegate extends java_util_Collections { static final class SynchronizedSet_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
Set set = new HashSet((Set) oldInstance); Set<?> set = new HashSet<>((Set<?>) oldInstance);
return new Expression(oldInstance, Collections.class, "synchronizedSet", new Object[]{set}); return new Expression(oldInstance, Collections.class, "synchronizedSet", new Object[]{set});
} }
} }
static final class SynchronizedSortedSet_PersistenceDelegate extends java_util_Collections { static final class SynchronizedSortedSet_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
SortedSet set = new TreeSet((SortedSet) oldInstance); SortedSet<?> set = new TreeSet<>((SortedSet<?>) oldInstance);
return new Expression(oldInstance, Collections.class, "synchronizedSortedSet", new Object[]{set}); return new Expression(oldInstance, Collections.class, "synchronizedSortedSet", new Object[]{set});
} }
} }
static final class SynchronizedMap_PersistenceDelegate extends java_util_Collections { static final class SynchronizedMap_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
Map map = new HashMap((Map) oldInstance); Map<?,?> map = new HashMap<>((Map<?,?>) oldInstance);
return new Expression(oldInstance, Collections.class, "synchronizedMap", new Object[]{map}); return new Expression(oldInstance, Collections.class, "synchronizedMap", new Object[]{map});
} }
} }
static final class SynchronizedSortedMap_PersistenceDelegate extends java_util_Collections { static final class SynchronizedSortedMap_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
SortedMap map = new TreeMap((SortedMap) oldInstance); SortedMap<?,?> map = new TreeMap<>((SortedMap<?,?>) oldInstance);
return new Expression(oldInstance, Collections.class, "synchronizedSortedMap", new Object[]{map}); return new Expression(oldInstance, Collections.class, "synchronizedSortedMap", new Object[]{map});
} }
} }
@ -508,7 +508,7 @@ abstract class java_util_Collections extends PersistenceDelegate {
static final class CheckedCollection_PersistenceDelegate extends java_util_Collections { static final class CheckedCollection_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type"); Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
List list = new ArrayList((Collection) oldInstance); List<?> list = new ArrayList<>((Collection<?>) oldInstance);
return new Expression(oldInstance, Collections.class, "checkedCollection", new Object[]{list, type}); return new Expression(oldInstance, Collections.class, "checkedCollection", new Object[]{list, type});
} }
} }
@ -516,7 +516,7 @@ abstract class java_util_Collections extends PersistenceDelegate {
static final class CheckedList_PersistenceDelegate extends java_util_Collections { static final class CheckedList_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type"); Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
List list = new LinkedList((Collection) oldInstance); List<?> list = new LinkedList<>((Collection<?>) oldInstance);
return new Expression(oldInstance, Collections.class, "checkedList", new Object[]{list, type}); return new Expression(oldInstance, Collections.class, "checkedList", new Object[]{list, type});
} }
} }
@ -524,7 +524,7 @@ abstract class java_util_Collections extends PersistenceDelegate {
static final class CheckedRandomAccessList_PersistenceDelegate extends java_util_Collections { static final class CheckedRandomAccessList_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type"); Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
List list = new ArrayList((Collection) oldInstance); List<?> list = new ArrayList<>((Collection<?>) oldInstance);
return new Expression(oldInstance, Collections.class, "checkedList", new Object[]{list, type}); return new Expression(oldInstance, Collections.class, "checkedList", new Object[]{list, type});
} }
} }
@ -532,7 +532,7 @@ abstract class java_util_Collections extends PersistenceDelegate {
static final class CheckedSet_PersistenceDelegate extends java_util_Collections { static final class CheckedSet_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type"); Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
Set set = new HashSet((Set) oldInstance); Set<?> set = new HashSet<>((Set<?>) oldInstance);
return new Expression(oldInstance, Collections.class, "checkedSet", new Object[]{set, type}); return new Expression(oldInstance, Collections.class, "checkedSet", new Object[]{set, type});
} }
} }
@ -540,7 +540,7 @@ abstract class java_util_Collections extends PersistenceDelegate {
static final class CheckedSortedSet_PersistenceDelegate extends java_util_Collections { static final class CheckedSortedSet_PersistenceDelegate extends java_util_Collections {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type"); Object type = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedCollection.type");
SortedSet set = new TreeSet((SortedSet) oldInstance); SortedSet<?> set = new TreeSet<>((SortedSet<?>) oldInstance);
return new Expression(oldInstance, Collections.class, "checkedSortedSet", new Object[]{set, type}); return new Expression(oldInstance, Collections.class, "checkedSortedSet", new Object[]{set, type});
} }
} }
@ -549,7 +549,7 @@ abstract class java_util_Collections extends PersistenceDelegate {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
Object keyType = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.keyType"); Object keyType = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.keyType");
Object valueType = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.valueType"); Object valueType = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.valueType");
Map map = new HashMap((Map) oldInstance); Map<?,?> map = new HashMap<>((Map<?,?>) oldInstance);
return new Expression(oldInstance, Collections.class, "checkedMap", new Object[]{map, keyType, valueType}); return new Expression(oldInstance, Collections.class, "checkedMap", new Object[]{map, keyType, valueType});
} }
} }
@ -558,7 +558,7 @@ abstract class java_util_Collections extends PersistenceDelegate {
protected Expression instantiate(Object oldInstance, Encoder out) { protected Expression instantiate(Object oldInstance, Encoder out) {
Object keyType = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.keyType"); Object keyType = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.keyType");
Object valueType = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.valueType"); Object valueType = MetaData.getPrivateFieldValue(oldInstance, "java.util.Collections$CheckedMap.valueType");
SortedMap map = new TreeMap((SortedMap) oldInstance); SortedMap<?,?> map = new TreeMap<>((SortedMap<?,?>) oldInstance);
return new Expression(oldInstance, Collections.class, "checkedSortedMap", new Object[]{map, keyType, valueType}); return new Expression(oldInstance, Collections.class, "checkedSortedMap", new Object[]{map, keyType, valueType});
} }
} }
@ -605,13 +605,13 @@ class java_util_EnumSet_PersistenceDelegate extends PersistenceDelegate {
// Collection // Collection
class java_util_Collection_PersistenceDelegate extends DefaultPersistenceDelegate { class java_util_Collection_PersistenceDelegate extends DefaultPersistenceDelegate {
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) { protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
java.util.Collection oldO = (java.util.Collection)oldInstance; java.util.Collection<?> oldO = (java.util.Collection)oldInstance;
java.util.Collection newO = (java.util.Collection)newInstance; java.util.Collection<?> newO = (java.util.Collection)newInstance;
if (newO.size() != 0) { if (newO.size() != 0) {
invokeStatement(oldInstance, "clear", new Object[]{}, out); invokeStatement(oldInstance, "clear", new Object[]{}, out);
} }
for (Iterator i = oldO.iterator(); i.hasNext();) { for (Iterator<?> i = oldO.iterator(); i.hasNext();) {
invokeStatement(oldInstance, "add", new Object[]{i.next()}, out); invokeStatement(oldInstance, "add", new Object[]{i.next()}, out);
} }
} }
@ -620,8 +620,8 @@ class java_util_Collection_PersistenceDelegate extends DefaultPersistenceDelegat
// List // List
class java_util_List_PersistenceDelegate extends DefaultPersistenceDelegate { class java_util_List_PersistenceDelegate extends DefaultPersistenceDelegate {
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) { protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
java.util.List oldO = (java.util.List)oldInstance; java.util.List<?> oldO = (java.util.List<?>)oldInstance;
java.util.List newO = (java.util.List)newInstance; java.util.List<?> newO = (java.util.List<?>)newInstance;
int oldSize = oldO.size(); int oldSize = oldO.size();
int newSize = (newO == null) ? 0 : newO.size(); int newSize = (newO == null) ? 0 : newO.size();
if (oldSize < newSize) { if (oldSize < newSize) {
@ -656,8 +656,8 @@ class java_util_List_PersistenceDelegate extends DefaultPersistenceDelegate {
class java_util_Map_PersistenceDelegate extends DefaultPersistenceDelegate { class java_util_Map_PersistenceDelegate extends DefaultPersistenceDelegate {
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) { protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
// System.out.println("Initializing: " + newInstance); // System.out.println("Initializing: " + newInstance);
java.util.Map oldMap = (java.util.Map)oldInstance; java.util.Map<?,?> oldMap = (java.util.Map)oldInstance;
java.util.Map newMap = (java.util.Map)newInstance; java.util.Map<?,?> newMap = (java.util.Map)newInstance;
// Remove the new elements. // Remove the new elements.
// Do this first otherwise we undo the adding work. // Do this first otherwise we undo the adding work.
if (newMap != null) { if (newMap != null) {
@ -746,9 +746,9 @@ final class java_awt_Font_PersistenceDelegate extends PersistenceDelegate {
int style = Font.PLAIN; int style = Font.PLAIN;
int size = 12; int size = 12;
Map basic = font.getAttributes(); Map<TextAttribute, ?> basic = font.getAttributes();
Map clone = new HashMap(basic.size()); Map<TextAttribute, Object> clone = new HashMap<>(basic.size());
for (Object key : basic.keySet()) { for (TextAttribute key : basic.keySet()) {
Object value = basic.get(key); Object value = basic.get(key);
if (value != null) { if (value != null) {
clone.put(key, value); clone.put(key, value);
@ -784,7 +784,7 @@ final class java_awt_Font_PersistenceDelegate extends PersistenceDelegate {
} }
} }
} }
Class type = font.getClass(); Class<?> type = font.getClass();
if (count == clone.size()) { if (count == clone.size()) {
return new Expression(font, type, "new", new Object[]{family, style, size}); return new Expression(font, type, "new", new Object[]{family, style, size});
} }
@ -832,7 +832,7 @@ final class java_awt_AWTKeyStroke_PersistenceDelegate extends PersistenceDelegat
if (args == null) { if (args == null) {
throw new IllegalStateException("Unsupported KeyStroke: " + key); throw new IllegalStateException("Unsupported KeyStroke: " + key);
} }
Class type = key.getClass(); Class<?> type = key.getClass();
String name = type.getName(); String name = type.getName();
// get short name of the class // get short name of the class
int index = name.lastIndexOf('.') + 1; int index = name.lastIndexOf('.') + 1;
@ -1057,12 +1057,12 @@ class java_awt_CardLayout_PersistenceDelegate extends DefaultPersistenceDelegate
protected void initialize(Class<?> type, Object oldInstance, protected void initialize(Class<?> type, Object oldInstance,
Object newInstance, Encoder out) { Object newInstance, Encoder out) {
super.initialize(type, oldInstance, newInstance, out); super.initialize(type, oldInstance, newInstance, out);
Hashtable tab = (Hashtable)ReflectionUtils.getPrivateField(oldInstance, Hashtable<?,?> tab = (Hashtable<?,?>)ReflectionUtils.getPrivateField(oldInstance,
java.awt.CardLayout.class, java.awt.CardLayout.class,
"tab", "tab",
out.getExceptionListener()); out.getExceptionListener());
if (tab != null) { if (tab != null) {
for(Enumeration e = tab.keys(); e.hasMoreElements();) { for(Enumeration<?> e = tab.keys(); e.hasMoreElements();) {
Object child = e.nextElement(); Object child = e.nextElement();
invokeStatement(oldInstance, "addLayoutComponent", invokeStatement(oldInstance, "addLayoutComponent",
new Object[]{child, (String)tab.get(child)}, out); new Object[]{child, (String)tab.get(child)}, out);
@ -1076,12 +1076,12 @@ class java_awt_GridBagLayout_PersistenceDelegate extends DefaultPersistenceDeleg
protected void initialize(Class<?> type, Object oldInstance, protected void initialize(Class<?> type, Object oldInstance,
Object newInstance, Encoder out) { Object newInstance, Encoder out) {
super.initialize(type, oldInstance, newInstance, out); super.initialize(type, oldInstance, newInstance, out);
Hashtable comptable = (Hashtable)ReflectionUtils.getPrivateField(oldInstance, Hashtable<?,?> comptable = (Hashtable<?,?>)ReflectionUtils.getPrivateField(oldInstance,
java.awt.GridBagLayout.class, java.awt.GridBagLayout.class,
"comptable", "comptable",
out.getExceptionListener()); out.getExceptionListener());
if (comptable != null) { if (comptable != null) {
for(Enumeration e = comptable.keys(); e.hasMoreElements();) { for(Enumeration<?> e = comptable.keys(); e.hasMoreElements();) {
Object child = e.nextElement(); Object child = e.nextElement();
invokeStatement(oldInstance, "addLayoutComponent", invokeStatement(oldInstance, "addLayoutComponent",
new Object[]{child, comptable.get(child)}, out); new Object[]{child, comptable.get(child)}, out);
@ -1119,8 +1119,8 @@ class javax_swing_DefaultListModel_PersistenceDelegate extends DefaultPersistenc
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) { protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
// Note, the "size" property will be set here. // Note, the "size" property will be set here.
super.initialize(type, oldInstance, newInstance, out); super.initialize(type, oldInstance, newInstance, out);
javax.swing.DefaultListModel m = (javax.swing.DefaultListModel)oldInstance; javax.swing.DefaultListModel<?> m = (javax.swing.DefaultListModel<?>)oldInstance;
javax.swing.DefaultListModel n = (javax.swing.DefaultListModel)newInstance; javax.swing.DefaultListModel<?> n = (javax.swing.DefaultListModel<?>)newInstance;
for (int i = n.getSize(); i < m.getSize(); i++) { for (int i = n.getSize(); i < m.getSize(); i++) {
invokeStatement(oldInstance, "add", // Can also use "addElement". invokeStatement(oldInstance, "add", // Can also use "addElement".
new Object[]{m.getElementAt(i)}, out); new Object[]{m.getElementAt(i)}, out);
@ -1132,7 +1132,7 @@ class javax_swing_DefaultListModel_PersistenceDelegate extends DefaultPersistenc
class javax_swing_DefaultComboBoxModel_PersistenceDelegate extends DefaultPersistenceDelegate { class javax_swing_DefaultComboBoxModel_PersistenceDelegate extends DefaultPersistenceDelegate {
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) { protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out) {
super.initialize(type, oldInstance, newInstance, out); super.initialize(type, oldInstance, newInstance, out);
javax.swing.DefaultComboBoxModel m = (javax.swing.DefaultComboBoxModel)oldInstance; javax.swing.DefaultComboBoxModel<?> m = (javax.swing.DefaultComboBoxModel<?>)oldInstance;
for (int i = 0; i < m.getSize(); i++) { for (int i = 0; i < m.getSize(); i++) {
invokeStatement(oldInstance, "addElement", new Object[]{m.getElementAt(i)}, out); invokeStatement(oldInstance, "addElement", new Object[]{m.getElementAt(i)}, out);
} }
@ -1275,7 +1275,7 @@ final class sun_swing_PrintColorUIResource_PersistenceDelegate extends Persisten
class MetaData { class MetaData {
private static final Map<String,Field> fields = Collections.synchronizedMap(new WeakHashMap<String, Field>()); private static final Map<String,Field> fields = Collections.synchronizedMap(new WeakHashMap<String, Field>());
private static Hashtable internalPersistenceDelegates = new Hashtable(); private static Hashtable<String, PersistenceDelegate> internalPersistenceDelegates = new Hashtable<>();
private static PersistenceDelegate nullPersistenceDelegate = new NullPersistenceDelegate(); private static PersistenceDelegate nullPersistenceDelegate = new NullPersistenceDelegate();
private static PersistenceDelegate enumPersistenceDelegate = new EnumPersistenceDelegate(); private static PersistenceDelegate enumPersistenceDelegate = new EnumPersistenceDelegate();
@ -1308,6 +1308,7 @@ class MetaData {
internalPersistenceDelegates.put("java.util.RegularEnumSet", new java_util_EnumSet_PersistenceDelegate()); internalPersistenceDelegates.put("java.util.RegularEnumSet", new java_util_EnumSet_PersistenceDelegate());
} }
@SuppressWarnings("rawtypes")
public synchronized static PersistenceDelegate getPersistenceDelegate(Class type) { public synchronized static PersistenceDelegate getPersistenceDelegate(Class type) {
if (type == null) { if (type == null) {
return nullPersistenceDelegate; return nullPersistenceDelegate;
@ -1342,7 +1343,7 @@ class MetaData {
String typeName = type.getName(); String typeName = type.getName();
PersistenceDelegate pd = (PersistenceDelegate)getBeanAttribute(type, "persistenceDelegate"); PersistenceDelegate pd = (PersistenceDelegate)getBeanAttribute(type, "persistenceDelegate");
if (pd == null) { if (pd == null) {
pd = (PersistenceDelegate)internalPersistenceDelegates.get(typeName); pd = internalPersistenceDelegates.get(typeName);
if (pd != null) { if (pd != null) {
return pd; return pd;
} }
@ -1369,7 +1370,7 @@ class MetaData {
return (pd != null) ? pd : defaultPersistenceDelegate; return (pd != null) ? pd : defaultPersistenceDelegate;
} }
private static String[] getConstructorProperties(Class type) { private static String[] getConstructorProperties(Class<?> type) {
String[] names = null; String[] names = null;
int length = 0; int length = 0;
for (Constructor<?> constructor : type.getConstructors()) { for (Constructor<?> constructor : type.getConstructors()) {
@ -1402,7 +1403,7 @@ class MetaData {
return true; return true;
} }
private static Object getBeanAttribute(Class type, String attribute) { private static Object getBeanAttribute(Class<?> type, String attribute) {
try { try {
return Introspector.getBeanInfo(type).getBeanDescriptor().getValue(attribute); return Introspector.getBeanInfo(type).getBeanDescriptor().getValue(attribute);
} catch (IntrospectionException exception) { } catch (IntrospectionException exception) {

View File

@ -42,7 +42,7 @@ public class MethodDescriptor extends FeatureDescriptor {
private String[] paramNames; private String[] paramNames;
private List params; private List<WeakReference<Class<?>>> params;
private ParameterDescriptor parameterDescriptors[]; private ParameterDescriptor parameterDescriptors[];
@ -81,10 +81,10 @@ public class MethodDescriptor extends FeatureDescriptor {
public synchronized Method getMethod() { public synchronized Method getMethod() {
Method method = getMethod0(); Method method = getMethod0();
if (method == null) { if (method == null) {
Class cls = getClass0(); Class<?> cls = getClass0();
String name = getName(); String name = getName();
if ((cls != null) && (name != null)) { if ((cls != null) && (name != null)) {
Class[] params = getParams(); Class<?>[] params = getParams();
if (params == null) { if (params == null) {
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
// Find methods for up to 2 params. We are guessing here. // Find methods for up to 2 params. We are guessing here.
@ -121,15 +121,15 @@ public class MethodDescriptor extends FeatureDescriptor {
: null; : null;
} }
private synchronized void setParams(Class[] param) { private synchronized void setParams(Class<?>[] param) {
if (param == null) { if (param == null) {
return; return;
} }
paramNames = new String[param.length]; paramNames = new String[param.length];
params = new ArrayList(param.length); params = new ArrayList<>(param.length);
for (int i = 0; i < param.length; i++) { for (int i = 0; i < param.length; i++) {
paramNames[i] = param[i].getName(); paramNames[i] = param[i].getName();
params.add(new WeakReference(param[i])); params.add(new WeakReference<Class<?>>(param[i]));
} }
} }
@ -138,12 +138,12 @@ public class MethodDescriptor extends FeatureDescriptor {
return paramNames; return paramNames;
} }
private synchronized Class[] getParams() { private synchronized Class<?>[] getParams() {
Class[] clss = new Class[params.size()]; Class<?>[] clss = new Class<?>[params.size()];
for (int i = 0; i < params.size(); i++) { for (int i = 0; i < params.size(); i++) {
Reference ref = (Reference)params.get(i); Reference<? extends Class<?>> ref = (Reference<? extends Class<?>>)params.get(i);
Class cls = (Class)ref.get(); Class<?> cls = ref.get();
if (cls == null) { if (cls == null) {
return null; return null;
} else { } else {

View File

@ -43,12 +43,12 @@ import static java.util.Locale.ENGLISH;
*/ */
class NameGenerator { class NameGenerator {
private Map valueToName; private Map<Object, String> valueToName;
private Map nameToCount; private Map<String, Integer> nameToCount;
public NameGenerator() { public NameGenerator() {
valueToName = new IdentityHashMap(); valueToName = new IdentityHashMap<>();
nameToCount = new HashMap(); nameToCount = new HashMap<>();
} }
/** /**
@ -63,6 +63,7 @@ class NameGenerator {
/** /**
* Returns the root name of the class. * Returns the root name of the class.
*/ */
@SuppressWarnings("rawtypes")
public static String unqualifiedClassName(Class type) { public static String unqualifiedClassName(Class type) {
if (type.isArray()) { if (type.isArray()) {
return unqualifiedClassName(type.getComponentType())+"Array"; return unqualifiedClassName(type.getComponentType())+"Array";
@ -97,15 +98,15 @@ class NameGenerator {
return unqualifiedClassName((Class)instance); return unqualifiedClassName((Class)instance);
} }
else { else {
String result = (String)valueToName.get(instance); String result = valueToName.get(instance);
if (result != null) { if (result != null) {
return result; return result;
} }
Class type = instance.getClass(); Class<?> type = instance.getClass();
String className = unqualifiedClassName(type); String className = unqualifiedClassName(type);
Object size = nameToCount.get(className); Integer size = nameToCount.get(className);
int instanceNumber = (size == null) ? 0 : ((Integer)size).intValue() + 1; int instanceNumber = (size == null) ? 0 : (size).intValue() + 1;
nameToCount.put(className, new Integer(instanceNumber)); nameToCount.put(className, new Integer(instanceNumber));
result = className + instanceNumber; result = className + instanceNumber;

View File

@ -207,7 +207,7 @@ public abstract class PersistenceDelegate {
Object oldInstance, Object newInstance, Object oldInstance, Object newInstance,
Encoder out) Encoder out)
{ {
Class superType = type.getSuperclass(); Class<?> superType = type.getSuperclass();
PersistenceDelegate info = out.getPersistenceDelegate(superType); PersistenceDelegate info = out.getPersistenceDelegate(superType);
info.initialize(superType, oldInstance, newInstance, out); info.initialize(superType, oldInstance, newInstance, out);
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,8 @@
package java.beans; package java.beans;
import java.util.EventObject;
/** /**
* A "PropertyChange" event gets delivered whenever a bean changes a "bound" * A "PropertyChange" event gets delivered whenever a bean changes a "bound"
* or "constrained" property. A PropertyChangeEvent object is sent as an * or "constrained" property. A PropertyChangeEvent object is sent as an
@ -42,21 +44,21 @@ package java.beans;
* arbitrary set of if its properties have changed. In this case the * arbitrary set of if its properties have changed. In this case the
* old and new values should also be null. * old and new values should also be null.
*/ */
public class PropertyChangeEvent extends EventObject {
public class PropertyChangeEvent extends java.util.EventObject {
private static final long serialVersionUID = 7042693688939648123L; private static final long serialVersionUID = 7042693688939648123L;
/** /**
* Constructs a new <code>PropertyChangeEvent</code>. * Constructs a new {@code PropertyChangeEvent}.
* *
* @param source The bean that fired the event. * @param source the bean that fired the event
* @param propertyName The programmatic name of the property * @param propertyName the programmatic name of the property that was changed
* that was changed. * @param oldValue the old value of the property
* @param oldValue The old value of the property. * @param newValue the new value of the property
* @param newValue The new value of the property. *
* @throws IllegalArgumentException if {@code source} is {@code null}
*/ */
public PropertyChangeEvent(Object source, String propertyName, public PropertyChangeEvent(Object source, String propertyName,
Object oldValue, Object newValue) { Object oldValue, Object newValue) {
super(source); super(source);
this.propertyName = propertyName; this.propertyName = propertyName;
this.newValue = newValue; this.newValue = newValue;

View File

@ -431,7 +431,7 @@ public class PropertyChangeSupport implements Serializable {
listeners = entry.getValue(); listeners = entry.getValue();
} else { } else {
if (children == null) { if (children == null) {
children = new Hashtable<String, PropertyChangeSupport>(); children = new Hashtable<>();
} }
PropertyChangeSupport pcs = new PropertyChangeSupport(this.source); PropertyChangeSupport pcs = new PropertyChangeSupport(this.source);
pcs.map.set(null, entry.getValue()); pcs.map.set(null, entry.getValue());
@ -460,6 +460,7 @@ public class PropertyChangeSupport implements Serializable {
ObjectInputStream.GetField fields = s.readFields(); ObjectInputStream.GetField fields = s.readFields();
@SuppressWarnings("unchecked")
Hashtable<String, PropertyChangeSupport> children = (Hashtable<String, PropertyChangeSupport>) fields.get("children", null); Hashtable<String, PropertyChangeSupport> children = (Hashtable<String, PropertyChangeSupport>) fields.get("children", null);
this.source = fields.get("source", null); this.source = fields.get("source", null);
fields.get("propertyChangeSupportSerializedDataVersion", 2); fields.get("propertyChangeSupportSerializedDataVersion", 2);

View File

@ -35,10 +35,10 @@ import java.lang.reflect.Constructor;
*/ */
public class PropertyDescriptor extends FeatureDescriptor { public class PropertyDescriptor extends FeatureDescriptor {
private Reference<Class> propertyTypeRef; private Reference<? extends Class<?>> propertyTypeRef;
private Reference<Method> readMethodRef; private Reference<Method> readMethodRef;
private Reference<Method> writeMethodRef; private Reference<Method> writeMethodRef;
private Reference<Class> propertyEditorClassRef; private Reference<? extends Class<?>> propertyEditorClassRef;
private boolean bound; private boolean bound;
private boolean constrained; private boolean constrained;
@ -174,7 +174,7 @@ public class PropertyDescriptor extends FeatureDescriptor {
* or {@code null} if the type cannot be determined * or {@code null} if the type cannot be determined
*/ */
public synchronized Class<?> getPropertyType() { public synchronized Class<?> getPropertyType() {
Class type = getPropertyType0(); Class<?> type = getPropertyType0();
if (type == null) { if (type == null) {
try { try {
type = findPropertyType(getReadMethod(), getWriteMethod()); type = findPropertyType(getReadMethod(), getWriteMethod());
@ -186,11 +186,11 @@ public class PropertyDescriptor extends FeatureDescriptor {
return type; return type;
} }
private void setPropertyType(Class type) { private void setPropertyType(Class<?> type) {
this.propertyTypeRef = getWeakReference(type); this.propertyTypeRef = getWeakReference(type);
} }
private Class getPropertyType0() { private Class<?> getPropertyType0() {
return (this.propertyTypeRef != null) return (this.propertyTypeRef != null)
? this.propertyTypeRef.get() ? this.propertyTypeRef.get()
: null; : null;
@ -205,13 +205,13 @@ public class PropertyDescriptor extends FeatureDescriptor {
public synchronized Method getReadMethod() { public synchronized Method getReadMethod() {
Method readMethod = getReadMethod0(); Method readMethod = getReadMethod0();
if (readMethod == null) { if (readMethod == null) {
Class cls = getClass0(); Class<?> cls = getClass0();
if (cls == null || (readMethodName == null && readMethodRef == null)) { if (cls == null || (readMethodName == null && readMethodRef == null)) {
// The read method was explicitly set to null. // The read method was explicitly set to null.
return null; return null;
} }
if (readMethodName == null) { if (readMethodName == null) {
Class type = getPropertyType0(); Class<?> type = getPropertyType0();
if (type == boolean.class || type == null) { if (type == boolean.class || type == null) {
readMethodName = Introspector.IS_PREFIX + getBaseName(); readMethodName = Introspector.IS_PREFIX + getBaseName();
} else { } else {
@ -268,14 +268,14 @@ public class PropertyDescriptor extends FeatureDescriptor {
public synchronized Method getWriteMethod() { public synchronized Method getWriteMethod() {
Method writeMethod = getWriteMethod0(); Method writeMethod = getWriteMethod0();
if (writeMethod == null) { if (writeMethod == null) {
Class cls = getClass0(); Class<?> cls = getClass0();
if (cls == null || (writeMethodName == null && writeMethodRef == null)) { if (cls == null || (writeMethodName == null && writeMethodRef == null)) {
// The write method was explicitly set to null. // The write method was explicitly set to null.
return null; return null;
} }
// We need the type to fetch the correct method. // We need the type to fetch the correct method.
Class type = getPropertyType0(); Class<?> type = getPropertyType0();
if (type == null) { if (type == null) {
try { try {
// Can't use getPropertyType since it will lead to recursive loop. // Can't use getPropertyType since it will lead to recursive loop.
@ -292,7 +292,7 @@ public class PropertyDescriptor extends FeatureDescriptor {
writeMethodName = Introspector.SET_PREFIX + getBaseName(); writeMethodName = Introspector.SET_PREFIX + getBaseName();
} }
Class[] args = (type == null) ? null : new Class[] { type }; Class<?>[] args = (type == null) ? null : new Class<?>[] { type };
writeMethod = Introspector.findMethod(cls, writeMethodName, 1, args); writeMethod = Introspector.findMethod(cls, writeMethodName, 1, args);
if (writeMethod != null) { if (writeMethod != null) {
if (!writeMethod.getReturnType().equals(void.class)) { if (!writeMethod.getReturnType().equals(void.class)) {
@ -344,7 +344,7 @@ public class PropertyDescriptor extends FeatureDescriptor {
/** /**
* Overridden to ensure that a super class doesn't take precedent * Overridden to ensure that a super class doesn't take precedent
*/ */
void setClass0(Class clz) { void setClass0(Class<?> clz) {
if (getClass0() != null && clz.isAssignableFrom(getClass0())) { if (getClass0() != null && clz.isAssignableFrom(getClass0())) {
// dont replace a subclass with a superclass // dont replace a subclass with a superclass
return; return;
@ -402,7 +402,7 @@ public class PropertyDescriptor extends FeatureDescriptor {
* @param propertyEditorClass The Class for the desired PropertyEditor. * @param propertyEditorClass The Class for the desired PropertyEditor.
*/ */
public void setPropertyEditorClass(Class<?> propertyEditorClass) { public void setPropertyEditorClass(Class<?> propertyEditorClass) {
this.propertyEditorClassRef = getWeakReference((Class)propertyEditorClass); this.propertyEditorClassRef = getWeakReference(propertyEditorClass);
} }
/** /**
@ -437,12 +437,12 @@ public class PropertyDescriptor extends FeatureDescriptor {
public PropertyEditor createPropertyEditor(Object bean) { public PropertyEditor createPropertyEditor(Object bean) {
Object editor = null; Object editor = null;
Class cls = getPropertyEditorClass(); Class<?> cls = getPropertyEditorClass();
if (cls != null) { if (cls != null) {
Constructor ctor = null; Constructor<?> ctor = null;
if (bean != null) { if (bean != null) {
try { try {
ctor = cls.getConstructor(new Class[] { Object.class }); ctor = cls.getConstructor(new Class<?>[] { Object.class });
} catch (Exception ex) { } catch (Exception ex) {
// Fall through // Fall through
} }
@ -454,10 +454,7 @@ public class PropertyDescriptor extends FeatureDescriptor {
editor = ctor.newInstance(new Object[] { bean }); editor = ctor.newInstance(new Object[] { bean });
} }
} catch (Exception ex) { } catch (Exception ex) {
// A serious error has occured. // Fall through
// Proably due to an invalid property editor.
throw new RuntimeException("PropertyEditor not instantiated",
ex);
} }
} }
return (PropertyEditor)editor; return (PropertyEditor)editor;
@ -637,12 +634,12 @@ public class PropertyDescriptor extends FeatureDescriptor {
* read and write methods are null. * read and write methods are null.
* @throws IntrospectionException if the read or write method is invalid * @throws IntrospectionException if the read or write method is invalid
*/ */
private Class findPropertyType(Method readMethod, Method writeMethod) private Class<?> findPropertyType(Method readMethod, Method writeMethod)
throws IntrospectionException { throws IntrospectionException {
Class propertyType = null; Class<?> propertyType = null;
try { try {
if (readMethod != null) { if (readMethod != null) {
Class[] params = getParameterTypes(getClass0(), readMethod); Class<?>[] params = getParameterTypes(getClass0(), readMethod);
if (params.length != 0) { if (params.length != 0) {
throw new IntrospectionException("bad read method arg count: " throw new IntrospectionException("bad read method arg count: "
+ readMethod); + readMethod);
@ -654,7 +651,7 @@ public class PropertyDescriptor extends FeatureDescriptor {
} }
} }
if (writeMethod != null) { if (writeMethod != null) {
Class params[] = getParameterTypes(getClass0(), writeMethod); Class<?>[] params = getParameterTypes(getClass0(), writeMethod);
if (params.length != 1) { if (params.length != 1) {
throw new IntrospectionException("bad write method arg count: " throw new IntrospectionException("bad write method arg count: "
+ writeMethod); + writeMethod);

View File

@ -25,9 +25,6 @@
package java.beans; package java.beans;
import com.sun.beans.finder.PropertyEditorFinder;
import sun.awt.AppContext;
/** /**
* The PropertyEditorManager can be used to locate a property editor for * The PropertyEditorManager can be used to locate a property editor for
* any given type name. This property editor must support the * any given type name. This property editor must support the
@ -55,8 +52,6 @@ import sun.awt.AppContext;
public class PropertyEditorManager { public class PropertyEditorManager {
private static final Object FINDER_KEY = new Object();
/** /**
* Registers an editor class to edit values of the given target class. * Registers an editor class to edit values of the given target class.
* If the editor class is {@code null}, * If the editor class is {@code null},
@ -81,7 +76,7 @@ public class PropertyEditorManager {
if (sm != null) { if (sm != null) {
sm.checkPropertiesAccess(); sm.checkPropertiesAccess();
} }
getFinder().register(targetType, editorClass); ThreadGroupContext.getContext().getPropertyEditorFinder().register(targetType, editorClass);
} }
/** /**
@ -92,7 +87,7 @@ public class PropertyEditorManager {
* The result is null if no suitable editor can be found. * The result is null if no suitable editor can be found.
*/ */
public static PropertyEditor findEditor(Class<?> targetType) { public static PropertyEditor findEditor(Class<?> targetType) {
return getFinder().find(targetType); return ThreadGroupContext.getContext().getPropertyEditorFinder().find(targetType);
} }
/** /**
@ -104,7 +99,7 @@ public class PropertyEditorManager {
* e.g. Sun implementation initially sets to {"sun.beans.editors"}. * e.g. Sun implementation initially sets to {"sun.beans.editors"}.
*/ */
public static String[] getEditorSearchPath() { public static String[] getEditorSearchPath() {
return getFinder().getPackages(); return ThreadGroupContext.getContext().getPropertyEditorFinder().getPackages();
} }
/** /**
@ -125,17 +120,6 @@ public class PropertyEditorManager {
if (sm != null) { if (sm != null) {
sm.checkPropertiesAccess(); sm.checkPropertiesAccess();
} }
getFinder().setPackages(path); ThreadGroupContext.getContext().getPropertyEditorFinder().setPackages(path);
}
private static PropertyEditorFinder getFinder() {
AppContext context = AppContext.getAppContext();
Object object = context.get(FINDER_KEY);
if (object instanceof PropertyEditorFinder) {
return (PropertyEditorFinder) object;
}
PropertyEditorFinder finder = new PropertyEditorFinder();
context.put(FINDER_KEY, finder);
return finder;
} }
} }

View File

@ -251,7 +251,7 @@ public class PropertyEditorSupport implements PropertyEditor {
public synchronized void addPropertyChangeListener( public synchronized void addPropertyChangeListener(
PropertyChangeListener listener) { PropertyChangeListener listener) {
if (listeners == null) { if (listeners == null) {
listeners = new java.util.Vector(); listeners = new java.util.Vector<>();
} }
listeners.addElement(listener); listeners.addElement(listener);
} }
@ -278,25 +278,30 @@ public class PropertyEditorSupport implements PropertyEditor {
* Report that we have been modified to any interested listeners. * Report that we have been modified to any interested listeners.
*/ */
public void firePropertyChange() { public void firePropertyChange() {
java.util.Vector targets; java.util.Vector<PropertyChangeListener> targets;
synchronized (this) { synchronized (this) {
if (listeners == null) { if (listeners == null) {
return; return;
} }
targets = (java.util.Vector) listeners.clone(); targets = unsafeClone(listeners);
} }
// Tell our listeners that "everything" has changed. // Tell our listeners that "everything" has changed.
PropertyChangeEvent evt = new PropertyChangeEvent(source, null, null, null); PropertyChangeEvent evt = new PropertyChangeEvent(source, null, null, null);
for (int i = 0; i < targets.size(); i++) { for (int i = 0; i < targets.size(); i++) {
PropertyChangeListener target = (PropertyChangeListener)targets.elementAt(i); PropertyChangeListener target = targets.elementAt(i);
target.propertyChange(evt); target.propertyChange(evt);
} }
} }
@SuppressWarnings("unchecked")
private <T> java.util.Vector<T> unsafeClone(java.util.Vector<T> v) {
return (java.util.Vector<T>)v.clone();
}
//---------------------------------------------------------------------- //----------------------------------------------------------------------
private Object value; private Object value;
private Object source; private Object source;
private java.util.Vector listeners; private java.util.Vector<PropertyChangeListener> listeners;
} }

View File

@ -32,10 +32,12 @@ import java.lang.reflect.Field;
*/ */
class ReflectionUtils { class ReflectionUtils {
@SuppressWarnings("rawtypes")
public static boolean isPrimitive(Class type) { public static boolean isPrimitive(Class type) {
return primitiveTypeFor(type) != null; return primitiveTypeFor(type) != null;
} }
@SuppressWarnings("rawtypes")
public static Class primitiveTypeFor(Class wrapper) { public static Class primitiveTypeFor(Class wrapper) {
if (wrapper == Boolean.class) return Boolean.TYPE; if (wrapper == Boolean.class) return Boolean.TYPE;
if (wrapper == Byte.class) return Byte.TYPE; if (wrapper == Byte.class) return Byte.TYPE;
@ -58,6 +60,7 @@ class ReflectionUtils {
* @param el an exception listener to handle exceptions; or null * @param el an exception listener to handle exceptions; or null
* @return value of the field; null if not found or an error is encountered * @return value of the field; null if not found or an error is encountered
*/ */
@SuppressWarnings("rawtypes")
public static Object getPrivateField(Object instance, Class cls, public static Object getPrivateField(Object instance, Class cls,
String name, ExceptionListener el) { String name, ExceptionListener el) {
try { try {

View File

@ -116,10 +116,10 @@ public class SimpleBeanInfo implements BeanInfo {
*/ */
public java.awt.Image loadImage(final String resourceName) { public java.awt.Image loadImage(final String resourceName) {
try { try {
final Class c = getClass(); final Class<?> c = getClass();
java.awt.image.ImageProducer ip = (java.awt.image.ImageProducer) java.awt.image.ImageProducer ip = (java.awt.image.ImageProducer)
java.security.AccessController.doPrivileged( java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() { new java.security.PrivilegedAction<Object>() {
public Object run() { public Object run() {
java.net.URL url; java.net.URL url;
if ((url = c.getResource(resourceName)) == null) { if ((url = c.getResource(resourceName)) == null) {

View File

@ -212,7 +212,7 @@ public class Statement {
if (target == Class.class && methodName.equals("forName")) { if (target == Class.class && methodName.equals("forName")) {
return ClassFinder.resolveClass((String)arguments[0], this.loader); return ClassFinder.resolveClass((String)arguments[0], this.loader);
} }
Class[] argClasses = new Class[arguments.length]; Class<?>[] argClasses = new Class<?>[arguments.length];
for(int i = 0; i < arguments.length; i++) { for(int i = 0; i < arguments.length; i++) {
argClasses[i] = (arguments[i] == null) ? null : arguments[i].getClass(); argClasses[i] = (arguments[i] == null) ? null : arguments[i].getClass();
} }

View File

@ -0,0 +1,133 @@
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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.
*/
package java.beans;
import com.sun.beans.finder.BeanInfoFinder;
import com.sun.beans.finder.PropertyEditorFinder;
import java.awt.GraphicsEnvironment;
import java.util.HashMap;
import java.util.Map;
import java.util.WeakHashMap;
/**
* The {@code ThreadGroupContext} is an application-dependent
* context referenced by the specific {@link ThreadGroup}.
* This is a replacement for the {@link sun.awt.AppContext}.
*
* @author Sergey Malenkov
*/
final class ThreadGroupContext {
private static final Map<ThreadGroup, ThreadGroupContext> contexts = new WeakHashMap<>();
/**
* Returns the appropriate {@code AppContext} for the caller,
* as determined by its {@code ThreadGroup}.
*
* @return the application-dependent context
*/
static ThreadGroupContext getContext() {
ThreadGroup group = Thread.currentThread().getThreadGroup();
synchronized (contexts) {
ThreadGroupContext context = contexts.get(group);
if (context == null) {
context = new ThreadGroupContext();
contexts.put(group, context);
}
return context;
}
}
private volatile boolean isDesignTime;
private volatile Boolean isGuiAvailable;
private Map<Class<?>, BeanInfo> beanInfoCache;
private BeanInfoFinder beanInfoFinder;
private PropertyEditorFinder propertyEditorFinder;
boolean isDesignTime() {
return this.isDesignTime;
}
void setDesignTime(boolean isDesignTime) {
this.isDesignTime = isDesignTime;
}
boolean isGuiAvailable() {
Boolean isGuiAvailable = this.isGuiAvailable;
return (isGuiAvailable != null)
? isGuiAvailable.booleanValue()
: !GraphicsEnvironment.isHeadless();
}
void setGuiAvailable(boolean isGuiAvailable) {
this.isGuiAvailable = Boolean.valueOf(isGuiAvailable);
}
BeanInfo getBeanInfo(Class<?> type) {
return (this.beanInfoCache != null)
? this.beanInfoCache.get(type)
: null;
}
BeanInfo putBeanInfo(Class<?> type, BeanInfo info) {
if (this.beanInfoCache == null) {
this.beanInfoCache = new WeakHashMap<>();
}
return this.beanInfoCache.put(type, info);
}
void removeBeanInfo(Class<?> type) {
if (this.beanInfoCache != null) {
this.beanInfoCache.remove(type);
}
}
void clearBeanInfoCache() {
if (this.beanInfoCache != null) {
this.beanInfoCache.clear();
}
}
synchronized BeanInfoFinder getBeanInfoFinder() {
if (this.beanInfoFinder == null) {
this.beanInfoFinder = new BeanInfoFinder();
}
return this.beanInfoFinder;
}
synchronized PropertyEditorFinder getPropertyEditorFinder() {
if (this.propertyEditorFinder == null) {
this.propertyEditorFinder = new PropertyEditorFinder();
}
return this.propertyEditorFinder;
}
}

View File

@ -420,7 +420,7 @@ public class VetoableChangeSupport implements Serializable {
listeners = entry.getValue(); listeners = entry.getValue();
} else { } else {
if (children == null) { if (children == null) {
children = new Hashtable<String, VetoableChangeSupport>(); children = new Hashtable<>();
} }
VetoableChangeSupport vcs = new VetoableChangeSupport(this.source); VetoableChangeSupport vcs = new VetoableChangeSupport(this.source);
vcs.map.set(null, entry.getValue()); vcs.map.set(null, entry.getValue());
@ -449,7 +449,8 @@ public class VetoableChangeSupport implements Serializable {
ObjectInputStream.GetField fields = s.readFields(); ObjectInputStream.GetField fields = s.readFields();
Hashtable<String, VetoableChangeSupport> children = (Hashtable<String, VetoableChangeSupport>) fields.get("children", null); @SuppressWarnings("unchecked")
Hashtable<String, VetoableChangeSupport> children = (Hashtable<String, VetoableChangeSupport>)fields.get("children", null);
this.source = fields.get("source", null); this.source = fields.get("source", null);
fields.get("vetoableChangeSupportSerializedDataVersion", 2); fields.get("vetoableChangeSupportSerializedDataVersion", 2);

View File

@ -287,8 +287,8 @@ public class XMLEncoder extends Encoder implements AutoCloseable {
this.declaration = declaration; this.declaration = declaration;
this.indentation = indentation; this.indentation = indentation;
this.out = new OutputStreamWriter(out, cs.newEncoder()); this.out = new OutputStreamWriter(out, cs.newEncoder());
valueToExpression = new IdentityHashMap<Object, ValueData>(); valueToExpression = new IdentityHashMap<>();
targetToStatementList = new IdentityHashMap<Object, List<Statement>>(); targetToStatementList = new IdentityHashMap<>();
nameGenerator = new NameGenerator(); nameGenerator = new NameGenerator();
} }
@ -334,7 +334,7 @@ public class XMLEncoder extends Encoder implements AutoCloseable {
private List<Statement> statementList(Object target) { private List<Statement> statementList(Object target) {
List<Statement> list = targetToStatementList.get(target); List<Statement> list = targetToStatementList.get(target);
if (list == null) { if (list == null) {
list = new ArrayList<Statement>(); list = new ArrayList<>();
targetToStatementList.put(target, list); targetToStatementList.put(target, list);
} }
return list; return list;
@ -604,7 +604,7 @@ public class XMLEncoder extends Encoder implements AutoCloseable {
return; return;
} }
Class primitiveType = ReflectionUtils.primitiveTypeFor(value.getClass()); Class<?> primitiveType = ReflectionUtils.primitiveTypeFor(value.getClass());
if (primitiveType != null && target == value.getClass() && if (primitiveType != null && target == value.getClass() &&
methodName.equals("new")) { methodName.equals("new")) {
String primitiveTypeName = primitiveType.getName(); String primitiveTypeName = primitiveType.getName();

View File

@ -53,6 +53,7 @@ import java.util.Locale;
* @see java.util.Collection * @see java.util.Collection
*/ */
@SuppressWarnings("rawtypes")
public interface BeanContext extends BeanContextChild, Collection, DesignMode, Visibility { public interface BeanContext extends BeanContextChild, Collection, DesignMode, Visibility {
/** /**

View File

@ -65,6 +65,7 @@ public class BeanContextMembershipEvent extends BeanContextEvent {
* @throws NullPointerException if <CODE>changes</CODE> is <CODE>null</CODE> * @throws NullPointerException if <CODE>changes</CODE> is <CODE>null</CODE>
*/ */
@SuppressWarnings("rawtypes")
public BeanContextMembershipEvent(BeanContext bc, Collection changes) { public BeanContextMembershipEvent(BeanContext bc, Collection changes) {
super(bc); super(bc);
@ -117,6 +118,7 @@ public class BeanContextMembershipEvent extends BeanContextEvent {
* Gets the array of children affected by this event. * Gets the array of children affected by this event.
* @return the array of children effected * @return the array of children effected
*/ */
@SuppressWarnings("rawtypes")
public Iterator iterator() { return children.iterator(); } public Iterator iterator() { return children.iterator(); }
/* /*
@ -127,5 +129,6 @@ public class BeanContextMembershipEvent extends BeanContextEvent {
* The list of children affected by this * The list of children affected by this
* event notification. * event notification.
*/ */
@SuppressWarnings("rawtypes")
protected Collection children; protected Collection children;
} }

View File

@ -35,7 +35,7 @@ import java.util.Set;
class ExpiringCache { class ExpiringCache {
private long millisUntilExpiration; private long millisUntilExpiration;
private Map map; private Map<String,Entry> map;
// Clear out old entries every few queries // Clear out old entries every few queries
private int queryCount; private int queryCount;
private int queryOverflow = 300; private int queryOverflow = 300;
@ -61,10 +61,11 @@ class ExpiringCache {
this(30000); this(30000);
} }
@SuppressWarnings("serial")
ExpiringCache(long millisUntilExpiration) { ExpiringCache(long millisUntilExpiration) {
this.millisUntilExpiration = millisUntilExpiration; this.millisUntilExpiration = millisUntilExpiration;
map = new LinkedHashMap() { map = new LinkedHashMap<String,Entry>() {
protected boolean removeEldestEntry(Map.Entry eldest) { protected boolean removeEldestEntry(Map.Entry<String,Entry> eldest) {
return size() > MAX_ENTRIES; return size() > MAX_ENTRIES;
} }
}; };
@ -99,7 +100,7 @@ class ExpiringCache {
} }
private Entry entryFor(String key) { private Entry entryFor(String key) {
Entry entry = (Entry) map.get(key); Entry entry = map.get(key);
if (entry != null) { if (entry != null) {
long delta = System.currentTimeMillis() - entry.timestamp(); long delta = System.currentTimeMillis() - entry.timestamp();
if (delta < 0 || delta >= millisUntilExpiration) { if (delta < 0 || delta >= millisUntilExpiration) {
@ -111,12 +112,11 @@ class ExpiringCache {
} }
private void cleanup() { private void cleanup() {
Set keySet = map.keySet(); Set<String> keySet = map.keySet();
// Avoid ConcurrentModificationExceptions // Avoid ConcurrentModificationExceptions
String[] keys = new String[keySet.size()]; String[] keys = new String[keySet.size()];
int i = 0; int i = 0;
for (Iterator iter = keySet.iterator(); iter.hasNext(); ) { for (String key: keySet) {
String key = (String) iter.next();
keys[i++] = key; keys[i++] = key;
} }
for (int j = 0; j < keys.length; j++) { for (int j = 0; j < keys.length; j++) {

View File

@ -2006,7 +2006,7 @@ public class File
throws IOException throws IOException
{ {
s.defaultWriteObject(); s.defaultWriteObject();
s.writeChar(this.separatorChar); // Add the separator character s.writeChar(separatorChar); // Add the separator character
} }
/** /**

View File

@ -87,6 +87,7 @@ class LineNumberInputStream extends FilterInputStream {
* @see java.io.FilterInputStream#in * @see java.io.FilterInputStream#in
* @see java.io.LineNumberInputStream#getLineNumber() * @see java.io.LineNumberInputStream#getLineNumber()
*/ */
@SuppressWarnings("fallthrough")
public int read() throws IOException { public int read() throws IOException {
int c = pushBack; int c = pushBack;

View File

@ -120,6 +120,7 @@ public class LineNumberReader extends BufferedReader {
* @throws IOException * @throws IOException
* If an I/O error occurs * If an I/O error occurs
*/ */
@SuppressWarnings("fallthrough")
public int read() throws IOException { public int read() throws IOException {
synchronized (lock) { synchronized (lock) {
int c = super.read(); int c = super.read();
@ -159,6 +160,7 @@ public class LineNumberReader extends BufferedReader {
* @throws IOException * @throws IOException
* If an I/O error occurs * If an I/O error occurs
*/ */
@SuppressWarnings("fallthrough")
public int read(char cbuf[], int off, int len) throws IOException { public int read(char cbuf[], int off, int len) throws IOException {
synchronized (lock) { synchronized (lock) {
int n = super.read(cbuf, off, len); int n = super.read(cbuf, off, len);

View File

@ -689,9 +689,9 @@ public class ObjectInputStream
boolean hasNonPublicInterface = false; boolean hasNonPublicInterface = false;
// define proxy in class loader of non-public interface(s), if any // define proxy in class loader of non-public interface(s), if any
Class[] classObjs = new Class[interfaces.length]; Class<?>[] classObjs = new Class<?>[interfaces.length];
for (int i = 0; i < interfaces.length; i++) { for (int i = 0; i < interfaces.length; i++) {
Class cl = Class.forName(interfaces[i], false, latestLoader); Class<?> cl = Class.forName(interfaces[i], false, latestLoader);
if ((cl.getModifiers() & Modifier.PUBLIC) == 0) { if ((cl.getModifiers() & Modifier.PUBLIC) == 0) {
if (hasNonPublicInterface) { if (hasNonPublicInterface) {
if (nonPublicLoader != cl.getClassLoader()) { if (nonPublicLoader != cl.getClassLoader()) {
@ -1229,7 +1229,7 @@ public class ObjectInputStream
* "enableSubclassImplementation" SerializablePermission is checked. * "enableSubclassImplementation" SerializablePermission is checked.
*/ */
private void verifySubclass() { private void verifySubclass() {
Class cl = getClass(); Class<?> cl = getClass();
if (cl == ObjectInputStream.class) { if (cl == ObjectInputStream.class) {
return; return;
} }
@ -1473,12 +1473,12 @@ public class ObjectInputStream
* ClassNotFoundException will be associated with the class' handle in the * ClassNotFoundException will be associated with the class' handle in the
* handle table). * handle table).
*/ */
private Class readClass(boolean unshared) throws IOException { private Class<?> readClass(boolean unshared) throws IOException {
if (bin.readByte() != TC_CLASS) { if (bin.readByte() != TC_CLASS) {
throw new InternalError(); throw new InternalError();
} }
ObjectStreamClass desc = readClassDesc(false); ObjectStreamClass desc = readClassDesc(false);
Class cl = desc.forClass(); Class<?> cl = desc.forClass();
passHandle = handles.assign(unshared ? unsharedMarker : cl); passHandle = handles.assign(unshared ? unsharedMarker : cl);
ClassNotFoundException resolveEx = desc.getResolveException(); ClassNotFoundException resolveEx = desc.getResolveException();
@ -1542,7 +1542,7 @@ public class ObjectInputStream
ifaces[i] = bin.readUTF(); ifaces[i] = bin.readUTF();
} }
Class cl = null; Class<?> cl = null;
ClassNotFoundException resolveEx = null; ClassNotFoundException resolveEx = null;
bin.setBlockDataMode(true); bin.setBlockDataMode(true);
try { try {
@ -1586,7 +1586,7 @@ public class ObjectInputStream
"failed to read class descriptor").initCause(ex); "failed to read class descriptor").initCause(ex);
} }
Class cl = null; Class<?> cl = null;
ClassNotFoundException resolveEx = null; ClassNotFoundException resolveEx = null;
bin.setBlockDataMode(true); bin.setBlockDataMode(true);
try { try {
@ -1643,7 +1643,7 @@ public class ObjectInputStream
int len = bin.readInt(); int len = bin.readInt();
Object array = null; Object array = null;
Class cl, ccl = null; Class<?> cl, ccl = null;
if ((cl = desc.forClass()) != null) { if ((cl = desc.forClass()) != null) {
ccl = cl.getComponentType(); ccl = cl.getComponentType();
array = Array.newInstance(ccl, len); array = Array.newInstance(ccl, len);
@ -1696,7 +1696,7 @@ public class ObjectInputStream
* Reads in and returns enum constant, or null if enum type is * Reads in and returns enum constant, or null if enum type is
* unresolvable. Sets passHandle to enum constant's assigned handle. * unresolvable. Sets passHandle to enum constant's assigned handle.
*/ */
private Enum readEnum(boolean unshared) throws IOException { private Enum<?> readEnum(boolean unshared) throws IOException {
if (bin.readByte() != TC_ENUM) { if (bin.readByte() != TC_ENUM) {
throw new InternalError(); throw new InternalError();
} }
@ -1713,24 +1713,26 @@ public class ObjectInputStream
} }
String name = readString(false); String name = readString(false);
Enum en = null; Enum<?> result = null;
Class cl = desc.forClass(); Class<?> cl = desc.forClass();
if (cl != null) { if (cl != null) {
try { try {
en = Enum.valueOf(cl, name); @SuppressWarnings("unchecked")
Enum<?> en = Enum.valueOf((Class)cl, name);
result = en;
} catch (IllegalArgumentException ex) { } catch (IllegalArgumentException ex) {
throw (IOException) new InvalidObjectException( throw (IOException) new InvalidObjectException(
"enum constant " + name + " does not exist in " + "enum constant " + name + " does not exist in " +
cl).initCause(ex); cl).initCause(ex);
} }
if (!unshared) { if (!unshared) {
handles.setObject(enumHandle, en); handles.setObject(enumHandle, result);
} }
} }
handles.finish(enumHandle); handles.finish(enumHandle);
passHandle = enumHandle; passHandle = enumHandle;
return en; return result;
} }
/** /**
@ -1941,7 +1943,7 @@ public class ObjectInputStream
throws IOException throws IOException
{ {
// REMIND: is isInstance check necessary? // REMIND: is isInstance check necessary?
Class cl = desc.forClass(); Class<?> cl = desc.forClass();
if (cl != null && obj != null && !cl.isInstance(obj)) { if (cl != null && obj != null && !cl.isInstance(obj)) {
throw new ClassCastException(); throw new ClassCastException();
} }
@ -2140,7 +2142,7 @@ public class ObjectInputStream
* class descriptor, returns -1. Throws IllegalArgumentException if * class descriptor, returns -1. Throws IllegalArgumentException if
* neither incoming nor local class descriptor contains a match. * neither incoming nor local class descriptor contains a match.
*/ */
private int getFieldOffset(String name, Class type) { private int getFieldOffset(String name, Class<?> type) {
ObjectStreamField field = desc.getField(name, type); ObjectStreamField field = desc.getField(name, type);
if (field != null) { if (field != null) {
return field.getOffset(); return field.getOffset();
@ -2838,6 +2840,7 @@ public class ObjectInputStream
return readUTFBody(readUnsignedShort()); return readUTFBody(readUnsignedShort());
} }
@SuppressWarnings("deprecation")
public String readLine() throws IOException { public String readLine() throws IOException {
return din.readLine(); // deprecated, not worth optimizing return din.readLine(); // deprecated, not worth optimizing
} }

View File

@ -1034,7 +1034,7 @@ public class ObjectOutputStream
* "enableSubclassImplementation" SerializablePermission is checked. * "enableSubclassImplementation" SerializablePermission is checked.
*/ */
private void verifySubclass() { private void verifySubclass() {
Class cl = getClass(); Class<?> cl = getClass();
if (cl == ObjectOutputStream.class) { if (cl == ObjectOutputStream.class) {
return; return;
} }
@ -1060,22 +1060,22 @@ public class ObjectOutputStream
* override security-sensitive non-final methods. Returns true if subclass * override security-sensitive non-final methods. Returns true if subclass
* is "safe", false otherwise. * is "safe", false otherwise.
*/ */
private static boolean auditSubclass(final Class subcl) { private static boolean auditSubclass(final Class<?> subcl) {
Boolean result = AccessController.doPrivileged( Boolean result = AccessController.doPrivileged(
new PrivilegedAction<Boolean>() { new PrivilegedAction<Boolean>() {
public Boolean run() { public Boolean run() {
for (Class cl = subcl; for (Class<?> cl = subcl;
cl != ObjectOutputStream.class; cl != ObjectOutputStream.class;
cl = cl.getSuperclass()) cl = cl.getSuperclass())
{ {
try { try {
cl.getDeclaredMethod( cl.getDeclaredMethod(
"writeUnshared", new Class[] { Object.class }); "writeUnshared", new Class<?>[] { Object.class });
return Boolean.FALSE; return Boolean.FALSE;
} catch (NoSuchMethodException ex) { } catch (NoSuchMethodException ex) {
} }
try { try {
cl.getDeclaredMethod("putFields", (Class[]) null); cl.getDeclaredMethod("putFields", (Class<?>[]) null);
return Boolean.FALSE; return Boolean.FALSE;
} catch (NoSuchMethodException ex) { } catch (NoSuchMethodException ex) {
} }
@ -1122,11 +1122,11 @@ public class ObjectOutputStream
// check for replacement object // check for replacement object
Object orig = obj; Object orig = obj;
Class cl = obj.getClass(); Class<?> cl = obj.getClass();
ObjectStreamClass desc; ObjectStreamClass desc;
for (;;) { for (;;) {
// REMIND: skip this check for strings/arrays? // REMIND: skip this check for strings/arrays?
Class repCl; Class<?> repCl;
desc = ObjectStreamClass.lookup(cl, true); desc = ObjectStreamClass.lookup(cl, true);
if (!desc.hasWriteReplaceMethod() || if (!desc.hasWriteReplaceMethod() ||
(obj = desc.invokeWriteReplace(obj)) == null || (obj = desc.invokeWriteReplace(obj)) == null ||
@ -1169,7 +1169,7 @@ public class ObjectOutputStream
} else if (cl.isArray()) { } else if (cl.isArray()) {
writeArray(obj, desc, unshared); writeArray(obj, desc, unshared);
} else if (obj instanceof Enum) { } else if (obj instanceof Enum) {
writeEnum((Enum) obj, desc, unshared); writeEnum((Enum<?>) obj, desc, unshared);
} else if (obj instanceof Serializable) { } else if (obj instanceof Serializable) {
writeOrdinaryObject(obj, desc, unshared); writeOrdinaryObject(obj, desc, unshared);
} else { } else {
@ -1204,7 +1204,7 @@ public class ObjectOutputStream
/** /**
* Writes representation of given class to stream. * Writes representation of given class to stream.
*/ */
private void writeClass(Class cl, boolean unshared) throws IOException { private void writeClass(Class<?> cl, boolean unshared) throws IOException {
bout.writeByte(TC_CLASS); bout.writeByte(TC_CLASS);
writeClassDesc(ObjectStreamClass.lookup(cl, true), false); writeClassDesc(ObjectStreamClass.lookup(cl, true), false);
handles.assign(unshared ? null : cl); handles.assign(unshared ? null : cl);
@ -1237,7 +1237,7 @@ public class ObjectOutputStream
bout.writeByte(TC_PROXYCLASSDESC); bout.writeByte(TC_PROXYCLASSDESC);
handles.assign(unshared ? null : desc); handles.assign(unshared ? null : desc);
Class cl = desc.forClass(); Class<?> cl = desc.forClass();
Class[] ifaces = cl.getInterfaces(); Class[] ifaces = cl.getInterfaces();
bout.writeInt(ifaces.length); bout.writeInt(ifaces.length);
for (int i = 0; i < ifaces.length; i++) { for (int i = 0; i < ifaces.length; i++) {
@ -1269,7 +1269,7 @@ public class ObjectOutputStream
writeClassDescriptor(desc); writeClassDescriptor(desc);
} }
Class cl = desc.forClass(); Class<?> cl = desc.forClass();
bout.setBlockDataMode(true); bout.setBlockDataMode(true);
annotateClass(cl); annotateClass(cl);
bout.setBlockDataMode(false); bout.setBlockDataMode(false);
@ -1306,7 +1306,7 @@ public class ObjectOutputStream
writeClassDesc(desc, false); writeClassDesc(desc, false);
handles.assign(unshared ? null : array); handles.assign(unshared ? null : array);
Class ccl = desc.forClass().getComponentType(); Class<?> ccl = desc.forClass().getComponentType();
if (ccl.isPrimitive()) { if (ccl.isPrimitive()) {
if (ccl == Integer.TYPE) { if (ccl == Integer.TYPE) {
int[] ia = (int[]) array; int[] ia = (int[]) array;
@ -1377,7 +1377,7 @@ public class ObjectOutputStream
/** /**
* Writes given enum constant to stream. * Writes given enum constant to stream.
*/ */
private void writeEnum(Enum en, private void writeEnum(Enum<?> en,
ObjectStreamClass desc, ObjectStreamClass desc,
boolean unshared) boolean unshared)
throws IOException throws IOException
@ -1700,7 +1700,7 @@ public class ObjectOutputStream
* types, and any other non-null type matches assignable types only. * types, and any other non-null type matches assignable types only.
* Throws IllegalArgumentException if no matching field found. * Throws IllegalArgumentException if no matching field found.
*/ */
private int getFieldOffset(String name, Class type) { private int getFieldOffset(String name, Class<?> type) {
ObjectStreamField field = desc.getField(name, type); ObjectStreamField field = desc.getField(name, type);
if (field == null) { if (field == null) {
throw new IllegalArgumentException("no such field " + name + throw new IllegalArgumentException("no such field " + name +

View File

@ -144,7 +144,7 @@ public class ObjectStreamClass implements Serializable {
private volatile ClassDataSlot[] dataLayout; private volatile ClassDataSlot[] dataLayout;
/** serialization-appropriate constructor, or null if none */ /** serialization-appropriate constructor, or null if none */
private Constructor cons; private Constructor<?> cons;
/** class-defined writeObject method, or null if none */ /** class-defined writeObject method, or null if none */
private Method writeObjectMethod; private Method writeObjectMethod;
/** class-defined readObject method, or null if none */ /** class-defined readObject method, or null if none */
@ -1308,9 +1308,9 @@ public class ObjectStreamClass implements Serializable {
* Access checks are disabled on the returned constructor (if any), since * Access checks are disabled on the returned constructor (if any), since
* the defining class may still be non-public. * the defining class may still be non-public.
*/ */
private static Constructor getExternalizableConstructor(Class<?> cl) { private static Constructor<?> getExternalizableConstructor(Class<?> cl) {
try { try {
Constructor cons = cl.getDeclaredConstructor((Class<?>[]) null); Constructor<?> cons = cl.getDeclaredConstructor((Class<?>[]) null);
cons.setAccessible(true); cons.setAccessible(true);
return ((cons.getModifiers() & Modifier.PUBLIC) != 0) ? return ((cons.getModifiers() & Modifier.PUBLIC) != 0) ?
cons : null; cons : null;
@ -1324,7 +1324,7 @@ public class ObjectStreamClass implements Serializable {
* superclass, or null if none found. Access checks are disabled on the * superclass, or null if none found. Access checks are disabled on the
* returned constructor (if any). * returned constructor (if any).
*/ */
private static Constructor getSerializableConstructor(Class<?> cl) { private static Constructor<?> getSerializableConstructor(Class<?> cl) {
Class<?> initCl = cl; Class<?> initCl = cl;
while (Serializable.class.isAssignableFrom(initCl)) { while (Serializable.class.isAssignableFrom(initCl)) {
if ((initCl = initCl.getSuperclass()) == null) { if ((initCl = initCl.getSuperclass()) == null) {
@ -1332,7 +1332,7 @@ public class ObjectStreamClass implements Serializable {
} }
} }
try { try {
Constructor cons = initCl.getDeclaredConstructor((Class<?>[]) null); Constructor<?> cons = initCl.getDeclaredConstructor((Class<?>[]) null);
int mods = cons.getModifiers(); int mods = cons.getModifiers();
if ((mods & Modifier.PRIVATE) != 0 || if ((mods & Modifier.PRIVATE) != 0 ||
((mods & (Modifier.PUBLIC | Modifier.PROTECTED)) == 0 && ((mods & (Modifier.PUBLIC | Modifier.PROTECTED)) == 0 &&
@ -1802,7 +1802,7 @@ public class ObjectStreamClass implements Serializable {
signature = getClassSignature(field.getType()); signature = getClassSignature(field.getType());
} }
public MemberSignature(Constructor cons) { public MemberSignature(Constructor<?> cons) {
member = cons; member = cons;
name = cons.getName(); name = cons.getName();
signature = getMethodSignature( signature = getMethodSignature(

View File

@ -1049,6 +1049,7 @@ public class RandomAccessFile implements DataOutput, DataInput, Closeable {
* @param s a string of bytes to be written. * @param s a string of bytes to be written.
* @exception IOException if an I/O error occurs. * @exception IOException if an I/O error occurs.
*/ */
@SuppressWarnings("deprecation")
public final void writeBytes(String s) throws IOException { public final void writeBytes(String s) throws IOException {
int len = s.length(); int len = s.length();
byte[] b = new byte[len]; byte[] b = new byte[len];

View File

@ -44,7 +44,7 @@ import java.util.Vector;
*/ */
public public
class SequenceInputStream extends InputStream { class SequenceInputStream extends InputStream {
Enumeration e; Enumeration<? extends InputStream> e;
InputStream in; InputStream in;
/** /**
@ -85,7 +85,7 @@ class SequenceInputStream extends InputStream {
* @param s2 the second input stream to read. * @param s2 the second input stream to read.
*/ */
public SequenceInputStream(InputStream s1, InputStream s2) { public SequenceInputStream(InputStream s1, InputStream s2) {
Vector v = new Vector(2); Vector<InputStream> v = new Vector<>(2);
v.addElement(s1); v.addElement(s1);
v.addElement(s2); v.addElement(s2);

View File

@ -258,7 +258,7 @@ public abstract class ClassLoader {
private final Set<ProtectionDomain> domains; private final Set<ProtectionDomain> domains;
// Invoked by the VM to record every loaded class with this loader. // Invoked by the VM to record every loaded class with this loader.
void addClass(Class c) { void addClass(Class<?> c) {
classes.addElement(c); classes.addElement(c);
} }
@ -402,7 +402,7 @@ public abstract class ClassLoader {
{ {
synchronized (getClassLoadingLock(name)) { synchronized (getClassLoadingLock(name)) {
// First, check if the class has already been loaded // First, check if the class has already been loaded
Class c = findLoadedClass(name); Class<?> c = findLoadedClass(name);
if (c == null) { if (c == null) {
long t0 = System.nanoTime(); long t0 = System.nanoTime();
try { try {
@ -468,7 +468,7 @@ public abstract class ClassLoader {
} }
// This method is invoked by the virtual machine to load a class. // This method is invoked by the virtual machine to load a class.
private Class loadClassInternal(String name) private Class<?> loadClassInternal(String name)
throws ClassNotFoundException throws ClassNotFoundException
{ {
// For backward compatibility, explicitly lock on 'this' when // For backward compatibility, explicitly lock on 'this' when
@ -483,7 +483,7 @@ public abstract class ClassLoader {
} }
// Invoked by the VM after loading class with this loader. // Invoked by the VM after loading class with this loader.
private void checkPackageAccess(Class cls, ProtectionDomain pd) { private void checkPackageAccess(Class<?> cls, ProtectionDomain pd) {
final SecurityManager sm = System.getSecurityManager(); final SecurityManager sm = System.getSecurityManager();
if (sm != null) { if (sm != null) {
final String name = cls.getName(); final String name = cls.getName();
@ -669,9 +669,9 @@ public abstract class ClassLoader {
return source; return source;
} }
private Class defineTransformedClass(String name, byte[] b, int off, int len, private Class<?> defineTransformedClass(String name, byte[] b, int off, int len,
ProtectionDomain pd, ProtectionDomain pd,
ClassFormatError cfe, String source) ClassFormatError cfe, String source)
throws ClassFormatError throws ClassFormatError
{ {
// Class format error - try to transform the bytecode and // Class format error - try to transform the bytecode and
@ -679,7 +679,7 @@ public abstract class ClassLoader {
// //
ClassFileTransformer[] transformers = ClassFileTransformer[] transformers =
ClassFileTransformer.getTransformers(); ClassFileTransformer.getTransformers();
Class c = null; Class<?> c = null;
if (transformers != null) { if (transformers != null) {
for (ClassFileTransformer transformer : transformers) { for (ClassFileTransformer transformer : transformers) {
@ -704,7 +704,7 @@ public abstract class ClassLoader {
return c; return c;
} }
private void postDefineClass(Class c, ProtectionDomain pd) private void postDefineClass(Class<?> c, ProtectionDomain pd)
{ {
if (pd.getCodeSource() != null) { if (pd.getCodeSource() != null) {
Certificate certs[] = pd.getCodeSource().getCertificates(); Certificate certs[] = pd.getCodeSource().getCertificates();
@ -784,7 +784,7 @@ public abstract class ClassLoader {
{ {
protectionDomain = preDefineClass(name, protectionDomain); protectionDomain = preDefineClass(name, protectionDomain);
Class c = null; Class<?> c = null;
String source = defineClassSourceLocation(protectionDomain); String source = defineClassSourceLocation(protectionDomain);
try { try {
@ -882,7 +882,7 @@ public abstract class ClassLoader {
protectionDomain = preDefineClass(name, protectionDomain); protectionDomain = preDefineClass(name, protectionDomain);
Class c = null; Class<?> c = null;
String source = defineClassSourceLocation(protectionDomain); String source = defineClassSourceLocation(protectionDomain);
try { try {
@ -899,15 +899,15 @@ public abstract class ClassLoader {
return c; return c;
} }
private native Class defineClass0(String name, byte[] b, int off, int len, private native Class<?> defineClass0(String name, byte[] b, int off, int len,
ProtectionDomain pd); ProtectionDomain pd);
private native Class defineClass1(String name, byte[] b, int off, int len, private native Class<?> defineClass1(String name, byte[] b, int off, int len,
ProtectionDomain pd, String source); ProtectionDomain pd, String source);
private native Class defineClass2(String name, java.nio.ByteBuffer b, private native Class<?> defineClass2(String name, java.nio.ByteBuffer b,
int off, int len, ProtectionDomain pd, int off, int len, ProtectionDomain pd,
String source); String source);
// true if the name is null or has the potential to be a valid binary name // true if the name is null or has the potential to be a valid binary name
private boolean checkName(String name) { private boolean checkName(String name) {
@ -1010,7 +1010,7 @@ public abstract class ClassLoader {
resolveClass0(c); resolveClass0(c);
} }
private native void resolveClass0(Class c); private native void resolveClass0(Class<?> c);
/** /**
* Finds a class with the specified <a href="#name">binary name</a>, * Finds a class with the specified <a href="#name">binary name</a>,
@ -1041,7 +1041,7 @@ public abstract class ClassLoader {
if (system == null) { if (system == null) {
if (!checkName(name)) if (!checkName(name))
throw new ClassNotFoundException(name); throw new ClassNotFoundException(name);
Class cls = findBootstrapClass(name); Class<?> cls = findBootstrapClass(name);
if (cls == null) { if (cls == null) {
throw new ClassNotFoundException(name); throw new ClassNotFoundException(name);
} }
@ -1054,7 +1054,7 @@ public abstract class ClassLoader {
* Returns a class loaded by the bootstrap class loader; * Returns a class loaded by the bootstrap class loader;
* or return null if not found. * or return null if not found.
*/ */
private Class findBootstrapClassOrNull(String name) private Class<?> findBootstrapClassOrNull(String name)
{ {
if (!checkName(name)) return null; if (!checkName(name)) return null;
@ -1062,7 +1062,7 @@ public abstract class ClassLoader {
} }
// return null if not found // return null if not found
private native Class findBootstrapClass(String name); private native Class<?> findBootstrapClass(String name);
/** /**
* Returns the class with the given <a href="#name">binary name</a> if this * Returns the class with the given <a href="#name">binary name</a> if this
@ -1084,7 +1084,7 @@ public abstract class ClassLoader {
return findLoadedClass0(name); return findLoadedClass0(name);
} }
private native final Class findLoadedClass0(String name); private native final Class<?> findLoadedClass0(String name);
/** /**
* Sets the signers of a class. This should be invoked after defining a * Sets the signers of a class. This should be invoked after defining a
@ -1528,7 +1528,7 @@ public abstract class ClassLoader {
// invocation and the desired invoker. // invocation and the desired invoker.
static ClassLoader getCallerClassLoader() { static ClassLoader getCallerClassLoader() {
// NOTE use of more generic Reflection.getCallerClass() // NOTE use of more generic Reflection.getCallerClass()
Class caller = Reflection.getCallerClass(3); Class<?> caller = Reflection.getCallerClass(3);
// This can be null if the VM is requesting it // This can be null if the VM is requesting it
if (caller == null) { if (caller == null) {
return null; return null;
@ -1722,7 +1722,7 @@ public abstract class ClassLoader {
private int jniVersion; private int jniVersion;
// the class from which the library is loaded, also indicates // the class from which the library is loaded, also indicates
// the loader this native library belongs. // the loader this native library belongs.
private Class fromClass; private Class<?> fromClass;
// the canonicalized name of the native library. // the canonicalized name of the native library.
String name; String name;
@ -1730,7 +1730,7 @@ public abstract class ClassLoader {
native long find(String name); native long find(String name);
native void unload(); native void unload();
public NativeLibrary(Class fromClass, String name) { public NativeLibrary(Class<?> fromClass, String name) {
this.name = name; this.name = name;
this.fromClass = fromClass; this.fromClass = fromClass;
} }
@ -1758,7 +1758,7 @@ public abstract class ClassLoader {
} }
// Invoked in the VM to determine the context class in // Invoked in the VM to determine the context class in
// JNI_Load/JNI_Unload // JNI_Load/JNI_Unload
static Class getFromClass() { static Class<?> getFromClass() {
return ClassLoader.nativeLibraryContext.peek().fromClass; return ClassLoader.nativeLibraryContext.peek().fromClass;
} }
} }
@ -1813,7 +1813,7 @@ public abstract class ClassLoader {
} }
// Invoked in the java.lang.Runtime class to implement load and loadLibrary. // Invoked in the java.lang.Runtime class to implement load and loadLibrary.
static void loadLibrary(Class fromClass, String name, static void loadLibrary(Class<?> fromClass, String name,
boolean isAbsolute) { boolean isAbsolute) {
ClassLoader loader = ClassLoader loader =
(fromClass == null) ? null : fromClass.getClassLoader(); (fromClass == null) ? null : fromClass.getClassLoader();
@ -1860,7 +1860,7 @@ public abstract class ClassLoader {
throw new UnsatisfiedLinkError("no " + name + " in java.library.path"); throw new UnsatisfiedLinkError("no " + name + " in java.library.path");
} }
private static boolean loadLibrary0(Class fromClass, final File file) { private static boolean loadLibrary0(Class<?> fromClass, final File file) {
boolean exists = AccessController.doPrivileged( boolean exists = AccessController.doPrivileged(
new PrivilegedAction<Object>() { new PrivilegedAction<Object>() {
public Object run() { public Object run() {
@ -2194,8 +2194,8 @@ class SystemClassLoaderAction
return parent; return parent;
} }
Constructor ctor = Class.forName(cls, true, parent) Constructor<?> ctor = Class.forName(cls, true, parent)
.getDeclaredConstructor(new Class[] { ClassLoader.class }); .getDeclaredConstructor(new Class<?>[] { ClassLoader.class });
ClassLoader sys = (ClassLoader) ctor.newInstance( ClassLoader sys = (ClassLoader) ctor.newInstance(
new Object[] { parent }); new Object[] { parent });
Thread.currentThread().setContextClassLoader(sys); Thread.currentThread().setContextClassLoader(sys);

View File

@ -173,8 +173,8 @@ public abstract class Enum<E extends Enum<E>>
* method is the order in which the constants are declared. * method is the order in which the constants are declared.
*/ */
public final int compareTo(E o) { public final int compareTo(E o) {
Enum other = (Enum)o; Enum<?> other = (Enum<?>)o;
Enum self = this; Enum<E> self = this;
if (self.getClass() != other.getClass() && // optimization if (self.getClass() != other.getClass() && // optimization
self.getDeclaringClass() != other.getDeclaringClass()) self.getDeclaringClass() != other.getDeclaringClass())
throw new ClassCastException(); throw new ClassCastException();
@ -193,10 +193,11 @@ public abstract class Enum<E extends Enum<E>>
* @return the Class object corresponding to this enum constant's * @return the Class object corresponding to this enum constant's
* enum type * enum type
*/ */
@SuppressWarnings("unchecked")
public final Class<E> getDeclaringClass() { public final Class<E> getDeclaringClass() {
Class clazz = getClass(); Class<?> clazz = getClass();
Class zuper = clazz.getSuperclass(); Class<?> zuper = clazz.getSuperclass();
return (zuper == Enum.class) ? clazz : zuper; return (zuper == Enum.class) ? (Class<E>)clazz : (Class<E>)zuper;
} }
/** /**

View File

@ -608,5 +608,5 @@ public class Package implements java.lang.reflect.AnnotatedElement {
private final String implVendor; private final String implVendor;
private final URL sealBase; private final URL sealBase;
private transient final ClassLoader loader; private transient final ClassLoader loader;
private transient Class packageInfo; private transient Class<?> packageInfo;
} }

View File

@ -780,7 +780,7 @@ public class Runtime {
load0(System.getCallerClass(), filename); load0(System.getCallerClass(), filename);
} }
synchronized void load0(Class fromClass, String filename) { synchronized void load0(Class<?> fromClass, String filename) {
SecurityManager security = System.getSecurityManager(); SecurityManager security = System.getSecurityManager();
if (security != null) { if (security != null) {
security.checkLink(filename); security.checkLink(filename);
@ -833,7 +833,7 @@ public class Runtime {
loadLibrary0(System.getCallerClass(), libname); loadLibrary0(System.getCallerClass(), libname);
} }
synchronized void loadLibrary0(Class fromClass, String libname) { synchronized void loadLibrary0(Class<?> fromClass, String libname) {
SecurityManager security = System.getSecurityManager(); SecurityManager security = System.getSecurityManager();
if (security != null) { if (security != null) {
security.checkLink(libname); security.checkLink(libname);

View File

@ -400,7 +400,7 @@ class SecurityManager {
*/ */
@Deprecated @Deprecated
protected Class<?> currentLoadedClass() { protected Class<?> currentLoadedClass() {
Class c = currentLoadedClass0(); Class<?> c = currentLoadedClass0();
if ((c != null) && hasAllPermission()) if ((c != null) && hasAllPermission())
c = null; c = null;
return c; return c;
@ -1715,7 +1715,7 @@ class SecurityManager {
checkPermission(new SecurityPermission(target)); checkPermission(new SecurityPermission(target));
} }
private native Class currentLoadedClass0(); private native Class<?> currentLoadedClass0();
/** /**
* Returns the thread group into which to instantiate any new * Returns the thread group into which to instantiate any new

View File

@ -1245,6 +1245,9 @@ public final class String
} }
return n1 - n2; return n1 - n2;
} }
/** Replaces the de-serialized object. */
private Object readResolve() { return CASE_INSENSITIVE_ORDER; }
} }
/** /**

View File

@ -1171,13 +1171,13 @@ public final class System {
private static void setJavaLangAccess() { private static void setJavaLangAccess() {
// Allow privileged classes outside of java.lang // Allow privileged classes outside of java.lang
sun.misc.SharedSecrets.setJavaLangAccess(new sun.misc.JavaLangAccess(){ sun.misc.SharedSecrets.setJavaLangAccess(new sun.misc.JavaLangAccess(){
public sun.reflect.ConstantPool getConstantPool(Class klass) { public sun.reflect.ConstantPool getConstantPool(Class<?> klass) {
return klass.getConstantPool(); return klass.getConstantPool();
} }
public void setAnnotationType(Class klass, AnnotationType type) { public void setAnnotationType(Class<?> klass, AnnotationType type) {
klass.setAnnotationType(type); klass.setAnnotationType(type);
} }
public AnnotationType getAnnotationType(Class klass) { public AnnotationType getAnnotationType(Class<?> klass) {
return klass.getAnnotationType(); return klass.getAnnotationType();
} }
public <E extends Enum<E>> public <E extends Enum<E>>

View File

@ -1650,7 +1650,7 @@ class Thread implements Runnable {
* security-sensitive non-final methods, or else the * security-sensitive non-final methods, or else the
* "enableContextClassLoaderOverride" RuntimePermission is checked. * "enableContextClassLoaderOverride" RuntimePermission is checked.
*/ */
private static boolean isCCLOverridden(Class cl) { private static boolean isCCLOverridden(Class<?> cl) {
if (cl == Thread.class) if (cl == Thread.class)
return false; return false;
@ -1670,21 +1670,21 @@ class Thread implements Runnable {
* override security-sensitive non-final methods. Returns true if the * override security-sensitive non-final methods. Returns true if the
* subclass overrides any of the methods, false otherwise. * subclass overrides any of the methods, false otherwise.
*/ */
private static boolean auditSubclass(final Class subcl) { private static boolean auditSubclass(final Class<?> subcl) {
Boolean result = AccessController.doPrivileged( Boolean result = AccessController.doPrivileged(
new PrivilegedAction<Boolean>() { new PrivilegedAction<Boolean>() {
public Boolean run() { public Boolean run() {
for (Class cl = subcl; for (Class<?> cl = subcl;
cl != Thread.class; cl != Thread.class;
cl = cl.getSuperclass()) cl = cl.getSuperclass())
{ {
try { try {
cl.getDeclaredMethod("getContextClassLoader", new Class[0]); cl.getDeclaredMethod("getContextClassLoader", new Class<?>[0]);
return Boolean.TRUE; return Boolean.TRUE;
} catch (NoSuchMethodException ex) { } catch (NoSuchMethodException ex) {
} }
try { try {
Class[] params = {ClassLoader.class}; Class<?>[] params = {ClassLoader.class};
cl.getDeclaredMethod("setContextClassLoader", params); cl.getDeclaredMethod("setContextClassLoader", params);
return Boolean.TRUE; return Boolean.TRUE;
} catch (NoSuchMethodException ex) { } catch (NoSuchMethodException ex) {

View File

@ -670,6 +670,7 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
* {@link Thread#suspend} for details. * {@link Thread#suspend} for details.
*/ */
@Deprecated @Deprecated
@SuppressWarnings("deprecation")
public final void suspend() { public final void suspend() {
if (stopOrSuspend(true)) if (stopOrSuspend(true))
Thread.currentThread().suspend(); Thread.currentThread().suspend();
@ -682,6 +683,7 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
* if (and only if) the current thread is found to be in this thread * if (and only if) the current thread is found to be in this thread
* group or one of its subgroups. * group or one of its subgroups.
*/ */
@SuppressWarnings("deprecation")
private boolean stopOrSuspend(boolean suspend) { private boolean stopOrSuspend(boolean suspend) {
boolean suicide = false; boolean suicide = false;
Thread us = Thread.currentThread(); Thread us = Thread.currentThread();
@ -731,6 +733,7 @@ class ThreadGroup implements Thread.UncaughtExceptionHandler {
* deadlock-prone. See {@link Thread#suspend} for details. * deadlock-prone. See {@link Thread#suspend} for details.
*/ */
@Deprecated @Deprecated
@SuppressWarnings("deprecation")
public final void resume() { public final void resume() {
int ngroupsSnapshot; int ngroupsSnapshot;
ThreadGroup[] groupsSnapshot; ThreadGroup[] groupsSnapshot;

View File

@ -40,12 +40,12 @@ public final class ClassDefinition {
/** /**
* The class to redefine * The class to redefine
*/ */
private final Class mClass; private final Class<?> mClass;
/** /**
* The replacement class file bytes * The replacement class file bytes
*/ */
private final byte[] mClassFile; private final byte[] mClassFile;
/** /**
* Creates a new <code>ClassDefinition</code> binding using the supplied * Creates a new <code>ClassDefinition</code> binding using the supplied

View File

@ -576,7 +576,7 @@ public class ManagementFactory {
Class<T> mxbeanInterface) Class<T> mxbeanInterface)
throws java.io.IOException { throws java.io.IOException {
final Class interfaceClass = mxbeanInterface; final Class<?> interfaceClass = mxbeanInterface;
// Only allow MXBean interfaces from rt.jar loaded by the // Only allow MXBean interfaces from rt.jar loaded by the
// bootstrap class loader // bootstrap class loader
final ClassLoader loader = final ClassLoader loader =

View File

@ -314,7 +314,7 @@ enum PlatformComponent {
private final String domain; private final String domain;
private final String type; private final String type;
private final Set<String> keyProperties; private final Set<String> keyProperties;
private final MXBeanFetcher fetcher; private final MXBeanFetcher<?> fetcher;
private final PlatformComponent[] subComponents; private final PlatformComponent[] subComponents;
private final boolean singleton; private final boolean singleton;
@ -322,7 +322,7 @@ enum PlatformComponent {
String domain, String type, String domain, String type,
Set<String> keyProperties, Set<String> keyProperties,
boolean singleton, boolean singleton,
MXBeanFetcher fetcher, MXBeanFetcher<?> fetcher,
PlatformComponent... subComponents) { PlatformComponent... subComponents) {
this.mxbeanInterfaceName = intfName; this.mxbeanInterfaceName = intfName;
this.domain = domain; this.domain = domain;
@ -373,7 +373,7 @@ enum PlatformComponent {
<T extends PlatformManagedObject> <T extends PlatformManagedObject>
List<T> getMXBeans(Class<T> mxbeanInterface) List<T> getMXBeans(Class<T> mxbeanInterface)
{ {
return fetcher.getMXBeans(); return (List<T>) fetcher.getMXBeans();
} }
<T extends PlatformManagedObject> T getSingletonMXBean(Class<T> mxbeanInterface) <T extends PlatformManagedObject> T getSingletonMXBean(Class<T> mxbeanInterface)
@ -382,7 +382,7 @@ enum PlatformComponent {
throw new IllegalArgumentException(mxbeanInterfaceName + throw new IllegalArgumentException(mxbeanInterfaceName +
" can have zero or more than one instances"); " can have zero or more than one instances");
List<T> list = fetcher.getMXBeans(); List<T> list = getMXBeans(mxbeanInterface);
assert list.size() == 1; assert list.size() == 1;
return list.isEmpty() ? null : list.get(0); return list.isEmpty() ? null : list.get(0);
} }

File diff suppressed because it is too large Load Diff

View File

@ -32,6 +32,7 @@ import java.util.Iterator;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.ServiceLoader;
import java.security.AccessController; import java.security.AccessController;
import java.io.ObjectStreamException; import java.io.ObjectStreamException;
import java.io.IOException; import java.io.IOException;
@ -39,7 +40,6 @@ import java.io.ObjectInputStream;
import sun.security.action.*; import sun.security.action.*;
import sun.net.InetAddressCachePolicy; import sun.net.InetAddressCachePolicy;
import sun.net.util.IPAddressUtil; import sun.net.util.IPAddressUtil;
import sun.misc.Service;
import sun.net.spi.nameservice.*; import sun.net.spi.nameservice.*;
/** /**
@ -876,10 +876,9 @@ class InetAddress implements java.io.Serializable {
nameService = java.security.AccessController.doPrivileged( nameService = java.security.AccessController.doPrivileged(
new java.security.PrivilegedExceptionAction<NameService>() { new java.security.PrivilegedExceptionAction<NameService>() {
public NameService run() { public NameService run() {
// sun.misc.Service.providers returns a raw Iterator
@SuppressWarnings("unchecked")
Iterator<NameServiceDescriptor> itr = Iterator<NameServiceDescriptor> itr =
Service.providers(NameServiceDescriptor.class); ServiceLoader.load(NameServiceDescriptor.class)
.iterator();
while (itr.hasNext()) { while (itr.hasNext()) {
NameServiceDescriptor nsd = itr.next(); NameServiceDescriptor nsd = itr.next();
if (providerName. if (providerName.

View File

@ -156,6 +156,7 @@ public final class MarshalledObject<T> implements Serializable {
(locBytes == null ? null : new ByteArrayInputStream(locBytes)); (locBytes == null ? null : new ByteArrayInputStream(locBytes));
MarshalledObjectInputStream in = MarshalledObjectInputStream in =
new MarshalledObjectInputStream(bin, lin); new MarshalledObjectInputStream(bin, lin);
@SuppressWarnings("unchecked")
T obj = (T) in.readObject(); T obj = (T) in.readObject();
in.close(); in.close();
return obj; return obj;
@ -190,7 +191,7 @@ public final class MarshalledObject<T> implements Serializable {
return true; return true;
if (obj != null && obj instanceof MarshalledObject) { if (obj != null && obj instanceof MarshalledObject) {
MarshalledObject other = (MarshalledObject) obj; MarshalledObject<?> other = (MarshalledObject<?>) obj;
// if either is a ref to null, both must be // if either is a ref to null, both must be
if (objBytes == null || other.objBytes == null) if (objBytes == null || other.objBytes == null)

View File

@ -118,7 +118,7 @@ public final class VMID implements java.io.Serializable {
StringBuffer result = new StringBuffer(); StringBuffer result = new StringBuffer();
if (addr != null) if (addr != null)
for (int i = 0; i < addr.length; ++ i) { for (int i = 0; i < addr.length; ++ i) {
int x = (int) (addr[i] & 0xFF); int x = addr[i] & 0xFF;
result.append((x < 0x10 ? "0" : "") + result.append((x < 0x10 ? "0" : "") +
Integer.toString(x, 16)); Integer.toString(x, 16));
} }

View File

@ -39,7 +39,7 @@ import java.util.*;
public class LogStream extends PrintStream { public class LogStream extends PrintStream {
/** table mapping known log names to log stream objects */ /** table mapping known log names to log stream objects */
private static Hashtable known = new Hashtable(5); private static Map<String,LogStream> known = new HashMap<>(5);
/** default output stream for new logs */ /** default output stream for new logs */
private static PrintStream defaultStream = System.err; private static PrintStream defaultStream = System.err;
@ -90,7 +90,7 @@ public class LogStream extends PrintStream {
public static LogStream log(String name) { public static LogStream log(String name) {
LogStream stream; LogStream stream;
synchronized (known) { synchronized (known) {
stream = (LogStream)known.get(name); stream = known.get(name);
if (stream == null) { if (stream == null) {
stream = new LogStream(name, defaultStream); stream = new LogStream(name, defaultStream);
} }

View File

@ -436,7 +436,7 @@ public abstract class RemoteObject implements Remote, java.io.Serializable {
*/ */
String internalRefClassName = String internalRefClassName =
RemoteRef.packagePrefix + "." + refClassName; RemoteRef.packagePrefix + "." + refClassName;
Class refClass = Class.forName(internalRefClassName); Class<?> refClass = Class.forName(internalRefClassName);
try { try {
ref = (RemoteRef) refClass.newInstance(); ref = (RemoteRef) refClass.newInstance();

View File

@ -150,6 +150,7 @@ public class Date extends java.util.Date {
* <P> * <P>
* @return a String in yyyy-mm-dd format * @return a String in yyyy-mm-dd format
*/ */
@SuppressWarnings("deprecation")
public String toString () { public String toString () {
int year = super.getYear() + 1900; int year = super.getYear() + 1900;
int month = super.getMonth() + 1; int month = super.getMonth() + 1;

View File

@ -80,7 +80,7 @@ public class DriverManager {
// List of registered JDBC drivers // List of registered JDBC drivers
private final static CopyOnWriteArrayList<DriverInfo> registeredDrivers = new CopyOnWriteArrayList<DriverInfo>(); private final static CopyOnWriteArrayList<DriverInfo> registeredDrivers = new CopyOnWriteArrayList<>();
private static volatile int loginTimeout = 0; private static volatile int loginTimeout = 0;
private static volatile java.io.PrintWriter logWriter = null; private static volatile java.io.PrintWriter logWriter = null;
private static volatile java.io.PrintStream logStream = null; private static volatile java.io.PrintStream logStream = null;
@ -357,7 +357,7 @@ public class DriverManager {
* @return the list of JDBC Drivers loaded by the caller's class loader * @return the list of JDBC Drivers loaded by the caller's class loader
*/ */
public static java.util.Enumeration<Driver> getDrivers() { public static java.util.Enumeration<Driver> getDrivers() {
java.util.Vector<Driver> result = new java.util.Vector<Driver>(); java.util.Vector<Driver> result = new java.util.Vector<>();
// Gets the classloader of the code that called this method, may // Gets the classloader of the code that called this method, may
// be null. // be null.
@ -621,15 +621,18 @@ class DriverInfo {
this.driver = driver; this.driver = driver;
} }
@Override
public boolean equals(Object other) { public boolean equals(Object other) {
return (other instanceof DriverInfo) return (other instanceof DriverInfo)
&& this.driver == ((DriverInfo) other).driver; && this.driver == ((DriverInfo) other).driver;
} }
@Override
public int hashCode() { public int hashCode() {
return driver.hashCode(); return driver.hashCode();
} }
@Override
public String toString() { public String toString() {
return ("driver[className=" + driver + "]"); return ("driver[className=" + driver + "]");
} }

Some files were not shown because too many files have changed in this diff Show More