Merge pull request #6681 from hvitved/java/files-folders-drop-columns

Java: Drop redundant columns from `files` and `folders` relations
This commit is contained in:
Tom Hvitved
2021-09-13 17:43:31 +02:00
committed by GitHub
7 changed files with 1979 additions and 482 deletions

View File

@@ -157,7 +157,7 @@ class Container extends @container, Top {
/** A folder. */
class Folder extends Container, @folder {
override string getAbsolutePath() { folders(this, result, _) }
override string getAbsolutePath() { folders(this, result) }
/** Gets the URL of this folder. */
override string getURL() { result = "folder://" + getAbsolutePath() }
@@ -171,7 +171,7 @@ class Folder extends Container, @folder {
* Note that `File` extends `Container` as it may be a `jar` file.
*/
class File extends Container, @file {
override string getAbsolutePath() { files(this, result, _, _, _) }
override string getAbsolutePath() { files(this, result) }
/** Gets the URL of this file. */
override string getURL() { result = "file://" + this.getAbsolutePath() + ":0:0:0:0" }

View File

@@ -24,7 +24,7 @@ predicate hasName(Element e, string name) {
or
packages(e, name)
or
files(e, _, name, _, _)
name = e.(File).getStem()
or
paramName(e, name)
or