You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by cs...@apache.org on 2012/08/13 14:10:00 UTC

svn commit: r1372383 - in /maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index: ./ context/ packer/

Author: cstamas
Date: Mon Aug 13 12:10:00 2012
New Revision: 1372383

URL: http://svn.apache.org/viewvc?rev=1372383&view=rev
Log:
Getting rid completely of lock/unlock methods from context.

Also, applied @Override in Java6 way.

Modified:
    maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultIteratorResultSet.java
    maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultNexusIndexer.java
    maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/context/DefaultIndexingContext.java
    maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/context/IndexingContext.java
    maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/context/MergedIndexingContext.java
    maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/packer/DefaultIndexPacker.java

Modified: maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultIteratorResultSet.java
URL: http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultIteratorResultSet.java?rev=1372383&r1=1372382&r2=1372383&view=diff
==============================================================================
--- maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultIteratorResultSet.java (original)
+++ maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultIteratorResultSet.java Mon Aug 13 12:10:00 2012
@@ -371,6 +371,7 @@ public class DefaultIteratorResultSet
         }
         else
         {
+            tokenStream.close();
             throw new UnsupportedOperationException( "Hightlight more \"" + hr.getHighlightMode().toString()
                 + "\" is not supported!" );
         }

Modified: maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultNexusIndexer.java
URL: http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultNexusIndexer.java?rev=1372383&r1=1372382&r2=1372383&view=diff
==============================================================================
--- maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultNexusIndexer.java (original)
+++ maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/DefaultNexusIndexer.java Mon Aug 13 12:10:00 2012
@@ -282,13 +282,6 @@ public class DefaultNexusIndexer
         }
 
         // always use temporary context when reindexing
-        File indexDir = context.getIndexDirectoryFile();
-        File dir = null;
-        if ( indexDir != null )
-        {
-            dir = indexDir.getParentFile();
-        }
-
         File tmpFile = File.createTempFile( context.getId() + "-tmp", "" );
         File tmpDir = new File( tmpFile.getParentFile(), tmpFile.getName() + ".dir" );
         if ( !tmpDir.mkdirs() )

Modified: maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/context/DefaultIndexingContext.java
URL: http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/context/DefaultIndexingContext.java?rev=1372383&r1=1372382&r2=1372383&view=diff
==============================================================================
--- maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/context/DefaultIndexingContext.java (original)
+++ maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/context/DefaultIndexingContext.java Mon Aug 13 12:10:00 2012
@@ -28,8 +28,6 @@ import java.util.Date;
 import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
 
 import org.apache.lucene.analysis.Analyzer;
 import org.apache.lucene.document.Document;
@@ -107,8 +105,6 @@ public class DefaultIndexingContext
      */
     private GavCalculator gavCalculator;
 
-    private ReadWriteLock indexMaintenanceLock = new ReentrantReadWriteLock();
-
     private DefaultIndexingContext( String id,
                                     String repositoryId,
                                     File repository, //
@@ -175,31 +171,13 @@ public class DefaultIndexingContext
         }
     }
 
-    public void lock()
-    {
-        //indexMaintenanceLock.readLock().lock();
-    }
-
-    public void unlock()
-    {
-        //indexMaintenanceLock.readLock().unlock();
-    }
-
-    public void lockExclusively()
-    {
-        //indexMaintenanceLock.writeLock().lock();
-    }
-
-    public void unlockExclusively()
-    {
-        //indexMaintenanceLock.writeLock().unlock();
-    }
-
+    @Override
     public Directory getIndexDirectory()
     {
         return indexDirectory;
     }
 
+    @Override
     public File getIndexDirectoryFile()
     {
         return indexDirectoryFile;
@@ -385,33 +363,39 @@ public class DefaultIndexingContext
         }
     }
 
+    @Override
     public boolean isSearchable()
     {
         return searchable;
     }
 
+    @Override
     public void setSearchable( boolean searchable )
     {
         this.searchable = searchable;
     }
 
+    @Override
     public String getId()
     {
         return id;
     }
 
+    @Override
     public void updateTimestamp()
         throws IOException
     {
         updateTimestamp( false );
     }
 
+    @Override
     public void updateTimestamp( boolean save )
         throws IOException
     {
         updateTimestamp( save, new Date() );
     }
 
