Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
katkav committed Apr 9, 2018
2 parents 8ee586f + 2ce6acd commit 5679841
Show file tree
Hide file tree
Showing 40 changed files with 114 additions and 103 deletions.
Expand Up @@ -256,7 +256,7 @@ protected void onUpdate(AjaxRequestTarget target) {
}
}

private class PasswordModel implements IModel<String> {
private static class PasswordModel implements IModel<String> {

IModel<ProtectedStringType> psModel;

Expand Down
Expand Up @@ -71,11 +71,11 @@ private void appendOptions(StringBuilder sb) {
}

sb.append('{');
Iterator<String> keys = map.keySet().iterator();
Iterator<Map.Entry<String, String>> keys = map.entrySet().iterator();
while (keys.hasNext()) {
String key = keys.next();
sb.append(key).append(":");
sb.append('\'').append(map.get(key)).append('\'');
final Map.Entry<String, String> key = keys.next();
sb.append(key.getKey()).append(":");
sb.append('\'').append(key.getValue()).append('\'');
if (keys.hasNext()) {
sb.append(",\n");
}
Expand Down
Expand Up @@ -35,7 +35,7 @@ public String getDuplicatesList() {
return sb.toString();
}

private class ObjectTypeRecord {
private static class ObjectTypeRecord {

@NotNull public final ShadowKindType kind;
@NotNull public final String intent;
Expand Down
Expand Up @@ -131,7 +131,7 @@ static Severity fromModel(@NotNull com.evolveum.midpoint.model.api.validator.Iss
}
}

public class Issue implements Serializable {
public static class Issue implements Serializable {
@NotNull private final Severity severity;
@NotNull private final String text;
@Nullable private final Class<? extends WizardStep> relatedStep;
Expand Down
Expand Up @@ -201,7 +201,7 @@ public String getObject() {
}


private class NoOffsetPrismReferencePanel extends PrismPropertyPanel<ReferenceWrapper> {
private static class NoOffsetPrismReferencePanel extends PrismPropertyPanel<ReferenceWrapper> {
public NoOffsetPrismReferencePanel(String id, IModel<ReferenceWrapper> propertyModel, Form form, PageBase pageBase) {
super(id, propertyModel, form, null, pageBase);
}
Expand Down
Expand Up @@ -64,7 +64,7 @@ public class SystemConfigurationDto implements Serializable {
public static final String F_ADMIN_GUI_CONFIGURATION = "adminGuiConfiguration";
private AEPlevel aepLevel;

private class CleanupInfo implements Serializable {
private static class CleanupInfo implements Serializable {
String ageValue;
Integer records;

Expand Down
Expand Up @@ -587,7 +587,7 @@ public Component getComponent() {
return this;
}

class LookupReportPropertyModel extends LookupPropertyModel<String> {
static class LookupReportPropertyModel extends LookupPropertyModel<String> {

private static final long serialVersionUID = 1L;

Expand Down
Expand Up @@ -160,7 +160,7 @@ public void initResultsPanel(RepeatingView resultView, List<OpResult> opresults,
}
}

private class ConnectorStruct implements Serializable {
private static class ConnectorStruct implements Serializable {
private String connectorName;
private List<OpResult> connectorResultsDto;
}
Expand Down
Expand Up @@ -232,7 +232,7 @@ protected boolean isGovernance(){
return true;
}

class RoleRelationSelectionDto implements Serializable {
static class RoleRelationSelectionDto implements Serializable {

private static final long serialVersionUID = 1L;
private boolean approver;
Expand Down
Expand Up @@ -357,18 +357,18 @@ private static List<LocaleDescriptor> loadLocaleDescriptors(Resource resource) t
map.put(key, properties.getProperty(key));
}

for (String key : localeMap.keySet()) {
Map<String, String> localeDefinition = localeMap.get(key);
if (!localeDefinition.containsKey(key + PROP_NAME)
|| !localeDefinition.containsKey(key + PROP_FLAG)) {
for (Map.Entry<String, Map<String, String>> entry : localeMap.entrySet()) {
Map<String, String> localeDefinition = entry.getValue();
if (!localeDefinition.containsKey(entry + PROP_NAME)
|| !localeDefinition.containsKey(entry + PROP_FLAG)) {
continue;
}

LocaleDescriptor descriptor = new LocaleDescriptor(
localeDefinition.get(key + PROP_NAME),
localeDefinition.get(key + PROP_FLAG),
localeDefinition.get(key + PROP_DEFAULT),
WebComponentUtil.getLocaleFromString(key)
localeDefinition.get(entry + PROP_NAME),
localeDefinition.get(entry + PROP_FLAG),
localeDefinition.get(entry + PROP_DEFAULT),
WebComponentUtil.getLocaleFromString(entry.getKey())
);
locales.add(descriptor);
}
Expand Down
Expand Up @@ -105,7 +105,7 @@ private List<RootXNode> readInternal(@NotNull ParserSource source, @NotNull Pars
}
}

private class IterativeParsingContext {
private static class IterativeParsingContext {
final RootXNodeHandler handler;
boolean dataSent; // true if we really found the list of objects and sent it out
String defaultNamespace; // default namespace, if present
Expand Down Expand Up @@ -621,7 +621,7 @@ private JsonParser configureParser(JsonParser parser) {

//region Serialization implementation

class JsonSerializationContext {
static class JsonSerializationContext {
@NotNull final JsonGenerator generator;
@NotNull private final SerializationContext prismSerializationContext;
private String currentNamespace;
Expand Down
Expand Up @@ -543,17 +543,18 @@ public ItemPathHolder transposedPath(List<PathHolderSegment> parentPath) {

private void addExplicitNsDeclarations(StringBuilder sb) {
if (explicitNamespaceDeclarations != null) {
for (String prefix : explicitNamespaceDeclarations.keySet()) {
for (Map.Entry<String, String> prefix : explicitNamespaceDeclarations.entrySet()) {
sb.append("declare ");
final String declaration = explicitNamespaceDeclarations.get(prefix);
if (prefix.equals("")) {
sb.append("default namespace '");
sb.append(explicitNamespaceDeclarations.get(prefix));
sb.append(declaration);
sb.append("'; ");
} else {
sb.append("namespace ");
sb.append(prefix);
sb.append("='");
sb.append(explicitNamespaceDeclarations.get(prefix));
sb.append(declaration);
sb.append("'; ");
}
}
Expand Down
Expand Up @@ -401,7 +401,7 @@ public CompareResult compareComplexOld(ItemPath otherPath) {
/**
* Alternative to normalization: reads the same sequence of segments of 'path' as segments of 'path.normalize()'
*/
private class ItemPathNormalizingIterator implements Iterator<ItemPathSegment> {
private static class ItemPathNormalizingIterator implements Iterator<ItemPathSegment> {
final ItemPath path;
private int i = 0;
private boolean nextIsArtificialId = false;
Expand Down
Expand Up @@ -166,7 +166,7 @@ public InputSource resolveResourceUsingBuiltinResolver(String type, String names
return inputSource;
}

class Input implements LSInput {
static class Input implements LSInput {

private String publicId;
private String systemId;
Expand Down
Expand Up @@ -152,13 +152,13 @@ public static QName determineQNameWithNs(QName xsdType){
public static <T> Class<T> getXsdToJavaMapping(QName xsdType) {
Class clazz = xsdToJavaTypeMap.get(xsdType);
if (clazz == null){
Set<QName> keys = xsdToJavaTypeMap.keySet();
for (Iterator<QName> iterator = keys.iterator(); iterator.hasNext();){
QName key = iterator.next();
if (QNameUtil.match(key, xsdType)){
return xsdToJavaTypeMap.get(key);
}
}
Set<Map.Entry<QName, Class>> entries = xsdToJavaTypeMap.entrySet();
for (Map.Entry<QName, Class> entry : entries) {
QName key = entry.getKey();
if (QNameUtil.match(key, xsdType)){
return entry.getValue();
}
}
}
return xsdToJavaTypeMap.get(xsdType);
}
Expand Down
Expand Up @@ -395,7 +395,7 @@ public RootXNode getSingleEntryMapAsRoot() {
return new RootXNode(key, get(key));
}

private class Entry implements Map.Entry<QName, XNode>, Serializable {
private static class Entry implements Map.Entry<QName, XNode>, Serializable {

private QName key;
private XNode value;
Expand Down
Expand Up @@ -268,10 +268,10 @@ private synchronized void updateOverallStatistics(Map<String, MethodUsageStatist
}

private static void printMap(Map<String, MethodUsageStatistics> logMap, Subsystem subsystem, boolean afterTest){

for(String key: logMap.keySet()){
if(logMap.get(key) != null && subsystem.equals(logMap.get(key).getSubsystem())){
logMap.get(key).appendToLogger(afterTest);
for (Map.Entry<String, MethodUsageStatistics> usage : logMap.entrySet()){
final MethodUsageStatistics value = usage.getValue();
if(subsystem.equals(value.getSubsystem())){
value.appendToLogger(afterTest);
}
}
}
Expand Down
Expand Up @@ -277,7 +277,7 @@ public void launch(AccessCertificationCampaignType campaign, OperationResult par
LOGGER.trace("Closing task for {} switched to background, control thread returning with task {}", toShortString(campaign), task);
}

private class ObjectContext {
private static class ObjectContext {
@NotNull final ObjectType object;
@NotNull final List<ItemDelta<?, ?>> modifications = new ArrayList<>();

Expand All @@ -286,7 +286,7 @@ private class ObjectContext {
}
}

private class RunContext {
private static class RunContext {
final Task task;
final Map<String, ObjectContext> objectContextMap = new HashMap<>();
final PerformerCommentsFormatter commentsFormatter;
Expand Down
Expand Up @@ -554,9 +554,10 @@ private String generateAttempt(ValuePolicyType policy, int defaultLength, boolea
* first in password
*/
Map<StringLimitType, List<String>> mustBeFirst = new HashMap<>();
for (StringLimitType l : lims.keySet()) {
if (l.isMustBeFirst() != null && l.isMustBeFirst()) {
mustBeFirst.put(l, lims.get(l));
for (Map.Entry<StringLimitType, List<String>> entry : lims.entrySet()) {
final StringLimitType key = entry.getKey();
if (key.isMustBeFirst() != null && key.isMustBeFirst()) {
mustBeFirst.put(key, entry.getValue());
}
}

Expand Down Expand Up @@ -771,26 +772,28 @@ private Map<Integer, List<String>> cardinalityCounter(Map<StringLimitType, List<
List<String> password, Boolean skipMatchedLims, boolean uniquenessReached, OperationResult op) {
HashMap<String, Integer> counter = new HashMap<>();

for (StringLimitType l : lims.keySet()) {
Map<StringLimitType, List<String>> mustBeFirst = new HashMap<>();
for (Map.Entry<StringLimitType, List<String>> entry : lims.entrySet()) {
final StringLimitType key = entry.getKey();
int counterKey = 1;
List<String> chars = lims.get(l);
List<String> chars = entry.getValue();
int i = 0;
if (null != password) {
i = charIntersectionCounter(lims.get(l), password);
i = charIntersectionCounter(entry.getValue(), password);
}
// If max is exceed then error unable to continue
if (l.getMaxOccurs() != null && i > l.getMaxOccurs()) {
OperationResult o = new OperationResult("Limitation check :" + l.getDescription());
if (key.getMaxOccurs() != null && i > key.getMaxOccurs()) {
OperationResult o = new OperationResult("Limitation check :" + key.getDescription());
o.recordFatalError(
"Exceeded maximal value for this limitation. " + i + ">" + l.getMaxOccurs());
"Exceeded maximal value for this limitation. " + i + ">" + key.getMaxOccurs());
op.addSubresult(o);
return null;
// if max is all ready reached or skip enabled for minimal skip
// counting
} else if (l.getMaxOccurs() != null && i == l.getMaxOccurs()) {
} else if (key.getMaxOccurs() != null && i == key.getMaxOccurs()) {
continue;
// other cases minimum is not reached
} else if ((l.getMinOccurs() == null || i >= l.getMinOccurs()) && !skipMatchedLims) {
} else if ((key.getMinOccurs() == null || i >= key.getMinOccurs()) && !skipMatchedLims) {
continue;
}
for (String s : chars) {
Expand All @@ -803,9 +806,9 @@ private Map<Integer, List<String>> cardinalityCounter(Map<StringLimitType, List<
}
}
counterKey++;

}


// If need to remove disabled chars (already reached limitations)
if (null != password) {
for (StringLimitType l : lims.keySet()) {
Expand Down
Expand Up @@ -56,8 +56,8 @@ public class ProfilingModelInspector implements DiagnosticContext, ClockworkInsp
private ModelContext lastLensContext;
private ModelState currentState = null;
private long totalRepoTime = 0;
class Runtimes {

static class Runtimes {
long startTime = 0;
long finishTime = 0;

Expand All @@ -70,7 +70,7 @@ String etimeStr() {
}
}

class PartRuntime {
static class PartRuntime {

public PartRuntime(String part) {
super();
Expand Down
Expand Up @@ -68,7 +68,7 @@ public void init() {
}

// TODO clean this up
private class EvaluationContext {
private static class EvaluationContext {
private final List<LocalizableMessage> messages = new ArrayList<>();
private final List<EvaluatedPolicyRuleType> rules = new ArrayList<>();
}
Expand Down
Expand Up @@ -616,7 +616,7 @@ private boolean wasExecuted(LensProjectionContext accountContext){
return true;
}

class DependencyAndSource {
static class DependencyAndSource {
ResourceObjectTypeDependencyType dependency;
LensProjectionContext sourceProjectionContext;
}
Expand Down
Expand Up @@ -129,7 +129,7 @@ private ComputationResult compute(@NotNull List<EvaluatedPolicyRule> rulesToReco
return cr;
}

private class ComputationResult {
private static class ComputationResult {
final Set<String> oldPolicySituations = new HashSet<>();
final Set<String> newPolicySituations = new HashSet<>();
final Set<EvaluatedPolicyRuleType> oldTriggeredRules = new HashSet<>();
Expand Down
Expand Up @@ -85,7 +85,7 @@ public class ResourceValidatorImpl implements ResourceValidator {
@Autowired
private PrismContext prismContext;

private class ResourceValidationContext {
private static class ResourceValidationContext {
@NotNull final PrismObject<ResourceType> resourceObject;
@NotNull final ObjectReferenceType resourceRef;
@NotNull final Scope scope;
Expand Down
Expand Up @@ -177,7 +177,7 @@ public void send(Message mailMessage, String transportName, Event event, Task ta
LOGGER.debug("Using mail properties: ");
for (Object key : properties.keySet()) {
if (key instanceof String && ((String) key).startsWith("mail.")) {
LOGGER.debug(" - " + key + " = " + properties.get(key));
LOGGER.debug(" - {} = {}", key, properties.get(key));
}
}
}
Expand Down
Expand Up @@ -119,7 +119,7 @@ public void onTaskDelete(Task task, OperationResult result) {
}
}

class Statistics {
static class Statistics {
int processes = 0;
int processesWithNonExistingTaskOid = 0;
int processesWithNonWorkflowTaskOid = 0;
Expand Down
Expand Up @@ -249,7 +249,7 @@ public List<ObjectReferenceType> getMidpointAssignees(TaskExtract taskExtract) {
/**
* Helper class to carry relevant data from both Task and DelegateTask (to avoid code duplication)
*/
private class TaskExtract {
private static class TaskExtract {

private String id;
private String assignee;
Expand Down
Expand Up @@ -108,7 +108,7 @@ public ExpressionVariables getDefaultVariables(WfContextType wfContext, String r
}

// TODO name
public class ComputationResult {
public static class ComputationResult {
private ApprovalLevelOutcomeType predeterminedOutcome;
private AutomatedCompletionReasonType automatedCompletionReason;
private Set<ObjectReferenceType> approverRefs;
Expand Down
Expand Up @@ -31,7 +31,7 @@
*/
public class PolicyRuleApplication {

class Cause {
static class Cause {
private final ResourceShadowDiscriminator shadowDiscriminator; // non-null for projection context
@NotNull private final ItemPath itemPath; // should be non-empty
@NotNull private final PrismValue itemValue;
Expand Down

0 comments on commit 5679841

Please sign in to comment.