提交 c20cf6c8 编写于 作者: L lana

Merge

......@@ -47,7 +47,6 @@ SUBDIRS_enterprise = crypto/provider jndi \
org rowset net/httpserver
SUBDIRS_misc = $(SCRIPT_SUBDIR) tracing servicetag nio demo
# Omit mirror since it's built with the apt tool.
SUBDIRS_tools = tools
include $(BUILDDIR)/common/Subdirs.gmk
......
......@@ -29,11 +29,11 @@
ifneq ($(PLATFORM), windows)
FILES_export = \
sun/nio/ch/SctpAssocChange.java \
sun/nio/ch/SctpChannelImpl.java \
sun/nio/ch/SctpNet.java \
sun/nio/ch/SctpPeerAddrChange.java \
sun/nio/ch/SctpResultContainer.java \
sun/nio/ch/SctpServerChannelImpl.java \
sun/nio/ch/SctpStdSocketOption.java
sun/nio/ch/sctp/AssociationChange.java \
sun/nio/ch/sctp/SctpChannelImpl.java \
sun/nio/ch/sctp/SctpNet.java \
sun/nio/ch/sctp/PeerAddrChange.java \
sun/nio/ch/sctp/ResultContainer.java \
sun/nio/ch/sctp/SctpServerChannelImpl.java \
sun/nio/ch/sctp/SctpStdSocketOption.java
endif
......@@ -42,25 +42,25 @@ FILES_java = \
com/sun/nio/sctp/SendFailedNotification.java \
com/sun/nio/sctp/ShutdownNotification.java \
\
sun/nio/ch/SctpMessageInfoImpl.java \
sun/nio/ch/SctpStdSocketOption.java
sun/nio/ch/sctp/MessageInfoImpl.java \
sun/nio/ch/sctp/SctpStdSocketOption.java
ifneq ($(PLATFORM), windows)
FILES_java += \
sun/nio/ch/SctpAssocChange.java \
sun/nio/ch/SctpAssociationImpl.java \
sun/nio/ch/SctpChannelImpl.java \
sun/nio/ch/SctpMultiChannelImpl.java \
sun/nio/ch/SctpNet.java \
sun/nio/ch/SctpNotification.java \
sun/nio/ch/SctpPeerAddrChange.java \
sun/nio/ch/SctpResultContainer.java \
sun/nio/ch/SctpSendFailed.java \
sun/nio/ch/SctpServerChannelImpl.java \
sun/nio/ch/SctpShutdown.java
sun/nio/ch/sctp/AssociationChange.java \
sun/nio/ch/sctp/AssociationImpl.java \
sun/nio/ch/sctp/PeerAddrChange.java \
sun/nio/ch/sctp/ResultContainer.java \
sun/nio/ch/sctp/SctpChannelImpl.java \
sun/nio/ch/sctp/SctpMultiChannelImpl.java \
sun/nio/ch/sctp/SctpNet.java \
sun/nio/ch/sctp/SctpNotification.java \
sun/nio/ch/sctp/SctpServerChannelImpl.java \
sun/nio/ch/sctp/SendFailed.java \
sun/nio/ch/sctp/Shutdown.java
else
FILES_java += \
sun/nio/ch/SctpChannelImpl.java \
sun/nio/ch/SctpMultiChannelImpl.java \
sun/nio/ch/SctpServerChannelImpl.java
sun/nio/ch/sctp/SctpChannelImpl.java \
sun/nio/ch/sctp/SctpMultiChannelImpl.java \
sun/nio/ch/sctp/SctpServerChannelImpl.java
endif
......@@ -47,14 +47,16 @@ include $(BUILDDIR)/common/Library.gmk
#
# Find platform-specific C source files
#
vpath %.c $(PLATFORM_SRC)/native/sun/nio/ch
vpath %.c $(PLATFORM_SRC)/native/sun/nio/ch/sctp
#
# Include nio.h, net_util.h, sun_nio_ch_IOStatus.h, etc
#
OTHER_INCLUDES += \
-I$(SHARE_SRC)/native/sun/nio/ch \
-I$(SHARE_SRC)/native/sun/nio/ch/sctp \
-I$(SHARE_SRC)/native/java/net \
-I$(PLATFORM_SRC)/native/sun/nio/ch \
-I$(PLATFORM_SRC)/native/java/net \
-I$(CLASSHDRDIR)/../../../../java/java.nio/nio/CClassHeaders
......@@ -75,5 +77,5 @@ endif # ifneq windows
clean clobber::
$(RM) -r $(CLASSDESTDIR)/com/sun/nio/sctp
$(RM) -r $(CLASSDESTDIR)/sun/nio/ch
$(RM) -r $(CLASSDESTDIR)/sun/nio/ch/sctp
......@@ -25,30 +25,30 @@
SUNWprivate_1.1 {
global:
Java_sun_nio_ch_SctpNet_init;
Java_sun_nio_ch_SctpNet_socket0;
Java_sun_nio_ch_SctpNet_bindx;
Java_sun_nio_ch_SctpNet_branch0;
Java_sun_nio_ch_SctpNet_listen0;
Java_sun_nio_ch_SctpNet_connect0;
Java_sun_nio_ch_SctpNet_close0;
Java_sun_nio_ch_SctpNet_preClose0;
Java_sun_nio_ch_SctpNet_getLocalAddresses0;
Java_sun_nio_ch_SctpNet_getRemoteAddresses0;
Java_sun_nio_ch_SctpNet_getPrimAddrOption0;
Java_sun_nio_ch_SctpNet_setPrimAddrOption0;
Java_sun_nio_ch_SctpNet_setPeerPrimAddrOption0;
Java_sun_nio_ch_SctpNet_getInitMsgOption0;
Java_sun_nio_ch_SctpNet_setInitMsgOption0;
Java_sun_nio_ch_SctpNet_getIntOption0;
Java_sun_nio_ch_SctpNet_setIntOption0;
Java_sun_nio_ch_SctpNet_shutdown0;
Java_sun_nio_ch_SctpChannelImpl_initIDs;
Java_sun_nio_ch_SctpChannelImpl_checkConnect;
Java_sun_nio_ch_SctpChannelImpl_receive0;
Java_sun_nio_ch_SctpChannelImpl_send0;
Java_sun_nio_ch_SctpServerChannelImpl_initIDs;
Java_sun_nio_ch_SctpServerChannelImpl_accept0;
Java_sun_nio_ch_sctp_SctpNet_init;
Java_sun_nio_ch_sctp_SctpNet_socket0;
Java_sun_nio_ch_sctp_SctpNet_bindx;
Java_sun_nio_ch_sctp_SctpNet_branch0;
Java_sun_nio_ch_sctp_SctpNet_listen0;
Java_sun_nio_ch_sctp_SctpNet_connect0;
Java_sun_nio_ch_sctp_SctpNet_close0;
Java_sun_nio_ch_sctp_SctpNet_preClose0;
Java_sun_nio_ch_sctp_SctpNet_getLocalAddresses0;
Java_sun_nio_ch_sctp_SctpNet_getRemoteAddresses0;
Java_sun_nio_ch_sctp_SctpNet_getPrimAddrOption0;
Java_sun_nio_ch_sctp_SctpNet_setPrimAddrOption0;
Java_sun_nio_ch_sctp_SctpNet_setPeerPrimAddrOption0;
Java_sun_nio_ch_sctp_SctpNet_getInitMsgOption0;
Java_sun_nio_ch_sctp_SctpNet_setInitMsgOption0;
Java_sun_nio_ch_sctp_SctpNet_getIntOption0;
Java_sun_nio_ch_sctp_SctpNet_setIntOption0;
Java_sun_nio_ch_sctp_SctpNet_shutdown0;
Java_sun_nio_ch_sctp_SctpChannelImpl_initIDs;
Java_sun_nio_ch_sctp_SctpChannelImpl_checkConnect;
Java_sun_nio_ch_sctp_SctpChannelImpl_receive0;
Java_sun_nio_ch_sctp_SctpChannelImpl_send0;
Java_sun_nio_ch_sctp_SctpServerChannelImpl_initIDs;
Java_sun_nio_ch_sctp_SctpServerChannelImpl_accept0;
JNI_OnLoad;
local:
*;
......
......@@ -132,7 +132,6 @@ endif
JDK_MAN_PAGES = \
$(JRE_MAN_PAGES) \
appletviewer.1 \
apt.1 \
extcheck.1 \
idlj.1 \
jar.1 \
......@@ -264,7 +263,6 @@ SOURCES = \
com/sun/java/swing \
com/sun/javadoc \
com/sun/jmx \
com/sun/mirror \
com/sun/source \
com/sun/naming \
com/sun/security/auth \
......@@ -346,7 +344,6 @@ TOOLS = \
com/sun/javadoc \
com/sun/jdi \
com/sun/jarsigner \
com/sun/mirror \
com/sun/source \
com/sun/tools/classfile \
com/sun/tools/doclets \
......@@ -356,16 +353,16 @@ TOOLS = \
com/sun/tools/hat \
com/sun/tools/javac \
com/sun/tools/javadoc \
com/sun/tools/apt \
com/sun/tools/javah \
com/sun/tools/javap \
com/sun/tools/corba \
com/sun/tools/internal/xjc \
com/sun/tools/internal/ws \
META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory \
META-INF/services/com.sun.tools.xjc.Plugin \
META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \
META-INF/services/com.sun.tools.internal.xjc.Plugin \
com/sun/istack/internal/tools \
com/sun/istack/internal/ws \
com/sun/tools/internal/jxc/ap \
com/sun/tools/internal/ws/wscompile/plugin/at_generated \
com/sun/codemodel \
com/sun/tools/internal/jxc \
com/sun/xml/internal/rngom \
......@@ -438,7 +435,6 @@ NOTJRETOOLS = \
java-rmi.cgi \
javac$(EXE_SUFFIX) \
javadoc$(EXE_SUFFIX) \
apt$(EXE_SUFFIX) \
javah$(EXE_SUFFIX) \
javap$(EXE_SUFFIX) \
jcmd$(EXE_SUFFIX) \
......@@ -525,13 +521,10 @@ $(NOT_RT_JAR_LIST): FRC
$(ECHO) "com/sun/javadoc/" >> $@
$(ECHO) "com/sun/jdi/" >> $@
$(ECHO) "com/sun/jarsigner/" >> $@
$(ECHO) "com/sun/mirror/" >> $@
$(ECHO) "com/sun/source/" >> $@
$(ECHO) "com/sun/istack/internal/tools/" >> $@
$(ECHO) "com/sun/istack/internal/ws/" >> $@
$(ECHO) "META-INF/services/com.sun.jdi.connect.Connector" >> $@
$(ECHO) "META-INF/services/com.sun.jdi.connect.spi.TransportService" >> $@
$(ECHO) "META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory" >> $@
$(ECHO) "META-INF/services/com.sun.tools.xjc.Plugin" >> $@
$(ECHO) "com/sun/tools/" >> $@
$(ECHO) "sun/jvmstat/" >> $@
......@@ -1000,7 +993,7 @@ initial-image-jdk:: initial-image-jdk-setup \
@#
@# files that might not exist need to be touched.
@#
$(TOUCH) $(CLASSBINDIR)/META-INF/services/com.sun.tools.xjc.Plugin
$(TOUCH) $(CLASSBINDIR)/META-INF/services/com.sun.tools.internal.xjc.Plugin
@#
@# lib/tools.jar
@#
......
......@@ -34,7 +34,6 @@ IMPORT_RT_PACKAGES += \
javax/xml/ws \
javax/jws \
javax/annotation \
com/sun/istack/internal \
com/sun/xml/internal/bind \
com/sun/xml/internal/fastinfoset \
com/sun/xml/internal/messaging \
......@@ -42,13 +41,13 @@ IMPORT_RT_PACKAGES += \
com/sun/xml/internal/txw2 \
com/sun/xml/internal/ws \
com/sun/xml/internal/stream/buffer
NOT_USED_PACKAGES += \
com/sun/tools/internal/txw2
IMPORT_TOOLS_PACKAGES += \
com/sun/codemodel \
com/sun/istack/internal/tools \
com/sun/istack/internal/ws \
com/sun/xml/internal/rngom \
com/sun/xml/internal/xsom \
com/sun/xml/internal/dtdparser \
......@@ -56,6 +55,9 @@ IMPORT_TOOLS_PACKAGES += \
com/sun/tools/internal/ws \
com/sun/tools/internal/jxc \
org/relaxng \
META-INF/services/com.sun.mirror.apt.AnnotationProcessorFactory \
META-INF/services/com.sun.tools.internal.xjc.Plugin
META-INF/services/com.sun.tools.internal.ws.wscompile.Plugin \
META-INF/services/com.sun.tools.internal.xjc.Plugin \
com/sun/tools/internal/jxc/ap \
com/sun/tools/internal/ws/wscompile/plugin/at_generated
#
# Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1997, 2012, 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
......@@ -32,9 +32,7 @@ IMPORT_RT_PACKAGES += \
IMPORT_TOOLS_PACKAGES += \
com/sun/javadoc \
com/sun/mirror \
com/sun/source \
com/sun/tools/apt \
com/sun/tools/classfile \
com/sun/tools/doclets \
com/sun/tools/javac \
......
# Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1997, 2012, 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
......@@ -356,64 +356,6 @@ $(COREAPI_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(CORE_P
$(prep-target)
$(call PackageFilter,$(CORE_PKGS))
#############################################################
#
# mirrordocs
#
# Part of langtools
ifdef LANGTOOLS_DIST
ALL_OTHER_TARGETS += mirrordocs
endif
MIRROR_DOCDIR := $(JDK_API_DOCSDIR)/apt/mirror
MIRROR2COREAPI := ../../$(JDKJRE2COREAPI)
MIRROR_DOCTITLE := Mirror API
MIRROR_WINDOWTITLE := Mirror API
MIRROR_HEADER := <strong>Mirror API</strong>
MIRROR_BOTTOM := $(call CommonBottom,$(MIRROR_FIRST_COPYRIGHT_YEAR))
MIRROR_GROUPNAME := Packages
MIRROR_OVERVIEW := $(IMPORTSRCDIR)/com/sun/mirror/overview.html
MIRROR_REGEXP := com.sun.mirror.*
# MIRROR_PKGS is located in NON_CORE_PKGS.gmk
# The index.html, options, and packages files
MIRROR_INDEX_FILE = $(MIRROR_DOCDIR)/index.html
MIRROR_OPTIONS_FILE = $(DOCSTMPDIR)/mirror.options
MIRROR_PACKAGES_FILE = $(DOCSTMPDIR)/mirror.packages
mirrordocs: $(MIRROR_INDEX_FILE)
# Set relative location to core api document root
$(MIRROR_INDEX_FILE): GET2DOCSDIR=$(MIRROR2COREAPI)/..
# Run javadoc if the index file is out of date or missing
$(MIRROR_INDEX_FILE): $(MIRROR_OPTIONS_FILE) $(MIRROR_PACKAGES_FILE)
$(prep-javadoc)
$(call JavadocSummary,$(MIRROR_OPTIONS_FILE),$(MIRROR_PACKAGES_FILE))
$(JAVADOC_CMD) $(JAVADOC_VM_MEMORY_FLAGS) -d $(@D) \
@$(MIRROR_OPTIONS_FILE) @$(MIRROR_PACKAGES_FILE)
# Create file with javadoc options in it
$(MIRROR_OPTIONS_FILE): $(MIRROR_OVERVIEW)
$(prep-target)
@($(call OptionOnly,$(COMMON_JAVADOCFLAGS)) ; \
$(call OptionPair,-sourcepath,$(RELEASEDOCS_SOURCEPATH)) ; \
$(call OptionPair,-encoding,ascii) ; \
$(call OptionPair,-overview,$(MIRROR_OVERVIEW)) ; \
$(call OptionPair,-doctitle,$(MIRROR_DOCTITLE)) ; \
$(call OptionPair,-windowtitle,$(MIRROR_WINDOWTITLE) $(DRAFT_WINTITLE));\
$(call OptionPair,-header,$(MIRROR_HEADER)$(DRAFT_HEADER)) ; \
$(call OptionPair,-bottom,$(MIRROR_BOTTOM)$(DRAFT_BOTTOM)) ; \
$(call OptionTrip,-group,$(MIRROR_GROUPNAME),$(MIRROR_REGEXP)); \
$(call OptionTrip,-linkoffline,$(MIRROR2COREAPI),$(COREAPI_DOCSDIR)); \
) >> $@
# Create a file with the package names in it
$(MIRROR_PACKAGES_FILE): $(DIRECTORY_CACHE) $(call PackageDependencies,$(MIRROR_PKGS))
$(prep-target)
$(call PackageFilter,$(MIRROR_PKGS))
#############################################################
#
# docletapidocs
......
#
# Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2002, 2012, 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
......@@ -71,11 +71,6 @@ DOCLETAPI_PKGS = com.sun.javadoc
TAGLETAPI_FILE = com/sun/tools/doclets/Taglet.java
MIRROR_PKGS = com.sun.mirror.apt \
com.sun.mirror.declaration \
com.sun.mirror.type \
com.sun.mirror.util
ATTACH_PKGS = com.sun.tools.attach \
com.sun.tools.attach.spi
......
......@@ -54,9 +54,6 @@ SUNWprivate_1.1 {
Java_sun_management_GcInfoBuilder_getLastGcInfo0;
Java_sun_management_GcInfoBuilder_getNumGcExtAttributes;
Java_sun_management_HotSpotDiagnostic_dumpHeap;
Java_sun_management_HotSpotDiagnostic_executeDiagnosticCommand0;
Java_sun_management_HotSpotDiagnostic_getDiagnosticCommandInfo0;
Java_sun_management_HotSpotDiagnostic_getDiagnosticCommands0;
Java_sun_management_HotspotThread_getInternalThreadCount;
Java_sun_management_HotspotThread_getInternalThreadTimes0;
Java_sun_management_MemoryImpl_getMemoryManagers0;
......
#
# Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2004, 2012, 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
......@@ -55,7 +55,6 @@ endif
define make-all-launchers
$(make-appletviewer)
$(call make-launcher, apt, com.sun.tools.apt.Main, , )
$(call make-launcher, extcheck, com.sun.tools.extcheck.Main, , )
$(call make-launcher, idlj, com.sun.tools.corba.se.idl.toJavaPortable.Compile, , )
$(call make-launcher, jar, sun.tools.jar.Main, , )
......
#
# Copyright (c) 2004, 2005, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2004, 2012, 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
......@@ -47,10 +47,6 @@ ifndef MAIN_CLASS
endif
# Some tools need the wildcard expansion option
ifeq ($(PROGRAM),apt)
WILDCARDS=true
NEVER_ACT_AS_SERVER_CLASS_MACHINE=true
endif
ifeq ($(PROGRAM),javac)
WILDCARDS=true
MAIN_JAVA_ARGS += -J-Xss4m -J-ea:com.sun.tools...
......
." Copyright (c) 2004, 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.
."
." 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.
."
.TH apt 1 "10 May 2011"
.LP
.SH "NAME"
.LP
.LP
\f2apt\fP \- annotation processing tool
.LP
.SH "SYNOPSIS"
.LP
.LP
\f2apt [\-classpath \fP\f2classpath\fP] [\-sourcepath \f2sourcepath\fP] [\-d \f2directory\fP] [\-s \f2directory\fP] [\-factorypath \f2path\fP] [\-factory \f2class\fP] [\-print] [\-nocompile] [\-A\f2key\fP[\f2=val\fP] ...] [\f2javac option\fP] sourcefiles [@files]
.LP
.SH "PARAMETERS"
.LP
.LP
Options may be in any order. For a discussion of parameters which apply to a specific option, see OPTIONS below.
.LP
.RS 3
.TP 3
sourcefiles
Zero or more source files to be processed.
.TP 3
@files
One or more files that list source files or other options
.RE
.LP
.SH "DESCRIPTION"
.LP
.LP
\f3Note\fP: The \f2apt\fP tool and its associated API contained in the package \f2com.sun.mirror\fP have been deprecated since JDK 7 and are planned to be removed in the next major JDK release. Use the options available in the \f2javac(1)\fP tool and the APIs contained in the packages \f2javax.annotation.processing\fP and \f2javax.lang.model\fP to process annotations.
.LP
.LP
The tool \f2apt\fP, annotation processing tool, includes reflective APIs and supporting infrastructure to process program annotations. The \f2apt\fP reflective APIs provide a build\-time, source\-based, read\-only view of program structure. These reflective APIs are designed to cleanly model the Java(TM) programming language's type system after the addition of generics. First, \f2apt\fP runs annotation processors that can produce new source code and other files. Next, \f2apt\fP can cause compilation of both original and generated source files, easing development. The reflective APIs and other APIs used to interact with the tool are subpackages of \f2com.sun.mirror\fP.
.LP
.LP
A fuller discussion of how the tool operates as well as instructions for developing with \f2apt\fP are in
.na
\f4Getting Started with \fP\f4apt\fP. @
.fi
http://download.oracle.com/javase/7/docs/technotes/guides/apt/GettingStarted.html
.LP
.SH "OPTIONS"
.LP
.SS
apt specific options
.LP
.RS 3
.TP 3
\-s dir
Specify the directory root under which processor\-generated source files will be placed; files are placed in subdirectories based on package namespace.
.TP 3
\-nocompile
Do not compile source files to class files.
.TP 3
\-print
Print out textual representation of specified types; perform no annotation processing or compilation.
.TP 3
\-A[key[=val]]
Options to pass to annotation processors \-\- these are not interpreted by \f2apt\fP directly, but are made available for use by individual processors
.TP 3
\-factorypath path
Specify where to find annotation processor factories; if this option is used, the classpath is \f2not\fP searched for factories.
.TP 3
\-factory classname
Name of annotation processor factory to use; bypasses default discovery process
.TP 3
\-version
Print version information.
.TP 3
\-X
Display information about non\-standard options.
.RE
.LP
.SS
Options shared with javac
.LP
.RS 3
.TP 3
\-d dir
Specify where to place processor and javac generated class files
.TP 3
\-cp path or \-classpath path
Specify where to find user class files and annotation processor factories. If \f2\-factorypath\fP is given, the classpath is not searched for factories.
.RE
.LP
.LP
Consult the javac(1) man page for information on \f2javac\fP options.
.LP
.SS
Non\-Standard Options
.LP
.RS 3
.TP 3
\-XListAnnotationTypes
List found annotation types.
.TP 3
\-XListDeclarations
List specified and included declarations.
.TP 3
\-XPrintAptRounds
Print information about initial and recursive \f2apt\fP rounds.
.TP 3
\-XPrintFactoryInfo
Print information about which annotations a factory is asked to process.
.TP 3
\-XclassesAsDecls
Treat both class and source files as declarations to process.
.RE
.LP
.LP
\f3Note\fP: Because these options are non\-standard, they are subject to change without notice.
.LP
.SH "NOTES"
.LP
.LP
The \f2apt\fP tool and its associated API contained in the package \f2com.sun.mirror\fP have been deprecated since JDK 7 and are planned to be removed in the next major JDK release. Use the options available in the \f2javac(1)\fP tool and the APIs contained in the packages \f2javax.annotation.processing\fP and \f2javax.lang.model\fP to process annotations.
.LP
.SH "SEE ALSO"
.LP
.RS 3
.TP 2
o
javac(1), java(1)
.RE
.LP
." Copyright (c) 2004, 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.
."
." 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.
."
.TH apt 1 "07 May 2011"
.LP
.SH "NAME"
.LP
.LP
\f2apt\fP \- 注釈処理ツール
.LP
.SH "形式"
.LP
.LP
\f2apt [\-classpath \fP\f2classpath\fP] [\-sourcepath \f2sourcepath\fP] [\-d \f2directory\fP] [\-s \f2directory\fP] [\-factorypath \f2path\fP] [\-factory \f2class\fP] [\-print] [\-nocompile] [\-A\f2key\fP[\f2=val\fP] ...] [\f2javac option\fP] sourcefiles [@files]
.LP
.SH "パラメータ"
.LP
.LP
オプションの指定順序に決まりはありません。特定のオプションに適用されるパラメータについては、下記の「オプション」を参照してください。
.LP
.RS 3
.TP 3
sourcefiles
ゼロ、1 つ、または複数の処理対象のソースファイル
.TP 3
@files
ソースファイルまたは他のオプションを一覧表示する 1 つまたは複数のファイル
.RE
.LP
.SH "説明"
.LP
.LP
\f3注\fP: \f2apt\fP ツールと、パッケージ \f2com.sun.mirror\fP に含まれているそれに関連した API は、JDK 7 以降非推奨になっており、JDK の次のメジャーリリースで削除される予定です。\f2javac(1)\fP ツールで利用可能なオプションと、パッケージ \f2javax.annotation.processing\fP および \f2javax.lang.model\fP に含まれている API を使用して、注釈を処理してください。
.LP
.LP
注釈処理ツール \f2apt\fP は、リフレクト API とサポートインフラストラクチャーから構成され、プログラム注釈を処理します。\f2apt\fP リフレクト API は、 構築時のソースベースで、プログラム構造に関する読み取り専用ビューを提供します。これらのリフレクト API は、総称を追加した後に、Java(TM) プログラミング言語の型システムを正しくモデル化するように設計されています。最初に、\f2apt\fP は、新しいソースコードと他のファイルを作成する注釈プロセッサを実行します。次に、\f2apt\fP は、元のソースファイルと生成したソースファイルの両方をコンパイルするため、開発が楽になります。ツールとのインタフェースに使用されるリフレクト API などの API は、\f2com.sun.mirror\fP のサブパッケージです。
.LP
.LP
ツールの機能に関する詳細と、\f2apt\fP を使用した開発方法については、
.na
\f4「apt 入門」\fP @
.fi
http://java.sun.com/javase/6/docs/technotes/guides/apt/GettingStarted.htmlを参照してください。
.LP
.SH "オプション"
.LP
.SS
apt 固有のオプション
.LP
.RS 3
.TP 3
\-s dir
プロセッサの生成するソースファイルを置くディレクトリルートを指定します。 ファイルは、パッケージの名前空間に基づいてサブディレクトリに置かれます。
.TP 3
\-nocompile
ソースファイルをクラスファイルにコンパイルしません。
.TP 3
\-print
指定したタイプのテキスト表現を出力します。 注釈処理またはコンパイルは行いません。
.TP 3
\-A[key[=val]]
注釈プロセッサへ渡すオプションです。 このオプションは、\f2apt\fP が直接解釈するのではなく、それぞれのプロセッサによって使用できるように変えられます。
.TP 3
\-factorypath path
注釈プロセッサファクトリを検索する場所を指定します。 このオプションを使用する場合、クラスパスのファクトリは検索されません。
.TP 3
\-factory classname
使用する注釈プロセッサファクトリの名前です。 デフォルトの検出プロセスを省略します。
.TP 3
\-version
バージョン情報を出力します。
.TP 3
\-X
非標準オプションに関する情報を表示します。
.RE
.LP
.SS
javac と共用するオプション
.LP
.RS 3
.TP 3
\-d dir
プロセッサと javac 生成のクラスファイルを置く場所を指定します。
.TP 3
\-cp path または \-classpath path
ユーザークラスファイルと注釈プロセッサファクトリを検索する場所を指定します。\f2\-factorypath\fP が指定されている場合、クラスパスのファクトリは検索されません。
.RE
.LP
.LP
\f2javac\fP オプションの詳細については、javac(1) のマニュアルページを参照してください。
.LP
.SS
非標準オプション
.LP
.RS 3
.TP 3
\-XListAnnotationTypes
注釈の型に検出されるリスト.
.TP 3
\-XListDeclarations
指定および宣言がインクルードされるリスト.
.TP 3
\-XPrintAptRounds
初期および再帰的な \f2apt\fP ラウンドに関する情報を出力する.
.TP 3
\-XPrintFactoryInfo
処理を要求するファクトリの注釈に関する情報を出力する.
.TP 3
\-XclassesAsDecls
クラスファイルとソースファイルの両方を、処理対象の宣言として処理します。
.RE
.LP
.LP
\f3注\fP: これらは非標準オプションなので、予告なく変更される可能性があります。
.LP
.SH "注"
.LP
.LP
\f2apt\fP ツールと、パッケージ \f2com.sun.mirror\fP に含まれているそれに関連した API は、JDK 7 以降非推奨になっており、JDK の次のメジャーリリースで削除される予定です。\f2javac(1)\fP ツールで利用可能なオプションと、パッケージ \f2javax.annotation.processing\fP および \f2javax.lang.model\fP に含まれている API を使用して、注釈を処理してください。
.LP
.SH "関連項目"
.LP
.RS 3
.TP 2
o
javac(1), java(1)
.RE
.LP
......@@ -55,9 +55,12 @@ final class PBEKey implements SecretKey {
// Should allow an empty password.
passwd = new char[0];
}
for (int i=0; i<passwd.length; i++) {
if ((passwd[i] < '\u0020') || (passwd[i] > '\u007E')) {
throw new InvalidKeySpecException("Password is not ASCII");
// Accept "\0" to signify "zero-length password with no terminator".
if (!(passwd.length == 1 && passwd[0] == 0)) {
for (int i=0; i<passwd.length; i++) {
if ((passwd[i] < '\u0020') || (passwd[i] > '\u007E')) {
throw new InvalidKeySpecException("Password is not ASCII");
}
}
}
this.key = new byte[passwd.length];
......
......@@ -60,11 +60,16 @@ final class PKCS12PBECipherCore {
static byte[] derive(char[] chars, byte[] salt,
int ic, int n, int type) {
// Add in trailing NULL terminator.
// Add in trailing NULL terminator. Special case:
// no terminator if password is "\0".
int length = chars.length*2;
if (length != 0) {
if (length == 2 && chars[0] == 0) {
chars = new char[0];
length = 0;
} else {
length += 2;
}
byte[] passwd = new byte[length];
for (int i = 0, j = 0; i < chars.length; i++, j+=2) {
passwd[j] = (byte) ((chars[i] >>> 8) & 0xFF);
......@@ -133,6 +138,9 @@ final class PKCS12PBECipherCore {
}
private static void concat(byte[] src, byte[] dst, int start, int len) {
if (src.length == 0) {
return;
}
int loop = len / src.length;
int off, i;
for (i = 0, off = 0; i < loop; i++, off += src.length)
......
......@@ -137,6 +137,11 @@ public class WindowsProgressBarUI extends BasicProgressBarUI
g.setColor(progressBar.getForeground());
barRectHeight -= 2;
barRectWidth -= 2;
if (barRectWidth <= 0 || barRectHeight <= 0) {
return;
}
Graphics2D g2 = (Graphics2D)g;
g2.setStroke(new BasicStroke((float)(vertical ? barRectWidth : barRectHeight),
BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL));
......
/*
* 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 com.sun.management;
import java.beans.ConstructorProperties;
/**
* Diagnostic Command Argument information. It contains the description
* of one parameter of the diagnostic command. A parameter can either be an
* option or an argument. Options are identified by the option name while
* arguments are identified by their position in the command line. The generic
* syntax of a diagnostic command is:
* <blockquote>
* &lt;command name&gt; [&lt;option&gt;=&lt;value&gt;] [&lt;argument_value&gt;]
* </blockquote>
* Example:
* <blockquote>
* command_name option1=value1 option2=value argumentA argumentB argumentC
* </blockquote>
* In this command line, the diagnostic command receives five parameters, two
* options named {@code option1} and {@code option2}, and three arguments.
* argumentA's position is 0, argumentB's position is 1 and argumentC's
* position is 2.
*
* @author Frederic Parain
* @since 7u4
*/
public class DiagnosticCommandArgumentInfo {
private final String name;
private final String description;
private final String type;
private final String defaultValue;
private final boolean mandatory;
private final boolean option;
private final int position;
/**
* Returns the argument name
*
* @return the argument name
*/
public String getName() {
return name;
}
/**
* Returns the argument description
*
* @return the argument description
*/
public String getDescription() {
return description;
}
/**
* Returns the argument type
*
* @return the argument type
*/
public String getType() {
return type;
}
/**
* Returns the default value as a String if a default value
* is defined, null otherwise.
*
* @return the default value as a String if a default value
* is defined, null otherwise.
*/
public String getDefault() {
return defaultValue;
}
/**
* Returns {@code true} if the argument is mandatory,
* {@code false} otherwise
*
* @return {@code true} if the argument is mandatory,
* {@code false} otherwise
*/
public boolean isMandatory() {
return mandatory;
}
/**
* Returns {@code true} if the argument is an option,
* {@code false} otherwise. Options have to be specified using the
* &lt;key&gt;=&lt;value&gt; syntax on the command line, while other
* arguments are specified with a single &lt;value&gt; field and are
* identified by their position on command line.
*
* @return {@code true} if the argument is an option,
* {@code false} otherwise
*/
public boolean isOption() {
return option;
}
/**
* Returns the expected position of this argument if it is not an option,
* -1 otherwise. Argument position if defined from left to right,
* starting at zero and ignoring the diagnostic command name and
* options.
*
* @return the expected position of this argument if it is not an option,
* -1 otherwise.
*/
public int getPosition() {
return position;
}
@ConstructorProperties({"name","description","type","default",
"mandatory","option","position"})
public DiagnosticCommandArgumentInfo(String name, String description,
String type, String defaultValue,
boolean mandatory, boolean option,
int position) {
this.name = name;
this.description = description;
this.type = type;
this.defaultValue = defaultValue;
this.mandatory = mandatory;
this.option = option;
this.position = position;
}
}
/*
* 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 com.sun.management;
import java.beans.ConstructorProperties;
import java.util.List;
/**
* Diagnostic command information. It contains the description of a
* diagnostic command.
*
* @author Frederic Parain
* @since 7u4
*/
public class DiagnosticCommandInfo {
private final String name;
private final String description;
private final String impact;
private final boolean enabled;
private final List<DiagnosticCommandArgumentInfo> arguments;
/**
* Returns the diagnostic command name
*
* @return the diagnostic command name
*/
public String getName() {
return name;
}
/**
* Returns the diagnostic command description
*
* @return the diagnostic command description
*/
public String getDescription() {
return description;
}
/**
* Returns the potential impact of the diagnostic command execution
* on the Java virtual machine behavior
*
* @return the potential impact of the diagnostic command execution
* on the Java virtual machine behavior
*/
public String getImpact() {
return impact;
}
/**
* Returns {@code true} if the diagnostic command is enabled,
* {@code false} otherwise. The enabled/disabled
* status of a diagnostic command can evolve during
* the lifetime of the Java virtual machine.
*
* @return {@code true} if the diagnostic command is enabled,
* {@code false} otherwise
*/
public boolean isEnabled() {
return enabled;
}
/**
* Returns the list of the diagnostic command arguments description.
* If the diagnostic command has no arguments, it returns an empty list.
*
* @return a list of the diagnostic command arguments description
*/
public List<DiagnosticCommandArgumentInfo> getArgumentsInfo() {
return arguments;
}
@ConstructorProperties({"name", "description","impact","enabled",
"argumentsInfo"})
public DiagnosticCommandInfo(String name, String description,
String impact, boolean enabled,
List<DiagnosticCommandArgumentInfo> arguments)
{
this.name = name;
this.description = description;
this.impact = impact;
this.enabled = enabled;
this.arguments = arguments;
}
}
/*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2012, 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
......@@ -31,11 +31,6 @@ import java.lang.management.PlatformManagedObject;
/**
* Diagnostic management interface for the HotSpot Virtual Machine.
*
* <p>{@linkplain #getDiagnosticCommands Diagnostic commands}
* are actions that can be invoked dynamically and
* executed in a target Java virtual machine, mainly for troubleshooting
* and diagnosis.
*
* <p>The diagnostic MBean is registered to the platform MBeanServer
* as are other platform MBeans.
*
......@@ -116,108 +111,4 @@ public interface HotSpotDiagnosticMXBean extends PlatformManagedObject {
* ManagementPermission("control").
*/
public void setVMOption(String name, String value);
/**
* Returns the {@linkplain DiagnosticCommandInfo#getName() names}
* of all diagnostic commands.
* A diagnostic command is an action that can be invoked dynamically
* mainly for troubleshooting and diagnosis. The list of diagnostic
* commands may change at runtime. A diagnostic command may be
* {@linkplain DiagnosticCommandInfo#isEnabled disabled} but will
* not be removed from a previously returned list.
*
* @return the names of all diagnostic commands.
*
* @since 7u4
*/
public List<String> getDiagnosticCommands();
/**
* Returns a {@code DiagnosticCommandInfo} object describing the
* diagnostic command of the specified name {@code command}
*
* @param command a diagnostic command name
* @return a {@code DiagnosticCommandInfo} object
* @throws java.lang.IllegalArgumentException if the {@code command}
* doesn't match any diagnostic command registered in the
* targeted Java virtual machine.
*
* @since 7u4
*/
public DiagnosticCommandInfo getDiagnosticCommandInfo(String command);
/**
* Returns a list of {@code DiagnosticCommandInfo} object describing
* all diagnostic commands available on the targeted Java virtual machine
*
* @return a list of {@code DiagnosticCommandInfo} objects
*
* @since 7u4
*/
public List<DiagnosticCommandInfo> getDiagnosticCommandInfo();
/**
* Returns a list of {@code DiagnosticCommandInfo} object describing
* all diagnostic commands specified in the {@code commands} list.
*
* @param commands {@code List} of {@code String} containing diagnostic
* command names
* @return a {@code List} of {@code DiagnosticCommandInfo} objects
*
* @throws java.lang.IllegalArgumentException if at least one
* command specified in the {@code commands } list
* doesn't match any diagnostic command registered in the
* targeted Java virtual machine.
*
* @since 7u4
*/
public List<DiagnosticCommandInfo> getDiagnosticCommandInfo(List<String> commands);
/**
* Executes the command line {@code commandLine}. The command line must
* start with a diagnostic command name, optionally followed by parameters.
* Each command has its own syntax but the generic syntax for a diagnostic
* command line is:
* <blockquote>
* &lt;command name&gt; [&lt;option&gt;=&lt;value&gt;] [&lt;argument_value&gt;]
* </blockquote>
*
* @param commandLine command line to execute
* @return a {@code String} object containing the diagnostic command
* output.
*
* @throws java.lang.IllegalArgumentException if the command line doesn't
* match any diagnostic command registered in the virtual machine
* of if the parameters don't match the diagnostic command syntax.
* @throws java.lang.SecurityException
* if a security manager exists and the caller does not have
* ManagementPermission("control").
*
* @since 7u4
*/
public String execute(String commandLine);
/**
* Invokes the diagnostic command named {@code cmd} with the parameters
* specified in {@code args}. Each command has its own syntax but
* the generic syntax for parameters is:
* <blockquote>
* [&lt;option&gt;=&lt;value&gt;] [&lt;argument_value&gt;]
* </blockquote>
*
* @param cmd a diagnostic command name
* @param args the command parameters
* @return a {@code String} object containing the diagnostic command
* output.
*
* @throws java.lang.IllegalArgumentException if the command line doesn't
* match any diagnostic command registered in the virtual machine
* of if the parameters don't match the diagnostic command syntax.
* @throws java.lang.SecurityException
* if a security manager exists and the caller does not have
* ManagementPermission("control").
*
* @since 7u4
*/
public String execute(String cmd, String... args);
}
......@@ -94,7 +94,7 @@ public abstract class MessageInfo {
if (streamNumber < 0 || streamNumber > 65536)
throw new IllegalArgumentException("Invalid stream number");
return new sun.nio.ch.SctpMessageInfoImpl(null, address, streamNumber);
return new sun.nio.ch.sctp.MessageInfoImpl(null, address, streamNumber);
}
/**
* Creates a {@code MessageInfo} instance suitable for use when
......@@ -133,8 +133,8 @@ public abstract class MessageInfo {
if (streamNumber < 0 || streamNumber > 65536)
throw new IllegalArgumentException("Invalid stream number");
return new sun.nio.ch.SctpMessageInfoImpl(association, address,
streamNumber);
return new sun.nio.ch.sctp.MessageInfoImpl(association,
address, streamNumber);
}
/**
......
......@@ -162,7 +162,7 @@ public abstract class SctpChannel
*/
public static SctpChannel open() throws
IOException {
return new sun.nio.ch.SctpChannelImpl((SelectorProvider)null);
return new sun.nio.ch.sctp.SctpChannelImpl((SelectorProvider)null);
}
/**
......
......@@ -162,7 +162,7 @@ public abstract class SctpMultiChannel
*/
public static SctpMultiChannel open() throws
IOException {
return new sun.nio.ch.SctpMultiChannelImpl((SelectorProvider)null);
return new sun.nio.ch.sctp.SctpMultiChannelImpl((SelectorProvider)null);
}
/**
......
......@@ -98,7 +98,7 @@ public abstract class SctpServerChannel
*/
public static SctpServerChannel open() throws
IOException {
return new sun.nio.ch.SctpServerChannelImpl((SelectorProvider)null);
return new sun.nio.ch.sctp.SctpServerChannelImpl((SelectorProvider)null);
}
/**
......
......@@ -25,7 +25,7 @@
package com.sun.nio.sctp;
import java.net.SocketAddress;
import sun.nio.ch.SctpStdSocketOption;
import sun.nio.ch.sctp.SctpStdSocketOption;
/**
* SCTP channels supports the socket options defined by this class
......@@ -50,7 +50,7 @@ public class SctpStandardSocketOptions {
*/
public static final SctpSocketOption<Boolean> SCTP_DISABLE_FRAGMENTS = new
SctpStdSocketOption<Boolean>("SCTP_DISABLE_FRAGMENTS", Boolean.class,
sun.nio.ch.SctpStdSocketOption.SCTP_DISABLE_FRAGMENTS);
sun.nio.ch.sctp.SctpStdSocketOption.SCTP_DISABLE_FRAGMENTS);
/**
* Enables or disables explicit message completion.
......@@ -69,7 +69,7 @@ public class SctpStandardSocketOptions {
*/
public static final SctpSocketOption<Boolean> SCTP_EXPLICIT_COMPLETE = new
SctpStdSocketOption<Boolean>("SCTP_EXPLICIT_COMPLETE", Boolean.class,
sun.nio.ch.SctpStdSocketOption.SCTP_EXPLICIT_COMPLETE);
sun.nio.ch.sctp.SctpStdSocketOption.SCTP_EXPLICIT_COMPLETE);
/**
* Fragmented interleave controls how the presentation of messages occur
......@@ -120,7 +120,7 @@ public class SctpStandardSocketOptions {
public static final SctpSocketOption<Integer> SCTP_FRAGMENT_INTERLEAVE =
new SctpStdSocketOption<Integer>("SCTP_FRAGMENT_INTERLEAVE",
Integer.class,
sun.nio.ch.SctpStdSocketOption.SCTP_FRAGMENT_INTERLEAVE);
sun.nio.ch.sctp.SctpStdSocketOption.SCTP_FRAGMENT_INTERLEAVE);
/**
* The maximum number of streams requested by the local endpoint during
......@@ -171,7 +171,7 @@ public class SctpStandardSocketOptions {
*/
public static final SctpSocketOption<Boolean> SCTP_NODELAY =
new SctpStdSocketOption<Boolean>("SCTP_NODELAY", Boolean.class,
sun.nio.ch.SctpStdSocketOption.SCTP_NODELAY);
sun.nio.ch.sctp.SctpStdSocketOption.SCTP_NODELAY);
/**
* Requests that the local SCTP stack use the given peer address as
......@@ -246,7 +246,7 @@ public class SctpStandardSocketOptions {
*/
public static final SctpSocketOption<Integer> SO_SNDBUF =
new SctpStdSocketOption<Integer>("SO_SNDBUF", Integer.class,
sun.nio.ch.SctpStdSocketOption.SO_SNDBUF);
sun.nio.ch.sctp.SctpStdSocketOption.SO_SNDBUF);
/**
* The size of the socket receive buffer.
......@@ -273,7 +273,7 @@ public class SctpStandardSocketOptions {
*/
public static final SctpSocketOption<Integer> SO_RCVBUF =
new SctpStdSocketOption<Integer>("SO_RCVBUF", Integer.class,
sun.nio.ch.SctpStdSocketOption.SO_RCVBUF);
sun.nio.ch.sctp.SctpStdSocketOption.SO_RCVBUF);
/**
* Linger on close if data is present.
......@@ -304,7 +304,7 @@ public class SctpStandardSocketOptions {
*/
public static final SctpSocketOption<Integer> SO_LINGER =
new SctpStdSocketOption<Integer>("SO_LINGER", Integer.class,
sun.nio.ch.SctpStdSocketOption.SO_LINGER);
sun.nio.ch.sctp.SctpStdSocketOption.SO_LINGER);
/**
* This class is used to set the maximum number of inbound/outbound streams
......
......@@ -115,7 +115,7 @@ public class List extends Component implements ItemSelectable, Accessible {
* @see #addItem(String)
* @see #getItem(int)
*/
Vector items = new Vector();
Vector<String> items = new Vector<>();
/**
* This field will represent the number of visible rows in the
......@@ -306,7 +306,7 @@ public class List extends Component implements ItemSelectable, Accessible {
// to insure that it cannot be overridden by client subclasses.
// DO NOT INVOKE CLIENT CODE ON THIS THREAD!
final String getItemImpl(int index) {
return (String)items.elementAt(index);
return items.elementAt(index);
}
/**
......@@ -415,7 +415,7 @@ public class List extends Component implements ItemSelectable, Accessible {
if (peer != null) {
peer.removeAll();
}
items = new Vector();
items = new Vector<>();
selected = new int[0];
}
......@@ -490,9 +490,9 @@ public class List extends Component implements ItemSelectable, Accessible {
public synchronized int[] getSelectedIndexes() {
ListPeer peer = (ListPeer)this.peer;
if (peer != null) {
selected = ((ListPeer)peer).getSelectedIndexes();
selected = peer.getSelectedIndexes();
}
return (int[])selected.clone();
return selected.clone();
}
/**
......@@ -908,7 +908,7 @@ public class List extends Component implements ItemSelectable, Accessible {
* @since 1.4
*/
public synchronized ItemListener[] getItemListeners() {
return (ItemListener[])(getListeners(ItemListener.class));
return getListeners(ItemListener.class);
}
/**
......@@ -975,7 +975,7 @@ public class List extends Component implements ItemSelectable, Accessible {
* @since 1.4
*/
public synchronized ActionListener[] getActionListeners() {
return (ActionListener[])(getListeners(ActionListener.class));
return getListeners(ActionListener.class);
}
/**
......
......@@ -398,10 +398,10 @@ public class Window extends Container implements Accessible {
initIDs();
}
String s = (String) java.security.AccessController.doPrivileged(
String s = java.security.AccessController.doPrivileged(
new GetPropertyAction("java.awt.syncLWRequests"));
systemSyncLWRequests = (s != null && s.equals("true"));
s = (String) java.security.AccessController.doPrivileged(
s = java.security.AccessController.doPrivileged(
new GetPropertyAction("java.awt.Window.locationByPlatform"));
locationByPlatformProp = (s != null && s.equals("true"));
}
......@@ -1378,7 +1378,7 @@ public class Window extends Container implements Accessible {
// make sure the privileged action is only
// for getting the property! We don't want the
// above checkTopLevelWindow call to always succeed!
warningString = (String) AccessController.doPrivileged(
warningString = AccessController.doPrivileged(
new GetPropertyAction("awt.appletWarning",
"Java Applet Window"));
}
......
......@@ -921,9 +921,9 @@ public class ICC_Profile implements Serializable {
*/
private static ICC_Profile getStandardProfile(final String name) {
return (ICC_Profile) AccessController.doPrivileged(
new PrivilegedAction() {
public Object run() {
return AccessController.doPrivileged(
new PrivilegedAction<ICC_Profile>() {
public ICC_Profile run() {
ICC_Profile p = null;
try {
p = getInstance (name);
......
......@@ -321,14 +321,15 @@ public abstract class InputEvent extends ComponentEvent {
* @param when a long int that gives the time the event occurred.
* Passing negative or zero value
* is not recommended
* @param modifiers the modifier keys down during event (e.g. shift, ctrl,
* alt, meta)
* Passing negative parameter is not recommended.
* Zero value means no modifiers.
* Either extended _DOWN_MASK or old _MASK modifiers
* should be used, but both models should not be mixed
* in one event. Use of the extended modifiers is
* preferred
* @param modifiers a modifier mask describing the modifier keys and mouse
* buttons (for example, shift, ctrl, alt, and meta) that
* are down during the event.
* Only extended modifiers are allowed to be used as a
* value for this parameter (see the {@link InputEvent#getModifiersEx}
* class for the description of extended modifiers).
* Passing negative parameter
* is not recommended.
* Zero value means that no modifiers were passed
* @throws IllegalArgumentException if <code>source</code> is null
* @see #getSource()
* @see #getID()
......@@ -416,9 +417,13 @@ public abstract class InputEvent extends ComponentEvent {
/**
* Returns the extended modifier mask for this event.
* <P>
* Extended modifiers are the modifiers that ends with the _DOWN_MASK suffix,
* such as ALT_DOWN_MASK, BUTTON1_DOWN_MASK, and others.
* <P>
* Extended modifiers represent the state of all modal keys,
* such as ALT, CTRL, META, and the mouse buttons just after
* the event occurred
* the event occurred.
* <P>
* For example, if the user presses <b>button 1</b> followed by
* <b>button 2</b>, and then releases them in the same order,
......
......@@ -488,14 +488,15 @@ public class MouseEvent extends InputEvent {
* @param when A long integer that gives the time the event occurred.
* Passing negative or zero value
* is not recommended
* @param modifiers The modifier keys down during event (e.g. shift, ctrl,
* alt, meta)
* @param modifiers a modifier mask describing the modifier keys and mouse
* buttons (for example, shift, ctrl, alt, and meta) that
* are down during the event.
* Only extended modifiers are allowed to be used as a
* value for this parameter (see the {@link InputEvent#getModifiersEx}
* class for the description of extended modifiers).
* Passing negative parameter
* is not recommended.
* Zero value means that no modifiers were passed.
* Use either an extended _DOWN_MASK or old _MASK modifiers,
* however do not mix models in the one event.
* The extended modifiers are preferred for using
* Zero value means that no modifiers were passed
* @param x The horizontal x coordinate for the mouse location.
* It is allowed to pass negative values
* @param y The vertical y coordinate for the mouse location.
......@@ -586,14 +587,15 @@ public class MouseEvent extends InputEvent {
* @param when A long integer that gives the time the event occurred.
* Passing negative or zero value
* is not recommended
* @param modifiers The modifier keys down during event (e.g. shift, ctrl,
* alt, meta)
* @param modifiers a modifier mask describing the modifier keys and mouse
* buttons (for example, shift, ctrl, alt, and meta) that
* are down during the event.
* Only extended modifiers are allowed to be used as a
* value for this parameter (see the {@link InputEvent#getModifiersEx}
* class for the description of extended modifiers).
* Passing negative parameter
* is not recommended.
* Zero value means that no modifiers were passed.
* Use either an extended _DOWN_MASK or old _MASK modifiers,
* however do not mix models in the one event.
* The extended modifiers are preferred for using
* Zero value means that no modifiers were passed
* @param x The horizontal x coordinate for the mouse location.
* It is allowed to pass negative values
* @param y The vertical y coordinate for the mouse location.
......@@ -657,14 +659,15 @@ public class MouseEvent extends InputEvent {
* @param when A long integer that gives the time the event occurred.
* Passing negative or zero value
* is not recommended
* @param modifiers The modifier keys down during event (e.g. shift, ctrl,
* alt, meta)
* @param modifiers a modifier mask describing the modifier keys and mouse
* buttons (for example, shift, ctrl, alt, and meta) that
* are down during the event.
* Only extended modifiers are allowed to be used as a
* value for this parameter (see the {@link InputEvent#getModifiersEx}
* class for the description of extended modifiers).
* Passing negative parameter
* is not recommended.
* Zero value means that no modifiers were passed.
* Use either an extended _DOWN_MASK or old _MASK modifiers,
* however do not mix models in the one event.
* The extended modifiers are preferred for using
* Zero value means that no modifiers were passed
* @param x The horizontal x coordinate for the mouse location.
* It is allowed to pass negative values
* @param y The vertical y coordinate for the mouse location.
......
/*
* Copyright (c) 2003, 2008, 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.
*
* This code is free software; you can redistribute it and/or modify it
......@@ -46,12 +46,17 @@ at the permission allows, and associated risks">
* <tr>
* <td>control</td>
* <td>Ability to control the runtime characteristics of the Java virtual
* machine, for example, setting the -verbose:gc and -verbose:class flag,
* setting the threshold of a memory pool, and enabling and disabling
* the thread contention monitoring support.
* machine, for example, enabling and disabling the verbose output for
* the class loading or memory system, setting the threshold of a memory
* pool, and enabling and disabling the thread contention monitoring
* support. Some actions controlled by this permission can disclose
* information about the running application, like the -verbose:class
* flag.
* </td>
* <td>This allows an attacker to control the runtime characteristics
* of the Java virtual machine and cause the system to misbehave.
* of the Java virtual machine and cause the system to misbehave. An
* attacker can also access some information related to the running
* application.
* </td>
* </tr>
* <tr>
......
......@@ -71,7 +71,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
* @param size the initial number of attributes
*/
public Attributes(int size) {
map = new HashMap(size);
map = new HashMap<>(size);
}
/**
......@@ -81,7 +81,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
* @param attr the specified Attributes
*/
public Attributes(Attributes attr) {
map = new HashMap(attr);
map = new HashMap<>(attr);
}
......@@ -296,9 +296,9 @@ public class Attributes implements Map<Object,Object>, Cloneable {
* XXX Need to handle UTF8 values and break up lines longer than 72 bytes
*/
void write(DataOutputStream os) throws IOException {
Iterator it = entrySet().iterator();
Iterator<Map.Entry<Object, Object>> it = entrySet().iterator();
while (it.hasNext()) {
Map.Entry e = (Map.Entry)it.next();
Map.Entry<Object, Object> e = it.next();
StringBuffer buffer = new StringBuffer(
((Name)e.getKey()).toString());
buffer.append(": ");
......@@ -340,9 +340,9 @@ public class Attributes implements Map<Object,Object>, Cloneable {
// write out all attributes except for the version
// we wrote out earlier
Iterator it = entrySet().iterator();
Iterator<Map.Entry<Object, Object>> it = entrySet().iterator();
while (it.hasNext()) {
Map.Entry e = (Map.Entry)it.next();
Map.Entry<Object, Object> e = it.next();
String name = ((Name)e.getKey()).toString();
if ((version != null) && ! (name.equalsIgnoreCase(vername))) {
......@@ -499,7 +499,7 @@ public class Attributes implements Map<Object,Object>, Cloneable {
*/
public boolean equals(Object o) {
if (o instanceof Name) {
Comparator c = ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER;
Comparator<String> c = ASCIICaseInsensitiveComparator.CASE_INSENSITIVE_ORDER;
return c.compare(name, ((Name)o).name) == 0;
} else {
return false;
......
/*
* Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
......@@ -135,7 +135,7 @@ class JarOutputStream extends ZipOutputStream {
* The bytes are assumed to be in Intel (little-endian) byte order.
*/
private static int get16(byte[] b, int off) {
return (b[off] & 0xff) | ((b[off+1] & 0xff) << 8);
return Byte.toUnsignedInt(b[off]) | ( Byte.toUnsignedInt(b[off+1]) << 8);
}
/*
......
......@@ -48,21 +48,21 @@ class JarVerifier {
/* a table mapping names to code signers, for jar entries that have
had their actual hashes verified */
private Hashtable verifiedSigners;
private Hashtable<String, CodeSigner[]> verifiedSigners;
/* a table mapping names to code signers, for jar entries that have
passed the .SF/.DSA/.EC -> MANIFEST check */
private Hashtable sigFileSigners;
private Hashtable<String, CodeSigner[]> sigFileSigners;
/* a hash table to hold .SF bytes */
private Hashtable sigFileData;
private Hashtable<String, byte[]> sigFileData;
/** "queue" of pending PKCS7 blocks that we couldn't parse
* until we parsed the .SF file */
private ArrayList pendingBlocks;
private ArrayList<SignatureFileVerifier> pendingBlocks;
/* cache of CodeSigner objects */
private ArrayList signerCache;
private ArrayList<CodeSigner[]> signerCache;
/* Are we parsing a block? */
private boolean parsingBlockOrSF = false;
......@@ -94,10 +94,10 @@ class JarVerifier {
public JarVerifier(byte rawBytes[]) {
manifestRawBytes = rawBytes;
sigFileSigners = new Hashtable();
verifiedSigners = new Hashtable();
sigFileData = new Hashtable(11);
pendingBlocks = new ArrayList();
sigFileSigners = new Hashtable<>();
verifiedSigners = new Hashtable<>();
sigFileData = new Hashtable<>(11);
pendingBlocks = new ArrayList<>();
baos = new ByteArrayOutputStream();
manifestDigests = new ArrayList<>();
}
......@@ -248,10 +248,9 @@ class JarVerifier {
sigFileData.put(key, bytes);
// check pending blocks, we can now process
// anyone waiting for this .SF file
Iterator it = pendingBlocks.iterator();
Iterator<SignatureFileVerifier> it = pendingBlocks.iterator();
while (it.hasNext()) {
SignatureFileVerifier sfv =
(SignatureFileVerifier) it.next();
SignatureFileVerifier sfv = it.next();
if (sfv.needSignatureFile(key)) {
if (debug != null) {
debug.println(
......@@ -270,7 +269,7 @@ class JarVerifier {
String key = uname.substring(0, uname.lastIndexOf("."));
if (signerCache == null)
signerCache = new ArrayList();
signerCache = new ArrayList<>();
if (manDig == null) {
synchronized(manifestRawBytes) {
......@@ -287,7 +286,7 @@ class JarVerifier {
if (sfv.needSignatureFileBytes()) {
// see if we have already parsed an external .SF file
byte[] bytes = (byte[]) sigFileData.get(key);
byte[] bytes = sigFileData.get(key);
if (bytes == null) {
// put this block on queue for later processing
......@@ -343,7 +342,7 @@ class JarVerifier {
*/
public CodeSigner[] getCodeSigners(String name)
{
return (CodeSigner[])verifiedSigners.get(name);
return verifiedSigners.get(name);
}
public CodeSigner[] getCodeSigners(JarFile jar, JarEntry entry)
......@@ -376,15 +375,14 @@ class JarVerifier {
CodeSigner[] signers) {
if (signers != null) {
ArrayList certChains = new ArrayList();
ArrayList<java.security.cert.Certificate> certChains = new ArrayList<>();
for (int i = 0; i < signers.length; i++) {
certChains.addAll(
signers[i].getSignerCertPath().getCertificates());
}
// Convert into a Certificate[]
return (java.security.cert.Certificate[])
certChains.toArray(
return certChains.toArray(
new java.security.cert.Certificate[certChains.size()]);
}
return null;
......@@ -418,8 +416,8 @@ class JarVerifier {
// MANIFEST.MF is always treated as signed and verified,
// move its signers from sigFileSigners to verifiedSigners.
if (sigFileSigners.containsKey(JarFile.MANIFEST_NAME)) {
verifiedSigners.put(JarFile.MANIFEST_NAME,
sigFileSigners.remove(JarFile.MANIFEST_NAME));
CodeSigner[] codeSigners = sigFileSigners.remove(JarFile.MANIFEST_NAME);
verifiedSigners.put(JarFile.MANIFEST_NAME, codeSigners);
}
}
......@@ -493,10 +491,10 @@ class JarVerifier {
// Extended JavaUtilJarAccess CodeSource API Support
private Map urlToCodeSourceMap = new HashMap();
private Map signerToCodeSource = new HashMap();
private Map<URL, Map<CodeSigner[], CodeSource>> urlToCodeSourceMap = new HashMap<>();
private Map<CodeSigner[], CodeSource> signerToCodeSource = new HashMap<>();
private URL lastURL;
private Map lastURLMap;
private Map<CodeSigner[], CodeSource> lastURLMap;
/*
* Create a unique mapping from codeSigner cache entries to CodeSource.
......@@ -504,19 +502,19 @@ class JarVerifier {
* and shared JAR file although in practice there will be a single URL in use.
*/
private synchronized CodeSource mapSignersToCodeSource(URL url, CodeSigner[] signers) {
Map map;
Map<CodeSigner[], CodeSource> map;
if (url == lastURL) {
map = lastURLMap;
} else {
map = (Map) urlToCodeSourceMap.get(url);
map = urlToCodeSourceMap.get(url);
if (map == null) {
map = new HashMap();
map = new HashMap<>();
urlToCodeSourceMap.put(url, map);
}
lastURLMap = map;
lastURL = url;
}
CodeSource cs = (CodeSource) map.get(signers);
CodeSource cs = map.get(signers);
if (cs == null) {
cs = new VerifierCodeSource(csdomain, url, signers);
signerToCodeSource.put(signers, cs);
......@@ -524,16 +522,16 @@ class JarVerifier {
return cs;
}
private CodeSource[] mapSignersToCodeSources(URL url, List signers, boolean unsigned) {
List sources = new ArrayList();
private CodeSource[] mapSignersToCodeSources(URL url, List<CodeSigner[]> signers, boolean unsigned) {
List<CodeSource> sources = new ArrayList<>();
for (int i = 0; i < signers.size(); i++) {
sources.add(mapSignersToCodeSource(url, (CodeSigner[]) signers.get(i)));
sources.add(mapSignersToCodeSource(url, signers.get(i)));
}
if (unsigned) {
sources.add(mapSignersToCodeSource(url, null));
}
return (CodeSource[]) sources.toArray(new CodeSource[sources.size()]);
return sources.toArray(new CodeSource[sources.size()]);
}
private CodeSigner[] emptySigner = new CodeSigner[0];
......@@ -553,7 +551,7 @@ class JarVerifier {
* but this handles a CodeSource of any type, just in case.
*/
CodeSource[] sources = mapSignersToCodeSources(cs.getLocation(), getJarCodeSigners(), true);
List sourceList = new ArrayList();
List<CodeSource> sourceList = new ArrayList<>();
for (int i = 0; i < sources.length; i++) {
sourceList.add(sources[i]);
}
......@@ -574,6 +572,7 @@ class JarVerifier {
* signing data that can be compared by object reference identity.
*/
private static class VerifierCodeSource extends CodeSource {
private static final long serialVersionUID = -9047366145967768825L;
URL vlocation;
CodeSigner[] vsigners;
......@@ -641,16 +640,16 @@ class JarVerifier {
return vcerts;
}
}
private Map signerMap;
private Map<String, CodeSigner[]> signerMap;
private synchronized Map signerMap() {
private synchronized Map<String, CodeSigner[]> signerMap() {
if (signerMap == null) {
/*
* Snapshot signer state so it doesn't change on us. We care
* only about the asserted signatures. Verification of
* signature validity happens via the JarEntry apis.
*/
signerMap = new HashMap(verifiedSigners.size() + sigFileSigners.size());
signerMap = new HashMap<>(verifiedSigners.size() + sigFileSigners.size());
signerMap.putAll(verifiedSigners);
signerMap.putAll(sigFileSigners);
}
......@@ -658,15 +657,15 @@ class JarVerifier {
}
public synchronized Enumeration<String> entryNames(JarFile jar, final CodeSource[] cs) {
final Map map = signerMap();
final Iterator itor = map.entrySet().iterator();
final Map<String, CodeSigner[]> map = signerMap();
final Iterator<Map.Entry<String, CodeSigner[]>> itor = map.entrySet().iterator();
boolean matchUnsigned = false;
/*
* Grab a single copy of the CodeSigner arrays. Check
* to see if we can optimize CodeSigner equality test.
*/
List req = new ArrayList(cs.length);
List<CodeSigner[]> req = new ArrayList<>(cs.length);
for (int i = 0; i < cs.length; i++) {
CodeSigner[] match = findMatchingSigners(cs[i]);
if (match != null) {
......@@ -678,8 +677,8 @@ class JarVerifier {
}
}
final List signersReq = req;
final Enumeration enum2 = (matchUnsigned) ? unsignedEntryNames(jar) : emptyEnumeration;
final List<CodeSigner[]> signersReq = req;
final Enumeration<String> enum2 = (matchUnsigned) ? unsignedEntryNames(jar) : emptyEnumeration;
return new Enumeration<String>() {
......@@ -691,14 +690,14 @@ class JarVerifier {
}
while (itor.hasNext()) {
Map.Entry e = (Map.Entry) itor.next();
if (signersReq.contains((CodeSigner[]) e.getValue())) {
name = (String) e.getKey();
Map.Entry<String, CodeSigner[]> e = itor.next();
if (signersReq.contains(e.getValue())) {
name = e.getKey();
return true;
}
}
while (enum2.hasMoreElements()) {
name = (String) enum2.nextElement();
name = enum2.nextElement();
return true;
}
return false;
......@@ -719,13 +718,13 @@ class JarVerifier {
* Like entries() but screens out internal JAR mechanism entries
* and includes signed entries with no ZIP data.
*/
public Enumeration<JarEntry> entries2(final JarFile jar, Enumeration e) {
final Map map = new HashMap();
public Enumeration<JarEntry> entries2(final JarFile jar, Enumeration<? extends ZipEntry> e) {
final Map<String, CodeSigner[]> map = new HashMap<>();
map.putAll(signerMap());
final Enumeration enum_ = e;
final Enumeration<? extends ZipEntry> enum_ = e;
return new Enumeration<JarEntry>() {
Enumeration signers = null;
Enumeration<String> signers = null;
JarEntry entry;
public boolean hasMoreElements() {
......@@ -733,7 +732,7 @@ class JarVerifier {
return true;
}
while (enum_.hasMoreElements()) {
ZipEntry ze = (ZipEntry) enum_.nextElement();
ZipEntry ze = enum_.nextElement();
if (JarVerifier.isSigningRelated(ze.getName())) {
continue;
}
......@@ -744,7 +743,7 @@ class JarVerifier {
signers = Collections.enumeration(map.keySet());
}
while (signers.hasMoreElements()) {
String name = (String) signers.nextElement();
String name = signers.nextElement();
entry = jar.newEntry(new ZipEntry(name));
return true;
}
......@@ -764,7 +763,7 @@ class JarVerifier {
}
};
}
private Enumeration emptyEnumeration = new Enumeration<String>() {
private Enumeration<String> emptyEnumeration = new Enumeration<String>() {
public boolean hasMoreElements() {
return false;
......@@ -797,8 +796,8 @@ class JarVerifier {
}
private Enumeration<String> unsignedEntryNames(JarFile jar) {
final Map map = signerMap();
final Enumeration entries = jar.entries();
final Map<String, CodeSigner[]> map = signerMap();
final Enumeration<JarEntry> entries = jar.entries();
return new Enumeration<String>() {
String name;
......@@ -813,7 +812,7 @@ class JarVerifier {
}
while (entries.hasMoreElements()) {
String value;
ZipEntry e = (ZipEntry) entries.nextElement();
ZipEntry e = entries.nextElement();
value = e.getName();
if (e.isDirectory() || isSigningRelated(value)) {
continue;
......@@ -836,14 +835,14 @@ class JarVerifier {
}
};
}
private List jarCodeSigners;
private List<CodeSigner[]> jarCodeSigners;
private synchronized List getJarCodeSigners() {
private synchronized List<CodeSigner[]> getJarCodeSigners() {
CodeSigner[] signers;
if (jarCodeSigners == null) {
HashSet set = new HashSet();
HashSet<CodeSigner[]> set = new HashSet<>();
set.addAll(signerMap().values());
jarCodeSigners = new ArrayList();
jarCodeSigners = new ArrayList<>();
jarCodeSigners.addAll(set);
}
return jarCodeSigners;
......@@ -858,7 +857,7 @@ class JarVerifier {
public CodeSource getCodeSource(URL url, String name) {
CodeSigner[] signers;
signers = (CodeSigner[]) signerMap().get(name);
signers = signerMap().get(name);
return mapSignersToCodeSource(url, signers);
}
......
/*
* Copyright (c) 1997, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
......@@ -339,7 +339,7 @@ public class Manifest implements Cloneable {
return -1;
}
}
return buf[pos++] & 0xff;
return Byte.toUnsignedInt(buf[pos++]);
}
public int read(byte[] b, int off, int len) throws IOException {
......
/*
* Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2012, 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
......@@ -119,7 +119,7 @@ class InflaterInputStream extends FilterInputStream {
*/
public int read() throws IOException {
ensureOpen();
return read(singleByteBuf, 0, 1) == -1 ? -1 : singleByteBuf[0] & 0xff;
return read(singleByteBuf, 0, 1) == -1 ? -1 : Byte.toUnsignedInt(singleByteBuf[0]);
}
/**
......
/*
* Copyright (c) 1996, 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2012, 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
......@@ -435,7 +435,7 @@ class ZipInputStream extends InflaterInputStream implements ZipConstants {
* The bytes are assumed to be in Intel (little-endian) byte order.
*/
private static final int get16(byte b[], int off) {
return (b[off] & 0xff) | ((b[off+1] & 0xff) << 8);
return Byte.toUnsignedInt(b[off]) | (Byte.toUnsignedInt(b[off+1]) << 8);
}
/*
......
/*
* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2012, 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
......@@ -775,7 +775,7 @@ public abstract class CipherSpi {
int outOfs = output.arrayOffset() + outPos;
byte[] inArray = new byte[getTempArraySize(inLen)];
int total = 0;
while (inLen > 0) {
do {
int chunk = Math.min(inLen, inArray.length);
input.get(inArray, 0, chunk);
int n;
......@@ -787,7 +787,7 @@ public abstract class CipherSpi {
total += n;
outOfs += n;
inLen -= chunk;
}
} while (inLen > 0);
output.position(outPos + total);
return total;
} else { // output is not backed by an accessible byte[]
......@@ -804,7 +804,7 @@ public abstract class CipherSpi {
int outSize = outArray.length;
int total = 0;
boolean resized = false;
while (inLen > 0) {
do {
int chunk = Math.min(inLen, outSize);
if ((a1 == false) && (resized == false)) {
input.get(inArray, 0, chunk);
......@@ -834,7 +834,7 @@ public abstract class CipherSpi {
int newOut = engineGetOutputSize(chunk);
outArray = new byte[newOut];
}
}
} while (inLen > 0);
input.position(inLimit);
return total;
}
......
/*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2010, 2012, 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
......@@ -43,7 +43,7 @@ public abstract class ExtendedSSLSession implements SSLSession {
* The signature algorithm name must be a standard Java Security
* name (such as "SHA1withRSA", "SHA256withECDSA", and so on).
* See Appendix A in the <a href=
* "../../../technotes/guides/security/crypto/CryptoSpec.html#AppA">
* "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#AppA">
* Java Cryptography Architecture API Specification &amp; Reference </a>
* for information about standard algorithm names.
* <p>
......@@ -71,7 +71,7 @@ public abstract class ExtendedSSLSession implements SSLSession {
* The signature algorithm name must be a standard Java Security
* name (such as "SHA1withRSA", "SHA256withECDSA", and so on).
* See Appendix A in the <a href=
* "../../../technotes/guides/security/crypto/CryptoSpec.html#AppA">
* "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#AppA">
* Java Cryptography Architecture API Specification &amp; Reference </a>
* for information about standard algorithm names.
*
......
/*
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2012, 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
......@@ -242,7 +242,7 @@ public class SSLParameters {
*
* @param algorithm The standard string name of the endpoint
* identification algorithm (or null). See Appendix A in the <a href=
* "../../../technotes/guides/security/crypto/CryptoSpec.html#AppA">
* "{@docRoot}/../technotes/guides/security/crypto/CryptoSpec.html#AppA">
* Java Cryptography Architecture API Specification &amp; Reference </a>
* for information about standard algorithm names.
*
......
......@@ -180,8 +180,7 @@ public final class PrinterStateReasons
if (severity == null) {
throw new NullPointerException("severity is null");
}
return super.put((PrinterStateReason) reason,
(Severity) severity);
return super.put(reason, severity);
}
/**
......
......@@ -141,7 +141,7 @@ public class ReferenceUriSchemesSupported
* Returns the string table for class ReferenceUriSchemesSupported.
*/
protected String[] getStringTable() {
return (String[])myStringTable.clone();
return myStringTable.clone();
}
/**
......
/*
* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2012, 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
......@@ -107,10 +107,17 @@ public final class X500Principal implements Principal, java.io.Serializable {
* defined in RFC 1779 and RFC 2253
* (and listed in {@link #getName(String format) getName(String format)}),
* as well as the T, DNQ or DNQUALIFIER, SURNAME, GIVENNAME, INITIALS,
* GENERATION, EMAILADDRESS, and SERIALNUMBER keywords whose OIDs are
* defined in RFC 3280 and its successor.
* GENERATION, EMAILADDRESS, and SERIALNUMBER keywords whose Object
* Identifiers (OIDs) are defined in RFC 3280 and its successor.
* Any other attribute type must be specified as an OID.
*
* <p>This implementation enforces a more restrictive OID syntax than
* defined in RFC 1779 and 2253. It uses the more correct syntax defined in
* <a href="http://www.ietf.org/rfc/rfc4512.txt">RFC 4512</a>, which
* specifies that OIDs contain at least 2 digits:
*
* <p>{@code numericoid = number 1*( DOT number ) }
*
* @param name an X.500 distinguished name in RFC 1779 or RFC 2253 format
* @exception NullPointerException if the <code>name</code>
* is <code>null</code>
......@@ -135,10 +142,17 @@ public final class X500Principal implements Principal, java.io.Serializable {
* keywords recognized by <code>X500Principal(String)</code>. Keywords
* MUST be specified in all upper-case, otherwise they will be ignored.
* Improperly specified keywords are ignored; however if a keyword in the
* name maps to an improperly specified OID, an
* name maps to an improperly specified Object Identifier (OID), an
* <code>IllegalArgumentException</code> is thrown. It is permissible to
* have 2 different keywords that map to the same OID.
*
* <p>This implementation enforces a more restrictive OID syntax than
* defined in RFC 1779 and 2253. It uses the more correct syntax defined in
* <a href="http://www.ietf.org/rfc/rfc4512.txt">RFC 4512</a>, which
* specifies that OIDs contain at least 2 digits:
*
* <p>{@code numericoid = number 1*( DOT number ) }
*
* @param name an X.500 distinguished name in RFC 1779 or RFC 2253 format
* @param keywordMap an attribute type keyword map, where each key is a
* keyword String that maps to a corresponding object identifier in String
......
......@@ -2,7 +2,7 @@
<html>
<head>
<!--
Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2000, 2012, 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
......@@ -30,17 +30,26 @@ questions.
<body bgcolor="white">
This package contains the classes that should be used to store
X500 Principal and X500 Private Crendentials in a
X500 Principal and X500 Private Credentials in a
<i>Subject</i>.
<!--
<h2>Package Specification</h2>
##### FILL IN ANY SPECS NEEDED BY JAVA COMPATIBILITY KIT #####
<ul>
<li><a href="">##### REFER TO ANY FRAMEMAKER SPECIFICATION HERE #####</a>
<li><a href="http://www.ietf.org/rfc/rfc1779.txt">
RFC 1779: A String Representation of Distinguished Names</a></li>
<li><a href="http://www.ietf.org/rfc/rfc2253.txt">
RFC 2253: Lightweight Directory Access Protocol (v3):
UTF-8 String Representation of Distinguished Names</a></li>
<li><a href="http://www.ietf.org/rfc/rfc3280.txt">
RFC 3280: Internet X.509 Public Key Infrastructure
Certificate and Certificate Revocation List (CRL) Profile</a></li>
<li><a href="http://www.ietf.org/rfc/rfc4512.txt">
RFC 4512: Lightweight Directory Access Protocol (LDAP):
Directory Information Models</a></li>
</ul>
<!--
<h2>Related Documentation</h2>
For overviews, tutorials, examples, guides, and tool documentation, please see:
......
......@@ -34,7 +34,6 @@ import java.awt.KeyboardFocusManager;
import java.awt.Frame;
import java.awt.Point;
import java.awt.HeadlessException;
import java.awt.Toolkit;
import java.awt.Window;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
......@@ -994,8 +993,7 @@ public class JOptionPane extends JComponent implements Accessible
// if the user closed the window without selecting a button
// (newValue = null in that case). Otherwise, close the dialog.
if (dialog.isVisible() && event.getSource() == JOptionPane.this &&
(event.getPropertyName().equals(VALUE_PROPERTY) ||
event.getPropertyName().equals(INPUT_VALUE_PROPERTY)) &&
(event.getPropertyName().equals(VALUE_PROPERTY)) &&
event.getNewValue() != null &&
event.getNewValue() != JOptionPane.UNINITIALIZED_VALUE) {
dialog.setVisible(false);
......
......@@ -1236,6 +1236,7 @@ public class BasicOptionPaneUI extends OptionPaneUI {
int index = list.locationToIndex(e.getPoint());
optionPane.setInputValue(list.getModel().getElementAt(index));
optionPane.setValue(JOptionPane.OK_OPTION);
}
}
......
......@@ -434,6 +434,8 @@ public class SynthTreeUI extends BasicTreeUI
// Empty out the renderer pane, allowing renderers to be gc'ed.
rendererPane.removeAll();
paintContext = null;
}
private void configureRenderer(SynthContext context) {
......
......@@ -156,7 +156,7 @@ public class DefaultTreeCellRenderer extends JLabel implements TreeCellRenderer
protected Color borderSelectionColor;
private boolean isDropCell;
private boolean fillBackground = true;
private boolean fillBackground;
/**
* Set to true after the constructor has run.
......
/*
* Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2012, 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
......@@ -185,6 +185,7 @@ public class OffScreenImageSource implements ImageProducer {
theConsumer.setDimensions(image.getWidth(), image.getHeight());
theConsumer.setProperties(properties);
sendPixels();
theConsumer.imageComplete(ImageConsumer.SINGLEFRAMEDONE);
theConsumer.imageComplete(ImageConsumer.STATICIMAGEDONE);
} catch (NullPointerException e) {
if (theConsumer != null) {
......
......@@ -32,7 +32,7 @@ import java.beans.*;
*/
public class ComponentBeanInfo extends SimpleBeanInfo {
private static final Class beanClass = java.awt.Component.class;
private static final Class<java.awt.Component> beanClass = java.awt.Component.class;
public PropertyDescriptor[] getPropertyDescriptors() {
try {
......
......@@ -163,7 +163,9 @@ public abstract class FileFont extends PhysicalFont {
}
}
}
scaler.dispose();
if (scaler != null) {
scaler.dispose();
}
scaler = FontScaler.getNullScaler();
}
......
......@@ -1740,8 +1740,9 @@ public class StandardGlyphVector extends GlyphVector {
tx,
sgv.font.getStyle(),
aa, fm);
FontStrike strike = sgv.font2D.getStrike(desc); // !!! getStrike(desc, false)
// Get the strike via the handle. Shouldn't matter
// if we've invalidated the font but its an extra precaution.
FontStrike strike = sgv.font2D.handle.font2D.getStrike(desc); // !!! getStrike(desc, false)
return new GlyphStrike(sgv, strike, dx, dy);
}
......
......@@ -2619,6 +2619,9 @@ public abstract class SunFontManager implements FontSupport, FontManagerForSGE {
physicalFonts.remove(oldFont.fullName);
fullNameToFont.remove(oldFont.fullName.toLowerCase(Locale.ENGLISH));
FontFamily.remove(oldFont);
if (oldFont instanceof FileFont) {
((FileFont)oldFont).deregisterFontAndClearStrikeCache();
}
if (localeFullNamesToFont != null) {
Map.Entry[] mapEntries =
......
......@@ -1037,6 +1037,9 @@ public class TrueTypeFont extends FileFont {
if (head_Table != null && head_Table.capacity() >= 18) {
ShortBuffer sb = head_Table.asShortBuffer();
upem = sb.get(9) & 0xffff;
if (upem < 16 || upem > 16384) {
upem = 2048;
}
}
ByteBuffer os2_Table = getTableBuffer(os_2Tag);
......
/*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2012, 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
......@@ -27,13 +27,9 @@ package sun.management;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import javax.management.ObjectName;
import com.sun.management.DiagnosticCommandInfo;
import com.sun.management.DiagnosticCommandArgumentInfo;
import com.sun.management.HotSpotDiagnosticMXBean;
import com.sun.management.VMOption;
......@@ -120,54 +116,7 @@ public class HotSpotDiagnostic implements HotSpotDiagnosticMXBean {
}
}
public List<String> getDiagnosticCommands() {
String[] commands = getDiagnosticCommands0();
return commands == null ? Collections.<String>emptyList() :
Arrays.asList(commands);
}
public DiagnosticCommandInfo getDiagnosticCommandInfo(String command) {
String[] array = new String[] { command };
return getDiagnosticCommandInfo0(array)[0];
}
public List<DiagnosticCommandInfo> getDiagnosticCommandInfo() {
String[] commands = getDiagnosticCommands0();
return Arrays.asList(getDiagnosticCommandInfo0(commands));
}
public List<DiagnosticCommandInfo> getDiagnosticCommandInfo(
List<String> commands) {
return Arrays.asList(getDiagnosticCommandInfo0(
commands.toArray(new String[commands.size()])));
}
public String execute(String command) {
Util.checkControlAccess();
return executeDiagnosticCommand0(command);
}
public String execute(String cmd, String... arguments) {
if(cmd == null) {
throw new NullPointerException("Missing command name");
}
StringBuilder sb = new StringBuilder();
sb.append(cmd);
sb.append(" ");
for(String arg : arguments) {
sb.append(arg);
sb.append(" ");
}
return execute(sb.toString());
}
public ObjectName getObjectName() {
return Util.newObjectName("com.sun.management:type=HotSpotDiagnostic");
}
private native String[] getDiagnosticCommands0();
private native DiagnosticCommandInfo[] getDiagnosticCommandInfo0(
String[] commands) throws IllegalArgumentException;
private native String executeDiagnosticCommand0(String command)
throws IllegalArgumentException;
}
......@@ -270,7 +270,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
protected Proxy instProxy;
private CookieHandler cookieHandler;
private ResponseCache cacheHandler;
private final ResponseCache cacheHandler;
// the cached response, and cached response headers and body
protected CacheResponse cachedResponse;
......@@ -1579,7 +1579,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection {
if (respCode == 200 || respCode == 203 || respCode == 206 ||
respCode == 300 || respCode == 301 || respCode == 410) {
if (cacheHandler != null) {
if (cacheHandler != null && getUseCaches()) {
// give cache a chance to save response in cache
URI uri = ParseUtil.toURI(url);
if (uri != null) {
......
......@@ -35,15 +35,15 @@ import sun.misc.*;
* @since 1.4
*/
abstract class AbstractPollArrayWrapper {
public abstract class AbstractPollArrayWrapper {
// Event masks
static final short POLLIN = 0x0001;
static final short POLLOUT = 0x0004;
static final short POLLERR = 0x0008;
static final short POLLHUP = 0x0010;
static final short POLLNVAL = 0x0020;
static final short POLLREMOVE = 0x0800;
public static final short POLLIN = 0x0001;
public static final short POLLOUT = 0x0004;
public static final short POLLERR = 0x0008;
public static final short POLLHUP = 0x0010;
public static final short POLLNVAL = 0x0020;
public static final short POLLREMOVE = 0x0800;
// Miscellaneous constants
static final short SIZE_POLLFD = 8;
......
......@@ -67,7 +67,7 @@ abstract class AbstractPollSelectorImpl
this.channelOffset = offset;
}
void putEventOps(SelectionKeyImpl sk, int ops) {
public void putEventOps(SelectionKeyImpl sk, int ops) {
synchronized (closeLock) {
if (closed)
throw new ClosedSelectorException();
......
......@@ -28,16 +28,16 @@ package sun.nio.ch;
// Constants for reporting I/O status
final class IOStatus {
public final class IOStatus {
private IOStatus() { }
static final int EOF = -1; // End of file
static final int UNAVAILABLE = -2; // Nothing available (non-blocking)
static final int INTERRUPTED = -3; // System call interrupted
static final int UNSUPPORTED = -4; // Operation not supported
static final int THROWN = -5; // Exception thrown in JNI code
static final int UNSUPPORTED_CASE = -6; // This case not supported
public static final int EOF = -1; // End of file
public static final int UNAVAILABLE = -2; // Nothing available (non-blocking)
public static final int INTERRUPTED = -3; // System call interrupted
public static final int UNSUPPORTED = -4; // Operation not supported
public static final int THROWN = -5; // Exception thrown in JNI code
public static final int UNSUPPORTED_CASE = -6; // This case not supported
// The following two methods are for use in try/finally blocks where a
// status value needs to be normalized before being returned to the invoker
......@@ -55,28 +55,28 @@ final class IOStatus {
// }
//
static int normalize(int n) {
public static int normalize(int n) {
if (n == UNAVAILABLE)
return 0;
return n;
}
static boolean check(int n) {
public static boolean check(int n) {
return (n >= UNAVAILABLE);
}
static long normalize(long n) {
public static long normalize(long n) {
if (n == UNAVAILABLE)
return 0;
return n;
}
static boolean check(long n) {
public static boolean check(long n) {
return (n >= UNAVAILABLE);
}
// Return true iff n is not one of the IOStatus values
static boolean checkAll(long n) {
public static boolean checkAll(long n) {
return ((n > EOF) || (n < UNSUPPORTED_CASE));
}
......
......@@ -34,7 +34,7 @@ import java.nio.ByteBuffer;
* File-descriptor based I/O utilities that are shared by NIO classes.
*/
class IOUtil {
public class IOUtil {
private IOUtil() { } // No instantiation
......@@ -309,7 +309,7 @@ class IOUtil {
}
}
static FileDescriptor newFD(int i) {
public static FileDescriptor newFD(int i) {
FileDescriptor fd = new FileDescriptor();
setfdVal(fd, i);
return fd;
......@@ -326,10 +326,11 @@ class IOUtil {
static native boolean drain(int fd) throws IOException;
static native void configureBlocking(FileDescriptor fd, boolean blocking)
public static native void configureBlocking(FileDescriptor fd,
boolean blocking)
throws IOException;
static native int fdVal(FileDescriptor fd);
public static native int fdVal(FileDescriptor fd);
static native void setfdVal(FileDescriptor fd, int value);
......
......@@ -33,7 +33,7 @@ import java.security.AccessController;
import java.security.PrivilegedAction;
class Net { // package-private
public class Net {
private Net() { }
......@@ -75,7 +75,7 @@ class Net { // package-private
return canJoin6WithIPv4Group0();
}
static InetSocketAddress checkAddress(SocketAddress sa) {
public static InetSocketAddress checkAddress(SocketAddress sa) {
if (sa == null)
throw new NullPointerException();
if (!(sa instanceof InetSocketAddress))
......@@ -330,7 +330,7 @@ class Net { // package-private
// Due to oddities SO_REUSEADDR on windows reuse is ignored
private static native int socket0(boolean preferIPv6, boolean stream, boolean reuse);
static void bind(FileDescriptor fd, InetAddress addr, int port)
public static void bind(FileDescriptor fd, InetAddress addr, int port)
throws IOException
{
bind(UNSPEC, fd, addr, port);
......@@ -383,7 +383,7 @@ class Net { // package-private
private static native InetAddress localInetAddress(FileDescriptor fd)
throws IOException;
static InetSocketAddress localAddress(FileDescriptor fd)
public static InetSocketAddress localAddress(FileDescriptor fd)
throws IOException
{
return new InetSocketAddress(localInetAddress(fd), localPort(fd));
......
......@@ -36,7 +36,7 @@ import java.io.IOException;
* @since 1.4
*/
interface SelChImpl extends Channel {
public interface SelChImpl extends Channel {
FileDescriptor getFD();
......
......@@ -34,12 +34,12 @@ import java.nio.channels.spi.*;
* An implementation of SelectionKey for Solaris.
*/
class SelectionKeyImpl
public class SelectionKeyImpl
extends AbstractSelectionKey
{
final SelChImpl channel; // package-private
final SelectorImpl selector; // package-private
public final SelectorImpl selector;
// Index for a pollfd array in Selector that this key is registered with
private int index;
......@@ -91,15 +91,15 @@ class SelectionKeyImpl
// The nio versions of these operations do not care if a key
// has been invalidated. They are for internal use by nio code.
void nioReadyOps(int ops) { // package-private
public void nioReadyOps(int ops) {
readyOps = ops;
}
int nioReadyOps() { // package-private
public int nioReadyOps() {
return readyOps;
}
SelectionKey nioInterestOps(int ops) { // package-private
public SelectionKey nioInterestOps(int ops) {
if ((ops & ~channel().validOps()) != 0)
throw new IllegalArgumentException();
channel.translateAndSetInterestOps(ops, this);
......@@ -107,7 +107,7 @@ class SelectionKeyImpl
return this;
}
int nioInterestOps() { // package-private
public int nioInterestOps() {
return interestOps;
}
......
......@@ -36,7 +36,7 @@ import java.util.*;
* Base Selector implementation class.
*/
abstract class SelectorImpl
public abstract class SelectorImpl
extends AbstractSelector
{
......@@ -118,7 +118,7 @@ abstract class SelectorImpl
protected abstract void implClose() throws IOException;
void putEventOps(SelectionKeyImpl sk, int ops) { }
public void putEventOps(SelectionKeyImpl sk, int ops) { }
protected final SelectionKey register(AbstractSelectableChannel ch,
int ops,
......
......@@ -40,7 +40,7 @@ import sun.misc.Cleaner;
import sun.security.action.GetPropertyAction;
class Util {
public class Util {
// -- Caches --
......@@ -158,7 +158,7 @@ class Util {
/**
* Returns a temporary buffer of at least the given size
*/
static ByteBuffer getTemporaryDirectBuffer(int size) {
public static ByteBuffer getTemporaryDirectBuffer(int size) {
BufferCache cache = bufferCache.get();
ByteBuffer buf = cache.get(size);
if (buf != null) {
......@@ -178,7 +178,7 @@ class Util {
/**
* Releases a temporary buffer by returning to the cache or freeing it.
*/
static void releaseTemporaryDirectBuffer(ByteBuffer buf) {
public static void releaseTemporaryDirectBuffer(ByteBuffer buf) {
offerFirstTemporaryDirectBuffer(buf);
}
......@@ -467,7 +467,7 @@ class Util {
private static boolean loaded = false;
static void load() {
public static void load() {
synchronized (Util.class) {
if (loaded)
return;
......
......@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.nio.ch;
package sun.nio.ch.sctp;
import java.net.SocketAddress;
import com.sun.nio.sctp.MessageInfo;
......@@ -31,7 +31,7 @@ import com.sun.nio.sctp.Association;
/**
* An implementation of a MessageInfo.
*/
public class SctpMessageInfoImpl extends MessageInfo {
public class MessageInfoImpl extends MessageInfo {
private final SocketAddress address;
private final int bytes; /* 0 */
......@@ -43,9 +43,9 @@ public class SctpMessageInfoImpl extends MessageInfo {
private long timeToLive; /* 0L */
private int ppid; /* 0 */
public SctpMessageInfoImpl(Association association,
SocketAddress address,
int streamNumber) {
public MessageInfoImpl(Association association,
SocketAddress address,
int streamNumber) {
this.association = association;
this.address = address;
this.streamNumber = streamNumber;
......@@ -53,13 +53,13 @@ public class SctpMessageInfoImpl extends MessageInfo {
}
/* Invoked from native */
private SctpMessageInfoImpl(int assocId,
SocketAddress address,
int bytes,
int streamNumber,
boolean complete,
boolean unordered,
int ppid) {
private MessageInfoImpl(int assocId,
SocketAddress address,
int bytes,
int streamNumber,
boolean complete,
boolean unordered,
int ppid) {
this.assocId = assocId;
this.address = address;
this.bytes = bytes;
......@@ -75,7 +75,7 @@ public class SctpMessageInfoImpl extends MessageInfo {
}
/**
* SctpMessageInfoImpl instances created from native will need to have their
* MessageInfoImpl instances created from native will need to have their
* association set from the channel.
*/
void setAssociation(Association association) {
......
......@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.nio.ch;
package sun.nio.ch.sctp;
import com.sun.nio.sctp.SctpSocketOption;
......
/*
* Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2012, 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
......@@ -72,16 +72,19 @@ public class PKCS7 {
/*
* Random number generator for creating nonce values
* (Lazy initialization)
*/
private static final SecureRandom RANDOM;
static {
SecureRandom tmp = null;
try {
tmp = SecureRandom.getInstance("SHA1PRNG");
} catch (NoSuchAlgorithmException e) {
// should not happen
private static class SecureRandomHolder {
static final SecureRandom RANDOM;
static {
SecureRandom tmp = null;
try {
tmp = SecureRandom.getInstance("SHA1PRNG");
} catch (NoSuchAlgorithmException e) {
// should not happen
}
RANDOM = tmp;
}
RANDOM = tmp;
}
/*
......@@ -862,8 +865,8 @@ public class PKCS7 {
// Generate a nonce
BigInteger nonce = null;
if (RANDOM != null) {
nonce = new BigInteger(64, RANDOM);
if (SecureRandomHolder.RANDOM != null) {
nonce = new BigInteger(64, SecureRandomHolder.RANDOM);
tsQuery.setNonce(nonce);
}
tsQuery.requestCertificate(true);
......
......@@ -253,11 +253,25 @@ public final class PKCS12KeyStore extends KeyStoreSpi {
}
try {
// Use JCE
SecretKey skey = getPBEKey(password);
Cipher cipher = Cipher.getInstance(algOid.toString());
cipher.init(Cipher.DECRYPT_MODE, skey, algParams);
byte[] privateKeyInfo = cipher.doFinal(encryptedKey);
byte[] privateKeyInfo;
while (true) {
try {
// Use JCE
SecretKey skey = getPBEKey(password);
Cipher cipher = Cipher.getInstance(algOid.toString());
cipher.init(Cipher.DECRYPT_MODE, skey, algParams);
privateKeyInfo = cipher.doFinal(encryptedKey);
break;
} catch (Exception e) {
if (password.length == 0) {
// Retry using an empty password
// without a NULL terminator.
password = new char[1];
continue;
}
throw e;
}
}
PKCS8EncodedKeySpec kspec = new PKCS8EncodedKeySpec(privateKeyInfo);
......@@ -1251,16 +1265,24 @@ public final class PKCS12KeyStore extends KeyStoreSpi {
ObjectIdentifier algOid = in.getOID();
AlgorithmParameters algParams = parseAlgParameters(in);
try {
// Use JCE
SecretKey skey = getPBEKey(password);
Cipher cipher = Cipher.getInstance(algOid.toString());
cipher.init(Cipher.DECRYPT_MODE, skey, algParams);
safeContentsData = cipher.doFinal(safeContentsData);
} catch (Exception e) {
throw new IOException("failed to decrypt safe"
+ " contents entry: " + e, e);
while (true) {
try {
// Use JCE
SecretKey skey = getPBEKey(password);
Cipher cipher = Cipher.getInstance(algOid.toString());
cipher.init(Cipher.DECRYPT_MODE, skey, algParams);
safeContentsData = cipher.doFinal(safeContentsData);
break;
} catch (Exception e) {
if (password.length == 0) {
// Retry using an empty password
// without a NULL terminator.
password = new char[1];
continue;
}
throw new IOException(
"failed to decrypt safe contents entry: " + e, e);
}
}
} else {
throw new IOException("public key protected PKCS12" +
......
......@@ -55,7 +55,7 @@ public class CommandLine {
public static String[] parse(String[] args)
throws IOException
{
ArrayList newArgs = new ArrayList(args.length);
List<String> newArgs = new ArrayList<>(args.length);
for (int i = 0; i < args.length; i++) {
String arg = args[i];
if (arg.length() > 1 && arg.charAt(0) == '@') {
......@@ -69,10 +69,10 @@ public class CommandLine {
newArgs.add(arg);
}
}
return (String[])newArgs.toArray(new String[newArgs.size()]);
return newArgs.toArray(new String[newArgs.size()]);
}
private static void loadCmdFile(String name, List args)
private static void loadCmdFile(String name, List<String> args)
throws IOException
{
Reader r = new BufferedReader(new FileReader(name));
......@@ -83,7 +83,7 @@ public class CommandLine {
st.commentChar('#');
st.quoteChar('"');
st.quoteChar('\'');
while (st.nextToken() != st.TT_EOF) {
while (st.nextToken() != StreamTokenizer.TT_EOF) {
args.add(st.sval);
}
r.close();
......
......@@ -47,10 +47,10 @@ public class Manifest {
/* list of headers that all pertain to a particular
* file in the archive
*/
private Vector entries = new Vector();
private Vector<MessageHeader> entries = new Vector<>();
private byte[] tmpbuf = new byte[512];
/* a hashtable of entries, for fast lookup */
private Hashtable tableEntries = new Hashtable();
private Hashtable<String, MessageHeader> tableEntries = new Hashtable<>();
static final String[] hashes = {"SHA"};
static final byte[] EOL = {(byte)'\r', (byte)'\n'};
......@@ -115,14 +115,14 @@ public class Manifest {
}
public MessageHeader getEntry(String name) {
return (MessageHeader) tableEntries.get(name);
return tableEntries.get(name);
}
public MessageHeader entryAt(int i) {
return (MessageHeader) entries.elementAt(i);
return entries.elementAt(i);
}
public Enumeration entries() {
public Enumeration<MessageHeader> entries() {
return entries.elements();
}
......@@ -214,7 +214,7 @@ public class Manifest {
/* the first header in the file should be the global one.
* It should say "Manifest-Version: x.x"; if not add it
*/
MessageHeader globals = (MessageHeader) entries.elementAt(0);
MessageHeader globals = entries.elementAt(0);
if (globals.findValue("Manifest-Version") == null) {
/* Assume this is a user-defined manifest. If it has a Name: <..>
......@@ -238,7 +238,7 @@ public class Manifest {
globals.print(ps);
for (int i = 1; i < entries.size(); ++i) {
MessageHeader mh = (MessageHeader) entries.elementAt(i);
MessageHeader mh = entries.elementAt(i);
mh.print(ps);
}
}
......
......@@ -47,7 +47,7 @@ import sun.security.x509.AlgorithmId;
*
* <p>Each entry section contains the name of an entry (which must
* have a counterpart in the manifest). Like the manifest it contains
* a hash, the hash of the manifest section correspondind to the
* a hash, the hash of the manifest section corresponding to the
* name. Since the manifest entry contains the hash of the data, this
* is equivalent to a signature of the data, plus the attributes of
* the manifest entry.
......@@ -66,7 +66,7 @@ public class SignatureFile {
/* list of headers that all pertain to a particular file in the
* archive */
private Vector entries = new Vector();
private Vector<MessageHeader> entries = new Vector<>();
/* Right now we only support SHA hashes */
static final String[] hashes = {"SHA"};
......@@ -98,7 +98,7 @@ public class SignatureFile {
* character in length. */
private SignatureFile(String name) throws JarException {
entries = new Vector();
entries = new Vector<>();
if (name != null) {
if (name.length() > 8 || name.indexOf('.') != -1) {
......@@ -142,9 +142,9 @@ public class SignatureFile {
this(name, true);
this.manifest = manifest;
Enumeration enum_ = manifest.entries();
Enumeration<MessageHeader> enum_ = manifest.entries();
while (enum_.hasMoreElements()) {
MessageHeader mh = (MessageHeader)enum_.nextElement();
MessageHeader mh = enum_.nextElement();
String entryName = mh.findValue("Name");
if (entryName != null) {
add(entryName);
......@@ -269,9 +269,9 @@ public class SignatureFile {
*the entry does not exist.
*/
public MessageHeader getEntry(String name) {
Enumeration enum_ = entries();
Enumeration<MessageHeader> enum_ = entries();
while(enum_.hasMoreElements()) {
MessageHeader mh = (MessageHeader)enum_.nextElement();
MessageHeader mh = enum_.nextElement();
if (name.equals(mh.findValue("Name"))) {
return mh;
}
......@@ -282,13 +282,13 @@ public class SignatureFile {
/**
* Returns the n-th entry. The global header is a entry 0. */
public MessageHeader entryAt(int n) {
return (MessageHeader) entries.elementAt(n);
return entries.elementAt(n);
}
/**
* Returns an enumeration of the entries.
*/
public Enumeration entries() {
public Enumeration<MessageHeader> entries() {
return entries.elements();
}
......@@ -322,11 +322,11 @@ public class SignatureFile {
}
}
private Hashtable digests = new Hashtable();
private Hashtable<String, MessageDigest> digests = new Hashtable<>();
private MessageDigest getDigest(String algorithm)
throws NoSuchAlgorithmException {
MessageDigest dig = (MessageDigest)digests.get(algorithm);
MessageDigest dig = digests.get(algorithm);
if (dig == null) {
dig = MessageDigest.getInstance(algorithm);
digests.put(algorithm, dig);
......@@ -344,7 +344,7 @@ public class SignatureFile {
/* the first header in the file should be the global one.
* It should say "SignatureFile-Version: x.x"; barf if not
*/
MessageHeader globals = (MessageHeader) entries.elementAt(0);
MessageHeader globals = entries.elementAt(0);
if (globals.findValue("Signature-Version") == null) {
throw new JarException("Signature file requires " +
"Signature-Version: 1.0 in 1st header");
......@@ -354,7 +354,7 @@ public class SignatureFile {
globals.print(ps);
for (int i = 1; i < entries.size(); ++i) {
MessageHeader mh = (MessageHeader) entries.elementAt(i);
MessageHeader mh = entries.elementAt(i);
mh.print(ps);
}
}
......
......@@ -213,10 +213,10 @@ public class MemoryMonitor extends JPanel {
// Calculate remaining size
float ssH = ascent + descent;
float remainingHeight = (float) (y2 - (ssH*2) - 0.5f);
float remainingHeight = y2 - (ssH*2) - 0.5f;
float blockHeight = remainingHeight/10;
float blockWidth = 20.0f;
float remainingWidth = (float) (x2 - blockWidth - 10);
float remainingWidth = x2 - blockWidth - 10;
// .. Memory Free ..
big.setColor(mfColor);
......@@ -224,7 +224,7 @@ public class MemoryMonitor extends JPanel {
int i = 0;
for ( ; i < MemUsage ; i++) {
mfRect.setRect(x1+5,(float) y1+ssH+i*blockHeight,
blockWidth,(float) blockHeight-1);
blockWidth, blockHeight-1);
big.fill(mfRect);
}
......@@ -232,13 +232,13 @@ public class MemoryMonitor extends JPanel {
big.setColor(Color.green);
for ( ; i < 10; i++) {
muRect.setRect(x1+5,(float) y1 + ssH+i*blockHeight,
blockWidth,(float) blockHeight-1);
blockWidth, blockHeight-1);
big.fill(muRect);
}
// .. Draw History Graph ..
if (remainingWidth <= 30) remainingWidth = (float)30;
if (remainingHeight <= ssH) remainingHeight = (float)ssH;
if (remainingHeight <= ssH) remainingHeight = ssH;
big.setColor(graphColor);
int graphX = x1+30;
int graphY = y1 + (int) ssH;
......@@ -347,8 +347,8 @@ public class MemoryMonitor extends JPanel {
big = bimg.createGraphics();
big.setFont(font);
FontMetrics fm = big.getFontMetrics(font);
ascent = (int) fm.getAscent();
descent = (int) fm.getDescent();
ascent = fm.getAscent();
descent = fm.getDescent();
}
repaint();
try {
......
......@@ -185,11 +185,11 @@ class ZipConstants {
*/
///////////////////////////////////////////////////////
static final int CH(byte[] b, int n) {
return b[n] & 0xff;
return Byte.toUnsignedInt(b[n]);
}
static final int SH(byte[] b, int n) {
return (b[n] & 0xff) | ((b[n + 1] & 0xff) << 8);
return Byte.toUnsignedInt(b[n]) | (Byte.toUnsignedInt(b[n + 1]) << 8);
}
static final long LG(byte[] b, int n) {
......
......@@ -61,7 +61,7 @@ public class ZipFileStore extends FileStore {
private final ZipFileSystem zfs;
ZipFileStore(ZipPath zpath) {
this.zfs = (ZipFileSystem)zpath.getFileSystem();
this.zfs = zpath.getFileSystem();
}
@Override
......
......@@ -1609,7 +1609,7 @@ public class ZipFileSystem extends FileSystem {
synchronized (inflaters) {
int size = inflaters.size();
if (size > 0) {
Inflater inf = (Inflater)inflaters.remove(size - 1);
Inflater inf = inflaters.remove(size - 1);
return inf;
} else {
return new Inflater(true);
......@@ -1638,7 +1638,7 @@ public class ZipFileSystem extends FileSystem {
synchronized (deflaters) {
int size = deflaters.size();
if (size > 0) {
Deflater def = (Deflater)deflaters.remove(size - 1);
Deflater def = deflaters.remove(size - 1);
return def;
} else {
return new Deflater(Deflater.DEFAULT_COMPRESSION, true);
......
......@@ -211,7 +211,7 @@ public class ZipFileSystemProvider extends FileSystemProvider {
public <V extends FileAttributeView> V
getFileAttributeView(Path path, Class<V> type, LinkOption... options)
{
return (V)ZipFileAttributeView.get(toZipPath(path), type);
return ZipFileAttributeView.get(toZipPath(path), type);
}
@Override
......
......@@ -78,12 +78,12 @@ public class ZipInfo {
// twice
long len = LOCHDR + CENNAM(cen, pos) + CENEXT(cen, pos) + CENHDR;
if (zfs.readFullyAt(buf, 0, len, locoff(cen, pos)) != len)
zfs.zerror("read loc header failed");
ZipFileSystem.zerror("read loc header failed");
if (LOCEXT(buf) > CENEXT(cen, pos) + CENHDR) {
// have to read the second time;
len = LOCHDR + LOCNAM(buf) + LOCEXT(buf);
if (zfs.readFullyAt(buf, 0, len, locoff(cen, pos)) != len)
zfs.zerror("read loc header failed");
ZipFileSystem.zerror("read loc header failed");
}
printLOC(buf);
pos += CENHDR + CENNAM(cen, pos) + CENEXT(cen, pos) + CENCOM(cen, pos);
......
/*
* Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2012, 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
......@@ -34,141 +34,3 @@ Java_sun_management_HotSpotDiagnostic_dumpHeap
{
jmm_interface->DumpHeap0(env, outputfile, live);
}
JNIEXPORT jobjectArray JNICALL
Java_sun_management_HotSpotDiagnostic_getDiagnosticCommands0
(JNIEnv *env, jobject dummy)
{
if ((jmm_version > JMM_VERSION_1_2_1)
|| (jmm_version == JMM_VERSION_1_2 && ((jmm_version&0xFF)>=2))) {
return jmm_interface->GetDiagnosticCommands(env);
}
JNU_ThrowByName(env, "java/lang/UnsupportedOperationException",
"Diagnostic commands are not supported by this VM");
}
jobject getDiagnosticCommandArgumentInfoArray(JNIEnv *env, jstring command,
int num_arg) {
int i;
jobject obj;
jobjectArray result;
dcmdArgInfo* dcmd_arg_info_array;
jclass dcmdArgInfoCls;
jclass arraysCls;
jmethodID mid;
jobject resultList;
dcmd_arg_info_array = (dcmdArgInfo*) malloc(num_arg * sizeof(dcmdArgInfo));
if (dcmd_arg_info_array == NULL) {
return NULL;
}
jmm_interface->GetDiagnosticCommandArgumentsInfo(env, command,
dcmd_arg_info_array);
dcmdArgInfoCls = (*env)->FindClass(env,
"com/sun/management/DiagnosticCommandArgumentInfo");
result = (*env)->NewObjectArray(env, num_arg, dcmdArgInfoCls, NULL);
if (result == NULL) {
free(dcmd_arg_info_array);
return NULL;
}
for (i=0; i<num_arg; i++) {
obj = JNU_NewObjectByName(env,
"com/sun/management/DiagnosticCommandArgumentInfo",
"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZZI)V",
(*env)->NewStringUTF(env,dcmd_arg_info_array[i].name),
(*env)->NewStringUTF(env,dcmd_arg_info_array[i].description),
(*env)->NewStringUTF(env,dcmd_arg_info_array[i].type),
dcmd_arg_info_array[i].default_string == NULL ? NULL:
(*env)->NewStringUTF(env, dcmd_arg_info_array[i].default_string),
dcmd_arg_info_array[i].mandatory,
dcmd_arg_info_array[i].option,
dcmd_arg_info_array[i].position);
if (obj == NULL) {
free(dcmd_arg_info_array);
return NULL;
}
(*env)->SetObjectArrayElement(env, result, i, obj);
}
free(dcmd_arg_info_array);
arraysCls = (*env)->FindClass(env, "java/util/Arrays");
mid = (*env)->GetStaticMethodID(env, arraysCls,
"asList", "([Ljava/lang/Object;)Ljava/util/List;");
resultList = (*env)->CallStaticObjectMethod(env, arraysCls, mid, result);
return resultList;
}
/* Throws IllegalArgumentException if at least one the diagnostic command
* passed in argument is not supported by the JVM
*/
JNIEXPORT jobjectArray JNICALL
Java_sun_management_HotSpotDiagnostic_getDiagnosticCommandInfo0
(JNIEnv *env, jobject dummy, jobjectArray commands)
{
int i;
jclass dcmdInfoCls;
jobject result;
jobjectArray args;
jobject obj;
if (commands == NULL) {
JNU_ThrowNullPointerException(env, "Invalid String Array");
return NULL;
}
if ((jmm_version > JMM_VERSION_1_2_1)
|| (jmm_version == JMM_VERSION_1_2 && ((jmm_version&0xFF)>=2))) {
jsize num_commands = (*env)->GetArrayLength(env, commands);
dcmdInfo* dcmd_info_array = (dcmdInfo*) malloc(num_commands *
sizeof(dcmdInfo));
if (dcmd_info_array == NULL) {
JNU_ThrowOutOfMemoryError(env, NULL);
}
jmm_interface->GetDiagnosticCommandInfo(env, commands, dcmd_info_array);
dcmdInfoCls = (*env)->FindClass(env,
"com/sun/management/DiagnosticCommandInfo");
result = (*env)->NewObjectArray(env, num_commands, dcmdInfoCls, NULL);
if (result == NULL) {
free(dcmd_info_array);
JNU_ThrowOutOfMemoryError(env, 0);
}
for (i=0; i<num_commands; i++) {
args = getDiagnosticCommandArgumentInfoArray(env,
(*env)->GetObjectArrayElement(env,commands,i),
dcmd_info_array[i].num_arguments);
if (args == NULL) {
free(dcmd_info_array);
JNU_ThrowOutOfMemoryError(env, 0);
}
obj = JNU_NewObjectByName(env,
"com/sun/management/DiagnosticCommandInfo",
"(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZLjava/util/List;)V",
(*env)->NewStringUTF(env,dcmd_info_array[i].name),
(*env)->NewStringUTF(env,dcmd_info_array[i].description),
(*env)->NewStringUTF(env,dcmd_info_array[i].impact),
dcmd_info_array[i].enabled,
args);
if (obj == NULL) {
free(dcmd_info_array);
JNU_ThrowOutOfMemoryError(env, 0);
}
(*env)->SetObjectArrayElement(env, result, i, obj);
}
free(dcmd_info_array);
return result;
}
JNU_ThrowByName(env, "java/lang/UnsupportedOperationException",
"Diagnostic commands are not supported by this VM");
}
/* Throws IllegalArgumentException if the diagnostic command
* passed in argument is not supported by the JVM
*/
JNIEXPORT jstring JNICALL
Java_sun_management_HotSpotDiagnostic_executeDiagnosticCommand0
(JNIEnv *env, jobject dummy, jstring command) {
if((jmm_version > JMM_VERSION_1_2_1 )
|| (jmm_version == JMM_VERSION_1_2 && ((jmm_version&0xFF)>=2))) {
return jmm_interface->ExecuteDiagnosticCommand(env, command);
}
JNU_ThrowByName(env, "java/lang/UnsupportedOperationException",
"Diagnostic commands are not supported by this VM");
}
......@@ -180,7 +180,7 @@ class DevPollSelectorImpl
((SelChImpl)selch).kill();
}
void putEventOps(SelectionKeyImpl sk, int ops) {
public void putEventOps(SelectionKeyImpl sk, int ops) {
if (closed)
throw new ClosedSelectorException();
int fd = IOUtil.fdVal(sk.channel.getFD());
......
......@@ -181,7 +181,7 @@ class EPollSelectorImpl
((SelChImpl)selch).kill();
}
void putEventOps(SelectionKeyImpl sk, int ops) {
public void putEventOps(SelectionKeyImpl sk, int ops) {
if (closed)
throw new ClosedSelectorException();
pollWrapper.setInterest(sk.channel, ops);
......
......@@ -37,21 +37,21 @@ package sun.nio.ch;
// always returns -1 and the signal(long) method has no effect.
class NativeThread {
public class NativeThread {
// Returns an opaque token representing the native thread underlying the
// invoking Java thread. On systems that do not require signalling, this
// method always returns -1.
//
static native long current();
public static native long current();
// Signals the given native thread so as to release it from a blocking I/O
// operation. On systems that do not require signalling, this method has
// no effect.
//
static native void signal(long nt);
public static native void signal(long nt);
static native void init();
private static native void init();
static {
Util.load();
......
......@@ -41,9 +41,9 @@ import sun.misc.*;
* @since 1.4
*/
class PollArrayWrapper extends AbstractPollArrayWrapper {
public class PollArrayWrapper extends AbstractPollArrayWrapper {
static final short POLLCONN = POLLOUT;
public static final short POLLCONN = POLLOUT;
// File descriptor to write for interrupt
int interruptFD;
......
......@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.nio.ch;
package sun.nio.ch.sctp;
import com.sun.nio.sctp.Association;
import com.sun.nio.sctp.AssociationChangeNotification;
......@@ -30,7 +30,7 @@ import com.sun.nio.sctp.AssociationChangeNotification;
/**
* An implementation of AssociationChangeNotification
*/
public class SctpAssocChange extends AssociationChangeNotification
public class AssociationChange extends AssociationChangeNotification
implements SctpNotification
{
/* static final ints so that they can be referenced from native */
......@@ -50,10 +50,10 @@ public class SctpAssocChange extends AssociationChangeNotification
private int maxInStreams;
/* Invoked from native */
private SctpAssocChange(int assocId,
int intEvent,
int maxOutStreams,
int maxInStreams) {
private AssociationChange(int assocId,
int intEvent,
int maxOutStreams,
int maxInStreams) {
switch (intEvent) {
case SCTP_COMM_UP :
this.event = AssocChangeEvent.COMM_UP;
......
......@@ -22,17 +22,17 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.nio.ch;
package sun.nio.ch.sctp;
import com.sun.nio.sctp.Association;
/**
* An implementation of Association
*/
public class SctpAssociationImpl extends Association {
public SctpAssociationImpl(int associationID,
int maxInStreams,
int maxOutStreams) {
public class AssociationImpl extends Association {
public AssociationImpl(int associationID,
int maxInStreams,
int maxOutStreams) {
super(associationID, maxInStreams, maxOutStreams);
}
......
......@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.nio.ch;
package sun.nio.ch.sctp;
import java.net.SocketAddress;
import com.sun.nio.sctp.Association;
......@@ -31,7 +31,7 @@ import com.sun.nio.sctp.PeerAddressChangeNotification;
/**
* An implementation of PeerAddressChangeNotification
*/
public class SctpPeerAddrChange extends PeerAddressChangeNotification
public class PeerAddrChange extends PeerAddressChangeNotification
implements SctpNotification
{
/* static final ints so that they can be referenced from native */
......@@ -51,7 +51,7 @@ public class SctpPeerAddrChange extends PeerAddressChangeNotification
private AddressChangeEvent event;
/* Invoked from native */
private SctpPeerAddrChange(int assocId, SocketAddress address, int intEvent) {
private PeerAddrChange(int assocId, SocketAddress address, int intEvent) {
switch (intEvent) {
case SCTP_ADDR_AVAILABLE :
this.event = AddressChangeEvent.ADDR_AVAILABLE;
......
......@@ -22,13 +22,13 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.nio.ch;
package sun.nio.ch.sctp;
/**
* Wraps the actual message or notification so that it can be
* set and returned from the native receive implementation.
*/
public class SctpResultContainer {
public class ResultContainer {
/* static final ints so that they can be referenced from native */
static final int NOTHING = 0;
static final int MESSAGE = 1;
......@@ -63,47 +63,47 @@ public class SctpResultContainer {
return (SctpNotification) value;
}
SctpMessageInfoImpl getMessageInfo() {
MessageInfoImpl getMessageInfo() {
assert type() == MESSAGE;
if (value instanceof SctpMessageInfoImpl)
return (SctpMessageInfoImpl) value;
if (value instanceof MessageInfoImpl)
return (MessageInfoImpl) value;
return null;
}
SctpSendFailed getSendFailed() {
SendFailed getSendFailed() {
assert type() == SEND_FAILED;
if (value instanceof SctpSendFailed)
return (SctpSendFailed) value;
if (value instanceof SendFailed)
return (SendFailed) value;
return null;
}
SctpAssocChange getAssociationChanged() {
AssociationChange getAssociationChanged() {
assert type() == ASSOCIATION_CHANGED;
if (value instanceof SctpAssocChange)
return (SctpAssocChange) value;
if (value instanceof AssociationChange)
return (AssociationChange) value;
return null;
}
SctpPeerAddrChange getPeerAddressChanged() {
PeerAddrChange getPeerAddressChanged() {
assert type() == PEER_ADDRESS_CHANGED;
if (value instanceof SctpPeerAddrChange)
return (SctpPeerAddrChange) value;
if (value instanceof PeerAddrChange)
return (PeerAddrChange) value;
return null;
}
SctpShutdown getShutdown() {
Shutdown getShutdown() {
assert type() == SHUTDOWN;
if (value instanceof SctpShutdown)
return (SctpShutdown) value;
if (value instanceof Shutdown)
return (Shutdown) value;
return null;
}
......
......@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.nio.ch;
package sun.nio.ch.sctp;
import java.net.InetAddress;
import java.net.SocketAddress;
......@@ -53,11 +53,20 @@ import com.sun.nio.sctp.MessageInfo;
import com.sun.nio.sctp.NotificationHandler;
import com.sun.nio.sctp.SctpChannel;
import com.sun.nio.sctp.SctpSocketOption;
import sun.nio.ch.DirectBuffer;
import sun.nio.ch.IOStatus;
import sun.nio.ch.IOUtil;
import sun.nio.ch.NativeThread;
import sun.nio.ch.Net;
import sun.nio.ch.PollArrayWrapper;
import sun.nio.ch.SelChImpl;
import sun.nio.ch.SelectionKeyImpl;
import sun.nio.ch.Util;
import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
import static sun.nio.ch.SctpResultContainer.SEND_FAILED;
import static sun.nio.ch.SctpResultContainer.ASSOCIATION_CHANGED;
import static sun.nio.ch.SctpResultContainer.PEER_ADDRESS_CHANGED;
import static sun.nio.ch.SctpResultContainer.SHUTDOWN;
import static sun.nio.ch.sctp.ResultContainer.SEND_FAILED;
import static sun.nio.ch.sctp.ResultContainer.ASSOCIATION_CHANGED;
import static sun.nio.ch.sctp.ResultContainer.PEER_ADDRESS_CHANGED;
import static sun.nio.ch.sctp.ResultContainer.SHUTDOWN;
/**
* An implementation of an SctpChannel
......@@ -745,7 +754,7 @@ public class SctpChannelImpl extends SctpChannel
receiveInvoked.set(Boolean.TRUE);
try {
SctpResultContainer resultContainer = new SctpResultContainer();
ResultContainer resultContainer = new ResultContainer();
do {
resultContainer.clear();
synchronized (receiveLock) {
......@@ -775,7 +784,7 @@ public class SctpChannelImpl extends SctpChannel
/* message or nothing */
if (resultContainer.hasSomething()) {
/* Set the association before returning */
SctpMessageInfoImpl info =
MessageInfoImpl info =
resultContainer.getMessageInfo();
synchronized (stateLock) {
assert association != null;
......@@ -812,7 +821,7 @@ public class SctpChannelImpl extends SctpChannel
private int receive(int fd,
ByteBuffer dst,
SctpResultContainer resultContainer,
ResultContainer resultContainer,
boolean peek)
throws IOException {
int pos = dst.position();
......@@ -837,7 +846,7 @@ public class SctpChannelImpl extends SctpChannel
}
private int receiveIntoNativeBuffer(int fd,
SctpResultContainer resultContainer,
ResultContainer resultContainer,
ByteBuffer bb,
int rem,
int pos,
......@@ -854,7 +863,7 @@ public class SctpChannelImpl extends SctpChannel
private InternalNotificationHandler internalNotificationHandler =
new InternalNotificationHandler();
private void handleNotificationInternal(SctpResultContainer resultContainer)
private void handleNotificationInternal(ResultContainer resultContainer)
{
invokeNotificationHandler(resultContainer,
internalNotificationHandler, null);
......@@ -869,8 +878,8 @@ public class SctpChannelImpl extends SctpChannel
if (not.event().equals(
AssociationChangeNotification.AssocChangeEvent.COMM_UP) &&
association == null) {
SctpAssocChange sac = (SctpAssocChange) not;
association = new SctpAssociationImpl
AssociationChange sac = (AssociationChange) not;
association = new AssociationImpl
(sac.assocId(), sac.maxInStreams(), sac.maxOutStreams());
}
return HandlerResult.CONTINUE;
......@@ -878,7 +887,7 @@ public class SctpChannelImpl extends SctpChannel
}
private <T> HandlerResult invokeNotificationHandler
(SctpResultContainer resultContainer,
(ResultContainer resultContainer,
NotificationHandler<T> handler,
T attachment) {
SctpNotification notification = resultContainer.notification();
......@@ -1078,7 +1087,7 @@ public class SctpChannelImpl extends SctpChannel
/* Native */
private static native void initIDs();
static native int receive0(int fd, SctpResultContainer resultContainer,
static native int receive0(int fd, ResultContainer resultContainer,
long address, int length, boolean peek) throws IOException;
static native int send0(int fd, long address, int length,
......
......@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.nio.ch;
package sun.nio.ch.sctp;
import java.net.InetAddress;
import java.net.SocketAddress;
......@@ -53,8 +53,17 @@ import com.sun.nio.sctp.MessageInfo;
import com.sun.nio.sctp.SctpChannel;
import com.sun.nio.sctp.SctpMultiChannel;
import com.sun.nio.sctp.SctpSocketOption;
import sun.nio.ch.DirectBuffer;
import sun.nio.ch.NativeThread;
import sun.nio.ch.IOStatus;
import sun.nio.ch.IOUtil;
import sun.nio.ch.Net;
import sun.nio.ch.PollArrayWrapper;
import sun.nio.ch.SelChImpl;
import sun.nio.ch.SelectionKeyImpl;
import sun.nio.ch.Util;
import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
import static sun.nio.ch.SctpResultContainer.*;
import static sun.nio.ch.sctp.ResultContainer.*;
/**
* An implementation of SctpMultiChannel
......@@ -466,7 +475,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel
receiveInvoked.set(Boolean.TRUE);
try {
SctpResultContainer resultContainer = new SctpResultContainer();
ResultContainer resultContainer = new ResultContainer();
do {
resultContainer.clear();
synchronized (receiveLock) {
......@@ -498,7 +507,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel
/* message or nothing */
if (resultContainer.hasSomething()) {
/* Set the association before returning */
SctpMessageInfoImpl info =
MessageInfoImpl info =
resultContainer.getMessageInfo();
info.setAssociation(lookupAssociation(info.
associationID()));
......@@ -542,7 +551,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel
private int receive(int fd,
ByteBuffer dst,
SctpResultContainer resultContainer)
ResultContainer resultContainer)
throws IOException {
int pos = dst.position();
int lim = dst.limit();
......@@ -566,7 +575,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel
}
private int receiveIntoNativeBuffer(int fd,
SctpResultContainer resultContainer,
ResultContainer resultContainer,
ByteBuffer bb,
int rem,
int pos)
......@@ -580,7 +589,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel
private InternalNotificationHandler internalNotificationHandler =
new InternalNotificationHandler();
private void handleNotificationInternal(SctpResultContainer resultContainer)
private void handleNotificationInternal(ResultContainer resultContainer)
{
invokeNotificationHandler(resultContainer,
internalNotificationHandler, null);
......@@ -592,12 +601,12 @@ public class SctpMultiChannelImpl extends SctpMultiChannel
@Override
public HandlerResult handleNotification(
AssociationChangeNotification not, Object unused) {
SctpAssocChange sac = (SctpAssocChange) not;
AssociationChange sac = (AssociationChange) not;
/* Update map to reflect change in association */
switch (not.event()) {
case COMM_UP :
Association newAssociation = new SctpAssociationImpl
Association newAssociation = new AssociationImpl
(sac.assocId(), sac.maxInStreams(), sac.maxOutStreams());
addAssociation(newAssociation);
break;
......@@ -612,7 +621,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel
}
private <T> HandlerResult invokeNotificationHandler(
SctpResultContainer resultContainer,
ResultContainer resultContainer,
NotificationHandler<T> handler,
T attachment) {
HandlerResult result;
......@@ -956,7 +965,7 @@ public class SctpMultiChannelImpl extends SctpMultiChannel
/* Use common native implementation shared between
* one-to-one and one-to-many */
private static int receive0(int fd,
SctpResultContainer resultContainer,
ResultContainer resultContainer,
long address,
int length)
throws IOException{
......
......@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.nio.ch;
package sun.nio.ch.sctp;
import java.io.FileDescriptor;
import java.io.IOException;
......@@ -34,6 +34,8 @@ import java.util.Set;
import java.util.HashSet;
import java.security.AccessController;
import sun.security.action.GetPropertyAction;
import sun.nio.ch.IOUtil;
import sun.nio.ch.Net;
import com.sun.nio.sctp.SctpSocketOption;
import static com.sun.nio.sctp.SctpStandardSocketOptions.*;
......
......@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.nio.ch;
package sun.nio.ch.sctp;
import com.sun.nio.sctp.Association;
import com.sun.nio.sctp.Notification;
......
......@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.nio.ch;
package sun.nio.ch.sctp;
import java.net.SocketAddress;
import java.net.InetSocketAddress;
......@@ -41,6 +41,15 @@ import com.sun.nio.sctp.SctpChannel;
import com.sun.nio.sctp.SctpServerChannel;
import com.sun.nio.sctp.SctpSocketOption;
import com.sun.nio.sctp.SctpStandardSocketOptions;
import sun.nio.ch.DirectBuffer;
import sun.nio.ch.NativeThread;
import sun.nio.ch.IOStatus;
import sun.nio.ch.IOUtil;
import sun.nio.ch.Net;
import sun.nio.ch.PollArrayWrapper;
import sun.nio.ch.SelChImpl;
import sun.nio.ch.SelectionKeyImpl;
import sun.nio.ch.Util;
/**
* An implementation of SctpServerChannel
......
......@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.nio.ch;
package sun.nio.ch.sctp;
import java.nio.ByteBuffer;
import java.net.SocketAddress;
......@@ -32,7 +32,7 @@ import com.sun.nio.sctp.SendFailedNotification;
/**
* An implementation of SendFailedNotification
*/
public class SctpSendFailed extends SendFailedNotification
public class SendFailed extends SendFailedNotification
implements SctpNotification
{
private Association association;
......@@ -45,11 +45,11 @@ public class SctpSendFailed extends SendFailedNotification
private int streamNumber;
/* Invoked from native */
private SctpSendFailed(int assocId,
SocketAddress address,
ByteBuffer buffer,
int errorCode,
int streamNumber) {
private SendFailed(int assocId,
SocketAddress address,
ByteBuffer buffer,
int errorCode,
int streamNumber) {
this.assocId = assocId;
this.errorCode = errorCode;
this.streamNumber = streamNumber;
......
......@@ -22,7 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.nio.ch;
package sun.nio.ch.sctp;
import com.sun.nio.sctp.Association;
import com.sun.nio.sctp.ShutdownNotification;
......@@ -30,7 +30,7 @@ import com.sun.nio.sctp.ShutdownNotification;
/**
* An implementation of ShutdownNotification
*/
public class SctpShutdown extends ShutdownNotification
public class Shutdown extends ShutdownNotification
implements SctpNotification
{
private Association association;
......@@ -39,7 +39,7 @@ public class SctpShutdown extends ShutdownNotification
private int assocId;
/* Invoked from native */
private SctpShutdown(int assocId) {
private Shutdown(int assocId) {
this.assocId = assocId;
}
......
." Copyright (c) 2004, 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.
."
." 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.
."
.TH apt 1 "10 May 2011"
.LP
.SH "NAME"
.LP
.LP
\f2apt\fP \- annotation processing tool
.LP
.SH "SYNOPSIS"
.LP
.LP
\f2apt [\-classpath \fP\f2classpath\fP] [\-sourcepath \f2sourcepath\fP] [\-d \f2directory\fP] [\-s \f2directory\fP] [\-factorypath \f2path\fP] [\-factory \f2class\fP] [\-print] [\-nocompile] [\-A\f2key\fP[\f2=val\fP] ...] [\f2javac option\fP] sourcefiles [@files]
.LP
.SH "PARAMETERS"
.LP
.LP
Options may be in any order. For a discussion of parameters which apply to a specific option, see OPTIONS below.
.LP
.RS 3
.TP 3
sourcefiles
Zero or more source files to be processed.
.TP 3
@files
One or more files that list source files or other options
.RE
.LP
.SH "DESCRIPTION"
.LP
.LP
\f3Note\fP: The \f2apt\fP tool and its associated API contained in the package \f2com.sun.mirror\fP have been deprecated since JDK 7 and are planned to be removed in the next major JDK release. Use the options available in the \f2javac(1)\fP tool and the APIs contained in the packages \f2javax.annotation.processing\fP and \f2javax.lang.model\fP to process annotations.
.LP
.LP
The tool \f2apt\fP, annotation processing tool, includes reflective APIs and supporting infrastructure to process program annotations. The \f2apt\fP reflective APIs provide a build\-time, source\-based, read\-only view of program structure. These reflective APIs are designed to cleanly model the Java(TM) programming language's type system after the addition of generics. First, \f2apt\fP runs annotation processors that can produce new source code and other files. Next, \f2apt\fP can cause compilation of both original and generated source files, easing development. The reflective APIs and other APIs used to interact with the tool are subpackages of \f2com.sun.mirror\fP.
.LP
.LP
A fuller discussion of how the tool operates as well as instructions for developing with \f2apt\fP are in
.na
\f4Getting Started with \fP\f4apt\fP. @
.fi
http://download.oracle.com/javase/7/docs/technotes/guides/apt/GettingStarted.html
.LP
.SH "OPTIONS"
.LP
.SS
apt specific options
.LP
.RS 3
.TP 3
\-s dir
Specify the directory root under which processor\-generated source files will be placed; files are placed in subdirectories based on package namespace.
.TP 3
\-nocompile
Do not compile source files to class files.
.TP 3
\-print
Print out textual representation of specified types; perform no annotation processing or compilation.
.TP 3
\-A[key[=val]]
Options to pass to annotation processors \-\- these are not interpreted by \f2apt\fP directly, but are made available for use by individual processors
.TP 3
\-factorypath path
Specify where to find annotation processor factories; if this option is used, the classpath is \f2not\fP searched for factories.
.TP 3
\-factory classname
Name of annotation processor factory to use; bypasses default discovery process
.TP 3
\-version
Print version information.
.TP 3
\-X
Display information about non\-standard options.
.RE
.LP
.SS
Options shared with javac
.LP
.RS 3
.TP 3
\-d dir
Specify where to place processor and javac generated class files
.TP 3
\-cp path or \-classpath path
Specify where to find user class files and annotation processor factories. If \f2\-factorypath\fP is given, the classpath is not searched for factories.
.RE
.LP
.LP
Consult the javac(1) man page for information on \f2javac\fP options.
.LP
.SS
Non\-Standard Options
.LP
.RS 3
.TP 3
\-XListAnnotationTypes
List found annotation types.
.TP 3
\-XListDeclarations
List specified and included declarations.
.TP 3
\-XPrintAptRounds
Print information about initial and recursive \f2apt\fP rounds.
.TP 3
\-XPrintFactoryInfo
Print information about which annotations a factory is asked to process.
.TP 3
\-XclassesAsDecls
Treat both class and source files as declarations to process.
.RE
.LP
.LP
\f3Note\fP: Because these options are non\-standard, they are subject to change without notice.
.LP
.SH "NOTES"
.LP
.LP
The \f2apt\fP tool and its associated API contained in the package \f2com.sun.mirror\fP have been deprecated since JDK 7 and are planned to be removed in the next major JDK release. Use the options available in the \f2javac(1)\fP tool and the APIs contained in the packages \f2javax.annotation.processing\fP and \f2javax.lang.model\fP to process annotations.
.LP
.SH "SEE ALSO"
.LP
.RS 3
.TP 2
o
javac(1), java(1)
.RE
.LP
." Copyright (c) 2004, 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.
."
." 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.
."
.TH apt 1 "07 May 2011"
.LP
.SH "NAME"
.LP
.LP
\f2apt\fP \- 注釈処理ツール
.LP
.SH "形式"
.LP
.LP
\f2apt [\-classpath \fP\f2classpath\fP] [\-sourcepath \f2sourcepath\fP] [\-d \f2directory\fP] [\-s \f2directory\fP] [\-factorypath \f2path\fP] [\-factory \f2class\fP] [\-print] [\-nocompile] [\-A\f2key\fP[\f2=val\fP] ...] [\f2javac option\fP] sourcefiles [@files]
.LP
.SH "パラメータ"
.LP
.LP
オプションの指定順序に決まりはありません。特定のオプションに適用されるパラメータについては、下記の「オプション」を参照してください。
.LP
.RS 3
.TP 3
sourcefiles
ゼロ、1 つ、または複数の処理対象のソースファイル
.TP 3
@files
ソースファイルまたは他のオプションを一覧表示する 1 つまたは複数のファイル
.RE
.LP
.SH "説明"
.LP
.LP
\f3注\fP: \f2apt\fP ツールと、パッケージ \f2com.sun.mirror\fP に含まれているそれに関連した API は、JDK 7 以降非推奨になっており、JDK の次のメジャーリリースで削除される予定です。\f2javac(1)\fP ツールで利用可能なオプションと、パッケージ \f2javax.annotation.processing\fP および \f2javax.lang.model\fP に含まれている API を使用して、注釈を処理してください。
.LP
.LP
注釈処理ツール \f2apt\fP は、リフレクト API とサポートインフラストラクチャーから構成され、プログラム注釈を処理します。\f2apt\fP リフレクト API は、 構築時のソースベースで、プログラム構造に関する読み取り専用ビューを提供します。これらのリフレクト API は、総称を追加した後に、Java(TM) プログラミング言語の型システムを正しくモデル化するように設計されています。最初に、\f2apt\fP は、新しいソースコードと他のファイルを作成する注釈プロセッサを実行します。次に、\f2apt\fP は、元のソースファイルと生成したソースファイルの両方をコンパイルするため、開発が楽になります。ツールとのインタフェースに使用されるリフレクト API などの API は、\f2com.sun.mirror\fP のサブパッケージです。
.LP
.LP
ツールの機能に関する詳細と、\f2apt\fP を使用した開発方法については、
.na
\f4「apt 入門」\fP @
.fi
http://java.sun.com/javase/6/docs/technotes/guides/apt/GettingStarted.htmlを参照してください。
.LP
.SH "オプション"
.LP
.SS
apt 固有のオプション
.LP
.RS 3
.TP 3
\-s dir
プロセッサの生成するソースファイルを置くディレクトリルートを指定します。 ファイルは、パッケージの名前空間に基づいてサブディレクトリに置かれます。
.TP 3
\-nocompile
ソースファイルをクラスファイルにコンパイルしません。
.TP 3
\-print
指定したタイプのテキスト表現を出力します。 注釈処理またはコンパイルは行いません。
.TP 3
\-A[key[=val]]
注釈プロセッサへ渡すオプションです。 このオプションは、\f2apt\fP が直接解釈するのではなく、それぞれのプロセッサによって使用できるように変えられます。
.TP 3
\-factorypath path
注釈プロセッサファクトリを検索する場所を指定します。 このオプションを使用する場合、クラスパスのファクトリは検索されません。
.TP 3
\-factory classname
使用する注釈プロセッサファクトリの名前です。 デフォルトの検出プロセスを省略します。
.TP 3
\-version
バージョン情報を出力します。
.TP 3
\-X
非標準オプションに関する情報を表示します。
.RE
.LP
.SS
javac と共用するオプション
.LP
.RS 3
.TP 3
\-d dir
プロセッサと javac 生成のクラスファイルを置く場所を指定します。
.TP 3
\-cp path または \-classpath path
ユーザークラスファイルと注釈プロセッサファクトリを検索する場所を指定します。\f2\-factorypath\fP が指定されている場合、クラスパスのファクトリは検索されません。
.RE
.LP
.LP
\f2javac\fP オプションの詳細については、javac(1) のマニュアルページを参照してください。
.LP
.SS
非標準オプション
.LP
.RS 3
.TP 3
\-XListAnnotationTypes
注釈の型に検出されるリスト.
.TP 3
\-XListDeclarations
指定および宣言がインクルードされるリスト.
.TP 3
\-XPrintAptRounds
初期および再帰的な \f2apt\fP ラウンドに関する情報を出力する.
.TP 3
\-XPrintFactoryInfo
処理を要求するファクトリの注釈に関する情報を出力する.
.TP 3
\-XclassesAsDecls
クラスファイルとソースファイルの両方を、処理対象の宣言として処理します。
.RE
.LP
.LP
\f3注\fP: これらは非標準オプションなので、予告なく変更される可能性があります。
.LP
.SH "注"
.LP
.LP
\f2apt\fP ツールと、パッケージ \f2com.sun.mirror\fP に含まれているそれに関連した API は、JDK 7 以降非推奨になっており、JDK の次のメジャーリリースで削除される予定です。\f2javac(1)\fP ツールで利用可能なオプションと、パッケージ \f2javax.annotation.processing\fP および \f2javax.lang.model\fP に含まれている API を使用して、注釈を処理してください。
.LP
.SH "関連項目"
.LP
.RS 3
.TP 2
o
javac(1), java(1)
.RE
.LP
......@@ -171,6 +171,53 @@ static jobjectArray toFilenamesArray(JNIEnv *env, GSList* list)
return array;
}
/**
* Convert a GSList to an array of filenames (with the parent folder)
*/
static jobjectArray toPathAndFilenamesArray(JNIEnv *env, GSList* list)
{
jstring str;
jclass stringCls;
GSList *iterator;
jobjectArray array;
int i;
char* entry;
if (list == NULL) {
return NULL;
}
stringCls = (*env)->FindClass(env, "java/lang/String");
if (stringCls == NULL) {
JNU_ThrowInternalError(env, "Could not get java.lang.String class");
return NULL;
}
array = (*env)->NewObjectArray(env, fp_gtk_g_slist_length(list), stringCls,
NULL);
if (array == NULL) {
JNU_ThrowInternalError(env, "Could not instantiate array files array");
return NULL;
}
i = 0;
for (iterator = list; iterator; iterator = iterator->next) {
entry = (char*) iterator->data;
//check for leading slash.
if (entry[0] == '/') {
entry++;
}
str = (*env)->NewStringUTF(env, entry);
(*env)->SetObjectArrayElement(env, array, i, str);
i++;
}
return array;
}
static void handle_response(GtkWidget* aDialog, gint responseId, gpointer obj)
{
JNIEnv *env;
......@@ -183,16 +230,25 @@ static void handle_response(GtkWidget* aDialog, gint responseId, gpointer obj)
env = (JNIEnv *) JNU_GetEnv(jvm, JNI_VERSION_1_2);
current_folder = NULL;
filenames = NULL;
gboolean full_path_names = FALSE;
if (responseId == GTK_RESPONSE_ACCEPT) {
current_folder = fp_gtk_file_chooser_get_current_folder(
GTK_FILE_CHOOSER(aDialog));
if (current_folder == NULL) {
full_path_names = TRUE;
}
filenames = fp_gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(aDialog));
}
jcurrent_folder = (*env)->NewStringUTF(env, current_folder);
jfilenames = toFilenamesArray(env, filenames);
if (full_path_names) {
//This is a hack for use with "Recent Folders" in gtk where each
//file could have its own directory.
jcurrent_folder = (*env)->NewStringUTF(env, "/");
jfilenames = toPathAndFilenamesArray(env, filenames);
} else {
jcurrent_folder = (*env)->NewStringUTF(env, current_folder);
jfilenames = toFilenamesArray(env, filenames);
}
(*env)->CallVoidMethod(env, obj, setFileInternalMethodID, jcurrent_folder,
jfilenames);
fp_g_free(current_folder);
......
......@@ -32,21 +32,21 @@
#include "nio.h"
#include "net_util.h"
#include "net_util_md.h"
#include "sun_nio_ch_SctpNet.h"
#include "sun_nio_ch_SctpChannelImpl.h"
#include "sun_nio_ch_SctpAssocChange.h"
#include "sun_nio_ch_SctpResultContainer.h"
#include "sun_nio_ch_SctpPeerAddrChange.h"
#include "sun_nio_ch_sctp_SctpNet.h"
#include "sun_nio_ch_sctp_SctpChannelImpl.h"
#include "sun_nio_ch_sctp_AssociationChange.h"
#include "sun_nio_ch_sctp_ResultContainer.h"
#include "sun_nio_ch_sctp_PeerAddrChange.h"
/* sizeof(union sctp_notification */
#define NOTIFICATION_BUFFER_SIZE 280
#define MESSAGE_IMPL_CLASS "sun/nio/ch/SctpMessageInfoImpl"
#define RESULT_CONTAINER_CLASS "sun/nio/ch/SctpResultContainer"
#define SEND_FAILED_CLASS "sun/nio/ch/SctpSendFailed"
#define ASSOC_CHANGE_CLASS "sun/nio/ch/SctpAssocChange"
#define PEER_CHANGE_CLASS "sun/nio/ch/SctpPeerAddrChange"
#define SHUTDOWN_CLASS "sun/nio/ch/SctpShutdown"
#define MESSAGE_IMPL_CLASS "sun/nio/ch/sctp/MessageInfoImpl"
#define RESULT_CONTAINER_CLASS "sun/nio/ch/sctp/ResultContainer"
#define SEND_FAILED_CLASS "sun/nio/ch/sctp/SendFailed"
#define ASSOC_CHANGE_CLASS "sun/nio/ch/sctp/AssociationChange"
#define PEER_CHANGE_CLASS "sun/nio/ch/sctp/PeerAddrChange"
#define SHUTDOWN_CLASS "sun/nio/ch/sctp/Shutdown"
struct controlData {
int assocId;
......@@ -55,38 +55,40 @@ struct controlData {
unsigned int ppid;
};
static jclass smi_class; /* sun.nio.ch.SctpMessageInfoImpl */
static jmethodID smi_ctrID; /* sun.nio.ch.SctpMessageInfoImpl.<init> */
static jfieldID src_valueID; /* sun.nio.ch.SctpResultContainer.value */
static jfieldID src_typeID; /* sun.nio.ch.SctpResultContainer.type */
static jclass ssf_class; /* sun.nio.ch.SctpSendFailed */
static jmethodID ssf_ctrID; /* sun.nio.ch.SctpSendFailed.<init> */
static jclass sac_class; /* sun.nio.ch.SctpAssociationChanged */
static jmethodID sac_ctrID; /* sun.nio.ch.SctpAssociationChanged.<init> */
static jclass spc_class; /* sun.nio.ch.SctpPeerAddressChanged */
static jmethodID spc_ctrID; /* sun.nio.ch.SctpPeerAddressChanged.<init> */
static jclass ss_class; /* sun.nio.ch.SctpShutdown */
static jmethodID ss_ctrID; /* sun.nio.ch.SctpShutdown.<init> */
static jfieldID isa_addrID; /* java.net.InetSocketAddress.addr */
static jfieldID isa_portID; /* java.net.InetSocketAddress.port */
static jclass smi_class; /* sun.nio.ch.sctp.MessageInfoImpl */
static jmethodID smi_ctrID; /* sun.nio.ch.sctp.MessageInfoImpl.<init> */
static jfieldID src_valueID; /* sun.nio.ch.sctp.ResultContainer.value */
static jfieldID src_typeID; /* sun.nio.ch.sctp.ResultContainer.type */
static jclass ssf_class; /* sun.nio.ch.sctp.SendFailed */
static jmethodID ssf_ctrID; /* sun.nio.ch.sctp.SendFailed.<init> */
static jclass sac_class; /* sun.nio.ch.sctp.AssociationChange */
static jmethodID sac_ctrID; /* sun.nio.ch.sctp.AssociationChange.<init> */
static jclass spc_class; /* sun.nio.ch.sctp.PeerAddressChanged */
static jmethodID spc_ctrID; /* sun.nio.ch.sctp.PeerAddressChanged.<init> */
static jclass ss_class; /* sun.nio.ch.sctp.Shutdown */
static jmethodID ss_ctrID; /* sun.nio.ch.sctp.Shutdown.<init> */
static jfieldID isa_addrID; /* java.net.InetSocketAddress.addr */
static jfieldID isa_portID; /* java.net.InetSocketAddress.port */
/* defined in SctpNet.c */
jobject SockAddrToInetSocketAddress(JNIEnv* env, struct sockaddr* addr);
jint handleSocketError(JNIEnv *env, jint errorValue);
/* use SocketChannelImpl's checkConnect implementation */
extern jint Java_sun_nio_ch_SocketChannelImpl_checkConnect(JNIEnv* env,
jobject this, jobject fdo, jboolean block, jboolean ready);
/*
* Class: sun_nio_ch_SctpChannelImpl
* Class: sun_nio_ch_sctp_SctpChannelImpl
* Method: initIDs
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs
JNIEXPORT void JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_initIDs
(JNIEnv *env, jclass klass) {
jclass cls;
/* SctpMessageInfoImpl */
/* MessageInfoImpl */
cls = (*env)->FindClass(env, MESSAGE_IMPL_CLASS);
CHECK_NULL(cls);
smi_class = (*env)->NewGlobalRef(env, cls);
......@@ -95,7 +97,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs
"(ILjava/net/SocketAddress;IIZZI)V");
CHECK_NULL(smi_ctrID);
/* SctpResultContainer */
/* ResultContainer */
cls = (*env)->FindClass(env, RESULT_CONTAINER_CLASS);
CHECK_NULL(cls);
src_valueID = (*env)->GetFieldID(env, cls, "value", "Ljava/lang/Object;");
......@@ -103,7 +105,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs
src_typeID = (*env)->GetFieldID(env, cls, "type", "I");
CHECK_NULL(src_typeID);
/* SctpSendFailed */
/* SendFailed */
cls = (*env)->FindClass(env, SEND_FAILED_CLASS);
CHECK_NULL(cls);
ssf_class = (*env)->NewGlobalRef(env, cls);
......@@ -112,7 +114,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs
"(ILjava/net/SocketAddress;Ljava/nio/ByteBuffer;II)V");
CHECK_NULL(ssf_ctrID);
/* SctpAssocChange */
/* AssociationChange */
cls = (*env)->FindClass(env, ASSOC_CHANGE_CLASS);
CHECK_NULL(cls);
sac_class = (*env)->NewGlobalRef(env, cls);
......@@ -120,7 +122,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs
sac_ctrID = (*env)->GetMethodID(env, cls, "<init>", "(IIII)V");
CHECK_NULL(sac_ctrID);
/* SctpPeerAddrChange */
/* PeerAddrChange */
cls = (*env)->FindClass(env, PEER_CHANGE_CLASS);
CHECK_NULL(cls);
spc_class = (*env)->NewGlobalRef(env, cls);
......@@ -129,7 +131,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpChannelImpl_initIDs
"(ILjava/net/SocketAddress;I)V");
CHECK_NULL(spc_ctrID);
/* sun.nio.ch.SctpShutdown */
/* Shutdown */
cls = (*env)->FindClass(env, SHUTDOWN_CLASS);
CHECK_NULL(cls);
ss_class = (*env)->NewGlobalRef(env, cls);
......@@ -266,13 +268,13 @@ void handleSendFailed
}
}
/* create SctpSendFailed */
/* create SendFailed */
resultObj = (*env)->NewObject(env, ssf_class, ssf_ctrID, ssf->ssf_assoc_id,
isaObj, bufferObj, ssf->ssf_error, sri->sinfo_stream);
CHECK_NULL(resultObj);
(*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj);
(*env)->SetIntField(env, resultContainerObj, src_typeID,
sun_nio_ch_SctpResultContainer_SEND_FAILED);
sun_nio_ch_sctp_ResultContainer_SEND_FAILED);
}
void handleAssocChange
......@@ -282,38 +284,38 @@ void handleAssocChange
switch (sac->sac_state) {
case SCTP_COMM_UP :
state = sun_nio_ch_SctpAssocChange_SCTP_COMM_UP;
state = sun_nio_ch_sctp_AssociationChange_SCTP_COMM_UP;
break;
case SCTP_COMM_LOST :
state = sun_nio_ch_SctpAssocChange_SCTP_COMM_LOST;
state = sun_nio_ch_sctp_AssociationChange_SCTP_COMM_LOST;
break;
case SCTP_RESTART :
state = sun_nio_ch_SctpAssocChange_SCTP_RESTART;
state = sun_nio_ch_sctp_AssociationChange_SCTP_RESTART;
break;
case SCTP_SHUTDOWN_COMP :
state = sun_nio_ch_SctpAssocChange_SCTP_SHUTDOWN;
state = sun_nio_ch_sctp_AssociationChange_SCTP_SHUTDOWN;
break;
case SCTP_CANT_STR_ASSOC :
state = sun_nio_ch_SctpAssocChange_SCTP_CANT_START;
state = sun_nio_ch_sctp_AssociationChange_SCTP_CANT_START;
}
/* create SctpAssociationChanged */
/* create AssociationChange */
resultObj = (*env)->NewObject(env, sac_class, sac_ctrID, sac->sac_assoc_id,
state, sac->sac_outbound_streams, sac->sac_inbound_streams);
CHECK_NULL(resultObj);
(*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj);
(*env)->SetIntField(env, resultContainerObj, src_typeID,
sun_nio_ch_SctpResultContainer_ASSOCIATION_CHANGED);
sun_nio_ch_sctp_ResultContainer_ASSOCIATION_CHANGED);
}
void handleShutdown
(JNIEnv* env, jobject resultContainerObj, struct sctp_shutdown_event* sse) {
/* create SctpShutdown */
/* create Shutdown */
jobject resultObj = (*env)->NewObject(env, ss_class, ss_ctrID, sse->sse_assoc_id);
CHECK_NULL(resultObj);
(*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj);
(*env)->SetIntField(env, resultContainerObj, src_typeID,
sun_nio_ch_SctpResultContainer_SHUTDOWN);
sun_nio_ch_sctp_ResultContainer_SHUTDOWN);
}
void handlePeerAddrChange
......@@ -324,35 +326,35 @@ void handlePeerAddrChange
switch (state) {
case SCTP_ADDR_AVAILABLE :
event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_AVAILABLE;
event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_AVAILABLE;
break;
case SCTP_ADDR_UNREACHABLE :
event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_UNREACHABLE;
event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_UNREACHABLE;
break;
case SCTP_ADDR_REMOVED :
event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_REMOVED;
event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_REMOVED;
break;
case SCTP_ADDR_ADDED :
event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_ADDED;
event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_ADDED;
break;
case SCTP_ADDR_MADE_PRIM :
event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_MADE_PRIM;
event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_MADE_PRIM;
#ifdef __linux__ /* Solaris currently doesn't support SCTP_ADDR_CONFIRMED */
break;
case SCTP_ADDR_CONFIRMED :
event = sun_nio_ch_SctpPeerAddrChange_SCTP_ADDR_CONFIRMED;
event = sun_nio_ch_sctp_PeerAddrChange_SCTP_ADDR_CONFIRMED;
#endif /* __linux__ */
}
addressObj = SockAddrToInetSocketAddress(env, (struct sockaddr*)&spc->spc_aaddr);
/* create SctpPeerAddressChanged */
/* create PeerAddressChanged */
resultObj = (*env)->NewObject(env, spc_class, spc_ctrID, spc->spc_assoc_id,
addressObj, event);
CHECK_NULL(resultObj);
(*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj);
(*env)->SetIntField(env, resultContainerObj, src_typeID,
sun_nio_ch_SctpResultContainer_PEER_ADDRESS_CHANGED);
sun_nio_ch_sctp_ResultContainer_PEER_ADDRESS_CHANGED);
}
void handleUninteresting
......@@ -403,7 +405,7 @@ void handleMessage
isa = SockAddrToInetSocketAddress(env, sap);
getControlData(msg, cdata);
/* create SctpMessageInfoImpl */
/* create MessageInfoImpl */
resultObj = (*env)->NewObject(env, smi_class, smi_ctrID, cdata->assocId,
isa, read, cdata->streamNumber,
isEOR ? JNI_TRUE : JNI_FALSE,
......@@ -411,15 +413,15 @@ void handleMessage
CHECK_NULL(resultObj);
(*env)->SetObjectField(env, resultContainerObj, src_valueID, resultObj);
(*env)->SetIntField(env, resultContainerObj, src_typeID,
sun_nio_ch_SctpResultContainer_MESSAGE);
sun_nio_ch_sctp_ResultContainer_MESSAGE);
}
/*
* Class: sun_nio_ch_SctpChannelImpl
* Class: sun_nio_ch_sctp_SctpChannelImpl
* Method: receive0
* Signature: (ILsun/nio/ch/SctpResultContainer;JIZ)I
* Signature: (ILsun/nio/ch/sctp/ResultContainer;JIZ)I
*/
JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_receive0
JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_receive0
(JNIEnv *env, jclass klass, jint fd, jobject resultContainerObj,
jlong address, jint length, jboolean peek) {
SOCKADDR sa;
......@@ -505,11 +507,11 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_receive0
}
/*
* Class: sun_nio_ch_SctpChannelImpl
* Class: sun_nio_ch_sctp_SctpChannelImpl
* Method: send0
* Signature: (IJILjava/net/SocketAddress;IIZI)I
*/
JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_send0
JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_send0
(JNIEnv *env, jclass klass, jint fd, jlong address, jint length,
jobject saTarget, jint assocId, jint streamNumber, jboolean unordered,
jint ppid) {
......@@ -582,11 +584,11 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_send0
}
/*
* Class: sun_nio_ch_SctpChannelImpl
* Class: sun_nio_ch_sctp_SctpChannelImpl
* Method: checkConnect
* Signature: (Ljava/io/FileDescriptor;ZZ)I
*/
JNIEXPORT jint JNICALL Java_sun_nio_ch_SctpChannelImpl_checkConnect
JNIEXPORT jint JNICALL Java_sun_nio_ch_sctp_SctpChannelImpl_checkConnect
(JNIEnv* env, jobject this, jobject fdo, jboolean block, jboolean ready) {
return Java_sun_nio_ch_SocketChannelImpl_checkConnect(env, this,
fdo, block, ready);
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册