auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected boolean manageLeftClick(final int canvasX, final int canvasY) { final Point2D ap = convertDOMToGridCoordinate(scenarioGrid, new Point2D(canvasX, canvasY)); final Integer uiColumnIndex = getUiColumnIndex(scenarioGrid, ap.getX()); if (uiColumnIndex == null) { return false; } ScenarioGridColumn scenarioGridColumn = (ScenarioGridColumn) scenarioGrid.getModel().getColumns().get(uiColumnIndex); if (scenarioGridColumn == null) { return false; } if (!manageHeaderLeftClick(uiColumnIndex, scenarioGridColumn, ap)) { final Integer uiRowIndex = CoordinateUtilities.getUiRowIndex(scenarioGrid, ap.getY()); if (uiRowIndex == null) { return false; } else { return manageGridLeftClick(uiRowIndex, uiColumnIndex, scenarioGridColumn); } } else { return true; } }

Target:
protected boolean manageLeftClick(final int canvasX, final int canvasY) { final Point2D gridClickPoint = convertDOMToGridCoordinate(scenarioGrid, new Point2D(canvasX, canvasY)); final Integer uiColumnIndex = getUiColumnIndex(scenarioGrid, gridClickPoint.getX()); if (uiColumnIndex == null) { return false; } ScenarioGridColumn scenarioGridColumn = (ScenarioGridColumn) scenarioGrid.getModel().getColumns().get(uiColumnIndex); if (scenarioGridColumn == null) { return false; } if (!manageHeaderLeftClick(uiColumnIndex, scenarioGridColumn, gridClickPoint)) { final Integer uiRowIndex = getUiRowIndex(scenarioGrid, gridClickPoint.getY()); if (uiRowIndex == null) { return false; } else { return manageGridLeftClick(uiRowIndex, uiColumnIndex, scenarioGridColumn); } } else { return true; } }
Source:
public static Map<TopicPartition, ListOffsetsResultInfo> fetchEndOffsets(final Collection<TopicPartition> partitions, final Admin adminClient, final Duration timeout) { final Map<TopicPartition, ListOffsetsResultInfo> endOffsets; try { final KafkaFuture<Map<TopicPartition, ListOffsetsResultInfo>> future = adminClient.listOffsets( partitions.stream().collect(Collectors.toMap(Function.identity(), tp -> OffsetSpec.latest()))) .all(); if (timeout == null) { endOffsets = future.get(); } else { endOffsets = future.get(timeout.toMillis(), TimeUnit.MILLISECONDS); } } catch (final TimeoutException | RuntimeException | InterruptedException | ExecutionException e) { LOG.warn("listOffsets request failed due to ", e); throw new StreamsException("Unable to obtain end offsets from kafka", e); } return endOffsets; }

Target:
public static Map<TopicPartition, ListOffsetsResultInfo> fetchEndOffsets(final Collection<TopicPartition> partitions, final Admin adminClient, final Duration timeout) { final Map<TopicPartition, ListOffsetsResultInfo> endOffsets; try { final KafkaFuture<Map<TopicPartition, ListOffsetsResultInfo>> future = adminClient.listOffsets( partitions.stream().collect(Collectors.toMap(Function.identity(), tp -> OffsetSpec.latest()))) .all(); if (timeout == null) { endOffsets = future.get(); } else { endOffsets = future.get(timeout.toMillis(), TimeUnit.MILLISECONDS); } } catch (final TimeoutException | RuntimeException | InterruptedException | ExecutionException e) { LOG.warn("listOffsets request failed.", e); throw new StreamsException("Unable to obtain end offsets from kafka", e); } return endOffsets; }
Source:
private void broadcastBlockBreakAnimation(GlowBlock block, int destroyStage) { if (block == null) return; GlowChunk.Key key = new GlowChunk.Key(block.getChunk().getX(), block.getChunk().getZ()); block.getWorld().getRawPlayers().stream().filter(player1 -> player1.canSeeChunk(key)).forEach(player2 -> { if (player2 != this) { player2.sendBlockBreakAnimation(player2, block.getLocation(), destroyStage); } }); }

Target:
private void broadcastBlockBreakAnimation(GlowBlock block, int destroyStage) { GlowChunk.Key key = new GlowChunk.Key(block.getChunk().getX(), block.getChunk().getZ()); block.getWorld().getRawPlayers().stream() .filter(player -> player.canSeeChunk(key) && player != this) .forEach(player -> player.sendBlockBreakAnimation(block.getLocation(), destroyStage)); }
Source:
public Map<Object, Object> loadInitialData() { Map<Object, Object> result = null; FSDataInputStream in = null; BufferedReader bin = null; try { result = Maps.newHashMap(); in = fs.open(filePath); bin = new BufferedReader(new InputStreamReader(in)); String line; int linesCount = 0; while ((line = bin.readLine()) != null) { if ( numInitCachedLines > 0 && linesCount >= numInitCachedLines) { break; } try { Map<String, Object> tuple = extractFields(line); if (tuple != null && !tuple.isEmpty()) { result.put(getKey(tuple), getValue(tuple)); } } catch (Exception parseExp) { logger.info("Unable to parse line {}", line); } ++linesCount; } } catch (IOException e) { throw new RuntimeException(e); } finally { if (bin != null) { IOUtils.closeQuietly(bin); } if (in != null) { IOUtils.closeQuietly(in); } } logger.debug("loading initial data, size: {}", result.size()); return result; }

Target:
public Map<Object, Object> loadInitialData() { Map<Object, Object> result; try ( FSDataInputStream in = fs.open(filePath); BufferedReader bin = new BufferedReader(new InputStreamReader(in)); ) { result = Maps.newHashMap(); String line; int linesCount = 0; while ((line = bin.readLine()) != null && (numInitCachedLines < 0 || linesCount < numInitCachedLines)) { try { Map<String, Object> tuple = extractFields(line); if (tuple != null && !tuple.isEmpty()) { result.put(getKey(tuple), getValue(tuple)); } } catch (Exception parseExp) { throw new RuntimeException(parseExp); } ++linesCount; } } catch (IOException e) { throw new RuntimeException(e); } logger.debug("loading initial data, size: {}", result.size()); return result; }
Source:
public Exchange get(CamelContext camelContext, String key) { try { debug("Getting exchange for key '{}'", key); return toExchange(camelContext, mongoRepo.tryLockAndGet(key, SECONDS.toMillis(waitForLockSec))); } catch (LockWaitTimeoutException e) { throw new RepositoryLockWaitException(format( "Failed to acquire the lock for the key '%s' within timeout of %ds", key, waitForLockSec)); } catch (PessimisticException | MongoException e) { LOGGER.warn("Failed to get the key: ", e); throw new RepositoryUnreachableException(e); } }

