Skip to content

Commit

Permalink
Update dependencies and Maven wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
ThexXTURBOXx committed Feb 25, 2022
1 parent 3702d61 commit 46e39e7
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 55 deletions.
Binary file modified .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
21 changes: 18 additions & 3 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.2/apache-maven-3.8.2-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar

# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.4/apache-maven-3.8.4-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
18 changes: 12 additions & 6 deletions mvnw
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@

if [ -z "$MAVEN_SKIP_RC" ] ; then

if [ -f /usr/local/etc/mavenrc ] ; then
. /usr/local/etc/mavenrc
fi

if [ -f /etc/mavenrc ] ; then
. /etc/mavenrc
fi
Expand Down Expand Up @@ -145,7 +149,7 @@ if [ -z "$JAVACMD" ] ; then
JAVACMD="$JAVA_HOME/bin/java"
fi
else
JAVACMD="`which java`"
JAVACMD="`\\unset -f command; \\command -v java`"
fi
fi

Expand Down Expand Up @@ -212,9 +216,9 @@ else
echo "Couldn't find .mvn/wrapper/maven-wrapper.jar, downloading it ..."
fi
if [ -n "$MVNW_REPOURL" ]; then
jarUrl="$MVNW_REPOURL/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
jarUrl="$MVNW_REPOURL/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
else
jarUrl="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
jarUrl="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
fi
while IFS="=" read key value; do
case "$key" in (wrapperUrl) jarUrl="$value"; break ;;
Expand All @@ -233,9 +237,9 @@ else
echo "Found wget ... using wget"
fi
if [ -z "$MVNW_USERNAME" ] || [ -z "$MVNW_PASSWORD" ]; then
wget "$jarUrl" -O "$wrapperJarPath"
wget "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
else
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath"
wget --http-user=$MVNW_USERNAME --http-password=$MVNW_PASSWORD "$jarUrl" -O "$wrapperJarPath" || rm -f "$wrapperJarPath"
fi
elif command -v curl > /dev/null; then
if [ "$MVNW_VERBOSE" = true ]; then
Expand Down Expand Up @@ -305,6 +309,8 @@ WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain

exec "$JAVACMD" \
$MAVEN_OPTS \
$MAVEN_DEBUG_OPTS \
-classpath "$MAVEN_PROJECTBASEDIR/.mvn/wrapper/maven-wrapper.jar" \
"-Dmaven.home=${M2_HOME}" "-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
"-Dmaven.home=${M2_HOME}" \
"-Dmaven.multiModuleProjectDirectory=${MAVEN_PROJECTBASEDIR}" \
${WRAPPER_LAUNCHER} $MAVEN_CONFIG "$@"
30 changes: 18 additions & 12 deletions mvnw.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ if "%HOME%" == "" (set "HOME=%HOMEDRIVE%%HOMEPATH%")
@REM Execute a user defined script before this one
if not "%MAVEN_SKIP_RC%" == "" goto skipRcPre
@REM check for pre script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_pre.bat" call "%HOME%\mavenrc_pre.bat"
if exist "%HOME%\mavenrc_pre.cmd" call "%HOME%\mavenrc_pre.cmd"
if exist "%USERPROFILE%\mavenrc_pre.bat" call "%USERPROFILE%\mavenrc_pre.bat" %*
if exist "%USERPROFILE%\mavenrc_pre.cmd" call "%USERPROFILE%\mavenrc_pre.cmd" %*
:skipRcPre

@setlocal
Expand Down Expand Up @@ -120,9 +120,9 @@ SET MAVEN_JAVA_EXE="%JAVA_HOME%\bin\java.exe"
set WRAPPER_JAR="%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.jar"
set WRAPPER_LAUNCHER=org.apache.maven.wrapper.MavenWrapperMain

set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
set DOWNLOAD_URL="https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"

FOR /F "tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
FOR /F "usebackq tokens=1,2 delims==" %%A IN ("%MAVEN_PROJECTBASEDIR%\.mvn\wrapper\maven-wrapper.properties") DO (
IF "%%A"=="wrapperUrl" SET DOWNLOAD_URL=%%B
)

