This commit is contained in:
Vladimir Kozlov 2014-01-22 14:17:32 -08:00
commit 9c83896027
697 changed files with 11269 additions and 9766 deletions

View File

@ -242,3 +242,4 @@ aaf663f591aba43ec942263b15ba62759ce26a1e jdk8-b116
f5b521ade7a35cea18df78ee86322207729f5611 jdk8-b118
87b743b2263cc53955266411b7797b365a0fb050 jdk8-b119
a1ee9743f4ee165eae59389a020f2552f895dac8 jdk8-b120
13b877757b0b1c0d5813298df85364f41d7ba6fe jdk9-b00

View File

@ -242,3 +242,4 @@ a4afb0a8d55ef75aef5b0d77b434070468fb89f8 jdk8-b117
0a6db1aac998cdc88e52f9adb97d40ca5b0f1da6 jdk8-b118
9e90215673be68a3e77a9e444e4232076373734d jdk8-b119
cd3825b2983045784d6fc6d1729c799b08215752 jdk8-b120
1e1f86d5d4e22c15a9bf9f1581acddb8c59abae2 jdk9-b00

View File

@ -1 +1 @@
project=jdk8
project=jdk9

View File

@ -66,7 +66,7 @@ else
# First, find out the valid targets
# Run the makefile with an arbitrary SPEC using -p -q (quiet dry-run and dump rules) to find
# available PHONY targets. Use this list as valid targets to pass on to the repeated calls.
all_phony_targets=$(filter-out $(global_targets) bundles bundles-only final-images-only, $(strip $(shell \
all_phony_targets=$(filter-out $(global_targets), $(strip $(shell \
cd $(root_dir) && $(MAKE) -p -q FRC SPEC=$(firstword $(SPEC)) | \
grep ^.PHONY: | head -n 1 | cut -d " " -f 2-)))
@ -79,10 +79,6 @@ else
endif
endif
# Include this after a potential spec file has been included so that the bundles target
# has access to the spec variables.
include $(root_dir)/make/Jprt.gmk
# Here are "global" targets, i.e. targets that can be executed without specifying a single configuration.
# If you addd more global targets, please update the variable global_targets in MakeHelpers.

View File

@ -3865,7 +3865,7 @@ fi
#CUSTOM_AUTOCONF_INCLUDE
# Do not change or remove the following line, it is needed for consistency checks:
DATE_WHEN_GENERATED=1384422786
DATE_WHEN_GENERATED=1389186094
###############################################################################
#
@ -29625,7 +29625,7 @@ fi
fi
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY"
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"$RELEASE\"'"
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"\$(RELEASE)\"'"
CCXXFLAGS_JDK="$CCXXFLAGS_JDK \
-I${JDK_OUTPUTDIR}/include \

View File

@ -936,7 +936,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_COMPILER_FLAGS_FOR_JDK],
fi
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DARCH='\"$OPENJDK_TARGET_CPU_LEGACY\"' -D$OPENJDK_TARGET_CPU_LEGACY"
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"$RELEASE\"'"
CCXXFLAGS_JDK="$CCXXFLAGS_JDK -DRELEASE='\"\$(RELEASE)\"'"
CCXXFLAGS_JDK="$CCXXFLAGS_JDK \
-I${JDK_OUTPUTDIR}/include \

View File

@ -24,7 +24,7 @@
#
JDK_MAJOR_VERSION=1
JDK_MINOR_VERSION=8
JDK_MINOR_VERSION=9
JDK_MICRO_VERSION=0
JDK_UPDATE_VERSION=
LAUNCHER_NAME=openjdk

View File

@ -242,3 +242,4 @@ e53d1ee4d2ae898f1cf58688d45a5afe7c482173 jdk8-b117
d6820a414f182a011a53a29a52370c696cd58dab jdk8-b118
379fc7609beb7a3d85ebc0cc21a8a51c60d3c7d3 jdk8-b119
53fd772d28c8a9f0f43adfc06f75f6b3cfa93cb5 jdk8-b120
a7d3638deb2f4e33217b1ecf889479e90f9e5b50 jdk9-b00

View File

@ -1 +1 @@
project=jdk8
project=jdk9

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2003, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2013, 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

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2013, 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

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2013, 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

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2013, 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

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2013, 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

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2013, 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

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2013, 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

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2013, 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

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2013, 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

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2013, 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

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2000, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2009, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2013, 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

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1999, 2013, 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

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1999, 2013, 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

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1999, 2013, 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

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 1999, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2004, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2007, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2013, 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

View File

@ -402,3 +402,4 @@ b2426da30009cd3069d03de073f351e6432c7682 hs25-b61
ce42d815dd2130250acf6132b51b624001638f0d jdk8-b119
05fedd51e40da22c9460bf17c7185889e435db3d hs25-b62
fca262db9c4309f99d2f5542ab0780e45c2f1578 jdk8-b120
ce2d7e46f3c7e41241f3b407705a4071323a11ab jdk9-b00

View File

@ -1 +1 @@
project=jdk8
project=jdk9

View File

@ -242,3 +242,4 @@ c1d234d4f16472a5163464420fa00b25ffa5298a jdk8-b117
e4e5069250e717defcb556e2f6be291460988c51 jdk8-b118
69a930376c70beb9877970128bad0f04cb0c6eb1 jdk8-b119
64d8b228a72cf9082b1a9a881c81188ccffde234 jdk8-b120
4045edd35e8ba73bfdc23ce8961b9640d4145fe5 jdk9-b00

View File

@ -1 +1 @@
project=jdk8
project=jdk9

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
*/
/*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2013, 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

View File

@ -61,14 +61,13 @@
package com.sun.org.apache.xerces.internal.impl;
import java.io.IOException;
import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
import com.sun.org.apache.xerces.internal.util.XMLChar;
import com.sun.org.apache.xerces.internal.util.XML11Char;
import com.sun.org.apache.xerces.internal.util.XMLChar;
import com.sun.org.apache.xerces.internal.util.XMLStringBuffer;
import com.sun.org.apache.xerces.internal.xni.QName;
import com.sun.org.apache.xerces.internal.xni.XMLString;
import java.io.IOException;
/**
* Implements the entity scanner methods in
@ -78,6 +77,7 @@ import com.sun.org.apache.xerces.internal.xni.XMLString;
*
* @author Michael Glavassevich, IBM
* @author Neil Graham, IBM
* @version $Id: XML11EntityScanner.java,v 1.5 2010-11-01 04:39:40 joehw Exp $
*/
public class XML11EntityScanner
@ -108,7 +108,7 @@ public class XML11EntityScanner
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
load(0, true, true);
}
// peek at character
@ -136,7 +136,7 @@ public class XML11EntityScanner
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
load(0, true, true);
}
// scan character
@ -148,7 +148,7 @@ public class XML11EntityScanner
fCurrentEntity.columnNumber = 1;
if (fCurrentEntity.position == fCurrentEntity.count) {
fCurrentEntity.ch[0] = (char)c;
load(1, false);
load(1, false, true);
}
if (c == '\r' && external) {
int cc = fCurrentEntity.ch[fCurrentEntity.position++];
@ -183,7 +183,7 @@ public class XML11EntityScanner
public String scanNmtoken() throws IOException {
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
load(0, true, true);
}
// scan nmtoken
@ -194,6 +194,7 @@ public class XML11EntityScanner
if (XML11Char.isXML11Name(ch)) {
if (++fCurrentEntity.position == fCurrentEntity.count) {
int length = fCurrentEntity.position - offset;
invokeListeners(length);
if (length == fCurrentEntity.ch.length) {
// bad luck we have to resize our buffer
char[] tmp = new char[fCurrentEntity.ch.length << 1];
@ -206,7 +207,7 @@ public class XML11EntityScanner
fCurrentEntity.ch, 0, length);
}
offset = 0;
if (load(length, false)) {
if (load(length, false, false)) {
break;
}
}
@ -214,6 +215,7 @@ public class XML11EntityScanner
else if (XML11Char.isXML11NameHighSurrogate(ch)) {
if (++fCurrentEntity.position == fCurrentEntity.count) {
int length = fCurrentEntity.position - offset;
invokeListeners(length);
if (length == fCurrentEntity.ch.length) {
// bad luck we have to resize our buffer
char[] tmp = new char[fCurrentEntity.ch.length << 1];
@ -226,7 +228,7 @@ public class XML11EntityScanner
fCurrentEntity.ch, 0, length);
}
offset = 0;
if (load(length, false)) {
if (load(length, false, false)) {
--fCurrentEntity.startPosition;
--fCurrentEntity.position;
break;
@ -240,6 +242,7 @@ public class XML11EntityScanner
}
if (++fCurrentEntity.position == fCurrentEntity.count) {
int length = fCurrentEntity.position - offset;
invokeListeners(length);
if (length == fCurrentEntity.ch.length) {
// bad luck we have to resize our buffer
char[] tmp = new char[fCurrentEntity.ch.length << 1];
@ -252,7 +255,7 @@ public class XML11EntityScanner
fCurrentEntity.ch, 0, length);
}
offset = 0;
if (load(length, false)) {
if (load(length, false, false)) {
break;
}
}
@ -294,7 +297,7 @@ public class XML11EntityScanner
public String scanName() throws IOException {
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
load(0, true, true);
}
// scan name
@ -305,7 +308,7 @@ public class XML11EntityScanner
if (++fCurrentEntity.position == fCurrentEntity.count) {
fCurrentEntity.ch[0] = ch;
offset = 0;
if (load(1, false)) {
if (load(1, false, true)) {
fCurrentEntity.columnNumber++;
String symbol = fSymbolTable.addSymbol(fCurrentEntity.ch, 0, 1);
return symbol;
@ -316,7 +319,7 @@ public class XML11EntityScanner
if (++fCurrentEntity.position == fCurrentEntity.count) {
fCurrentEntity.ch[0] = ch;
offset = 0;
if (load(1, false)) {
if (load(1, false, true)) {
--fCurrentEntity.position;
--fCurrentEntity.startPosition;
return null;
@ -332,7 +335,7 @@ public class XML11EntityScanner
fCurrentEntity.ch[0] = ch;
fCurrentEntity.ch[1] = ch2;
offset = 0;
if (load(2, false)) {
if (load(2, false, true)) {
fCurrentEntity.columnNumber += 2;
String symbol = fSymbolTable.addSymbol(fCurrentEntity.ch, 0, 2);
return symbol;
@ -348,6 +351,7 @@ public class XML11EntityScanner
if (XML11Char.isXML11Name(ch)) {
if (++fCurrentEntity.position == fCurrentEntity.count) {
int length = fCurrentEntity.position - offset;
invokeListeners(length);
if (length == fCurrentEntity.ch.length) {
// bad luck we have to resize our buffer
char[] tmp = new char[fCurrentEntity.ch.length << 1];
@ -360,7 +364,7 @@ public class XML11EntityScanner
fCurrentEntity.ch, 0, length);
}
offset = 0;
if (load(length, false)) {
if (load(length, false, false)) {
break;
}
}
@ -368,6 +372,7 @@ public class XML11EntityScanner
else if (XML11Char.isXML11NameHighSurrogate(ch)) {
if (++fCurrentEntity.position == fCurrentEntity.count) {
int length = fCurrentEntity.position - offset;
invokeListeners(length);
if (length == fCurrentEntity.ch.length) {
// bad luck we have to resize our buffer
char[] tmp = new char[fCurrentEntity.ch.length << 1];
@ -380,7 +385,7 @@ public class XML11EntityScanner
fCurrentEntity.ch, 0, length);
}
offset = 0;
if (load(length, false)) {
if (load(length, false, false)) {
--fCurrentEntity.position;
--fCurrentEntity.startPosition;
break;
@ -394,6 +399,7 @@ public class XML11EntityScanner
}
if (++fCurrentEntity.position == fCurrentEntity.count) {
int length = fCurrentEntity.position - offset;
invokeListeners(length);
if (length == fCurrentEntity.ch.length) {
// bad luck we have to resize our buffer
char[] tmp = new char[fCurrentEntity.ch.length << 1];
@ -406,7 +412,7 @@ public class XML11EntityScanner
fCurrentEntity.ch, 0, length);
}
offset = 0;
if (load(length, false)) {
if (load(length, false, false)) {
break;
}
}
@ -449,7 +455,7 @@ public class XML11EntityScanner
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
load(0, true, true);
}
// scan name
@ -460,7 +466,7 @@ public class XML11EntityScanner
if (++fCurrentEntity.position == fCurrentEntity.count) {
fCurrentEntity.ch[0] = ch;
offset = 0;
if (load(1, false)) {
if (load(1, false, true)) {
fCurrentEntity.columnNumber++;
String symbol = fSymbolTable.addSymbol(fCurrentEntity.ch, 0, 1);
return symbol;
@ -471,7 +477,7 @@ public class XML11EntityScanner
if (++fCurrentEntity.position == fCurrentEntity.count) {
fCurrentEntity.ch[0] = ch;
offset = 0;
if (load(1, false)) {
if (load(1, false, true)) {
--fCurrentEntity.position;
--fCurrentEntity.startPosition;
return null;
@ -487,7 +493,7 @@ public class XML11EntityScanner
fCurrentEntity.ch[0] = ch;
fCurrentEntity.ch[1] = ch2;
offset = 0;
if (load(2, false)) {
if (load(2, false, true)) {
fCurrentEntity.columnNumber += 2;
String symbol = fSymbolTable.addSymbol(fCurrentEntity.ch, 0, 2);
return symbol;
@ -503,6 +509,7 @@ public class XML11EntityScanner
if (XML11Char.isXML11NCName(ch)) {
if (++fCurrentEntity.position == fCurrentEntity.count) {
int length = fCurrentEntity.position - offset;
invokeListeners(length);
if (length == fCurrentEntity.ch.length) {
// bad luck we have to resize our buffer
char[] tmp = new char[fCurrentEntity.ch.length << 1];
@ -515,7 +522,7 @@ public class XML11EntityScanner
fCurrentEntity.ch, 0, length);
}
offset = 0;
if (load(length, false)) {
if (load(length, false, false)) {
break;
}
}
@ -523,6 +530,7 @@ public class XML11EntityScanner
else if (XML11Char.isXML11NameHighSurrogate(ch)) {
if (++fCurrentEntity.position == fCurrentEntity.count) {
int length = fCurrentEntity.position - offset;
invokeListeners(length);
if (length == fCurrentEntity.ch.length) {
// bad luck we have to resize our buffer
char[] tmp = new char[fCurrentEntity.ch.length << 1];
@ -535,7 +543,7 @@ public class XML11EntityScanner
fCurrentEntity.ch, 0, length);
}
offset = 0;
if (load(length, false)) {
if (load(length, false, false)) {
--fCurrentEntity.startPosition;
--fCurrentEntity.position;
break;
@ -549,6 +557,7 @@ public class XML11EntityScanner
}
if (++fCurrentEntity.position == fCurrentEntity.count) {
int length = fCurrentEntity.position - offset;
invokeListeners(length);
if (length == fCurrentEntity.ch.length) {
// bad luck we have to resize our buffer
char[] tmp = new char[fCurrentEntity.ch.length << 1];
@ -561,7 +570,7 @@ public class XML11EntityScanner
fCurrentEntity.ch, 0, length);
}
offset = 0;
if (load(length, false)) {
if (load(length, false, false)) {
break;
}
}
@ -610,7 +619,7 @@ public class XML11EntityScanner
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
load(0, true, true);
}
// scan qualified name
@ -621,7 +630,7 @@ public class XML11EntityScanner
if (++fCurrentEntity.position == fCurrentEntity.count) {
fCurrentEntity.ch[0] = ch;
offset = 0;
if (load(1, false)) {
if (load(1, false, true)) {
fCurrentEntity.columnNumber++;
String name = fSymbolTable.addSymbol(fCurrentEntity.ch, 0, 1);
qname.setValues(null, name, name, null);
@ -633,7 +642,7 @@ public class XML11EntityScanner
if (++fCurrentEntity.position == fCurrentEntity.count) {
fCurrentEntity.ch[0] = ch;
offset = 0;
if (load(1, false)) {
if (load(1, false, true)) {
--fCurrentEntity.startPosition;
--fCurrentEntity.position;
return false;
@ -649,7 +658,7 @@ public class XML11EntityScanner
fCurrentEntity.ch[0] = ch;
fCurrentEntity.ch[1] = ch2;
offset = 0;
if (load(2, false)) {
if (load(2, false, true)) {
fCurrentEntity.columnNumber += 2;
String name = fSymbolTable.addSymbol(fCurrentEntity.ch, 0, 2);
qname.setValues(null, name, name, null);
@ -674,6 +683,7 @@ public class XML11EntityScanner
}
if (++fCurrentEntity.position == fCurrentEntity.count) {
int length = fCurrentEntity.position - offset;
invokeListeners(length);
if (length == fCurrentEntity.ch.length) {
// bad luck we have to resize our buffer
char[] tmp = new char[fCurrentEntity.ch.length << 1];
@ -689,7 +699,7 @@ public class XML11EntityScanner
index = index - offset;
}
offset = 0;
if (load(length, false)) {
if (load(length, false, false)) {
break;
}
}
@ -697,6 +707,7 @@ public class XML11EntityScanner
else if (XML11Char.isXML11NameHighSurrogate(ch)) {
if (++fCurrentEntity.position == fCurrentEntity.count) {
int length = fCurrentEntity.position - offset;
invokeListeners(length);
if (length == fCurrentEntity.ch.length) {
// bad luck we have to resize our buffer
char[] tmp = new char[fCurrentEntity.ch.length << 1];
@ -712,7 +723,7 @@ public class XML11EntityScanner
index = index - offset;
}
offset = 0;
if (load(length, false)) {
if (load(length, false, false)) {
sawIncompleteSurrogatePair = true;
--fCurrentEntity.startPosition;
--fCurrentEntity.position;
@ -728,6 +739,7 @@ public class XML11EntityScanner
}
if (++fCurrentEntity.position == fCurrentEntity.count) {
int length = fCurrentEntity.position - offset;
invokeListeners(length);
if (length == fCurrentEntity.ch.length) {
// bad luck we have to resize our buffer
char[] tmp = new char[fCurrentEntity.ch.length << 1];
@ -743,7 +755,7 @@ public class XML11EntityScanner
index = index - offset;
}
offset = 0;
if (load(length, false)) {
if (load(length, false, false)) {
break;
}
}
@ -820,11 +832,11 @@ public class XML11EntityScanner
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
load(0, true, true);
}
else if (fCurrentEntity.position == fCurrentEntity.count - 1) {
fCurrentEntity.ch[0] = fCurrentEntity.ch[fCurrentEntity.count - 1];
load(1, false);
load(1, false, true);
fCurrentEntity.position = 0;
fCurrentEntity.startPosition = 0;
}
@ -846,7 +858,7 @@ public class XML11EntityScanner
fCurrentEntity.baseCharOffset += (fCurrentEntity.position - fCurrentEntity.startPosition);
fCurrentEntity.position = newlines;
fCurrentEntity.startPosition = newlines;
if (load(newlines, false)) {
if (load(newlines, false, true)) {
break;
}
}
@ -869,7 +881,7 @@ public class XML11EntityScanner
fCurrentEntity.baseCharOffset += (fCurrentEntity.position - fCurrentEntity.startPosition);
fCurrentEntity.position = newlines;
fCurrentEntity.startPosition = newlines;
if (load(newlines, false)) {
if (load(newlines, false, true)) {
break;
}
}
@ -961,11 +973,11 @@ public class XML11EntityScanner
throws IOException {
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
load(0, true, true);
}
else if (fCurrentEntity.position == fCurrentEntity.count - 1) {
fCurrentEntity.ch[0] = fCurrentEntity.ch[fCurrentEntity.count - 1];
load(1, false);
load(1, false, true);
fCurrentEntity.startPosition = 0;
fCurrentEntity.position = 0;
}
@ -987,7 +999,7 @@ public class XML11EntityScanner
fCurrentEntity.baseCharOffset += (fCurrentEntity.position - fCurrentEntity.startPosition);
fCurrentEntity.position = newlines;
fCurrentEntity.startPosition = newlines;
if (load(newlines, false)) {
if (load(newlines, false, true)) {
break;
}
}
@ -1010,7 +1022,7 @@ public class XML11EntityScanner
fCurrentEntity.baseCharOffset += (fCurrentEntity.position - fCurrentEntity.startPosition);
fCurrentEntity.position = newlines;
fCurrentEntity.startPosition = newlines;
if (load(newlines, false)) {
if (load(newlines, false, true)) {
break;
}
}
@ -1113,7 +1125,7 @@ public class XML11EntityScanner
do {
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
load(0, true, false);
}
boolean bNextEntity = false;
@ -1127,7 +1139,7 @@ public class XML11EntityScanner
0,
fCurrentEntity.count - fCurrentEntity.position);
bNextEntity = load(fCurrentEntity.count - fCurrentEntity.position, false);
bNextEntity = load(fCurrentEntity.count - fCurrentEntity.position, false, false);
fCurrentEntity.position = 0;
fCurrentEntity.startPosition = 0;
}
@ -1140,7 +1152,7 @@ public class XML11EntityScanner
fCurrentEntity.baseCharOffset += (fCurrentEntity.position - fCurrentEntity.startPosition);
fCurrentEntity.position = fCurrentEntity.count;
fCurrentEntity.startPosition = fCurrentEntity.count;
load(0,true);
load(0,true, false);
return false;
}
@ -1160,7 +1172,7 @@ public class XML11EntityScanner
fCurrentEntity.baseCharOffset += (fCurrentEntity.position - fCurrentEntity.startPosition);
fCurrentEntity.position = newlines;
fCurrentEntity.startPosition = newlines;
if (load(newlines, false)) {
if (load(newlines, false, true)) {
break;
}
}
@ -1184,7 +1196,7 @@ public class XML11EntityScanner
fCurrentEntity.position = newlines;
fCurrentEntity.startPosition = newlines;
fCurrentEntity.count = newlines;
if (load(newlines, false)) {
if (load(newlines, false, true)) {
break;
}
}
@ -1309,7 +1321,7 @@ public class XML11EntityScanner
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
load(0, true, true);
}
// skip character
@ -1335,7 +1347,7 @@ public class XML11EntityScanner
// handle newlines
if (fCurrentEntity.position == fCurrentEntity.count) {
fCurrentEntity.ch[0] = (char)cc;
load(1, false);
load(1, false, true);
}
int ccc = fCurrentEntity.ch[++fCurrentEntity.position];
if (ccc == '\n' || ccc == 0x85) {
@ -1369,7 +1381,7 @@ public class XML11EntityScanner
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
load(0, true, true);
}
@ -1397,7 +1409,7 @@ public class XML11EntityScanner
fCurrentEntity.columnNumber = 1;
if (fCurrentEntity.position == fCurrentEntity.count - 1) {
fCurrentEntity.ch[0] = (char)c;
entityChanged = load(1, true);
entityChanged = load(1, true, true);
if (!entityChanged) {
// the load change the position to be 1,
// need to restore it when entity not changed
@ -1424,7 +1436,7 @@ public class XML11EntityScanner
if (!entityChanged)
fCurrentEntity.position++;
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
load(0, true, true);
if(fCurrentEntity == null){
return true ;
@ -1445,7 +1457,7 @@ public class XML11EntityScanner
fCurrentEntity.columnNumber = 1;
if (fCurrentEntity.position == fCurrentEntity.count - 1) {
fCurrentEntity.ch[0] = (char)c;
entityChanged = load(1, true);
entityChanged = load(1, true, true);
if (!entityChanged) {
// the load change the position to be 1,
// need to restore it when entity not changed
@ -1463,7 +1475,7 @@ public class XML11EntityScanner
if (!entityChanged)
fCurrentEntity.position++;
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
load(0, true, true);
if(fCurrentEntity == null){
return true ;
@ -1496,7 +1508,7 @@ public class XML11EntityScanner
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
load(0, true, true);
}
// skip string
@ -1508,10 +1520,11 @@ public class XML11EntityScanner
return false;
}
if (i < length - 1 && fCurrentEntity.position == fCurrentEntity.count) {
invokeListeners(0);
System.arraycopy(fCurrentEntity.ch, fCurrentEntity.count - i - 1, fCurrentEntity.ch, 0, i + 1);
// REVISIT: Can a string to be skipped cross an
// entity boundary? -Ac
if (load(i + 1, false)) {
if (load(i + 1, false, false)) {
fCurrentEntity.startPosition -= i + 1;
fCurrentEntity.position -= i + 1;
return false;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
*/
/*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
*/
/*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
*/
/*

View File

@ -20,34 +20,28 @@
package com.sun.org.apache.xerces.internal.impl;
import java.io.EOFException;
import java.io.IOException;
import java.util.Locale;
import java.util.Vector;
import com.sun.xml.internal.stream.Entity;
import com.sun.xml.internal.stream.XMLBufferListener;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import com.sun.org.apache.xerces.internal.impl.io.ASCIIReader;
import com.sun.org.apache.xerces.internal.impl.io.UCSReader;
import com.sun.org.apache.xerces.internal.impl.io.UTF8Reader;
import com.sun.org.apache.xerces.internal.impl.msg.XMLMessageFormatter;
import com.sun.org.apache.xerces.internal.util.EncodingMap;
import com.sun.org.apache.xerces.internal.util.SymbolTable;
import com.sun.org.apache.xerces.internal.util.XMLChar;
import com.sun.org.apache.xerces.internal.util.XMLStringBuffer;
import com.sun.org.apache.xerces.internal.xni.QName;
import com.sun.org.apache.xerces.internal.xni.XMLString;
import com.sun.org.apache.xerces.internal.xni.*;
import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager;
import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException;
import com.sun.org.apache.xerces.internal.xni.*;
import com.sun.xml.internal.stream.Entity;
import com.sun.xml.internal.stream.XMLBufferListener;
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.util.Locale;
import java.util.Vector;
/**
* Implements the entity scanner methods.
@ -493,8 +487,7 @@ public class XMLEntityScanner implements XMLLocator {
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
invokeListeners(0);
load(0, true);
load(0, true, true);
}
// peek at character
@ -535,8 +528,7 @@ public class XMLEntityScanner implements XMLLocator {
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
invokeListeners(0);
load(0, true);
load(0, true, true);
}
// scan character
@ -546,9 +538,8 @@ public class XMLEntityScanner implements XMLLocator {
fCurrentEntity.lineNumber++;
fCurrentEntity.columnNumber = 1;
if (fCurrentEntity.position == fCurrentEntity.count) {
invokeListeners(1);
fCurrentEntity.ch[0] = (char)c;
load(1, false);
load(1, false, true);
}
if (c == '\r' && isExternal) {
if (fCurrentEntity.ch[fCurrentEntity.position++] != '\n') {
@ -593,8 +584,7 @@ public class XMLEntityScanner implements XMLLocator {
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
invokeListeners(0);
load(0, true);
load(0, true, true);
}
// scan nmtoken
@ -626,7 +616,7 @@ public class XMLEntityScanner implements XMLLocator {
fCurrentEntity.ch, 0, length);
}
offset = 0;
if (load(length, false)) {
if (load(length, false, false)) {
break;
}
}
@ -673,18 +663,16 @@ public class XMLEntityScanner implements XMLLocator {
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
invokeListeners(0);
load(0, true);
load(0, true, true);
}
// scan name
int offset = fCurrentEntity.position;
if (XMLChar.isNameStart(fCurrentEntity.ch[offset])) {
if (++fCurrentEntity.position == fCurrentEntity.count) {
invokeListeners(1);
fCurrentEntity.ch[0] = fCurrentEntity.ch[offset];
offset = 0;
if (load(1, false)) {
if (load(1, false, true)) {
fCurrentEntity.columnNumber++;
String symbol = fSymbolTable.addSymbol(fCurrentEntity.ch, 0, 1);
@ -721,7 +709,7 @@ public class XMLEntityScanner implements XMLLocator {
fCurrentEntity.ch, 0, length);
}
offset = 0;
if (load(length, false)) {
if (load(length, false, false)) {
break;
}
}
@ -776,8 +764,7 @@ public class XMLEntityScanner implements XMLLocator {
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
invokeListeners(0);
load(0, true);
load(0, true, true);
}
// scan qualified name
@ -789,11 +776,10 @@ public class XMLEntityScanner implements XMLLocator {
if (XMLChar.isNameStart(fCurrentEntity.ch[offset])) {
if (++fCurrentEntity.position == fCurrentEntity.count) {
invokeListeners(1);
fCurrentEntity.ch[0] = fCurrentEntity.ch[offset];
offset = 0;
if (load(1, false)) {
if (load(1, false, true)) {
fCurrentEntity.columnNumber++;
//adding into symbol table.
//XXX We are trying to add single character in SymbolTable??????
@ -843,7 +829,7 @@ public class XMLEntityScanner implements XMLLocator {
index = index - offset;
}
offset = 0;
if (load(length, false)) {
if (load(length, false, false)) {
break;
}
}
@ -918,12 +904,10 @@ public class XMLEntityScanner implements XMLLocator {
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
invokeListeners(0);
load(0, true);
load(0, true, true);
} else if (fCurrentEntity.position == fCurrentEntity.count - 1) {
invokeListeners(0);
fCurrentEntity.ch[0] = fCurrentEntity.ch[fCurrentEntity.count - 1];
load(1, false);
load(1, false, true);
fCurrentEntity.position = 0;
}
@ -945,9 +929,8 @@ public class XMLEntityScanner implements XMLLocator {
fCurrentEntity.columnNumber = 1;
if (fCurrentEntity.position == fCurrentEntity.count) {
offset = 0;
invokeListeners(newlines);
fCurrentEntity.position = newlines;
if (load(newlines, false)) {
if (load(newlines, false, true)) {
break;
}
}
@ -965,9 +948,8 @@ public class XMLEntityScanner implements XMLLocator {
fCurrentEntity.columnNumber = 1;
if (fCurrentEntity.position == fCurrentEntity.count) {
offset = 0;
invokeListeners(newlines);
fCurrentEntity.position = newlines;
if (load(newlines, false)) {
if (load(newlines, false, true)) {
break;
}
}
@ -1070,13 +1052,10 @@ public class XMLEntityScanner implements XMLLocator {
}
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
invokeListeners(0);
load(0, true);
load(0, true, true);
} else if (fCurrentEntity.position == fCurrentEntity.count - 1) {
invokeListeners(0);
fCurrentEntity.ch[0] = fCurrentEntity.ch[fCurrentEntity.count - 1];
load(1, false);
load(1, false, true);
fCurrentEntity.position = 0;
}
@ -1099,10 +1078,9 @@ public class XMLEntityScanner implements XMLLocator {
fCurrentEntity.lineNumber++;
fCurrentEntity.columnNumber = 1;
if (fCurrentEntity.position == fCurrentEntity.count) {
invokeListeners(newlines);
offset = 0;
fCurrentEntity.position = newlines;
if (load(newlines, false)) {
if (load(newlines, false, true)) {
break;
}
}
@ -1121,9 +1099,8 @@ public class XMLEntityScanner implements XMLLocator {
fCurrentEntity.columnNumber = 1;
if (fCurrentEntity.position == fCurrentEntity.count) {
offset = 0;
invokeListeners(newlines);
fCurrentEntity.position = newlines;
if (load(newlines, false)) {
if (load(newlines, false, true)) {
break;
}
}
@ -1142,7 +1119,7 @@ public class XMLEntityScanner implements XMLLocator {
int i=0;
for ( i = offset; i < fCurrentEntity.position; i++) {
fCurrentEntity.ch[i] = '\n';
whiteSpaceLookup[whiteSpaceLen++]=i;
storeWhiteSpace(i);
}
int length = fCurrentEntity.position - offset;
@ -1163,25 +1140,15 @@ public class XMLEntityScanner implements XMLLocator {
}
// scan literal value
while (fCurrentEntity.position < fCurrentEntity.count) {
c = fCurrentEntity.ch[fCurrentEntity.position++];
for (; fCurrentEntity.position<fCurrentEntity.count; fCurrentEntity.position++) {
c = fCurrentEntity.ch[fCurrentEntity.position];
if ((c == quote &&
(!fCurrentEntity.literal || isExternal))
|| c == '%' || !XMLChar.isContent(c)) {
fCurrentEntity.position--;
(!fCurrentEntity.literal || isExternal)) ||
c == '%' || !XMLChar.isContent(c)) {
break;
}
if(whiteSpaceInfoNeeded){
if(c == 0x20 || c == 0x9){
if(whiteSpaceLen < whiteSpaceLookup.length){
whiteSpaceLookup[whiteSpaceLen++]= fCurrentEntity.position-1;
}else{
int [] tmp = new int[whiteSpaceLookup.length*2];
System.arraycopy(whiteSpaceLookup,0,tmp,0,whiteSpaceLookup.length);
whiteSpaceLookup = tmp;
whiteSpaceLookup[whiteSpaceLen++]= fCurrentEntity.position - 1;
}
}
if (whiteSpaceInfoNeeded && c == '\t') {
storeWhiteSpace(fCurrentEntity.position);
}
}
int length = fCurrentEntity.position - offset;
@ -1209,6 +1176,24 @@ public class XMLEntityScanner implements XMLLocator {
} // scanLiteral(int,XMLString):int
/**
* Save whitespace information. Increase the whitespace buffer by 100
* when needed.
*
* For XML 1.0, legal characters below 0x20 are 0x09 (TAB), 0x0A (LF) and 0x0D (CR).
*
* @param whiteSpacePos position of a whitespace in the scanner entity buffer
*/
private void storeWhiteSpace(int whiteSpacePos) {
if (whiteSpaceLen >= whiteSpaceLookup.length) {
int [] tmp = new int[whiteSpaceLookup.length + 100];
System.arraycopy(whiteSpaceLookup, 0, tmp, 0, whiteSpaceLookup.length);
whiteSpaceLookup = tmp;
}
whiteSpaceLookup[whiteSpaceLen++] = whiteSpacePos;
}
//CHANGED:
/**
* Scans a range of character data up to the specified delimiter,
@ -1249,7 +1234,7 @@ public class XMLEntityScanner implements XMLLocator {
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
load(0, true, false);
}
boolean bNextEntity = false;
@ -1263,7 +1248,7 @@ public class XMLEntityScanner implements XMLLocator {
0,
fCurrentEntity.count - fCurrentEntity.position);
bNextEntity = load(fCurrentEntity.count - fCurrentEntity.position, false);
bNextEntity = load(fCurrentEntity.count - fCurrentEntity.position, false, false);
fCurrentEntity.position = 0;
fCurrentEntity.startPosition = 0;
}
@ -1276,7 +1261,7 @@ public class XMLEntityScanner implements XMLLocator {
fCurrentEntity.baseCharOffset += (fCurrentEntity.position - fCurrentEntity.startPosition);
fCurrentEntity.position = fCurrentEntity.count;
fCurrentEntity.startPosition = fCurrentEntity.count;
load(0, true);
load(0, true, false);
return false;
}
@ -1298,9 +1283,8 @@ public class XMLEntityScanner implements XMLLocator {
fCurrentEntity.columnNumber = 1;
if (fCurrentEntity.position == fCurrentEntity.count) {
offset = 0;
invokeListeners(newlines);
fCurrentEntity.position = newlines;
if (load(newlines, false)) {
if (load(newlines, false, true)) {
break;
}
}
@ -1318,10 +1302,9 @@ public class XMLEntityScanner implements XMLLocator {
fCurrentEntity.columnNumber = 1;
if (fCurrentEntity.position == fCurrentEntity.count) {
offset = 0;
invokeListeners(newlines);
fCurrentEntity.position = newlines;
fCurrentEntity.count = newlines;
if (load(newlines, false)) {
if (load(newlines, false, true)) {
break;
}
}
@ -1422,8 +1405,7 @@ public class XMLEntityScanner implements XMLLocator {
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
invokeListeners(0);
load(0, true);
load(0, true, true);
}
// skip character
@ -1445,9 +1427,8 @@ public class XMLEntityScanner implements XMLLocator {
} else if (c == '\n' && cc == '\r' && isExternal) {
// handle newlines
if (fCurrentEntity.position == fCurrentEntity.count) {
invokeListeners(1);
fCurrentEntity.ch[0] = (char)cc;
load(1, false);
load(1, false, true);
}
fCurrentEntity.position++;
if (fCurrentEntity.ch[fCurrentEntity.position] == '\n') {
@ -1498,8 +1479,7 @@ public class XMLEntityScanner implements XMLLocator {
//boolean entityChanged = false;
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
invokeListeners(0);
load(0, true);
load(0, true, true);
}
//we are doing this check only in skipSpace() because it is called by
@ -1522,9 +1502,8 @@ public class XMLEntityScanner implements XMLLocator {
fCurrentEntity.lineNumber++;
fCurrentEntity.columnNumber = 1;
if (fCurrentEntity.position == fCurrentEntity.count - 1) {
invokeListeners(0);
fCurrentEntity.ch[0] = (char)c;
entityChanged = load(1, true);
entityChanged = load(1, true, true);
if (!entityChanged){
// the load change the position to be 1,
// need to restore it when entity not changed
@ -1549,8 +1528,7 @@ public class XMLEntityScanner implements XMLLocator {
}
if (fCurrentEntity.position == fCurrentEntity.count) {
invokeListeners(0);
load(0, true);
load(0, true, true);
//we are doing this check only in skipSpace() because it is called by
//fMiscDispatcher and we want the parser to exit gracefully when document
@ -1626,7 +1604,7 @@ public class XMLEntityScanner implements XMLLocator {
if((fCurrentEntity.count - fCurrentEntity.position) < length){
int pos = fCurrentEntity.position;
invokeListeners(pos);
entityChanged = load(fCurrentEntity.count, changeEntity);
entityChanged = load(fCurrentEntity.count, changeEntity, false);
fCurrentEntity.position = pos;
if(entityChanged)break;
}
@ -1731,17 +1709,22 @@ public class XMLEntityScanner implements XMLLocator {
* the current entity in place and the entity
* boundary will be signaled by the return
* value.
* @param notify Determine whether to notify listeners of
* the event
*
* @returns Returns true if the entity changed as a result of this
* load operation.
*/
final boolean load(int offset, boolean changeEntity)
final boolean load(int offset, boolean changeEntity, boolean notify)
throws IOException {
if (DEBUG_BUFFER) {
System.out.print("(load, "+offset+": ");
print();
System.out.println();
}
if (notify) {
invokeListeners(offset);
}
//maintaing the count till last load
fCurrentEntity.fTotalCountTillLastLoad = fCurrentEntity.fTotalCountTillLastLoad + fCurrentEntity.fLastCount ;
// read characters
@ -1778,7 +1761,7 @@ public class XMLEntityScanner implements XMLLocator {
}
// handle the trailing edges
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
load(0, true, false);
}
}
@ -2075,7 +2058,7 @@ public class XMLEntityScanner implements XMLLocator {
*
* @param loadPos Starting position from which new data is being loaded into scanner buffer.
*/
private void invokeListeners(int loadPos){
public void invokeListeners(int loadPos){
for(int i=0;i<listeners.size();i++){
XMLBufferListener listener =(XMLBufferListener) listeners.get(i);
listener.refresh(loadPos);
@ -2108,7 +2091,7 @@ public class XMLEntityScanner implements XMLLocator {
// load more characters, if needed
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
load(0, true, false);
}
// skip spaces
@ -2123,7 +2106,7 @@ public class XMLEntityScanner implements XMLLocator {
fCurrentEntity.columnNumber = 1;
if (fCurrentEntity.position == fCurrentEntity.count - 1) {
fCurrentEntity.ch[0] = (char)c;
entityChanged = load(1, true);
entityChanged = load(1, true, false);
if (!entityChanged)
// the load change the position to be 1,
// need to restore it when entity not changed
@ -2151,7 +2134,7 @@ public class XMLEntityScanner implements XMLLocator {
if (!entityChanged)
fCurrentEntity.position++;
if (fCurrentEntity.position == fCurrentEntity.count) {
load(0, true);
load(0, true, false);
}
} while (XMLChar.isSpace(c = fCurrentEntity.ch[fCurrentEntity.position]));
if (DEBUG_BUFFER) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
*/
/*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
*/
/*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
*/
/*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
*/
/*

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2013, 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

View File

@ -241,11 +241,10 @@ public abstract class XMLOutputFactory {
* factory class name that provides implementation of the factory.
*
* <p>
* Note that this is a new method that replaces the deprecated
* Note that this is a new method that replaces the deprecated
* {@link #newInstance(java.lang.String, java.lang.ClassLoader)
* newInstance(String factoryId, ClassLoader classLoader)} method.
* No changes in behavior are defined by this replacement method relative
* to the deprecated method.
* The original method was incorrectly defined to return XMLInputFactory.
* </p>
*
* @param factoryId Name of the factory to find, same as

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2001, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2001, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2004, 2006, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2004, 2013, 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

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2013, 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

View File

@ -242,3 +242,4 @@ fe56ba456fd32758c72db629938d69067468d89c jdk8-b117
76a598cf50c4e1dc1fc8adc08b451943aa1a3179 jdk8-b118
172b8e056ff259044ca48c5425d643dc8e2e05c8 jdk8-b119
6c152deb600d8a11bc46149ace317b1c9fce1482 jdk8-b120
32050ab53c8a8e4cb09f04b88db78258a480fb61 jdk9-b00

View File

@ -1 +1 @@
project=jdk8
project=jdk9

View File

@ -243,3 +243,4 @@ fc4ac66aa657e09de5f8257c3174f240ed0cbaf7 jdk8-b117
e4499a6529e8c3e762ba86f45cdd774c92a8e7bc jdk8-b119
d31cd980e1da31fa496a359caaf1a165aeb5791a jdk8-b120
27b384262cba51dd0fe3e3534820189b46abc8cb jdk9-b00
3b4ac8d1b76fc6bec9815f0ab714f15b552e4c7b jdk9-b01

View File

@ -195,9 +195,6 @@ ifndef OPENJDK
$(JDK_OUTPUTDIR)/demo/nbproject/%: $(JDK_TOPDIR)/src/closed/share/demo/nbproject/%
$(call install-file)
$(CHMOD) -f ug+w $@
ifeq ($(OPENJDK_TARGET_OS), solaris)
$(RM) -r $(JDK_OUTPUTDIR)/demo/nbproject/jfc/SwingApplet
endif
endif
##################################################################################################
@ -378,9 +375,16 @@ BUILD_DEMOS += $(JDK_OUTPUTDIR)/demo/management/index.html \
##################################################################################################
# The netbeans project files are copied into the demo directory.
BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/share/demo/nbproject/%, \
ifeq ($(OPENJDK_TARGET_OS), solaris)
BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/share/demo/nbproject/%, \
$(JDK_OUTPUTDIR)/demo/nbproject/%, \
$(filter-out $(JDK_TOPDIR)/src/share/demo/nbproject/jfc/SwingApplet%, \
$(call CacheFind, $(JDK_TOPDIR)/src/share/demo/nbproject)))
else
BUILD_DEMOS += $(patsubst $(JDK_TOPDIR)/src/share/demo/nbproject/%, \
$(JDK_OUTPUTDIR)/demo/nbproject/%, \
$(call CacheFind, $(JDK_TOPDIR)/src/share/demo/nbproject))
endif
$(JDK_OUTPUTDIR)/demo/nbproject/%: $(JDK_TOPDIR)/src/share/demo/nbproject/%
$(call install-file)

View File

@ -298,29 +298,6 @@ $(PROFILE_VERSION_CLASS_TARGETS): $(PROFILE_VERSION_JAVA_TARGETS)
@$(JAVAC) -d $(@D)/../../ $(@D)/$(VERSION_JAVA_FILE)
# Support for removing the addPropertyChangeListener and removePropertyChangeListener
# methods from classes that only go into the profile builds.
BEANLESS_CLASSES = $(IMAGES_OUTPUTDIR)/beanless
# When there are $ characters in filenames we have some very subtle interactions between
# make expansion and shell expansion. In this particular case $< will contain a single $ while
# $@ will contain \$. So we have to pass $< in single-quotes to avoid shell expansion
$(BEANLESS_CLASSES)/%: $(JDK_OUTPUTDIR)/classes/%
$(MKDIR) -p $(@D)
$(TOOL_REMOVEMETHODS) '$<' $@ addPropertyChangeListener removePropertyChangeListener
CLASSES_TO_DEBEAN = \
java/util/logging/LogManager.class \
java/util/jar/Pack200\$$Packer.class \
java/util/jar/Pack200\$$Unpacker.class \
com/sun/java/util/jar/pack/PackerImpl.class \
com/sun/java/util/jar/pack/UnpackerImpl.class
ifneq ($(PROFILE), )
BEANLESS_CLASSES_TARGETS := $(addprefix $(BEANLESS_CLASSES)/, $(CLASSES_TO_DEBEAN))
endif
RT_JAR_CREATE_OPTIONS := c0fm
RT_JAR_UPDATE_OPTIONS := u0f
ifeq ($(COMPRESS_JARS), true)
@ -333,7 +310,7 @@ endif
$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/rt.jar: \
CLASS_FILE = $(if $(PROFILE), $(strip $(foreach class, $(PROFILE_VERSION_CLASS_TARGETS), $(if $(findstring $(PROFILE), $(class)), $(class)))), NO_SUCH_FILE)
# This is the real target
$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/rt.jar: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents $(RT_JAR_MANIFEST_FILE) $(PROFILE_VERSION_CLASS_TARGETS) $(BEANLESS_CLASSES_TARGETS)
$(IMAGES_OUTPUTDIR)/lib$(PROFILE)/rt.jar: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the.rt.jar.contents $(RT_JAR_MANIFEST_FILE) $(PROFILE_VERSION_CLASS_TARGETS)
$(ECHO) Creating rt.jar $(PROFILE) Compressed=$(COMPRESS_JARS)
$(MKDIR) -p $(@D)
$(RM) $@ $@.tmp
@ -344,8 +321,6 @@ $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/rt.jar: $(IMAGES_OUTPUTDIR)/lib$(PROFILE)/_the
$(ECHO) Updating rt.jar $(PROFILE) && \
$(CD) $(patsubst %$(VERSION_CLASS_PATH), %, $(CLASS_FILE)) && \
$(JAR) $(RT_JAR_UPDATE_OPTIONS) $@.tmp $(VERSION_CLASS_PATH); \
$(CD) $(BEANLESS_CLASSES) && \
$(JAR) $(RT_JAR_UPDATE_OPTIONS) $@.tmp $(CLASSES_TO_DEBEAN); \
fi
$(MV) $@.tmp $@

View File

@ -190,26 +190,6 @@ $(foreach f,$(filter $(OVERLAY_FILTER),$(JDK_BIN_LIST)), \
$(foreach f,$(filter $(OVERLAY_FILTER),$(JDKJRE_BIN_LIST)), \
$(eval $(call AddFileToCopy,$(JDK_OUTPUTDIR),$(JDK_OVERLAY_IMAGE_DIR)/jre,$f,JDKJRE_BIN_TARGETS)))
ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU_BITS),solaris-64)
define AddIsadirLink
# Param 1 - src file
# Param 2 - variable to add targets to
$1_LINK := $$(dir $1)$(OPENJDK_TARGET_CPU_ISADIR)/$$(notdir $1)
$$($1_LINK):
$(ECHO) $(LOG_INFO) Creating link $$(patsubst $(OUTPUT_ROOT)/%,%,$$@)
$(MKDIR) -p $$(@D)
$(LN) -s ../$$(@F) $$@
$2 += $$($1_LINK)
endef
$(foreach f,$(JRE_BIN_TARGETS),$(eval $(call AddIsadirLink,$f,JRE_BIN_ISADIR_LINK_TARGETS)))
$(foreach f,$(JDK_BIN_TARGETS),$(eval $(call AddIsadirLink,$f,JDK_BIN_ISADIR_LINK_TARGETS)))
$(foreach f,$(JDKJRE_BIN_TARGETS),$(eval $(call AddIsadirLink,$f,JDKJRE_BIN_ISADIR_LINK_TARGETS)))
endif
################################################################################
# /lib dir
ifneq ($(OPENJDK_TARGET_OS), macosx)

View File

@ -122,10 +122,6 @@ TOOL_OSX_TOBIN = $(JAVA) -Djava.awt.headless=true -cp $(JDK_OUTPUTDIR)/btclasses
TOOL_CLDRCONVERTER = $(JAVA) -cp $(JDK_OUTPUTDIR)/btclasses \
build.tools.cldrconverter.CLDRConverter
TOOL_REMOVEMETHODS = $(JAVA) -Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \
-cp $(JDK_OUTPUTDIR)/btclasses:$(JDK_OUTPUTDIR) \
build.tools.classfile.RemoveMethods
TOOL_CHECKDEPS = $(JAVA) -Xbootclasspath/p:$(LANGTOOLS_OUTPUTDIR)/dist/bootstrap/lib/javac.jar \
-cp $(JDK_OUTPUTDIR)/btclasses:$(JDK_OUTPUTDIR) \
build.tools.deps.CheckDeps

View File

@ -26,8 +26,8 @@
# Included or excluded types must take one of two forms
# - *.class to indicate all classes; or else
# - a full single type name e.g.
# com/sun/security/auth/callback/DialogCallbackHandler$$1.class
# You can not use arbitrary wildcards like DialogCallbackHandler*.class.
# javax/management/remote/rmi/_RMIServer_Stub.class
# You can not use arbitrary wildcards like _RMI*.class.
#
# Notes:
# - Nested types must use $$ in place of $ as $ is the make meta-character
@ -149,11 +149,6 @@ PROFILE_3_RTJAR_INCLUDE_PACKAGES := \
PROFILE_3_RTJAR_INCLUDE_TYPES :=
PROFILE_3_RTJAR_EXCLUDE_TYPES := \
com/sun/security/auth/callback/DialogCallbackHandler$$1.class \
com/sun/security/auth/callback/DialogCallbackHandler$$2.class \
com/sun/security/auth/callback/DialogCallbackHandler$$Action.class \
com/sun/security/auth/callback/DialogCallbackHandler$$ConfirmationInfo.class \
com/sun/security/auth/callback/DialogCallbackHandler.class \
javax/management/remote/rmi/_RMIConnectionImpl_Tie.class \
javax/management/remote/rmi/_RMIConnection_Stub.class \
javax/management/remote/rmi/_RMIServerImpl_Tie.class \
@ -225,11 +220,6 @@ FULL_JRE_RTJAR_INCLUDE_PACKAGES := \
sun/tools/jar
FULL_JRE_RTJAR_INCLUDE_TYPES := \
com/sun/security/auth/callback/DialogCallbackHandler$$1.class \
com/sun/security/auth/callback/DialogCallbackHandler$$2.class \
com/sun/security/auth/callback/DialogCallbackHandler$$Action.class \
com/sun/security/auth/callback/DialogCallbackHandler$$ConfirmationInfo.class \
com/sun/security/auth/callback/DialogCallbackHandler.class \
javax/annotation/*.class \
javax/management/remote/rmi/_RMIConnectionImpl_Tie.class \
javax/management/remote/rmi/_RMIConnection_Stub.class \

View File

@ -1,115 +0,0 @@
/*
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* 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.classfile;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Set;
import java.util.HashSet;
import com.sun.tools.classfile.AccessFlags;
import com.sun.tools.classfile.Attributes;
import com.sun.tools.classfile.ClassFile;
import com.sun.tools.classfile.ClassWriter;
import com.sun.tools.classfile.ConstantPool;
import com.sun.tools.classfile.Field;
import com.sun.tools.classfile.Method;
public class RemoveMethods {
public static void main(String[] args) throws Exception {
if (args.length < 2) {
System.err.println("Usage: java RemoveMethods classfile output [method...]");
System.exit(-1);
}
// class file to read
Path input = Paths.get(args[0]);
// class file to write, if directory then use the name of the input
Path output = Paths.get(args[1]);
if (Files.isDirectory(output))
output = output.resolve(input.getFileName());
// the methods to remove
Set<String> methodsToRemove = new HashSet<>();
int i = 2;
while (i < args.length)
methodsToRemove.add(args[i++]);
// read class file
ClassFile cf;
try (InputStream in = Files.newInputStream(input)) {
cf = ClassFile.read(in);
}
final int magic = cf.magic;
final int major_version = cf.major_version;
final int minor_version = cf.minor_version;
final ConstantPool cp = cf.constant_pool;
final AccessFlags access_flags = cf.access_flags;
final int this_class = cf.this_class;
final int super_class = cf.super_class;
final int[] interfaces = cf.interfaces;
final Field[] fields = cf.fields;
final Attributes class_attrs = cf.attributes;
// remove the requested methods, no signature check at this time
Method[] methods = cf.methods;
i = 0;
while (i < methods.length) {
Method m = methods[i];
String name = m.getName(cp);
if (methodsToRemove.contains(name)) {
int len = methods.length;
Method[] newMethods = new Method[len-1];
if (i > 0)
System.arraycopy(methods, 0, newMethods, 0, i);
int after = methods.length - i - 1;
if (after > 0)
System.arraycopy(methods, i+1, newMethods, i, after);
methods = newMethods;
String paramTypes = m.descriptor.getParameterTypes(cp);
System.out.format("Removed method %s%s from %s%n",
name, paramTypes, cf.getName());
continue;
}
i++;
}
// TBD, prune constant pool of entries that are no longer referenced
// re-write class file
cf = new ClassFile(magic, minor_version, major_version, cp, access_flags,
this_class, super_class, interfaces, fields, methods, class_attrs);
try (OutputStream out = Files.newOutputStream(output)) {
new ClassWriter().write(cf, out);
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -43,7 +43,7 @@ public final class AppleProvider extends Provider {
public AppleProvider() {
/* We are the Apple provider */
super("Apple", 1.8d, info);
super("Apple", 1.9d, info);
AccessController.<Object>doPrivileged(new java.security.PrivilegedAction<Object>() {
public Object run() {

View File

@ -38,7 +38,6 @@ import java.util.*;
import sun.awt.*;
import sun.lwawt.macosx.*;
import sun.print.*;
import sun.security.util.SecurityConstants;
public abstract class LWToolkit extends SunToolkit implements Runnable {
@ -503,7 +502,7 @@ public abstract class LWToolkit extends SunToolkit implements Runnable {
public Clipboard getSystemClipboard() {
SecurityManager security = System.getSecurityManager();
if (security != null) {
security.checkPermission(SecurityConstants.AWT.ACCESS_CLIPBOARD_PERMISSION);
security.checkPermission(AWTPermissions.ACCESS_CLIPBOARD_PERMISSION);
}
synchronized (this) {

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2014, 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
@ -104,7 +104,7 @@ public final class SunJCE extends Provider {
public SunJCE() {
/* We are the "SunJCE" provider */
super("SunJCE", 1.8d, info);
super("SunJCE", 1.9d, info);
final String BLOCK_MODES = "ECB|CBC|PCBC|CTR|CTS|CFB|OFB" +
"|CFB8|CFB16|CFB24|CFB32|CFB40|CFB48|CFB56|CFB64" +

View File

@ -26,7 +26,6 @@
package com.sun.java.util.jar.pack;
import com.sun.java.util.jar.pack.Attribute.Layout;
import java.beans.PropertyChangeListener;
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@ -136,23 +135,6 @@ public class PackerImpl extends TLGlobals implements Pack200.Packer {
in.close();
}
}
/**
* Register a listener for changes to options.
* @param listener An object to be invoked when a property is changed.
*/
public void addPropertyChangeListener(PropertyChangeListener listener) {
props.addListener(listener);
}
/**
* Remove a listener for the PropertyChange event.
* @param listener The PropertyChange listener to be removed.
*/
public void removePropertyChangeListener(PropertyChangeListener listener) {
props.removeListener(listener);
}
// All the worker bees.....
// The packer worker.

View File

@ -40,9 +40,6 @@ import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.jar.Pack200;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/**
* Control block for publishing Pack200 options to the other classes.
@ -51,30 +48,9 @@ import java.lang.reflect.Method;
final class PropMap implements SortedMap<String, String> {
private final TreeMap<String, String> theMap = new TreeMap<>();;
// type is erased, elements are of type java.beans.PropertyChangeListener
private final List<Object> listenerList = new ArrayList<>(1);
void addListener(Object listener) {
assert Beans.isPropertyChangeListener(listener);
listenerList.add(listener);
}
void removeListener(Object listener) {
assert Beans.isPropertyChangeListener(listener);
listenerList.remove(listener);
}
// Override:
public String put(String key, String value) {
String oldValue = theMap.put(key, value);
if (value != oldValue && !listenerList.isEmpty()) {
assert Beans.isBeansPresent();
// Post the property change event.
Object event = Beans.newPropertyChangeEvent(this, key, oldValue, value);
for (Object listener : listenerList) {
Beans.invokePropertyChange(listener, event);
}
}
return oldValue;
}
@ -341,113 +317,4 @@ final class PropMap implements SortedMap<String, String> {
public String lastKey() {
return theMap.lastKey();
}
/**
* A class that provides access to the java.beans.PropertyChangeListener
* and java.beans.PropertyChangeEvent without creating a static dependency
* on java.beans. This class can be removed once the addPropertyChangeListener
* and removePropertyChangeListener methods are removed from Packer and
* Unpacker.
*/
private static class Beans {
private static final Class<?> propertyChangeListenerClass =
getClass("java.beans.PropertyChangeListener");
private static final Class<?> propertyChangeEventClass =
getClass("java.beans.PropertyChangeEvent");
private static final Method propertyChangeMethod =
getMethod(propertyChangeListenerClass,
"propertyChange",
propertyChangeEventClass);
private static final Constructor<?> propertyEventCtor =
getConstructor(propertyChangeEventClass,
Object.class,
String.class,
Object.class,
Object.class);
private static Class<?> getClass(String name) {
try {
return Class.forName(name, true, Beans.class.getClassLoader());
} catch (ClassNotFoundException e) {
return null;
}
}
private static Constructor<?> getConstructor(Class<?> c, Class<?>... types) {
try {
return (c == null) ? null : c.getDeclaredConstructor(types);
} catch (NoSuchMethodException x) {
throw new AssertionError(x);
}
}
private static Method getMethod(Class<?> c, String name, Class<?>... types) {
try {
return (c == null) ? null : c.getMethod(name, types);
} catch (NoSuchMethodException e) {
throw new AssertionError(e);
}
}
/**
* Returns {@code true} if java.beans is present.
*/
static boolean isBeansPresent() {
return propertyChangeListenerClass != null &&
propertyChangeEventClass != null;
}
/**
* Returns {@code true} if the given object is a PropertyChangeListener
*/
static boolean isPropertyChangeListener(Object obj) {
if (propertyChangeListenerClass == null) {
return false;
} else {
return propertyChangeListenerClass.isInstance(obj);
}
}
/**
* Returns a new PropertyChangeEvent with the given source, property
* name, old and new values.
*/
static Object newPropertyChangeEvent(Object source, String prop,
Object oldValue, Object newValue)
{
try {
return propertyEventCtor.newInstance(source, prop, oldValue, newValue);
} catch (InstantiationException | IllegalAccessException x) {
throw new AssertionError(x);
} catch (InvocationTargetException x) {
Throwable cause = x.getCause();
if (cause instanceof Error)
throw (Error)cause;
if (cause instanceof RuntimeException)
throw (RuntimeException)cause;
throw new AssertionError(x);
}
}
/**
* Invokes the given PropertyChangeListener's propertyChange method
* with the given event.
*/
static void invokePropertyChange(Object listener, Object ev) {
try {
propertyChangeMethod.invoke(listener, ev);
} catch (IllegalAccessException x) {
throw new AssertionError(x);
} catch (InvocationTargetException x) {
Throwable cause = x.getCause();
if (cause instanceof Error)
throw (Error)cause;
if (cause instanceof RuntimeException)
throw (RuntimeException)cause;
throw new AssertionError(x);
}
}
}
}

View File

@ -25,7 +25,6 @@
package com.sun.java.util.jar.pack;
import java.beans.PropertyChangeListener;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
@ -55,24 +54,6 @@ import java.util.zip.ZipEntry;
public class UnpackerImpl extends TLGlobals implements Pack200.Unpacker {
/**
* Register a listener for changes to options.
* @param listener An object to be invoked when a property is changed.
*/
public void addPropertyChangeListener(PropertyChangeListener listener) {
props.addListener(listener);
}
/**
* Remove a listener for the PropertyChange event.
* @param listener The PropertyChange listener to be removed.
*/
public void removePropertyChangeListener(PropertyChangeListener listener) {
props.removeListener(listener);
}
public UnpackerImpl() {}

View File

@ -66,6 +66,14 @@ public final class ResourceManager {
*/
private static final String JRELIB_PROPERTY_FILE_NAME = "jndi.properties";
/*
* Internal environment property, that when set to "true", disables
* application resource files lookup to prevent recursion issues
* when validating signed JARs.
*/
private static final String DISABLE_APP_RESOURCE_FILES =
"com.sun.naming.disable.app.resource.files";
/*
* The standard JNDI properties that specify colon-separated lists.
*/
@ -224,6 +232,13 @@ public final class ResourceManager {
}
}
// Return without merging if application resource files lookup
// is disabled.
String disableAppRes = (String)env.get(DISABLE_APP_RESOURCE_FILES);
if (disableAppRes != null && disableAppRes.equalsIgnoreCase("true")) {
return env;
}
// Merge the above with the values read from all application
// resource files. Colon-separated lists are concatenated.
mergeTables((Hashtable<Object, Object>)env, getApplicationResources());

View File

@ -1,319 +0,0 @@
/*
* Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.security.auth.callback;
/* JAAS imports */
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.ConfirmationCallback;
import javax.security.auth.callback.NameCallback;
import javax.security.auth.callback.PasswordCallback;
import javax.security.auth.callback.TextOutputCallback;
import javax.security.auth.callback.UnsupportedCallbackException;
/* Java imports */
import java.awt.Component;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.swing.Box;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPasswordField;
import javax.swing.JTextField;
/**
* <p>
* Uses a Swing dialog window to query the user for answers to
* authentication questions.
* This can be used by a JAAS application to instantiate a
* CallbackHandler
* @see javax.security.auth.callback
* @deprecated This class will be removed in a future release.
*/
@jdk.Exported(false)
@Deprecated
public class DialogCallbackHandler implements CallbackHandler {
/* -- Fields -- */
/* The parent window, or null if using the default parent */
private Component parentComponent;
private static final int JPasswordFieldLen = 8 ;
private static final int JTextFieldLen = 8 ;
/* -- Methods -- */
/**
* Creates a callback dialog with the default parent window.
*/
public DialogCallbackHandler() { }
/**
* Creates a callback dialog and specify the parent window.
*
* @param parentComponent the parent window -- specify <code>null</code>
* for the default parent
*/
public DialogCallbackHandler(Component parentComponent) {
this.parentComponent = parentComponent;
}
/*
* An interface for recording actions to carry out if the user
* clicks OK for the dialog.
*/
private static interface Action {
void perform();
}
/**
* Handles the specified set of callbacks.
*
* @param callbacks the callbacks to handle
* @throws UnsupportedCallbackException if the callback is not an
* instance of NameCallback or PasswordCallback
*/
public void handle(Callback[] callbacks)
throws UnsupportedCallbackException
{
/* Collect messages to display in the dialog */
final List<Object> messages = new ArrayList<>(3);
/* Collection actions to perform if the user clicks OK */
final List<Action> okActions = new ArrayList<>(2);
ConfirmationInfo confirmation = new ConfirmationInfo();
for (int i = 0; i < callbacks.length; i++) {
if (callbacks[i] instanceof TextOutputCallback) {
TextOutputCallback tc = (TextOutputCallback) callbacks[i];
switch (tc.getMessageType()) {
case TextOutputCallback.INFORMATION:
confirmation.messageType = JOptionPane.INFORMATION_MESSAGE;
break;
case TextOutputCallback.WARNING:
confirmation.messageType = JOptionPane.WARNING_MESSAGE;
break;
case TextOutputCallback.ERROR:
confirmation.messageType = JOptionPane.ERROR_MESSAGE;
break;
default:
throw new UnsupportedCallbackException(
callbacks[i], "Unrecognized message type");
}
messages.add(tc.getMessage());
} else if (callbacks[i] instanceof NameCallback) {
final NameCallback nc = (NameCallback) callbacks[i];
JLabel prompt = new JLabel(nc.getPrompt());
final JTextField name = new JTextField(JTextFieldLen);
String defaultName = nc.getDefaultName();
if (defaultName != null) {
name.setText(defaultName);
}
/*
* Put the prompt and name in a horizontal box,
* and add that to the set of messages.
*/
Box namePanel = Box.createHorizontalBox();
namePanel.add(prompt);
namePanel.add(name);
messages.add(namePanel);
/* Store the name back into the callback if OK */
okActions.add(new Action() {
public void perform() {
nc.setName(name.getText());
}
});
} else if (callbacks[i] instanceof PasswordCallback) {
final PasswordCallback pc = (PasswordCallback) callbacks[i];
JLabel prompt = new JLabel(pc.getPrompt());
final JPasswordField password =
new JPasswordField(JPasswordFieldLen);
if (!pc.isEchoOn()) {
password.setEchoChar('*');
}
Box passwordPanel = Box.createHorizontalBox();
passwordPanel.add(prompt);
passwordPanel.add(password);
messages.add(passwordPanel);
okActions.add(new Action() {
public void perform() {
pc.setPassword(password.getPassword());
}
});
} else if (callbacks[i] instanceof ConfirmationCallback) {
ConfirmationCallback cc = (ConfirmationCallback)callbacks[i];
confirmation.setCallback(cc);
if (cc.getPrompt() != null) {
messages.add(cc.getPrompt());
}
} else {
throw new UnsupportedCallbackException(
callbacks[i], "Unrecognized Callback");
}
}
/* Display the dialog */
int result = JOptionPane.showOptionDialog(
parentComponent,
messages.toArray(),
"Confirmation", /* title */
confirmation.optionType,
confirmation.messageType,
null, /* icon */
confirmation.options, /* options */
confirmation.initialValue); /* initialValue */
/* Perform the OK actions */
if (result == JOptionPane.OK_OPTION
|| result == JOptionPane.YES_OPTION)
{
Iterator<Action> iterator = okActions.iterator();
while (iterator.hasNext()) {
iterator.next().perform();
}
}
confirmation.handleResult(result);
}
/*
* Provides assistance with translating between JAAS and Swing
* confirmation dialogs.
*/
private static class ConfirmationInfo {
private int[] translations;
int optionType = JOptionPane.OK_CANCEL_OPTION;
Object[] options = null;
Object initialValue = null;
int messageType = JOptionPane.QUESTION_MESSAGE;
private ConfirmationCallback callback;
/* Set the confirmation callback handler */
void setCallback(ConfirmationCallback callback)
throws UnsupportedCallbackException
{
this.callback = callback;
int confirmationOptionType = callback.getOptionType();
switch (confirmationOptionType) {
case ConfirmationCallback.YES_NO_OPTION:
optionType = JOptionPane.YES_NO_OPTION;
translations = new int[] {
JOptionPane.YES_OPTION, ConfirmationCallback.YES,
JOptionPane.NO_OPTION, ConfirmationCallback.NO,
JOptionPane.CLOSED_OPTION, ConfirmationCallback.NO
};
break;
case ConfirmationCallback.YES_NO_CANCEL_OPTION:
optionType = JOptionPane.YES_NO_CANCEL_OPTION;
translations = new int[] {
JOptionPane.YES_OPTION, ConfirmationCallback.YES,
JOptionPane.NO_OPTION, ConfirmationCallback.NO,
JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
};
break;
case ConfirmationCallback.OK_CANCEL_OPTION:
optionType = JOptionPane.OK_CANCEL_OPTION;
translations = new int[] {
JOptionPane.OK_OPTION, ConfirmationCallback.OK,
JOptionPane.CANCEL_OPTION, ConfirmationCallback.CANCEL,
JOptionPane.CLOSED_OPTION, ConfirmationCallback.CANCEL
};
break;
case ConfirmationCallback.UNSPECIFIED_OPTION:
options = callback.getOptions();
/*
* There's no way to know if the default option means
* to cancel the login, but there isn't a better way
* to guess this.
*/
translations = new int[] {
JOptionPane.CLOSED_OPTION, callback.getDefaultOption()
};
break;
default:
throw new UnsupportedCallbackException(
callback,
"Unrecognized option type: " + confirmationOptionType);
}
int confirmationMessageType = callback.getMessageType();
switch (confirmationMessageType) {
case ConfirmationCallback.WARNING:
messageType = JOptionPane.WARNING_MESSAGE;
break;
case ConfirmationCallback.ERROR:
messageType = JOptionPane.ERROR_MESSAGE;
break;
case ConfirmationCallback.INFORMATION:
messageType = JOptionPane.INFORMATION_MESSAGE;
break;
default:
throw new UnsupportedCallbackException(
callback,
"Unrecognized message type: " + confirmationMessageType);
}
}
/* Process the result returned by the Swing dialog */
void handleResult(int result) {
if (callback == null) {
return;
}
for (int i = 0; i < translations.length; i += 2) {
if (translations[i] == result) {
result = translations[i + 1];
break;
}
}
callback.setSelectedIndex(result);
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2014, 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
@ -53,7 +53,7 @@ public final class Provider extends java.security.Provider {
" server mechanisms for: DIGEST-MD5, GSSAPI, CRAM-MD5, NTLM)";
public Provider() {
super("SunSASL", 1.8d, info);
super("SunSASL", 1.9d, info);
AccessController.doPrivileged(new PrivilegedAction<Void>() {
public Void run() {

View File

@ -539,10 +539,10 @@ void MultiplicativeExpression() :
}
void UnaryExpression() :
{}
{Token tok;}
{
( "+" | "-" ) UnaryExpression()
{ throw new ParseException("operation not yet supported"); }
( tok = "+" | tok = "-" ) UnaryExpression()
{ push( LValue.operation(vm, tok, pop(), frameGetter) ); }
|
PreIncrementExpression()
|
@ -566,10 +566,10 @@ void PreDecrementExpression() :
}
void UnaryExpressionNotPlusMinus() :
{}
{Token tok;}
{
( "~" | "!" ) UnaryExpression()
{ throw new ParseException("operation not yet supported"); }
( tok = "~" | tok = "!" ) UnaryExpression()
{ push( LValue.operation(vm, tok, pop(), frameGetter) ); }
|
LOOKAHEAD( CastLookahead() )
CastExpression()

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2013, 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
@ -23,134 +23,243 @@
* questions.
*/
/*
* This source code is provided to illustrate the usage of a given feature
* or technique and has been deliberately simplified. Additional steps
* required for a production-quality application, such as security checks,
* input validation and proper error handling, might not be present in
* this sample code.
*/
/* Generated By:JavaCC: Do not edit this line. ExpressionParserConstants.java */
package com.sun.tools.example.debug.expr;
/**
* Token literal values and constants.
* Generated by org.javacc.parser.OtherFilesGen#start()
*/
public interface ExpressionParserConstants {
/** End of File. */
int EOF = 0;
/** RegularExpression Id. */
int SINGLE_LINE_COMMENT = 6;
/** RegularExpression Id. */
int FORMAL_COMMENT = 7;
/** RegularExpression Id. */
int MULTI_LINE_COMMENT = 8;
/** RegularExpression Id. */
int ABSTRACT = 9;
/** RegularExpression Id. */
int BOOLEAN = 10;
/** RegularExpression Id. */
int BREAK = 11;
/** RegularExpression Id. */
int BYTE = 12;
/** RegularExpression Id. */
int CASE = 13;
/** RegularExpression Id. */
int CATCH = 14;
/** RegularExpression Id. */
int CHAR = 15;
/** RegularExpression Id. */
int CLASS = 16;
/** RegularExpression Id. */
int CONST = 17;
/** RegularExpression Id. */
int CONTINUE = 18;
/** RegularExpression Id. */
int _DEFAULT = 19;
/** RegularExpression Id. */
int DO = 20;
/** RegularExpression Id. */
int DOUBLE = 21;
/** RegularExpression Id. */
int ELSE = 22;
/** RegularExpression Id. */
int EXTENDS = 23;
/** RegularExpression Id. */
int FALSE = 24;
/** RegularExpression Id. */
int FINAL = 25;
/** RegularExpression Id. */
int FINALLY = 26;
/** RegularExpression Id. */
int FLOAT = 27;
/** RegularExpression Id. */
int FOR = 28;
/** RegularExpression Id. */
int GOTO = 29;
/** RegularExpression Id. */
int IF = 30;
/** RegularExpression Id. */
int IMPLEMENTS = 31;
/** RegularExpression Id. */
int IMPORT = 32;
/** RegularExpression Id. */
int INSTANCEOF = 33;
/** RegularExpression Id. */
int INT = 34;
/** RegularExpression Id. */
int INTERFACE = 35;
/** RegularExpression Id. */
int LONG = 36;
/** RegularExpression Id. */
int NATIVE = 37;
/** RegularExpression Id. */
int NEW = 38;
/** RegularExpression Id. */
int NULL = 39;
/** RegularExpression Id. */
int PACKAGE = 40;
/** RegularExpression Id. */
int PRIVATE = 41;
/** RegularExpression Id. */
int PROTECTED = 42;
/** RegularExpression Id. */
int PUBLIC = 43;
/** RegularExpression Id. */
int RETURN = 44;
/** RegularExpression Id. */
int SHORT = 45;
/** RegularExpression Id. */
int STATIC = 46;
/** RegularExpression Id. */
int SUPER = 47;
/** RegularExpression Id. */
int SWITCH = 48;
/** RegularExpression Id. */
int SYNCHRONIZED = 49;
/** RegularExpression Id. */
int THIS = 50;
/** RegularExpression Id. */
int THROW = 51;
/** RegularExpression Id. */
int THROWS = 52;
/** RegularExpression Id. */
int TRANSIENT = 53;
/** RegularExpression Id. */
int TRUE = 54;
/** RegularExpression Id. */
int TRY = 55;
/** RegularExpression Id. */
int VOID = 56;
/** RegularExpression Id. */
int VOLATILE = 57;
/** RegularExpression Id. */
int WHILE = 58;
/** RegularExpression Id. */
int INTEGER_LITERAL = 59;
/** RegularExpression Id. */
int DECIMAL_LITERAL = 60;
/** RegularExpression Id. */
int HEX_LITERAL = 61;
/** RegularExpression Id. */
int OCTAL_LITERAL = 62;
/** RegularExpression Id. */
int FLOATING_POINT_LITERAL = 63;
/** RegularExpression Id. */
int EXPONENT = 64;
/** RegularExpression Id. */
int CHARACTER_LITERAL = 65;
/** RegularExpression Id. */
int STRING_LITERAL = 66;
/** RegularExpression Id. */
int IDENTIFIER = 67;
/** RegularExpression Id. */
int LETTER = 68;
/** RegularExpression Id. */
int DIGIT = 69;
/** RegularExpression Id. */
int LPAREN = 70;
/** RegularExpression Id. */
int RPAREN = 71;
/** RegularExpression Id. */
int LBRACE = 72;
/** RegularExpression Id. */
int RBRACE = 73;
/** RegularExpression Id. */
int LBRACKET = 74;
/** RegularExpression Id. */
int RBRACKET = 75;
/** RegularExpression Id. */
int SEMICOLON = 76;
/** RegularExpression Id. */
int COMMA = 77;
/** RegularExpression Id. */
int DOT = 78;
/** RegularExpression Id. */
int ASSIGN = 79;
/** RegularExpression Id. */
int GT = 80;
/** RegularExpression Id. */
int LT = 81;
/** RegularExpression Id. */
int BANG = 82;
/** RegularExpression Id. */
int TILDE = 83;
/** RegularExpression Id. */
int HOOK = 84;
/** RegularExpression Id. */
int COLON = 85;
/** RegularExpression Id. */
int EQ = 86;
/** RegularExpression Id. */
int LE = 87;
/** RegularExpression Id. */
int GE = 88;
/** RegularExpression Id. */
int NE = 89;
/** RegularExpression Id. */
int SC_OR = 90;
/** RegularExpression Id. */
int SC_AND = 91;
/** RegularExpression Id. */
int INCR = 92;
/** RegularExpression Id. */
int DECR = 93;
/** RegularExpression Id. */
int PLUS = 94;
/** RegularExpression Id. */
int MINUS = 95;
/** RegularExpression Id. */
int STAR = 96;
/** RegularExpression Id. */
int SLASH = 97;
/** RegularExpression Id. */
int BIT_AND = 98;
/** RegularExpression Id. */
int BIT_OR = 99;
/** RegularExpression Id. */
int XOR = 100;
/** RegularExpression Id. */
int REM = 101;
/** RegularExpression Id. */
int LSHIFT = 102;
/** RegularExpression Id. */
int RSIGNEDSHIFT = 103;
/** RegularExpression Id. */
int RUNSIGNEDSHIFT = 104;
/** RegularExpression Id. */
int PLUSASSIGN = 105;
/** RegularExpression Id. */
int MINUSASSIGN = 106;
/** RegularExpression Id. */
int STARASSIGN = 107;
/** RegularExpression Id. */
int SLASHASSIGN = 108;
/** RegularExpression Id. */
int ANDASSIGN = 109;
/** RegularExpression Id. */
int ORASSIGN = 110;
/** RegularExpression Id. */
int XORASSIGN = 111;
/** RegularExpression Id. */
int REMASSIGN = 112;
/** RegularExpression Id. */
int LSHIFTASSIGN = 113;
/** RegularExpression Id. */
int RSIGNEDSHIFTASSIGN = 114;
/** RegularExpression Id. */
int RUNSIGNEDSHIFTASSIGN = 115;
/** Lexical state. */
int DEFAULT = 0;
/** Literal token values. */
String[] tokenImage = {
"<EOF>",
"\" \"",

View File

@ -0,0 +1,642 @@
/*
* Copyright (c) 1999, 2013, 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.
*/
/* Generated By:JavaCC: Do not edit this line. JavaCharStream.java Version 5.0 */
/* JavaCCOptions:STATIC=false,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package com.sun.tools.example.debug.expr;
/**
* An implementation of interface CharStream, where the stream is assumed to
* contain only ASCII characters (with java-like unicode escape processing).
*/
public
class JavaCharStream
{
/** Whether parser is static. */
public static final boolean staticFlag = false;
static final int hexval(char c) throws java.io.IOException {
switch(c)
{
case '0' :
return 0;
case '1' :
return 1;
case '2' :
return 2;
case '3' :
return 3;
case '4' :
return 4;
case '5' :
return 5;
case '6' :
return 6;
case '7' :
return 7;
case '8' :
return 8;
case '9' :
return 9;
case 'a' :
case 'A' :
return 10;
case 'b' :
case 'B' :
return 11;
case 'c' :
case 'C' :
return 12;
case 'd' :
case 'D' :
return 13;
case 'e' :
case 'E' :
return 14;
case 'f' :
case 'F' :
return 15;
}
throw new java.io.IOException(); // Should never come here
}
/** Position in buffer. */
public int bufpos = -1;
int bufsize;
int available;
int tokenBegin;
protected int bufline[];
protected int bufcolumn[];
protected int column = 0;
protected int line = 1;
protected boolean prevCharIsCR = false;
protected boolean prevCharIsLF = false;
protected java.io.Reader inputStream;
protected char[] nextCharBuf;
protected char[] buffer;
protected int maxNextCharInd = 0;
protected int nextCharInd = -1;
protected int inBuf = 0;
protected int tabSize = 8;
protected void setTabSize(int i) { tabSize = i; }
protected int getTabSize(int i) { return tabSize; }
protected void ExpandBuff(boolean wrapAround)
{
char[] newbuffer = new char[bufsize + 2048];
int newbufline[] = new int[bufsize + 2048];
int newbufcolumn[] = new int[bufsize + 2048];
try
{
if (wrapAround)
{
System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
System.arraycopy(buffer, 0, newbuffer, bufsize - tokenBegin, bufpos);
buffer = newbuffer;
System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
System.arraycopy(bufline, 0, newbufline, bufsize - tokenBegin, bufpos);
bufline = newbufline;
System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
System.arraycopy(bufcolumn, 0, newbufcolumn, bufsize - tokenBegin, bufpos);
bufcolumn = newbufcolumn;
bufpos += (bufsize - tokenBegin);
}
else
{
System.arraycopy(buffer, tokenBegin, newbuffer, 0, bufsize - tokenBegin);
buffer = newbuffer;
System.arraycopy(bufline, tokenBegin, newbufline, 0, bufsize - tokenBegin);
bufline = newbufline;
System.arraycopy(bufcolumn, tokenBegin, newbufcolumn, 0, bufsize - tokenBegin);
bufcolumn = newbufcolumn;
bufpos -= tokenBegin;
}
}
catch (Throwable t)
{
throw new Error(t.getMessage());
}
available = (bufsize += 2048);
tokenBegin = 0;
}
protected void FillBuff() throws java.io.IOException
{
int i;
if (maxNextCharInd == 4096)
maxNextCharInd = nextCharInd = 0;
try {
if ((i = inputStream.read(nextCharBuf, maxNextCharInd,
4096 - maxNextCharInd)) == -1)
{
inputStream.close();
throw new java.io.IOException();
}
else
maxNextCharInd += i;
return;
}
catch(java.io.IOException e) {
if (bufpos != 0)
{
--bufpos;
backup(0);
}
else
{
bufline[bufpos] = line;
bufcolumn[bufpos] = column;
}
throw e;
}
}
protected char ReadByte() throws java.io.IOException
{
if (++nextCharInd >= maxNextCharInd)
FillBuff();
return nextCharBuf[nextCharInd];
}
/** @return starting character for token. */
public char BeginToken() throws java.io.IOException
{
if (inBuf > 0)
{
--inBuf;
if (++bufpos == bufsize)
bufpos = 0;
tokenBegin = bufpos;
return buffer[bufpos];
}
tokenBegin = 0;
bufpos = -1;
return readChar();
}
protected void AdjustBuffSize()
{
if (available == bufsize)
{
if (tokenBegin > 2048)
{
bufpos = 0;
available = tokenBegin;
}
else
ExpandBuff(false);
}
else if (available > tokenBegin)
available = bufsize;
else if ((tokenBegin - available) < 2048)
ExpandBuff(true);
else
available = tokenBegin;
}
protected void UpdateLineColumn(char c)
{
column++;
if (prevCharIsLF)
{
prevCharIsLF = false;
line += (column = 1);
}
else if (prevCharIsCR)
{
prevCharIsCR = false;
if (c == '\n')
{
prevCharIsLF = true;
}
else
line += (column = 1);
}
switch (c)
{
case '\r' :
prevCharIsCR = true;
break;
case '\n' :
prevCharIsLF = true;
break;
case '\t' :
column--;
column += (tabSize - (column % tabSize));
break;
default :
break;
}
bufline[bufpos] = line;
bufcolumn[bufpos] = column;
}
/** Read a character. */
public char readChar() throws java.io.IOException
{
if (inBuf > 0)
{
--inBuf;
if (++bufpos == bufsize)
bufpos = 0;
return buffer[bufpos];
}
char c;
if (++bufpos == available)
AdjustBuffSize();
if ((buffer[bufpos] = c = ReadByte()) == '\\')
{
UpdateLineColumn(c);
int backSlashCnt = 1;
for (;;) // Read all the backslashes
{
if (++bufpos == available)
AdjustBuffSize();
try
{
if ((buffer[bufpos] = c = ReadByte()) != '\\')
{
UpdateLineColumn(c);
// found a non-backslash char.
if ((c == 'u') && ((backSlashCnt & 1) == 1))
{
if (--bufpos < 0)
bufpos = bufsize - 1;
break;
}
backup(backSlashCnt);
return '\\';
}
}
catch(java.io.IOException e)
{
// We are returning one backslash so we should only backup (count-1)
if (backSlashCnt > 1)
backup(backSlashCnt-1);
return '\\';
}
UpdateLineColumn(c);
backSlashCnt++;
}
// Here, we have seen an odd number of backslash's followed by a 'u'
try
{
while ((c = ReadByte()) == 'u')
++column;
buffer[bufpos] = c = (char)(hexval(c) << 12 |
hexval(ReadByte()) << 8 |
hexval(ReadByte()) << 4 |
hexval(ReadByte()));
column += 4;
}
catch(java.io.IOException e)
{
throw new Error("Invalid escape character at line " + line +
" column " + column + ".");
}
if (backSlashCnt == 1)
return c;
else
{
backup(backSlashCnt - 1);
return '\\';
}
}
else
{
UpdateLineColumn(c);
return c;
}
}
@Deprecated
/**
* @deprecated
* @see #getEndColumn
*/
public int getColumn() {
return bufcolumn[bufpos];
}
@Deprecated
/**
* @deprecated
* @see #getEndLine
*/
public int getLine() {
return bufline[bufpos];
}
/** Get end column. */
public int getEndColumn() {
return bufcolumn[bufpos];
}
/** Get end line. */
public int getEndLine() {
return bufline[bufpos];
}
/** @return column of token start */
public int getBeginColumn() {
return bufcolumn[tokenBegin];
}
/** @return line number of token start */
public int getBeginLine() {
return bufline[tokenBegin];
}
/** Retreat. */
public void backup(int amount) {
inBuf += amount;
if ((bufpos -= amount) < 0)
bufpos += bufsize;
}
/** Constructor. */
public JavaCharStream(java.io.Reader dstream,
int startline, int startcolumn, int buffersize)
{
inputStream = dstream;
line = startline;
column = startcolumn - 1;
available = bufsize = buffersize;
buffer = new char[buffersize];
bufline = new int[buffersize];
bufcolumn = new int[buffersize];
nextCharBuf = new char[4096];
}
/** Constructor. */
public JavaCharStream(java.io.Reader dstream,
int startline, int startcolumn)
{
this(dstream, startline, startcolumn, 4096);
}
/** Constructor. */
public JavaCharStream(java.io.Reader dstream)
{
this(dstream, 1, 1, 4096);
}
/** Reinitialise. */
public void ReInit(java.io.Reader dstream,
int startline, int startcolumn, int buffersize)
{
inputStream = dstream;
line = startline;
column = startcolumn - 1;
if (buffer == null || buffersize != buffer.length)
{
available = bufsize = buffersize;
buffer = new char[buffersize];
bufline = new int[buffersize];
bufcolumn = new int[buffersize];
nextCharBuf = new char[4096];
}
prevCharIsLF = prevCharIsCR = false;
tokenBegin = inBuf = maxNextCharInd = 0;
nextCharInd = bufpos = -1;
}
/** Reinitialise. */
public void ReInit(java.io.Reader dstream,
int startline, int startcolumn)
{
ReInit(dstream, startline, startcolumn, 4096);
}
/** Reinitialise. */
public void ReInit(java.io.Reader dstream)
{
ReInit(dstream, 1, 1, 4096);
}
/** Constructor. */
public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
{
this(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
}
/** Constructor. */
public JavaCharStream(java.io.InputStream dstream, int startline,
int startcolumn, int buffersize)
{
this(new java.io.InputStreamReader(dstream), startline, startcolumn, 4096);
}
/** Constructor. */
public JavaCharStream(java.io.InputStream dstream, String encoding, int startline,
int startcolumn) throws java.io.UnsupportedEncodingException
{
this(dstream, encoding, startline, startcolumn, 4096);
}
/** Constructor. */
public JavaCharStream(java.io.InputStream dstream, int startline,
int startcolumn)
{
this(dstream, startline, startcolumn, 4096);
}
/** Constructor. */
public JavaCharStream(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
{
this(dstream, encoding, 1, 1, 4096);
}
/** Constructor. */
public JavaCharStream(java.io.InputStream dstream)
{
this(dstream, 1, 1, 4096);
}
/** Reinitialise. */
public void ReInit(java.io.InputStream dstream, String encoding, int startline,
int startcolumn, int buffersize) throws java.io.UnsupportedEncodingException
{
ReInit(encoding == null ? new java.io.InputStreamReader(dstream) : new java.io.InputStreamReader(dstream, encoding), startline, startcolumn, buffersize);
}
/** Reinitialise. */
public void ReInit(java.io.InputStream dstream, int startline,
int startcolumn, int buffersize)
{
ReInit(new java.io.InputStreamReader(dstream), startline, startcolumn, buffersize);
}
/** Reinitialise. */
public void ReInit(java.io.InputStream dstream, String encoding, int startline,
int startcolumn) throws java.io.UnsupportedEncodingException
{
ReInit(dstream, encoding, startline, startcolumn, 4096);
}
/** Reinitialise. */
public void ReInit(java.io.InputStream dstream, int startline,
int startcolumn)
{
ReInit(dstream, startline, startcolumn, 4096);
}
/** Reinitialise. */
public void ReInit(java.io.InputStream dstream, String encoding) throws java.io.UnsupportedEncodingException
{
ReInit(dstream, encoding, 1, 1, 4096);
}
/** Reinitialise. */
public void ReInit(java.io.InputStream dstream)
{
ReInit(dstream, 1, 1, 4096);
}
/** @return token image as String */
public String GetImage()
{
if (bufpos >= tokenBegin)
return new String(buffer, tokenBegin, bufpos - tokenBegin + 1);
else
return new String(buffer, tokenBegin, bufsize - tokenBegin) +
new String(buffer, 0, bufpos + 1);
}
/** @return suffix */
public char[] GetSuffix(int len)
{
char[] ret = new char[len];
if ((bufpos + 1) >= len)
System.arraycopy(buffer, bufpos - len + 1, ret, 0, len);
else
{
System.arraycopy(buffer, bufsize - (len - bufpos - 1), ret, 0,
len - bufpos - 1);
System.arraycopy(buffer, 0, ret, len - bufpos - 1, bufpos + 1);
}
return ret;
}
/** Set buffers back to null when finished. */
public void Done()
{
nextCharBuf = null;
buffer = null;
bufline = null;
bufcolumn = null;
}
/**
* Method to adjust line and column numbers for the start of a token.
*/
public void adjustBeginLineColumn(int newLine, int newCol)
{
int start = tokenBegin;
int len;
if (bufpos >= tokenBegin)
{
len = bufpos - tokenBegin + inBuf + 1;
}
else
{
len = bufsize - tokenBegin + bufpos + 1 + inBuf;
}
int i = 0, j = 0, k = 0;
int nextColDiff = 0, columnDiff = 0;
while (i < len && bufline[j = start % bufsize] == bufline[k = ++start % bufsize])
{
bufline[j] = newLine;
nextColDiff = columnDiff + bufcolumn[k] - bufcolumn[j];
bufcolumn[j] = newCol + columnDiff;
columnDiff = nextColDiff;
i++;
}
if (i < len)
{
bufline[j] = newLine++;
bufcolumn[j] = newCol + columnDiff;
while (i++ < len)
{
if (bufline[j = start % bufsize] != bufline[++start % bufsize])
bufline[j] = newLine++;
else
bufline[j] = newLine;
}
}
line = bufline[j];
column = bufcolumn[j];
}
}
/* JavaCC - OriginalChecksum=17a580b005f6229e8445521923427bab (do not edit this line) */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2013, 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
@ -740,7 +740,30 @@ abstract class LValue {
}
static LValue makeInteger(VirtualMachine vm, Token token) {
return make(vm, Integer.parseInt(token.image));
String image = token.image;
// Here we have to deal with the fact that an INTEGER_LITERAL
// can be DECIMAL_LITERAL, HEX_LITERAL or OCTAL_LITERAL. All of these
// can have an optional "L" or "l" at the end signifying that it is
// a long value. Otherwise, we treat values that are in range for an
// int as int and anything else as long.
if (image.endsWith("L") || image.endsWith("l")) {
// This is a long without doubt - drop the final "Ll" and decode
image = image.substring(0, image.length() - 1);
return make(vm, Long.decode(image));
}
long longValue = Long.decode(image);
int intValue = (int) longValue;
if (intValue == longValue) {
// the value fits in an integer, lets return it as an integer
return make(vm, intValue);
}
else {
// otherwise treat it as a long
return make(vm, longValue);
}
}
static LValue makeShort(VirtualMachine vm, Token token) {
@ -1062,4 +1085,76 @@ abstract class LValue {
return make(vm, res);
}
}
static LValue operation(VirtualMachine vm, Token token, LValue rightL,
ExpressionParser.GetFrame frameGetter)
throws ParseException {
String op = token.image;
Value right = rightL.interiorGetValue();
if (right instanceof ObjectReference) {
throw new ParseException("Invalid operation '" + op
+ "' on an Object");
}
if (right instanceof BooleanValue) {
if (op.equals("!")) {
boolean rr = ((BooleanValue) right).value();
return make(vm, !rr);
}
throw new ParseException("Invalid operation '" + op
+ "' on a Boolean");
}
// from here on, we know it is a integer kind of type
PrimitiveValue primRight = (PrimitiveValue) right;
if (primRight instanceof DoubleValue) {
double rr = primRight.doubleValue();
double res;
if (op.equals("+")) {
res = rr;
} else if (op.equals("-")) {
res = -rr;
} else {
throw new ParseException("Unknown operation: " + op);
}
return make(vm, res);
}
if (primRight instanceof FloatValue) {
float rr = primRight.floatValue();
float res;
if (op.equals("+")) {
res = rr;
} else if (op.equals("-")) {
res = -rr;
} else {
throw new ParseException("Unknown operation: " + op);
}
return make(vm, res);
}
if (primRight instanceof LongValue) {
long rr = primRight.longValue();
long res;
if (op.equals("+")) {
res = rr;
} else if (op.equals("-")) {
res = -rr;
} else if (op.equals("~")) {
res = ~rr;
} else {
throw new ParseException("Unknown operation: " + op);
}
return make(vm, res);
} else {
int rr = primRight.intValue();
int res;
if (op.equals("+")) {
res = rr;
} else if (op.equals("-")) {
res = -rr;
} else if (op.equals("~")) {
res = ~rr;
} else {
throw new ParseException("Unknown operation: " + op);
}
return make(vm, res);
}
}
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2013, 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
@ -23,16 +23,8 @@
* questions.
*/
/*
* This source code is provided to illustrate the usage of a given feature
* or technique and has been deliberately simplified. Additional steps
* required for a production-quality application, such as security checks,
* input validation and proper error handling, might not be present in
* this sample code.
*/
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 0.7pre6 */
/* Generated By:JavaCC: Do not edit this line. ParseException.java Version 5.0 */
/* JavaCCOptions:KEEP_LINE_COL=null */
package com.sun.tools.example.debug.expr;
/**
@ -46,27 +38,25 @@ package com.sun.tools.example.debug.expr;
*/
public class ParseException extends Exception {
private static final long serialVersionUID = 7978489144303647901L;
/**
* The version identifier for this Serializable class.
* Increment only if the <i>serialized</i> form of the
* class changes.
*/
private static final long serialVersionUID = 1L;
/**
* This constructor is used by the method "generateParseException"
* in the generated parser. Calling this constructor generates
* a new object of this type with the fields "currentToken",
* "expectedTokenSequences", and "tokenImage" set. The boolean
* flag "specialConstructor" is also set to true to indicate that
* this constructor was used to create this object.
* This constructor calls its super class with the empty string
* to force the "toString" method of parent class "Throwable" to
* print the error message in the form:
* ParseException: <result of getMessage>
* "expectedTokenSequences", and "tokenImage" set.
*/
public ParseException(Token currentTokenVal,
int[][] expectedTokenSequencesVal,
String[] tokenImageVal
)
{
super("");
specialConstructor = true;
super(initialise(currentTokenVal, expectedTokenSequencesVal, tokenImageVal));
currentToken = currentTokenVal;
expectedTokenSequences = expectedTokenSequencesVal;
tokenImage = tokenImageVal;
@ -84,20 +74,13 @@ public class ParseException extends Exception {
public ParseException() {
super();
specialConstructor = false;
}
/** Constructor with message. */
public ParseException(String message) {
super(message);
specialConstructor = false;
}
/**
* This variable determines which constructor was used to create
* this object and thereby affects the semantics of the
* "getMessage" method (see below).
*/
protected boolean specialConstructor;
/**
* This is the last token that has been consumed successfully. If
@ -121,54 +104,52 @@ public class ParseException extends Exception {
public String[] tokenImage;
/**
* This method has the standard behavior when this object has been
* created using the standard constructors. Otherwise, it uses
* "currentToken" and "expectedTokenSequences" to generate a parse
* It uses "currentToken" and "expectedTokenSequences" to generate a parse
* error message and returns it. If this object has been created
* due to a parse error, and you do not catch it (it gets thrown
* from the parser), then this method is called during the printing
* of the final stack trace, and hence the correct error message
* from the parser) the correct error message
* gets displayed.
*/
@Override
public String getMessage() {
if (!specialConstructor) {
return super.getMessage();
}
String expected = "";
private static String initialise(Token currentToken,
int[][] expectedTokenSequences,
String[] tokenImage) {
String eol = System.getProperty("line.separator", "\n");
StringBuffer expected = new StringBuffer();
int maxSize = 0;
for (int[] expectedTokenSequence : expectedTokenSequences) {
if (maxSize < expectedTokenSequence.length) {
maxSize = expectedTokenSequence.length;
for (int i = 0; i < expectedTokenSequences.length; i++) {
if (maxSize < expectedTokenSequences[i].length) {
maxSize = expectedTokenSequences[i].length;
}
for (int j = 0; j < expectedTokenSequence.length; j++) {
expected += tokenImage[expectedTokenSequence[j]] + " ";
for (int j = 0; j < expectedTokenSequences[i].length; j++) {
expected.append(tokenImage[expectedTokenSequences[i][j]]).append(' ');
}
if (expectedTokenSequence[expectedTokenSequence.length - 1] != 0) {
expected += "...";
if (expectedTokenSequences[i][expectedTokenSequences[i].length - 1] != 0) {
expected.append("...");
}
expected += eol + " ";
expected.append(eol).append(" ");
}
String retval = "Encountered \"";
Token tok = currentToken.next;
for (int i = 0; i < maxSize; i++) {
if (i != 0) {
retval += " ";
}
if (i != 0) retval += " ";
if (tok.kind == 0) {
retval += tokenImage[0];
break;
}
retval += " " + tokenImage[tok.kind];
retval += " \"";
retval += add_escapes(tok.image);
retval += " \"";
tok = tok.next;
}
retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn + "." + eol;
retval += "\" at line " + currentToken.next.beginLine + ", column " + currentToken.next.beginColumn;
retval += "." + eol;
if (expectedTokenSequences.length == 1) {
retval += "Was expecting:" + eol + " ";
} else {
retval += "Was expecting one of:" + eol + " ";
}
retval += expected;
retval += expected.toString();
return retval;
}
@ -182,7 +163,7 @@ public class ParseException extends Exception {
* when these raw version cannot be used as part of an ASCII
* string literal.
*/
protected String add_escapes(String str) {
static String add_escapes(String str) {
StringBuffer retval = new StringBuffer();
char ch;
for (int i = 0; i < str.length(); i++) {
@ -228,3 +209,4 @@ public class ParseException extends Exception {
}
}
/* JavaCC - OriginalChecksum=3c9f049ed2bb6ade635c5bf58a386169 (do not edit this line) */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2013, 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
@ -23,23 +23,22 @@
* questions.
*/
/*
* This source code is provided to illustrate the usage of a given feature
* or technique and has been deliberately simplified. Additional steps
* required for a production-quality application, such as security checks,
* input validation and proper error handling, might not be present in
* this sample code.
*/
/* Generated By:JavaCC: Do not edit this line. Token.java Version 0.7pre3 */
/* Generated By:JavaCC: Do not edit this line. Token.java Version 5.0 */
/* JavaCCOptions:TOKEN_EXTENDS=,KEEP_LINE_COL=null,SUPPORT_CLASS_VISIBILITY_PUBLIC=true */
package com.sun.tools.example.debug.expr;
/**
* Describes the input token stream.
*/
public class Token {
public class Token implements java.io.Serializable {
/**
* The version identifier for this Serializable class.
* Increment only if the <i>serialized</i> form of the
* class changes.
*/
private static final long serialVersionUID = 1L;
/**
* An integer that describes the kind of this token. This numbering
@ -48,12 +47,14 @@ public class Token {
*/
public int kind;
/**
* beginLine and beginColumn describe the position of the first character
* of this token; endLine and endColumn describe the position of the
* last character of this token.
*/
public int beginLine, beginColumn, endLine, endColumn;
/** The line number of the first character of this Token. */
public int beginLine;
/** The column number of the first character of this Token. */
public int beginColumn;
/** The line number of the last character of this Token. */
public int endLine;
/** The column number of the last character of this Token. */
public int endColumn;
/**
* The string image of the token.
@ -84,13 +85,46 @@ public class Token {
*/
public Token specialToken;
/**
* An optional attribute value of the Token.
* Tokens which are not used as syntactic sugar will often contain
* meaningful values that will be used later on by the compiler or
* interpreter. This attribute value is often different from the image.
* Any subclass of Token that actually wants to return a non-null value can
* override this method as appropriate.
*/
public Object getValue() {
return null;
}
/**
* No-argument constructor
*/
public Token() {}
/**
* Constructs a new token for the specified Image.
*/
public Token(int kind)
{
this(kind, null);
}
/**
* Constructs a new token for the specified Image and Kind.
*/
public Token(int kind, String image)
{
this.kind = kind;
this.image = image;
}
/**
* Returns the image.
*/
@Override
public final String toString()
public String toString()
{
return image;
return image;
}
/**
@ -98,19 +132,25 @@ public class Token {
* can create and return subclass objects based on the value of ofKind.
* Simply add the cases to the switch for all those special cases.
* For example, if you have a subclass of Token called IDToken that
* you want to create if ofKind is ID, simlpy add something like :
* you want to create if ofKind is ID, simply add something like :
*
* case MyParserConstants.ID : return new IDToken();
* case MyParserConstants.ID : return new IDToken(ofKind, image);
*
* to the following switch statement. Then you can cast matchedToken
* variable to the appropriate type and use it in your lexical actions.
* variable to the appropriate type and use sit in your lexical actions.
*/
public static final Token newToken(int ofKind)
public static Token newToken(int ofKind, String image)
{
switch(ofKind)
{
default : return new Token();
}
switch(ofKind)
{
default : return new Token(ofKind, image);
}
}
public static Token newToken(int ofKind)
{
return newToken(ofKind, null);
}
}
/* JavaCC - OriginalChecksum=1f1783cae2d4cc94bc225889842dfa8b (do not edit this line) */

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 1999, 2011, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1999, 2013, 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
@ -23,148 +23,150 @@
* questions.
*/
/*
* This source code is provided to illustrate the usage of a given feature
* or technique and has been deliberately simplified. Additional steps
* required for a production-quality application, such as security checks,
* input validation and proper error handling, might not be present in
* this sample code.
*/
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 0.7pre2 */
/* Generated By:JavaCC: Do not edit this line. TokenMgrError.java Version 5.0 */
/* JavaCCOptions: */
package com.sun.tools.example.debug.expr;
/** Token Manager Error. */
public class TokenMgrError extends Error
{
/*
* Ordinals for various reasons why an Error of this type can be thrown.
*/
private static final long serialVersionUID = -6236440836177601522L;
/**
* The version identifier for this Serializable class.
* Increment only if the <i>serialized</i> form of the
* class changes.
*/
private static final long serialVersionUID = 1L;
/**
* Lexical error occurred.
*/
static final int LEXICAL_ERROR = 0;
/*
* Ordinals for various reasons why an Error of this type can be thrown.
*/
/**
* An attempt wass made to create a second instance of a static token manager.
*/
static final int STATIC_LEXER_ERROR = 1;
/**
* Lexical error occurred.
*/
static final int LEXICAL_ERROR = 0;
/**
* Tried to change to an invalid lexical state.
*/
static final int INVALID_LEXICAL_STATE = 2;
/**
* An attempt was made to create a second instance of a static token manager.
*/
static final int STATIC_LEXER_ERROR = 1;
/**
* Detected (and bailed out of) an infinite loop in the token manager.
*/
static final int LOOP_DETECTED = 3;
/**
* Tried to change to an invalid lexical state.
*/
static final int INVALID_LEXICAL_STATE = 2;
/**
* Indicates the reason why the exception is thrown. It will have
* one of the above 4 values.
*/
int errorCode;
/**
* Detected (and bailed out of) an infinite loop in the token manager.
*/
static final int LOOP_DETECTED = 3;
/**
* Replaces unprintable characters by their espaced (or unicode escaped)
* equivalents in the given string
*/
protected static final String addEscapes(String str) {
StringBuffer retval = new StringBuffer();
char ch;
for (int i = 0; i < str.length(); i++) {
switch (str.charAt(i))
{
case 0 :
continue;
case '\b':
retval.append("\\b");
continue;
case '\t':
retval.append("\\t");
continue;
case '\n':
retval.append("\\n");
continue;
case '\f':
retval.append("\\f");
continue;
case '\r':
retval.append("\\r");
continue;
case '\"':
retval.append("\\\"");
continue;
case '\'':
retval.append("\\\'");
continue;
case '\\':
retval.append("\\\\");
continue;
default:
if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
String s = "0000" + Integer.toString(ch, 16);
retval.append("\\u" + s.substring(s.length() - 4, s.length()));
} else {
retval.append(ch);
}
continue;
}
/**
* Indicates the reason why the exception is thrown. It will have
* one of the above 4 values.
*/
int errorCode;
/**
* Replaces unprintable characters by their escaped (or unicode escaped)
* equivalents in the given string
*/
protected static final String addEscapes(String str) {
StringBuffer retval = new StringBuffer();
char ch;
for (int i = 0; i < str.length(); i++) {
switch (str.charAt(i))
{
case 0 :
continue;
case '\b':
retval.append("\\b");
continue;
case '\t':
retval.append("\\t");
continue;
case '\n':
retval.append("\\n");
continue;
case '\f':
retval.append("\\f");
continue;
case '\r':
retval.append("\\r");
continue;
case '\"':
retval.append("\\\"");
continue;
case '\'':
retval.append("\\\'");
continue;
case '\\':
retval.append("\\\\");
continue;
default:
if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
String s = "0000" + Integer.toString(ch, 16);
retval.append("\\u" + s.substring(s.length() - 4, s.length()));
} else {
retval.append(ch);
}
continue;
}
return retval.toString();
}
}
return retval.toString();
}
/**
* Returns a detailed message for the Error when it is thrown by the
* token manager to indicate a lexical error.
* Parameters :
* EOFSeen : indicates if EOF caused the lexicl error
* curLexState : lexical state in which this error occurred
* errorLine : line number when the error occurred
* errorColumn : column number when the error occurred
* errorAfter : prefix that was seen before this error occurred
* curchar : the offending character
* Note: You can customize the lexical error message by modifying this method.
*/
private static final String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
return("Lexical error at line " +
errorLine + ", column " +
errorColumn + ". Encountered: " +
(EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
"after : \"" + addEscapes(errorAfter) + "\"");
}
/**
* Returns a detailed message for the Error when it is thrown by the
* token manager to indicate a lexical error.
* Parameters :
* EOFSeen : indicates if EOF caused the lexical error
* curLexState : lexical state in which this error occurred
* errorLine : line number when the error occurred
* errorColumn : column number when the error occurred
* errorAfter : prefix that was seen before this error occurred
* curchar : the offending character
* Note: You can customize the lexical error message by modifying this method.
*/
protected static String LexicalError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar) {
return("Lexical error at line " +
errorLine + ", column " +
errorColumn + ". Encountered: " +
(EOFSeen ? "<EOF> " : ("\"" + addEscapes(String.valueOf(curChar)) + "\"") + " (" + (int)curChar + "), ") +
"after : \"" + addEscapes(errorAfter) + "\"");
}
/**
* You can also modify the body of this method to customize your error messages.
* For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
* of end-users concern, so you can return something like :
*
* "Internal Error : Please file a bug report .... "
*
* from this method for such cases in the release version of your parser.
*/
@Override
public String getMessage() {
return super.getMessage();
}
/**
* You can also modify the body of this method to customize your error messages.
* For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not
* of end-users concern, so you can return something like :
*
* "Internal Error : Please file a bug report .... "
*
* from this method for such cases in the release version of your parser.
*/
public String getMessage() {
return super.getMessage();
}
/*
* Constructors of various flavors follow.
*/
/*
* Constructors of various flavors follow.
*/
public TokenMgrError() {
}
/** No arg constructor. */
public TokenMgrError() {
}
public TokenMgrError(String message, int reason) {
super(message);
errorCode = reason;
}
/** Constructor with message and reason. */
public TokenMgrError(String message, int reason) {
super(message);
errorCode = reason;
}
public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
}
/** Full Constructor. */
public TokenMgrError(boolean EOFSeen, int lexState, int errorLine, int errorColumn, String errorAfter, char curChar, int reason) {
this(LexicalError(EOFSeen, lexState, errorLine, errorColumn, errorAfter, curChar), reason);
}
}
/* JavaCC - OriginalChecksum=9b5d040f247411cad7f77688386c48e7 (do not edit this line) */

View File

@ -31,6 +31,7 @@ import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
public class ArrayTypeImpl extends ReferenceTypeImpl
implements ArrayType
@ -61,7 +62,8 @@ public class ArrayTypeImpl extends ReferenceTypeImpl
return findType(componentSignature());
}
void addVisibleMethods(Map<String, Method> map) {
@Override
void addVisibleMethods(Map<String, Method> map, Set<InterfaceType> seenInterfaces) {
// arrays don't have methods
}

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