Target:
public Exchange get(CamelContext camelContext, String key) { try { debug("Getting exchange for key '{}'", key); return toExchange(camelContext, mongoRepo.tryLockAndGet(key, SECONDS.toMillis(waitForLockSec))); } catch (LockWaitTimeoutException e) { throw new RepositoryLockWaitException(format( "Failed to acquire the lock for the key '%s' within timeout of %ds", key, waitForLockSec), e); } catch (PessimisticException | MongoException e) { LOGGER.warn("Failed to get the key: ", e); throw new RepositoryUnreachableException(e); } }
Source:
protected void addAttributesTo(Map<PropertyDescriptorField, String> attributes) { super.addAttributesTo(attributes); attributes.put(MIN, lowerLimit.toString()); attributes.put(MAX, upperLimit.toString()); }

Target:
protected void addAttributesTo(Map<PropertyDescriptorField, String> attributes) { super.addAttributesTo(attributes); module.addAttributesTo(attributes); }
Source:
private void setRepairLogTruncationHandle(long newHandle, boolean isForLeader) { if (newHandle > m_repairLogTruncationHandle) { m_repairLogTruncationHandle = newHandle; if (m_isLeader || (!m_isLeader && isForLeader)) { if (m_defaultConsistencyReadLevel == ReadLevel.SAFE) { m_bufferedReadLog.releaseBufferedReads(m_mailbox, m_repairLogTruncationHandle); } scheduleRepairLogTruncateMsg(); } } else { if (tmLog.isDebugEnabled()) { tmLog.debug("Updating truncation point from " + TxnEgo.txnIdToString(m_repairLogTruncationHandle) + "to" + TxnEgo.txnIdToString(newHandle)+ " isLeader:" + m_isLeader + " isForLeader:" + isForLeader); } } }

Target:
private void setRepairLogTruncationHandle(long newHandle, boolean isForLeader) { if (newHandle > m_repairLogTruncationHandle) { m_repairLogTruncationHandle = newHandle; if (m_isLeader || isForLeader) { if (m_defaultConsistencyReadLevel == ReadLevel.SAFE) { m_bufferedReadLog.releaseBufferedReads(m_mailbox, m_repairLogTruncationHandle); } scheduleRepairLogTruncateMsg(); } } else { if (tmLog.isDebugEnabled()) { tmLog.debug("Updating truncation point from " + TxnEgo.txnIdToString(m_repairLogTruncationHandle) + "to" + TxnEgo.txnIdToString(newHandle)+ " isLeader:" + m_isLeader + " isForLeader:" + isForLeader); } } }
Source:
public void ensureChannelCount(int capacity) throws IOException { if (totalSize.get() < capacity) { synchronized(this){ if (totalSize.get() < capacity) { ImmutableList.Builder<Channel> channelsBuilder = ImmutableList.builder(); List<Channel> current = channels.get(); channelsBuilder.addAll(current); int unreservedCapacity = capacity - reservedChannelCount; for (int i = current.size(); i < unreservedCapacity; i++) { channelsBuilder.add(factory.create()); } channels.set(channelsBuilder.build()); totalSize.set(capacity); } } } }

Target:
public void ensureChannelCount(int capacity) throws IOException { if (totalSize.get() < capacity) { synchronized(this){ if (totalSize.get() < capacity) { List<Channel> newChannelList = new ArrayList<>(channels.get()); int unreservedCapacity = capacity - reservedChannelCount; while(newChannelList.size() < unreservedCapacity) { newChannelList.add(factory.create()); } setChannels(newChannelList); totalSize.set(capacity); } } } }
Source:
private boolean isAccessible( Type mapperToImplement, Type usedMapper, ExecutableElement method ) { if ( method.getModifiers().contains( Modifier.PRIVATE ) ) { return false; } else if ( method.getModifiers().contains( Modifier.PROTECTED ) ) { return mapperToImplement.isAssignableTo( usedMapper ); } else if ( !method.getModifiers().contains( Modifier.PUBLIC ) ) { return mapperToImplement.getPackageName().equals( usedMapper.getPackageName()); } return true; }

Target:
private boolean isAccessible( Type mapperToImplement, Type usedMapper, ExecutableElement method ) { if ( method.getModifiers().contains( Modifier.PRIVATE ) ) { return false; } else if ( method.getModifiers().contains( Modifier.PROTECTED ) ) { return mapperToImplement.isAssignableTo( usedMapper ) || mapperToImplement.getPackageName().equals( usedMapper.getPackageName() ); } else if ( !method.getModifiers().contains( Modifier.PUBLIC ) ) { return mapperToImplement.getPackageName().equals( usedMapper.getPackageName() ); } return true; }
Source:
public Object execute(final ExecutionEvent event) throws ExecutionException { final Repository repository = getRepository(true, event); if (repository == null) return null; if (!canMerge(repository, event)) return null; MergeTargetSelectionDialog mergeTargetSelectionDialog = new MergeTargetSelectionDialog( getShell(event), repository); if (mergeTargetSelectionDialog.open() == IDialogConstants.OK_ID) { final String refName = mergeTargetSelectionDialog.getRefName(); String jobname = NLS.bind(UIText.MergeAction_JobNameMerge, refName); Job job = new Job(jobname) { @Override protected IStatus run(IProgressMonitor monitor) { try { new MergeOperation(repository, refName) .execute(monitor); } catch (final CoreException e) { Activator .handleError( "Merge impossible, Unsupported Operation", null, true); } return Status.OK_STATUS; } }; job.setUser(true); job.schedule(); } return null; }