Expand All @@ -134,7 +134,7 @@ if exist %WRAPPER_JAR% (
)
) else (
if not "%MVNW_REPOURL%" == "" (
SET DOWNLOAD_URL="%MVNW_REPOURL%/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar"
SET DOWNLOAD_URL="%MVNW_REPOURL%/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar"
)
if "%MVNW_VERBOSE%" == "true" (
echo Couldn't find %WRAPPER_JAR%, downloading it ...
Expand All @@ -158,7 +158,13 @@ if exist %WRAPPER_JAR% (
@REM work with both Windows and non-Windows executions.
set MAVEN_CMD_LINE_ARGS=%*

%MAVEN_JAVA_EXE% %JVM_CONFIG_MAVEN_PROPS% %MAVEN_OPTS% %MAVEN_DEBUG_OPTS% -classpath %WRAPPER_JAR% "-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" %WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
%MAVEN_JAVA_EXE% ^
%JVM_CONFIG_MAVEN_PROPS% ^
%MAVEN_OPTS% ^
%MAVEN_DEBUG_OPTS% ^
-classpath %WRAPPER_JAR% ^
"-Dmaven.multiModuleProjectDirectory=%MAVEN_PROJECTBASEDIR%" ^
%WRAPPER_LAUNCHER% %MAVEN_CONFIG% %*
if ERRORLEVEL 1 goto error
goto end

Expand All @@ -168,15 +174,15 @@ set ERROR_CODE=1
:end
@endlocal & set ERROR_CODE=%ERROR_CODE%

if not "%MAVEN_SKIP_RC%" == "" goto skipRcPost
if not "%MAVEN_SKIP_RC%"=="" goto skipRcPost
@REM check for post script, once with legacy .bat ending and once with .cmd ending
if exist "%HOME%\mavenrc_post.bat" call "%HOME%\mavenrc_post.bat"
if exist "%HOME%\mavenrc_post.cmd" call "%HOME%\mavenrc_post.cmd"
if exist "%USERPROFILE%\mavenrc_post.bat" call "%USERPROFILE%\mavenrc_post.bat"
if exist "%USERPROFILE%\mavenrc_post.cmd" call "%USERPROFILE%\mavenrc_post.cmd"
:skipRcPost

@REM pause the script if MAVEN_BATCH_PAUSE is set to 'on'
if "%MAVEN_BATCH_PAUSE%" == "on" pause
if "%MAVEN_BATCH_PAUSE%"=="on" pause

if "%MAVEN_TERMINATE_CMD%" == "on" exit %ERROR_CODE%
if "%MAVEN_TERMINATE_CMD%"=="on" exit %ERROR_CODE%

exit /B %ERROR_CODE%
cmd /C exit /B %ERROR_CODE%
40 changes: 17 additions & 23 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<asm.version>9.2</asm.version>
<analysis.version>1.6.0</analysis.version>
<dude.version>1.8.1</dude.version>
<dude.version>1.9.4</dude.version>
<cfr.version>0.152</cfr.version>
<ff.version>1.5.498.23</ff.version>
<procyon.version>0.5.36</procyon.version>
<junit.version>5.8.1</junit.version>
<pico.version>4.6.1</pico.version>
<jline.version>3.20.0</jline.version>
<jp.version>3.23.1</jp.version>
<jfx.version>16</jfx.version>
<procyon.version>0.6.0</procyon.version>
<junit.version>5.8.2</junit.version>
<pico.version>4.6.3</pico.version>
<jline.version>3.21.0</jline.version>
<jp.version>3.24.0</jp.version>
<jfx.version>17.0.2</jfx.version>
<spotbugs.version>4.0.0</spotbugs.version>
<spotbugs-mvn.version>3.1.12.2</spotbugs-mvn.version>
</properties>
Expand Down Expand Up @@ -135,7 +135,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>30.1.1-jre</version>
<version>31.0.1-jre</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.eclipsesource.minimal-json/minimal-json -->
<dependency>
Expand All @@ -153,7 +153,7 @@
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.14.2</version>
<version>1.14.3</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.plugface/plugface-core -->
<dependency>
Expand All @@ -169,9 +169,9 @@
</dependency>
<!-- https://mvnrepository.com/artifact/com.atlassian.commonmark/commonmark -->
<dependency>
<groupId>com.atlassian.commonmark</groupId>
<groupId>org.commonmark</groupId>
<artifactId>commonmark</artifactId>
<version>0.17.0</version>
<version>0.18.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/net.sourceforge.cssparser/cssparser -->
<dependency>
Expand Down Expand Up @@ -219,7 +219,7 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<version>1.2.10</version>
</dependency>
<!-- Tools -->
<dependency>
Expand Down Expand Up @@ -303,6 +303,7 @@
<dependency>
<groupId>org.fxmisc.richtext</groupId>
<artifactId>richtextfx</artifactId>
<!-- Newer versions depend on Flowless 0.6.5+ which requires Java 9, do not upgrade -->
<version>0.10.6</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.fxmisc.wellbehaved/wellbehavedfx -->
Expand All @@ -324,8 +325,9 @@
<plugins>
<!-- Compiler version -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.9.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
Expand Down Expand Up @@ -375,6 +377,7 @@
</plugin>
<!-- Packaging -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.3.0</version>
<executions>
Expand Down Expand Up @@ -485,15 +488,6 @@
<linkXRef>false</linkXRef>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down Expand Up @@ -524,4 +518,4 @@
-->
</plugins>
</build>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ public void saveDirEntry(String s, String s1, String s2) {}
@Override
public void copyEntry(String s, String s1, String s2, String s3) {}

@Override
public void saveClassEntry(String s, String s1, String s2, String s3, String s4) {}

@Override
public void closeArchive(String s, String s1) {}
}
6 changes: 2 additions & 4 deletions src/main/java/me/coley/recaf/parse/source/SourceCode.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,8 @@ public Node getNodeAt(int line, int column) {
if (!node.getBegin().isPresent() || !node.getEnd().isPresent())
return false;
// Same as above, we want to return the node with actual context.
if (node instanceof NameExpr)
return false;
return !(node instanceof NameExpr);
// Should be fine
return true;
});
}

