Hi Andy It changes default behavior which was mainly make port unpredictable. Now it is almost always the same in dev which is bad IMO dince it allows to hardcode the port and have regular green builds locally but not on jenkins.
Other point: min should be 1025 cause IIRC 1024 is reserved as well. Le 1 déc. 2014 23:06, <[email protected]> a écrit : > Repository: tomee > Updated Branches: > refs/heads/tomee-1.7.x 1e2c844db -> 2fece229d > > > Just get next available port in range > > > Project: http://git-wip-us.apache.org/repos/asf/tomee/repo > Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/2fece229 > Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/2fece229 > Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/2fece229 > > Branch: refs/heads/tomee-1.7.x > Commit: 2fece229d9a0312e5bc447033a5e06be2a32229c > Parents: 1e2c844 > Author: andygumbrecht <[email protected]> > Authored: Mon Dec 1 23:05:48 2014 +0100 > Committer: andygumbrecht <[email protected]> > Committed: Mon Dec 1 23:05:48 2014 +0100 > > ---------------------------------------------------------------------- > .../src/main/java/org/apache/openejb/util/NetworkUtil.java | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > ---------------------------------------------------------------------- > > > > http://git-wip-us.apache.org/repos/asf/tomee/blob/2fece229/container/openejb-core/src/main/java/org/apache/openejb/util/NetworkUtil.java > ---------------------------------------------------------------------- > diff --git > a/container/openejb-core/src/main/java/org/apache/openejb/util/NetworkUtil.java > b/container/openejb-core/src/main/java/org/apache/openejb/util/NetworkUtil.java > index d0ce67e..40a83e9 100644 > --- > a/container/openejb-core/src/main/java/org/apache/openejb/util/NetworkUtil.java > +++ > b/container/openejb-core/src/main/java/org/apache/openejb/util/NetworkUtil.java > @@ -41,7 +41,7 @@ public final class NetworkUtil { > * Lock file property name > */ > public static final String TOMEE_LOCK_FILE = "TOMEE_LOCK_FILE"; > - public static final int[] RANDOM = new int[] { 0 }; > + //public static final int[] RANDOM = new int[]{0}; > > private static final ReentrantLock lock = new ReentrantLock(); > private static final ByteBuffer buf = ByteBuffer.allocate(512); > @@ -63,7 +63,7 @@ public final class NetworkUtil { > final ReentrantLock l = lock; > l.lock(); > try { > - return getNextAvailablePort(RANDOM); > + return getNextAvailablePort(PORT_MIN, PORT_MAX, null); > } finally { > l.unlock(); > } > @@ -113,7 +113,7 @@ public final class NetworkUtil { > } > > try { > - s = create(new int[]{ i }, lastPorts); > + s = create(new int[]{i}, lastPorts); > port = s.getLocalPort(); > break; > > >
