This commit is contained in:
Lana Steuck 2015-12-17 20:25:21 -08:00
commit 2197283b8b
252 changed files with 764 additions and 431 deletions

View File

@ -20,6 +20,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package propertiesparser.parser;
import java.util.ArrayList;

View File

@ -20,6 +20,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package propertiesparser.parser;
import java.io.*;

View File

@ -20,6 +20,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package propertiesparser.parser;
import propertiesparser.parser.MessageType.CompoundType;

View File

@ -20,6 +20,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package propertiesparser.parser;
import java.util.regex.Pattern;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package javax.tools;
import java.io.Writer;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.source.doctree;
import javax.tools.Diagnostic;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.source.doctree;
import java.util.List;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.source.doctree;
import java.util.List;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.source.util;
import com.sun.source.doctree.DocTree;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.source.util;
import java.util.ServiceLoader;

View File

@ -23,7 +23,6 @@
* questions.
*/
package com.sun.tools.javac.api;
import java.io.File;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.api;
import java.util.Locale;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.code;
import java.lang.annotation.Annotation;

View File

@ -1,7 +1,6 @@
/*
* Copyright (c) 2014, Oracle and/or its affiliates. All rights
* reserved. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE
* HEADER.
* Copyright (c) 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
* under the terms of the GNU General Public License version 2 only, as

View File

@ -597,36 +597,42 @@ public class Types {
}
public Type removeWildcards(Type site) {
Type capturedSite = capture(site);
if (capturedSite != site) {
Type formalInterface = site.tsym.type;
ListBuffer<Type> typeargs = new ListBuffer<>();
List<Type> actualTypeargs = site.getTypeArguments();
List<Type> capturedTypeargs = capturedSite.getTypeArguments();
//simply replace the wildcards with its bound
for (Type t : formalInterface.getTypeArguments()) {
if (actualTypeargs.head.hasTag(WILDCARD)) {
WildcardType wt = (WildcardType)actualTypeargs.head;
Type bound;
switch (wt.kind) {
case EXTENDS:
case UNBOUND:
CapturedType capVar = (CapturedType)capturedTypeargs.head;
//use declared bound if it doesn't depend on formal type-args
bound = capVar.bound.containsAny(capturedSite.getTypeArguments()) ?
wt.type : capVar.bound;
break;
default:
bound = wt.type;
if (site.getTypeArguments().stream().anyMatch(t -> t.hasTag(WILDCARD))) {
//compute non-wildcard parameterization - JLS 9.9
List<Type> actuals = site.getTypeArguments();
List<Type> formals = site.tsym.type.getTypeArguments();
ListBuffer<Type> targs = new ListBuffer<>();
for (Type formal : formals) {
Type actual = actuals.head;
Type bound = formal.getUpperBound();
if (actuals.head.hasTag(WILDCARD)) {
WildcardType wt = (WildcardType)actual;
//check that bound does not contain other formals
if (bound.containsAny(formals)) {
targs.add(wt.type);
} else {
//compute new type-argument based on declared bound and wildcard bound
switch (wt.kind) {
case UNBOUND:
targs.add(bound);
break;
case EXTENDS:
targs.add(glb(bound, wt.type));
break;
case SUPER:
targs.add(wt.type);
break;
default:
Assert.error("Cannot get here!");
}
}
typeargs.append(bound);
} else {
typeargs.append(actualTypeargs.head);
//not a wildcard - the new type argument remains unchanged
targs.add(actual);
}
actualTypeargs = actualTypeargs.tail;
capturedTypeargs = capturedTypeargs.tail;
actuals = actuals.tail;
}
return subst(formalInterface, formalInterface.getTypeArguments(), typeargs.toList());
return subst(site.tsym.type, formals, targs.toList());
} else {
return site;
}
@ -1436,12 +1442,13 @@ public class Types {
public boolean isCastable(Type t, Type s, Warner warn) {
if (t == s)
return true;
if (t.isPrimitive() != s.isPrimitive())
if (t.isPrimitive() != s.isPrimitive()) {
t = skipTypeVars(t, false);
return (isConvertible(t, s, warn)
|| (allowObjectToPrimitiveCast &&
s.isPrimitive() &&
isSubtype(boxedClass(s).type, t)));
}
if (warn != warnStack.head) {
try {
warnStack = warnStack.prepend(warn);

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.comp;
import com.sun.tools.javac.tree.*;

View File

@ -2707,11 +2707,11 @@ public class Lower extends TreeTranslator {
if (fvs.nonEmpty()) {
List<Type> addedargtypes = List.nil();
for (List<VarSymbol> l = fvs; l.nonEmpty(); l = l.tail) {
final Name pName = proxyName(l.head.name);
m.capturedLocals =
m.capturedLocals.prepend((VarSymbol)
(proxies.findFirst(pName)));
if (TreeInfo.isInitialConstructor(tree)) {
final Name pName = proxyName(l.head.name);
m.capturedLocals =
m.capturedLocals.append((VarSymbol)
(proxies.findFirst(pName)));
added = added.prepend(
initField(tree.body.pos, pName));
}

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.file;
import java.io.IOException;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.file;
import java.io.File;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.jvm;
import com.sun.tools.javac.util.Context;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.main;
import java.io.File;

View File

@ -23,7 +23,6 @@
* questions.
*/
package com.sun.tools.javac.parser;
import com.sun.tools.javac.tree.JCTree.JCCompilationUnit;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.platform;
import java.io.IOException;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.platform;
import java.io.Closeable;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.platform;
/** A collection of platform descriptions that can be selected using {@code -release name}

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.platform;
import com.sun.tools.javac.main.Arguments;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.sym;
import java.io.BufferedInputStream;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.tree;
import com.sun.source.doctree.ErroneousTree;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.util;
import java.nio.file.Path;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.util;
import java.util.Set;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.util;
import java.util.Iterator;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.util;
import java.util.Collection;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javac.util;
import java.nio.file.Path;

View File

@ -23,7 +23,6 @@
* questions.
*/
package com.sun.tools.javah;
import java.io.OutputStream;

