Skip to content

Commit 09ee106

Browse files
author
Max Schaefer
committed
Java/JavaScript: Add two deprecated predicates to XML.qll.
This makes XML.qll identical across C++, Java, JavaScript and Python.
1 parent a17b615 commit 09ee106

File tree

2 files changed

+28
-0
lines changed
  • javascript/ql/src/semmle/javascript
  • java/ql/src/semmle/code/xml

2 files changed

+28
-0
lines changed

java/ql/src/semmle/code/xml/XML.qll

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,20 @@ class XMLFile extends XMLParent, File {
117117
/** Gets the name of this XML file. */
118118
override string getName() { result = File.super.getAbsolutePath() }
119119

120+
/**
121+
* DEPRECATED: Use `getAbsolutePath()` instead.
122+
*
123+
* Gets the path of this XML file.
124+
*/
125+
deprecated string getPath() { result = getAbsolutePath() }
126+
127+
/**
128+
* DEPRECATED: Use `getParentContainer().getAbsolutePath()` instead.
129+
*
130+
* Gets the path of the folder that contains this XML file.
131+
*/
132+
deprecated string getFolder() { result = getParentContainer().getAbsolutePath() }
133+
120134
/** Gets the encoding of this XML file. */
121135
string getEncoding() { xmlEncoding(this, result) }
122136

javascript/ql/src/semmle/javascript/XML.qll

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,20 @@ class XMLFile extends XMLParent, File {
117117
/** Gets the name of this XML file. */
118118
override string getName() { result = File.super.getAbsolutePath() }
119119

120+
/**
121+
* DEPRECATED: Use `getAbsolutePath()` instead.
122+
*
123+
* Gets the path of this XML file.
124+
*/
125+
deprecated string getPath() { result = getAbsolutePath() }
126+
127+
/**
128+
* DEPRECATED: Use `getParentContainer().getAbsolutePath()` instead.
129+
*
130+
* Gets the path of the folder that contains this XML file.
131+
*/
132+
deprecated string getFolder() { result = getParentContainer().getAbsolutePath() }
133+
120134
/** Gets the encoding of this XML file. */
121135
string getEncoding() { xmlEncoding(this, result) }
122136

0 commit comments

Comments
 (0)