This commit is contained in:
J. Duke 2017-07-05 22:46:16 +02:00
commit 6ac1ca1358
197 changed files with 6356 additions and 10462 deletions

View file

@ -396,3 +396,4 @@ b119012d1c2ab2570fe8718633840d0c1f1f441d jdk-9+149
71a766d4c18041a7f833ee22823125b02e1a7f1e jdk-9+151 71a766d4c18041a7f833ee22823125b02e1a7f1e jdk-9+151
ef056360ddf3977d7d2ddbeb456a4d612d19ea05 jdk-9+152 ef056360ddf3977d7d2ddbeb456a4d612d19ea05 jdk-9+152
816a6d03a7c44edfbd8780110529f1bdc3964fb9 jdk-9+153 816a6d03a7c44edfbd8780110529f1bdc3964fb9 jdk-9+153
8d26916eaa21b689835ffc1c0dbf12470aa9be61 jdk-9+154

View file

@ -5180,7 +5180,7 @@ VS_SDK_PLATFORM_NAME_2013=
#CUSTOM_AUTOCONF_INCLUDE #CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks: # Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1484571183 DATE_WHEN_GENERATED=1485508515
############################################################################### ###############################################################################
# #
@ -31283,12 +31283,6 @@ $as_echo "$as_me: The path of IMPORT_MODULES_TOPDIR, which resolves as \"$path\"
if test -d "$IMPORT_MODULES_TOPDIR/modules_src"; then if test -d "$IMPORT_MODULES_TOPDIR/modules_src"; then
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src" IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src"
fi fi
# Workaround for using different imported module-info.java in Jake due to a
# change in format. Remove once new format is standard in JDK 9 and javafx
# delivers just that.
if test -d "$IMPORT_MODULES_TOPDIR/modules_src_jake"; then
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src_jake $IMPORT_MODULES_SRC"
fi
if test -d "$IMPORT_MODULES_TOPDIR/make"; then if test -d "$IMPORT_MODULES_TOPDIR/make"; then
IMPORT_MODULES_MAKE="$IMPORT_MODULES_TOPDIR/make" IMPORT_MODULES_MAKE="$IMPORT_MODULES_TOPDIR/make"
fi fi

View file

@ -114,12 +114,6 @@ AC_DEFUN_ONCE([SRCDIRS_SETUP_IMPORT_MODULES],
if test -d "$IMPORT_MODULES_TOPDIR/modules_src"; then if test -d "$IMPORT_MODULES_TOPDIR/modules_src"; then
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src" IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src"
fi fi
# Workaround for using different imported module-info.java in Jake due to a
# change in format. Remove once new format is standard in JDK 9 and javafx
# delivers just that.
if test -d "$IMPORT_MODULES_TOPDIR/modules_src_jake"; then
IMPORT_MODULES_SRC="$IMPORT_MODULES_TOPDIR/modules_src_jake $IMPORT_MODULES_SRC"
fi
if test -d "$IMPORT_MODULES_TOPDIR/make"; then if test -d "$IMPORT_MODULES_TOPDIR/make"; then
IMPORT_MODULES_MAKE="$IMPORT_MODULES_TOPDIR/make" IMPORT_MODULES_MAKE="$IMPORT_MODULES_TOPDIR/make"
fi fi

View file

@ -610,6 +610,19 @@ var getJibProfilesProfiles = function (input, common, data) {
} }
profiles = concatObjects(profiles, testOnlyProfilesPrebuilt); profiles = concatObjects(profiles, testOnlyProfilesPrebuilt);
// On macosx add the devkit bin dir to the path in all the run-test profiles.
// This gives us a guaranteed working version of lldb for the jtreg failure handler.
if (input.build_os == "macosx") {
macosxRunTestExtra = {
dependencies: [ "devkit" ],
environment_path: input.get("devkit", "install_path")
+ "/Xcode.app/Contents/Developer/usr/bin"
}
profiles["run-test"] = concatObjects(profiles["run-test"], macosxRunTestExtra);
profiles["run-test-jprt"] = concatObjects(profiles["run-test-jprt"], macosxRunTestExtra);
profiles["run-test-prebuilt"] = concatObjects(profiles["run-test-prebuilt"], macosxRunTestExtra);
}
// //
// Define artifacts for profiles // Define artifacts for profiles
// //
@ -844,7 +857,7 @@ var getJibProfilesDependencies = function (input, common) {
file: boot_jdk_platform + "/jdk-" + common.boot_jdk_revision file: boot_jdk_platform + "/jdk-" + common.boot_jdk_revision
+ "-" + boot_jdk_platform + ".tar.gz", + "-" + boot_jdk_platform + ".tar.gz",
configure_args: "--with-boot-jdk=" + common.boot_jdk_home, configure_args: "--with-boot-jdk=" + common.boot_jdk_home,
environment_path: common.boot_jdk_home environment_path: common.boot_jdk_home + "/bin"
}, },
devkit: { devkit: {

View file

@ -396,3 +396,4 @@ f95cc86b6ac22ec1ade5d4f825dc7782adeea228 jdk-9+148
77f827f5bbad3ef795664bc675f72d98d156b9f8 jdk-9+151 77f827f5bbad3ef795664bc675f72d98d156b9f8 jdk-9+151
ff8cb43c07c069b1debdee44cb88ca22db1ec757 jdk-9+152 ff8cb43c07c069b1debdee44cb88ca22db1ec757 jdk-9+152
68a8e8658511093b322a46ed04b2a321e1da2a43 jdk-9+153 68a8e8658511093b322a46ed04b2a321e1da2a43 jdk-9+153
078ebe23b584466dc8346e620d7821d91751e5a9 jdk-9+154

View file

@ -31,9 +31,6 @@ import java.util.Properties ;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.logging.Logger ; import java.util.logging.Logger ;
import java.security.AccessController ;
import java.security.PrivilegedAction ;
import org.omg.CORBA.TCKind ; import org.omg.CORBA.TCKind ;
import com.sun.corba.se.pept.broker.Broker ; import com.sun.corba.se.pept.broker.Broker ;
@ -89,9 +86,6 @@ import com.sun.corba.se.impl.logging.OMGSystemException ;
import com.sun.corba.se.impl.presentation.rmi.PresentationManagerImpl ; import com.sun.corba.se.impl.presentation.rmi.PresentationManagerImpl ;
import jdk.internal.misc.JavaAWTAccess;
import jdk.internal.misc.SharedSecrets;
public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
implements Broker, TypeCodeFactory implements Broker, TypeCodeFactory
{ {
@ -167,9 +161,6 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
setupPresentationManager(); setupPresentationManager();
} }
private static final Map<Object, PresentationManager> pmContexts =
new ConcurrentHashMap<>();
private static Map<StringPair, LogWrapperBase> staticWrapperMap = private static Map<StringPair, LogWrapperBase> staticWrapperMap =
new ConcurrentHashMap<>(); new ConcurrentHashMap<>();
@ -198,23 +189,10 @@ public abstract class ORB extends com.sun.corba.se.org.omg.CORBA.ORB
byteBufferPool = null; byteBufferPool = null;
} }
/** /** Get the single instance of the PresentationManager
* Returns the Presentation Manager for the current thread group, using the ThreadGroup-specific
* AppContext to hold it. Creates and records one if needed.
*/ */
public static PresentationManager getPresentationManager() public static PresentationManager getPresentationManager()
{ {
SecurityManager sm = System.getSecurityManager();
JavaAWTAccess javaAwtAccess = SharedSecrets.getJavaAWTAccess();
if (sm != null && javaAwtAccess != null) {
final Object appletContext = javaAwtAccess.getAppletContext();
if (appletContext != null) {
return pmContexts.computeIfAbsent(appletContext,
x -> setupPresentationManager());
}
}
// No security manager or AppletAppContext
return Holder.defaultPresentationManager; return Holder.defaultPresentationManager;
} }

View file

@ -36,8 +36,6 @@ import java.io.FileInputStream;
import java.security.AccessController; import java.security.AccessController;
import java.security.PrivilegedAction; import java.security.PrivilegedAction;
import sun.reflect.misc.ReflectUtil;
/** /**
* A class providing APIs for the CORBA Object Request Broker * A class providing APIs for the CORBA Object Request Broker
* features. The {@code ORB} class also provides * features. The {@code ORB} class also provides
@ -188,6 +186,24 @@ abstract public class ORB {
private static final String ORBClassKey = "org.omg.CORBA.ORBClass"; private static final String ORBClassKey = "org.omg.CORBA.ORBClass";
private static final String ORBSingletonClassKey = "org.omg.CORBA.ORBSingletonClass"; private static final String ORBSingletonClassKey = "org.omg.CORBA.ORBSingletonClass";
// check that access to the class is not restricted by the security manager.
private static void checkPackageAccess(String name) {
SecurityManager s = System.getSecurityManager();
if (s != null) {
String cname = name.replace('/', '.');
if (cname.startsWith("[")) {
int b = cname.lastIndexOf('[') + 2;
if (b > 1 && b < cname.length()) {
cname = cname.substring(b);
}
}
int i = cname.lastIndexOf('.');
if (i != -1) {
s.checkPackageAccess(cname.substring(0, i));
}
}
}
// //
// The global instance of the singleton ORB implementation which // The global instance of the singleton ORB implementation which
// acts as a factory for typecodes for generated Helper classes. // acts as a factory for typecodes for generated Helper classes.
@ -318,7 +334,7 @@ abstract public class ORB {
private static ORB create_impl_with_systemclassloader(String className) { private static ORB create_impl_with_systemclassloader(String className) {
try { try {
ReflectUtil.checkPackageAccess(className); checkPackageAccess(className);
ClassLoader cl = ClassLoader.getSystemClassLoader(); ClassLoader cl = ClassLoader.getSystemClassLoader();
Class<org.omg.CORBA.ORB> orbBaseClass = org.omg.CORBA.ORB.class; Class<org.omg.CORBA.ORB> orbBaseClass = org.omg.CORBA.ORB.class;
Class<?> singletonOrbClass = Class.forName(className, true, cl).asSubclass(orbBaseClass); Class<?> singletonOrbClass = Class.forName(className, true, cl).asSubclass(orbBaseClass);
@ -337,7 +353,7 @@ abstract public class ORB {
cl = ClassLoader.getSystemClassLoader(); cl = ClassLoader.getSystemClassLoader();
try { try {
ReflectUtil.checkPackageAccess(className); checkPackageAccess(className);
Class<org.omg.CORBA.ORB> orbBaseClass = org.omg.CORBA.ORB.class; Class<org.omg.CORBA.ORB> orbBaseClass = org.omg.CORBA.ORB.class;
Class<?> orbClass = Class.forName(className, true, cl).asSubclass(orbBaseClass); Class<?> orbClass = Class.forName(className, true, cl).asSubclass(orbBaseClass);
return (ORB)orbClass.newInstance(); return (ORB)orbClass.newInstance();

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -75,10 +75,11 @@ public abstract class InputStream extends org.omg.CORBA.portable.InputStream {
/** /**
* Create a new instance of this class. * Create a new instance of this class.
* *
* throw SecurityException if SecurityManager is installed and * @implNote
* Throws SecurityException if SecurityManager is installed and
* enableSubclassImplementation SerializablePermission * enableSubclassImplementation SerializablePermission
* is not granted or jdk.corba.allowInputStreamSubclass system * is not granted or jdk.corba.allowInputStreamSubclass system
* property is either not set or is set to 'false' * property is either not set or is set to 'false'.
*/ */
public InputStream() { public InputStream() {
this(checkPermission()); this(checkPermission());

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -72,10 +72,11 @@ public abstract class OutputStream extends org.omg.CORBA.portable.OutputStream {
/** /**
* Create a new instance of this class. * Create a new instance of this class.
* *
* throw SecurityException if SecurityManager is installed and * @implNote
* Throws SecurityException if SecurityManager is installed and
* enableSubclassImplementation SerializablePermission * enableSubclassImplementation SerializablePermission
* is not granted or jdk.corba.allowOutputStreamSubclass system * is not granted or jdk.corba.allowOutputStreamSubclass system
* property is either not set or is set to 'false' * property is either not set or is set to 'false'.
*/ */
public OutputStream() { public OutputStream() {
this(checkPermission()); this(checkPermission());

View file

@ -29,6 +29,10 @@ import java.io.OptionalDataException;
import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandle;
import java.lang.reflect.Field ; import java.lang.reflect.Field ;
import java.lang.reflect.Constructor ; import java.lang.reflect.Constructor ;
import java.lang.StackWalker;
import java.lang.StackWalker.StackFrame;
import java.util.Optional;
import java.util.stream.Stream;
import java.security.AccessController; import java.security.AccessController;
import java.security.Permission; import java.security.Permission;
@ -58,6 +62,7 @@ import sun.reflect.ReflectionFactory;
* <li>RuntimePermission "reflectionFactoryAccess"</li> * <li>RuntimePermission "reflectionFactoryAccess"</li>
* <li>BridgePermission "getBridge"</li> * <li>BridgePermission "getBridge"</li>
* <li>ReflectPermission "suppressAccessChecks"</li> * <li>ReflectPermission "suppressAccessChecks"</li>
* <li>StackFramePermission "retainClassReference"</li>
* </ul> * </ul>
* <p> * <p>
* All of these permissions are required to obtain and correctly initialize * All of these permissions are required to obtain and correctly initialize
@ -89,9 +94,12 @@ public final class Bridge
) ; ) ;
private final ReflectionFactory reflectionFactory ; private final ReflectionFactory reflectionFactory ;
private final StackWalker stackWalker;
private Bridge() { private Bridge() {
reflectionFactory = ReflectionFactory.getReflectionFactory(); reflectionFactory = ReflectionFactory.getReflectionFactory();
stackWalker = StackWalker.getInstance(
StackWalker.Option.RETAIN_CLASS_REFERENCE);
} }
/** Fetch the Bridge singleton. This requires the following /** Fetch the Bridge singleton. This requires the following
@ -100,6 +108,7 @@ public final class Bridge
* <li>RuntimePermission "reflectionFactoryAccess"</li> * <li>RuntimePermission "reflectionFactoryAccess"</li>
* <li>BridgePermission "getBridge"</li> * <li>BridgePermission "getBridge"</li>
* <li>ReflectPermission "suppressAccessChecks"</li> * <li>ReflectPermission "suppressAccessChecks"</li>
* <li>StackFramePermission "retainClassReference"</li>
* </ul> * </ul>
* @return The singleton instance of the Bridge class * @return The singleton instance of the Bridge class
* @throws SecurityException if the caller does not have the * @throws SecurityException if the caller does not have the
@ -118,11 +127,33 @@ public final class Bridge
return bridge ; return bridge ;
} }
/** Returns true if the loader that loaded the frame's declaring class
* is a user loader (if it is not the platform class loader or one of
* its ancestor).
*/
private boolean isUserLoader(StackFrame sf) {
ClassLoader cl = sf.getDeclaringClass().getClassLoader();
if (cl == null) return false;
ClassLoader p = ClassLoader.getPlatformClassLoader();
while (cl != p && p != null) p = p.getParent();
return cl != p;
}
private Optional<StackFrame> getLatestUserDefinedLoaderFrame(Stream<StackFrame> stream) {
return stream.filter(this::isUserLoader).findFirst();
}
/** Obtain the latest user defined ClassLoader from the call stack. /** Obtain the latest user defined ClassLoader from the call stack.
* This is required by the RMI-IIOP specification. * This is required by the RMI-IIOP specification.
*/ */
public final ClassLoader getLatestUserDefinedLoader() { public final ClassLoader getLatestUserDefinedLoader() {
return jdk.internal.misc.VM.latestUserDefinedLoader(); // requires getClassLoader permission => needs doPrivileged.
PrivilegedAction<ClassLoader> pa = () ->
stackWalker.walk(this::getLatestUserDefinedLoaderFrame)
.map(sf -> sf.getDeclaringClass().getClassLoader())
.orElseGet(() -> ClassLoader.getPlatformClassLoader());
return AccessController.doPrivileged(pa);
} }
/** /**

View file

@ -556,3 +556,4 @@ a82cb5350cad96a0b4de496afebe3ded89f27efa jdk-9+146
2a2ac7d9f52c8cb2b80077e515b5840b947e640c jdk-9+151 2a2ac7d9f52c8cb2b80077e515b5840b947e640c jdk-9+151
31f1d26c60df7b2e516a4f84160d76ba017d4e09 jdk-9+152 31f1d26c60df7b2e516a4f84160d76ba017d4e09 jdk-9+152
217ba81b9a4ce8698200370175aa2db86a39f66c jdk-9+153 217ba81b9a4ce8698200370175aa2db86a39f66c jdk-9+153
a9fdfd55835ef9dccb7f317b07249bd66653b874 jdk-9+154

View file

@ -46,7 +46,10 @@ define_pd_global(intx, InlineFrequencyCount, 100);
#define DEFAULT_STACK_YELLOW_PAGES (2) #define DEFAULT_STACK_YELLOW_PAGES (2)
#define DEFAULT_STACK_RED_PAGES (1) #define DEFAULT_STACK_RED_PAGES (1)
#define DEFAULT_STACK_SHADOW_PAGES (4 DEBUG_ONLY(+5)) // Java_java_net_SocketOutputStream_socketWrite0() uses a 64k buffer on the
// stack if compiled for unix and LP64. To pass stack overflow tests we need
// 20 shadow pages.
#define DEFAULT_STACK_SHADOW_PAGES (20 DEBUG_ONLY(+5))
#define DEFAULT_STACK_RESERVED_PAGES (0) #define DEFAULT_STACK_RESERVED_PAGES (0)
#define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES #define MIN_STACK_YELLOW_PAGES DEFAULT_STACK_YELLOW_PAGES

View file

@ -475,9 +475,9 @@ bool os::is_allocatable(size_t bytes) {
// Minimum usable stack sizes required to get to user code. Space for // Minimum usable stack sizes required to get to user code. Space for
// HotSpot guard pages is added later. // HotSpot guard pages is added later.
size_t os::Posix::_compiler_thread_min_stack_allowed = 32 * K; size_t os::Posix::_compiler_thread_min_stack_allowed = 72 * K;
size_t os::Posix::_java_thread_min_stack_allowed = 32 * K; size_t os::Posix::_java_thread_min_stack_allowed = 72 * K;
size_t os::Posix::_vm_internal_thread_min_stack_allowed = 64 * K; size_t os::Posix::_vm_internal_thread_min_stack_allowed = 72 * K;
// return default stack size for thr_type // return default stack size for thr_type
size_t os::Posix::default_stack_size(os::ThreadType thr_type) { size_t os::Posix::default_stack_size(os::ThreadType thr_type) {

View file

@ -396,3 +396,4 @@ f85154af719f99a3b4d81b67a8b4c18a650d10f9 jdk-9+150
13c6906bfc861d99dc35a19c80b7a99f0b0ac58d jdk-9+151 13c6906bfc861d99dc35a19c80b7a99f0b0ac58d jdk-9+151
7e3da313b1746578da648155e37dd8526e83153d jdk-9+152 7e3da313b1746578da648155e37dd8526e83153d jdk-9+152
1384504d2cd0e55c5e0becaeaf40ab05cae959d6 jdk-9+153 1384504d2cd0e55c5e0becaeaf40ab05cae959d6 jdk-9+153
7fa738305436d14c0926df0f04892890cacc766b jdk-9+154

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -64,7 +64,7 @@ public class EventFilterSupport extends EventReaderDelegate {
} }
public XMLEvent nextEvent()throws XMLStreamException{ public XMLEvent nextEvent()throws XMLStreamException{
if(super.hasNext()){ while (super.hasNext()) {
//get the next event by calling XMLEventReader //get the next event by calling XMLEventReader
XMLEvent event = super.nextEvent(); XMLEvent event = super.nextEvent();
@ -72,28 +72,20 @@ public class EventFilterSupport extends EventReaderDelegate {
if(fEventFilter.accept(event)){ if(fEventFilter.accept(event)){
return event; return event;
} }
else{
return nextEvent();
} }
}else{
throw new NoSuchElementException(); throw new NoSuchElementException();
}
}//nextEvent() }//nextEvent()
public XMLEvent nextTag() throws XMLStreamException{ public XMLEvent nextTag() throws XMLStreamException{
if(super.hasNext()){ while (super.hasNext()) {
XMLEvent event = super.nextTag(); XMLEvent event = super.nextTag();
//if the filter accepts this event return this event. //if the filter accepts this event return this event.
if(fEventFilter.accept(event)){ if(fEventFilter.accept(event)){
return event; return event;
} }
else{
return nextTag();
} }
}else{
throw new NoSuchElementException(); throw new NoSuchElementException();
} }
}
public XMLEvent peek() throws XMLStreamException{ public XMLEvent peek() throws XMLStreamException{
while (true) { while (true) {

View file

@ -149,14 +149,6 @@ class Util {
CatalogMessages.reportIAE(CatalogMessages.ERR_URI_NOTVALIDURL, CatalogMessages.reportIAE(CatalogMessages.ERR_URI_NOTVALIDURL,
new Object[]{uri}, null); new Object[]{uri}, null);
} }
// verify the resource exists where possible
if (isFileUri(uri)) {
if (!isFileUriExist(uri, false)) {
CatalogMessages.reportIAE(CatalogMessages.ERR_URI_NOTVALIDURL,
new Object[]{uri}, null);
}
}
} }
/** /**

View file

@ -1,6 +1,6 @@
########################################################################### ###########################################################################
# #
# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -22,5 +22,3 @@
# questions. # questions.
# #
########################################################################### ###########################################################################
javax/xml/jaxp/isolatedjdk/catalog/PropertiesTest.sh 8169827 generic-all

View file

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -21,11 +21,6 @@
# or visit www.oracle.com if you need additional information or have any # or visit www.oracle.com if you need additional information or have any
# questions. # questions.
if [ $# = 0 ]; then
echo "The suffix of ISOLATED_JDK is mandatory"
exit 1
fi
checkVariable() { checkVariable() {
variable='$'$1 variable='$'$1
@ -42,20 +37,33 @@ checkVariables() {
done done
} }
# Check essential variables # Script needs parameters
checkVariables TESTJAVA TESTSRC TESTCLASSES TESTCLASSPATH if [ $# = 0 ]; then
echo "Syntax: IsolatedJDK.sh <Suffix> [remove]"
exit 1
fi
echo "TESTJAVA=${TESTJAVA}" # Is it the call to remove ?
echo "TESTSRC=${TESTSRC}" if [ $# = 2 ]; then
echo "TESTCLASSES=${TESTCLASSES}" if [ "$2" = "remove" ]; then
echo "TESTCLASSPATH=${TESTCLASSPATH}" removeIsolatedJdk=1
fi
fi
# Check essential variables
checkVariables TESTJAVA
ISOLATED_JDK="./ISOLATED_JDK_$1"
# Remove isolated copy
if [ "$removeIsolatedJdk" = "1" ]; then
echo "Removing ${ISOLATED_JDK}..."
rm -rf ${ISOLATED_JDK}
echo "Removed."
exit 0
fi
# Make an isolated copy of the testing JDK # Make an isolated copy of the testing JDK
ISOLATED_JDK="./ISOLATED_JDK_$1" echo "Copying test JDK: ${TESTJAVA} -> ${ISOLATED_JDK}..."
echo "ISOLATED_JDK=${ISOLATED_JDK}"
echo "Copy testing JDK started"
cp -H -R ${TESTJAVA} ${ISOLATED_JDK} || exit 1 cp -H -R ${TESTJAVA} ${ISOLATED_JDK} || exit 1
chmod -R +w ${ISOLATED_JDK} || exit 1 chmod -R +w ${ISOLATED_JDK} || exit 1
echo "Copy testing JDK ended" echo "Copy done."

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -37,20 +37,95 @@ import static catalog.CatalogTestUtils.deleteJAXPProps;
import static catalog.CatalogTestUtils.generateJAXPProps; import static catalog.CatalogTestUtils.generateJAXPProps;
import static catalog.CatalogTestUtils.getCatalogPath; import static catalog.CatalogTestUtils.getCatalogPath;
import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import javax.xml.catalog.CatalogResolver; import javax.xml.catalog.CatalogResolver;
import org.testng.Assert;
import org.testng.annotations.Test;
/* /*
* This case tests if the properties FILES, DEFER, PREFER, RESOLVE in * @test
* jaxp.properties and system properties could be cared. * @library /javax/xml/jaxp/libs /javax/xml/jaxp/isolatedjdk
* @run shell/timeout=600 ../IsolatedJDK.sh JAXP_PROPS
* @run testng catalog.PropertiesTest
* @run shell/timeout=600 ../IsolatedJDK.sh JAXP_PROPS remove
* @summary This test case tests if the properties FILES, DEFER, PREFER,
* RESOLVE in jaxp.properties and system properties are used.
* It needs to run in a copied JDK as it modifies the JDK's
* jaxp.properties file.
* @bug 8077931
*/ */
public class PropertiesTest { public class PropertiesTest {
private static final String CATALOG_PROPERTIES = "properties.xml"; private static final String CATALOG_PROPERTIES = "properties.xml";
@Test
/*
* Run main in a child process as it will modify the JDK.
*/
public void test() throws Exception {
// get required properties and do some assertions
String javaclasspath = System.getProperty("java.class.path");
Assert.assertNotNull(javaclasspath, "Test class path is null");
String testclasspath = System.getProperty("test.class.path");
Assert.assertNotNull(testclasspath, "Test class path is null");
String testsourcepath = System.getProperty("test.src");
Assert.assertNotNull(testsourcepath, "Test source path is null");
// start the child process
List<String> testCall = new ArrayList<>(6);
testCall.add(Paths.get("ISOLATED_JDK_JAXP_PROPS", "/bin", "java").toString());
testCall.add("-cp");
testCall.add(javaclasspath);
testCall.add("-Dtest.class.path=" + testclasspath);
testCall.add("-Dtest.src=" + testsourcepath);
testCall.add("catalog.PropertiesTest");
System.out.println("Starting child process: " + Arrays.toString(testCall.toArray()));
Process test = new ProcessBuilder(testCall).start();
// wait for it to finish
boolean interrupted = false;
do {
try {
test.waitFor();
interrupted = false;
} catch (InterruptedException ie) {
interrupted = true;
}
} while (interrupted);
// trace system.out of child process
System.out.println("Proccess Out:");
BufferedReader br = new BufferedReader(new InputStreamReader(test.getInputStream()));
String line;
while ((line = br.readLine()) != null) {
System.out.println(line);
}
br.close();
// trace system.err of child process
System.out.println("Proccess Err:");
br = new BufferedReader(new InputStreamReader(test.getErrorStream()));
while ((line = br.readLine()) != null) {
System.out.println(line);
}
br.close();
// trace exit value and assert 0
int exitValue = test.exitValue();
System.out.println("Process Exit code: " + exitValue);
Assert.assertEquals(exitValue, 0, "PropertiesTest returned nonzero exit code.");
}
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
System.out.println("testJAXPProperties started"); System.out.println("testJAXPProperties started");
testJAXPProperties(); testJAXPProperties();
@ -64,7 +139,8 @@ public class PropertiesTest {
} }
/* /*
* Tests how does jaxp.properties affects the resolution. * Tests how jaxp.properties affects the resolution.
* Be careful: This test modifies jaxp.properties in the used JDK.
*/ */
private static void testJAXPProperties() throws IOException { private static void testJAXPProperties() throws IOException {
generateJAXPProps(createJAXPPropsContent()); generateJAXPProps(createJAXPPropsContent());
@ -73,7 +149,7 @@ public class PropertiesTest {
} }
/* /*
* Tests how does system properties affects the resolution. * Tests how system properties affects the resolution.
*/ */
private static void testSystemProperties() { private static void testSystemProperties() {
setSystemProperties(); setSystemProperties();
@ -104,7 +180,7 @@ public class PropertiesTest {
// The properties in jaxp.properties don't use default values // The properties in jaxp.properties don't use default values
private static String createJAXPPropsContent() { private static String createJAXPPropsContent() {
Map<String, String> props = new HashMap<>(); Map<String, String> props = new HashMap<>();
props.put(FEATURE_FILES, getCatalogPath(CATALOG_PROPERTIES)); props.put(FEATURE_FILES, getCatalogPath(CATALOG_PROPERTIES).toString());
props.put(FEATURE_DEFER, DEFER_FALSE); props.put(FEATURE_DEFER, DEFER_FALSE);
props.put(FEATURE_PREFER, PREFER_SYSTEM); props.put(FEATURE_PREFER, PREFER_SYSTEM);
props.put(FEATURE_RESOLVE, RESOLVE_CONTINUE); props.put(FEATURE_RESOLVE, RESOLVE_CONTINUE);
@ -113,7 +189,7 @@ public class PropertiesTest {
// The system properties don't use default values // The system properties don't use default values
private static void setSystemProperties() { private static void setSystemProperties() {
System.setProperty(FEATURE_FILES, getCatalogPath(CATALOG_PROPERTIES)); System.setProperty(FEATURE_FILES, getCatalogPath(CATALOG_PROPERTIES).toString());
System.setProperty(FEATURE_DEFER, DEFER_FALSE); System.setProperty(FEATURE_DEFER, DEFER_FALSE);
System.setProperty(FEATURE_PREFER, PREFER_SYSTEM); System.setProperty(FEATURE_PREFER, PREFER_SYSTEM);
System.setProperty(FEATURE_RESOLVE, RESOLVE_CONTINUE); System.setProperty(FEATURE_RESOLVE, RESOLVE_CONTINUE);

View file

@ -1,58 +0,0 @@
#!/bin/sh
# Copyright (c) 2015, 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.
# @test
# @bug 8077931
# @summary This case tests if the properties FILES, DEFER, PREFER, RESOLVE in
# jaxp.properties and system properties could be used.
# @key intermittent
# @library ../../libs/
# @build catalog.CatalogTestUtils
# @build PropertiesTest
# @run shell/timeout=600 ../IsolatedJDK.sh JAXP_PROPS
# @run shell/timeout=600 PropertiesTest.sh
echo "Copies properties.xml to class path"
TEST_CATALOG_PATH=${TESTCLASSES}/catalog/catalogFiles
echo "TEST_CATALOG_PATH=${TEST_CATALOG_PATH}"
mkdir -p ${TEST_CATALOG_PATH}
cp ${TESTSRC}/catalogFiles/properties.xml ${TEST_CATALOG_PATH}/properties.xml
# Execute test
ISOLATED_JDK=./ISOLATED_JDK_JAXP_PROPS
echo "Executes PropertiesTest"
${ISOLATED_JDK}/bin/java -Dtest.src="${TESTSRC}/.." ${TESTVMOPTS} -cp "${TESTCLASSPATH}" catalog.PropertiesTest
exitCode=$?
# Cleanup ISOLATED_JDK
rm -rf ${ISOLATED_JDK}
# Results
echo ''
if [ $exitCode -gt 0 ]; then
echo "PropertiesTest failed";
else
echo "PropertiesTest passed";
fi
exit $exitCode

View file

@ -69,12 +69,6 @@ final class CatalogTestUtils {
private static final String JAXP_PROPS = "jaxp.properties"; private static final String JAXP_PROPS = "jaxp.properties";
private static final String JAXP_PROPS_BAK = JAXP_PROPS + ".bak"; private static final String JAXP_PROPS_BAK = JAXP_PROPS + ".bak";
/*
* Force using slash as File separator as we always use cygwin to test in
* Windows platform.
*/
private static final String FILE_SEP = "/";
private CatalogTestUtils() { } private CatalogTestUtils() { }
/* ********** create resolver ********** */ /* ********** create resolver ********** */
@ -133,11 +127,14 @@ final class CatalogTestUtils {
/* ********** jaxp.properties ********** */ /* ********** jaxp.properties ********** */
/* /*
* Generates the jaxp.properties with the specified content. * Generates jaxp.properties with the specified content,
* takes a backup if possible.
*/ */
static void generateJAXPProps(String content) throws IOException { static void generateJAXPProps(String content) throws IOException {
Path filePath = getJAXPPropsPath(); Path filePath = getJAXPPropsPath();
Path bakPath = filePath.resolveSibling(JAXP_PROPS_BAK); Path bakPath = filePath.resolveSibling(JAXP_PROPS_BAK);
System.out.println("Creating new file " + filePath +
", saving old version to " + bakPath + ".");
if (Files.exists(filePath) && !Files.exists(bakPath)) { if (Files.exists(filePath) && !Files.exists(bakPath)) {
Files.move(filePath, bakPath); Files.move(filePath, bakPath);
} }
@ -146,14 +143,16 @@ final class CatalogTestUtils {
} }
/* /*
* Deletes the jaxp.properties. * Deletes jaxp.properties, restoring backup if possible.
*/ */
static void deleteJAXPProps() throws IOException { static void deleteJAXPProps() throws IOException {
Path filePath = getJAXPPropsPath(); Path filePath = getJAXPPropsPath();
Path bakPath = filePath.resolveSibling(JAXP_PROPS_BAK);
System.out.println("Removing file " + filePath +
", restoring old version from " + bakPath + ".");
Files.delete(filePath); Files.delete(filePath);
Path bakFilePath = filePath.resolveSibling(JAXP_PROPS_BAK); if (Files.exists(bakPath)) {
if (Files.exists(bakFilePath)) { Files.move(bakPath, filePath);
Files.move(bakFilePath, filePath);
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -85,13 +85,13 @@ public class JAXPTestUtilities {
* A map storing every test's current test file pointer. File number should * A map storing every test's current test file pointer. File number should
* be incremental and it's a thread-safe reading on this file number. * be incremental and it's a thread-safe reading on this file number.
*/ */
private static final ConcurrentHashMap<Class, Integer> currentFileNumber private static final ConcurrentHashMap<Class<?>, Integer> currentFileNumber
= new ConcurrentHashMap<>(); = new ConcurrentHashMap<>();
/** /**
* BOM table for storing BOM header. * BOM table for storing BOM header.
*/ */
private final static Map<String, byte[]> bom = new HashMap(); private final static Map<String, byte[]> bom = new HashMap<>();
/** /**
* Initialize all BOM headers. * Initialize all BOM headers.
@ -313,7 +313,7 @@ public class JAXPTestUtilities {
* @param clazz test class. * @param clazz test class.
* @return next test output file name. * @return next test output file name.
*/ */
public static String getNextFile(Class clazz) { public static String getNextFile(Class<?> clazz) {
int nextNumber = currentFileNumber.contains(clazz) int nextNumber = currentFileNumber.contains(clazz)
? currentFileNumber.get(clazz) + 1 : 1; ? currentFileNumber.get(clazz) + 1 : 1;
Integer i = currentFileNumber.putIfAbsent(clazz, nextNumber); Integer i = currentFileNumber.putIfAbsent(clazz, nextNumber);
@ -332,7 +332,7 @@ public class JAXPTestUtilities {
* path. * path.
* @return a string represents the full path of accessing path. * @return a string represents the full path of accessing path.
*/ */
public static String getPathByClassName(Class clazz, String relativeDir) { public static String getPathByClassName(Class<?> clazz, String relativeDir) {
String javaSourcePath = System.getProperty("test.src").replaceAll("\\" + File.separator, FILE_SEP); String javaSourcePath = System.getProperty("test.src").replaceAll("\\" + File.separator, FILE_SEP);
String normalizedPath = Paths.get(javaSourcePath, relativeDir).normalize(). String normalizedPath = Paths.get(javaSourcePath, relativeDir).normalize().
toAbsolutePath().toString(); toAbsolutePath().toString();
@ -435,7 +435,7 @@ public class JAXPTestUtilities {
*/ */
public static void runWithTmpPermission(Runnable r, Permission... ps) { public static void runWithTmpPermission(Runnable r, Permission... ps) {
JAXPPolicyManager policyManager = JAXPPolicyManager.getJAXPPolicyManager(false); JAXPPolicyManager policyManager = JAXPPolicyManager.getJAXPPolicyManager(false);
List<Integer> tmpPermissionIndexes = new ArrayList(); List<Integer> tmpPermissionIndexes = new ArrayList<>();
if (policyManager != null) { if (policyManager != null) {
for (Permission p : ps) for (Permission p : ps)
tmpPermissionIndexes.add(policyManager.addTmpPermission(p)); tmpPermissionIndexes.add(policyManager.addTmpPermission(p));
@ -459,7 +459,7 @@ public class JAXPTestUtilities {
*/ */
public static <T> T runWithTmpPermission(Supplier<T> s, Permission... ps) { public static <T> T runWithTmpPermission(Supplier<T> s, Permission... ps) {
JAXPPolicyManager policyManager = JAXPPolicyManager.getJAXPPolicyManager(false); JAXPPolicyManager policyManager = JAXPPolicyManager.getJAXPPolicyManager(false);
List<Integer> tmpPermissionIndexes = new ArrayList(); List<Integer> tmpPermissionIndexes = new ArrayList<>();
if (policyManager != null) { if (policyManager != null) {
for (Permission p : ps) for (Permission p : ps)
tmpPermissionIndexes.add(policyManager.addTmpPermission(p)); tmpPermissionIndexes.add(policyManager.addTmpPermission(p));
@ -483,7 +483,7 @@ public class JAXPTestUtilities {
*/ */
public static void tryRunWithTmpPermission(RunnableWithException r, Permission... ps) throws Exception { public static void tryRunWithTmpPermission(RunnableWithException r, Permission... ps) throws Exception {
JAXPPolicyManager policyManager = JAXPPolicyManager.getJAXPPolicyManager(false); JAXPPolicyManager policyManager = JAXPPolicyManager.getJAXPPolicyManager(false);
List<Integer> tmpPermissionIndexes = new ArrayList(); List<Integer> tmpPermissionIndexes = new ArrayList<>();
if (policyManager != null) { if (policyManager != null) {
for (Permission p : ps) for (Permission p : ps)
tmpPermissionIndexes.add(policyManager.addTmpPermission(p)); tmpPermissionIndexes.add(policyManager.addTmpPermission(p));

View file

@ -222,6 +222,8 @@ public class CatalogFileInputTest extends CatalogSupportBase {
String catalogUri = getClass().getResource("catalog_invalid.xml").toExternalForm(); String catalogUri = getClass().getResource("catalog_invalid.xml").toExternalForm();
return new Object[][]{ return new Object[][]{
{catalogUri, "-//W3C//DTD XHTML 1.0 Strict//EN", {catalogUri, "-//W3C//DTD XHTML 1.0 Strict//EN",
"The catalog is invalid, attempting to match the public entry shall return null."},
{"file:/../../..", "-//W3C//DTD XHTML 1.0 Strict//EN",
"The catalog is invalid, attempting to match the public entry shall return null."} "The catalog is invalid, attempting to match the public entry shall return null."}
}; };
} }
@ -239,7 +241,6 @@ public class CatalogFileInputTest extends CatalogSupportBase {
return new Object[][]{ return new Object[][]{
{""}, {""},
{"file:a/b\\c"}, {"file:a/b\\c"},
{"file:/../../.."},
{"c:/te:t"}, {"c:/te:t"},
{"c:/te?t"}, {"c:/te?t"},
{"c/te*t"}, {"c/te*t"},

View file

@ -0,0 +1,221 @@
/*
* Copyright (c) 2017, 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.
*/
package stream.EventsTest;
import java.io.IOException;
import java.io.InputStream;
import javax.xml.stream.EventFilter;
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLInputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.events.XMLEvent;
import org.testng.annotations.Test;
import static org.testng.Assert.assertEquals;
/**
* @test
* @bug 8173111
* @summary tests that filtering out nested elements doesn't end up in
* a StackOverflowException
* @run testng/othervm stream.EventsTest.EventFilterSupportTest
* @author danielfuchs
*/
public class EventFilterSupportTest {
static final String ROOT = "xml";
static final String NEXT = "foo";
static final String SMOKE = "<?xml version=\"1.0\" encoding=\"US-ASCII\"?>"
+ "<xml><foo><foo><foo></foo></foo></foo></xml>";
// A number high enough to trigger StackOverflowException before the fix.
static final int MAX = 100_000;
public static void main(String[] args)
throws XMLStreamException, IOException {
smokeTest();
testNextEvent(MAX);
testNextTag(MAX);
System.out.println("Tests passed...");
}
// The smoke test just verifies that our TestInputStream works as
// expected and produces the expected stream of characters.
// Here we test it with 4 nested elements.
@Test
public static void smokeTest() throws IOException {
System.out.println("\nSmoke test...");
StringBuilder sb = new StringBuilder();
try (InputStream ts = new TestInputStream(4)) {
int c;
while ((c = ts.read()) != -1) {
System.out.print((char)c);
sb.append((char)c);
}
}
assertEquals(sb.toString(), SMOKE, "Smoke test failed");
System.out.println("\nSmoke test passed\n");
}
// Test calling XMLEventReader.nextEvent()
@Test
public static void testNextEvent() throws IOException, XMLStreamException {
testNextEvent(MAX);
}
// Without the fix, will cause a StackOverflowException if 'max' is high
// enough
private static void testNextEvent(int max)
throws IOException, XMLStreamException {
System.out.println("\nTest nextEvent (" + max + ")...");
XMLEventReader reader = createXmlReader(max);
XMLEvent event;
do {
event = reader.nextEvent();
System.out.println(event);
} while (event.getEventType() != XMLEvent.END_DOCUMENT);
System.out.println("nextEvent passed\n");
}
// Test calling XMLEventReader.nextTag()
@Test
public static void testNextTag() throws IOException, XMLStreamException {
testNextTag(MAX);
}
// Without the fix, will cause a StackOverflowException if 'max' is high
// enough
private static void testNextTag(int max)
throws IOException, XMLStreamException {
System.out.println("\nTest nextTag (" + max + ")...");
XMLEventReader reader = createXmlReader(max);
XMLEvent event;
do {
event = reader.nextTag();
System.out.println(event);
if (event.getEventType() == XMLEvent.END_ELEMENT
&& event.asEndElement().getName().getLocalPart().equals(ROOT)) {
break;
}
} while (true);
System.out.println("nextTag passed\n");
}
private static XMLEventReader createXmlReader(int max)
throws XMLStreamException {
TestInputStream ts = new TestInputStream(max);
XMLInputFactory xif = XMLInputFactory.newInstance();
XMLEventReader reader = xif.createXMLEventReader(ts);
return xif.createFilteredReader(reader, new TagFilter(max));
}
// An input stream that pretends to contain 'max - 1' nested NEXT tags
// within a ROOT element:
// <?xml version="1.0" encoding="US-ASCII"?>
// <ROOT><NEXT><NEXT>...</NEXT></NEXT></ROOT>
// (1 ROOT element + max-1 nested NEXT elements)
public static class TestInputStream extends InputStream {
int open = 0;
int i = 0;
int n = 0;
final int max;
public TestInputStream(int max) {
this.max = max;
}
String tag() {
if (n == 0) {
// opening first element - includes the XML processing instruction.
return "?xml version=\"1.0\" encoding=\"US-ASCII\"?><" + ROOT;
}
if (n == 2 * max -1) {
// closing the first element
// we have 'max' opening tags (0..max-1) followed by
// 'max' closing tags (max..2*max-1)
// for n in [0..max-1] we open the tags,
// for n in [max..2*max-1] we close them (in reverse order)
return ROOT;
}
// everything between [1..max-2] is a NEXT element tag (opening
// or closing)
return NEXT;
}
@Override
public int read() throws IOException {
if (n >= 2 * max) return -1;
if (open == 0) {
open = 1;
return '<';
}
if (open == 1 && n >= max) {
// we have opened the ROOT element + n-1 nested NEXT elements,
// so now we need to start closing them all in reverse order.
open = 2;
return '/';
}
String tag = tag();
if (open > 0 && i < tag.length()) {
return tag.charAt(i++);
}
if (open > 0 && i == tag.length()) {
open = 0; i = 0; n++;
return '>';
}
return -1;
}
}
public static final class TagFilter implements EventFilter {
int count;
final int max;
public TagFilter(int max) {
this.max = max;
}
// Filters everything except the ROOT element.
@Override
public boolean accept(XMLEvent event) {
int type = event.getEventType();
if (type == XMLEvent.START_ELEMENT) {
String loc = event.asStartElement().getName().getLocalPart();
if (count == 0 || count == 1) System.out.println("<" + loc + ">");
count++;
return ROOT.equals(loc);
}
if (type == XMLEvent.END_ELEMENT) {
if (count == max) System.out.println("Got " + count + " elements");
String loc = event.asEndElement().getName().getLocalPart();
count--;
if (count == 0 || count == 1) System.out.println("</" + loc + ">");
return ROOT.equals(loc);
}
if (type == XMLEvent.PROCESSING_INSTRUCTION) return true;
if (type == XMLEvent.START_DOCUMENT) return true;
if (type == XMLEvent.END_DOCUMENT) return true;
return false;
}
}
}

View file

@ -399,3 +399,4 @@ c8c9c334743caf8155c9809b6b4ac315d3a66476 jdk-9+148
c48b4d4768b1c2b8fe5d1a844ca13732e5dfbe2a jdk-9+151 c48b4d4768b1c2b8fe5d1a844ca13732e5dfbe2a jdk-9+151
6f8fb1cf7e5f61c40dcc3654f9a623c505f6de1f jdk-9+152 6f8fb1cf7e5f61c40dcc3654f9a623c505f6de1f jdk-9+152
7a532a9a227137155b905341d4b99939db51220e jdk-9+153 7a532a9a227137155b905341d4b99939db51220e jdk-9+153
34af95c7dbff74f3448fcdb7d745524e8a1cc88a jdk-9+154

View file

@ -396,3 +396,4 @@ c41140100bf1e5c10c7b8f3bde91c16eff7485f5 jdk-9+147
d27bab22ff62823902d93d1d35ca397cfd50d059 jdk-9+151 d27bab22ff62823902d93d1d35ca397cfd50d059 jdk-9+151
a20f2cf90762673e1bc4980fd6597e70a2578045 jdk-9+152 a20f2cf90762673e1bc4980fd6597e70a2578045 jdk-9+152
1c4411322327aea3f91011ec3977a12a05b09629 jdk-9+153 1c4411322327aea3f91011ec3977a12a05b09629 jdk-9+153
c97e7a8b8da062b9070df442f9cf308e10845fb7 jdk-9+154

View file

@ -1,5 +1,5 @@
# #
# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
@ -89,8 +89,8 @@ define CaptureLocale
$1_NON_BASE_LOCALES := $$(subst zh-MO,zh-MO$$(SPACE)zh-Hant-MO, $$($1_NON_BASE_LOCALES)) $1_NON_BASE_LOCALES := $$(subst zh-MO,zh-MO$$(SPACE)zh-Hant-MO, $$($1_NON_BASE_LOCALES))
$1_NON_BASE_LOCALES := $$(subst zh-TW,zh-TW$$(SPACE)zh-Hant-TW, $$($1_NON_BASE_LOCALES)) $1_NON_BASE_LOCALES := $$(subst zh-TW,zh-TW$$(SPACE)zh-Hant-TW, $$($1_NON_BASE_LOCALES))
# Adding implict locales nn-NO and nb-NO # Adding implict locales nb nn-NO and nb-NO
$1_NON_BASE_LOCALES += nn-NO nb-NO $1_NON_BASE_LOCALES += nb nn-NO nb-NO
$1_NON_BASE_LOCALES := $$(sort $$($1_NON_BASE_LOCALES)) $1_NON_BASE_LOCALES := $$(sort $$($1_NON_BASE_LOCALES))
ALL_BASE_LOCALES += $$($1_BASE_LOCALES) ALL_BASE_LOCALES += $$($1_BASE_LOCALES)

View file

@ -387,6 +387,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJLI, \
-export:JLI_MemFree \ -export:JLI_MemFree \
-export:JLI_InitArgProcessing \ -export:JLI_InitArgProcessing \
-export:JLI_PreprocessArg \ -export:JLI_PreprocessArg \
-export:JLI_AddArgsFromEnvVar \
-export:JLI_GetAppArgIndex, \ -export:JLI_GetAppArgIndex, \
LIBS_unix := $(LIBZ), \ LIBS_unix := $(LIBZ), \
LIBS_linux := $(LIBDL) -lc -lpthread, \ LIBS_linux := $(LIBDL) -lc -lpthread, \

View file

@ -30,9 +30,6 @@ include LibCommon.gmk
ifeq ($(OPENJDK_TARGET_OS_TYPE), unix) ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
ifeq (, $(filter $(OPENJDK_TARGET_OS), macosx aix)) ifeq (, $(filter $(OPENJDK_TARGET_OS), macosx aix))
# DISABLED_WARNINGS_gcc := unused-parameter needed to
# suppress unused parameters required by exported JNI functions.
$(eval $(call SetupNativeCompilation,BUILD_LIBSCTP, \ $(eval $(call SetupNativeCompilation,BUILD_LIBSCTP, \
LIBRARY := sctp, \ LIBRARY := sctp, \
OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \ OUTPUT_DIR := $(INSTALL_LIBRARIES_HERE), \
@ -45,7 +42,6 @@ ifeq ($(OPENJDK_TARGET_OS_TYPE), unix)
$(LIBJAVA_HEADER_FLAGS) \ $(LIBJAVA_HEADER_FLAGS) \
-I$(SUPPORT_OUTPUTDIR)/headers/jdk.sctp \ -I$(SUPPORT_OUTPUTDIR)/headers/jdk.sctp \
-I$(SUPPORT_OUTPUTDIR)/headers/java.base, \ -I$(SUPPORT_OUTPUTDIR)/headers/java.base, \
DISABLED_WARNINGS_gcc := unused-parameter, \
MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsctp/mapfile-vers, \ MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsctp/mapfile-vers, \
LDFLAGS := $(LDFLAGS_JDKLIB) \ LDFLAGS := $(LDFLAGS_JDKLIB) \
$(call SET_SHARED_LIBRARY_ORIGIN), \ $(call SET_SHARED_LIBRARY_ORIGIN), \

View file

@ -42,6 +42,7 @@ SUNWprivate_1.1 {
JLI_MemFree; JLI_MemFree;
JLI_InitArgProcessing; JLI_InitArgProcessing;
JLI_PreprocessArg; JLI_PreprocessArg;
JLI_AddArgsFromEnvVar;
JLI_GetAppArgIndex; JLI_GetAppArgIndex;
local: local:

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -389,6 +389,18 @@ class Bundle {
} }
} }
} }
// replace empty era names with parentMap era names
for (String key : ERA_KEYS) {
Object value = myMap.get(key);
if (value != null && value instanceof String[]) {
String[] eraStrings = (String[]) value;
for (String eraString : eraStrings) {
if (eraString == null || eraString.isEmpty()) {
fillInElements(parentsMap, key, value);
}
}
}
}
// Remove all duplicates // Remove all duplicates
if (Objects.nonNull(parentsMap)) { if (Objects.nonNull(parentsMap)) {

View file

@ -0,0 +1,71 @@
/*
* Copyright (c) 2017, 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 build.tools.taglet;
import java.util.EnumSet;
import java.util.List;
import java.util.Set;
import com.sun.source.doctree.DocTree;
import jdk.javadoc.doclet.taglet.Taglet;
import static jdk.javadoc.doclet.taglet.Taglet.Location.*;
/**
* An inline tag to conveniently insert a standard Incubating warning. For
* use by members in Incubator Modules.
*/
public class Incubating implements Taglet {
/** Returns the set of locations in which a taglet may be used. */
@Override
public Set<Location> getAllowedLocations() {
return EnumSet.of(OVERVIEW, MODULE, PACKAGE, TYPE);
}
@Override
public boolean isInlineTag() {
return true;
}
@Override
public String getName() {
return "Incubating";
}
private static final String MESSAGE =
"<BR><b><a href=\"http://openjdk.java.net/jeps/11\">Incubating Feature.</a>"
+ " Will be removed in a future release.</b>";
@Override
public String toString(DocTree tag) {
return MESSAGE;
}
@Override
public String toString(List<? extends DocTree> tags) {
return MESSAGE;
}
}

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -162,12 +162,12 @@ final class OutputFeedback extends FeedbackCipher {
for (int i = 0; i < numBytes; i++) { for (int i = 0; i < numBytes; i++) {
cipher[i + cipherOffset] = cipher[i + cipherOffset] =
(byte)(k[i] ^ plain[i + plainOffset]); (byte)(k[i] ^ plain[i + plainOffset]);
}
if (nShift != 0) { if (nShift != 0) {
System.arraycopy(register, numBytes, register, 0, nShift); System.arraycopy(register, numBytes, register, 0, nShift);
} }
System.arraycopy(k, 0, register, nShift, numBytes); System.arraycopy(k, 0, register, nShift, numBytes);
} }
}
return plainLen; return plainLen;
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -66,16 +66,16 @@ import sun.security.util.SecurityConstants;
* refer to a directory. Otherwise, the URL is assumed to refer to a JAR file * refer to a directory. Otherwise, the URL is assumed to refer to a JAR file
* which will be opened as needed. * which will be opened as needed.
* <p> * <p>
* This class loader supports the loading of classes and resources from the
* contents of a <a href="../util/jar/JarFile.html#multirelease">multi-release</a>
* JAR file that is referred to by a given URL.
* <p>
* The AccessControlContext of the thread that created the instance of * The AccessControlContext of the thread that created the instance of
* URLClassLoader will be used when subsequently loading classes and * URLClassLoader will be used when subsequently loading classes and
* resources. * resources.
* <p> * <p>
* The classes that are loaded are by default granted permission only to * The classes that are loaded are by default granted permission only to
* access the URLs specified when the URLClassLoader was created. * access the URLs specified when the URLClassLoader was created.
* <p>
* This class loader supports the loading of classes from the contents of a
* <a href="../util/jar/JarFile.html#multirelease">multi-release</a> JAR file
* that is referred to by a given URL.
* *
* @author David Connelly * @author David Connelly
* @since 1.2 * @since 1.2

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -71,7 +71,7 @@ import java.util.Objects;
* following standard {@code AlgorithmParameterGenerator} algorithms and * following standard {@code AlgorithmParameterGenerator} algorithms and
* keysizes in parentheses: * keysizes in parentheses:
* <ul> * <ul>
* <li>{@code DiffieHellman} (1024, 2048, 4096)</li> * <li>{@code DiffieHellman} (1024, 2048)</li>
* <li>{@code DSA} (1024, 2048)</li> * <li>{@code DSA} (1024, 2048)</li>
* </ul> * </ul>
* These algorithms are described in the <a href= * These algorithms are described in the <a href=

View file

@ -61,7 +61,10 @@ import java.security.PrivilegedExceptionAction;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentMap;
import java.util.jar.JarEntry; import java.util.jar.JarEntry;
import java.util.spi.ResourceBundleControlProvider;
import java.util.spi.ResourceBundleProvider; import java.util.spi.ResourceBundleProvider;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import jdk.internal.loader.BootLoader; import jdk.internal.loader.BootLoader;
import jdk.internal.misc.JavaUtilResourceBundleAccess; import jdk.internal.misc.JavaUtilResourceBundleAccess;
@ -232,6 +235,8 @@ import static sun.security.util.SecurityConstants.GET_CLASSLOADER_PERMISSION;
* <li>{@code ResourceBundle.Control} is <em>not</em> supported in named modules. * <li>{@code ResourceBundle.Control} is <em>not</em> supported in named modules.
* If the {@code getBundle} method with a {@code ResourceBundle.Control} is called * If the {@code getBundle} method with a {@code ResourceBundle.Control} is called
* in a named module, the method will throw an {@code UnsupportedOperationException}. * in a named module, the method will throw an {@code UnsupportedOperationException}.
* Any service providers of {@link ResourceBundleControlProvider} are ignored in
* named modules.
* </li> * </li>
* </ul> * </ul>
* *
@ -262,6 +267,18 @@ import static sun.security.util.SecurityConstants.GET_CLASSLOADER_PERMISSION;
* {@link #getBundle(String, Locale, ClassLoader, Control) getBundle} * {@link #getBundle(String, Locale, ClassLoader, Control) getBundle}
* factory method for details. * factory method for details.
* *
* <p><a name="modify_default_behavior">For the {@code getBundle} factory</a>
* methods that take no {@link Control} instance, their <a
* href="#default_behavior"> default behavior</a> of resource bundle loading
* can be modified with custom {@link
* ResourceBundleControlProvider} implementations.
* If any of the
* providers provides a {@link Control} for the given base name, that {@link
* Control} will be used instead of the default {@link Control}. If there is
* more than one service provider for supporting the same base name,
* the first one returned from {@link ServiceLoader} will be used.
* A custom {@link Control} implementation is ignored by named modules.
*
* <h3>Cache Management</h3> * <h3>Cache Management</h3>
* *
* Resource bundle instances created by the <code>getBundle</code> factory * Resource bundle instances created by the <code>getBundle</code> factory
@ -367,7 +384,8 @@ public abstract class ResourceBundle {
public ResourceBundle getBundle(String baseName, Locale locale, Module module) { public ResourceBundle getBundle(String baseName, Locale locale, Module module) {
// use the given module as the caller to bypass the access check // use the given module as the caller to bypass the access check
return getBundleImpl(module, module, return getBundleImpl(module, module,
baseName, locale, Control.INSTANCE); baseName, locale,
getDefaultControl(module, baseName));
} }
@Override @Override
@ -815,7 +833,7 @@ public abstract class ResourceBundle {
{ {
Class<?> caller = Reflection.getCallerClass(); Class<?> caller = Reflection.getCallerClass();
return getBundleImpl(baseName, Locale.getDefault(), return getBundleImpl(baseName, Locale.getDefault(),
caller, Control.INSTANCE); caller, getDefaultControl(caller, baseName));
} }
/** /**
@ -889,7 +907,7 @@ public abstract class ResourceBundle {
{ {
Class<?> caller = Reflection.getCallerClass(); Class<?> caller = Reflection.getCallerClass();
return getBundleImpl(baseName, locale, return getBundleImpl(baseName, locale,
caller, Control.INSTANCE); caller, getDefaultControl(caller, baseName));
} }
/** /**
@ -925,7 +943,8 @@ public abstract class ResourceBundle {
@CallerSensitive @CallerSensitive
public static ResourceBundle getBundle(String baseName, Module module) { public static ResourceBundle getBundle(String baseName, Module module) {
return getBundleFromModule(Reflection.getCallerClass(), module, baseName, return getBundleFromModule(Reflection.getCallerClass(), module, baseName,
Locale.getDefault(), Control.INSTANCE); Locale.getDefault(),
getDefaultControl(module, baseName));
} }
/** /**
@ -953,7 +972,9 @@ public abstract class ResourceBundle {
* equivalent to calling {@link #getBundle(String, Locale, ClassLoader) * equivalent to calling {@link #getBundle(String, Locale, ClassLoader)
* getBundle(baseName, targetLocale, module.getClassLoader()} to load * getBundle(baseName, targetLocale, module.getClassLoader()} to load
* resource bundles that are visible to the class loader of the given * resource bundles that are visible to the class loader of the given
* unnamed module. * unnamed module. Custom {@link java.util.spi.ResourceBundleControlProvider}
* implementations, if present, will only be invoked if the specified
* module is an unnamed module.
* *
* @param baseName the base name of the resource bundle, * @param baseName the base name of the resource bundle,
* a fully qualified class name * a fully qualified class name
@ -974,7 +995,7 @@ public abstract class ResourceBundle {
@CallerSensitive @CallerSensitive
public static ResourceBundle getBundle(String baseName, Locale targetLocale, Module module) { public static ResourceBundle getBundle(String baseName, Locale targetLocale, Module module) {
return getBundleFromModule(Reflection.getCallerClass(), module, baseName, targetLocale, return getBundleFromModule(Reflection.getCallerClass(), module, baseName, targetLocale,
Control.INSTANCE); getDefaultControl(module, baseName));
} }
/** /**
@ -1030,7 +1051,10 @@ public abstract class ResourceBundle {
* *
* <p>This method behaves the same as calling * <p>This method behaves the same as calling
* {@link #getBundle(String, Locale, ClassLoader, Control)} passing a * {@link #getBundle(String, Locale, ClassLoader, Control)} passing a
* default instance of {@link Control}. * default instance of {@link Control} unless another {@link Control} is
* provided with the {@link ResourceBundleControlProvider} SPI. Refer to the
* description of <a href="#modify_default_behavior">modifying the default
* behavior</a>.
* *
* <p><a name="default_behavior">The following describes the default * <p><a name="default_behavior">The following describes the default
* behavior</a>. * behavior</a>.
@ -1228,7 +1252,7 @@ public abstract class ResourceBundle {
throw new NullPointerException(); throw new NullPointerException();
} }
Class<?> caller = Reflection.getCallerClass(); Class<?> caller = Reflection.getCallerClass();
return getBundleImpl(baseName, locale, caller, loader, Control.INSTANCE); return getBundleImpl(baseName, locale, caller, loader, getDefaultControl(caller, baseName));
} }
/** /**
@ -1453,6 +1477,39 @@ public abstract class ResourceBundle {
return getBundleImpl(baseName, targetLocale, caller, loader, control); return getBundleImpl(baseName, targetLocale, caller, loader, control);
} }
private static Control getDefaultControl(Class<?> caller, String baseName) {
return getDefaultControl(caller.getModule(), baseName);
}
private static Control getDefaultControl(Module targetModule, String baseName) {
return targetModule.isNamed() ?
Control.INSTANCE :
ResourceBundleControlProviderHolder.getControl(baseName);
}
private static class ResourceBundleControlProviderHolder {
private static final PrivilegedAction<List<ResourceBundleControlProvider>> pa =
() -> {
return Collections.unmodifiableList(
ServiceLoader.load(ResourceBundleControlProvider.class,
ClassLoader.getSystemClassLoader()).stream()
.map(ServiceLoader.Provider::get)
.collect(Collectors.toList()));
};
private static final List<ResourceBundleControlProvider> CONTROL_PROVIDERS =
AccessController.doPrivileged(pa);
private static Control getControl(String baseName) {
return CONTROL_PROVIDERS.isEmpty() ?
Control.INSTANCE :
CONTROL_PROVIDERS.stream()
.flatMap(provider -> Stream.ofNullable(provider.getControl(baseName)))
.findFirst()
.orElse(Control.INSTANCE);
}
}
private static void checkNamedModule(Class<?> caller) { private static void checkNamedModule(Class<?> caller) {
if (caller.getModule().isNamed()) { if (caller.getModule().isNamed()) {
throw new UnsupportedOperationException( throw new UnsupportedOperationException(
@ -2414,7 +2471,8 @@ public abstract class ResourceBundle {
* @apiNote <a name="note">{@code ResourceBundle.Control} is not supported * @apiNote <a name="note">{@code ResourceBundle.Control} is not supported
* in named modules.</a> If the {@code ResourceBundle.getBundle} method with * in named modules.</a> If the {@code ResourceBundle.getBundle} method with
* a {@code ResourceBundle.Control} is called in a named module, the method * a {@code ResourceBundle.Control} is called in a named module, the method
* will throw an {@link UnsupportedOperationException}. * will throw an {@link UnsupportedOperationException}. Any service providers
* of {@link ResourceBundleControlProvider} are ignored in named modules.
* *
* @since 1.6 * @since 1.6
* @see java.util.spi.ResourceBundleProvider * @see java.util.spi.ResourceBundleProvider

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -35,19 +35,19 @@ import java.util.ResourceBundle;
* no {@link java.util.ResourceBundle.Control} instance can be modified with {@code * no {@link java.util.ResourceBundle.Control} instance can be modified with {@code
* ResourceBundleControlProvider} implementations. * ResourceBundleControlProvider} implementations.
* *
* <p>Provider implementations are loaded from the application's class path
* using {@link java.util.ServiceLoader} at the first invocation of the
* {@code ResourceBundle.getBundle} factory method that takes no
* {@link java.util.ResourceBundle.Control} instance.
*
* <p>All {@code ResourceBundleControlProvider}s are ignored in named modules.
*
* @author Masayoshi Okutsu * @author Masayoshi Okutsu
* @since 1.8 * @since 1.8
* @see ResourceBundle#getBundle(String, java.util.Locale, ClassLoader, ResourceBundle.Control) * @see ResourceBundle#getBundle(String, java.util.Locale, ClassLoader, ResourceBundle.Control)
* ResourceBundle.getBundle * ResourceBundle.getBundle
* @see java.util.ServiceLoader#loadInstalled(Class) * @see java.util.ServiceLoader#load(Class)
* @deprecated There is no longer any mechanism to install a custom
* {@code ResourceBundleControlProvider} implementation defined
* by the platform class loader or its ancestor. The recommended
* way to use a custom {@code Control} implementation to load resource bundle
* is to use {@link java.util.ResourceBundle#getBundle(String, Control)}
* or other factory methods that take custom {@link java.util.ResourceBundle.Control}.
*/ */
@Deprecated(since="9", forRemoval=true)
public interface ResourceBundleControlProvider { public interface ResourceBundleControlProvider {
/** /**
* Returns a {@code ResourceBundle.Control} instance that is used * Returns a {@code ResourceBundle.Control} instance that is used

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -25,6 +25,7 @@
package javax.crypto; package javax.crypto;
import java.lang.reflect.Module;
import java.security.*; import java.security.*;
import java.net.*; import java.net.*;
import java.util.*; import java.util.*;
@ -227,38 +228,55 @@ final class JceSecurityManager extends SecurityManager {
return (CryptoPermission)enum_.nextElement(); return (CryptoPermission)enum_.nextElement();
} }
// See bug 4341369 & 4334690 for more info. // Only used by javax.crypto.Cipher constructor to disallow Cipher
// objects being constructed by untrusted code (See bug 4341369 &
// 4334690 for more info).
boolean isCallerTrusted(Provider provider) { boolean isCallerTrusted(Provider provider) {
if (ProviderVerifier.isTrustedCryptoProvider(provider)) {
// fast path
return true;
}
// Get the caller and its codebase. // Get the caller and its codebase.
Class<?>[] context = getClassContext(); Class<?>[] context = getClassContext();
URL callerCodeBase = null; if (context.length >= 3) {
int i; // context[0]: class javax.crypto.JceSecurityManager
for (i=0; i<context.length; i++) { // context[1]: class javax.crypto.Cipher (or other JCE API class)
callerCodeBase = JceSecurity.getCodeBase(context[i]); // context[2]: this is what we are gonna check
if (callerCodeBase != null) { Class<?> caller = context[2];
break; URL callerCodeBase = JceSecurity.getCodeBase(caller);
} if (callerCodeBase == null) {
}
// The caller is in the JCE framework.
if (i == context.length) {
return true; return true;
} }
// The caller has been verified. // The caller has been verified.
if (TrustedCallersCache.contains(context[i])) { if (TrustedCallersCache.contains(caller)) {
return true; return true;
} }
// Check the association between caller and provider
Class<?> pCls = provider.getClass();
Module pMod = pCls.getModule();
// If they are in the same named module or share
// the same codebase, then they are associated
boolean sameOrigin = (pMod.isNamed()?
caller.getModule().equals(pMod) :
callerCodeBase.equals(JceSecurity.getCodeBase(pCls)));
if (sameOrigin) {
// The caller is from trusted provider
if (ProviderVerifier.isTrustedCryptoProvider(provider)) {
TrustedCallersCache.addElement(caller);
return true;
}
} else {
// Don't include the provider in the subsequent
// JceSecurity.verifyProvider(...) call
provider = null;
}
// Check whether the caller is a trusted provider. // Check whether the caller is a trusted provider.
try { try {
JceSecurity.verifyProvider(callerCodeBase, provider); JceSecurity.verifyProvider(callerCodeBase, provider);
} catch (Exception e2) { } catch (Exception e2) {
return false; return false;
} }
TrustedCallersCache.addElement(context[i]); TrustedCallersCache.addElement(caller);
return true; return true;
} }
return false;
}
} }

View file

@ -53,21 +53,21 @@ public final class ModuleInfoExtender {
// the input stream to read the original module-info.class // the input stream to read the original module-info.class
private final InputStream in; private final InputStream in;
// the packages in the Packages attribute // the packages in the ModulePackages attribute
private Set<String> packages; private Set<String> packages;
// the value of the Version attribute // the value of the module_version in Module attribute
private Version version; private Version version;
// the value of the MainClass attribute // the value of the ModuleMainClass attribute
private String mainClass; private String mainClass;
// the values for the TargetPlatform attribute // the values for the ModuleTarget attribute
private String osName; private String osName;
private String osArch; private String osArch;
private String osVersion; private String osVersion;
// the hashes for the Hashes attribute // the hashes for the ModuleHashes attribute
private ModuleHashes hashes; private ModuleHashes hashes;
// the value of the ModuleResolution attribute // the value of the ModuleResolution attribute
@ -78,7 +78,7 @@ public final class ModuleInfoExtender {
} }
/** /**
* Sets the set of packages for the Packages attribute * Sets the set of packages for the ModulePackages attribute
*/ */
public ModuleInfoExtender packages(Set<String> packages) { public ModuleInfoExtender packages(Set<String> packages) {
this.packages = Collections.unmodifiableSet(packages); this.packages = Collections.unmodifiableSet(packages);
@ -86,7 +86,7 @@ public final class ModuleInfoExtender {
} }
/** /**
* Sets the value of the Version attribute. * Sets the value of the module_version in Module attribute.
*/ */
public ModuleInfoExtender version(Version version) { public ModuleInfoExtender version(Version version) {
this.version = version; this.version = version;
@ -94,7 +94,7 @@ public final class ModuleInfoExtender {
} }
/** /**
* Sets the value of the MainClass attribute. * Sets the value of the ModuleMainClass attribute.
*/ */
public ModuleInfoExtender mainClass(String mainClass) { public ModuleInfoExtender mainClass(String mainClass) {
this.mainClass = mainClass; this.mainClass = mainClass;
@ -102,7 +102,7 @@ public final class ModuleInfoExtender {
} }
/** /**
* Sets the values for the TargetPlatform attribute. * Sets the values for the ModuleTarget attribute.
*/ */
public ModuleInfoExtender targetPlatform(String osName, public ModuleInfoExtender targetPlatform(String osName,
String osArch, String osArch,
@ -114,7 +114,7 @@ public final class ModuleInfoExtender {
} }
/** /**
* The Hashes attribute will be emitted to the module-info with * The ModuleHashes attribute will be emitted to the module-info with
* the hashes encapsulated in the given {@code ModuleHashes} * the hashes encapsulated in the given {@code ModuleHashes}
* object. * object.
*/ */

View file

@ -154,7 +154,6 @@ module java.base {
jdk.jartool, jdk.jartool,
jdk.jlink; jdk.jlink;
exports jdk.internal.misc to exports jdk.internal.misc to
java.corba,
java.desktop, java.desktop,
jdk.incubator.httpclient, jdk.incubator.httpclient,
java.logging, java.logging,
@ -183,7 +182,6 @@ module java.base {
java.desktop, java.desktop,
jdk.unsupported; jdk.unsupported;
exports jdk.internal.reflect to exports jdk.internal.reflect to
java.corba,
java.logging, java.logging,
java.sql, java.sql,
java.sql.rowset, java.sql.rowset,
@ -232,7 +230,6 @@ module java.base {
exports sun.reflect.generics.reflectiveObjects to exports sun.reflect.generics.reflectiveObjects to
java.desktop; java.desktop;
exports sun.reflect.misc to exports sun.reflect.misc to
java.corba,
java.desktop, java.desktop,
java.datatransfer, java.datatransfer,
java.management, java.management,

View file

@ -117,7 +117,6 @@ java.launcher.X.usage=\n\
\ -Xdebug provided for backward compatibility\n\ \ -Xdebug provided for backward compatibility\n\
\ -Xdiag show additional diagnostic messages\n\ \ -Xdiag show additional diagnostic messages\n\
\ -Xdiag:resolver show resolver diagnostic messages\n\ \ -Xdiag:resolver show resolver diagnostic messages\n\
\ -Xdisable-@files disable further argument file expansion\n\
\ -Xfuture enable strictest checks, anticipating future default\n\ \ -Xfuture enable strictest checks, anticipating future default\n\
\ -Xint interpreted mode execution only\n\ \ -Xint interpreted mode execution only\n\
\ -Xinternalversion\n\ \ -Xinternalversion\n\
@ -158,6 +157,7 @@ java.launcher.X.usage=\n\
\ --add-opens <module>/<package>=<target-module>(,<target-module>)*\n\ \ --add-opens <module>/<package>=<target-module>(,<target-module>)*\n\
\ updates <module> to open <package> to\n\ \ updates <module> to open <package> to\n\
\ <target-module>, regardless of module declaration.\n\ \ <target-module>, regardless of module declaration.\n\
\ --disable-@files disable further argument file expansion\n\
\ --patch-module <module>=<file>({0}<file>)*\n\ \ --patch-module <module>=<file>({0}<file>)*\n\
\ Override or augment a module with classes and resources\n\ \ Override or augment a module with classes and resources\n\
\ in JAR files or directories.\n\n\ \ in JAR files or directories.\n\n\

View file

@ -38,7 +38,7 @@ java.launcher.opt.footer =\ -cp <Klassensuchpfad von Verzeichnissen und Z
See Weitere Einzelheiten finden Sie unter http://www.oracle.com/technetwork/java/javase/documentation/index.html. See Weitere Einzelheiten finden Sie unter http://www.oracle.com/technetwork/java/javase/documentation/index.html.
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xbatch Deaktiviert Hintergrundkompilierung\n -Xbootclasspath/a:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n an Ende von Bootstrap-Klassenpfad anh\u00E4ngen\n -Xcheck:jni F\u00FChrt zus\u00E4tzliche Pr\u00FCfungen f\u00FCr JNI-Funktionen aus\n -Xcomp Erzwingt Kompilierung von Methoden beim ersten Aufruf\n -Xdebug Wird zur Abw\u00E4rtskompatiblit\u00E4t bereitgestellt\n -Xdiag Zeigt zus\u00E4tzliche Diagnosemeldungen\n -Xdiag:resolver Zeigt Resolver-Diagnosemeldungen\n -Xdisable-@files Deaktiviert das weitere Einblenden der Argumentdatei\n -Xfuture Aktiviert strengste Pr\u00FCfungen, als m\u00F6glicher zuk\u00FCnftiger Standardwert erwartet\n -Xint Nur Ausf\u00FChrung im interpretierten Modus\n -Xinternalversion\n Zeigt detailliertere JVM-Versionsinformationen an als die\n -version-Option\n -Xloggc:<file> Protokolliert GC-Status in einer Datei mit Zeitstempeln\n -Xmixed Ausf\u00FChrung im gemischten Modus (Standard)\n -Xmn<size> Setzt die anf\u00E4ngliche und maximale Gr\u00F6\u00DFe (in Byte) des Heaps\n f\u00FCr die junge Generation (Nursery)\n -Xms<size> Setzt die anf\u00E4ngliche Java-Heap-Gr\u00F6\u00DFe\n -Xmx<size> Setzt die maximale Java-Heap-Gr\u00F6\u00DFe\n -Xnoclassgc Deaktiviert die Klassen-Garbage Collection\n -Xprof Gibt CPU-Profilierungsdaten aus\n -Xrs Reduziert die Verwendung von BS-Signalen durch Java/VM (siehe Dokumentation)\n -Xshare:auto Verwendet freigegebene Klassendaten, wenn m\u00F6glich (Standard)\n -Xshare:off Versucht nicht, freigegebene Klassendaten zu verwenden\n -Xshare:on Erfordert die Verwendung von freigegebenen Klassendaten, verl\u00E4uft sonst nicht erfolgreich.\n -XshowSettings Zeigt alle Einstellungen und f\u00E4hrt fort\n -XshowSettings:all\n Zeigt alle Einstellungen und f\u00E4hrt fort\n -XshowSettings:locale\n Zeigt alle gebietsschemabezogenen Einstellungen und f\u00E4hrt fort\n -XshowSettings:properties\n Zeigt alle Eigenschaftseinstellungen und f\u00E4hrt fort\n -XshowSettings:vm Zeigt alle VM-bezogenen Einstellungen und f\u00E4hrt fort\n -Xss<size> Setzt Stackgr\u00F6\u00DFe des Java-Threads\n -Xverify Setzt den Modus der Bytecodeverifizierung\n --add-reads <Modul>=<Zielmodul>(,<Zielmodul>)*\n Aktualisiert <Modul>, damit <Zielmodul> gelesen wird, ungeachtet \n der Moduldeklaration. \n <Zielmodul> kann ALL-UNNAMED sein, um alle unbenannten\n Module zu lesen.\n --add-exports <Modul>/<Package>=<Zielmodul>(,<Zielmodul>)*\n Aktualisiert <Modul>, um <Package> in <Zielmodul> zu exportieren,\n ungeachtet der Moduldeklaration.\n <Zielmodul> kann ALL-UNNAMED sein, um in alle \n unbenannten Module zu exportieren.\n --patch-module <Modul>=<Datei>({0}<Datei>)*\n Setzt ein Modul au\u00DFer Kraft oder erweitert ein Modul mit Klassen und Ressourcen\n in JAR-Dateien oder -Verzeichnissen.\n\nDiese Optionen sind Nicht-Standardoptionen und k\u00F6nnen ohne Ank\u00FCndigung ge\u00E4ndert werden.\n java.launcher.X.usage=\ -Xbatch Deaktiviert Hintergrundkompilierung\n -Xbootclasspath/a:<Verzeichnisse und ZIP-/JAR-Dateien durch {0} getrennt>\n an Ende von Bootstrap-Klassenpfad anh\u00E4ngen\n -Xcheck:jni F\u00FChrt zus\u00E4tzliche Pr\u00FCfungen f\u00FCr JNI-Funktionen aus\n -Xcomp Erzwingt Kompilierung von Methoden beim ersten Aufruf\n -Xdebug Wird zur Abw\u00E4rtskompatiblit\u00E4t bereitgestellt\n -Xdiag Zeigt zus\u00E4tzliche Diagnosemeldungen\n -Xdiag:resolver Zeigt Resolver-Diagnosemeldungen\n -Xfuture Aktiviert strengste Pr\u00FCfungen, als m\u00F6glicher zuk\u00FCnftiger Standardwert erwartet\n -Xint Nur Ausf\u00FChrung im interpretierten Modus\n -Xinternalversion\n Zeigt detailliertere JVM-Versionsinformationen an als die\n -version-Option\n -Xloggc:<file> Protokolliert GC-Status in einer Datei mit Zeitstempeln\n -Xmixed Ausf\u00FChrung im gemischten Modus (Standard)\n -Xmn<size> Setzt die anf\u00E4ngliche und maximale Gr\u00F6\u00DFe (in Byte) des Heaps\n f\u00FCr die junge Generation (Nursery)\n -Xms<size> Setzt die anf\u00E4ngliche Java-Heap-Gr\u00F6\u00DFe\n -Xmx<size> Setzt die maximale Java-Heap-Gr\u00F6\u00DFe\n -Xnoclassgc Deaktiviert die Klassen-Garbage Collection\n -Xprof Gibt CPU-Profilierungsdaten aus\n -Xrs Reduziert die Verwendung von BS-Signalen durch Java/VM (siehe Dokumentation)\n -Xshare:auto Verwendet freigegebene Klassendaten, wenn m\u00F6glich (Standard)\n -Xshare:off Versucht nicht, freigegebene Klassendaten zu verwenden\n -Xshare:on Erfordert die Verwendung von freigegebenen Klassendaten, verl\u00E4uft sonst nicht erfolgreich.\n -XshowSettings Zeigt alle Einstellungen und f\u00E4hrt fort\n -XshowSettings:all\n Zeigt alle Einstellungen und f\u00E4hrt fort\n -XshowSettings:locale\n Zeigt alle gebietsschemabezogenen Einstellungen und f\u00E4hrt fort\n -XshowSettings:properties\n Zeigt alle Eigenschaftseinstellungen und f\u00E4hrt fort\n -XshowSettings:vm Zeigt alle VM-bezogenen Einstellungen und f\u00E4hrt fort\n -Xss<size> Setzt Stackgr\u00F6\u00DFe des Java-Threads\n -Xverify Setzt den Modus der Bytecodeverifizierung\n --add-reads <Modul>=<Zielmodul>(,<Zielmodul>)*\n Aktualisiert <Modul>, damit <Zielmodul> gelesen wird, ungeachtet \n der Moduldeklaration. \n <Zielmodul> kann ALL-UNNAMED sein, um alle unbenannten\n Module zu lesen.\n --add-exports <Modul>/<Package>=<Zielmodul>(,<Zielmodul>)*\n Aktualisiert <Modul>, um <Package> in <Zielmodul> zu exportieren,\n ungeachtet der Moduldeklaration.\n <Zielmodul> kann ALL-UNNAMED sein, um in alle \n unbenannten Module zu exportieren.\n --disable-@files Deaktiviert das weitere Einblenden der Argumentdatei\n --patch-module <Modul>=<Datei>({0}<Datei>)*\n Setzt ein Modul au\u00DFer Kraft oder erweitert ein Modul mit Klassen und Ressourcen\n in JAR-Dateien oder -Verzeichnissen.\n\nDiese Optionen sind Nicht-Standardoptionen und k\u00F6nnen ohne Ank\u00FCndigung ge\u00E4ndert werden.\n
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves
java.launcher.X.macosx.usage=\nDie folgenden Optionen sind f\u00FCr Mac OS X spezifisch:\n -XstartOnFirstThread\n main()-Methode f\u00FCr den ersten (AppKit) Thread ausf\u00FChren\n -Xdock:name=<application name>\n Den im Dock angezeigten Standardanwendungsnamen \u00FCberschreiben\n -Xdock:icon=<Pfad zu Symboldatei>\n Das im Dock angezeigte Standardsymbol \u00FCberschreiben\n\n java.launcher.X.macosx.usage=\nDie folgenden Optionen sind f\u00FCr Mac OS X spezifisch:\n -XstartOnFirstThread\n main()-Methode f\u00FCr den ersten (AppKit) Thread ausf\u00FChren\n -Xdock:name=<application name>\n Den im Dock angezeigten Standardanwendungsnamen \u00FCberschreiben\n -Xdock:icon=<Pfad zu Symboldatei>\n Das im Dock angezeigte Standardsymbol \u00FCberschreiben\n\n

View file

@ -39,7 +39,7 @@ la API de la pantalla de bienvenida para obtener m\u00E1s informaci\u00F3n.\n
See http://www.oracle.com/technetwork/java/javase/documentation/index.html para obtener m\u00E1s informaci\u00F3n. See http://www.oracle.com/technetwork/java/javase/documentation/index.html para obtener m\u00E1s informaci\u00F3n.
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xbatch desactivar compilaci\u00F3n de fondo\n -Xbootclasspath/a:<directorios y archivos zip/jar separados por {0}>\n agregar al final de la ruta de la clase de inicializaci\u00F3n de datos\n -Xcheck:jni realizar comprobaciones adicionales para las funciones de JNI\n -Xcomp fuerza la compilaci\u00F3n de m\u00E9todos en la primera llamada\n -Xdebug se proporciona para ofrecer compatibilidad con versiones anteriores\n -Xdiag mostrar mensajes de diagn\u00F3stico adicionales\n -Xdiag:resolver mostrar mensajes de diagn\u00F3stico de resoluci\u00F3n\n -Xdisable-@files desactivar la ampliaci\u00F3n de archivos de m\u00E1s argumentos\n -Xfuture activar las comprobaciones m\u00E1s estrictas, anticip\u00E1ndose al futuro valor por defecto\n -Xint solo ejecuci\u00F3n de modo interpretado\n -Xinternalversion\n muestra una informaci\u00F3n de la versi\u00F3n de JVM m\u00E1s detallada que la\n opci\u00F3n -version\n -Xloggc:<archivo> registrar el estado de GC en un archivo con registros de hora\n -Xmixed ejecuci\u00F3n de modo mixto (por defecto)\n -Xmn<tama\u00F1o> define el tama\u00F1o inicial y m\u00E1ximo (en bytes) de la pila\n para la generaci\u00F3n m\u00E1s joven (espacio infantil)\n -Xms<size> define el tama\u00F1o inicial de la pila de Java\n -Xmx<size> define el tama\u00F1o m\u00E1ximo de la pila de Java\n -Xnoclassgc desactivar la recolecci\u00F3n de basura de clases\n -Xprof datos de creaci\u00F3n de perfiles de CPU de salida\n -Xrs reducir el uso de se\u00F1ales de sistema operativo por parte de Java/VM (consulte la documentaci\u00F3n)\n -Xshare:auto usar datos de clase compartidos si es posible (valor por defecto)\n -Xshare:off no intentar usar datos de clase compartidos\n -Xshare:on es obligatorio el uso de datos de clase compartidos, de lo contrario se producir\u00E1 un fallo.\n -XshowSettings mostrar toda la configuraci\u00F3n y continuar\n -XshowSettings:all\n mostrar todos los valores y continuar\n -XshowSettings:locale\n mostrar todos los valores relacionados con la configuraci\u00F3n regional y continuar\n -XshowSettings:properties\n mostrar todos los valores de propiedad y continuar\n -XshowSettings:vm mostrar todos los valores relacionados con vm y continuar\n -Xss<tama\u00F1o> definir tama\u00F1o de la pila del thread de Java\n -Xverify define el modo del verificador de c\u00F3digo de bytes\n --add-reads <m\u00F3dulo>=<m\u00F3dulo-destino>(,<m\u00F3dulo-destino>)*\n actualiza <m\u00F3dulo> para leer <m\u00F3dulo-destino>, independientemente\n de la declaraci\u00F3n del m\u00F3dulo. \n <m\u00F3dulo-destino> puede ser ALL-UNNAMED para leer todos los\n m\u00F3dulos sin nombre.\n --add-exports <m\u00F3dulo>/<paquete>=<m\u00F3dulo-destino>(,<m\u00F3dulo-destino>)*\n actualiza <m\u00F3dulo> para exportar <paquete> en <m\u00F3dulo-destino>,\n independientemente de la declaraci\u00F3n del m\u00F3dulo.\n <m\u00F3dulo-destino> puede ser ALL-UNNAMED para exportar a todos los\n m\u00F3dulos sin nombre.\n --patch-module <m\u00F3dulo>=<archivo>({0}<archivo>)*\n Aumentar o anular un m\u00F3dulo con clases y recursos\n en directorios y archivos JAR\n\nEstas opciones no son est\u00E1ndar y est\u00E1n sujetas a cambio sin previo aviso.\n java.launcher.X.usage=\ -Xbatch desactivar compilaci\u00F3n de fondo\n -Xbootclasspath/a:<directorios y archivos zip/jar separados por {0}>\n agregar al final de la ruta de la clase de inicializaci\u00F3n de datos\n -Xcheck:jni realizar comprobaciones adicionales para las funciones de JNI\n -Xcomp fuerza la compilaci\u00F3n de m\u00E9todos en la primera llamada\n -Xdebug se proporciona para ofrecer compatibilidad con versiones anteriores\n -Xdiag mostrar mensajes de diagn\u00F3stico adicionales\n -Xdiag:resolver mostrar mensajes de diagn\u00F3stico de resoluci\u00F3n\n -Xfuture activar las comprobaciones m\u00E1s estrictas, anticip\u00E1ndose al futuro valor por defecto\n -Xint solo ejecuci\u00F3n de modo interpretado\n -Xinternalversion\n muestra una informaci\u00F3n de la versi\u00F3n de JVM m\u00E1s detallada que la\n opci\u00F3n -version\n -Xloggc:<archivo> registrar el estado de GC en un archivo con registros de hora\n -Xmixed ejecuci\u00F3n de modo mixto (por defecto)\n -Xmn<tama\u00F1o> define el tama\u00F1o inicial y m\u00E1ximo (en bytes) de la pila\n para la generaci\u00F3n m\u00E1s joven (espacio infantil)\n -Xms<size> define el tama\u00F1o inicial de la pila de Java\n -Xmx<size> define el tama\u00F1o m\u00E1ximo de la pila de Java\n -Xnoclassgc desactivar la recolecci\u00F3n de basura de clases\n -Xprof datos de creaci\u00F3n de perfiles de CPU de salida\n -Xrs reducir el uso de se\u00F1ales de sistema operativo por parte de Java/VM (consulte la documentaci\u00F3n)\n -Xshare:auto usar datos de clase compartidos si es posible (valor por defecto)\n -Xshare:off no intentar usar datos de clase compartidos\n -Xshare:on es obligatorio el uso de datos de clase compartidos, de lo contrario se producir\u00E1 un fallo.\n -XshowSettings mostrar toda la configuraci\u00F3n y continuar\n -XshowSettings:all\n mostrar todos los valores y continuar\n -XshowSettings:locale\n mostrar todos los valores relacionados con la configuraci\u00F3n regional y continuar\n -XshowSettings:properties\n mostrar todos los valores de propiedad y continuar\n -XshowSettings:vm mostrar todos los valores relacionados con vm y continuar\n -Xss<tama\u00F1o> definir tama\u00F1o de la pila del thread de Java\n -Xverify define el modo del verificador de c\u00F3digo de bytes\n --add-reads <m\u00F3dulo>=<m\u00F3dulo-destino>(,<m\u00F3dulo-destino>)*\n actualiza <m\u00F3dulo> para leer <m\u00F3dulo-destino>, independientemente\n de la declaraci\u00F3n del m\u00F3dulo. \n <m\u00F3dulo-destino> puede ser ALL-UNNAMED para leer todos los\n m\u00F3dulos sin nombre.\n --add-exports <m\u00F3dulo>/<paquete>=<m\u00F3dulo-destino>(,<m\u00F3dulo-destino>)*\n actualiza <m\u00F3dulo> para exportar <paquete> en <m\u00F3dulo-destino>,\n independientemente de la declaraci\u00F3n del m\u00F3dulo.\n <m\u00F3dulo-destino> puede ser ALL-UNNAMED para exportar a todos los\n m\u00F3dulos sin nombre.\n --disable-@files desactivar la ampliaci\u00F3n de archivos de m\u00E1s argumentos\n --patch-module <m\u00F3dulo>=<archivo>({0}<archivo>)*\n Aumentar o anular un m\u00F3dulo con clases y recursos\n en directorios y archivos JAR\n\nEstas opciones no son est\u00E1ndar y est\u00E1n sujetas a cambio sin previo aviso.\n
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves
java.launcher.X.macosx.usage=\nLas siguientes opciones son espec\u00EDficas para Mac OS X:\n -XstartOnFirstThread\n ejecutar el m\u00E9todo main() del primer thread (AppKit)\n -Xdock:name=<application name>\n sustituir al nombre por defecto de la aplicaci\u00F3n que se muestra en el Dock\n -Xdock:icon=<ruta de acceso a archivo de icono>\n sustituir al icono por defecto que se muestra en el Dock\n\n java.launcher.X.macosx.usage=\nLas siguientes opciones son espec\u00EDficas para Mac OS X:\n -XstartOnFirstThread\n ejecutar el m\u00E9todo main() del primer thread (AppKit)\n -Xdock:name=<application name>\n sustituir al nombre por defecto de la aplicaci\u00F3n que se muestra en el Dock\n -Xdock:icon=<ruta de acceso a archivo de icono>\n sustituir al icono por defecto que se muestra en el Dock\n\n

View file

@ -39,7 +39,7 @@ java.launcher.opt.footer =\ -cp <chemin de recherche de classe de r\u00E9
See http://www.oracle.com/technetwork/java/javase/documentation/index.html pour plus de d\u00E9tails. See http://www.oracle.com/technetwork/java/javase/documentation/index.html pour plus de d\u00E9tails.
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xbatch d\u00E9sactivation de la compilation en arri\u00E8re-plan\n -Xbootclasspath/a:<r\u00E9pertoires et fichiers ZIP/JAR s\u00E9par\u00E9s par des {0}>\n ajout \u00E0 la fin du chemin de classe bootstrap\n -Xcheck:jni ex\u00E9cution de contr\u00F4les suppl\u00E9mentaires pour les fonctions JNI\n -Xcomp force la compilation de m\u00E9thodes au premier appel\n -Xdebug fourni pour la compatibilit\u00E9 amont\n -Xdiag affichage de messages de diagnostic suppl\u00E9mentaires\n -Xdiag:resolver affichage de messages de diagnostic du r\u00E9solveur\n -Xdisable-@files d\u00E9sactivation d''autres d\u00E9veloppements de fichier d''argument\n -Xfuture activation des contr\u00F4les les plus stricts en vue d''anticiper la future valeur par d\u00E9faut\n -Xint ex\u00E9cution en mode interpr\u00E9t\u00E9 uniquement\n -Xinternalversion\n affiche des informations de version JVM plus d\u00E9taill\u00E9es que\n l''option -version\n -Xloggc:<file> journalisation du statut de l''op\u00E9ration de ramasse-miette dans un fichier avec horodatage\n -Xmixed ex\u00E9cution en mode mixte (valeur par d\u00E9faut)\n -Xmn<size> d\u00E9finit les tailles initiale et maximale (en octets) de la portion de m\u00E9moire\n pour la jeune g\u00E9n\u00E9ration (nursery)\n -Xms<size> d\u00E9finition de la taille initiale des portions de m\u00E9moire Java\n -Xmx<size> d\u00E9finition de la taille maximale des portions de m\u00E9moire Java\n -Xnoclassgc d\u00E9sactivation de l''op\u00E9ration de ramasse-miette de la classe\n -Xprof sortie des donn\u00E9es de profilage d''UC\n -Xrs r\u00E9duction de l''utilisation des signaux OS par Java/la machine virtuelle (voir documentation)\n -Xshare:auto utilisation des donn\u00E9es de classe partag\u00E9es si possible (valeur par d\u00E9faut)\n -Xshare:off aucune tentative d''utilisation des donn\u00E9es de classe partag\u00E9es\n -Xshare:on utilisation des donn\u00E9es de classe partag\u00E9es obligatoire ou \u00E9chec de l''op\u00E9ration\n -XshowSettings affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:all\n affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:locale\n affichage de tous les param\u00E8tres d''environnement local et poursuite de l''op\u00E9ration\n -XshowSettings:properties\n affichage de tous les param\u00E8tres de propri\u00E9t\u00E9 et poursuite de l''op\u00E9ration\n -XshowSettings:vm affichage de tous les param\u00E8tres de machine virtuelle et poursuite de l''op\u00E9ration\n -Xss<size> d\u00E9finition de la taille de pile de threads Java\n -Xverify d\u00E9finit le mode du v\u00E9rificateur de code ex\u00E9cutable\n --add-reads <module>=<target-module>(,<target-module>)*\n met \u00E0 jour <module> pour lire <target-module>, sans tenir compte\n de la d\u00E9claration de module. \n <target-module> peut \u00EAtre ALL-UNNAMED pour lire tous les modules\n sans nom.\n --add-exports <module>/<package>=<target-module>(,<target-module>)*\n met \u00E0 jour <module> pour exporter <package> vers <target-module>,\n sans tenir compte de la d\u00E9claration de module.\n <target-module> peut \u00EAtre ALL-UNNAMED pour effectuer un export vers tous\n les modules sans nom.\n --patch-module <module>=<file>({0}<file>)*\n Remplacement ou augmentation d''un module avec des classes et des ressources\n dans des \ java.launcher.X.usage=\ -Xbatch d\u00E9sactivation de la compilation en arri\u00E8re-plan\n -Xbootclasspath/a:<r\u00E9pertoires et fichiers ZIP/JAR s\u00E9par\u00E9s par des {0}>\n ajout \u00E0 la fin du chemin de classe bootstrap\n -Xcheck:jni ex\u00E9cution de contr\u00F4les suppl\u00E9mentaires pour les fonctions JNI\n -Xcomp force la compilation de m\u00E9thodes au premier appel\n -Xdebug fourni pour la compatibilit\u00E9 amont\n -Xdiag affichage de messages de diagnostic suppl\u00E9mentaires\n -Xdiag:resolver affichage de messages de diagnostic du r\u00E9solveur\n -Xfuture activation des contr\u00F4les les plus stricts en vue d''anticiper la future valeur par d\u00E9faut\n -Xint ex\u00E9cution en mode interpr\u00E9t\u00E9 uniquement\n -Xinternalversion\n affiche des informations de version JVM plus d\u00E9taill\u00E9es que\n l''option -version\n -Xloggc:<file> journalisation du statut de l''op\u00E9ration de ramasse-miette dans un fichier avec horodatage\n -Xmixed ex\u00E9cution en mode mixte (valeur par d\u00E9faut)\n -Xmn<size> d\u00E9finit les tailles initiale et maximale (en octets) de la portion de m\u00E9moire\n pour la jeune g\u00E9n\u00E9ration (nursery)\n -Xms<size> d\u00E9finition de la taille initiale des portions de m\u00E9moire Java\n -Xmx<size> d\u00E9finition de la taille maximale des portions de m\u00E9moire Java\n -Xnoclassgc d\u00E9sactivation de l''op\u00E9ration de ramasse-miette de la classe\n -Xprof sortie des donn\u00E9es de profilage d''UC\n -Xrs r\u00E9duction de l''utilisation des signaux OS par Java/la machine virtuelle (voir documentation)\n -Xshare:auto utilisation des donn\u00E9es de classe partag\u00E9es si possible (valeur par d\u00E9faut)\n -Xshare:off aucune tentative d''utilisation des donn\u00E9es de classe partag\u00E9es\n -Xshare:on utilisation des donn\u00E9es de classe partag\u00E9es obligatoire ou \u00E9chec de l''op\u00E9ration\n -XshowSettings affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:all\n affichage de tous les param\u00E8tres et poursuite de l''op\u00E9ration\n -XshowSettings:locale\n affichage de tous les param\u00E8tres d''environnement local et poursuite de l''op\u00E9ration\n -XshowSettings:properties\n affichage de tous les param\u00E8tres de propri\u00E9t\u00E9 et poursuite de l''op\u00E9ration\n -XshowSettings:vm affichage de tous les param\u00E8tres de machine virtuelle et poursuite de l''op\u00E9ration\n -Xss<size> d\u00E9finition de la taille de pile de threads Java\n -Xverify d\u00E9finit le mode du v\u00E9rificateur de code ex\u00E9cutable\n --add-reads <module>=<target-module>(,<target-module>)*\n met \u00E0 jour <module> pour lire <target-module>, sans tenir compte\n de la d\u00E9claration de module. \n <target-module> peut \u00EAtre ALL-UNNAMED pour lire tous les modules\n sans nom.\n --add-exports <module>/<package>=<target-module>(,<target-module>)*\n met \u00E0 jour <module> pour exporter <package> vers <target-module>,\n sans tenir compte de la d\u00E9claration de module.\n <target-module> peut \u00EAtre ALL-UNNAMED pour effectuer un export vers tous\n les modules sans nom.\n --disable-@files d\u00E9sactivation d''autres d\u00E9veloppements de fichier d''argument\n --patch-module <module>=<file>({0}<file>)*\n Remplacement ou augmentation d''un module avec des classes et des ressources\n dans des \
fichiers ou des r\u00E9pertoires JAR.\n\nCes options ne sont pas standard et peuvent \u00EAtre modifi\u00E9es sans pr\u00E9avis.\n fichiers ou des r\u00E9pertoires JAR.\n\nCes options ne sont pas standard et peuvent \u00EAtre modifi\u00E9es sans pr\u00E9avis.\n
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves

View file

@ -39,7 +39,7 @@ utilizzare --<nome>=<valore> o\n--<nome> <valore>.
See Per ulteriori dettagli, vedere http://www.oracle.com/technetwork/java/javase/documentation/index.html. See Per ulteriori dettagli, vedere http://www.oracle.com/technetwork/java/javase/documentation/index.html.
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xbatch disabilita la compilazione in background\n -Xbootclasspath/a:<directory e file zip/jar separati da {0}>\n aggiunge alla fine del classpath di bootstrap\n -Xcheck:jni esegue controlli aggiuntivi per le funzioni JNI\n -Xcomp forza la compilazione dei metodi al primo richiamo\n -Xdebug fornito per la compatibilit\u00E0 con le versioni precedenti\n -Xdiag mostra ulteriori messaggi diagnostici\n -Xdiag:resolver mostra i messaggi diagnostici del resolver\n -Xdisable-@files disabilita l''ulteriore espansione del file di argomenti\n -Xfuture abilita i controlli pi\u00F9 limitativi anticipando le impostazioni predefinite future\n -Xint esecuzione solo in modalit\u00E0 convertita\n -Xinternalversion\n visualizza informazioni pi\u00F9 dettagliate sulla versione JVM rispetto\n all''opzione -version\n -Xloggc:<file> registra lo stato GC in un file con indicatori orari\n -Xmixed esecuzione in modalit\u00E0 mista (impostazione predefinita)\n -Xmn<size> imposta le dimensioni iniziale e massima (in byte) dell''heap\n per la young generation (nursery)\n -Xms<size> imposta la dimensione heap Java iniziale\n -Xmx<size> imposta la dimensione heap Java massima\n -Xnoclassgc disabilta la garbage collection della classe\n -Xprof visualizza i dati di profilo della CPU\n -Xrs riduce l''uso di segnali del sistema operativo da Java/VM (vedere la documentazione)\n -Xshare:auto utilizza i dati di classe condivisi se possibile (impostazione predefinita)\n -Xshare:off non tenta di utilizzare i dati di classe condivisi\n -Xshare:on richiede l''uso dei dati di classe condivisi, altrimenti l''esecuzione non riesce.\n -XshowSettings mostra tutte le impostazioni e continua\n -XshowSettings:all\n mostra tutte le impostazioni e continua\n -XshowSettings:locale\n mostra tutte le impostazioni correlate alle impostazioni nazionali e continua\n -XshowSettings:properties\n mostra tutte le impostazioni delle propriet\u00E0 e continua\n -XshowSettings:vm mostra tutte le impostazioni correlate alla VM e continua\n -Xss<size> imposta la dimensione dello stack di thread Java\n -Xverify imposta la modalit\u00E0 del verificatore bytecode\n --add-reads:<module>=<target-module>(,<target-module>)*\n aggiorna <module> per leggere <target-module>, indipendentemente\n dalla dichiarazione del modulo.\n <target-module> pu\u00F2 essere ALL-UNNAMED per leggere tutti i\n moduli senza nome.\n -add-exports:<module>/<package>=<target-module>(,<target-module>)*\n aggiorna <module> per esportare <package> in <target-module>,\n indipendentemente dalla dichiarazione del modulo.\n <target-module> pu\u00F2 essere ALL-UNNAMED per esportare tutti i\n moduli senza nome.\n -patch-module <module>=<file>({0}<file>)*\n sostituisce o migliora un modulo con classi e risorse\n in file JAR o directory\n\nQueste opzioni non sono opzioni standard e sono soggette a modifiche senza preavviso.\n java.launcher.X.usage=\ -Xbatch disabilita la compilazione in background\n -Xbootclasspath/a:<directory e file zip/jar separati da {0}>\n aggiunge alla fine del classpath di bootstrap\n -Xcheck:jni esegue controlli aggiuntivi per le funzioni JNI\n -Xcomp forza la compilazione dei metodi al primo richiamo\n -Xdebug fornito per la compatibilit\u00E0 con le versioni precedenti\n -Xdiag mostra ulteriori messaggi diagnostici\n -Xdiag:resolver mostra i messaggi diagnostici del resolver\n -Xfuture abilita i controlli pi\u00F9 limitativi anticipando le impostazioni predefinite future\n -Xint esecuzione solo in modalit\u00E0 convertita\n -Xinternalversion\n visualizza informazioni pi\u00F9 dettagliate sulla versione JVM rispetto\n all''opzione -version\n -Xloggc:<file> registra lo stato GC in un file con indicatori orari\n -Xmixed esecuzione in modalit\u00E0 mista (impostazione predefinita)\n -Xmn<size> imposta le dimensioni iniziale e massima (in byte) dell''heap\n per la young generation (nursery)\n -Xms<size> imposta la dimensione heap Java iniziale\n -Xmx<size> imposta la dimensione heap Java massima\n -Xnoclassgc disabilta la garbage collection della classe\n -Xprof visualizza i dati di profilo della CPU\n -Xrs riduce l''uso di segnali del sistema operativo da Java/VM (vedere la documentazione)\n -Xshare:auto utilizza i dati di classe condivisi se possibile (impostazione predefinita)\n -Xshare:off non tenta di utilizzare i dati di classe condivisi\n -Xshare:on richiede l''uso dei dati di classe condivisi, altrimenti l''esecuzione non riesce.\n -XshowSettings mostra tutte le impostazioni e continua\n -XshowSettings:all\n mostra tutte le impostazioni e continua\n -XshowSettings:locale\n mostra tutte le impostazioni correlate alle impostazioni nazionali e continua\n -XshowSettings:properties\n mostra tutte le impostazioni delle propriet\u00E0 e continua\n -XshowSettings:vm mostra tutte le impostazioni correlate alla VM e continua\n -Xss<size> imposta la dimensione dello stack di thread Java\n -Xverify imposta la modalit\u00E0 del verificatore bytecode\n --add-reads:<module>=<target-module>(,<target-module>)*\n aggiorna <module> per leggere <target-module>, indipendentemente\n dalla dichiarazione del modulo.\n <target-module> pu\u00F2 essere ALL-UNNAMED per leggere tutti i\n moduli senza nome.\n -add-exports:<module>/<package>=<target-module>(,<target-module>)*\n aggiorna <module> per esportare <package> in <target-module>,\n indipendentemente dalla dichiarazione del modulo.\n <target-module> pu\u00F2 essere ALL-UNNAMED per esportare tutti i\n moduli senza nome.\n --disable-@files disabilita l''ulteriore espansione del file di argomenti\n -patch-module <module>=<file>({0}<file>)*\n sostituisce o migliora un modulo con classi e risorse\n in file JAR o directory\n\nQueste opzioni non sono opzioni standard e sono soggette a modifiche senza preavviso.\n
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves
java.launcher.X.macosx.usage=\nLe opzioni riportate di seguito sono specifiche del sistema operativo Mac OS X:\n -XstartOnFirstThread\n Esegue il metodo main() sul primo thread (AppKit).\n -Xdock:name=<nome applicazione>\n Sostituisce il nome applicazione predefinito visualizzato nel dock\n -Xdock:icon=<percorso file icona>\n Sostituisce l'icona predefinita visualizzata nel dock\n\n java.launcher.X.macosx.usage=\nLe opzioni riportate di seguito sono specifiche del sistema operativo Mac OS X:\n -XstartOnFirstThread\n Esegue il metodo main() sul primo thread (AppKit).\n -Xdock:name=<nome applicazione>\n Sostituisce il nome applicazione predefinito visualizzato nel dock\n -Xdock:icon=<percorso file icona>\n Sostituisce l'icona predefinita visualizzata nel dock\n\n

View file

@ -39,8 +39,8 @@ java.launcher.opt.footer =\ -cp <\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u30
See \u8A73\u7D30\u306F\u3001http://www.oracle.com/technetwork/java/javase/documentation/index.html\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002 See \u8A73\u7D30\u306F\u3001http://www.oracle.com/technetwork/java/javase/documentation/index.html\u3092\u53C2\u7167\u3057\u3066\u304F\u3060\u3055\u3044\u3002
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xbatch \u30D0\u30C3\u30AF\u30B0\u30E9\u30A6\u30F3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xbootclasspath/a:<{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB>\n \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u6700\u5F8C\u306B\u8FFD\u52A0\u3059\u308B\n -Xcheck:jni JNI\u95A2\u6570\u306B\u5BFE\u3059\u308B\u8FFD\u52A0\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5B9F\u884C\u3059\u308B\n -Xcomp \u521D\u56DE\u547C\u51FA\u3057\u6642\u306B\u30E1\u30BD\u30C3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u5F37\u5236\u3059\u308B\n -Xdebug \u4E0B\u4F4D\u4E92\u63DB\u6027\u306E\u305F\u3081\u306B\u63D0\u4F9B\n -Xdiag \u8FFD\u52A0\u306E\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n -Xdiag:resolver \u30EA\u30BE\u30EB\u30D0\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n -Xdisable-@files \u3055\u3089\u306A\u308B\u5F15\u6570\u30D5\u30A1\u30A4\u30EB\u62E1\u5F35\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xfuture \u5C06\u6765\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u898B\u8D8A\u3057\u3066\u3001\u6700\u3082\u53B3\u5BC6\u306A\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u306B\u3059\u308B\n -Xint \u30A4\u30F3\u30BF\u30D7\u30EA\u30BF\u30FB\u30E2\u30FC\u30C9\u306E\u5B9F\u884C\u306E\u307F\n -Xinternalversion\n -version\u30AA\u30D7\u30B7\u30E7\u30F3\u3088\u308A\u8A73\u7D30\u306AJVM\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\n \u8868\u793A\u3059\u308B\n -Xloggc:<file> \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u304C\u4ED8\u3044\u305F\u30D5\u30A1\u30A4\u30EB\u306BGC\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u30ED\u30B0\u3092\u8A18\u9332\u3059\u308B\n -Xmixed \u6DF7\u5408\u30E2\u30FC\u30C9\u306E\u5B9F\u884C(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -Xmn<size> \u82E5\u3044\u4E16\u4EE3(\u30CA\u30FC\u30B5\u30EA)\u306E\u30D2\u30FC\u30D7\u306E\u521D\u671F\u304A\u3088\u3073\u6700\u5927\u30B5\u30A4\u30BA(\u30D0\u30A4\u30C8\u5358\u4F4D)\n \u3092\u8A2D\u5B9A\u3059\u308B\n -Xms<size> Java\u306E\u521D\u671F\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xmx<size> Java\u306E\u6700\u5927\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xnoclassgc \u30AF\u30E9\u30B9\u306E\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xprof CPU\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u30FB\u30C7\u30FC\u30BF\u3092\u51FA\u529B\u3059\u308B\n -Xrs Java/VM\u306B\u3088\u308BOS\u30B7\u30B0\u30CA\u30EB\u306E\u4F7F\u7528\u3092\u524A\u6E1B\u3059\u308B(\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167)\n -Xshare:auto \u53EF\u80FD\u3067\u3042\u308C\u3070\u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -Xshare:off \u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u306A\u3044\n -Xshare:on \u5171\u6709\u30AF\u30E9\u30B9\u30FB\u30C7\u30FC\u30BF\u306E\u4F7F\u7528\u3092\u5FC5\u9808\u306B\u3057\u3001\u3067\u304D\u306A\u3051\u308C\u3070\u5931\u6557\u3059\u308B\u3002\n -XshowSettings \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:all\n \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:locale\n \u3059\u3079\u3066\u306E\u30ED\u30B1\u30FC\u30EB\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:properties\n \ java.launcher.X.usage=\ -Xbatch \u30D0\u30C3\u30AF\u30B0\u30E9\u30A6\u30F3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xbootclasspath/a:<{0}\u3067\u533A\u5207\u3089\u308C\u305F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u304A\u3088\u3073zip/jar\u30D5\u30A1\u30A4\u30EB>\n \u30D6\u30FC\u30C8\u30B9\u30C8\u30E9\u30C3\u30D7\u30FB\u30AF\u30E9\u30B9\u30FB\u30D1\u30B9\u306E\u6700\u5F8C\u306B\u8FFD\u52A0\u3059\u308B\n -Xcheck:jni JNI\u95A2\u6570\u306B\u5BFE\u3059\u308B\u8FFD\u52A0\u306E\u30C1\u30A7\u30C3\u30AF\u3092\u5B9F\u884C\u3059\u308B\n -Xcomp \u521D\u56DE\u547C\u51FA\u3057\u6642\u306B\u30E1\u30BD\u30C3\u30C9\u306E\u30B3\u30F3\u30D1\u30A4\u30EB\u3092\u5F37\u5236\u3059\u308B\n -Xdebug \u4E0B\u4F4D\u4E92\u63DB\u6027\u306E\u305F\u3081\u306B\u63D0\u4F9B\n -Xdiag \u8FFD\u52A0\u306E\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n -Xdiag:resolver \u30EA\u30BE\u30EB\u30D0\u8A3A\u65AD\u30E1\u30C3\u30BB\u30FC\u30B8\u3092\u8868\u793A\u3059\u308B\n -Xfuture \u5C06\u6765\u306E\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u898B\u8D8A\u3057\u3066\u3001\u6700\u3082\u53B3\u5BC6\u306A\u30C1\u30A7\u30C3\u30AF\u3092\u6709\u52B9\u306B\u3059\u308B\n -Xint \u30A4\u30F3\u30BF\u30D7\u30EA\u30BF\u30FB\u30E2\u30FC\u30C9\u306E\u5B9F\u884C\u306E\u307F\n -Xinternalversion\n -version\u30AA\u30D7\u30B7\u30E7\u30F3\u3088\u308A\u8A73\u7D30\u306AJVM\u30D0\u30FC\u30B8\u30E7\u30F3\u60C5\u5831\u3092\n \u8868\u793A\u3059\u308B\n -Xloggc:<file> \u30BF\u30A4\u30E0\u30B9\u30BF\u30F3\u30D7\u304C\u4ED8\u3044\u305F\u30D5\u30A1\u30A4\u30EB\u306BGC\u30B9\u30C6\u30FC\u30BF\u30B9\u306E\u30ED\u30B0\u3092\u8A18\u9332\u3059\u308B\n -Xmixed \u6DF7\u5408\u30E2\u30FC\u30C9\u306E\u5B9F\u884C(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -Xmn<size> \u82E5\u3044\u4E16\u4EE3(\u30CA\u30FC\u30B5\u30EA)\u306E\u30D2\u30FC\u30D7\u306E\u521D\u671F\u304A\u3088\u3073\u6700\u5927\u30B5\u30A4\u30BA(\u30D0\u30A4\u30C8\u5358\u4F4D)\n \u3092\u8A2D\u5B9A\u3059\u308B\n -Xms<size> Java\u306E\u521D\u671F\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xmx<size> Java\u306E\u6700\u5927\u30D2\u30FC\u30D7\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xnoclassgc \u30AF\u30E9\u30B9\u306E\u30AC\u30D9\u30FC\u30B8\u30FB\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3092\u7121\u52B9\u306B\u3059\u308B\n -Xprof CPU\u30D7\u30ED\u30D5\u30A1\u30A4\u30EB\u30FB\u30C7\u30FC\u30BF\u3092\u51FA\u529B\u3059\u308B\n -Xrs Java/VM\u306B\u3088\u308BOS\u30B7\u30B0\u30CA\u30EB\u306E\u4F7F\u7528\u3092\u524A\u6E1B\u3059\u308B(\u30C9\u30AD\u30E5\u30E1\u30F3\u30C8\u3092\u53C2\u7167)\n -Xshare:auto \u53EF\u80FD\u3067\u3042\u308C\u3070\u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3059\u308B(\u30C7\u30D5\u30A9\u30EB\u30C8)\n -Xshare:off \u5171\u6709\u30AF\u30E9\u30B9\u306E\u30C7\u30FC\u30BF\u3092\u4F7F\u7528\u3057\u3088\u3046\u3068\u3057\u306A\u3044\n -Xshare:on \u5171\u6709\u30AF\u30E9\u30B9\u30FB\u30C7\u30FC\u30BF\u306E\u4F7F\u7528\u3092\u5FC5\u9808\u306B\u3057\u3001\u3067\u304D\u306A\u3051\u308C\u3070\u5931\u6557\u3059\u308B\u3002\n -XshowSettings \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:all\n \u3059\u3079\u3066\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:locale\n \u3059\u3079\u3066\u306E\u30ED\u30B1\u30FC\u30EB\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:properties\n \
\u3059\u3079\u3066\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:vm \u3059\u3079\u3066\u306EVM\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -Xss<size> Java\u306E\u30B9\u30EC\u30C3\u30C9\u30FB\u30B9\u30BF\u30C3\u30AF\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xverify \u30D0\u30A4\u30C8\u30B3\u30FC\u30C9\u691C\u8A3C\u6A5F\u80FD\u306E\u30E2\u30FC\u30C9\u3092\u8A2D\u5B9A\u3059\u308B\n --add-reads <module>=<target-module>(,<target-module>)*\n \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001<module>\u3092\u66F4\u65B0\u3057\u3066<target-module>\n \u3092\u8AAD\u307F\u53D6\u308A\u307E\u3059\u3002 \n <target-module>\u3092ALL-UNNAMED\u306B\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u3059\u3079\u3066\u306E\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\n \u8AAD\u307F\u53D6\u308C\u307E\u3059\u3002\n --add-exports <module>/<package>=<target-module>(,<target-module>)*\n \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001<module>\u3092\u66F4\u65B0\u3057\u3066<package>\u3092<target-module>\u306B\n \u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3057\u307E\u3059\u3002\n <target-module>\u3092ALL-UNNAMED\u306B\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u3059\u3079\u3066\u306E\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\n \u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3067\u304D\u307E\u3059\u3002\n --patch-module <module>=<file>({0}<file>)*\n JAR\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30EA\u30BD\u30FC\u30B9\u3067\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u307E\u305F\u306F\n \u62E1\u5F35\u3057\u307E\u3059\u3002\n\n\u3053\u308C\u3089\u306F\u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3042\u308A\u4E88\u544A\u306A\u3057\u306B\u5909\u66F4\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002\n \u3059\u3079\u3066\u306E\u30D7\u30ED\u30D1\u30C6\u30A3\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -XshowSettings:vm \u3059\u3079\u3066\u306EVM\u95A2\u9023\u306E\u8A2D\u5B9A\u3092\u8868\u793A\u3057\u3066\u7D9A\u884C\u3059\u308B\n -Xss<size> Java\u306E\u30B9\u30EC\u30C3\u30C9\u30FB\u30B9\u30BF\u30C3\u30AF\u30FB\u30B5\u30A4\u30BA\u3092\u8A2D\u5B9A\u3059\u308B\n -Xverify \u30D0\u30A4\u30C8\u30B3\u30FC\u30C9\u691C\u8A3C\u6A5F\u80FD\u306E\u30E2\u30FC\u30C9\u3092\u8A2D\u5B9A\u3059\u308B\n --add-reads <module>=<target-module>(,<target-module>)*\n \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001<module>\u3092\u66F4\u65B0\u3057\u3066<target-module>\n \u3092\u8AAD\u307F\u53D6\u308A\u307E\u3059\u3002 \n <target-module>\u3092ALL-UNNAMED\u306B\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u3059\u3079\u3066\u306E\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\n \u8AAD\u307F\u53D6\u308C\u307E\u3059\u3002\n --add-exports <module>/<package>=<target-module>(,<target-module>)*\n \u30E2\u30B8\u30E5\u30FC\u30EB\u5BA3\u8A00\u306B\u95A2\u4FC2\u306A\u304F\u3001<module>\u3092\u66F4\u65B0\u3057\u3066<package>\u3092<target-module>\u306B\n \u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3057\u307E\u3059\u3002\n <target-module>\u3092ALL-UNNAMED\u306B\u8A2D\u5B9A\u3059\u308B\u3068\u3001\u3059\u3079\u3066\u306E\u540D\u524D\u306E\u306A\u3044\u30E2\u30B8\u30E5\u30FC\u30EB\u306B\n \u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u3067\u304D\u307E\u3059\u3002\n --disable-@files \u3055\u3089\u306A\u308B\u5F15\u6570\u30D5\u30A1\u30A4\u30EB\u62E1\u5F35\u3092\u7121\u52B9\u306B\u3059\u308B\n --patch-module <module>=<file>({0}<file>)*\n JAR\u30D5\u30A1\u30A4\u30EB\u307E\u305F\u306F\u30C7\u30A3\u30EC\u30AF\u30C8\u30EA\u306E\u30AF\u30E9\u30B9\u304A\u3088\u3073\u30EA\u30BD\u30FC\u30B9\u3067\u30E2\u30B8\u30E5\u30FC\u30EB\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u307E\u305F\u306F\n \u62E1\u5F35\u3057\u307E\u3059\u3002\n\n\u3053\u308C\u3089\u306F\u975E\u6A19\u6E96\u30AA\u30D7\u30B7\u30E7\u30F3\u3067\u3042\u308A\u4E88\u544A\u306A\u3057\u306B\u5909\u66F4\u3055\u308C\u308B\u3053\u3068\u304C\u3042\u308A\u307E\u3059\u3002\n
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves
java.launcher.X.macosx.usage=\n\u6B21\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306FMac OS X\u56FA\u6709\u3067\u3059:\n -XstartOnFirstThread\n main()\u30E1\u30BD\u30C3\u30C9\u3092\u6700\u521D(AppKit)\u306E\u30B9\u30EC\u30C3\u30C9\u3067\u5B9F\u884C\u3059\u308B\n -Xdock:name=<application name>\n Dock\u306B\u8868\u793A\u3055\u308C\u308B\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n -Xdock:icon=<path to icon file>\n Dock\u306B\u8868\u793A\u3055\u308C\u308B\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n\n java.launcher.X.macosx.usage=\n\u6B21\u306E\u30AA\u30D7\u30B7\u30E7\u30F3\u306FMac OS X\u56FA\u6709\u3067\u3059:\n -XstartOnFirstThread\n main()\u30E1\u30BD\u30C3\u30C9\u3092\u6700\u521D(AppKit)\u306E\u30B9\u30EC\u30C3\u30C9\u3067\u5B9F\u884C\u3059\u308B\n -Xdock:name=<application name>\n Dock\u306B\u8868\u793A\u3055\u308C\u308B\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30D7\u30EA\u30B1\u30FC\u30B7\u30E7\u30F3\u540D\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n -Xdock:icon=<path to icon file>\n Dock\u306B\u8868\u793A\u3055\u308C\u308B\u30C7\u30D5\u30A9\u30EB\u30C8\u30FB\u30A2\u30A4\u30B3\u30F3\u3092\u30AA\u30FC\u30D0\u30FC\u30E9\u30A4\u30C9\u3059\u308B\n\n

View file

@ -39,8 +39,8 @@ java.launcher.opt.footer =\ -cp <\uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar
See \uC790\uC138\uD55C \uB0B4\uC6A9\uC740 http://www.oracle.com/technetwork/java/javase/documentation/index.html\uC744 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624. See \uC790\uC138\uD55C \uB0B4\uC6A9\uC740 http://www.oracle.com/technetwork/java/javase/documentation/index.html\uC744 \uCC38\uC870\uD558\uC2ED\uC2DC\uC624.
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xbatch \uBC31\uADF8\uB77C\uC6B4\uB4DC \uCEF4\uD30C\uC77C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xbootclasspath/a:<{0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C>\n \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uACBD\uB85C \uB05D\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4.\n -Xcheck:jni JNI \uD568\uC218\uC5D0 \uB300\uD55C \uCD94\uAC00 \uAC80\uC0AC\uB97C \uC218\uD589\uD569\uB2C8\uB2E4.\n -Xcomp \uCCAB\uBC88\uC9F8 \uD638\uCD9C\uC5D0\uC11C \uBA54\uC18C\uB4DC \uCEF4\uD30C\uC77C\uC744 \uAC15\uC81C\uD569\uB2C8\uB2E4.\n -Xdebug \uC5ED \uD638\uD658\uC131\uC744 \uC704\uD574 \uC81C\uACF5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n -Xdiag \uCD94\uAC00 \uC9C4\uB2E8 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n -Xdiag:resolver \uBD84\uC11D\uAE30 \uC9C4\uB2E8 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n -Xdisable-@files \uCD94\uAC00 \uC778\uC218 \uD30C\uC77C \uD655\uC7A5\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xfuture \uBBF8\uB798 \uAE30\uBCF8\uAC12\uC744 \uC608\uCE21\uD558\uC5EC \uAC00\uC7A5 \uC5C4\uACA9\uD55C \uAC80\uC0AC\uB97C \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xint \uD574\uC11D\uB41C \uBAA8\uB4DC\uB9CC \uC2E4\uD589\uD569\uB2C8\uB2E4.\n -Xinternalversion\n -version \uC635\uC158\uBCF4\uB2E4 \uC0C1\uC138\uD55C JVM \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n -Xloggc:<file> \uC2DC\uAC04 \uAE30\uB85D\uACFC \uD568\uAED8 \uD30C\uC77C\uC5D0 GC \uC0C1\uD0DC\uB97C \uAE30\uB85D\uD569\uB2C8\uB2E4.\n -Xmixed \uD63C\uD569 \uBAA8\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n -Xmn<size> \uC80A\uC740 \uC138\uB300(Nursery)\uB97C \uC704\uD574 \uD799\uC758 \uCD08\uAE30 \uBC0F \uCD5C\uB300\n \uD06C\uAE30(\uBC14\uC774\uD2B8)\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xms<size> \uCD08\uAE30 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xmx<size> \uCD5C\uB300 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xnoclassgc \uD074\uB798\uC2A4\uC758 \uBD88\uD544\uC694\uD55C \uC815\uBCF4 \uBAA8\uC74C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xprof CPU \uD504\uB85C\uD30C\uC77C \uC791\uC131 \uB370\uC774\uD130\uB97C \uCD9C\uB825\uD569\uB2C8\uB2E4.\n -Xrs Java/VM\uC5D0 \uC758\uD55C OS \uC2E0\uD638 \uC0AC\uC6A9\uC744 \uC904\uC785\uB2C8\uB2E4(\uC124\uBA85\uC11C \uCC38\uC870).\n -Xshare:auto \uAC00\uB2A5\uD55C \uACBD\uC6B0 \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n -Xshare:off \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130 \uC0AC\uC6A9\uC744 \uC2DC\uB3C4\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n -Xshare:on \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4. \uADF8\uB807\uC9C0 \uC54A\uC744 \uACBD\uC6B0 \uC2E4\uD328\uD569\uB2C8\uB2E4.\n -XshowSettings \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:all\n \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:locale\n \uBAA8\uB4E0 \uB85C\uCF00\uC77C \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:properties\n \uBAA8\uB4E0 \uC18D\uC131 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:vm \uBAA8\uB4E0 VM \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -Xss<size> Java \uC2A4\uB808\uB4DC \uC2A4\uD0DD \ java.launcher.X.usage=\ -Xbatch \uBC31\uADF8\uB77C\uC6B4\uB4DC \uCEF4\uD30C\uC77C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xbootclasspath/a:<{0}(\uC73C)\uB85C \uAD6C\uBD84\uB41C \uB514\uB809\uD1A0\uB9AC \uBC0F zip/jar \uD30C\uC77C>\n \uBD80\uD2B8\uC2A4\uD2B8\uB7A9 \uD074\uB798\uC2A4 \uACBD\uB85C \uB05D\uC5D0 \uCD94\uAC00\uD569\uB2C8\uB2E4.\n -Xcheck:jni JNI \uD568\uC218\uC5D0 \uB300\uD55C \uCD94\uAC00 \uAC80\uC0AC\uB97C \uC218\uD589\uD569\uB2C8\uB2E4.\n -Xcomp \uCCAB\uBC88\uC9F8 \uD638\uCD9C\uC5D0\uC11C \uBA54\uC18C\uB4DC \uCEF4\uD30C\uC77C\uC744 \uAC15\uC81C\uD569\uB2C8\uB2E4.\n -Xdebug \uC5ED \uD638\uD658\uC131\uC744 \uC704\uD574 \uC81C\uACF5\uB418\uC5C8\uC2B5\uB2C8\uB2E4.\n -Xdiag \uCD94\uAC00 \uC9C4\uB2E8 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n -Xdiag:resolver \uBD84\uC11D\uAE30 \uC9C4\uB2E8 \uBA54\uC2DC\uC9C0\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n -Xfuture \uBBF8\uB798 \uAE30\uBCF8\uAC12\uC744 \uC608\uCE21\uD558\uC5EC \uAC00\uC7A5 \uC5C4\uACA9\uD55C \uAC80\uC0AC\uB97C \uC0AC\uC6A9\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xint \uD574\uC11D\uB41C \uBAA8\uB4DC\uB9CC \uC2E4\uD589\uD569\uB2C8\uB2E4.\n -Xinternalversion\n -version \uC635\uC158\uBCF4\uB2E4 \uC0C1\uC138\uD55C JVM \uBC84\uC804 \uC815\uBCF4\uB97C \uD45C\uC2DC\uD569\uB2C8\uB2E4.\n -Xloggc:<file> \uC2DC\uAC04 \uAE30\uB85D\uACFC \uD568\uAED8 \uD30C\uC77C\uC5D0 GC \uC0C1\uD0DC\uB97C \uAE30\uB85D\uD569\uB2C8\uB2E4.\n -Xmixed \uD63C\uD569 \uBAA8\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n -Xmn<size> \uC80A\uC740 \uC138\uB300(Nursery)\uB97C \uC704\uD574 \uD799\uC758 \uCD08\uAE30 \uBC0F \uCD5C\uB300\n \uD06C\uAE30(\uBC14\uC774\uD2B8)\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xms<size> \uCD08\uAE30 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xmx<size> \uCD5C\uB300 Java \uD799 \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xnoclassgc \uD074\uB798\uC2A4\uC758 \uBD88\uD544\uC694\uD55C \uC815\uBCF4 \uBAA8\uC74C\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xprof CPU \uD504\uB85C\uD30C\uC77C \uC791\uC131 \uB370\uC774\uD130\uB97C \uCD9C\uB825\uD569\uB2C8\uB2E4.\n -Xrs Java/VM\uC5D0 \uC758\uD55C OS \uC2E0\uD638 \uC0AC\uC6A9\uC744 \uC904\uC785\uB2C8\uB2E4(\uC124\uBA85\uC11C \uCC38\uC870).\n -Xshare:auto \uAC00\uB2A5\uD55C \uACBD\uC6B0 \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD569\uB2C8\uB2E4(\uAE30\uBCF8\uAC12).\n -Xshare:off \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130 \uC0AC\uC6A9\uC744 \uC2DC\uB3C4\uD558\uC9C0 \uC54A\uC2B5\uB2C8\uB2E4.\n -Xshare:on \uACF5\uC720 \uD074\uB798\uC2A4 \uB370\uC774\uD130\uB97C \uC0AC\uC6A9\uD574\uC57C \uD569\uB2C8\uB2E4. \uADF8\uB807\uC9C0 \uC54A\uC744 \uACBD\uC6B0 \uC2E4\uD328\uD569\uB2C8\uB2E4.\n -XshowSettings \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:all\n \uBAA8\uB4E0 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:locale\n \uBAA8\uB4E0 \uB85C\uCF00\uC77C \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:properties\n \uBAA8\uB4E0 \uC18D\uC131 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -XshowSettings:vm \uBAA8\uB4E0 VM \uAD00\uB828 \uC124\uC815\uC744 \uD45C\uC2DC\uD55C \uD6C4 \uACC4\uC18D\uD569\uB2C8\uB2E4.\n -Xss<size> Java \uC2A4\uB808\uB4DC \uC2A4\uD0DD \
\uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xverify \uBC14\uC774\uD2B8\uCF54\uB4DC \uAC80\uC99D\uC790\uC758 \uBAA8\uB4DC\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n --add-reads <module>=<target-module>(,<target-module>)*\n \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774 <target-module>\uC744 \uC77D\uB3C4\uB85D\n <module>\uC744 \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n <target-module>\uC740 \uC774\uB984\uC774 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uBAA8\uB4E0 \uBAA8\uB4C8\uC744 \uC77D\uC744 \uC218 \uC788\uB294\n ALL-UNNAMED\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n --add-exports <module>/<package>=<target-module>(,<target-module>)*\n \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774 <package>\uB97C <target-module>\uB85C \uC775\uC2A4\uD3EC\uD2B8\uD558\uB3C4\uB85D\n <module>\uC744 \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n <target-module>\uC740 \uC774\uB984\uC774 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uBAA8\uB4E0 \uBAA8\uB4C8\uB85C \uC775\uC2A4\uD3EC\uD2B8\uD560 \uC218 \uC788\uB294\n ALL-UNNAMED\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n --patch-module <module>=<file>({0}<file>)*\n JAR \uD30C\uC77C/\uB514\uB809\uD1A0\uB9AC\uC758 \uD074\uB798\uC2A4\uC640 \uB9AC\uC18C\uC2A4\uB85C\n \uBAA8\uB4C8\uC744 \uBB34\uD6A8\uD654\uD558\uAC70\uB098 \uC778\uC218\uD654\uD569\uB2C8\uB2E4.\n\n\uC774 \uC635\uC158\uC740 \uBE44\uD45C\uC900 \uC635\uC158\uC774\uBBC0\uB85C \uD1B5\uC9C0 \uC5C6\uC774 \uBCC0\uACBD\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n \uD06C\uAE30\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n -Xverify \uBC14\uC774\uD2B8\uCF54\uB4DC \uAC80\uC99D\uC790\uC758 \uBAA8\uB4DC\uB97C \uC124\uC815\uD569\uB2C8\uB2E4.\n --add-reads <module>=<target-module>(,<target-module>)*\n \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774 <target-module>\uC744 \uC77D\uB3C4\uB85D\n <module>\uC744 \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n <target-module>\uC740 \uC774\uB984\uC774 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uBAA8\uB4E0 \uBAA8\uB4C8\uC744 \uC77D\uC744 \uC218 \uC788\uB294\n ALL-UNNAMED\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n --add-exports <module>/<package>=<target-module>(,<target-module>)*\n \uBAA8\uB4C8 \uC120\uC5B8\uC5D0 \uAD00\uACC4\uC5C6\uC774 <package>\uB97C <target-module>\uB85C \uC775\uC2A4\uD3EC\uD2B8\uD558\uB3C4\uB85D\n <module>\uC744 \uC5C5\uB370\uC774\uD2B8\uD569\uB2C8\uB2E4.\n <target-module>\uC740 \uC774\uB984\uC774 \uC9C0\uC815\uB418\uC9C0 \uC54A\uC740 \uBAA8\uB4E0 \uBAA8\uB4C8\uB85C \uC775\uC2A4\uD3EC\uD2B8\uD560 \uC218 \uC788\uB294\n ALL-UNNAMED\uC77C \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n --disable-@files \uCD94\uAC00 \uC778\uC218 \uD30C\uC77C \uD655\uC7A5\uC744 \uC0AC\uC6A9 \uC548\uD568\uC73C\uB85C \uC124\uC815\uD569\uB2C8\uB2E4.\n --patch-module <module>=<file>({0}<file>)*\n JAR \uD30C\uC77C/\uB514\uB809\uD1A0\uB9AC\uC758 \uD074\uB798\uC2A4\uC640 \uB9AC\uC18C\uC2A4\uB85C\n \uBAA8\uB4C8\uC744 \uBB34\uD6A8\uD654\uD558\uAC70\uB098 \uC778\uC218\uD654\uD569\uB2C8\uB2E4.\n\n\uC774 \uC635\uC158\uC740 \uBE44\uD45C\uC900 \uC635\uC158\uC774\uBBC0\uB85C \uD1B5\uC9C0 \uC5C6\uC774 \uBCC0\uACBD\uB420 \uC218 \uC788\uC2B5\uB2C8\uB2E4.\n
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves
java.launcher.X.macosx.usage=\n\uB2E4\uC74C\uC740 Mac OS X\uC5D0 \uD2B9\uC815\uB41C \uC635\uC158\uC785\uB2C8\uB2E4.\n -XstartOnFirstThread\n \uCCAB\uBC88\uC9F8 (AppKit) \uC2A4\uB808\uB4DC\uC5D0 main() \uBA54\uC18C\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4.\n -Xdock:name=<application name>\n \uACE0\uC815\uC73C\uB85C \uD45C\uC2DC\uB41C \uAE30\uBCF8 \uC560\uD50C\uB9AC\uCF00\uC774\uC158 \uC774\uB984\uC744 \uBB34\uD6A8\uD654\uD569\uB2C8\uB2E4.\n -Xdock:icon=<path to icon file>\n \uACE0\uC815\uC73C\uB85C \uD45C\uC2DC\uB41C \uAE30\uBCF8 \uC544\uC774\uCF58\uC744 \uBB34\uD6A8\uD654\uD569\uB2C8\uB2E4.\n\n java.launcher.X.macosx.usage=\n\uB2E4\uC74C\uC740 Mac OS X\uC5D0 \uD2B9\uC815\uB41C \uC635\uC158\uC785\uB2C8\uB2E4.\n -XstartOnFirstThread\n \uCCAB\uBC88\uC9F8 (AppKit) \uC2A4\uB808\uB4DC\uC5D0 main() \uBA54\uC18C\uB4DC\uB97C \uC2E4\uD589\uD569\uB2C8\uB2E4.\n -Xdock:name=<application name>\n \uACE0\uC815\uC73C\uB85C \uD45C\uC2DC\uB41C \uAE30\uBCF8 \uC560\uD50C\uB9AC\uCF00\uC774\uC158 \uC774\uB984\uC744 \uBB34\uD6A8\uD654\uD569\uB2C8\uB2E4.\n -Xdock:icon=<path to icon file>\n \uACE0\uC815\uC73C\uB85C \uD45C\uC2DC\uB41C \uAE30\uBCF8 \uC544\uC774\uCF58\uC744 \uBB34\uD6A8\uD654\uD569\uB2C8\uB2E4.\n\n

View file

@ -39,7 +39,7 @@ informa\u00E7\u00F5es.\n @<filepath> op\u00E7\u00F5es de leitura do arquivo
See http://www.oracle.com/technetwork/java/javase/documentation/index.html para obter mais detalhes. See http://www.oracle.com/technetwork/java/javase/documentation/index.html para obter mais detalhes.
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xbatch desativar compila\u00E7\u00E3o em segundo plano\n -Xbootclasspath/a:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n anexar ao final do caminho de classe bootstrap\n -Xcheck:jni executar verifica\u00E7\u00F5es adicionais de fun\u00E7\u00F5es JNI\n -Xcomp for\u00E7a a compila\u00E7\u00E3o de m\u00E9todos na primeira chamada\n -Xdebug fornecido para fins de compatibilidade reversa\n -Xdiag mostrar mensagens de diagn\u00F3stico adicionais\n -Xdiag:resolver mostrar mensagens de diagn\u00F3stico do resolvedor\n -Xdisable-@files desativar expans\u00E3o de arquivo de argumento adicional\n -Xfuture ativar verifica\u00E7\u00F5es mais rigorosas, antecipando padr\u00E3o futuro\n -Xint somente execu\u00E7\u00E3o em modo interpretado\n -Xinternalversion\n exibe informa\u00E7\u00F5es mais detalhadas de vers\u00E3o da JVM do que a\n op\u00E7\u00E3o -version\n -Xloggc:<file> registrar status de GC em um arquivo com time-stamps\n -Xmixed execu\u00E7\u00E3o em modo misto (padr\u00E3o)\n -Xmn<size> define o tamanho inicial e m\u00E1ximo (em bytes) do heap\n para a gera\u00E7\u00E3o jovem (infantil)\n -Xms<size> definir tamanho do heap Java inicial\n -Xmx<size> definir tamanho do heap Java m\u00E1ximo\n -Xnoclassgc desativar coleta de lixo de classe\n -Xprof emitir dados de perfil de cpu\n -Xrs reduzir uso de sinais do SO por Java/VM (consultar documenta\u00E7\u00E3o)\n -Xshare:auto usar dados de classe compartilhados, se poss\u00EDvel (padr\u00E3o)\n -Xshare:off n\u00E3o tentar usar dados de classe compartilhados\n -Xshare:on exigir o uso de dados de classe compartilhados; caso contr\u00E1rio, falhar\u00E1.\n -XshowSettings mostrar todas as defini\u00E7\u00F5es e continuar\n -XshowSettings:all\n mostrar todas as defini\u00E7\u00F5es e continuar\n -XshowSettings:locale\n mostrar todas as defini\u00E7\u00F5es relativas a localidade e continuar\n -XshowSettings:properties\n mostrar todas as defini\u00E7\u00F5es de propriedade e continuar\n -XshowSettings:vm mostrar todas as defini\u00E7\u00F5es relativas a vm e continuar\n -Xss<size> definir tamanho de pilha de thread java\n -Xverify define o modo do verificador de c\u00F3digo de byte\n --add-reads <module>=<target-module>(,<target-module>)*\n atualiza <module> para ler <target-module>, independentemente\n da declara\u00E7\u00E3o do m\u00F3dulo. \n <target-module> pode ser ALL-UNNAMED para ler todos os m\u00F3dulos\n sem nome.\n --add-exports <module>/<package>=<target-module>(,<target-module>)*\n atualiza <module> para exportar <package> para <target-module>,\n independentemente da declara\u00E7\u00E3o do m\u00F3dulo.\n <target-module> pode ser ALL-UNNAMED para exportar para todos\n os m\u00F3dulos sem nome.\n --patch-module <module>=<file>({0}<file>)*\n Substituir ou aumentar um m\u00F3dulo com classes e recursos\n em arquivo JAR ou diret\u00F3rios.\n\nEssas op\u00E7\u00F5es n\u00E3o s\u00E3o padr\u00E3o e est\u00E3o sujeitas a altera\u00E7\u00E3o sem aviso.\n java.launcher.X.usage=\ -Xbatch desativar compila\u00E7\u00E3o em segundo plano\n -Xbootclasspath/a:<diret\u00F3rios e arquivos zip/jar separados por {0}>\n anexar ao final do caminho de classe bootstrap\n -Xcheck:jni executar verifica\u00E7\u00F5es adicionais de fun\u00E7\u00F5es JNI\n -Xcomp for\u00E7a a compila\u00E7\u00E3o de m\u00E9todos na primeira chamada\n -Xdebug fornecido para fins de compatibilidade reversa\n -Xdiag mostrar mensagens de diagn\u00F3stico adicionais\n -Xdiag:resolver mostrar mensagens de diagn\u00F3stico do resolvedor\n -Xfuture ativar verifica\u00E7\u00F5es mais rigorosas, antecipando padr\u00E3o futuro\n -Xint somente execu\u00E7\u00E3o em modo interpretado\n -Xinternalversion\n exibe informa\u00E7\u00F5es mais detalhadas de vers\u00E3o da JVM do que a\n op\u00E7\u00E3o -version\n -Xloggc:<file> registrar status de GC em um arquivo com time-stamps\n -Xmixed execu\u00E7\u00E3o em modo misto (padr\u00E3o)\n -Xmn<size> define o tamanho inicial e m\u00E1ximo (em bytes) do heap\n para a gera\u00E7\u00E3o jovem (infantil)\n -Xms<size> definir tamanho do heap Java inicial\n -Xmx<size> definir tamanho do heap Java m\u00E1ximo\n -Xnoclassgc desativar coleta de lixo de classe\n -Xprof emitir dados de perfil de cpu\n -Xrs reduzir uso de sinais do SO por Java/VM (consultar documenta\u00E7\u00E3o)\n -Xshare:auto usar dados de classe compartilhados, se poss\u00EDvel (padr\u00E3o)\n -Xshare:off n\u00E3o tentar usar dados de classe compartilhados\n -Xshare:on exigir o uso de dados de classe compartilhados; caso contr\u00E1rio, falhar\u00E1.\n -XshowSettings mostrar todas as defini\u00E7\u00F5es e continuar\n -XshowSettings:all\n mostrar todas as defini\u00E7\u00F5es e continuar\n -XshowSettings:locale\n mostrar todas as defini\u00E7\u00F5es relativas a localidade e continuar\n -XshowSettings:properties\n mostrar todas as defini\u00E7\u00F5es de propriedade e continuar\n -XshowSettings:vm mostrar todas as defini\u00E7\u00F5es relativas a vm e continuar\n -Xss<size> definir tamanho de pilha de thread java\n -Xverify define o modo do verificador de c\u00F3digo de byte\n --add-reads <module>=<target-module>(,<target-module>)*\n atualiza <module> para ler <target-module>, independentemente\n da declara\u00E7\u00E3o do m\u00F3dulo. \n <target-module> pode ser ALL-UNNAMED para ler todos os m\u00F3dulos\n sem nome.\n --add-exports <module>/<package>=<target-module>(,<target-module>)*\n atualiza <module> para exportar <package> para <target-module>,\n independentemente da declara\u00E7\u00E3o do m\u00F3dulo.\n <target-module> pode ser ALL-UNNAMED para exportar para todos\n os m\u00F3dulos sem nome.\n --disable-@files desativar expans\u00E3o de arquivo de argumento adicional\n --patch-module <module>=<file>({0}<file>)*\n Substituir ou aumentar um m\u00F3dulo com classes e recursos\n em arquivo JAR ou diret\u00F3rios.\n\nEssas op\u00E7\u00F5es n\u00E3o s\u00E3o padr\u00E3o e est\u00E3o sujeitas a altera\u00E7\u00E3o sem aviso.\n
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves
java.launcher.X.macosx.usage=\nAs op\u00E7\u00F5es a seguir s\u00E3o espec\u00EDficas para o Mac OS X:\n -XstartOnFirstThread\n executa o m\u00E9todo main() no primeiro thread (AppKit)\n -Xdock:name=<nome do aplicativo>\n substitui o nome do aplicativo padr\u00E3o exibido no encaixe\n -Xdock:icon=<caminho para o arquivo do \u00EDcone>\n substitui o \u00EDcone exibido no encaixe\n\n java.launcher.X.macosx.usage=\nAs op\u00E7\u00F5es a seguir s\u00E3o espec\u00EDficas para o Mac OS X:\n -XstartOnFirstThread\n executa o m\u00E9todo main() no primeiro thread (AppKit)\n -Xdock:name=<nome do aplicativo>\n substitui o nome do aplicativo padr\u00E3o exibido no encaixe\n -Xdock:icon=<caminho para o arquivo do \u00EDcone>\n substitui o \u00EDcone exibido no encaixe\n\n

View file

@ -39,7 +39,7 @@ ett l\u00E5ngt alternativ kan du anv\u00E4nda --<namn>=<v\u00E4rde>\neller --<na
See Se http://www.oracle.com/technetwork/java/javase/documentation/index.html f\u00F6r mer information. See Se http://www.oracle.com/technetwork/java/javase/documentation/index.html f\u00F6r mer information.
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xbatch avaktivera bakgrundskompilering\n -Xbootclasspath/a:<kataloger och zip-/jar-filer avgr\u00E4nsade med {0}>\n l\u00E4gg till sist i klass\u00F6kv\u00E4gen f\u00F6r programladdning\n -Xcheck:jni utf\u00F6r fler kontroller f\u00F6r JNI-funktioner\n -Xcomp tvingar kompilering av metoder vid det f\u00F6rsta anropet\n -Xdebug tillhandah\u00E5lls f\u00F6r bak\u00E5tkompatibilitet\n -Xdiag visa fler diagnostiska meddelanden\n -Xdiag:resolver visa diagnostiska meddelanden f\u00F6r matchning\n -Xdisable-@files avaktivera ytterligare argumentfilsut\u00F6kning\n -Xfuture aktivera str\u00E4ngaste kontroller, f\u00F6rv\u00E4ntad framtida standard\n -Xint endast exekvering i tolkat l\u00E4ge\n -Xinternalversion\n visar mer detaljerad information om JVM-version \u00E4n\n alternativet -version\n -Xloggc:<fil> logga GC-status till en fil med tidsst\u00E4mplar\n -Xmixed exekvering i blandat l\u00E4ge (standard)\n -Xmn<storlek> anger ursprunglig och maximal storlek (i byte) f\u00F6r h\u00F6gen f\u00F6r\n generationen med nyare objekt (h\u00F6gen f\u00F6r tilldelning av nya objekt)\n -Xms<storlek> ange ursprunglig storlek f\u00F6r Java-heap-utrymmet\n -Xmx<storlek> ange st\u00F6rsta storlek f\u00F6r Java-heap-utrymmet\n -Xnoclassgc avaktivera klasskr\u00E4pinsamling\n -Xprof utdata f\u00F6r processorprofilering\n -Xrs minska operativsystemssignalanv\u00E4ndning f\u00F6r Java/VM (se dokumentationen)\n -Xshare:auto anv\u00E4nd delade klassdata om m\u00F6jligt (standard)\n -Xshare:off f\u00F6rs\u00F6k inte anv\u00E4nda delade klassdata\n -Xshare:on kr\u00E4v anv\u00E4ndning av delade klassdata, utf\u00F6r inte i annat fall.\n -XshowSettings visa alla inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:all\n visa alla inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:locale\n visa alla spr\u00E5kkonventionsrelaterade inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:properties\n visa alla egenskapsinst\u00E4llningar och forts\u00E4tt\n -XshowSettings:vm visa alla vm-relaterade inst\u00E4llningar och forts\u00E4tt\n -Xss<storlek> ange storlek f\u00F6r java-tr\u00E5dsstacken\n -Xverify anger l\u00E4ge f\u00F6r bytekodverifieraren\n --add-reads <modul>=<m\u00E5lmodul>(,<m\u00E5lmodul>)*\n uppdaterar <modul> att l\u00E4sa <m\u00E5lmodul>, oavsett\n moduldeklarationen. \n <m\u00E5lmodul> kan vara ALL-UNNAMED f\u00F6r att l\u00E4sa alla\n ej namngivna moduler.\n --add-exports <modul>/<paket>=<m\u00E5lmodul>(,<m\u00E5lmodul>)*\n uppdaterar <modul> att exportera <paket> till <m\u00E5lmodul>,\n oavsett moduldeklarationen.\n <m\u00E5lmodul> kan vara ALL-UNNAMED f\u00F6r att exportera till alla\n ej namngivna moduler.\n --patch-module <modul>=<fil>({0}<fil>)*\n \u00C5sidos\u00E4tt eller ut\u00F6ka en modul med klasser och resurser\n i JAR-filer eller kataloger.\n\nDe h\u00E4r alternativen \u00E4r icke-standardalternativ och kan \u00E4ndras utan f\u00F6reg\u00E5ende meddelande.\n java.launcher.X.usage=\ -Xbatch avaktivera bakgrundskompilering\n -Xbootclasspath/a:<kataloger och zip-/jar-filer avgr\u00E4nsade med {0}>\n l\u00E4gg till sist i klass\u00F6kv\u00E4gen f\u00F6r programladdning\n -Xcheck:jni utf\u00F6r fler kontroller f\u00F6r JNI-funktioner\n -Xcomp tvingar kompilering av metoder vid det f\u00F6rsta anropet\n -Xdebug tillhandah\u00E5lls f\u00F6r bak\u00E5tkompatibilitet\n -Xdiag visa fler diagnostiska meddelanden\n -Xdiag:resolver visa diagnostiska meddelanden f\u00F6r matchning\n -Xfuture aktivera str\u00E4ngaste kontroller, f\u00F6rv\u00E4ntad framtida standard\n -Xint endast exekvering i tolkat l\u00E4ge\n -Xinternalversion\n visar mer detaljerad information om JVM-version \u00E4n\n alternativet -version\n -Xloggc:<fil> logga GC-status till en fil med tidsst\u00E4mplar\n -Xmixed exekvering i blandat l\u00E4ge (standard)\n -Xmn<storlek> anger ursprunglig och maximal storlek (i byte) f\u00F6r h\u00F6gen f\u00F6r\n generationen med nyare objekt (h\u00F6gen f\u00F6r tilldelning av nya objekt)\n -Xms<storlek> ange ursprunglig storlek f\u00F6r Java-heap-utrymmet\n -Xmx<storlek> ange st\u00F6rsta storlek f\u00F6r Java-heap-utrymmet\n -Xnoclassgc avaktivera klasskr\u00E4pinsamling\n -Xprof utdata f\u00F6r processorprofilering\n -Xrs minska operativsystemssignalanv\u00E4ndning f\u00F6r Java/VM (se dokumentationen)\n -Xshare:auto anv\u00E4nd delade klassdata om m\u00F6jligt (standard)\n -Xshare:off f\u00F6rs\u00F6k inte anv\u00E4nda delade klassdata\n -Xshare:on kr\u00E4v anv\u00E4ndning av delade klassdata, utf\u00F6r inte i annat fall.\n -XshowSettings visa alla inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:all\n visa alla inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:locale\n visa alla spr\u00E5kkonventionsrelaterade inst\u00E4llningar och forts\u00E4tt\n -XshowSettings:properties\n visa alla egenskapsinst\u00E4llningar och forts\u00E4tt\n -XshowSettings:vm visa alla vm-relaterade inst\u00E4llningar och forts\u00E4tt\n -Xss<storlek> ange storlek f\u00F6r java-tr\u00E5dsstacken\n -Xverify anger l\u00E4ge f\u00F6r bytekodverifieraren\n --add-reads <modul>=<m\u00E5lmodul>(,<m\u00E5lmodul>)*\n uppdaterar <modul> att l\u00E4sa <m\u00E5lmodul>, oavsett\n moduldeklarationen. \n <m\u00E5lmodul> kan vara ALL-UNNAMED f\u00F6r att l\u00E4sa alla\n ej namngivna moduler.\n --add-exports <modul>/<paket>=<m\u00E5lmodul>(,<m\u00E5lmodul>)*\n uppdaterar <modul> att exportera <paket> till <m\u00E5lmodul>,\n oavsett moduldeklarationen.\n <m\u00E5lmodul> kan vara ALL-UNNAMED f\u00F6r att exportera till alla\n ej namngivna moduler.\n --disable-@files avaktivera ytterligare argumentfilsut\u00F6kning\n --patch-module <modul>=<fil>({0}<fil>)*\n \u00C5sidos\u00E4tt eller ut\u00F6ka en modul med klasser och resurser\n i JAR-filer eller kataloger.\n\nDe h\u00E4r alternativen \u00E4r icke-standardalternativ och kan \u00E4ndras utan f\u00F6reg\u00E5ende meddelande.\n
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves
java.launcher.X.macosx.usage=\nF\u00F6ljande alternativ \u00E4r Mac OS X-specifika:\n -XstartOnFirstThread\n k\u00F6r main()-metoden p\u00E5 den f\u00F6rsta (AppKit)-tr\u00E5den\n -Xdock:name=<applikationsnamn>\n \u00E5sidos\u00E4tt det standardapplikationsnamn som visas i dockan\n -Xdock:icon=<s\u00F6kv\u00E4g till ikonfil>\n \u00E5sidos\u00E4tt den standardikon som visas i dockan\n\n java.launcher.X.macosx.usage=\nF\u00F6ljande alternativ \u00E4r Mac OS X-specifika:\n -XstartOnFirstThread\n k\u00F6r main()-metoden p\u00E5 den f\u00F6rsta (AppKit)-tr\u00E5den\n -Xdock:name=<applikationsnamn>\n \u00E5sidos\u00E4tt det standardapplikationsnamn som visas i dockan\n -Xdock:icon=<s\u00F6kv\u00E4g till ikonfil>\n \u00E5sidos\u00E4tt den standardikon som visas i dockan\n\n

View file

@ -39,7 +39,7 @@ Java \u7F16\u7A0B\u8BED\u8A00\u4EE3\u7406, \u8BF7\u53C2\u9605 java.lang.instrume
See \u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605 http://www.oracle.com/technetwork/java/javase/documentation/index.html\u3002 See \u6709\u5173\u8BE6\u7EC6\u4FE1\u606F, \u8BF7\u53C2\u9605 http://www.oracle.com/technetwork/java/javase/documentation/index.html\u3002
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xbatch \u7981\u7528\u540E\u53F0\u7F16\u8BD1\n -Xbootclasspath/a:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n \u9644\u52A0\u5728\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u672B\u5C3E\n -Xcheck:jni \u5BF9 JNI \u51FD\u6570\u6267\u884C\u5176\u4ED6\u68C0\u67E5\n -Xcomp \u5728\u9996\u6B21\u8C03\u7528\u65F6\u5F3A\u5236\u7F16\u8BD1\u65B9\u6CD5\n -Xdebug \u4E3A\u5B9E\u73B0\u5411\u540E\u517C\u5BB9\u800C\u63D0\u4F9B\n -Xdiag \u663E\u793A\u9644\u52A0\u8BCA\u65AD\u6D88\u606F\n -Xdiag:resolver \u663E\u793A\u89E3\u6790\u5668\u8BCA\u65AD\u6D88\u606F\n -Xdisable-@files \u7981\u6B62\u8FDB\u4E00\u6B65\u6269\u5C55\u53C2\u6570\u6587\u4EF6\n -Xfuture \u542F\u7528\u6700\u4E25\u683C\u7684\u68C0\u67E5, \u9884\u671F\u5C06\u6765\u7684\u9ED8\u8BA4\u503C\n -Xint \u4EC5\u89E3\u91CA\u6A21\u5F0F\u6267\u884C\n -Xinternalversion\n \u663E\u793A\u6BD4 -version \u9009\u9879\u66F4\u8BE6\u7EC6\u7684 JVM\n \u7248\u672C\u4FE1\u606F\n -Xloggc:<\u6587\u4EF6> \u5C06 GC \u72B6\u6001\u8BB0\u5F55\u5728\u6587\u4EF6\u4E2D (\u5E26\u65F6\u95F4\u6233)\n -Xmixed \u6DF7\u5408\u6A21\u5F0F\u6267\u884C (\u9ED8\u8BA4\u503C)\n -Xmn<\u5927\u5C0F> \u4E3A\u5E74\u8F7B\u4EE3 (\u65B0\u751F\u4EE3) \u8BBE\u7F6E\u521D\u59CB\u548C\u6700\u5927\u5806\u5927\u5C0F\n (\u4EE5\u5B57\u8282\u4E3A\u5355\u4F4D)\n -Xms<\u5927\u5C0F> \u8BBE\u7F6E\u521D\u59CB Java \u5806\u5927\u5C0F\n -Xmx<\u5927\u5C0F> \u8BBE\u7F6E\u6700\u5927 Java \u5806\u5927\u5C0F\n -Xnoclassgc \u7981\u7528\u7C7B\u5783\u573E\u6536\u96C6\n -Xprof \u8F93\u51FA cpu \u914D\u7F6E\u6587\u4EF6\u6570\u636E\n -Xrs \u51CF\u5C11 Java/VM \u5BF9\u64CD\u4F5C\u7CFB\u7EDF\u4FE1\u53F7\u7684\u4F7F\u7528 (\u8BF7\u53C2\u9605\u6587\u6863)\n -Xshare:auto \u5728\u53EF\u80FD\u7684\u60C5\u51B5\u4E0B\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E (\u9ED8\u8BA4\u503C)\n -Xshare:off \u4E0D\u5C1D\u8BD5\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E\n -Xshare:on \u8981\u6C42\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E, \u5426\u5219\u5C06\u5931\u8D25\u3002\n -XshowSettings \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:all\n \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:locale\n \u663E\u793A\u6240\u6709\u4E0E\u533A\u57DF\u8BBE\u7F6E\u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EEDe\n -XshowSettings:properties\n \u663E\u793A\u6240\u6709\u5C5E\u6027\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:vm \u663E\u793A\u6240\u6709\u4E0E vm \u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -Xss<\u5927\u5C0F> \u8BBE\u7F6E Java \u7EBF\u7A0B\u5806\u6808\u5927\u5C0F\n -Xverify \u8BBE\u7F6E\u5B57\u8282\u7801\u9A8C\u8BC1\u5668\u7684\u6A21\u5F0F\n --add-reads <\u6A21\u5757>=<\u76EE\u6807\u6A21\u5757>(,<\u76EE\u6807\u6A21\u5757>)*\n \u66F4\u65B0 <\u6A21\u5757> \u4EE5\u8BFB\u53D6 <\u76EE\u6807\u6A21\u5757>,\n \u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\u3002\n <\u76EE\u6807\u6A21\u5757> \u53EF\u4EE5\u662F ALL-UNNAMED \u4EE5\u8BFB\u53D6\u6240\u6709\u672A\u547D\u540D\n \u6A21\u5757\u3002\n --add-exports <\u6A21\u5757>/<\u7A0B\u5E8F\u5305>=<\u76EE\u6807\u6A21\u5757>(,<\u76EE\u6807\u6A21\u5757>)*\n \u66F4\u65B0 <\u6A21\u5757> \u4EE5\u5C06 <\u7A0B\u5E8F\u5305> \u5BFC\u51FA\u5230 <\u76EE\u6807\u6A21\u5757>,\n \u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\u3002\n <\u76EE\u6807\u6A21\u5757> \u53EF\u4EE5\u662F ALL-UNNAMED \u4EE5\u5BFC\u51FA\u6240\u6709\n \u672A\u547D\u540D\u6A21\u5757\u3002\n --patch-module \ java.launcher.X.usage=\ -Xbatch \u7981\u7528\u540E\u53F0\u7F16\u8BD1\n -Xbootclasspath/a:<\u7528 {0} \u5206\u9694\u7684\u76EE\u5F55\u548C zip/jar \u6587\u4EF6>\n \u9644\u52A0\u5728\u5F15\u5BFC\u7C7B\u8DEF\u5F84\u672B\u5C3E\n -Xcheck:jni \u5BF9 JNI \u51FD\u6570\u6267\u884C\u5176\u4ED6\u68C0\u67E5\n -Xcomp \u5728\u9996\u6B21\u8C03\u7528\u65F6\u5F3A\u5236\u7F16\u8BD1\u65B9\u6CD5\n -Xdebug \u4E3A\u5B9E\u73B0\u5411\u540E\u517C\u5BB9\u800C\u63D0\u4F9B\n -Xdiag \u663E\u793A\u9644\u52A0\u8BCA\u65AD\u6D88\u606F\n -Xdiag:resolver \u663E\u793A\u89E3\u6790\u5668\u8BCA\u65AD\u6D88\u606F\n -Xfuture \u542F\u7528\u6700\u4E25\u683C\u7684\u68C0\u67E5, \u9884\u671F\u5C06\u6765\u7684\u9ED8\u8BA4\u503C\n -Xint \u4EC5\u89E3\u91CA\u6A21\u5F0F\u6267\u884C\n -Xinternalversion\n \u663E\u793A\u6BD4 -version \u9009\u9879\u66F4\u8BE6\u7EC6\u7684 JVM\n \u7248\u672C\u4FE1\u606F\n -Xloggc:<\u6587\u4EF6> \u5C06 GC \u72B6\u6001\u8BB0\u5F55\u5728\u6587\u4EF6\u4E2D (\u5E26\u65F6\u95F4\u6233)\n -Xmixed \u6DF7\u5408\u6A21\u5F0F\u6267\u884C (\u9ED8\u8BA4\u503C)\n -Xmn<\u5927\u5C0F> \u4E3A\u5E74\u8F7B\u4EE3 (\u65B0\u751F\u4EE3) \u8BBE\u7F6E\u521D\u59CB\u548C\u6700\u5927\u5806\u5927\u5C0F\n (\u4EE5\u5B57\u8282\u4E3A\u5355\u4F4D)\n -Xms<\u5927\u5C0F> \u8BBE\u7F6E\u521D\u59CB Java \u5806\u5927\u5C0F\n -Xmx<\u5927\u5C0F> \u8BBE\u7F6E\u6700\u5927 Java \u5806\u5927\u5C0F\n -Xnoclassgc \u7981\u7528\u7C7B\u5783\u573E\u6536\u96C6\n -Xprof \u8F93\u51FA cpu \u914D\u7F6E\u6587\u4EF6\u6570\u636E\n -Xrs \u51CF\u5C11 Java/VM \u5BF9\u64CD\u4F5C\u7CFB\u7EDF\u4FE1\u53F7\u7684\u4F7F\u7528 (\u8BF7\u53C2\u9605\u6587\u6863)\n -Xshare:auto \u5728\u53EF\u80FD\u7684\u60C5\u51B5\u4E0B\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E (\u9ED8\u8BA4\u503C)\n -Xshare:off \u4E0D\u5C1D\u8BD5\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E\n -Xshare:on \u8981\u6C42\u4F7F\u7528\u5171\u4EAB\u7C7B\u6570\u636E, \u5426\u5219\u5C06\u5931\u8D25\u3002\n -XshowSettings \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:all\n \u663E\u793A\u6240\u6709\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:locale\n \u663E\u793A\u6240\u6709\u4E0E\u533A\u57DF\u8BBE\u7F6E\u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EEDe\n -XshowSettings:properties\n \u663E\u793A\u6240\u6709\u5C5E\u6027\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -XshowSettings:vm \u663E\u793A\u6240\u6709\u4E0E vm \u76F8\u5173\u7684\u8BBE\u7F6E\u5E76\u7EE7\u7EED\n -Xss<\u5927\u5C0F> \u8BBE\u7F6E Java \u7EBF\u7A0B\u5806\u6808\u5927\u5C0F\n -Xverify \u8BBE\u7F6E\u5B57\u8282\u7801\u9A8C\u8BC1\u5668\u7684\u6A21\u5F0F\n --add-reads <\u6A21\u5757>=<\u76EE\u6807\u6A21\u5757>(,<\u76EE\u6807\u6A21\u5757>)*\n \u66F4\u65B0 <\u6A21\u5757> \u4EE5\u8BFB\u53D6 <\u76EE\u6807\u6A21\u5757>,\n \u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\u3002\n <\u76EE\u6807\u6A21\u5757> \u53EF\u4EE5\u662F ALL-UNNAMED \u4EE5\u8BFB\u53D6\u6240\u6709\u672A\u547D\u540D\n \u6A21\u5757\u3002\n --add-exports <\u6A21\u5757>/<\u7A0B\u5E8F\u5305>=<\u76EE\u6807\u6A21\u5757>(,<\u76EE\u6807\u6A21\u5757>)*\n \u66F4\u65B0 <\u6A21\u5757> \u4EE5\u5C06 <\u7A0B\u5E8F\u5305> \u5BFC\u51FA\u5230 <\u76EE\u6807\u6A21\u5757>,\n \u800C\u65E0\u8BBA\u6A21\u5757\u58F0\u660E\u5982\u4F55\u3002\n <\u76EE\u6807\u6A21\u5757> \u53EF\u4EE5\u662F ALL-UNNAMED \u4EE5\u5BFC\u51FA\u6240\u6709\n \u672A\u547D\u540D\u6A21\u5757\u3002\n --disable-@files \u7981\u6B62\u8FDB\u4E00\u6B65\u6269\u5C55\u53C2\u6570\u6587\u4EF6\n --patch-module \
<\u6A21\u5757>=<\u6587\u4EF6>({0}<\u6587\u4EF6>)*\n \u4F7F\u7528 JAR \u6587\u4EF6\u6216\u76EE\u5F55\u4E2D\u7684\u7C7B\u548C\u8D44\u6E90\n \u8986\u76D6\u6216\u589E\u5F3A\u6A21\u5757\u3002\n\n\u8FD9\u4E9B\u9009\u9879\u662F\u975E\u6807\u51C6\u9009\u9879, \u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n <\u6A21\u5757>=<\u6587\u4EF6>({0}<\u6587\u4EF6>)*\n \u4F7F\u7528 JAR \u6587\u4EF6\u6216\u76EE\u5F55\u4E2D\u7684\u7C7B\u548C\u8D44\u6E90\n \u8986\u76D6\u6216\u589E\u5F3A\u6A21\u5757\u3002\n\n\u8FD9\u4E9B\u9009\u9879\u662F\u975E\u6807\u51C6\u9009\u9879, \u5982\u6709\u66F4\u6539, \u6055\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves

View file

@ -39,7 +39,7 @@ java.launcher.opt.footer =\ -cp <class search path of directories and zip
See \u8ACB\u53C3\u95B1 http://www.oracle.com/technetwork/java/javase/documentation/index.html \u66B8\u89E3\u8A73\u7D30\u8CC7\u8A0A\u3002 See \u8ACB\u53C3\u95B1 http://www.oracle.com/technetwork/java/javase/documentation/index.html \u66B8\u89E3\u8A73\u7D30\u8CC7\u8A0A\u3002
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves
java.launcher.X.usage=\ -Xbatch \u505C\u7528\u80CC\u666F\u7DE8\u8B6F\n -Xbootclasspath/a:<directories and zip/jar files separated by {0}>\n \u52A0\u5728\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u7D50\u5C3E\n -Xcheck:jni \u57F7\u884C\u5176\u4ED6\u7684 JNI \u51FD\u6578\u6AA2\u67E5\n -Xcomp \u5F37\u5236\u7DE8\u8B6F\u7B2C\u4E00\u500B\u547C\u53EB\u7684\u65B9\u6CD5\n -Xdebug \u70BA\u56DE\u6EAF\u76F8\u5BB9\u6027\u63D0\u4F9B\n -Xdiag \u986F\u793A\u5176\u4ED6\u8A3A\u65B7\u8A0A\u606F\n -Xdiag:resolver \u986F\u793A\u89E3\u6790\u5668\u8A3A\u65B7\u8A0A\u606F\n -Xdisable-@files \u505C\u7528\u9032\u4E00\u6B65\u7684\u5F15\u6578\u6A94\u6848\u64F4\u5145\n -Xfuture \u555F\u7528\u6700\u56B4\u683C\u7684\u6AA2\u67E5\uFF0C\u9810\u5148\u4F5C\u70BA\u5C07\u4F86\u7684\u9810\u8A2D\n -Xint \u50C5\u9650\u89E3\u8B6F\u6A21\u5F0F\u57F7\u884C\n -Xinternalversion\n \u986F\u793A\u6BD4\u4F7F\u7528 -version \u9078\u9805\u6642\u66F4\u70BA\u8A73\u7D30\u7684\n JVM \u7248\u672C\u8CC7\u8A0A\n -Xloggc:<file> \u5C07 GC \u72C0\u614B\u548C\u6642\u6233\u8A18\u9304\u81F3\u6A94\u6848\n -Xmixed \u6DF7\u5408\u6A21\u5F0F\u57F7\u884C (\u9810\u8A2D)\n -Xmn<size> \u91DD\u5C0D\u65B0\u751F\u4EE3 (\u990A\u6210\u5340) \u8A2D\u5B9A\u5806\u96C6\u7684\u8D77\u59CB\u5927\u5C0F\u548C\n \u5927\u5C0F\u4E0A\u9650 (\u4F4D\u5143\u7D44)\n -Xms<size> \u8A2D\u5B9A\u8D77\u59CB Java \u5806\u96C6\u5927\u5C0F\n -Xmx<size> \u8A2D\u5B9A Java \u5806\u96C6\u5927\u5C0F\u4E0A\u9650\n -Xnoclassgc \u505C\u7528\u985E\u5225\u8CC7\u6E90\u56DE\u6536\n -Xprof \u8F38\u51FA cpu \u5206\u6790\u8CC7\u6599\n -Xrs \u6E1B\u5C11 Java/VM \u4F7F\u7528\u4F5C\u696D\u7CFB\u7D71\u4FE1\u865F (\u8ACB\u53C3\u95B1\u6587\u4EF6)\n -Xshare:auto \u76E1\u53EF\u80FD\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599 (\u9810\u8A2D)\n -Xshare:off \u4E0D\u5617\u8A66\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\n -Xshare:on \u9700\u8981\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\uFF0C\u5426\u5247\u5931\u6557\u3002\n -XshowSettings \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:all\n \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:locale\n \u986F\u793A\u6240\u6709\u5730\u5340\u8A2D\u5B9A\u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:properties\n \u986F\u793A\u6240\u6709\u5C6C\u6027\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:vm \u986F\u793A\u6240\u6709 VM \u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -Xss<size> \u8A2D\u5B9A Java \u57F7\u884C\u7DD2\u5806\u758A\u5927\u5C0F\n -Xverify \u8A2D\u5B9A Bytecode \u9A57\u8B49\u7A0B\u5F0F\u6A21\u5F0F\n --add-reads <module>=<target-module>(,<target-module>)*\n \u7121\u8AD6\u6A21\u7D44\u5BA3\u544A\u70BA\u4F55\uFF0C\u66F4\u65B0 <module> \u4EE5\n \u8B80\u53D6 <target-module>\u3002\n \u53EF\u5C07 <target-module> \u8A2D\u70BA ALL-UNNAMED \u4EE5\u8B80\u53D6\u6240\u6709\u672A\u547D\u540D\u7684\n \u6A21\u7D44\u3002\n --add-exports <module>/<package>=<target-module>(,<target-module>)*\n \u7121\u8AD6\u6A21\u7D44\u5BA3\u544A\u70BA\u4F55\uFF0C\u66F4\u65B0 <module> \u4EE5\u4FBF\u5C07 <package>\n \u532F\u51FA\u81F3 <target-module>\u3002\n \u53EF\u5C07 <target-module> \u8A2D\u70BA ALL-UNNAMED \u4EE5\u532F\u51FA\u81F3\u6240\u6709\n \u672A\u547D\u540D\u7684\u6A21\u7D44\u3002\n --patch-module <module>=<file>({0}<file>)*\n \u8986\u5BEB\u6216\u52A0\u5F37 JAR \u6A94\u6848\u6216\u76EE\u9304\u4E2D\n \ java.launcher.X.usage=\ -Xbatch \u505C\u7528\u80CC\u666F\u7DE8\u8B6F\n -Xbootclasspath/a:<directories and zip/jar files separated by {0}>\n \u52A0\u5728\u555F\u52D5\u5B89\u88DD\u985E\u5225\u8DEF\u5F91\u7684\u7D50\u5C3E\n -Xcheck:jni \u57F7\u884C\u5176\u4ED6\u7684 JNI \u51FD\u6578\u6AA2\u67E5\n -Xcomp \u5F37\u5236\u7DE8\u8B6F\u7B2C\u4E00\u500B\u547C\u53EB\u7684\u65B9\u6CD5\n -Xdebug \u70BA\u56DE\u6EAF\u76F8\u5BB9\u6027\u63D0\u4F9B\n -Xdiag \u986F\u793A\u5176\u4ED6\u8A3A\u65B7\u8A0A\u606F\n -Xdiag:resolver \u986F\u793A\u89E3\u6790\u5668\u8A3A\u65B7\u8A0A\u606F\n -Xfuture \u555F\u7528\u6700\u56B4\u683C\u7684\u6AA2\u67E5\uFF0C\u9810\u5148\u4F5C\u70BA\u5C07\u4F86\u7684\u9810\u8A2D\n -Xint \u50C5\u9650\u89E3\u8B6F\u6A21\u5F0F\u57F7\u884C\n -Xinternalversion\n \u986F\u793A\u6BD4\u4F7F\u7528 -version \u9078\u9805\u6642\u66F4\u70BA\u8A73\u7D30\u7684\n JVM \u7248\u672C\u8CC7\u8A0A\n -Xloggc:<file> \u5C07 GC \u72C0\u614B\u548C\u6642\u6233\u8A18\u9304\u81F3\u6A94\u6848\n -Xmixed \u6DF7\u5408\u6A21\u5F0F\u57F7\u884C (\u9810\u8A2D)\n -Xmn<size> \u91DD\u5C0D\u65B0\u751F\u4EE3 (\u990A\u6210\u5340) \u8A2D\u5B9A\u5806\u96C6\u7684\u8D77\u59CB\u5927\u5C0F\u548C\n \u5927\u5C0F\u4E0A\u9650 (\u4F4D\u5143\u7D44)\n -Xms<size> \u8A2D\u5B9A\u8D77\u59CB Java \u5806\u96C6\u5927\u5C0F\n -Xmx<size> \u8A2D\u5B9A Java \u5806\u96C6\u5927\u5C0F\u4E0A\u9650\n -Xnoclassgc \u505C\u7528\u985E\u5225\u8CC7\u6E90\u56DE\u6536\n -Xprof \u8F38\u51FA cpu \u5206\u6790\u8CC7\u6599\n -Xrs \u6E1B\u5C11 Java/VM \u4F7F\u7528\u4F5C\u696D\u7CFB\u7D71\u4FE1\u865F (\u8ACB\u53C3\u95B1\u6587\u4EF6)\n -Xshare:auto \u76E1\u53EF\u80FD\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599 (\u9810\u8A2D)\n -Xshare:off \u4E0D\u5617\u8A66\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\n -Xshare:on \u9700\u8981\u4F7F\u7528\u5171\u7528\u985E\u5225\u8CC7\u6599\uFF0C\u5426\u5247\u5931\u6557\u3002\n -XshowSettings \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:all\n \u986F\u793A\u6240\u6709\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:locale\n \u986F\u793A\u6240\u6709\u5730\u5340\u8A2D\u5B9A\u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:properties\n \u986F\u793A\u6240\u6709\u5C6C\u6027\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -XshowSettings:vm \u986F\u793A\u6240\u6709 VM \u76F8\u95DC\u8A2D\u5B9A\u503C\u4E26\u7E7C\u7E8C\n -Xss<size> \u8A2D\u5B9A Java \u57F7\u884C\u7DD2\u5806\u758A\u5927\u5C0F\n -Xverify \u8A2D\u5B9A Bytecode \u9A57\u8B49\u7A0B\u5F0F\u6A21\u5F0F\n --add-reads <module>=<target-module>(,<target-module>)*\n \u7121\u8AD6\u6A21\u7D44\u5BA3\u544A\u70BA\u4F55\uFF0C\u66F4\u65B0 <module> \u4EE5\n \u8B80\u53D6 <target-module>\u3002\n \u53EF\u5C07 <target-module> \u8A2D\u70BA ALL-UNNAMED \u4EE5\u8B80\u53D6\u6240\u6709\u672A\u547D\u540D\u7684\n \u6A21\u7D44\u3002\n --add-exports <module>/<package>=<target-module>(,<target-module>)*\n \u7121\u8AD6\u6A21\u7D44\u5BA3\u544A\u70BA\u4F55\uFF0C\u66F4\u65B0 <module> \u4EE5\u4FBF\u5C07 <package>\n \u532F\u51FA\u81F3 <target-module>\u3002\n \u53EF\u5C07 <target-module> \u8A2D\u70BA ALL-UNNAMED \u4EE5\u532F\u51FA\u81F3\u6240\u6709\n \u672A\u547D\u540D\u7684\u6A21\u7D44\u3002\n --disable-@files \u505C\u7528\u9032\u4E00\u6B65\u7684\u5F15\u6578\u6A94\u6848\u64F4\u5145\n --patch-module <module>=<file>({0}<file>)*\n \u8986\u5BEB\u6216\u52A0\u5F37 JAR \u6A94\u6848\u6216\u76EE\u9304\u4E2D\n \
\u542B\u6709\u985E\u5225\u548C\u8CC7\u6E90\u7684\u6A21\u7D44\u3002\n\n\u4E0A\u8FF0\u9078\u9805\u4E0D\u662F\u6A19\u6E96\u9078\u9805\uFF0C\u82E5\u6709\u8B8A\u66F4\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n \u542B\u6709\u985E\u5225\u548C\u8CC7\u6E90\u7684\u6A21\u7D44\u3002\n\n\u4E0A\u8FF0\u9078\u9805\u4E0D\u662F\u6A19\u6E96\u9078\u9805\uFF0C\u82E5\u6709\u8B8A\u66F4\u4E0D\u53E6\u884C\u901A\u77E5\u3002\n
# Translators please note do not translate the options themselves # Translators please note do not translate the options themselves

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -32,7 +32,6 @@ import java.net.URL;
import java.net.URI; import java.net.URI;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.*; import java.util.*;
import java.text.MessageFormat;
import java.security.*; import java.security.*;
import java.security.cert.Certificate; import java.security.cert.Certificate;
import java.security.cert.X509Certificate; import java.security.cert.X509Certificate;
@ -579,10 +578,9 @@ public class PolicyFile extends java.security.Policy {
k.add(policy); k.add(policy);
return k; return k;
}); });
MessageFormat form = new MessageFormat(ResourcesMgr.getString
(POLICY + ".error.parsing.policy.message"));
Object[] source = {policy, pe.getLocalizedMessage()}; Object[] source = {policy, pe.getLocalizedMessage()};
System.err.println(form.format(source)); System.err.println(LocalizedMessage.getMessage
(POLICY + ".error.parsing.policy.message", source));
if (debug != null) { if (debug != null) {
pe.printStackTrace(); pe.printStackTrace();
} }
@ -805,32 +803,30 @@ public class PolicyFile extends java.security.Policy {
} }
} }
} catch (java.lang.reflect.InvocationTargetException ite) { } catch (java.lang.reflect.InvocationTargetException ite) {
MessageFormat form = new MessageFormat
(ResourcesMgr.getString
(POLICY +
".error.adding.Permission.perm.message"));
Object[] source = {pe.permission, Object[] source = {pe.permission,
ite.getTargetException().toString()}; ite.getTargetException().toString()};
System.err.println(form.format(source)); System.err.println(
LocalizedMessage.getMessage(
POLICY + ".error.adding.Permission.perm.message",
source));
} catch (Exception e) { } catch (Exception e) {
MessageFormat form = new MessageFormat
(ResourcesMgr.getString
(POLICY +
".error.adding.Permission.perm.message"));
Object[] source = {pe.permission, Object[] source = {pe.permission,
e.toString()}; e.toString()};
System.err.println(form.format(source)); System.err.println(
LocalizedMessage.getMessage(
POLICY + ".error.adding.Permission.perm.message",
source));
} }
} }
// No need to sync because noone has access to newInfo yet // No need to sync because noone has access to newInfo yet
newInfo.policyEntries.add(entry); newInfo.policyEntries.add(entry);
} catch (Exception e) { } catch (Exception e) {
MessageFormat form = new MessageFormat(ResourcesMgr.getString
(POLICY
+ ".error.adding.Entry.message"));
Object[] source = {e.toString()}; Object[] source = {e.toString()};
System.err.println(form.format(source)); System.err.println(
LocalizedMessage.getMessage(
POLICY + ".error.adding.Entry.message",
source));
} }
if (debug != null) if (debug != null)
debug.println(); debug.println();
@ -1803,29 +1799,29 @@ public class PolicyFile extends java.security.Policy {
} else if (prefix.equalsIgnoreCase("alias")) { } else if (prefix.equalsIgnoreCase("alias")) {
// get the suffix and perform keystore alias replacement // get the suffix and perform keystore alias replacement
if (colonIndex == -1) { if (colonIndex == -1) {
MessageFormat form = new MessageFormat
(ResourcesMgr.getString
("alias.name.not.provided.pe.name."));
Object[] source = {pe.name}; Object[] source = {pe.name};
throw new Exception(form.format(source)); throw new Exception(
LocalizedMessage.getMessage(
"alias.name.not.provided.pe.name.",
source));
} }
suffix = value.substring(colonIndex+1); suffix = value.substring(colonIndex+1);
if ((suffix = getDN(suffix, keystore)) == null) { if ((suffix = getDN(suffix, keystore)) == null) {
MessageFormat form = new MessageFormat
(ResourcesMgr.getString
("unable.to.perform.substitution.on.alias.suffix"));
Object[] source = {value.substring(colonIndex+1)}; Object[] source = {value.substring(colonIndex+1)};
throw new Exception(form.format(source)); throw new Exception(
LocalizedMessage.getMessage(
"unable.to.perform.substitution.on.alias.suffix",
source));
} }
sb.append(X500PRINCIPAL + " \"" + suffix + "\""); sb.append(X500PRINCIPAL + " \"" + suffix + "\"");
startIndex = e+2; startIndex = e+2;
} else { } else {
MessageFormat form = new MessageFormat
(ResourcesMgr.getString
("substitution.value.prefix.unsupported"));
Object[] source = {prefix}; Object[] source = {prefix};
throw new Exception(form.format(source)); throw new Exception(
LocalizedMessage.getMessage(
"substitution.value.prefix.unsupported",
source));
} }
} }
@ -2039,7 +2035,7 @@ public class PolicyFile extends java.security.Policy {
super(type); super(type);
if (type == null) { if (type == null) {
throw new NullPointerException throw new NullPointerException
(ResourcesMgr.getString("type.can.t.be.null")); (LocalizedMessage.getMessage("type.can.t.be.null"));
} }
this.type = type; this.type = type;
this.name = name; this.name = name;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -26,18 +26,14 @@
package sun.security.provider; package sun.security.provider;
import java.io.*; import java.io.*;
import java.lang.RuntimePermission;
import java.net.SocketPermission;
import java.net.URL;
import java.security.GeneralSecurityException; import java.security.GeneralSecurityException;
import java.security.Principal; import java.security.Principal;
import java.text.MessageFormat;
import java.util.*; import java.util.*;
import javax.security.auth.x500.X500Principal; import javax.security.auth.x500.X500Principal;
import sun.security.util.Debug; import sun.security.util.Debug;
import sun.security.util.PropertyExpander; import sun.security.util.PropertyExpander;
import sun.security.util.ResourcesMgr; import sun.security.util.LocalizedMessage;
/** /**
* The policy for a Java runtime (specifying * The policy for a Java runtime (specifying
@ -209,13 +205,12 @@ public class PolicyParser {
if (!domainEntries.containsKey(domainName)) { if (!domainEntries.containsKey(domainName)) {
domainEntries.put(domainName, de); domainEntries.put(domainName, de);
} else { } else {
MessageFormat form = LocalizedMessage localizedMsg =
new MessageFormat(ResourcesMgr.getString( new LocalizedMessage("duplicate.keystore.domain.name");
"duplicate.keystore.domain.name"));
Object[] source = {domainName}; Object[] source = {domainName};
String msg = "duplicate keystore domain name: " + String msg = "duplicate keystore domain name: " +
domainName; domainName;
throw new ParsingException(msg, form, source); throw new ParsingException(msg, localizedMsg, source);
} }
} }
} else { } else {
@ -225,7 +220,7 @@ public class PolicyParser {
} }
if (keyStoreUrlString == null && storePassURL != null) { if (keyStoreUrlString == null && storePassURL != null) {
throw new ParsingException(ResourcesMgr.getString throw new ParsingException(LocalizedMessage.getMessage
("keystorePasswordURL.can.not.be.specified.without.also.specifying.keystore")); ("keystorePasswordURL.can.not.be.specified.without.also.specifying.keystore"));
} }
} }
@ -367,7 +362,7 @@ public class PolicyParser {
keyStoreType = match("quoted string"); keyStoreType = match("quoted string");
} else { } else {
throw new ParsingException(st.lineno(), throw new ParsingException(st.lineno(),
ResourcesMgr.getString("expected.keystore.type")); LocalizedMessage.getMessage("expected.keystore.type"));
} }
// parse keystore provider // parse keystore provider
@ -380,7 +375,7 @@ public class PolicyParser {
keyStoreProvider = match("quoted string"); keyStoreProvider = match("quoted string");
} else { } else {
throw new ParsingException(st.lineno(), throw new ParsingException(st.lineno(),
ResourcesMgr.getString("expected.keystore.provider")); LocalizedMessage.getMessage("expected.keystore.provider"));
} }
} }
@ -430,7 +425,7 @@ public class PolicyParser {
if (e.codeBase != null) if (e.codeBase != null)
throw new ParsingException( throw new ParsingException(
st.lineno(), st.lineno(),
ResourcesMgr.getString LocalizedMessage.getMessage
("multiple.Codebase.expressions")); ("multiple.Codebase.expressions"));
e.codeBase = match("quoted string"); e.codeBase = match("quoted string");
peekAndMatch(","); peekAndMatch(",");
@ -438,8 +433,8 @@ public class PolicyParser {
if (e.signedBy != null) if (e.signedBy != null)
throw new ParsingException( throw new ParsingException(
st.lineno(), st.lineno(),
ResourcesMgr.getString( LocalizedMessage.getMessage
"multiple.SignedBy.expressions")); ("multiple.SignedBy.expressions"));
e.signedBy = match("quoted string"); e.signedBy = match("quoted string");
// verify syntax of the aliases // verify syntax of the aliases
@ -457,8 +452,8 @@ public class PolicyParser {
if (actr <= cctr) if (actr <= cctr)
throw new ParsingException( throw new ParsingException(
st.lineno(), st.lineno(),
ResourcesMgr.getString( LocalizedMessage.getMessage
"SignedBy.has.empty.alias")); ("SignedBy.has.empty.alias"));
peekAndMatch(","); peekAndMatch(",");
} else if (peekAndMatch("Principal")) { } else if (peekAndMatch("Principal")) {
@ -500,7 +495,7 @@ public class PolicyParser {
} }
throw new ParsingException throw new ParsingException
(st.lineno(), (st.lineno(),
ResourcesMgr.getString LocalizedMessage.getMessage
("can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name")); ("can.not.specify.Principal.with.a.wildcard.class.without.a.wildcard.name"));
} }
} }
@ -537,8 +532,8 @@ public class PolicyParser {
} else { } else {
throw new ParsingException(st.lineno(), throw new ParsingException(st.lineno(),
ResourcesMgr.getString( LocalizedMessage.getMessage
"expected.codeBase.or.SignedBy.or.Principal")); ("expected.codeBase.or.SignedBy.or.Principal"));
} }
} }
@ -561,8 +556,8 @@ public class PolicyParser {
} else { } else {
throw new throw new
ParsingException(st.lineno(), ParsingException(st.lineno(),
ResourcesMgr.getString( LocalizedMessage.getMessage
"expected.permission.entry")); ("expected.permission.entry"));
} }
} }
match("}"); match("}");
@ -738,15 +733,14 @@ public class PolicyParser {
switch (lookahead) { switch (lookahead) {
case StreamTokenizer.TT_NUMBER: case StreamTokenizer.TT_NUMBER:
throw new ParsingException(st.lineno(), expect, throw new ParsingException(st.lineno(), expect,
ResourcesMgr.getString("number.") + LocalizedMessage.getMessage("number.") +
String.valueOf(st.nval)); String.valueOf(st.nval));
case StreamTokenizer.TT_EOF: case StreamTokenizer.TT_EOF:
MessageFormat form = new MessageFormat( LocalizedMessage localizedMsg = new LocalizedMessage
ResourcesMgr.getString ("expected.expect.read.end.of.file.");
("expected.expect.read.end.of.file."));
Object[] source = {expect}; Object[] source = {expect};
String msg = "expected [" + expect + "], read [end of file]"; String msg = "expected [" + expect + "], read [end of file]";
throw new ParsingException(msg, form, source); throw new ParsingException(msg, localizedMsg, source);
case StreamTokenizer.TT_WORD: case StreamTokenizer.TT_WORD:
if (expect.equalsIgnoreCase(st.sval)) { if (expect.equalsIgnoreCase(st.sval)) {
lookahead = st.nextToken(); lookahead = st.nextToken();
@ -832,10 +826,10 @@ public class PolicyParser {
switch (lookahead) { switch (lookahead) {
case StreamTokenizer.TT_NUMBER: case StreamTokenizer.TT_NUMBER:
throw new ParsingException(st.lineno(), ";", throw new ParsingException(st.lineno(), ";",
ResourcesMgr.getString("number.") + LocalizedMessage.getMessage("number.") +
String.valueOf(st.nval)); String.valueOf(st.nval));
case StreamTokenizer.TT_EOF: case StreamTokenizer.TT_EOF:
throw new ParsingException(ResourcesMgr.getString throw new ParsingException(LocalizedMessage.getMessage
("expected.read.end.of.file.")); ("expected.read.end.of.file."));
default: default:
lookahead = st.nextToken(); lookahead = st.nextToken();
@ -993,8 +987,8 @@ public class PolicyParser {
*/ */
public PrincipalEntry(String principalClass, String principalName) { public PrincipalEntry(String principalClass, String principalName) {
if (principalClass == null || principalName == null) if (principalClass == null || principalName == null)
throw new NullPointerException(ResourcesMgr.getString( throw new NullPointerException(LocalizedMessage.getMessage
"null.principalClass.or.principalName")); ("null.principalClass.or.principalName"));
this.principalClass = principalClass; this.principalClass = principalClass;
this.principalName = principalName; this.principalName = principalName;
} }
@ -1244,11 +1238,11 @@ public class PolicyParser {
if (!entries.containsKey(keystoreName)) { if (!entries.containsKey(keystoreName)) {
entries.put(keystoreName, entry); entries.put(keystoreName, entry);
} else { } else {
MessageFormat form = new MessageFormat(ResourcesMgr.getString( LocalizedMessage localizedMsg = new LocalizedMessage
"duplicate.keystore.name")); ("duplicate.keystore.name");
Object[] source = {keystoreName}; Object[] source = {keystoreName};
String msg = "duplicate keystore name: " + keystoreName; String msg = "duplicate keystore name: " + keystoreName;
throw new ParsingException(msg, form, source); throw new ParsingException(msg, localizedMsg, source);
} }
} }
@ -1320,7 +1314,7 @@ public class PolicyParser {
private static final long serialVersionUID = -4330692689482574072L; private static final long serialVersionUID = -4330692689482574072L;
private String i18nMessage; private String i18nMessage;
private MessageFormat form; private LocalizedMessage localizedMsg;
private Object[] source; private Object[] source;
/** /**
@ -1336,10 +1330,10 @@ public class PolicyParser {
i18nMessage = msg; i18nMessage = msg;
} }
public ParsingException(String msg, MessageFormat form, public ParsingException(String msg, LocalizedMessage localizedMsg,
Object[] source) { Object[] source) {
super(msg); super(msg);
this.form = form; this.localizedMsg = localizedMsg;
this.source = source; this.source = source;
} }
@ -1347,7 +1341,7 @@ public class PolicyParser {
super("line " + line + ": " + msg); super("line " + line + ": " + msg);
// don't call form.format unless getLocalizedMessage is called // don't call form.format unless getLocalizedMessage is called
// to avoid unnecessary permission checks // to avoid unnecessary permission checks
form = new MessageFormat(ResourcesMgr.getString("line.number.msg")); localizedMsg = new LocalizedMessage("line.number.msg");
source = new Object[] {line, msg}; source = new Object[] {line, msg};
} }
@ -1356,14 +1350,14 @@ public class PolicyParser {
"], found [" + actual + "]"); "], found [" + actual + "]");
// don't call form.format unless getLocalizedMessage is called // don't call form.format unless getLocalizedMessage is called
// to avoid unnecessary permission checks // to avoid unnecessary permission checks
form = new MessageFormat(ResourcesMgr.getString localizedMsg = new LocalizedMessage
("line.number.expected.expect.found.actual.")); ("line.number.expected.expect.found.actual.");
source = new Object[] {line, expect, actual}; source = new Object[] {line, expect, actual};
} }
@Override @Override
public String getLocalizedMessage() { public String getLocalizedMessage() {
return i18nMessage != null ? i18nMessage : form.format(source); return i18nMessage != null ? i18nMessage : localizedMsg.format(source);
} }
} }

View file

@ -0,0 +1,151 @@
/*
* Copyright (c) 2017, 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 sun.security.util;
/**
* This class produces formatted and localized messages describing security
* issues. Some messages may be required when the VM is not fully booted. In
* this case, localization resources and classes used for message formatting
* may not be available. When the VM is not booted, the message will not be
* localized, and it will be formatted using simplified message formatting
* code that is contained in this class.
*/
/*
* Some of this code is executed before the VM is fully booted. Some import
* statements have been omitted to help prevent accidental use of classes that
* may not be available during boot.
*/
public class LocalizedMessage {
private static final Resources resources = new Resources();
private final String key;
/**
* A LocalizedMessage can be instantiated with a key and formatted with
* arguments later in the style of MessageFormat. This organization
* allows the actual formatting (and associated permission checks) to be
* avoided unless the resulting string is needed.
* @param key
*/
public LocalizedMessage(String key) {
this.key = key;
}
/**
* Return a localized string corresponding to the key stored in this
* object, formatted with the provided arguments. When the VM is booted,
* this method will obtain the correct localized message and format it
* using java.text.MessageFormat. Otherwise, a non-localized string is
* returned, and the formatting is performed by simplified formatting code.
*
* @param arguments The arguments that should be placed in the message
* @return A formatted message string
*/
public String format(Object... arguments) {
return getMessage(key, arguments);
}
/**
* Return a non-localized string corresponding to the provided key, and
* formatted with the provided arguments. All strings are obtained from
* sun.security.util.Resources, and the formatting only supports
* simple positional argument replacement (e.g. {1}).
*
* @param key The key of the desired string in Resources
* @param arguments The arguments that should be placed in the message
* @return A formatted message string
*/
public static String getMessageUnbooted(String key,
Object... arguments) {
String value = resources.getString(key);
if (arguments == null || arguments.length == 0) {
return value;
}
// Classes like StringTokenizer may not be loaded, so parsing
// is performed with String methods
StringBuilder sb = new StringBuilder();
int nextBraceIndex;
while ((nextBraceIndex = value.indexOf('{')) >= 0) {
String firstPart = value.substring(0, nextBraceIndex);
sb.append(firstPart);
value = value.substring(nextBraceIndex + 1);
// look for closing brace and argument index
nextBraceIndex = value.indexOf('}');
if (nextBraceIndex < 0) {
// no closing brace
// MessageFormat would throw IllegalArgumentException, but
// that exception class may not be loaded yet
throw new RuntimeException("Unmatched braces");
}
String indexStr = value.substring(0, nextBraceIndex);
try {
int index = Integer.parseInt(indexStr);
sb.append(arguments[index]);
}
catch(NumberFormatException e) {
// argument index is not an integer
throw new RuntimeException("not an integer: " + indexStr);
}
value = value.substring(nextBraceIndex + 1);
}
sb.append(value);
return sb.toString();
}
/**
* Return a localized string corresponding to the provided key, and
* formatted with the provided arguments. When the VM is booted, this
* method will obtain the correct localized message and format it using
* java.text.MessageFormat. Otherwise, a non-localized string is returned,
* and the formatting is performed by simplified formatting code.
*
* @param key The key of the desired string in the security resource bundle
* @param arguments The arguments that should be placed in the message
* @return A formatted message string
*/
public static String getMessage(String key,
Object... arguments) {
if (jdk.internal.misc.VM.isBooted()) {
// Localization and formatting resources are available
String value = ResourcesMgr.getString(key);
if (arguments == null) {
return value;
}
java.text.MessageFormat form = new java.text.MessageFormat(value);
return form.format(arguments);
} else {
return getMessageUnbooted(key, arguments);
}
}
}

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -34,37 +34,24 @@ import jdk.internal.misc.VM;
*/ */
public class ResourcesMgr { public class ResourcesMgr {
// intended for java.security, javax.security and sun.security resources // intended for java.security, javax.security and sun.security resources
private final static String RESOURCES = "sun.security.util.Resources";
private final static String AUTH_RESOURCES = "sun.security.util.AuthResources";
private final static Map<String, ResourceBundle> bundles = new ConcurrentHashMap<>(); private final static Map<String, ResourceBundle> bundles = new ConcurrentHashMap<>();
public static String getString(String s) { public static String getString(String s) {
ResourceBundle bundle = bundles.get(RESOURCES); return getBundle("sun.security.util.Resources").getString(s);
if (bundle == null) {
// only load if/when needed
bundle = java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction<java.util.ResourceBundle>() {
public java.util.ResourceBundle run() {
return (java.util.ResourceBundle.getBundle
("sun.security.util.Resources"));
}
});
}
return bundle.getString(s);
} }
public static String getAuthResourceString(String s) { public static String getAuthResourceString(String s) {
if (VM.initLevel() == 3) { return getBundle("sun.security.util.AuthResources").getString(s);
// cannot trigger loading of any resource bundle as
// it depends on the system class loader fully initialized.
throw new InternalError("system class loader is being initialized");
} }
return bundles.computeIfAbsent(AUTH_RESOURCES, ResourceBundle::getBundle) private static ResourceBundle getBundle(String bundleName) {
.getString(s); if (!VM.isBooted()) {
// don't expect this be called before the system is fully initialized.
// This triggers loading of any resource bundle that should be
// be done during initialization of system class loader.
throw new InternalError("Expected to use ResourceBundle only after booted");
}
return bundles.computeIfAbsent(bundleName, ResourceBundle::getBundle);
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -195,9 +195,26 @@ public class CLDRLocaleProviderAdapter extends JRELocaleProviderAdapter {
return parent; return parent;
} }
/**
* This method returns equivalent CLDR supported locale for zh-HK,
* no, no-NO locales so that COMPAT locales do not precede
* those locales during ResourceBundle search path.
*/
private static Locale getEquivalentLoc(Locale locale) {
switch (locale.toString()) {
case "zh_HK":
return Locale.forLanguageTag("zh-Hant-HK");
case "no":
case "no_NO":
return Locale.forLanguageTag("nb");
}
return locale;
}
@Override @Override
public boolean isSupportedProviderLocale(Locale locale, Set<String> langtags) { public boolean isSupportedProviderLocale(Locale locale, Set<String> langtags) {
return Locale.ROOT.equals(locale) || return Locale.ROOT.equals(locale)
langtags.contains(locale.stripExtensions().toLanguageTag()); || langtags.contains(locale.stripExtensions().toLanguageTag())
|| langtags.contains(getEquivalentLoc(locale).toLanguageTag());
} }
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -31,6 +31,8 @@ import java.util.Map;
import java.util.Set; import java.util.Set;
import java.util.TreeMap; import java.util.TreeMap;
import java.util.spi.CalendarNameProvider; import java.util.spi.CalendarNameProvider;
import sun.util.calendar.CalendarSystem;
import sun.util.calendar.Era;
/** /**
* Concrete implementation of the {@link java.util.spi.CalendarDataProvider * Concrete implementation of the {@link java.util.spi.CalendarDataProvider
@ -75,7 +77,21 @@ public class CalendarNameProviderImpl extends CalendarNameProvider implements Av
if (field == DAY_OF_WEEK || field == YEAR) { if (field == DAY_OF_WEEK || field == YEAR) {
--value; --value;
} }
if (value < 0 || value >= strings.length) { if (value < 0 || value > strings.length) {
return null;
} else if (value == strings.length) {
if (field == ERA && "japanese".equals(calendarType)) {
// get the supplemental era, if any, specified through
// the property "jdk.calendar.japanese.supplemental.era"
// which is always the last element.
Era[] jeras = CalendarSystem.forName("japanese").getEras();
if (jeras.length == value) {
Era supEra = jeras[value - 1]; // 0-based index
return style == LONG ?
supEra.getName() :
supEra.getAbbreviation();
}
}
return null; return null;
} }
name = strings[value]; name = strings[value];

View file

@ -127,7 +127,22 @@ main(int argc, char **argv)
// accommodate the NULL at the end // accommodate the NULL at the end
JLI_List args = JLI_List_new(argc + 1); JLI_List args = JLI_List_new(argc + 1);
int i = 0; int i = 0;
for (i = 0; i < argc; i++) {
// Add first arg, which is the app name
JLI_List_add(args, JLI_StringDup(argv[0]));
// Append JAVA_OPTIONS
if (JLI_AddArgsFromEnvVar(args, JAVA_OPTIONS)) {
// JLI_SetTraceLauncher is not called yet
// Show _JAVA_OPTIONS content along with JAVA_OPTIONS to aid diagnosis
if (getenv(JLDEBUG_ENV_ENTRY)) {
char *tmp = getenv("_JAVA_OPTIONS");
if (NULL != tmp) {
JLI_ReportMessage(ARG_INFO_ENVVAR, "_JAVA_OPTIONS", tmp);
}
}
}
// Iterate the rest of command line
for (i = 1; i < argc; i++) {
JLI_List argsInFile = JLI_PreprocessArg(argv[i]); JLI_List argsInFile = JLI_PreprocessArg(argv[i]);
if (NULL == argsInFile) { if (NULL == argsInFile) {
JLI_List_add(args, JLI_StringDup(argv[i])); JLI_List_add(args, JLI_StringDup(argv[i]));

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -23,15 +23,19 @@
* questions. * questions.
*/ */
#include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <assert.h> #include <assert.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <ctype.h>
#ifdef DEBUG_ARGFILE #ifdef DEBUG_ARGFILE
#ifndef NO_JNI #ifndef NO_JNI
#define NO_JNI #define NO_JNI
#endif #endif
#define JLI_ReportMessage(p1, p2) printf((p1), (p2)) #define JLI_ReportMessage(...) printf(__VA_ARGS__)
#define JAVA_OPTIONS "JAVA_OPTIONS"
int IsWhiteSpaceOption(const char* name) { return 1; }
#else #else
#include "java.h" #include "java.h"
#endif #endif
@ -69,14 +73,17 @@ typedef struct {
static int firstAppArgIndex = NOT_FOUND; static int firstAppArgIndex = NOT_FOUND;
static jboolean expectingNoDashArg = JNI_FALSE; static jboolean expectingNoDashArg = JNI_FALSE;
static size_t argsCount = 0; // Initialize to 1, as the first argument is the app name and not preprocessed
static size_t argsCount = 1;
static jboolean stopExpansion = JNI_FALSE; static jboolean stopExpansion = JNI_FALSE;
static jboolean relaunch = JNI_FALSE;
void JLI_InitArgProcessing(jboolean isJava, jboolean disableArgFile) { void JLI_InitArgProcessing(jboolean isJava, jboolean disableArgFile) {
// No expansion for relaunch // No expansion for relaunch
if (argsCount != 0) { if (argsCount != 1) {
relaunch = JNI_TRUE;
stopExpansion = JNI_TRUE; stopExpansion = JNI_TRUE;
argsCount = 0; argsCount = 1;
} else { } else {
stopExpansion = disableArgFile; stopExpansion = disableArgFile;
} }
@ -95,10 +102,6 @@ int JLI_GetAppArgIndex() {
static void checkArg(const char *arg) { static void checkArg(const char *arg) {
size_t idx = 0; size_t idx = 0;
argsCount++; argsCount++;
if (argsCount == 1) {
// ignore first argument, the application name
return;
}
// All arguments arrive here must be a launcher argument, // All arguments arrive here must be a launcher argument,
// ie. by now, all argfile expansions must have been performed. // ie. by now, all argfile expansions must have been performed.
@ -109,6 +112,7 @@ static void checkArg(const char *arg) {
expectingNoDashArg = JNI_TRUE; expectingNoDashArg = JNI_TRUE;
if (JLI_StrCmp(arg, "-jar") == 0 || if (JLI_StrCmp(arg, "-jar") == 0 ||
JLI_StrCmp(arg, "--module") == 0 ||
JLI_StrCmp(arg, "-m") == 0) { JLI_StrCmp(arg, "-m") == 0) {
// This is tricky, we do expect NoDashArg // This is tricky, we do expect NoDashArg
// But that is considered main class to stop expansion // But that is considered main class to stop expansion
@ -116,7 +120,7 @@ static void checkArg(const char *arg) {
// We can not just update the idx here because if -jar @file // We can not just update the idx here because if -jar @file
// still need expansion of @file to get the argument for -jar // still need expansion of @file to get the argument for -jar
} }
} else if (JLI_StrCmp(arg, "-Xdisable-@files") == 0) { } else if (JLI_StrCmp(arg, "--disable-@files") == 0) {
stopExpansion = JNI_TRUE; stopExpansion = JNI_TRUE;
} }
} else { } else {
@ -407,6 +411,117 @@ JLI_List JLI_PreprocessArg(const char *arg)
return rv; return rv;
} }
int isTerminalOpt(char *arg) {
return JLI_StrCmp(arg, "-jar") == 0 ||
JLI_StrCmp(arg, "-m") == 0 ||
JLI_StrCmp(arg, "--module") == 0 ||
JLI_StrCmp(arg, "--dry-run") == 0 ||
JLI_StrCmp(arg, "-h") == 0 ||
JLI_StrCmp(arg, "-?") == 0 ||
JLI_StrCmp(arg, "-help") == 0 ||
JLI_StrCmp(arg, "--help") == 0 ||
JLI_StrCmp(arg, "-X") == 0 ||
JLI_StrCmp(arg, "--help-extra") == 0 ||
JLI_StrCmp(arg, "-version") == 0 ||
JLI_StrCmp(arg, "--version") == 0 ||
JLI_StrCmp(arg, "-fullversion") == 0 ||
JLI_StrCmp(arg, "--full-version") == 0;
}
jboolean JLI_AddArgsFromEnvVar(JLI_List args, const char *var_name) {
#ifndef ENABLE_JAVA_OPTIONS
return JNI_FALSE;
#else
char *env = getenv(var_name);
char *p, *arg;
char quote;
JLI_List argsInFile;
if (firstAppArgIndex == 0) {
// Not 'java', return
return JNI_FALSE;
}
if (relaunch) {
return JNI_FALSE;
}
if (NULL == env) {
return JNI_FALSE;
}
JLI_ReportMessage(ARG_INFO_ENVVAR, var_name, env);
// This is retained until the process terminates as it is saved as the args
p = JLI_MemAlloc(JLI_StrLen(env) + 1);
while (*env != '\0') {
while (*env != '\0' && isspace(*env)) {
env++;
}
arg = p;
while (*env != '\0' && !isspace(*env)) {
if (*env == '"' || *env == '\'') {
quote = *env++;
while (*env != quote && *env != '\0') {
*p++ = *env++;
}
if (*env == '\0') {
JLI_ReportMessage(ARG_ERROR8, var_name);
exit(1);
}
env++;
} else {
*p++ = *env++;
}
}
*p++ = '\0';
argsInFile = JLI_PreprocessArg(arg);
if (NULL == argsInFile) {
if (isTerminalOpt(arg)) {
JLI_ReportMessage(ARG_ERROR9, arg, var_name);
exit(1);
}
JLI_List_add(args, arg);
} else {
size_t cnt, idx;
char *argFile = arg;
cnt = argsInFile->size;
for (idx = 0; idx < cnt; idx++) {
arg = argsInFile->elements[idx];
if (isTerminalOpt(arg)) {
JLI_ReportMessage(ARG_ERROR10, arg, argFile, var_name);
exit(1);
}
JLI_List_add(args, arg);
}
// Shallow free, we reuse the string to avoid copy
JLI_MemFree(argsInFile->elements);
JLI_MemFree(argsInFile);
}
/*
* Check if main-class is specified after argument being checked. It
* must always appear after expansion, as a main-class could be specified
* indirectly into environment variable via an @argfile, and it must be
* caught now.
*/
if (firstAppArgIndex != NOT_FOUND) {
JLI_ReportMessage(ARG_ERROR11, var_name);
exit(1);
}
assert (*env == '\0' || isspace(*env));
}
return JNI_TRUE;
#endif
}
#ifdef DEBUG_ARGFILE #ifdef DEBUG_ARGFILE
/* /*
* Stand-alone sanity test, build with following command line * Stand-alone sanity test, build with following command line

View file

@ -36,6 +36,7 @@
#define JNI_ERROR "Error: A JNI error has occurred, please check your installation and try again" #define JNI_ERROR "Error: A JNI error has occurred, please check your installation and try again"
#define JNI_ERROR1 "Error: can't find JNI interfaces in: %s" #define JNI_ERROR1 "Error: can't find JNI interfaces in: %s"
#define ARG_INFO_ENVVAR "NOTE: Picked up the following options via %s:\n %s"
#define ARG_WARN "Warning: %s option is no longer supported." #define ARG_WARN "Warning: %s option is no longer supported."
#define ARG_ERROR1 "Error: %s requires class path specification" #define ARG_ERROR1 "Error: %s requires class path specification"
@ -45,6 +46,10 @@
#define ARG_ERROR5 "Error: %s requires module id" #define ARG_ERROR5 "Error: %s requires module id"
#define ARG_ERROR6 "Error: %s requires modules to be specified" #define ARG_ERROR6 "Error: %s requires modules to be specified"
#define ARG_ERROR7 "Error: %s can only be specified once" #define ARG_ERROR7 "Error: %s can only be specified once"
#define ARG_ERROR8 "Error: Unmatched quote in environment variable %s"
#define ARG_ERROR9 "Error: Option %s is not allowed in environment variable %s"
#define ARG_ERROR10 "Error: Option %s in %s is not allowed in environment variable %s"
#define ARG_ERROR11 "Error: Cannot specify main class in environment variable %s"
#define JVM_ERROR1 "Error: Could not create the Java Virtual Machine.\n" GEN_ERROR #define JVM_ERROR1 "Error: Could not create the Java Virtual Machine.\n" GEN_ERROR
#define JVM_ERROR2 "Error: Could not detach main thread.\n" JNI_ERROR #define JVM_ERROR2 "Error: Could not detach main thread.\n" JNI_ERROR

View file

@ -769,17 +769,7 @@ SetJvmEnvironment(int argc, char **argv) {
continue; continue;
} }
if (*arg != '-' if (*arg != '-' || isTerminalOpt(arg)) {
|| JLI_StrCmp(arg, "-version") == 0
|| JLI_StrCmp(arg, "--version") == 0
|| JLI_StrCmp(arg, "-fullversion") == 0
|| JLI_StrCmp(arg, "--full-version") == 0
|| JLI_StrCmp(arg, "-help") == 0
|| JLI_StrCmp(arg, "--help") == 0
|| JLI_StrCmp(arg, "-?") == 0
|| JLI_StrCmp(arg, "-jar") == 0
|| JLI_StrCmp(arg, "-X") == 0
|| JLI_StrCmp(arg, "--help-extra") == 0) {
return; return;
} }
} }
@ -1576,6 +1566,31 @@ GetApplicationClass(JNIEnv *env)
return (*env)->CallStaticObjectMethod(env, cls, mid); return (*env)->CallStaticObjectMethod(env, cls, mid);
} }
static char* expandWildcardOnLongOpt(char* arg) {
char *p, *value;
size_t optLen, valueLen;
p = JLI_StrChr(arg, '=');
if (p == NULL || p[1] == '\0') {
JLI_ReportErrorMessage(ARG_ERROR1, arg);
exit(1);
}
p++;
value = (char *) JLI_WildcardExpandClasspath(p);
if (p == value) {
// no wildcard
return arg;
}
optLen = p - arg;
valueLen = JLI_StrLen(value);
p = JLI_MemAlloc(optLen + valueLen + 1);
memcpy(p, arg, optLen);
memcpy(p + optLen, value, valueLen);
p[optLen + valueLen + 1] = '\0';
return p;
}
/* /*
* For tools, convert command line args thus: * For tools, convert command line args thus:
* javac -cp foo:foo/"*" -J-ms32m ... * javac -cp foo:foo/"*" -J-ms32m ...
@ -1626,15 +1641,18 @@ TranslateApplicationArgs(int jargc, const char **jargv, int *pargc, char ***parg
if (arg[0] == '-') { if (arg[0] == '-') {
if (arg[1] == 'J') if (arg[1] == 'J')
continue; continue;
if (IsWildCardEnabled() && arg[1] == 'c' if (IsWildCardEnabled()) {
&& (JLI_StrCmp(arg, "-cp") == 0 || if (IsClassPathOption(arg) && i < argc - 1) {
JLI_StrCmp(arg, "-classpath") == 0)
&& i < argc - 1) {
*nargv++ = arg; *nargv++ = arg;
*nargv++ = (char *) JLI_WildcardExpandClasspath(argv[i+1]); *nargv++ = (char *) JLI_WildcardExpandClasspath(argv[i+1]);
i++; i++;
continue; continue;
} }
if (JLI_StrCCmp(arg, "--class-path=") == 0) {
*nargv++ = expandWildcardOnLongOpt(arg);
continue;
}
}
} }
*nargv++ = arg; *nargv++ = arg;
} }

View file

@ -71,6 +71,7 @@
#define SPLASH_FILE_ENV_ENTRY "_JAVA_SPLASH_FILE" #define SPLASH_FILE_ENV_ENTRY "_JAVA_SPLASH_FILE"
#define SPLASH_JAR_ENV_ENTRY "_JAVA_SPLASH_JAR" #define SPLASH_JAR_ENV_ENTRY "_JAVA_SPLASH_JAR"
#define JAVA_OPTIONS "JAVA_OPTIONS"
/* /*
* Pointers to the needed JNI invocation API, initialized by LoadJavaVM. * Pointers to the needed JNI invocation API, initialized by LoadJavaVM.
@ -169,6 +170,9 @@ char *CheckJvmType(int *argc, char ***argv, jboolean speculative);
void AddOption(char *str, void *info); void AddOption(char *str, void *info);
jboolean IsWhiteSpaceOption(const char* name); jboolean IsWhiteSpaceOption(const char* name);
// Utility function defined in args.c
int isTerminalOpt(char *arg);
const char* GetProgramName(); const char* GetProgramName();
const char* GetFullVersion(); const char* GetFullVersion();
jboolean IsJavaArgs(); jboolean IsJavaArgs();

View file

@ -135,5 +135,6 @@ JLI_List JLI_List_split(const char *str, char sep);
void JLI_InitArgProcessing(jboolean isJava, jboolean disableArgFile); void JLI_InitArgProcessing(jboolean isJava, jboolean disableArgFile);
JLI_List JLI_PreprocessArg(const char *arg); JLI_List JLI_PreprocessArg(const char *arg);
jboolean JLI_AddArgsFromEnvVar(JLI_List args, const char *var_name);
#endif /* _JLI_UTIL_H */ #endif /* _JLI_UTIL_H */

View file

@ -272,14 +272,16 @@ isWildcard(const char *filename)
(! exists(filename)); (! exists(filename));
} }
static void static int
FileList_expandWildcards(JLI_List fl) FileList_expandWildcards(JLI_List fl)
{ {
size_t i, j; size_t i, j;
int expandedCnt = 0;
for (i = 0; i < fl->size; i++) { for (i = 0; i < fl->size; i++) {
if (isWildcard(fl->elements[i])) { if (isWildcard(fl->elements[i])) {
JLI_List expanded = wildcardFileList(fl->elements[i]); JLI_List expanded = wildcardFileList(fl->elements[i]);
if (expanded != NULL && expanded->size > 0) { if (expanded != NULL && expanded->size > 0) {
expandedCnt++;
JLI_MemFree(fl->elements[i]); JLI_MemFree(fl->elements[i]);
JLI_List_ensureCapacity(fl, fl->size + expanded->size); JLI_List_ensureCapacity(fl, fl->size + expanded->size);
for (j = fl->size - 1; j >= i+1; j--) for (j = fl->size - 1; j >= i+1; j--)
@ -294,19 +296,20 @@ FileList_expandWildcards(JLI_List fl)
JLI_List_free(expanded); JLI_List_free(expanded);
} }
} }
return expandedCnt;
} }
const char * const char *
JLI_WildcardExpandClasspath(const char *classpath) JLI_WildcardExpandClasspath(const char *classpath)
{ {
char *expanded; const char *expanded;
JLI_List fl; JLI_List fl;
if (JLI_StrChr(classpath, '*') == NULL) if (JLI_StrChr(classpath, '*') == NULL)
return classpath; return classpath;
fl = JLI_List_split(classpath, PATH_SEPARATOR); fl = JLI_List_split(classpath, PATH_SEPARATOR);
FileList_expandWildcards(fl); expanded = FileList_expandWildcards(fl) ?
expanded = JLI_List_join(fl, PATH_SEPARATOR); JLI_List_join(fl, PATH_SEPARATOR) : classpath;
JLI_List_free(fl); JLI_List_free(fl);
if (getenv(JLDEBUG_ENV_ENTRY) != 0) if (getenv(JLDEBUG_ENV_ENTRY) != 0)
printf("Expanded wildcards:\n" printf("Expanded wildcards:\n"

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -31,6 +31,8 @@
* in the jdk regression tests. * in the jdk regression tests.
*/ */
#include <assert.h>
#ifndef IDE_STANDALONE #ifndef IDE_STANDALONE
#include "java.h" #include "java.h"
#include "jli_util.h" #include "jli_util.h"
@ -198,17 +200,50 @@ void JLI_CmdToArgs(char* cmdline) {
int nargs = 0; int nargs = 0;
StdArg* argv = NULL; StdArg* argv = NULL;
jboolean wildcard = JNI_FALSE; jboolean wildcard = JNI_FALSE;
char* src = cmdline; char* src = cmdline, *arg = NULL;
JLI_List argsInFile; JLI_List argsInFile;
size_t i, cnt;
JLI_List envArgs = JLI_List_new(1);
if (JLI_AddArgsFromEnvVar(envArgs, JAVA_OPTIONS)) {
// JLI_SetTraceLauncher is not called yet
// Show _JAVA_OPTIONS content along with JAVA_OPTIONS to aid diagnosis
if (getenv(JLDEBUG_ENV_ENTRY)) {
char *tmp = getenv("_JAVA_OPTIONS");
if (NULL != tmp) {
JLI_ReportMessage(ARG_INFO_ENVVAR, "_JAVA_OPTIONS", tmp);
}
}
}
cnt = envArgs->size + 1;
argv = JLI_MemAlloc(cnt * sizeof(StdArg));
// allocate arg buffer with sufficient space to receive the largest arg // allocate arg buffer with sufficient space to receive the largest arg
char* arg = JLI_StringDup(cmdline); arg = JLI_StringDup(cmdline);
do { src = next_arg(src, arg, &wildcard);
// first argument is the app name, do not preprocess and make sure remains first
argv[0].arg = JLI_StringDup(arg);
argv[0].has_wildcard = wildcard;
nargs++;
for (i = 1; i < cnt; i++) {
argv[i].arg = envArgs->elements[i - 1];
// wildcard is not supported in argfile
argv[i].has_wildcard = JNI_FALSE;
nargs++;
}
JLI_MemFree(envArgs->elements);
JLI_MemFree(envArgs);
assert ((size_t) nargs == cnt);
*arg = '\0';
// iterate through rest of command line
while (src != NULL) {
src = next_arg(src, arg, &wildcard); src = next_arg(src, arg, &wildcard);
argsInFile = JLI_PreprocessArg(arg); argsInFile = JLI_PreprocessArg(arg);
if (argsInFile != NULL) { if (argsInFile != NULL) {
size_t cnt, i;
// resize to accommodate another Arg // resize to accommodate another Arg
cnt = argsInFile->size; cnt = argsInFile->size;
argv = (StdArg*) JLI_MemRealloc(argv, (nargs + cnt) * sizeof(StdArg)); argv = (StdArg*) JLI_MemRealloc(argv, (nargs + cnt) * sizeof(StdArg));
@ -230,7 +265,7 @@ void JLI_CmdToArgs(char* cmdline) {
nargs++; nargs++;
} }
*arg = '\0'; *arg = '\0';
} while (src != NULL); }
JLI_MemFree(arg); JLI_MemFree(arg);

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -248,7 +248,8 @@ public class AquaLookAndFeel extends BasicLookAndFeel {
*/ */
private void initResourceBundle(final UIDefaults table) { private void initResourceBundle(final UIDefaults table) {
table.setDefaultLocale(Locale.getDefault()); table.setDefaultLocale(Locale.getDefault());
table.addResourceBundle(PKG_PREFIX + "resources.aqua"); SwingAccessor.getUIDefaultsAccessor().addInternalBundle(table,
PKG_PREFIX + "resources.aqua");
try { try {
final ResourceBundle aquaProperties = ResourceBundle.getBundle(PKG_PREFIX + "resources.aqua"); final ResourceBundle aquaProperties = ResourceBundle.getBundle(PKG_PREFIX + "resources.aqua");
final Enumeration<String> propertyKeys = aquaProperties.getKeys(); final Enumeration<String> propertyKeys = aquaProperties.getKeys();

View file

@ -155,6 +155,11 @@ public abstract class TIFFDecompressor {
*/ */
protected boolean planar; protected boolean planar;
/**
* The planar band to decode; ignored for chunky (interleaved) images.
*/
protected int planarBand = 0;
/** /**
* The value of the {@code SamplesPerPixel} tag. * The value of the {@code SamplesPerPixel} tag.
*/ */
@ -446,24 +451,19 @@ public abstract class TIFFDecompressor {
* Create a {@code ComponentColorModel} for use in creating * Create a {@code ComponentColorModel} for use in creating
* an {@code ImageTypeSpecifier}. * an {@code ImageTypeSpecifier}.
*/ */
// This code was copied from javax.imageio.ImageTypeSpecifier. // This code was inspired by the method of the same name in
// javax.imageio.ImageTypeSpecifier
static ColorModel createComponentCM(ColorSpace colorSpace, static ColorModel createComponentCM(ColorSpace colorSpace,
int numBands, int numBands,
int[] bitsPerSample,
int dataType, int dataType,
boolean hasAlpha, boolean hasAlpha,
boolean isAlphaPremultiplied) { boolean isAlphaPremultiplied) {
int transparency = int transparency =
hasAlpha ? Transparency.TRANSLUCENT : Transparency.OPAQUE; hasAlpha ? Transparency.TRANSLUCENT : Transparency.OPAQUE;
int[] numBits = new int[numBands];
int bits = DataBuffer.getDataTypeSize(dataType);
for (int i = 0; i < numBands; i++) {
numBits[i] = bits;
}
return new ComponentColorModel(colorSpace, return new ComponentColorModel(colorSpace,
numBits, bitsPerSample,
hasAlpha, hasAlpha,
isAlphaPremultiplied, isAlphaPremultiplied,
transparency, transparency,
@ -581,14 +581,15 @@ public abstract class TIFFDecompressor {
* Determines whether the {@code DataBuffer} is filled without * Determines whether the {@code DataBuffer} is filled without
* any interspersed padding bits. * any interspersed padding bits.
*/ */
private static boolean isDataBufferBitContiguous(SampleModel sm) private static boolean isDataBufferBitContiguous(SampleModel sm,
int[] bitsPerSample)
throws IIOException { throws IIOException {
int dataTypeSize = getDataTypeSize(sm.getDataType()); int dataTypeSize = getDataTypeSize(sm.getDataType());
if(sm instanceof ComponentSampleModel) { if(sm instanceof ComponentSampleModel) {
int numBands = sm.getNumBands(); int numBands = sm.getNumBands();
for(int i = 0; i < numBands; i++) { for(int i = 0; i < numBands; i++) {
if(sm.getSampleSize(i) != dataTypeSize) { if(bitsPerSample[i] != dataTypeSize) {
// Sample does not fill data element. // Sample does not fill data element.
return false; return false;
} }
@ -682,6 +683,7 @@ public abstract class TIFFDecompressor {
* of the supplied {@code WritableRaster}. * of the supplied {@code WritableRaster}.
*/ */
private static void reformatDiscontiguousData(byte[] buf, private static void reformatDiscontiguousData(byte[] buf,
int[] bitsPerSample,
int stride, int stride,
int w, int w,
int h, int h,
@ -691,7 +693,6 @@ public abstract class TIFFDecompressor {
// Get SampleModel info. // Get SampleModel info.
SampleModel sm = raster.getSampleModel(); SampleModel sm = raster.getSampleModel();
int numBands = sm.getNumBands(); int numBands = sm.getNumBands();
int[] sampleSize = sm.getSampleSize();
// Initialize input stream. // Initialize input stream.
ByteArrayInputStream is = new ByteArrayInputStream(buf); ByteArrayInputStream is = new ByteArrayInputStream(buf);
@ -705,7 +706,7 @@ public abstract class TIFFDecompressor {
int x = raster.getMinX(); int x = raster.getMinX();
for(int i = 0; i < w; i++, x++) { for(int i = 0; i < w; i++, x++) {
for(int b = 0; b < numBands; b++) { for(int b = 0; b < numBands; b++) {
long bits = iis.readBits(sampleSize[b]); long bits = iis.readBits(bitsPerSample[b]);
raster.setSample(x, y, b, (int)bits); raster.setSample(x, y, b, (int)bits);
} }
} }
@ -806,8 +807,15 @@ public abstract class TIFFDecompressor {
blueLut[i] = (byte)((colorMap[2*mapSize + i]*255)/65535); blueLut[i] = (byte)((colorMap[2*mapSize + i]*255)/65535);
} }
int dataType = bitsPerSample[0] == 8 ? int dataType;
DataBuffer.TYPE_BYTE : DataBuffer.TYPE_USHORT; if (bitsPerSample[0] <= 8) {
dataType = DataBuffer.TYPE_BYTE;
} else if (sampleFormat[0] ==
BaselineTIFFTagSet.SAMPLE_FORMAT_SIGNED_INTEGER) {
dataType = DataBuffer.TYPE_SHORT;
} else {
dataType = DataBuffer.TYPE_USHORT;
}
return ImageTypeSpecifier.createIndexed(redLut, return ImageTypeSpecifier.createIndexed(redLut,
greenLut, greenLut,
blueLut, blueLut,
@ -1082,6 +1090,7 @@ public abstract class TIFFDecompressor {
cm = createComponentCM(cs, cm = createComponentCM(cs,
samplesPerPixel, samplesPerPixel,
bitsPerSample,
dataType, dataType,
hasAlpha, hasAlpha,
alphaPremultiplied); alphaPremultiplied);
@ -1089,6 +1098,7 @@ public abstract class TIFFDecompressor {
ColorSpace cs = new BogusColorSpace(samplesPerPixel); ColorSpace cs = new BogusColorSpace(samplesPerPixel);
cm = createComponentCM(cs, cm = createComponentCM(cs,
samplesPerPixel, samplesPerPixel,
bitsPerSample,
dataType, dataType,
false, // hasAlpha false, // hasAlpha
false); // alphaPremultiplied false); // alphaPremultiplied
@ -1119,17 +1129,23 @@ public abstract class TIFFDecompressor {
BaselineTIFFTagSet.SAMPLE_FORMAT_SIGNED_INTEGER); BaselineTIFFTagSet.SAMPLE_FORMAT_SIGNED_INTEGER);
// Grayscale // Grayscale
if(samplesPerPixel == 1) { if(samplesPerPixel == 1 &&
int dataType = (bitsPerSample[0] == 1 || bitsPerSample[0] == 2 ||
getDataTypeFromNumBits(maxBitsPerSample, isSigned); bitsPerSample[0] == 4 || bitsPerSample[0] == 8 ||
bitsPerSample[0] == 16)) {
int dataType = getDataTypeFromNumBits(maxBitsPerSample, isSigned);
return ImageTypeSpecifier.createGrayscale(maxBitsPerSample, return ImageTypeSpecifier.createGrayscale(bitsPerSample[0],
dataType, dataType,
isSigned); isSigned);
} }
// Gray-alpha // Gray-alpha
if (samplesPerPixel == 2) { if (samplesPerPixel == 2 &&
bitsPerSample[0] == bitsPerSample[1] &&
(bitsPerSample[0] == 1 || bitsPerSample[0] == 2 ||
bitsPerSample[0] == 4 || bitsPerSample[0] == 8 ||
bitsPerSample[0] == 16)) {
boolean alphaPremultiplied = false; boolean alphaPremultiplied = false;
if (extraSamples != null && if (extraSamples != null &&
extraSamples[0] == extraSamples[0] ==
@ -1147,6 +1163,13 @@ public abstract class TIFFDecompressor {
} }
if (samplesPerPixel == 3 || samplesPerPixel == 4) { if (samplesPerPixel == 3 || samplesPerPixel == 4) {
int dataType = getDataTypeFromNumBits(maxBitsPerSample, isSigned);
int dataTypeSize;
try {
dataTypeSize = getDataTypeSize(dataType);
} catch (IIOException ignored) {
dataTypeSize = maxBitsPerSample;
}
if(totalBits <= 32 && !isSigned) { if(totalBits <= 32 && !isSigned) {
// Packed RGB or RGBA // Packed RGB or RGBA
int redMask = createMask(bitsPerSample, 0); int redMask = createMask(bitsPerSample, 0);
@ -1169,21 +1192,24 @@ public abstract class TIFFDecompressor {
alphaMask, alphaMask,
transferType, transferType,
alphaPremultiplied); alphaPremultiplied);
} else if(samplesPerPixel == 3) { } else if(samplesPerPixel == 3 &&
dataTypeSize == bitsPerSample[0] &&
bitsPerSample[0] == bitsPerSample[1] &&
bitsPerSample[1] == bitsPerSample[2]) {
// Interleaved RGB // Interleaved RGB
int[] bandOffsets = new int[] {0, 1, 2}; int[] bandOffsets = new int[] {0, 1, 2};
int dataType =
getDataTypeFromNumBits(maxBitsPerSample, isSigned);
return ImageTypeSpecifier.createInterleaved(rgb, return ImageTypeSpecifier.createInterleaved(rgb,
bandOffsets, bandOffsets,
dataType, dataType,
false, false,
false); false);
} else if(samplesPerPixel == 4) { } else if(samplesPerPixel == 4 &&
dataTypeSize == bitsPerSample[0] &&
bitsPerSample[0] == bitsPerSample[1] &&
bitsPerSample[1] == bitsPerSample[2] &&
bitsPerSample[2] == bitsPerSample[3]) {
// Interleaved RGBA // Interleaved RGBA
int[] bandOffsets = new int[] {0, 1, 2, 3}; int[] bandOffsets = new int[] {0, 1, 2, 3};
int dataType =
getDataTypeFromNumBits(maxBitsPerSample, isSigned);
boolean alphaPremultiplied = false; boolean alphaPremultiplied = false;
if (extraSamples != null && if (extraSamples != null &&
extraSamples[0] == extraSamples[0] ==
@ -1196,21 +1222,29 @@ public abstract class TIFFDecompressor {
true, true,
alphaPremultiplied); alphaPremultiplied);
} }
} else { }
// Arbitrary Interleaved. // Arbitrary Interleaved.
int dataType = int dataType =
getDataTypeFromNumBits(maxBitsPerSample, isSigned); getDataTypeFromNumBits(maxBitsPerSample, isSigned);
SampleModel sm = createInterleavedSM(dataType, SampleModel sm = createInterleavedSM(dataType,
samplesPerPixel); samplesPerPixel);
ColorSpace cs = new BogusColorSpace(samplesPerPixel); ColorSpace cs;
if (samplesPerPixel <= 2) {
cs = ColorSpace.getInstance(ColorSpace.CS_GRAY);
} else if (samplesPerPixel <= 4) {
cs = rgb;
} else {
cs = new BogusColorSpace(samplesPerPixel);
}
ColorModel cm = createComponentCM(cs, ColorModel cm = createComponentCM(cs,
samplesPerPixel, samplesPerPixel,
bitsPerSample,
dataType, dataType,
false, // hasAlpha false, // hasAlpha
false); // alphaPremultiplied false); // alphaPremultiplied
return new ImageTypeSpecifier(cm, sm); return new ImageTypeSpecifier(cm, sm);
} }
}
return null; return null;
} }
@ -1284,6 +1318,14 @@ public abstract class TIFFDecompressor {
this.planar = planar; this.planar = planar;
} }
/**
* Sets the index of the planar configuration band to be decoded. This value
* is ignored for chunky (interleaved) images.
*
* @param the index of the planar band to decode
*/
public void setPlanarBand(int planarBand) { this.planarBand = planarBand; }
/** /**
* Sets the value of the {@code samplesPerPixel} field. * Sets the value of the {@code samplesPerPixel} field.
* *
@ -2488,7 +2530,7 @@ public abstract class TIFFDecompressor {
// Branch based on whether data are bit-contiguous, i.e., // Branch based on whether data are bit-contiguous, i.e.,
// data are packaed as tightly as possible leaving no unused // data are packaed as tightly as possible leaving no unused
// bits except at the end of a row. // bits except at the end of a row.
if(isDataBufferBitContiguous(sm)) { if(isDataBufferBitContiguous(sm, bitsPerSample)) {
// Use byte or float data directly. // Use byte or float data directly.
if (byteData != null) { if (byteData != null) {
decodeRaw(byteData, dstOffset, decodeRaw(byteData, dstOffset,
@ -2537,11 +2579,19 @@ public abstract class TIFFDecompressor {
} else { } else {
// Read discontiguous data into bytes and set the samples // Read discontiguous data into bytes and set the samples
// into the Raster. // into the Raster.
int bpp = getBitsPerPixel(sm); int bpp;
if (planar) {
bpp = bitsPerSample[planarBand];
} else {
bpp = 0;
for (int bps : bitsPerSample) {
bpp += bps;
}
}
int bytesPerRow = (bpp*srcWidth + 7)/8; int bytesPerRow = (bpp*srcWidth + 7)/8;
byte[] buf = new byte[bytesPerRow*srcHeight]; byte[] buf = new byte[bytesPerRow*srcHeight];
decodeRaw(buf, 0, bpp, bytesPerRow); decodeRaw(buf, 0, bpp, bytesPerRow);
reformatDiscontiguousData(buf, bytesPerRow, reformatDiscontiguousData(buf, bitsPerSample, bytesPerRow,
srcWidth, srcHeight, srcWidth, srcHeight,
ras); ras);
} }

View file

@ -413,6 +413,133 @@ public class TIFFIFD extends TIFFDirectory {
} }
} }
//
// Retrieve the value of a baseline field as a long.
//
private long getFieldAsLong(int tagNumber) {
TIFFField f = getTIFFField(tagNumber);
return f == null ? -1 : f.getAsLong(0);
}
//
// Retrieve the value of a baseline field as an int.
//
private int getFieldAsInt(int tagNumber) {
TIFFField f = getTIFFField(tagNumber);
return f == null ? -1 : f.getAsInt(0);
}
//
// Calculate the number of bytes in each strip or tile. This method
// is to be used if and only if no fields exist which provide this
// information. The parameter must be empty and if the method succeeds
// will contain a single element.
//
private boolean calculateByteCounts(int expectedSize,
List<TIFFField> byteCounts) {
if (!byteCounts.isEmpty()) {
throw new IllegalArgumentException("byteCounts is not empty");
}
// must be interleaved
if (getFieldAsInt(BaselineTIFFTagSet.TAG_PLANAR_CONFIGURATION) ==
BaselineTIFFTagSet.PLANAR_CONFIGURATION_PLANAR) {
return false;
}
// must be uncompressed
if (getFieldAsInt(BaselineTIFFTagSet.TAG_COMPRESSION) !=
BaselineTIFFTagSet.COMPRESSION_NONE) {
return false;
}
// must have image dimensions
long w = getFieldAsLong(BaselineTIFFTagSet.TAG_IMAGE_WIDTH);
if (w < 0) {
return false;
}
long h = getFieldAsLong(BaselineTIFFTagSet.TAG_IMAGE_LENGTH);
if (h < 0) {
return false;
}
long tw = getFieldAsLong(BaselineTIFFTagSet.TAG_TILE_WIDTH);
if (tw < 0) {
tw = w;
}
long th = getFieldAsLong(BaselineTIFFTagSet.TAG_TILE_LENGTH);
if (th < 0) {
th = getFieldAsLong(BaselineTIFFTagSet.TAG_ROWS_PER_STRIP);
if (th < 0) {
th = h;
}
}
int[] bitsPerSample = null;
TIFFField f = getTIFFField(BaselineTIFFTagSet.TAG_BITS_PER_SAMPLE);
if (f != null) {
bitsPerSample = f.getAsInts();
} else {
int samplesPerPixel =
getFieldAsInt(BaselineTIFFTagSet.TAG_SAMPLES_PER_PIXEL);
if (samplesPerPixel < 0) {
samplesPerPixel = 1;
}
bitsPerSample = new int[samplesPerPixel];
Arrays.fill(bitsPerSample, 8);
}
int bitsPerPixel = 0;
for (int bps : bitsPerSample) {
bitsPerPixel += bps;
}
int bytesPerRow = (int)(tw*bitsPerPixel + 7)/8;
int bytesPerPacket = (int)th*bytesPerRow;
long nx = (w + tw - 1)/tw;
long ny = (h + th - 1)/th;
if (nx*ny != expectedSize) {
return false;
}
boolean isTiled =
getTIFFField(BaselineTIFFTagSet.TAG_TILE_BYTE_COUNTS) != null;
int tagNumber;
if (isTiled) {
tagNumber = BaselineTIFFTagSet.TAG_TILE_BYTE_COUNTS;
} else {
tagNumber = BaselineTIFFTagSet.TAG_STRIP_BYTE_COUNTS;
}
TIFFTag t = BaselineTIFFTagSet.getInstance().getTag(tagNumber);
f = getTIFFField(tagNumber);
if (f != null) {
removeTIFFField(tagNumber);
}
int numPackets = (int)(nx*ny);
long[] packetByteCounts = new long[numPackets];
Arrays.fill(packetByteCounts, bytesPerPacket);
// if the strip or tile width does not exceed the image width and the
// image height is not a multiple of the strip or tile height, then
// truncate the estimate of the byte count of the last strip to avoid
// reading past the end of the data
if (tw <= w && h % th != 0) {
int numRowsInLastStrip = (int)(h - (ny - 1)*th);
packetByteCounts[numPackets - 1] = numRowsInLastStrip*bytesPerRow;
}
f = new TIFFField(t, TIFFTag.TIFF_LONG, numPackets, packetByteCounts);
addTIFFField(f);
byteCounts.add(f);
return true;
}
// //
// Verify that data pointed to outside of the IFD itself are within the // Verify that data pointed to outside of the IFD itself are within the
// stream. To be called after all fields have been read and populated. // stream. To be called after all fields have been read and populated.
@ -502,8 +629,19 @@ public class TIFFIFD extends TIFFDirectory {
// Ensure there is at least a data pointer for JPEG interchange format or // Ensure there is at least a data pointer for JPEG interchange format or
// both data offsets and byte counts for other compression types. // both data offsets and byte counts for other compression types.
if (jpegOffset == null && (offsets.size() == 0 || byteCounts.size() == 0)) { if (jpegOffset == null
throw new IIOException("Insufficient data offsets or byte counts"); && (offsets.size() == 0 || byteCounts.size() == 0)) {
boolean throwException = true;
if (offsets.size() != 0 && byteCounts.size() == 0) {
// Attempt to calculate missing byte counts
int expectedSize = offsets.get(0).getCount();
throwException =
!calculateByteCounts(expectedSize, byteCounts);
}
if (throwException) {
throw new IIOException
("Insufficient data offsets or byte counts");
}
} }
// JPEGQTables - one 64-byte table for each offset. // JPEGQTables - one 64-byte table for each offset.

View file

@ -1113,6 +1113,7 @@ public class TIFFImageReader extends ImageReader {
long offset = getTileOrStripOffset(tileIndex); long offset = getTileOrStripOffset(tileIndex);
long byteCount = getTileOrStripByteCount(tileIndex); long byteCount = getTileOrStripByteCount(tileIndex);
decompressor.setPlanarBand(band);
decompressor.setStream(stream); decompressor.setStream(stream);
decompressor.setOffset(offset); decompressor.setOffset(offset);
decompressor.setByteCount((int) byteCount); decompressor.setByteCount((int) byteCount);

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -47,6 +47,7 @@ import sun.awt.UNIXToolkit;
import sun.awt.OSInfo; import sun.awt.OSInfo;
import sun.security.action.GetPropertyAction; import sun.security.action.GetPropertyAction;
import sun.swing.DefaultLayoutStyle; import sun.swing.DefaultLayoutStyle;
import sun.swing.SwingAccessor;
import sun.swing.SwingUtilities2; import sun.swing.SwingUtilities2;
/** /**
@ -288,7 +289,9 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
} }
private void initResourceBundle(UIDefaults table) { private void initResourceBundle(UIDefaults table) {
table.addResourceBundle("com.sun.java.swing.plaf.gtk.resources.gtk"); SwingAccessor.getUIDefaultsAccessor()
.addInternalBundle(table,
"com.sun.java.swing.plaf.gtk.resources.gtk");
} }
protected void initComponentDefaults(UIDefaults table) { protected void initComponentDefaults(UIDefaults table) {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -43,6 +43,7 @@ import javax.swing.plaf.basic.BasicBorders;
import javax.swing.plaf.basic.BasicComboBoxRenderer; import javax.swing.plaf.basic.BasicComboBoxRenderer;
import javax.swing.plaf.basic.BasicComboBoxEditor; import javax.swing.plaf.basic.BasicComboBoxEditor;
import sun.swing.SwingAccessor;
import sun.swing.SwingUtilities2; import sun.swing.SwingUtilities2;
import sun.awt.OSInfo; import sun.awt.OSInfo;
@ -179,7 +180,9 @@ public class MotifLookAndFeel extends BasicLookAndFeel
* used for getting localized defaults. * used for getting localized defaults.
*/ */
private void initResourceBundle(UIDefaults table) { private void initResourceBundle(UIDefaults table) {
table.addResourceBundle( "com.sun.java.swing.plaf.motif.resources.motif" ); SwingAccessor.getUIDefaultsAccessor()
.addInternalBundle(table,
"com.sun.java.swing.plaf.motif.resources.motif");
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -68,6 +68,7 @@ import sun.security.action.GetPropertyAction;
import sun.swing.DefaultLayoutStyle; import sun.swing.DefaultLayoutStyle;
import sun.swing.ImageIconUIResource; import sun.swing.ImageIconUIResource;
import sun.swing.SwingAccessor;
import sun.swing.icon.SortArrowIcon; import sun.swing.icon.SortArrowIcon;
import sun.swing.SwingUtilities2; import sun.swing.SwingUtilities2;
import sun.swing.StringUIClientPropertyKey; import sun.swing.StringUIClientPropertyKey;
@ -287,7 +288,9 @@ public class WindowsLookAndFeel extends BasicLookAndFeel
* used for getting localized defaults. * used for getting localized defaults.
*/ */
private void initResourceBundle(UIDefaults table) { private void initResourceBundle(UIDefaults table) {
table.addResourceBundle( "com.sun.java.swing.plaf.windows.resources.windows" ); SwingAccessor.getUIDefaultsAccessor()
.addInternalBundle(table,
"com.sun.java.swing.plaf.windows.resources.windows");
} }
// XXX - there are probably a lot of redundant values that could be removed. // XXX - there are probably a lot of redundant values that could be removed.

View file

@ -1005,15 +1005,15 @@ final class DirectAudioDevice extends AbstractMixer {
private static final class DirectClip extends DirectDL private static final class DirectClip extends DirectDL
implements Clip, Runnable, AutoClosingClip { implements Clip, Runnable, AutoClosingClip {
private Thread thread; private volatile Thread thread;
private byte[] audioData = null; private volatile byte[] audioData = null;
private int frameSize; // size of one frame in bytes private volatile int frameSize; // size of one frame in bytes
private int m_lengthInFrames; private volatile int m_lengthInFrames;
private int loopCount; private volatile int loopCount;
private int clipBytePosition; // index in the audioData array at current playback private volatile int clipBytePosition; // index in the audioData array at current playback
private int newFramePosition; // set in setFramePosition() private volatile int newFramePosition; // set in setFramePosition()
private int loopStartFrame; private volatile int loopStartFrame;
private int loopEndFrame; // the last sample included in the loop private volatile int loopEndFrame; // the last sample included in the loop
// auto closing clip support // auto closing clip support
private boolean autoclosing = false; private boolean autoclosing = false;
@ -1345,7 +1345,8 @@ final class DirectAudioDevice extends AbstractMixer {
@Override @Override
public void run() { public void run() {
if (Printer.trace) Printer.trace(">>> DirectClip: run() threadID="+Thread.currentThread().getId()); if (Printer.trace) Printer.trace(">>> DirectClip: run() threadID="+Thread.currentThread().getId());
while (thread != null) { Thread curThread = Thread.currentThread();
while (thread == curThread) {
// doIO is volatile, but we could check it, then get // doIO is volatile, but we could check it, then get
// pre-empted while another thread changes doIO and notifies, // pre-empted while another thread changes doIO and notifies,
// before we wait (so we sleep in wait forever). // before we wait (so we sleep in wait forever).
@ -1353,7 +1354,12 @@ final class DirectAudioDevice extends AbstractMixer {
if (!doIO) { if (!doIO) {
try { try {
lock.wait(); lock.wait();
} catch(InterruptedException ie) {} } catch(InterruptedException ie) {
} finally {
if (thread != curThread) {
break;
}
}
} }
} }
while (doIO) { while (doIO) {

View file

@ -28,8 +28,6 @@ questions.
</head> </head>
<body bgcolor="white"> <body bgcolor="white">
<body>
Public classes used by the built-in TIFF plug-ins. Public classes used by the built-in TIFF plug-ins.
<p> <p>

View file

@ -487,7 +487,7 @@ public class JColorChooser extends JComponent implements Accessible {
= "An array of different chooser types.") = "An array of different chooser types.")
public void setChooserPanels( AbstractColorChooserPanel[] panels) { public void setChooserPanels( AbstractColorChooserPanel[] panels) {
AbstractColorChooserPanel[] oldValue = chooserPanels; AbstractColorChooserPanel[] oldValue = chooserPanels;
chooserPanels = panels; chooserPanels = Arrays.copyOf(panels, panels.length);
firePropertyChange(CHOOSER_PANELS_PROPERTY, oldValue, panels); firePropertyChange(CHOOSER_PANELS_PROPERTY, oldValue, panels);
} }
@ -497,7 +497,7 @@ public class JColorChooser extends JComponent implements Accessible {
* @return an array of <code>AbstractColorChooserPanel</code> objects * @return an array of <code>AbstractColorChooserPanel</code> objects
*/ */
public AbstractColorChooserPanel[] getChooserPanels() { public AbstractColorChooserPanel[] getChooserPanels() {
return chooserPanels; return Arrays.copyOf(chooserPanels, chooserPanels.length);
} }
/** /**

View file

@ -48,6 +48,7 @@ import java.io.InvalidObjectException;
import java.io.ObjectInputStream; import java.io.ObjectInputStream;
import java.io.ObjectOutputStream; import java.io.ObjectOutputStream;
import java.io.Serializable; import java.io.Serializable;
import java.util.Arrays;
import java.util.Vector; import java.util.Vector;
import javax.swing.plaf.OptionPaneUI; import javax.swing.plaf.OptionPaneUI;
import javax.swing.event.InternalFrameEvent; import javax.swing.event.InternalFrameEvent;
@ -1812,7 +1813,7 @@ public class JOptionPane extends JComponent implements Accessible
Icon icon, Object[] options, Object initialValue) { Icon icon, Object[] options, Object initialValue) {
this.message = message; this.message = message;
this.options = options; this.options = options == null ? null : Arrays.copyOf(options, options.length);
this.initialValue = initialValue; this.initialValue = initialValue;
this.icon = icon; this.icon = icon;
setMessageType(messageType); setMessageType(messageType);
@ -1972,7 +1973,9 @@ public class JOptionPane extends JComponent implements Accessible
public void setOptions(Object[] newOptions) { public void setOptions(Object[] newOptions) {
Object[] oldOptions = options; Object[] oldOptions = options;
options = newOptions; options = newOptions == null
? null
: Arrays.copyOf(newOptions, newOptions.length);
firePropertyChange(OPTIONS_PROPERTY, oldOptions, options); firePropertyChange(OPTIONS_PROPERTY, oldOptions, options);
} }
@ -1983,14 +1986,7 @@ public class JOptionPane extends JComponent implements Accessible
* @see #setOptions * @see #setOptions
*/ */
public Object[] getOptions() { public Object[] getOptions() {
if(options != null) { return options == null ? null : Arrays.copyOf(options, options.length);
int optionCount = options.length;
Object[] retOptions = new Object[optionCount];
System.arraycopy(options, 0, retOptions, 0, optionCount);
return retOptions;
}
return options;
} }
/** /**
@ -2139,7 +2135,9 @@ public class JOptionPane extends JComponent implements Accessible
public void setSelectionValues(Object[] newValues) { public void setSelectionValues(Object[] newValues) {
Object[] oldValues = selectionValues; Object[] oldValues = selectionValues;
selectionValues = newValues; selectionValues = newValues == null
? null
: Arrays.copyOf(newValues, newValues.length);
firePropertyChange(SELECTION_VALUES_PROPERTY, oldValues, newValues); firePropertyChange(SELECTION_VALUES_PROPERTY, oldValues, newValues);
if(selectionValues != null) if(selectionValues != null)
setWantsInput(true); setWantsInput(true);
@ -2152,7 +2150,9 @@ public class JOptionPane extends JComponent implements Accessible
* @see #setSelectionValues * @see #setSelectionValues
*/ */
public Object[] getSelectionValues() { public Object[] getSelectionValues() {
return selectionValues; return selectionValues == null
? null
: Arrays.copyOf(selectionValues, selectionValues.length);
} }
/** /**

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -53,6 +53,7 @@ import java.security.PrivilegedAction;
import sun.reflect.misc.MethodUtil; import sun.reflect.misc.MethodUtil;
import sun.reflect.misc.ReflectUtil; import sun.reflect.misc.ReflectUtil;
import sun.swing.SwingAccessor;
import sun.swing.SwingUtilities2; import sun.swing.SwingUtilities2;
/** /**
@ -91,6 +92,10 @@ public class UIDefaults extends Hashtable<Object,Object>
*/ */
private Map<Locale, Map<String, Object>> resourceCache; private Map<Locale, Map<String, Object>> resourceCache;
static {
SwingAccessor.setUIDefaultsAccessor(UIDefaults::addInternalBundle);
}
/** /**
* Creates an empty defaults table. * Creates an empty defaults table.
*/ */
@ -881,16 +886,37 @@ public class UIDefaults extends Hashtable<Object,Object>
/** /**
* Adds a resource bundle to the list of resource bundles that are * Adds a resource bundle to the list of resource bundles that are
* searched for localized values. Resource bundles are searched in the * searched for localized values. Resource bundles are searched in
* reverse order they were added. In other words, the most recently added * the reverse order they were added, using the
* bundle is searched first. * {@linkplain ClassLoader#getSystemClassLoader application class loader}.
* In other words, the most recently added bundle is searched first.
* *
* @param bundleName the base name of the resource bundle to be added * @param bundleName the base name of the resource bundle to be added
* @see java.util.ResourceBundle * @see java.util.ResourceBundle
* @see #removeResourceBundle * @see #removeResourceBundle
* @see ResourceBundle#getBundle(String, Locale, ClassLoader)
* @since 1.4 * @since 1.4
*/ */
public synchronized void addResourceBundle( String bundleName ) { public synchronized void addResourceBundle(final String bundleName) {
if (bundleName == null) {
return;
}
if (isDesktopResourceBundle(bundleName)) {
// Only the java.desktop itself can register resource bundles from
// java.desktop module
return;
}
addInternalBundle(bundleName);
}
/**
* This methods should be used to register internal resource bundles from
* the java.desktop module.
*
* @param bundleName the base name of the resource bundle to be added
* @since 9
*/
private synchronized void addInternalBundle(final String bundleName) {
if (bundleName == null) { if (bundleName == null) {
return; return;
} }
@ -903,7 +929,6 @@ public class UIDefaults extends Hashtable<Object,Object>
} }
} }
/** /**
* Removes a resource bundle from the list of resource bundles that are * Removes a resource bundle from the list of resource bundles that are
* searched for localized defaults. * searched for localized defaults.

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -48,7 +48,7 @@ import javax.sound.sampled.*;
import sun.awt.AppContext; import sun.awt.AppContext;
import sun.awt.SunToolkit; import sun.awt.SunToolkit;
import sun.swing.SwingAccessor;
import sun.swing.SwingUtilities2; import sun.swing.SwingUtilities2;
import sun.swing.icon.SortArrowIcon; import sun.swing.icon.SortArrowIcon;
@ -439,7 +439,9 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab
*/ */
private void initResourceBundle(UIDefaults table) { private void initResourceBundle(UIDefaults table) {
table.setDefaultLocale( Locale.getDefault() ); table.setDefaultLocale( Locale.getDefault() );
table.addResourceBundle( "com.sun.swing.internal.plaf.basic.resources.basic" ); SwingAccessor.getUIDefaultsAccessor()
.addInternalBundle(table,
"com.sun.swing.internal.plaf.basic.resources.basic");
} }
/** /**

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -43,6 +43,8 @@ import sun.awt.*;
import sun.security.action.GetPropertyAction; import sun.security.action.GetPropertyAction;
import sun.swing.DefaultLayoutStyle; import sun.swing.DefaultLayoutStyle;
import static javax.swing.UIDefaults.LazyValue; import static javax.swing.UIDefaults.LazyValue;
import sun.swing.SwingAccessor;
import sun.swing.SwingUtilities2; import sun.swing.SwingUtilities2;
/** /**
@ -418,7 +420,9 @@ public class MetalLookAndFeel extends BasicLookAndFeel
* used for getting localized defaults. * used for getting localized defaults.
*/ */
private void initResourceBundle(UIDefaults table) { private void initResourceBundle(UIDefaults table) {
table.addResourceBundle( "com.sun.swing.internal.plaf.metal.resources.metal" ); SwingAccessor.getUIDefaultsAccessor()
.addInternalBundle(table,
"com.sun.swing.internal.plaf.metal.resources.metal");
} }
/** /**

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -647,9 +647,12 @@ public class SynthLookAndFeel extends BasicLookAndFeel {
Region.registerUIs(table); Region.registerUIs(table);
table.setDefaultLocale(Locale.getDefault()); table.setDefaultLocale(Locale.getDefault());
table.addResourceBundle( SwingAccessor.getUIDefaultsAccessor()
.addInternalBundle(table,
"com.sun.swing.internal.plaf.basic.resources.basic"); "com.sun.swing.internal.plaf.basic.resources.basic");
table.addResourceBundle("com.sun.swing.internal.plaf.synth.resources.synth"); SwingAccessor.getUIDefaultsAccessor()
.addInternalBundle(table,
"com.sun.swing.internal.plaf.synth.resources.synth");
// SynthTabbedPaneUI supports rollover on tabs, GTK does not // SynthTabbedPaneUI supports rollover on tabs, GTK does not
table.put("TabbedPane.isTabRollover", Boolean.TRUE); table.put("TabbedPane.isTabRollover", Boolean.TRUE);

View file

@ -32,7 +32,7 @@ import java.io.*;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.LinkOption; import java.nio.file.LinkOption;
import java.nio.file.Path; import java.nio.file.Paths;
import java.util.*; import java.util.*;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
@ -244,7 +244,7 @@ public abstract class ShellFolder extends File {
return (ShellFolder)file; return (ShellFolder)file;
} }
if (!Files.exists(file.toPath(), LinkOption.NOFOLLOW_LINKS)) { if (!Files.exists(Paths.get(file.getPath()), LinkOption.NOFOLLOW_LINKS)) {
throw new FileNotFoundException(); throw new FileNotFoundException();
} }
return shellFolderManager.createShellFolder(file); return shellFolderManager.createShellFolder(file);

View file

@ -99,6 +99,10 @@ public class TrueTypeFont extends FileFont {
public static final int ottoTag = 0x4f54544f; // 'otto' - OpenType font public static final int ottoTag = 0x4f54544f; // 'otto' - OpenType font
/* -- ID's used in the 'name' table */ /* -- ID's used in the 'name' table */
public static final int MAC_PLATFORM_ID = 1;
public static final int MACROMAN_SPECIFIC_ID = 0;
public static final int MACROMAN_ENGLISH_LANG = 0;
public static final int MS_PLATFORM_ID = 3; public static final int MS_PLATFORM_ID = 3;
/* MS locale id for US English is the "default" */ /* MS locale id for US English is the "default" */
public static final short ENGLISH_LOCALE_ID = 0x0409; // 1033 decimal public static final short ENGLISH_LOCALE_ID = 0x0409; // 1033 decimal
@ -1108,7 +1112,12 @@ public class TrueTypeFont extends FileFont {
metrics[offset+3] = ulSize * pointSize; metrics[offset+3] = ulSize * pointSize;
} }
private String makeString(byte[] bytes, int len, short encoding) { private String makeString(byte[] bytes, int len,
short platformID, short encoding) {
if (platformID == MAC_PLATFORM_ID) {
encoding = -1; // hack so we can re-use the code below.
}
/* Check for fonts using encodings 2->6 is just for /* Check for fonts using encodings 2->6 is just for
* some old DBCS fonts, apparently mostly on Solaris. * some old DBCS fonts, apparently mostly on Solaris.
@ -1130,6 +1139,7 @@ public class TrueTypeFont extends FileFont {
String charset; String charset;
switch (encoding) { switch (encoding) {
case -1: charset = "US-ASCII";break;
case 1: charset = "UTF-16"; break; // most common case first. case 1: charset = "UTF-16"; break; // most common case first.
case 0: charset = "UTF-16"; break; // symbol uses this case 0: charset = "UTF-16"; break; // symbol uses this
case 2: charset = "SJIS"; break; case 2: charset = "SJIS"; break;
@ -1175,7 +1185,8 @@ public class TrueTypeFont extends FileFont {
for (int i=0; i<numRecords; i++) { for (int i=0; i<numRecords; i++) {
short platformID = sbuffer.get(); short platformID = sbuffer.get();
if (platformID != MS_PLATFORM_ID) { if (platformID != MS_PLATFORM_ID &&
platformID != MAC_PLATFORM_ID) {
sbuffer.position(sbuffer.position()+5); sbuffer.position(sbuffer.position()+5);
continue; // skip over this record. continue; // skip over this record.
} }
@ -1185,6 +1196,14 @@ public class TrueTypeFont extends FileFont {
int nameLen = ((int) sbuffer.get()) & 0xffff; int nameLen = ((int) sbuffer.get()) & 0xffff;
int namePtr = (((int) sbuffer.get()) & 0xffff) + stringPtr; int namePtr = (((int) sbuffer.get()) & 0xffff) + stringPtr;
String tmpName = null; String tmpName = null;
// only want MacRoman encoding and English name on Mac.
if ((platformID == MAC_PLATFORM_ID) &&
(encodingID != MACROMAN_SPECIFIC_ID ||
langID != MACROMAN_ENGLISH_LANG)) {
continue;
}
switch (nameID) { switch (nameID) {
case FAMILY_NAME_ID: case FAMILY_NAME_ID:
@ -1196,7 +1215,7 @@ public class TrueTypeFont extends FileFont {
{ {
buffer.position(namePtr); buffer.position(namePtr);
buffer.get(name, 0, nameLen); buffer.get(name, 0, nameLen);
tmpName = makeString(name, nameLen, encodingID); tmpName = makeString(name, nameLen, platformID, encodingID);
if (familyName == null || langID == ENGLISH_LOCALE_ID){ if (familyName == null || langID == ENGLISH_LOCALE_ID){
familyName = tmpName; familyName = tmpName;
} }
@ -1229,7 +1248,7 @@ public class TrueTypeFont extends FileFont {
{ {
buffer.position(namePtr); buffer.position(namePtr);
buffer.get(name, 0, nameLen); buffer.get(name, 0, nameLen);
tmpName = makeString(name, nameLen, encodingID); tmpName = makeString(name, nameLen, platformID, encodingID);
if (fullName == null || langID == ENGLISH_LOCALE_ID) { if (fullName == null || langID == ENGLISH_LOCALE_ID) {
fullName = tmpName; fullName = tmpName;
@ -1290,7 +1309,7 @@ public class TrueTypeFont extends FileFont {
|| langID == findLocaleID)) { || langID == findLocaleID)) {
buffer.position(namePtr); buffer.position(namePtr);
buffer.get(name, 0, nameLen); buffer.get(name, 0, nameLen);
foundName = makeString(name, nameLen, encodingID); foundName = makeString(name, nameLen, platformID, encodingID);
if (langID == findLocaleID) { if (langID == findLocaleID) {
return foundName; return foundName;
} }
@ -1627,7 +1646,7 @@ public class TrueTypeFont extends FileFont {
if (nameID == requestedID) { if (nameID == requestedID) {
buffer.position(namePtr); buffer.position(namePtr);
buffer.get(name, 0, nameLen); buffer.get(name, 0, nameLen);
names.add(makeString(name, nameLen, encodingID)); names.add(makeString(name, nameLen, platformID, encodingID));
} }
} }
} }

View file

@ -548,7 +548,7 @@ public class FilePane extends JPanel implements PropertyChangeListener {
actions = actionList.toArray(new Action[actionList.size()]); actions = actionList.toArray(new Action[actionList.size()]);
} }
return actions; return Arrays.copyOf(actions, actions.length);
} }
protected void createActionMap() { protected void createActionMap() {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -91,6 +91,16 @@ public final class SwingAccessor {
void updateCursor(JLightweightFrame frame); void updateCursor(JLightweightFrame frame);
} }
/**
* An accessor for the UIDefaults class.
*/
public interface UIDefaultsAccessor {
/**
* Adds a resource bundle to the list of resource bundles.
*/
void addInternalBundle(UIDefaults uiDefaults, String bundleName);
}
/** /**
* An accessor for the RepaintManager class. * An accessor for the RepaintManager class.
*/ */
@ -183,6 +193,28 @@ public final class SwingAccessor {
return jLightweightFrameAccessor; return jLightweightFrameAccessor;
} }
/**
* The UIDefaults class accessor object
*/
private static UIDefaultsAccessor uiDefaultsAccessor;
/**
* Set an accessor object for the UIDefaults class.
*/
public static void setUIDefaultsAccessor(UIDefaultsAccessor accessor) {
uiDefaultsAccessor = accessor;
}
/**
* Retrieve the accessor object for the JLightweightFrame class
*/
public static UIDefaultsAccessor getUIDefaultsAccessor() {
if (uiDefaultsAccessor == null) {
unsafe.ensureClassInitialized(UIDefaults.class);
}
return uiDefaultsAccessor;
}
/** /**
* The RepaintManager class accessor object. * The RepaintManager class accessor object.
*/ */

View file

@ -1,28 +1,3 @@
/*
* Copyright (c) 2011, 2015, 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.
*/
#if 0 #if 0
CHANGES - changes for libpng CHANGES - changes for libpng
@ -5621,6 +5596,204 @@ Version 1.6.23rc02 [June 4, 2016]
Version 1.6.23 [June 9, 2016] Version 1.6.23 [June 9, 2016]
Fixed bad link to RFC2083 in png.5 (Nikola Forro). Fixed bad link to RFC2083 in png.5 (Nikola Forro).
Version 1.6.24beta01 [June 11, 2016]
Avoid potential overflow of the PNG_IMAGE_SIZE macro. This macro
is not used within libpng, but is used in some of the examples.
Version 1.6.24beta02 [June 23, 2016]
Correct filter heuristic overflow handling. This was broken when the
write filter code was moved out-of-line; if there is a single filter and
the heuristic sum overflows the calculation of the filtered line is not
completed. In versions prior to 1.6 the code was duplicated in-line
and the check not performed, so the filter operation completed; however,
in the multi-filter case where the sum is performed the 'none' filter would
be selected if all the sums overflowed, even if it wasn't in the filter
list. The fix to the first problem is simply to provide PNG_SIZE_MAX as
the current lmins sum value; this means the sum can never exceed it and
overflows silently. A reasonable compiler that does choose to inline
the code will simply eliminate the sum check.
The fix to the second problem is to use high precision arithmetic (this is
implemented in 1.7), however a simple safe fix here is to chose the lowest
numbered filter in the list from png_set_filter (this only works if the
first problem is also fixed) (John Bowler).
Use a more efficient absolute value calculation on SSE2 (Matthieu Darbois).
Fixed the case where PNG_IMAGE_BUFFER_SIZE can overflow in the application
as a result of the application using an increased 'row_stride'; previously
png_image_finish_read only checked for overflow on the base calculation of
components. (I.e. it checked for overflow of a 32-bit number on the total
number of pixel components in the output format, not the possibly padded row
length and not the number of bytes, which for linear formats is twice the
number of components.)
MSVC does not like '-(unsigned)', so replaced it with 0U-(unsigned)
MSVC does not like (uInt) = -(unsigned) (i.e. as an initializer), unless
the conversion is explicitly invoked by a cast.
Put the SKIP definition in the correct place. It needs to come after the
png.h include (see all the other .c files in contrib/libtests) because it
depends on PNG_LIBPNG_VER.
Removed the three compile warning options from the individual project
files into the zlib.props globals. It increases the warning level from 4
to All and adds a list of the warnings that need to be turned off. This is
semi-documentary; the intent is to tell libpng users which warnings have
been examined and judged non-fixable at present. The warning about
structure padding is fixable, but it would be a signficant change (moving
structure members around).
Version 1.6.24beta03 [July 4, 2016]
Optimized absolute value calculation in filter selection, similar to
code in the PAETH decoder in pngrutil.c. Build with PNG_USE_ABS to
use this.
Added pngcp to the build together with a pngcp.dfa configuration test.
Added high resolution timing to pngcp.
Added "Common linking failures" section to INSTALL.
Relocated misplaced #endif in png.c sRGB profile checking.
Fixed two Coverity issues in pngcp.c.
Version 1.6.24beta04 [July 8, 2016]
Avoid filter-selection heuristic sum calculations in cases where only one
filter is a candidate for selection. This trades off code size (added
private png_setup_*_row_only() functions) for speed.
Version 1.6.24beta05 [July 13, 2016]
Fixed some indentation to comply with our coding style.
Added contrib/tools/reindent.
Version 1.6.24beta06 [July 18, 2016]
Fixed more indentation to comply with our coding style.
Eliminated unnecessary tests of boolean png_isaligned() vs 0.
Version 1.6.24rc01 [July 25, 2016]
No changes.
Version 1.6.24rc02 [August 1, 2016]
Conditionally compile SSE2 headers in contrib/intel/intel_sse.patch
Conditionally compile png_decompress_chunk().
Version 1.6.24rc03 [August 2, 2016]
Conditionally compile ARM_NEON headers in pngpriv.h
Updated contrib/intel/intel_sse.patch
Version 1.6.24[August 4, 2016]
No changes.
Version 1.6.25beta01 [August 12, 2016]
Reject oversized iCCP profile immediately.
Cleaned up PNG_DEBUG compile of pngtest.c.
Conditionally compile png_inflate().
Version 1.6.25beta02 [August 18, 2016]
Don't install pngcp; it conflicts with pngcp in the pngtools package.
Minor editing of INSTALL, (whitespace, added copyright line)
Version 1.6.25rc01 [August 24, 2016]
No changes.
Version 1.6.25rc02 [August 29, 2016]
Added MIPS support (Mandar Sahastrabuddhe <Mandar.Sahastrabuddhe@imgtec.com>).
Only the UP filter is currently implemented.
Version 1.6.25rc03 [August 29, 2016]
Rebased contrib/intel/intel_sse.patch after the MIPS implementation.
Version 1.6.25rc04 [August 30, 2016]
Added MIPS support for SUB, AVG, and PAETH filters (Mandar Sahastrabuddhe).
Version 1.6.25rc05 [August 30, 2016]
Rebased contrib/intel/intel_sse.patch after the MIPS implementation update..
Version 1.6.25 [September 1, 2016]
No changes.
Version 1.6.26beta01 [September 26, 2016]
Fixed handling zero length IDAT in pngfix (bug report by Agostino Sarubbo,
bugfix by John Bowler).
Do not issue a png_error() on read in png_set_pCAL() because png_handle_pCAL
has allocated memory that libpng needs to free.
Conditionally compile png_set_benign_errors() in pngread.c and pngtest.c
Issue a png_benign_error instead of a png_error on ADLER32 mismatch
while decoding compressed data chunks.
Changed PNG_ZLIB_VERNUM to ZLIB_VERNUM in pngpriv.h, pngstruct.h, and
pngrutil.c.
If CRC handling of critical chunks has been set to PNG_CRC_QUIET_USE,
ignore the ADLER32 checksum in the IDAT chunk as well as the chunk CRCs.
Issue png_benign_error() on ADLER32 checksum mismatch instead of png_error().
Add tests/badcrc.png and tests/badadler.png to tests/pngtest.
Merged pngtest.c with libpng-1.7.0beta84/pngtest.c
Version 1.6.26beta02 [October 1, 2016]
Updated the documentation about CRC and ADLER32 handling.
Quieted 117 warnings from clang-3.8 in pngtrans.c, pngread.c,
pngwrite.c, pngunknown.c, and pngvalid.c.
Quieted 58 (out of 144) -Wconversion compiler warnings by changing
flag definitions in pngpriv.h from 0xnnnn to 0xnnnnU and trivial changes
in png.c, pngread.c, and pngwutil.c.
Version 1.6.26beta03 [October 2, 2016]
Removed contrib/libtests/*.orig and *.rej that slipped into the tarballs.
Quieted the 86 remaining -Wconversion compiler warnings by
revising the png_isaligned() macro and trivial changes in png.c,
pngerror.c, pngget.c, pngmem.c, pngset.c, pngrtran.c, pngrutil.c,
pngwtran.c, pngwrite.c, and pngwutil.c.
Version 1.6.26beta04 [October 3, 2016]
Quieted (bogus?) clang warnings about "absolute value has no effect"
when PNG_USE_ABS is defined.
Fixed offsets in contrib/intel/intel_sse.patch
Version 1.6.26beta05 [October 6, 2016]
Changed integer constant 4294967294 to unsigned 4294967294U in pngconf.h
to avoid a signed/unsigned compare in the preprocessor.
Version 1.6.26beta06 [October 7, 2016]
Use zlib-1.2.8.1 inflateValidate() instead of inflateReset2() to
optionally avoid ADLER32 evaluation.
Version 1.6.26rc01 [October 12, 2016]
No changes.
Version 1.6.26 [October 20, 2016]
Cosmetic change, "ptr != 0" to "ptr != NULL" in png.c and pngrutil.c
Despammed email addresses (replaced "@" with " at ").
Version 1.6.27beta01 [November 2, 2016]
Restrict the new ADLER32-skipping to IDAT chunks. It broke iCCP chunk
handling: an erroneous iCCP chunk would throw a png_error and reject the
entire PNG image instead of rejecting just the iCCP chunk with a warning,
if built with zlib-1.2.8.1.
Version 1.6.27rc01 [December 27, 2016]
Control ADLER32 checking with new PNG_IGNORE_ADLER32 option.
Removed the use of a macro containing the pre-processor 'defined'
operator. It is unclear whether this is valid; a macro that
"generates" 'defined' is not permitted, but the use of the word
"generates" within the C90 standard seems to imply more than simple
substitution of an expression itself containing a well-formed defined
operation.
Added ARM support to CMakeLists.txt (Andreas Franek).
Version 1.6.27 [December 29, 2016]
Fixed a potential null pointer dereference in png_set_text_2() (bug report
and patch by Patrick Keshishian, CVE-2016-10087).
Version 1.6.28rc01 [January 3, 2017]
Fixed arm/aarch64 detection in CMakeLists.txt (Gianfranco Costamagna).
Added option to Cmake build allowing a custom location of zlib to be
specified in a scenario where libpng is being built as a subproject
alongside zlib by another project (Sam Serrels).
Changed png_ptr->options from a png_byte to png_uint_32, to accomodate
up to 16 options.
Version 1.6.28rc02 [January 4, 2017]
Added "include(GNUInstallDirs)" to CMakeLists.txt (Gianfranco Costamagna).
Moved SSE2 optimization code into the main libpng source directory.
Configure libpng with "configure --enable-intel-sse" or compile
libpng with "-DPNG_INTEL_SSE" in CPPFLAGS to enable it.
Version 1.6.28rc03 [January 4, 2017]
Backed out the SSE optimization and last CMakeLists.txt to allow time for QA.
Version 1.6.28 [January 5, 2017]
No changes.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement https://lists.sourceforge.net/lists/listinfo/png-mng-implement

View file

@ -10,8 +10,8 @@ this sentence.
This code is released under the libpng license. This code is released under the libpng license.
libpng versions 1.0.7, July 1, 2000 through 1.6.23, June 9, 2016 are libpng versions 1.0.7, July 1, 2000 through 1.6.28, January 5, 2017 are
Copyright (c) 2000-2002, 2004, 2006-2016 Glenn Randers-Pehrson, are Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
derived from libpng-1.0.6, and are distributed according to the same derived from libpng-1.0.6, and are distributed according to the same
disclaimer and license as libpng-1.0.6 with the following individuals disclaimer and license as libpng-1.0.6 with the following individuals
added to the list of Contributing Authors: added to the list of Contributing Authors:
@ -22,6 +22,7 @@ added to the list of Contributing Authors:
Cosmin Truta Cosmin Truta
Gilles Vollant Gilles Vollant
James Yu James Yu
Mandar Sahastrabuddhe
and with the following additions to the disclaimer: and with the following additions to the disclaimer:
@ -127,4 +128,4 @@ any encryption software. See the EAR, paragraphs 734.3(b)(3) and
Glenn Randers-Pehrson Glenn Randers-Pehrson
glennrp at users.sourceforge.net glennrp at users.sourceforge.net
June 9, 2016 January 5, 2017

View file

@ -1,4 +1,4 @@
README for libpng version 1.6.23 - June 9, 2016 (shared library 16.0) README for libpng version 1.6.28 - January 5, 2017 (shared library 16.0)
See the note about version numbers near the top of png.h See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng. See INSTALL for instructions on how to install libpng.
@ -180,15 +180,18 @@ Files in this distribution:
pngwutil.c => Write utility functions pngwutil.c => Write utility functions
arm => Contains optimized code for the ARM platform arm => Contains optimized code for the ARM platform
contrib => Contributions contrib => Contributions
arm-neon => Optimized code for ARM-NEON platform
examples => Example programs examples => Example programs
gregbook => source code for PNG reading and writing, from gregbook => source code for PNG reading and writing, from
Greg Roelofs' "PNG: The Definitive Guide", Greg Roelofs' "PNG: The Definitive Guide",
O'Reilly, 1999 O'Reilly, 1999
intel => Optimized code for INTEL-SSE2 platform
libtests => Test programs libtests => Test programs
pngminim => Minimal decoder, encoder, and progressive decoder pngminim => Minimal decoder, encoder, and progressive decoder
programs demonstrating use of pngusr.dfa programs demonstrating use of pngusr.dfa
pngminus => Simple pnm2png and png2pnm programs pngminus => Simple pnm2png and png2pnm programs
pngsuite => Test images pngsuite => Test images
testpngs
tools => Various tools tools => Various tools
visupng => Contains a MSVC workspace for VisualPng visupng => Contains a MSVC workspace for VisualPng
projects => Contains project files and workspaces for projects => Contains project files and workspaces for

View file

@ -29,8 +29,8 @@
* However, the following notice accompanied the original version of this * However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed: * file and, per its terms, should not be removed:
* *
* Last changed in libpng 1.6.19 [November 12, 2015] * Last changed in libpng 1.6.28 [January 5, 2017]
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
* *
@ -42,7 +42,7 @@
#include "pngpriv.h" #include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */ /* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_6_23 Your_png_h_is_not_version_1_6_23; typedef png_libpng_version_1_6_28 Your_png_h_is_not_version_1_6_28;
/* Tells libpng that we have already handled the first "num_bytes" bytes /* Tells libpng that we have already handled the first "num_bytes" bytes
* of the PNG file signature. If the PNG data is embedded into another * of the PNG file signature. If the PNG data is embedded into another
@ -486,7 +486,7 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
#ifdef PNG_TEXT_SUPPORTED #ifdef PNG_TEXT_SUPPORTED
/* Free text item num or (if num == -1) all text items */ /* Free text item num or (if num == -1) all text items */
if (info_ptr->text != 0 && if (info_ptr->text != NULL &&
((mask & PNG_FREE_TEXT) & info_ptr->free_me) != 0) ((mask & PNG_FREE_TEXT) & info_ptr->free_me) != 0)
{ {
if (num != -1) if (num != -1)
@ -505,6 +505,7 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
png_free(png_ptr, info_ptr->text); png_free(png_ptr, info_ptr->text);
info_ptr->text = NULL; info_ptr->text = NULL;
info_ptr->num_text = 0; info_ptr->num_text = 0;
info_ptr->max_text = 0;
} }
} }
#endif #endif
@ -569,7 +570,7 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
#ifdef PNG_sPLT_SUPPORTED #ifdef PNG_sPLT_SUPPORTED
/* Free a given sPLT entry, or (if num == -1) all sPLT entries */ /* Free a given sPLT entry, or (if num == -1) all sPLT entries */
if (info_ptr->splt_palettes != 0 && if (info_ptr->splt_palettes != NULL &&
((mask & PNG_FREE_SPLT) & info_ptr->free_me) != 0) ((mask & PNG_FREE_SPLT) & info_ptr->free_me) != 0)
{ {
if (num != -1) if (num != -1)
@ -599,7 +600,7 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
#endif #endif
#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
if (info_ptr->unknown_chunks != 0 && if (info_ptr->unknown_chunks != NULL &&
((mask & PNG_FREE_UNKN) & info_ptr->free_me) != 0) ((mask & PNG_FREE_UNKN) & info_ptr->free_me) != 0)
{ {
if (num != -1) if (num != -1)
@ -645,7 +646,7 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
/* Free any image bits attached to the info structure */ /* Free any image bits attached to the info structure */
if (((mask & PNG_FREE_ROWS) & info_ptr->free_me) != 0) if (((mask & PNG_FREE_ROWS) & info_ptr->free_me) != 0)
{ {
if (info_ptr->row_pointers != 0) if (info_ptr->row_pointers != NULL)
{ {
png_uint_32 row; png_uint_32 row;
for (row = 0; row < info_ptr->height; row++) for (row = 0; row < info_ptr->height; row++)
@ -712,7 +713,7 @@ png_init_io(png_structrp png_ptr, png_FILE_p fp)
void PNGAPI void PNGAPI
png_save_int_32(png_bytep buf, png_int_32 i) png_save_int_32(png_bytep buf, png_int_32 i)
{ {
png_save_uint_32(buf, i); png_save_uint_32(buf, (png_uint_32)i);
} }
# endif # endif
@ -803,15 +804,15 @@ png_get_copyright(png_const_structrp png_ptr)
#else #else
# ifdef __STDC__ # ifdef __STDC__
return PNG_STRING_NEWLINE \ return PNG_STRING_NEWLINE \
"libpng version 1.6.23 - June 9, 2016" PNG_STRING_NEWLINE \ "libpng version 1.6.28 - January 5, 2017" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson" \ "Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson" \
PNG_STRING_NEWLINE \ PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE; PNG_STRING_NEWLINE;
# else # else
return "libpng version 1.6.23 - June 9, 2016\ return "libpng version 1.6.28 - January 5, 2017\
Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson\ Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
# endif # endif
@ -1959,8 +1960,8 @@ png_colorspace_set_sRGB(png_const_structrp png_ptr, png_colorspacerp colorspace,
static const png_byte D50_nCIEXYZ[12] = static const png_byte D50_nCIEXYZ[12] =
{ 0x00, 0x00, 0xf6, 0xd6, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x2d }; { 0x00, 0x00, 0xf6, 0xd6, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x2d };
int /* PRIVATE */ static int /* bool */
png_icc_check_length(png_const_structrp png_ptr, png_colorspacerp colorspace, icc_check_length(png_const_structrp png_ptr, png_colorspacerp colorspace,
png_const_charp name, png_uint_32 profile_length) png_const_charp name, png_uint_32 profile_length)
{ {
if (profile_length < 132) if (profile_length < 132)
@ -1970,6 +1971,40 @@ png_icc_check_length(png_const_structrp png_ptr, png_colorspacerp colorspace,
return 1; return 1;
} }
#ifdef PNG_READ_iCCP_SUPPORTED
int /* PRIVATE */
png_icc_check_length(png_const_structrp png_ptr, png_colorspacerp colorspace,
png_const_charp name, png_uint_32 profile_length)
{
if (!icc_check_length(png_ptr, colorspace, name, profile_length))
return 0;
/* This needs to be here because the 'normal' check is in
* png_decompress_chunk, yet this happens after the attempt to
* png_malloc_base the required data. We only need this on read; on write
* the caller supplies the profile buffer so libpng doesn't allocate it. See
* the call to icc_check_length below (the write case).
*/
# ifdef PNG_SET_USER_LIMITS_SUPPORTED
else if (png_ptr->user_chunk_malloc_max > 0 &&
png_ptr->user_chunk_malloc_max < profile_length)
return png_icc_profile_error(png_ptr, colorspace, name, profile_length,
"exceeds application limits");
# elif PNG_USER_CHUNK_MALLOC_MAX > 0
else if (PNG_USER_CHUNK_MALLOC_MAX < profile_length)
return png_icc_profile_error(png_ptr, colorspace, name, profile_length,
"exceeds libpng limits");
# else /* !SET_USER_LIMITS */
/* This will get compiled out on all 32-bit and better systems. */
else if (PNG_SIZE_MAX < profile_length)
return png_icc_profile_error(png_ptr, colorspace, name, profile_length,
"exceeds system limits");
# endif /* !SET_USER_LIMITS */
return 1;
}
#endif /* READ_iCCP */
int /* PRIVATE */ int /* PRIVATE */
png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace, png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace,
png_const_charp name, png_uint_32 profile_length, png_const_charp name, png_uint_32 profile_length,
@ -2382,7 +2417,6 @@ png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr,
return 0; /* no match */ return 0; /* no match */
} }
#endif /* PNG_sRGB_PROFILE_CHECKS >= 0 */
void /* PRIVATE */ void /* PRIVATE */
png_icc_set_sRGB(png_const_structrp png_ptr, png_icc_set_sRGB(png_const_structrp png_ptr,
@ -2391,12 +2425,11 @@ png_icc_set_sRGB(png_const_structrp png_ptr,
/* Is this profile one of the known ICC sRGB profiles? If it is, just set /* Is this profile one of the known ICC sRGB profiles? If it is, just set
* the sRGB information. * the sRGB information.
*/ */
#if PNG_sRGB_PROFILE_CHECKS >= 0
if (png_compare_ICC_profile_with_sRGB(png_ptr, profile, adler) != 0) if (png_compare_ICC_profile_with_sRGB(png_ptr, profile, adler) != 0)
#endif
(void)png_colorspace_set_sRGB(png_ptr, colorspace, (void)png_colorspace_set_sRGB(png_ptr, colorspace,
(int)/*already checked*/png_get_uint_32(profile+64)); (int)/*already checked*/png_get_uint_32(profile+64));
} }
#endif /* PNG_sRGB_PROFILE_CHECKS >= 0 */
#endif /* sRGB */ #endif /* sRGB */
int /* PRIVATE */ int /* PRIVATE */
@ -2407,13 +2440,13 @@ png_colorspace_set_ICC(png_const_structrp png_ptr, png_colorspacerp colorspace,
if ((colorspace->flags & PNG_COLORSPACE_INVALID) != 0) if ((colorspace->flags & PNG_COLORSPACE_INVALID) != 0)
return 0; return 0;
if (png_icc_check_length(png_ptr, colorspace, name, profile_length) != 0 && if (icc_check_length(png_ptr, colorspace, name, profile_length) != 0 &&
png_icc_check_header(png_ptr, colorspace, name, profile_length, profile, png_icc_check_header(png_ptr, colorspace, name, profile_length, profile,
color_type) != 0 && color_type) != 0 &&
png_icc_check_tag_table(png_ptr, colorspace, name, profile_length, png_icc_check_tag_table(png_ptr, colorspace, name, profile_length,
profile) != 0) profile) != 0)
{ {
# ifdef PNG_sRGB_SUPPORTED # if defined(PNG_sRGB_SUPPORTED) && PNG_sRGB_PROFILE_CHECKS >= 0
/* If no sRGB support, don't try storing sRGB information */ /* If no sRGB support, don't try storing sRGB information */
png_icc_set_sRGB(png_ptr, colorspace, profile, 0); png_icc_set_sRGB(png_ptr, colorspace, profile, 0);
# endif # endif
@ -2525,7 +2558,7 @@ png_check_IHDR(png_const_structrp png_ptr,
error = 1; error = 1;
} }
if (png_gt(((width + 7) & (~7)), if (png_gt(((width + 7) & (~7U)),
((PNG_SIZE_MAX ((PNG_SIZE_MAX
- 48 /* big_row_buf hack */ - 48 /* big_row_buf hack */
- 1) /* filter byte */ - 1) /* filter byte */
@ -2936,7 +2969,7 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
*/ */
if (exp_b10 < 0 && exp_b10 > -3) /* PLUS 3 TOTAL 4 */ if (exp_b10 < 0 && exp_b10 > -3) /* PLUS 3 TOTAL 4 */
{ {
czero = -exp_b10; /* PLUS 2 digits: TOTAL 3 */ czero = (unsigned int)(-exp_b10); /* PLUS 2 digits: TOTAL 3 */
exp_b10 = 0; /* Dot added below before first output. */ exp_b10 = 0; /* Dot added below before first output. */
} }
else else
@ -3114,11 +3147,11 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, png_size_t size,
if (exp_b10 < 0) if (exp_b10 < 0)
{ {
*ascii++ = 45, --size; /* '-': PLUS 1 TOTAL 3+precision */ *ascii++ = 45, --size; /* '-': PLUS 1 TOTAL 3+precision */
uexp_b10 = -exp_b10; uexp_b10 = (unsigned int)(-exp_b10);
} }
else else
uexp_b10 = exp_b10; uexp_b10 = (unsigned int)exp_b10;
cdigits = 0; cdigits = 0;
@ -3180,9 +3213,9 @@ png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii,
/* Avoid overflow here on the minimum integer. */ /* Avoid overflow here on the minimum integer. */
if (fp < 0) if (fp < 0)
*ascii++ = 45, num = -fp; *ascii++ = 45, num = (png_uint_32)(-fp);
else else
num = fp; num = (png_uint_32)fp;
if (num <= 0x80000000) /* else overflowed */ if (num <= 0x80000000) /* else overflowed */
{ {
@ -4120,9 +4153,9 @@ png_build_gamma_table(png_structrp png_ptr, int bit_depth)
/* Remove any existing table; this copes with multiple calls to /* Remove any existing table; this copes with multiple calls to
* png_read_update_info. The warning is because building the gamma tables * png_read_update_info. The warning is because building the gamma tables
* multiple times is a performance hit - it's harmless but the ability to call * multiple times is a performance hit - it's harmless but the ability to
* png_read_update_info() multiple times is new in 1.5.6 so it seems sensible * call png_read_update_info() multiple times is new in 1.5.6 so it seems
* to warn if the app introduces such a hit. * sensible to warn if the app introduces such a hit.
*/ */
if (png_ptr->gamma_table != NULL || png_ptr->gamma_16_table != NULL) if (png_ptr->gamma_table != NULL || png_ptr->gamma_16_table != NULL)
{ {
@ -4133,7 +4166,8 @@ png_build_gamma_table(png_structrp png_ptr, int bit_depth)
if (bit_depth <= 8) if (bit_depth <= 8)
{ {
png_build_8bit_table(png_ptr, &png_ptr->gamma_table, png_build_8bit_table(png_ptr, &png_ptr->gamma_table,
png_ptr->screen_gamma > 0 ? png_reciprocal2(png_ptr->colorspace.gamma, png_ptr->screen_gamma > 0 ?
png_reciprocal2(png_ptr->colorspace.gamma,
png_ptr->screen_gamma) : PNG_FP_1); png_ptr->screen_gamma) : PNG_FP_1);
#if defined(PNG_READ_BACKGROUND_SUPPORTED) || \ #if defined(PNG_READ_BACKGROUND_SUPPORTED) || \
@ -4145,7 +4179,8 @@ png_build_gamma_table(png_structrp png_ptr, int bit_depth)
png_reciprocal(png_ptr->colorspace.gamma)); png_reciprocal(png_ptr->colorspace.gamma));
png_build_8bit_table(png_ptr, &png_ptr->gamma_from_1, png_build_8bit_table(png_ptr, &png_ptr->gamma_from_1,
png_ptr->screen_gamma > 0 ? png_reciprocal(png_ptr->screen_gamma) : png_ptr->screen_gamma > 0 ?
png_reciprocal(png_ptr->screen_gamma) :
png_ptr->colorspace.gamma/* Probably doing rgb_to_gray */); png_ptr->colorspace.gamma/* Probably doing rgb_to_gray */);
} }
#endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */ #endif /* READ_BACKGROUND || READ_ALPHA_MODE || RGB_TO_GRAY */
@ -4176,8 +4211,8 @@ png_build_gamma_table(png_structrp png_ptr, int bit_depth)
* pow(iv, gamma). * pow(iv, gamma).
* *
* Thus the gamma table consists of up to 256 256-entry tables. The table * Thus the gamma table consists of up to 256 256-entry tables. The table
* is selected by the (8-gamma_shift) most significant of the low 8 bits of * is selected by the (8-gamma_shift) most significant of the low 8 bits
* the color value then indexed by the upper 8 bits: * of the color value then indexed by the upper 8 bits:
* *
* table[low bits][high 8 bits] * table[low bits][high 8 bits]
* *
@ -4210,8 +4245,8 @@ png_build_gamma_table(png_structrp png_ptr, int bit_depth)
/* NOTE: prior to 1.5.4 this test used to include PNG_BACKGROUND (now /* NOTE: prior to 1.5.4 this test used to include PNG_BACKGROUND (now
* PNG_COMPOSE). This effectively smashed the background calculation for * PNG_COMPOSE). This effectively smashed the background calculation for
* 16-bit output because the 8-bit table assumes the result will be reduced * 16-bit output because the 8-bit table assumes the result will be
* to 8 bits. * reduced to 8 bits.
*/ */
if ((png_ptr->transformations & (PNG_16_TO_8 | PNG_SCALE_16_TO_8)) != 0) if ((png_ptr->transformations & (PNG_16_TO_8 | PNG_SCALE_16_TO_8)) != 0)
png_build_16to8_table(png_ptr, &png_ptr->gamma_16_table, shift, png_build_16to8_table(png_ptr, &png_ptr->gamma_16_table, shift,
@ -4253,11 +4288,11 @@ png_set_option(png_structrp png_ptr, int option, int onoff)
if (png_ptr != NULL && option >= 0 && option < PNG_OPTION_NEXT && if (png_ptr != NULL && option >= 0 && option < PNG_OPTION_NEXT &&
(option & 1) == 0) (option & 1) == 0)
{ {
int mask = 3 << option; png_uint_32 mask = 3 << option;
int setting = (2 + (onoff != 0)) << option; png_uint_32 setting = (2 + (onoff != 0)) << option;
int current = png_ptr->options; png_uint_32 current = png_ptr->options;
png_ptr->options = (png_byte)(((current & ~mask) | setting) & 0xff); png_ptr->options = (png_uint_32)(((current & ~mask) | setting) & 0xff);
return (current & mask) >> option; return (current & mask) >> option;
} }

View file

@ -29,9 +29,9 @@
* However, the following notice accompanied the original version of this * However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed: * file and, per its terms, should not be removed:
* *
* libpng version 1.6.23, June 9, 2016 * libpng version 1.6.28, January 5, 2017
* *
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
* *
@ -40,7 +40,7 @@
* Authors and maintainers: * Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger * libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.6.23, June 9, 2016: * libpng versions 0.97, January 1998, through 1.6.28, January 5, 2017:
* Glenn Randers-Pehrson. * Glenn Randers-Pehrson.
* See also "Contributing Authors", below. * See also "Contributing Authors", below.
*/ */
@ -53,12 +53,8 @@
* *
* This code is released under the libpng license. * This code is released under the libpng license.
* *
* Some files in the "contrib" directory and some configure-generated * libpng versions 1.0.7, July 1, 2000 through 1.6.28, January 5, 2017 are
* files that are distributed with libpng have other copyright owners and * Copyright (c) 2000-2002, 2004, 2006-2017 Glenn Randers-Pehrson, are
* are released under other open source licenses.
*
* libpng versions 1.0.7, July 1, 2000 through 1.6.23, June 9, 2016 are
* Copyright (c) 2000-2002, 2004, 2006-2016 Glenn Randers-Pehrson, are
* derived from libpng-1.0.6, and are distributed according to the same * derived from libpng-1.0.6, and are distributed according to the same
* disclaimer and license as libpng-1.0.6 with the following individuals * disclaimer and license as libpng-1.0.6 with the following individuals
* added to the list of Contributing Authors: * added to the list of Contributing Authors:
@ -69,6 +65,7 @@
* Cosmin Truta * Cosmin Truta
* Gilles Vollant * Gilles Vollant
* James Yu * James Yu
* Mandar Sahastrabuddhe
* *
* and with the following additions to the disclaimer: * and with the following additions to the disclaimer:
* *
@ -79,10 +76,10 @@
* risk of satisfactory quality, performance, accuracy, and effort is with * risk of satisfactory quality, performance, accuracy, and effort is with
* the user. * the user.
* *
* Some files in the "contrib" directory have other copyright owners and * Some files in the "contrib" directory and some configure-generated
* files that are distributed with libpng have other copyright owners and
* are released under other open source licenses. * are released under other open source licenses.
* *
*
* libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are * libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
* Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from * Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
* libpng-0.96, and are distributed according to the same disclaimer and * libpng-0.96, and are distributed according to the same disclaimer and
@ -93,9 +90,6 @@
* Glenn Randers-Pehrson * Glenn Randers-Pehrson
* Willem van Schaik * Willem van Schaik
* *
* Some files in the "scripts" directory have different copyright owners
* but are also released under this license.
*
* libpng versions 0.89, June 1996, through 0.96, May 1997, are * libpng versions 0.89, June 1996, through 0.96, May 1997, are
* Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88, * Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
* and are distributed according to the same disclaimer and license as * and are distributed according to the same disclaimer and license as
@ -241,11 +235,11 @@
* ... * ...
* 1.0.19 10 10019 10.so.0.19[.0] * 1.0.19 10 10019 10.so.0.19[.0]
* ... * ...
* 1.2.56 13 10256 12.so.0.56[.0] * 1.2.57 13 10257 12.so.0.57[.0]
* ... * ...
* 1.5.27 15 10527 15.so.15.27[.0] * 1.5.28 15 10527 15.so.15.28[.0]
* ... * ...
* 1.6.23 16 10623 16.so.16.23[.0] * 1.6.28 16 10628 16.so.16.28[.0]
* *
* Henceforth the source version will match the shared-library major * Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be * and minor numbers; the shared-library major version number will be
@ -273,13 +267,13 @@
* Y2K compliance in libpng: * Y2K compliance in libpng:
* ========================= * =========================
* *
* June 9, 2016 * January 5, 2017
* *
* Since the PNG Development group is an ad-hoc body, we can't make * Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration. * an official declaration.
* *
* This is your unofficial assurance that libpng from version 0.71 and * This is your unofficial assurance that libpng from version 0.71 and
* upward through 1.6.23 are Y2K compliant. It is my belief that * upward through 1.6.28 are Y2K compliant. It is my belief that
* earlier versions were also Y2K compliant. * earlier versions were also Y2K compliant.
* *
* Libpng only has two year fields. One is a 2-byte unsigned integer * Libpng only has two year fields. One is a 2-byte unsigned integer
@ -341,9 +335,8 @@
*/ */
/* Version information for png.h - this should match the version in png.c */ /* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.6.23" #define PNG_LIBPNG_VER_STRING "1.6.28"
#define PNG_HEADER_VERSION_STRING \ #define PNG_HEADER_VERSION_STRING " libpng version 1.6.28 - January 5, 2017\n"
" libpng version 1.6.23 - June 9, 2016\n"
#define PNG_LIBPNG_VER_SONUM 16 #define PNG_LIBPNG_VER_SONUM 16
#define PNG_LIBPNG_VER_DLLNUM 16 #define PNG_LIBPNG_VER_DLLNUM 16
@ -351,7 +344,7 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1 #define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 6 #define PNG_LIBPNG_VER_MINOR 6
#define PNG_LIBPNG_VER_RELEASE 23 #define PNG_LIBPNG_VER_RELEASE 28
/* This should match the numeric part of the final component of /* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero: * PNG_LIBPNG_VER_STRING, omitting any leading zero:
@ -382,7 +375,7 @@
* version 1.0.0 was mis-numbered 100 instead of 10000). From * version 1.0.0 was mis-numbered 100 instead of 10000). From
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
*/ */
#define PNG_LIBPNG_VER 10623 /* 1.6.23 */ #define PNG_LIBPNG_VER 10628 /* 1.6.28 */
/* Library configuration: these options cannot be changed after /* Library configuration: these options cannot be changed after
* the library has been built. * the library has been built.
@ -492,7 +485,7 @@ extern "C" {
/* This triggers a compiler error in png.c, if png.c and png.h /* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number. * do not agree upon the version number.
*/ */
typedef char* png_libpng_version_1_6_23; typedef char* png_libpng_version_1_6_28;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info. /* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
* *
@ -2328,8 +2321,10 @@ PNG_EXPORT(171, void, png_set_sCAL_s, (png_const_structrp png_ptr,
* except for the IHDR, PLTE, tRNS, IDAT, and IEND chunks (which continue to * except for the IHDR, PLTE, tRNS, IDAT, and IEND chunks (which continue to
* be processed by libpng. * be processed by libpng.
*/ */
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
PNG_EXPORT(172, void, png_set_keep_unknown_chunks, (png_structrp png_ptr, PNG_EXPORT(172, void, png_set_keep_unknown_chunks, (png_structrp png_ptr,
int keep, png_const_bytep chunk_list, int num_chunks)); int keep, png_const_bytep chunk_list, int num_chunks));
#endif /* HANDLE_AS_UNKNOWN */
/* The "keep" PNG_HANDLE_CHUNK_ parameter for the specified chunk is returned; /* The "keep" PNG_HANDLE_CHUNK_ parameter for the specified chunk is returned;
* the result is therefore true (non-zero) if special handling is required, * the result is therefore true (non-zero) if special handling is required,
@ -2337,7 +2332,7 @@ PNG_EXPORT(172, void, png_set_keep_unknown_chunks, (png_structrp png_ptr,
*/ */
PNG_EXPORT(173, int, png_handle_as_unknown, (png_const_structrp png_ptr, PNG_EXPORT(173, int, png_handle_as_unknown, (png_const_structrp png_ptr,
png_const_bytep chunk_name)); png_const_bytep chunk_name));
#endif #endif /* SET_UNKNOWN_CHUNKS */
#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
PNG_EXPORT(174, void, png_set_unknown_chunks, (png_const_structrp png_ptr, PNG_EXPORT(174, void, png_set_unknown_chunks, (png_const_structrp png_ptr,
@ -2559,18 +2554,22 @@ PNG_EXPORT(216, png_uint_32, png_get_io_chunk_type,
/* fg and bg should be in `gamma 1.0' space; alpha is the opacity */ /* fg and bg should be in `gamma 1.0' space; alpha is the opacity */
# define png_composite(composite, fg, alpha, bg) \ # define png_composite(composite, fg, alpha, bg) \
{ png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \ { \
png_uint_16 temp = (png_uint_16)((png_uint_16)(fg) \
* (png_uint_16)(alpha) \ * (png_uint_16)(alpha) \
+ (png_uint_16)(bg)*(png_uint_16)(255 \ + (png_uint_16)(bg)*(png_uint_16)(255 \
- (png_uint_16)(alpha)) + 128); \ - (png_uint_16)(alpha)) + 128); \
(composite) = (png_byte)(((temp + (temp >> 8)) >> 8) & 0xff); } (composite) = (png_byte)(((temp + (temp >> 8)) >> 8) & 0xff); \
}
# define png_composite_16(composite, fg, alpha, bg) \ # define png_composite_16(composite, fg, alpha, bg) \
{ png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) \ { \
png_uint_32 temp = (png_uint_32)((png_uint_32)(fg) \
* (png_uint_32)(alpha) \ * (png_uint_32)(alpha) \
+ (png_uint_32)(bg)*(65535 \ + (png_uint_32)(bg)*(65535 \
- (png_uint_32)(alpha)) + 32768); \ - (png_uint_32)(alpha)) + 32768); \
(composite) = (png_uint_16)(0xffff & ((temp + (temp >> 16)) >> 16)); } (composite) = (png_uint_16)(0xffff & ((temp + (temp >> 16)) >> 16)); \
}
#else /* Standard method using integer division */ #else /* Standard method using integer division */
@ -3249,7 +3248,11 @@ PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory,
#endif #endif
#define PNG_MAXIMUM_INFLATE_WINDOW 2 /* SOFTWARE: force maximum window */ #define PNG_MAXIMUM_INFLATE_WINDOW 2 /* SOFTWARE: force maximum window */
#define PNG_SKIP_sRGB_CHECK_PROFILE 4 /* SOFTWARE: Check ICC profile for sRGB */ #define PNG_SKIP_sRGB_CHECK_PROFILE 4 /* SOFTWARE: Check ICC profile for sRGB */
#define PNG_OPTION_NEXT 6 /* Next option - numbers must be even */ #ifdef PNG_MIPS_MSA_API_SUPPORTED
# define PNG_MIPS_MSA 6 /* HARDWARE: MIPS Msa SIMD instructions supported */
#endif
#define PNG_IGNORE_ADLER32 8
#define PNG_OPTION_NEXT 10 /* Next option - numbers must be even */
/* Return values: NOTE: there are four values and 'off' is *not* zero */ /* Return values: NOTE: there are four values and 'off' is *not* zero */
#define PNG_OPTION_UNSET 0 /* Unset - defaults to off */ #define PNG_OPTION_UNSET 0 /* Unset - defaults to off */

View file

@ -29,9 +29,9 @@
* However, the following notice accompanied the original version of this * However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed: * file and, per its terms, should not be removed:
* *
* libpng version 1.6.23, June 9, 2016 * libpng version 1.6.28, January 5, 2017
* *
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
* *
@ -535,9 +535,9 @@
# error "libpng requires a signed 32-bit (or more) type" # error "libpng requires a signed 32-bit (or more) type"
#endif #endif
#if UINT_MAX > 4294967294 #if UINT_MAX > 4294967294U
typedef unsigned int png_uint_32; typedef unsigned int png_uint_32;
#elif ULONG_MAX > 4294967294 #elif ULONG_MAX > 4294967294U
typedef unsigned long int png_uint_32; typedef unsigned long int png_uint_32;
#else #else
# error "libpng requires an unsigned 32-bit (or more) type" # error "libpng requires an unsigned 32-bit (or more) type"

View file

@ -29,8 +29,8 @@
* However, the following notice accompanied the original version of this * However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed: * file and, per its terms, should not be removed:
* *
* Last changed in libpng 1.6.15 [November 20, 2014] * Last changed in libpng 1.6.26 [October 20, 2016]
* Copyright (c) 1998-2002,2004,2006-2014 Glenn Randers-Pehrson * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
* *
@ -601,7 +601,7 @@ png_fixed_error,(png_const_structrp png_ptr, png_const_charp name),PNG_NORETURN)
{ {
# define fixed_message "fixed point overflow in " # define fixed_message "fixed point overflow in "
# define fixed_message_ln ((sizeof fixed_message)-1) # define fixed_message_ln ((sizeof fixed_message)-1)
int iin; unsigned int iin;
char msg[fixed_message_ln+PNG_MAX_ERROR_TEXT]; char msg[fixed_message_ln+PNG_MAX_ERROR_TEXT];
memcpy(msg, fixed_message, fixed_message_ln); memcpy(msg, fixed_message, fixed_message_ln);
iin = 0; iin = 0;

View file

@ -28,9 +28,9 @@
* License version 2 only, as published by the Free Software Foundation. * License version 2 only, as published by the Free Software Foundation.
* However, the following notice accompanied the original version of this * However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed: * file and, per its terms, should not be removed:
*
* Last changed in libpng 1.6.17 [March 26, 2015] * Last changed in libpng 1.6.26 [October 20, 2016]
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
* *
@ -366,7 +366,7 @@ ppi_from_ppm(png_uint_32 ppm)
png_fixed_point result; png_fixed_point result;
if (ppm <= PNG_UINT_31_MAX && png_muldiv(&result, (png_int_32)ppm, 127, if (ppm <= PNG_UINT_31_MAX && png_muldiv(&result, (png_int_32)ppm, 127,
5000) != 0) 5000) != 0)
return result; return (png_uint_32)result;
/* Overflow. */ /* Overflow. */
return 0; return 0;

View file

@ -33,7 +33,7 @@
* file and, per its terms, should not be removed: * file and, per its terms, should not be removed:
*/ */
/* libpng version 1.6.23, June 9, 2016 */ /* libpng version 1.6.28, January 5, 2017 */
/* Copyright (c) 1998-2016 Glenn Randers-Pehrson */ /* Copyright (c) 1998-2016 Glenn Randers-Pehrson */
@ -83,7 +83,7 @@
#define PNG_READ_BGR_SUPPORTED #define PNG_READ_BGR_SUPPORTED
#define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED #define PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
#define PNG_READ_COMPOSITE_NODIV_SUPPORTED #define PNG_READ_COMPOSITE_NODIV_SUPPORTED
#define PNG_READ_COMPRESSED_TEXT_SUPPORTED /*#undef PNG_READ_COMPRESSED_TEXT_SUPPORTED*/
#define PNG_READ_EXPAND_16_SUPPORTED #define PNG_READ_EXPAND_16_SUPPORTED
#define PNG_READ_EXPAND_SUPPORTED #define PNG_READ_EXPAND_SUPPORTED
#define PNG_READ_FILLER_SUPPORTED #define PNG_READ_FILLER_SUPPORTED
@ -115,8 +115,8 @@
#define PNG_READ_cHRM_SUPPORTED #define PNG_READ_cHRM_SUPPORTED
#define PNG_READ_gAMA_SUPPORTED #define PNG_READ_gAMA_SUPPORTED
#define PNG_READ_hIST_SUPPORTED #define PNG_READ_hIST_SUPPORTED
#define PNG_READ_iCCP_SUPPORTED /*#undef PNG_READ_iCCP_SUPPORTED*/
#define PNG_READ_iTXt_SUPPORTED /*#undef PNG_READ_iTXt_SUPPORTED*/
#define PNG_READ_oFFs_SUPPORTED #define PNG_READ_oFFs_SUPPORTED
#define PNG_READ_pCAL_SUPPORTED #define PNG_READ_pCAL_SUPPORTED
#define PNG_READ_pHYs_SUPPORTED #define PNG_READ_pHYs_SUPPORTED
@ -127,7 +127,7 @@
#define PNG_READ_tEXt_SUPPORTED #define PNG_READ_tEXt_SUPPORTED
#define PNG_READ_tIME_SUPPORTED #define PNG_READ_tIME_SUPPORTED
#define PNG_READ_tRNS_SUPPORTED #define PNG_READ_tRNS_SUPPORTED
#define PNG_READ_zTXt_SUPPORTED /*#undef PNG_READ_zTXt_SUPPORTED*/
/*#undef PNG_SAVE_INT_32_SUPPORTED*/ /*#undef PNG_SAVE_INT_32_SUPPORTED*/
#define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED #define PNG_SAVE_UNKNOWN_CHUNKS_SUPPORTED
#define PNG_SEQUENTIAL_READ_SUPPORTED #define PNG_SEQUENTIAL_READ_SUPPORTED
@ -231,10 +231,10 @@
#define PNG_QUANTIZE_RED_BITS 5 #define PNG_QUANTIZE_RED_BITS 5
#define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1) #define PNG_TEXT_Z_DEFAULT_COMPRESSION (-1)
#define PNG_TEXT_Z_DEFAULT_STRATEGY 0 #define PNG_TEXT_Z_DEFAULT_STRATEGY 0
#define PNG_USER_CHUNK_CACHE_MAX 0 #define PNG_USER_CHUNK_CACHE_MAX 1000
#define PNG_USER_CHUNK_MALLOC_MAX 0 #define PNG_USER_CHUNK_MALLOC_MAX 8000000
#define PNG_USER_HEIGHT_MAX 1000000 #define PNG_USER_HEIGHT_MAX 8000
#define PNG_USER_WIDTH_MAX 1000000 #define PNG_USER_WIDTH_MAX 8000
#define PNG_ZBUF_SIZE 8192 #define PNG_ZBUF_SIZE 8192
#define PNG_ZLIB_VERNUM 0 #define PNG_ZLIB_VERNUM 0
#define PNG_Z_DEFAULT_COMPRESSION (-1) #define PNG_Z_DEFAULT_COMPRESSION (-1)

View file

@ -29,8 +29,8 @@
* However, the following notice accompanied the original version of this * However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed: * file and, per its terms, should not be removed:
* *
* Last changed in libpng 1.6.15 [November 20, 2014] * Last changed in libpng 1.6.26 [October 20, 2016]
* Copyright (c) 1998-2002,2004,2006-2014 Glenn Randers-Pehrson * Copyright (c) 1998-2002,2004,2006-2014,2016 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
* *
@ -137,7 +137,7 @@ static png_voidp
png_malloc_array_checked(png_const_structrp png_ptr, int nelements, png_malloc_array_checked(png_const_structrp png_ptr, int nelements,
size_t element_size) size_t element_size)
{ {
png_alloc_size_t req = nelements; /* known to be > 0 */ png_alloc_size_t req = (png_alloc_size_t)nelements; /* known to be > 0 */
if (req <= PNG_SIZE_MAX/element_size) if (req <= PNG_SIZE_MAX/element_size)
return png_malloc_base(png_ptr, req * element_size); return png_malloc_base(png_ptr, req * element_size);

View file

@ -29,7 +29,7 @@
* However, the following notice accompanied the original version of this * However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed: * file and, per its terms, should not be removed:
* *
* Last changed in libpng 1.6.23 [June 9, 2016] * Last changed in libpng 1.6.24 [August 4, 2016]
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -711,8 +711,13 @@ png_process_IDAT_data(png_structrp png_ptr, png_bytep buffer,
png_ptr->pass > 6) png_ptr->pass > 6)
png_warning(png_ptr, "Truncated compressed data in IDAT"); png_warning(png_ptr, "Truncated compressed data in IDAT");
else
{
if (ret == Z_DATA_ERROR)
png_benign_error(png_ptr, "IDAT: ADLER32 checksum mismatch");
else else
png_error(png_ptr, "Decompression error in IDAT"); png_error(png_ptr, "Decompression error in IDAT");
}
/* Skip the check on unprocessed input */ /* Skip the check on unprocessed input */
return; return;

View file

@ -29,7 +29,7 @@
* However, the following notice accompanied the original version of this * However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed: * file and, per its terms, should not be removed:
* *
* Last changed in libpng 1.6.22 [May 26, 2016] * Last changed in libpng 1.6.26 [October 20, 2016]
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -210,6 +210,35 @@
# endif # endif
#endif /* PNG_ARM_NEON_OPT > 0 */ #endif /* PNG_ARM_NEON_OPT > 0 */
#ifndef PNG_MIPS_MSA_OPT
# if defined(__mips_msa) && (__mips_isa_rev >= 5) && defined(PNG_ALIGNED_MEMORY_SUPPORTED)
# define PNG_MIPS_MSA_OPT 2
# else
# define PNG_MIPS_MSA_OPT 0
# endif
#endif
#if PNG_MIPS_MSA_OPT > 0
# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_msa
# ifndef PNG_MIPS_MSA_IMPLEMENTATION
# if defined(__mips_msa)
# if defined(__clang__)
# elif defined(__GNUC__)
# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)
# define PNG_MIPS_MSA_IMPLEMENTATION 2
# endif /* no GNUC support */
# endif /* __GNUC__ */
# else /* !defined __mips_msa */
# define PNG_MIPS_MSA_IMPLEMENTATION 2
# endif /* __mips_msa */
# endif /* !PNG_MIPS_MSA_IMPLEMENTATION */
# ifndef PNG_MIPS_MSA_IMPLEMENTATION
# define PNG_MIPS_MSA_IMPLEMENTATION 1
# endif
#endif /* PNG_MIPS_MSA_OPT > 0 */
/* Is this a build of a DLL where compilation of the object modules requires /* Is this a build of a DLL where compilation of the object modules requires
* different preprocessor settings to those required for a simple library? If * different preprocessor settings to those required for a simple library? If
* so PNG_BUILD_DLL must be set. * so PNG_BUILD_DLL must be set.
@ -532,7 +561,8 @@
/* This implicitly assumes alignment is always to a power of 2. */ /* This implicitly assumes alignment is always to a power of 2. */
#ifdef png_alignof #ifdef png_alignof
# define png_isaligned(ptr, type)\ # define png_isaligned(ptr, type)\
((((const char*)ptr-(const char*)0) & (png_alignof(type)-1)) == 0) (((type)((const char*)ptr-(const char*)0) & \
(type)(png_alignof(type)-1)) == 0)
#else #else
# define png_isaligned(ptr, type) 0 # define png_isaligned(ptr, type) 0
#endif #endif
@ -549,92 +579,92 @@
* are defined in png.h because they need to be visible to applications * are defined in png.h because they need to be visible to applications
* that call png_set_unknown_chunk(). * that call png_set_unknown_chunk().
*/ */
/* #define PNG_HAVE_IHDR 0x01 (defined in png.h) */ /* #define PNG_HAVE_IHDR 0x01U (defined in png.h) */
/* #define PNG_HAVE_PLTE 0x02 (defined in png.h) */ /* #define PNG_HAVE_PLTE 0x02U (defined in png.h) */
#define PNG_HAVE_IDAT 0x04 #define PNG_HAVE_IDAT 0x04U
/* #define PNG_AFTER_IDAT 0x08 (defined in png.h) */ /* #define PNG_AFTER_IDAT 0x08U (defined in png.h) */
#define PNG_HAVE_IEND 0x10 #define PNG_HAVE_IEND 0x10U
/* 0x20 (unused) */ /* 0x20U (unused) */
/* 0x40 (unused) */ /* 0x40U (unused) */
/* 0x80 (unused) */ /* 0x80U (unused) */
#define PNG_HAVE_CHUNK_HEADER 0x100 #define PNG_HAVE_CHUNK_HEADER 0x100U
#define PNG_WROTE_tIME 0x200 #define PNG_WROTE_tIME 0x200U
#define PNG_WROTE_INFO_BEFORE_PLTE 0x400 #define PNG_WROTE_INFO_BEFORE_PLTE 0x400U
#define PNG_BACKGROUND_IS_GRAY 0x800 #define PNG_BACKGROUND_IS_GRAY 0x800U
#define PNG_HAVE_PNG_SIGNATURE 0x1000 #define PNG_HAVE_PNG_SIGNATURE 0x1000U
#define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000 /* Have another chunk after IDAT */ #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000U /* Have another chunk after IDAT */
/* 0x4000 (unused) */ /* 0x4000U (unused) */
#define PNG_IS_READ_STRUCT 0x8000 /* Else is a write struct */ #define PNG_IS_READ_STRUCT 0x8000U /* Else is a write struct */
/* Flags for the transformations the PNG library does on the image data */ /* Flags for the transformations the PNG library does on the image data */
#define PNG_BGR 0x0001 #define PNG_BGR 0x0001U
#define PNG_INTERLACE 0x0002 #define PNG_INTERLACE 0x0002U
#define PNG_PACK 0x0004 #define PNG_PACK 0x0004U
#define PNG_SHIFT 0x0008 #define PNG_SHIFT 0x0008U
#define PNG_SWAP_BYTES 0x0010 #define PNG_SWAP_BYTES 0x0010U
#define PNG_INVERT_MONO 0x0020 #define PNG_INVERT_MONO 0x0020U
#define PNG_QUANTIZE 0x0040 #define PNG_QUANTIZE 0x0040U
#define PNG_COMPOSE 0x0080 /* Was PNG_BACKGROUND */ #define PNG_COMPOSE 0x0080U /* Was PNG_BACKGROUND */
#define PNG_BACKGROUND_EXPAND 0x0100 #define PNG_BACKGROUND_EXPAND 0x0100U
#define PNG_EXPAND_16 0x0200 /* Added to libpng 1.5.2 */ #define PNG_EXPAND_16 0x0200U /* Added to libpng 1.5.2 */
#define PNG_16_TO_8 0x0400 /* Becomes 'chop' in 1.5.4 */ #define PNG_16_TO_8 0x0400U /* Becomes 'chop' in 1.5.4 */
#define PNG_RGBA 0x0800 #define PNG_RGBA 0x0800U
#define PNG_EXPAND 0x1000 #define PNG_EXPAND 0x1000U
#define PNG_GAMMA 0x2000 #define PNG_GAMMA 0x2000U
#define PNG_GRAY_TO_RGB 0x4000 #define PNG_GRAY_TO_RGB 0x4000U
#define PNG_FILLER 0x8000 #define PNG_FILLER 0x8000U
#define PNG_PACKSWAP 0x10000 #define PNG_PACKSWAP 0x10000U
#define PNG_SWAP_ALPHA 0x20000 #define PNG_SWAP_ALPHA 0x20000U
#define PNG_STRIP_ALPHA 0x40000 #define PNG_STRIP_ALPHA 0x40000U
#define PNG_INVERT_ALPHA 0x80000 #define PNG_INVERT_ALPHA 0x80000U
#define PNG_USER_TRANSFORM 0x100000 #define PNG_USER_TRANSFORM 0x100000U
#define PNG_RGB_TO_GRAY_ERR 0x200000 #define PNG_RGB_TO_GRAY_ERR 0x200000U
#define PNG_RGB_TO_GRAY_WARN 0x400000 #define PNG_RGB_TO_GRAY_WARN 0x400000U
#define PNG_RGB_TO_GRAY 0x600000 /* two bits, RGB_TO_GRAY_ERR|WARN */ #define PNG_RGB_TO_GRAY 0x600000U /* two bits, RGB_TO_GRAY_ERR|WARN */
#define PNG_ENCODE_ALPHA 0x800000 /* Added to libpng-1.5.4 */ #define PNG_ENCODE_ALPHA 0x800000U /* Added to libpng-1.5.4 */
#define PNG_ADD_ALPHA 0x1000000 /* Added to libpng-1.2.7 */ #define PNG_ADD_ALPHA 0x1000000U /* Added to libpng-1.2.7 */
#define PNG_EXPAND_tRNS 0x2000000 /* Added to libpng-1.2.9 */ #define PNG_EXPAND_tRNS 0x2000000U /* Added to libpng-1.2.9 */
#define PNG_SCALE_16_TO_8 0x4000000 /* Added to libpng-1.5.4 */ #define PNG_SCALE_16_TO_8 0x4000000U /* Added to libpng-1.5.4 */
/* 0x8000000 unused */ /* 0x8000000U unused */
/* 0x10000000 unused */ /* 0x10000000U unused */
/* 0x20000000 unused */ /* 0x20000000U unused */
/* 0x40000000 unused */ /* 0x40000000U unused */
/* Flags for png_create_struct */ /* Flags for png_create_struct */
#define PNG_STRUCT_PNG 0x0001 #define PNG_STRUCT_PNG 0x0001U
#define PNG_STRUCT_INFO 0x0002 #define PNG_STRUCT_INFO 0x0002U
/* Flags for the png_ptr->flags rather than declaring a byte for each one */ /* Flags for the png_ptr->flags rather than declaring a byte for each one */
#define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001 #define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001U
#define PNG_FLAG_ZSTREAM_INITIALIZED 0x0002 /* Added to libpng-1.6.0 */ #define PNG_FLAG_ZSTREAM_INITIALIZED 0x0002U /* Added to libpng-1.6.0 */
/* 0x0004 unused */ /* 0x0004U unused */
#define PNG_FLAG_ZSTREAM_ENDED 0x0008 /* Added to libpng-1.6.0 */ #define PNG_FLAG_ZSTREAM_ENDED 0x0008U /* Added to libpng-1.6.0 */
/* 0x0010 unused */ /* 0x0010U unused */
/* 0x0020 unused */ /* 0x0020U unused */
#define PNG_FLAG_ROW_INIT 0x0040 #define PNG_FLAG_ROW_INIT 0x0040U
#define PNG_FLAG_FILLER_AFTER 0x0080 #define PNG_FLAG_FILLER_AFTER 0x0080U
#define PNG_FLAG_CRC_ANCILLARY_USE 0x0100 #define PNG_FLAG_CRC_ANCILLARY_USE 0x0100U
#define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200 #define PNG_FLAG_CRC_ANCILLARY_NOWARN 0x0200U
#define PNG_FLAG_CRC_CRITICAL_USE 0x0400 #define PNG_FLAG_CRC_CRITICAL_USE 0x0400U
#define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800 #define PNG_FLAG_CRC_CRITICAL_IGNORE 0x0800U
#define PNG_FLAG_ASSUME_sRGB 0x1000 /* Added to libpng-1.5.4 */ #define PNG_FLAG_ASSUME_sRGB 0x1000U /* Added to libpng-1.5.4 */
#define PNG_FLAG_OPTIMIZE_ALPHA 0x2000 /* Added to libpng-1.5.4 */ #define PNG_FLAG_OPTIMIZE_ALPHA 0x2000U /* Added to libpng-1.5.4 */
#define PNG_FLAG_DETECT_UNINITIALIZED 0x4000 /* Added to libpng-1.5.4 */ #define PNG_FLAG_DETECT_UNINITIALIZED 0x4000U /* Added to libpng-1.5.4 */
/* #define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000 */ /* #define PNG_FLAG_KEEP_UNKNOWN_CHUNKS 0x8000U */
/* #define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000 */ /* #define PNG_FLAG_KEEP_UNSAFE_CHUNKS 0x10000U */
#define PNG_FLAG_LIBRARY_MISMATCH 0x20000 #define PNG_FLAG_LIBRARY_MISMATCH 0x20000U
#define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000 #define PNG_FLAG_STRIP_ERROR_NUMBERS 0x40000U
#define PNG_FLAG_STRIP_ERROR_TEXT 0x80000 #define PNG_FLAG_STRIP_ERROR_TEXT 0x80000U
#define PNG_FLAG_BENIGN_ERRORS_WARN 0x100000 /* Added to libpng-1.4.0 */ #define PNG_FLAG_BENIGN_ERRORS_WARN 0x100000U /* Added to libpng-1.4.0 */
#define PNG_FLAG_APP_WARNINGS_WARN 0x200000 /* Added to libpng-1.6.0 */ #define PNG_FLAG_APP_WARNINGS_WARN 0x200000U /* Added to libpng-1.6.0 */
#define PNG_FLAG_APP_ERRORS_WARN 0x400000 /* Added to libpng-1.6.0 */ #define PNG_FLAG_APP_ERRORS_WARN 0x400000U /* Added to libpng-1.6.0 */
/* 0x800000 unused */ /* 0x800000U unused */
/* 0x1000000 unused */ /* 0x1000000U unused */
/* 0x2000000 unused */ /* 0x2000000U unused */
/* 0x4000000 unused */ /* 0x4000000U unused */
/* 0x8000000 unused */ /* 0x8000000U unused */
/* 0x10000000 unused */ /* 0x10000000U unused */
/* 0x20000000 unused */ /* 0x20000000U unused */
/* 0x40000000 unused */ /* 0x40000000U unused */
#define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \ #define PNG_FLAG_CRC_ANCILLARY_MASK (PNG_FLAG_CRC_ANCILLARY_USE | \
PNG_FLAG_CRC_ANCILLARY_NOWARN) PNG_FLAG_CRC_ANCILLARY_NOWARN)
@ -668,6 +698,24 @@
((png_size_t)(width) * (((png_size_t)(pixel_bits)) >> 3)) : \ ((png_size_t)(width) * (((png_size_t)(pixel_bits)) >> 3)) : \
(( ((png_size_t)(width) * ((png_size_t)(pixel_bits))) + 7) >> 3) ) (( ((png_size_t)(width) * ((png_size_t)(pixel_bits))) + 7) >> 3) )
/* This returns the number of trailing bits in the last byte of a row, 0 if the
* last byte is completely full of pixels. It is, in principle, (pixel_bits x
* width) % 8, but that would overflow for large 'width'. The second macro is
* the same except that it returns the number of unused bits in the last byte;
* (8-TRAILBITS), but 0 when TRAILBITS is 0.
*
* NOTE: these macros are intended to be self-evidently correct and never
* overflow on the assumption that pixel_bits is in the range 0..255. The
* arguments are evaluated only once and they can be signed (e.g. as a result of
* the integral promotions). The result of the expression always has type
* (png_uint_32), however the compiler always knows it is in the range 0..7.
*/
#define PNG_TRAILBITS(pixel_bits, width) \
(((pixel_bits) * ((width) % (png_uint_32)8)) % 8)
#define PNG_PADBITS(pixel_bits, width) \
((8 - PNG_TRAILBITS(pixel_bits, width)) % 8)
/* PNG_OUT_OF_RANGE returns true if value is outside the range /* PNG_OUT_OF_RANGE returns true if value is outside the range
* ideal-delta..ideal+delta. Each argument is evaluated twice. * ideal-delta..ideal+delta. Each argument is evaluated twice.
* "ideal" and "delta" should be constants, normally simple * "ideal" and "delta" should be constants, normally simple
@ -1202,6 +1250,7 @@ PNG_INTERNAL_FUNCTION(void,png_do_write_interlace,(png_row_infop row_info,
PNG_INTERNAL_FUNCTION(void,png_read_filter_row,(png_structrp pp, png_row_infop PNG_INTERNAL_FUNCTION(void,png_read_filter_row,(png_structrp pp, png_row_infop
row_info, png_bytep row, png_const_bytep prev_row, int filter),PNG_EMPTY); row_info, png_bytep row, png_const_bytep prev_row, int filter),PNG_EMPTY);
#if PNG_ARM_NEON_OPT > 0
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_neon,(png_row_infop row_info, PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_neon,(png_row_infop row_info,
png_bytep row, png_const_bytep prev_row),PNG_EMPTY); png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_neon,(png_row_infop PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_neon,(png_row_infop
@ -1216,6 +1265,24 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_neon,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
#endif
#if PNG_MIPS_MSA_OPT > 0
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_msa,(png_row_infop row_info,
png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_msa,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_msa,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_msa,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_msa,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_msa,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_msa,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
#endif
/* Choose the best filter to use and filter the row data */ /* Choose the best filter to use and filter the row data */
PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr, PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr,
@ -1243,7 +1310,7 @@ PNG_INTERNAL_FUNCTION(void,png_read_finish_row,(png_structrp png_ptr),
/* Initialize the row buffers, etc. */ /* Initialize the row buffers, etc. */
PNG_INTERNAL_FUNCTION(void,png_read_start_row,(png_structrp png_ptr),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_start_row,(png_structrp png_ptr),PNG_EMPTY);
#if PNG_ZLIB_VERNUM >= 0x1240 #if ZLIB_VERNUM >= 0x1240
PNG_INTERNAL_FUNCTION(int,png_zlib_inflate,(png_structrp png_ptr, int flush), PNG_INTERNAL_FUNCTION(int,png_zlib_inflate,(png_structrp png_ptr, int flush),
PNG_EMPTY); PNG_EMPTY);
# define PNG_INFLATE(pp, flush) png_zlib_inflate(pp, flush) # define PNG_INFLATE(pp, flush) png_zlib_inflate(pp, flush)
@ -1520,9 +1587,11 @@ PNG_INTERNAL_FUNCTION(int,png_colorspace_set_ICC,(png_const_structrp png_ptr,
/* The 'name' is used for information only */ /* The 'name' is used for information only */
/* Routines for checking parts of an ICC profile. */ /* Routines for checking parts of an ICC profile. */
#ifdef PNG_READ_iCCP_SUPPORTED
PNG_INTERNAL_FUNCTION(int,png_icc_check_length,(png_const_structrp png_ptr, PNG_INTERNAL_FUNCTION(int,png_icc_check_length,(png_const_structrp png_ptr,
png_colorspacerp colorspace, png_const_charp name, png_colorspacerp colorspace, png_const_charp name,
png_uint_32 profile_length), PNG_EMPTY); png_uint_32 profile_length), PNG_EMPTY);
#endif /* READ_iCCP */
PNG_INTERNAL_FUNCTION(int,png_icc_check_header,(png_const_structrp png_ptr, PNG_INTERNAL_FUNCTION(int,png_icc_check_header,(png_const_structrp png_ptr,
png_colorspacerp colorspace, png_const_charp name, png_colorspacerp colorspace, png_const_charp name,
png_uint_32 profile_length, png_uint_32 profile_length,
@ -1941,10 +2010,17 @@ PNG_INTERNAL_FUNCTION(void, PNG_FILTER_OPTIMIZATIONS, (png_structp png_ptr,
* the builder of libpng passes the definition of PNG_FILTER_OPTIMIZATIONS in * the builder of libpng passes the definition of PNG_FILTER_OPTIMIZATIONS in
* CFLAGS in place of CPPFLAGS *and* uses symbol prefixing. * CFLAGS in place of CPPFLAGS *and* uses symbol prefixing.
*/ */
# if PNG_ARM_NEON_OPT > 0
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon, PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon,
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY); (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
#endif #endif
#if PNG_MIPS_MSA_OPT > 0
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_msa,
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
#endif
#endif
PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr, PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr,
png_const_charp key, png_bytep new_key), PNG_EMPTY); png_const_charp key, png_bytep new_key), PNG_EMPTY);

View file

@ -29,7 +29,7 @@
* However, the following notice accompanied the original version of this * However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed: * file and, per its terms, should not be removed:
* *
* Last changed in libpng 1.6.23 [June 9, 2016] * Last changed in libpng 1.6.26 [October 20, 2016]
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -387,9 +387,9 @@ png_do_read_intrapixel(png_row_infop row_info, png_bytep row)
for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel) for (i = 0, rp = row; i < row_width; i++, rp += bytes_per_pixel)
{ {
png_uint_32 s0 = (*(rp ) << 8) | *(rp + 1); png_uint_32 s0 = (png_uint_32)(*(rp ) << 8) | *(rp + 1);
png_uint_32 s1 = (*(rp + 2) << 8) | *(rp + 3); png_uint_32 s1 = (png_uint_32)(*(rp + 2) << 8) | *(rp + 3);
png_uint_32 s2 = (*(rp + 4) << 8) | *(rp + 5); png_uint_32 s2 = (png_uint_32)(*(rp + 4) << 8) | *(rp + 5);
png_uint_32 red = (s0 + s1 + 65536) & 0xffff; png_uint_32 red = (s0 + s1 + 65536) & 0xffff;
png_uint_32 blue = (s2 + s1 + 65536) & 0xffff; png_uint_32 blue = (s2 + s1 + 65536) & 0xffff;
*(rp ) = (png_byte)((red >> 8) & 0xff); *(rp ) = (png_byte)((red >> 8) & 0xff);
@ -1058,8 +1058,7 @@ png_set_read_status_fn(png_structrp png_ptr, png_read_status_ptr read_row_fn)
#ifdef PNG_INFO_IMAGE_SUPPORTED #ifdef PNG_INFO_IMAGE_SUPPORTED
void PNGAPI void PNGAPI
png_read_png(png_structrp png_ptr, png_inforp info_ptr, png_read_png(png_structrp png_ptr, png_inforp info_ptr,
int transforms, int transforms, voidp params)
voidp params)
{ {
if (png_ptr == NULL || info_ptr == NULL) if (png_ptr == NULL || info_ptr == NULL)
return; return;
@ -1422,7 +1421,9 @@ png_image_read_header(png_voidp argument)
png_structrp png_ptr = image->opaque->png_ptr; png_structrp png_ptr = image->opaque->png_ptr;
png_inforp info_ptr = image->opaque->info_ptr; png_inforp info_ptr = image->opaque->info_ptr;
#ifdef PNG_BENIGN_ERRORS_SUPPORTED
png_set_benign_errors(png_ptr, 1/*warn*/); png_set_benign_errors(png_ptr, 1/*warn*/);
#endif
png_read_info(png_ptr, info_ptr); png_read_info(png_ptr, info_ptr);
/* Do this the fast way; just read directly out of png_struct. */ /* Do this the fast way; just read directly out of png_struct. */
@ -1460,7 +1461,7 @@ png_image_read_header(png_voidp argument)
break; break;
case PNG_COLOR_TYPE_PALETTE: case PNG_COLOR_TYPE_PALETTE:
cmap_entries = png_ptr->num_palette; cmap_entries = (png_uint_32)png_ptr->num_palette;
break; break;
default: default:
@ -1995,7 +1996,7 @@ make_gray_file_colormap(png_image_read_control *display)
for (i=0; i<256; ++i) for (i=0; i<256; ++i)
png_create_colormap_entry(display, i, i, i, i, 255, P_FILE); png_create_colormap_entry(display, i, i, i, i, 255, P_FILE);
return i; return (int)i;
} }
static int static int
@ -2006,7 +2007,7 @@ make_gray_colormap(png_image_read_control *display)
for (i=0; i<256; ++i) for (i=0; i<256; ++i)
png_create_colormap_entry(display, i, i, i, i, 255, P_sRGB); png_create_colormap_entry(display, i, i, i, i, 255, P_sRGB);
return i; return (int)i;
} }
#define PNG_GRAY_COLORMAP_ENTRIES 256 #define PNG_GRAY_COLORMAP_ENTRIES 256
@ -2060,7 +2061,7 @@ make_ga_colormap(png_image_read_control *display)
P_sRGB); P_sRGB);
} }
return i; return (int)i;
} }
#define PNG_GA_COLORMAP_ENTRIES 256 #define PNG_GA_COLORMAP_ENTRIES 256
@ -2085,7 +2086,7 @@ make_rgb_colormap(png_image_read_control *display)
} }
} }
return i; return (int)i;
} }
#define PNG_RGB_COLORMAP_ENTRIES 216 #define PNG_RGB_COLORMAP_ENTRIES 216
@ -2133,7 +2134,7 @@ png_image_read_colormap(png_voidp argument)
else if (display->background == NULL /* no way to remove it */) else if (display->background == NULL /* no way to remove it */)
png_error(png_ptr, png_error(png_ptr,
"a background color must be supplied to remove alpha/transparency"); "background color must be supplied to remove alpha/transparency");
/* Get a copy of the background color (this avoids repeating the checks /* Get a copy of the background color (this avoids repeating the checks
* below.) The encoding is 8-bit sRGB or 16-bit linear, depending on the * below.) The encoding is 8-bit sRGB or 16-bit linear, depending on the
@ -2278,7 +2279,7 @@ png_image_read_colormap(png_voidp argument)
if (PNG_GRAY_COLORMAP_ENTRIES > image->colormap_entries) if (PNG_GRAY_COLORMAP_ENTRIES > image->colormap_entries)
png_error(png_ptr, "gray[16] color-map: too few entries"); png_error(png_ptr, "gray[16] color-map: too few entries");
cmap_entries = make_gray_colormap(display); cmap_entries = (unsigned int)make_gray_colormap(display);
if (png_ptr->num_trans > 0) if (png_ptr->num_trans > 0)
{ {
@ -2376,7 +2377,7 @@ png_image_read_colormap(png_voidp argument)
if (PNG_GA_COLORMAP_ENTRIES > image->colormap_entries) if (PNG_GA_COLORMAP_ENTRIES > image->colormap_entries)
png_error(png_ptr, "gray+alpha color-map: too few entries"); png_error(png_ptr, "gray+alpha color-map: too few entries");
cmap_entries = make_ga_colormap(display); cmap_entries = (unsigned int)make_ga_colormap(display);
background_index = PNG_CMAP_GA_BACKGROUND; background_index = PNG_CMAP_GA_BACKGROUND;
output_processing = PNG_CMAP_GA; output_processing = PNG_CMAP_GA;
@ -2410,7 +2411,7 @@ png_image_read_colormap(png_voidp argument)
if (PNG_GRAY_COLORMAP_ENTRIES > image->colormap_entries) if (PNG_GRAY_COLORMAP_ENTRIES > image->colormap_entries)
png_error(png_ptr, "gray-alpha color-map: too few entries"); png_error(png_ptr, "gray-alpha color-map: too few entries");
cmap_entries = make_gray_colormap(display); cmap_entries = (unsigned int)make_gray_colormap(display);
if (output_encoding == P_LINEAR) if (output_encoding == P_LINEAR)
{ {
@ -2458,8 +2459,8 @@ png_image_read_colormap(png_voidp argument)
background_index = i; background_index = i;
png_create_colormap_entry(display, i++, back_r, back_g, back_b, png_create_colormap_entry(display, i++, back_r, back_g, back_b,
#ifdef __COVERITY__ #ifdef __COVERITY__
/* Coverity claims that output_encoding cannot be 2 (P_LINEAR) /* Coverity claims that output_encoding
* here. * cannot be 2 (P_LINEAR) here.
*/ 255U, */ 255U,
#else #else
output_encoding == P_LINEAR ? 65535U : 255U, output_encoding == P_LINEAR ? 65535U : 255U,
@ -2549,7 +2550,7 @@ png_image_read_colormap(png_voidp argument)
if (PNG_GA_COLORMAP_ENTRIES > image->colormap_entries) if (PNG_GA_COLORMAP_ENTRIES > image->colormap_entries)
png_error(png_ptr, "rgb[ga] color-map: too few entries"); png_error(png_ptr, "rgb[ga] color-map: too few entries");
cmap_entries = make_ga_colormap(display); cmap_entries = (unsigned int)make_ga_colormap(display);
background_index = PNG_CMAP_GA_BACKGROUND; background_index = PNG_CMAP_GA_BACKGROUND;
output_processing = PNG_CMAP_GA; output_processing = PNG_CMAP_GA;
} }
@ -2575,12 +2576,12 @@ png_image_read_colormap(png_voidp argument)
png_ptr->num_trans > 0) && png_ptr->num_trans > 0) &&
png_gamma_not_sRGB(png_ptr->colorspace.gamma) != 0) png_gamma_not_sRGB(png_ptr->colorspace.gamma) != 0)
{ {
cmap_entries = make_gray_file_colormap(display); cmap_entries = (unsigned int)make_gray_file_colormap(display);
data_encoding = P_FILE; data_encoding = P_FILE;
} }
else else
cmap_entries = make_gray_colormap(display); cmap_entries = (unsigned int)make_gray_colormap(display);
/* But if the input has alpha or transparency it must be removed /* But if the input has alpha or transparency it must be removed
*/ */
@ -2668,7 +2669,7 @@ png_image_read_colormap(png_voidp argument)
if (PNG_RGB_COLORMAP_ENTRIES+1+27 > image->colormap_entries) if (PNG_RGB_COLORMAP_ENTRIES+1+27 > image->colormap_entries)
png_error(png_ptr, "rgb+alpha color-map: too few entries"); png_error(png_ptr, "rgb+alpha color-map: too few entries");
cmap_entries = make_rgb_colormap(display); cmap_entries = (unsigned int)make_rgb_colormap(display);
/* Add a transparent entry. */ /* Add a transparent entry. */
png_create_colormap_entry(display, cmap_entries, 255, 255, png_create_colormap_entry(display, cmap_entries, 255, 255,
@ -2717,7 +2718,7 @@ png_image_read_colormap(png_voidp argument)
if (PNG_RGB_COLORMAP_ENTRIES+1+27 > image->colormap_entries) if (PNG_RGB_COLORMAP_ENTRIES+1+27 > image->colormap_entries)
png_error(png_ptr, "rgb-alpha color-map: too few entries"); png_error(png_ptr, "rgb-alpha color-map: too few entries");
cmap_entries = make_rgb_colormap(display); cmap_entries = (unsigned int)make_rgb_colormap(display);
png_create_colormap_entry(display, cmap_entries, back_r, png_create_colormap_entry(display, cmap_entries, back_r,
back_g, back_b, 0/*unused*/, output_encoding); back_g, back_b, 0/*unused*/, output_encoding);
@ -2802,7 +2803,7 @@ png_image_read_colormap(png_voidp argument)
if (PNG_RGB_COLORMAP_ENTRIES > image->colormap_entries) if (PNG_RGB_COLORMAP_ENTRIES > image->colormap_entries)
png_error(png_ptr, "rgb color-map: too few entries"); png_error(png_ptr, "rgb color-map: too few entries");
cmap_entries = make_rgb_colormap(display); cmap_entries = (unsigned int)make_rgb_colormap(display);
output_processing = PNG_CMAP_RGB; output_processing = PNG_CMAP_RGB;
} }
} }
@ -2826,11 +2827,11 @@ png_image_read_colormap(png_voidp argument)
output_processing = PNG_CMAP_NONE; output_processing = PNG_CMAP_NONE;
data_encoding = P_FILE; /* Don't change from color-map indices */ data_encoding = P_FILE; /* Don't change from color-map indices */
cmap_entries = png_ptr->num_palette; cmap_entries = (unsigned int)png_ptr->num_palette;
if (cmap_entries > 256) if (cmap_entries > 256)
cmap_entries = 256; cmap_entries = 256;
if (cmap_entries > image->colormap_entries) if (cmap_entries > (unsigned int)image->colormap_entries)
png_error(png_ptr, "palette color-map: too few entries"); png_error(png_ptr, "palette color-map: too few entries");
for (i=0; i < cmap_entries; ++i) for (i=0; i < cmap_entries; ++i)
@ -2847,12 +2848,12 @@ png_image_read_colormap(png_voidp argument)
* on the sRGB color in 'back'. * on the sRGB color in 'back'.
*/ */
png_create_colormap_entry(display, i, png_create_colormap_entry(display, i,
png_colormap_compose(display, colormap[i].red, P_FILE, png_colormap_compose(display, colormap[i].red,
trans[i], back_r, output_encoding), P_FILE, trans[i], back_r, output_encoding),
png_colormap_compose(display, colormap[i].green, P_FILE, png_colormap_compose(display, colormap[i].green,
trans[i], back_g, output_encoding), P_FILE, trans[i], back_g, output_encoding),
png_colormap_compose(display, colormap[i].blue, P_FILE, png_colormap_compose(display, colormap[i].blue,
trans[i], back_b, output_encoding), P_FILE, trans[i], back_b, output_encoding),
output_encoding == P_LINEAR ? trans[i] * 257U : output_encoding == P_LINEAR ? trans[i] * 257U :
trans[i], trans[i],
output_encoding); output_encoding);
@ -2942,7 +2943,7 @@ png_image_read_colormap(png_voidp argument)
png_error(png_ptr, "bad background index (internal error)"); png_error(png_ptr, "bad background index (internal error)");
} }
display->colormap_processing = output_processing; display->colormap_processing = (int)output_processing;
return 1/*ok*/; return 1/*ok*/;
} }
@ -3251,14 +3252,14 @@ png_image_read_colormapped(png_voidp argument)
else else
{ {
png_alloc_size_t row_bytes = display->row_bytes; png_alloc_size_t row_bytes = (png_alloc_size_t)display->row_bytes;
while (--passes >= 0) while (--passes >= 0)
{ {
png_uint_32 y = image->height; png_uint_32 y = image->height;
png_bytep row = png_voidcast(png_bytep, display->first_row); png_bytep row = png_voidcast(png_bytep, display->first_row);
while (y-- > 0) for (; y > 0; --y)
{ {
png_read_row(png_ptr, row, NULL); png_read_row(png_ptr, row, NULL);
row += row_bytes; row += row_bytes;
@ -3461,8 +3462,7 @@ png_image_read_background(png_voidp argument)
for (pass = 0; pass < passes; ++pass) for (pass = 0; pass < passes; ++pass)
{ {
png_bytep row = png_voidcast(png_bytep, png_bytep row = png_voidcast(png_bytep, display->first_row);
display->first_row);
unsigned int startx, stepx, stepy; unsigned int startx, stepx, stepy;
png_uint_32 y; png_uint_32 y;
@ -3587,8 +3587,9 @@ png_image_read_background(png_voidp argument)
* stride which was multiplied by 2 (below) to get row_bytes. * stride which was multiplied by 2 (below) to get row_bytes.
*/ */
ptrdiff_t step_row = display->row_bytes / 2; ptrdiff_t step_row = display->row_bytes / 2;
int preserve_alpha = (image->format & PNG_FORMAT_FLAG_ALPHA) != 0; unsigned int preserve_alpha = (image->format &
unsigned int outchannels = 1+preserve_alpha; PNG_FORMAT_FLAG_ALPHA) != 0;
unsigned int outchannels = 1U+preserve_alpha;
int swap_alpha = 0; int swap_alpha = 0;
# ifdef PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED # ifdef PNG_SIMPLIFIED_READ_AFIRST_SUPPORTED
@ -4085,14 +4086,14 @@ png_image_read_direct(png_voidp argument)
else else
{ {
png_alloc_size_t row_bytes = display->row_bytes; png_alloc_size_t row_bytes = (png_alloc_size_t)display->row_bytes;
while (--passes >= 0) while (--passes >= 0)
{ {
png_uint_32 y = image->height; png_uint_32 y = image->height;
png_bytep row = png_voidcast(png_bytep, display->first_row); png_bytep row = png_voidcast(png_bytep, display->first_row);
while (y-- > 0) for (; y > 0; --y)
{ {
png_read_row(png_ptr, row, NULL); png_read_row(png_ptr, row, NULL);
row += row_bytes; row += row_bytes;
@ -4115,7 +4116,13 @@ png_image_finish_read(png_imagep image, png_const_colorp background,
*/ */
const unsigned int channels = PNG_IMAGE_PIXEL_CHANNELS(image->format); const unsigned int channels = PNG_IMAGE_PIXEL_CHANNELS(image->format);
if (image->width <= 0x7FFFFFFFU/channels) /* no overflow */ /* The following checks just the 'row_stride' calculation to ensure it
* fits in a signed 32-bit value. Because channels/components can be
* either 1 or 2 bytes in size the length of a row can still overflow 32
* bits; this is just to verify that the 'row_stride' argument can be
* represented.
*/
if (image->width <= 0x7fffffffU/channels) /* no overflow */
{ {
png_uint_32 check; png_uint_32 check;
const png_uint_32 png_row_stride = image->width * channels; const png_uint_32 png_row_stride = image->width * channels;
@ -4124,18 +4131,35 @@ png_image_finish_read(png_imagep image, png_const_colorp background,
row_stride = (png_int_32)/*SAFE*/png_row_stride; row_stride = (png_int_32)/*SAFE*/png_row_stride;
if (row_stride < 0) if (row_stride < 0)
check = -row_stride; check = (png_uint_32)(-row_stride);
else else
check = row_stride; check = (png_uint_32)row_stride;
/* This verifies 'check', the absolute value of the actual stride
* passed in and detects overflow in the application calculation (i.e.
* if the app did actually pass in a non-zero 'row_stride'.
*/
if (image->opaque != NULL && buffer != NULL && check >= png_row_stride) if (image->opaque != NULL && buffer != NULL && check >= png_row_stride)
{ {
/* Now check for overflow of the image buffer calculation; this /* Now check for overflow of the image buffer calculation; this
* limits the whole image size to 32 bits for API compatibility with * limits the whole image size to 32 bits for API compatibility with
* the current, 32-bit, PNG_IMAGE_BUFFER_SIZE macro. * the current, 32-bit, PNG_IMAGE_BUFFER_SIZE macro.
*
* The PNG_IMAGE_BUFFER_SIZE macro is:
*
* (PNG_IMAGE_PIXEL_COMPONENT_SIZE(fmt)*height*(row_stride))
*
* And the component size is always 1 or 2, so make sure that the
* number of *bytes* that the application is saying are available
* does actually fit into a 32-bit number.
*
* NOTE: this will be changed in 1.7 because PNG_IMAGE_BUFFER_SIZE
* will be changed to use png_alloc_size_t; bigger images can be
* accomodated on 64-bit systems.
*/ */
if (image->height <= 0xFFFFFFFF/png_row_stride) if (image->height <=
0xffffffffU/PNG_IMAGE_PIXEL_COMPONENT_SIZE(image->format)/check)
{ {
if ((image->format & PNG_FORMAT_FLAG_COLORMAP) == 0 || if ((image->format & PNG_FORMAT_FLAG_COLORMAP) == 0 ||
(image->colormap_entries > 0 && colormap != NULL)) (image->colormap_entries > 0 && colormap != NULL))
@ -4155,7 +4179,8 @@ png_image_finish_read(png_imagep image, png_const_colorp background,
* all the setup has already been done. * all the setup has already been done.
*/ */
if ((image->format & PNG_FORMAT_FLAG_COLORMAP) != 0) if ((image->format & PNG_FORMAT_FLAG_COLORMAP) != 0)
result = png_safe_execute(image, result =
png_safe_execute(image,
png_image_read_colormap, &display) && png_image_read_colormap, &display) &&
png_safe_execute(image, png_safe_execute(image,
png_image_read_colormapped, &display); png_image_read_colormapped, &display);

View file

@ -29,8 +29,8 @@
* However, the following notice accompanied the original version of this * However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed: * file and, per its terms, should not be removed:
* *
* Last changed in libpng 1.6.17 [March 26, 2015] * Last changed in libpng 1.6.24 [August 4, 2016]
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
* *

View file

@ -29,7 +29,7 @@
* However, the following notice accompanied the original version of this * However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed: * file and, per its terms, should not be removed:
* *
* Last changed in libpng 1.6.22 [May 26, 2016] * Last changed in libpng 1.6.24 [August 4, 2016]
* Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -457,7 +457,7 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
int i; int i;
png_ptr->quantize_index = (png_bytep)png_malloc(png_ptr, png_ptr->quantize_index = (png_bytep)png_malloc(png_ptr,
(png_uint_32)(num_palette * (sizeof (png_byte)))); (png_uint_32)((png_uint_32)num_palette * (sizeof (png_byte))));
for (i = 0; i < num_palette; i++) for (i = 0; i < num_palette; i++)
png_ptr->quantize_index[i] = (png_byte)i; png_ptr->quantize_index[i] = (png_byte)i;
} }
@ -474,7 +474,7 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
/* Initialize an array to sort colors */ /* Initialize an array to sort colors */
png_ptr->quantize_sort = (png_bytep)png_malloc(png_ptr, png_ptr->quantize_sort = (png_bytep)png_malloc(png_ptr,
(png_uint_32)(num_palette * (sizeof (png_byte)))); (png_uint_32)((png_uint_32)num_palette * (sizeof (png_byte))));
/* Initialize the quantize_sort array */ /* Initialize the quantize_sort array */
for (i = 0; i < num_palette; i++) for (i = 0; i < num_palette; i++)
@ -608,9 +608,9 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
/* Initialize palette index arrays */ /* Initialize palette index arrays */
png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr, png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr,
(png_uint_32)(num_palette * (sizeof (png_byte)))); (png_uint_32)((png_uint_32)num_palette * (sizeof (png_byte))));
png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr, png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr,
(png_uint_32)(num_palette * (sizeof (png_byte)))); (png_uint_32)((png_uint_32)num_palette * (sizeof (png_byte))));
/* Initialize the sort array */ /* Initialize the sort array */
for (i = 0; i < num_palette; i++) for (i = 0; i < num_palette; i++)
@ -2178,7 +2178,7 @@ png_do_unpack(png_row_infop row_info, png_bytep row)
{ {
png_bytep sp = row + (png_size_t)((row_width - 1) >> 3); png_bytep sp = row + (png_size_t)((row_width - 1) >> 3);
png_bytep dp = row + (png_size_t)row_width - 1; png_bytep dp = row + (png_size_t)row_width - 1;
png_uint_32 shift = 7 - (int)((row_width + 7) & 0x07); png_uint_32 shift = 7U - ((row_width + 7U) & 0x07);
for (i = 0; i < row_width; i++) for (i = 0; i < row_width; i++)
{ {
*dp = (png_byte)((*sp >> shift) & 0x01); *dp = (png_byte)((*sp >> shift) & 0x01);
@ -2202,7 +2202,7 @@ png_do_unpack(png_row_infop row_info, png_bytep row)
png_bytep sp = row + (png_size_t)((row_width - 1) >> 2); png_bytep sp = row + (png_size_t)((row_width - 1) >> 2);
png_bytep dp = row + (png_size_t)row_width - 1; png_bytep dp = row + (png_size_t)row_width - 1;
png_uint_32 shift = (int)((3 - ((row_width + 3) & 0x03)) << 1); png_uint_32 shift = ((3U - ((row_width + 3U) & 0x03)) << 1);
for (i = 0; i < row_width; i++) for (i = 0; i < row_width; i++)
{ {
*dp = (png_byte)((*sp >> shift) & 0x03); *dp = (png_byte)((*sp >> shift) & 0x03);
@ -2225,7 +2225,7 @@ png_do_unpack(png_row_infop row_info, png_bytep row)
{ {
png_bytep sp = row + (png_size_t)((row_width - 1) >> 1); png_bytep sp = row + (png_size_t)((row_width - 1) >> 1);
png_bytep dp = row + (png_size_t)row_width - 1; png_bytep dp = row + (png_size_t)row_width - 1;
png_uint_32 shift = (int)((1 - ((row_width + 1) & 0x01)) << 2); png_uint_32 shift = ((1U - ((row_width + 1U) & 0x01)) << 2);
for (i = 0; i < row_width; i++) for (i = 0; i < row_width; i++)
{ {
*dp = (png_byte)((*sp >> shift) & 0x0f); *dp = (png_byte)((*sp >> shift) & 0x0f);
@ -3251,7 +3251,8 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
== png_ptr->trans_color.gray) == png_ptr->trans_color.gray)
{ {
unsigned int tmp = *sp & (0x7f7f >> (7 - shift)); unsigned int tmp = *sp & (0x7f7f >> (7 - shift));
tmp |= png_ptr->background.gray << shift; tmp |=
(unsigned int)(png_ptr->background.gray << shift);
*sp = (png_byte)(tmp & 0xff); *sp = (png_byte)(tmp & 0xff);
} }
@ -3280,7 +3281,8 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
== png_ptr->trans_color.gray) == png_ptr->trans_color.gray)
{ {
unsigned int tmp = *sp & (0x3f3f >> (6 - shift)); unsigned int tmp = *sp & (0x3f3f >> (6 - shift));
tmp |= png_ptr->background.gray << shift; tmp |=
(unsigned int)png_ptr->background.gray << shift;
*sp = (png_byte)(tmp & 0xff); *sp = (png_byte)(tmp & 0xff);
} }
@ -3290,7 +3292,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
unsigned int g = (gamma_table [p | (p << 2) | unsigned int g = (gamma_table [p | (p << 2) |
(p << 4) | (p << 6)] >> 6) & 0x03; (p << 4) | (p << 6)] >> 6) & 0x03;
unsigned int tmp = *sp & (0x3f3f >> (6 - shift)); unsigned int tmp = *sp & (0x3f3f >> (6 - shift));
tmp |= g << shift; tmp |= (unsigned int)(g << shift);
*sp = (png_byte)(tmp & 0xff); *sp = (png_byte)(tmp & 0xff);
} }
@ -3316,7 +3318,8 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
== png_ptr->trans_color.gray) == png_ptr->trans_color.gray)
{ {
unsigned int tmp = *sp & (0x3f3f >> (6 - shift)); unsigned int tmp = *sp & (0x3f3f >> (6 - shift));
tmp |= png_ptr->background.gray << shift; tmp |=
(unsigned int)png_ptr->background.gray << shift;
*sp = (png_byte)(tmp & 0xff); *sp = (png_byte)(tmp & 0xff);
} }
@ -3346,7 +3349,8 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
== png_ptr->trans_color.gray) == png_ptr->trans_color.gray)
{ {
unsigned int tmp = *sp & (0x0f0f >> (4 - shift)); unsigned int tmp = *sp & (0x0f0f >> (4 - shift));
tmp |= png_ptr->background.gray << shift; tmp |=
(unsigned int)(png_ptr->background.gray << shift);
*sp = (png_byte)(tmp & 0xff); *sp = (png_byte)(tmp & 0xff);
} }
@ -3356,7 +3360,7 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
unsigned int g = (gamma_table[p | (p << 4)] >> 4) & unsigned int g = (gamma_table[p | (p << 4)] >> 4) &
0x0f; 0x0f;
unsigned int tmp = *sp & (0x0f0f >> (4 - shift)); unsigned int tmp = *sp & (0x0f0f >> (4 - shift));
tmp |= g << shift; tmp |= (unsigned int)(g << shift);
*sp = (png_byte)(tmp & 0xff); *sp = (png_byte)(tmp & 0xff);
} }
@ -3382,7 +3386,8 @@ png_do_compose(png_row_infop row_info, png_bytep row, png_structrp png_ptr)
== png_ptr->trans_color.gray) == png_ptr->trans_color.gray)
{ {
unsigned int tmp = *sp & (0x0f0f >> (4 - shift)); unsigned int tmp = *sp & (0x0f0f >> (4 - shift));
tmp |= png_ptr->background.gray << shift; tmp |=
(unsigned int)(png_ptr->background.gray << shift);
*sp = (png_byte)(tmp & 0xff); *sp = (png_byte)(tmp & 0xff);
} }

View file

@ -29,8 +29,8 @@
* However, the following notice accompanied the original version of this * However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed: * file and, per its terms, should not be removed:
* *
* Last changed in libpng 1.6.20 [December 3, 2014] * Last changed in libpng 1.6.27 [January 5, 2017]
* Copyright (c) 1998-2002,2004,2006-2015 Glenn Randers-Pehrson * Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
* *
@ -114,7 +114,7 @@ png_get_int_32)(png_const_bytep buf)
{ {
png_uint_32 uval = png_get_uint_32(buf); png_uint_32 uval = png_get_uint_32(buf);
if ((uval & 0x80000000) == 0) /* non-negative */ if ((uval & 0x80000000) == 0) /* non-negative */
return uval; return (png_int_32)uval;
uval = (uval ^ 0xffffffff) + 1; /* 2's complement: -x = ~x+1 */ uval = (uval ^ 0xffffffff) + 1; /* 2's complement: -x = ~x+1 */
if ((uval & 0x80000000) == 0) /* no overflow */ if ((uval & 0x80000000) == 0) /* no overflow */
@ -398,11 +398,10 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
*/ */
{ {
int ret; /* zlib return code */ int ret; /* zlib return code */
#if PNG_ZLIB_VERNUM >= 0x1240 #if ZLIB_VERNUM >= 0x1240
int window_bits = 0;
# if defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_MAXIMUM_INFLATE_WINDOW) # if defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_MAXIMUM_INFLATE_WINDOW)
int window_bits;
if (((png_ptr->options >> PNG_MAXIMUM_INFLATE_WINDOW) & 3) == if (((png_ptr->options >> PNG_MAXIMUM_INFLATE_WINDOW) & 3) ==
PNG_OPTION_ON) PNG_OPTION_ON)
{ {
@ -412,14 +411,12 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
else else
{ {
window_bits = 0;
png_ptr->zstream_start = 1; png_ptr->zstream_start = 1;
} }
# else
# define window_bits 0
# endif
# endif # endif
#endif /* ZLIB_VERNUM >= 0x1240 */
/* Set this for safety, just in case the previous owner left pointers to /* Set this for safety, just in case the previous owner left pointers to
* memory allocations. * memory allocations.
*/ */
@ -430,25 +427,32 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
if ((png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED) != 0) if ((png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED) != 0)
{ {
#if PNG_ZLIB_VERNUM < 0x1240 #if ZLIB_VERNUM >= 0x1240
ret = inflateReset(&png_ptr->zstream);
#else
ret = inflateReset2(&png_ptr->zstream, window_bits); ret = inflateReset2(&png_ptr->zstream, window_bits);
#else
ret = inflateReset(&png_ptr->zstream);
#endif #endif
} }
else else
{ {
#if PNG_ZLIB_VERNUM < 0x1240 #if ZLIB_VERNUM >= 0x1240
ret = inflateInit(&png_ptr->zstream);
#else
ret = inflateInit2(&png_ptr->zstream, window_bits); ret = inflateInit2(&png_ptr->zstream, window_bits);
#else
ret = inflateInit(&png_ptr->zstream);
#endif #endif
if (ret == Z_OK) if (ret == Z_OK)
png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED; png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED;
} }
#if ZLIB_VERNUM >= 0x1281 && \
defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32)
if (((png_ptr->options >> PNG_IGNORE_ADLER32) & 3) == PNG_OPTION_ON)
/* Turn off validation of the ADLER32 checksum in IDAT chunks */
ret = inflateValidate(&png_ptr->zstream, 0);
#endif
if (ret == Z_OK) if (ret == Z_OK)
png_ptr->zowner = owner; png_ptr->zowner = owner;
@ -463,7 +467,7 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
#endif #endif
} }
#if PNG_ZLIB_VERNUM >= 0x1240 #if ZLIB_VERNUM >= 0x1240
/* Handle the start of the inflate stream if we called inflateInit2(strm,0); /* Handle the start of the inflate stream if we called inflateInit2(strm,0);
* in this case some zlib versions skip validation of the CINFO field and, in * in this case some zlib versions skip validation of the CINFO field and, in
* certain circumstances, libpng may end up displaying an invalid image, in * certain circumstances, libpng may end up displaying an invalid image, in
@ -489,6 +493,7 @@ png_zlib_inflate(png_structrp png_ptr, int flush)
#endif /* Zlib >= 1.2.4 */ #endif /* Zlib >= 1.2.4 */
#ifdef PNG_READ_COMPRESSED_TEXT_SUPPORTED #ifdef PNG_READ_COMPRESSED_TEXT_SUPPORTED
#if defined(PNG_READ_zTXt_SUPPORTED) || defined (PNG_READ_iTXt_SUPPORTED)
/* png_inflate now returns zlib error codes including Z_OK and Z_STREAM_END to /* png_inflate now returns zlib error codes including Z_OK and Z_STREAM_END to
* allow the caller to do multiple calls if required. If the 'finish' flag is * allow the caller to do multiple calls if required. If the 'finish' flag is
* set Z_FINISH will be passed to the final inflate() call and Z_STREAM_END must * set Z_FINISH will be passed to the final inflate() call and Z_STREAM_END must
@ -782,6 +787,7 @@ png_decompress_chunk(png_structrp png_ptr,
return Z_MEM_ERROR; return Z_MEM_ERROR;
} }
} }
#endif /* READ_zTXt || READ_iTXt */
#endif /* READ_COMPRESSED_TEXT */ #endif /* READ_COMPRESSED_TEXT */
#ifdef PNG_READ_iCCP_SUPPORTED #ifdef PNG_READ_iCCP_SUPPORTED
@ -830,8 +836,8 @@ png_inflate_read(png_structrp png_ptr, png_bytep read_buffer, uInt read_size,
* the available output is produced; this allows reading of truncated * the available output is produced; this allows reading of truncated
* streams. * streams.
*/ */
ret = PNG_INFLATE(png_ptr, ret = PNG_INFLATE(png_ptr, *chunk_bytes > 0 ?
*chunk_bytes > 0 ? Z_NO_FLUSH : (finish ? Z_FINISH : Z_SYNC_FLUSH)); Z_NO_FLUSH : (finish ? Z_FINISH : Z_SYNC_FLUSH));
} }
while (ret == Z_OK && (*out_size > 0 || png_ptr->zstream.avail_out > 0)); while (ret == Z_OK && (*out_size > 0 || png_ptr->zstream.avail_out > 0));
@ -849,7 +855,7 @@ png_inflate_read(png_structrp png_ptr, png_bytep read_buffer, uInt read_size,
return Z_STREAM_ERROR; return Z_STREAM_ERROR;
} }
} }
#endif #endif /* READ_iCCP */
/* Read and check the IDHR chunk */ /* Read and check the IDHR chunk */
@ -1037,7 +1043,7 @@ png_handle_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
#endif #endif
{ {
png_crc_finish(png_ptr, (int) length - num * 3); png_crc_finish(png_ptr, (png_uint_32) (length - (unsigned int)num * 3));
} }
#ifndef PNG_READ_OPT_PLTE_SUPPORTED #ifndef PNG_READ_OPT_PLTE_SUPPORTED
@ -1540,7 +1546,7 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
png_crc_finish(png_ptr, length); png_crc_finish(png_ptr, length);
finished = 1; finished = 1;
# ifdef PNG_sRGB_SUPPORTED # if defined(PNG_sRGB_SUPPORTED) && PNG_sRGB_PROFILE_CHECKS >= 0
/* Check for a match against sRGB */ /* Check for a match against sRGB */
png_icc_set_sRGB(png_ptr, png_icc_set_sRGB(png_ptr,
&png_ptr->colorspace, profile, &png_ptr->colorspace, profile,
@ -1743,13 +1749,13 @@ png_handle_sPLT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
data_length = length - (png_uint_32)(entry_start - buffer); data_length = length - (png_uint_32)(entry_start - buffer);
/* Integrity-check the data length */ /* Integrity-check the data length */
if ((data_length % entry_size) != 0) if ((data_length % (unsigned int)entry_size) != 0)
{ {
png_warning(png_ptr, "sPLT chunk has bad length"); png_warning(png_ptr, "sPLT chunk has bad length");
return; return;
} }
dl = (png_int_32)(data_length / entry_size); dl = (png_uint_32)(data_length / (unsigned int)entry_size);
max_dl = PNG_SIZE_MAX / (sizeof (png_sPLT_entry)); max_dl = PNG_SIZE_MAX / (sizeof (png_sPLT_entry));
if (dl > max_dl) if (dl > max_dl)
@ -1758,10 +1764,10 @@ png_handle_sPLT(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
return; return;
} }
new_palette.nentries = (png_int_32)(data_length / entry_size); new_palette.nentries = (png_int_32)(data_length / (unsigned int)entry_size);
new_palette.entries = (png_sPLT_entryp)png_malloc_warn( new_palette.entries = (png_sPLT_entryp)png_malloc_warn(png_ptr,
png_ptr, new_palette.nentries * (sizeof (png_sPLT_entry))); (png_alloc_size_t) new_palette.nentries * (sizeof (png_sPLT_entry)));
if (new_palette.entries == NULL) if (new_palette.entries == NULL)
{ {
@ -3125,7 +3131,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
# ifdef PNG_READ_PACKSWAP_SUPPORTED # ifdef PNG_READ_PACKSWAP_SUPPORTED
if ((png_ptr->transformations & PNG_PACKSWAP) != 0) if ((png_ptr->transformations & PNG_PACKSWAP) != 0)
/* little-endian byte */ /* little-endian byte */
end_mask = 0xff << end_mask; end_mask = (unsigned int)(0xff << end_mask);
else /* big-endian byte */ else /* big-endian byte */
# endif # endif
@ -3446,8 +3452,8 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
/* Everything is aligned for png_uint_16 copies, but try for /* Everything is aligned for png_uint_16 copies, but try for
* png_uint_32 first. * png_uint_32 first.
*/ */
if (png_isaligned(dp, png_uint_32) != 0 && if (png_isaligned(dp, png_uint_32) &&
png_isaligned(sp, png_uint_32) != 0 && png_isaligned(sp, png_uint_32) &&
bytes_to_copy % (sizeof (png_uint_32)) == 0 && bytes_to_copy % (sizeof (png_uint_32)) == 0 &&
bytes_to_jump % (sizeof (png_uint_32)) == 0) bytes_to_jump % (sizeof (png_uint_32)) == 0)
{ {
@ -3571,7 +3577,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
{ {
/* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */
/* Offset to next interlace block */ /* Offset to next interlace block */
static PNG_CONST int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; static PNG_CONST unsigned int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1};
png_debug(1, "in png_do_read_interlace"); png_debug(1, "in png_do_read_interlace");
if (row != NULL && row_info != NULL) if (row != NULL && row_info != NULL)
@ -3586,9 +3592,10 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
{ {
png_bytep sp = row + (png_size_t)((row_info->width - 1) >> 3); png_bytep sp = row + (png_size_t)((row_info->width - 1) >> 3);
png_bytep dp = row + (png_size_t)((final_width - 1) >> 3); png_bytep dp = row + (png_size_t)((final_width - 1) >> 3);
int sshift, dshift; unsigned int sshift, dshift;
int s_start, s_end, s_inc; unsigned int s_start, s_end;
int jstop = png_pass_inc[pass]; int s_inc;
int jstop = (int)png_pass_inc[pass];
png_byte v; png_byte v;
png_uint_32 i; png_uint_32 i;
int j; int j;
@ -3596,8 +3603,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
#ifdef PNG_READ_PACKSWAP_SUPPORTED #ifdef PNG_READ_PACKSWAP_SUPPORTED
if ((transformations & PNG_PACKSWAP) != 0) if ((transformations & PNG_PACKSWAP) != 0)
{ {
sshift = (int)((row_info->width + 7) & 0x07); sshift = ((row_info->width + 7) & 0x07);
dshift = (int)((final_width + 7) & 0x07); dshift = ((final_width + 7) & 0x07);
s_start = 7; s_start = 7;
s_end = 0; s_end = 0;
s_inc = -1; s_inc = -1;
@ -3606,8 +3613,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
else else
#endif #endif
{ {
sshift = 7 - (int)((row_info->width + 7) & 0x07); sshift = 7 - ((row_info->width + 7) & 0x07);
dshift = 7 - (int)((final_width + 7) & 0x07); dshift = 7 - ((final_width + 7) & 0x07);
s_start = 0; s_start = 0;
s_end = 7; s_end = 7;
s_inc = 1; s_inc = 1;
@ -3619,7 +3626,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
for (j = 0; j < jstop; j++) for (j = 0; j < jstop; j++)
{ {
unsigned int tmp = *dp & (0x7f7f >> (7 - dshift)); unsigned int tmp = *dp & (0x7f7f >> (7 - dshift));
tmp |= v << dshift; tmp |= (unsigned int)(v << dshift);
*dp = (png_byte)(tmp & 0xff); *dp = (png_byte)(tmp & 0xff);
if (dshift == s_end) if (dshift == s_end)
@ -3629,7 +3636,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
} }
else else
dshift += s_inc; dshift = (unsigned int)((int)dshift + s_inc);
} }
if (sshift == s_end) if (sshift == s_end)
@ -3639,7 +3646,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
} }
else else
sshift += s_inc; sshift = (unsigned int)((int)sshift + s_inc);
} }
break; break;
} }
@ -3648,16 +3655,17 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
{ {
png_bytep sp = row + (png_uint_32)((row_info->width - 1) >> 2); png_bytep sp = row + (png_uint_32)((row_info->width - 1) >> 2);
png_bytep dp = row + (png_uint_32)((final_width - 1) >> 2); png_bytep dp = row + (png_uint_32)((final_width - 1) >> 2);
int sshift, dshift; unsigned int sshift, dshift;
int s_start, s_end, s_inc; unsigned int s_start, s_end;
int jstop = png_pass_inc[pass]; int s_inc;
int jstop = (int)png_pass_inc[pass];
png_uint_32 i; png_uint_32 i;
#ifdef PNG_READ_PACKSWAP_SUPPORTED #ifdef PNG_READ_PACKSWAP_SUPPORTED
if ((transformations & PNG_PACKSWAP) != 0) if ((transformations & PNG_PACKSWAP) != 0)
{ {
sshift = (int)(((row_info->width + 3) & 0x03) << 1); sshift = (((row_info->width + 3) & 0x03) << 1);
dshift = (int)(((final_width + 3) & 0x03) << 1); dshift = (((final_width + 3) & 0x03) << 1);
s_start = 6; s_start = 6;
s_end = 0; s_end = 0;
s_inc = -2; s_inc = -2;
@ -3666,8 +3674,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
else else
#endif #endif
{ {
sshift = (int)((3 - ((row_info->width + 3) & 0x03)) << 1); sshift = ((3 - ((row_info->width + 3) & 0x03)) << 1);
dshift = (int)((3 - ((final_width + 3) & 0x03)) << 1); dshift = ((3 - ((final_width + 3) & 0x03)) << 1);
s_start = 0; s_start = 0;
s_end = 6; s_end = 6;
s_inc = 2; s_inc = 2;
@ -3682,7 +3690,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
for (j = 0; j < jstop; j++) for (j = 0; j < jstop; j++)
{ {
unsigned int tmp = *dp & (0x3f3f >> (6 - dshift)); unsigned int tmp = *dp & (0x3f3f >> (6 - dshift));
tmp |= v << dshift; tmp |= (unsigned int)(v << dshift);
*dp = (png_byte)(tmp & 0xff); *dp = (png_byte)(tmp & 0xff);
if (dshift == s_end) if (dshift == s_end)
@ -3692,7 +3700,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
} }
else else
dshift += s_inc; dshift = (unsigned int)((int)dshift + s_inc);
} }
if (sshift == s_end) if (sshift == s_end)
@ -3702,7 +3710,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
} }
else else
sshift += s_inc; sshift = (unsigned int)((int)sshift + s_inc);
} }
break; break;
} }
@ -3711,16 +3719,17 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
{ {
png_bytep sp = row + (png_size_t)((row_info->width - 1) >> 1); png_bytep sp = row + (png_size_t)((row_info->width - 1) >> 1);
png_bytep dp = row + (png_size_t)((final_width - 1) >> 1); png_bytep dp = row + (png_size_t)((final_width - 1) >> 1);
int sshift, dshift; unsigned int sshift, dshift;
int s_start, s_end, s_inc; unsigned int s_start, s_end;
int s_inc;
png_uint_32 i; png_uint_32 i;
int jstop = png_pass_inc[pass]; int jstop = (int)png_pass_inc[pass];
#ifdef PNG_READ_PACKSWAP_SUPPORTED #ifdef PNG_READ_PACKSWAP_SUPPORTED
if ((transformations & PNG_PACKSWAP) != 0) if ((transformations & PNG_PACKSWAP) != 0)
{ {
sshift = (int)(((row_info->width + 1) & 0x01) << 2); sshift = (((row_info->width + 1) & 0x01) << 2);
dshift = (int)(((final_width + 1) & 0x01) << 2); dshift = (((final_width + 1) & 0x01) << 2);
s_start = 4; s_start = 4;
s_end = 0; s_end = 0;
s_inc = -4; s_inc = -4;
@ -3729,8 +3738,8 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
else else
#endif #endif
{ {
sshift = (int)((1 - ((row_info->width + 1) & 0x01)) << 2); sshift = ((1 - ((row_info->width + 1) & 0x01)) << 2);
dshift = (int)((1 - ((final_width + 1) & 0x01)) << 2); dshift = ((1 - ((final_width + 1) & 0x01)) << 2);
s_start = 0; s_start = 0;
s_end = 4; s_end = 4;
s_inc = 4; s_inc = 4;
@ -3744,7 +3753,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
for (j = 0; j < jstop; j++) for (j = 0; j < jstop; j++)
{ {
unsigned int tmp = *dp & (0xf0f >> (4 - dshift)); unsigned int tmp = *dp & (0xf0f >> (4 - dshift));
tmp |= v << dshift; tmp |= (unsigned int)(v << dshift);
*dp = (png_byte)(tmp & 0xff); *dp = (png_byte)(tmp & 0xff);
if (dshift == s_end) if (dshift == s_end)
@ -3754,7 +3763,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
} }
else else
dshift += s_inc; dshift = (unsigned int)((int)dshift + s_inc);
} }
if (sshift == s_end) if (sshift == s_end)
@ -3764,7 +3773,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
} }
else else
sshift += s_inc; sshift = (unsigned int)((int)sshift + s_inc);
} }
break; break;
} }
@ -3778,7 +3787,7 @@ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass,
png_bytep dp = row + (png_size_t)(final_width - 1) * pixel_bytes; png_bytep dp = row + (png_size_t)(final_width - 1) * pixel_bytes;
int jstop = png_pass_inc[pass]; int jstop = (int)png_pass_inc[pass];
png_uint_32 i; png_uint_32 i;
for (i = 0; i < row_info->width; i++) for (i = 0; i < row_info->width; i++)
@ -3922,7 +3931,7 @@ static void
png_read_filter_row_paeth_multibyte_pixel(png_row_infop row_info, png_bytep row, png_read_filter_row_paeth_multibyte_pixel(png_row_infop row_info, png_bytep row,
png_const_bytep prev_row) png_const_bytep prev_row)
{ {
int bpp = (row_info->pixel_depth + 7) >> 3; unsigned int bpp = (row_info->pixel_depth + 7) >> 3;
png_bytep rp_end = row + bpp; png_bytep rp_end = row + bpp;
/* Process the first pixel in the row completely (this is the same as 'up' /* Process the first pixel in the row completely (this is the same as 'up'
@ -3935,7 +3944,7 @@ png_read_filter_row_paeth_multibyte_pixel(png_row_infop row_info, png_bytep row,
} }
/* Remainder */ /* Remainder */
rp_end += row_info->rowbytes - bpp; rp_end = rp_end + (row_info->rowbytes - bpp);
while (row < rp_end) while (row < rp_end)
{ {
@ -4280,7 +4289,7 @@ png_read_start_row(png_structrp png_ptr)
/* Offset to next interlace block in the y direction */ /* Offset to next interlace block in the y direction */
static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; static PNG_CONST png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2};
int max_pixel_depth; unsigned int max_pixel_depth;
png_size_t row_bytes; png_size_t row_bytes;
png_debug(1, "in png_read_start_row"); png_debug(1, "in png_read_start_row");
@ -4309,7 +4318,7 @@ png_read_start_row(png_structrp png_ptr)
png_ptr->iwidth = png_ptr->width; png_ptr->iwidth = png_ptr->width;
} }
max_pixel_depth = png_ptr->pixel_depth; max_pixel_depth = (unsigned int)png_ptr->pixel_depth;
/* WARNING: * png_read_transform_info (pngrtran.c) performs a simpler set of /* WARNING: * png_read_transform_info (pngrtran.c) performs a simpler set of
* calculations to calculate the final pixel depth, then * calculations to calculate the final pixel depth, then
@ -4444,7 +4453,7 @@ png_read_start_row(png_structrp png_ptr)
defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
if ((png_ptr->transformations & PNG_USER_TRANSFORM) != 0) if ((png_ptr->transformations & PNG_USER_TRANSFORM) != 0)
{ {
int user_pixel_depth = png_ptr->user_transform_depth * unsigned int user_pixel_depth = png_ptr->user_transform_depth *
png_ptr->user_transform_channels; png_ptr->user_transform_channels;
if (user_pixel_depth > max_pixel_depth) if (user_pixel_depth > max_pixel_depth)
@ -4466,7 +4475,7 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
* for safety's sake * for safety's sake
*/ */
row_bytes = PNG_ROWBYTES(max_pixel_depth, row_bytes) + row_bytes = PNG_ROWBYTES(max_pixel_depth, row_bytes) +
1 + ((max_pixel_depth + 7) >> 3); 1 + ((max_pixel_depth + 7) >> 3U);
#ifdef PNG_MAX_MALLOC_64K #ifdef PNG_MAX_MALLOC_64K
if (row_bytes > (png_uint_32)65536L) if (row_bytes > (png_uint_32)65536L)
@ -4535,7 +4544,7 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
* does not, so free the read buffer now regardless; the sequential reader * does not, so free the read buffer now regardless; the sequential reader
* reallocates it on demand. * reallocates it on demand.
*/ */
if (png_ptr->read_buffer != 0) if (png_ptr->read_buffer != NULL)
{ {
png_bytep buffer = png_ptr->read_buffer; png_bytep buffer = png_ptr->read_buffer;

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