+    @Override
     public void updateTimestamp( boolean save, Date timestamp )
         throws IOException
     {
@@ -423,11 +407,13 @@ public class DefaultIndexingContext
         }
     }
 
+    @Override
     public Date getTimestamp()
     {
         return timestamp;
     }
 
+    @Override
     public int getSize()
         throws IOException
     {
@@ -442,21 +428,25 @@ public class DefaultIndexingContext
         }
     }
 
+    @Override
     public String getRepositoryId()
     {
         return repositoryId;
     }
 
+    @Override
     public File getRepository()
     {
         return repository;
     }
 
+    @Override
     public String getRepositoryUrl()
     {
         return repositoryUrl;
     }
 
+    @Override
     public String getIndexUpdateUrl()
     {
         if ( repositoryUrl != null )
@@ -469,6 +459,7 @@ public class DefaultIndexingContext
         return indexUpdateUrl;
     }
 
+    @Override
     public Analyzer getAnalyzer()
     {
         return new NexusAnalyzer();
@@ -497,28 +488,23 @@ public class DefaultIndexingContext
         this.searcherManager = new SearcherManager( indexWriter, false, new NexusIndexSearcherFactory( this ) );
     }
 
+    @Override
     public IndexWriter getIndexWriter()
         throws IOException
     {
-        lock();
-
-        try
-        {
-            return indexWriter;
-        }
-        finally
-        {
-            unlock();
-        }
+        return indexWriter;
     }
 
+    @Override
     public IndexSearcher acquireIndexSearcher()
         throws IOException
     {
+        // TODO: move this to separate thread to not penalty next incoming searcher
         searcherManager.maybeRefresh();
         return searcherManager.acquire();
     }
 
+    @Override
     public void releaseIndexSearcher( final IndexSearcher is )
         throws IOException
     {
@@ -529,11 +515,10 @@ public class DefaultIndexingContext
         searcherManager.release( is );
     }
 
