-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix the exception occurred when publish/rollback namespaces with gray…
… release
- Loading branch information
Showing
2 changed files
with
14 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,6 +39,15 @@ | |
import com.google.common.collect.Sets; | ||
import com.google.gson.Gson; | ||
import com.google.gson.reflect.TypeToken; | ||
import java.lang.reflect.Type; | ||
import java.util.Collection; | ||
import java.util.Collections; | ||
import java.util.Date; | ||
import java.util.LinkedHashMap; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
import java.util.Set; | ||
import org.apache.commons.lang.time.FastDateFormat; | ||
import org.springframework.data.domain.Page; | ||
import org.springframework.data.domain.PageRequest; | ||
|
@@ -47,9 +56,6 @@ | |
import org.springframework.transaction.annotation.Transactional; | ||
import org.springframework.util.CollectionUtils; | ||
|
||
import java.lang.reflect.Type; | ||
import java.util.*; | ||
|
||
/** | ||
* @author Jason Song([email protected]) | ||
*/ | ||
|
@@ -62,7 +68,7 @@ public class ReleaseService { | |
.newHashSet(ReleaseOperation.GRAY_RELEASE, ReleaseOperation.MASTER_NORMAL_RELEASE_MERGE_TO_GRAY, | ||
ReleaseOperation.MATER_ROLLBACK_MERGE_TO_GRAY); | ||
private static final Pageable FIRST_ITEM = PageRequest.of(0, 1); | ||
private static final Type OPERATION_CONTEXT_TYPE_REFERENCE = new TypeToken<Map<String, Collection<String>>>() { }.getType(); | ||
private static final Type OPERATION_CONTEXT_TYPE_REFERENCE = new TypeToken<Map<String, Object>>() { }.getType(); | ||
|
||
private final ReleaseRepository releaseRepository; | ||
private final ItemService itemService; | ||
|
@@ -329,14 +335,14 @@ private Collection<String> getBranchReleaseKeys(long releaseId) { | |
return null; | ||
} | ||
|
||
Map<String, Collection<String>> operationContext = GSON | ||
.fromJson(operationContextJson, OPERATION_CONTEXT_TYPE_REFERENCE); | ||
Map<String, Object> operationContext = GSON.fromJson(operationContextJson, | ||
OPERATION_CONTEXT_TYPE_REFERENCE); | ||
|
||
if (operationContext == null) { | ||
return null; | ||
} | ||
|
||
return operationContext.get(ReleaseOperationContext.BRANCH_RELEASE_KEYS); | ||
return (Collection<String>) operationContext.get(ReleaseOperationContext.BRANCH_RELEASE_KEYS); | ||
} | ||
|
||
private Release publishBranchNamespace(Namespace parentNamespace, Namespace childNamespace, | ||
|