mirror of
https://github.com/1C-Company/v8-code-style.git
synced 2025-04-13 20:50:35 +02:00
Исправления по код-ревью #1077
This commit is contained in:
parent
2232919a08
commit
10945e9811
@ -60,7 +60,7 @@ public class InternalRightInfosService
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the rights of some {@link EClass} of configuration metadata object that may has some rights.
|
||||
* Gets the rights of some {@link EClass} of configuration metadata object that may have some rights.
|
||||
*
|
||||
* @param eClass the {@link EClass} of configuration metadata object that has some rights, cannot be {@code null}.
|
||||
* @param context the context object of the configuration to determine platform version, cannot be {@code null}.
|
||||
|
@ -26,9 +26,9 @@ import static com._1c.g5.v8.dt.rights.model.RightsPackage.Literals.ROLE_DESCRIPT
|
||||
import java.text.MessageFormat;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@ -251,7 +251,7 @@ public abstract class RoleRightSetCheck
|
||||
}
|
||||
else
|
||||
{
|
||||
// add marker as closer as possible to the probleb place in the model
|
||||
// add marker as closer as possible to the problem place in the model
|
||||
resultAceptor.addIssue(message, objectRights, OBJECT_RIGHTS__OBJECT);
|
||||
}
|
||||
}
|
||||
@ -337,8 +337,6 @@ public abstract class RoleRightSetCheck
|
||||
|
||||
private Collection<MdObject> getDefaultObjectsWithRight(RoleDescription description, IProgressMonitor monitor)
|
||||
{
|
||||
Collection<MdObject> result = new LinkedList<>();
|
||||
|
||||
IProject project = resourceLookup.getProject(description);
|
||||
|
||||
Set<Long> objectIdForRole = getRoleTopObjects(project, description, monitor);
|
||||
@ -347,6 +345,9 @@ public abstract class RoleRightSetCheck
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
// return only unique objects
|
||||
Map<Long, MdObject> result = new HashMap<>();
|
||||
|
||||
IBmEmfIndexProvider bmEmfIndexProvider = bmEmfIndexManager.getEmfIndexProvider(project);
|
||||
RightsModelUtil.SUPPORTED_RIGHT_ECLASSES.stream().forEach(eClass -> {
|
||||
|
||||
@ -371,12 +372,12 @@ public abstract class RoleRightSetCheck
|
||||
|
||||
if (!objectIdForRole.contains(bmObjectId))
|
||||
{
|
||||
result.add((MdObject)object);
|
||||
result.put(bmObjectId, (MdObject)object);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
return result;
|
||||
return result.values();
|
||||
}
|
||||
|
||||
private Set<Long> getRoleTopObjects(IProject project, RoleDescription description, IProgressMonitor monitor)
|
||||
|
Loading…
x
Reference in New Issue
Block a user