Skip to content

Commit 89132fb

Browse files
committed
2024.1 Code Drop
1 parent 52c86b8 commit 89132fb

File tree

11 files changed

+199
-156
lines changed

11 files changed

+199
-156
lines changed

RELEASE.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Release Notes for
22
P4Java, the Perforce Java API
33

4-
Version 2023.2
4+
Version 2024.1
55

66
Introduction
77

@@ -22,7 +22,7 @@ Requirements
2222

2323
* Perforce server at Release 2015.1 or higher.
2424

25-
* Java: full standard JDK 8 or later. Implementation as
25+
* Java: full standard JDK 11 or later. Implementation as
2626
discussed in "Known Limitations" below.
2727

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

126126

127+
-------------------------------------------
128+
Updates in 2024.1 (2024.1/2612262) (2024/06/12)
129+
130+
#2608430 (Job #120559)
131+
Added support for comments in the view mapping of Client, Branch, and Label Spec.
132+
133+
#2604468 (Job #120573)
134+
Upgraded P4Java to use Java 11.
135+
136+
#2597460 (Job #119320)
137+
Fixed a bug where the "Server.getExtendedFile(..)" throws NumberFormatException
138+
when headRev is #none
139+
140+
#2597531 (Job #112324)
141+
Fixed inconsistent handling of quotes in ViewMap for Label.
142+
127143
-------------------------------------------
128144
Updates in 2023.2 Patch 1 (2023.2/2581742) (2024/04/05)
129145

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ plugins {
77
group = 'com.perforce'
88
version = project.hasProperty('ver') ? project.ext.ver : 'PREP-TEST_ONLY'
99

10-
sourceCompatibility = 1.8
11-
targetCompatibility = 1.8
10+
sourceCompatibility = 11
11+
targetCompatibility = 11
1212

1313
repositories {
1414
maven { url "https://repo.maven.apache.org/maven2" }
@@ -26,8 +26,8 @@ dependencies {
2626
testImplementation 'org.slf4j:slf4j-simple:1.7.36'
2727
testImplementation 'org.apache.commons:commons-exec:1.3'
2828
testImplementation 'org.apache.commons:commons-compress:1.21'
29-
testImplementation 'junit:junit:4.12'
30-
testImplementation 'org.mockito:mockito-core:2.7.12'
29+
testImplementation 'junit:junit:4.13.1'
30+
testImplementation 'org.mockito:mockito-core:4.0.0'
3131
testImplementation 'com.googlecode.java-diff-utils:diffutils:1.3.0'
3232
}
3333

gradlew.bat

Lines changed: 84 additions & 84 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/com/perforce/p4java/impl/generic/core/BranchSpec.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,19 +188,21 @@ public BranchSpec(Map<String, Object> map, IServer server) {
188188
super(map, false);
189189

190190
this.server = server;
191-
this.branchView = new ViewMap<IBranchMapping>();
191+
this.branchView = new ViewMap<>();
192192

193193
if (map != null) {
194194
String key = MapKeys.VIEW_KEY;
195+
String commentKey = MapKeys.VIEW_COMMENT_KEY;
195196
for (int i = 0; ; i++) {
196-
if (!map.containsKey(key + i)) {
197+
if (!map.containsKey(key + i) && !map.containsKey(commentKey + i)) {
197198
break;
198-
} else if (map.get(key + i) != null) {
199+
} else if (map.get(key + i) != null || map.get(commentKey + i) != null) {
199200
try {
200201
String[] matchStrs = MapEntry.parseViewMappingString((String) map.get(key + i));
201-
202-
this.branchView.getEntryList().add(new BranchViewMapping(i, matchStrs[0], matchStrs[1]));
203-
202+
String comment = MapEntry.parseComments((String) map.get(commentKey + i));
203+
BranchViewMapping mapping = new BranchViewMapping(i, matchStrs[0], matchStrs[1]);
204+
mapping.setComment(comment);
205+
this.branchView.getEntryList().add(mapping);
204206
} catch (Throwable thr) {
205207
Log.error("Unexpected exception in BranchSpec map-based constructor: "
206208
+ thr.getLocalizedMessage());

src/main/java/com/perforce/p4java/impl/generic/core/InputMapper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public static Map<String, Object> map(IClient client) {
183183
}
184184
IClientOptions opts = client.getOptions();
185185
IClientSubmitOptions subOpts = client.getSubmitOptions();
186-
ClientView view = client.getClientView();
186+
187187

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

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

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

232+
ClientView view = client.getClientView();
232233
if ((view != null) && (view.getEntryList() != null)) {
233234
List<IClientViewMapping> viewList = view.getEntryList();
234-
235235
for (IClientViewMapping mapping : viewList) {
236236
clientMap.put(MapKeys.VIEW_KEY + mapping.getOrder(), mapping.toString(" ", true));
237237
}

src/main/java/com/perforce/p4java/impl/generic/core/Label.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,17 +234,18 @@ public Label(Map<String, Object> map, IServer server) {
234234

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

237-
this.viewMapping = new ViewMap<ILabelMapping>();
237+
this.viewMapping = new ViewMap<>();
238238

239239
for (int i = 0; ; i++) {
240-
String mappingStr = (String) map.get(MapKeys.VIEW_KEY
241-
+ i);
242-
243-
if (mappingStr == null) {
240+
String mappingStr = (String) map.get(MapKeys.VIEW_KEY + i);
241+
String commentStr = (String) map.get(MapKeys.VIEW_COMMENT_KEY + i);
242+
if (mappingStr == null && commentStr == null) {
244243
break;
245244
} else {
246245
String[] parts = MapEntry.parseViewMappingString(mappingStr);
247-
this.viewMapping.getEntryList().add(new LabelMapping(i, parts[0]));
246+
LabelMapping mapping = new LabelMapping(i, parts[0]);
247+
mapping.setComment(MapEntry.parseComments(commentStr));
248+
this.viewMapping.getEntryList().add(mapping);
248249
}
249250
}
250251

0 commit comments

Comments
 (0)