groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (GROOVY-8228) JSR308 grammar changes
Date Tue, 13 Jun 2017 13:14:00 GMT

     [ https://issues.apache.org/jira/browse/GROOVY-8228?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Paul King updated GROOVY-8228:
------------------------------
    Description: 
Potential cases to consider:
{code}
// method receiver parameters (works with existing grammar)
void tempCalc(@ReadOnly Weather this){ ... }

// constructor usage
Forecast currentForecast = new @Interned Forecast()

// type casts
Object myObject = (@NotNull Object) obj

// exceptions
catch (@Critical Exception e) { ... }

// inheritance and generics
class MyForecast<T> implements @NonEmpty List<@ReadOnly T>

// on arrays
// Annotating the int type:
@ReadOnly int [] nums; 
// Annotating the array type int[]:
int @ReadOnly [] nums
// Annotating the array type int[][]:
int @ReadOnly [][] nums
// Annotating the type int[], which is a component type of int[][]:
int [] @ReadOnly [] nums
{code}

Adapted mostly from: http://www.oracle.com/technetwork/articles/java/ma14-architect-annotations-2177655.html

  was:
Potential cases to consider:
{code}
// constructor usage
Forecast currentForecast = new @Interned Forecast()

// type casts
Object myObject = (@NotNull Object) obj

// exceptions
catch (@Critical Exception e) { ... }

// inheritance and generics
class MyForecast<T> implements @NonEmpty List<@ReadOnly T>

// on arrays
// Annotating the int type:
@ReadOnly int [] nums; 
// Annotating the array type int[]:
int @ReadOnly [] nums
// Annotating the array type int[][]:
int @ReadOnly [][] nums
// Annotating the type int[], which is a component type of int[][]:
int [] @ReadOnly [] nums
{code}

Adapted mostly from: http://www.oracle.com/technetwork/articles/java/ma14-architect-annotations-2177655.html


> JSR308 grammar changes
> ----------------------
>
>                 Key: GROOVY-8228
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8228
>             Project: Groovy
>          Issue Type: Sub-task
>            Reporter: Paul King
>            Assignee: Daniel Sun
>
> Potential cases to consider:
> {code}
> // method receiver parameters (works with existing grammar)
> void tempCalc(@ReadOnly Weather this){ ... }
> // constructor usage
> Forecast currentForecast = new @Interned Forecast()
> // type casts
> Object myObject = (@NotNull Object) obj
> // exceptions
> catch (@Critical Exception e) { ... }
> // inheritance and generics
> class MyForecast<T> implements @NonEmpty List<@ReadOnly T>
> // on arrays
> // Annotating the int type:
> @ReadOnly int [] nums; 
> // Annotating the array type int[]:
> int @ReadOnly [] nums
> // Annotating the array type int[][]:
> int @ReadOnly [][] nums
> // Annotating the type int[], which is a component type of int[][]:
> int [] @ReadOnly [] nums
> {code}
> Adapted mostly from: http://www.oracle.com/technetwork/articles/java/ma14-architect-annotations-2177655.html



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message