Github user jburwell commented on a diff in the pull request:
https://github.com/apache/cloudstack/pull/1804#discussion_r90476049
--- Diff: server/src/com/cloud/configuration/ConfigurationManagerImpl.java
---
@@ -3092,8 +3092,12 @@ public Vlan createVlanAndPublicIpRange(final long
zoneId, final long networkId,
final String guestNetworkCidr = zone.getGuestNetworkCidr();
if (guestNetworkCidr != null) {
if (NetUtils.isNetworksOverlap(newCidr, guestNetworkCidr))
{
- throw new InvalidParameterValueException("The new IP
range you have specified has overlapped with the guest network in zone: " +
zone.getName()
- + ". Please specify a different
gateway/netmask.");
+ // when adding shared network with same cidr of zone
guest cidr,
+ // if the specified vlan is not present in zone,
physical network, allow to create the network as the isolation is based on VLAN.
+ if (_zoneDao.findVnet(zoneId, physicalNetworkId,
vlanId).size() > 0) {
--- End diff --
Please consider using `isEmpty` rather than a size check to determine
whether or not a list contains elements. It is more idiomatic/clear, but less
error prone. Also, why isn't this `if` condition combined with the previous
`if` block and an `&&` operator.

---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---