Examples of chunk()


Examples of org.sonar.duplications.block.BlockChunker.chunk()

  }

  private static void addToIndex(CloneIndex index, String resourceId, String sourceCode) {
    List<Statement> statements = STATEMENT_CHUNKER.chunk(TOKEN_CHUNKER.chunk(sourceCode));
    BlockChunker blockChunker = new BlockChunker(2);
    List<Block> blocks = blockChunker.chunk(resourceId, statements);
    for (Block block : blocks) {
      index.insert(block);
    }
  }
View Full Code Here

Examples of org.sonar.duplications.internal.pmd.TokenizerBridge.chunk()

      String resourceEffectiveKey = ((DeprecatedDefaultInputFile) inputFile).key();
      FileBlocks fileBlocks = duplicationCache.byComponent(resourceEffectiveKey);
      if (fileBlocks != null) {
        index.insert(inputFile, fileBlocks.blocks());
      } else if (bridge != null) {
        List<Block> blocks2 = bridge.chunk(resourceEffectiveKey, inputFile.file());
        index.insert(inputFile, blocks2);
      }
    }
  }
View Full Code Here

Examples of org.sonar.duplications.statement.StatementChunker.chunk()

      List<Statement> statements;

      Reader reader = null;
      try {
        reader = new InputStreamReader(new FileInputStream(inputFile.file()), fs.encoding());
        statements = statementChunker.chunk(tokenChunker.chunk(reader));
      } catch (FileNotFoundException e) {
        throw new SonarException("Cannot find file " + inputFile.file(), e);
      } finally {
        IOUtils.closeQuietly(reader);
      }
View Full Code Here

Examples of org.sonar.duplications.token.TokenChunker.chunk()

      List<Statement> statements;

      Reader reader = null;
      try {
        reader = new InputStreamReader(new FileInputStream(inputFile.file()), fs.encoding());
        statements = statementChunker.chunk(tokenChunker.chunk(reader));
      } catch (FileNotFoundException e) {
        throw new SonarException("Cannot find file " + inputFile.file(), e);
      } finally {
        IOUtils.closeQuietly(reader);
      }
View Full Code Here

Examples of org.xtreemfs.babudb.replication.service.clients.MasterClient.chunk()

                               
                // request the chunk
                final long pos1 = begin;
                final long size = (end > fileSize) ? fileSize : end;
                final ClientResponseFuture<ReusableBuffer, ErrorCodeResponse> chunkRp =
                    master.chunk(fileName, pos1, size);      
                begin = end;
                chunkRp.registerListener(new ClientResponseAvailableListener<ReusableBuffer>() {
               
                    @Override
                    public void responseAvailable(ReusableBuffer buffer) {
View Full Code Here

Examples of org.xtreemfs.babudb.replication.transmission.client.ReplicationClientAdapter.chunk()

        // setup the client
        ReplicationClientAdapter testClient = new ReplicationClientAdapter(client,
                config.getInetSocketAddress());
       
        // run some test operations
        ReusableBuffer result = testClient.chunk(fileName, offsetStart, offsetEnd).get();
        assertEquals(chunkResult, new String(result.array()));
       
        testClient.heartbeat(lsn, port).get();
    }
   
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.