Ivan Maidanski | 12 Apr 2010 07:01
Picon

vm/reference code refinements

Hi!

The proposed (attached) patch doesn't really contain bug fixes, it just refines the reference VM classes
(like making the classes/methods package-private instead of public and prohibiting class instantiation).

The ChangeLog entries:

	* vm/reference/gnu/classpath/VMStackWalker.java: Make the default
	constructor private.
	* vm/reference/gnu/classpath/VMSystemProperties.java: Likewise.
	* vm/reference/gnu/java/lang/VMCPStringBuilder.java: Likewise.
	* vm/reference/gnu/java/lang/VMInstrumentationImpl.java: Likewise.
	* vm/reference/gnu/java/lang/management/VMClassLoadingMXBeanImpl.java:
	Likewise.
	* vm/reference/gnu/java/lang/management/VMCompilationMXBeanImpl.java:
	Likewise.
	* vm/reference/gnu/java/lang/management/VMGarbageCollectorMXBeanImpl.java:
	Likewise.
	* vm/reference/gnu/java/lang/management/VMMemoryMXBeanImpl.java:
	Likewise.
	*vm/reference/gnu/java/lang/management/VMMemoryManagerMXBeanImpl.java:
	Likewise.
	* vm/reference/gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java:
	Likewise.
	* vm/reference/gnu/java/lang/management/VMOperatingSystemMXBeanImpl.java:
	Likewise.
	* vm/reference/gnu/java/lang/management/VMRuntimeMXBeanImpl.java:
	Likewise.
	* vm/reference/gnu/java/lang/management/VMThreadMXBeanImpl.java:
	Likewise.
(Continue reading)

Andrew John Hughes | 12 Apr 2010 21:54
Picon
Favicon

Re: vm/reference code refinements

2010/4/12 Ivan Maidanski <ivmai <at> mail.ru>:
> Hi!
>
> The proposed (attached) patch doesn't really contain bug fixes, it just refines the reference VM classes
(like making the classes/methods package-private instead of public and prohibiting class instantiation).
>
> The ChangeLog entries:
>
>        * vm/reference/gnu/classpath/VMStackWalker.java: Make the default
>        constructor private.
>        * vm/reference/gnu/classpath/VMSystemProperties.java: Likewise.
>        * vm/reference/gnu/java/lang/VMCPStringBuilder.java: Likewise.
>        * vm/reference/gnu/java/lang/VMInstrumentationImpl.java: Likewise.
>        * vm/reference/gnu/java/lang/management/VMClassLoadingMXBeanImpl.java:
>        Likewise.
>        * vm/reference/gnu/java/lang/management/VMCompilationMXBeanImpl.java:
>        Likewise.
>        * vm/reference/gnu/java/lang/management/VMGarbageCollectorMXBeanImpl.java:
>        Likewise.
>        * vm/reference/gnu/java/lang/management/VMMemoryMXBeanImpl.java:
>        Likewise.
>        *vm/reference/gnu/java/lang/management/VMMemoryManagerMXBeanImpl.java:
>        Likewise.
>        * vm/reference/gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java:
>        Likewise.
>        * vm/reference/gnu/java/lang/management/VMOperatingSystemMXBeanImpl.java:
>        Likewise.
>        * vm/reference/gnu/java/lang/management/VMRuntimeMXBeanImpl.java:
>        Likewise.
>        * vm/reference/gnu/java/lang/management/VMThreadMXBeanImpl.java:
(Continue reading)

Ivan Maidanski | 13 Apr 2010 09:05
Picon

Re: vm/reference code refinements


Mon, 12 Apr 2010 20:54:58 +0100 Andrew John Hughes <ahughes <at> redhat.com>:

> 2010/4/12 Ivan Maidanski <ivmai <at> mail.ru>:
> > Hi!
> >
> > The proposed (attached) patch doesn't really contain bug fixes, it just refines the reference VM
classes (like making the classes/methods package-private instead of public and prohibiting class instantiation).
> >
> > The ChangeLog entries:
> > ...
> >
> > Bye.
> >