View File

@ -23,7 +23,6 @@
* questions.
*/
package com.sun.tools.javah;
import javax.lang.model.element.ExecutableElement;

View File

@ -23,7 +23,6 @@
* questions.
*/
package com.sun.tools.javah;
import java.util.*;

View File

@ -23,7 +23,6 @@
* questions.
*/
package com.sun.tools.javah;
import java.io.PrintWriter;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2012-2014, 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

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.client;
import java.io.IOException;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.comp;
import javax.tools.FileObject;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.comp;
import javax.tools.ForwardingJavaFileObject;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.comp;
import java.nio.file.Path;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.comp;
import java.io.Writer;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.comp;
import java.io.IOException;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.comp;
import java.io.*;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.pubapi;
import java.io.Serializable;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.pubapi;
import java.io.Serializable;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.pubapi;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.pubapi;
import java.io.Serializable;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.pubapi;
import java.io.Serializable;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.pubapi;
import java.io.Serializable;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.pubapi;
import java.io.Serializable;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.pubapi;
import java.io.Serializable;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.pubapi;
import java.io.Serializable;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.server;
import java.io.Writer;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.server;
import java.io.IOException;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.server;
import static com.sun.tools.sjavac.server.SjavacServer.LINE_TYPE_RC;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.server;
import java.io.Writer;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.server;
import java.io.FileNotFoundException;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.sjavac.server;
/**

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.doclets.formats.html;
import java.io.*;

View File

@ -23,7 +23,6 @@
* questions.
*/
package com.sun.tools.doclets.formats.html;
import com.sun.javadoc.*;

View File

@ -23,7 +23,6 @@
* questions.
*/
package com.sun.tools.doclets.internal.toolkit;
import java.io.*;

View File