Target:
public Object execute(final ExecutionEvent event) throws ExecutionException { final Repository repository = getRepository(true, event); if (repository == null) return null; if (!canMerge(repository, event)) return null; MergeTargetSelectionDialog mergeTargetSelectionDialog = new MergeTargetSelectionDialog( getShell(event), repository); if (mergeTargetSelectionDialog.open() == IDialogConstants.OK_ID) { final String refName = mergeTargetSelectionDialog.getRefName(); String jobname = NLS.bind(UIText.MergeAction_JobNameMerge, refName); final MergeOperation op = new MergeOperation(repository, refName); Job job = new Job(jobname) { @Override protected IStatus run(IProgressMonitor monitor) { try { op.execute(monitor); } catch (final CoreException e) { return e.getStatus(); } return Status.OK_STATUS; } }; job.setUser(true); job.addJobChangeListener(new JobChangeAdapter() { @Override public void done(IJobChangeEvent cevent) { IStatus result = cevent.getJob().getResult(); if (result.getSeverity() == IStatus.CANCEL) { Display.getDefault().asyncExec(new Runnable() { public void run() { try { MessageDialog .openInformation( getShell(event), UIText.MergeAction_MergeCanceledTitle, UIText.MergeAction_MergeCanceledMessage); } catch (ExecutionException e) { Activator .handleError( UIText.MergeAction_MergeCanceledMessage, null, true); } } }); } else if (!result.isOK()) { Activator.handleError(result.getMessage(), result .getException(), true); } else { Display.getDefault().asyncExec(new Runnable() { public void run() { try { MessageDialog .openInformation( getShell(event), UIText.MergeAction_MergeResultTitle, op.getResult().toString()); } catch (ExecutionException e) { Activator.handleError(op.getResult() .toString(), null, true); } } }); } } }); job.schedule(); } return null; }
Source:
public List<Pair<PublicKey, String>> getIdentities() throws IOException { byte cmd = SshAgentConstants.SSH2_AGENTC_REQUEST_IDENTITIES; byte okcmd = SshAgentConstants.SSH2_AGENT_IDENTITIES_ANSWER; if (FactoryManager.AGENT_FORWARDING_TYPE_IETF.equals(channelType)) { cmd = SshAgentConstants.SSH_AGENT_LIST_KEYS; okcmd = SshAgentConstants.SSH_AGENT_KEY_LIST; } Buffer buffer = createBuffer(cmd, 1); buffer = request(prepare(buffer)); int type = buffer.getUByte(); if (type != okcmd) { throw new SshException("Bad agent identities answer: " + SshAgentConstants.getCommandMessageName(type)); } int nbIdentities = buffer.getInt(); if (nbIdentities > 1024) { throw new SshException("Bad identities count: " + nbIdentities); } List<Pair<PublicKey, String>> keys = new ArrayList<>(nbIdentities); for (int i = 0; i < nbIdentities; i++) { PublicKey key = buffer.getPublicKey(); String comment = buffer.getString(); if (log.isDebugEnabled()) { log.debug("getIdentities() key type={}, comment={}, fingerprint={}", KeyUtils.getKeyType(key), comment, KeyUtils.getFingerPrint(key)); } keys.add(new Pair<>(key, comment)); } return keys; }

Target:
public List<Pair<PublicKey, String>> getIdentities() throws IOException { int cmd = SshAgentConstants.SSH2_AGENTC_REQUEST_IDENTITIES; int okcmd = SshAgentConstants.SSH2_AGENT_IDENTITIES_ANSWER; if (FactoryManager.AGENT_FORWARDING_TYPE_IETF.equals(channelType)) { cmd = SshAgentConstants.SSH_AGENT_LIST_KEYS; okcmd = SshAgentConstants.SSH_AGENT_KEY_LIST; } Buffer buffer = createBuffer((byte) cmd, 1); buffer = request(prepare(buffer)); int type = buffer.getUByte(); if (type != okcmd) { throw new SshException("Bad agent identities answer: " + SshAgentConstants.getCommandMessageName(type)); } int nbIdentities = buffer.getInt(); if (nbIdentities > 1024) { throw new SshException("Bad identities count: " + nbIdentities); } List<Pair<PublicKey, String>> keys = new ArrayList<>(nbIdentities); for (int i = 0; i < nbIdentities; i++) { PublicKey key = buffer.getPublicKey(); String comment = buffer.getString(); if (log.isDebugEnabled()) { log.debug("getIdentities() key type={}, comment={}, fingerprint={}", KeyUtils.getKeyType(key), comment, KeyUtils.getFingerPrint(key)); } keys.add(new Pair<>(key, comment)); } return keys; }
Source:
private void loadIntoBuilder(I id) { Optional<S> existingState = load(id); if (existingState.isPresent()) { AbstractStatefulReactor.this.builder = (B) existingState.get() .toBuilder(); } else { AbstractStatefulReactor.this.builder = newStateBuilderWith(id); } }

Target:
private void loadIntoBuilder(I id) { Optional<S> existingState = load(id); AbstractStatefulReactor.this.builder = existingState.isPresent() ? (B) existingState.get() .toBuilder() : newStateBuilderWith(id); }
Source:
private void mockSimpleConsumer(TopicMetadataResponse metadataResponse, OffsetResponse offsetResponse, FetchResponse fetchResponse) { _simpleConsumer = EasyMock.createNiceMock(SimpleConsumer.class); _mocks.add(_simpleConsumer); EasyMock.expect(_simpleConsumer.send((TopicMetadataRequest)EasyMock.anyObject())).andReturn(metadataResponse).times(1); EasyMock.expect(_simpleConsumer.getOffsetsBefore((OffsetRequest)EasyMock.anyObject())).andReturn(offsetResponse).anyTimes(); _simpleConsumer.close(); EasyMock.expectLastCall().andVoid().anyTimes(); EasyMock.expect(_simpleConsumer.clientId()).andReturn(KAFKA_CLIENT_ID).times(1); EasyMock.expect(_simpleConsumer.fetch((FetchRequest)EasyMock.anyObject())).andReturn(fetchResponse).times(1); }

Target:
private void mockSimpleConsumer(TopicMetadataResponse metadataResponse, OffsetResponse offsetResponse, FetchResponse fetchResponse) { _simpleConsumer = EasyMock.createMock(SimpleConsumer.class); _mocks.add(_simpleConsumer); EasyMock.expect(_simpleConsumer.send((TopicMetadataRequest)EasyMock.anyObject())).andReturn(metadataResponse).times(1); EasyMock.expect(_simpleConsumer.getOffsetsBefore((OffsetRequest)EasyMock.anyObject())).andReturn(offsetResponse).anyTimes(); _simpleConsumer.close(); EasyMock.expectLastCall().andVoid().anyTimes(); EasyMock.expect(_simpleConsumer.clientId()).andReturn(KAFKA_CLIENT_ID).times(1); EasyMock.expect(_simpleConsumer.fetch((FetchRequest)EasyMock.anyObject())).andReturn(fetchResponse).times(1); EasyMock.expect(_simpleConsumer.host()).andReturn("dummyHost").anyTimes(); EasyMock.expect(_simpleConsumer.port()).andReturn(8888).anyTimes(); }
Source:
private Constraint characterConflict(ConstraintFactory cf) { return cf.from(ScrabbleCell.class) .filter(sc -> sc.getCharacterSet().size() >= 2) .penalize("Character confict", HardMediumSoftScore.ONE_HARD, sc -> 1 - sc.getCharacterSet().size()); }

