Skip to content
Permalink
Browse files
8244232: [lworld] Improve javadoc comments for various methods dealin…
…g with projection types
  • Loading branch information
Srikanth Adayapalam committed Aug 18, 2020
1 parent f72ec3c commit 212077b167af8987ac2ca2bc74a6d53ab7d90412
Showing with 21 additions and 3 deletions.
  1. +5 −2 src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java
  2. +16 −1 src/jdk.compiler/share/classes/com/sun/tools/javac/code/Type.java
@@ -434,7 +434,7 @@ public Symbol valueProjection() {
}

/**
* Return the reference projection IFF 'this' happens to be value projection, null
* Return the reference projection IFF 'this' happens to be inline class, null
* otherwise.
*/
public Symbol referenceProjection() {
@@ -1671,7 +1671,10 @@ public ClassSymbol valueProjection() {

@Override
public ClassSymbol referenceProjection() {
if (!isValue() || projection != null)
if (!isValue())
return null;

if (projection != null)
return projection;

ClassType ct = (ClassType) this.type;
@@ -239,14 +239,26 @@ public boolean isValue() {
return false;
}

/**
* @return true IFF the receiver is a reference projection of an inline type and false
* for primitives or plain references
*/
public boolean isReferenceProjection() {
return false;
}

/**
* @return the value projection type IFF the receiver is a reference projection of an inline type
* and null otherwise
*/
public Type valueProjection() {
return null;
}

/**
* @return the reference projection type IFF the receiver is an inline type
* and null otherwise
*/
public Type referenceProjection() {
return null;
}
@@ -1194,7 +1206,10 @@ public boolean isReferenceProjection() {

@Override
public Type valueProjection() {
if (!isReferenceProjection() || projection != null)
if (!isReferenceProjection())
return null;

if (projection != null)
return projection;

// Make a best case effort to cache the other projection.

0 comments on commit 212077b

Please sign in to comment.