@@ -5,6 +5,7 @@ overlay[local?]
55module ;
66
77import java
8+ private import internal.OverlayXml
89
910/**
1011 * A local predicate that always holds for the overlay variant and
@@ -18,7 +19,7 @@ predicate isOverlay() { databaseMetadata("isOverlay", "true") }
1819overlay [ local]
1920string getRawFile ( @locatable el ) {
2021 exists ( @location loc , @file file |
21- ( hasLocation ( el , loc ) or xmllocations ( el , loc ) ) and
22+ hasLocation ( el , loc ) and
2223 locations_default ( loc , file , _, _, _, _) and
2324 files ( file , result )
2425 )
@@ -102,31 +103,3 @@ private predicate discardBaseConfigLocatable(@configLocatable el) {
102103 // property files than those included in overlayChangedFiles.
103104 overlayConfigExtracted ( baseConfigLocatable ( el ) )
104105}
105-
106- /**
107- * An `@xmllocatable` that should be discarded in the base variant if its file is
108- * extracted in the overlay variant.
109- */
110- overlay [ local]
111- abstract class DiscardableXmlLocatable extends @xmllocatable {
112- /** Gets the raw file for an xmllocatable in base. */
113- string getRawFileInBase ( ) { not isOverlay ( ) and result = getRawFile ( this ) }
114-
115- /** Gets a textual representation of this discardable xmllocatable. */
116- string toString ( ) { none ( ) }
117- }
118-
119- overlay [ local]
120- private predicate overlayXmlExtracted ( string file ) {
121- isOverlay ( ) and
122- exists ( @xmllocatable el | not files ( el , _) and not xmlNs ( el , _, _, _) and file = getRawFile ( el ) )
123- }
124-
125- overlay [ discard_entity]
126- private predicate discardXmlLocatable ( @xmllocatable el ) {
127- overlayChangedFiles ( el .( DiscardableXmlLocatable ) .getRawFileInBase ( ) )
128- or
129- // The XML extractor is currently not incremental and may extract more
130- // XML files than those included in overlayChangedFiles.
131- overlayXmlExtracted ( el .( DiscardableXmlLocatable ) .getRawFileInBase ( ) )
132- }
0 commit comments