Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix #682 from path #738

Merged
merged 67 commits into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
a11d106
add single file testcase for having a packagename
swissiety Nov 2, 2023
51523af
progress
swissiety Nov 2, 2023
e2313b8
add check that we load a compilation unit which has indeed the reques…
swissiety Oct 7, 2023
f1d4487
simplify
swissiety Nov 8, 2023
2c5d73e
Body: cleanup validators (they will be implemented as a BodyIntercept…
swissiety Nov 22, 2023
41734a9
Merge branch 'develop' into fix/682_fromPath
swissiety Nov 23, 2023
6828580
improve isCtor
swissiety Nov 23, 2023
c24d52f
Merge branch 'develop' into fix/682_fromPath
swissiety Nov 27, 2023
6c49d80
fix tests where the bodybuilder was not copied anymore
swissiety Nov 27, 2023
c3aa637
Merge branch 'develop' into fix/682_fromPath
swissiety Jan 11, 2024
82d58b9
merge fixes
swissiety Jan 11, 2024
f8b8c1d
merge fixes
swissiety Jan 11, 2024
b69bc90
Merge remote-tracking branch 'origin/fix/682_fromPath' into fix/682_f…
swissiety Jan 11, 2024
ba1be79
fix ClassBasedAnalysisInputLocation via fromPath
swissiety Jan 11, 2024
3a1ede9
progress multireleasejarinputlocations
swissiety Jan 11, 2024
f45e47b
style + naming
swissiety Jan 12, 2024
ca8d50f
remove obsolete sourcetypespecifier
swissiety Jan 12, 2024
aa15526
progress
swissiety Jan 12, 2024
c2a60b7
cleanup
swissiety Jan 12, 2024
38f0375
test if multi release
swissiety Jan 12, 2024
ee9345c
refactor
swissiety Jan 12, 2024
d9c2ff5
refactor MultiReleaseJarAnalysisInputLocation
swissiety Jan 15, 2024
628a524
refactor + extract tests - they definitely need >java8 runtime to run…
swissiety Jan 16, 2024
de67ebe
Merge branch 'develop' into fix/682_fromPath
swissiety Jan 16, 2024
be9593a
fixup
swissiety Jan 16, 2024
e53e2f5
style
swissiety Jan 16, 2024
3d85900
add ignorePaths; improve error message
swissiety Jan 16, 2024
e829c82
style
swissiety Jan 17, 2024
4a3f335
add test execution
swissiety Jan 17, 2024
4ddd710
fix check for java modules
swissiety Jan 17, 2024
02298d8
postpone fixing more tests into a future PR
swissiety Jan 17, 2024
218f005
this lamb is silent now.
swissiety Jan 18, 2024
db0b171
update multimodulereleasejar according to its sources; de-win the cre…
swissiety Jan 18, 2024
b33eb98
remove obsolete python file
swissiety Jan 18, 2024
d82c02f
style, test todos
swissiety Jan 18, 2024
03cb3b3
header
swissiety Jan 18, 2024
f0b075b
add license header - fix licenseheader check, change workflow to chec…
swissiety Jan 18, 2024
c6b03d3
Merge remote-tracking branch 'origin/fix/682_fromPath' into fix/682_f…
swissiety Jan 18, 2024
c3f425a
Merge branch 'develop' into fix/682_fromPath
swissiety Jan 18, 2024
0ae8c4d
sytle
swissiety Jan 18, 2024
763c73b
remove obsolete test
swissiety Jan 18, 2024
4b035a3
fix handling invalid class files
swissiety Jan 18, 2024
207f736
Merge branch 'develop' into fix/682_fromPath
swissiety Jan 18, 2024
a49feda
remove obsolete StmtContainer + usages
swissiety Jan 18, 2024
bbae8d4
cherrypick leftovers from obsolete branch
swissiety Jan 18, 2024
746755d
add argument checks for traps
swissiety Jan 18, 2024
0e03e0a
refactor
swissiety Jan 19, 2024
a954c65
style, fix test
swissiety Jan 19, 2024
718ae93
Errormsg++
swissiety Jan 22, 2024
4da38c8
fix wrong full qualified classnames coming from the JrtFileSystemAnal…
swissiety Jan 22, 2024
5b5c062
"Fashions fade, style is eternal." — YSL
swissiety Jan 22, 2024
6b04c93
remove obsolete copyable interface
swissiety Jan 22, 2024
fbcce58
Merge branch 'develop' into fix/682_fromPath
swissiety Jan 22, 2024
cd20d5f
refactor api
swissiety Jan 22, 2024
b8c11eb
improve api - make available versions static
swissiety Jan 23, 2024
7ccd8ab
adapt test input to have a similar structure; test version
swissiety Jan 23, 2024
f4c434e
cleanup; move task into another issue
swissiety Jan 24, 2024
5371e9e
fix providerMismatchException
swissiety Jan 25, 2024
3b00746
Merge branch 'develop' into fix/682_fromPath
swissiety Jan 26, 2024
9f6a8c1
never trust your inputs!
swissiety Jan 26, 2024
5f77222
never trust your inputs - modular.
swissiety Jan 26, 2024
f79d143
copy de-incorporated comment to wip feature
swissiety Jan 26, 2024
eb38068
fix #763
swissiety Jan 29, 2024
5922dec
and pass interceptors further down
swissiety Jan 29, 2024
564bba0
test getClasses; fix typo in ignored Path
swissiety Jan 30, 2024
66a0cc8
its not easy beeing green /style
swissiety Jan 30, 2024
f139b8e
incorporate PR feedback
swissiety Jan 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ jobs:
- name: Check Format
run: mvn -B com.coveo:fmt-maven-plugin:check -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn

- name: License Headers
run: mvn -B org.codehaus.mojo:license-maven-plugin:check-file-header -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn

JDK8:
needs: Compilation
runs-on: ubuntu-latest
Expand Down
8 changes: 7 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,15 @@
<licenseName>lgpl_v2_1</licenseName>
<organizationName>Raja Vallée-Rai and others</organizationName>
<roots>
<root>sootup.java.analysis/src/main/java</root>
<root>sootup.callgraph/src/main/java</root>
<root>sootup.core/src/main/java</root>
<root>sootup.java.examples/src/main/java</root>
<root>sootup.java.bytecode/src/main/java</root>
<root>sootup.java.core/src/main/java</root>
<root>sootup.java.sourcecode/src/main/java</root>
<root>sootup.jimple.parser/src/main/java</root>
<root>sootup.tests/src/main/java</root>
</roots>
</configuration>
<executions>
Expand All @@ -335,7 +341,7 @@
<goals>
<goal>check-file-header</goal>
</goals>
<phase>verify</phase>
<phase>none</phase>
</execution>
</executions>
</plugin>
Expand Down
Binary file added shared-test-resources/ClassWithPackageName.class
Binary file not shown.
44 changes: 44 additions & 0 deletions shared-test-resources/ClassWithPackageName.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html.
*
* This file is a derivative of code released by the University of
* California under the terms listed below.
*
* WALA JDT Frontend is Copyright (c) 2008 The Regents of the
* University of California (Regents). Provided that this notice and
* the following two paragraphs are included in any distribution of
* Refinement Analysis Tools or its derivative work, Regents agrees
* not to assert any of Regents' copyright rights in Refinement
* Analysis Tools against recipient for recipient's reproduction,
* preparation of derivative works, public display, public
* performance, distribution or sublicensing of Refinement Analysis
* Tools and derivative works, in source code and object code form.
* This agreement not to assert does not confer, by implication,
* estoppel, or otherwise any license or rights in any intellectual
* property of Regents, including, but not limited to, any patents
* of Regents or Regents' employees.
*
* IN NO EVENT SHALL REGENTS BE LIABLE TO ANY PARTY FOR DIRECT,
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES,
* INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE
* AND ITS DOCUMENTATION, EVEN IF REGENTS HAS BEEN ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* REGENTS SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE AND FURTHER DISCLAIMS ANY STATUTORY
* WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE AND ACCOMPANYING
* DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS
* IS". REGENTS HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT,
* UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*/
package ClassesPackageName;

// need inner classes to run this test

public class ClassWithPackageName {
int foo;
}
18 changes: 18 additions & 0 deletions shared-test-resources/multi-release-jar-modular/createModMrJar.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# /bin/bash

# To build the jar:

javac --release 8 -d classes src/main/java/de/upb/sse/multirelease/*java
javac --release 9 -d classes-9 src/main/java9/de/upb/sse/multirelease/*java src/main/java9/module-info.java
javac --release 10 -d classes-10 src/main/java10/de/upb/sse/multirelease/*java src/main/java10/module-info.java

jar --create --file mrjar.jar --main-class multirelease.Main -C classes . --release 9 -C classes-9 . --release 10 -C classes-10 .


# cleanup
rm -r ./classes ./classes-9 ./classes-10


#More info:
#https://www.baeldung.com/java-multi-release-jar

Binary file modified shared-test-resources/multi-release-jar-modular/mrjar.jar
Binary file not shown.
10 changes: 0 additions & 10 deletions shared-test-resources/multi-release-jar-modular/readme.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multirelease;
package de.upb.sse.multirelease;

public class Main {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multirelease;
package de.upb.sse.multirelease;

public class Utility {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multirelease;
package de.upb.sse.multirelease;

public class Utility {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module multirelease {
exports multirelease;
exports de.upb.sse.multirelease;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multirelease;
package de.upb.sse.multirelease;

public class Utility {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module multirelease {
exports multirelease;
exports de.upb.sse.multirelease;
}
11 changes: 11 additions & 0 deletions shared-test-resources/multi-release-jar/createMrJar.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# /bin/bash
#More info: https://www.baeldung.com/java-multi-release-jar

javac --release 8 -d classes src/main/java/de/upb/sse/multirelease/*java
javac --release 9 -d classes-9 src/main/java9/de/upb/sse/multirelease/*java
javac --release 10 -d classes-10 src/main/java10/de/upb/sse/multirelease/*java

jar --create --file mrjar.jar --main-class de.upb.swt.multirelease.Main -C classes . --release 9 -C classes-9 . --release 10 -C classes-10 .



Binary file modified shared-test-resources/multi-release-jar/mrjar.jar
Binary file not shown.
10 changes: 0 additions & 10 deletions shared-test-resources/multi-release-jar/readme.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multirelease;
package de.upb.sse.multirelease;

public class Main {

Expand All @@ -10,4 +10,4 @@ public static void main(String[] args) {
System.out.println("End jar");
}

}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multirelease;
package de.upb.sse.multirelease;

public class Utility {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package de.upb.sse.multirelease;

public class Utility {

public static void printVersion() {
System.out.println("java 10");
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package multirelease;
package de.upb.sse.multirelease;

public class Utility {

Expand Down
93 changes: 0 additions & 93 deletions shared-test-resources/srcCodeForTest.py

This file was deleted.

22 changes: 22 additions & 0 deletions sootup.core/src/main/java/sootup/core/BaseViewChangeListener.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
package sootup.core;

/*-
* #%L
* SootUp
* %%
* Copyright (C) 1997 - 2024 Raja Vallée-Rai and others
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 2.1 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-2.1.html>.
* #L%
*/

import sootup.core.model.SootClass;
import sootup.core.model.SootMethod;

Expand Down
12 changes: 2 additions & 10 deletions sootup.core/src/main/java/sootup/core/IdentifierFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
* #L%
*/

import java.nio.file.Path;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nonnull;
Expand Down Expand Up @@ -245,17 +244,10 @@ FieldSignature getFieldSignature(
*/
ArrayType getArrayType(Type baseType, int dim);

/**
* Builds class type from path.
*
* @param file the file
* @param rootDirectory root directory in which the file is.
* @return the class type
*/
ClassType fromPath(Path rootDirectory, Path file);

boolean isStaticInitializerSubSignature(@Nonnull MethodSubSignature methodSubSignature);

boolean isConstructorSignature(@Nonnull MethodSignature methodSignature);

boolean isConstructorSubSignature(@Nonnull MethodSubSignature methodSubSignature);

boolean isMainSubSignature(@Nonnull MethodSubSignature methodSubSignature);
Expand Down
41 changes: 0 additions & 41 deletions sootup.core/src/main/java/sootup/core/SourceTypeSpecifier.java

This file was deleted.

Loading
Loading