mirror of
https://github.com/apache/openjpa.git
synced 2025-02-20 17:05:15 +00:00
Add (presumably forgotten) JDK 1.4 GregorianCalendar. 1.4 has a public mutator
method that wasn't available in previous versions, and we must intercept it. git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@428533 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
eb333839db
commit
0167f87b32
36
openjpa-kernel-4/pom.xml
Normal file
36
openjpa-kernel-4/pom.xml
Normal file
@ -0,0 +1,36 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.apache.openjpa</groupId>
|
||||
<artifactId>openjpa-kernel-4</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Kernel 1.4</name>
|
||||
<description>Kernel 1.4</description>
|
||||
<url>http://incubator.apache.org/projects/openjpa</url>
|
||||
<parent>
|
||||
<groupId>org.apache.openjpa</groupId>
|
||||
<artifactId>openjpa</artifactId>
|
||||
<version>0.9.0</version>
|
||||
</parent>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.openjpa</groupId>
|
||||
<artifactId>openjpa-kernel</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.4</source>
|
||||
<target>1.4</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,60 @@
|
||||
package org.apache.openjpa.util;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
/**
|
||||
* {@link ProxyGregorianCalendar} subclass that overrides the mutating
|
||||
* {@link #set} method, which is final in Java 1.3 but public in Java 1.4
|
||||
* and higher.
|
||||
*
|
||||
* @author Marc Prud'hommeaux
|
||||
* @nojavadoc
|
||||
*/
|
||||
public class ProxyGregorianCalendar4
|
||||
extends ProxyGregorianCalendar {
|
||||
|
||||
public ProxyGregorianCalendar4() {
|
||||
super();
|
||||
}
|
||||
|
||||
public ProxyGregorianCalendar4(int year, int month, int dayOfMonth) {
|
||||
super(year, month, dayOfMonth);
|
||||
}
|
||||
|
||||
public ProxyGregorianCalendar4(int year, int month, int dayOfMonth,
|
||||
int hourOfDay, int minute) {
|
||||
super(year, month, dayOfMonth, hourOfDay, minute);
|
||||
}
|
||||
|
||||
public ProxyGregorianCalendar4(int year, int month, int dayOfMonth,
|
||||
int hourOfDay, int minute, int second) {
|
||||
super(year, month, dayOfMonth, hourOfDay, minute, second);
|
||||
}
|
||||
|
||||
public ProxyGregorianCalendar4(Locale aLocale) {
|
||||
super(aLocale);
|
||||
}
|
||||
|
||||
public ProxyGregorianCalendar4(TimeZone zone) {
|
||||
super(zone);
|
||||
}
|
||||
|
||||
public ProxyGregorianCalendar4(TimeZone zone, Locale aLocale) {
|
||||
super(zone, aLocale);
|
||||
}
|
||||
|
||||
public void set(int field, int value) {
|
||||
if (get(field) != value) {
|
||||
Proxies.dirty(this);
|
||||
super.set(field, value);
|
||||
}
|
||||
}
|
||||
|
||||
public ProxyCalendar newInstance(TimeZone timeZone) {
|
||||
if (timeZone == null)
|
||||
return new ProxyGregorianCalendar4();
|
||||
else
|
||||
return new ProxyGregorianCalendar4(timeZone);
|
||||
}
|
||||
}
|
@ -135,6 +135,11 @@
|
||||
<artifactId>openjpa-kernel</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.openjpa</groupId>
|
||||
<artifactId>openjpa-kernel-4</artifactId>
|
||||
<version>${pom.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.openjpa</groupId>
|
||||
<artifactId>openjpa-kernel-5</artifactId>
|
||||
|
10
pom.xml
10
pom.xml
@ -89,6 +89,15 @@
|
||||
<module>openjpa-project</module>
|
||||
</modules>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>jdk1.4</id>
|
||||
<activation>
|
||||
<jdk>1.4</jdk>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>openjpa-kernel-4</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>jdk1.5</id>
|
||||
<activation>
|
||||
@ -97,6 +106,7 @@
|
||||
<modules>
|
||||
<module>openjpa-persistence</module>
|
||||
<module>openjpa-persistence-jdbc</module>
|
||||
<module>openjpa-kernel-4</module>
|
||||
<module>openjpa-kernel-5</module>
|
||||
<module>openjpa-jdbc-5</module>
|
||||
</modules>
|
||||
|
Loading…
x
Reference in New Issue
Block a user