Conform to style
@@ -203,19 +203,9 @@ public class JobController {
* Accepts and stores a new application package and test jar pair under a generated application version key.
*/
public ApplicationVersion submit(ApplicationId id, SourceRevision revision,
- byte[] applicationPackage, byte[] applicationTestPackage) {
+ byte[] packageBytes, byte[] testPackageBytes) {
AtomicReference<ApplicationVersion> version = new AtomicReference<>();
controller.applications().lockOrThrow(id, application -> {
- long run = nextBuild(id);
- version.set(ApplicationVersion.from(revision, run));
-
- controller.applications().applicationStore().putApplicationPackage(id,
- version.get().id(),
- applicationPackage);
- controller.applications().applicationStore().putTesterPackage(testerOf(id),
- version.get().id(),
- applicationTestPackage);
-
if ( ! application.get().deploymentJobs().builtInternally()) {
// Copy all current packages to the new application store
application.get().deployments().values().stream()
@@ -227,7 +217,17 @@ public class JobController {
});
}
- controller.applications().storeWithUpdatedConfig(application.withBuiltInternally(true), new ApplicationPackage(applicationPackage));
+ long run = nextBuild(id);
+ version.set(ApplicationVersion.from(revision, run));
+
+ controller.applications().applicationStore().putApplicationPackage(id,
+ version.get().id(),
+ packageBytes);
+ controller.applications().applicationStore().putTesterPackage(testerOf(id),
+ version.get().id(),
+ testPackageBytes);
+
+ controller.applications().storeWithUpdatedConfig(application.withBuiltInternally(true), new ApplicationPackage(packageBytes));
notifyOfNewSubmission(id, revision, run);
});