Expand All @@ -171,7 +169,7 @@ private Node getNodeAt(int line, int column, Node root, Predicate<Node> filter)
// We won't instantly return null because the root range may be SMALLER than
// the range of children. This is really stupid IMO but thats how JavaParser is...
boolean bounds = true;
Position cursor = Position.pos(line, column);
Position cursor = new Position(line, column);
if (cursor.isBefore(root.getBegin().get()) || cursor.isAfter(root.getEnd().get()))
bounds = false;
// Iterate over children, return non-null child
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void report(Diagnostic<? extends VirtualJavaFileObject> diagnostic) {
// 0-index the line number
int line = (int) diagnostic.getLineNumber() - 1;
int column = (int) diagnostic.getColumnNumber();
int literalStart = calculate(Position.pos(line + 1, column));
int literalStart = calculate(new Position(line + 1, column));
// TODO: Properly fix this not fetching the correct section of text in weird cases
String[] split = codeArea.getText().substring(literalStart).split("[^\\w.]+");
int wordLength = split.length == 0 ? 1 : split[0].length();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package me.coley.recaf.util;

import me.coley.cafedude.ClassFile;
import me.coley.cafedude.classfile.ClassFile;
import me.coley.cafedude.io.ClassFileReader;
import me.coley.cafedude.io.ClassFileWriter;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/me/coley/recaf/util/JavaParserUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ private static String typeToDesc(Type type) {
ClassOrInterfaceType clsType = (ClassOrInterfaceType) type;
clsType.setTypeArguments(NO_TYPE_ARGS);
try {
key = toInternal(clsType.resolve().getTypeDeclaration().get());
key = toInternal(clsType.resolve().asTypeParameter());
} catch(UnsolvedSymbolException ex) {
Log.warn("JavaParser failed to resolve type '{}'", ex.getName());
} catch(UnsupportedOperationException ex) {
Expand Down
3 changes: 2 additions & 1 deletion src/test/java/me/coley/recaf/SourceCodeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.github.javaparser.resolution.declarations.*;
import com.github.javaparser.resolution.types.ResolvedPrimitiveType;
import com.github.javaparser.resolution.types.ResolvedReferenceType;
import com.github.javaparser.resolution.types.ResolvedType;
import com.google.common.collect.Sets;
import me.coley.recaf.parse.source.SourceCode;
import me.coley.recaf.workspace.*;
Expand Down Expand Up @@ -91,7 +92,7 @@ public void testClassResolve() {
Node node = code.getNodeAt(6, 37); // String
assertTrue(node instanceof ClassOrInterfaceType);
ClassOrInterfaceType classType = (ClassOrInterfaceType) node;
ResolvedReferenceType dec = classType.resolve();
ResolvedType dec = classType.resolve();
assertEquals("java/lang/String", toInternal(dec));
//
node = code.getNodeAt(22, 18); // Exponent
Expand Down

0 comments on commit 46e39e7

Please sign in to comment.