svn commit: r1203522 - /commons/sandbox/graph/trunk/RELEASE-NOTES.txt
Author: simonetripodi Date: Fri Nov 18 08:29:50 2011 New Revision: 1203522 URL: http://svn.apache.org/viewvc?rev=1203522view=rev Log: updating graph release notes Modified: commons/sandbox/graph/trunk/RELEASE-NOTES.txt Modified: commons/sandbox/graph/trunk/RELEASE-NOTES.txt URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/RELEASE-NOTES.txt?rev=1203522r1=1203521r2=1203522view=diff == --- commons/sandbox/graph/trunk/RELEASE-NOTES.txt (original) +++ commons/sandbox/graph/trunk/RELEASE-NOTES.txt Fri Nov 18 08:29:50 2011 @@ -37,16 +37,12 @@ BREAKING CHANGES: DEPENDENCIES = -Graph 0.1 users should upgrade to the recommended dependency set below -where possible. - -The Recommended Dependency Set for Graph 0.1 is: - TBD +Apache Commons Graph does not have any dependency. NEW FEATURES = - * TBD + * none BUGS FROM PREVIOUS RELEASE ===
svn commit: r1203524 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java
Author: simonetripodi Date: Fri Nov 18 08:33:07 2011 New Revision: 1203524 URL: http://svn.apache.org/viewvc?rev=1203524view=rev Log: strongly connected component implementation switched to LinkedHashSet to preserve the order Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java?rev=1203524r1=1203523r2=1203524view=diff == --- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java (original) +++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java Fri Nov 18 08:33:07 2011 @@ -22,7 +22,7 @@ package org.apache.commons.graph.connect import static java.lang.Math.min; import java.util.HashMap; -import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; import java.util.Stack; @@ -50,7 +50,7 @@ public final class Tarjan { final MapV, TarjanVertexMetaInfo verticesMetaInfo = new HashMapV, TarjanVertexMetaInfo(); final StackV s = new StackV(); -final SetV stronglyConnectedComponent = new HashSetV(); +final SetV stronglyConnectedComponent = new LinkedHashSetV(); Integer index = 0; for ( V vertex : graph.getVertices() )
svn commit: r1203527 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java
Author: simonetripodi Date: Fri Nov 18 08:38:41 2011 New Revision: 1203527 URL: http://svn.apache.org/viewvc?rev=1203527view=rev Log: added simple method just to check if the input graph has a strongly connected component Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java?rev=1203527r1=1203526r2=1203527view=diff == --- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java (original) +++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java Fri Nov 18 08:38:41 2011 @@ -39,6 +39,19 @@ public final class Tarjan { /** + * Applies the classical Tarjan's algorithm checking if there is a strongly connected component. + * + * @param V the Graph vertices type. + * @param E the Graph edges type. + * @param graph the Graph which strongly connected component has to be verified. + * @return true, if the input graph has a strongly connected component, false otherwise. + */ +public static V extends Vertex, E extends Edge boolean hasStronglyConnectedComponent( DirectedGraphV, E graph ) +{ +return !getStronglyConnectedComponent( graph ).isEmpty(); +} + +/** * Applies the classical Tarjan's algorithm to find the strongly connected components, if exist. * * @param V the Graph vertices type.
svn commit: r1203535 - /commons/proper/daemon/trunk/src/native/windows/src/log.c
Author: mturk Date: Fri Nov 18 08:54:56 2011 New Revision: 1203535 URL: http://svn.apache.org/viewvc?rev=1203535view=rev Log: WriteFile requires DWORD. strlen on WIN64 returns 64-bit Modified: commons/proper/daemon/trunk/src/native/windows/src/log.c Modified: commons/proper/daemon/trunk/src/native/windows/src/log.c URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/windows/src/log.c?rev=1203535r1=1203534r2=1203535view=diff == --- commons/proper/daemon/trunk/src/native/windows/src/log.c (original) +++ commons/proper/daemon/trunk/src/native/windows/src/log.c Fri Nov 18 08:54:56 2011 @@ -358,7 +358,7 @@ apxLogWrite( WriteFile(lf-hFile, sb, lstrlenA(sb), wr, NULL); } WriteFile(lf-hFile, _log_level[dwLevel], - strlen(_log_level[dwLevel]), wr, NULL); + lstrlenA(_log_level[dwLevel]), wr, NULL); if (f lf-dwLogLevel == APXLOG_LEVEL_DEBUG) { wsprintfA(sb, (%10s:%-4d) , f, dwLine); WriteFile(lf-hFile, sb, lstrlenA(sb), wr, NULL);
svn commit: r1203541 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java
Author: simonetripodi Date: Fri Nov 18 09:03:42 2011 New Revision: 1203541 URL: http://svn.apache.org/viewvc?rev=1203541view=rev Log: added hidden construcotor in Tarjan class algorithm Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java?rev=1203541r1=1203540r2=1203541view=diff == --- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java (original) +++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java Fri Nov 18 09:03:42 2011 @@ -39,6 +39,14 @@ public final class Tarjan { /** + * Hidden constructor, this class cannot be instantiated directly. + */ +private Tarjan() +{ +// do nothing +} + +/** * Applies the classical Tarjan's algorithm checking if there is a strongly connected component. * * @param V the Graph vertices type.
svn commit: r1203544 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharir.java
Author: simonetripodi Date: Fri Nov 18 09:07:22 2011 New Revision: 1203544 URL: http://svn.apache.org/viewvc?rev=1203544view=rev Log: fixed javadoc violation Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharir.java Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharir.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharir.java?rev=1203544r1=1203543r2=1203544view=diff == --- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharir.java (original) +++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharir.java Fri Nov 18 09:07:22 2011 @@ -33,7 +33,7 @@ public final class KosarajuSharir { /** - * This class can not be instantiated directly + * This class can not be instantiated directly. */ private KosarajuSharir() {
svn commit: r1203545 - /commons/sandbox/graph/trunk/pom.xml
Author: simonetripodi Date: Fri Nov 18 09:09:13 2011 New Revision: 1203545 URL: http://svn.apache.org/viewvc?rev=1203545view=rev Log: upgrated parent Modified: commons/sandbox/graph/trunk/pom.xml Modified: commons/sandbox/graph/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/pom.xml?rev=1203545r1=1203544r2=1203545view=diff == --- commons/sandbox/graph/trunk/pom.xml (original) +++ commons/sandbox/graph/trunk/pom.xml Fri Nov 18 09:09:13 2011 @@ -21,7 +21,7 @@ parent groupIdorg.apache.commons/groupId artifactIdcommons-parent/artifactId -version21/version +version22/version /parent groupIdorg.apache.commons/groupId
svn commit: r1203582 - in /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/entry: FiedlCacheEntryFactory.java FieldCacheEntryFactory.java
Author: mcucchiara Date: Fri Nov 18 10:53:44 2011 New Revision: 1203582 URL: http://svn.apache.org/viewvc?rev=1203582view=rev Log: OGNL-39 - Corrected typo: Renamed Fie{dl,ld}CacheEntryFactory. Added: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/entry/FieldCacheEntryFactory.java Removed: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/entry/FiedlCacheEntryFactory.java Added: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/entry/FieldCacheEntryFactory.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/entry/FieldCacheEntryFactory.java?rev=1203582view=auto == --- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/entry/FieldCacheEntryFactory.java (added) +++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/entry/FieldCacheEntryFactory.java Fri Nov 18 10:53:44 2011 @@ -0,0 +1,47 @@ +package org.apache.commons.ognl.internal.entry; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +/* + * $Id: FiedlCacheEntryFactory.java 1194954 2011-10-29 18:00:27Z mcucchiara $ + */ + +import org.apache.commons.ognl.internal.CacheException; + +import java.lang.reflect.Field; +import java.util.HashMap; +import java.util.Map; + +public class FieldCacheEntryFactory +implements ClassCacheEntryFactoryMapString, Field +{ +public MapString, Field create( Class? key ) +throws CacheException +{ +Field[] declaredFields = key.getDeclaredFields(); +MapString, Field result = new HashMapString, Field( declaredFields.length ); +for ( Field field : declaredFields ) +{ +result.put( field.getName(), field ); +} +return result; +} +} +
svn commit: r1203584 - /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/ClassCacheHandler.java
Author: mcucchiara Date: Fri Nov 18 10:54:19 2011 New Revision: 1203584 URL: http://svn.apache.org/viewvc?rev=1203584view=rev Log: OGNL-39 - Renamed local var Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/ClassCacheHandler.java Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/ClassCacheHandler.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/ClassCacheHandler.java?rev=1203584r1=1203583r2=1203584view=diff == --- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/ClassCacheHandler.java (original) +++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/internal/ClassCacheHandler.java Fri Nov 18 10:54:19 2011 @@ -50,12 +50,12 @@ public class ClassCacheHandler { keyFound = forClass; outer: -for ( Class? c = forClass; c != null; c = c.getSuperclass() ) +for ( Class? clazz = forClass; clazz != null; clazz = clazz.getSuperclass() ) { -answer = handlers.get( c ); +answer = handlers.get( clazz ); if ( answer == null ) { -Class?[] interfaces = c.getInterfaces(); +Class?[] interfaces = clazz.getInterfaces(); for ( Class? iface : interfaces ) { answer = handlers.get( iface ); @@ -73,7 +73,7 @@ public class ClassCacheHandler } else { -keyFound = c; +keyFound = clazz; break; } }
svn commit: r1203585 - /commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/internal/FieldCacheTest.java
Author: mcucchiara Date: Fri Nov 18 10:54:48 2011 New Revision: 1203585 URL: http://svn.apache.org/viewvc?rev=1203585view=rev Log: OGNL-39 - Corrected typo: Renamed Fie{dl,ld}CacheEntryFactory. Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/internal/FieldCacheTest.java Modified: commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/internal/FieldCacheTest.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/internal/FieldCacheTest.java?rev=1203585r1=1203584r2=1203585view=diff == --- commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/internal/FieldCacheTest.java (original) +++ commons/proper/ognl/trunk/src/test/java/org/apache/commons/ognl/internal/FieldCacheTest.java Fri Nov 18 10:54:48 2011 @@ -21,7 +21,7 @@ package org.apache.commons.ognl.internal; -import org.apache.commons.ognl.internal.entry.FiedlCacheEntryFactory; +import org.apache.commons.ognl.internal.entry.FieldCacheEntryFactory; import org.apache.commons.ognl.test.objects.Bean2; import org.junit.Test; @@ -39,7 +39,7 @@ import static junit.framework.Assert.ass public class FieldCacheTest { ConcurrentHashMapCacheClass?, MapString,Field cache = -new ConcurrentHashMapCacheClass?, MapString,Field( new FiedlCacheEntryFactory()); +new ConcurrentHashMapCacheClass?, MapString,Field( new FieldCacheEntryFactory()); @Test public void testGet( )
svn commit: r1203603 - /commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlCache.java
Author: mcucchiara Date: Fri Nov 18 11:20:37 2011 New Revision: 1203603 URL: http://svn.apache.org/viewvc?rev=1203603view=rev Log: Added explicit argument type (Jenkins fails) Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlCache.java Modified: commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlCache.java URL: http://svn.apache.org/viewvc/commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlCache.java?rev=1203603r1=1203602r2=1203603view=diff == --- commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlCache.java (original) +++ commons/proper/ognl/trunk/src/main/java/org/apache/commons/ognl/OgnlCache.java Fri Nov 18 11:20:37 2011 @@ -98,7 +98,7 @@ public class OgnlCache { public ListConstructor? create( Class? key ) throws CacheException { -return Arrays.asList( key.getConstructors() ); +return Arrays.Constructor?asList( key.getConstructors() ); } } );
svn commit: r1203621 - in /commons/proper/compress/trunk/src/test: java/org/apache/commons/compress/compressors/ resources/
Author: bodewig Date: Fri Nov 18 12:20:05 2011 New Revision: 1203621 URL: http://svn.apache.org/viewvc?rev=1203621view=rev Log: testcases for compressors with concatenated streams. COMPRESS-146 COMPRESS-154 COMPRESS156 Added: commons/proper/compress/trunk/src/test/resources/multiple.bz2 (with props) commons/proper/compress/trunk/src/test/resources/multiple.gz (with props) commons/proper/compress/trunk/src/test/resources/multiple.xz (with props) Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/BZip2TestCase.java commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/GZipTestCase.java commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/XZTestCase.java Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/BZip2TestCase.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/BZip2TestCase.java?rev=1203621r1=1203620r2=1203621view=diff == --- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/BZip2TestCase.java (original) +++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/BZip2TestCase.java Fri Nov 18 12:20:05 2011 @@ -25,6 +25,7 @@ import java.io.InputStream; import java.io.OutputStream; import org.apache.commons.compress.AbstractTestCase; +import org.apache.commons.compress.compressors.bzip2.BZip2CompressorInputStream; import org.apache.commons.compress.utils.IOUtils; public final class BZip2TestCase extends AbstractTestCase { @@ -68,4 +69,39 @@ public final class BZip2TestCase extends os.close(); } +public void testConcatenatedStreamsReadFirstOnly() throws Exception { +final File input = getFile(multiple.bz2); +final InputStream is = new FileInputStream(input); +try { +final CompressorInputStream in = new CompressorStreamFactory() +.createCompressorInputStream(bzip2, is); +try { +assertEquals('a', in.read()); +assertEquals(-1, in.read()); +} finally { +in.close(); +} +} finally { +is.close(); +} +} + +public void testConcatenatedStreamsReadFully() throws Exception { +final File input = getFile(multiple.bz2); +final InputStream is = new FileInputStream(input); +try { +final CompressorInputStream in = +new BZip2CompressorInputStream(is, true); +try { +assertEquals('a', in.read()); +assertEquals('b', in.read()); +assertEquals(0, in.available()); +assertEquals(-1, in.read()); +} finally { +in.close(); +} +} finally { +is.close(); +} +} } Modified: commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/GZipTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/GZipTestCase.java?rev=1203621r1=1203620r2=1203621view=diff == --- commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/GZipTestCase.java (original) +++ commons/proper/compress/trunk/src/test/java/org/apache/commons/compress/compressors/GZipTestCase.java Fri Nov 18 12:20:05 2011 @@ -28,6 +28,7 @@ import java.io.InputStream; import java.io.OutputStream; import org.apache.commons.compress.AbstractTestCase; +import org.apache.commons.compress.compressors.gzip.GzipCompressorInputStream; import org.apache.commons.compress.utils.IOUtils; public final class GZipTestCase extends AbstractTestCase { @@ -71,6 +72,42 @@ public final class GZipTestCase extends } } +public void testConcatenatedStreamsReadFirstOnly() throws Exception { +final File input = getFile(multiple.gz); +final InputStream is = new FileInputStream(input); +try { +final CompressorInputStream in = new CompressorStreamFactory() +.createCompressorInputStream(gz, is); +try { +assertEquals('a', in.read()); +assertEquals(-1, in.read()); +} finally { +in.close(); +} +} finally { +is.close(); +} +} + +public void testConcatenatedStreamsReadFully() throws Exception { +final File input = getFile(multiple.gz); +final InputStream is = new FileInputStream(input); +try { +final CompressorInputStream in = +new GzipCompressorInputStream(is, true); +try
svn propchange: r1203475 - svn:log
Author: ggregory Revision: 1203475 Modified property: svn:log Modified: svn:log at Fri Nov 18 13:29:13 2011 -- --- svn:log (original) +++ svn:log Fri Nov 18 13:29:13 2011 @@ -0,0 +1 @@ +[VFS-385] Add HTTP status code to HTTP file provider exception messages when available.
Nexus: Staging Completed.
Description:Close staging repository automatically for uploaded bundle.Details:The following artifacts have been staged to the org.apache.commons-217 (u:sebb, a:80.176.146.62) repository.commons-daemon-1.0.8.pomcommons-daemon-1.0.8-sources.jarcommons-daemon-1.0.8-sources.jar.asccommons-daemon-1.0.8.jarcommons-daemon-1.0.8.pom.asccommons-daemon-1.0.8-javadoc.jar.asccommons-daemon-1.0.8-javadoc.jarcommons-daemon-1.0.8.jar.ascarchetype-catalog.xml
Nexus: Staging Repository Dropped.
Description:Duplicate hashesDetails:The org.apache.commons-217 (u:sebb, a:80.176.146.62) staging repository has been dropped.
Nexus: Staging Completed.
Description:Close staging repository automatically for uploaded bundle.Details:The following artifacts have been staged to the org.apache.commons-218 (u:sebb, a:80.176.146.62) repository.commons-daemon-1.0.8.pomcommons-daemon-1.0.8-sources.jarcommons-daemon-1.0.8-sources.jar.asccommons-daemon-1.0.8.jarcommons-daemon-1.0.8.pom.asccommons-daemon-1.0.8-javadoc.jar.asccommons-daemon-1.0.8-javadoc.jarcommons-daemon-1.0.8.jar.ascarchetype-catalog.xml
svn commit: r1203666 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharirVisitHandler.java
Author: simonetripodi Date: Fri Nov 18 14:31:24 2011 New Revision: 1203666 URL: http://svn.apache.org/viewvc?rev=1203666view=rev Log: first checkin of KosarajuSharirVisitHandler class Added: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharirVisitHandler.java (with props) Added: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharirVisitHandler.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharirVisitHandler.java?rev=1203666view=auto == --- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharirVisitHandler.java (added) +++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharirVisitHandler.java Fri Nov 18 14:31:24 2011 @@ -0,0 +1,69 @@ +package org.apache.commons.graph.connectedcomponents; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import java.util.LinkedList; + +import org.apache.commons.graph.Edge; +import org.apache.commons.graph.Graph; +import org.apache.commons.graph.Vertex; +import org.apache.commons.graph.visit.BaseGraphVisitHandler; + +/** + * Kosaraju's strongly connected component algorithm is based on DFS (or BFS) algorithm + * and needs to execute specific actions during the visit. + * + * @param V the Graph vertices type. + * @param E the Graph edges type. + */ +final class KosarajuSharirVisitHandlerV extends Vertex, E extends Edge +extends BaseGraphVisitHandlerV, E +{ + +final V startVisit; + +public KosarajuSharirVisitHandler( final V startVisit ) +{ +this.startVisit = startVisit; +} + +final LinkedListV vertices = new LinkedListV(); + +/** + * {@inheritDoc} + */ +public void finishVertex( V vertex ) +{ +if ( !startVisit.equals( vertex ) ) +{ +vertices.add( vertex ); +} +} + +@Override +public void finishGraph( GraphV, E graph ) +{ +vertices.add( startVisit ); + +// FIXME make sure the vertices order is the one needed by the algorithm +System.out.println( Visit complete: + vertices ); +} + +} Propchange: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharirVisitHandler.java -- svn:eol-style = native Propchange: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharirVisitHandler.java -- svn:keywords = Date Author Id Revision HeadURL Propchange: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharirVisitHandler.java -- svn:mime-type = text/plain
svn commit: r1203669 - in /commons/proper/vfs/trunk: ./ core/ core/src/test/java/org/apache/commons/vfs2/provider/http/test/ src/changes/
Author: ggregory Date: Fri Nov 18 14:33:59 2011 New Revision: 1203669 URL: http://svn.apache.org/viewvc?rev=1203669view=rev Log: [VFS-386] Build tests HTTP file system with an embedded HTTP server (Apache HttpComponent Core) Added: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/http/test/NHttpServer.java Modified: commons/proper/vfs/trunk/core/pom.xml commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/http/test/HttpProviderTestCase.java commons/proper/vfs/trunk/pom.xml commons/proper/vfs/trunk/src/changes/changes.xml Modified: commons/proper/vfs/trunk/core/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/pom.xml?rev=1203669r1=1203668r2=1203669view=diff == --- commons/proper/vfs/trunk/core/pom.xml (original) +++ commons/proper/vfs/trunk/core/pom.xml Fri Nov 18 14:33:59 2011 @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. -- - + project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; @@ -113,6 +113,12 @@ artifactIdcommons-io/artifactId scopetest/scope /dependency +!-- Test HTTP with Apache HttpComponent Core -- +dependency + groupIdorg.apache.httpcomponents/groupId + artifactIdhttpcore-nio/artifactId + scopetest/scope +/dependency /dependencies properties Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/http/test/HttpProviderTestCase.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/http/test/HttpProviderTestCase.java?rev=1203669r1=1203668r2=1203669view=diff == --- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/http/test/HttpProviderTestCase.java (original) +++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/http/test/HttpProviderTestCase.java Fri Nov 18 14:33:59 2011 @@ -16,6 +16,8 @@ */ package org.apache.commons.vfs2.provider.http.test; +import java.io.IOException; + import junit.framework.Test; import org.apache.commons.vfs2.FileObject; @@ -24,46 +26,109 @@ import org.apache.commons.vfs2.impl.Defa import org.apache.commons.vfs2.provider.http.HttpFileProvider; import org.apache.commons.vfs2.test.AbstractProviderTestConfig; import org.apache.commons.vfs2.test.ProviderTestSuite; +import org.apache.commons.vfs2.util.FreeSocketPortUtil; /** * Test cases for the HTTP provider. - * + * * @author a href=mailto:adammurd...@apache.org;Adam Murdoch/a */ -public class HttpProviderTestCase -extends AbstractProviderTestConfig +public class HttpProviderTestCase extends AbstractProviderTestConfig { +private static NHttpServer Server; + +private static int SocketPort; + private static final String TEST_URI = test.http.uri; -public static Test suite() throws Exception + +/** + * Use %40 for @ in URLs + */ +private static String ConnectionUri; + +private static String getSystemTestUriOverride() { -if (System.getProperty(TEST_URI) != null) +return System.getProperty(TEST_URI); +} + +/** + * Creates and starts an embedded Apache HTTP Server (). + * + * @throws Exception + */ +private static void setUpClass() throws Exception +{ +Server = new NHttpServer(); +if (!Server.run(SocketPort, getTestDirectory(), 5000)) { -return new ProviderTestSuite(new HttpProviderTestCase()); +throw new IllegalStateException(The embedded HTTP server has not completed startup, increase wait time); } -else +} + +public static Test suite() throws Exception +{ +return new ProviderTestSuite(new HttpProviderTestCase()) { -return notConfigured(HttpProviderTestCase.class); -} +@Override +protected void setUp() throws Exception +{ +if (getSystemTestUriOverride() == null) +{ +setUpClass(); +} +super.setUp(); +} + +@Override +protected void tearDown() throws Exception +{ +tearDownClass(); +super.tearDown(); +} +}; } /** - * Prepares the file system manager. + * Stops the embedded Apache HTTP Server (). + * + * @throws IOException */ -@Override -public void prepare(final DefaultFileSystemManager manager) -throws Exception +private static void tearDownClass() throws IOException { -manager.addProvider(http, new HttpFileProvider()); +if
svn commit: r1203673 - /commons/proper/vfs/trunk/src/changes/changes.xml
Author: ggregory Date: Fri Nov 18 14:40:56 2011 New Revision: 1203673 URL: http://svn.apache.org/viewvc?rev=1203673view=rev Log: Add missing issues for testing FTP and SFTP with embedded servers. Modified: commons/proper/vfs/trunk/src/changes/changes.xml Modified: commons/proper/vfs/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/src/changes/changes.xml?rev=1203673r1=1203672r2=1203673view=diff == --- commons/proper/vfs/trunk/src/changes/changes.xml (original) +++ commons/proper/vfs/trunk/src/changes/changes.xml Fri Nov 18 14:40:56 2011 @@ -23,6 +23,12 @@ body release version=2.1 date=TBD description= + action issue=VFS-388 dev=ggregory type=update +Build tests SFTP file system with an embedded SFTP server (Apache MINA). + /action + action issue=VFS-387 dev=ggregory type=update +Build tests FTP file system with an embedded FTP server (Apache MINA). + /action action issue=VFS-386 dev=ggregory type=update Build tests HTTP file system with an embedded HTTP server (Apache HttpComponent Core). /action
svn commit: r1203678 - /commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/http/test/NHttpServer.java
Author: ggregory Date: Fri Nov 18 14:48:25 2011 New Revision: 1203678 URL: http://svn.apache.org/viewvc?rev=1203678view=rev Log: [VFS-386] Build tests HTTP file system with an embedded HTTP server (Apache HttpComponent Core). Forgot to make test quiet on the console. Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/http/test/NHttpServer.java Modified: commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/http/test/NHttpServer.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/http/test/NHttpServer.java?rev=1203678r1=1203677r2=1203678view=diff == --- commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/http/test/NHttpServer.java (original) +++ commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/http/test/NHttpServer.java Fri Nov 18 14:48:25 2011 @@ -97,27 +97,27 @@ public class NHttpServer { public void connectionClosed(final NHttpConnection conn) { -System.out.println(Connection closed: + conn); +debug(Connection closed: + conn); } public void connectionOpen(final NHttpConnection conn) { -System.out.println(Connection open: + conn); +debug(Connection open: + conn); } public void connectionTimeout(final NHttpConnection conn) { -System.out.println(Connection timed out: + conn); +debug(Connection timed out: + conn); } public void fatalIOException(final IOException ex, final NHttpConnection conn) { -System.err.println(I/O error: + ex.getMessage()); +debug(I/O error: + ex.getMessage()); } public void fatalProtocolException(final HttpException ex, final NHttpConnection conn) { -System.err.println(HTTP error: + ex.getMessage()); +debug(HTTP error: + ex.getMessage()); } } @@ -144,7 +144,7 @@ public class NHttpServer { HttpEntity entity = ((HttpEntityEnclosingRequest) request).getEntity(); byte[] entityContent = EntityUtils.toByteArray(entity); -System.out.println(Incoming entity content (bytes): + entityContent.length); +debug(Incoming entity content (bytes): + entityContent.length); } String target = request.getRequestLine().getUri(); @@ -156,7 +156,7 @@ public class NHttpServer + not found/h1/body/html, UTF-8); entity.setContentType(text/html; charset=UTF-8); response.setEntity(entity); -System.out.println(File + file.getPath() + not found); +debug(File + file.getPath() + not found); } else if (!file.canRead()) { @@ -164,7 +164,7 @@ public class NHttpServer NStringEntity entity = new NStringEntity(htmlbodyh1Access denied/h1/body/html, UTF-8); entity.setContentType(text/html; charset=UTF-8); response.setEntity(entity); -System.out.println(Cannot read file + file.getPath()); +debug(Cannot read file + file.getPath()); } else { @@ -175,11 +175,21 @@ public class NHttpServer { response.addHeader(HttpHeaders.LAST_MODIFIED, DateUtil.formatDate(new Date(file.lastModified(; } -System.out.println(Serving file + file.getPath()); +debug(Serving file + file.getPath()); } } } +static final boolean Debug = false; + +private static void debug(String s) +{ +if (Debug) +{ +System.out.println(s); +} +} + public static void main(String[] args) throws Exception { new NHttpServer().run(0, null, 0); @@ -238,12 +248,12 @@ public class NHttpServer ioReactor.execute(ioEventDispatch); } catch (InterruptedIOException ex) { -System.err.println(Interrupted); +debug(Interrupted); } catch (IOException e) { -System.err.println(I/O error: + e.getMessage()); +debug(I/O error: + e.getMessage()); } -System.out.println(Shutdown); +debug(Shutdown); } public void stop() throws IOException
svn commit: r1203680 - /commons/proper/daemon/trunk/pom.xml
Author: sebb Date: Fri Nov 18 14:57:33 2011 New Revision: 1203680 URL: http://svn.apache.org/viewvc?rev=1203680view=rev Log: Don't leave trunk as a release version Modified: commons/proper/daemon/trunk/pom.xml Modified: commons/proper/daemon/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/pom.xml?rev=1203680r1=1203679r2=1203680view=diff == --- commons/proper/daemon/trunk/pom.xml (original) +++ commons/proper/daemon/trunk/pom.xml Fri Nov 18 14:57:33 2011 @@ -27,7 +27,7 @@ modelVersion4.0.0/modelVersion groupIdcommons-daemon/groupId artifactIdcommons-daemon/artifactId - version1.0.8/version + version1.0.9-SNAPSHOT/version nameCommons Daemon/name !-- Daemon started in Commons in 2002 with an import of code from Tomcat, which is why the NOTICE file has an earlier date than the inceptionYear --
svn commit: r1203682 - /commons/proper/math/trunk/src/main/resources/META-INF/localization/LocalizedFormats_fr.properties
Author: luc Date: Fri Nov 18 15:01:56 2011 New Revision: 1203682 URL: http://svn.apache.org/viewvc?rev=1203682view=rev Log: Fixed wrong unicode character. Modified: commons/proper/math/trunk/src/main/resources/META-INF/localization/LocalizedFormats_fr.properties Modified: commons/proper/math/trunk/src/main/resources/META-INF/localization/LocalizedFormats_fr.properties URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/resources/META-INF/localization/LocalizedFormats_fr.properties?rev=1203682r1=1203681r2=1203682view=diff == --- commons/proper/math/trunk/src/main/resources/META-INF/localization/LocalizedFormats_fr.properties (original) +++ commons/proper/math/trunk/src/main/resources/META-INF/localization/LocalizedFormats_fr.properties Fri Nov 18 15:01:56 2011 @@ -156,7 +156,7 @@ ALPHA = alpha BETA = beta NOT_POSITIVE_COLUMNDIMENSION = nombre de colonnes invalide : {0} (doit \u00eatre positif) NOT_POSITIVE_DEFINITE_MATRIX = matrice non d\u00e9finie positive -NON_POSITIVE_DEFINITE_MATRIX = matrice non d\u00e9finie positive: l''\u00e9l\u00e9ment diagonal ({1},{1}) est inf\u00e9rieur \u0061 {2} ({0}) +NON_POSITIVE_DEFINITE_MATRIX = matrice non d\u00e9finie positive: l''\u00e9l\u00e9ment diagonal ({1},{1}) est inf\u00e9rieur \u00e0 {2} ({0}) NON_SELF_ADJOINT_LINEAR_OPERATOR = : |x'' A y - y'' A x| {0} quand x est {1} et y est {2} NON_POSITIVE_DEFINITE_LINEAR_OPERATOR = op\u00e9rateur lin\u00e9aire non d\u00e9fini positif NON_SELF_ADJOINT_LINEAR_OPERATOR = op\u00e9rateur lin\u00e9aire non auto-adjoint @@ -197,7 +197,7 @@ NOT_STRICTLY_INCREASING_NUMBER_OF_POINTS NOT_STRICTLY_INCREASING_SEQUENCE = les points {3} et {2} ne sont pas strictement croissants ({1} = {0}) NOT_SUBTRACTION_COMPATIBLE_MATRICES = les dimensions {0}x{1} et {2}x{3} sont incompatibles pour la soustraction matricielle NOT_SYMMETRIC_MATRIX = matrice non symm\u00e9trique -NON_SYMMETRIC_MATRIX = matrice non symm\u00e9trique: la diff\u00e9rence entre les \u00e9l\u00e9ments ({0},{1}) et ({1},{0}) est sup\u00e9rieure \u0061 {2} +NON_SYMMETRIC_MATRIX = matrice non symm\u00e9trique: la diff\u00e9rence entre les \u00e9l\u00e9ments ({0},{1}) et ({1},{0}) est sup\u00e9rieure \u00e0 {2} NO_BIN_SELECTED = aucun compartiment s\u00e9lectionn\u00e9 NO_CONVERGENCE_WITH_ANY_START_POINT = aucun des {0} points de d\u00e9part n''aboutit \u00e0 une convergence NO_DATA = aucune donn\u00e9e
svn commit: r1203691 - in /commons/proper/vfs/trunk: core/src/main/java/org/apache/commons/vfs2/ core/src/main/java/org/apache/commons/vfs2/impl/ core/src/main/java/org/apache/commons/vfs2/provider/ c
Author: ggregory Date: Fri Nov 18 15:25:14 2011 New Revision: 1203691 URL: http://svn.apache.org/viewvc?rev=1203691view=rev Log: [VFS-389] Use variable argument lists in FileSystemException instead of Object[]s. Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemException.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/DefaultFileSystemManager.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/PrivilegedFileReplicator.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileObject.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/AbstractFileSystem.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/DefaultFileContent.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpClientFactory.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpRandomAccessContent.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftps/FtpsClientFactory.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpClientFactory.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileObject.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpRandomAccessContent.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/local/LocalFile.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpRandomAccessContent.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/FileSystemExceptionTest.java commons/proper/vfs/trunk/src/changes/changes.xml Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemException.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemException.java?rev=1203691r1=1203690r2=1203691view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemException.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemException.java Fri Nov 18 15:25:14 2011 @@ -63,7 +63,7 @@ public class FileSystemException */ public FileSystemException(final String code) { -this(code, null, null); +this(code, null, (Object[])null); } /** @@ -74,7 +74,7 @@ public class FileSystemException */ public FileSystemException(final String code, final Object info0) { -this(code, new Object[]{info0}, null); +this(code, null, new Object[]{info0}); } /** @@ -88,7 +88,7 @@ public class FileSystemException final Object info0, final Throwable throwable) { -this(code, new Object[]{info0}, throwable); +this(code, throwable, new Object[]{info0}); } /** @@ -97,9 +97,9 @@ public class FileSystemException * @param code the error code of the message. * @param info array of complementary info (context). */ -public FileSystemException(final String code, final Object[] info) +public FileSystemException(final String code, final Object... info) { -this(code, info, null); +this(code, null, info); } /** @@ -110,7 +110,7 @@ public class FileSystemException */ public FileSystemException(final String code, final Throwable throwable) { -this(code, null, throwable); +this(code, throwable, (Object[])null); } /** @@ -119,11 +119,27 @@ public class FileSystemException * @param code the error code of the message. * @param info array of complementary info (context). * @param throwable the cause. + * @deprecated Use instead {@link #FileSystemException(String, Throwable, Object[])}. Will be removed in 3.0. */ +@Deprecated public FileSystemException(final String code, final Object[] info, final Throwable throwable) { +this(code, throwable, info); +} + +/** + * Constructs exception with the specified detail message. + * + * @param code the error code of the message. + * @param info array of complementary info
svn commit: r1203699 - in /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2: FileSystemConfigBuilder.java provider/ftp/FtpRandomAccessContent.java provider/http/HttpRandomAccessCont
Author: ggregory Date: Fri Nov 18 15:30:18 2011 New Revision: 1203699 URL: http://svn.apache.org/viewvc?rev=1203699view=rev Log: Use the Long cache, don't create new Longs if not needed. Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemConfigBuilder.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpRandomAccessContent.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpRandomAccessContent.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpRandomAccessContent.java Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemConfigBuilder.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemConfigBuilder.java?rev=1203699r1=1203698r2=1203699view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemConfigBuilder.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemConfigBuilder.java Fri Nov 18 15:30:18 2011 @@ -268,7 +268,7 @@ public abstract class FileSystemConfigBu /** @since 2.0 */ protected long getLong(FileSystemOptions opts, String name, long defaultValue) { -return getLong(opts, name, new Long(defaultValue)).longValue(); +return getLong(opts, name, Long.valueOf(defaultValue)).longValue(); } /** @since 2.0 */ Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpRandomAccessContent.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpRandomAccessContent.java?rev=1203699r1=1203698r2=1203699view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpRandomAccessContent.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpRandomAccessContent.java Fri Nov 18 15:30:18 2011 @@ -59,7 +59,7 @@ class FtpRandomAccessContent extends Abs if (pos 0) { throw new FileSystemException(vfs.provider/random-access-invalid-position.error, -new Long(pos)); +Long.valueOf(pos)); } if (dis != null) { Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpRandomAccessContent.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpRandomAccessContent.java?rev=1203699r1=1203698r2=1203699view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpRandomAccessContent.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpRandomAccessContent.java Fri Nov 18 15:30:18 2011 @@ -65,7 +65,7 @@ class HttpRandomAccessContent extends Ab if (pos 0) { throw new FileSystemException(vfs.provider/random-access-invalid-position.error, -new Long(pos)); +Long.valueOf(pos)); } if (dis != null) { Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpRandomAccessContent.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpRandomAccessContent.java?rev=1203699r1=1203698r2=1203699view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpRandomAccessContent.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpRandomAccessContent.java Fri Nov 18 15:30:18 2011 @@ -62,7 +62,7 @@ class SftpRandomAccessContent extends Ab if (pos 0) { throw new FileSystemException(vfs.provider/random-access-invalid-position.error, -new Long(pos)); +Long.valueOf(pos)); } if (dis != null) {
svn commit: r1203703 - in /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2: ./ provider/ftp/ provider/http/ provider/ram/ provider/sftp/
Author: ggregory Date: Fri Nov 18 15:32:02 2011 New Revision: 1203703 URL: http://svn.apache.org/viewvc?rev=1203703view=rev Log: Use the Integer cache, don't create new Integers if not needed. Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemConfigBuilder.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileSystemConfigBuilder.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileSystemConfigBuilder.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpFileSystemConfigBuilder.java Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemConfigBuilder.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemConfigBuilder.java?rev=1203703r1=1203702r2=1203703view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemConfigBuilder.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemConfigBuilder.java Fri Nov 18 15:32:02 2011 @@ -240,7 +240,7 @@ public abstract class FileSystemConfigBu /** @since 2.0 */ protected int getInteger(FileSystemOptions opts, String name, int defaultValue) { -return getInteger(opts, name, new Integer(defaultValue)).intValue(); +return getInteger(opts, name, Integer.valueOf(defaultValue)).intValue(); } /** @since 2.0 */ Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java?rev=1203703r1=1203702r2=1203703view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java Fri Nov 18 15:32:02 2011 @@ -157,7 +157,7 @@ public class FtpFileObject extends Abstr log.debug(Messages.getString(vfs.provider.ftp/invalid-directory-entry.debug, new Object[] { -new Integer(i), relPath +Integer.valueOf(i), relPath })); } continue; Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileSystemConfigBuilder.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileSystemConfigBuilder.java?rev=1203703r1=1203702r2=1203703view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileSystemConfigBuilder.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/http/HttpFileSystemConfigBuilder.java Fri Nov 18 15:32:02 2011 @@ -99,7 +99,7 @@ public class HttpFileSystemConfigBuilder */ public void setProxyPort(FileSystemOptions opts, int proxyPort) { -setParam(opts, proxyPort, new Integer(proxyPort)); +setParam(opts, proxyPort, Integer.valueOf(proxyPort)); } /** @@ -176,7 +176,7 @@ public class HttpFileSystemConfigBuilder */ public void setMaxTotalConnections(FileSystemOptions opts, int maxTotalConnections) { -setParam(opts, HttpConnectionManagerParams.MAX_TOTAL_CONNECTIONS, new Integer(maxTotalConnections)); +setParam(opts, HttpConnectionManagerParams.MAX_TOTAL_CONNECTIONS, Integer.valueOf(maxTotalConnections)); } /** @@ -198,7 +198,7 @@ public class HttpFileSystemConfigBuilder */ public void setMaxConnectionsPerHost(FileSystemOptions opts, int maxHostConnections) { -setParam(opts, HttpConnectionManagerParams.MAX_HOST_CONNECTIONS, new Integer(maxHostConnections)); +setParam(opts, HttpConnectionManagerParams.MAX_HOST_CONNECTIONS, Integer.valueOf(maxHostConnections)); } /** Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileSystemConfigBuilder.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ram/RamFileSystemConfigBuilder.java?rev=1203703r1=1203702r2=1203703view=diff
svn commit: r1203704 - in /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph: connectedcomponents/ ssc/
Author: simonetripodi Date: Fri Nov 18 15:38:00 2011 New Revision: 1203704 URL: http://svn.apache.org/viewvc?rev=1203704view=rev Log: used the SSC achronym to identify the package of StronglyConnectedComponents algorithms, as used in literature Added: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/ - copied from r1203230, commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/KosarajuSharir.java - copied, changed from r1203544, commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharir.java commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/KosarajuSharirVisitHandler.java - copied, changed from r1203666, commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharirVisitHandler.java commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/Tarjan.java - copied, changed from r1203541, commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/Tarjan.java commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/TarjanVertexMetaInfo.java - copied, changed from r1203296, commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/TarjanVertexMetaInfo.java Removed: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/ Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/package-info.java Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java?rev=1203704r1=1203230r2=1203704view=diff == --- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java (original) +++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java Fri Nov 18 15:38:00 2011 @@ -1,4 +1,4 @@ -package org.apache.commons.graph.connectedcomponents; +package org.apache.commons.graph.ssc; /* * Licensed to the Apache Software Foundation (ASF) under one Copied: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/KosarajuSharir.java (from r1203544, commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharir.java) URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/KosarajuSharir.java?p2=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/KosarajuSharir.javap1=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharir.javar1=1203544r2=1203704rev=1203704view=diff == --- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharir.java (original) +++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/KosarajuSharir.java Fri Nov 18 15:38:00 2011 @@ -1,4 +1,4 @@ -package org.apache.commons.graph.connectedcomponents; +package org.apache.commons.graph.ssc; /* * Licensed to the Apache Software Foundation (ASF) under one Copied: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/KosarajuSharirVisitHandler.java (from r1203666, commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharirVisitHandler.java) URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/KosarajuSharirVisitHandler.java?p2=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/KosarajuSharirVisitHandler.javap1=commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharirVisitHandler.javar1=1203666r2=1203704rev=1203704view=diff == --- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/connectedcomponents/KosarajuSharirVisitHandler.java (original) +++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/KosarajuSharirVisitHandler.java Fri Nov 18 15:38:00 2011 @@ -1,4 +1,4 @@ -package org.apache.commons.graph.connectedcomponents; +package org.apache.commons.graph.ssc; /* * Licensed to the Apache Software Foundation (ASF) under one Copied: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/Tarjan.java (from r1203541,
svn commit: r1203711 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java
Author: simonetripodi Date: Fri Nov 18 16:09:10 2011 New Revision: 1203711 URL: http://svn.apache.org/viewvc?rev=1203711view=rev Log: this class cannot be instantiated directly Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java?rev=1203711r1=1203710r2=1203711view=diff == --- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java (original) +++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java Fri Nov 18 16:09:10 2011 @@ -22,6 +22,12 @@ package org.apache.commons.graph.ssc; public final class CheriyanMehlhornGabow { -// TODO +/** + * This class can not be instantiated directly. + */ +private CheriyanMehlhornGabow() +{ +// do nothing +} }
svn commit: r1203712 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java
Author: simonetripodi Date: Fri Nov 18 16:09:53 2011 New Revision: 1203712 URL: http://svn.apache.org/viewvc?rev=1203712view=rev Log: added missing javadoc comment Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java?rev=1203712r1=1203711r2=1203712view=diff == --- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java (original) +++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java Fri Nov 18 16:09:53 2011 @@ -19,6 +19,9 @@ package org.apache.commons.graph.ssc; * under the License. */ +/** + * Contains the Cheriyan/Mehlhorn/Gabow's strongly connected component algorithm implementation. + */ public final class CheriyanMehlhornGabow {
svn commit: r1203718 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java
Author: simonetripodi Date: Fri Nov 18 16:23:02 2011 New Revision: 1203718 URL: http://svn.apache.org/viewvc?rev=1203718view=rev Log: first checkin of CheriyanMehlhornGabowVisitHandler class Added: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java (with props) Added: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java?rev=1203718view=auto == --- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java (added) +++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java Fri Nov 18 16:23:02 2011 @@ -0,0 +1,37 @@ +package org.apache.commons.graph.ssc; + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * License); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * AS IS BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.apache.commons.graph.Edge; +import org.apache.commons.graph.Vertex; +import org.apache.commons.graph.visit.BaseGraphVisitHandler; + +/** + * Cheriyan/Mehlhorn/Gabow's strongly connected component algorithm is based on DFS (or BFS) algorithm + * and needs to execute specific actions during the visit. + * + * @param V the Graph vertices type. + * @param E the Graph edges type. + */ +final class CheriyanMehlhornGabowVisitHandlerV extends Vertex, E extends Edge +extends BaseGraphVisitHandlerV, E +{ + +} Propchange: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java -- svn:eol-style = native Propchange: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java -- svn:keywords = Date Author Id Revision HeadURL Propchange: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java -- svn:mime-type = text/plain
svn commit: r1203723 - /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java
Author: simonetripodi Date: Fri Nov 18 16:27:45 2011 New Revision: 1203723 URL: http://svn.apache.org/viewvc?rev=1203723view=rev Log: first steps of Gabow algorithm Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java?rev=1203723r1=1203722r2=1203723view=diff == --- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java (original) +++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java Fri Nov 18 16:27:45 2011 @@ -19,6 +19,16 @@ package org.apache.commons.graph.ssc; * under the License. */ +import static org.apache.commons.graph.visit.Visit.depthFirstSearch; + +import java.util.HashSet; +import java.util.Set; +import java.util.Stack; + +import org.apache.commons.graph.DirectedGraph; +import org.apache.commons.graph.Edge; +import org.apache.commons.graph.Vertex; + /** * Contains the Cheriyan/Mehlhorn/Gabow's strongly connected component algorithm implementation. */ @@ -33,4 +43,29 @@ public final class CheriyanMehlhornGabow // do nothing } +/** + * Applies the classical Cheriyan/Mehlhorn/Gabow's algorithm to find the strongly connected components, if exist. + * + * @param V the Graph vertices type. + * @param E the Graph edges type. + * @param graph the Graph which strongly connected component has to be verified. + */ +public static V extends Vertex, E extends Edge void hasStronglyConnectedComponent( DirectedGraphV, E graph ) +{ +final SetV marked = new HashSetV(); +final StackV s = new StackV(); +final StackV p = new StackV(); + +for ( V vertex : graph.getVertices() ) +{ +if ( marked.add( vertex ) ) +{ +s.push( vertex ); +p.push( vertex ); + +depthFirstSearch( graph, vertex, new CheriyanMehlhornGabowVisitHandlerV, E() ); +} +} +} + }
svn commit: r1203737 - /commons/sandbox/runtime/trunk/src/main/native/configure.bat
Author: mturk Date: Fri Nov 18 16:45:23 2011 New Revision: 1203737 URL: http://svn.apache.org/viewvc?rev=1203737view=rev Log: _WIN32 and _WIN64 are predefined macros Modified: commons/sandbox/runtime/trunk/src/main/native/configure.bat Modified: commons/sandbox/runtime/trunk/src/main/native/configure.bat URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/configure.bat?rev=1203737r1=1203736r2=1203737view=diff == --- commons/sandbox/runtime/trunk/src/main/native/configure.bat (original) +++ commons/sandbox/runtime/trunk/src/main/native/configure.bat Fri Nov 18 16:45:23 2011 @@ -41,7 +41,7 @@ set BINDIR=bin set LIBDIR=lib set SHRDIR=share set INCDIR=include/%NAME%-%VMAJOR% -set CPPOPTS=-DWIN32 -D_WIN32 -DWINDOWS -D_WINDOWS -D_WIN32 -DWINNT -D_WINNT +set CPPOPTS=-DWIN32 -DWINDOWS -D_WINDOWS -DWINNT -D_WINNT set CPPOPTS=%CPPOPTS% -D_WIN32_WINNT=0x0502 -DWINVER=0x0502 -D_WIN32_IE=0x0600 -D_UNICODE -DUNICODE set CCFLAGS=-nologo set LDFLAGS=/NOLOGO /INCREMENTAL:NO /DEBUG @@ -188,7 +188,7 @@ set AS=ml set CC_SIZEOF_VOIDP=8 set CC_SIZEOF_SIZE_T=8 set CC_SIZEOF_SSIZE_T=8 -set CPPOPTS=%CPPOPTS% -D%MCPU% -D_WIN64 -DWIN64 +set CPPOPTS=%CPPOPTS% -D%MCPU% -DWIN64 set AS=ml64 ) set RCFLAGS=%RCFLAGS% /d %MCPU% /d OCPR_COMPILE /d OCPR_API_EXPORT
svn commit: r1203739 - in /commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc: CheriyanMehlhornGabow.java CheriyanMehlhornGabowVisitHandler.java
Author: simonetripodi Date: Fri Nov 18 16:48:03 2011 New Revision: 1203739 URL: http://svn.apache.org/viewvc?rev=1203739view=rev Log: moving algorithm logic to the DFS handler Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java?rev=1203739r1=1203738r2=1203739view=diff == --- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java (original) +++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabow.java Fri Nov 18 16:48:03 2011 @@ -23,11 +23,11 @@ import static org.apache.commons.graph.v import java.util.HashSet; import java.util.Set; -import java.util.Stack; import org.apache.commons.graph.DirectedGraph; import org.apache.commons.graph.Edge; import org.apache.commons.graph.Vertex; +import org.apache.commons.graph.visit.GraphVisitHandler; /** * Contains the Cheriyan/Mehlhorn/Gabow's strongly connected component algorithm implementation. @@ -53,17 +53,14 @@ public final class CheriyanMehlhornGabow public static V extends Vertex, E extends Edge void hasStronglyConnectedComponent( DirectedGraphV, E graph ) { final SetV marked = new HashSetV(); -final StackV s = new StackV(); -final StackV p = new StackV(); + +final GraphVisitHandlerV, E visitHandler = new CheriyanMehlhornGabowVisitHandlerV, E( graph, marked ); for ( V vertex : graph.getVertices() ) { -if ( marked.add( vertex ) ) +if ( !marked.contains( vertex ) ) { -s.push( vertex ); -p.push( vertex ); - -depthFirstSearch( graph, vertex, new CheriyanMehlhornGabowVisitHandlerV, E() ); +depthFirstSearch( graph, vertex, visitHandler ); } } } Modified: commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java URL: http://svn.apache.org/viewvc/commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java?rev=1203739r1=1203738r2=1203739view=diff == --- commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java (original) +++ commons/sandbox/graph/trunk/src/main/java/org/apache/commons/graph/ssc/CheriyanMehlhornGabowVisitHandler.java Fri Nov 18 16:48:03 2011 @@ -19,6 +19,12 @@ package org.apache.commons.graph.ssc; * under the License. */ +import static org.apache.commons.graph.visit.Visit.depthFirstSearch; + +import java.util.Set; +import java.util.Stack; + +import org.apache.commons.graph.DirectedGraph; import org.apache.commons.graph.Edge; import org.apache.commons.graph.Vertex; import org.apache.commons.graph.visit.BaseGraphVisitHandler; @@ -34,4 +40,39 @@ final class CheriyanMehlhornGabowVisitHa extends BaseGraphVisitHandlerV, E { +private final DirectedGraphV, E graph; + +private final SetV marked; + +private final StackV s = new StackV(); + +private final StackV p = new StackV(); + +public CheriyanMehlhornGabowVisitHandler( DirectedGraphV, E graph, SetV marked ) +{ +this.graph = graph; +this.marked = marked; +} + + +/** + * {@inheritDoc} + */ +@Override +public void discoverVertex( V vertex ) +{ +marked.add( vertex ); +s.push( vertex ); +p.push( vertex ); + +for ( V adjacent : graph.getOutbound( vertex ) ) +{ +if ( !marked.contains( adjacent ) ) +{ +depthFirstSearch( graph, adjacent, this ); +} +// TODO else... +} +} + }
svn commit: r1203796 - in /commons/proper/vfs/trunk: core/src/main/java/org/apache/commons/vfs2/ core/src/main/java/org/apache/commons/vfs2/impl/ core/src/main/java/org/apache/commons/vfs2/provider/ft
Author: ggregory Date: Fri Nov 18 19:33:54 2011 New Revision: 1203796 URL: http://svn.apache.org/viewvc?rev=1203796view=rev Log: [VFS-390] Use variable argument list in org.apache.commons.vfs2.util.Messages instead of Object[] Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemException.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/StandardFileSystemManager.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/Messages.java commons/proper/vfs/trunk/src/changes/changes.xml Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemException.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemException.java?rev=1203796r1=1203795r2=1203796view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemException.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/FileSystemException.java Fri Nov 18 19:33:54 2011 @@ -183,7 +183,7 @@ public class FileSystemException @Override public String getMessage() { -return Messages.getString(super.getMessage(), getInfo()); +return Messages.getString(super.getMessage(), (Object[])getInfo()); } /** Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/StandardFileSystemManager.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/StandardFileSystemManager.java?rev=1203796r1=1203795r2=1203796view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/StandardFileSystemManager.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/impl/StandardFileSystemManager.java Fri Nov 18 19:33:54 2011 @@ -346,7 +346,7 @@ public class StandardFileSystemManager if (!hasProvider(requiredScheme)) { final String msg = Messages.getString(vfs.impl/skipping-provider-scheme.debug, -new String[]{classname, requiredScheme}); +classname, requiredScheme); VfsLog.debug(getLogger(), getLogger(), msg); return; } @@ -359,7 +359,7 @@ public class StandardFileSystemManager if (!findClass(requiredClass)) { final String msg = Messages.getString(vfs.impl/skipping-provider.debug, -new String[]{classname, requiredClass}); +classname, requiredClass); VfsLog.debug(getLogger(), getLogger(), msg); return; } Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java?rev=1203796r1=1203795r2=1203796view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java (original) +++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/provider/ftp/FtpFileObject.java Fri Nov 18 19:33:54 2011 @@ -155,10 +155,7 @@ public class FtpFileObject extends Abstr if (log.isDebugEnabled()) { log.debug(Messages.getString(vfs.provider.ftp/invalid-directory-entry.debug, -new Object[] -{ -Integer.valueOf(i), relPath -})); +Integer.valueOf(i), relPath)); } continue; } Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java?rev=1203796r1=1203795r2=1203796view=diff == --- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs2/util/DelegatingFileSystemOptionsBuilder.java (original) +++
svn commit: r1203851 - in /commons/sandbox/runtime/trunk/src/main/native: include/acr/callback.h modules/openssl/password.c shared/callback.c
Author: mturk Date: Fri Nov 18 21:26:49 2011 New Revision: 1203851 URL: http://svn.apache.org/viewvc?rev=1203851view=rev Log: Simplify native callback and axe all non java code Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/callback.h commons/sandbox/runtime/trunk/src/main/native/modules/openssl/password.c commons/sandbox/runtime/trunk/src/main/native/shared/callback.c Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr/callback.h URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr/callback.h?rev=1203851r1=1203850r2=1203851view=diff == --- commons/sandbox/runtime/trunk/src/main/native/include/acr/callback.h (original) +++ commons/sandbox/runtime/trunk/src/main/native/include/acr/callback.h Fri Nov 18 21:26:49 2011 @@ -39,20 +39,10 @@ enum { }; typedef struct acr_callback_t acr_callback_t; - -/** - * Callback handler function prototype. - * The handler function must check for data validity. - */ -typedef int (acr_callback_handler_fn_t)(JNIEnv *, acr_callback_t *, -void **, int); - struct acr_callback_t { size_t size; /* Length of 'this' structure */ inttype; /* Type of this callback */ -acr_callback_handler_fn_t *handler;/* Native handler callback */ void *ctx;/* Context data pointer */ -void **refd; /* Generic 'reference to' pointer */ jobjectthiz; /* Pointer to 'this' Java object */ jobjectdata; /* handler provided Java object */ jint counter;/* Reference or invocation counter */ @@ -63,18 +53,6 @@ ACR_CLASS_CTOR(Callback); ACR_CLASS_DTOR(Callback); /** - * Create and initialize a new Callback. - * @param env Current JNI environment - * @param refd Opaque data stored as reference inside callback. - * @param size Additional context size. - * @param type Callback type. - * @param handler Callback function pointer. - */ -acr_callback_t * -AcrCallbackCreate(JNI_STDENV, void *refd, size_t size, int type, - acr_callback_handler_fn_t *handler); - -/** * Create and attach a new Callback to Java object. * @param env Current JNI environment * @param obj Java Object representing callback instance. @@ -84,8 +62,8 @@ AcrCallbackCreate(JNI_STDENV, void *refd * @param handler Callback function pointer. */ acr_callback_t * -AcrCallbackAttach(JNI_STDARGS, jobject refd, size_t size, - int type, acr_callback_handler_fn_t *handler); +AcrCallbackAttach(JNI_STDARGS, jobject refd, size_t size, int type); + /** * Free the memory associated with this Callback. * @param env Current JNI environment @@ -103,7 +81,7 @@ AcrCallbackFree(JNI_STDENV, acr_callback * @param rv Return value from the callback method. */ int -AcrCallbackRun(JNI_STDENV, acr_callback_t *cb, void *ctx, int val, int *rv); +AcrCallbackRun(JNI_STDENV, acr_callback_t *cb, jobject ctx, int val, int *rv); #ifdef __cplusplus } Modified: commons/sandbox/runtime/trunk/src/main/native/modules/openssl/password.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/modules/openssl/password.c?rev=1203851r1=1203850r2=1203851view=diff == --- commons/sandbox/runtime/trunk/src/main/native/modules/openssl/password.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/modules/openssl/password.c Fri Nov 18 21:26:49 2011 @@ -153,7 +153,7 @@ ACR_SSL_EXPORT(jlong, SSLPasswordCallbac pc = ACR_TALLOC(ssl_pass_cb_t); if (pc == 0) return 0; -pc-cb = AcrCallbackAttach(env, obj, 0, 0, ACR_CALLBACK_NORMAL, 0); +pc-cb = AcrCallbackAttach(env, obj, 0, 0, ACR_CALLBACK_NORMAL); if (pc-cb == 0) { AcrFree(pc); return 0; Modified: commons/sandbox/runtime/trunk/src/main/native/shared/callback.c URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/callback.c?rev=1203851r1=1203850r2=1203851view=diff == --- commons/sandbox/runtime/trunk/src/main/native/shared/callback.c (original) +++ commons/sandbox/runtime/trunk/src/main/native/shared/callback.c Fri Nov 18 21:26:49 2011 @@ -53,32 +53,13 @@ ACR_CLASS_DTOR(Callback) } acr_callback_t * -AcrCallbackCreate(JNI_STDENV, void *refd, - size_t size, int type, acr_callback_handler_fn_t *handler) +AcrCallbackAttach(JNI_STDARGS, jobject refd, size_t size, int type) { acr_callback_t *cb = ACR_EALLOC(acr_callback_t, size); if (cb == 0) return 0; -cb-type= type; -cb-handler = handler; -
svn commit: r1203855 - /commons/proper/configuration/trunk/pom.xml
Author: oheger Date: Fri Nov 18 21:36:19 2011 New Revision: 1203855 URL: http://svn.apache.org/viewvc?rev=1203855view=rev Log: Updated to most recent junit version. Modified: commons/proper/configuration/trunk/pom.xml Modified: commons/proper/configuration/trunk/pom.xml URL: http://svn.apache.org/viewvc/commons/proper/configuration/trunk/pom.xml?rev=1203855r1=1203854r2=1203855view=diff == --- commons/proper/configuration/trunk/pom.xml (original) +++ commons/proper/configuration/trunk/pom.xml Fri Nov 18 21:36:19 2011 @@ -350,7 +350,7 @@ dependency groupIdjunit/groupId artifactIdjunit/artifactId - version3.8.1/version + version4.10/version scopetest/scope /dependency