Target:
private Constraint characterConflict(ConstraintFactory cf) { return cf.from(ScrabbleCell.class) .filter(sc -> sc.getCharacterSet().size() >= 2) .penalize("Character confict", HardMediumSoftScore.ONE_HARD, sc -> sc.getCharacterSet().size() - 1); }
Source:
public void visitNode(Tree tree) { MethodTree methodTree = (MethodTree) tree; if (hasSemantic() && "equals".equals(methodTree.symbol().name()) && methodTree.parameters().size() == 1 && NullableAnnotationUtils.isAnnotatedNonNull(methodTree.parameters().get(0).symbol())) { reportIssue(methodTree.parameters().get(0), "\"equals\" method parameters should not be marked \"@Nonnull\"."); } }

Target:
public void visitNode(Tree tree) { if (!hasSemantic()) { return; } MethodTree methodTree = (MethodTree) tree; List<VariableTree> params = methodTree.parameters(); if ("equals".equals(methodTree.symbol().name()) && params.size() == 1) { VariableTree variable = params.get(0); if (variable.type().symbolType().is("java.lang.Object") && NullableAnnotationUtils.isAnnotatedNonNull(variable.symbol())) { reportIssue(variable, "\"equals\" method parameters should not be marked \"@Nonnull\"."); } } }
Source:
private void validatePipelineTemplateVersion(String version) { if (StringUtils.isEmpty(version)) { throw new InvalidRequestException("The provided version is empty or null"); } if (!version.matches(VALID_TEMPLATE_VERSION_REGEX)) { throw new InvalidRequestException(String.format("The provided version %s contains illegal characters." + " Pipeline template versions must match %s", version, VALID_TEMPLATE_VERSION_REGEX)); } }

Target:
private void validatePipelineTemplateVersion(String version) { if (!version.matches(VALID_TEMPLATE_VERSION_REGEX)) { throw new InvalidRequestException(String.format("The provided version %s contains illegal characters." + " Pipeline template versions must match %s", version, VALID_TEMPLATE_VERSION_REGEX)); } }
Source:
public void export(final TransactionBase fluoTx, final String queryId, final VisibilityBindingSet result) throws ResultExportException { checkNotNull(fluoTx); checkNotNull(queryId); checkNotNull(result); try { final String pcjId = fluoTx.gets(queryId, FluoQueryColumns.RYA_PCJ_ID); String msg = "out to kafta topic: queryId=" + queryId + " pcjId=" + pcjId + " result=" + result; System.out.println(msg); ProducerRecord<String, VisibilityBindingSet> rec = new ProducerRecord<String, VisibilityBindingSet>( queryId, result); producer.send(rec); System.out.println("producer.send(rec) completed"); } catch (final Throwable e) { throw new ResultExportException("A result could not be exported to Kafka.", e); } }

Target:
public void export(final TransactionBase fluoTx, final String queryId, final VisibilityBindingSet result) throws ResultExportException { checkNotNull(fluoTx); checkNotNull(queryId); checkNotNull(result); try { final String pcjId = fluoTx.gets(queryId, FluoQueryColumns.RYA_PCJ_ID); String msg = "out to kafta topic: queryId=" + queryId + " pcjId=" + pcjId + " result=" + result; log.info(msg); ProducerRecord<String, VisibilityBindingSet> rec = new ProducerRecord<String, VisibilityBindingSet>( queryId, result); producer.send(rec); log.debug("producer.send(rec) completed"); } catch (final Throwable e) { throw new ResultExportException("A result could not be exported to Kafka.", e); } }
Source:
public boolean equals(Object obj) { if (obj == this) { return true; } else if (obj instanceof EvalParameters) { EvalParameters evalParameters = (EvalParameters) obj; return Arrays.equals(params, evalParameters.params) && numOutcomes == evalParameters.numOutcomes && correctionConstant == evalParameters.correctionConstant && constantInverse == evalParameters.constantInverse && correctionParam == evalParameters.correctionParam; } else { return false; } }

Target:
public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof EvalParameters) { EvalParameters evalParameters = (EvalParameters) obj; return Arrays.equals(params, evalParameters.params) && numOutcomes == evalParameters.numOutcomes && correctionConstant == evalParameters.correctionConstant && constantInverse == evalParameters.constantInverse && correctionParam == evalParameters.correctionParam; } return false; }
Source:
public static void generateKitchenSink(final TinkerGraph graph) { final GraphTraversalSource g = graph.traversal(); g.addV("loops").property(T.id, 1000).property("name", "loop").as("me"). addE("self").to("me"). iterate(); final String LABEL = "message_passing_test"; final String EDGE_LABEL = "msg_pass_test_edge"; final String PROPERTY_IN = "propertyin"; Vertex a = graph.addVertex(T.id, 2000, T.label, LABEL, PROPERTY_IN, "a"); Vertex b = graph.addVertex(T.id, 2001, T.label, LABEL, PROPERTY_IN, "b"); a.addEdge(EDGE_LABEL, b); a.addEdge(EDGE_LABEL, a); }

Target:
public static void generateKitchenSink(final TinkerGraph graph) { final GraphTraversalSource g = graph.traversal(); g.addV("loops").property(T.id, 1000).property("name", "loop").as("me"). addE("self").to("me"). iterate(); final String LABEL = "message_passing_test"; final String EDGE_LABEL = "msg_pass_test_edge"; final String PROPERTY_IN = "name"; final Vertex a = graph.addVertex(T.id, 2000, T.label, LABEL, PROPERTY_IN, "a"); final Vertex b = graph.addVertex(T.id, 2001, T.label, LABEL, PROPERTY_IN, "b"); a.addEdge(EDGE_LABEL, b); a.addEdge(EDGE_LABEL, a); }
Source:
private void migrate() throws SQLException { if(!validateDatabase(false)) throw new SchemaMigrationException("Target database is empty, please consider executing with \"create\" option"); flyway.migrate(); }

Target:
private void migrate() throws SQLException { try (Connection connection = flyway.getDataSource().getConnection()) { if (isDatabaseEmpty(connection)) throw new SchemaMigrationException("Target database is empty and no previous versions found, use the \"create\" option."); } flyway.migrate(); }
Source:
void setup() { b1 = new BibEntry(); b2 = new BibEntry(); bList = new ArrayList<>(); b2.setField(StandardField.DOI, "10.1007/s11616-005-0142-4"); b2.setField(StandardField.CITING, "test"); b2.setField(StandardField.CITEDBY, "test"); bList.add(b1); bList.add(b2); }