+    @Override
     public void commit()
         throws IOException
     {
-        lock();
-
         try
         {
             getIndexWriter().commit();
@@ -541,202 +526,127 @@ public class DefaultIndexingContext
         catch ( CorruptIndexException e )
         {
             close( false );
-
             throw e;
         }
         catch ( IOException e )
         {
             close( false );
-
             throw e;
         }
-        finally
-        {
-            unlock();
-        }
     }
 
+    @Override
     public void rollback()
         throws IOException
     {
-        lock();
-
         try
         {
-            try
-            {
-                getIndexWriter().rollback();
-            }
-            catch ( CorruptIndexException e )
-            {
-                close( false );
-
-                throw e;
-            }
-            catch ( IOException e )
-            {
-                close( false );
-
-                throw e;
-            }
+            getIndexWriter().rollback();
         }
-        finally
+        catch ( CorruptIndexException e )
         {
-            unlock();
+            close( false );
+            throw e;
+        }
+        catch ( IOException e )
+        {
+            close( false );
+            throw e;
         }
     }
 
-    public void optimize()
+    @Override
+    public synchronized void optimize()
         throws CorruptIndexException, IOException
     {
-        lockExclusively();
-
         try
         {
-            IndexWriter w = getIndexWriter();
-
-            try
-            {
-                w.optimize();
-
-                commit();
-            }
-            catch ( CorruptIndexException e )
-            {
-                close( false );
-
-                throw e;
-            }
-            catch ( IOException e )
-            {
-                close( false );
-
-                throw e;
-            }
+            getIndexWriter().optimize();
+            commit();
         }
-        finally
+        catch ( CorruptIndexException e )
         {
-            unlockExclusively();
+            close( false );
+            throw e;
+        }
+        catch ( IOException e )
+        {
+            close( false );
+            throw e;
         }
     }
 
-    public void close( boolean deleteFiles )
+    @Override
+    public synchronized void close( boolean deleteFiles )
         throws IOException
     {
-        lockExclusively();
-
-        try
+        if ( indexDirectory != null )
         {
-            if ( indexDirectory != null )
+            IndexUtils.updateTimestamp( indexDirectory, getTimestamp() );
+            closeReaders();
+            if ( deleteFiles )
             {
-                IndexUtils.updateTimestamp( indexDirectory, getTimestamp() );
-
-                closeReaders();
-
-                if ( deleteFiles )
-                {
-                    deleteIndexFiles( true );
-                }
-
-                indexDirectory.close();
+                deleteIndexFiles( true );
             }
-
-            // TODO: this will prevent from reopening them, but needs better solution
-            // Needed to make bottleWarmerThread die off
-            indexDirectory = null;
-        }
-        finally
-        {
-            unlockExclusively();
+            indexDirectory.close();
         }
+        indexDirectory = null;
     }
 
-    public void purge()
+    @Override
+    public synchronized void purge()
         throws IOException
     {
-        lockExclusively();
-
+        closeReaders();
+        deleteIndexFiles( true );
+        openAndWarmup();
         try
         {
-            closeReaders();
-
-            deleteIndexFiles( true );
-
-            openAndWarmup();
-
-            try
-            {
-                prepareIndex( true );
-            }
-            catch ( UnsupportedExistingLuceneIndexException e )
-            {
-                // just deleted it
-            }
-
-            rebuildGroups();
-
-            updateTimestamp( true, null );
+            prepareIndex( true );
         }
-        finally
+        catch ( UnsupportedExistingLuceneIndexException e )
         {
-            unlockExclusively();
+            // just deleted it
         }
+        rebuildGroups();
+        updateTimestamp( true, null );
     }
 
-    public void replace( Directory directory )
+    @Override
+    public synchronized void replace( Directory directory )
         throws IOException
     {
-        lockExclusively();
-
-        try
-        {
-            Date ts = IndexUtils.getTimestamp( directory );
-
-            closeReaders();
-
-            deleteIndexFiles( false );
-
-            IndexUtils.copyDirectory( directory, indexDirectory );
-
-            openAndWarmup();
-
-            // reclaim the index as mine
-            storeDescriptor();
-
-            updateTimestamp( true, ts );
-
-            optimize();
-        }
-        finally
-        {
-            unlockExclusively();
-        }
+        final Date ts = IndexUtils.getTimestamp( directory );
+        closeReaders();
+        deleteIndexFiles( false );
+        IndexUtils.copyDirectory( directory, indexDirectory );
+        openAndWarmup();
+        // reclaim the index as mine
+        storeDescriptor();
+        updateTimestamp( true, ts );
+        optimize();
     }
 
-    public void merge( Directory directory )
+    @Override
+    public synchronized void merge( Directory directory )
         throws IOException
     {
         merge( directory, null );
     }
 
-    public void merge( Directory directory, DocumentFilter filter )
+    @Override
+    public synchronized void merge( Directory directory, DocumentFilter filter )
         throws IOException
     {
-        lockExclusively();
-
-        IndexSearcher s = acquireIndexSearcher();
+        final IndexSearcher s = acquireIndexSearcher();
         try
         {
-            IndexWriter w = getIndexWriter();
-
-            IndexReader directoryReader = IndexReader.open( directory, true );
-
+            final IndexWriter w = getIndexWriter();
+            final IndexReader directoryReader = IndexReader.open( directory, true );
             TopScoreDocCollector collector = null;
-
             try
             {
                 int numDocs = directoryReader.maxDoc();
-
                 for ( int i = 0; i < numDocs; i++ )
                 {
                     if ( directoryReader.isDeleted( i ) )
@@ -745,20 +655,16 @@ public class DefaultIndexingContext
                     }
 
                     Document d = directoryReader.document( i );
-
                     if ( filter != null && !filter.accept( d ) )
                     {
                         continue;
                     }
 
                     String uinfo = d.get( ArtifactInfo.UINFO );
-
                     if ( uinfo != null )
                     {
                         collector = TopScoreDocCollector.create( 1, false );
-
                         s.search( new TermQuery( new Term( ArtifactInfo.UINFO, uinfo ) ), collector );
-
                         if ( collector.getTotalHits() == 0 )
                         {
                             w.addDocument( IndexUtils.updateDocument( d, this, false ) );
@@ -787,7 +693,6 @@ public class DefaultIndexingContext
             }
 
             rebuildGroups();
-
             Date mergedTimestamp = IndexUtils.getTimestamp( directory );
 
             if ( getTimestamp() != null && mergedTimestamp != null && mergedTimestamp.after( getTimestamp() ) )
@@ -799,13 +704,11 @@ public class DefaultIndexingContext
             {
                 updateTimestamp( true );
             }
-
             optimize();
         }
         finally
         {
             releaseIndexSearcher( s );
-            unlockExclusively();
         }
     }
 
@@ -815,22 +718,22 @@ public class DefaultIndexingContext
         if ( searcherManager != null )
         {
             searcherManager.close();
-
             searcherManager = null;
         }
         if ( indexWriter != null )
         {
             indexWriter.close();
-
             indexWriter = null;
         }
     }
 
+    @Override
     public GavCalculator getGavCalculator()
     {
         return gavCalculator;
     }
 
+    @Override
     public List<IndexCreator> getIndexCreators()
     {
         return Collections.unmodifiableList( indexCreators );
@@ -838,11 +741,10 @@ public class DefaultIndexingContext
 
     // groups
 
-    public void rebuildGroups()
+    @Override
+    public synchronized void rebuildGroups()
         throws IOException
     {
-        lockExclusively();
-
         final IndexSearcher is = acquireIndexSearcher();
         try
         {
@@ -880,70 +782,37 @@ public class DefaultIndexingContext
         finally
         {
             releaseIndexSearcher( is );
-            unlockExclusively();
         }
     }
 
+    @Override
     public Set<String> getAllGroups()
         throws IOException
     {
-        lock();
-
-        try
-        {
-            return getGroups( ArtifactInfo.ALL_GROUPS, ArtifactInfo.ALL_GROUPS_VALUE, ArtifactInfo.ALL_GROUPS_LIST );
-        }
-        finally
-        {
-            unlock();
-        }
+        return getGroups( ArtifactInfo.ALL_GROUPS, ArtifactInfo.ALL_GROUPS_VALUE, ArtifactInfo.ALL_GROUPS_LIST );
     }
 
-    public void setAllGroups( Collection<String> groups )
+    @Override
+    public synchronized void setAllGroups( Collection<String> groups )
         throws IOException
     {
-        lockExclusively();
-
-        try
-        {
-            setGroups( groups, ArtifactInfo.ALL_GROUPS, ArtifactInfo.ALL_GROUPS_VALUE, ArtifactInfo.ALL_GROUPS_LIST );
-            commit();
-        }
-        finally
-        {
-            unlockExclusively();
-        }
+        setGroups( groups, ArtifactInfo.ALL_GROUPS, ArtifactInfo.ALL_GROUPS_VALUE, ArtifactInfo.ALL_GROUPS_LIST );
+        commit();
     }
 
+    @Override
     public Set<String> getRootGroups()
         throws IOException
     {
-        lock();
-
-        try
-        {
-            return getGroups( ArtifactInfo.ROOT_GROUPS, ArtifactInfo.ROOT_GROUPS_VALUE, ArtifactInfo.ROOT_GROUPS_LIST );
-        }
-        finally
-        {
-            unlock();
-        }
+        return getGroups( ArtifactInfo.ROOT_GROUPS, ArtifactInfo.ROOT_GROUPS_VALUE, ArtifactInfo.ROOT_GROUPS_LIST );
     }
 
-    public void setRootGroups( Collection<String> groups )
+    @Override
+    public synchronized void setRootGroups( Collection<String> groups )
         throws IOException
     {
-        lockExclusively();
-
-        try
-        {
-            setGroups( groups, ArtifactInfo.ROOT_GROUPS, ArtifactInfo.ROOT_GROUPS_VALUE, ArtifactInfo.ROOT_GROUPS_LIST );
-            commit();
-        }
-        finally
-        {
-            unlockExclusively();
-        }
+        setGroups( groups, ArtifactInfo.ROOT_GROUPS, ArtifactInfo.ROOT_GROUPS_VALUE, ArtifactInfo.ROOT_GROUPS_LIST );
+        commit();
     }
 
     protected Set<String> getGroups( String field, String filedValue, String listField )
@@ -954,23 +823,17 @@ public class DefaultIndexingContext
         try
         {
             indexSearcher.search( new TermQuery( new Term( field, filedValue ) ), collector );
-
             TopDocs topDocs = collector.topDocs();
-
             Set<String> groups = new LinkedHashSet<String>( Math.max( 10, topDocs.totalHits ) );
-
             if ( topDocs.totalHits > 0 )
             {
                 Document doc = indexSearcher.doc( topDocs.scoreDocs[0].doc );
-
                 String groupList = doc.get( listField );
-
                 if ( groupList != null )
                 {
                     groups.addAll( Arrays.asList( groupList.split( "\\|" ) ) );
                 }
             }
-
             return groups;
         }
         finally
@@ -983,8 +846,7 @@ public class DefaultIndexingContext
                               String groupListField )
         throws IOException, CorruptIndexException
     {
-        IndexWriter w = getIndexWriter();
-
+        final IndexWriter w = getIndexWriter();
         w.updateDocument( new Term( groupField, groupFieldValue ),
             createGroupsDocument( groups, groupField, groupFieldValue, groupListField ) );
     }
@@ -992,14 +854,11 @@ public class DefaultIndexingContext
     protected Document createGroupsDocument( Collection<String> groups, String field, String fieldValue,
                                              String listField )
     {
-        Document groupDoc = new Document();
-
+        final Document groupDoc = new Document();
         groupDoc.add( new Field( field, //
             fieldValue, Field.Store.YES, Field.Index.NOT_ANALYZED ) );
-
         groupDoc.add( new Field( listField, //
             ArtifactInfo.lst2str( groups ), Field.Store.YES, Field.Index.NO ) );
-
         return groupDoc;
     }
 

Modified: maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/context/IndexingContext.java
URL: http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/context/IndexingContext.java?rev=1372383&r1=1372382&r2=1372383&view=diff
==============================================================================
--- maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/context/IndexingContext.java (original)
+++ maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/context/IndexingContext.java Mon Aug 13 12:10:00 2012
@@ -167,7 +167,7 @@ public interface IndexingContext
 
     /**
      * Acquires a fresh instance of {@link IndexSearcher}. You have to release the received instance with
-     * {@link #releaseIndexSearcher(IndexSearcher)}.
+     * {@link #releaseIndexSearcher(IndexSearcher)} otherwise you are about to introduce leak.
      * 
      * @return
      */
@@ -183,7 +183,7 @@ public interface IndexingContext
         throws IOException;
 
     /**
-     * Returns the Lucene IndexWriter of this context.
+     * Returns the Lucene IndexWriter (thread safe, shared instance) of this context.
      * 
      * @return indexWriter
      * @throws IOException
@@ -223,24 +223,13 @@ public interface IndexingContext
         throws IOException;
 
     /**
-     * Optimizes index
+     * Optimizes index. According to Lucene 3.6+ Javadoc, there is no more sense to optimize, so this method might
+     * become "noop".
      */
     void optimize()
         throws IOException;
 
     /**
-     * Performs a shared locking on this context, guaranteeing that no IndexReader/Searcher/Writer close will occur. But
-     * the cost of it is potentially blocking other threads, so stay in critical region locking this context as less as
-     * possible.
-     */
-    void lock();
-
-    /**
-     * Releases the shared lock on this context.
-     */
-    void unlock();
-
-    /**
      * Shuts down this context.
      */
     void close( boolean deleteFiles )

Modified: maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/context/MergedIndexingContext.java
URL: http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/context/MergedIndexingContext.java?rev=1372383&r1=1372382&r2=1372383&view=diff
==============================================================================
--- maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/context/MergedIndexingContext.java (original)
+++ maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/context/MergedIndexingContext.java Mon Aug 13 12:10:00 2012
@@ -100,41 +100,49 @@ public class MergedIndexingContext
         return membersProvider.getMembers();
     }
 
+    @Override
     public String getId()
     {
         return id;
     }
 
+    @Override
     public String getRepositoryId()
     {
         return repositoryId;
     }
 
+    @Override
     public File getRepository()
     {
         return repository;
     }
 
+    @Override
     public String getRepositoryUrl()
     {
         return null;
     }
 
+    @Override
     public String getIndexUpdateUrl()
     {
         return null;
     }
 
+    @Override
     public boolean isSearchable()
     {
         return searchable;
     }
 
+    @Override
     public void setSearchable( boolean searchable )
     {
         this.searchable = searchable;
     }
 
+    @Override
     public Date getTimestamp()
     {
         Date ts = null;
@@ -155,24 +163,28 @@ public class MergedIndexingContext
         return ts;
     }
 
+    @Override
     public void updateTimestamp()
         throws IOException
     {
         // noop
     }
 
+    @Override
     public void updateTimestamp( boolean save )
         throws IOException
     {
         // noop
     }
 
+    @Override
     public void updateTimestamp( boolean save, Date date )
         throws IOException
     {
         // noop
     }
 
+    @Override
     public int getSize()
         throws IOException
     {
@@ -186,6 +198,7 @@ public class MergedIndexingContext
         return size;
     }
 
+    @Override
     public IndexSearcher acquireIndexSearcher()
         throws IOException
     {
@@ -193,6 +206,7 @@ public class MergedIndexingContext
         return new NexusIndexMultiSearcher( mr );
     }
 
+    @Override
     public void releaseIndexSearcher( IndexSearcher indexSearcher )
         throws IOException
     {
@@ -209,14 +223,14 @@ public class MergedIndexingContext
 
     }
 
+    @Override
     public IndexWriter getIndexWriter()
         throws IOException
     {
-        // noop?
-        return null;
-        // throw new UnsupportedOperationException( "Merged indexing context is read-only!" );
+        throw new UnsupportedOperationException( getClass().getName() + " indexing context is read-only!" );
     }
 
+    @Override
     public List<IndexCreator> getIndexCreators()
     {
         HashSet<IndexCreator> creators = new HashSet<IndexCreator>();
@@ -229,96 +243,94 @@ public class MergedIndexingContext
         return new ArrayList<IndexCreator>( creators );
     }
 
+    @Override
     public Analyzer getAnalyzer()
     {
         return new NexusAnalyzer();
     }
 
+    @Override
     public void commit()
         throws IOException
     {
         // noop
     }
 
+    @Override
     public void rollback()
         throws IOException
     {
         // noop
     }
 
+    @Override
     public void optimize()
         throws IOException
     {
         // noop
     }
 
-    public void lock()
-    {
-        for ( IndexingContext ctx : getMembers() )
-        {
-            ctx.lock();
-        }
-    }
-
-    public void unlock()
-    {
-        for ( IndexingContext ctx : getMembers() )
-        {
-            ctx.unlock();
-        }
-    }
-
+    @Override
     public void close( boolean deleteFiles )
         throws IOException
     {
         // noop
     }
 
+    @Override
     public void purge()
         throws IOException
     {
         // noop
     }
 
+    @Override
     public void merge( Directory directory )
         throws IOException
     {
         // noop
     }
 
+    @Override
     public void merge( Directory directory, DocumentFilter filter )
         throws IOException
     {
         // noop
     }
 
+    @Override
     public void replace( Directory directory )
         throws IOException
     {
         // noop
     }
 
+    @Override
     public Directory getIndexDirectory()
     {
         return directory;
     }
 
+    @Override
     public File getIndexDirectoryFile()
     {
         return directoryFile;
     }
 
+    @Override
     public GavCalculator getGavCalculator()
     {
         return gavCalculator;
     }
 
+    @Override
     public void setAllGroups( Collection<String> groups )
         throws IOException
     {
         // noop
     }
 
+    @Override
     public Set<String> getAllGroups()
         throws IOException
     {
@@ -332,12 +344,14 @@ public class MergedIndexingContext
         return result;
     }
 
+    @Override
     public void setRootGroups( Collection<String> groups )
         throws IOException
     {
         // noop
     }
 
+    @Override
     public Set<String> getRootGroups()
         throws IOException
     {
@@ -351,10 +365,10 @@ public class MergedIndexingContext
         return result;
     }
 
+    @Override
     public void rebuildGroups()
         throws IOException
     {
         // noop
     }
-
 }

Modified: maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/packer/DefaultIndexPacker.java
URL: http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/packer/DefaultIndexPacker.java?rev=1372383&r1=1372382&r2=1372383&view=diff
==============================================================================
--- maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/packer/DefaultIndexPacker.java (original)
+++ maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/packer/DefaultIndexPacker.java Mon Aug 13 12:10:00 2012
@@ -108,8 +108,6 @@ public class DefaultIndexPacker
 
         Properties info = null;
 
-        final IndexingContext context = request.getContext();
-
         try
         {
             // Note that for incremental indexes to work properly, a valid index.properties file