From 89132fb9ea7e8ec22b06592bf5fc0f9052fadd61 Mon Sep 17 00:00:00 2001 From: skumar7322 Date: Mon, 15 Jul 2024 14:55:37 +0530 Subject: [PATCH] 2024.1 Code Drop --- RELEASE.md | 20 ++- build.gradle | 8 +- gradlew.bat | 168 +++++++++--------- .../p4java/impl/generic/core/BranchSpec.java | 14 +- .../p4java/impl/generic/core/InputMapper.java | 6 +- .../p4java/impl/generic/core/Label.java | 13 +- .../p4java/impl/generic/core/MapEntry.java | 81 +++++---- .../generic/core/file/ExtendedFileSpec.java | 3 +- .../p4java/impl/mapbased/MapKeys.java | 1 + .../p4java/impl/mapbased/client/Client.java | 39 ++-- .../p4java/impl/mapbased/rpc/RpcServer.java | 2 +- 11 files changed, 199 insertions(+), 156 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 112b6b4..ace8cb8 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,7 +1,7 @@ Release Notes for P4Java, the Perforce Java API - Version 2023.2 + Version 2024.1 Introduction @@ -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 @@ -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) diff --git a/build.gradle b/build.gradle index ab8a686..c1fc6a6 100644 --- a/build.gradle +++ b/build.gradle @@ -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" } @@ -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' } diff --git a/gradlew.bat b/gradlew.bat index b113f38..f955316 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -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 diff --git a/src/main/java/com/perforce/p4java/impl/generic/core/BranchSpec.java b/src/main/java/com/perforce/p4java/impl/generic/core/BranchSpec.java index cb99617..a57b347 100644 --- a/src/main/java/com/perforce/p4java/impl/generic/core/BranchSpec.java +++ b/src/main/java/com/perforce/p4java/impl/generic/core/BranchSpec.java @@ -188,19 +188,21 @@ public BranchSpec(Map map, IServer server) { super(map, false); this.server = server; - this.branchView = new ViewMap(); + 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()); diff --git a/src/main/java/com/perforce/p4java/impl/generic/core/InputMapper.java b/src/main/java/com/perforce/p4java/impl/generic/core/InputMapper.java index 66b72a6..cf30a18 100644 --- a/src/main/java/com/perforce/p4java/impl/generic/core/InputMapper.java +++ b/src/main/java/com/perforce/p4java/impl/generic/core/InputMapper.java @@ -183,7 +183,7 @@ public static Map map(IClient client) { } IClientOptions opts = client.getOptions(); IClientSubmitOptions subOpts = client.getSubmitOptions(); - ClientView view = client.getClientView(); + ArrayList changeView = client.getChangeView(); if (changeView != null && !changeView.isEmpty()) { @@ -205,7 +205,7 @@ public static Map 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); @@ -229,9 +229,9 @@ public static Map map(IClient client) { clientMap.put("SubmitOptions", subOptsStr); } + ClientView view = client.getClientView(); if ((view != null) && (view.getEntryList() != null)) { List viewList = view.getEntryList(); - for (IClientViewMapping mapping : viewList) { clientMap.put(MapKeys.VIEW_KEY + mapping.getOrder(), mapping.toString(" ", true)); } diff --git a/src/main/java/com/perforce/p4java/impl/generic/core/Label.java b/src/main/java/com/perforce/p4java/impl/generic/core/Label.java index f55c588..646889c 100644 --- a/src/main/java/com/perforce/p4java/impl/generic/core/Label.java +++ b/src/main/java/com/perforce/p4java/impl/generic/core/Label.java @@ -234,17 +234,18 @@ public Label(Map map, IServer server) { // Note: only the left (depot) side is given for label views - this.viewMapping = new ViewMap(); + 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); } } diff --git a/src/main/java/com/perforce/p4java/impl/generic/core/MapEntry.java b/src/main/java/com/perforce/p4java/impl/generic/core/MapEntry.java index 24cf2f8..53540ce 100644 --- a/src/main/java/com/perforce/p4java/impl/generic/core/MapEntry.java +++ b/src/main/java/com/perforce/p4java/impl/generic/core/MapEntry.java @@ -5,7 +5,9 @@ import com.perforce.p4java.Log; import com.perforce.p4java.core.IMapEntry; +import org.apache.commons.lang3.StringUtils; +import java.util.Objects; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -220,34 +222,11 @@ public void setComment(String comment) { */ public String toString(String sepString, boolean quoteBlanks) { StringBuilder retVal = new StringBuilder(); - boolean quoteLeft = false; - boolean quoteRight = false; - - if (quoteBlanks) { - if (this.left != null && this.left.contains(" ")) { - quoteLeft = true; - } - if (this.right != null && this.right.contains(" ")) { - quoteRight = true; - } - } - if (quoteLeft) retVal.append("\""); - if (this.type != null && this.type != EntryType.INCLUDE) { - retVal.append(type); - } - if (this.left != null) { - retVal.append(left); - } - if (quoteLeft) retVal.append("\""); - - if ((sepString != null) && (this.right != null)) { + formatLeft(quoteBlanks, retVal); + if (StringUtils.isNotEmpty(sepString) && (this.right != null)) { retVal.append(sepString); } - if (this.right != null) { - if (quoteRight) retVal.append("\""); - retVal.append(this.right); - if (quoteRight) retVal.append("\""); - } + formatRight(quoteBlanks, retVal); if (this.comment != null) { retVal.append(" ## "); retVal.append(this.comment); @@ -255,6 +234,44 @@ public String toString(String sepString, boolean quoteBlanks) { return retVal.toString(); } + private void formatRight(boolean quoteBlanks, StringBuilder retVal) { + if (!Objects.isNull(this.right)) { + boolean shouldQuoteBlank = quoteBlanks && this.right.contains(" ") && !this.right.startsWith("\""); + if (shouldQuoteBlank) { + retVal.append("\""); + } + retVal.append(this.right); + if (shouldQuoteBlank) { + retVal.append("\""); + } + } + } + + private void formatLeft(boolean quoteBlanks, StringBuilder retVal) { + if (Objects.nonNull(this.left)) { + boolean shouldQuote = quoteBlanks && this.left.contains(" ") && !this.left.startsWith("\""); + if (shouldQuote) { + retVal.append("\""); + } + boolean shouldAppendType = this.type != null && this.type != EntryType.INCLUDE; + if (shouldAppendType) { + if (this.left.startsWith("\"")) { + retVal.append(this.left); + String startWith1 = "\"" + this.type; + retVal.replace(0, 1, startWith1); + } else { + retVal.append(type); + retVal.append(this.left); + } + } else { + retVal.append(this.left); + } + if (shouldQuote) { + retVal.append("\""); + } + } + } + /** * An alias for this.toString(" ", true). * @@ -320,7 +337,7 @@ public static String stripComments(String str) { * Attempt to parse a string to get left and right view mapping * elements out of it along with the optional EntryType spec * on any left view strings.

- * + *

* The incoming string format is described semi-formally as follows: *

 	 * [whitespace] leftentry [whitespace rightentry] [whitespace]
@@ -331,7 +348,7 @@ public static String stripComments(String str) {
 	 * it should be quoted with a double quote character; any left-entry entry
 	 * type character must be within the quotes if they exist. The quotes
 	 * are always stripped from the associated element before being returned.

- * + *

* The left string is returned as the first element of the returned * array; the right (if it exists) is the second. Either or both can * be null, but the array itself will never be null. The left string @@ -340,11 +357,11 @@ public static String stripComments(String str) { * the entry type character). * * @param rawStr if not null, string to be parsed; if null, this method returns - * an empty (but not null) array + * an empty (but not null) array * @return non-null two-element string array; element 0 contains the left - * element, element 1 contains the right. Either or both can be null, - * but except in pathological cases, it's unusual for the left to be - * null and the right to be non-null. + * element, element 1 contains the right. Either or both can be null, + * but except in pathological cases, it's unusual for the left to be + * null and the right to be non-null. */ public static String[] parseViewMappingString(String rawStr) { String[] retVal = new String[]{null, null}; diff --git a/src/main/java/com/perforce/p4java/impl/generic/core/file/ExtendedFileSpec.java b/src/main/java/com/perforce/p4java/impl/generic/core/file/ExtendedFileSpec.java index aa43fab..2526c16 100644 --- a/src/main/java/com/perforce/p4java/impl/generic/core/file/ExtendedFileSpec.java +++ b/src/main/java/com/perforce/p4java/impl/generic/core/file/ExtendedFileSpec.java @@ -10,6 +10,7 @@ import com.perforce.p4java.core.file.IExtendedFileSpec; import com.perforce.p4java.core.file.IResolveRecord; import com.perforce.p4java.server.IServer; +import org.apache.commons.lang3.math.NumberUtils; import java.util.ArrayList; import java.util.Date; @@ -550,7 +551,7 @@ public void setEntry(String tag, String value) { setFileSize(value == null ? 0 : Long.parseLong(value)); break; case HEADREV: - setHeadRev(value == null ? 0 : Integer.parseInt(value)); + setHeadRev(NumberUtils.isParsable(value) ? Integer.parseInt(value) : 0); break; case HEADTYPE: setHeadType(value); diff --git a/src/main/java/com/perforce/p4java/impl/mapbased/MapKeys.java b/src/main/java/com/perforce/p4java/impl/mapbased/MapKeys.java index e1d7e49..3a46b05 100644 --- a/src/main/java/com/perforce/p4java/impl/mapbased/MapKeys.java +++ b/src/main/java/com/perforce/p4java/impl/mapbased/MapKeys.java @@ -130,6 +130,7 @@ public class MapKeys { public static final String UTF16_LC_KEY = "utf16"; public static final String VALUE_KEY = "Value"; public static final String VIEW_KEY = "View"; + public static final String VIEW_COMMENT_KEY = "ViewComment"; public static final String PARENT_VIEW_KEY = "ParentView"; public static final String REPO_KEY = "Repo"; diff --git a/src/main/java/com/perforce/p4java/impl/mapbased/client/Client.java b/src/main/java/com/perforce/p4java/impl/mapbased/client/Client.java index b6d67c1..2bcea9a 100644 --- a/src/main/java/com/perforce/p4java/impl/mapbased/client/Client.java +++ b/src/main/java/com/perforce/p4java/impl/mapbased/client/Client.java @@ -24,6 +24,7 @@ import com.perforce.p4java.impl.generic.core.InputMapper; import com.perforce.p4java.impl.generic.core.ListData; import com.perforce.p4java.impl.generic.core.MapEntry; +import com.perforce.p4java.impl.mapbased.MapKeys; import com.perforce.p4java.impl.mapbased.client.cmd.WhereDelegator; import com.perforce.p4java.impl.mapbased.rpc.func.client.ClientHelper; import com.perforce.p4java.impl.mapbased.server.Parameters; @@ -59,6 +60,7 @@ import com.perforce.p4java.server.IOptionsServer; import com.perforce.p4java.server.IServer; import com.perforce.p4java.server.callback.IStreamingCallback; +import org.apache.commons.lang3.StringUtils; import java.io.File; import java.io.FileOutputStream; @@ -180,7 +182,7 @@ public static Client newClient(IOptionsServer server, String name, String descri ClientView clientView = new ClientView(); clientView.setClient(client); - List viewMappings = new ArrayList(); + List viewMappings = new ArrayList<>(); int i = 0; for (String mapping : paths) { if (mapping == null) { @@ -309,7 +311,7 @@ public Client(IServer serverImpl, Map map) { // the brute-force duplication of the original ClientSummary map parsing below. if (map != null) { - this.name = (String) map.get("Client"); + this.name = (String) map.get(MapKeys.CLIENT_KEY); // Try to retrieve the view map; it comes to us as a series of // map entries starting with "View" and followed by a number, e.g. "View9". @@ -321,24 +323,27 @@ public Client(IServer serverImpl, Map map) { ArrayList mappingList = new ArrayList(); viewImpl.setEntryList(mappingList); this.clientView = viewImpl; - String pfx = "View"; + String pfx = MapKeys.VIEW_KEY; + String commentPfx = MapKeys.VIEW_COMMENT_KEY; - for (int i = 0; map.containsKey(pfx + i); i++) { + for (int i = 0; map.containsKey(pfx + i) || map.containsKey(commentPfx + i); i++) { String key = pfx + i; - + String commentKey = commentPfx + i; String[] parts = MapEntry.parseViewMappingString((String) map.get(key)); - if (parts.length < 2) { - throw new P4JavaError("bad client view mapping string in Client constructor: " + (String) map.get(key)); + String comment = MapEntry.parseComments((String) map.get(commentKey)); + if (parts.length < 2 && StringUtils.isEmpty(comment)) { + throw new P4JavaError("bad client view mapping string in Client constructor: " + map.get(key)); } - - mappingList.add(new ClientView.ClientViewMapping(i, parts[0], parts[1])); + ClientView.ClientViewMapping mapping = new ClientView.ClientViewMapping(i, parts[0], parts[1]); + mapping.setComment(comment); + mappingList.add(mapping); } // Add change view entries to list if found. ArrayList changeViewImpl = new ArrayList<>(); - pfx = "ChangeView"; + pfx = MapKeys.CHANGE_VIEW_KEY; for (int i = 0; map.containsKey(pfx + i); i++) { String key = pfx + i; @@ -359,22 +364,22 @@ public Client(IServer serverImpl, Map map) { // says that descriptions can't start or end with whitespace -- so we kludge up // the following to get rid of just the trailing newline if it's there -- HR. - this.description = (String) map.get("Description"); + this.description = (String) map.get(MapKeys.DESCRIPTION_KEY); if ((this.description != null) && (this.description.length() > 1) && this.description.endsWith("\n")) { this.description = this.description.substring(0, this.description.length() - 1); } try { // Different format here to what's in ClientSummary. - if (map.get("Access") != null) { - this.accessed = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").parse((String) map.get("Access")); + if (map.get(MapKeys.ACCESS_KEY) != null) { + this.accessed = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").parse((String) map.get(MapKeys.ACCESS_KEY)); } } catch (Exception exc) { Log.error("Access date parse error in Client constructor " + exc.getLocalizedMessage()); Log.exception(exc); } try { - if (map.get("Update") != null) { - this.updated = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").parse((String) map.get("Update")); + if (map.get(MapKeys.UPDATE_KEY) != null) { + this.updated = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").parse((String) map.get(MapKeys.UPDATE_KEY)); } } catch (Exception exc) { Log.error("Update date parse error in Client constructor " + exc.getLocalizedMessage()); @@ -605,7 +610,7 @@ public List sync(List fileSpecs, boolean forceUpdate, bool */ @Override public List sync(List fileSpecs, SyncOptions syncOpts) throws P4JavaException { - List specList = new ArrayList(); + List specList = new ArrayList<>(); if ((this.serverImpl.getCurrentClient() == null) || !this.serverImpl.getCurrentClient().getName().equalsIgnoreCase(this.getName())) { throw new RequestException("Attempted to sync a client that is not the server's current client"); @@ -627,7 +632,7 @@ public List sync(List fileSpecs, SyncOptions syncOpts) thr */ @Override public List syncParallel(List fileSpecs, SyncOptions syncOpts, ParallelSyncOptions pSyncOpts) throws P4JavaException { - List specList = new ArrayList(); + List specList = new ArrayList<>(); if ((this.serverImpl.getCurrentClient() == null) || !this.serverImpl.getCurrentClient().getName().equalsIgnoreCase(this.getName())) { throw new RequestException("Attempted to sync a client that is not the server's current client"); diff --git a/src/main/java/com/perforce/p4java/impl/mapbased/rpc/RpcServer.java b/src/main/java/com/perforce/p4java/impl/mapbased/rpc/RpcServer.java index 54d0c7d..bd13a2d 100644 --- a/src/main/java/com/perforce/p4java/impl/mapbased/rpc/RpcServer.java +++ b/src/main/java/com/perforce/p4java/impl/mapbased/rpc/RpcServer.java @@ -133,7 +133,7 @@ public abstract class RpcServer extends Server { * default for most commands; some commands dynamically bump up the level * for the command's duration. */ - public static final int DEFAULT_CLIENT_API_LEVEL = 92; // 2022.1 + public static final int DEFAULT_CLIENT_API_LEVEL = 96; // 2024.1 // p4/msgs/p4tagl.cc // p4/client/client.cc