@ -23,7 +23,6 @@
* questions.
*/
package com.sun.tools.doclets.internal.toolkit;
import java.io.*;

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2015 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.doclets.internal.toolkit.builders;
import java.io.*;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.doclets.internal.toolkit.taglets;
import java.util.Map;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.doclets.internal.toolkit.taglets;
import java.util.Map;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.doclets.internal.toolkit.taglets;
import java.util.Map;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.doclets.internal.toolkit.util;
import java.text.MessageFormat;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.doclets.internal.toolkit.util;
import com.sun.javadoc.*;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javadoc.api;
import com.sun.tools.javac.util.ClientCodeException;

View File

@ -1,4 +1,3 @@
/*
* Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@ -24,6 +23,7 @@
* questions.
*/
package com.sun.tools.classfile;
import java.io.ByteArrayOutputStream;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.classfile;
import java.io.IOException;

View File

@ -23,7 +23,6 @@
* questions.
*/
package com.sun.tools.classfile;
/*

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.classfile;
import java.util.Deque;

View File

@ -23,7 +23,6 @@
* questions.
*/
package com.sun.tools.classfile;
import java.io.IOException;

View File

@ -23,7 +23,6 @@
* questions.
*/
package com.sun.tools.classfile;
/*

View File

@ -1,4 +1,3 @@
/*
* Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@ -24,6 +23,7 @@
* questions.
*/
package com.sun.tools.classfile;
import java.io.IOException;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.classfile;
import java.io.IOException;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.javap;
import com.sun.tools.classfile.Attribute;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.jdeps;
import java.io.PrintStream;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.jdeps;
import com.sun.tools.classfile.ClassFile;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.jdeps;
import com.sun.tools.classfile.ClassFile;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.jdeps;
import com.sun.tools.classfile.AccessFlags;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.jdeps;
import java.util.Collections;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.jdeps;
import java.io.IOException;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.jdeps;
import com.sun.tools.classfile.ClassFile;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.sun.tools.jdeps;
import java.io.IOException;

View File

@ -23,7 +23,6 @@
* questions.
*/
package jdk.internal.jshell.remote;
import java.util.regex.Pattern;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.internal.jshell.tool;
import java.util.ArrayList;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.internal.jshell.tool;
import java.io.IOException;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.jshell;
import java.util.Collection;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.jshell;
import jdk.jshell.Key.ErroneousKey;

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.jshell;
import java.util.ArrayList;

View File

@ -33,6 +33,7 @@ import java.net.ServerSocket;
import java.net.Socket;
import com.sun.jdi.*;
import java.io.EOFException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import jdk.jshell.ClassTracker.ClassInfo;
@ -247,17 +248,18 @@ class ExecutionControl {
//MessageOutput.textResources = ResourceBundle.getBundle("impl.TTYResources",
// Locale.getDefault());
String connect = "com.sun.jdi.CommandLineLaunch:";
String cmdLine = "jdk.internal.jshell.remote.RemoteAgent";
String connectorName = "com.sun.jdi.CommandLineLaunch";
String classPath = System.getProperty("java.class.path");
String bootclassPath = System.getProperty("sun.boot.class.path");
String javaArgs = "-classpath " + classPath + " -Xbootclasspath:" + bootclassPath;
String javaArgs = "-classpath \"" + classPath + "\" -Xbootclasspath:\"" + bootclassPath + "\"";
Map<String, String> argumentName2Value = new HashMap<>();
argumentName2Value.put("main", "jdk.internal.jshell.remote.RemoteAgent " + port);
argumentName2Value.put("options", javaArgs);
String connectSpec = connect + "main=" + cmdLine + " " + port + ",options=" + javaArgs + ",";
boolean launchImmediately = true;
int traceFlags = 0;// VirtualMachine.TRACE_SENDS | VirtualMachine.TRACE_EVENTS;
env.init(connectSpec, launchImmediately, traceFlags);
env.init(connectorName, argumentName2Value, launchImmediately, traceFlags);
if (env.connection().isOpen() && env.vm().canBeModified()) {
/*

View File

@ -22,6 +22,7 @@
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.jshell;
import jdk.jshell.Key.ExpressionKey;

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