Merge remote-tracking branch 'origin/helma-🐜' into helma-🐜
This commit is contained in:
commit
47f7b19fe9
20 changed files with 186 additions and 186 deletions
10
README.md
10
README.md
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
## TL;DR
|
## TL;DR
|
||||||
|
|
||||||
- Make sure you have Java 11 or higher installed
|
- Make sure you have Java 17 or higher installed
|
||||||
- Download and unpack the [latest release](https://github.com/antville/helma/releases)
|
- Download and unpack the [latest release](https://github.com/antville/helma/releases)
|
||||||
- Invoke `./bin/helma`, resp. `./bin/helma.bat`, depending on your platform
|
- Invoke `./bin/helma`, resp. `./bin/helma.bat`, depending on your platform
|
||||||
- Direct your web browser to <http://localhost:8080>
|
- Direct your web browser to <http://localhost:8080>
|
||||||
|
@ -21,9 +21,9 @@ Although Helma became a Grande Dame of server-side JavaScript already decades ag
|
||||||
|
|
||||||
## System Requirements
|
## System Requirements
|
||||||
|
|
||||||
You need a Java virtual machine version 11 or higher to run Helma.
|
You need a Java virtual machine version 17 or higher to run Helma.
|
||||||
|
|
||||||
Please consult the documentation of your platform how to obtain and install Java.
|
Please consult the documentation of your platform on how to obtain and install Java.
|
||||||
|
|
||||||
You also can directly download a [Java runtime or development kit](https://www.oracle.com/java/technologies/javase-downloads.html#javasejdk) from Oracle.
|
You also can directly download a [Java runtime or development kit](https://www.oracle.com/java/technologies/javase-downloads.html#javasejdk) from Oracle.
|
||||||
|
|
||||||
|
@ -34,9 +34,9 @@ Helma is built with [Gradle](https://gradle.org), the build task depends on the
|
||||||
### Additional Prerequisites
|
### Additional Prerequisites
|
||||||
|
|
||||||
* [Rsync](https://rsync.samba.org) version ≥ 3.1.0
|
* [Rsync](https://rsync.samba.org) version ≥ 3.1.0
|
||||||
* [NodeJS](https://nodejs.org) LTS version
|
* [Node.js](https://nodejs.org) LTS version
|
||||||
|
|
||||||
Clone this repository to your machine and start the build process with `./gradlew install`. The build script is going to ask you if you want to update the installation, enter `y`.
|
Clone this repository to your machine and start the build process with `./gradlew install`. The build script is going to ask you if you want to update the installation, enter `yes` or `no`.
|
||||||
|
|
||||||
> ⚠️
|
> ⚠️
|
||||||
> Please be aware that this step is going to overwrite files in the installation directory – escpecially at a later time when there might be substantial changes. Should this happen by accident you find the previous installation in the `backups` directory.
|
> Please be aware that this step is going to overwrite files in the installation directory – escpecially at a later time when there might be substantial changes. Should this happen by accident you find the previous installation in the `backups` directory.
|
||||||
|
|
|
@ -18,8 +18,8 @@ allprojects {
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
|
|
||||||
compileJava {
|
compileJava {
|
||||||
sourceCompatibility = JavaVersion.VERSION_11
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
targetCompatibility = JavaVersion.VERSION_11
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
|
|
|
@ -280,9 +280,9 @@ public class ResponseBean implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* add an HTML formatted debug message to the end of the page.
|
* add HTML formatted debug messages to the end of the page.
|
||||||
*
|
*
|
||||||
* @param message the message
|
* @param messages the list of messages
|
||||||
*/
|
*/
|
||||||
public void debug(String... messages) {
|
public void debug(String... messages) {
|
||||||
if (messages == null) {
|
if (messages == null) {
|
||||||
|
|
|
@ -384,7 +384,7 @@ public final class ResponseTrans extends Writer implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replace special characters with entities, including <, > and ", thus allowing
|
* Replace special characters with entities, including {@code <}, {@code >} and {@code "}, thus allowing
|
||||||
* no HTML tags.
|
* no HTML tags.
|
||||||
*/
|
*/
|
||||||
public synchronized void encode(Object what) {
|
public synchronized void encode(Object what) {
|
||||||
|
@ -415,7 +415,7 @@ public final class ResponseTrans extends Writer implements Serializable {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Replace special characters with entities, including <, > and ", thus allowing
|
* Replace special characters with entities, including {@code <}, {@code >} and {@code "}, thus allowing
|
||||||
* no HTML tags.
|
* no HTML tags.
|
||||||
*/
|
*/
|
||||||
public synchronized void encodeXml(Object what) {
|
public synchronized void encodeXml(Object what) {
|
||||||
|
|
|
@ -129,7 +129,7 @@ public final class TypeManager {
|
||||||
protected synchronized void checkRepository(Repository repository, boolean update) throws IOException {
|
protected synchronized void checkRepository(Repository repository, boolean update) throws IOException {
|
||||||
Repository[] list = repository.getRepositories();
|
Repository[] list = repository.getRepositories();
|
||||||
for (int i = 0; i < list.length; i++) {
|
for (int i = 0; i < list.length; i++) {
|
||||||
|
|
||||||
// ignore dir name found - compare to shortname (= Prototype name)
|
// ignore dir name found - compare to shortname (= Prototype name)
|
||||||
if (ignoreDirs.contains(list[i].getShortName())) {
|
if (ignoreDirs.contains(list[i].getShortName())) {
|
||||||
// jump this repository
|
// jump this repository
|
||||||
|
@ -140,7 +140,7 @@ public final class TypeManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (list[i].isScriptRoot()) {
|
if (list[i].isScriptRoot()) {
|
||||||
// this is an embedded top-level script repository
|
// this is an embedded top-level script repository
|
||||||
if (app.addRepository(list[i], list[i].getParentRepository())) {
|
if (app.addRepository(list[i], list[i].getParentRepository())) {
|
||||||
// repository is new, check it
|
// repository is new, check it
|
||||||
checkRepository(list[i], update);
|
checkRepository(list[i], update);
|
||||||
|
@ -153,7 +153,7 @@ public final class TypeManager {
|
||||||
// if prototype doesn't exist, create it
|
// if prototype doesn't exist, create it
|
||||||
if (proto == null) {
|
if (proto == null) {
|
||||||
// create new prototype if type name is valid
|
// create new prototype if type name is valid
|
||||||
if (isValidTypeName(name))
|
if (isValidTypeName(name))
|
||||||
createPrototype(name, list[i], null);
|
createPrototype(name, list[i], null);
|
||||||
} else {
|
} else {
|
||||||
proto.addRepository(list[i], update);
|
proto.addRepository(list[i], update);
|
||||||
|
@ -192,7 +192,7 @@ public final class TypeManager {
|
||||||
long lastScan = lastRepoScan.containsKey(repository) ?
|
long lastScan = lastRepoScan.containsKey(repository) ?
|
||||||
((Long) lastRepoScan.get(repository)).longValue() : 0;
|
((Long) lastRepoScan.get(repository)).longValue() : 0;
|
||||||
if (repository.lastModified() != lastScan) {
|
if (repository.lastModified() != lastScan) {
|
||||||
lastRepoScan.put(repository, new Long(repository.lastModified()));
|
lastRepoScan.put(repository, Long.valueOf(repository.lastModified()));
|
||||||
checkRepository(repository, false);
|
checkRepository(repository, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -210,7 +210,7 @@ public final class TypeManager {
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
System.err.println("CHECK: " + proto.getName() + " in " + Thread.currentThread());
|
System.err.println("CHECK: " + proto.getName() + " in " + Thread.currentThread());
|
||||||
}
|
}
|
||||||
|
|
||||||
// update prototype's type mapping
|
// update prototype's type mapping
|
||||||
DbMapping dbmap = proto.getDbMapping();
|
DbMapping dbmap = proto.getDbMapping();
|
||||||
|
|
|
@ -16,21 +16,21 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A few explanations:
|
* A few explanations:
|
||||||
*
|
*
|
||||||
* - this.image is either an AWT Image or a BufferedImage.
|
* - this.image is either an AWT Image or a BufferedImage.
|
||||||
* It depends on the ImageGenerator in what form the Image initially is.
|
* It depends on the ImageGenerator in what form the Image initially is.
|
||||||
* (the ImageIO implementation only uses BufferedImages for example.)
|
* (the ImageIO implementation only uses BufferedImages for example.)
|
||||||
*
|
*
|
||||||
* As soon as some action that needs the graphics object is performed and the
|
* As soon as some action that needs the graphics object is performed and the
|
||||||
* image is still in AWT format, it is converted to a BufferedImage
|
* image is still in AWT format, it is converted to a BufferedImage
|
||||||
*
|
*
|
||||||
* Any internal function that performs graphical actions needs to call
|
* Any internal function that performs graphical actions needs to call
|
||||||
* getGraphics, never rely on this.graphics being set correctly!
|
* getGraphics, never rely on this.graphics being set correctly!
|
||||||
*
|
*
|
||||||
* - ImageWrapper objects are created and safed by the ImageGenerator class
|
* - ImageWrapper objects are created and safed by the ImageGenerator class
|
||||||
* all different implementations of Imaging functionallity are implemented
|
* all different implementations of Imaging functionallity are implemented
|
||||||
* as a ImageGenerator extending class.
|
* as a ImageGenerator extending class.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package helma.image;
|
package helma.image;
|
||||||
|
@ -52,7 +52,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new ImageWrapper object.
|
* Creates a new ImageWrapper object.
|
||||||
*
|
*
|
||||||
* @param image ...
|
* @param image ...
|
||||||
* @param width ...
|
* @param width ...
|
||||||
* @param height ...
|
* @param height ...
|
||||||
|
@ -66,7 +66,7 @@ public class ImageWrapper {
|
||||||
// graphics are turned off by default. getGraphics activates it if necessary.
|
// graphics are turned off by default. getGraphics activates it if necessary.
|
||||||
this.graphics = null;
|
this.graphics = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ImageWrapper(Image image, ImageGenerator generator) {
|
public ImageWrapper(Image image, ImageGenerator generator) {
|
||||||
this(image, image.getWidth(null), image.getHeight(null), generator);
|
this(image, image.getWidth(null), image.getHeight(null), generator);
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ public class ImageWrapper {
|
||||||
* not. By using getBufferedImage, images are only converted to a
|
* not. By using getBufferedImage, images are only converted to a
|
||||||
* getBufferedImage when this is actually needed, which is better than
|
* getBufferedImage when this is actually needed, which is better than
|
||||||
* storing images as BufferedImage in general.
|
* storing images as BufferedImage in general.
|
||||||
*
|
*
|
||||||
* @return the Image object as a BufferedImage
|
* @return the Image object as a BufferedImage
|
||||||
*/
|
*/
|
||||||
public BufferedImage getBufferedImage() {
|
public BufferedImage getBufferedImage() {
|
||||||
|
@ -94,9 +94,9 @@ public class ImageWrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Graphics object to directly paint to this Image. Converts the
|
* Returns the Graphics object to directly paint to this Image. Converts the
|
||||||
* internal image to a BufferedImage if necessary.
|
* internal image to a BufferedImage if necessary.
|
||||||
*
|
*
|
||||||
* @return the Graphics object for drawing into this image
|
* @return the Graphics object for drawing into this image
|
||||||
*/
|
*/
|
||||||
public Graphics2D getGraphics() {
|
public Graphics2D getGraphics() {
|
||||||
|
@ -107,7 +107,7 @@ public class ImageWrapper {
|
||||||
}
|
}
|
||||||
return graphics;
|
return graphics;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the internal image and clears the stored graphics object.
|
* Sets the internal image and clears the stored graphics object.
|
||||||
* Any code that is changing the internal image should do it through this function
|
* Any code that is changing the internal image should do it through this function
|
||||||
|
@ -129,7 +129,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and returns a copy of this image.
|
* Creates and returns a copy of this image.
|
||||||
*
|
*
|
||||||
* @return a clone of this image.
|
* @return a clone of this image.
|
||||||
*/
|
*/
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
|
@ -141,7 +141,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Image object represented by this ImageWrapper.
|
* Returns the Image object represented by this ImageWrapper.
|
||||||
*
|
*
|
||||||
* @return the image object
|
* @return the image object
|
||||||
*/
|
*/
|
||||||
public Image getImage() {
|
public Image getImage() {
|
||||||
|
@ -150,7 +150,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the ImageProducer of the wrapped image
|
* Returns the ImageProducer of the wrapped image
|
||||||
*
|
*
|
||||||
* @return the images's ImageProducer
|
* @return the images's ImageProducer
|
||||||
*/
|
*/
|
||||||
public ImageProducer getSource() {
|
public ImageProducer getSource() {
|
||||||
|
@ -180,7 +180,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the color used to write/paint to this image.
|
* Sets the color used to write/paint to this image.
|
||||||
*
|
*
|
||||||
* @param red ...
|
* @param red ...
|
||||||
* @param green ...
|
* @param green ...
|
||||||
* @param blue ...
|
* @param blue ...
|
||||||
|
@ -191,7 +191,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the color used to write/paint to this image.
|
* Sets the color used to write/paint to this image.
|
||||||
*
|
*
|
||||||
* @param color ...
|
* @param color ...
|
||||||
*/
|
*/
|
||||||
public void setColor(int color) {
|
public void setColor(int color) {
|
||||||
|
@ -200,7 +200,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the color used to write/paint to this image.
|
* Sets the color used to write/paint to this image.
|
||||||
*
|
*
|
||||||
* @param color ...
|
* @param color ...
|
||||||
*/
|
*/
|
||||||
public void setColor(Color color) {
|
public void setColor(Color color) {
|
||||||
|
@ -209,7 +209,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the color used to write/paint to this image.
|
* Sets the color used to write/paint to this image.
|
||||||
*
|
*
|
||||||
* @param color ...
|
* @param color ...
|
||||||
*/
|
*/
|
||||||
public void setColor(String color) {
|
public void setColor(String color) {
|
||||||
|
@ -217,7 +217,7 @@ public class ImageWrapper {
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Draws a string to this image at the given coordinates.
|
* Draws a string to this image at the given coordinates.
|
||||||
*
|
*
|
||||||
* @param str ...
|
* @param str ...
|
||||||
* @param x ...
|
* @param x ...
|
||||||
* @param y ...
|
* @param y ...
|
||||||
|
@ -228,7 +228,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws a line to this image from x1/y1 to x2/y2.
|
* Draws a line to this image from x1/y1 to x2/y2.
|
||||||
*
|
*
|
||||||
* @param x1 ...
|
* @param x1 ...
|
||||||
* @param y1 ...
|
* @param y1 ...
|
||||||
* @param x2 ...
|
* @param x2 ...
|
||||||
|
@ -240,7 +240,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws a rectangle to this image.
|
* Draws a rectangle to this image.
|
||||||
*
|
*
|
||||||
* @param x ...
|
* @param x ...
|
||||||
* @param y ...
|
* @param y ...
|
||||||
* @param w ...
|
* @param w ...
|
||||||
|
@ -252,12 +252,12 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws another image to this image.
|
* Draws another image to this image.
|
||||||
*
|
*
|
||||||
* @param filename ...
|
* @param filename ...
|
||||||
* @param x ...
|
* @param x ...
|
||||||
* @param y ...
|
* @param y ...
|
||||||
*/
|
*/
|
||||||
public void drawImage(String filename, int x, int y)
|
public void drawImage(String filename, int x, int y)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
Image img = generator.read(filename);
|
Image img = generator.read(filename);
|
||||||
if (img != null)
|
if (img != null)
|
||||||
|
@ -266,30 +266,30 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws another image to this image.
|
* Draws another image to this image.
|
||||||
*
|
*
|
||||||
* @param image ...
|
* @param image ...
|
||||||
* @param x ...
|
* @param x ...
|
||||||
* @param y ...
|
* @param y ...
|
||||||
*/
|
*/
|
||||||
public void drawImage(ImageWrapper image, int x, int y)
|
public void drawImage(ImageWrapper image, int x, int y)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
getGraphics().drawImage(image.getImage(), x, y, null);
|
getGraphics().drawImage(image.getImage(), x, y, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws another image to this image.
|
* Draws another image to this image.
|
||||||
*
|
*
|
||||||
* @param image ...
|
* @param image ...
|
||||||
* @param at ...
|
* @param at ...
|
||||||
*/
|
*/
|
||||||
public void drawImage(ImageWrapper image, AffineTransform at)
|
public void drawImage(ImageWrapper image, AffineTransform at)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
getGraphics().drawImage(image.getImage(), at, null);
|
getGraphics().drawImage(image.getImage(), at, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws a filled rectangle to this image.
|
* Draws a filled rectangle to this image.
|
||||||
*
|
*
|
||||||
* @param x ...
|
* @param x ...
|
||||||
* @param y ...
|
* @param y ...
|
||||||
* @param w ...
|
* @param w ...
|
||||||
|
@ -301,7 +301,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the width of this image.
|
* Returns the width of this image.
|
||||||
*
|
*
|
||||||
* @return the width of this image
|
* @return the width of this image
|
||||||
*/
|
*/
|
||||||
public int getWidth() {
|
public int getWidth() {
|
||||||
|
@ -310,7 +310,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the height of this image.
|
* Returns the height of this image.
|
||||||
*
|
*
|
||||||
* @return the height of this image
|
* @return the height of this image
|
||||||
*/
|
*/
|
||||||
public int getHeight() {
|
public int getHeight() {
|
||||||
|
@ -319,7 +319,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Crops the image.
|
* Crops the image.
|
||||||
*
|
*
|
||||||
* @param x ...
|
* @param x ...
|
||||||
* @param y ...
|
* @param y ...
|
||||||
* @param w ...
|
* @param w ...
|
||||||
|
@ -340,21 +340,21 @@ public class ImageWrapper {
|
||||||
setImage(buffered);
|
setImage(buffered);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trims the image.
|
* Trims the image.
|
||||||
*
|
*
|
||||||
* @param x the x-coordinate of the pixel specifying the background color
|
* @param x the x-coordinate of the pixel specifying the background color
|
||||||
* @param y the y-coordinate of the pixel specifying the background color
|
* @param y the y-coordinate of the pixel specifying the background color
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public void trim(int x, int y) {
|
public void trim(int x, int y) {
|
||||||
trim(x, y, true, true, true, true);
|
trim(x, y, true, true, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trims the image.
|
* Trims the image.
|
||||||
*
|
*
|
||||||
* @param x
|
* @param x
|
||||||
* @param y
|
* @param y
|
||||||
* @param trimLeft
|
* @param trimLeft
|
||||||
|
@ -369,7 +369,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
// create a BufferedImage of only 1 pixel height for fetching the rows of the image in the correct format (ARGB)
|
// create a BufferedImage of only 1 pixel height for fetching the rows of the image in the correct format (ARGB)
|
||||||
// This speeds up things by more than factor 2, compared to the standard BufferedImage.getRGB solution,
|
// This speeds up things by more than factor 2, compared to the standard BufferedImage.getRGB solution,
|
||||||
// which is supposed to be fast too. This is probably the case because drawing to BufferedImages uses
|
// which is supposed to be fast too. This is probably the case because drawing to BufferedImages uses
|
||||||
// very optimized code which may even be hardware accelerated.
|
// very optimized code which may even be hardware accelerated.
|
||||||
if (trimTop || trimBottom) {
|
if (trimTop || trimBottom) {
|
||||||
BufferedImage row = new BufferedImage(width, 1, BufferedImage.TYPE_INT_ARGB);
|
BufferedImage row = new BufferedImage(width, 1, BufferedImage.TYPE_INT_ARGB);
|
||||||
|
@ -445,7 +445,7 @@ public class ImageWrapper {
|
||||||
}
|
}
|
||||||
crop(left, top, right - left + 1, bottom - top + 1);
|
crop(left, top, right - left + 1, bottom - top + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resizes the image using the Graphics2D approach
|
* Resizes the image using the Graphics2D approach
|
||||||
*/
|
*/
|
||||||
|
@ -453,12 +453,12 @@ public class ImageWrapper {
|
||||||
BufferedImage buffered = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
|
BufferedImage buffered = new BufferedImage(w, h, BufferedImage.TYPE_INT_ARGB);
|
||||||
Graphics2D g2d = buffered.createGraphics();
|
Graphics2D g2d = buffered.createGraphics();
|
||||||
|
|
||||||
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
|
g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
|
||||||
smooth ? RenderingHints.VALUE_INTERPOLATION_BICUBIC :
|
smooth ? RenderingHints.VALUE_INTERPOLATION_BICUBIC :
|
||||||
RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR
|
RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR
|
||||||
);
|
);
|
||||||
|
|
||||||
g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
|
g2d.setRenderingHint(RenderingHints.KEY_RENDERING,
|
||||||
smooth ? RenderingHints.VALUE_RENDER_QUALITY :
|
smooth ? RenderingHints.VALUE_RENDER_QUALITY :
|
||||||
RenderingHints.VALUE_RENDER_SPEED
|
RenderingHints.VALUE_RENDER_SPEED
|
||||||
);
|
);
|
||||||
|
@ -474,7 +474,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resizes the image
|
* Resizes the image
|
||||||
*
|
*
|
||||||
* @param w ...
|
* @param w ...
|
||||||
* @param h ...
|
* @param h ...
|
||||||
*/
|
*/
|
||||||
|
@ -494,7 +494,7 @@ public class ImageWrapper {
|
||||||
// Image scaled = ImageWaiter.waitForImage(image.getScaledInstance(w, h, Image.SCALE_AREA_AVERAGING));
|
// Image scaled = ImageWaiter.waitForImage(image.getScaledInstance(w, h, Image.SCALE_AREA_AVERAGING));
|
||||||
// if (scaled == null)
|
// if (scaled == null)
|
||||||
// throw new RuntimeException("Image cannot be resized.");
|
// throw new RuntimeException("Image cannot be resized.");
|
||||||
|
|
||||||
// This version is up to 4 times faster than getScaledInstance:
|
// This version is up to 4 times faster than getScaledInstance:
|
||||||
ImageFilterOp filter = new ImageFilterOp(new AreaAveragingScaleFilter(w, h));
|
ImageFilterOp filter = new ImageFilterOp(new AreaAveragingScaleFilter(w, h));
|
||||||
setImage(filter.filter(getBufferedImage(), null));
|
setImage(filter.filter(getBufferedImage(), null));
|
||||||
|
@ -503,7 +503,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resize the image, using a fast and cheap algorithm
|
* Resize the image, using a fast and cheap algorithm
|
||||||
*
|
*
|
||||||
* @param w ...
|
* @param w ...
|
||||||
* @param h ...
|
* @param h ...
|
||||||
*/
|
*/
|
||||||
|
@ -513,8 +513,8 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reduces the colors used in the image. Necessary before saving as GIF.
|
* Reduces the colors used in the image. Necessary before saving as GIF.
|
||||||
*
|
*
|
||||||
* @param colors colors the number of colors to use, usually <= 256.
|
* @param colors colors the number of colors to use, usually {@literal <}= 256.
|
||||||
*/
|
*/
|
||||||
public void reduceColors(int colors) {
|
public void reduceColors(int colors) {
|
||||||
reduceColors(colors, false);
|
reduceColors(colors, false);
|
||||||
|
@ -522,8 +522,8 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reduces the colors used in the image. Necessary before saving as GIF.
|
* Reduces the colors used in the image. Necessary before saving as GIF.
|
||||||
*
|
*
|
||||||
* @param colors colors the number of colors to use, usually <= 256.
|
* @param colors colors the number of colors to use, usually {@literal <}= 256.
|
||||||
* @param dither ...
|
* @param dither ...
|
||||||
*/
|
*/
|
||||||
public void reduceColors(int colors, boolean dither) {
|
public void reduceColors(int colors, boolean dither) {
|
||||||
|
@ -533,8 +533,8 @@ public class ImageWrapper {
|
||||||
/**
|
/**
|
||||||
* Reduce the colors used in this image. Useful and necessary before saving
|
* Reduce the colors used in this image. Useful and necessary before saving
|
||||||
* the image as GIF file.
|
* the image as GIF file.
|
||||||
*
|
*
|
||||||
* @param colors the number of colors to use, usually <= 256.
|
* @param colors the number of colors to use, usually {@literal <}= 256.
|
||||||
* @param dither ...
|
* @param dither ...
|
||||||
* @param alphaToBitmask ...
|
* @param alphaToBitmask ...
|
||||||
*/
|
*/
|
||||||
|
@ -546,7 +546,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save the image. Image format is deduced from filename.
|
* Save the image. Image format is deduced from filename.
|
||||||
*
|
*
|
||||||
* @param filename ...
|
* @param filename ...
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
|
@ -557,7 +557,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the image. Image format is deduced from filename.
|
* Saves the image. Image format is deduced from filename.
|
||||||
*
|
*
|
||||||
* @param filename ...
|
* @param filename ...
|
||||||
* @param quality ...
|
* @param quality ...
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
|
@ -569,7 +569,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the image. Image format is deduced from filename.
|
* Saves the image. Image format is deduced from filename.
|
||||||
*
|
*
|
||||||
* @param filename ...
|
* @param filename ...
|
||||||
* @param quality ...
|
* @param quality ...
|
||||||
* @param alpha ...
|
* @param alpha ...
|
||||||
|
@ -579,10 +579,10 @@ public class ImageWrapper {
|
||||||
throws IOException {
|
throws IOException {
|
||||||
generator.write(this, checkFilename(filename), quality, alpha);
|
generator.write(this, checkFilename(filename), quality, alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the image. Image format is deduced from mimeType.
|
* Saves the image. Image format is deduced from mimeType.
|
||||||
*
|
*
|
||||||
* @param out ...
|
* @param out ...
|
||||||
* @param mimeType ...
|
* @param mimeType ...
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
|
@ -591,10 +591,10 @@ public class ImageWrapper {
|
||||||
throws IOException {
|
throws IOException {
|
||||||
generator.write(this, out, mimeType, -1f, false); // -1 means default quality
|
generator.write(this, out, mimeType, -1f, false); // -1 means default quality
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the image. Image format is deduced from mimeType.
|
* Saves the image. Image format is deduced from mimeType.
|
||||||
*
|
*
|
||||||
* @param out ...
|
* @param out ...
|
||||||
* @param mimeType ...
|
* @param mimeType ...
|
||||||
* @param quality ...
|
* @param quality ...
|
||||||
|
@ -607,7 +607,7 @@ public class ImageWrapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Saves the image. Image format is deduced from mimeType.
|
* Saves the image. Image format is deduced from mimeType.
|
||||||
*
|
*
|
||||||
* @param out ...
|
* @param out ...
|
||||||
* @param mimeType ...
|
* @param mimeType ...
|
||||||
* @param quality ...
|
* @param quality ...
|
||||||
|
@ -618,7 +618,7 @@ public class ImageWrapper {
|
||||||
throws IOException {
|
throws IOException {
|
||||||
generator.write(this, out, mimeType, quality, alpha);
|
generator.write(this, out, mimeType, quality, alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the palette index of the transparent color for Images with an
|
* Sets the palette index of the transparent color for Images with an
|
||||||
* IndexColorModel. This can be used together with
|
* IndexColorModel. This can be used together with
|
||||||
|
@ -648,7 +648,7 @@ public class ImageWrapper {
|
||||||
/**
|
/**
|
||||||
* Returns the pixel at x, y. If the image is indexed, it returns the
|
* Returns the pixel at x, y. If the image is indexed, it returns the
|
||||||
* palette index, otherwise the rgb code of the color is returned.
|
* palette index, otherwise the rgb code of the color is returned.
|
||||||
*
|
*
|
||||||
* @param x the x coordinate of the pixel
|
* @param x the x coordinate of the pixel
|
||||||
* @param y the y coordinate of the pixel
|
* @param y the y coordinate of the pixel
|
||||||
* @return the pixel at x, y
|
* @return the pixel at x, y
|
||||||
|
@ -676,4 +676,4 @@ public class ImageWrapper {
|
||||||
}
|
}
|
||||||
return file.getPath();
|
return file.getPath();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,13 +76,13 @@ public final class TransientProperty implements IProperty, Serializable {
|
||||||
return svalue;
|
return svalue;
|
||||||
|
|
||||||
case BOOLEAN:
|
case BOOLEAN:
|
||||||
return new Boolean(bvalue);
|
return Boolean.valueOf(bvalue);
|
||||||
|
|
||||||
case INTEGER:
|
case INTEGER:
|
||||||
return new Long(lvalue);
|
return Long.valueOf(lvalue);
|
||||||
|
|
||||||
case FLOAT:
|
case FLOAT:
|
||||||
return new Double(dvalue);
|
return Double.valueOf(dvalue);
|
||||||
|
|
||||||
case DATE:
|
case DATE:
|
||||||
return new Date(lvalue);
|
return new Date(lvalue);
|
||||||
|
|
|
@ -93,7 +93,7 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case INTEGER:
|
case INTEGER:
|
||||||
value = new Long(in.readLong());
|
value = Long.valueOf(in.readLong());
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FLOAT:
|
case FLOAT:
|
||||||
value = new Double(in.readDouble());
|
value = Double.valueOf(in.readDouble());
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -231,7 +231,7 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
|
||||||
*/
|
*/
|
||||||
public void setIntegerValue(long l) {
|
public void setIntegerValue(long l) {
|
||||||
type = INTEGER;
|
type = INTEGER;
|
||||||
value = new Long(l);
|
value = Long.valueOf(l);
|
||||||
dirty = true;
|
dirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
|
||||||
*/
|
*/
|
||||||
public void setFloatValue(double d) {
|
public void setFloatValue(double d) {
|
||||||
type = FLOAT;
|
type = FLOAT;
|
||||||
value = new Double(d);
|
value = Double.valueOf(d);
|
||||||
dirty = true;
|
dirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -544,4 +544,4 @@ public final class Property implements IProperty, Serializable, Cloneable, Compa
|
||||||
Property p = (Property) obj;
|
Property p = (Property) obj;
|
||||||
return value == null ? p.value == null : value.equals(p.value);
|
return value == null ? p.value == null : value.equals(p.value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,7 +240,7 @@ public class Transactor {
|
||||||
public void registerConnection(DbSource src, Connection con) {
|
public void registerConnection(DbSource src, Connection con) {
|
||||||
sqlConnections.put(src, con);
|
sqlConnections.put(src, con);
|
||||||
// we assume a freshly created connection is ok.
|
// we assume a freshly created connection is ok.
|
||||||
testedConnections.put(src, new Long(System.currentTimeMillis()));
|
testedConnections.put(src, Long.valueOf(System.currentTimeMillis()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -262,7 +262,7 @@ public class Transactor {
|
||||||
stmt.execute("SELECT 1");
|
stmt.execute("SELECT 1");
|
||||||
}
|
}
|
||||||
stmt.close();
|
stmt.close();
|
||||||
testedConnections.put(src, new Long(now));
|
testedConnections.put(src, Long.valueOf(now));
|
||||||
} catch (SQLException sx) {
|
} catch (SQLException sx) {
|
||||||
try {
|
try {
|
||||||
con.close();
|
con.close();
|
||||||
|
|
|
@ -32,7 +32,7 @@ import java.util.Date;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public final class XmlDatabaseReader extends DefaultHandler implements XmlConstants {
|
public final class XmlDatabaseReader extends DefaultHandler implements XmlConstants {
|
||||||
static SAXParserFactory factory = SAXParserFactory.newInstance();
|
static SAXParserFactory factory = SAXParserFactory.newInstance();
|
||||||
|
@ -225,9 +225,9 @@ public final class XmlDatabaseReader extends DefaultHandler implements XmlConsta
|
||||||
prop.setStringValue(charValue);
|
prop.setStringValue(charValue);
|
||||||
}
|
}
|
||||||
} else if ("float".equals(elementType)) {
|
} else if ("float".equals(elementType)) {
|
||||||
prop.setFloatValue((new Double(charValue)).doubleValue());
|
prop.setFloatValue((Double.valueOf(charValue)).doubleValue());
|
||||||
} else if ("integer".equals(elementType)) {
|
} else if ("integer".equals(elementType)) {
|
||||||
prop.setIntegerValue((new Long(charValue)).longValue());
|
prop.setIntegerValue((Long.valueOf(charValue)).longValue());
|
||||||
} else {
|
} else {
|
||||||
prop.setStringValue(charValue);
|
prop.setStringValue(charValue);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ import java.util.HashMap;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public final class XmlReader extends DefaultHandler implements XmlConstants {
|
public final class XmlReader extends DefaultHandler implements XmlConstants {
|
||||||
static SAXParserFactory factory = SAXParserFactory.newInstance();
|
static SAXParserFactory factory = SAXParserFactory.newInstance();
|
||||||
|
@ -213,9 +213,9 @@ public final class XmlReader extends DefaultHandler implements XmlConstants {
|
||||||
if (propName == null) {
|
if (propName == null) {
|
||||||
propName = qName;
|
propName = qName;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ("hop:parent".equals(qName)) {
|
if ("hop:parent".equals(qName)) {
|
||||||
// FIXME: we ought to set parent here, but we're
|
// FIXME: we ought to set parent here, but we're
|
||||||
// dealing with INodes, which don't have a setParent().
|
// dealing with INodes, which don't have a setParent().
|
||||||
} else {
|
} else {
|
||||||
currentNode.setNode(propName, n);
|
currentNode.setNode(propName, n);
|
||||||
|
@ -299,9 +299,9 @@ public final class XmlReader extends DefaultHandler implements XmlConstants {
|
||||||
currentNode.setString(elementName, charValue);
|
currentNode.setString(elementName, charValue);
|
||||||
}
|
}
|
||||||
} else if ("float".equals(elementType)) {
|
} else if ("float".equals(elementType)) {
|
||||||
currentNode.setFloat(elementName, (new Double(charValue)).doubleValue());
|
currentNode.setFloat(elementName, (Double.valueOf(charValue)).doubleValue());
|
||||||
} else if ("integer".equals(elementType)) {
|
} else if ("integer".equals(elementType)) {
|
||||||
currentNode.setInteger(elementName, (new Long(charValue)).longValue());
|
currentNode.setInteger(elementName, (Long.valueOf(charValue)).longValue());
|
||||||
} else {
|
} else {
|
||||||
currentNode.setString(elementName, charValue);
|
currentNode.setString(elementName, charValue);
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,7 +217,7 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
||||||
INode node = getNode();
|
INode node = getNode();
|
||||||
|
|
||||||
if (skin != null) {
|
if (skin != null) {
|
||||||
skin.render(engine.reval, node,
|
skin.render(engine.reval, node,
|
||||||
(paramobj == Undefined.instance) ? null : paramobj);
|
(paramobj == Undefined.instance) ? null : paramobj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -711,7 +711,7 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
||||||
public int jsFunction_contains(Object obj) {
|
public int jsFunction_contains(Object obj) {
|
||||||
return jsFunction_indexOf(obj);
|
return jsFunction_indexOf(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set a property in this HopObject
|
* Set a property in this HopObject
|
||||||
*
|
*
|
||||||
|
@ -879,7 +879,7 @@ public class HopObject extends ScriptableObject implements Wrapper, PropertyReco
|
||||||
if (d == null) {
|
if (d == null) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
Object[] args = { new Long(d.getTime()) };
|
Object[] args = { Long.valueOf(d.getTime()) };
|
||||||
try {
|
try {
|
||||||
return cx.newObject(core.global, "Date", args);
|
return cx.newObject(core.global, "Date", args);
|
||||||
} catch (JavaScriptException nafx) {
|
} catch (JavaScriptException nafx) {
|
||||||
|
|
|
@ -1,26 +1,26 @@
|
||||||
/*
|
/*
|
||||||
* The contents of this file are subject to the terms
|
* The contents of this file are subject to the terms
|
||||||
* of the Common Development and Distribution License
|
* of the Common Development and Distribution License
|
||||||
* (the License). You may not use this file except in
|
* (the License). You may not use this file except in
|
||||||
* compliance with the License.
|
* compliance with the License.
|
||||||
*
|
*
|
||||||
* You can obtain a copy of the license at
|
* You can obtain a copy of the license at
|
||||||
* https://glassfish.dev.java.net/public/CDDLv1.0.html or
|
* https://glassfish.dev.java.net/public/CDDLv1.0.html or
|
||||||
* glassfish/bootstrap/legal/CDDLv1.0.txt.
|
* glassfish/bootstrap/legal/CDDLv1.0.txt.
|
||||||
* See the License for the specific language governing
|
* See the License for the specific language governing
|
||||||
* permissions and limitations under the License.
|
* permissions and limitations under the License.
|
||||||
*
|
*
|
||||||
* When distributing Covered Code, include this CDDL
|
* When distributing Covered Code, include this CDDL
|
||||||
* Header Notice in each file and include the License file
|
* Header Notice in each file and include the License file
|
||||||
* at glassfish/bootstrap/legal/CDDLv1.0.txt.
|
* at glassfish/bootstrap/legal/CDDLv1.0.txt.
|
||||||
* If applicable, add the following below the CDDL Header,
|
* If applicable, add the following below the CDDL Header,
|
||||||
* with the fields enclosed by brackets [] replaced by
|
* with the fields enclosed by brackets [] replaced by
|
||||||
* you own identifying information:
|
* you own identifying information:
|
||||||
* "Portions Copyrighted [year] [name of copyright owner]"
|
* "Portions Copyrighted [year] [name of copyright owner]"
|
||||||
*
|
*
|
||||||
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
|
* Copyright 2006 Sun Microsystems, Inc. All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package helma.scripting.rhino;
|
package helma.scripting.rhino;
|
||||||
|
|
||||||
import org.mozilla.javascript.*;
|
import org.mozilla.javascript.*;
|
||||||
|
@ -71,7 +71,7 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
private JSAdapter(Scriptable obj) {
|
private JSAdapter(Scriptable obj) {
|
||||||
setAdaptee(obj);
|
setAdaptee(obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
// initializer to setup JSAdapter prototype in the given scope
|
// initializer to setup JSAdapter prototype in the given scope
|
||||||
public static void init(Context cx, Scriptable scope, boolean sealed)
|
public static void init(Context cx, Scriptable scope, boolean sealed)
|
||||||
throws RhinoException {
|
throws RhinoException {
|
||||||
|
@ -82,11 +82,11 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
ScriptableObject.defineProperty(scope, "JSAdapter", obj,
|
ScriptableObject.defineProperty(scope, "JSAdapter", obj,
|
||||||
ScriptableObject.DONTENUM);
|
ScriptableObject.DONTENUM);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getClassName() {
|
public String getClassName() {
|
||||||
return "JSAdapter";
|
return "JSAdapter";
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object get(String name, Scriptable start) {
|
public Object get(String name, Scriptable start) {
|
||||||
Function func = getAdapteeFunction(GET_PROP);
|
Function func = getAdapteeFunction(GET_PROP);
|
||||||
if (func != null) {
|
if (func != null) {
|
||||||
|
@ -96,17 +96,17 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
return start.get(name, start);
|
return start.get(name, start);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object get(int index, Scriptable start) {
|
public Object get(int index, Scriptable start) {
|
||||||
Function func = getAdapteeFunction(GET_PROP);
|
Function func = getAdapteeFunction(GET_PROP);
|
||||||
if (func != null) {
|
if (func != null) {
|
||||||
return call(func, new Object[] { new Integer(index) });
|
return call(func, new Object[] { Integer.valueOf(index) });
|
||||||
} else {
|
} else {
|
||||||
start = getAdaptee();
|
start = getAdaptee();
|
||||||
return start.get(index, start);
|
return start.get(index, start);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean has(String name, Scriptable start) {
|
public boolean has(String name, Scriptable start) {
|
||||||
Function func = getAdapteeFunction(HAS_PROP);
|
Function func = getAdapteeFunction(HAS_PROP);
|
||||||
if (func != null) {
|
if (func != null) {
|
||||||
|
@ -117,18 +117,18 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
return start.has(name, start);
|
return start.has(name, start);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean has(int index, Scriptable start) {
|
public boolean has(int index, Scriptable start) {
|
||||||
Function func = getAdapteeFunction(HAS_PROP);
|
Function func = getAdapteeFunction(HAS_PROP);
|
||||||
if (func != null) {
|
if (func != null) {
|
||||||
Object res = call(func, new Object[] { new Integer(index) });
|
Object res = call(func, new Object[] { Integer.valueOf(index) });
|
||||||
return Context.toBoolean(res);
|
return Context.toBoolean(res);
|
||||||
} else {
|
} else {
|
||||||
start = getAdaptee();
|
start = getAdaptee();
|
||||||
return start.has(index, start);
|
return start.has(index, start);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void put(String name, Scriptable start, Object value) {
|
public void put(String name, Scriptable start, Object value) {
|
||||||
if (start == this) {
|
if (start == this) {
|
||||||
Function func = getAdapteeFunction(PUT_PROP);
|
Function func = getAdapteeFunction(PUT_PROP);
|
||||||
|
@ -142,12 +142,12 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
start.put(name, start, value);
|
start.put(name, start, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void put(int index, Scriptable start, Object value) {
|
public void put(int index, Scriptable start, Object value) {
|
||||||
if (start == this) {
|
if (start == this) {
|
||||||
Function func = getAdapteeFunction(PUT_PROP);
|
Function func = getAdapteeFunction(PUT_PROP);
|
||||||
if( func != null) {
|
if( func != null) {
|
||||||
call(func, new Object[] { new Integer(index), value });
|
call(func, new Object[] { Integer.valueOf(index), value });
|
||||||
} else {
|
} else {
|
||||||
start = getAdaptee();
|
start = getAdaptee();
|
||||||
start.put(index, start, value);
|
start.put(index, start, value);
|
||||||
|
@ -156,7 +156,7 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
start.put(index, start, value);
|
start.put(index, start, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void delete(String name) {
|
public void delete(String name) {
|
||||||
Function func = getAdapteeFunction(DEL_PROP);
|
Function func = getAdapteeFunction(DEL_PROP);
|
||||||
if (func != null) {
|
if (func != null) {
|
||||||
|
@ -165,32 +165,32 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
getAdaptee().delete(name);
|
getAdaptee().delete(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void delete(int index) {
|
public void delete(int index) {
|
||||||
Function func = getAdapteeFunction(DEL_PROP);
|
Function func = getAdapteeFunction(DEL_PROP);
|
||||||
if (func != null) {
|
if (func != null) {
|
||||||
call(func, new Object[] { new Integer(index) });
|
call(func, new Object[] { Integer.valueOf(index) });
|
||||||
} else {
|
} else {
|
||||||
getAdaptee().delete(index);
|
getAdaptee().delete(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Scriptable getPrototype() {
|
public Scriptable getPrototype() {
|
||||||
return prototype;
|
return prototype;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPrototype(Scriptable prototype) {
|
public void setPrototype(Scriptable prototype) {
|
||||||
this.prototype = prototype;
|
this.prototype = prototype;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Scriptable getParentScope() {
|
public Scriptable getParentScope() {
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setParentScope(Scriptable parent) {
|
public void setParentScope(Scriptable parent) {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object[] getIds() {
|
public Object[] getIds() {
|
||||||
Function func = getAdapteeFunction(GET_PROPIDS);
|
Function func = getAdapteeFunction(GET_PROPIDS);
|
||||||
if (func != null) {
|
if (func != null) {
|
||||||
|
@ -226,7 +226,7 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
return getAdaptee().getIds();
|
return getAdaptee().getIds();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasInstance(Scriptable scriptable) {
|
public boolean hasInstance(Scriptable scriptable) {
|
||||||
if (scriptable instanceof JSAdapter) {
|
if (scriptable instanceof JSAdapter) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -239,11 +239,11 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getDefaultValue(Class hint) {
|
public Object getDefaultValue(Class hint) {
|
||||||
return ScriptableObject.getDefaultValue(this, hint);
|
return ScriptableObject.getDefaultValue(this, hint);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object call(Context cx, Scriptable scope, Scriptable thisObj,
|
public Object call(Context cx, Scriptable scope, Scriptable thisObj,
|
||||||
Object[] args)
|
Object[] args)
|
||||||
throws RhinoException {
|
throws RhinoException {
|
||||||
|
@ -258,7 +258,7 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Scriptable construct(Context cx, Scriptable scope, Object[] args)
|
public Scriptable construct(Context cx, Scriptable scope, Object[] args)
|
||||||
throws RhinoException {
|
throws RhinoException {
|
||||||
if (isPrototype) {
|
if (isPrototype) {
|
||||||
|
@ -279,38 +279,38 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Scriptable getAdaptee() {
|
public Scriptable getAdaptee() {
|
||||||
return adaptee;
|
return adaptee;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAdaptee(Scriptable adaptee) {
|
public void setAdaptee(Scriptable adaptee) {
|
||||||
if (adaptee == null) {
|
if (adaptee == null) {
|
||||||
throw new NullPointerException("adaptee can not be null");
|
throw new NullPointerException("adaptee can not be null");
|
||||||
}
|
}
|
||||||
this.adaptee = adaptee;
|
this.adaptee = adaptee;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-- internals only below this point
|
//-- internals only below this point
|
||||||
|
|
||||||
// map a property id. Property id can only be an Integer or String
|
// map a property id. Property id can only be an Integer or String
|
||||||
private Object mapToId(Object tmp) {
|
private Object mapToId(Object tmp) {
|
||||||
if (tmp instanceof Double) {
|
if (tmp instanceof Double) {
|
||||||
return new Integer(((Double)tmp).intValue());
|
return Integer.valueOf(((Double)tmp).intValue());
|
||||||
} else {
|
} else {
|
||||||
return Context.toString(tmp);
|
return Context.toString(tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Scriptable getFunctionPrototype(Scriptable scope) {
|
private static Scriptable getFunctionPrototype(Scriptable scope) {
|
||||||
return ScriptableObject.getFunctionPrototype(scope);
|
return ScriptableObject.getFunctionPrototype(scope);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Function getAdapteeFunction(String name) {
|
private Function getAdapteeFunction(String name) {
|
||||||
Object o = ScriptableObject.getProperty(getAdaptee(), name);
|
Object o = ScriptableObject.getProperty(getAdaptee(), name);
|
||||||
return (o instanceof Function)? (Function)o : null;
|
return (o instanceof Function)? (Function)o : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Object call(Function func, Object[] args) {
|
private Object call(Function func, Object[] args) {
|
||||||
Context cx = Context.getCurrentContext();
|
Context cx = Context.getCurrentContext();
|
||||||
Scriptable thisObj = getAdaptee();
|
Scriptable thisObj = getAdaptee();
|
||||||
|
@ -321,12 +321,12 @@ public final class JSAdapter implements Scriptable, Function {
|
||||||
throw Context.reportRuntimeError(re.getMessage());
|
throw Context.reportRuntimeError(re.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private Scriptable prototype;
|
private Scriptable prototype;
|
||||||
private Scriptable parent;
|
private Scriptable parent;
|
||||||
private Scriptable adaptee;
|
private Scriptable adaptee;
|
||||||
private boolean isPrototype;
|
private boolean isPrototype;
|
||||||
|
|
||||||
// names of adaptee JavaScript functions
|
// names of adaptee JavaScript functions
|
||||||
private static final String GET_PROP = "__get__";
|
private static final String GET_PROP = "__get__";
|
||||||
private static final String HAS_PROP = "__has__";
|
private static final String HAS_PROP = "__has__";
|
||||||
|
|
|
@ -106,7 +106,7 @@ public class PathWrapper extends ScriptableObject {
|
||||||
Object[] ids = new Object[path.size()];
|
Object[] ids = new Object[path.size()];
|
||||||
|
|
||||||
for (int i=0; i<ids.length; i++) {
|
for (int i=0; i<ids.length; i++) {
|
||||||
ids[i] = new Integer(i);
|
ids[i] = Integer.valueOf(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ids;
|
return ids;
|
||||||
|
|
|
@ -569,7 +569,7 @@ public final class RhinoCore implements ScopeProvider {
|
||||||
return arg;
|
return arg;
|
||||||
if (arg instanceof Date) {
|
if (arg instanceof Date) {
|
||||||
Date d = (Date) arg;
|
Date d = (Date) arg;
|
||||||
Object[] args = { new Long(d.getTime()) };
|
Object[] args = { Long.valueOf(d.getTime()) };
|
||||||
return Context.getCurrentContext().newObject(global, "Date", args);
|
return Context.getCurrentContext().newObject(global, "Date", args);
|
||||||
}
|
}
|
||||||
return Context.toObject(arg, global);
|
return Context.toObject(arg, global);
|
||||||
|
@ -618,9 +618,9 @@ public final class RhinoCore implements ScopeProvider {
|
||||||
} else if (arg instanceof Number) {
|
} else if (arg instanceof Number) {
|
||||||
Number n = (Number) arg;
|
Number n = (Number) arg;
|
||||||
if (arg instanceof Float || arg instanceof Long) {
|
if (arg instanceof Float || arg instanceof Long) {
|
||||||
return new Double(n.doubleValue());
|
return Double.valueOf(n.doubleValue());
|
||||||
} else if (!(arg instanceof Double)) {
|
} else if (!(arg instanceof Double)) {
|
||||||
return new Integer(n.intValue());
|
return Integer.valueOf(n.intValue());
|
||||||
}
|
}
|
||||||
} else if (arg instanceof INode) {
|
} else if (arg instanceof INode) {
|
||||||
// interpret HopObject as object/dict
|
// interpret HopObject as object/dict
|
||||||
|
@ -1146,7 +1146,7 @@ public final class RhinoCore implements ScopeProvider {
|
||||||
|
|
||||||
// Convert java.util.Date objects to JavaScript Dates
|
// Convert java.util.Date objects to JavaScript Dates
|
||||||
if (obj instanceof Date) {
|
if (obj instanceof Date) {
|
||||||
Object[] args = { new Long(((Date) obj).getTime()) };
|
Object[] args = { Long.valueOf(((Date) obj).getTime()) };
|
||||||
try {
|
try {
|
||||||
return cx.newObject(global, "Date", args);
|
return cx.newObject(global, "Date", args);
|
||||||
} catch (JavaScriptException nafx) {
|
} catch (JavaScriptException nafx) {
|
||||||
|
|
|
@ -106,7 +106,7 @@ public class Profiler implements Debugger {
|
||||||
Scriptable thisObj, Object[] args) {
|
Scriptable thisObj, Object[] args) {
|
||||||
|
|
||||||
long time = System.nanoTime();
|
long time = System.nanoTime();
|
||||||
timer.push(new Long(time));
|
timer.push(Long.valueOf(time));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -456,7 +456,7 @@ public class DatabaseObject {
|
||||||
|
|
||||||
// First return system or or prototype properties
|
// First return system or or prototype properties
|
||||||
if (propertyName.equals("length")) {
|
if (propertyName.equals("length")) {
|
||||||
return new Integer(colNames.size());
|
return Integer.valueOf(colNames.size());
|
||||||
} else {
|
} else {
|
||||||
if (resultSet == null) {
|
if (resultSet == null) {
|
||||||
lastError = new SQLException("Attempt to access a released result set");
|
lastError = new SQLException("Attempt to access a released result set");
|
||||||
|
@ -515,12 +515,12 @@ public class DatabaseObject {
|
||||||
case Types.BIGINT:
|
case Types.BIGINT:
|
||||||
case Types.SMALLINT:
|
case Types.SMALLINT:
|
||||||
case Types.INTEGER:
|
case Types.INTEGER:
|
||||||
return new Long(resultSet.getLong(index));
|
return Long.valueOf(resultSet.getLong(index));
|
||||||
|
|
||||||
case Types.REAL:
|
case Types.REAL:
|
||||||
case Types.FLOAT:
|
case Types.FLOAT:
|
||||||
case Types.DOUBLE:
|
case Types.DOUBLE:
|
||||||
return new Double(resultSet.getDouble(index));
|
return Double.valueOf(resultSet.getDouble(index));
|
||||||
|
|
||||||
case Types.DECIMAL:
|
case Types.DECIMAL:
|
||||||
case Types.NUMERIC:
|
case Types.NUMERIC:
|
||||||
|
@ -530,9 +530,9 @@ public class DatabaseObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (num.scale() > 0) {
|
if (num.scale() > 0) {
|
||||||
return new Double(num.doubleValue());
|
return Double.valueOf(num.doubleValue());
|
||||||
} else {
|
} else {
|
||||||
return new Long(num.longValue());
|
return Long.valueOf(num.longValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
case Types.VARBINARY:
|
case Types.VARBINARY:
|
||||||
|
|
|
@ -753,7 +753,7 @@ public abstract class AbstractServletClient extends HttpServlet {
|
||||||
* <strong>IMPLEMENTATION NOTE</strong>: URL decoding is performed
|
* <strong>IMPLEMENTATION NOTE</strong>: URL decoding is performed
|
||||||
* individually on the parsed name and value elements, rather than on
|
* individually on the parsed name and value elements, rather than on
|
||||||
* the entire query string ahead of time, to properly deal with the case
|
* the entire query string ahead of time, to properly deal with the case
|
||||||
* where the name or value includes an encoded "=" or "&" character
|
* where the name or value includes an encoded {@code =} or {@code &} character
|
||||||
* that would otherwise be interpreted as a delimiter.
|
* that would otherwise be interpreted as a delimiter.
|
||||||
*
|
*
|
||||||
* NOTE: byte array data is modified by this method. Caller beware.
|
* NOTE: byte array data is modified by this method. Caller beware.
|
||||||
|
|
|
@ -10,39 +10,39 @@ package helma.util;
|
||||||
/**
|
/**
|
||||||
* The Protomatter Software License, Version 1.0
|
* The Protomatter Software License, Version 1.0
|
||||||
* derived from The Apache Software License, Version 1.1
|
* derived from The Apache Software License, Version 1.1
|
||||||
*
|
*
|
||||||
* Copyright (c) 1998-2002 Nate Sammons. All rights reserved.
|
* Copyright (c) 1998-2002 Nate Sammons. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
* are met:
|
* are met:
|
||||||
*
|
*
|
||||||
* 1. Redistributions of source code must retain the above copyright
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer.
|
* notice, this list of conditions and the following disclaimer.
|
||||||
*
|
*
|
||||||
* 2. Redistributions in binary form must reproduce the above copyright
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
* notice, this list of conditions and the following disclaimer in
|
* notice, this list of conditions and the following disclaimer in
|
||||||
* the documentation and/or other materials provided with the
|
* the documentation and/or other materials provided with the
|
||||||
* distribution.
|
* distribution.
|
||||||
*
|
*
|
||||||
* 3. The end-user documentation included with the redistribution,
|
* 3. The end-user documentation included with the redistribution,
|
||||||
* if any, must include the following acknowledgment:
|
* if any, must include the following acknowledgment:
|
||||||
* "This product includes software developed for the
|
* "This product includes software developed for the
|
||||||
* Protomatter Software Project
|
* Protomatter Software Project
|
||||||
* (http://protomatter.sourceforge.net/)."
|
* (http://protomatter.sourceforge.net/)."
|
||||||
* Alternately, this acknowledgment may appear in the software itself,
|
* Alternately, this acknowledgment may appear in the software itself,
|
||||||
* if and wherever such third-party acknowledgments normally appear.
|
* if and wherever such third-party acknowledgments normally appear.
|
||||||
*
|
*
|
||||||
* 4. The names "Protomatter" and "Protomatter Software Project" must
|
* 4. The names "Protomatter" and "Protomatter Software Project" must
|
||||||
* not be used to endorse or promote products derived from this
|
* not be used to endorse or promote products derived from this
|
||||||
* software without prior written permission. For written
|
* software without prior written permission. For written
|
||||||
* permission, please contact support@protomatter.com.
|
* permission, please contact support@protomatter.com.
|
||||||
*
|
*
|
||||||
* 5. Products derived from this software may not be called "Protomatter",
|
* 5. Products derived from this software may not be called "Protomatter",
|
||||||
* nor may "Protomatter" appear in their name, without prior written
|
* nor may "Protomatter" appear in their name, without prior written
|
||||||
* permission of the Protomatter Software Project
|
* permission of the Protomatter Software Project
|
||||||
* (support@protomatter.com).
|
* (support@protomatter.com).
|
||||||
*
|
*
|
||||||
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
||||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
@ -103,7 +103,7 @@ public class CronJob {
|
||||||
* cron.name1.minute = minute-list
|
* cron.name1.minute = minute-list
|
||||||
*
|
*
|
||||||
* cron.name1.timeout = timeout-value
|
* cron.name1.timeout = timeout-value
|
||||||
*
|
*
|
||||||
* </pre></blockquote><p>
|
* </pre></blockquote><p>
|
||||||
*
|
*
|
||||||
* And delivers corresponding <tt>CronJob</tt> objects in a collection.
|
* And delivers corresponding <tt>CronJob</tt> objects in a collection.
|
||||||
|
@ -450,27 +450,27 @@ public class CronJob {
|
||||||
cal.setTime(date);
|
cal.setTime(date);
|
||||||
|
|
||||||
// try and short-circuit as fast as possible.
|
// try and short-circuit as fast as possible.
|
||||||
Integer theYear = new Integer(cal.get(Calendar.YEAR));
|
Integer theYear = Integer.valueOf(cal.get(Calendar.YEAR));
|
||||||
if (!year.contains(ALL_VALUE) && !year.contains(theYear))
|
if (!year.contains(ALL_VALUE) && !year.contains(theYear))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Integer theMonth = new Integer(cal.get(Calendar.MONTH));
|
Integer theMonth = Integer.valueOf(cal.get(Calendar.MONTH));
|
||||||
if (!month.contains(ALL_VALUE) && !month.contains(theMonth))
|
if (!month.contains(ALL_VALUE) && !month.contains(theMonth))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Integer theDay = new Integer(cal.get(Calendar.DAY_OF_MONTH));
|
Integer theDay = Integer.valueOf(cal.get(Calendar.DAY_OF_MONTH));
|
||||||
if (!day.contains(ALL_VALUE) && !day.contains(theDay))
|
if (!day.contains(ALL_VALUE) && !day.contains(theDay))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Integer theWeekDay = new Integer(cal.get(Calendar.DAY_OF_WEEK));
|
Integer theWeekDay = Integer.valueOf(cal.get(Calendar.DAY_OF_WEEK));
|
||||||
if (!weekday.contains(ALL_VALUE) && !weekday.contains(theWeekDay))
|
if (!weekday.contains(ALL_VALUE) && !weekday.contains(theWeekDay))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Integer theHour = new Integer(cal.get(Calendar.HOUR_OF_DAY));
|
Integer theHour = Integer.valueOf(cal.get(Calendar.HOUR_OF_DAY));
|
||||||
if (!hour.contains(ALL_VALUE) && !hour.contains(theHour))
|
if (!hour.contains(ALL_VALUE) && !hour.contains(theHour))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Integer theMinute = new Integer(cal.get(Calendar.MINUTE));
|
Integer theMinute = Integer.valueOf(cal.get(Calendar.MINUTE));
|
||||||
if (!minute.contains(ALL_VALUE) && !minute.contains(theMinute))
|
if (!minute.contains(ALL_VALUE) && !minute.contains(theMinute))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -484,7 +484,7 @@ public class CronJob {
|
||||||
public void addYear(int year)
|
public void addYear(int year)
|
||||||
{
|
{
|
||||||
this.year.remove(ALL_VALUE);
|
this.year.remove(ALL_VALUE);
|
||||||
this.year.add(new Integer(year));
|
this.year.add(Integer.valueOf(year));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -492,7 +492,7 @@ public class CronJob {
|
||||||
*/
|
*/
|
||||||
public void removeYear(int year)
|
public void removeYear(int year)
|
||||||
{
|
{
|
||||||
this.year.remove(new Integer(year));
|
this.year.remove(Integer.valueOf(year));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -520,7 +520,7 @@ public class CronJob {
|
||||||
public void addMonth(int month)
|
public void addMonth(int month)
|
||||||
{
|
{
|
||||||
this.month.remove(ALL_VALUE);
|
this.month.remove(ALL_VALUE);
|
||||||
this.month.add(new Integer(month));
|
this.month.add(Integer.valueOf(month));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -530,7 +530,7 @@ public class CronJob {
|
||||||
*/
|
*/
|
||||||
public void removeMonth(int month)
|
public void removeMonth(int month)
|
||||||
{
|
{
|
||||||
this.month.remove(new Integer(month));
|
this.month.remove(Integer.valueOf(month));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -556,7 +556,7 @@ public class CronJob {
|
||||||
public void addDay(int day)
|
public void addDay(int day)
|
||||||
{
|
{
|
||||||
this.day.remove(ALL_VALUE);
|
this.day.remove(ALL_VALUE);
|
||||||
this.day.add(new Integer(day));
|
this.day.add(Integer.valueOf(day));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -564,7 +564,7 @@ public class CronJob {
|
||||||
*/
|
*/
|
||||||
public void removeDay(int day)
|
public void removeDay(int day)
|
||||||
{
|
{
|
||||||
this.day.remove(new Integer(day));
|
this.day.remove(Integer.valueOf(day));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -592,7 +592,7 @@ public class CronJob {
|
||||||
public void addWeekday(int weekday)
|
public void addWeekday(int weekday)
|
||||||
{
|
{
|
||||||
this.weekday.remove(ALL_VALUE);
|
this.weekday.remove(ALL_VALUE);
|
||||||
this.weekday.add(new Integer(weekday));
|
this.weekday.add(Integer.valueOf(weekday));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -602,7 +602,7 @@ public class CronJob {
|
||||||
*/
|
*/
|
||||||
public void removeWeekday(int weekday)
|
public void removeWeekday(int weekday)
|
||||||
{
|
{
|
||||||
this.weekday.remove(new Integer(weekday));
|
this.weekday.remove(Integer.valueOf(weekday));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -628,7 +628,7 @@ public class CronJob {
|
||||||
public void addHour(int hour)
|
public void addHour(int hour)
|
||||||
{
|
{
|
||||||
this.hour.remove(ALL_VALUE);
|
this.hour.remove(ALL_VALUE);
|
||||||
this.hour.add(new Integer(hour));
|
this.hour.add(Integer.valueOf(hour));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -636,7 +636,7 @@ public class CronJob {
|
||||||
*/
|
*/
|
||||||
public void removeHour(int hour)
|
public void removeHour(int hour)
|
||||||
{
|
{
|
||||||
this.hour.remove(new Integer(hour));
|
this.hour.remove(Integer.valueOf(hour));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -662,7 +662,7 @@ public class CronJob {
|
||||||
public void addMinute(int minute)
|
public void addMinute(int minute)
|
||||||
{
|
{
|
||||||
this.minute.remove(ALL_VALUE);
|
this.minute.remove(ALL_VALUE);
|
||||||
this.minute.add(new Integer(minute));
|
this.minute.add(Integer.valueOf(minute));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -670,7 +670,7 @@ public class CronJob {
|
||||||
*/
|
*/
|
||||||
public void removeMinute(int minute)
|
public void removeMinute(int minute)
|
||||||
{
|
{
|
||||||
this.minute.remove(new Integer(minute));
|
this.minute.remove(Integer.valueOf(minute));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -127,7 +127,7 @@ public final class HtmlEncoder {
|
||||||
/**
|
/**
|
||||||
* Do "smart" encodging on a string. This means that valid HTML entities and tags,
|
* Do "smart" encodging on a string. This means that valid HTML entities and tags,
|
||||||
* Helma macros and HTML comments are passed through unescaped, while
|
* Helma macros and HTML comments are passed through unescaped, while
|
||||||
* other occurrences of '<', '>' and '&' are encoded to HTML entities.
|
* other occurrences of {@code <}, {@code >} and {@code &} are encoded to HTML entities.
|
||||||
*/
|
*/
|
||||||
public final static String encode(String str) {
|
public final static String encode(String str) {
|
||||||
if (str == null) {
|
if (str == null) {
|
||||||
|
@ -151,7 +151,7 @@ public final class HtmlEncoder {
|
||||||
/**
|
/**
|
||||||
* Do "smart" encodging on a string. This means that valid HTML entities and tags,
|
* Do "smart" encodging on a string. This means that valid HTML entities and tags,
|
||||||
* Helma macros and HTML comments are passed through unescaped, while
|
* Helma macros and HTML comments are passed through unescaped, while
|
||||||
* other occurrences of '<', '>' and '&' are encoded to HTML entities.
|
* other occurrences of {@code <}, {@code >} and {@code &} are encoded to HTML entities.
|
||||||
*/
|
*/
|
||||||
public final static void encode(String str, StringBuffer ret) {
|
public final static void encode(String str, StringBuffer ret) {
|
||||||
encode(str, ret, false, null);
|
encode(str, ret, false, null);
|
||||||
|
@ -160,7 +160,7 @@ public final class HtmlEncoder {
|
||||||
/**
|
/**
|
||||||
* Do "smart" encodging on a string. This means that valid HTML entities and tags,
|
* Do "smart" encodging on a string. This means that valid HTML entities and tags,
|
||||||
* Helma macros and HTML comments are passed through unescaped, while
|
* Helma macros and HTML comments are passed through unescaped, while
|
||||||
* other occurrences of '<', '>' and '&' are encoded to HTML entities.
|
* other occurrences of {@code <}, {@code >} and {@code &} are encoded to HTML entities.
|
||||||
*
|
*
|
||||||
* @param str the string to encode
|
* @param str the string to encode
|
||||||
* @param ret the string buffer to encode to
|
* @param ret the string buffer to encode to
|
||||||
|
|
Loading…
Add table
Reference in a new issue