Skip to content

Commit

Permalink
2024.1 Code Drop
Browse files Browse the repository at this point in the history
  • Loading branch information
skumar7322 committed Jul 15, 2024
1 parent 52c86b8 commit 89132fb
Show file tree
Hide file tree
Showing 11 changed files with 199 additions and 156 deletions.
20 changes: 18 additions & 2 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Release Notes for
P4Java, the Perforce Java API

Version 2023.2
Version 2024.1

Introduction

Expand All @@ -22,7 +22,7 @@ Requirements

* Perforce server at Release 2015.1 or higher.

* Java: full standard JDK 8 or later. Implementation as
* Java: full standard JDK 11 or later. Implementation as
discussed in "Known Limitations" below.

* SSL: unlimited strength JCE (Java Cryptography Extension) package for
Expand Down Expand Up @@ -124,6 +124,22 @@ Known Limitations
* P4Java would not support file operations on altsync enabled clients.


-------------------------------------------
Updates in 2024.1 (2024.1/2612262) (2024/06/12)

#2608430 (Job #120559)
Added support for comments in the view mapping of Client, Branch, and Label Spec.

#2604468 (Job #120573)
Upgraded P4Java to use Java 11.

#2597460 (Job #119320)
Fixed a bug where the "Server.getExtendedFile(..)" throws NumberFormatException
when headRev is #none

#2597531 (Job #112324)
Fixed inconsistent handling of quotes in ViewMap for Label.

-------------------------------------------
Updates in 2023.2 Patch 1 (2023.2/2581742) (2024/04/05)

Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ plugins {
group = 'com.perforce'
version = project.hasProperty('ver') ? project.ext.ver : 'PREP-TEST_ONLY'

sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = 11
targetCompatibility = 11

repositories {
maven { url "https://repo.maven.apache.org/maven2" }
Expand All @@ -26,8 +26,8 @@ dependencies {
testImplementation 'org.slf4j:slf4j-simple:1.7.36'
testImplementation 'org.apache.commons:commons-exec:1.3'
testImplementation 'org.apache.commons:commons-compress:1.21'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.7.12'
testImplementation 'junit:junit:4.13.1'
testImplementation 'org.mockito:mockito-core:4.0.0'
testImplementation 'com.googlecode.java-diff-utils:diffutils:1.3.0'
}

Expand Down
168 changes: 84 additions & 84 deletions gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,84 +1,84 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto init

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.

goto fail

:init
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args

:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2

:win9xME_args_slurp
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
Original file line number Diff line number Diff line change
Expand Up @@ -188,19 +188,21 @@ public BranchSpec(Map<String, Object> map, IServer server) {
super(map, false);

this.server = server;
this.branchView = new ViewMap<IBranchMapping>();
this.branchView = new ViewMap<>();

if (map != null) {
String key = MapKeys.VIEW_KEY;
String commentKey = MapKeys.VIEW_COMMENT_KEY;
for (int i = 0; ; i++) {
if (!map.containsKey(key + i)) {
if (!map.containsKey(key + i) && !map.containsKey(commentKey + i)) {
break;
} else if (map.get(key + i) != null) {
} else if (map.get(key + i) != null || map.get(commentKey + i) != null) {
try {
String[] matchStrs = MapEntry.parseViewMappingString((String) map.get(key + i));

this.branchView.getEntryList().add(new BranchViewMapping(i, matchStrs[0], matchStrs[1]));

String comment = MapEntry.parseComments((String) map.get(commentKey + i));
BranchViewMapping mapping = new BranchViewMapping(i, matchStrs[0], matchStrs[1]);
mapping.setComment(comment);
this.branchView.getEntryList().add(mapping);
} catch (Throwable thr) {
Log.error("Unexpected exception in BranchSpec map-based constructor: "
+ thr.getLocalizedMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public static Map<String, Object> map(IClient client) {
}
IClientOptions opts = client.getOptions();
IClientSubmitOptions subOpts = client.getSubmitOptions();
ClientView view = client.getClientView();


ArrayList<String> changeView = client.getChangeView();
if (changeView != null && !changeView.isEmpty()) {
Expand All @@ -205,7 +205,7 @@ public static Map<String, Object> map(IClient client) {
+ (opts.isModtime() ? "modtime " : "nomodtime ")
+ (opts.isRmdir() ? "rmdir" : "normdir");

if(opts.toString().split(" ").length > 6)
if (opts.toString().split(" ").length > 6)
optStr = optStr + (opts.isaltSync() ? " altsync" : " noaltsync");

clientMap.put("Options", optStr);
Expand All @@ -229,9 +229,9 @@ public static Map<String, Object> map(IClient client) {
clientMap.put("SubmitOptions", subOptsStr);
}

ClientView view = client.getClientView();
if ((view != null) && (view.getEntryList() != null)) {
List<IClientViewMapping> viewList = view.getEntryList();

for (IClientViewMapping mapping : viewList) {
clientMap.put(MapKeys.VIEW_KEY + mapping.getOrder(), mapping.toString(" ", true));
}
Expand Down
13 changes: 7 additions & 6 deletions src/main/java/com/perforce/p4java/impl/generic/core/Label.java
Original file line number Diff line number Diff line change
Expand Up @@ -234,17 +234,18 @@ public Label(Map<String, Object> map, IServer server) {

// Note: only the left (depot) side is given for label views

this.viewMapping = new ViewMap<ILabelMapping>();
this.viewMapping = new ViewMap<>();

for (int i = 0; ; i++) {
String mappingStr = (String) map.get(MapKeys.VIEW_KEY
+ i);

if (mappingStr == null) {
String mappingStr = (String) map.get(MapKeys.VIEW_KEY + i);
String commentStr = (String) map.get(MapKeys.VIEW_COMMENT_KEY + i);
if (mappingStr == null && commentStr == null) {
break;
} else {
String[] parts = MapEntry.parseViewMappingString(mappingStr);
this.viewMapping.getEntryList().add(new LabelMapping(i, parts[0]));
LabelMapping mapping = new LabelMapping(i, parts[0]);
mapping.setComment(MapEntry.parseComments(commentStr));
this.viewMapping.getEntryList().add(mapping);
}
}

Expand Down
Loading

0 comments on commit 89132fb

Please sign in to comment.