rm com.google.guava from main bundles#1189
Conversation
- Lists.newArrayList(), Maps.newHashMap(), Sets.newHashSet() → JDK constructors - Strings.isNullOrEmpty(s) → (s == null || s.isEmpty()) - Joiner.on(s).join(c) → c.stream()...Collectors.joining(...) - Guava Predicate/Function/Optional → java.util.function.* / java.util.Optional - DoubleMath.fuzzyEquals/fuzzyCompare → public static helpers added to CompareFuzzy - ImmutableMap.of, ImmutableSet.of → Map.of / Set.of - Multimap/HashMultimap/ArrayListMultimap/LinkedHashMultimap/ListMultimap → Map<K, List<V>> / Map<K, Set<V>> with computeIfAbsent - Table/ArrayTable → nested Map<R, Map<C, V>> (using EnumMap for enum keys) - Range.closed(a, b) → plain int constants - Iterables.concat/filter/size/stream and Lists.reverse → centralized helpers in LGraphUtil Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
There was a problem hiding this comment.
Is there a source for the added function, i.e. are they copied from com.google.common?
| @@ -86,14 +86,13 @@ public void restorePorts(final SelfLoopHolder slHolder, final IElkProgressMonito | |||
| * of port side and port side area in {@link #targetAreas}. | |||
| */ | |||
| private void initTargetAreas() { | |||
| // An array table is more efficient than other tables, but requires all row and column keys to be specified in | |||
| // advance | |||
| targetAreas = ArrayTable.create(Arrays.asList(PortSide.values()), Arrays.asList(PortSideArea.values())); | |||
|
|
|||
| targetAreas = new EnumMap<>(PortSide.class); | |||
| for (PortSide side : PortSide.values()) { | |||
| Map<PortSideArea, List<SelfLoopPort>> areaMap = new EnumMap<>(PortSideArea.class); | |||
| for (PortSideArea area : PortSideArea.values()) { | |||
| targetAreas.put(side, area, new ArrayList<>()); | |||
| areaMap.put(area, new ArrayList<>()); | |||
| } | |||
| targetAreas.put(side, areaMap); | |||
There was a problem hiding this comment.
This seems to be a semantic change?
| public static final IProperty<Map<LEdge, Set<CrossHierarchyEdge>>> CROSS_HIERARCHY_MAP = | ||
| new Property<Map<LEdge, Set<CrossHierarchyEdge>>>("crossHierarchyMap"); |
There was a problem hiding this comment.
Map and Set might mess with the iteration order.
Maybe this was also problematic using MultiMap?
We might need an Xtext upgrade.
Something changes the port ordering. I am not sure, which implementation is better, as the p_0, p_1 and p_2 ordering looks better in terms of model order. The errors are harder to track down but something seems to be missing here.
Maybe some default value thing? |
|
will look at this PR next week again |
Signed-off-by: Stefan Bischof <stbischof@bipolis.org>
#1190