)env, getApplicationResources());
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java
--- a/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java Fri Dec 13 09:35:35 2013 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -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;
-
-/**
- *
- * 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 null
- * 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 messages = new ArrayList<>(3);
-
- /* Collection actions to perform if the user clicks OK */
- final List 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 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);
- }
- }
-}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/com/sun/security/sasl/Provider.java
--- a/jdk/src/share/classes/com/sun/security/sasl/Provider.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/com/sun/security/sasl/Provider.java Wed Jul 05 19:26:45 2017 +0200
@@ -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 @@
" 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() {
public Void run() {
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/com/sun/tools/example/debug/expr/Expr.jj
--- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/Expr.jj Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/Expr.jj Wed Jul 05 19:26:45 2017 +0200
@@ -539,10 +539,10 @@
}
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 UnaryExpressionNotPlusMinus() :
-{}
+{Token tok;}
{
- ( "~" | "!" ) UnaryExpression()
- { throw new ParseException("operation not yet supported"); }
+ ( tok = "~" | tok = "!" ) UnaryExpression()
+ { push( LValue.operation(vm, tok, pop(), frameGetter) ); }
|
LOOKAHEAD( CastLookahead() )
CastExpression()
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java
--- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParser.java Wed Jul 05 19:26:45 2017 +0200
@@ -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,38 +23,28 @@
* 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. ExpressionParser.java */
package com.sun.tools.example.debug.expr;
import com.sun.jdi.*;
-
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;
public class ExpressionParser implements ExpressionParserConstants {
- Stack stack = new Stack();
+ Stack stack = new Stack();
VirtualMachine vm = null;
GetFrame frameGetter = null;
private static GetFrame lastFrameGetter;
private static LValue lastLValue;
LValue peek() {
- return stack.peek();
+ return (LValue)stack.peek();
}
LValue pop() {
- return stack.pop();
+ return (LValue)stack.pop();
}
void push(LValue lval) {
@@ -62,7 +52,7 @@
}
public static Value getMassagedValue() throws ParseException {
- return lastLValue.getMassagedValue(lastFrameGetter);
+ return lastLValue.getMassagedValue(lastFrameGetter);
}
public interface GetFrame {
@@ -70,14 +60,17 @@
}
public static Value evaluate(String expr, VirtualMachine vm,
- GetFrame frameGetter) throws ParseException, InvocationException,
- InvalidTypeException, ClassNotLoadedException,
+ GetFrame frameGetter) throws ParseException,
+ InvocationException,
+ InvalidTypeException,
+ ClassNotLoadedException,
IncompatibleThreadStateException {
// TODO StringBufferInputStream is deprecated.
java.io.InputStream in = new java.io.StringBufferInputStream(expr);
ExpressionParser parser = new ExpressionParser(in);
parser.vm = vm;
parser.frameGetter = frameGetter;
+ Value value = null;
parser.Expression();
lastFrameGetter = frameGetter;
lastLValue = parser.pop();
@@ -95,8 +88,8 @@
try {
parser = new ExpressionParser(new java.io.FileInputStream(args[0]));
} catch (java.io.FileNotFoundException e) {
- System.out.println("Java Parser Version 1.0.2: File " + args[0]
- + " not found.");
+ System.out.println("Java Parser Version 1.0.2: File " +
+ args[0] + " not found.");
return;
}
} else {
@@ -143,7 +136,8 @@
jj_consume_token(-1);
throw new ParseException();
}
- label_1: while (true) {
+ label_1:
+ while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LBRACKET:
;
@@ -194,7 +188,8 @@
StringBuffer sb = new StringBuffer();
jj_consume_token(IDENTIFIER);
sb.append(token);
- label_2: while (true) {
+ label_2:
+ while (true) {
if (jj_2_1(2)) {
;
} else {
@@ -202,18 +197,16 @@
}
jj_consume_token(DOT);
jj_consume_token(IDENTIFIER);
- sb.append('.');
- sb.append(token);
- }
- if (true) {
- return sb.toString();
- }
+ sb.append('.'); sb.append(token);
+ }
+ {if (true) return sb.toString();}
throw new Error("Missing return statement in function");
}
final public void NameList() throws ParseException {
Name();
- label_3: while (true) {
+ label_3:
+ while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
@@ -267,9 +260,7 @@
PrimaryExpression();
AssignmentOperator();
Expression();
- LValue exprVal = pop();
- pop().setValue(exprVal);
- push(exprVal);
+ LValue exprVal = pop(); pop().setValue(exprVal); push(exprVal);
}
final public void AssignmentOperator() throws ParseException {
@@ -325,18 +316,13 @@
Expression();
jj_consume_token(COLON);
ConditionalExpression();
- LValue falseBranch = pop();
- LValue trueBranch = pop();
+ LValue falseBranch = pop(); LValue trueBranch = pop();
Value cond = pop().interiorGetValue();
if (cond instanceof BooleanValue) {
- push(((BooleanValue) cond).booleanValue() ? trueBranch
- : falseBranch);
+ push(((BooleanValue)cond).booleanValue()?
+ trueBranch : falseBranch);
} else {
- {
- if (true) {
- throw new ParseException("Condition must be boolean");
- }
- }
+ {if (true) throw new ParseException("Condition must be boolean");}
}
break;
default:
@@ -347,7 +333,8 @@
final public void ConditionalOrExpression() throws ParseException {
ConditionalAndExpression();
- label_4: while (true) {
+ label_4:
+ while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case SC_OR:
;
@@ -358,17 +345,14 @@
}
jj_consume_token(SC_OR);
ConditionalAndExpression();
- {
- if (true) {
- throw new ParseException("operation not yet supported");
- }
- }
+ {if (true) throw new ParseException("operation not yet supported");}
}
}
final public void ConditionalAndExpression() throws ParseException {
InclusiveOrExpression();
- label_5: while (true) {
+ label_5:
+ while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case SC_AND:
;
@@ -379,17 +363,14 @@
}
jj_consume_token(SC_AND);
InclusiveOrExpression();
- {
- if (true) {
- throw new ParseException("operation not yet supported");
- }
- }
+ {if (true) throw new ParseException("operation not yet supported");}
}
}
final public void InclusiveOrExpression() throws ParseException {
ExclusiveOrExpression();
- label_6: while (true) {
+ label_6:
+ while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case BIT_OR:
;
@@ -400,17 +381,14 @@
}
jj_consume_token(BIT_OR);
ExclusiveOrExpression();
- {
- if (true) {
- throw new ParseException("operation not yet supported");
- }
- }
+ {if (true) throw new ParseException("operation not yet supported");}
}
}
final public void ExclusiveOrExpression() throws ParseException {
AndExpression();
- label_7: while (true) {
+ label_7:
+ while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case XOR:
;
@@ -421,17 +399,14 @@
}
jj_consume_token(XOR);
AndExpression();
- {
- if (true) {
- throw new ParseException("operation not yet supported");
- }
- }
+ {if (true) throw new ParseException("operation not yet supported");}
}
}
final public void AndExpression() throws ParseException {
EqualityExpression();
- label_8: while (true) {
+ label_8:
+ while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case BIT_AND:
;
@@ -442,18 +417,15 @@
}
jj_consume_token(BIT_AND);
EqualityExpression();
- {
- if (true) {
- throw new ParseException("operation not yet supported");
- }
- }
+ {if (true) throw new ParseException("operation not yet supported");}
}
}
final public void EqualityExpression() throws ParseException {
Token tok;
InstanceOfExpression();
- label_9: while (true) {
+ label_9:
+ while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case EQ:
case NE:
@@ -487,11 +459,7 @@
case INSTANCEOF:
jj_consume_token(INSTANCEOF);
Type();
- {
- if (true) {
- throw new ParseException("operation not yet supported");
- }
- }
+ {if (true) throw new ParseException("operation not yet supported");}
break;
default:
jj_la1[14] = jj_gen;
@@ -502,7 +470,8 @@
final public void RelationalExpression() throws ParseException {
Token tok;
ShiftExpression();
- label_10: while (true) {
+ label_10:
+ while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case GT:
case LT:
@@ -540,7 +509,8 @@
final public void ShiftExpression() throws ParseException {
AdditiveExpression();
- label_11: while (true) {
+ label_11:
+ while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LSHIFT:
case RSIGNEDSHIFT:
@@ -567,18 +537,15 @@
throw new ParseException();
}
AdditiveExpression();
- {
- if (true) {
- throw new ParseException("operation not yet supported");
- }
- }
+ {if (true) throw new ParseException("operation not yet supported");}
}
}
final public void AdditiveExpression() throws ParseException {
Token tok;
MultiplicativeExpression();
- label_12: while (true) {
+ label_12:
+ while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case PLUS:
case MINUS:
@@ -609,7 +576,8 @@
final public void MultiplicativeExpression() throws ParseException {
Token tok;
UnaryExpression();
- label_13: while (true) {
+ label_13:
+ while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case STAR:
case SLASH:
@@ -642,15 +610,16 @@
}
final public void UnaryExpression() throws ParseException {
+ Token tok;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case PLUS:
case MINUS:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case PLUS:
- jj_consume_token(PLUS);
+ tok = jj_consume_token(PLUS);
break;
case MINUS:
- jj_consume_token(MINUS);
+ tok = jj_consume_token(MINUS);
break;
default:
jj_la1[23] = jj_gen;
@@ -658,11 +627,7 @@
throw new ParseException();
}
UnaryExpression();
- {
- if (true) {
- throw new ParseException("operation not yet supported");
- }
- }
+ push( LValue.operation(vm, tok, pop(), frameGetter) );
break;
case INCR:
PreIncrementExpression();
@@ -696,33 +661,26 @@
final public void PreIncrementExpression() throws ParseException {
jj_consume_token(INCR);
PrimaryExpression();
- {
- if (true) {
- throw new ParseException("operation not yet supported");
- }
- }
+ {if (true) throw new ParseException("operation not yet supported");}
}
final public void PreDecrementExpression() throws ParseException {
jj_consume_token(DECR);
PrimaryExpression();
- {
- if (true) {
- throw new ParseException("operation not yet supported");
- }
- }
+ {if (true) throw new ParseException("operation not yet supported");}
}
final public void UnaryExpressionNotPlusMinus() throws ParseException {
+ Token tok;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case BANG:
case TILDE:
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case TILDE:
- jj_consume_token(TILDE);
+ tok = jj_consume_token(TILDE);
break;
case BANG:
- jj_consume_token(BANG);
+ tok = jj_consume_token(BANG);
break;
default:
jj_la1[25] = jj_gen;
@@ -730,11 +688,7 @@
throw new ParseException();
}
UnaryExpression();
- {
- if (true) {
- throw new ParseException("operation not yet supported");
- }
- }
+ push( LValue.operation(vm, tok, pop(), frameGetter) );
break;
default:
jj_la1[26] = jj_gen;
@@ -765,10 +719,8 @@
}
}
- // This production is to determine lookahead only. The LOOKAHEAD
- // specifications
- // below are not used, but they are there just to indicate that we know
- // about
+// This production is to determine lookahead only. The LOOKAHEAD specifications
+// below are not used, but they are there just to indicate that we know about
// this.
final public void CastLookahead() throws ParseException {
if (jj_2_4(2)) {
@@ -841,11 +793,7 @@
break;
case DECR:
jj_consume_token(DECR);
- {
- if (true) {
- throw new ParseException("operation not yet supported");
- }
- }
+ {if (true) throw new ParseException("operation not yet supported");}
break;
default:
jj_la1[30] = jj_gen;
@@ -863,7 +811,8 @@
if (jj_2_6(2)) {
jj_consume_token(LPAREN);
PrimitiveType();
- label_14: while (true) {
+ label_14:
+ while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LBRACKET:
;
@@ -882,7 +831,8 @@
case LPAREN:
jj_consume_token(LPAREN);
Name();
- label_15: while (true) {
+ label_15:
+ while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LBRACKET:
;
@@ -907,7 +857,8 @@
final public void PrimaryExpression() throws ParseException {
PrimaryPrefix();
- label_16: while (true) {
+ label_16:
+ while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LPAREN:
case LBRACKET:
@@ -946,11 +897,7 @@
jj_consume_token(SUPER);
jj_consume_token(DOT);
jj_consume_token(IDENTIFIER);
- {
- if (true) {
- throw new ParseException("operation not yet supported");
- }
- }
+ {if (true) throw new ParseException("operation not yet supported");}
break;
case LPAREN:
jj_consume_token(LPAREN);
@@ -968,7 +915,7 @@
}
final public void PrimarySuffix() throws ParseException {
- List argList;
+ List argList;
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case LBRACKET:
jj_consume_token(LBRACKET);
@@ -1046,8 +993,8 @@
jj_consume_token(NULL);
}
- final public List Arguments() throws ParseException {
- List argList = new ArrayList();
+ final public List Arguments() throws ParseException {
+ List argList = new ArrayList();
jj_consume_token(LPAREN);
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case FALSE:
@@ -1075,18 +1022,15 @@
;
}
jj_consume_token(RPAREN);
- {
- if (true) {
- return argList;
- }
- }
+ {if (true) return argList;}
throw new Error("Missing return statement in function");
}
- final public void ArgumentList(List argList) throws ParseException {
+ final public void ArgumentList(List argList) throws ParseException {
Expression();
argList.add(pop().interiorGetValue());
- label_17: while (true) {
+ label_17:
+ while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case COMMA:
;
@@ -1102,8 +1046,7 @@
}
final public void AllocationExpression() throws ParseException {
- List argList;
- String className;
+ List argList; String className;
if (jj_2_7(2)) {
jj_consume_token(NEW);
PrimitiveType();
@@ -1120,11 +1063,7 @@
break;
case LBRACKET:
ArrayDimensions();
- {
- if (true) {
- throw new ParseException("operation not yet supported");
- }
- }
+ {if (true) throw new ParseException("operation not yet supported");}
break;
default:
jj_la1[42] = jj_gen;
@@ -1141,11 +1080,12 @@
}
/*
- * The second LOOKAHEAD specification below is to parse to PrimarySuffix if
- * there is an expression between the "[...]".
+ * The second LOOKAHEAD specification below is to parse to PrimarySuffix
+ * if there is an expression between the "[...]".
*/
final public void ArrayDimensions() throws ParseException {
- label_18: while (true) {
+ label_18:
+ while (true) {
jj_consume_token(LBRACKET);
Expression();
jj_consume_token(RBRACKET);
@@ -1155,7 +1095,8 @@
break label_18;
}
}
- label_19: while (true) {
+ label_19:
+ while (true) {
if (jj_2_9(2)) {
;
} else {
@@ -1166,2230 +1107,636 @@
}
}
- final private boolean jj_2_1(int xla) {
- jj_la = xla;
- jj_lastpos = jj_scanpos = token;
- boolean retval = !jj_3_1();
- jj_save(0, xla);
- return retval;
- }
-
- final private boolean jj_2_2(int xla) {
- jj_la = xla;
- jj_lastpos = jj_scanpos = token;
- boolean retval = !jj_3_2();
- jj_save(1, xla);
- return retval;
- }
-
- final private boolean jj_2_3(int xla) {
- jj_la = xla;
- jj_lastpos = jj_scanpos = token;
- boolean retval = !jj_3_3();
- jj_save(2, xla);
- return retval;
- }
-
- final private boolean jj_2_4(int xla) {
- jj_la = xla;
- jj_lastpos = jj_scanpos = token;
- boolean retval = !jj_3_4();
- jj_save(3, xla);
- return retval;
- }
-
- final private boolean jj_2_5(int xla) {
- jj_la = xla;
- jj_lastpos = jj_scanpos = token;
- boolean retval = !jj_3_5();
- jj_save(4, xla);
- return retval;
- }
-
- final private boolean jj_2_6(int xla) {
- jj_la = xla;
- jj_lastpos = jj_scanpos = token;
- boolean retval = !jj_3_6();
- jj_save(5, xla);
- return retval;
+ private boolean jj_2_1(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_1(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(0, xla); }
}
- final private boolean jj_2_7(int xla) {
- jj_la = xla;
- jj_lastpos = jj_scanpos = token;
- boolean retval = !jj_3_7();
- jj_save(6, xla);
- return retval;
- }
-
- final private boolean jj_2_8(int xla) {
- jj_la = xla;
- jj_lastpos = jj_scanpos = token;
- boolean retval = !jj_3_8();
- jj_save(7, xla);
- return retval;
- }
-
- final private boolean jj_2_9(int xla) {
- jj_la = xla;
- jj_lastpos = jj_scanpos = token;
- boolean retval = !jj_3_9();
- jj_save(8, xla);
- return retval;
+ private boolean jj_2_2(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_2(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(1, xla); }
}
- final private boolean jj_3R_154() {
- if (jj_scan_token(INCR)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
+ private boolean jj_2_3(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_3(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(2, xla); }
}
- final private boolean jj_3R_151() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_154()) {
- jj_scanpos = xsp;
- if (jj_3R_155()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
+ private boolean jj_2_4(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_4(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(3, xla); }
}
- final private boolean jj_3R_148() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3_6()) {
- jj_scanpos = xsp;
- if (jj_3R_150()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
+ private boolean jj_2_5(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_5(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(4, xla); }
+ }
+
+ private boolean jj_2_6(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_6(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(5, xla); }
}
- final private boolean jj_3_6() {
- if (jj_scan_token(LPAREN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_23()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_152()) {
- jj_scanpos = xsp;
- break;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- }
- if (jj_scan_token(RPAREN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_115()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
+ private boolean jj_2_7(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_7(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(6, xla); }
}
- final private boolean jj_3R_25() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_50()) {
- jj_scanpos = xsp;
- if (jj_3R_51()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
+ private boolean jj_2_8(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_8(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(7, xla); }
}
- final private boolean jj_3R_50() {
- if (jj_3R_67()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
+ private boolean jj_2_9(int xla) {
+ jj_la = xla; jj_lastpos = jj_scanpos = token;
+ try { return !jj_3_9(); }
+ catch(LookaheadSuccess ls) { return true; }
+ finally { jj_save(8, xla); }
}
- final private boolean jj_3_5() {
- if (jj_scan_token(LPAREN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_24()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_scan_token(LBRACKET)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_94() {
+ if (jj_scan_token(DECR)) return true;
+ if (jj_3R_20()) return true;
return false;
}
- final private boolean jj_3R_149() {
- if (jj_3R_20()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_151()) {
- jj_scanpos = xsp;
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_86() {
+ if (jj_3R_24()) return true;
return false;
}
- final private boolean jj_3R_41() {
- if (jj_scan_token(LPAREN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_24()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_scan_token(RPAREN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_59()) {
- jj_scanpos = xsp;
- if (jj_3R_60()) {
- jj_scanpos = xsp;
- if (jj_3R_61()) {
- jj_scanpos = xsp;
- if (jj_3R_62()) {
- jj_scanpos = xsp;
- if (jj_3R_63()) {
- jj_scanpos = xsp;
- if (jj_3R_64()) {
- jj_scanpos = xsp;
- if (jj_3R_65()) {
- jj_scanpos = xsp;
- if (jj_3R_66()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_93() {
+ if (jj_scan_token(INCR)) return true;
+ if (jj_3R_20()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_91() {
+ if (jj_3R_95()) return true;
return false;
}
- final private boolean jj_3R_40() {
- if (jj_scan_token(LPAREN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_24()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_scan_token(LBRACKET)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_scan_token(RBRACKET)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_123() {
- if (jj_scan_token(LBRACKET)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_scan_token(RBRACKET)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3_1() {
- if (jj_scan_token(DOT)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_scan_token(IDENTIFIER)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3_4() {
- if (jj_scan_token(LPAREN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_23()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_22() {
+ private boolean jj_3R_23() {
Token xsp;
xsp = jj_scanpos;
- if (jj_3_4()) {
+ if (jj_scan_token(10)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(15)) {
jj_scanpos = xsp;
- if (jj_3R_40()) {
+ if (jj_scan_token(12)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(45)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(34)) {
jj_scanpos = xsp;
- if (jj_3R_41()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3_3() {
- if (jj_3R_22()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_24() {
- if (jj_scan_token(IDENTIFIER)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3_1()) {
- jj_scanpos = xsp;
- break;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ if (jj_scan_token(36)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(27)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(21)) return true;
+ }
+ }
+ }
+ }
+ }
+ }
}
return false;
}
- final private boolean jj_3R_147() {
- if (jj_scan_token(BANG)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_142() {
- if (jj_3R_149()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_122() {
- if (jj_3R_24()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_90() {
+ if (jj_3R_94()) return true;
return false;
}
- final private boolean jj_3R_49() {
- if (jj_scan_token(DOUBLE)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_141() {
- if (jj_3R_148()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_48() {
- if (jj_scan_token(FLOAT)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_146() {
- if (jj_scan_token(TILDE)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_89() {
+ if (jj_3R_93()) return true;
return false;
}
- final private boolean jj_3R_47() {
- if (jj_scan_token(LONG)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_140() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_146()) {
- jj_scanpos = xsp;
- if (jj_3R_147()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_115()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_85() {
+ if (jj_3R_23()) return true;
return false;
}
- final private boolean jj_3R_136() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_140()) {
- jj_scanpos = xsp;
- if (jj_3R_141()) {
- jj_scanpos = xsp;
- if (jj_3R_142()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_60() {
+ if (jj_3R_58()) return true;
return false;
}
- final private boolean jj_3R_46() {
- if (jj_scan_token(INT)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_145() {
- if (jj_scan_token(REM)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_45() {
- if (jj_scan_token(SHORT)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_88() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_scan_token(94)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(95)) return true;
+ }
+ if (jj_3R_83()) return true;
return false;
}
- final private boolean jj_3R_44() {
- if (jj_scan_token(BYTE)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_135() {
- if (jj_scan_token(DECR)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_20()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_43() {
- if (jj_scan_token(CHAR)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_23() {
+ private boolean jj_3R_83() {
Token xsp;
xsp = jj_scanpos;
- if (jj_3R_42()) {
- jj_scanpos = xsp;
- if (jj_3R_43()) {
- jj_scanpos = xsp;
- if (jj_3R_44()) {
+ if (jj_3R_88()) {
jj_scanpos = xsp;
- if (jj_3R_45()) {
- jj_scanpos = xsp;
- if (jj_3R_46()) {
- jj_scanpos = xsp;
- if (jj_3R_47()) {
- jj_scanpos = xsp;
- if (jj_3R_48()) {
+ if (jj_3R_89()) {
jj_scanpos = xsp;
- if (jj_3R_49()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ if (jj_3R_90()) {
+ jj_scanpos = xsp;
+ if (jj_3R_91()) return true;
+ }
+ }
+ }
return false;
}
- final private boolean jj_3R_42() {
- if (jj_scan_token(BOOLEAN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_82() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_85()) {
+ jj_scanpos = xsp;
+ if (jj_3R_86()) return true;
+ }
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_87()) { jj_scanpos = xsp; break; }
+ }
return false;
}
- final private boolean jj_3_9() {
- if (jj_scan_token(LBRACKET)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_scan_token(RBRACKET)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_121() {
- if (jj_3R_23()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_59() {
+ if (jj_3R_55()) return true;
return false;
}
- final private boolean jj_3R_144() {
- if (jj_scan_token(SLASH)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_96() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_scan_token(96)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(97)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(101)) return true;
+ }
+ }
+ if (jj_3R_83()) return true;
return false;
}
- final private boolean jj_3R_134() {
- if (jj_scan_token(INCR)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_20()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_114() {
+ private boolean jj_3R_80() {
+ if (jj_3R_83()) return true;
Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_121()) {
- jj_scanpos = xsp;
- if (jj_3R_122()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
while (true) {
xsp = jj_scanpos;
- if (jj_3R_123()) {
- jj_scanpos = xsp;
- break;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ if (jj_3R_96()) { jj_scanpos = xsp; break; }
}
return false;
}
- final private boolean jj_3R_120() {
- if (jj_scan_token(GE)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_133() {
- if (jj_scan_token(MINUS)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_127() {
- if (jj_3R_136()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_126() {
- if (jj_3R_135()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_139() {
- if (jj_scan_token(MINUS)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_125() {
- if (jj_3R_134()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_132() {
- if (jj_scan_token(PLUS)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_143() {
- if (jj_scan_token(STAR)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_124() {
+ private boolean jj_3R_92() {
Token xsp;
xsp = jj_scanpos;
- if (jj_3R_132()) {
+ if (jj_scan_token(94)) {
jj_scanpos = xsp;
- if (jj_3R_133()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_115()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ if (jj_scan_token(95)) return true;
+ }
+ if (jj_3R_80()) return true;
return false;
}
- final private boolean jj_3R_115() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_124()) {
- jj_scanpos = xsp;
- if (jj_3R_125()) {
- jj_scanpos = xsp;
- if (jj_3R_126()) {
- jj_scanpos = xsp;
- if (jj_3R_127()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3_8() {
+ if (jj_scan_token(LBRACKET)) return true;
+ if (jj_3R_25()) return true;
+ if (jj_scan_token(RBRACKET)) return true;
return false;
}
- final private boolean jj_3R_137() {
+ private boolean jj_3R_58() {
Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_143()) {
- jj_scanpos = xsp;
- if (jj_3R_144()) {
- jj_scanpos = xsp;
- if (jj_3R_145()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_115()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_131() {
- if (jj_scan_token(RUNSIGNEDSHIFT)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_119() {
- if (jj_scan_token(LE)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_138() {
- if (jj_scan_token(PLUS)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_112() {
- if (jj_3R_115()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- Token xsp;
+ if (jj_3_8()) return true;
while (true) {
xsp = jj_scanpos;
- if (jj_3R_137()) {
- jj_scanpos = xsp;
- break;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ if (jj_3_8()) { jj_scanpos = xsp; break; }
+ }
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3_9()) { jj_scanpos = xsp; break; }
}
return false;
}
- final private boolean jj_3R_88() {
- if (jj_3R_86()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_130() {
- if (jj_scan_token(RSIGNEDSHIFT)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_84() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_scan_token(102)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(103)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(104)) return true;
+ }
+ }
+ if (jj_3R_78()) return true;
return false;
}
- final private boolean jj_3R_128() {
+ private boolean jj_3R_78() {
+ if (jj_3R_80()) return true;
Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_138()) {
- jj_scanpos = xsp;
- if (jj_3R_139()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_112()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_87() {
- if (jj_3R_82()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_92()) { jj_scanpos = xsp; break; }
+ }
return false;
}
- final private boolean jj_3R_118() {
- if (jj_scan_token(GT)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_54() {
+ if (jj_scan_token(NEW)) return true;
+ if (jj_3R_24()) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_59()) {
+ jj_scanpos = xsp;
+ if (jj_3R_60()) return true;
+ }
return false;
}
- final private boolean jj_3R_129() {
- if (jj_scan_token(LSHIFT)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_76() {
+ if (jj_3R_78()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_84()) { jj_scanpos = xsp; break; }
+ }
return false;
}
- final private boolean jj_3R_116() {
+ private boolean jj_3R_81() {
Token xsp;
xsp = jj_scanpos;
- if (jj_3R_129()) {
+ if (jj_scan_token(81)) {
jj_scanpos = xsp;
- if (jj_3R_130()) {
+ if (jj_scan_token(80)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(87)) {
jj_scanpos = xsp;
- if (jj_3R_131()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_108()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ if (jj_scan_token(88)) return true;
+ }
+ }
+ }
+ if (jj_3R_76()) return true;
return false;
}
- final private boolean jj_3R_108() {
- if (jj_3R_112()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_43() {
Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_128()) {
- jj_scanpos = xsp;
- break;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ xsp = jj_scanpos;
+ if (jj_3_7()) {
+ jj_scanpos = xsp;
+ if (jj_3R_54()) return true;
}
return false;
}
- final private boolean jj_3_8() {
- if (jj_scan_token(LBRACKET)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_25()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_scan_token(RBRACKET)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3_7() {
+ if (jj_scan_token(NEW)) return true;
+ if (jj_3R_23()) return true;
+ if (jj_3R_58()) return true;
return false;
}
- final private boolean jj_3R_86() {
+ private boolean jj_3R_67() {
+ if (jj_scan_token(COMMA)) return true;
+ if (jj_3R_25()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_64() {
+ if (jj_3R_25()) return true;
Token xsp;
- if (jj_3_8()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
while (true) {
xsp = jj_scanpos;
- if (jj_3_8()) {
- jj_scanpos = xsp;
- break;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- }
- while (true) {
- xsp = jj_scanpos;
- if (jj_3_9()) {
- jj_scanpos = xsp;
- break;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ if (jj_3R_67()) { jj_scanpos = xsp; break; }
}
return false;
}
- final private boolean jj_3R_117() {
- if (jj_scan_token(LT)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_106() {
- if (jj_3R_108()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_116()) {
- jj_scanpos = xsp;
- break;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- }
+ private boolean jj_3R_61() {
+ if (jj_3R_64()) return true;
return false;
}
- final private boolean jj_3R_113() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_117()) {
- jj_scanpos = xsp;
- if (jj_3R_118()) {
- jj_scanpos = xsp;
- if (jj_3R_119()) {
- jj_scanpos = xsp;
- if (jj_3R_120()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_106()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_79() {
+ if (jj_scan_token(INSTANCEOF)) return true;
+ if (jj_3R_82()) return true;
return false;
}
- final private boolean jj_3R_111() {
- if (jj_scan_token(NE)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_109() {
- if (jj_scan_token(INSTANCEOF)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_114()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_104() {
- if (jj_3R_106()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_74() {
+ if (jj_3R_76()) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
- if (jj_3R_113()) {
- jj_scanpos = xsp;
- break;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ if (jj_3R_81()) { jj_scanpos = xsp; break; }
}
return false;
}
- final private boolean jj_3R_81() {
- if (jj_scan_token(NEW)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_24()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_55() {
+ if (jj_scan_token(LPAREN)) return true;
Token xsp;
xsp = jj_scanpos;
- if (jj_3R_87()) {
- jj_scanpos = xsp;
- if (jj_3R_88()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ if (jj_3R_61()) jj_scanpos = xsp;
+ if (jj_scan_token(RPAREN)) return true;
return false;
}
- final private boolean jj_3_7() {
- if (jj_scan_token(NEW)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_23()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_86()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_70() {
+ private boolean jj_3R_72() {
+ if (jj_3R_74()) return true;
Token xsp;
xsp = jj_scanpos;
- if (jj_3_7()) {
- jj_scanpos = xsp;
- if (jj_3R_81()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ if (jj_3R_79()) jj_scanpos = xsp;
return false;
}
- final private boolean jj_3R_97() {
- if (jj_scan_token(COMMA)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_25()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_39() {
- if (jj_scan_token(ORASSIGN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_110() {
- if (jj_scan_token(EQ)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_77() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_scan_token(86)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(89)) return true;
+ }
+ if (jj_3R_72()) return true;
return false;
}
- final private boolean jj_3R_102() {
- if (jj_3R_104()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_109()) {
- jj_scanpos = xsp;
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_75() {
+ if (jj_scan_token(BIT_AND)) return true;
+ if (jj_3R_70()) return true;
return false;
}
- final private boolean jj_3R_107() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_110()) {
- jj_scanpos = xsp;
- if (jj_3R_111()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_102()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_94() {
- if (jj_3R_25()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_70() {
+ if (jj_3R_72()) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
- if (jj_3R_97()) {
- jj_scanpos = xsp;
- break;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ if (jj_3R_77()) { jj_scanpos = xsp; break; }
}
return false;
}
- final private boolean jj_3R_89() {
- if (jj_3R_94()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_38() {
- if (jj_scan_token(XORASSIGN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_82() {
- if (jj_scan_token(LPAREN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_57() {
Token xsp;
xsp = jj_scanpos;
- if (jj_3R_89()) {
- jj_scanpos = xsp;
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_scan_token(RPAREN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_105() {
- if (jj_scan_token(BIT_AND)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_100()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_100() {
- if (jj_3R_102()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_107()) {
- jj_scanpos = xsp;
- break;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ if (jj_scan_token(54)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(24)) return true;
}
return false;
}
- final private boolean jj_3R_37() {
- if (jj_scan_token(ANDASSIGN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_85() {
- if (jj_scan_token(NULL)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_53() {
+ if (jj_scan_token(39)) return true;
return false;
}
- final private boolean jj_3R_103() {
- if (jj_scan_token(XOR)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_98()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_39() {
+ if (jj_3R_42()) return true;
return false;
}
- final private boolean jj_3R_98() {
- if (jj_3R_100()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_68() {
+ if (jj_3R_70()) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
- if (jj_3R_105()) {
- jj_scanpos = xsp;
- break;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ if (jj_3R_75()) { jj_scanpos = xsp; break; }
}
return false;
}
- final private boolean jj_3R_92() {
- if (jj_scan_token(FALSE)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_73() {
+ if (jj_scan_token(XOR)) return true;
+ if (jj_3R_68()) return true;
return false;
}
- final private boolean jj_3R_36() {
- if (jj_scan_token(RUNSIGNEDSHIFTASSIGN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_91() {
- if (jj_scan_token(TRUE)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_52() {
+ if (jj_3R_57()) return true;
return false;
}
- final private boolean jj_3R_84() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_91()) {
- jj_scanpos = xsp;
- if (jj_3R_92()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_51() {
+ if (jj_scan_token(STRING_LITERAL)) return true;
return false;
}
- final private boolean jj_3R_101() {
- if (jj_scan_token(BIT_OR)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_95()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_50() {
+ if (jj_scan_token(CHARACTER_LITERAL)) return true;
return false;
}
- final private boolean jj_3R_95() {
- if (jj_3R_98()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_65() {
+ if (jj_3R_68()) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
- if (jj_3R_103()) {
- jj_scanpos = xsp;
- break;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ if (jj_3R_73()) { jj_scanpos = xsp; break; }
}
return false;
}
- final private boolean jj_3R_35() {
- if (jj_scan_token(RSIGNEDSHIFTASSIGN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_71() {
+ if (jj_scan_token(BIT_OR)) return true;
+ if (jj_3R_65()) return true;
return false;
}
- final private boolean jj_3R_80() {
- if (jj_3R_85()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_66() {
- if (jj_3R_69()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_79() {
- if (jj_3R_84()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_49() {
+ if (jj_scan_token(FLOATING_POINT_LITERAL)) return true;
return false;
}
- final private boolean jj_3R_78() {
- if (jj_scan_token(STRING_LITERAL)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_99() {
- if (jj_scan_token(SC_AND)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_90()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_90() {
- if (jj_3R_95()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_42() {
Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_101()) {
- jj_scanpos = xsp;
- break;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ xsp = jj_scanpos;
+ if (jj_3R_48()) {
+ jj_scanpos = xsp;
+ if (jj_3R_49()) {
+ jj_scanpos = xsp;
+ if (jj_3R_50()) {
+ jj_scanpos = xsp;
+ if (jj_3R_51()) {
+ jj_scanpos = xsp;
+ if (jj_3R_52()) {
+ jj_scanpos = xsp;
+ if (jj_3R_53()) return true;
+ }
+ }
+ }
+ }
}
return false;
}
- final private boolean jj_3R_34() {
- if (jj_scan_token(LSHIFTASSIGN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_65() {
- if (jj_scan_token(NEW)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_77() {
- if (jj_scan_token(CHARACTER_LITERAL)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_76() {
- if (jj_scan_token(FLOATING_POINT_LITERAL)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_33() {
- if (jj_scan_token(MINUSASSIGN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_48() {
+ if (jj_scan_token(INTEGER_LITERAL)) return true;
return false;
}
- final private boolean jj_3R_69() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_75()) {
- jj_scanpos = xsp;
- if (jj_3R_76()) {
- jj_scanpos = xsp;
- if (jj_3R_77()) {
- jj_scanpos = xsp;
- if (jj_3R_78()) {
- jj_scanpos = xsp;
- if (jj_3R_79()) {
- jj_scanpos = xsp;
- if (jj_3R_80()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_75() {
- if (jj_scan_token(INTEGER_LITERAL)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_96() {
- if (jj_scan_token(SC_OR)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_83()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_83() {
- if (jj_3R_90()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_62() {
+ if (jj_3R_65()) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
- if (jj_3R_99()) {
- jj_scanpos = xsp;
- break;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ if (jj_3R_71()) { jj_scanpos = xsp; break; }
}
return false;
}
- final private boolean jj_3R_64() {
- if (jj_scan_token(SUPER)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_69() {
+ if (jj_scan_token(SC_AND)) return true;
+ if (jj_3R_62()) return true;
return false;
}
- final private boolean jj_3R_32() {
- if (jj_scan_token(PLUSASSIGN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_73() {
- if (jj_3R_82()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_46() {
+ if (jj_3R_55()) return true;
return false;
}
- final private boolean jj_3R_72() {
- if (jj_scan_token(DOT)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_scan_token(IDENTIFIER)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_45() {
+ if (jj_scan_token(DOT)) return true;
+ if (jj_scan_token(IDENTIFIER)) return true;
return false;
}
- final private boolean jj_3R_74() {
- if (jj_3R_83()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_56() {
+ if (jj_3R_62()) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
- if (jj_3R_96()) {
- jj_scanpos = xsp;
- break;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ if (jj_3R_69()) { jj_scanpos = xsp; break; }
}
return false;
}
- final private boolean jj_3R_63() {
- if (jj_scan_token(THIS)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_31() {
- if (jj_scan_token(REMASSIGN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_66() {
+ if (jj_scan_token(SC_OR)) return true;
+ if (jj_3R_56()) return true;
return false;
}
- final private boolean jj_3R_58() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_71()) {
- jj_scanpos = xsp;
- if (jj_3R_72()) {
- jj_scanpos = xsp;
- if (jj_3R_73()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_71() {
- if (jj_scan_token(LBRACKET)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_25()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_scan_token(RBRACKET)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_44() {
+ if (jj_scan_token(LBRACKET)) return true;
+ if (jj_3R_25()) return true;
+ if (jj_scan_token(RBRACKET)) return true;
return false;
}
- final private boolean jj_3R_93() {
- if (jj_scan_token(HOOK)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_25()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_scan_token(COLON)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_68()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_57() {
- if (jj_3R_70()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_38() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_44()) {
+ jj_scanpos = xsp;
+ if (jj_3R_45()) {
+ jj_scanpos = xsp;
+ if (jj_3R_46()) return true;
+ }
+ }
return false;
}
- final private boolean jj_3R_30() {
- if (jj_scan_token(SLASHASSIGN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_27() {
- if (jj_3R_58()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_37() {
+ if (jj_3R_43()) return true;
return false;
}
- final private boolean jj_3R_56() {
- if (jj_scan_token(LPAREN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_25()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_scan_token(RPAREN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_27() {
+ if (jj_3R_38()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_36() {
+ if (jj_scan_token(LPAREN)) return true;
+ if (jj_3R_25()) return true;
+ if (jj_scan_token(RPAREN)) return true;
return false;
}
- final private boolean jj_3R_152() {
- if (jj_scan_token(LBRACKET)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_scan_token(RBRACKET)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_55() {
- if (jj_scan_token(SUPER)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_scan_token(DOT)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_scan_token(IDENTIFIER)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_47() {
+ if (jj_3R_56()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_66()) { jj_scanpos = xsp; break; }
+ }
return false;
}
- final private boolean jj_3R_29() {
- if (jj_scan_token(STARASSIGN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_104() {
+ if (jj_scan_token(LBRACKET)) return true;
+ if (jj_scan_token(RBRACKET)) return true;
return false;
}
- final private boolean jj_3R_68() {
- if (jj_3R_74()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_93()) {
- jj_scanpos = xsp;
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_35() {
+ if (jj_scan_token(SUPER)) return true;
+ if (jj_scan_token(DOT)) return true;
+ if (jj_scan_token(IDENTIFIER)) return true;
return false;
}
- final private boolean jj_3R_54() {
- if (jj_scan_token(THIS)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_62() {
- if (jj_scan_token(IDENTIFIER)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_34() {
+ if (jj_scan_token(THIS)) return true;
return false;
}
- final private boolean jj_3R_53() {
- if (jj_3R_24()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_63() {
+ if (jj_scan_token(HOOK)) return true;
+ if (jj_3R_25()) return true;
+ if (jj_scan_token(COLON)) return true;
+ if (jj_3R_41()) return true;
return false;
}
- final private boolean jj_3R_153() {
- if (jj_scan_token(LBRACKET)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_scan_token(RBRACKET)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_33() {
+ if (jj_3R_24()) return true;
return false;
}
- final private boolean jj_3R_26() {
- Token xsp;
- xsp = jj_scanpos;
- if (jj_3R_52()) {
- jj_scanpos = xsp;
- if (jj_3R_53()) {
- jj_scanpos = xsp;
- if (jj_3R_54()) {
- jj_scanpos = xsp;
- if (jj_3R_55()) {
- jj_scanpos = xsp;
- if (jj_3R_56()) {
- jj_scanpos = xsp;
- if (jj_3R_57()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_105() {
+ if (jj_scan_token(LBRACKET)) return true;
+ if (jj_scan_token(RBRACKET)) return true;
return false;
}
- final private boolean jj_3R_52() {
- if (jj_3R_69()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_32() {
+ if (jj_3R_42()) return true;
return false;
}
- final private boolean jj_3R_21() {
+ private boolean jj_3R_26() {
Token xsp;
xsp = jj_scanpos;
- if (jj_3R_28()) {
- jj_scanpos = xsp;
- if (jj_3R_29()) {
- jj_scanpos = xsp;
- if (jj_3R_30()) {
- jj_scanpos = xsp;
- if (jj_3R_31()) {
- jj_scanpos = xsp;
if (jj_3R_32()) {
jj_scanpos = xsp;
if (jj_3R_33()) {
@@ -3400,318 +1747,420 @@
jj_scanpos = xsp;
if (jj_3R_36()) {
jj_scanpos = xsp;
- if (jj_3R_37()) {
- jj_scanpos = xsp;
- if (jj_3R_38()) {
- jj_scanpos = xsp;
- if (jj_3R_39()) {
- return true;
- }
- if (jj_la == 0
- && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0
- && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0
- && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- } else if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ if (jj_3R_37()) return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ private boolean jj_3R_20() {
+ if (jj_3R_26()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_27()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
+ private boolean jj_3R_41() {
+ if (jj_3R_47()) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_63()) jj_scanpos = xsp;
+ return false;
+ }
+
+ private boolean jj_3R_106() {
+ if (jj_scan_token(DECR)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_102() {
+ if (jj_scan_token(LPAREN)) return true;
+ if (jj_3R_24()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_105()) { jj_scanpos = xsp; break; }
+ }
+ if (jj_scan_token(RPAREN)) return true;
+ if (jj_3R_95()) return true;
return false;
}
- final private boolean jj_3R_28() {
- if (jj_scan_token(ASSIGN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_21() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_scan_token(79)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(107)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(108)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(112)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(105)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(106)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(113)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(114)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(115)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(109)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(111)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(110)) return true;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
return false;
}
- final private boolean jj_3R_61() {
- if (jj_scan_token(LPAREN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_103() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_scan_token(92)) {
+ jj_scanpos = xsp;
+ if (jj_3R_106()) return true;
+ }
return false;
}
- final private boolean jj_3_2() {
- if (jj_3R_20()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_21()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_100() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_6()) {
+ jj_scanpos = xsp;
+ if (jj_3R_102()) return true;
+ }
+ return false;
+ }
+
+ private boolean jj_3_6() {
+ if (jj_scan_token(LPAREN)) return true;
+ if (jj_3R_23()) return true;
+ Token xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_104()) { jj_scanpos = xsp; break; }
+ }
+ if (jj_scan_token(RPAREN)) return true;
+ if (jj_3R_83()) return true;
+ return false;
+ }
+
+ private boolean jj_3_2() {
+ if (jj_3R_20()) return true;
+ if (jj_3R_21()) return true;
return false;
}
- final private boolean jj_3R_20() {
- if (jj_3R_26()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_40() {
+ if (jj_3R_20()) return true;
+ if (jj_3R_21()) return true;
+ if (jj_3R_25()) return true;
+ return false;
+ }
+
+ private boolean jj_3_5() {
+ if (jj_scan_token(LPAREN)) return true;
+ if (jj_3R_24()) return true;
+ if (jj_scan_token(LBRACKET)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_101() {
+ if (jj_3R_20()) return true;
Token xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_27()) {
- jj_scanpos = xsp;
- break;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ xsp = jj_scanpos;
+ if (jj_3R_103()) jj_scanpos = xsp;
+ return false;
+ }
+
+ private boolean jj_3R_31() {
+ if (jj_3R_41()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_30() {
+ if (jj_3R_40()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_25() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_30()) {
+ jj_scanpos = xsp;
+ if (jj_3R_31()) return true;
}
return false;
}
- final private boolean jj_3R_60() {
- if (jj_scan_token(BANG)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_29() {
+ if (jj_scan_token(LPAREN)) return true;
+ if (jj_3R_24()) return true;
+ if (jj_scan_token(RPAREN)) return true;
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_scan_token(83)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(82)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(70)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(67)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(50)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(47)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(38)) {
+ jj_scanpos = xsp;
+ if (jj_3R_39()) return true;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
return false;
}
- final private boolean jj_3R_155() {
- if (jj_scan_token(DECR)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3R_28() {
+ if (jj_scan_token(LPAREN)) return true;
+ if (jj_3R_24()) return true;
+ if (jj_scan_token(LBRACKET)) return true;
+ if (jj_scan_token(RBRACKET)) return true;
+ return false;
+ }
+
+ private boolean jj_3_4() {
+ if (jj_scan_token(LPAREN)) return true;
+ if (jj_3R_23()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_22() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3_4()) {
+ jj_scanpos = xsp;
+ if (jj_3R_28()) {
+ jj_scanpos = xsp;
+ if (jj_3R_29()) return true;
+ }
+ }
return false;
}
- final private boolean jj_3R_67() {
- if (jj_3R_20()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_21()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_25()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3_3() {
+ if (jj_3R_22()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_99() {
+ if (jj_3R_101()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_87() {
+ if (jj_scan_token(LBRACKET)) return true;
+ if (jj_scan_token(RBRACKET)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_98() {
+ if (jj_3R_100()) return true;
+ return false;
+ }
+
+ private boolean jj_3_1() {
+ if (jj_scan_token(DOT)) return true;
+ if (jj_scan_token(IDENTIFIER)) return true;
return false;
}
- final private boolean jj_3R_150() {
- if (jj_scan_token(LPAREN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_24()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ private boolean jj_3_9() {
+ if (jj_scan_token(LBRACKET)) return true;
+ if (jj_scan_token(RBRACKET)) return true;
+ return false;
+ }
+
+ private boolean jj_3R_97() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_scan_token(83)) {
+ jj_scanpos = xsp;
+ if (jj_scan_token(82)) return true;
+ }
+ if (jj_3R_83()) return true;
+ return false;
+ }
+
+ private boolean jj_3R_95() {
+ Token xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_97()) {
+ jj_scanpos = xsp;
+ if (jj_3R_98()) {
+ jj_scanpos = xsp;
+ if (jj_3R_99()) return true;
+ }
+ }
+ return false;
+ }
+
+ private boolean jj_3R_24() {
+ if (jj_scan_token(IDENTIFIER)) return true;
Token xsp;
while (true) {
xsp = jj_scanpos;
- if (jj_3R_153()) {
- jj_scanpos = xsp;
- break;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- }
- if (jj_scan_token(RPAREN)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- if (jj_3R_136()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
- final private boolean jj_3R_59() {
- if (jj_scan_token(TILDE)) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
+ if (jj_3_1()) { jj_scanpos = xsp; break; }
+ }
return false;
}
- final private boolean jj_3R_51() {
- if (jj_3R_68()) {
- return true;
- }
- if (jj_la == 0 && jj_scanpos == jj_lastpos) {
- return false;
- }
- return false;
- }
-
+ /** Generated Token Manager. */
public ExpressionParserTokenManager token_source;
- ASCII_UCodeESC_CharStream jj_input_stream;
- public Token token, jj_nt;
+ JavaCharStream jj_input_stream;
+ /** Current token. */
+ public Token token;
+ /** Next token. */
+ public Token jj_nt;
private int jj_ntk;
private Token jj_scanpos, jj_lastpos;
private int jj_la;
- public boolean lookingAhead = false;
private int jj_gen;
final private int[] jj_la1 = new int[44];
- final private int[] jj_la1_0 = { 0x8209400, 0x0, 0x8209400, 0x0, 0x1000000,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x1000000, 0x0, 0x0, 0x1000000, 0x1000000,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1000000, 0x0, 0x1000000,
- 0x1000000, 0x1000000, 0x0, 0x0, 0x0, };
- final private int[] jj_la1_1 = { 0x2014, 0x0, 0x2014, 0x0, 0x884480c0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x884480c0, 0x0, 0x0, 0x884480c0, 0x884480c0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x884480c0, 0x0, 0x88400080, 0x400000,
- 0x884480c0, 0x0, 0x0, 0x40, };
- final private int[] jj_la1_2 = { 0x8, 0x400, 0x0, 0x2000, 0xf00c004e,
- 0x8000, 0x100000, 0x4000000, 0x8000000, 0x0, 0x0, 0x0, 0x2400000,
- 0x2400000, 0x0, 0x1830000, 0x1830000, 0x0, 0x0, 0xc0000000,
- 0xc0000000, 0x0, 0x0, 0xc0000000, 0xf00c004e, 0xc0000, 0xc0000, 0x4e,
- 0xc004e, 0x40, 0x30000000, 0x30000000, 0x400, 0x400, 0x40, 0x4440,
- 0x4e, 0x4440, 0x6, 0x0, 0xf00c004e, 0x2000, 0x440, 0x0, };
- final private int[] jj_la1_3 = { 0x0, 0x0, 0x0, 0x0, 0x0, 0xffe00, 0x0, 0x0,
- 0x0, 0x8, 0x10, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1c0, 0x1c0, 0x0, 0x0,
- 0x23, 0x23, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, };
- final private JJExpressionParserCalls[] jj_2_rtns = new JJExpressionParserCalls[9];
+ static private int[] jj_la1_0;
+ static private int[] jj_la1_1;
+ static private int[] jj_la1_2;
+ static private int[] jj_la1_3;
+ static {
+ jj_la1_init_0();
+ jj_la1_init_1();
+ jj_la1_init_2();
+ jj_la1_init_3();
+ }
+ private static void jj_la1_init_0() {
+ jj_la1_0 = new int[] {0x8209400,0x0,0x8209400,0x0,0x1000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000000,0x0,0x0,0x1000000,0x1000000,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x1000000,0x0,0x1000000,0x1000000,0x1000000,0x0,0x0,0x0,};
+ }
+ private static void jj_la1_init_1() {
+ jj_la1_1 = new int[] {0x2014,0x0,0x2014,0x0,0x884480c0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x884480c0,0x0,0x0,0x884480c0,0x884480c0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x884480c0,0x0,0x88400080,0x400000,0x884480c0,0x0,0x0,0x40,};
+ }
+ private static void jj_la1_init_2() {
+ jj_la1_2 = new int[] {0x8,0x400,0x0,0x2000,0xf00c004e,0x8000,0x100000,0x4000000,0x8000000,0x0,0x0,0x0,0x2400000,0x2400000,0x0,0x1830000,0x1830000,0x0,0x0,0xc0000000,0xc0000000,0x0,0x0,0xc0000000,0xf00c004e,0xc0000,0xc0000,0x4e,0xc004e,0x40,0x30000000,0x30000000,0x400,0x400,0x40,0x4440,0x4e,0x4440,0x6,0x0,0xf00c004e,0x2000,0x440,0x0,};
+ }
+ private static void jj_la1_init_3() {
+ jj_la1_3 = new int[] {0x0,0x0,0x0,0x0,0x0,0xffe00,0x0,0x0,0x0,0x8,0x10,0x4,0x0,0x0,0x0,0x0,0x0,0x1c0,0x1c0,0x0,0x0,0x23,0x23,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,};
+ }
+ final private JJCalls[] jj_2_rtns = new JJCalls[9];
private boolean jj_rescan = false;
private int jj_gc = 0;
+ /** Constructor with InputStream. */
public ExpressionParser(java.io.InputStream stream) {
- jj_input_stream = new ASCII_UCodeESC_CharStream(stream, 1, 1);
+ this(stream, null);
+ }
+ /** Constructor with InputStream and supplied encoding */
+ public ExpressionParser(java.io.InputStream stream, String encoding) {
+ try { jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
token_source = new ExpressionParserTokenManager(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
- for (int i = 0; i < 44; i++) {
- jj_la1[i] = -1;
- }
- for (int i = 0; i < jj_2_rtns.length; i++) {
- jj_2_rtns[i] = new JJExpressionParserCalls();
- }
+ for (int i = 0; i < 44; i++) jj_la1[i] = -1;
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
+ /** Reinitialise. */
public void ReInit(java.io.InputStream stream) {
+ ReInit(stream, null);
+ }
+ /** Reinitialise. */
+ public void ReInit(java.io.InputStream stream, String encoding) {
+ try { jj_input_stream.ReInit(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }
+ token_source.ReInit(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 44; i++) jj_la1[i] = -1;
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
+ }
+
+ /** Constructor. */
+ public ExpressionParser(java.io.Reader stream) {
+ jj_input_stream = new JavaCharStream(stream, 1, 1);
+ token_source = new ExpressionParserTokenManager(jj_input_stream);
+ token = new Token();
+ jj_ntk = -1;
+ jj_gen = 0;
+ for (int i = 0; i < 44; i++) jj_la1[i] = -1;
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
+ }
+
+ /** Reinitialise. */
+ public void ReInit(java.io.Reader stream) {
jj_input_stream.ReInit(stream, 1, 1);
token_source.ReInit(jj_input_stream);
token = new Token();
jj_ntk = -1;
jj_gen = 0;
- for (int i = 0; i < 44; i++) {
- jj_la1[i] = -1;
- }
- for (int i = 0; i < jj_2_rtns.length; i++) {
- jj_2_rtns[i] = new JJExpressionParserCalls();
- }
+ for (int i = 0; i < 44; i++) jj_la1[i] = -1;
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
+ /** Constructor with generated Token Manager. */
public ExpressionParser(ExpressionParserTokenManager tm) {
token_source = tm;
token = new Token();
jj_ntk = -1;
jj_gen = 0;
- for (int i = 0; i < 44; i++) {
- jj_la1[i] = -1;
- }
- for (int i = 0; i < jj_2_rtns.length; i++) {
- jj_2_rtns[i] = new JJExpressionParserCalls();
- }
+ for (int i = 0; i < 44; i++) jj_la1[i] = -1;
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
+ /** Reinitialise. */
public void ReInit(ExpressionParserTokenManager tm) {
token_source = tm;
token = new Token();
jj_ntk = -1;
jj_gen = 0;
- for (int i = 0; i < 44; i++) {
- jj_la1[i] = -1;
- }
- for (int i = 0; i < jj_2_rtns.length; i++) {
- jj_2_rtns[i] = new JJExpressionParserCalls();
- }
+ for (int i = 0; i < 44; i++) jj_la1[i] = -1;
+ for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();
}
- final private Token jj_consume_token(int kind) throws ParseException {
+ private Token jj_consume_token(int kind) throws ParseException {
Token oldToken;
- if ((oldToken = token).next != null) {
- token = token.next;
- } else {
- token = token.next = token_source.getNextToken();
- }
+ if ((oldToken = token).next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
jj_ntk = -1;
if (token.kind == kind) {
jj_gen++;
if (++jj_gc > 100) {
jj_gc = 0;
- for (JJExpressionParserCalls jj_2_rtn : jj_2_rtns) {
- JJExpressionParserCalls c = jj_2_rtn;
+ for (int i = 0; i < jj_2_rtns.length; i++) {
+ JJCalls c = jj_2_rtns[i];
while (c != null) {
- if (c.gen < jj_gen) {
- c.first = null;
- }
+ if (c.gen < jj_gen) c.first = null;
c = c.next;
}
}
@@ -3723,12 +2172,13 @@
throw generateParseException();
}
- final private boolean jj_scan_token(int kind) {
+ static private final class LookaheadSuccess extends java.lang.Error { }
+ final private LookaheadSuccess jj_ls = new LookaheadSuccess();
+ private boolean jj_scan_token(int kind) {
if (jj_scanpos == jj_lastpos) {
jj_la--;
if (jj_scanpos.next == null) {
- jj_lastpos = jj_scanpos = jj_scanpos.next = token_source
- .getNextToken();
+ jj_lastpos = jj_scanpos = jj_scanpos.next = token_source.getNextToken();
} else {
jj_lastpos = jj_scanpos = jj_scanpos.next;
}
@@ -3736,60 +2186,50 @@
jj_scanpos = jj_scanpos.next;
}
if (jj_rescan) {
- int i = 0;
- Token tok = token;
- while (tok != null && tok != jj_scanpos) {
- i++;
- tok = tok.next;
- }
- if (tok != null) {
- jj_add_error_token(kind, i);
- }
+ int i = 0; Token tok = token;
+ while (tok != null && tok != jj_scanpos) { i++; tok = tok.next; }
+ if (tok != null) jj_add_error_token(kind, i);
}
- return (jj_scanpos.kind != kind);
+ if (jj_scanpos.kind != kind) return true;
+ if (jj_la == 0 && jj_scanpos == jj_lastpos) throw jj_ls;
+ return false;
}
+
+/** Get the next Token. */
final public Token getNextToken() {
- if (token.next != null) {
- token = token.next;
- } else {
- token = token.next = token_source.getNextToken();
- }
+ if (token.next != null) token = token.next;
+ else token = token.next = token_source.getNextToken();
jj_ntk = -1;
jj_gen++;
return token;
}
+/** Get the specific Token. */
final public Token getToken(int index) {
- Token t = lookingAhead ? jj_scanpos : token;
+ Token t = token;
for (int i = 0; i < index; i++) {
- if (t.next != null) {
- t = t.next;
- } else {
- t = t.next = token_source.getNextToken();
- }
+ if (t.next != null) t = t.next;
+ else t = t.next = token_source.getNextToken();
}
return t;
}
- final private int jj_ntk() {
- if ((jj_nt = token.next) == null) {
+ private int jj_ntk() {
+ if ((jj_nt=token.next) == null)
return (jj_ntk = (token.next=token_source.getNextToken()).kind);
- } else {
+ else
return (jj_ntk = jj_nt.kind);
}
- }
- private java.util.Vector jj_expentries = new java.util.Vector();
+ private java.util.List jj_expentries = new java.util.ArrayList();
private int[] jj_expentry;
private int jj_kind = -1;
private int[] jj_lasttokens = new int[100];
private int jj_endpos;
private void jj_add_error_token(int kind, int pos) {
- if (pos >= 100) {
- return;
- }
+ if (pos >= 100) return;
if (pos == jj_endpos + 1) {
jj_lasttokens[jj_endpos++] = kind;
} else if (jj_endpos != 0) {
@@ -3797,38 +2237,26 @@
for (int i = 0; i < jj_endpos; i++) {
jj_expentry[i] = jj_lasttokens[i];
}
- boolean exists = false;
- for (java.util.Enumeration enum_ = jj_expentries.elements(); enum_
- .hasMoreElements();) {
- int[] oldentry = (enum_.nextElement());
+ jj_entries_loop: for (java.util.Iterator> it = jj_expentries.iterator(); it.hasNext();) {
+ int[] oldentry = (int[])(it.next());
if (oldentry.length == jj_expentry.length) {
- exists = true;
for (int i = 0; i < jj_expentry.length; i++) {
if (oldentry[i] != jj_expentry[i]) {
- exists = false;
- break;
+ continue jj_entries_loop;
}
}
- if (exists) {
- break;
- }
- }
- }
- if (!exists) {
- jj_expentries.addElement(jj_expentry);
- }
- if (pos != 0) {
- jj_lasttokens[(jj_endpos = pos) - 1] = kind;
- }
+ jj_expentries.add(jj_expentry);
+ break jj_entries_loop;
+ }
+ }
+ if (pos != 0) jj_lasttokens[(jj_endpos = pos) - 1] = kind;
}
}
- final public ParseException generateParseException() {
- jj_expentries.removeAllElements();
+ /** Generate ParseException. */
+ public ParseException generateParseException() {
+ jj_expentries.clear();
boolean[] la1tokens = new boolean[116];
- for (int i = 0; i < 116; i++) {
- la1tokens[i] = false;
- }
if (jj_kind >= 0) {
la1tokens[jj_kind] = true;
jj_kind = -1;
@@ -3855,7 +2283,7 @@
if (la1tokens[i]) {
jj_expentry = new int[1];
jj_expentry[0] = i;
- jj_expentries.addElement(jj_expentry);
+ jj_expentries.add(jj_expentry);
}
}
jj_endpos = 0;
@@ -3863,80 +2291,60 @@
jj_add_error_token(0, 0);
int[][] exptokseq = new int[jj_expentries.size()][];
for (int i = 0; i < jj_expentries.size(); i++) {
- exptokseq[i] = jj_expentries.elementAt(i);
+ exptokseq[i] = jj_expentries.get(i);
}
return new ParseException(token, exptokseq, tokenImage);
}
+ /** Enable tracing. */
final public void enable_tracing() {
}
+ /** Disable tracing. */
final public void disable_tracing() {
}
- final private void jj_rescan_token() {
+ private void jj_rescan_token() {
jj_rescan = true;
for (int i = 0; i < 9; i++) {
- JJExpressionParserCalls p = jj_2_rtns[i];
+ try {
+ JJCalls p = jj_2_rtns[i];
do {
if (p.gen > jj_gen) {
- jj_la = p.arg;
- jj_lastpos = jj_scanpos = p.first;
+ jj_la = p.arg; jj_lastpos = jj_scanpos = p.first;
switch (i) {
- case 0:
- jj_3_1();
- break;
- case 1:
- jj_3_2();
- break;
- case 2:
- jj_3_3();
- break;
- case 3:
- jj_3_4();
- break;
- case 4:
- jj_3_5();
- break;
- case 5:
- jj_3_6();
- break;
- case 6:
- jj_3_7();
- break;
- case 7:
- jj_3_8();
- break;
- case 8:
- jj_3_9();
- break;
+ case 0: jj_3_1(); break;
+ case 1: jj_3_2(); break;
+ case 2: jj_3_3(); break;
+ case 3: jj_3_4(); break;
+ case 4: jj_3_5(); break;
+ case 5: jj_3_6(); break;
+ case 6: jj_3_7(); break;
+ case 7: jj_3_8(); break;
+ case 8: jj_3_9(); break;
}
}
p = p.next;
} while (p != null);
+ } catch(LookaheadSuccess ls) { }
}
jj_rescan = false;
}
- final private void jj_save(int index, int xla) {
- JJExpressionParserCalls p = jj_2_rtns[index];
+ private void jj_save(int index, int xla) {
+ JJCalls p = jj_2_rtns[index];
while (p.gen > jj_gen) {
- if (p.next == null) {
- p = p.next = new JJExpressionParserCalls();
- break;
- }
+ if (p.next == null) { p = p.next = new JJCalls(); break; }
p = p.next;
}
- p.gen = jj_gen + xla - jj_la;
- p.first = token;
- p.arg = xla;
+ p.gen = jj_gen + xla - jj_la; p.first = token; p.arg = xla;
+ }
+
+ static final class JJCalls {
+ int gen;
+ Token first;
+ int arg;
+ JJCalls next;
}
}
-
-final class JJExpressionParserCalls {
- int gen;
- Token first;
- int arg;
- JJExpressionParserCalls next;
-}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserConstants.java
--- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserConstants.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserConstants.java Wed Jul 05 19:26:45 2017 +0200
@@ -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 = {
"",
"\" \"",
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserTokenManager.java
--- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserTokenManager.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ExpressionParserTokenManager.java Wed Jul 05 19:26:45 2017 +0200
@@ -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,38 +23,39 @@
* 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. ExpressionParserTokenManager.java */
package com.sun.tools.example.debug.expr;
+import com.sun.jdi.*;
+import java.util.Stack;
+import java.util.List;
+import java.util.ArrayList;
+/** Token Manager. */
public class ExpressionParserTokenManager implements ExpressionParserConstants
{
+
+ /** Debug output. */
+ public java.io.PrintStream debugStream = System.out;
+ /** Set debug output. */
+ public void setDebugStream(java.io.PrintStream ds) { debugStream = ds; }
private final int jjStopStringLiteralDfa_0(int pos, long active0, long active1)
{
switch (pos)
{
case 0:
- if ((active1 & 0x4000L) != 0L) {
+ if ((active1 & 0x100200000000L) != 0L)
+ return 49;
+ if ((active1 & 0x4000L) != 0L)
return 4;
- }
if ((active0 & 0x7fffffffffffe00L) != 0L)
{
jjmatchedKind = 67;
return 28;
}
- if ((active1 & 0x100200000000L) != 0L) {
- return 49;
- }
return -1;
case 1:
+ if ((active0 & 0x40300000L) != 0L)
+ return 28;
if ((active0 & 0x7ffffffbfcffe00L) != 0L)
{
if (jjmatchedPos != 1)
@@ -64,11 +65,10 @@
}
return 28;
}
- if ((active0 & 0x40300000L) != 0L) {
- return 28;
- }
return -1;
case 2:
+ if ((active0 & 0x80004c10000000L) != 0L)
+ return 28;
if ((active0 & 0x77fffb3afeffe00L) != 0L)
{
if (jjmatchedPos != 2)
@@ -78,9 +78,6 @@
}
return 28;
}
- if ((active0 & 0x80004c10000000L) != 0L) {
- return 28;
- }
return -1;
case 3:
if ((active0 & 0x63bff2b8faf4e00L) != 0L)
@@ -89,11 +86,12 @@
jjmatchedPos = 3;
return 28;
}
- if ((active0 & 0x14400902040b000L) != 0L) {
+ if ((active0 & 0x14400902040b000L) != 0L)
return 28;
- }
return -1;
case 4:
+ if ((active0 & 0x418a0000f034800L) != 0L)
+ return 28;
if ((active0 & 0x2235f2b80ac0600L) != 0L)
{
if (jjmatchedPos != 4)
@@ -103,20 +101,16 @@
}
return 28;
}
- if ((active0 & 0x418a0000f034800L) != 0L) {
- return 28;
- }
return -1;
case 5:
+ if ((active0 & 0x11582100200000L) != 0L)
+ return 28;
if ((active0 & 0x222070a848c0600L) != 0L)
{
jjmatchedKind = 67;
jjmatchedPos = 5;
return 28;
}
- if ((active0 & 0x11582100200000L) != 0L) {
- return 28;
- }
return -1;
case 6:
if ((active0 & 0x222040a80040200L) != 0L)
@@ -125,31 +119,28 @@
jjmatchedPos = 6;
return 28;
}
- if ((active0 & 0x30004880400L) != 0L) {
+ if ((active0 & 0x30004880400L) != 0L)
return 28;
- }
return -1;
case 7:
+ if ((active0 & 0x200000000040200L) != 0L)
+ return 28;
if ((active0 & 0x22040a80000000L) != 0L)
{
jjmatchedKind = 67;
jjmatchedPos = 7;
return 28;
}
- if ((active0 & 0x200000000040200L) != 0L) {
- return 28;
- }
return -1;
case 8:
+ if ((active0 & 0x20040800000000L) != 0L)
+ return 28;
if ((active0 & 0x2000280000000L) != 0L)
{
jjmatchedKind = 67;
jjmatchedPos = 8;
return 28;
}
- if ((active0 & 0x20040800000000L) != 0L) {
- return 28;
- }
return -1;
case 9:
if ((active0 & 0x2000000000000L) != 0L)
@@ -158,9 +149,8 @@
jjmatchedPos = 9;
return 28;
}
- if ((active0 & 0x280000000L) != 0L) {
+ if ((active0 & 0x280000000L) != 0L)
return 28;
- }
return -1;
case 10:
if ((active0 & 0x2000000000000L) != 0L)
@@ -178,21 +168,13 @@
{
return jjMoveNfa_0(jjStopStringLiteralDfa_0(pos, active0, active1), pos + 1);
}
-private final int jjStopAtPos(int pos, int kind)
+private int jjStopAtPos(int pos, int kind)
{
jjmatchedKind = kind;
jjmatchedPos = pos;
return pos + 1;
}
-private final int jjStartNfaWithStates_0(int pos, int kind, int state)
-{
- jjmatchedKind = kind;
- jjmatchedPos = pos;
- try { curChar = input_stream.readChar(); }
- catch(java.io.IOException e) { return pos + 1; }
- return jjMoveNfa_0(state, pos + 1);
-}
-private final int jjMoveStringLiteralDfa0_0()
+private int jjMoveStringLiteralDfa0_0()
{
switch(curChar)
{
@@ -292,7 +274,7 @@
return jjMoveNfa_0(0, 0);
}
}
-private final int jjMoveStringLiteralDfa1_0(long active0, long active1)
+private int jjMoveStringLiteralDfa1_0(long active0, long active1)
{
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
@@ -302,19 +284,16 @@
switch(curChar)
{
case 38:
- if ((active1 & 0x8000000L) != 0L) {
+ if ((active1 & 0x8000000L) != 0L)
return jjStopAtPos(1, 91);
- }
break;
case 43:
- if ((active1 & 0x10000000L) != 0L) {
+ if ((active1 & 0x10000000L) != 0L)
return jjStopAtPos(1, 92);
- }
break;
case 45:
- if ((active1 & 0x20000000L) != 0L) {
+ if ((active1 & 0x20000000L) != 0L)
return jjStopAtPos(1, 93);
- }
break;
case 60:
if ((active1 & 0x4000000000L) != 0L)
@@ -324,31 +303,30 @@
}
return jjMoveStringLiteralDfa2_0(active0, 0L, active1, 0x2000000000000L);
case 61:
- if ((active1 & 0x400000L) != 0L) {
+ if ((active1 & 0x400000L) != 0L)
return jjStopAtPos(1, 86);
- } else if ((active1 & 0x800000L) != 0L) {
+ else if ((active1 & 0x800000L) != 0L)
return jjStopAtPos(1, 87);
- } else if ((active1 & 0x1000000L) != 0L) {
+ else if ((active1 & 0x1000000L) != 0L)
return jjStopAtPos(1, 88);
- } else if ((active1 & 0x2000000L) != 0L) {
+ else if ((active1 & 0x2000000L) != 0L)
return jjStopAtPos(1, 89);
- } else if ((active1 & 0x20000000000L) != 0L) {
+ else if ((active1 & 0x20000000000L) != 0L)
return jjStopAtPos(1, 105);
- } else if ((active1 & 0x40000000000L) != 0L) {
+ else if ((active1 & 0x40000000000L) != 0L)
return jjStopAtPos(1, 106);
- } else if ((active1 & 0x80000000000L) != 0L) {
+ else if ((active1 & 0x80000000000L) != 0L)
return jjStopAtPos(1, 107);
- } else if ((active1 & 0x100000000000L) != 0L) {
+ else if ((active1 & 0x100000000000L) != 0L)
return jjStopAtPos(1, 108);
- } else if ((active1 & 0x200000000000L) != 0L) {
+ else if ((active1 & 0x200000000000L) != 0L)
return jjStopAtPos(1, 109);
- } else if ((active1 & 0x400000000000L) != 0L) {
+ else if ((active1 & 0x400000000000L) != 0L)
return jjStopAtPos(1, 110);
- } else if ((active1 & 0x800000000000L) != 0L) {
+ else if ((active1 & 0x800000000000L) != 0L)
return jjStopAtPos(1, 111);
- } else if ((active1 & 0x1000000000000L) != 0L) {
+ else if ((active1 & 0x1000000000000L) != 0L)
return jjStopAtPos(1, 112);
- }
break;
case 62:
if ((active1 & 0x8000000000L) != 0L)
@@ -364,9 +342,8 @@
case 101:
return jjMoveStringLiteralDfa2_0(active0, 0x104000080000L, active1, 0L);
case 102:
- if ((active0 & 0x40000000L) != 0L) {
+ if ((active0 & 0x40000000L) != 0L)
return jjStartNfaWithStates_0(1, 30, 28);
- }
break;
case 104:
return jjMoveStringLiteralDfa2_0(active0, 0x41c200000008000L, active1, 0L);
@@ -398,20 +375,18 @@
case 121:
return jjMoveStringLiteralDfa2_0(active0, 0x2000000001000L, active1, 0L);
case 124:
- if ((active1 & 0x4000000L) != 0L) {
+ if ((active1 & 0x4000000L) != 0L)
return jjStopAtPos(1, 90);
- }
break;
default :
break;
}
return jjStartNfa_0(0, active0, active1);
}
-private final int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1)
+private int jjMoveStringLiteralDfa2_0(long old0, long active0, long old1, long active1)
{
- if (((active0 &= old0) | (active1 &= old1)) == 0L) {
+ if (((active0 &= old0) | (active1 &= old1)) == 0L)
return jjStartNfa_0(0, old0, old1);
- }
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(1, active0, active1);
@@ -420,11 +395,10 @@
switch(curChar)
{
case 61:
- if ((active1 & 0x2000000000000L) != 0L) {
+ if ((active1 & 0x2000000000000L) != 0L)
return jjStopAtPos(2, 113);
- } else if ((active1 & 0x4000000000000L) != 0L) {
+ else if ((active1 & 0x4000000000000L) != 0L)
return jjStopAtPos(2, 114);
- }
break;
case 62:
if ((active1 & 0x10000000000L) != 0L)
@@ -454,9 +428,8 @@
case 112:
return jjMoveStringLiteralDfa3_0(active0, 0x800180000000L, active1, 0L);
case 114:
- if ((active0 & 0x10000000L) != 0L) {
+ if ((active0 & 0x10000000L) != 0L)
return jjStartNfaWithStates_0(2, 28, 28);
- }
return jjMoveStringLiteralDfa3_0(active0, 0x18000000000000L, active1, 0L);
case 115:
return jjMoveStringLiteralDfa3_0(active0, 0x200402200L, active1, 0L);
@@ -470,25 +443,22 @@
case 117:
return jjMoveStringLiteralDfa3_0(active0, 0x40000000200000L, active1, 0L);
case 119:
- if ((active0 & 0x4000000000L) != 0L) {
+ if ((active0 & 0x4000000000L) != 0L)
return jjStartNfaWithStates_0(2, 38, 28);
- }
break;
case 121:
- if ((active0 & 0x80000000000000L) != 0L) {
+ if ((active0 & 0x80000000000000L) != 0L)
return jjStartNfaWithStates_0(2, 55, 28);
- }
break;
default :
break;
}
return jjStartNfa_0(1, active0, active1);
}
-private final int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1)
+private int jjMoveStringLiteralDfa3_0(long old0, long active0, long old1, long active1)
{
- if (((active0 &= old0) | (active1 &= old1)) == 0L) {
+ if (((active0 &= old0) | (active1 &= old1)) == 0L)
return jjStartNfa_0(1, old0, old1);
- }
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(2, active0, active1);
@@ -497,9 +467,8 @@
switch(curChar)
{
case 61:
- if ((active1 & 0x8000000000000L) != 0L) {
+ if ((active1 & 0x8000000000000L) != 0L)
return jjStopAtPos(3, 115);
- }
break;
case 97:
return jjMoveStringLiteralDfa4_0(active0, 0x20000000e080800L, active1, 0L);
@@ -508,51 +477,44 @@
case 99:
return jjMoveStringLiteralDfa4_0(active0, 0x2000000004000L, active1, 0L);
case 100:
- if ((active0 & 0x100000000000000L) != 0L) {
+ if ((active0 & 0x100000000000000L) != 0L)
return jjStartNfaWithStates_0(3, 56, 28);
- }
break;
case 101:
- if ((active0 & 0x1000L) != 0L) {
+ if ((active0 & 0x1000L) != 0L)
return jjStartNfaWithStates_0(3, 12, 28);
- } else if ((active0 & 0x2000L) != 0L) {
+ else if ((active0 & 0x2000L) != 0L)
return jjStartNfaWithStates_0(3, 13, 28);
- } else if ((active0 & 0x400000L) != 0L) {
+ else if ((active0 & 0x400000L) != 0L)
return jjStartNfaWithStates_0(3, 22, 28);
- } else if ((active0 & 0x40000000000000L) != 0L) {
+ else if ((active0 & 0x40000000000000L) != 0L)
return jjStartNfaWithStates_0(3, 54, 28);
- }
return jjMoveStringLiteralDfa4_0(active0, 0x800800800000L, active1, 0L);
case 103:
- if ((active0 & 0x1000000000L) != 0L) {
+ if ((active0 & 0x1000000000L) != 0L)
return jjStartNfaWithStates_0(3, 36, 28);
- }
break;
case 105:
return jjMoveStringLiteralDfa4_0(active0, 0x2000000000L, active1, 0L);
case 107:
return jjMoveStringLiteralDfa4_0(active0, 0x10000000000L, active1, 0L);
case 108:
- if ((active0 & 0x8000000000L) != 0L) {
+ if ((active0 & 0x8000000000L) != 0L)
return jjStartNfaWithStates_0(3, 39, 28);
- }
return jjMoveStringLiteralDfa4_0(active0, 0x400080080000400L, active1, 0L);
case 110:
return jjMoveStringLiteralDfa4_0(active0, 0x20000000000000L, active1, 0L);
case 111:
- if ((active0 & 0x20000000L) != 0L) {
+ if ((active0 & 0x20000000L) != 0L)
return jjStartNfaWithStates_0(3, 29, 28);
- }
return jjMoveStringLiteralDfa4_0(active0, 0x18000100000000L, active1, 0L);
case 114:
- if ((active0 & 0x8000L) != 0L) {
+ if ((active0 & 0x8000L) != 0L)
return jjStartNfaWithStates_0(3, 15, 28);
- }
return jjMoveStringLiteralDfa4_0(active0, 0x200000000000L, active1, 0L);
case 115:
- if ((active0 & 0x4000000000000L) != 0L) {
+ if ((active0 & 0x4000000000000L) != 0L)
return jjStartNfaWithStates_0(3, 50, 28);
- }
return jjMoveStringLiteralDfa4_0(active0, 0x1030000L, active1, 0L);
case 116:
return jjMoveStringLiteralDfa4_0(active0, 0x1440200040200L, active1, 0L);
@@ -565,11 +527,10 @@
}
return jjStartNfa_0(2, active0, active1);
}
-private final int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1)
+private int jjMoveStringLiteralDfa4_0(long old0, long active0, long old1, long active1)
{
- if (((active0 &= old0) | (active1 &= old1)) == 0L) {
+ if (((active0 &= old0) | (active1 &= old1)) == 0L)
return jjStartNfa_0(2, old0, old1);
- }
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(3, active0, 0L);
@@ -582,23 +543,20 @@
case 99:
return jjMoveStringLiteralDfa5_0(active0, 0x1000000000000L);
case 101:
- if ((active0 & 0x1000000L) != 0L) {
+ if ((active0 & 0x1000000L) != 0L)
return jjStartNfaWithStates_0(4, 24, 28);
- } else if ((active0 & 0x400000000000000L) != 0L) {
+ else if ((active0 & 0x400000000000000L) != 0L)
return jjStartNfaWithStates_0(4, 58, 28);
- }
return jjMoveStringLiteralDfa5_0(active0, 0x40080000400L);
case 104:
- if ((active0 & 0x4000L) != 0L) {
+ if ((active0 & 0x4000L) != 0L)
return jjStartNfaWithStates_0(4, 14, 28);
- }
return jjMoveStringLiteralDfa5_0(active0, 0x2000000000000L);
case 105:
return jjMoveStringLiteralDfa5_0(active0, 0x480000040000L);
case 107:
- if ((active0 & 0x800L) != 0L) {
+ if ((active0 & 0x800L) != 0L)
return jjStartNfaWithStates_0(4, 11, 28);
- }
break;
case 108:
if ((active0 & 0x2000000L) != 0L)
@@ -610,23 +568,20 @@
case 110:
return jjMoveStringLiteralDfa5_0(active0, 0x800000L);
case 114:
- if ((active0 & 0x800000000000L) != 0L) {
+ if ((active0 & 0x800000000000L) != 0L)
return jjStartNfaWithStates_0(4, 47, 28);
- }
return jjMoveStringLiteralDfa5_0(active0, 0x100900000200L);
case 115:
- if ((active0 & 0x10000L) != 0L) {
+ if ((active0 & 0x10000L) != 0L)
return jjStartNfaWithStates_0(4, 16, 28);
- }
return jjMoveStringLiteralDfa5_0(active0, 0x20000000000000L);
case 116:
- if ((active0 & 0x20000L) != 0L) {
+ if ((active0 & 0x20000L) != 0L)
return jjStartNfaWithStates_0(4, 17, 28);
- } else if ((active0 & 0x8000000L) != 0L) {
+ else if ((active0 & 0x8000000L) != 0L)
return jjStartNfaWithStates_0(4, 27, 28);
- } else if ((active0 & 0x200000000000L) != 0L) {
+ else if ((active0 & 0x200000000000L) != 0L)
return jjStartNfaWithStates_0(4, 45, 28);
- }
return jjMoveStringLiteralDfa5_0(active0, 0x200000000000000L);
case 117:
return jjMoveStringLiteralDfa5_0(active0, 0x80000L);
@@ -644,11 +599,10 @@
}
return jjStartNfa_0(3, active0, 0L);
}
-private final int jjMoveStringLiteralDfa5_0(long old0, long active0)
+private int jjMoveStringLiteralDfa5_0(long old0, long active0)
{
- if (((active0 &= old0)) == 0L) {
+ if (((active0 &= old0)) == 0L)
return jjStartNfa_0(3, old0, 0L);
- }
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(4, active0, 0L);
@@ -659,29 +613,26 @@
case 97:
return jjMoveStringLiteralDfa6_0(active0, 0x600L);
case 99:
- if ((active0 & 0x80000000000L) != 0L) {
+ if ((active0 & 0x80000000000L) != 0L)
return jjStartNfaWithStates_0(5, 43, 28);
- } else if ((active0 & 0x400000000000L) != 0L) {
+ else if ((active0 & 0x400000000000L) != 0L)
return jjStartNfaWithStates_0(5, 46, 28);
- }
return jjMoveStringLiteralDfa6_0(active0, 0x40000000000L);
case 100:
return jjMoveStringLiteralDfa6_0(active0, 0x800000L);
case 101:
- if ((active0 & 0x200000L) != 0L) {
+ if ((active0 & 0x200000L) != 0L)
return jjStartNfaWithStates_0(5, 21, 28);
- } else if ((active0 & 0x2000000000L) != 0L) {
+ else if ((active0 & 0x2000000000L) != 0L)
return jjStartNfaWithStates_0(5, 37, 28);
- }
break;
case 102:
return jjMoveStringLiteralDfa6_0(active0, 0x800000000L);
case 103:
return jjMoveStringLiteralDfa6_0(active0, 0x10000000000L);
case 104:
- if ((active0 & 0x1000000000000L) != 0L) {
+ if ((active0 & 0x1000000000000L) != 0L)
return jjStartNfaWithStates_0(5, 48, 28);
- }
break;
case 105:
return jjMoveStringLiteralDfa6_0(active0, 0x220000000000000L);
@@ -690,32 +641,28 @@
case 109:
return jjMoveStringLiteralDfa6_0(active0, 0x80000000L);
case 110:
- if ((active0 & 0x100000000000L) != 0L) {
+ if ((active0 & 0x100000000000L) != 0L)
return jjStartNfaWithStates_0(5, 44, 28);
- }
return jjMoveStringLiteralDfa6_0(active0, 0x200040000L);
case 114:
return jjMoveStringLiteralDfa6_0(active0, 0x2000000000000L);
case 115:
- if ((active0 & 0x10000000000000L) != 0L) {
+ if ((active0 & 0x10000000000000L) != 0L)
return jjStartNfaWithStates_0(5, 52, 28);
- }
break;
case 116:
- if ((active0 & 0x100000000L) != 0L) {
+ if ((active0 & 0x100000000L) != 0L)
return jjStartNfaWithStates_0(5, 32, 28);
- }
return jjMoveStringLiteralDfa6_0(active0, 0x20000000000L);
default :
break;
}
return jjStartNfa_0(4, active0, 0L);
}
-private final int jjMoveStringLiteralDfa6_0(long old0, long active0)
+private int jjMoveStringLiteralDfa6_0(long old0, long active0)
{
- if (((active0 &= old0)) == 0L) {
+ if (((active0 &= old0)) == 0L)
return jjStartNfa_0(4, old0, 0L);
- }
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(5, active0, 0L);
@@ -728,48 +675,42 @@
case 99:
return jjMoveStringLiteralDfa7_0(active0, 0x200000200L);
case 101:
- if ((active0 & 0x10000000000L) != 0L) {
+ if ((active0 & 0x10000000000L) != 0L)
return jjStartNfaWithStates_0(6, 40, 28);
- } else if ((active0 & 0x20000000000L) != 0L) {
+ else if ((active0 & 0x20000000000L) != 0L)
return jjStartNfaWithStates_0(6, 41, 28);
- }
return jjMoveStringLiteralDfa7_0(active0, 0x20000080000000L);
case 108:
return jjMoveStringLiteralDfa7_0(active0, 0x200000000000000L);
case 110:
- if ((active0 & 0x400L) != 0L) {
+ if ((active0 & 0x400L) != 0L)
return jjStartNfaWithStates_0(6, 10, 28);
- }
break;
case 111:
return jjMoveStringLiteralDfa7_0(active0, 0x2000000000000L);
case 115:
- if ((active0 & 0x800000L) != 0L) {
+ if ((active0 & 0x800000L) != 0L)
return jjStartNfaWithStates_0(6, 23, 28);
- }
break;
case 116:
- if ((active0 & 0x80000L) != 0L) {
+ if ((active0 & 0x80000L) != 0L)
return jjStartNfaWithStates_0(6, 19, 28);
- }
return jjMoveStringLiteralDfa7_0(active0, 0x40000000000L);
case 117:
return jjMoveStringLiteralDfa7_0(active0, 0x40000L);
case 121:
- if ((active0 & 0x4000000L) != 0L) {
+ if ((active0 & 0x4000000L) != 0L)
return jjStartNfaWithStates_0(6, 26, 28);
- }
break;
default :
break;
}
return jjStartNfa_0(5, active0, 0L);
}
-private final int jjMoveStringLiteralDfa7_0(long old0, long active0)
+private int jjMoveStringLiteralDfa7_0(long old0, long active0)
{
- if (((active0 &= old0)) == 0L) {
+ if (((active0 &= old0)) == 0L)
return jjStartNfa_0(5, old0, 0L);
- }
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(6, active0, 0L);
@@ -780,29 +721,26 @@
case 99:
return jjMoveStringLiteralDfa8_0(active0, 0x800000000L);
case 101:
- if ((active0 & 0x40000L) != 0L) {
+ if ((active0 & 0x40000L) != 0L)
return jjStartNfaWithStates_0(7, 18, 28);
- } else if ((active0 & 0x200000000000000L) != 0L) {
+ else if ((active0 & 0x200000000000000L) != 0L)
return jjStartNfaWithStates_0(7, 57, 28);
- }
return jjMoveStringLiteralDfa8_0(active0, 0x40200000000L);
case 110:
return jjMoveStringLiteralDfa8_0(active0, 0x22000080000000L);
case 116:
- if ((active0 & 0x200L) != 0L) {
+ if ((active0 & 0x200L) != 0L)
return jjStartNfaWithStates_0(7, 9, 28);
- }
break;
default :
break;
}
return jjStartNfa_0(6, active0, 0L);
}
-private final int jjMoveStringLiteralDfa8_0(long old0, long active0)
+private int jjMoveStringLiteralDfa8_0(long old0, long active0)
{
- if (((active0 &= old0)) == 0L) {
+ if (((active0 &= old0)) == 0L)
return jjStartNfa_0(6, old0, 0L);
- }
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(7, active0, 0L);
@@ -811,34 +749,30 @@
switch(curChar)
{
case 100:
- if ((active0 & 0x40000000000L) != 0L) {
+ if ((active0 & 0x40000000000L) != 0L)
return jjStartNfaWithStates_0(8, 42, 28);
- }
break;
case 101:
- if ((active0 & 0x800000000L) != 0L) {
+ if ((active0 & 0x800000000L) != 0L)
return jjStartNfaWithStates_0(8, 35, 28);
- }
break;
case 105:
return jjMoveStringLiteralDfa9_0(active0, 0x2000000000000L);
case 111:
return jjMoveStringLiteralDfa9_0(active0, 0x200000000L);
case 116:
- if ((active0 & 0x20000000000000L) != 0L) {
+ if ((active0 & 0x20000000000000L) != 0L)
return jjStartNfaWithStates_0(8, 53, 28);
- }
return jjMoveStringLiteralDfa9_0(active0, 0x80000000L);
default :
break;
}
return jjStartNfa_0(7, active0, 0L);
}
-private final int jjMoveStringLiteralDfa9_0(long old0, long active0)
+private int jjMoveStringLiteralDfa9_0(long old0, long active0)
{
- if (((active0 &= old0)) == 0L) {
+ if (((active0 &= old0)) == 0L)
return jjStartNfa_0(7, old0, 0L);
- }
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(8, active0, 0L);
@@ -847,14 +781,12 @@
switch(curChar)
{
case 102:
- if ((active0 & 0x200000000L) != 0L) {
+ if ((active0 & 0x200000000L) != 0L)
return jjStartNfaWithStates_0(9, 33, 28);
- }
break;
case 115:
- if ((active0 & 0x80000000L) != 0L) {
+ if ((active0 & 0x80000000L) != 0L)
return jjStartNfaWithStates_0(9, 31, 28);
- }
break;
case 122:
return jjMoveStringLiteralDfa10_0(active0, 0x2000000000000L);
@@ -863,11 +795,10 @@
}
return jjStartNfa_0(8, active0, 0L);
}
-private final int jjMoveStringLiteralDfa10_0(long old0, long active0)
+private int jjMoveStringLiteralDfa10_0(long old0, long active0)
{
- if (((active0 &= old0)) == 0L) {
+ if (((active0 &= old0)) == 0L)
return jjStartNfa_0(8, old0, 0L);
- }
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(9, active0, 0L);
@@ -882,11 +813,10 @@
}
return jjStartNfa_0(9, active0, 0L);
}
-private final int jjMoveStringLiteralDfa11_0(long old0, long active0)
+private int jjMoveStringLiteralDfa11_0(long old0, long active0)
{
- if (((active0 &= old0)) == 0L) {
+ if (((active0 &= old0)) == 0L)
return jjStartNfa_0(9, old0, 0L);
- }
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) {
jjStopStringLiteralDfa_0(10, active0, 0L);
@@ -895,44 +825,21 @@
switch(curChar)
{
case 100:
- if ((active0 & 0x2000000000000L) != 0L) {
+ if ((active0 & 0x2000000000000L) != 0L)
return jjStartNfaWithStates_0(11, 49, 28);
- }
break;
default :
break;
}
return jjStartNfa_0(10, active0, 0L);
}
-private final void jjCheckNAdd(int state)
-{
- if (jjrounds[state] != jjround)
- {
- jjstateSet[jjnewStateCnt++] = state;
- jjrounds[state] = jjround;
- }
-}
-private final void jjAddStates(int start, int end)
+private int jjStartNfaWithStates_0(int pos, int kind, int state)
{
- do {
- jjstateSet[jjnewStateCnt++] = jjnextStates[start];
- } while (start++ != end);
-}
-private final void jjCheckNAddTwoStates(int state1, int state2)
-{
- jjCheckNAdd(state1);
- jjCheckNAdd(state2);
-}
-private final void jjCheckNAddStates(int start, int end)
-{
- do {
- jjCheckNAdd(jjnextStates[start]);
- } while (start++ != end);
-}
-private final void jjCheckNAddStates(int start)
-{
- jjCheckNAdd(jjnextStates[start]);
- jjCheckNAdd(jjnextStates[start + 1]);
+ jjmatchedKind = kind;
+ jjmatchedPos = pos;
+ try { curChar = input_stream.readChar(); }
+ catch(java.io.IOException e) { return pos + 1; }
+ return jjMoveNfa_0(state, pos + 1);
}
static final long[] jjbitVec0 = {
0xfffffffffffffffeL, 0xffffffffffffffffL, 0xffffffffffffffffL, 0xffffffffffffffffL
@@ -958,7 +865,7 @@
static final long[] jjbitVec8 = {
0x3fffffffffffL, 0x0L, 0x0L, 0x0L
};
-private final int jjMoveNfa_0(int startState, int curPos)
+private int jjMoveNfa_0(int startState, int curPos)
{
int startsAt = 0;
jjnewStateCnt = 67;
@@ -967,388 +874,312 @@
int kind = 0x7fffffff;
for (;;)
{
- if (++jjround == 0x7fffffff) {
+ if (++jjround == 0x7fffffff)
ReInitRounds();
- }
if (curChar < 64)
{
long l = 1L << curChar;
- //MatchLoop
do
{
switch(jjstateSet[--i])
{
+ case 49:
+ if (curChar == 42)
+ jjCheckNAddTwoStates(62, 63);
+ else if (curChar == 47)
+ jjCheckNAddStates(0, 2);
+ if (curChar == 42)
+ jjstateSet[jjnewStateCnt++] = 54;
+ break;
case 0:
- if ((0x3ff000000000000L & l) != 0L) {
- jjCheckNAddStates(0, 6);
- } else if (curChar == 47) {
- jjAddStates(7, 9);
- } else if (curChar == 36)
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddStates(3, 9);
+ else if (curChar == 47)
+ jjAddStates(10, 12);
+ else if (curChar == 36)
{
- if (kind > 67) {
+ if (kind > 67)
kind = 67;
- }
jjCheckNAdd(28);
}
- else if (curChar == 34) {
- jjCheckNAddStates(10, 12);
- } else if (curChar == 39) {
- jjAddStates(13, 14);
- } else if (curChar == 46) {
+ else if (curChar == 34)
+ jjCheckNAddStates(13, 15);
+ else if (curChar == 39)
+ jjAddStates(16, 17);
+ else if (curChar == 46)
jjCheckNAdd(4);
- }
if ((0x3fe000000000000L & l) != 0L)
{
- if (kind > 59) {
+ if (kind > 59)
kind = 59;
- }
jjCheckNAddTwoStates(1, 2);
}
else if (curChar == 48)
{
- if (kind > 59) {
+ if (kind > 59)
kind = 59;
- }
- jjCheckNAddStates(15, 17);
- }
- break;
- case 49:
- if (curChar == 42) {
- jjCheckNAddTwoStates(62, 63);
- } else if (curChar == 47) {
jjCheckNAddStates(18, 20);
}
- if (curChar == 42) {
- jjstateSet[jjnewStateCnt++] = 54;
- }
break;
case 1:
- if ((0x3ff000000000000L & l) == 0L) {
+ if ((0x3ff000000000000L & l) == 0L)
break;
- }
- if (kind > 59) {
+ if (kind > 59)
kind = 59;
- }
jjCheckNAddTwoStates(1, 2);
break;
case 3:
- if (curChar == 46) {
+ if (curChar == 46)
jjCheckNAdd(4);
- }
break;
case 4:
- if ((0x3ff000000000000L & l) == 0L) {
+ if ((0x3ff000000000000L & l) == 0L)
break;
- }
- if (kind > 63) {
+ if (kind > 63)
kind = 63;
- }
jjCheckNAddStates(21, 23);
break;
case 6:
- if ((0x280000000000L & l) != 0L) {
+ if ((0x280000000000L & l) != 0L)
jjCheckNAdd(7);
- }
break;
case 7:
- if ((0x3ff000000000000L & l) == 0L) {
+ if ((0x3ff000000000000L & l) == 0L)
break;
- }
- if (kind > 63) {
+ if (kind > 63)
kind = 63;
- }
jjCheckNAddTwoStates(7, 8);
break;
case 9:
- if (curChar == 39) {
- jjAddStates(13, 14);
- }
+ if (curChar == 39)
+ jjAddStates(16, 17);
break;
case 10:
- if ((0xffffff7fffffdbffL & l) != 0L) {
+ if ((0xffffff7fffffdbffL & l) != 0L)
jjCheckNAdd(11);
- }
break;
case 11:
- if (curChar == 39 && kind > 65) {
+ if (curChar == 39 && kind > 65)
kind = 65;
- }
break;
case 13:
- if ((0x8400000000L & l) != 0L) {
+ if ((0x8400000000L & l) != 0L)
jjCheckNAdd(11);
- }
break;
case 14:
- if ((0xff000000000000L & l) != 0L) {
+ if ((0xff000000000000L & l) != 0L)
jjCheckNAddTwoStates(15, 11);
- }
break;
case 15:
- if ((0xff000000000000L & l) != 0L) {
+ if ((0xff000000000000L & l) != 0L)
jjCheckNAdd(11);
- }
break;
case 16:
- if ((0xf000000000000L & l) != 0L) {
+ if ((0xf000000000000L & l) != 0L)
jjstateSet[jjnewStateCnt++] = 17;
- }
break;
case 17:
- if ((0xff000000000000L & l) != 0L) {
+ if ((0xff000000000000L & l) != 0L)
jjCheckNAdd(15);
- }
break;
case 18:
- if (curChar == 34) {
- jjCheckNAddStates(10, 12);
- }
+ if (curChar == 34)
+ jjCheckNAddStates(13, 15);
break;
case 19:
- if ((0xfffffffbffffdbffL & l) != 0L) {
- jjCheckNAddStates(10, 12);
- }
+ if ((0xfffffffbffffdbffL & l) != 0L)
+ jjCheckNAddStates(13, 15);
break;
case 21:
- if ((0x8400000000L & l) != 0L) {
- jjCheckNAddStates(10, 12);
- }
+ if ((0x8400000000L & l) != 0L)
+ jjCheckNAddStates(13, 15);
break;
case 22:
- if (curChar == 34 && kind > 66) {
+ if (curChar == 34 && kind > 66)
kind = 66;
- }
break;
case 23:
- if ((0xff000000000000L & l) != 0L) {
+ if ((0xff000000000000L & l) != 0L)
jjCheckNAddStates(24, 27);
- }
break;
case 24:
- if ((0xff000000000000L & l) != 0L) {
- jjCheckNAddStates(10, 12);
- }
+ if ((0xff000000000000L & l) != 0L)
+ jjCheckNAddStates(13, 15);
break;
case 25:
- if ((0xf000000000000L & l) != 0L) {
+ if ((0xf000000000000L & l) != 0L)
jjstateSet[jjnewStateCnt++] = 26;
- }
break;
case 26:
- if ((0xff000000000000L & l) != 0L) {
+ if ((0xff000000000000L & l) != 0L)
jjCheckNAdd(24);
- }
break;
case 27:
- if (curChar != 36) {
+ if (curChar != 36)
break;
- }
- if (kind > 67) {
+ if (kind > 67)
kind = 67;
- }
jjCheckNAdd(28);
break;
case 28:
- if ((0x3ff001000000000L & l) == 0L) {
+ if ((0x3ff001000000000L & l) == 0L)
break;
- }
- if (kind > 67) {
+ if (kind > 67)
kind = 67;
- }
jjCheckNAdd(28);
break;
case 29:
- if ((0x3ff000000000000L & l) != 0L) {
- jjCheckNAddStates(0, 6);
- }
+ if ((0x3ff000000000000L & l) != 0L)
+ jjCheckNAddStates(3, 9);
break;
case 30:
- if ((0x3ff000000000000L & l) != 0L) {
+ if ((0x3ff000000000000L & l) != 0L)
jjCheckNAddTwoStates(30, 31);
- }
break;
case 31:
- if (curChar != 46) {
+ if (curChar != 46)
break;
- }
- if (kind > 63) {
+ if (kind > 63)
kind = 63;
- }
jjCheckNAddStates(28, 30);
break;
case 32:
- if ((0x3ff000000000000L & l) == 0L) {
+ if ((0x3ff000000000000L & l) == 0L)
break;
- }
- if (kind > 63) {
+ if (kind > 63)
kind = 63;
- }
jjCheckNAddStates(28, 30);
break;
case 34:
- if ((0x280000000000L & l) != 0L) {
+ if ((0x280000000000L & l) != 0L)
jjCheckNAdd(35);
- }
break;
case 35:
- if ((0x3ff000000000000L & l) == 0L) {
+ if ((0x3ff000000000000L & l) == 0L)
break;
- }
- if (kind > 63) {
+ if (kind > 63)
kind = 63;
- }
jjCheckNAddTwoStates(35, 8);
break;
case 36:
- if ((0x3ff000000000000L & l) != 0L) {
+ if ((0x3ff000000000000L & l) != 0L)
jjCheckNAddTwoStates(36, 37);
- }
break;
case 38:
- if ((0x280000000000L & l) != 0L) {
+ if ((0x280000000000L & l) != 0L)
jjCheckNAdd(39);
- }
break;
case 39:
- if ((0x3ff000000000000L & l) == 0L) {
+ if ((0x3ff000000000000L & l) == 0L)
break;
- }
- if (kind > 63) {
+ if (kind > 63)
kind = 63;
- }
jjCheckNAddTwoStates(39, 8);
break;
case 40:
- if ((0x3ff000000000000L & l) != 0L) {
+ if ((0x3ff000000000000L & l) != 0L)
jjCheckNAddStates(31, 33);
- }
break;
case 42:
- if ((0x280000000000L & l) != 0L) {
+ if ((0x280000000000L & l) != 0L)
jjCheckNAdd(43);
- }
break;
case 43:
- if ((0x3ff000000000000L & l) != 0L) {
+ if ((0x3ff000000000000L & l) != 0L)
jjCheckNAddTwoStates(43, 8);
- }
break;
case 44:
- if (curChar != 48) {
+ if (curChar != 48)
break;
- }
- if (kind > 59) {
+ if (kind > 59)
kind = 59;
- }
- jjCheckNAddStates(15, 17);
+ jjCheckNAddStates(18, 20);
break;
case 46:
- if ((0x3ff000000000000L & l) == 0L) {
+ if ((0x3ff000000000000L & l) == 0L)
break;
- }
- if (kind > 59) {
+ if (kind > 59)
kind = 59;
- }
jjCheckNAddTwoStates(46, 2);
break;
case 47:
- if ((0xff000000000000L & l) == 0L) {
+ if ((0xff000000000000L & l) == 0L)
break;
- }
- if (kind > 59) {
+ if (kind > 59)
kind = 59;
- }
jjCheckNAddTwoStates(47, 2);
break;
case 48:
- if (curChar == 47) {
- jjAddStates(7, 9);
- }
+ if (curChar == 47)
+ jjAddStates(10, 12);
break;
case 50:
- if ((0xffffffffffffdbffL & l) != 0L) {
- jjCheckNAddStates(18, 20);
- }
+ if ((0xffffffffffffdbffL & l) != 0L)
+ jjCheckNAddStates(0, 2);
break;
case 51:
- if ((0x2400L & l) != 0L && kind > 6) {
+ if ((0x2400L & l) != 0L && kind > 6)
kind = 6;
- }
break;
case 52:
- if (curChar == 10 && kind > 6) {
+ if (curChar == 10 && kind > 6)
kind = 6;
- }
break;
case 53:
- if (curChar == 13) {
+ if (curChar == 13)
jjstateSet[jjnewStateCnt++] = 52;
- }
break;
case 54:
- if (curChar == 42) {
+ if (curChar == 42)
jjCheckNAddTwoStates(55, 56);
- }
break;
case 55:
- if ((0xfffffbffffffffffL & l) != 0L) {
+ if ((0xfffffbffffffffffL & l) != 0L)
jjCheckNAddTwoStates(55, 56);
- }
break;
case 56:
- if (curChar == 42) {
+ if (curChar == 42)
jjCheckNAddStates(34, 36);
- }
break;
case 57:
- if ((0xffff7bffffffffffL & l) != 0L) {
+ if ((0xffff7bffffffffffL & l) != 0L)
jjCheckNAddTwoStates(58, 56);
- }
break;
case 58:
- if ((0xfffffbffffffffffL & l) != 0L) {
+ if ((0xfffffbffffffffffL & l) != 0L)
jjCheckNAddTwoStates(58, 56);
- }
break;
case 59:
- if (curChar == 47 && kind > 7) {
+ if (curChar == 47 && kind > 7)
kind = 7;
- }
break;
case 60:
- if (curChar == 42) {
+ if (curChar == 42)
jjstateSet[jjnewStateCnt++] = 54;
- }
break;
case 61:
- if (curChar == 42) {
+ if (curChar == 42)
jjCheckNAddTwoStates(62, 63);
- }
break;
case 62:
- if ((0xfffffbffffffffffL & l) != 0L) {
+ if ((0xfffffbffffffffffL & l) != 0L)
jjCheckNAddTwoStates(62, 63);
- }
break;
case 63:
- if (curChar == 42) {
+ if (curChar == 42)
jjCheckNAddStates(37, 39);
- }
break;
case 64:
- if ((0xffff7bffffffffffL & l) != 0L) {
+ if ((0xffff7bffffffffffL & l) != 0L)
jjCheckNAddTwoStates(65, 63);
- }
break;
case 65:
- if ((0xfffffbffffffffffL & l) != 0L) {
+ if ((0xfffffbffffffffffL & l) != 0L)
jjCheckNAddTwoStates(65, 63);
- }
break;
case 66:
- if (curChar == 47 && kind > 8) {
+ if (curChar == 47 && kind > 8)
kind = 8;
- }
break;
default : break;
}
@@ -1357,97 +1188,79 @@
else if (curChar < 128)
{
long l = 1L << (curChar & 077);
- //MatchLoop
do
{
switch(jjstateSet[--i])
{
case 0:
case 28:
- if ((0x7fffffe87fffffeL & l) == 0L) {
+ if ((0x7fffffe87fffffeL & l) == 0L)
break;
- }
- if (kind > 67) {
+ if (kind > 67)
kind = 67;
- }
jjCheckNAdd(28);
break;
case 2:
- if ((0x100000001000L & l) != 0L && kind > 59) {
+ if ((0x100000001000L & l) != 0L && kind > 59)
kind = 59;
- }
break;
case 5:
- if ((0x2000000020L & l) != 0L) {
+ if ((0x2000000020L & l) != 0L)
jjAddStates(40, 41);
- }
break;
case 8:
- if ((0x5000000050L & l) != 0L && kind > 63) {
+ if ((0x5000000050L & l) != 0L && kind > 63)
kind = 63;
- }
break;
case 10:
- if ((0xffffffffefffffffL & l) != 0L) {
+ if ((0xffffffffefffffffL & l) != 0L)
jjCheckNAdd(11);
- }
break;
case 12:
- if (curChar == 92) {
+ if (curChar == 92)
jjAddStates(42, 44);
- }
break;
case 13:
- if ((0x14404410000000L & l) != 0L) {
+ if ((0x14404410000000L & l) != 0L)
jjCheckNAdd(11);
- }
break;
case 19:
- if ((0xffffffffefffffffL & l) != 0L) {
- jjCheckNAddStates(10, 12);
- }
+ if ((0xffffffffefffffffL & l) != 0L)
+ jjCheckNAddStates(13, 15);
break;
case 20:
- if (curChar == 92) {
+ if (curChar == 92)
jjAddStates(45, 47);
- }
break;
case 21:
- if ((0x14404410000000L & l) != 0L) {
- jjCheckNAddStates(10, 12);
- }
+ if ((0x14404410000000L & l) != 0L)
+ jjCheckNAddStates(13, 15);
break;
case 33:
- if ((0x2000000020L & l) != 0L) {
+ if ((0x2000000020L & l) != 0L)
jjAddStates(48, 49);
- }
break;
case 37:
- if ((0x2000000020L & l) != 0L) {
+ if ((0x2000000020L & l) != 0L)
jjAddStates(50, 51);
- }
break;
case 41:
- if ((0x2000000020L & l) != 0L) {
+ if ((0x2000000020L & l) != 0L)
jjAddStates(52, 53);
- }
break;
case 45:
- if ((0x100000001000000L & l) != 0L) {
+ if ((0x100000001000000L & l) != 0L)
jjCheckNAdd(46);
- }
break;
case 46:
- if ((0x7e0000007eL & l) == 0L) {
+ if ((0x7e0000007eL & l) == 0L)
break;
- }
- if (kind > 59) {
+ if (kind > 59)
kind = 59;
- }
jjCheckNAddTwoStates(46, 2);
break;
case 50:
- jjAddStates(18, 20);
+ jjAddStates(0, 2);
break;
case 55:
jjCheckNAddTwoStates(55, 56);
@@ -1474,57 +1287,47 @@
long l1 = 1L << (hiByte & 077);
int i2 = (curChar & 0xff) >> 6;
long l2 = 1L << (curChar & 077);
- //MatchLoop
do
{
switch(jjstateSet[--i])
{
case 0:
case 28:
- if (!jjCanMove_1(hiByte, i1, i2, l1, l2)) {
+ if (!jjCanMove_1(hiByte, i1, i2, l1, l2))
break;
- }
- if (kind > 67) {
+ if (kind > 67)
kind = 67;
- }
jjCheckNAdd(28);
break;
case 10:
- if (jjCanMove_0(hiByte, i1, i2, l1, l2)) {
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjstateSet[jjnewStateCnt++] = 11;
- }
break;
case 19:
- if (jjCanMove_0(hiByte, i1, i2, l1, l2)) {
- jjAddStates(10, 12);
- }
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ jjAddStates(13, 15);
break;
case 50:
- if (jjCanMove_0(hiByte, i1, i2, l1, l2)) {
- jjAddStates(18, 20);
- }
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
+ jjAddStates(0, 2);
break;
case 55:
- if (jjCanMove_0(hiByte, i1, i2, l1, l2)) {
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjCheckNAddTwoStates(55, 56);
- }
break;
case 57:
case 58:
- if (jjCanMove_0(hiByte, i1, i2, l1, l2)) {
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjCheckNAddTwoStates(58, 56);
- }
break;
case 62:
- if (jjCanMove_0(hiByte, i1, i2, l1, l2)) {
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjCheckNAddTwoStates(62, 63);
- }
break;
case 64:
case 65:
- if (jjCanMove_0(hiByte, i1, i2, l1, l2)) {
+ if (jjCanMove_0(hiByte, i1, i2, l1, l2))
jjCheckNAddTwoStates(65, 63);
- }
break;
default : break;
}
@@ -1537,16 +1340,15 @@
kind = 0x7fffffff;
}
++curPos;
- if ((i = jjnewStateCnt) == (startsAt = 67 - (jjnewStateCnt = startsAt))) {
+ if ((i = jjnewStateCnt) == (startsAt = 67 - (jjnewStateCnt = startsAt)))
return curPos;
- }
try { curChar = input_stream.readChar(); }
catch(java.io.IOException e) { return curPos; }
}
}
static final int[] jjnextStates = {
- 30, 31, 36, 37, 40, 41, 8, 49, 60, 61, 19, 20, 22, 10, 12, 45,
- 47, 2, 50, 51, 53, 4, 5, 8, 19, 20, 24, 22, 32, 33, 8, 40,
+ 50, 51, 53, 30, 31, 36, 37, 40, 41, 8, 49, 60, 61, 19, 20, 22,
+ 10, 12, 45, 47, 2, 4, 5, 8, 19, 20, 24, 22, 32, 33, 8, 40,
41, 8, 56, 57, 59, 63, 64, 66, 6, 7, 13, 14, 16, 21, 23, 25,
34, 35, 38, 39, 42, 43,
};
@@ -1557,9 +1359,8 @@
case 0:
return ((jjbitVec2[i2] & l2) != 0L);
default :
- if ((jjbitVec0[i1] & l1) != 0L) {
+ if ((jjbitVec0[i1] & l1) != 0L)
return true;
- }
return false;
}
}
@@ -1578,12 +1379,13 @@
case 61:
return ((jjbitVec8[i2] & l2) != 0L);
default :
- if ((jjbitVec3[i1] & l1) != 0L) {
+ if ((jjbitVec3[i1] & l1) != 0L)
return true;
- }
return false;
}
}
+
+/** Token literal values. */
public static final String[] jjstrLiteralImages = {
"", null, null, null, null, null, null, null, null,
"\141\142\163\164\162\141\143\164", "\142\157\157\154\145\141\156", "\142\162\145\141\153", "\142\171\164\145",
@@ -1606,6 +1408,8 @@
"\46\46", "\53\53", "\55\55", "\53", "\55", "\52", "\57", "\46", "\174", "\136", "\45",
"\74\74", "\76\76", "\76\76\76", "\53\75", "\55\75", "\52\75", "\57\75", "\46\75",
"\174\75", "\136\75", "\45\75", "\74\74\75", "\76\76\75", "\76\76\76\75", };
+
+/** Lexer state names. */
public static final String[] lexStateNames = {
"DEFAULT",
};
@@ -1618,61 +1422,76 @@
static final long[] jjtoSpecial = {
0x1c0L, 0x0L,
};
-private ASCII_UCodeESC_CharStream input_stream;
+protected JavaCharStream input_stream;
private final int[] jjrounds = new int[67];
private final int[] jjstateSet = new int[134];
protected char curChar;
-public ExpressionParserTokenManager(ASCII_UCodeESC_CharStream stream)
-{
- if (ASCII_UCodeESC_CharStream.staticFlag) {
+/** Constructor. */
+public ExpressionParserTokenManager(JavaCharStream stream){
+ if (JavaCharStream.staticFlag)
throw new Error("ERROR: Cannot use a static CharStream class with a non-static lexical analyzer.");
- }
input_stream = stream;
}
-public ExpressionParserTokenManager(ASCII_UCodeESC_CharStream stream, int lexState)
-{
+
+/** Constructor. */
+public ExpressionParserTokenManager(JavaCharStream stream, int lexState){
this(stream);
SwitchTo(lexState);
}
-public void ReInit(ASCII_UCodeESC_CharStream stream)
+
+/** Reinitialise parser. */
+public void ReInit(JavaCharStream stream)
{
jjmatchedPos = jjnewStateCnt = 0;
curLexState = defaultLexState;
input_stream = stream;
ReInitRounds();
}
-private final void ReInitRounds()
+private void ReInitRounds()
{
int i;
jjround = 0x80000001;
- for (i = 67; i-- > 0;) {
+ for (i = 67; i-- > 0;)
jjrounds[i] = 0x80000000;
}
-}
-public void ReInit(ASCII_UCodeESC_CharStream stream, int lexState)
+
+/** Reinitialise parser. */
+public void ReInit(JavaCharStream stream, int lexState)
{
ReInit(stream);
SwitchTo(lexState);
}
+
+/** Switch to specified lex state. */
public void SwitchTo(int lexState)
{
- if (lexState >= 1 || lexState < 0) {
+ if (lexState >= 1 || lexState < 0)
throw new TokenMgrError("Error: Ignoring invalid lexical state : " + lexState + ". State unchanged.", TokenMgrError.INVALID_LEXICAL_STATE);
- } else {
+ else
curLexState = lexState;
}
-}
-private final Token jjFillToken()
+protected Token jjFillToken()
{
- Token t = Token.newToken(jjmatchedKind);
- t.kind = jjmatchedKind;
+ final Token t;
+ final String curTokenImage;
+ final int beginLine;
+ final int endLine;
+ final int beginColumn;
+ final int endColumn;
String im = jjstrLiteralImages[jjmatchedKind];
- t.image = (im == null) ? input_stream.GetImage() : im;
- t.beginLine = input_stream.getBeginLine();
- t.beginColumn = input_stream.getBeginColumn();
- t.endLine = input_stream.getEndLine();
- t.endColumn = input_stream.getEndColumn();
+ curTokenImage = (im == null) ? input_stream.GetImage() : im;
+ beginLine = input_stream.getBeginLine();
+ beginColumn = input_stream.getBeginColumn();
+ endLine = input_stream.getEndLine();
+ endColumn = input_stream.getEndColumn();
+ t = Token.newToken(jjmatchedKind, curTokenImage);
+
+ t.beginLine = beginLine;
+ t.endLine = endLine;
+ t.beginColumn = beginColumn;
+ t.endColumn = endColumn;
+
return t;
}
@@ -1683,7 +1502,8 @@
int jjmatchedPos;
int jjmatchedKind;
-public final Token getNextToken()
+/** Get the next Token. */
+public Token getNextToken()
{
Token specialToken = null;
Token matchedToken;
@@ -1704,20 +1524,18 @@
return matchedToken;
}
- try {
- while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L) {
+ try { input_stream.backup(0);
+ while (curChar <= 32 && (0x100003600L & (1L << curChar)) != 0L)
curChar = input_stream.BeginToken();
}
- }
catch (java.io.IOException e1) { continue EOFLoop; }
jjmatchedKind = 0x7fffffff;
jjmatchedPos = 0;
curPos = jjMoveStringLiteralDfa0_0();
if (jjmatchedKind != 0x7fffffff)
{
- if (jjmatchedPos + 1 < curPos) {
+ if (jjmatchedPos + 1 < curPos)
input_stream.backup(curPos - jjmatchedPos - 1);
- }
if ((jjtoToken[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
{
matchedToken = jjFillToken();
@@ -1729,9 +1547,9 @@
if ((jjtoSpecial[jjmatchedKind >> 6] & (1L << (jjmatchedKind & 077))) != 0L)
{
matchedToken = jjFillToken();
- if (specialToken == null) {
+ if (specialToken == null)
specialToken = matchedToken;
- } else
+ else
{
matchedToken.specialToken = specialToken;
specialToken = (specialToken.next = matchedToken);
@@ -1751,9 +1569,9 @@
if (curChar == '\n' || curChar == '\r') {
error_line++;
error_column = 0;
- } else {
+ }
+ else
error_column++;
- }
}
if (!EOFSeen) {
input_stream.backup(1);
@@ -1763,4 +1581,31 @@
}
}
+private void jjCheckNAdd(int state)
+{
+ if (jjrounds[state] != jjround)
+ {
+ jjstateSet[jjnewStateCnt++] = state;
+ jjrounds[state] = jjround;
+ }
}
+private void jjAddStates(int start, int end)
+{
+ do {
+ jjstateSet[jjnewStateCnt++] = jjnextStates[start];
+ } while (start++ != end);
+}
+private void jjCheckNAddTwoStates(int state1, int state2)
+{
+ jjCheckNAdd(state1);
+ jjCheckNAdd(state2);
+}
+
+private void jjCheckNAddStates(int start, int end)
+{
+ do {
+ jjCheckNAdd(jjnextStates[start]);
+ } while (start++ != end);
+}
+
+}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/com/sun/tools/example/debug/expr/JavaCharStream.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/JavaCharStream.java Wed Jul 05 19:26:45 2017 +0200
@@ -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) */
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/com/sun/tools/example/debug/expr/LValue.java
--- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/LValue.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/LValue.java Wed Jul 05 19:26:45 2017 +0200
@@ -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 @@
}
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 @@
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);
+ }
+ }
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java
--- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/ParseException.java Wed Jul 05 19:26:45 2017 +0200
@@ -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 @@
*/
public class ParseException extends Exception {
- private static final long serialVersionUID = 7978489144303647901L;
+ /**
+ * The version identifier for this Serializable class.
+ * Increment only if the serialized 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:
+ * "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 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 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 @@
* 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 @@
}
}
+/* JavaCC - OriginalChecksum=3c9f049ed2bb6ade635c5bf58a386169 (do not edit this line) */
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/com/sun/tools/example/debug/expr/Token.java
--- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/Token.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/Token.java Wed Jul 05 19:26:45 2017 +0200
@@ -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 serialized 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 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.
@@ -85,12 +86,45 @@
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 @@
* 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) */
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java
--- a/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/com/sun/tools/example/debug/expr/TokenMgrError.java Wed Jul 05 19:26:45 2017 +0200
@@ -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 serialized 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;
+
+ /**
+ * Tried to change to an invalid lexical state.
+ */
+ static final int INVALID_LEXICAL_STATE = 2;
- /**
- * Detected (and bailed out of) an infinite loop in the token manager.
- */
- static final int LOOP_DETECTED = 3;
+ /**
+ * Detected (and bailed out of) an infinite loop in the token manager.
+ */
+ static final int LOOP_DETECTED = 3;
- /**
- * Indicates the reason why the exception is thrown. It will have
- * one of the above 4 values.
- */
- int errorCode;
+ /**
+ * Indicates the reason why the exception is thrown. It will have
+ * one of the above 4 values.
+ */
+ int errorCode;
- /**
- * 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;
- }
+ /**
+ * 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 ? " " : ("\"" + 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 ? " " : ("\"" + 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) */
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/com/sun/tools/jdi/ArrayTypeImpl.java
--- a/jdk/src/share/classes/com/sun/tools/jdi/ArrayTypeImpl.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/com/sun/tools/jdi/ArrayTypeImpl.java Wed Jul 05 19:26:45 2017 +0200
@@ -31,6 +31,7 @@
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 @@
return findType(componentSignature());
}
- void addVisibleMethods(Map map) {
+ @Override
+ void addVisibleMethods(Map map, Set seenInterfaces) {
// arrays don't have methods
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/com/sun/tools/jdi/ClassTypeImpl.java
--- a/jdk/src/share/classes/com/sun/tools/jdi/ClassTypeImpl.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/com/sun/tools/jdi/ClassTypeImpl.java Wed Jul 05 19:26:45 2017 +0200
@@ -382,7 +382,8 @@
}
}
- void addVisibleMethods(Map methodMap) {
+ @Override
+ void addVisibleMethods(Map methodMap, Set seenInterfaces) {
/*
* Add methods from
* parent types first, so that the methods in this class will
@@ -392,12 +393,15 @@
Iterator iter = interfaces().iterator();
while (iter.hasNext()) {
InterfaceTypeImpl interfaze = (InterfaceTypeImpl)iter.next();
- interfaze.addVisibleMethods(methodMap);
+ if (!seenInterfaces.contains(interfaze)) {
+ interfaze.addVisibleMethods(methodMap, seenInterfaces);
+ seenInterfaces.add(interfaze);
+ }
}
ClassTypeImpl clazz = (ClassTypeImpl)superclass();
if (clazz != null) {
- clazz.addVisibleMethods(methodMap);
+ clazz.addVisibleMethods(methodMap, seenInterfaces);
}
addToMethodMap(methodMap, methods());
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/com/sun/tools/jdi/InterfaceTypeImpl.java
--- a/jdk/src/share/classes/com/sun/tools/jdi/InterfaceTypeImpl.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/com/sun/tools/jdi/InterfaceTypeImpl.java Wed Jul 05 19:26:45 2017 +0200
@@ -32,6 +32,7 @@
import java.util.Map;
import java.util.Iterator;
import java.util.Collections;
+import java.util.Set;
import java.lang.ref.SoftReference;
public class InterfaceTypeImpl extends ReferenceTypeImpl
@@ -80,7 +81,8 @@
return implementors;
}
- void addVisibleMethods(Map methodMap) {
+ @Override
+ void addVisibleMethods(Map methodMap, Set seenInterfaces) {
/*
* Add methods from
* parent types first, so that the methods in this class will
@@ -88,7 +90,10 @@
*/
for (InterfaceType interfaze : superinterfaces()) {
- ((InterfaceTypeImpl)interfaze).addVisibleMethods(methodMap);
+ if (!seenInterfaces.contains(interfaze)) {
+ ((InterfaceTypeImpl)interfaze).addVisibleMethods(methodMap, seenInterfaces);
+ seenInterfaces.add(interfaze);
+ }
}
addToMethodMap(methodMap, methods());
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java
--- a/jdk/src/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java Wed Jul 05 19:26:45 2017 +0200
@@ -511,7 +511,7 @@
methodMap.put(method.name().concat(method.signature()), method);
}
- abstract void addVisibleMethods(Map methodMap);
+ abstract void addVisibleMethods(Map methodMap, Set seenInterfaces);
public List visibleMethods() {
/*
@@ -520,7 +520,7 @@
* concatenation of name and signature.
*/
Map map = new HashMap();
- addVisibleMethods(map);
+ addVisibleMethods(map, new HashSet());
/*
* ... but the hash map destroys order. Methods should be
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/awt/Dialog.java
--- a/jdk/src/share/classes/java/awt/Dialog.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/awt/Dialog.java Wed Jul 05 19:26:45 2017 +0200
@@ -34,11 +34,11 @@
import java.security.PrivilegedAction;
import javax.accessibility.*;
import sun.awt.AppContext;
+import sun.awt.AWTPermissions;
import sun.awt.SunToolkit;
import sun.awt.PeerEvent;
import sun.awt.util.IdentityArrayList;
import sun.awt.util.IdentityLinkedList;
-import sun.security.util.SecurityConstants;
import java.security.AccessControlException;
/**
@@ -1611,9 +1611,7 @@
if (mt == ModalityType.TOOLKIT_MODAL) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
- sm.checkPermission(
- SecurityConstants.AWT.TOOLKIT_MODALITY_PERMISSION
- );
+ sm.checkPermission(AWTPermissions.TOOLKIT_MODALITY_PERMISSION);
}
}
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/awt/MouseInfo.java
--- a/jdk/src/share/classes/java/awt/MouseInfo.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/awt/MouseInfo.java Wed Jul 05 19:26:45 2017 +0200
@@ -25,7 +25,8 @@
package java.awt;
-import sun.security.util.SecurityConstants;
+import sun.awt.AWTPermissions;
+
/**
* MouseInfo
provides methods for getting information about the mouse,
* such as mouse pointer location and the number of mouse buttons.
@@ -76,7 +77,7 @@
SecurityManager security = System.getSecurityManager();
if (security != null) {
- security.checkPermission(SecurityConstants.AWT.WATCH_MOUSE_PERMISSION);
+ security.checkPermission(AWTPermissions.WATCH_MOUSE_PERMISSION);
}
Point point = new Point(0, 0);
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/awt/Robot.java
--- a/jdk/src/share/classes/java/awt/Robot.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/awt/Robot.java Wed Jul 05 19:26:45 2017 +0200
@@ -34,10 +34,10 @@
import java.awt.image.WritableRaster;
import java.awt.peer.RobotPeer;
import java.lang.reflect.InvocationTargetException;
+import sun.awt.AWTPermissions;
import sun.awt.ComponentFactory;
import sun.awt.SunToolkit;
import sun.awt.image.SunWritableRaster;
-import sun.security.util.SecurityConstants;
/**
* This class is used to generate native system input events
@@ -167,7 +167,7 @@
private void checkRobotAllowed() {
SecurityManager security = System.getSecurityManager();
if (security != null) {
- security.checkPermission(SecurityConstants.AWT.CREATE_ROBOT_PERMISSION);
+ security.checkPermission(AWTPermissions.CREATE_ROBOT_PERMISSION);
}
}
@@ -465,8 +465,7 @@
private static void checkScreenCaptureAllowed() {
SecurityManager security = System.getSecurityManager();
if (security != null) {
- security.checkPermission(
- SecurityConstants.AWT.READ_DISPLAY_PIXELS_PERMISSION);
+ security.checkPermission(AWTPermissions.READ_DISPLAY_PIXELS_PERMISSION);
}
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/awt/SystemTray.java
--- a/jdk/src/share/classes/java/awt/SystemTray.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/awt/SystemTray.java Wed Jul 05 19:26:45 2017 +0200
@@ -32,8 +32,8 @@
import sun.awt.AppContext;
import sun.awt.SunToolkit;
import sun.awt.HeadlessToolkit;
-import sun.security.util.SecurityConstants;
import sun.awt.AWTAccessor;
+import sun.awt.AWTPermissions;
/**
* The SystemTray
class represents the system tray for a
@@ -503,7 +503,7 @@
static void checkSystemTrayAllowed() {
SecurityManager security = System.getSecurityManager();
if (security != null) {
- security.checkPermission(SecurityConstants.AWT.ACCESS_SYSTEM_TRAY_PERMISSION);
+ security.checkPermission(AWTPermissions.ACCESS_SYSTEM_TRAY_PERMISSION);
}
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/awt/TextComponent.java
--- a/jdk/src/share/classes/java/awt/TextComponent.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/awt/TextComponent.java Wed Jul 05 19:26:45 2017 +0200
@@ -30,12 +30,12 @@
import java.io.ObjectOutputStream;
import java.io.ObjectInputStream;
import java.io.IOException;
-import sun.awt.InputMethodSupport;
import java.text.BreakIterator;
import javax.swing.text.AttributeSet;
import javax.accessibility.*;
import java.awt.im.InputMethodRequests;
-import sun.security.util.SecurityConstants;
+import sun.awt.AWTPermissions;
+import sun.awt.InputMethodSupport;
/**
* The TextComponent
class is the superclass of
@@ -729,7 +729,7 @@
SecurityManager sm = System.getSecurityManager();
if (sm == null) return true;
try {
- sm.checkPermission(SecurityConstants.AWT.ACCESS_CLIPBOARD_PERMISSION);
+ sm.checkPermission(AWTPermissions.ACCESS_CLIPBOARD_PERMISSION);
return true;
} catch (SecurityException e) {}
return false;
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/awt/Toolkit.java
--- a/jdk/src/share/classes/java/awt/Toolkit.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/awt/Toolkit.java Wed Jul 05 19:26:45 2017 +0200
@@ -57,7 +57,7 @@
import sun.awt.PeerEvent;
import sun.awt.SunToolkit;
import sun.awt.AWTAccessor;
-import sun.security.util.SecurityConstants;
+import sun.awt.AWTPermissions;
import sun.util.CoreResourceBundleControl;
@@ -1731,7 +1731,7 @@
public final EventQueue getSystemEventQueue() {
SecurityManager security = System.getSecurityManager();
if (security != null) {
- security.checkPermission(SecurityConstants.AWT.CHECK_AWT_EVENTQUEUE_PERMISSION);
+ security.checkPermission(AWTPermissions.CHECK_AWT_EVENTQUEUE_PERMISSION);
}
return getSystemEventQueueImpl();
}
@@ -2063,7 +2063,7 @@
}
SecurityManager security = System.getSecurityManager();
if (security != null) {
- security.checkPermission(SecurityConstants.AWT.ALL_AWT_EVENTS_PERMISSION);
+ security.checkPermission(AWTPermissions.ALL_AWT_EVENTS_PERMISSION);
}
synchronized (this) {
SelectiveAWTEventListener selectiveListener =
@@ -2132,7 +2132,7 @@
}
SecurityManager security = System.getSecurityManager();
if (security != null) {
- security.checkPermission(SecurityConstants.AWT.ALL_AWT_EVENTS_PERMISSION);
+ security.checkPermission(AWTPermissions.ALL_AWT_EVENTS_PERMISSION);
}
synchronized (this) {
@@ -2197,7 +2197,7 @@
public AWTEventListener[] getAWTEventListeners() {
SecurityManager security = System.getSecurityManager();
if (security != null) {
- security.checkPermission(SecurityConstants.AWT.ALL_AWT_EVENTS_PERMISSION);
+ security.checkPermission(AWTPermissions.ALL_AWT_EVENTS_PERMISSION);
}
synchronized (this) {
EventListener[] la = ToolkitEventMulticaster.getListeners(eventListener,AWTEventListener.class);
@@ -2249,7 +2249,7 @@
public AWTEventListener[] getAWTEventListeners(long eventMask) {
SecurityManager security = System.getSecurityManager();
if (security != null) {
- security.checkPermission(SecurityConstants.AWT.ALL_AWT_EVENTS_PERMISSION);
+ security.checkPermission(AWTPermissions.ALL_AWT_EVENTS_PERMISSION);
}
synchronized (this) {
EventListener[] la = ToolkitEventMulticaster.getListeners(eventListener,AWTEventListener.class);
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/awt/Window.java
--- a/jdk/src/share/classes/java/awt/Window.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/awt/Window.java Wed Jul 05 19:26:45 2017 +0200
@@ -51,6 +51,7 @@
import java.util.concurrent.atomic.AtomicBoolean;
import javax.accessibility.*;
import sun.awt.AWTAccessor;
+import sun.awt.AWTPermissions;
import sun.awt.AppContext;
import sun.awt.CausedFocusEvent;
import sun.awt.SunToolkit;
@@ -58,7 +59,6 @@
import sun.java2d.Disposer;
import sun.java2d.pipe.Region;
import sun.security.action.GetPropertyAction;
-import sun.security.util.SecurityConstants;
import sun.util.logging.PlatformLogger;
/**
@@ -1386,7 +1386,7 @@
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
try {
- sm.checkPermission(SecurityConstants.AWT.TOPLEVEL_WINDOW_PERMISSION);
+ sm.checkPermission(AWTPermissions.TOPLEVEL_WINDOW_PERMISSION);
} catch (SecurityException se) {
// make sure the privileged action is only
// for getting the property! We don't want the
@@ -1680,7 +1680,7 @@
if (exclusionType == Dialog.ModalExclusionType.TOOLKIT_EXCLUDE) {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
- sm.checkPermission(SecurityConstants.AWT.TOOLKIT_MODALITY_PERMISSION);
+ sm.checkPermission(AWTPermissions.TOOLKIT_MODALITY_PERMISSION);
}
}
modalExclusionType = exclusionType;
@@ -2228,7 +2228,7 @@
public final void setAlwaysOnTop(boolean alwaysOnTop) throws SecurityException {
SecurityManager security = System.getSecurityManager();
if (security != null) {
- security.checkPermission(SecurityConstants.AWT.SET_WINDOW_ALWAYS_ON_TOP_PERMISSION);
+ security.checkPermission(AWTPermissions.SET_WINDOW_ALWAYS_ON_TOP_PERMISSION);
}
boolean oldAlwaysOnTop;
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/awt/event/InputEvent.java
--- a/jdk/src/share/classes/java/awt/event/InputEvent.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/awt/event/InputEvent.java Wed Jul 05 19:26:45 2017 +0200
@@ -32,8 +32,8 @@
import java.util.Arrays;
import sun.awt.AWTAccessor;
+import sun.awt.AWTPermissions;
import sun.util.logging.PlatformLogger;
-import sun.security.util.SecurityConstants;
/**
* The root event class for all component-level input events.
@@ -351,7 +351,7 @@
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
try {
- sm.checkPermission(SecurityConstants.AWT.ACCESS_CLIPBOARD_PERMISSION);
+ sm.checkPermission(AWTPermissions.ACCESS_CLIPBOARD_PERMISSION);
b = true;
} catch (SecurityException se) {
if (logger.isLoggable(PlatformLogger.Level.FINE)) {
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/lang/Enum.java
--- a/jdk/src/share/classes/java/lang/Enum.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/lang/Enum.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2011, 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
@@ -52,6 +52,8 @@
* @see java.util.EnumMap
* @since 1.5
*/
+@SuppressWarnings("serial") // No serialVersionUID needed due to
+ // special-casing of enum types.
public abstract class Enum>
implements Comparable, Serializable {
/**
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/lang/Integer.java
--- a/jdk/src/share/classes/java/lang/Integer.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/lang/Integer.java Wed Jul 05 19:26:45 2017 +0200
@@ -376,9 +376,6 @@
// JIT case the dispatch overhead doesn't exist and the
// "trick" is considerably faster than the classic code.
//
- // TODO-FIXME: convert (x * 52429) into the equiv shift-add
- // sequence.
- //
// RE: Division by Invariant Integers using Multiplication
// T Gralund, P Montgomery
// ACM PLDI 1994
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/lang/SecurityManager.java
--- a/jdk/src/share/classes/java/lang/SecurityManager.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/lang/SecurityManager.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -29,7 +29,6 @@
import java.io.FileDescriptor;
import java.io.File;
import java.io.FilePermission;
-import java.awt.AWTPermission;
import java.util.PropertyPermission;
import java.lang.RuntimePermission;
import java.net.SocketPermission;
@@ -67,9 +66,7 @@
* completion of the operation by throwing an exception. A security
* manager routine simply returns if the operation is permitted, but
* throws a SecurityException
if the operation is not
- * permitted. The only exception to this convention is
- * checkTopLevelWindow
, which returns a
- * boolean
value.
+ * permitted.
*
* The current security manager is set by the
* setSecurityManager
method in class
@@ -202,8 +199,6 @@
*
* @see java.lang.ClassLoader
* @see java.lang.SecurityException
- * @see java.lang.SecurityManager#checkTopLevelWindow(java.lang.Object)
- * checkTopLevelWindow
* @see java.lang.System#getSecurityManager() getSecurityManager
* @see java.lang.System#setSecurityManager(java.lang.SecurityManager)
* setSecurityManager
@@ -246,8 +241,7 @@
/**
* returns true if the current context has been granted AllPermission
*/
- private boolean hasAllPermission()
- {
+ private boolean hasAllPermission() {
try {
checkPermission(SecurityConstants.ALL_PERMISSION);
return true;
@@ -313,7 +307,7 @@
*
* @return the execution stack.
*/
- protected native Class[] getClassContext();
+ protected native Class>[] getClassContext();
/**
* Returns the class loader of the most recently executing method from
@@ -352,8 +346,7 @@
* @see #checkPermission(java.security.Permission) checkPermission
*/
@Deprecated
- protected ClassLoader currentClassLoader()
- {
+ protected ClassLoader currentClassLoader() {
ClassLoader cl = currentClassLoader0();
if ((cl != null) && hasAllPermission())
cl = null;
@@ -457,8 +450,7 @@
* @see #checkPermission(java.security.Permission) checkPermission
*/
@Deprecated
- protected int classLoaderDepth()
- {
+ protected int classLoaderDepth() {
int depth = classLoaderDepth0();
if (depth != -1) {
if (hasAllPermission())
@@ -1303,45 +1295,16 @@
}
/**
- * Returns false
if the calling
- * thread is not trusted to bring up the top-level window indicated
- * by the window
argument. In this case, the caller can
- * still decide to show the window, but the window should include
- * some sort of visual warning. If the method returns
- * true
, then the window can be shown without any
- * special restrictions.
- *
- * See class Window
for more information on trusted and
- * untrusted windows.
- *
- * This method calls
- * checkPermission
with the
- * AWTPermission("showWindowWithoutWarningBanner")
permission,
- * and returns true
if a SecurityException is not thrown,
- * otherwise it returns false
.
- * In the case of subset Profiles of Java SE that do not include the
- * {@code java.awt} package, {@code checkPermission} is instead called
- * to check the permission {@code java.security.AllPermission}.
- *
- * If you override this method, then you should make a call to
- * super.checkTopLevelWindow
- * at the point the overridden method would normally return
- * false
, and the value of
- * super.checkTopLevelWindow
should
- * be returned.
+ * Returns {@code true} if the calling thread has {@code AllPermission}.
*
- * @param window the new window that is being created.
- * @return true
if the calling thread is trusted to put up
- * top-level windows; false
otherwise.
- * @exception NullPointerException if the window
argument is
- * null
.
- * @deprecated The dependency on {@code AWTPermission} creates an
- * impediment to future modularization of the Java platform.
- * Users of this method should instead invoke
- * {@link #checkPermission} directly.
- * This method will be changed in a future release to check
- * the permission {@code java.security.AllPermission}.
- * @see java.awt.Window
+ * @param window not used except to check if it is {@code null}.
+ * @return {@code true} if the calling thread has {@code AllPermission}.
+ * @exception NullPointerException if the {@code window} argument is
+ * {@code null}.
+ * @deprecated This method was originally used to check if the calling thread
+ * was trusted to bring up a top-level window. The method has been
+ * obsoleted and code should instead use {@link #checkPermission}
+ * to check {@code AWTPermission("showWindowWithoutWarningBanner")}.
* @see #checkPermission(java.security.Permission) checkPermission
*/
@Deprecated
@@ -1349,17 +1312,7 @@
if (window == null) {
throw new NullPointerException("window can't be null");
}
- Permission perm = SecurityConstants.AWT.TOPLEVEL_WINDOW_PERMISSION;
- if (perm == null) {
- perm = SecurityConstants.ALL_PERMISSION;
- }
- try {
- checkPermission(perm);
- return true;
- } catch (SecurityException se) {
- // just return false
- }
- return false;
+ return hasAllPermission();
}
/**
@@ -1386,75 +1339,39 @@
}
/**
- * Throws a SecurityException
if the
- * calling thread is not allowed to access the system clipboard.
- *
- * This method calls checkPermission
with the
- * AWTPermission("accessClipboard")
- * permission.
- * In the case of subset Profiles of Java SE that do not include the
- * {@code java.awt} package, {@code checkPermission} is instead called
- * to check the permission {@code java.security.AllPermission}.
- *
- * If you override this method, then you should make a call to
- * super.checkSystemClipboardAccess
- * at the point the overridden method would normally throw an
- * exception.
+ * Throws {@code SecurityException} if the calling thread does
+ * not have {@code AllPermission}.
*
* @since JDK1.1
* @exception SecurityException if the calling thread does not have
- * permission to access the system clipboard.
- * @deprecated The dependency on {@code AWTPermission} creates an
- * impediment to future modularization of the Java platform.
- * Users of this method should instead invoke
- * {@link #checkPermission} directly.
- * This method will be changed in a future release to check
- * the permission {@code java.security.AllPermission}.
+ * {@code AllPermission}
+ * @deprecated This method was originally used to check if the calling
+ * thread could access the system clipboard. The method has been
+ * obsoleted and code should instead use {@link #checkPermission}
+ * to check {@code AWTPermission("accessClipboard")}.
* @see #checkPermission(java.security.Permission) checkPermission
*/
@Deprecated
public void checkSystemClipboardAccess() {
- Permission perm = SecurityConstants.AWT.ACCESS_CLIPBOARD_PERMISSION;
- if (perm == null) {
- perm = SecurityConstants.ALL_PERMISSION;
- }
- checkPermission(perm);
+ checkPermission(SecurityConstants.ALL_PERMISSION);
}
/**
- * Throws a SecurityException
if the
- * calling thread is not allowed to access the AWT event queue.
- *
- * This method calls checkPermission
with the
- * AWTPermission("accessEventQueue")
permission.
- * In the case of subset Profiles of Java SE that do not include the
- * {@code java.awt} package, {@code checkPermission} is instead called
- * to check the permission {@code java.security.AllPermission}.
- *
- *
- * If you override this method, then you should make a call to
- * super.checkAwtEventQueueAccess
- * at the point the overridden method would normally throw an
- * exception.
+ * Throws {@code SecurityException} if the calling thread does
+ * not have {@code AllPermission}.
*
* @since JDK1.1
* @exception SecurityException if the calling thread does not have
- * permission to access the AWT event queue.
- * @deprecated The dependency on {@code AWTPermission} creates an
- * impediment to future modularization of the Java platform.
- * Users of this method should instead invoke
- * {@link #checkPermission} directly.
- * This method will be changed in a future release to check
- * the permission {@code java.security.AllPermission}.
+ * {@code AllPermission}
+ * @deprecated This method was originally used to check if the calling
+ * thread could access the AWT event queue. The method has been
+ * obsoleted and code should instead use {@link #checkPermission}
+ * to check {@code AWTPermission("accessEventQueue")}.
* @see #checkPermission(java.security.Permission) checkPermission
*/
@Deprecated
public void checkAwtEventQueueAccess() {
- Permission perm = SecurityConstants.AWT.CHECK_AWT_EVENTQUEUE_PERMISSION;
- if (perm == null) {
- perm = SecurityConstants.ALL_PERMISSION;
- }
- checkPermission(perm);
+ checkPermission(SecurityConstants.ALL_PERMISSION);
}
/*
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/lang/annotation/Annotation.java
--- a/jdk/src/share/classes/java/lang/annotation/Annotation.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/lang/annotation/Annotation.java Wed Jul 05 19:26:45 2017 +0200
@@ -34,6 +34,10 @@
* More information about annotation types can be found in section 9.6 of
* The Java™ Language Specification .
*
+ * The {@link java.lang.reflect.AnnotatedElement} interface discusses
+ * compatibility concerns when evolving an annotation type from being
+ * non-repeatable to being repeatable.
+ *
* @author Josh Bloch
* @since 1.5
*/
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/lang/management/ManagementFactory.java
--- a/jdk/src/share/classes/java/lang/management/ManagementFactory.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/lang/management/ManagementFactory.java Wed Jul 05 19:26:45 2017 +0200
@@ -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
@@ -612,7 +612,7 @@
" is not an instance of " + mxbeanInterface);
}
- final Class[] interfaces;
+ final Class>[] interfaces;
// check if the registered MBean is a notification emitter
boolean emitter = connection.isInstanceOf(objName, NOTIF_EMITTER);
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/lang/reflect/AnnotatedElement.java
--- a/jdk/src/share/classes/java/lang/reflect/AnnotatedElement.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/lang/reflect/AnnotatedElement.java Wed Jul 05 19:26:45 2017 +0200
@@ -135,7 +135,77 @@
* annotations on E are directly present on E in place
* of their container annotation, in the order in which they appear in
* the value element of the container annotation.
-
+ *
+ *
There are several compatibility concerns to keep in mind if an
+ * annotation type T is originally not repeatable and
+ * later modified to be repeatable.
+ *
+ * The containing annotation type for T is TC .
+ *
+ *
+ *
+ * Modifying T to be repeatable is source and binary
+ * compatible with existing uses of T and with existing uses
+ * of TC .
+ *
+ * That is, for source compatibility, source code with annotations of
+ * type T or of type TC will still compile. For binary
+ * compatibility, class files with annotations of type T or of
+ * type TC (or with other kinds of uses of type T or of
+ * type TC ) will link against the modified version of T
+ * if they linked against the earlier version.
+ *
+ * (An annotation type TC may informally serve as an acting
+ * containing annotation type before T is modified to be
+ * formally repeatable. Alternatively, when T is made
+ * repeatable, TC can be introduced as a new type.)
+ *
+ * If an annotation type TC is present on an element, and
+ * T is modified to be repeatable with TC as its
+ * containing annotation type then:
+ *
+ *
+ *
+ * The change to T is behaviorally compatible with respect
+ * to the {@code get[Declared]Annotation(Class)} (called with an
+ * argument of T or TC ) and {@code
+ * get[Declared]Annotations()} methods because the results of the
+ * methods will not change due to TC becoming the containing
+ * annotation type for T .
+ *
+ * The change to T changes the results of the {@code
+ * get[Declared]AnnotationsByType(Class)} methods called with an
+ * argument of T , because those methods will now recognize an
+ * annotation of type TC as a container annotation for T
+ * and will "look through" it to expose annotations of type T .
+ *
+ *
+ *
+ * If an annotation of type T is present on an
+ * element and T is made repeatable and more annotations of
+ * type T are added to the element:
+ *
+ *
+ *
+ * The addition of the annotations of type T is both
+ * source compatible and binary compatible.
+ *
+ * The addition of the annotations of type T changes the results
+ * of the {@code get[Declared]Annotation(Class)} methods and {@code
+ * get[Declared]Annotations()} methods, because those methods will now
+ * only see a container annotation on the element and not see an
+ * annotation of type T .
+ *
+ * The addition of the annotations of type T changes the
+ * results of the {@code get[Declared]AnnotationsByType(Class)}
+ * methods, because their results will expose the additional
+ * annotations of type T whereas previously they exposed only a
+ * single annotation of type T .
+ *
+ *
+ *
+ *
+ *
* If an annotation returned by a method in this interface contains
* (directly or indirectly) a {@link Class}-valued member referring to
* a class that is not accessible in this VM, attempting to read the class
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/lang/reflect/Constructor.java
--- a/jdk/src/share/classes/java/lang/reflect/Constructor.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/lang/reflect/Constructor.java Wed Jul 05 19:26:45 2017 +0200
@@ -204,6 +204,7 @@
/**
* {@inheritDoc}
+ * @since 1.8
*/
public int getParameterCount() { return parameterTypes.length; }
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/lang/reflect/Executable.java
--- a/jdk/src/share/classes/java/lang/reflect/Executable.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/lang/reflect/Executable.java Wed Jul 05 19:26:45 2017 +0200
@@ -240,7 +240,6 @@
* declared or implicitly declared or neither) for the executable
* represented by this object.
*
- * @since 1.8
* @return The number of formal parameters for the executable this
* object represents
*/
@@ -291,7 +290,6 @@
* have unique names, or names that are legal identifiers in the
* Java programming language (JLS 3.8).
*
- * @since 1.8
* @throws MalformedParametersException if the class file contains
* a MethodParameters attribute that is improperly formatted.
* @return an array of {@code Parameter} objects representing all
@@ -523,7 +521,6 @@
/**
* {@inheritDoc}
* @throws NullPointerException {@inheritDoc}
- * @since 1.8
*/
@Override
public T[] getAnnotationsByType(Class annotationClass) {
@@ -566,8 +563,6 @@
*
* @return an object representing the return type of the method
* or constructor represented by this {@code Executable}
- *
- * @since 1.8
*/
public abstract AnnotatedType getAnnotatedReturnType();
@@ -576,8 +571,6 @@
* Returns an AnnotatedType object that represents the use of a type to
* specify the return type of the method/constructor represented by this
* Executable.
- *
- * @since 1.8
*/
AnnotatedType getAnnotatedReturnType0(Type returnType) {
return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(),
@@ -607,8 +600,6 @@
*
* @return an object representing the receiver type of the method or
* constructor represented by this {@code Executable}
- *
- * @since 1.8
*/
public AnnotatedType getAnnotatedReceiverType() {
if (Modifier.isStatic(this.getModifiers()))
@@ -635,8 +626,6 @@
* @return an array of objects representing the types of the
* formal parameters of the method or constructor represented by this
* {@code Executable}
- *
- * @since 1.8
*/
public AnnotatedType[] getAnnotatedParameterTypes() {
return TypeAnnotationParser.buildAnnotatedTypes(getTypeAnnotationBytes0(),
@@ -661,8 +650,6 @@
* @return an array of objects representing the declared
* exceptions of the method or constructor represented by this {@code
* Executable}
- *
- * @since 1.8
*/
public AnnotatedType[] getAnnotatedExceptionTypes() {
return TypeAnnotationParser.buildAnnotatedTypes(getTypeAnnotationBytes0(),
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/lang/reflect/Method.java
--- a/jdk/src/share/classes/java/lang/reflect/Method.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/lang/reflect/Method.java Wed Jul 05 19:26:45 2017 +0200
@@ -252,6 +252,7 @@
/**
* {@inheritDoc}
+ * @since 1.8
*/
public int getParameterCount() { return parameterTypes.length; }
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/math/BigInteger.java
--- a/jdk/src/share/classes/java/math/BigInteger.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/math/BigInteger.java Wed Jul 05 19:26:45 2017 +0200
@@ -268,7 +268,15 @@
*/
private static final int SCHOENHAGE_BASE_CONVERSION_THRESHOLD = 20;
- //Constructors
+ /**
+ * The threshold value for using squaring code to perform multiplication
+ * of a {@code BigInteger} instance by itself. If the number of ints in
+ * the number are larger than this value, {@code multiply(this)} will
+ * return {@code square()}.
+ */
+ private static final int MULTIPLY_SQUARE_THRESHOLD = 20;
+
+ // Constructors
/**
* Translates a byte array containing the two's-complement binary
@@ -1458,6 +1466,9 @@
/**
* Returns a BigInteger whose value is {@code (this * val)}.
*
+ * @implNote An implementation may offer better algorithmic
+ * performance when {@code val == this}.
+ *
* @param val value to be multiplied by this BigInteger.
* @return {@code this * val}
*/
@@ -1466,6 +1477,11 @@
return ZERO;
int xlen = mag.length;
+
+ if (val == this && xlen > MULTIPLY_SQUARE_THRESHOLD) {
+ return square();
+ }
+
int ylen = val.mag.length;
if ((xlen < KARATSUBA_THRESHOLD) || (ylen < KARATSUBA_THRESHOLD)) {
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/net/Inet6Address.java
--- a/jdk/src/share/classes/java/net/Inet6Address.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/net/Inet6Address.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -604,9 +604,9 @@
ObjectInputStream.GetField gf = s.readFields();
byte[] ipaddress = (byte[])gf.get("ipaddress", null);
- int scope_id = (int)gf.get("scope_id", -1);
- boolean scope_id_set = (boolean)gf.get("scope_id_set", false);
- boolean scope_ifname_set = (boolean)gf.get("scope_ifname_set", false);
+ int scope_id = gf.get("scope_id", -1);
+ boolean scope_id_set = gf.get("scope_id_set", false);
+ boolean scope_ifname_set = gf.get("scope_ifname_set", false);
String ifname = (String)gf.get("ifname", null);
if (ifname != null && !"".equals (ifname)) {
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/net/URL.java
--- a/jdk/src/share/classes/java/net/URL.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/net/URL.java Wed Jul 05 19:26:45 2017 +0200
@@ -978,8 +978,8 @@
* support proxing will ignore the proxy parameter and make a
* normal connection.
*
- * Invoking this method preempts the system's default ProxySelector
- * settings.
+ * Invoking this method preempts the system's default
+ * {@link java.net.ProxySelector ProxySelector} settings.
*
* @param proxy the Proxy through which this connection
* will be made. If direct connection is desired,
@@ -1055,7 +1055,7 @@
/**
* Gets the contents of this URL. This method is a shorthand for:
*
- * openConnection().getContent(Class[])
+ * openConnection().getContent(classes)
*
*
* @param classes an array of Java types
@@ -1066,7 +1066,7 @@
* @see java.net.URLConnection#getContent(Class[])
* @since 1.3
*/
- public final Object getContent(Class[] classes)
+ public final Object getContent(Class>[] classes)
throws java.io.IOException {
return openConnection().getContent(classes);
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/net/URLConnection.java
--- a/jdk/src/share/classes/java/net/URLConnection.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/net/URLConnection.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -760,7 +760,7 @@
* @see java.net.URLConnection#setContentHandlerFactory(java.net.ContentHandlerFactory)
* @since 1.3
*/
- public Object getContent(Class[] classes) throws IOException {
+ public Object getContent(Class>[] classes) throws IOException {
// Must call getInputStream before GetHeaderField gets called
// so that FileNotFoundException has a chance to be thrown up
// from here without being caught.
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/net/URLPermission.java
--- a/jdk/src/share/classes/java/net/URLPermission.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/net/URLPermission.java Wed Jul 05 19:26:45 2017 +0200
@@ -47,7 +47,7 @@
* class.
* authority is specified as:
*
- * authority = hostrange [ : portrange ]
+ * authority = [ userinfo @ ] hostrange [ : portrange ]
* portrange = portnumber | -portnumber | portnumber-[portnumber] | *
* hostrange = ([*.] dnsname) | IPv4address | IPv6address
*
@@ -65,6 +65,9 @@
* (default 443). No default is assumed for other schemes. A wildcard may be specified
* which means all ports.
*
+ * userinfo is optional. A userinfo component if present, is ignored when
+ * creating a URLPermission, and has no effect on any other methods defined by this class.
+ *
* The path component comprises a sequence of path segments,
* separated by '/' characters. path may also be empty. The path is specified
* in a similar way to the path in {@link java.io.FilePermission}. There are
@@ -473,7 +476,12 @@
HostPortrange p;
Authority(String scheme, String authority) {
- p = new HostPortrange(scheme, authority);
+ int at = authority.indexOf('@');
+ if (at == -1) {
+ p = new HostPortrange(scheme, authority);
+ } else {
+ p = new HostPortrange(scheme, authority.substring(at+1));
+ }
}
boolean implies(Authority other) {
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/net/URLStreamHandler.java
--- a/jdk/src/share/classes/java/net/URLStreamHandler.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/net/URLStreamHandler.java Wed Jul 05 19:26:45 2017 +0200
@@ -76,8 +76,8 @@
* support proxying will ignore the proxy parameter and make a
* normal connection.
*
- * Calling this method preempts the system's default ProxySelector
- * settings.
+ * Calling this method preempts the system's default
+ * {@link java.net.ProxySelector ProxySelector} settings.
*
* @param u the URL that this connects to.
* @param p the proxy through which the connection will be made.
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/nio/channels/spi/SelectorProvider.java
--- a/jdk/src/share/classes/java/nio/channels/spi/SelectorProvider.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/nio/channels/spi/SelectorProvider.java Wed Jul 05 19:26:45 2017 +0200
@@ -71,6 +71,14 @@
private static final Object lock = new Object();
private static SelectorProvider provider = null;
+ private static Void checkPermission() {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null)
+ sm.checkPermission(new RuntimePermission("selectorProvider"));
+ return null;
+ }
+ private SelectorProvider(Void ignore) { }
+
/**
* Initializes a new instance of this class.
*
@@ -79,9 +87,7 @@
* {@link RuntimePermission}("selectorProvider")
*/
protected SelectorProvider() {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkPermission(new RuntimePermission("selectorProvider"));
+ this(checkPermission());
}
private static boolean loadProviderFromProperty() {
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/nio/charset/spi/CharsetProvider.java
--- a/jdk/src/share/classes/java/nio/charset/spi/CharsetProvider.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/nio/charset/spi/CharsetProvider.java Wed Jul 05 19:26:45 2017 +0200
@@ -71,6 +71,14 @@
public abstract class CharsetProvider {
+ private static Void checkPermission() {
+ SecurityManager sm = System.getSecurityManager();
+ if (sm != null)
+ sm.checkPermission(new RuntimePermission("charsetProvider"));
+ return null;
+ }
+ private CharsetProvider(Void ignore) { }
+
/**
* Initializes a new charset provider.
*
@@ -79,9 +87,7 @@
* {@link RuntimePermission}("charsetProvider")
*/
protected CharsetProvider() {
- SecurityManager sm = System.getSecurityManager();
- if (sm != null)
- sm.checkPermission(new RuntimePermission("charsetProvider"));
+ this(checkPermission());
}
/**
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/security/Provider.java
--- a/jdk/src/share/classes/java/security/Provider.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/security/Provider.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -1405,7 +1405,7 @@
private String[] supportedFormats;
// names of the supported key (super) classes
- private Class[] supportedClasses;
+ private Class>[] supportedClasses;
// whether this service has been registered with the Provider
private boolean registered;
@@ -1656,7 +1656,7 @@
return o;
}
Class> argClass = constructorParameter.getClass();
- Constructor[] cons = clazz.getConstructors();
+ Constructor>[] cons = clazz.getConstructors();
// find first public constructor that can take the
// argument as parameter
for (int i = 0; i < cons.length; i++) {
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/security/UnresolvedPermission.java
--- a/jdk/src/share/classes/java/security/UnresolvedPermission.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/security/UnresolvedPermission.java Wed Jul 05 19:26:45 2017 +0200
@@ -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
@@ -216,9 +216,9 @@
}
- private static final Class[] PARAMS0 = { };
- private static final Class[] PARAMS1 = { String.class };
- private static final Class[] PARAMS2 = { String.class, String.class };
+ private static final Class>[] PARAMS0 = { };
+ private static final Class>[] PARAMS1 = { String.class };
+ private static final Class>[] PARAMS2 = { String.class, String.class };
/**
* try and resolve this permission using the class loader of the permission
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/Duration.java
--- a/jdk/src/share/classes/java/time/Duration.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/Duration.java Wed Jul 05 19:26:45 2017 +0200
@@ -74,7 +74,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
-import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.BigInteger;
@@ -118,6 +118,13 @@
* most applications.
* See {@link Instant} for a discussion as to the meaning of the second and time-scales.
*
+ *
+ * This is a value-based
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code Duration} may have unpredictable results and should be avoided.
+ * The {@code equals} method should be used for comparisons.
+ *
* @implSpec
* This class is immutable and thread-safe.
*
@@ -1105,29 +1112,29 @@
//-----------------------------------------------------------------------
/**
- * Gets the number of minutes in this duration.
+ * Gets the number of days in this duration.
*
- * This returns the total number of minutes in the duration by dividing the
+ * This returns the total number of days in the duration by dividing the
* number of seconds by 86400.
* This is based on the standard definition of a day as 24 hours.
*
* This instance is immutable and unaffected by this method call.
*
- * @return the number of minutes in the duration, may be negative
+ * @return the number of days in the duration, may be negative
*/
public long toDays() {
return seconds / SECONDS_PER_DAY;
}
/**
- * Gets the number of minutes in this duration.
+ * Gets the number of hours in this duration.
*
- * This returns the total number of minutes in the duration by dividing the
+ * This returns the total number of hours in the duration by dividing the
* number of seconds by 3600.
*
* This instance is immutable and unaffected by this method call.
*
- * @return the number of minutes in the duration, may be negative
+ * @return the number of hours in the duration, may be negative
*/
public long toHours() {
return seconds / SECONDS_PER_HOUR;
@@ -1318,10 +1325,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/Instant.java
--- a/jdk/src/share/classes/java/time/Instant.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/Instant.java Wed Jul 05 19:26:45 2017 +0200
@@ -76,6 +76,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
@@ -196,6 +197,13 @@
* This includes {@code Instant}, {@code LocalDate}, {@code LocalTime}, {@code OffsetDateTime},
* {@code ZonedDateTime} and {@code Duration}.
*
+ *
+ * This is a value-based
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code Instant} may have unpredictable results and should be avoided.
+ * The {@code equals} method should be used for comparisons.
+ *
* @implSpec
* This class is immutable and thread-safe.
*
@@ -1339,10 +1347,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/LocalDate.java
--- a/jdk/src/share/classes/java/time/LocalDate.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/LocalDate.java Wed Jul 05 19:26:45 2017 +0200
@@ -78,6 +78,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.chrono.ChronoLocalDate;
import java.time.chrono.Era;
@@ -121,6 +122,13 @@
* However, any application that makes use of historical dates, and requires them
* to be accurate will find the ISO-8601 approach unsuitable.
*
+ *
+ * This is a value-based
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code LocalDate} may have unpredictable results and should be avoided.
+ * The {@code equals} method should be used for comparisons.
+ *
* @implSpec
* This class is immutable and thread-safe.
*
@@ -2044,10 +2052,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/LocalDateTime.java
--- a/jdk/src/share/classes/java/time/LocalDateTime.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/LocalDateTime.java Wed Jul 05 19:26:45 2017 +0200
@@ -76,6 +76,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.chrono.ChronoLocalDateTime;
import java.time.format.DateTimeFormatter;
@@ -119,6 +120,13 @@
* However, any application that makes use of historical dates, and requires them
* to be accurate will find the ISO-8601 approach unsuitable.
*
+ *
+ * This is a value-based
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code LocalDateTime} may have unpredictable results and should be avoided.
+ * The {@code equals} method should be used for comparisons.
+ *
* @implSpec
* This class is immutable and thread-safe.
*
@@ -1977,10 +1985,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/LocalTime.java
--- a/jdk/src/share/classes/java/time/LocalTime.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/LocalTime.java Wed Jul 05 19:26:45 2017 +0200
@@ -74,6 +74,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
@@ -109,6 +110,13 @@
* in most of the world. This API assumes that all calendar systems use the same
* representation, this class, for time-of-day.
*
+ *
+ * This is a value-based
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code LocalTime} may have unpredictable results and should be avoided.
+ * The {@code equals} method should be used for comparisons.
+ *
* @implSpec
* This class is immutable and thread-safe.
*
@@ -1629,10 +1637,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/MonthDay.java
--- a/jdk/src/share/classes/java/time/MonthDay.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/MonthDay.java Wed Jul 05 19:26:45 2017 +0200
@@ -68,6 +68,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.chrono.Chronology;
import java.time.chrono.IsoChronology;
@@ -111,6 +112,13 @@
* However, any application that makes use of historical dates, and requires them
* to be accurate will find the ISO-8601 approach unsuitable.
*
+ *
+ * This is a value-based
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code MonthDay} may have unpredictable results and should be avoided.
+ * The {@code equals} method should be used for comparisons.
+ *
* @implSpec
* This class is immutable and thread-safe.
*
@@ -762,10 +770,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/OffsetDateTime.java
--- a/jdk/src/share/classes/java/time/OffsetDateTime.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/OffsetDateTime.java Wed Jul 05 19:26:45 2017 +0200
@@ -72,6 +72,7 @@
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.chrono.IsoChronology;
import java.time.format.DateTimeFormatter;
@@ -112,6 +113,13 @@
* in simpler applications. This class may be used when modeling date-time concepts in
* more detail, or when communicating to a database or in a network protocol.
*
+ *
+ * This is a value-based
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code OffsetDateTime} may have unpredictable results and should be avoided.
+ * The {@code equals} method should be used for comparisons.
+ *
* @implSpec
* This class is immutable and thread-safe.
*
@@ -1916,10 +1924,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/OffsetTime.java
--- a/jdk/src/share/classes/java/time/OffsetTime.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/OffsetTime.java Wed Jul 05 19:26:45 2017 +0200
@@ -73,6 +73,7 @@
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
@@ -102,6 +103,13 @@
* For example, the value "13:45.30.123456789+02:00" can be stored
* in an {@code OffsetTime}.
*
+ *
+ * This is a value-based
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code OffsetTime} may have unpredictable results and should be avoided.
+ * The {@code equals} method should be used for comparisons.
+ *
* @implSpec
* This class is immutable and thread-safe.
*
@@ -1387,10 +1395,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/Period.java
--- a/jdk/src/share/classes/java/time/Period.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/Period.java Wed Jul 05 19:26:45 2017 +0200
@@ -69,6 +69,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.chrono.ChronoLocalDate;
import java.time.chrono.ChronoPeriod;
@@ -119,6 +120,13 @@
* The period is modeled as a directed amount of time, meaning that individual parts of the
* period may be negative.
*
+ *
+ * This is a value-based
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code Period} may have unpredictable results and should be avoided.
+ * The {@code equals} method should be used for comparisons.
+ *
* @implSpec
* This class is immutable and thread-safe.
*
@@ -1049,10 +1057,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws java.io.InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/Year.java
--- a/jdk/src/share/classes/java/time/Year.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/Year.java Wed Jul 05 19:26:45 2017 +0200
@@ -74,6 +74,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.chrono.Chronology;
import java.time.chrono.IsoChronology;
@@ -119,6 +120,13 @@
* However, any application that makes use of historical dates, and requires them
* to be accurate will find the ISO-8601 approach unsuitable.
*
+ *
+ * This is a value-based
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code Year} may have unpredictable results and should be avoided.
+ * The {@code equals} method should be used for comparisons.
+ *
* @implSpec
* This class is immutable and thread-safe.
*
@@ -1095,10 +1103,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/YearMonth.java
--- a/jdk/src/share/classes/java/time/YearMonth.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/YearMonth.java Wed Jul 05 19:26:45 2017 +0200
@@ -77,6 +77,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.chrono.Chronology;
import java.time.chrono.IsoChronology;
@@ -115,6 +116,13 @@
* However, any application that makes use of historical dates, and requires them
* to be accurate will find the ISO-8601 approach unsuitable.
*
+ *
+ * This is a value-based
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code YearMonth} may have unpredictable results and should be avoided.
+ * The {@code equals} method should be used for comparisons.
+ *
* @implSpec
* This class is immutable and thread-safe.
*
@@ -1221,10 +1229,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/ZoneId.java
--- a/jdk/src/share/classes/java/time/ZoneId.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/ZoneId.java Wed Jul 05 19:26:45 2017 +0200
@@ -64,6 +64,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.format.DateTimeFormatterBuilder;
import java.time.format.TextStyle;
@@ -159,6 +160,13 @@
* This approach is designed to allow a {@link ZonedDateTime} to be loaded and
* queried, but not modified, on a Java Runtime with incomplete time-zone information.
*
+ *
+ * This is a value-based
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code ZoneId} may have unpredictable results and should be avoided.
+ * The {@code equals} method should be used for comparisons.
+ *
* @implSpec
* This abstract class has two implementations, both of which are immutable and thread-safe.
* One implementation models region-based IDs, the other is {@code ZoneOffset} modelling
@@ -615,10 +623,10 @@
//-----------------------------------------------------------------------
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/ZoneOffset.java
--- a/jdk/src/share/classes/java/time/ZoneOffset.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/ZoneOffset.java Wed Jul 05 19:26:45 2017 +0200
@@ -70,6 +70,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.temporal.ChronoField;
import java.time.temporal.Temporal;
@@ -114,6 +115,13 @@
* Implementations may choose to cache certain common offsets, however
* applications must not rely on such caching.
*
+ *
+ * This is a value-based
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code ZoneOffset} may have unpredictable results and should be avoided.
+ * The {@code equals} method should be used for comparisons.
+ *
* @implSpec
* This class is immutable and thread-safe.
*
@@ -760,10 +768,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/ZoneRegion.java
--- a/jdk/src/share/classes/java/time/ZoneRegion.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/ZoneRegion.java Wed Jul 05 19:26:45 2017 +0200
@@ -60,7 +60,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
-import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.zone.ZoneRules;
import java.time.zone.ZoneRulesException;
@@ -195,10 +195,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/ZonedDateTime.java
--- a/jdk/src/share/classes/java/time/ZonedDateTime.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/ZonedDateTime.java Wed Jul 05 19:26:45 2017 +0200
@@ -67,9 +67,9 @@
import java.io.DataOutput;
import java.io.IOException;
-import java.io.InvalidObjectException;
import java.io.ObjectInput;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.chrono.ChronoZonedDateTime;
import java.time.format.DateTimeFormatter;
@@ -142,6 +142,13 @@
* a vital, but secondary, piece of information, used to ensure that the class
* represents an instant, especially during a daylight savings overlap.
*
+ *
+ * This is a value-based
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code ZonedDateTime} may have unpredictable results and should be avoided.
+ * The {@code equals} method should be used for comparisons.
+ *
* @implSpec
* A {@code ZonedDateTime} holds state equivalent to three separate objects,
* a {@code LocalDateTime}, a {@code ZoneId} and the resolved {@code ZoneOffset}.
@@ -2217,10 +2224,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/chrono/AbstractChronology.java
--- a/jdk/src/share/classes/java/time/chrono/AbstractChronology.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/chrono/AbstractChronology.java Wed Jul 05 19:26:45 2017 +0200
@@ -83,6 +83,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.ObjectStreamException;
import java.io.Serializable;
import java.time.DateTimeException;
@@ -764,10 +765,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws java.io.InvalidObjectException always
*/
- private Object readResolve() throws ObjectStreamException {
+ private void readObject(ObjectInputStream s) throws ObjectStreamException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java
--- a/jdk/src/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/chrono/ChronoLocalDateTimeImpl.java Wed Jul 05 19:26:45 2017 +0200
@@ -66,8 +66,8 @@
import java.io.IOException;
import java.io.InvalidObjectException;
import java.io.ObjectInput;
+import java.io.ObjectInputStream;
import java.io.ObjectOutput;
-import java.io.ObjectStreamException;
import java.io.Serializable;
import java.time.LocalTime;
import java.time.ZoneId;
@@ -415,10 +415,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/chrono/ChronoPeriodImpl.java
--- a/jdk/src/share/classes/java/time/chrono/ChronoPeriodImpl.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/chrono/ChronoPeriodImpl.java Wed Jul 05 19:26:45 2017 +0200
@@ -65,6 +65,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.ObjectStreamException;
import java.io.Serializable;
import java.time.DateTimeException;
@@ -374,10 +375,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws ObjectStreamException {
+ private void readObject(ObjectInputStream s) throws ObjectStreamException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java
--- a/jdk/src/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/chrono/ChronoZonedDateTimeImpl.java Wed Jul 05 19:26:45 2017 +0200
@@ -66,8 +66,8 @@
import java.io.IOException;
import java.io.InvalidObjectException;
import java.io.ObjectInput;
+import java.io.ObjectInputStream;
import java.io.ObjectOutput;
-import java.io.ObjectStreamException;
import java.io.Serializable;
import java.time.Instant;
import java.time.LocalDateTime;
@@ -339,10 +339,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/chrono/HijrahChronology.java
--- a/jdk/src/share/classes/java/time/chrono/HijrahChronology.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/chrono/HijrahChronology.java Wed Jul 05 19:26:45 2017 +0200
@@ -64,7 +64,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InvalidObjectException;
-import java.io.ObjectStreamException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.security.AccessController;
import java.security.PrivilegedActionException;
@@ -1095,10 +1095,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/chrono/HijrahDate.java
--- a/jdk/src/share/classes/java/time/chrono/HijrahDate.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/chrono/HijrahDate.java Wed Jul 05 19:26:45 2017 +0200
@@ -67,6 +67,7 @@
import java.io.IOException;
import java.io.InvalidObjectException;
import java.io.ObjectInput;
+import java.io.ObjectInputStream;
import java.io.ObjectOutput;
import java.io.Serializable;
import java.time.Clock;
@@ -102,6 +103,14 @@
* to create new HijrahDate instances.
* Alternatively, the {@link #withVariant} method can be used to convert
* to a new HijrahChronology.
+ *
+ *
+ * This is a value-based
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code HijrahDate} may have unpredictable results and should be avoided.
+ * The {@code equals} method should be used for comparisons.
+ *
* @implSpec
* This class is immutable and thread-safe.
*
@@ -599,13 +608,55 @@
return getChronology().period(Math.toIntExact(years), months, days);
}
+ //-------------------------------------------------------------------------
+ /**
+ * Compares this date to another date, including the chronology.
+ *
+ * Compares this {@code HijrahDate} with another ensuring that the date is the same.
+ *
+ * Only objects of type {@code HijrahDate} are compared, other types return false.
+ * To compare the dates of two {@code TemporalAccessor} instances, including dates
+ * in two different chronologies, use {@link ChronoField#EPOCH_DAY} as a comparator.
+ *
+ * @param obj the object to check, null returns false
+ * @return true if this is equal to the other date and the Chronologies are equal
+ */
+ @Override // override for performance
+ public boolean equals(Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj instanceof HijrahDate) {
+ HijrahDate otherDate = (HijrahDate) obj;
+ return prolepticYear == otherDate.prolepticYear
+ && this.monthOfYear == otherDate.monthOfYear
+ && this.dayOfMonth == otherDate.dayOfMonth
+ && getChronology().equals(otherDate.getChronology());
+ }
+ return false;
+ }
+
+ /**
+ * A hash code for this date.
+ *
+ * @return a suitable hash code based only on the Chronology and the date
+ */
+ @Override // override for performance
+ public int hashCode() {
+ int yearValue = prolepticYear;
+ int monthValue = monthOfYear;
+ int dayValue = dayOfMonth;
+ return getChronology().getId().hashCode() ^ (yearValue & 0xFFFFF800)
+ ^ ((yearValue << 11) + (monthValue << 6) + (dayValue));
+ }
+
//-----------------------------------------------------------------------
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/chrono/IsoChronology.java
--- a/jdk/src/share/classes/java/time/chrono/IsoChronology.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/chrono/IsoChronology.java Wed Jul 05 19:26:45 2017 +0200
@@ -62,7 +62,6 @@
package java.time.chrono;
import java.io.InvalidObjectException;
-import java.io.ObjectStreamException;
import static java.time.temporal.ChronoField.DAY_OF_MONTH;
import static java.time.temporal.ChronoField.ERA;
import static java.time.temporal.ChronoField.MONTH_OF_YEAR;
@@ -70,6 +69,7 @@
import static java.time.temporal.ChronoField.YEAR;
import static java.time.temporal.ChronoField.YEAR_OF_ERA;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.Clock;
import java.time.DateTimeException;
@@ -603,10 +603,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/chrono/JapaneseChronology.java
--- a/jdk/src/share/classes/java/time/chrono/JapaneseChronology.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/chrono/JapaneseChronology.java Wed Jul 05 19:26:45 2017 +0200
@@ -66,6 +66,7 @@
import static java.time.temporal.ChronoUnit.MONTHS;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.Clock;
import java.time.DateTimeException;
@@ -523,10 +524,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/chrono/JapaneseDate.java
--- a/jdk/src/share/classes/java/time/chrono/JapaneseDate.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/chrono/JapaneseDate.java Wed Jul 05 19:26:45 2017 +0200
@@ -68,6 +68,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.Clock;
import java.time.DateTimeException;
@@ -110,6 +111,13 @@
* Calling {@code japaneseDate.get(ERA)} will return 2, corresponding to
* {@code JapaneseChronology.ERA_HEISEI}.
*
+ *
+ * This is a value-based
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code JapaneseDate} may have unpredictable results and should be avoided.
+ * The {@code equals} method should be used for comparisons.
+ *
* @implSpec
* This class is immutable and thread-safe.
*
@@ -670,6 +678,18 @@
}
//-------------------------------------------------------------------------
+ /**
+ * Compares this date to another date, including the chronology.
+ *
+ * Compares this {@code JapaneseDate} with another ensuring that the date is the same.
+ *
+ * Only objects of type {@code JapaneseDate} are compared, other types return false.
+ * To compare the dates of two {@code TemporalAccessor} instances, including dates
+ * in two different chronologies, use {@link ChronoField#EPOCH_DAY} as a comparator.
+ *
+ * @param obj the object to check, null returns false
+ * @return true if this is equal to the other date
+ */
@Override // override for performance
public boolean equals(Object obj) {
if (this == obj) {
@@ -682,6 +702,11 @@
return false;
}
+ /**
+ * A hash code for this date.
+ *
+ * @return a suitable hash code based only on the Chronology and the date
+ */
@Override // override for performance
public int hashCode() {
return getChronology().getId().hashCode() ^ isoDate.hashCode();
@@ -690,10 +715,10 @@
//-----------------------------------------------------------------------
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/chrono/JapaneseEra.java
--- a/jdk/src/share/classes/java/time/chrono/JapaneseEra.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/chrono/JapaneseEra.java Wed Jul 05 19:26:45 2017 +0200
@@ -68,6 +68,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.ObjectStreamException;
import java.io.Serializable;
import java.time.DateTimeException;
@@ -171,24 +172,6 @@
this.since = since;
}
- /**
- * Returns the singleton {@code JapaneseEra} corresponding to this object.
- * It's possible that this version of {@code JapaneseEra} doesn't support the latest era value.
- * In that case, this method throws an {@code ObjectStreamException}.
- *
- * @return the singleton {@code JapaneseEra} for this object
- * @throws ObjectStreamException if the deserialized object has any unknown numeric era value.
- */
- private Object readResolve() throws ObjectStreamException {
- try {
- return of(eraValue);
- } catch (DateTimeException e) {
- InvalidObjectException ex = new InvalidObjectException("Invalid era");
- ex.initCause(e);
- throw ex;
- }
- }
-
//-----------------------------------------------------------------------
/**
* Returns the Sun private Era instance corresponding to this {@code JapaneseEra}.
@@ -212,7 +195,7 @@
* @throws DateTimeException if the value is invalid
*/
public static JapaneseEra of(int japaneseEra) {
- if (japaneseEra < MEIJI.eraValue || japaneseEra > HEISEI.eraValue) {
+ if (japaneseEra < MEIJI.eraValue || japaneseEra + ERA_OFFSET - 1 >= KNOWN_ERAS.length) {
throw new DateTimeException("Invalid era: " + japaneseEra);
}
return KNOWN_ERAS[ordinal(japaneseEra)];
@@ -372,6 +355,16 @@
//-----------------------------------------------------------------------
/**
+ * Defend against malicious streams.
+ *
+ * @throws InvalidObjectException always
+ */
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
+ throw new InvalidObjectException("Deserialization via serialization delegate");
+ }
+
+ //-----------------------------------------------------------------------
+ /**
* Writes the object using a
* dedicated serialized form .
* @serialData
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/chrono/MinguoChronology.java
--- a/jdk/src/share/classes/java/time/chrono/MinguoChronology.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/chrono/MinguoChronology.java Wed Jul 05 19:26:45 2017 +0200
@@ -57,10 +57,10 @@
package java.time.chrono;
import java.io.InvalidObjectException;
-import java.io.ObjectStreamException;
import static java.time.temporal.ChronoField.PROLEPTIC_MONTH;
import static java.time.temporal.ChronoField.YEAR;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.Clock;
import java.time.DateTimeException;
@@ -354,10 +354,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/chrono/MinguoDate.java
--- a/jdk/src/share/classes/java/time/chrono/MinguoDate.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/chrono/MinguoDate.java Wed Jul 05 19:26:45 2017 +0200
@@ -65,6 +65,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.Clock;
import java.time.DateTimeException;
@@ -90,6 +91,13 @@
* This calendar system is primarily used in the Republic of China, often known as Taiwan.
* Dates are aligned such that {@code 0001-01-01 (Minguo)} is {@code 1912-01-01 (ISO)}.
*
+ *
+ * This is a value-based
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code MinguoDate} may have unpredictable results and should be avoided.
+ * The {@code equals} method should be used for comparisons.
+ *
* @implSpec
* This class is immutable and thread-safe.
*
@@ -432,6 +440,18 @@
}
//-------------------------------------------------------------------------
+ /**
+ * Compares this date to another date, including the chronology.
+ *
+ * Compares this {@code MinguoDate} with another ensuring that the date is the same.
+ *
+ * Only objects of type {@code MinguoDate} are compared, other types return false.
+ * To compare the dates of two {@code TemporalAccessor} instances, including dates
+ * in two different chronologies, use {@link ChronoField#EPOCH_DAY} as a comparator.
+ *
+ * @param obj the object to check, null returns false
+ * @return true if this is equal to the other date
+ */
@Override // override for performance
public boolean equals(Object obj) {
if (this == obj) {
@@ -444,6 +464,11 @@
return false;
}
+ /**
+ * A hash code for this date.
+ *
+ * @return a suitable hash code based only on the Chronology and the date
+ */
@Override // override for performance
public int hashCode() {
return getChronology().getId().hashCode() ^ isoDate.hashCode();
@@ -452,10 +477,10 @@
//-----------------------------------------------------------------------
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/chrono/ThaiBuddhistChronology.java
--- a/jdk/src/share/classes/java/time/chrono/ThaiBuddhistChronology.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/chrono/ThaiBuddhistChronology.java Wed Jul 05 19:26:45 2017 +0200
@@ -57,10 +57,10 @@
package java.time.chrono;
import java.io.InvalidObjectException;
-import java.io.ObjectStreamException;
import static java.time.temporal.ChronoField.PROLEPTIC_MONTH;
import static java.time.temporal.ChronoField.YEAR;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.Clock;
import java.time.DateTimeException;
@@ -390,10 +390,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/chrono/ThaiBuddhistDate.java
--- a/jdk/src/share/classes/java/time/chrono/ThaiBuddhistDate.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/chrono/ThaiBuddhistDate.java Wed Jul 05 19:26:45 2017 +0200
@@ -65,6 +65,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.Clock;
import java.time.DateTimeException;
@@ -90,6 +91,13 @@
* This calendar system is primarily used in Thailand.
* Dates are aligned such that {@code 2484-01-01 (Buddhist)} is {@code 1941-01-01 (ISO)}.
*
+ *
+ * This is a value-based
+ * class; use of identity-sensitive operations (including reference equality
+ * ({@code ==}), identity hash code, or synchronization) on instances of
+ * {@code ThaiBuddhistDate} may have unpredictable results and should be avoided.
+ * The {@code equals} method should be used for comparisons.
+ *
* @implSpec
* This class is immutable and thread-safe.
*
@@ -432,6 +440,18 @@
}
//-------------------------------------------------------------------------
+ /**
+ * Compares this date to another date, including the chronology.
+ *
+ * Compares this {@code ThaiBuddhistDate} with another ensuring that the date is the same.
+ *
+ * Only objects of type {@code ThaiBuddhistDate} are compared, other types return false.
+ * To compare the dates of two {@code TemporalAccessor} instances, including dates
+ * in two different chronologies, use {@link ChronoField#EPOCH_DAY} as a comparator.
+ *
+ * @param obj the object to check, null returns false
+ * @return true if this is equal to the other date
+ */
@Override // override for performance
public boolean equals(Object obj) {
if (this == obj) {
@@ -444,6 +464,11 @@
return false;
}
+ /**
+ * A hash code for this date.
+ *
+ * @return a suitable hash code based only on the Chronology and the date
+ */
@Override // override for performance
public int hashCode() {
return getChronology().getId().hashCode() ^ isoDate.hashCode();
@@ -452,10 +477,10 @@
//-----------------------------------------------------------------------
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/temporal/ValueRange.java
--- a/jdk/src/share/classes/java/time/temporal/ValueRange.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/temporal/ValueRange.java Wed Jul 05 19:26:45 2017 +0200
@@ -61,7 +61,9 @@
*/
package java.time.temporal;
+import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.DateTimeException;
@@ -338,18 +340,27 @@
}
}
+ //-----------------------------------------------------------------------
/**
- * Return the ValueRange for the serialized values.
- * The values are validated according to the constraints of the {@link #of}
- * factory method.
- * @return the ValueRange for the serialized fields
- * @throws InvalidObjectException if the serialized object has invalid values
+ * Restore the state of an ValueRange from the stream.
+ * Check that the values are valid.
+ * @throws InvalidObjectException if
+ * the smallest minimum is greater than the smallest maximum,
+ * or the smallest maximum is greater than the largest maximum
+ * or the largest minimum is greater than the largest maximum
*/
- private Object readResolve() throws InvalidObjectException {
- try {
- return of(minSmallest, minLargest, maxSmallest, maxLargest);
- } catch (IllegalArgumentException iae) {
- throw new InvalidObjectException("Invalid serialized ValueRange: " + iae.getMessage());
+ private void readObject(ObjectInputStream s)
+ throws IOException, ClassNotFoundException, InvalidObjectException
+ {
+ s.defaultReadObject();
+ if (minSmallest > minLargest) {
+ throw new InvalidObjectException("Smallest minimum value must be less than largest minimum value");
+ }
+ if (maxSmallest > maxLargest) {
+ throw new InvalidObjectException("Smallest maximum value must be less than largest maximum value");
+ }
+ if (minLargest > maxLargest) {
+ throw new InvalidObjectException("Minimum value must be less than maximum value");
}
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/temporal/WeekFields.java
--- a/jdk/src/share/classes/java/time/temporal/WeekFields.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/temporal/WeekFields.java Wed Jul 05 19:26:45 2017 +0200
@@ -72,7 +72,9 @@
import static java.time.temporal.ChronoUnit.WEEKS;
import static java.time.temporal.ChronoUnit.YEARS;
+import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.DateTimeException;
import java.time.DayOfWeek;
@@ -340,6 +342,25 @@
//-----------------------------------------------------------------------
/**
+ * Restore the state of a WeekFields from the stream.
+ * Check that the values are valid.
+ * @throws InvalidObjectException if the serialized object has an invalid
+ * value for firstDayOfWeek or minimalDays.
+ */
+ private void readObject(ObjectInputStream s)
+ throws IOException, ClassNotFoundException, InvalidObjectException
+ {
+ s.defaultReadObject();
+ if (firstDayOfWeek == null) {
+ throw new InvalidObjectException("firstDayOfWeek is null");
+ }
+
+ if (minimalDays < 1 || minimalDays > 7) {
+ throw new InvalidObjectException("Minimal number of days is invalid");
+ }
+ }
+
+ /**
* Return the singleton WeekFields associated with the
* {@code firstDayOfWeek} and {@code minimalDays}.
* @return the singleton WeekFields for the firstDayOfWeek and minimalDays.
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/zone/ZoneOffsetTransition.java
--- a/jdk/src/share/classes/java/time/zone/ZoneOffsetTransition.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/zone/ZoneOffsetTransition.java Wed Jul 05 19:26:45 2017 +0200
@@ -65,6 +65,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.Duration;
import java.time.Instant;
@@ -172,10 +173,9 @@
//-----------------------------------------------------------------------
/**
* Defend against malicious streams.
- * @return never
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/zone/ZoneOffsetTransitionRule.java
--- a/jdk/src/share/classes/java/time/zone/ZoneOffsetTransitionRule.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/zone/ZoneOffsetTransitionRule.java Wed Jul 05 19:26:45 2017 +0200
@@ -68,6 +68,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.DayOfWeek;
import java.time.LocalDate;
@@ -233,10 +234,10 @@
//-----------------------------------------------------------------------
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/time/zone/ZoneRules.java
--- a/jdk/src/share/classes/java/time/zone/ZoneRules.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/time/zone/ZoneRules.java Wed Jul 05 19:26:45 2017 +0200
@@ -65,6 +65,7 @@
import java.io.DataOutput;
import java.io.IOException;
import java.io.InvalidObjectException;
+import java.io.ObjectInputStream;
import java.io.Serializable;
import java.time.Duration;
import java.time.Instant;
@@ -317,10 +318,10 @@
/**
* Defend against malicious streams.
- * @return never
+ *
* @throws InvalidObjectException always
*/
- private Object readResolve() throws InvalidObjectException {
+ private void readObject(ObjectInputStream s) throws InvalidObjectException {
throw new InvalidObjectException("Deserialization via serialization delegate");
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/AbstractCollection.java
--- a/jdk/src/share/classes/java/util/AbstractCollection.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/AbstractCollection.java Wed Jul 05 19:26:45 2017 +0200
@@ -80,7 +80,8 @@
/**
* {@inheritDoc}
*
- *
This implementation returns size() == 0 .
+ * @implSpec
+ * This implementation returns size() == 0 .
*/
public boolean isEmpty() {
return size() == 0;
@@ -89,7 +90,8 @@
/**
* {@inheritDoc}
*
- *
This implementation iterates over the elements in the collection,
+ * @implSpec
+ * This implementation iterates over the elements in the collection,
* checking each element in turn for equality with the specified element.
*
* @throws ClassCastException {@inheritDoc}
@@ -112,7 +114,8 @@
/**
* {@inheritDoc}
*
- *
This implementation returns an array containing all the elements
+ * @implSpec
+ * This implementation returns an array containing all the elements
* returned by this collection's iterator, in the same order, stored in
* consecutive elements of the array, starting with index {@code 0}.
* The length of the returned array is equal to the number of elements
@@ -146,7 +149,8 @@
/**
* {@inheritDoc}
*
- *
This implementation returns an array containing all the elements
+ * @implSpec
+ * This implementation returns an array containing all the elements
* returned by this collection's iterator in the same order, stored in
* consecutive elements of the array, starting with index {@code 0}.
* If the number of elements returned by the iterator is too large to
@@ -249,7 +253,8 @@
/**
* {@inheritDoc}
*
- *
This implementation always throws an
+ * @implSpec
+ * This implementation always throws an
* UnsupportedOperationException .
*
* @throws UnsupportedOperationException {@inheritDoc}
@@ -265,7 +270,8 @@
/**
* {@inheritDoc}
*
- *
This implementation iterates over the collection looking for the
+ * @implSpec
+ * This implementation iterates over the collection looking for the
* specified element. If it finds the element, it removes the element
* from the collection using the iterator's remove method.
*
@@ -304,7 +310,8 @@
/**
* {@inheritDoc}
*
- *
This implementation iterates over the specified collection,
+ * @implSpec
+ * This implementation iterates over the specified collection,
* checking each element returned by the iterator in turn to see
* if it's contained in this collection. If all elements are so
* contained true is returned, otherwise false .
@@ -323,7 +330,8 @@
/**
* {@inheritDoc}
*
- *
This implementation iterates over the specified collection, and adds
+ * @implSpec
+ * This implementation iterates over the specified collection, and adds
* each object returned by the iterator to this collection, in turn.
*
*
Note that this implementation will throw an
@@ -349,7 +357,8 @@
/**
* {@inheritDoc}
*
- *
This implementation iterates over this collection, checking each
+ * @implSpec
+ * This implementation iterates over this collection, checking each
* element returned by the iterator in turn to see if it's contained
* in the specified collection. If it's so contained, it's removed from
* this collection with the iterator's remove method.
@@ -383,7 +392,8 @@
/**
* {@inheritDoc}
*
- *
This implementation iterates over this collection, checking each
+ * @implSpec
+ * This implementation iterates over this collection, checking each
* element returned by the iterator in turn to see if it's contained
* in the specified collection. If it's not so contained, it's removed
* from this collection with the iterator's remove method.
@@ -417,7 +427,8 @@
/**
* {@inheritDoc}
*
- *
This implementation iterates over this collection, removing each
+ * @implSpec
+ * This implementation iterates over this collection, removing each
* element using the Iterator.remove operation. Most
* implementations will probably choose to override this method for
* efficiency.
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/AbstractList.java
--- a/jdk/src/share/classes/java/util/AbstractList.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/AbstractList.java Wed Jul 05 19:26:45 2017 +0200
@@ -87,7 +87,8 @@
* classes should clearly specify in their documentation any restrictions
* on what elements may be added.
*
- *
This implementation calls {@code add(size(), e)}.
+ * @implSpec
+ * This implementation calls {@code add(size(), e)}.
*
*
Note that this implementation throws an
* {@code UnsupportedOperationException} unless
@@ -119,7 +120,8 @@
/**
* {@inheritDoc}
*
- *
This implementation always throws an
+ * @implSpec
+ * This implementation always throws an
* {@code UnsupportedOperationException}.
*
* @throws UnsupportedOperationException {@inheritDoc}
@@ -135,7 +137,8 @@
/**
* {@inheritDoc}
*
- *
This implementation always throws an
+ * @implSpec
+ * This implementation always throws an
* {@code UnsupportedOperationException}.
*
* @throws UnsupportedOperationException {@inheritDoc}
@@ -151,7 +154,8 @@
/**
* {@inheritDoc}
*
- *
This implementation always throws an
+ * @implSpec
+ * This implementation always throws an
* {@code UnsupportedOperationException}.
*
* @throws UnsupportedOperationException {@inheritDoc}
@@ -167,7 +171,8 @@
/**
* {@inheritDoc}
*
- *
This implementation first gets a list iterator (with
+ * @implSpec
+ * This implementation first gets a list iterator (with
* {@code listIterator()}). Then, it iterates over the list until the
* specified element is found or the end of the list is reached.
*
@@ -191,7 +196,8 @@
/**
* {@inheritDoc}
*
- *
This implementation first gets a list iterator that points to the end
+ * @implSpec
+ * This implementation first gets a list iterator that points to the end
* of the list (with {@code listIterator(size())}). Then, it iterates
* backwards over the list until the specified element is found, or the
* beginning of the list is reached.
@@ -220,7 +226,8 @@
* Removes all of the elements from this list (optional operation).
* The list will be empty after this call returns.
*
- *
This implementation calls {@code removeRange(0, size())}.
+ * @implSpec
+ * This implementation calls {@code removeRange(0, size())}.
*
*
Note that this implementation throws an
* {@code UnsupportedOperationException} unless {@code remove(int
@@ -237,7 +244,8 @@
/**
* {@inheritDoc}
*
- *
This implementation gets an iterator over the specified collection
+ * @implSpec
+ * This implementation gets an iterator over the specified collection
* and iterates over it, inserting the elements obtained from the
* iterator into this list at the appropriate position, one at a time,
* using {@code add(int, E)}.
@@ -269,7 +277,8 @@
/**
* Returns an iterator over the elements in this list in proper sequence.
*
- *
This implementation returns a straightforward implementation of the
+ * @implSpec
+ * This implementation returns a straightforward implementation of the
* iterator interface, relying on the backing list's {@code size()},
* {@code get(int)}, and {@code remove(int)} methods.
*
@@ -291,7 +300,8 @@
/**
* {@inheritDoc}
*
- *
This implementation returns {@code listIterator(0)}.
+ * @implSpec
+ * This implementation returns {@code listIterator(0)}.
*
* @see #listIterator(int)
*/
@@ -302,7 +312,8 @@
/**
* {@inheritDoc}
*
- *
This implementation returns a straightforward implementation of the
+ * @implSpec
+ * This implementation returns a straightforward implementation of the
* {@code ListIterator} interface that extends the implementation of the
* {@code Iterator} interface returned by the {@code iterator()} method.
* The {@code ListIterator} implementation relies on the backing list's
@@ -448,7 +459,8 @@
/**
* {@inheritDoc}
*
- *
This implementation returns a list that subclasses
+ * @implSpec
+ * This implementation returns a list that subclasses
* {@code AbstractList}. The subclass stores, in private fields, the
* offset of the subList within the backing list, the size of the subList
* (which can change over its lifetime), and the expected
@@ -495,8 +507,9 @@
* the two lists are equal . (Two elements {@code e1} and
* {@code e2} are equal if {@code (e1==null ? e2==null :
* e1.equals(e2))}.) In other words, two lists are defined to be
- * equal if they contain the same elements in the same order.
+ * equal if they contain the same elements in the same order.
*
+ * @implSpec
* This implementation first checks if the specified object is this
* list. If so, it returns {@code true}; if not, it checks if the
* specified object is a list. If not, it returns {@code false}; if so,
@@ -529,7 +542,8 @@
/**
* Returns the hash code value for this list.
*
- *
This implementation uses exactly the code that is used to define the
+ * @implSpec
+ * This implementation uses exactly the code that is used to define the
* list hash function in the documentation for the {@link List#hashCode}
* method.
*
@@ -555,7 +569,8 @@
* improve the performance of the {@code clear} operation on this list
* and its subLists.
*
- *
This implementation gets a list iterator positioned before
+ * @implSpec
+ * This implementation gets a list iterator positioned before
* {@code fromIndex}, and repeatedly calls {@code ListIterator.next}
* followed by {@code ListIterator.remove} until the entire range has
* been removed. Note: if {@code ListIterator.remove} requires linear
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/AbstractMap.java
--- a/jdk/src/share/classes/java/util/AbstractMap.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/AbstractMap.java Wed Jul 05 19:26:45 2017 +0200
@@ -78,7 +78,8 @@
/**
* {@inheritDoc}
*
- *
This implementation returns entrySet().size() .
+ * @implSpec
+ * This implementation returns entrySet().size() .
*/
public int size() {
return entrySet().size();
@@ -87,7 +88,8 @@
/**
* {@inheritDoc}
*
- *
This implementation returns size() == 0 .
+ * @implSpec
+ * This implementation returns size() == 0 .
*/
public boolean isEmpty() {
return size() == 0;
@@ -96,7 +98,8 @@
/**
* {@inheritDoc}
*
- *
This implementation iterates over entrySet() searching
+ * @implSpec
+ * This implementation iterates over entrySet() searching
* for an entry with the specified value. If such an entry is found,
* true is returned. If the iteration terminates without
* finding such an entry, false is returned. Note that this
@@ -126,7 +129,8 @@
/**
* {@inheritDoc}
*
- *
This implementation iterates over entrySet() searching
+ * @implSpec
+ * This implementation iterates over entrySet() searching
* for an entry with the specified key. If such an entry is found,
* true is returned. If the iteration terminates without
* finding such an entry, false is returned. Note that this
@@ -157,7 +161,8 @@
/**
* {@inheritDoc}
*
- *
This implementation iterates over entrySet() searching
+ * @implSpec
+ * This implementation iterates over entrySet() searching
* for an entry with the specified key. If such an entry is found,
* the entry's value is returned. If the iteration terminates without
* finding such an entry, null is returned. Note that this
@@ -191,7 +196,8 @@
/**
* {@inheritDoc}
*
- *
This implementation always throws an
+ * @implSpec
+ * This implementation always throws an
* UnsupportedOperationException .
*
* @throws UnsupportedOperationException {@inheritDoc}
@@ -206,7 +212,8 @@
/**
* {@inheritDoc}
*
- *
This implementation iterates over entrySet() searching for an
+ * @implSpec
+ * This implementation iterates over entrySet() searching for an
* entry with the specified key. If such an entry is found, its value is
* obtained with its getValue operation, the entry is removed
* from the collection (and the backing map) with the iterator's
@@ -255,7 +262,8 @@
/**
* {@inheritDoc}
*
- *
This implementation iterates over the specified map's
+ * @implSpec
+ * This implementation iterates over the specified map's
* entrySet() collection, and calls this map's put
* operation once for each entry returned by the iteration.
*
@@ -276,7 +284,8 @@
/**
* {@inheritDoc}
*
- *
This implementation calls entrySet().clear() .
+ * @implSpec
+ * This implementation calls entrySet().clear() .
*
*
Note that this implementation throws an
* UnsupportedOperationException if the entrySet
@@ -302,7 +311,8 @@
/**
* {@inheritDoc}
*
- *
This implementation returns a set that subclasses {@link AbstractSet}.
+ * @implSpec
+ * This implementation returns a set that subclasses {@link AbstractSet}.
* The subclass's iterator method returns a "wrapper object" over this
* map's entrySet() iterator. The size method
* delegates to this map's size method and the
@@ -358,7 +368,8 @@
/**
* {@inheritDoc}
*
- *
This implementation returns a collection that subclasses {@link
+ * @implSpec
+ * This implementation returns a collection that subclasses {@link
* AbstractCollection}. The subclass's iterator method returns a
* "wrapper object" over this map's entrySet() iterator.
* The size method delegates to this map's size
@@ -425,7 +436,8 @@
* equals method works properly across different implementations
* of the Map interface.
*
- *
This implementation first checks if the specified object is this map;
+ * @implSpec
+ * This implementation first checks if the specified object is this map;
* if so it returns true . Then, it checks if the specified
* object is a map whose size is identical to the size of this map; if
* not, it returns false . If so, it iterates over this map's
@@ -448,13 +460,11 @@
return false;
try {
- Iterator> i = entrySet().iterator();
- while (i.hasNext()) {
- Entry e = i.next();
+ for (Entry e : entrySet()) {
K key = e.getKey();
V value = e.getValue();
if (value == null) {
- if (!(m.get(key)==null && m.containsKey(key)))
+ if (!(m.get(key) == null && m.containsKey(key)))
return false;
} else {
if (!value.equals(m.get(key)))
@@ -478,7 +488,8 @@
* m1 and m2 , as required by the general contract of
* {@link Object#hashCode}.
*
- * This implementation iterates over entrySet() , calling
+ * @implSpec
+ * This implementation iterates over entrySet() , calling
* {@link Map.Entry#hashCode hashCode()} on each element (entry) in the
* set, and adding up the results.
*
@@ -489,9 +500,8 @@
*/
public int hashCode() {
int h = 0;
- Iterator> i = entrySet().iterator();
- while (i.hasNext())
- h += i.next().hashCode();
+ for (Entry entry : entrySet())
+ h += entry.hashCode();
return h;
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/AbstractSequentialList.java
--- a/jdk/src/share/classes/java/util/AbstractSequentialList.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/AbstractSequentialList.java Wed Jul 05 19:26:45 2017 +0200
@@ -213,9 +213,8 @@
try {
boolean modified = false;
ListIterator e1 = listIterator(index);
- Iterator extends E> e2 = c.iterator();
- while (e2.hasNext()) {
- e1.add(e2.next());
+ for (E e : c) {
+ e1.add(e);
modified = true;
}
return modified;
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/AbstractSet.java
--- a/jdk/src/share/classes/java/util/AbstractSet.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/AbstractSet.java Wed Jul 05 19:26:45 2017 +0200
@@ -170,8 +170,8 @@
boolean modified = false;
if (size() > c.size()) {
- for (Iterator> i = c.iterator(); i.hasNext(); )
- modified |= remove(i.next());
+ for (Object e : c)
+ modified |= remove(e);
} else {
for (Iterator> i = iterator(); i.hasNext(); ) {
if (c.contains(i.next())) {
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/ArrayDeque.java
--- a/jdk/src/share/classes/java/util/ArrayDeque.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/ArrayDeque.java Wed Jul 05 19:26:45 2017 +0200
@@ -902,7 +902,7 @@
* @since 1.8
*/
public Spliterator spliterator() {
- return new DeqSpliterator(this, -1, -1);
+ return new DeqSpliterator<>(this, -1, -1);
}
static final class DeqSpliterator implements Spliterator {
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/ArrayList.java
--- a/jdk/src/share/classes/java/util/ArrayList.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/ArrayList.java Wed Jul 05 19:26:45 2017 +0200
@@ -1218,8 +1218,8 @@
public Spliterator spliterator() {
checkForComodification();
- return new ArrayListSpliterator(ArrayList.this, offset,
- offset + this.size, this.modCount);
+ return new ArrayListSpliterator<>(ArrayList.this, offset,
+ offset + this.size, this.modCount);
}
}
@@ -1322,8 +1322,8 @@
public ArrayListSpliterator trySplit() {
int hi = getFence(), lo = index, mid = (lo + hi) >>> 1;
return (lo >= mid) ? null : // divide range in half unless too small
- new ArrayListSpliterator(list, lo, index = mid,
- expectedModCount);
+ new ArrayListSpliterator<>(list, lo, index = mid,
+ expectedModCount);
}
public boolean tryAdvance(Consumer super E> action) {
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/ArrayPrefixHelpers.java
--- a/jdk/src/share/classes/java/util/ArrayPrefixHelpers.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/ArrayPrefixHelpers.java Wed Jul 05 19:26:45 2017 +0200
@@ -142,9 +142,9 @@
if (lt == null) { // first pass
int mid = (l + h) >>> 1;
f = rt = t.right =
- new CumulateTask(t, fn, a, org, fnc, th, mid, h);
+ new CumulateTask<>(t, fn, a, org, fnc, th, mid, h);
t = lt = t.left =
- new CumulateTask(t, fn, a, org, fnc, th, l, mid);
+ new CumulateTask<>(t, fn, a, org, fnc, th, l, mid);
}
else { // possibly refork
T pin = t.in;
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/Arrays.java
--- a/jdk/src/share/classes/java/util/Arrays.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/Arrays.java Wed Jul 05 19:26:45 2017 +0200
@@ -1002,7 +1002,7 @@
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
TimSort.sort(a, 0, n, NaturalOrder.INSTANCE, null, 0, 0);
else
- new ArraysParallelSortHelpers.FJObject.Sorter
+ new ArraysParallelSortHelpers.FJObject.Sorter<>
(null, a,
(T[])Array.newInstance(a.getClass().getComponentType(), n),
0, n, 0, ((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
@@ -1061,7 +1061,7 @@
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
TimSort.sort(a, fromIndex, toIndex, NaturalOrder.INSTANCE, null, 0, 0);
else
- new ArraysParallelSortHelpers.FJObject.Sorter
+ new ArraysParallelSortHelpers.FJObject.Sorter<>
(null, a,
(T[])Array.newInstance(a.getClass().getComponentType(), n),
fromIndex, n, 0, ((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
@@ -1110,7 +1110,7 @@
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
TimSort.sort(a, 0, n, cmp, null, 0, 0);
else
- new ArraysParallelSortHelpers.FJObject.Sorter
+ new ArraysParallelSortHelpers.FJObject.Sorter<>
(null, a,
(T[])Array.newInstance(a.getClass().getComponentType(), n),
0, n, 0, ((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
@@ -1171,7 +1171,7 @@
(p = ForkJoinPool.getCommonPoolParallelism()) == 1)
TimSort.sort(a, fromIndex, toIndex, cmp, null, 0, 0);
else
- new ArraysParallelSortHelpers.FJObject.Sorter
+ new ArraysParallelSortHelpers.FJObject.Sorter<>
(null, a,
(T[])Array.newInstance(a.getClass().getComponentType(), n),
fromIndex, n, 0, ((g = n / (p << 2)) <= MIN_ARRAY_SORT_GRAN) ?
@@ -4587,7 +4587,7 @@
if (a.length != 0 && bufLen <= 0)
bufLen = Integer.MAX_VALUE;
StringBuilder buf = new StringBuilder(bufLen);
- deepToString(a, buf, new HashSet());
+ deepToString(a, buf, new HashSet<>());
return buf.toString();
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/ArraysParallelSortHelpers.java
--- a/jdk/src/share/classes/java/util/ArraysParallelSortHelpers.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/ArraysParallelSortHelpers.java Wed Jul 05 19:26:45 2017 +0200
@@ -130,15 +130,15 @@
int b = this.base, n = this.size, wb = this.wbase, g = this.gran;
while (n > g) {
int h = n >>> 1, q = h >>> 1, u = h + q; // quartiles
- Relay fc = new Relay(new Merger(s, w, a, wb, h,
- wb+h, n-h, b, g, c));
- Relay rc = new Relay(new Merger(fc, a, w, b+h, q,
- b+u, n-u, wb+h, g, c));
- new Sorter(rc, a, w, b+u, n-u, wb+u, g, c).fork();
- new Sorter(rc, a, w, b+h, q, wb+h, g, c).fork();;
- Relay bc = new Relay(new Merger(fc, a, w, b, q,
- b+q, h-q, wb, g, c));
- new Sorter(bc, a, w, b+q, h-q, wb+q, g, c).fork();
+ Relay fc = new Relay(new Merger<>(s, w, a, wb, h,
+ wb+h, n-h, b, g, c));
+ Relay rc = new Relay(new Merger<>(fc, a, w, b+h, q,
+ b+u, n-u, wb+h, g, c));
+ new Sorter<>(rc, a, w, b+u, n-u, wb+u, g, c).fork();
+ new Sorter<>(rc, a, w, b+h, q, wb+h, g, c).fork();;
+ Relay bc = new Relay(new Merger<>(fc, a, w, b, q,
+ b+q, h-q, wb, g, c));
+ new Sorter<>(bc, a, w, b+q, h-q, wb+q, g, c).fork();
s = new EmptyCompleter(bc);
n = q;
}
@@ -199,9 +199,9 @@
lo = lm + 1;
}
}
- Merger m = new Merger(this, a, w, lb + lh, ln - lh,
- rb + rh, rn - rh,
- k + lh + rh, g, c);
+ Merger m = new Merger<>(this, a, w, lb + lh, ln - lh,
+ rb + rh, rn - rh,
+ k + lh + rh, g, c);
rn = rh;
ln = lh;
addToPendingCount(1);
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/Calendar.java
--- a/jdk/src/share/classes/java/util/Calendar.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/Calendar.java Wed Jul 05 19:26:45 2017 +0200
@@ -3380,8 +3380,7 @@
for (;;) {
int min = Integer.MAX_VALUE;
- for (int i = 0; i < stamp.length; i++) {
- int v = stamp[i];
+ for (int v : stamp) {
if (v >= newStamp && min > v) {
min = v;
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/Collections.java
--- a/jdk/src/share/classes/java/util/Collections.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/Collections.java Wed Jul 05 19:26:45 2017 +0200
@@ -165,9 +165,9 @@
Object[] a = list.toArray();
Arrays.sort(a);
ListIterator i = list.listIterator();
- for (int j=0; j i = list.listIterator();
- for (int j=0; j());
+ super(new TreeSet<>());
}
private Object readResolve() { return EMPTY_NAVIGABLE_SET; }
@@ -1910,7 +1910,7 @@
private static final long serialVersionUID = -2239321462712562324L;
- EmptyNavigableMap() { super(new TreeMap()); }
+ EmptyNavigableMap() { super(new TreeMap<>()); }
@Override
public NavigableSet navigableKeySet()
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/DoubleSummaryStatistics.java
--- a/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/DoubleSummaryStatistics.java Wed Jul 05 19:26:45 2017 +0200
@@ -64,6 +64,7 @@
private long count;
private double sum;
private double sumCompensation; // Low order bits of sum
+ private double simpleSum; // Used to compute right sum for non-finite inputs
private double min = Double.POSITIVE_INFINITY;
private double max = Double.NEGATIVE_INFINITY;
@@ -82,6 +83,7 @@
@Override
public void accept(double value) {
++count;
+ simpleSum += value;
sumWithCompensation(value);
min = Math.min(min, value);
max = Math.max(max, value);
@@ -96,6 +98,7 @@
*/
public void combine(DoubleSummaryStatistics other) {
count += other.count;
+ simpleSum += other.simpleSum;
sumWithCompensation(other.sum);
sumWithCompensation(other.sumCompensation);
min = Math.min(min, other.min);
@@ -147,7 +150,15 @@
*/
public final double getSum() {
// Better error bounds to add both terms as the final sum
- return sum + sumCompensation;
+ double tmp = sum + sumCompensation;
+ if (Double.isNaN(tmp) && Double.isInfinite(simpleSum))
+ // If the compensated sum is spuriously NaN from
+ // accumulating one or more same-signed infinite values,
+ // return the correctly-signed infinity stored in
+ // simpleSum.
+ return simpleSum;
+ else
+ return tmp;
}
/**
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/Formatter.java
--- a/jdk/src/share/classes/java/util/Formatter.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/Formatter.java Wed Jul 05 19:26:45 2017 +0200
@@ -2499,8 +2499,7 @@
int lasto = -1;
FormatString[] fsa = parse(format);
- for (int i = 0; i < fsa.length; i++) {
- FormatString fs = fsa[i];
+ for (FormatString fs : fsa) {
int index = fs.index();
try {
switch (index) {
@@ -2992,9 +2991,9 @@
}
private void checkBadFlags(Flags ... badFlags) {
- for (int i = 0; i < badFlags.length; i++)
- if (f.contains(badFlags[i]))
- failMismatch(badFlags[i], c);
+ for (Flags badFlag : badFlags)
+ if (f.contains(badFlag))
+ failMismatch(badFlag, c);
}
private void checkFloat() {
@@ -4437,8 +4436,8 @@
public static Flags parse(String s) {
char[] ca = s.toCharArray();
Flags f = new Flags(0);
- for (int i = 0; i < ca.length; i++) {
- Flags v = parse(ca[i]);
+ for (char c : ca) {
+ Flags v = parse(c);
if (f.contains(v))
throw new DuplicateFormatFlagsException(v.toString());
f.add(v);
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/HashMap.java
--- a/jdk/src/share/classes/java/util/HashMap.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/HashMap.java Wed Jul 05 19:26:45 2017 +0200
@@ -344,13 +344,13 @@
*/
static Class> comparableClassFor(Object x) {
if (x instanceof Comparable) {
- Class> c; Type[] ts, as; Type t; ParameterizedType p;
+ Class> c; Type[] ts, as; ParameterizedType p;
if ((c = x.getClass()) == String.class) // bypass checks
return c;
if ((ts = c.getGenericInterfaces()) != null) {
- for (int i = 0; i < ts.length; ++i) {
- if (((t = ts[i]) instanceof ParameterizedType) &&
- ((p = (ParameterizedType)t).getRawType() ==
+ for (Type t : ts) {
+ if ((t instanceof ParameterizedType) &&
+ ((p = (ParameterizedType) t).getRawType() ==
Comparable.class) &&
(as = p.getActualTypeArguments()) != null &&
as.length == 1 && as[0] == c) // type arg is c
@@ -875,8 +875,8 @@
public boolean containsValue(Object value) {
Node[] tab; V v;
if ((tab = table) != null && size > 0) {
- for (int i = 0; i < tab.length; ++i) {
- for (Node e = tab[i]; e != null; e = e.next) {
+ for (Node e : tab) {
+ for (; e != null; e = e.next) {
if ((v = e.value) == value ||
(value != null && value.equals(v)))
return true;
@@ -923,8 +923,8 @@
throw new NullPointerException();
if (size > 0 && (tab = table) != null) {
int mc = modCount;
- for (int i = 0; i < tab.length; ++i) {
- for (Node e = tab[i]; e != null; e = e.next)
+ for (Node e : tab) {
+ for (; e != null; e = e.next)
action.accept(e.key);
}
if (modCount != mc)
@@ -967,8 +967,8 @@
throw new NullPointerException();
if (size > 0 && (tab = table) != null) {
int mc = modCount;
- for (int i = 0; i < tab.length; ++i) {
- for (Node e = tab[i]; e != null; e = e.next)
+ for (Node e : tab) {
+ for (; e != null; e = e.next)
action.accept(e.value);
}
if (modCount != mc)
@@ -1030,8 +1030,8 @@
throw new NullPointerException();
if (size > 0 && (tab = table) != null) {
int mc = modCount;
- for (int i = 0; i < tab.length; ++i) {
- for (Node e = tab[i]; e != null; e = e.next)
+ for (Node e : tab) {
+ for (; e != null; e = e.next)
action.accept(e);
}
if (modCount != mc)
@@ -1116,13 +1116,13 @@
}
}
V v = mappingFunction.apply(key);
- if (old != null) {
+ if (v == null) {
+ return null;
+ } else if (old != null) {
old.value = v;
afterNodeAccess(old);
return v;
}
- else if (v == null)
- return null;
else if (t != null)
t.putTreeVal(this, tab, hash, key, v);
else {
@@ -1212,6 +1212,8 @@
@Override
public V merge(K key, V value,
BiFunction super V, ? super V, ? extends V> remappingFunction) {
+ if (value == null)
+ throw new NullPointerException();
if (remappingFunction == null)
throw new NullPointerException();
int hash = hash(key);
@@ -1273,8 +1275,8 @@
throw new NullPointerException();
if (size > 0 && (tab = table) != null) {
int mc = modCount;
- for (int i = 0; i < tab.length; ++i) {
- for (Node e = tab[i]; e != null; e = e.next)
+ for (Node e : tab) {
+ for (; e != null; e = e.next)
action.accept(e.key, e.value);
}
if (modCount != mc)
@@ -1289,8 +1291,8 @@
throw new NullPointerException();
if (size > 0 && (tab = table) != null) {
int mc = modCount;
- for (int i = 0; i < tab.length; ++i) {
- for (Node e = tab[i]; e != null; e = e.next) {
+ for (Node e : tab) {
+ for (; e != null; e = e.next) {
e.value = function.apply(e.key, e.value);
}
}
@@ -1769,8 +1771,8 @@
void internalWriteEntries(java.io.ObjectOutputStream s) throws IOException {
Node[] tab;
if (size > 0 && (tab = table) != null) {
- for (int i = 0; i < tab.length; ++i) {
- for (Node e = tab[i]; e != null; e = e.next) {
+ for (Node e : tab) {
+ for (; e != null; e = e.next) {
s.writeObject(e.key);
s.writeObject(e.value);
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/HashSet.java
--- a/jdk/src/share/classes/java/util/HashSet.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/HashSet.java Wed Jul 05 19:26:45 2017 +0200
@@ -324,8 +324,8 @@
// Create backing HashMap
map = (((HashSet>)this) instanceof LinkedHashSet ?
- new LinkedHashMap(capacity, loadFactor) :
- new HashMap(capacity, loadFactor));
+ new LinkedHashMap<>(capacity, loadFactor) :
+ new HashMap<>(capacity, loadFactor));
// Read in all elements in the proper order.
for (int i=0; i spliterator() {
- return new HashMap.KeySpliterator(map, 0, -1, 0, 0);
+ return new HashMap.KeySpliterator<>(map, 0, -1, 0, 0);
}
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/Hashtable.java
--- a/jdk/src/share/classes/java/util/Hashtable.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/Hashtable.java Wed Jul 05 19:26:45 2017 +0200
@@ -801,13 +801,11 @@
return false;
try {
- Iterator> i = entrySet().iterator();
- while (i.hasNext()) {
- Map.Entry e = i.next();
+ for (Map.Entry e : entrySet()) {
K key = e.getKey();
V value = e.getValue();
if (value == null) {
- if (!(t.get(key)==null && t.containsKey(key)))
+ if (!(t.get(key) == null && t.containsKey(key)))
return false;
} else {
if (!value.equals(t.get(key)))
@@ -1140,8 +1138,7 @@
s.writeInt(count);
// Stack copies of the entries in the table
- for (int index = 0; index < table.length; index++) {
- Entry,?> entry = table[index];
+ for (Entry, ?> entry : table) {
while (entry != null) {
entryStack =
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/IdentityHashMap.java
--- a/jdk/src/share/classes/java/util/IdentityHashMap.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/IdentityHashMap.java Wed Jul 05 19:26:45 2017 +0200
@@ -1426,8 +1426,8 @@
public KeySpliterator trySplit() {
int hi = getFence(), lo = index, mid = ((lo + hi) >>> 1) & ~1;
return (lo >= mid) ? null :
- new KeySpliterator(map, lo, index = mid, est >>>= 1,
- expectedModCount);
+ new KeySpliterator<>(map, lo, index = mid, est >>>= 1,
+ expectedModCount);
}
@SuppressWarnings("unchecked")
@@ -1483,8 +1483,8 @@
public ValueSpliterator trySplit() {
int hi = getFence(), lo = index, mid = ((lo + hi) >>> 1) & ~1;
return (lo >= mid) ? null :
- new ValueSpliterator(map, lo, index = mid, est >>>= 1,
- expectedModCount);
+ new ValueSpliterator<>(map, lo, index = mid, est >>>= 1,
+ expectedModCount);
}
public void forEachRemaining(Consumer super V> action) {
@@ -1542,8 +1542,8 @@
public EntrySpliterator trySplit() {
int hi = getFence(), lo = index, mid = ((lo + hi) >>> 1) & ~1;
return (lo >= mid) ? null :
- new EntrySpliterator(map, lo, index = mid, est >>>= 1,
- expectedModCount);
+ new EntrySpliterator<>(map, lo, index = mid, est >>>= 1,
+ expectedModCount);
}
public void forEachRemaining(Consumer super Map.Entry> action) {
@@ -1560,7 +1560,7 @@
(K)unmaskNull(key);
@SuppressWarnings("unchecked") V v = (V)a[i+1];
action.accept
- (new AbstractMap.SimpleImmutableEntry(k, v));
+ (new AbstractMap.SimpleImmutableEntry<>(k, v));
}
}
@@ -1583,7 +1583,7 @@
@SuppressWarnings("unchecked") K k =
(K)unmaskNull(key);
action.accept
- (new AbstractMap.SimpleImmutableEntry(k, v));
+ (new AbstractMap.SimpleImmutableEntry<>(k, v));
if (map.modCount != expectedModCount)
throw new ConcurrentModificationException();
return true;
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/LinkedHashMap.java
--- a/jdk/src/share/classes/java/util/LinkedHashMap.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/LinkedHashMap.java Wed Jul 05 19:26:45 2017 +0200
@@ -28,7 +28,6 @@
import java.util.function.Consumer;
import java.util.function.BiConsumer;
import java.util.function.BiFunction;
-import java.io.Serializable;
import java.io.IOException;
/**
@@ -63,14 +62,17 @@
* provided to create a linked hash map whose order of iteration is the order
* in which its entries were last accessed, from least-recently accessed to
* most-recently (access-order ). This kind of map is well-suited to
- * building LRU caches. Invoking the put or get method
- * results in an access to the corresponding entry (assuming it exists after
- * the invocation completes). The putAll method generates one entry
- * access for each mapping in the specified map, in the order that key-value
- * mappings are provided by the specified map's entry set iterator. No
- * other methods generate entry accesses. In particular, operations on
- * collection-views do not affect the order of iteration of the backing
- * map.
+ * building LRU caches. Invoking the {@code put}, {@code putIfAbsent},
+ * {@code get}, {@code getOrDefault}, {@code compute}, {@code computeIfAbsent},
+ * {@code computeIfPresent}, or {@code merge} methods results
+ * in an access to the corresponding entry (assuming it exists after the
+ * invocation completes). The {@code replace} methods only result in an access
+ * of the entry if the value is replaced. The {@code putAll} method generates one
+ * entry access for each mapping in the specified map, in the order that
+ * key-value mappings are provided by the specified map's entry set iterator.
+ * No other methods generate entry accesses. In particular, operations
+ * on collection-views do not affect the order of iteration of the
+ * backing map.
*
* The {@link #removeEldestEntry(Map.Entry)} method may be overridden to
* impose a policy for removing stale mappings automatically when new mappings
@@ -112,8 +114,8 @@
* iteration order. In insertion-ordered linked hash maps, merely changing
* the value associated with a key that is already contained in the map is not
* a structural modification. In access-ordered linked hash maps,
- * merely querying the map with get is a structural
- * modification. )
+ * merely querying the map with get is a structural modification.
+ * )
*
*
The iterators returned by the iterator method of the collections
* returned by all of this class's collection view methods are
@@ -252,7 +254,7 @@
Node newNode(int hash, K key, V value, Node e) {
LinkedHashMap.Entry p =
- new LinkedHashMap.Entry(hash, key, value, e);
+ new LinkedHashMap.Entry<>(hash, key, value, e);
linkNodeLast(p);
return p;
}
@@ -260,20 +262,20 @@
Node replacementNode(Node p, Node next) {
LinkedHashMap.Entry q = (LinkedHashMap.Entry)p;
LinkedHashMap.Entry t =
- new LinkedHashMap.Entry(q.hash, q.key, q.value, next);
+ new LinkedHashMap.Entry<>(q.hash, q.key, q.value, next);
transferLinks(q, t);
return t;
}
TreeNode newTreeNode(int hash, K key, V value, Node next) {
- TreeNode p = new TreeNode(hash, key, value, next);
+ TreeNode p = new TreeNode<>(hash, key, value, next);
linkNodeLast(p);
return p;
}
TreeNode replacementTreeNode(Node p, Node next) {
LinkedHashMap.Entry q = (LinkedHashMap.Entry)p;
- TreeNode t = new TreeNode(q.hash, q.key, q.value, next);
+ TreeNode t = new TreeNode<>(q.hash, q.key, q.value, next);
transferLinks(q, t);
return t;
}
@@ -443,8 +445,19 @@
}
/**
- * Removes all of the mappings from this map.
- * The map will be empty after this call returns.
+ * {@inheritDoc}
+ */
+ public V getOrDefault(Object key, V defaultValue) {
+ Node e;
+ if ((e = getNode(hash(key), key)) == null)
+ return defaultValue;
+ if (accessOrder)
+ afterNodeAccess(e);
+ return e.value;
+ }
+
+ /**
+ * {@inheritDoc}
*/
public void clear() {
super.clear();
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/LinkedList.java
--- a/jdk/src/share/classes/java/util/LinkedList.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/LinkedList.java Wed Jul 05 19:26:45 2017 +0200
@@ -1167,7 +1167,7 @@
*/
@Override
public Spliterator spliterator() {
- return new LLSpliterator(this, -1, 0);
+ return new LLSpliterator<>(this, -1, 0);
}
/** A customized variant of Spliterators.IteratorSpliterator */
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/ListResourceBundle.java
--- a/jdk/src/share/classes/java/util/ListResourceBundle.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/ListResourceBundle.java Wed Jul 05 19:26:45 2017 +0200
@@ -194,10 +194,10 @@
Object[][] contents = getContents();
HashMap temp = new HashMap<>(contents.length);
- for (int i = 0; i < contents.length; ++i) {
+ for (Object[] content : contents) {
// key must be non-null String, value must be non-null
- String key = (String) contents[i][0];
- Object value = contents[i][1];
+ String key = (String) content[0];
+ Object value = content[1];
if (key == null || value == null) {
throw new NullPointerException();
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/Map.java
--- a/jdk/src/share/classes/java/util/Map.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/Map.java Wed Jul 05 19:26:45 2017 +0200
@@ -600,7 +600,7 @@
* @implSpec
* The default implementation is equivalent to, for this {@code map}:
* {@code
- * for ((Map.Entry entry : map.entrySet())
+ * for (Map.Entry entry : map.entrySet())
* action.accept(entry.getKey(), entry.getValue());
* }
*
@@ -640,7 +640,7 @@
* @implSpec
* The default implementation is equivalent to, for this {@code map}:
*
{@code
- * for ((Map.Entry entry : map.entrySet())
+ * for (Map.Entry entry : map.entrySet())
* entry.setValue(function.apply(entry.getKey(), entry.getValue()));
* }
*
@@ -1110,8 +1110,8 @@
/**
* If the specified key is not already associated with a value or is
- * associated with null, associates it with the given value.
- * Otherwise, replaces the value with the results of the given
+ * associated with null, associates it with the given non-null value.
+ * Otherwise, replaces the associated value with the results of the given
* remapping function, or removes if the result is {@code null}. This
* method may be of use when combining multiple mapped values for a key.
* For example, to either create or append a {@code String msg} to a
@@ -1121,15 +1121,14 @@
* map.merge(key, msg, String::concat)
* }
*
- * If the function returns {@code null}, the mapping is removed (or
- * remains absent if initially absent). If the function itself throws an
- * (unchecked) exception, the exception is rethrown, and the current mapping
- * is left unchanged.
+ *
If the function returns {@code null} the mapping is removed. If the
+ * function itself throws an (unchecked) exception, the exception is
+ * rethrown, and the current mapping is left unchanged.
*
* @implSpec
- * The default implementation is equivalent to performing the
- * following steps for this {@code map}, then returning the
- * current value or {@code null} if absent:
+ * The default implementation is equivalent to performing the following
+ * steps for this {@code map}, then returning the current value or
+ * {@code null} if absent:
*
*
{@code
* V oldValue = map.get(key);
@@ -1137,8 +1136,6 @@
* remappingFunction.apply(oldValue, value);
* if (newValue == null)
* map.remove(key);
- * else if (oldValue == null)
- * map.remove(key);
* else
* map.put(key, newValue);
* }
@@ -1151,42 +1148,36 @@
* whether the function is applied once atomically only if the value is not
* present.
*
- * @param key key with which the specified value is to be associated
- * @param value the value to use if absent
+ * @param key key with which the resulting value is to be associated
+ * @param value the non-null value to be merged with the existing value
+ * associated with the key or, if no existing value or a null value
+ * is associated with the key, to be associated with the key
* @param remappingFunction the function to recompute a value if present
- * @return the new value associated with the specified key, or null if none
+ * @return the new value associated with the specified key, or null if no
+ * value is associated with the key
* @throws UnsupportedOperationException if the {@code put} operation
* is not supported by this map
* (optional )
* @throws ClassCastException if the class of the specified key or value
* prevents it from being stored in this map
* (optional )
- * @throws NullPointerException if the specified key is null and
- * this map does not support null keys, or the remappingFunction
- * is null
+ * @throws NullPointerException if the specified key is null and this map
+ * does not support null keys or the value or remappingFunction is
+ * null
* @since 1.8
*/
default V merge(K key, V value,
BiFunction super V, ? super V, ? extends V> remappingFunction) {
Objects.requireNonNull(remappingFunction);
+ Objects.requireNonNull(value);
V oldValue = get(key);
- if (oldValue != null) {
- V newValue = remappingFunction.apply(oldValue, value);
- if (newValue != null) {
- put(key, newValue);
- return newValue;
- } else {
- remove(key);
- return null;
- }
+ V newValue = (oldValue == null) ? value :
+ remappingFunction.apply(oldValue, value);
+ if(newValue == null) {
+ remove(key);
} else {
- if (value == null) {
- remove(key);
- return null;
- } else {
- put(key, value);
- return value;
- }
+ put(key, newValue);
}
+ return newValue;
}
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/PriorityQueue.java
--- a/jdk/src/share/classes/java/util/PriorityQueue.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/PriorityQueue.java Wed Jul 05 19:26:45 2017 +0200
@@ -258,8 +258,8 @@
a = Arrays.copyOf(a, a.length, Object[].class);
int len = a.length;
if (len == 1 || this.comparator != null)
- for (int i = 0; i < len; i++)
- if (a[i] == null)
+ for (Object e : a)
+ if (e == null)
throw new NullPointerException();
this.queue = a;
this.size = a.length;
@@ -809,7 +809,7 @@
* @since 1.8
*/
public final Spliterator spliterator() {
- return new PriorityQueueSpliterator(this, 0, -1, 0);
+ return new PriorityQueueSpliterator<>(this, 0, -1, 0);
}
static final class PriorityQueueSpliterator implements Spliterator {
@@ -843,8 +843,8 @@
public PriorityQueueSpliterator trySplit() {
int hi = getFence(), lo = index, mid = (lo + hi) >>> 1;
return (lo >= mid) ? null :
- new PriorityQueueSpliterator(pq, lo, index = mid,
- expectedModCount);
+ new PriorityQueueSpliterator<>(pq, lo, index = mid,
+ expectedModCount);
}
@SuppressWarnings("unchecked")
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/ResourceBundle.java
--- a/jdk/src/share/classes/java/util/ResourceBundle.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/ResourceBundle.java Wed Jul 05 19:26:45 2017 +0200
@@ -1494,19 +1494,15 @@
Locale targetLocale = cacheKey.getLocale();
ResourceBundle bundle = null;
- int size = formats.size();
- for (int i = 0; i < size; i++) {
- String format = formats.get(i);
+ for (String format : formats) {
try {
bundle = control.newBundle(cacheKey.getName(), targetLocale, format,
cacheKey.getLoader(), reload);
- } catch (LinkageError error) {
+ } catch (LinkageError | Exception error) {
// We need to handle the LinkageError case due to
// inconsistent case-sensitivity in ClassLoader.
// See 6572242 for details.
cacheKey.setCause(error);
- } catch (Exception cause) {
- cacheKey.setCause(cause);
}
if (bundle != null) {
// Set the format in the cache key so that it can be
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/StringTokenizer.java
--- a/jdk/src/share/classes/java/util/StringTokenizer.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/StringTokenizer.java Wed Jul 05 19:26:45 2017 +0200
@@ -297,8 +297,8 @@
}
private boolean isDelimiter(int codePoint) {
- for (int i = 0; i < delimiterCodePoints.length; i++) {
- if (delimiterCodePoints[i] == codePoint) {
+ for (int delimiterCodePoint : delimiterCodePoints) {
+ if (delimiterCodePoint == codePoint) {
return true;
}
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/TreeMap.java
--- a/jdk/src/share/classes/java/util/TreeMap.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/TreeMap.java Wed Jul 05 19:26:45 2017 +0200
@@ -198,8 +198,7 @@
comparator = m.comparator();
try {
buildFromSorted(m.size(), m.entrySet().iterator(), null, null);
- } catch (java.io.IOException cannotHappen) {
- } catch (ClassNotFoundException cannotHappen) {
+ } catch (java.io.IOException | ClassNotFoundException cannotHappen) {
}
}
@@ -318,8 +317,7 @@
try {
buildFromSorted(mapSize, map.entrySet().iterator(),
null, null);
- } catch (java.io.IOException cannotHappen) {
- } catch (ClassNotFoundException cannotHappen) {
+ } catch (java.io.IOException | ClassNotFoundException cannotHappen) {
}
return;
}
@@ -644,8 +642,7 @@
// Initialize clone with our mappings
try {
clone.buildFromSorted(size, entrySet().iterator(), null, null);
- } catch (java.io.IOException cannotHappen) {
- } catch (ClassNotFoundException cannotHappen) {
+ } catch (java.io.IOException | ClassNotFoundException cannotHappen) {
}
return clone;
@@ -1050,7 +1047,7 @@
}
public Spliterator spliterator() {
- return new ValueSpliterator(TreeMap.this, null, null, 0, -1, 0);
+ return new ValueSpliterator<>(TreeMap.this, null, null, 0, -1, 0);
}
}
@@ -1090,7 +1087,7 @@
}
public Spliterator> spliterator() {
- return new EntrySpliterator(TreeMap.this, null, null, 0, -1, 0);
+ return new EntrySpliterator<>(TreeMap.this, null, null, 0, -1, 0);
}
}
@@ -2427,8 +2424,7 @@
s.writeInt(size);
// Write out keys and values (alternating)
- for (Iterator> i = entrySet().iterator(); i.hasNext(); ) {
- Map.Entry e = i.next();
+ for (Map.Entry e : entrySet()) {
s.writeObject(e.getKey());
s.writeObject(e.getValue());
}
@@ -2459,8 +2455,7 @@
void addAllForTreeSet(SortedSet extends K> set, V defaultVal) {
try {
buildFromSorted(set.size(), set.iterator(), null, defaultVal);
- } catch (java.io.IOException cannotHappen) {
- } catch (ClassNotFoundException cannotHappen) {
+ } catch (java.io.IOException | ClassNotFoundException cannotHappen) {
}
}
@@ -2631,11 +2626,11 @@
}
final Spliterator keySpliterator() {
- return new KeySpliterator(this, null, null, 0, -1, 0);
+ return new KeySpliterator<>(this, null, null, 0, -1, 0);
}
final Spliterator descendingKeySpliterator() {
- return new DescendingKeySpliterator(this, null, null, 0, -2, 0);
+ return new DescendingKeySpliterator<>(this, null, null, 0, -2, 0);
}
/**
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/TreeSet.java
--- a/jdk/src/share/classes/java/util/TreeSet.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/TreeSet.java Wed Jul 05 19:26:45 2017 +0200
@@ -121,7 +121,7 @@
* {@code ClassCastException}.
*/
public TreeSet() {
- this(new TreeMap());
+ this(new TreeMap<>());
}
/**
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/Vector.java
--- a/jdk/src/share/classes/java/util/Vector.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/Vector.java Wed Jul 05 19:26:45 2017 +0200
@@ -1374,8 +1374,8 @@
public Spliterator trySplit() {
int hi = getFence(), lo = index, mid = (lo + hi) >>> 1;
return (lo >= mid) ? null :
- new VectorSpliterator(list, array, lo, index = mid,
- expectedModCount);
+ new VectorSpliterator<>(list, array, lo, index = mid,
+ expectedModCount);
}
@SuppressWarnings("unchecked")
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/WeakHashMap.java
--- a/jdk/src/share/classes/java/util/WeakHashMap.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/WeakHashMap.java Wed Jul 05 19:26:45 2017 +0200
@@ -1097,8 +1097,8 @@
public KeySpliterator trySplit() {
int hi = getFence(), lo = index, mid = (lo + hi) >>> 1;
return (lo >= mid) ? null :
- new KeySpliterator(map, lo, index = mid, est >>>= 1,
- expectedModCount);
+ new KeySpliterator<>(map, lo, index = mid, est >>>= 1,
+ expectedModCount);
}
public void forEachRemaining(Consumer super K> action) {
@@ -1177,8 +1177,8 @@
public ValueSpliterator trySplit() {
int hi = getFence(), lo = index, mid = (lo + hi) >>> 1;
return (lo >= mid) ? null :
- new ValueSpliterator(map, lo, index = mid, est >>>= 1,
- expectedModCount);
+ new ValueSpliterator<>(map, lo, index = mid, est >>>= 1,
+ expectedModCount);
}
public void forEachRemaining(Consumer super V> action) {
@@ -1254,8 +1254,8 @@
public EntrySpliterator trySplit() {
int hi = getFence(), lo = index, mid = (lo + hi) >>> 1;
return (lo >= mid) ? null :
- new EntrySpliterator(map, lo, index = mid, est >>>= 1,
- expectedModCount);
+ new EntrySpliterator<>(map, lo, index = mid, est >>>= 1,
+ expectedModCount);
}
@@ -1286,7 +1286,7 @@
@SuppressWarnings("unchecked") K k =
(K) WeakHashMap.unmaskNull(x);
action.accept
- (new AbstractMap.SimpleImmutableEntry(k, v));
+ (new AbstractMap.SimpleImmutableEntry<>(k, v));
}
}
} while (p != null || i < hi);
@@ -1312,7 +1312,7 @@
@SuppressWarnings("unchecked") K k =
(K) WeakHashMap.unmaskNull(x);
action.accept
- (new AbstractMap.SimpleImmutableEntry(k, v));
+ (new AbstractMap.SimpleImmutableEntry<>(k, v));
if (map.modCount != expectedModCount)
throw new ConcurrentModificationException();
return true;
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/concurrent/ConcurrentMap.java
--- a/jdk/src/share/classes/java/util/concurrent/ConcurrentMap.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/concurrent/ConcurrentMap.java Wed Jul 05 19:26:45 2017 +0200
@@ -463,9 +463,9 @@
* {@inheritDoc}
*
* @implSpec
- * The default implementation is equivalent to performing the
- * following steps for this {@code map}, then returning the
- * current value or {@code null} if absent:
+ * The default implementation is equivalent to performing the following
+ * steps for this {@code map}, then returning the current value or
+ * {@code null} if absent:
*
* {@code
* V oldValue = map.get(key);
@@ -473,8 +473,6 @@
* remappingFunction.apply(oldValue, value);
* if (newValue == null)
* map.remove(key);
- * else if (oldValue == null)
- * map.remove(key);
* else
* map.put(key, newValue);
* }
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/concurrent/ForkJoinPool.java
--- a/jdk/src/share/classes/java/util/concurrent/ForkJoinPool.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/concurrent/ForkJoinPool.java Wed Jul 05 19:26:45 2017 +0200
@@ -49,6 +49,9 @@
import java.util.concurrent.RunnableFuture;
import java.util.concurrent.ThreadLocalRandom;
import java.util.concurrent.TimeUnit;
+import java.security.AccessControlContext;
+import java.security.ProtectionDomain;
+import java.security.Permissions;
/**
* An {@link ExecutorService} for running {@link ForkJoinTask}s.
@@ -140,6 +143,9 @@
* {@code java.util.concurrent.ForkJoinPool.common.exceptionHandler}
* - the class name of a {@link UncaughtExceptionHandler}
*
+ * If a {@link SecurityManager} is present and no factory is
+ * specified, then the default pool uses a factory supplying
+ * threads that have no {@link Permissions} enabled.
* The system class loader is used to load these classes.
* Upon any error in establishing these settings, default parameters
* are used. It is possible to disable or limit the use of threads in
@@ -501,6 +507,16 @@
* task status checks) in inapplicable cases amounts to an odd
* form of limited spin-wait before blocking in ForkJoinTask.join.
*
+ * As a more appropriate default in managed environments, unless
+ * overridden by system properties, we use workers of subclass
+ * InnocuousForkJoinWorkerThread when there is a SecurityManager
+ * present. These workers have no permissions set, do not belong
+ * to any user-defined ThreadGroup, and erase all ThreadLocals
+ * after executing any top-level task (see WorkQueue.runTask). The
+ * associated mechanics (mainly in ForkJoinWorkerThread) may be
+ * JVM-dependent and must access particular Thread class fields to
+ * achieve this effect.
+ *
* Style notes
* ===========
*
@@ -882,6 +898,7 @@
*/
final void runTask(ForkJoinTask> task) {
if ((currentSteal = task) != null) {
+ ForkJoinWorkerThread thread;
task.doExec();
ForkJoinTask>[] a = array;
int md = mode;
@@ -899,6 +916,8 @@
t.doExec();
}
}
+ if ((thread = owner) != null) // no need to do in finally clause
+ thread.afterTopLevelExec();
}
}
@@ -1155,7 +1174,7 @@
* Increment for seed generators. See class ThreadLocal for
* explanation.
*/
- private static final int SEED_INCREMENT = 0x61c88647;
+ private static final int SEED_INCREMENT = 0x9e3779b9;
/*
* Bits and masks for control variables
@@ -2084,12 +2103,10 @@
((c & ~AC_MASK) |
((c & AC_MASK) + AC_UNIT))));
}
- if ((b = q.base) - q.top < 0 && (t = q.pollAt(b)) != null) {
- (w.currentSteal = t).doExec();
- w.currentSteal = ps;
- }
+ if ((b = q.base) - q.top < 0 && (t = q.pollAt(b)) != null)
+ w.runTask(t);
}
- else if (active) { // decrement active count without queuing
+ else if (active) { // decrement active count without queuing
long nc = ((c = ctl) & ~AC_MASK) | ((c & AC_MASK) - AC_UNIT);
if ((int)(nc >> AC_SHIFT) + parallelism == 0)
break; // bypass decrement-then-increment
@@ -3282,8 +3299,7 @@
*/
private static ForkJoinPool makeCommonPool() {
int parallelism = -1;
- ForkJoinWorkerThreadFactory factory
- = defaultForkJoinWorkerThreadFactory;
+ ForkJoinWorkerThreadFactory factory = null;
UncaughtExceptionHandler handler = null;
try { // ignore exceptions in accessing/parsing properties
String pp = System.getProperty
@@ -3302,7 +3318,12 @@
getSystemClassLoader().loadClass(hp).newInstance());
} catch (Exception ignore) {
}
-
+ if (factory == null) {
+ if (System.getSecurityManager() == null)
+ factory = defaultForkJoinWorkerThreadFactory;
+ else // use security-managed default
+ factory = new InnocuousForkJoinWorkerThreadFactory();
+ }
if (parallelism < 0 && // default 1 less than #cores
(parallelism = Runtime.getRuntime().availableProcessors() - 1) <= 0)
parallelism = 1;
@@ -3312,4 +3333,38 @@
"ForkJoinPool.commonPool-worker-");
}
+ /**
+ * Factory for innocuous worker threads
+ */
+ static final class InnocuousForkJoinWorkerThreadFactory
+ implements ForkJoinWorkerThreadFactory {
+
+ /**
+ * An ACC to restrict permissions for the factory itself.
+ * The constructed workers have no permissions set.
+ */
+ private static final AccessControlContext innocuousAcc;
+ static {
+ Permissions innocuousPerms = new Permissions();
+ innocuousPerms.add(modifyThreadPermission);
+ innocuousPerms.add(new RuntimePermission(
+ "enableContextClassLoaderOverride"));
+ innocuousPerms.add(new RuntimePermission(
+ "modifyThreadGroup"));
+ innocuousAcc = new AccessControlContext(new ProtectionDomain[] {
+ new ProtectionDomain(null, innocuousPerms)
+ });
+ }
+
+ public final ForkJoinWorkerThread newThread(ForkJoinPool pool) {
+ return (ForkJoinWorkerThread.InnocuousForkJoinWorkerThread)
+ java.security.AccessController.doPrivileged(
+ new java.security.PrivilegedAction() {
+ public ForkJoinWorkerThread run() {
+ return new ForkJoinWorkerThread.
+ InnocuousForkJoinWorkerThread(pool);
+ }}, innocuousAcc);
+ }
+ }
+
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java
--- a/jdk/src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/concurrent/ForkJoinWorkerThread.java Wed Jul 05 19:26:45 2017 +0200
@@ -35,6 +35,9 @@
package java.util.concurrent;
+import java.security.AccessControlContext;
+import java.security.ProtectionDomain;
+
/**
* A thread managed by a {@link ForkJoinPool}, which executes
* {@link ForkJoinTask}s.
@@ -61,6 +64,10 @@
* completes. This leads to a visibility race, that is tolerated
* by requiring that the workQueue field is only accessed by the
* owning thread.
+ *
+ * Support for (non-public) subclass InnocuousForkJoinWorkerThread
+ * requires that we break quite a lot of encapulation (via Unsafe)
+ * both here and in the subclass to access and set Thread fields.
*/
final ForkJoinPool pool; // the pool this thread works in
@@ -80,6 +87,18 @@
}
/**
+ * Version for InnocuousForkJoinWorkerThread
+ */
+ ForkJoinWorkerThread(ForkJoinPool pool, ThreadGroup threadGroup,
+ AccessControlContext acc) {
+ super(threadGroup, null, "aForkJoinWorkerThread");
+ U.putOrderedObject(this, INHERITEDACCESSCONTROLCONTEXT, acc);
+ eraseThreadLocals(); // clear before registering
+ this.pool = pool;
+ this.workQueue = pool.registerWorker(this);
+ }
+
+ /**
* Returns the pool hosting this thread.
*
* @return the pool
@@ -131,21 +150,128 @@
* {@link ForkJoinTask}s.
*/
public void run() {
- Throwable exception = null;
- try {
- onStart();
- pool.runWorker(workQueue);
- } catch (Throwable ex) {
- exception = ex;
- } finally {
+ if (workQueue.array == null) { // only run once
+ Throwable exception = null;
try {
- onTermination(exception);
+ onStart();
+ pool.runWorker(workQueue);
} catch (Throwable ex) {
- if (exception == null)
- exception = ex;
+ exception = ex;
} finally {
- pool.deregisterWorker(this, exception);
+ try {
+ onTermination(exception);
+ } catch (Throwable ex) {
+ if (exception == null)
+ exception = ex;
+ } finally {
+ pool.deregisterWorker(this, exception);
+ }
}
}
}
+
+ /**
+ * Erases ThreadLocals by nulling out Thread maps
+ */
+ final void eraseThreadLocals() {
+ U.putObject(this, THREADLOCALS, null);
+ U.putObject(this, INHERITABLETHREADLOCALS, null);
+ }
+
+ /**
+ * Non-public hook method for InnocuousForkJoinWorkerThread
+ */
+ void afterTopLevelExec() {
+ }
+
+ // Set up to allow setting thread fields in constructor
+ private static final sun.misc.Unsafe U;
+ private static final long THREADLOCALS;
+ private static final long INHERITABLETHREADLOCALS;
+ private static final long INHERITEDACCESSCONTROLCONTEXT;
+ static {
+ try {
+ U = sun.misc.Unsafe.getUnsafe();
+ Class> tk = Thread.class;
+ THREADLOCALS = U.objectFieldOffset
+ (tk.getDeclaredField("threadLocals"));
+ INHERITABLETHREADLOCALS = U.objectFieldOffset
+ (tk.getDeclaredField("inheritableThreadLocals"));
+ INHERITEDACCESSCONTROLCONTEXT = U.objectFieldOffset
+ (tk.getDeclaredField("inheritedAccessControlContext"));
+
+ } catch (Exception e) {
+ throw new Error(e);
+ }
+ }
+
+ /**
+ * A worker thread that has no permissions, is not a member of any
+ * user-defined ThreadGroup, and erases all ThreadLocals after
+ * running each top-level task.
+ */
+ static final class InnocuousForkJoinWorkerThread extends ForkJoinWorkerThread {
+ /** The ThreadGroup for all InnocuousForkJoinWorkerThreads */
+ private static final ThreadGroup innocuousThreadGroup =
+ createThreadGroup();
+
+ /** An AccessControlContext supporting no privileges */
+ private static final AccessControlContext INNOCUOUS_ACC =
+ new AccessControlContext(
+ new ProtectionDomain[] {
+ new ProtectionDomain(null, null)
+ });
+
+ InnocuousForkJoinWorkerThread(ForkJoinPool pool) {
+ super(pool, innocuousThreadGroup, INNOCUOUS_ACC);
+ }
+
+ @Override // to erase ThreadLocals
+ void afterTopLevelExec() {
+ eraseThreadLocals();
+ }
+
+ @Override // to always report system loader
+ public ClassLoader getContextClassLoader() {
+ return ClassLoader.getSystemClassLoader();
+ }
+
+ @Override // to silently fail
+ public void setUncaughtExceptionHandler(UncaughtExceptionHandler x) { }
+
+ @Override // paranoically
+ public void setContextClassLoader(ClassLoader cl) {
+ throw new SecurityException("setContextClassLoader");
+ }
+
+ /**
+ * Returns a new group with the system ThreadGroup (the
+ * topmost, parentless group) as parent. Uses Unsafe to
+ * traverse Thread group and ThreadGroup parent fields.
+ */
+ private static ThreadGroup createThreadGroup() {
+ try {
+ sun.misc.Unsafe u = sun.misc.Unsafe.getUnsafe();
+ Class> tk = Thread.class;
+ Class> gk = ThreadGroup.class;
+ long tg = u.objectFieldOffset(tk.getDeclaredField("group"));
+ long gp = u.objectFieldOffset(gk.getDeclaredField("parent"));
+ ThreadGroup group = (ThreadGroup)
+ u.getObject(Thread.currentThread(), tg);
+ while (group != null) {
+ ThreadGroup parent = (ThreadGroup)u.getObject(group, gp);
+ if (parent == null)
+ return new ThreadGroup(group,
+ "InnocuousForkJoinWorkerThreadGroup");
+ group = parent;
+ }
+ } catch (Exception e) {
+ throw new Error(e);
+ }
+ // fall through if null as cannot-happen safeguard
+ throw new Error("Cannot create ThreadGroup");
+ }
+ }
+
}
+
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/jar/Attributes.java
--- a/jdk/src/share/classes/java/util/jar/Attributes.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/jar/Attributes.java Wed Jul 05 19:26:45 2017 +0200
@@ -296,24 +296,22 @@
* XXX Need to handle UTF8 values and break up lines longer than 72 bytes
*/
void write(DataOutputStream os) throws IOException {
- Iterator> it = entrySet().iterator();
- while (it.hasNext()) {
- Map.Entry e = it.next();
- StringBuffer buffer = new StringBuffer(
- ((Name)e.getKey()).toString());
- buffer.append(": ");
+ for (Entry e : entrySet()) {
+ StringBuffer buffer = new StringBuffer(
+ ((Name) e.getKey()).toString());
+ buffer.append(": ");
- String value = (String)e.getValue();
- if (value != null) {
- byte[] vb = value.getBytes("UTF8");
- value = new String(vb, 0, 0, vb.length);
- }
- buffer.append(value);
+ String value = (String) e.getValue();
+ if (value != null) {
+ byte[] vb = value.getBytes("UTF8");
+ value = new String(vb, 0, 0, vb.length);
+ }
+ buffer.append(value);
- buffer.append("\r\n");
- Manifest.make72Safe(buffer);
- os.writeBytes(buffer.toString());
- }
+ buffer.append("\r\n");
+ Manifest.make72Safe(buffer);
+ os.writeBytes(buffer.toString());
+ }
os.writeBytes("\r\n");
}
@@ -340,16 +338,14 @@
// write out all attributes except for the version
// we wrote out earlier
- Iterator> it = entrySet().iterator();
- while (it.hasNext()) {
- Map.Entry e = it.next();
- String name = ((Name)e.getKey()).toString();
- if ((version != null) && ! (name.equalsIgnoreCase(vername))) {
+ for (Entry e : entrySet()) {
+ String name = ((Name) e.getKey()).toString();
+ if ((version != null) && !(name.equalsIgnoreCase(vername))) {
StringBuffer buffer = new StringBuffer(name);
buffer.append(": ");
- String value = (String)e.getValue();
+ String value = (String) e.getValue();
if (value != null) {
byte[] vb = value.getBytes("UTF8");
value = new String(vb, 0, 0, vb.length);
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/jar/JarFile.java
--- a/jdk/src/share/classes/java/util/jar/JarFile.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/jar/JarFile.java Wed Jul 05 19:26:45 2017 +0200
@@ -324,8 +324,8 @@
if (verify) {
String[] names = getMetaInfEntryNames();
if (names != null) {
- for (int i = 0; i < names.length; i++) {
- String name = names[i].toUpperCase(Locale.ENGLISH);
+ for (String nameLower : names) {
+ String name = nameLower.toUpperCase(Locale.ENGLISH);
if (name.endsWith(".DSA") ||
name.endsWith(".RSA") ||
name.endsWith(".EC") ||
@@ -356,8 +356,8 @@
try {
String[] names = getMetaInfEntryNames();
if (names != null) {
- for (int i = 0; i < names.length; i++) {
- JarEntry e = getJarEntry(names[i]);
+ for (String name : names) {
+ JarEntry e = getJarEntry(name);
if (e == null) {
throw new JarException("corrupted jar file");
}
@@ -487,10 +487,9 @@
// entries to find a match.
String[] names = getMetaInfEntryNames();
if (names != null) {
- for (int i = 0; i < names.length; i++) {
- if (MANIFEST_NAME.equals(
- names[i].toUpperCase(Locale.ENGLISH))) {
- manEntry = getJarEntry(names[i]);
+ for (String name : names) {
+ if (MANIFEST_NAME.equals(name.toUpperCase(Locale.ENGLISH))) {
+ manEntry = getJarEntry(name);
break;
}
}
@@ -580,11 +579,10 @@
}
String name = getName();
- String localJavaHome = javaHome;
- if (name.startsWith(localJavaHome)) {
+ if (name.startsWith(javaHome)) {
String[] names = jarNames;
- for (int i = 0; i < names.length; i++) {
- if (name.endsWith(names[i])) {
+ for (String jarName : names) {
+ if (name.endsWith(jarName)) {
return true;
}
}
@@ -619,8 +617,8 @@
* code source?
*/
boolean includeUnsigned = false;
- for (int i = 0; i < cs.length; i++) {
- if (cs[i].getCodeSigners() == null) {
+ for (CodeSource c : cs) {
+ if (c.getCodeSigners() == null) {
includeUnsigned = true;
break;
}
@@ -776,6 +774,6 @@
if (jv != null) {
return jv.getManifestDigests();
}
- return new ArrayList();
+ return new ArrayList<>();
}
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/jar/JarVerifier.java
--- a/jdk/src/share/classes/java/util/jar/JarVerifier.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/jar/JarVerifier.java Wed Jul 05 19:26:45 2017 +0200
@@ -258,9 +258,7 @@
sigFileData.put(key, bytes);
// check pending blocks, we can now process
// anyone waiting for this .SF file
- Iterator it = pendingBlocks.iterator();
- while (it.hasNext()) {
- SignatureFileVerifier sfv = it.next();
+ for (SignatureFileVerifier sfv : pendingBlocks) {
if (sfv.needSignatureFile(key)) {
if (debug != null) {
debug.println(
@@ -313,18 +311,9 @@
}
sfv.process(sigFileSigners, manifestDigests);
- } catch (IOException ioe) {
- // e.g. sun.security.pkcs.ParsingException
- if (debug != null) debug.println("processEntry caught: "+ioe);
- // ignore and treat as unsigned
- } catch (SignatureException se) {
- if (debug != null) debug.println("processEntry caught: "+se);
- // ignore and treat as unsigned
- } catch (NoSuchAlgorithmException nsae) {
- if (debug != null) debug.println("processEntry caught: "+nsae);
- // ignore and treat as unsigned
- } catch (CertificateException ce) {
- if (debug != null) debug.println("processEntry caught: "+ce);
+ } catch (IOException | CertificateException |
+ NoSuchAlgorithmException | SignatureException e) {
+ if (debug != null) debug.println("processEntry caught: "+e);
// ignore and treat as unsigned
}
}
@@ -387,9 +376,9 @@
if (signers != null) {
ArrayList certChains = new ArrayList<>();
- for (int i = 0; i < signers.length; i++) {
+ for (CodeSigner signer : signers) {
certChains.addAll(
- signers[i].getSignerCertPath().getCertificates());
+ signer.getSignerCertPath().getCertificates());
}
// Convert into a Certificate[]
@@ -536,8 +525,8 @@
private CodeSource[] mapSignersToCodeSources(URL url, List signers, boolean unsigned) {
List sources = new ArrayList<>();
- for (int i = 0; i < signers.size(); i++) {
- sources.add(mapSignersToCodeSource(url, signers.get(i)));
+ for (CodeSigner[] signer : signers) {
+ sources.add(mapSignersToCodeSource(url, signer));
}
if (unsigned) {
sources.add(mapSignersToCodeSource(url, null));
@@ -563,8 +552,8 @@
*/
CodeSource[] sources = mapSignersToCodeSources(cs.getLocation(), getJarCodeSigners(), true);
List sourceList = new ArrayList<>();
- for (int i = 0; i < sources.length; i++) {
- sourceList.add(sources[i]);
+ for (CodeSource source : sources) {
+ sourceList.add(source);
}
int j = sourceList.indexOf(cs);
if (j != -1) {
@@ -677,8 +666,8 @@
* to see if we can optimize CodeSigner equality test.
*/
List req = new ArrayList<>(cs.length);
- for (int i = 0; i < cs.length; i++) {
- CodeSigner[] match = findMatchingSigners(cs[i]);
+ for (CodeSource c : cs) {
+ CodeSigner[] match = findMatchingSigners(c);
if (match != null) {
if (match.length > 0) {
req.add(match);
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/jar/Manifest.java
--- a/jdk/src/share/classes/java/util/jar/Manifest.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/jar/Manifest.java Wed Jul 05 19:26:45 2017 +0200
@@ -148,9 +148,7 @@
// Write out the main attributes for the manifest
attr.writeMain(dos);
// Now write out the pre-entry attributes
- Iterator> it = entries.entrySet().iterator();
- while (it.hasNext()) {
- Map.Entry e = it.next();
+ for (Map.Entry e : entries.entrySet()) {
StringBuffer buffer = new StringBuffer("Name: ");
String value = e.getKey();
if (value != null) {
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/jar/Pack200.java
--- a/jdk/src/share/classes/java/util/jar/Pack200.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/jar/Pack200.java Wed Jul 05 19:26:45 2017 +0200
@@ -29,9 +29,6 @@
import java.io.OutputStream;
import java.io.File;
import java.io.IOException;
-import java.beans.PropertyChangeListener;
-
-
/**
@@ -571,54 +568,6 @@
* @exception IOException if an error is encountered.
*/
void pack(JarInputStream in, OutputStream out) throws IOException ;
-
- /**
- * Registers a listener for PropertyChange events on the properties map.
- * This is typically used by applications to update a progress bar.
- *
- * The default implementation of this method does nothing and has
- * no side-effects.
- *
- * WARNING: This method is omitted from the interface
- * declaration in all subset Profiles of Java SE that do not include
- * the {@code java.beans} package.
-
- * @see #properties
- * @see #PROGRESS
- * @param listener An object to be invoked when a property is changed.
- * @deprecated The dependency on {@code PropertyChangeListener} creates
- * a significant impediment to future modularization of the
- * Java platform. This method will be removed in a future
- * release.
- * Applications that need to monitor progress of the packer
- * can poll the value of the {@link #PROGRESS PROGRESS}
- * property instead.
- */
- @Deprecated
- default void addPropertyChangeListener(PropertyChangeListener listener) {
- }
-
- /**
- * Remove a listener for PropertyChange events, added by
- * the {@link #addPropertyChangeListener}.
- *
- * The default implementation of this method does nothing and has
- * no side-effects.
- *
- * WARNING: This method is omitted from the interface
- * declaration in all subset Profiles of Java SE that do not include
- * the {@code java.beans} package.
- *
- * @see #addPropertyChangeListener
- * @param listener The PropertyChange listener to be removed.
- * @deprecated The dependency on {@code PropertyChangeListener} creates
- * a significant impediment to future modularization of the
- * Java platform. This method will be removed in a future
- * release.
- */
- @Deprecated
- default void removePropertyChangeListener(PropertyChangeListener listener) {
- }
}
/**
@@ -730,54 +679,6 @@
* @exception IOException if an error is encountered.
*/
void unpack(File in, JarOutputStream out) throws IOException;
-
- /**
- * Registers a listener for PropertyChange events on the properties map.
- * This is typically used by applications to update a progress bar.
- *
- * The default implementation of this method does nothing and has
- * no side-effects.
- *
- * WARNING: This method is omitted from the interface
- * declaration in all subset Profiles of Java SE that do not include
- * the {@code java.beans} package.
- *
- * @see #properties
- * @see #PROGRESS
- * @param listener An object to be invoked when a property is changed.
- * @deprecated The dependency on {@code PropertyChangeListener} creates
- * a significant impediment to future modularization of the
- * Java platform. This method will be removed in a future
- * release.
- * Applications that need to monitor progress of the
- * unpacker can poll the value of the {@link #PROGRESS
- * PROGRESS} property instead.
- */
- @Deprecated
- default void addPropertyChangeListener(PropertyChangeListener listener) {
- }
-
- /**
- * Remove a listener for PropertyChange events, added by
- * the {@link #addPropertyChangeListener}.
- *
- * The default implementation of this method does nothing and has
- * no side-effects.
- *
- * WARNING: This method is omitted from the interface
- * declaration in all subset Profiles of Java SE that do not include
- * the {@code java.beans} package.
- *
- * @see #addPropertyChangeListener
- * @param listener The PropertyChange listener to be removed.
- * @deprecated The dependency on {@code PropertyChangeListener} creates
- * a significant impediment to future modularization of the
- * Java platform. This method will be removed in a future
- * release.
- */
- @Deprecated
- default void removePropertyChangeListener(PropertyChangeListener listener) {
- }
}
// Private stuff....
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/logging/ConsoleHandler.java
--- a/jdk/src/share/classes/java/util/logging/ConsoleHandler.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/logging/ConsoleHandler.java Wed Jul 05 19:26:45 2017 +0200
@@ -66,27 +66,6 @@
* @since 1.4
*/
public class ConsoleHandler extends StreamHandler {
- // Private method to configure a ConsoleHandler from LogManager
- // properties and/or default values as specified in the class
- // javadoc.
- private void configure() {
- LogManager manager = LogManager.getLogManager();
- String cname = getClass().getName();
-
- setLevel(manager.getLevelProperty(cname +".level", Level.INFO));
- setFilter(manager.getFilterProperty(cname +".filter", null));
- setFormatter(manager.getFormatterProperty(cname +".formatter", new SimpleFormatter()));
- try {
- setEncoding(manager.getStringProperty(cname +".encoding", null));
- } catch (Exception ex) {
- try {
- setEncoding(null);
- } catch (Exception ex2) {
- // doing a setEncoding with null should always work.
- // assert false;
- }
- }
- }
/**
* Create a ConsoleHandler for System.err .
@@ -96,10 +75,10 @@
*
*/
public ConsoleHandler() {
- sealed = false;
- configure();
- setOutputStream(System.err);
- sealed = true;
+ // configure with specific defaults for ConsoleHandler
+ super(Level.INFO, new SimpleFormatter(), null);
+
+ setOutputStreamPrivileged(System.err);
}
/**
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/logging/Handler.java
--- a/jdk/src/share/classes/java/util/logging/Handler.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/logging/Handler.java Wed Jul 05 19:26:45 2017 +0200
@@ -27,6 +27,9 @@
package java.util.logging;
import java.io.UnsupportedEncodingException;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
/**
* A Handler object takes log messages from a Logger and
* exports them. It might for example, write them to a console
@@ -62,10 +65,6 @@
private volatile ErrorManager errorManager = new ErrorManager();
private volatile String encoding;
- // Package private support for security checking. When sealed
- // is true, we access check updates to the class.
- boolean sealed = true;
-
/**
* Default constructor. The resulting Handler has a log
* level of Level.ALL , no Formatter , and no
@@ -76,6 +75,52 @@
}
/**
+ * Package-private constructor for chaining from subclass constructors
+ * that wish to configure the handler with specific default and/or
+ * specified values.
+ *
+ * @param defaultLevel a default {@link Level} to configure if one is
+ * not found in LogManager configuration properties
+ * @param defaultFormatter a default {@link Formatter} to configure if one is
+ * not specified by {@code specifiedFormatter} parameter
+ * nor found in LogManager configuration properties
+ * @param specifiedFormatter if not null, this is the formatter to configure
+ */
+ Handler(Level defaultLevel, Formatter defaultFormatter,
+ Formatter specifiedFormatter) {
+
+ LogManager manager = LogManager.getLogManager();
+ String cname = getClass().getName();
+
+ final Level level = manager.getLevelProperty(cname + ".level", defaultLevel);
+ final Filter filter = manager.getFilterProperty(cname + ".filter", null);
+ final Formatter formatter = specifiedFormatter == null
+ ? manager.getFormatterProperty(cname + ".formatter", defaultFormatter)
+ : specifiedFormatter;
+ final String encoding = manager.getStringProperty(cname + ".encoding", null);
+
+ AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
+ public Void run() {
+ setLevel(level);
+ setFilter(filter);
+ setFormatter(formatter);
+ try {
+ setEncoding(encoding);
+ } catch (Exception ex) {
+ try {
+ setEncoding(null);
+ } catch (Exception ex2) {
+ // doing a setEncoding with null should always work.
+ // assert false;
+ }
+ }
+ return null;
+ }
+ }, null, LogManager.controlPermission);
+ }
+
+ /**
* Publish a LogRecord .
*
* The logging request was made initially to a Logger object,
@@ -302,12 +347,9 @@
}
// Package-private support method for security checks.
- // If "sealed" is true, we check that the caller has
- // appropriate security privileges to update Handler
- // state and if not throw a SecurityException.
+ // We check that the caller has appropriate security privileges
+ // to update Handler state and if not throw a SecurityException.
void checkPermission() throws SecurityException {
- if (sealed) {
- manager.checkPermission();
- }
+ manager.checkPermission();
}
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/logging/LogManager.java
--- a/jdk/src/share/classes/java/util/logging/LogManager.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/logging/LogManager.java Wed Jul 05 19:26:45 2017 +0200
@@ -31,10 +31,6 @@
import java.security.*;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.WeakReference;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.beans.PropertyChangeListener;
import sun.misc.JavaAWTAccess;
import sun.misc.SharedSecrets;
@@ -156,10 +152,6 @@
private volatile Properties props = new Properties();
private final static Level defaultLevel = Level.INFO;
- // The map of the registered listeners. The map value is the registration
- // count to allow for cases where the same listener is registered many times.
- private final Map listenerMap = new HashMap<>();
-
// LoggerContext for system loggers and user loggers
private final LoggerContext systemContext = new SystemLoggerContext();
private final LoggerContext userContext = new LoggerContext();
@@ -329,6 +321,9 @@
// Create and retain Logger for the root of the namespace.
owner.rootLogger = owner.new RootLogger();
owner.addLogger(owner.rootLogger);
+ if (!owner.rootLogger.isLevelInitialized()) {
+ owner.rootLogger.setLevel(defaultLevel);
+ }
// Adding the global Logger.
// Do not call Logger.getGlobal() here as this might trigger
@@ -390,85 +385,6 @@
}
}
- /**
- * Adds an event listener to be invoked when the logging
- * properties are re-read. Adding multiple instances of
- * the same event Listener results in multiple entries
- * in the property event listener table.
- *
- * WARNING: This method is omitted from this class in all subset
- * Profiles of Java SE that do not include the {@code java.beans} package.
- *
- *
- * @param l event listener
- * @exception SecurityException if a security manager exists and if
- * the caller does not have LoggingPermission("control").
- * @exception NullPointerException if the PropertyChangeListener is null.
- * @deprecated The dependency on {@code PropertyChangeListener} creates a
- * significant impediment to future modularization of the Java
- * platform. This method will be removed in a future release.
- * The global {@code LogManager} can detect changes to the
- * logging configuration by overridding the {@link
- * #readConfiguration readConfiguration} method.
- */
- @Deprecated
- public void addPropertyChangeListener(PropertyChangeListener l) throws SecurityException {
- PropertyChangeListener listener = Objects.requireNonNull(l);
- checkPermission();
- synchronized (listenerMap) {
- // increment the registration count if already registered
- Integer value = listenerMap.get(listener);
- value = (value == null) ? 1 : (value + 1);
- listenerMap.put(listener, value);
- }
- }
-
- /**
- * Removes an event listener for property change events.
- * If the same listener instance has been added to the listener table
- * through multiple invocations of addPropertyChangeListener
,
- * then an equivalent number of
- * removePropertyChangeListener
invocations are required to remove
- * all instances of that listener from the listener table.
- *
- * Returns silently if the given listener is not found.
- *
- *
WARNING: This method is omitted from this class in all subset
- * Profiles of Java SE that do not include the {@code java.beans} package.
- *
- *
- * @param l event listener (can be null)
- * @exception SecurityException if a security manager exists and if
- * the caller does not have LoggingPermission("control").
- * @deprecated The dependency on {@code PropertyChangeListener} creates a
- * significant impediment to future modularization of the Java
- * platform. This method will be removed in a future release.
- * The global {@code LogManager} can detect changes to the
- * logging configuration by overridding the {@link
- * #readConfiguration readConfiguration} method.
- */
- @Deprecated
- public void removePropertyChangeListener(PropertyChangeListener l) throws SecurityException {
- checkPermission();
- if (l != null) {
- PropertyChangeListener listener = l;
- synchronized (listenerMap) {
- Integer value = listenerMap.get(listener);
- if (value != null) {
- // remove from map if registration count is 1, otherwise
- // just decrement its count
- int i = value.intValue();
- if (i == 1) {
- listenerMap.remove(listener);
- } else {
- assert i > 1;
- listenerMap.put(listener, i - 1);
- }
- }
- }
- }
- }
-
// LoggerContext maps from AppContext
private WeakHashMap contextsMap = null;
@@ -938,8 +854,7 @@
@Override
public Object run() {
String names[] = parseClassNames(handlersPropertyName);
- for (int i = 0; i < names.length; i++) {
- String word = names[i];
+ for (String word : names) {
try {
Class> clz = ClassLoader.getSystemClassLoader().loadClass(word);
Handler hdl = (Handler) clz.newInstance();
@@ -1318,8 +1233,7 @@
private void resetLogger(Logger logger) {
// Close all the Logger's handlers.
Handler[] targets = logger.getHandlers();
- for (int i = 0; i < targets.length; i++) {
- Handler h = targets[i];
+ for (Handler h : targets) {
logger.removeHandler(h);
try {
h.close();
@@ -1389,8 +1303,7 @@
// Instantiate new configuration objects.
String names[] = parseClassNames("config");
- for (int i = 0; i < names.length; i++) {
- String word = names[i];
+ for (String word : names) {
try {
Class> clz = ClassLoader.getSystemClassLoader().loadClass(word);
clz.newInstance();
@@ -1404,27 +1317,6 @@
// Set levels on any pre-existing loggers, based on the new properties.
setLevelsOnExistingLoggers();
- // Notify any interested parties that our properties have changed.
- // We first take a copy of the listener map so that we aren't holding any
- // locks when calling the listeners.
- Map listeners = null;
- synchronized (listenerMap) {
- if (!listenerMap.isEmpty())
- listeners = new HashMap<>(listenerMap);
- }
- if (listeners != null) {
- assert Beans.isBeansPresent();
- Object ev = Beans.newPropertyChangeEvent(LogManager.class, null, null, null);
- for (Map.Entry entry : listeners.entrySet()) {
- Object listener = entry.getKey();
- int count = entry.getValue().intValue();
- for (int i = 0; i < count; i++) {
- Beans.invokePropertyChange(listener, ev);
- }
- }
- }
-
-
// Note that we need to reinitialize global handles when
// they are first referenced.
synchronized (this) {
@@ -1557,7 +1449,7 @@
loadLoggerHandlers(rootLogger, null, "handlers");
}
- private final Permission controlPermission = new LoggingPermission("control", null);
+ static final Permission controlPermission = new LoggingPermission("control", null);
void checkPermission() {
SecurityManager sm = System.getSecurityManager();
@@ -1597,9 +1489,7 @@
if (children == null) {
return;
}
- Iterator values = children.values().iterator();
- while (values.hasNext()) {
- LogNode node = values.next();
+ for (LogNode node : children.values()) {
LoggerWeakRef ref = node.loggerRef;
Logger logger = (ref == null) ? null : ref.get();
if (logger == null) {
@@ -1620,7 +1510,6 @@
// to avoid calling LogManager.getLogManager() from within the
// RootLogger constructor.
super("", null, null, LogManager.this);
- setLevel(defaultLevel);
}
@Override
@@ -1713,101 +1602,4 @@
}
return loggingMXBean;
}
-
- /**
- * 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.
- */
- 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 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);
- }
- }
- }
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/logging/LogRecord.java
--- a/jdk/src/share/classes/java/util/logging/LogRecord.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/logging/LogRecord.java Wed Jul 05 19:26:45 2017 +0200
@@ -481,12 +481,8 @@
}
out.writeInt(parameters.length);
// Write string values for the parameters.
- for (int i = 0; i < parameters.length; i++) {
- if (parameters[i] == null) {
- out.writeObject(null);
- } else {
- out.writeObject(parameters[i].toString());
- }
+ for (Object parameter : parameters) {
+ out.writeObject(Objects.toString(parameter, null));
}
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/logging/Logger.java
--- a/jdk/src/share/classes/java/util/logging/Logger.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/logging/Logger.java Wed Jul 05 19:26:45 2017 +0200
@@ -2108,9 +2108,8 @@
// Recursively update the level on each of our kids.
if (kids != null) {
- for (int i = 0; i < kids.size(); i++) {
- LogManager.LoggerWeakRef ref = kids.get(i);
- Logger kid = ref.get();
+ for (LogManager.LoggerWeakRef ref : kids) {
+ Logger kid = ref.get();
if (kid != null) {
kid.updateEffectiveLevel();
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/logging/MemoryHandler.java
--- a/jdk/src/share/classes/java/util/logging/MemoryHandler.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/logging/MemoryHandler.java Wed Jul 05 19:26:45 2017 +0200
@@ -94,37 +94,24 @@
private LogRecord buffer[];
int start, count;
- // Private method to configure a MemoryHandler from LogManager
- // properties and/or default values as specified in the class
- // javadoc.
- private void configure() {
+ /**
+ * Create a MemoryHandler and configure it based on
+ * LogManager configuration properties.
+ */
+ public MemoryHandler() {
+ // configure with specific defaults for MemoryHandler
+ super(Level.ALL, new SimpleFormatter(), null);
+
LogManager manager = LogManager.getLogManager();
String cname = getClass().getName();
-
pushLevel = manager.getLevelProperty(cname +".push", Level.SEVERE);
size = manager.getIntProperty(cname + ".size", DEFAULT_SIZE);
if (size <= 0) {
size = DEFAULT_SIZE;
}
- setLevel(manager.getLevelProperty(cname +".level", Level.ALL));
- setFilter(manager.getFilterProperty(cname +".filter", null));
- setFormatter(manager.getFormatterProperty(cname +".formatter", new SimpleFormatter()));
- }
-
- /**
- * Create a MemoryHandler and configure it based on
- * LogManager configuration properties.
- */
- public MemoryHandler() {
- sealed = false;
- configure();
- sealed = true;
-
- LogManager manager = LogManager.getLogManager();
- String handlerName = getClass().getName();
- String targetName = manager.getProperty(handlerName+".target");
+ String targetName = manager.getProperty(cname+".target");
if (targetName == null) {
- throw new RuntimeException("The handler " + handlerName
+ throw new RuntimeException("The handler " + cname
+ " does not specify a target");
}
Class> clz;
@@ -158,15 +145,15 @@
* @throws IllegalArgumentException if {@code size is <= 0}
*/
public MemoryHandler(Handler target, int size, Level pushLevel) {
+ // configure with specific defaults for MemoryHandler
+ super(Level.ALL, new SimpleFormatter(), null);
+
if (target == null || pushLevel == null) {
throw new NullPointerException();
}
if (size <= 0) {
throw new IllegalArgumentException();
}
- sealed = false;
- configure();
- sealed = true;
this.target = target;
this.pushLevel = pushLevel;
this.size = size;
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/logging/SocketHandler.java
--- a/jdk/src/share/classes/java/util/logging/SocketHandler.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/logging/SocketHandler.java Wed Jul 05 19:26:45 2017 +0200
@@ -83,31 +83,6 @@
private String host;
private int port;
- // Private method to configure a SocketHandler from LogManager
- // properties and/or default values as specified in the class
- // javadoc.
- private void configure() {
- LogManager manager = LogManager.getLogManager();
- String cname = getClass().getName();
-
- setLevel(manager.getLevelProperty(cname +".level", Level.ALL));
- setFilter(manager.getFilterProperty(cname +".filter", null));
- setFormatter(manager.getFormatterProperty(cname +".formatter", new XMLFormatter()));
- try {
- setEncoding(manager.getStringProperty(cname +".encoding", null));
- } catch (Exception ex) {
- try {
- setEncoding(null);
- } catch (Exception ex2) {
- // doing a setEncoding with null should always work.
- // assert false;
- }
- }
- port = manager.getIntProperty(cname + ".port", 0);
- host = manager.getStringProperty(cname + ".host", null);
- }
-
-
/**
* Create a SocketHandler , using only LogManager properties
* (or their defaults).
@@ -117,9 +92,13 @@
* host and port.
*/
public SocketHandler() throws IOException {
- // We are going to use the logging defaults.
- sealed = false;
- configure();
+ // configure with specific defaults for SocketHandler
+ super(Level.ALL, new XMLFormatter(), null);
+
+ LogManager manager = LogManager.getLogManager();
+ String cname = getClass().getName();
+ port = manager.getIntProperty(cname + ".port", 0);
+ host = manager.getStringProperty(cname + ".host", null);
try {
connect();
@@ -127,7 +106,6 @@
System.err.println("SocketHandler: connect failed to " + host + ":" + port);
throw ix;
}
- sealed = true;
}
/**
@@ -146,11 +124,12 @@
* host and port.
*/
public SocketHandler(String host, int port) throws IOException {
- sealed = false;
- configure();
- sealed = true;
+ // configure with specific defaults for SocketHandler
+ super(Level.ALL, new XMLFormatter(), null);
+
this.port = port;
this.host = host;
+
connect();
}
@@ -167,7 +146,7 @@
sock = new Socket(host, port);
OutputStream out = sock.getOutputStream();
BufferedOutputStream bout = new BufferedOutputStream(out);
- setOutputStream(bout);
+ setOutputStreamPrivileged(bout);
}
/**
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/logging/StreamHandler.java
--- a/jdk/src/share/classes/java/util/logging/StreamHandler.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/logging/StreamHandler.java Wed Jul 05 19:26:45 2017 +0200
@@ -27,6 +27,9 @@
package java.util.logging;
import java.io.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.Objects;
/**
* Stream based logging Handler .
@@ -77,35 +80,12 @@
private boolean doneHeader;
private volatile Writer writer;
- // Private method to configure a StreamHandler from LogManager
- // properties and/or default values as specified in the class
- // javadoc.
- private void configure() {
- LogManager manager = LogManager.getLogManager();
- String cname = getClass().getName();
-
- setLevel(manager.getLevelProperty(cname +".level", Level.INFO));
- setFilter(manager.getFilterProperty(cname +".filter", null));
- setFormatter(manager.getFormatterProperty(cname +".formatter", new SimpleFormatter()));
- try {
- setEncoding(manager.getStringProperty(cname +".encoding", null));
- } catch (Exception ex) {
- try {
- setEncoding(null);
- } catch (Exception ex2) {
- // doing a setEncoding with null should always work.
- // assert false;
- }
- }
- }
-
/**
* Create a StreamHandler , with no current output stream.
*/
public StreamHandler() {
- sealed = false;
- configure();
- sealed = true;
+ // configure with specific defaults for StreamHandler
+ super(Level.INFO, new SimpleFormatter(), null);
}
/**
@@ -116,11 +96,19 @@
* @param formatter Formatter to be used to format output
*/
public StreamHandler(OutputStream out, Formatter formatter) {
- sealed = false;
- configure();
- setFormatter(formatter);
- setOutputStream(out);
- sealed = true;
+ // configure with default level but use specified formatter
+ super(Level.INFO, null, Objects.requireNonNull(formatter));
+
+ setOutputStreamPrivileged(out);
+ }
+
+ /**
+ * @see Handler#Handler(Level, Formatter, Formatter)
+ */
+ StreamHandler(Level defaultLevel,
+ Formatter defaultFormatter,
+ Formatter specifiedFormatter) {
+ super(defaultLevel, defaultFormatter, specifiedFormatter);
}
/**
@@ -301,4 +289,16 @@
public synchronized void close() throws SecurityException {
flushAndClose();
}
+
+ // Package-private support for setting OutputStream
+ // with elevated privilege.
+ final void setOutputStreamPrivileged(final OutputStream out) {
+ AccessController.doPrivileged(new PrivilegedAction() {
+ @Override
+ public Void run() {
+ setOutputStream(out);
+ return null;
+ }
+ }, null, LogManager.controlPermission);
+ }
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/logging/XMLFormatter.java
--- a/jdk/src/share/classes/java/util/logging/XMLFormatter.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/logging/XMLFormatter.java Wed Jul 05 19:26:45 2017 +0200
@@ -173,12 +173,12 @@
Object parameters[] = record.getParameters();
// Check to see if the parameter was not a messagetext format
// or was not null or empty
- if ( parameters != null && parameters.length != 0
+ if (parameters != null && parameters.length != 0
&& record.getMessage().indexOf("{") == -1 ) {
- for (int i = 0; i < parameters.length; i++) {
+ for (Object parameter : parameters) {
sb.append(" ");
try {
- escape(sb, parameters[i].toString());
+ escape(sb, parameter.toString());
} catch (Exception ex) {
sb.append("???");
}
@@ -194,8 +194,7 @@
escape(sb, th.toString());
sb.append("\n");
StackTraceElement trace[] = th.getStackTrace();
- for (int i = 0; i < trace.length; i++) {
- StackTraceElement frame = trace[i];
+ for (StackTraceElement frame : trace) {
sb.append(" \n");
sb.append(" ");
escape(sb, frame.getClassName());
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/prefs/AbstractPreferences.java
--- a/jdk/src/share/classes/java/util/prefs/AbstractPreferences.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/prefs/AbstractPreferences.java Wed Jul 05 19:26:45 2017 +0200
@@ -334,9 +334,8 @@
*/
public void clear() throws BackingStoreException {
synchronized(lock) {
- String[] keys = keys();
- for (int i=0; i i = kidCache.values().iterator();
@@ -1257,9 +1256,9 @@
synchronized(lock) {
// assert kidCache.get(nodeName)==null;
String[] kidNames = childrenNames();
- for (int i=0; i> i = map.entrySet().iterator(); i.hasNext(); ) {
- Map.Entry e = i.next();
+ for (Map.Entry e : map.entrySet()) {
Element xe = (Element)
xmlMap.appendChild(doc.createElement("entry"));
xe.setAttribute("key", e.getKey());
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/regex/Pattern.java
--- a/jdk/src/share/classes/java/util/regex/Pattern.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/regex/Pattern.java Wed Jul 05 19:26:45 2017 +0200
@@ -1545,8 +1545,8 @@
String[] subResult = producePermutations(otherChars);
String prefix = input.substring(offset, offset+len);
- for(int y=0; y, "
- + "value=<" + value + ">}");
+ switch (name) {
+ case "sc":
+ case "script":
+ node = unicodeScriptPropertyFor(value);
+ break;
+ case "blk":
+ case "block":
+ node = unicodeBlockPropertyFor(value);
+ break;
+ case "gc":
+ case "general_category":
+ node = charPropertyNodeFor(value);
+ break;
+ default:
+ throw error("Unknown Unicode property {name=<" + name + ">, "
+ + "value=<" + value + ">}");
}
} else {
if (name.startsWith("In")) {
@@ -5497,8 +5504,8 @@
BnMS(int[] src, int[] lastOcc, int[] optoSft, Node next) {
super(src, lastOcc, optoSft, next);
- for (int x = 0; x < buffer.length; x++) {
- lengthInChars += Character.charCount(buffer[x]);
+ for (int cp : buffer) {
+ lengthInChars += Character.charCount(cp);
}
}
boolean match(Matcher matcher, int i, CharSequence seq) {
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/stream/Collectors.java
--- a/jdk/src/share/classes/java/util/stream/Collectors.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/stream/Collectors.java Wed Jul 05 19:26:45 2017 +0200
@@ -507,16 +507,20 @@
summingDouble(ToDoubleFunction super T> mapper) {
/*
* In the arrays allocated for the collect operation, index 0
- * holds the high-order bits of the running sum and index 1
- * holds the low-order bits of the sum computed via
- * compensated summation.
+ * holds the high-order bits of the running sum, index 1 holds
+ * the low-order bits of the sum computed via compensated
+ * summation, and index 2 holds the simple sum used to compute
+ * the proper result if the stream contains infinite values of
+ * the same sign.
*/
return new CollectorImpl<>(
- () -> new double[2],
- (a, t) -> { sumWithCompensation(a, mapper.applyAsDouble(t)); },
- (a, b) -> { sumWithCompensation(a, b[0]); return sumWithCompensation(a, b[1]); },
- // Better error bounds to add both terms as the final sum
- a -> a[0] + a[1],
+ () -> new double[3],
+ (a, t) -> { sumWithCompensation(a, mapper.applyAsDouble(t));
+ a[2] += mapper.applyAsDouble(t);},
+ (a, b) -> { sumWithCompensation(a, b[0]);
+ a[2] += b[2];
+ return sumWithCompensation(a, b[1]); },
+ a -> computeFinalSum(a),
CH_NOID);
}
@@ -540,6 +544,20 @@
return intermediateSum;
}
+ /**
+ * If the compensated sum is spuriously NaN from accumulating one
+ * or more same-signed infinite values, return the
+ * correctly-signed infinity stored in the simple sum.
+ */
+ static double computeFinalSum(double[] summands) {
+ // Better error bounds to add both terms as the final sum
+ double tmp = summands[0] + summands[1];
+ double simpleSum = summands[summands.length - 1];
+ if (Double.isNaN(tmp) && Double.isInfinite(simpleSum))
+ return simpleSum;
+ else
+ return tmp;
+ }
/**
* Returns a {@code Collector} that produces the arithmetic mean of an integer-valued
@@ -608,11 +626,10 @@
* summation, and index 2 holds the number of values seen.
*/
return new CollectorImpl<>(
- () -> new double[3],
- (a, t) -> { sumWithCompensation(a, mapper.applyAsDouble(t)); a[2]++; },
- (a, b) -> { sumWithCompensation(a, b[0]); sumWithCompensation(a, b[1]); a[2] += b[2]; return a; },
- // Better error bounds to add both terms as the final sum to compute average
- a -> (a[2] == 0) ? 0.0d : ((a[0] + a[1]) / a[2]),
+ () -> new double[4],
+ (a, t) -> { sumWithCompensation(a, mapper.applyAsDouble(t)); a[2]++; a[3]+= mapper.applyAsDouble(t);},
+ (a, b) -> { sumWithCompensation(a, b[0]); sumWithCompensation(a, b[1]); a[2] += b[2]; a[3] += b[3]; return a; },
+ a -> (a[2] == 0) ? 0.0d : (computeFinalSum(a) / a[2]),
CH_NOID);
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/stream/DoublePipeline.java
--- a/jdk/src/share/classes/java/util/stream/DoublePipeline.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/stream/DoublePipeline.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 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
@@ -379,21 +379,24 @@
public final double sum() {
/*
* In the arrays allocated for the collect operation, index 0
- * holds the high-order bits of the running sum and index 1
- * holds the low-order bits of the sum computed via
- * compensated summation.
+ * holds the high-order bits of the running sum, index 1 holds
+ * the low-order bits of the sum computed via compensated
+ * summation, and index 2 holds the simple sum used to compute
+ * the proper result if the stream contains infinite values of
+ * the same sign.
*/
- double[] summation = collect(() -> new double[2],
+ double[] summation = collect(() -> new double[3],
(ll, d) -> {
Collectors.sumWithCompensation(ll, d);
+ ll[2] += d;
},
(ll, rr) -> {
Collectors.sumWithCompensation(ll, rr[0]);
Collectors.sumWithCompensation(ll, rr[1]);
+ ll[2] += rr[2];
});
- // Better error bounds to add both terms as the final sum
- return summation[0] + summation[1];
+ return Collectors.computeFinalSum(summation);
}
@Override
@@ -421,27 +424,29 @@
* In the arrays allocated for the collect operation, index 0
* holds the high-order bits of the running sum, index 1 holds
* the low-order bits of the sum computed via compensated
- * summation, and index 2 holds the number of values seen.
+ * summation, index 2 holds the number of values seen, index 3
+ * holds the simple sum.
*/
- double[] avg = collect(() -> new double[3],
+ double[] avg = collect(() -> new double[4],
(ll, d) -> {
ll[2]++;
Collectors.sumWithCompensation(ll, d);
+ ll[3] += d;
},
(ll, rr) -> {
Collectors.sumWithCompensation(ll, rr[0]);
Collectors.sumWithCompensation(ll, rr[1]);
ll[2] += rr[2];
+ ll[3] += rr[3];
});
return avg[2] > 0
- // Better error bounds to add both terms as the final sum to compute average
- ? OptionalDouble.of((avg[0] + avg[1]) / avg[2])
+ ? OptionalDouble.of(Collectors.computeFinalSum(avg) / avg[2])
: OptionalDouble.empty();
}
@Override
public final long count() {
- return mapToObj(e -> null).mapToInt(e -> 1).sum();
+ return mapToLong(e -> 1L).sum();
}
@Override
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/stream/IntPipeline.java
--- a/jdk/src/share/classes/java/util/stream/IntPipeline.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/stream/IntPipeline.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 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
@@ -426,7 +426,7 @@
@Override
public final long count() {
- return asLongStream().map(e -> 1L).sum();
+ return mapToLong(e -> 1L).sum();
}
@Override
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/java/util/stream/SortedOps.java
--- a/jdk/src/share/classes/java/util/stream/SortedOps.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/java/util/stream/SortedOps.java Wed Jul 05 19:26:45 2017 +0200
@@ -329,7 +329,7 @@
public void begin(long size) {
if (size >= Nodes.MAX_ARRAY_SIZE)
throw new IllegalArgumentException(Nodes.BAD_SIZE);
- list = (size >= 0) ? new ArrayList((int) size) : new ArrayList();
+ list = (size >= 0) ? new ArrayList<>((int) size) : new ArrayList<>();
}
@Override
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/javax/xml/crypto/dsig/CanonicalizationMethod.java
--- a/jdk/src/share/classes/javax/xml/crypto/dsig/CanonicalizationMethod.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/javax/xml/crypto/dsig/CanonicalizationMethod.java Wed Jul 05 19:26:45 2017 +0200
@@ -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
@@ -36,7 +36,6 @@
*
* W3C Recommendation for XML-Signature Syntax and Processing . The XML
* Schema Definition is defined as:
- *
*
* <element name="CanonicalizationMethod" type="ds:CanonicalizationMethodType"/>
* <complexType name="CanonicalizationMethodType" mixed="true">
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/javax/xml/crypto/dsig/DigestMethod.java
--- a/jdk/src/share/classes/javax/xml/crypto/dsig/DigestMethod.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/javax/xml/crypto/dsig/DigestMethod.java Wed Jul 05 19:26:45 2017 +0200
@@ -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
@@ -37,7 +37,6 @@
* defined in the
* W3C Recommendation for XML-Signature Syntax and Processing .
* The XML Schema Definition is defined as:
- *
*
* <element name="DigestMethod" type="ds:DigestMethodType"/>
* <complexType name="DigestMethodType" mixed="true">
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/javax/xml/crypto/dsig/Reference.java
--- a/jdk/src/share/classes/javax/xml/crypto/dsig/Reference.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/javax/xml/crypto/dsig/Reference.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, 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
@@ -38,7 +38,7 @@
*
* W3C Recommendation for XML-Signature Syntax and Processing .
* The XML schema is defined as:
- *
+ *
* <element name="Reference" type="ds:ReferenceType"/>
* <complexType name="ReferenceType">
* <sequence>
@@ -55,7 +55,7 @@
* <simpleType name="DigestValueType">
* <restriction base="base64Binary"/>
* </simpleType>
- *
+ *
*
* A Reference
instance may be created by invoking one of the
* {@link XMLSignatureFactory#newReference newReference} methods of the
@@ -145,7 +145,7 @@
/**
* Returns the dereferenced data, if
- * reference caching
+ * reference caching
* is enabled. This is the result of dereferencing the URI of this
* reference during a validation or generation operation.
*
@@ -157,7 +157,7 @@
/**
* Returns the pre-digested input stream, if
- * reference caching
+ * reference caching
* is enabled. This is the input to the digest operation during a
* validation or signing operation.
*
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/javax/xml/crypto/dsig/SignatureMethod.java
--- a/jdk/src/share/classes/javax/xml/crypto/dsig/SignatureMethod.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/javax/xml/crypto/dsig/SignatureMethod.java Wed Jul 05 19:26:45 2017 +0200
@@ -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
@@ -37,7 +37,6 @@
* as defined in the
* W3C Recommendation for XML-Signature Syntax and Processing .
* The XML Schema Definition is defined as:
- *
*
* <element name="SignatureMethod" type="ds:SignatureMethodType"/>
* <complexType name="SignatureMethodType" mixed="true">
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/javax/xml/crypto/dsig/TransformService.java
--- a/jdk/src/share/classes/javax/xml/crypto/dsig/TransformService.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/javax/xml/crypto/dsig/TransformService.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, 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
@@ -71,9 +71,9 @@
* TransformService
implementations that support the DOM
* mechanism type must abide by the DOM interoperability requirements defined
* in the
- *
+ *
* DOM Mechanism Requirements section of the API overview. See the
- *
+ *
* Service Providers section of the API overview for a list of standard
* mechanism types.
*
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/javax/xml/crypto/dsig/XMLSignContext.java
--- a/jdk/src/share/classes/javax/xml/crypto/dsig/XMLSignContext.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/javax/xml/crypto/dsig/XMLSignContext.java Wed Jul 05 19:26:45 2017 +0200
@@ -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
@@ -41,7 +41,7 @@
* (for example, you should not use the same XMLSignContext
* instance to sign two different {@link XMLSignature} objects).
*
- * Supported Properties
+ * Supported Properties
*
The following properties can be set using the
* {@link #setProperty setProperty} method.
*
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/javax/xml/crypto/dsig/XMLSignature.java
--- a/jdk/src/share/classes/javax/xml/crypto/dsig/XMLSignature.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/javax/xml/crypto/dsig/XMLSignature.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, 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
@@ -187,7 +187,6 @@
* defined in the
* W3C Recommendation for XML-Signature Syntax and Processing .
* The XML Schema Definition is defined as:
- *
*
* <element name="SignatureValue" type="ds:SignatureValueType"/>
* <complexType name="SignatureValueType">
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/javax/xml/crypto/dsig/XMLSignatureFactory.java
--- a/jdk/src/share/classes/javax/xml/crypto/dsig/XMLSignatureFactory.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/javax/xml/crypto/dsig/XMLSignatureFactory.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, 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
@@ -67,9 +67,9 @@
*
* The objects that this factory produces will be based
* on DOM and abide by the DOM interoperability requirements as defined in the
- *
+ *
* DOM Mechanism Requirements section of the API overview. See the
- *
+ *
* Service Providers section of the API overview for a list of standard
* mechanism types.
*
@@ -175,7 +175,7 @@
*
* @param mechanismType the type of the XML processing mechanism and
* representation. See the
+ * href="../../../../../technotes/guides/security/xmldsig/overview.html#Service%20Provider">
* Service Providers section of the API overview for a list of
* standard mechanism types.
* @return a new XMLSignatureFactory
@@ -212,7 +212,7 @@
*
* @param mechanismType the type of the XML processing mechanism and
* representation. See the
+ * href="../../../../../technotes/guides/security/xmldsig/overview.html#Service%20Provider">
* Service Providers section of the API overview for a list of
* standard mechanism types.
* @param provider the Provider
object
@@ -256,7 +256,7 @@
*
* @param mechanismType the type of the XML processing mechanism and
* representation. See the
+ * href="../../../../../technotes/guides/security/xmldsig/overview.html#Service%20Provider">
* Service Providers section of the API overview for a list of
* standard mechanism types.
* @param provider the string name of the provider
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/javax/xml/crypto/dsig/XMLValidateContext.java
--- a/jdk/src/share/classes/javax/xml/crypto/dsig/XMLValidateContext.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/javax/xml/crypto/dsig/XMLValidateContext.java Wed Jul 05 19:26:45 2017 +0200
@@ -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
@@ -40,7 +40,7 @@
* (for example, you should not use the same XMLValidateContext
* instance to validate two different {@link XMLSignature} objects).
*
- * Supported Properties
+ * Supported Properties
*
The following properties can be set by an application using the
* {@link #setProperty setProperty} method.
*
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/javax/xml/crypto/dsig/keyinfo/KeyInfoFactory.java
--- a/jdk/src/share/classes/javax/xml/crypto/dsig/keyinfo/KeyInfoFactory.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/javax/xml/crypto/dsig/keyinfo/KeyInfoFactory.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2011, 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
@@ -62,9 +62,9 @@
*
* The objects that this factory produces will be based
* on DOM and abide by the DOM interoperability requirements as defined in the
- *
+ *
* DOM Mechanism Requirements section of the API overview. See the
- *
+ *
* Service Providers section of the API overview for a list of standard
* mechanism types.
*
@@ -131,7 +131,7 @@
*
* @param mechanismType the type of the XML processing mechanism and
* representation. See the
+ * href="../../../../../../technotes/guides/security/xmldsig/overview.html#Service%20Provider">
* Service Providers section of the API overview for a list of
* standard mechanism types.
* @return a new KeyInfoFactory
@@ -167,7 +167,7 @@
*
* @param mechanismType the type of the XML processing mechanism and
* representation. See the
+ * href="../../../../../../technotes/guides/security/xmldsig/overview.html#Service%20Provider">
* Service Providers section of the API overview for a list of
* standard mechanism types.
* @param provider the Provider
object
@@ -211,7 +211,7 @@
*
* @param mechanismType the type of the XML processing mechanism and
* representation. See the
+ * href="../../../../../../technotes/guides/security/xmldsig/overview.html#Service%20Provider">
* Service Providers section of the API overview for a list of
* standard mechanism types.
* @param provider the string name of the provider
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/XMLDSigRI.java
--- a/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/XMLDSigRI.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/org/jcp/xml/dsig/internal/dom/XMLDSigRI.java Wed Jul 05 19:26:45 2017 +0200
@@ -28,7 +28,7 @@
* ===========================================================================
*/
/*
- * Copyright (c) 2005, 2013 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2014 Oracle and/or its affiliates. All rights reserved.
*/
/*
* $Id: XMLDSigRI.java 1400021 2012-10-19 10:16:04Z coheigea $
@@ -61,7 +61,7 @@
public XMLDSigRI() {
/* We are the XMLDSig provider */
- super("XMLDSig", 1.8d, INFO);
+ super("XMLDSig", 1.9d, INFO);
final Map map = new HashMap();
map.put("XMLSignatureFactory.DOM",
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/applet/AppletSecurity.java
--- a/jdk/src/share/classes/sun/applet/AppletSecurity.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/applet/AppletSecurity.java Wed Jul 05 19:26:45 2017 +0200
@@ -42,6 +42,7 @@
import java.lang.reflect.*;
import sun.awt.AWTSecurityManager;
import sun.awt.AppContext;
+import sun.awt.AWTPermissions;
import sun.security.provider.*;
import sun.security.util.SecurityConstants;
@@ -314,7 +315,7 @@
// If we're about to allow access to the main EventQueue,
// and anything untrusted is on the class context stack,
// disallow access.
- super.checkPermission(SecurityConstants.AWT.CHECK_AWT_EVENTQUEUE_PERMISSION);
+ super.checkPermission(AWTPermissions.CHECK_AWT_EVENTQUEUE_PERMISSION);
}
} // checkAwtEventQueueAccess()
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/awt/AWTPermissionFactory.java
--- a/jdk/src/share/classes/sun/awt/AWTPermissionFactory.java Fri Dec 13 09:35:35 2013 -0800
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package sun.awt;
-
-import java.awt.AWTPermission;
-import sun.security.util.PermissionFactory;
-
-/**
- * A factory object for AWTPermission objects.
- */
-
-public class AWTPermissionFactory
- implements PermissionFactory
-{
- @Override
- public AWTPermission newPermission(String name) {
- return new AWTPermission(name);
- }
-}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/awt/AWTPermissions.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/jdk/src/share/classes/sun/awt/AWTPermissions.java Wed Jul 05 19:26:45 2017 +0200
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 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.
+ */
+package sun.awt;
+
+import java.awt.AWTPermission;
+
+/**
+ * Defines the {@code AWTPermission} objects used for permission checks.
+ */
+
+public final class AWTPermissions {
+ private AWTPermissions() { }
+
+ public static final AWTPermission TOPLEVEL_WINDOW_PERMISSION =
+ new AWTPermission("showWindowWithoutWarningBanner");
+
+ public static final AWTPermission ACCESS_CLIPBOARD_PERMISSION =
+ new AWTPermission("accessClipboard");
+
+ public static final AWTPermission CHECK_AWT_EVENTQUEUE_PERMISSION =
+ new AWTPermission("accessEventQueue");
+
+ public static final AWTPermission TOOLKIT_MODALITY_PERMISSION =
+ new AWTPermission("toolkitModality");
+
+ public static final AWTPermission READ_DISPLAY_PIXELS_PERMISSION =
+ new AWTPermission("readDisplayPixels");
+
+ public static final AWTPermission CREATE_ROBOT_PERMISSION =
+ new AWTPermission("createRobot");
+
+ public static final AWTPermission WATCH_MOUSE_PERMISSION =
+ new AWTPermission("watchMousePointer");
+
+ public static final AWTPermission SET_WINDOW_ALWAYS_ON_TOP_PERMISSION =
+ new AWTPermission("setWindowAlwaysOnTop");
+
+ public static final AWTPermission ALL_AWT_EVENTS_PERMISSION =
+ new AWTPermission("listenToAllAWTEvents");
+
+ public static final AWTPermission ACCESS_SYSTEM_TRAY_PERMISSION =
+ new AWTPermission("accessSystemTray");
+}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/awt/SunToolkit.java
--- a/jdk/src/share/classes/sun/awt/SunToolkit.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/awt/SunToolkit.java Wed Jul 05 19:26:45 2017 +0200
@@ -43,7 +43,6 @@
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
-import sun.security.util.SecurityConstants;
import sun.util.logging.PlatformLogger;
import sun.misc.SoftCache;
import sun.font.FontDesignMetrics;
@@ -1049,8 +1048,7 @@
try {
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
- sm.checkPermission(
- SecurityConstants.AWT.SET_WINDOW_ALWAYS_ON_TOP_PERMISSION);
+ sm.checkPermission(AWTPermissions.SET_WINDOW_ALWAYS_ON_TOP_PERMISSION);
}
} catch (SecurityException se) {
// There is no permission to show popups over the task bar
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java
--- a/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/awt/dnd/SunDropTargetContextPeer.java Wed Jul 05 19:26:45 2017 +0200
@@ -54,10 +54,10 @@
import java.io.InputStream;
import sun.awt.AppContext;
+import sun.awt.AWTPermissions;
import sun.awt.SunToolkit;
import sun.awt.datatransfer.DataTransferer;
import sun.awt.datatransfer.ToolkitThreadBlockedHandler;
-import sun.security.util.SecurityConstants;
/**
*
@@ -226,7 +226,7 @@
SecurityManager sm = System.getSecurityManager();
try {
if (!dropInProcess && sm != null) {
- sm.checkPermission(SecurityConstants.AWT.ACCESS_CLIPBOARD_PERMISSION);
+ sm.checkPermission(AWTPermissions.ACCESS_CLIPBOARD_PERMISSION);
}
} catch (Exception e) {
Thread currentThread = Thread.currentThread();
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/misc/Cache.java
--- a/jdk/src/share/classes/sun/misc/Cache.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/misc/Cache.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1995, 1996, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 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
@@ -73,9 +73,11 @@
* @see java.lang.Object#hashCode
* @see java.lang.Object#equals
* @see sun.misc.Ref
+ * @deprecated Consider {@link java.util.LinkedHashMap} for LRU caches.
*/
+@Deprecated
public
-class Cache extends Dictionary {
+ class Cache extends Dictionary {
/**
* The hash table data.
*/
@@ -163,7 +165,7 @@
* @see Cache#elements
* @see Enumeration
*/
- public synchronized Enumeration keys() {
+ public synchronized Enumeration keys() {
return new CacheEnumerator(table, true);
}
@@ -173,7 +175,7 @@
* @see Cache#keys
* @see Enumeration
*/
- public synchronized Enumeration elements() {
+ public synchronized Enumeration elements() {
return new CacheEnumerator(table, false);
}
@@ -305,7 +307,7 @@
* A Cache enumerator class. This class should remain opaque
* to the client. It will use the Enumeration interface.
*/
-class CacheEnumerator implements Enumeration {
+class CacheEnumerator implements Enumeration {
boolean keys;
int index;
CacheEntry table[];
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/misc/SoftCache.java
--- a/jdk/src/share/classes/sun/misc/SoftCache.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/misc/SoftCache.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 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
@@ -99,10 +99,12 @@
* @since 1.2
* @see java.util.HashMap
* @see java.lang.ref.SoftReference
+ * @deprecated No direct replacement; {@link java.util.WeakHashMap}
+ * addresses a related by different use-case.
*/
-
-public class SoftCache extends AbstractMap implements Map {
+@Deprecated
+public class SoftCache extends AbstractMap implements Map {
/* The basic idea of this implementation is to maintain an internal HashMap
that maps keys to soft references whose referents are the keys' values;
@@ -115,18 +117,18 @@
*/
- static private class ValueCell extends SoftReference {
+ static private class ValueCell extends SoftReference {
static private Object INVALID_KEY = new Object();
static private int dropped = 0;
private Object key;
- private ValueCell(Object key, Object value, ReferenceQueue queue) {
+ private ValueCell(Object key, Object value, ReferenceQueue queue) {
super(value, queue);
this.key = key;
}
private static ValueCell create(Object key, Object value,
- ReferenceQueue queue)
+ ReferenceQueue queue)
{
if (value == null) return null;
return new ValueCell(key, value, queue);
@@ -154,10 +156,10 @@
/* Hash table mapping keys to ValueCells */
- private Map hash;
+ private Map hash;
/* Reference queue for cleared ValueCells */
- private ReferenceQueue queue = new ReferenceQueue();
+ private ReferenceQueue queue = new ReferenceQueue<>();
/* Process any ValueCells that have been cleared and enqueued by the
@@ -189,7 +191,7 @@
* factor is less than zero
*/
public SoftCache(int initialCapacity, float loadFactor) {
- hash = new HashMap(initialCapacity, loadFactor);
+ hash = new HashMap<>(initialCapacity, loadFactor);
}
/**
@@ -202,7 +204,7 @@
* or equal to zero
*/
public SoftCache(int initialCapacity) {
- hash = new HashMap(initialCapacity);
+ hash = new HashMap<>(initialCapacity);
}
/**
@@ -210,7 +212,7 @@
* capacity and the default load factor.
*/
public SoftCache() {
- hash = new HashMap();
+ hash = new HashMap<>();
}
@@ -348,13 +350,13 @@
/* Internal class for entries.
Because it uses SoftCache.this.queue, this class cannot be static.
*/
- private class Entry implements Map.Entry {
- private Map.Entry ent;
+ private class Entry implements Map.Entry {
+ private Map.Entry ent;
private Object value; /* Strong reference to value, to prevent the GC
from flushing the value while this Entry
exists */
- Entry(Map.Entry ent, Object value) {
+ Entry(Map.Entry ent, Object value) {
this.ent = ent;
this.value = value;
}
@@ -371,9 +373,10 @@
return ent.setValue(ValueCell.create(ent.getKey(), value, queue));
}
+ @SuppressWarnings("unchecked")
public boolean equals(Object o) {
if (! (o instanceof Map.Entry)) return false;
- Map.Entry e = (Map.Entry)o;
+ Map.Entry e = (Map.Entry)o;
return (valEquals(ent.getKey(), e.getKey())
&& valEquals(value, e.getValue()));
}
@@ -388,18 +391,18 @@
/* Internal class for entry sets */
- private class EntrySet extends AbstractSet {
- Set hashEntries = hash.entrySet();
+ private class EntrySet extends AbstractSet> {
+ Set> hashEntries = hash.entrySet();
- public Iterator iterator() {
+ public Iterator> iterator() {
- return new Iterator() {
- Iterator hashIterator = hashEntries.iterator();
+ return new Iterator>() {
+ Iterator> hashIterator = hashEntries.iterator();
Entry next = null;
public boolean hasNext() {
while (hashIterator.hasNext()) {
- Map.Entry ent = (Map.Entry)hashIterator.next();
+ Map.Entry ent = hashIterator.next();
ValueCell vc = (ValueCell)ent.getValue();
Object v = null;
if ((vc != null) && ((v = vc.get()) == null)) {
@@ -412,7 +415,7 @@
return false;
}
- public Object next() {
+ public Map.Entry next() {
if ((next == null) && !hasNext())
throw new NoSuchElementException();
Entry e = next;
@@ -433,7 +436,7 @@
public int size() {
int j = 0;
- for (Iterator i = iterator(); i.hasNext(); i.next()) j++;
+ for (Iterator> i = iterator(); i.hasNext(); i.next()) j++;
return j;
}
@@ -446,12 +449,12 @@
}
- private Set entrySet = null;
+ private Set> entrySet = null;
/**
* Return a Set
view of the mappings in this cache.
*/
- public Set entrySet() {
+ public Set> entrySet() {
if (entrySet == null) entrySet = new EntrySet();
return entrySet;
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/rmi/rmic/Main.java
--- a/jdk/src/share/classes/sun/rmi/rmic/Main.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/rmi/rmic/Main.java Wed Jul 05 19:26:45 2017 +0200
@@ -162,6 +162,15 @@
return false;
}
+ if ((flags & F_WARNINGS) != 0) {
+ for (Generator g : generators) {
+ if (g instanceof RMIGenerator) {
+ output(getText("rmic.jrmp.stubs.deprecated", program));
+ break;
+ }
+ }
+ }
+
return doCompile();
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/rmi/rmic/resources/rmic.properties
--- a/jdk/src/share/classes/sun/rmi/rmic/resources/rmic.properties Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/rmi/rmic/resources/rmic.properties Wed Jul 05 19:26:45 2017 +0200
@@ -1,6 +1,6 @@
#
#
-# Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 1996, 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
@@ -76,10 +76,10 @@
\nwhere includes:\
\n -keep Do not delete intermediate generated source files\
\n -keepgenerated (same as "-keep")\
-\n -v1.1 Create stubs/skeletons for 1.1 stub protocol version\
+\n -v1.1 Create stubs/skeletons for 1.1 stub protocol version (deprecated)\
\n -vcompat Create stubs/skeletons compatible with both\
-\n 1.1 and 1.2 stub protocol versions\
-\n -v1.2 (default) Create stubs for 1.2 stub protocol version only\
+\n 1.1 and 1.2 stub protocol versions (deprecated)\
+\n -v1.2 (default) Create stubs for 1.2 stub protocol version only (deprecated)\
\n -iiop Create stubs for IIOP. When present, also includes:\
\n\
\n -always Create stubs even when they appear current\
@@ -154,6 +154,12 @@
An IIOP "tie" exists for class {0}:\
\n {1}\
\nIf you use PortableRemoteObject.exportObject, you should remove this file; otherwise, your server object will be exported to IIOP rather than to JRMP.
+rmic.jrmp.stubs.deprecated=\
+ Warning: generation and use of skeletons and static stubs for JRMP\
+ \nis deprecated. Skeletons are unnecessary, and static stubs have\
+ \nbeen superseded by dynamically generated stubs. Users are\
+ \nencouraged to migrate away from using {0} to generate skeletons and static\
+ \nstubs. See the documentation for java.rmi.server.UnicastRemoteObject.
#
# RMI-IIOP Messages
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/security/ec/SunEC.java
--- a/jdk/src/share/classes/sun/security/ec/SunEC.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/security/ec/SunEC.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 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
@@ -67,7 +67,7 @@
}
public SunEC() {
- super("SunEC", 1.8d, "Sun Elliptic Curve provider (EC, ECDSA, ECDH)");
+ super("SunEC", 1.9d, "Sun Elliptic Curve provider (EC, ECDSA, ECDH)");
// if there is no security manager installed, put directly into
// the provider. Otherwise, create a temporary map and use a
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/security/jca/ProviderConfig.java
--- a/jdk/src/share/classes/sun/security/jca/ProviderConfig.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/security/jca/ProviderConfig.java Wed Jul 05 19:26:45 2017 +0200
@@ -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
@@ -58,7 +58,7 @@
// parameters for the Provider(String) constructor,
// use by doLoadProvider()
- private final static Class[] CL_STRING = { String.class };
+ private final static Class>[] CL_STRING = { String.class };
// name of the provider class
private final String className;
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/security/jgss/GSSNameImpl.java
--- a/jdk/src/share/classes/sun/security/jgss/GSSNameImpl.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/security/jgss/GSSNameImpl.java Wed Jul 05 19:26:45 2017 +0200
@@ -257,6 +257,10 @@
((0xFF & bytes[pos++]) << 16) |
((0xFF & bytes[pos++]) << 8) |
(0xFF & bytes[pos++]));
+ if (pos > bytes.length - mechPortionLen) {
+ throw new GSSExceptionImpl(GSSException.BAD_NAME,
+ "Exported name mech name is corrupted!");
+ }
byte[] mechPortion = new byte[mechPortionLen];
System.arraycopy(bytes, pos, mechPortion, 0, mechPortionLen);
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/security/jgss/SunProvider.java
--- a/jdk/src/share/classes/sun/security/jgss/SunProvider.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/security/jgss/SunProvider.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 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
@@ -62,7 +62,7 @@
public SunProvider() {
/* We are the Sun JGSS provider */
- super("SunJGSS", 1.8d, INFO);
+ super("SunJGSS", 1.9d, INFO);
AccessController.doPrivileged(
new java.security.PrivilegedAction() {
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java
--- a/jdk/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/security/jgss/wrapper/SunNativeProvider.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -120,7 +120,7 @@
public SunNativeProvider() {
/* We are the Sun NativeGSS provider */
- super(NAME, 1.8d, INFO);
+ super(NAME, 1.9d, INFO);
if (MECH_MAP != null) {
AccessController.doPrivileged(new PutAllAction(this, MECH_MAP));
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/security/krb5/internal/ccache/CCacheInputStream.java
--- a/jdk/src/share/classes/sun/security/krb5/internal/ccache/CCacheInputStream.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/security/krb5/internal/ccache/CCacheInputStream.java Wed Jul 05 19:26:45 2017 +0200
@@ -32,9 +32,11 @@
import java.io.IOException;
import java.io.InputStream;
-import java.util.Hashtable;
-import java.util.Vector;
+import java.util.ArrayList;
+import java.util.List;
import java.util.StringTokenizer;
+
+import sun.misc.IOUtils;
import sun.security.krb5.*;
import sun.security.krb5.internal.*;
import sun.security.krb5.internal.util.KrbDataInputStream;
@@ -74,7 +76,6 @@
// this needs to be public for Kinit.
public Tag readTag() throws IOException {
char[] buf = new char[1024];
- byte[] bytes;
int len;
int tag = -1;
int taglen;
@@ -85,7 +86,6 @@
if (len < 0) {
throw new IOException("stop.");
}
- bytes = new byte[len + 2];
if (len > buf.length) {
throw new IOException("Invalid tag length.");
}
@@ -101,11 +101,7 @@
}
len = len - (4 + taglen);
}
- Tag result;
- if (tag == -1) {
- }
- result = new Tag(len, tag, time_offset, usec_offset);
- return result;
+ return new Tag(len, tag, time_offset, usec_offset);
}
/*
* In file-based credential cache, the realm name is stored as part of
@@ -123,7 +119,7 @@
type = read(4);
}
length = read(4);
- String[] result = new String[length + 1];
+ List result = new ArrayList();
/*
* DCE includes the principal's realm in the count; the new format
* does not.
@@ -132,21 +128,26 @@
length--;
for (int i = 0; i <= length; i++) {
namelength = read(4);
- if (namelength > MAXNAMELENGTH) {
- throw new IOException("Invalid name length in principal name.");
+ byte[] bytes = IOUtils.readFully(this, namelength, true);
+ result.add(new String(bytes));
+ }
+ if (result.isEmpty()) {
+ throw new IOException("No realm or principal");
+ }
+ if (isRealm(result.get(0))) {
+ realm = result.remove(0);
+ if (result.isEmpty()) {
+ throw new IOException("No principal name components");
}
- byte[] bytes = new byte[namelength];
- read(bytes, 0, namelength);
- result[i] = new String(bytes);
- }
- if (isRealm(result[0])) {
- realm = result[0];
- pname = new String[length];
- System.arraycopy(result, 1, pname, 0, length);
- return new PrincipalName(type, pname, new Realm(realm));
+ return new PrincipalName(
+ type,
+ result.toArray(new String[result.size()]),
+ new Realm(realm));
}
try {
- return new PrincipalName(result, type);
+ return new PrincipalName(
+ result.toArray(new String[result.size()]),
+ type);
} catch (RealmException re) {
return null;
}
@@ -184,10 +185,7 @@
if (version == KRB5_FCC_FVNO_3)
read(2); /* keytype recorded twice in fvno 3 */
keyLen = read(4);
- byte[] bytes = new byte[keyLen];
- for (int i = 0; i < keyLen; i++) {
- bytes[i] = (byte)read();
- }
+ byte[] bytes = IOUtils.readFully(this, keyLen, true);
return new EncryptionKey(bytes, keyType, new Integer(version));
}
@@ -211,7 +209,7 @@
int numAddrs, addrType, addrLength;
numAddrs = read(4);
if (numAddrs > 0) {
- HostAddress[] addrs = new HostAddress[numAddrs];
+ List addrs = new ArrayList<>();
for (int i = 0; i < numAddrs; i++) {
addrType = read(2);
addrLength = read(4);
@@ -224,9 +222,9 @@
byte[] result = new byte[addrLength];
for (int j = 0; j < addrLength; j++)
result[j] = (byte)read(1);
- addrs[i] = new HostAddress(addrType, result);
+ addrs.add(new HostAddress(addrType, result));
}
- return addrs;
+ return addrs.toArray(new HostAddress[addrs.size()]);
}
return null;
}
@@ -235,18 +233,15 @@
int num, adtype, adlength;
num = read(4);
if (num > 0) {
- AuthorizationDataEntry[] auData = new AuthorizationDataEntry[num];
+ List auData = new ArrayList<>();
byte[] data = null;
for (int i = 0; i < num; i++) {
adtype = read(2);
adlength = read(4);
- data = new byte[adlength];
- for (int j = 0; j < adlength; j++) {
- data[j] = (byte)read();
- }
- auData[i] = new AuthorizationDataEntry(adtype, data);
+ data = IOUtils.readFully(this, adlength, true);
+ auData.add(new AuthorizationDataEntry(adtype, data));
}
- return auData;
+ return auData.toArray(new AuthorizationDataEntry[auData.size()]);
}
else return null;
}
@@ -257,9 +252,7 @@
if (length == 0) {
return null;
} else {
- byte[] bytes = new byte[length];
- read(bytes, 0, length);
- return bytes;
+ return IOUtils.readFully(this, length, true);
}
}
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/security/krb5/internal/ccache/FileCCacheConstants.java
--- a/jdk/src/share/classes/sun/security/krb5/internal/ccache/FileCCacheConstants.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/security/krb5/internal/ccache/FileCCacheConstants.java Wed Jul 05 19:26:45 2017 +0200
@@ -49,7 +49,6 @@
public final int KRB5_FCC_FVNO_4 = 0x504;
public final int FCC_TAG_DELTATIME = 1;
public final int KRB5_NT_UNKNOWN = 0;
- public final int MAXNAMELENGTH = 1024;
public final int TKT_FLG_FORWARDABLE = 0x40000000;
public final int TKT_FLG_FORWARDED = 0x20000000;
public final int TKT_FLG_PROXIABLE = 0x10000000;
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java
--- a/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/security/pkcs11/SunPKCS11.java Wed Jul 05 19:26:45 2017 +0200
@@ -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
@@ -94,7 +94,7 @@
}
public SunPKCS11() {
- super("SunPKCS11-Dummy", 1.8d, "SunPKCS11-Dummy");
+ super("SunPKCS11-Dummy", 1.9d, "SunPKCS11-Dummy");
throw new ProviderException
("SunPKCS11 requires configuration file argument");
}
@@ -127,7 +127,7 @@
public SunPKCS11(String configName, InputStream configStream) {
super("SunPKCS11-" +
Config.getConfig(configName, configStream).getName(),
- 1.8d, Config.getConfig(configName, configStream).getDescription());
+ 1.9d, Config.getConfig(configName, configStream).getDescription());
this.configName = configName;
this.config = Config.removeConfig(configName);
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/security/provider/MD4.java
--- a/jdk/src/share/classes/sun/security/provider/MD4.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/security/provider/MD4.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 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
@@ -65,7 +65,7 @@
private final static Provider md4Provider;
static {
- md4Provider = new Provider("MD4Provider", 1.8d, "MD4 MessageDigest") {
+ md4Provider = new Provider("MD4Provider", 1.9d, "MD4 MessageDigest") {
private static final long serialVersionUID = -8850464997518327965L;
};
AccessController.doPrivileged(new PrivilegedAction() {
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/security/provider/PolicyFile.java
--- a/jdk/src/share/classes/sun/security/provider/PolicyFile.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/security/provider/PolicyFile.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 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
@@ -285,9 +285,9 @@
// for use with the reflection API
- private static final Class[] PARAMS0 = { };
- private static final Class[] PARAMS1 = { String.class };
- private static final Class[] PARAMS2 = { String.class, String.class };
+ private static final Class>[] PARAMS0 = { };
+ private static final Class>[] PARAMS1 = { String.class };
+ private static final Class>[] PARAMS2 = { String.class, String.class };
/**
* Initializes the Policy object and reads the default policy
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/security/provider/Sun.java
--- a/jdk/src/share/classes/sun/security/provider/Sun.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/security/provider/Sun.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -47,7 +47,7 @@
public Sun() {
/* We are the SUN provider */
- super("SUN", 1.8d, INFO);
+ super("SUN", 1.9d, INFO);
// if there is no security manager installed, put directly into
// the provider. Otherwise, create a temporary map and use a
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/security/provider/VerificationProvider.java
--- a/jdk/src/share/classes/sun/security/provider/VerificationProvider.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/security/provider/VerificationProvider.java Wed Jul 05 19:26:45 2017 +0200
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1996, 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
@@ -61,7 +61,7 @@
}
public VerificationProvider() {
- super("SunJarVerification", 1.8d, "Jar Verification Provider");
+ super("SunJarVerification", 1.9d, "Jar Verification Provider");
// register all algorithms normally registered by the Sun and SunRsaSign
// providers, but only if they are missing
if (ACTIVE == false) {
diff -r e8046d3ee0ee -r 7bf6ee33a412 jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java
--- a/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java Fri Dec 13 09:35:35 2013 -0800
+++ b/jdk/src/share/classes/sun/security/provider/certpath/DistributionPointFetcher.java Wed Jul 05 19:26:45 2017 +0200
@@ -76,6 +76,25 @@
Date validity)
throws CertStoreException
{
+ return getCRLs(selector, signFlag, prevKey, null, provider, certStores,
+ reasonsMask, trustAnchors, validity);
+ }
+
+ /**
+ * Return the X509CRLs matching this selector. The selector must be
+ * an X509CRLSelector with certificateChecking set.
+ */
+ public static Collection getCRLs(X509CRLSelector selector,
+ boolean signFlag,
+ PublicKey prevKey,
+ X509Certificate prevCert,
+ String provider,
+ List certStores,
+ boolean[] reasonsMask,
+ Set trustAnchors,
+ Date validity)
+ throws CertStoreException
+ {
X509Certificate cert = selector.getCertificateChecking();
if (cert == null) {
return Collections.emptySet();
@@ -101,7 +120,7 @@
t.hasNext() && !Arrays.equals(reasonsMask, ALL_REASONS); ) {
DistributionPoint point = t.next();
Collection crls = getCRLs(selector, certImpl,
- point, reasonsMask, signFlag, prevKey, provider,
+ point, reasonsMask, signFlag, prevKey, prevCert, provider,
certStores, trustAnchors, validity);
results.addAll(crls);
}
@@ -125,9 +144,10 @@
*/
private static Collection