Target:
void setup() { bibEntry = new BibEntry().withField(StandardField.DOI, "10.1007/s11616-005-0142-4") .withField(StandardField.CITING, "test") .withField(StandardField.CITEDBY, "test"); bList = new ArrayList<>(); bList.add(new BibEntry()); bList.add(bibEntry); }
Source:
public void testBAMThroughCRAMRoundTripViaPath() throws IOException, NoSuchAlgorithmException { final File TEST_DATA_DIR = new File("src/test/resources/htsjdk/samtools/cram"); final File originalBAMInputFile = new File(TEST_DATA_DIR, "CEUTrio.HiSeq.WGS.b37.NA12878.20.first.8000.bam"); final File referenceFile = new File(TEST_DATA_DIR, "human_g1k_v37.20.subset.fasta"); List<SAMRecord> originalBAMRecords = getSAMRecordsFromFile(originalBAMInputFile, referenceFile); for (int i = 0; i < originalBAMRecords.size(); i++) { originalBAMRecords.get(i).setIndexingBin(null); } final File tempCRAMFile = File.createTempFile("testBAMThroughCRAMRoundTrip", CramIO.CRAM_FILE_EXTENSION); tempCRAMFile.deleteOnExit(); SAMFileHeader samHeader = getFileHeader(originalBAMInputFile, referenceFile); writeRecordsToPath(originalBAMRecords, tempCRAMFile, referenceFile, samHeader); List<SAMRecord> cramRecords = getSAMRecordsFromFile(tempCRAMFile, referenceFile); Assert.assertEquals(cramRecords.size(), originalBAMRecords.size()); for (int i = 0; i < originalBAMRecords.size(); i++) { Assert.assertEquals(originalBAMRecords.get(i), cramRecords.get(i)); } }

Target:
public void testBAMThroughCRAMRoundTripViaPath() throws IOException, NoSuchAlgorithmException { final File TEST_DATA_DIR = new File("src/test/resources/htsjdk/samtools/cram"); final File originalBAMInputFile = new File(TEST_DATA_DIR, "CEUTrio.HiSeq.WGS.b37.NA12878.20.first.8000.bam"); final File referenceFile = new File(TEST_DATA_DIR, "human_g1k_v37.20.subset.fasta"); List<SAMRecord> originalBAMRecords = getSAMRecordsFromFile(originalBAMInputFile, referenceFile); for (int i = 0; i < originalBAMRecords.size(); i++) { originalBAMRecords.get(i).setIndexingBin(null); } try (FileSystem jimfs = Jimfs.newFileSystem(Configuration.unix())) { final Path tempCRAM = jimfs.getPath("testBAMThroughCRAMRoundTrip" + CramIO.CRAM_FILE_EXTENSION); SAMFileHeader samHeader = getFileHeader(originalBAMInputFile, referenceFile); writeRecordsToPath(originalBAMRecords, tempCRAM, referenceFile, samHeader); List<SAMRecord> cramRecords = getSAMRecordsFromPath(tempCRAM, referenceFile); Assert.assertEquals(cramRecords.size(), originalBAMRecords.size()); for (int i = 0; i < originalBAMRecords.size(); i++) { Assert.assertEquals(originalBAMRecords.get(i), cramRecords.get(i)); } } }
Source:
public Method getOnOpenMethod(Object webSocketEndpoint) { Method[] methods = webSocketEndpoint.getClass().getMethods(); for (Method method : methods) { if (method.isAnnotationPresent(OnOpen.class)) { return method; } } return null; }

Target:
public Optional<Method> getOnOpenMethod(Object webSocketEndpoint) { Method[] methods = webSocketEndpoint.getClass().getMethods(); Method returnMethod = null; for (Method method : methods) { if (method.isAnnotationPresent(OnOpen.class)) { returnMethod = method; break; } } return Optional.ofNullable(returnMethod); }
Source:
private void initializeVcfDataSource() { if ( INTERVAL_ITERATOR ) { vcfFileReader = new VCFFileReader(VCF, true); if (!vcfFileReader.isQueryable()) { throw new PicardException("Cannot query VCF File! VCF Files must be queryable!"); } } else { vcfIterator = new PeekableIterator<>( VCF == null ? Collections.emptyIterator() : new VCFFileReader(VCF, true).iterator()); } }

Target:
private void initializeVcfDataSource() { if ( INTERVAL_ITERATOR ) { vcfFileReader = new VCFFileReader(VCF, true); if (!vcfFileReader.isQueryable()) { throw new PicardException("Cannot query VCF File! VCF Files must be queryable! Please index input VCF and re-run."); } } else { vcfIterator = new PeekableIterator<>( VCF == null ? Collections.emptyIterator() : new VCFFileReader(VCF, true).iterator()); } }
Source:
protected boolean processStatement(DDLStatement ddlStatement, Database db, DdlProceduresToLoad whichProcs) throws VoltCompilerException { Matcher statementMatcher = SQLParser.matchDropAggregateFunction(ddlStatement.statement); if (! statementMatcher.matches()) { return false; } String functionName = checkIdentifierStart(statementMatcher.group(1), ddlStatement.statement).toLowerCase(); boolean ifExists = statementMatcher.group(2) != null; if ( ! removeUDAFInSchema(functionName)) { if ( ! ifExists ) { throw m_compiler.new VoltCompilerException(String.format( "Function name \"%s\" in DROP AGGREGATE FUNCTION statement does not exist.", functionName)); } } FunctionForVoltDB.deregisterUserDefinedFunction(functionName); return true; }

Target:
protected boolean processStatement(DDLStatement ddlStatement, Database db, DdlProceduresToLoad whichProcs) throws VoltCompilerException { Matcher statementMatcher = SQLParser.matchDropAggregateFunction(ddlStatement.statement); if (!statementMatcher.matches()) { return false; } String functionName = checkIdentifierStart(statementMatcher.group(1), ddlStatement.statement).toLowerCase(); boolean ifExists = statementMatcher.group(2) != null; if (!removeUDAFInSchema(functionName) && !ifExists) { throw m_compiler.new VoltCompilerException(String.format( "Function name \"%s\" in DROP AGGREGATE FUNCTION statement does not exist.", functionName)); } FunctionForVoltDB.deregisterUserDefinedFunction(functionName); return true; }
Source:
protected boolean isExpired(IndexValue value){ if (value.getTimeToLiveInMs() != Utils.Infinite_Time && time.milliseconds() > value.getTimeToLiveInMs()) { return true; } return false; }

