Skip to content

Commit

Permalink
Merge pull request #738 from soot-oss/fix/682_fromPath
Browse files Browse the repository at this point in the history
fix #682 from path
  • Loading branch information
swissiety authored Jan 31, 2024
2 parents ee53892 + f139b8e commit d5f593a
Show file tree
Hide file tree
Showing 190 changed files with 2,110 additions and 1,451 deletions.
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

0 comments on commit d5f593a

Please sign in to comment.