Skip to content

Commit

Permalink
[GR-3148] Source.equalAttributes() enhanced, LineLocation class and a…
Browse files Browse the repository at this point in the history
…ll other deprecated methods removed from Source API.
  • Loading branch information
entlicher committed Dec 5, 2017
1 parent c93bfd1 commit 31d30a5
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 189 deletions.
4 changes: 4 additions & 0 deletions truffle/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

This changelog summarizes major changes between Truffle versions relevant to languages implementors building upon the Truffle framework. The main focus is on APIs exported by Truffle.

## Version 0.31

* Removed deprecated `com.oracle.truffle.api.source.LineLocation` class.

## Version 0.30

* Truffle languages are being [finalized](http://graalvm.github.io/graal/truffle/javadoc/com/oracle/truffle/api/TruffleLanguage##finalizeContext-C-) before disposal. This allows languages to run code with all languages still in a valid state. It is no longer allowed to access other languages during language disposal.
Expand Down
23 changes: 0 additions & 23 deletions truffle/src/com.oracle.truffle.api.source/snapshot.sigtest
Original file line number Diff line number Diff line change
@@ -1,19 +1,6 @@
#Signature file v4.1
#Version

CLSS public final com.oracle.truffle.api.source.LineLocation
anno 0 java.lang.Deprecated()
intf java.lang.Comparable<com.oracle.truffle.api.source.LineLocation>
meth public boolean equals(java.lang.Object)
meth public com.oracle.truffle.api.source.Source getSource()
meth public int compareTo(com.oracle.truffle.api.source.LineLocation)
meth public int getLineNumber()
meth public int hashCode()
meth public java.lang.String getShortDescription()
meth public java.lang.String toString()
supr java.lang.Object
hfds line,source

CLSS public final com.oracle.truffle.api.source.MissingMIMETypeException
supr java.lang.Exception
hfds serialVersionUID
Expand All @@ -27,8 +14,6 @@ innr public final Builder
meth public boolean isInteractive()
meth public boolean isInternal()
meth public com.oracle.truffle.api.source.Source subSource(int,int)
meth public final com.oracle.truffle.api.source.LineLocation createLineLocation(int)
anno 0 java.lang.Deprecated()
meth public final com.oracle.truffle.api.source.SourceSection createSection(int)
meth public final com.oracle.truffle.api.source.SourceSection createSection(int,int)
meth public final com.oracle.truffle.api.source.SourceSection createSection(int,int,int)
Expand Down Expand Up @@ -71,8 +56,6 @@ hfds content,interactive,internal,mime,name,origin,path,uri
CLSS public final com.oracle.truffle.api.source.SourceSection
meth public boolean equals(java.lang.Object)
meth public boolean isAvailable()
meth public com.oracle.truffle.api.source.LineLocation getLineLocation()
anno 0 java.lang.Deprecated()
meth public com.oracle.truffle.api.source.Source getSource()
meth public int getCharEndIndex()
meth public int getCharIndex()
Expand All @@ -92,12 +75,6 @@ CLSS public abstract interface java.io.Serializable
CLSS public abstract interface java.lang.Comparable<%0 extends java.lang.Object>
meth public abstract int compareTo({java.lang.Comparable%0})

CLSS public abstract interface !annotation java.lang.Deprecated
anno 0 java.lang.annotation.Documented()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[CONSTRUCTOR, FIELD, LOCAL_VARIABLE, METHOD, PACKAGE, PARAMETER, TYPE])
intf java.lang.annotation.Annotation

CLSS public java.lang.Exception
cons protected init(java.lang.String,java.lang.Throwable,boolean,boolean)
cons public init()
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -617,29 +617,6 @@ private static boolean assertValid(SourceSection section) {
return true;
}

/**
* Creates a representation of a line number in this source, suitable for use as a hash table
* key with equality defined to mean equivalent location.
*
* @param lineNumber a 1-based line number in this source
* @return a representation of a line in this source
* @since 0.8 or earlier
* @deprecated without replacement
*/
@SuppressWarnings("deprecation")
@Deprecated
public final LineLocation createLineLocation(int lineNumber) {
return new LineLocation(this, lineNumber);
}

/**
* An object suitable for using as a key into a hashtable that defines equivalence between
* different source types.
*/
Object getHashKey() {
return content().getHashKey();
}

final TextMap getTextMap() {
TextMap res = textMap;
if (res == null) {
Expand Down Expand Up @@ -698,8 +675,11 @@ public String getLanguage() {

final boolean equalAttributes(Source other) {
return Objects.equals(getMimeType(), other.getMimeType()) &&
Objects.equals(getLanguage(), other.getLanguage()) &&
Objects.equals(getName(), other.getName()) &&
Objects.equals(getPath(), other.getPath());
Objects.equals(getPath(), other.getPath()) &&
isInternal() == other.isInternal() &&
isInteractive() == other.isInteractive();
}

@SuppressWarnings({"unchecked", "unused"})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,24 +122,6 @@ public int getStartColumn() {
return source.getColumnNumber(getCharIndex());
}

/**
* Gets a representation of the {@link #getStartLine() first line} of the section, suitable for
* a hash key. Please note that calling this method causes the {@link Source#getCharacters()
* code} of the {@link #getSource() source} to be loaded if it was not yet loaded.
*
* @return first line of the section
* @since 0.8 or earlier
* @deprecated without replacement
*/
@SuppressWarnings("deprecation")
@Deprecated
public LineLocation getLineLocation() {
if (!isValid()) {
return null;
}
return source.createLineLocation(getStartLine());
}

/**
* Returns 1-based line number of the last character in this section (inclusive). Returns
* <code>1</code> for out of bounds or {@link #isAvailable() unavailable} source sections.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ private static String languageName(Language lang) {
return lang.getName() + "(" + lang.getVersion() + ")";
}

BreakpointInfo setLineBreakpoint(int ignoreCount, com.oracle.truffle.api.source.LineLocation lineLocation, boolean oneShot) throws IOException {
final BreakpointInfo info = new LineBreakpointInfo(lineLocation, ignoreCount, oneShot);
BreakpointInfo setLineBreakpoint(int ignoreCount, boolean oneShot) throws IOException {
final BreakpointInfo info = new LineBreakpointInfo(ignoreCount, oneShot);
info.activate();
return info;
}
Expand Down Expand Up @@ -372,8 +372,7 @@ protected void onCreate(Env env) {

final class LineBreakpointInfo extends BreakpointInfo {

@SuppressWarnings("unused")
private LineBreakpointInfo(com.oracle.truffle.api.source.LineLocation lineLocation, int ignoreCount, boolean oneShot) {
private LineBreakpointInfo(int ignoreCount, boolean oneShot) {
super(ignoreCount, oneShot);
}

Expand Down

0 comments on commit 31d30a5

Please sign in to comment.