Target:
private boolean isExpired(IndexValue value){ return value.getTimeToLiveInMs() != Utils.Infinite_Time && time.milliseconds() > value.getTimeToLiveInMs(); }
Source:
protected void initialize() { if (fields != null) { Iterator<FieldEditor> e = fields.iterator(); IPreferenceStore pagePreferenceStore = getPreferenceStore(); while (e.hasNext()) { FieldEditor pe = e.next(); pe.setPage(this); pe.setPropertyChangeListener(this); if (pe.getPreferenceStore() == null) { pe.setPreferenceStore(pagePreferenceStore); } pe.load(); } } }

Target:
protected void initialize() { if (fields != null) { Iterator<FieldEditor> e = fields.iterator(); while (e.hasNext()) { FieldEditor pe = e.next(); pe.setPage(this); pe.setPropertyChangeListener(this); if (pe.getPreferenceStore() == null) { pe.setPreferenceStore(getPreferenceStore()); } pe.load(); } } }
Source:
private static final List<NamedElement> getNamedElements(final List<String> nameFragments, final Namespace scope, final EClass clazz) { final List<NamedElement> resolvedNamedElements = new ArrayList<NamedElement>(); Iterator<NamedElement> members = scope.getMembers().iterator(); while(members.hasNext()) { final NamedElement member = members.next(); final List<String> memberNames = scope.getNamesOfMember(member); final String firstNameFragment = nameFragments.get(0); for (final String memberName : memberNames) { if (memberName.equals(firstNameFragment)) { if (nameFragments.size() == 1) { if (clazz != null) { if (clazz.isSuperTypeOf(member.eClass())) { resolvedNamedElements.add(member); } } else { resolvedNamedElements.add(member); } } else { if (member instanceof Namespace) { final List<String> remainingNameFragments = nameFragments.subList(1, nameFragments.size()); resolvedNamedElements.addAll(NameResolutionUtils.getNamedElements(remainingNameFragments, (Namespace) member, clazz)); } } } } } return resolvedNamedElements; }

Target:
private static final List<NamedElement> getNamedElements(final List<String> nameFragments, final Namespace scope, final EClass clazz) { final List<NamedElement> resolvedNamedElements = new ArrayList<NamedElement>(); for (final NamedElement member : scope.getMembers()) { final List<String> memberNames = scope.getNamesOfMember(member); final String firstNameFragment = nameFragments.get(0); for (final String memberName : memberNames) { if (memberName.equals(firstNameFragment)) { if (nameFragments.size() == 1) { if (clazz != null) { if (clazz.isSuperTypeOf(member.eClass())) { resolvedNamedElements.add(member); } } else { resolvedNamedElements.add(member); } } else { if (member instanceof Namespace) { final List<String> remainingNameFragments = nameFragments.subList(1, nameFragments.size()); resolvedNamedElements.addAll(NameResolutionUtils.getNamedElements(remainingNameFragments, (Namespace) member, clazz)); } } } } } return resolvedNamedElements; }
Source:
@Override public Pair<RelTraitSet, List<RelTraitSet>> deriveTraits( final RelTraitSet childTraits, final int childId) { if (childId > 0) { return null; } RelCollation collation = childTraits.getCollation(); if (collation == null || collation == RelCollations.EMPTY || joinType == JoinRelType.FULL || joinType == JoinRelType.RIGHT) { return null; } final int colCount = collation.getFieldCollations().size(); final int keyCount = joinInfo.leftKeys.size(); if (colCount < keyCount || keyCount == 0) { return null; } if (colCount > keyCount) { collation = RelCollations.of(collation.getFieldCollations().subList(0, keyCount)); } ImmutableBitSet childCollationKeys = ImmutableBitSet.of( RelCollations.ordinals(collation)); ImmutableBitSet keySet = ImmutableBitSet.of(joinInfo.leftKeys); if (!childCollationKeys.equals(keySet)) { return null; } return Pair.of( getTraitSet().replace(collation), ImmutableList.of(childTraits, right.getTraitSet())); }

Target:
@Override public Pair<RelTraitSet, List<RelTraitSet>> deriveTraits( final RelTraitSet childTraits, final int childId) { assert childId == 0; RelCollation collation = childTraits.getCollation(); if (collation == null || collation == RelCollations.EMPTY) { return null; } RelTraitSet derivedTraits = getTraitSet().replace(collation); return Pair.of( derivedTraits, ImmutableList.of(derivedTraits, right.getTraitSet())); }
Source:
protected void recoverCssStyle(StyleInfo si) { if (si == null) { return; } try { Styles.handler("css"); } catch (Exception e) { return; } long favorSLDIfNewerByMS = 600000; if (!"css".equalsIgnoreCase(si.getFormat())) { String filename = si.getFilename(); String filenameCss = filename.substring(0, filename.lastIndexOf('.')) + ".css"; GeoServerDataDirectory g = new GeoServerDataDirectory(getCatalog().getResourceLoader()); Resource cssResource = g.get(si, filenameCss); if (!cssResource.getType().equals(Resource.Type.UNDEFINED)) { Resource sldResource = g.get(si, filename); long sldNewerByMs = sldResource.lastmodified() - cssResource.lastmodified(); if (sldNewerByMs > favorSLDIfNewerByMS) { LOGGER.log(Level.WARNING, "A CSS version of this style has been recovered (" + filenameCss + "), but the SLD is more recent by " + sldNewerByMs + " ms. The style will be left as an SLD."); } else { LOGGER.log(Level.WARNING, "A CSS version of this style has been recovered (" + filenameCss + "). The style will be converted to CSS."); si.setFilename(filenameCss); si.setFormat("css"); getCatalog().save(si); } } } }

Target:
protected void recoverCssStyle(StyleInfo si) { if (si == null) { return; } try { Styles.handler("css"); } catch (Exception e) { return; } long favorSLDIfNewerByMS = 600000; if ("sld".equalsIgnoreCase(si.getFormat())) { String filename = si.getFilename(); String filenameCss = filename.substring(0, filename.lastIndexOf('.')) + ".css"; GeoServerDataDirectory dataDir = new GeoServerDataDirectory( getCatalog().getResourceLoader()); Resource cssResource = dataDir.get(si, filenameCss); if (!cssResource.getType().equals(Resource.Type.UNDEFINED)) { Resource sldResource = dataDir.get(si, filename); long sldNewerByMs = sldResource.lastmodified() - cssResource.lastmodified(); if (sldNewerByMs > favorSLDIfNewerByMS) { LOGGER.log(Level.WARNING, "A CSS version of " + si.getName() + " has been recovered (" + filenameCss + "), but the SLD is more recent by " + sldNewerByMs + " ms. The style will be left as an SLD."); } else { LOGGER.log(Level.WARNING, "A CSS version of " + si.getName() + " has been recovered (" + filenameCss + "). The style will be converted to CSS."); si.setFilename(filenameCss); si.setFormat("css"); getCatalog().save(si); } } } }
Source:
public DefaultExecutionSlotAllocator( final SlotProviderStrategy slotProviderStrategy, final PreferredLocationsRetriever preferredLocationsRetriever) { super(preferredLocationsRetriever); this.slotProviderStrategy = checkNotNull(slotProviderStrategy); }

