Java Code Examples for javax.tools.JavaFileObject.getLastModified()

The following are Jave code examples for showing how to use getLastModified() of the javax.tools.JavaFileObject class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: javaide   File: ClassReader.java   Source Code and License Vote up 5 votes
/**
 * Implement policy to choose to derive information from a source
 * file or a class file when both are present.  May be overridden
 * by subclasses.
 */
protected JavaFileObject preferredFileObject(JavaFileObject a,
                                             JavaFileObject b) {

    if (preferSource)
        return (a.getKind() == JavaFileObject.Kind.SOURCE) ? a : b;
    else {
        long adate = a.getLastModified();
        long bdate = b.getLastModified();
        // 6449326: policy for bad lastModifiedTime in ClassReader
        //assert adate >= 0 && bdate >= 0;
        return (adate > bdate) ? a : b;
    }
}
 
Example 2
Project: OpenJSharp   File: ClassReader.java   Source Code and License Vote up 5 votes
/** Implement policy to choose to derive information from a source
 *  file or a class file when both are present.  May be overridden
 *  by subclasses.
 */
protected JavaFileObject preferredFileObject(JavaFileObject a,
                                       JavaFileObject b) {

    if (preferSource)
        return (a.getKind() == JavaFileObject.Kind.SOURCE) ? a : b;
    else {
        long adate = a.getLastModified();
        long bdate = b.getLastModified();
        // 6449326: policy for bad lastModifiedTime in ClassReader
        //assert adate >= 0 && bdate >= 0;
        return (adate > bdate) ? a : b;
    }
}
 
Example 3
Project: openjdk-jdk10   File: ClassFinder.java   Source Code and License Vote up 5 votes
/** Implement policy to choose to derive information from a source
 *  file or a class file when both are present.  May be overridden
 *  by subclasses.
 */
protected JavaFileObject preferredFileObject(JavaFileObject a,
                                       JavaFileObject b) {

    if (preferSource)
        return (a.getKind() == JavaFileObject.Kind.SOURCE) ? a : b;
    else {
        long adate = a.getLastModified();
        long bdate = b.getLastModified();
        // 6449326: policy for bad lastModifiedTime in ClassReader
        //assert adate >= 0 && bdate >= 0;
        return (adate > bdate) ? a : b;
    }
}
 
Example 4
Project: javaide   File: BaseFileManager.java   Source Code and License Vote up 4 votes
ContentCacheEntry(JavaFileObject file, CharBuffer cb) {
    this.timestamp = file.getLastModified();
    this.ref = new SoftReference<CharBuffer>(cb);
}
 
Example 5
Project: javaide   File: BaseFileManager.java   Source Code and License Vote up 4 votes
boolean isValid(JavaFileObject file) {
    return timestamp == file.getLastModified();
}
 
Example 6
Project: OpenJSharp   File: BaseFileManager.java   Source Code and License Vote up 4 votes
ContentCacheEntry(JavaFileObject file, CharBuffer cb) {
    this.timestamp = file.getLastModified();
    this.ref = new SoftReference<CharBuffer>(cb);
}
 
Example 7
Project: OpenJSharp   File: BaseFileManager.java   Source Code and License Vote up 4 votes
boolean isValid(JavaFileObject file) {
    return timestamp == file.getLastModified();
}
 
Example 8
Project: openjdk-jdk10   File: BaseFileManager.java   Source Code and License Vote up 4 votes
ContentCacheEntry(JavaFileObject file, CharBuffer cb) {
    this.timestamp = file.getLastModified();
    this.ref = new SoftReference<>(cb);
}
 
Example 9
Project: openjdk-jdk10   File: BaseFileManager.java   Source Code and License Vote up 4 votes
boolean isValid(JavaFileObject file) {
    return timestamp == file.getLastModified();
}