truffle-api-changes after PR #86

Jaroslav Tulach jaroslav.tulach at oracle.com
Wed Mar 2 03:18:45 UTC 2016


Hi.
I've just merged pull request
https://github.com/graalvm/truffle/pull/86
and as can be seen in the Travis output
https://travis-ci.org/graalvm/truffle/jobs/113014547
there are some API changes. 

Here is explanation of what they mean:

> Checking all signature changes against
> /home/travis/build/graalvm/truffle/truffle/com.oracle.truffle.api/snapshot.
> sigtest
> 
> Added Annotations
> 
> -----------------
> 
> com.oracle.truffle.api.CompilerDirectives.init:             anno 0
> java.lang.Deprecated()
> 
> com.oracle.truffle.api.ExactMath.init:  anno 0 java.lang.Deprecated()
> 
> com.oracle.truffle.api.Truffle.init:    anno 0 java.lang.Deprecated()
> 
> com.oracle.truffle.api.frame.FrameUtil.init:                anno 0
> java.lang.Deprecated()
> 
> com.oracle.truffle.api.nodes.NodeUtil.init:                 anno 0
> java.lang.Deprecated()
> 
> com.oracle.truffle.api.utilities.JSONHelper$JSONStringBuilder.init:         
>    anno 0 java.lang.Deprecated()
> 
> com.oracle.truffle.api.utilities.JSONHelper.init:           anno 0
> java.lang.Deprecated()
> 
> com.oracle.truffle.api.utilities.ValueProfile.init:         anno 0
> java.lang.Deprecated()

In Java, if your source doesn't specify a constructor, a default one is 
generated. That is OK for regular code, but in case of API it is usually not 
what a designer wants. In most cases (like those eight classes listed above), 
the designer did want default constructor at all - in case of utility classes 
(those with static only methods) it makes little sense.

I kept the constructors, but I deprecated them. We'll remove them when we do 
cleanup of deprecated methods. 

> Missing Constructors
> 
> --------------------
> 
> com.oracle.truffle.api.instrumentation.SourceSectionFilter$Builder:         
>    constructor public
> com.oracle.truffle.api.instrumentation.SourceSectionFilter$Builder.init(com
> .oracle.truffle.api.instrumentation.SourceSectionFilter)

This is the same case as above, just with one difference: The new 
instrumentation API hasn't been released yet, so I made the constructor 
private - hence it is reported as missing compared to yesterday's state.

> There are changes!

Yes, there were changes, but they made the Truffle API cleaner! Or am I wrong?
-jt



More information about the graal-dev mailing list