Target:
DefaultExecutionSlotAllocator( final SlotProviderStrategy slotProviderStrategy, final PreferredLocationsRetriever preferredLocationsRetriever) { super(preferredLocationsRetriever); this.slotProviderStrategy = checkNotNull(slotProviderStrategy); }
Source:
private JsonObject toJSONObject(ServerConsumer consumer) throws Exception { JsonObjectBuilder obj = JsonLoader.createObjectBuilder().add("consumerID", consumer.getID()) .add("connectionID", consumer.getConnectionID().toString()) .add("sessionID", consumer.getSessionID()) .add("queueName", consumer.getQueue().getName().toString()) .add("browseOnly", consumer.isBrowseOnly()) .add("creationTime", consumer.getCreationTime()) .add("deliveringCount", consumer.getDeliveringMessages().size()); if (consumer.getFilter() != null) { obj.add("filter", consumer.getFilter().getFilterString().toString()); } String coreAddress = consumer.getQueue().getAddress().toString(); String[] result = new String[2]; if (coreAddress.startsWith("jms.queue.")) { result[0] = coreAddress.substring("jms.queue.".length()); result[1] = "queue"; } else if (coreAddress.startsWith("jms.tempqueue.")) { result[0] = coreAddress.substring("jms.tempqueue.".length()); result[1] = "tempqueue"; } else if (coreAddress.startsWith("jms.topic.")) { result[0] = coreAddress.substring("jms.topic.".length()); result[1] = "topic"; } else if (coreAddress.startsWith("jms.temptopic.")) { result[0] = coreAddress.substring("jms.temptopic.".length()); result[1] = "temptopic"; } else { logger.debug("Unable to determine the JMS destination of " + coreAddress); result[0] = ""; result[1] = ""; } obj.add("destinationName", result[0]) .add("destinationType", result[1]) .add("durable", consumer.getQueue().isDurable()); return obj.build(); }

Target:
private JsonObject toJSONObject(ServerConsumer consumer) throws Exception { JsonObjectBuilder obj = JsonLoader.createObjectBuilder().add("consumerID", consumer.getID()).add("connectionID", consumer.getConnectionID().toString()).add("sessionID", consumer.getSessionID()).add("queueName", consumer.getQueue().getName().toString()).add("browseOnly", consumer.isBrowseOnly()).add("creationTime", consumer.getCreationTime()).add("deliveringCount", consumer.getDeliveringMessages().size()); if (consumer.getFilter() != null) { obj.add("filter", consumer.getFilter().getFilterString().toString()); } obj.add("destinationName", consumer.getQueue().getAddress().toString()); if (consumer.getQueueType().getType() == 0) { obj.add("destinationType", "topic"); } else if (consumer.getQueueType().getType() == 1) { obj.add("destinationType", "queue"); } else { obj.add("destinationType", ""); } obj.add("durable", consumer.getQueue().isDurable()); return obj.build(); }
Source:
private boolean showSubmergeDialog( final String message, final AtomicReference<Territory> retreatTo) { final String ok = "Submerge"; final String cancel = "Remain"; final String wait = "Ask Me Later"; final String[] options = {ok, cancel, wait}; final int choice = JOptionPane.showOptionDialog( BattleDisplay.this, message, "Submerge Subs?", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, cancel); if (choice == JOptionPane.CLOSED_OPTION) { return false; } if (choice == JOptionPane.CANCEL_OPTION) { return false; } if (choice == JOptionPane.NO_OPTION) { return true; } retreatTo.set(battleLocation); return true; }

Target:
private boolean showSubmergeDialog( final String message, final AtomicReference<Territory> retreatTo) { final String ok = "Submerge"; final String cancel = "Remain"; final String wait = "Ask Me Later"; final String[] options = {ok, cancel, wait}; final int choice = JOptionPane.showOptionDialog( BattleDisplay.this, message, "Submerge Subs?", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, options, cancel); if (choice == JOptionPane.CLOSED_OPTION || choice == JOptionPane.CANCEL_OPTION) { return false; } if (choice == JOptionPane.NO_OPTION) { return true; } retreatTo.set(battleLocation); return true; }
Source:
public ResponseEntity<?> getInvoiceInfo( @ApiParam(required = true, value = "metasfreshId of the invoice") @PathVariable("invoiceId") final int invoiceRecordId) { final InvoiceId invoiceId = InvoiceId.ofRepoIdOrNull(invoiceRecordId); if (invoiceId == null) { return ResponseEntity.notFound().build(); } final JSONInvoiceInfoResponse invoiceInfo = invoiceService.getInvoiceInfo(invoiceId, Env.getAD_Language()); return ResponseEntity.ok(invoiceInfo); }

Target:
public ResponseEntity<?> getInvoiceInfo( @ApiParam(required = true, value = "metasfreshId of the invoice") @PathVariable("invoiceId") final int invoiceRecordId) { final InvoiceId invoiceId = InvoiceId.ofRepoIdOrNull(invoiceRecordId); if (invoiceId == null) { return ResponseEntity.notFound().build(); } final String ad_language = Env.getAD_Language(); try { final JSONInvoiceInfoResponse invoiceInfo = invoiceService.getInvoiceInfo(invoiceId, ad_language); return ResponseEntity.ok(invoiceInfo); } catch (final Exception ex) { final JsonError error = JsonError.ofSingleItem(JsonErrors.ofThrowable(ex, ad_language)); return ResponseEntity.unprocessableEntity().body(error); } }
Source:
public List<T> subList(final int fridx, final int toidx) { try { return this.origin.subList(fridx, toidx); } catch (final IndexOutOfBoundsException ex) { throw new IllegalArgumentException(this.message, ex); } }

Target:
public List<T> subList(final int fridx, final int toidx) { try { return this.origin.subList(fridx, toidx); } catch (final IndexOutOfBoundsException ex) { throw this.wrapException(ex); } }
Source:
public String getActionInfo() { String style = ""; if (message.toLowerCase(Locale.ENGLISH).contains(Const.ACTION_RESULT_FAILURE.toLowerCase(Locale.ENGLISH)) || message.toLowerCase(Locale.ENGLISH).contains( Const.ACTION_RESULT_SYSTEM_ERROR_REPORT.toLowerCase(Locale.ENGLISH))) { style = "text-danger"; } else { style = "text-success bold"; } return "<a href=\"" + getUrlToShow() + "\" class=\"" + style + "\" target=\"_blank\">" + servletName + "</a>"; }