I resubmit the patch and the changelog entries (because I earlier forget to change VMFile.canWrite()
comment (as I did for canRead/Execute()):

	* vm/reference/gnu/classpath/VMStackWalker.java: Make the default
	constructor private.
	* vm/reference/gnu/classpath/VMSystemProperties.java: Likewise.
	* vm/reference/gnu/java/lang/VMCPStringBuilder.java: Likewise.
	* vm/reference/gnu/java/lang/VMInstrumentationImpl.java: Likewise.
	* vm/reference/gnu/java/lang/management/VMClassLoadingMXBeanImpl.java:
	Likewise.
	* vm/reference/gnu/java/lang/management/VMCompilationMXBeanImpl.java:
	Likewise.
	* vm/reference/gnu/java/lang/management/VMGarbageCollectorMXBeanImpl.java:
	Likewise.
	* vm/reference/gnu/java/lang/management/VMMemoryMXBeanImpl.java:
(Continue reading)

Ivan Maidanski | 19 Apr 2010 09:23
Picon

jcl.c improvement and bugfix for GtkToolkit

Hi!

This proposed patch contains:
1. a fix for GtkToolkit.c (convert local ref to global, see bug #40889);
2. minor fix for JCL_realloc() (don't call free(ptr) if ptr is null like in JCL_free);
3. 32/64-bit code variants collapsed by introducing several macros (which select the proper class name,
primitive type, etc.);
4. new recognized macro (JCL_NO_JNIONLOAD) which removes the need for JNI_OnLoad (thus, if
JCL_NO_JNIONLOAD is defined, it is possible to link jcl.c statically).

Note on JCL_NO_JNIONLOAD: it roughly turns on the old Classpath implementation of
JCL_NewRawDataObject and JCL_GetRawData which wasn't based on JNI_OnLoad(), the difference is that the
new implementation is MT-safe (unless the CPU does not offer atomicity of pointer accesses).

ChangeLog entries:
	* native/jni/classpath/jcl.c (JCL_POINTER_CLASSNAME,
	JCL_POINTER_DATASIGN, JCL_POINTER_INTTYPE, JCL_POINTER_GETFIELD): New
	macro (used only in JNI_OnLoad, JCL_NewRawDataObject, JCL_GetRawData).
	* native/jni/classpath/jcl.c (JCL_NO_JNIONLOAD): Recognize new macro.
	* native/jni/classpath/jcl.c (JNI_OnLoad): Define only if not
	JCL_NO_JNIONLOAD.
	* native/jni/classpath/jcl.c (JNI_OnLoad, JCL_NewRawDataObject): Use
	JCL_POINTER_xxx macros instead of SIZEOF_VOID_P.
	* native/jni/classpath/jcl.c (JCL_realloc): Don't call free() for
	NULL pointer.
	* native/jni/classpath/jcl.c (JCL_NewRawDataObject, JCL_GetRawData):
	Initialize rawDataClass, rawData_fid, rawData_mid global variables
	if JCL_NO_JNIONLOAD.
	* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c
	(Java_gnu_java_awt_peer_gtk_GtkToolkit_gtkInit): Convert gtktoolkit
(Continue reading)

Andrew John Hughes | 27 Apr 2010 23:22
Picon
Favicon

FYI: Warning and whitespace fixes for gnu.javax.print.ipp.attribute.*

This patch fixes a number of warnings due to a mismatch between our
attribute implementation and the interface (getCategory now returns
Class<? extends Attribute>) and the use of raw types in
getAssociatedAttributeArray(Set).

The committed version also includes some automated whitespace cleanup,
removing trailing whitespace and replacing tabs with spaces.  They are
omitted in the version attached here for clarity.

2010-04-27  Andrew John Hughes  <ahughes <at> redhat.com>

	* gnu/javax/print/ipp/IppPrintService.java:
	Fix whitespace.  Use correct generic type for printerAttr
	map.
	(getPrinterAttributeSet(Class<? extends Attribute>)): Add
	appropriate generic type.
	* gnu/javax/print/ipp/attribute/supported/CharsetSupported.java:
	Fix whitespace.
	(getCategory()): Fix return type.
	* gnu/javax/print/ipp/attribute/supported/CompressionSupported.java:
	Fix whitespace.
	(getCategory()): Fix return type.
	(getAssociatedAttributeArray(Set<CompressionSupported>)): Add generic
	type to set and use for-each loop.
	* gnu/javax/print/ipp/attribute/supported/DocumentFormatSupported.java:
	Fix whitespace.
	(getCategory()): Fix return type.
	* gnu/javax/print/ipp/attribute/supported/FinishingsSupported.java:
	Fix whitespace.
	(getCategory()): Fix return type.
(Continue reading)

Andrew John Hughes | 27 Apr 2010 23:42
Picon
Favicon

FYI: Normalize whitespace in gnu.javax.print

This patch normalises the whitespace in gnu.javax.print.*.  The changes were
generated using the Sun script here:

http://mail.openjdk.java.net/pipermail/jdk6-dev/2009-September/000785.html

Tabs are replaced with spaces and trailing whitespace is removed.

2010-04-27  Andrew John Hughes  <ahughes <at> redhat.com>

	* gnu/javax/print/CupsIppOperation.java,
	* gnu/javax/print/CupsMediaMapping.java,
	* gnu/javax/print/CupsPrintService.java,
	* gnu/javax/print/CupsPrintServiceLookup.java,
	* gnu/javax/print/CupsServer.java,
	* gnu/javax/print/PrintAttributeException.java,
	* gnu/javax/print/PrintFlavorException.java,
	* gnu/javax/print/PrintUriException.java,
	* gnu/javax/print/PrinterDialog.java,
	* gnu/javax/print/ipp/DocPrintJobImpl.java,
	* gnu/javax/print/ipp/IppDelimiterTag.java,
	* gnu/javax/print/ipp/IppException.java,
	* gnu/javax/print/ipp/IppMultiDocPrintService.java,
	* gnu/javax/print/ipp/IppRequest.java,
	* gnu/javax/print/ipp/IppResponse.java,
	* gnu/javax/print/ipp/IppStatusCode.java,
	* gnu/javax/print/ipp/IppUtilities.java,
	* gnu/javax/print/ipp/IppValueTag.java,
	* gnu/javax/print/ipp/MultiDocPrintJobImpl.java,
	* gnu/javax/print/ipp/attribute/CharsetSyntax.java,
	* gnu/javax/print/ipp/attribute/DefaultValueAttribute.java,
(Continue reading)

Andrew John Hughes | 28 Apr 2010 01:32
Picon
Favicon

FYI: Add generic types to gnu.javax.print.ipp.IppUtilities

This patch adds generic types in IppUtilities.java, fixing nearly
a hundred warnings.

2010-04-28  Andrew John Hughes  <ahughes <at> redhat.com>

	* gnu/javax/print/ipp/IppUtilities.java:
	(INTEGER_CLASS_ARRAY): Use generic typing.
	(TEXT_CLASS_ARRAY): Likewise.
	(classesByName): Likewise.
	(instanceByClass): Likewise.
	(getClass(String)): Remove cast.  Return generic type.
	(getSupportedAttrName(Class<? extends Attribute>)): Remove cast.
	Add generic type to parameter.
	(getSupportedCategory(Class<?> extends Attribute>)): Likewise.
	(getEnumAttribute(String,Object)): Add missing generic types on Class.
	(getIntegerAttribute(String,int)): Likewise and on Constructor.
	(getTextAttribute(String,byte,byte[])): Likewise.
--

-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net
PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint = F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8
(Continue reading)

Andrew John Hughes | 28 Apr 2010 01:04
Picon
Favicon

FYI: Fix remaining getCategory() return types

A continutation of the earlier patch, this fixes the remaining return values
of getCategory() implementations in gnu.javax.print.ipp.  It also changes the
getValues() method in RequestedAttributes so that mutable access is no longer
provided to the internal list of attributes; an array snapshot is returned instead.

2010-04-27  Andrew John Hughes  <ahughes <at> redhat.com>

	* gnu/javax/print/ipp/IppRequest.java:
	(write(RequestedAttributes)): Fix for change in return value
	of RequestedAttributes.getValues().
	* gnu/javax/print/ipp/attribute/DetailedStatusMessage.java:
	(getCategory()): Fix return value.
	* gnu/javax/print/ipp/attribute/DocumentAccessError.java:
	(getCategory()): Fix return value.
	* gnu/javax/print/ipp/attribute/RequestedAttributes.java:
	(RequestedAttributes()): Use appropriate generic type with attributes
	ArrayList.
	(getValues()): Return an array-based snapshot of the current state of
	attributes rather than providing direct mutable access to it.
	* gnu/javax/print/ipp/attribute/StatusMessage.java:
	(getCategory()): Fix return value.
	* gnu/javax/print/ipp/attribute/UnknownAttribute.java:
	(getCategory()): Fix return value.
	* gnu/javax/print/ipp/attribute/defaults/CopiesDefault.java:
	(getCategory()): Fix return value.
	* gnu/javax/print/ipp/attribute/defaults/DocumentFormatDefault.java:
	(getCategory()): Fix return value.
	* gnu/javax/print/ipp/attribute/defaults/FinishingsDefault.java:
	(getCategory()): Fix return value.
	* gnu/javax/print/ipp/attribute/defaults/JobHoldUntilDefault.java:
(Continue reading)

Andrew John Hughes | 28 Apr 2010 23:32
Picon
Favicon

FYI: Generic fixes for gnu.javax.print.ipp.IppResponse and gnu.javax.print.ipp.IppPrintService

As subject.

2010-04-28  Andrew John Hughes  <ahughes <at> redhat.com>

	* gnu/javax/print/ipp/IppPrintService.java:
	(printerAttr): Add generic typing.
	(printServiceAttributeListener): Likewise.
	(flavors): Likewise.
	(printerUris): Likewise.
	(IppPrintService(URI uri, String username, String password)):
	Use generic types in initialising listener set.
	(getPrinterAttributes()): Add generic types.  Remove cast.
	(getPrinterAttributeSet(Class<T>)): Return a set containing
	attributes of type T.  Now creates a new set and checks that
	all elements of the original set can be cast and added to this
	new set.
	(getPrinterDefaultAttribute(Class<? extends Attribute>)): Add
	generic types.
	(processResponse()): Add generic types.
	(getAttribute(Class<T>)): Use generic types corresponding to
	parent interface.
	(getSupportedAttributeCategories()): Use generic types.
	(getSupportedAttributeValues()): Likewise.
	(handleSupportedAttributeValuesResponse(IppResponse,Class<? extends Attribute>)):
	Likewise.
	(isAttributeCategorySupported(Class<? extends Attribute>)): Likewise.
	* gnu/javax/print/ipp/IppResponse.java:
	(parseResponse(InputStream)): Use generic types.
	(parseAttributes(Map<Class<? extends Attribute>, Set<Attribute>, DataInputStream)):
	Likewise.
(Continue reading)


Gmane