Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
SDG
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Program Slicing
SDG
Merge requests
!43
Implement criterion which don't need a file.
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Implement criterion which don't need a file.
criterion-without-file
into
develop
Overview
7
Commits
2
Pipelines
0
Changes
4
All threads resolved!
Show all comments
Merged
David Olmos Garrido
requested to merge
criterion-without-file
into
develop
4 years ago
Overview
7
Commits
2
Pipelines
0
Changes
4
All threads resolved!
Show all comments
Expand
0
0
Merge request reports
Compare
develop
version 1
b0b8e498
4 years ago
develop (base)
and
latest version
latest version
2861afaa
2 commits,
4 years ago
version 1
b0b8e498
1 commit,
4 years ago
4 files
+
55
−
17
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
sdg-core/src/main/java/es/upv/mist/slicing/slicing/ClassFileLineCriterion.java
0 → 100644
+
34
−
0
Options
package
es.upv.mist.slicing.slicing
;
import
com.github.javaparser.ast.CompilationUnit
;
import
com.github.javaparser.ast.NodeList
;
import
com.github.javaparser.ast.body.TypeDeclaration
;
import
java.util.Objects
;
import
java.util.Optional
;
public
class
ClassFileLineCriterion
extends
LineNumberCriterion
{
private
final
String
fullyQualifiedClassName
;
public
ClassFileLineCriterion
(
final
String
fullyQualifiedClassName
,
int
lineNumber
,
String
variable
)
{
super
(
lineNumber
,
variable
);
this
.
fullyQualifiedClassName
=
fullyQualifiedClassName
;
}
/** Locates the compilation unit that corresponds to this criterion's file. */
protected
Optional
<
CompilationUnit
>
findCompilationUnit
(
NodeList
<
CompilationUnit
>
cus
)
{
for
(
CompilationUnit
cu
:
cus
)
{
if
(
cu
.
getTypes
().
stream
()
.
map
(
TypeDeclaration:
:
getFullyQualifiedName
)
.
map
(
o
->
o
.
orElse
(
null
))
.
anyMatch
(
type
->
Objects
.
equals
(
type
,
fullyQualifiedClassName
)))
return
Optional
.
of
(
cu
);
}
return
Optional
.
empty
();
}
@Override
public
String
toString
()
{
return
fullyQualifiedClassName
+
"#"
+
lineNumber
+
":"
+
variable
;
}
}
Loading