Target:
public String getActionInfo() { String style = ""; if (message.toLowerCase().contains(Const.ACTION_RESULT_FAILURE.toLowerCase()) || message.toLowerCase().contains(Const.ACTION_RESULT_SYSTEM_ERROR_REPORT.toLowerCase())) { style = "text-danger"; } else { style = "text-success bold"; } return "<a href=\"" + getUrlToShow() + "\" class=\"" + style + "\" target=\"_blank\">" + servletName + "</a>"; }
Source:
public QueryManager() { this.queries = Multimaps.synchronizedSetMultimap( HashMultimap.<String, ListenableFuture>create() ); this.queryDatasources = Maps.newHashMap(); }

Target:
public QueryManager() { this.queries = Multimaps.synchronizedSetMultimap( HashMultimap.<String, ListenableFuture>create() ); this.queryDatasources = Multimaps.synchronizedSetMultimap( HashMultimap.<String, String>create() ); }
Source:
public void addServiceTypes(Editable mServiceNameText, Editable mServiceDiscriptionText, Editable mServiceDurationText) { Services services=new Services(); services.setName(String.valueOf(mServiceNameText)); services.setDuration(Integer.valueOf(String.valueOf(mServiceDurationText))); services.setDescription(String.valueOf(mServiceDiscriptionText)); RestApi restApi = RestServiceBuilder.createService(RestApi.class); Call<Services> call = restApi.newServiceTypes(services); call.enqueue(new Callback<Services>() { @Override public void onResponse(Call<Services> call, Response<Services> response) { if (response.isSuccessful()) { mFormAddEditServiceView.endActivity(); } } @Override public void onFailure(Call<Services> call, Throwable t) { Log.e("jaasvk", String.valueOf(t)); } }); }

Target:
public void addServiceTypes(Editable mServiceNameText, Editable mServiceDiscriptionText, Editable mServiceDurationText) { Services services=new Services(); services.setName(String.valueOf(mServiceNameText)); services.setDuration(Integer.valueOf(mServiceDurationText.toString())); services.setDescription(String.valueOf(mServiceDiscriptionText)); RestApi restApi = RestServiceBuilder.createService(RestApi.class); Call<Services> call = restApi.newServiceTypes(services); call.enqueue(new Callback<Services>() { @Override public void onResponse(Call<Services> call, Response<Services> response) { if (response.isSuccessful()) { mFormAddEditServiceView.endActivity(); } } @Override public void onFailure(Call<Services> call, Throwable t) { } }); }
Source:
public void update() throws BankChoiceException, BankException, LoginException { super.update(); if (username == null || password == null || username.length() == 0 || password.length() == 0) { throw new LoginException(res.getText(R.string.invalid_username_password).toString()); } urlopen = login(); try { Account account = new Account(res.getText(R.string.balance).toString(), Helpers.parseBalance(userInfo.getString("balance")), "1"); accounts.add(account); balance = balance.add(account.getBalance()); } catch (JSONException e) { e.printStackTrace(); throw new BankException(res.getText(R.string.no_accounts_found).toString()); } super.updateComplete(); }

Target:
public void update() throws BankChoiceException, BankException, LoginException { super.update(); if (username == null || password == null || username.length() == 0 || password.length() == 0) { throw new LoginException(res.getText(R.string.invalid_username_password).toString()); } urlopen = login(); try { Account account = new Account(res.getText(R.string.balance).toString(), Helpers.parseBalance(userInfo.getString("balance")), "1"); accounts.add(account); } catch (JSONException e) { e.printStackTrace(); throw new BankException(res.getText(R.string.no_accounts_found).toString()); } super.updateComplete(); }
Source:
protected void runImpl() throws IOException, Failure { final Set<AccountGroup.Id> receiveGroup = getServerCommandConfig().getReceiveGroup(); if (receiveGroup != null && !receiveGroup.isEmpty()) { if (!CollectionsUtil.isAnyIncludedIn(currentUser.getEffectiveGroups(), receiveGroup)) { throw new Failure(1, "User: " + currentUser.getUserName() + " not allowed to execute this command on this server"); } } final ReceiveCommits receive = factory.create(projectControl, repo); ReceiveCommits.Capable r = receive.canUpload(); if (r != ReceiveCommits.Capable.OK) { throw new UnloggedFailure(1, "\nfatal: " + r.getMessage()); } verifyProjectVisible("reviewer", reviewerId); verifyProjectVisible("CC", ccId); receive.addReviewers(reviewerId); receive.addExtraCC(ccId); final ReceivePack rp = receive.getReceivePack(); rp.setRefLogIdent(currentUser.newRefLogIdent()); rp.setTimeout(config.getTimeout()); try { rp.receive(in, out, err); } catch (InterruptedIOException err) { throw new Failure(128, "fatal: client IO read/write timeout", err); } }

Target:
protected void runImpl() throws IOException, Failure { if (!projectControl.canPerformPackAction(receiveGroup)) { throw new Failure(1, "fatal: receive-pack not permitted on this server"); } final ReceiveCommits receive = factory.create(projectControl, repo); ReceiveCommits.Capable r = receive.canUpload(); if (r != ReceiveCommits.Capable.OK) { throw new UnloggedFailure(1, "\nfatal: " + r.getMessage()); } verifyProjectVisible("reviewer", reviewerId); verifyProjectVisible("CC", ccId); receive.addReviewers(reviewerId); receive.addExtraCC(ccId); final ReceivePack rp = receive.getReceivePack(); rp.setRefLogIdent(currentUser.newRefLogIdent()); rp.setTimeout(config.getTimeout()); try { rp.receive(in, out, err); } catch (InterruptedIOException err) { throw new Failure(128, "fatal: client IO read/write timeout", err); } }
Source:
public VcsChangeMarkerRender getVcsChangeMarkersRender() { OrionTextViewOverlay textView = editorWidget.getTextView(); if (vcsChangeMarkerRender == null) { stream(textView.getRulers()) .filter(ruler -> "ruler folding".equals(ruler.getStyle().getStyleClass())) .findAny() .ifPresent( ruler -> vcsChangeMarkerRender = vcsChangeMarkerRenderFactory.create( new OrionVcsChangeMarkersRuler(ruler, editorWidget.getEditor()))); } return vcsChangeMarkerRender; }

Target:
public VcsChangeMarkerRender getVcsChangeMarkersRender() { return this.vcsChangeMarkerRender; }