auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public StageResult processAckOnMaster(List<DistStageAck> acks) { StageResult result = super.processAckOnMaster(acks); if (result.isError()) return result; Report report = masterState.getReport(); Report.Test test = report.createTest("Stream_Stage", null, true); int testIteration = test.getIterations().size(); Map<Integer, Report.SlaveResult> numberOfResultKeysResult = new HashMap<>(); Map<Integer, Report.SlaveResult> durationsResult = new HashMap<>(); for (StreamStageAck ack : Projections.instancesOf(acks, StreamStageAck.class)) { if (ack.stats != null) { DataOperationStats opStats = (DataOperationStats) ack.stats.getOperationsStats().get(Streamable.STREAMABLE.name); opStats.setTotalBytes((Long) masterState.get(totalBytesKey)); test.addStatistics(testIteration, ack.getSlaveIndex(), Collections.singletonList(ack.stats)); durationsResult.put(ack.getSlaveIndex(), new Report.SlaveResult(opStats.getResponseTimes(), false)); test.addResult(testIteration, new Report.TestResult("Stream task durations", durationsResult, "", false)); } if (ack.numberOfResultKeys != null) { numberOfResultKeysResult.put(ack.getSlaveIndex(), new Report.SlaveResult(ack.numberOfResultKeys, false)); test.addResult(testIteration, new Report.TestResult("Key count in stream result map", numberOfResultKeysResult, "", false)); } } return StageResult.SUCCESS; }

Target:
public StageResult processAckOnMaster(List<DistStageAck> acks) { StageResult result = super.processAckOnMaster(acks); if (result.isError()) return result; Report report = masterState.getReport(); Report.Test test = report.createTest(testName, null, true); int testIteration = test.getIterations().size(); Map<Integer, Report.SlaveResult> numberOfResultKeysResult = new HashMap<>(); Map<Integer, Report.SlaveResult> durationsResult = new HashMap<>(); for (StreamStageAck ack : Projections.instancesOf(acks, StreamStageAck.class)) { if (ack.stats != null) { DataOperationStats opStats = (DataOperationStats) ack.stats.getOperationsStats().get(Streamable.STREAMABLE.name); opStats.setTotalBytes((Long) masterState.get(totalBytesKey)); test.addStatistics(testIteration, ack.getSlaveIndex(), Collections.singletonList(ack.stats)); durationsResult.put(ack.getSlaveIndex(), new Report.SlaveResult(opStats.getResponseTimes(), false)); test.addResult(testIteration, new Report.TestResult("Stream task durations on slave" + ack.getSlaveIndex(), durationsResult, "", false)); } if (ack.numberOfResultKeys != null) { numberOfResultKeysResult.put(ack.getSlaveIndex(), new Report.SlaveResult(ack.numberOfResultKeys, false)); test.addResult(testIteration, new Report.TestResult("Key count in stream result map on slave" + ack.getSlaveIndex(), numberOfResultKeysResult, "", false)); } } return StageResult.SUCCESS; }
Source:
public void onMessage(Message message) { try { log.infof("onMessage received message: %s '%s'", message, ((TextMessage) message).getText()); final Destination replyTo = message.getJMSReplyTo(); if (replyTo == null) { throw new RuntimeException("ReplyTo info in message was not specified" + " and bean does not know where to reply to"); } TxTestUtil.enlistTestXAResource(tm.getTransaction()); try ( JMSContext context = factory.createContext() ) { context.createProducer() .setJMSCorrelationID(message.getJMSMessageID()) .send(replyTo, REPLY_PREFIX + ((TextMessage) message).getText()); } TxTestUtil.waitForTimeout(tm); } catch (Exception e) { throw new RuntimeException("onMessage method execution failed", e); } }

Target:
public void onMessage(Message message) { try { log.tracef("onMessage received message: %s '%s'", message, ((TextMessage) message).getText()); final Destination replyTo = message.getJMSReplyTo(); if (replyTo == null) { throw new RuntimeException("ReplyTo info in message was not specified" + " and bean does not know where to reply to"); } TxTestUtil.enlistTestXAResource(tm.getTransaction()); try ( JMSContext context = factory.createContext() ) { context.createProducer() .setJMSCorrelationID(message.getJMSMessageID()) .send(replyTo, REPLY_PREFIX + ((TextMessage) message).getText()); } TxTestUtil.waitForTimeout(tm); } catch (Exception e) { throw new RuntimeException("onMessage method execution failed", e); } }
Source:
public GridH2Table( CreateTableData createTblData, GridH2RowDescriptor desc, H2TableDescriptor tblDesc, GridCacheContextInfo cacheInfo ) { super(createTblData); assert tblDesc != null; this.desc = desc; this.cacheInfo = cacheInfo; affKeyCol = calculateAffinityKeyColumn(); affKeyColIsKey = affKeyCol != null && desc.isKeyColumn(affKeyCol.column.getColumnId()); identifier = new QueryTable(getSchema().getName(), getName()); identifierStr = identifier.schema() + "." + identifier.table(); idxs = tblDesc.createSystemIndexes(this); assert idxs != null; List<Index> clones = new ArrayList<>(idxs.size()); for (Index index : idxs) { Index clone = createDuplicateIndexIfNeeded(index); if (clone != null) clones.add(clone); } idxs.addAll(clones); boolean hasHashIndex = idxs.size() >= 2 && index(0).getIndexType().isHash(); if (hasHashIndex) idxs.add(0, new H2TableScanIndex(this, index(1), index(0))); else idxs.add(0, new H2TableScanIndex(this, index(0), null)); pkIndexPos = hasHashIndex ? 2 : 1; sysIdxsCnt = idxs.size(); lock = new ReentrantReadWriteLock(); if (hasHashIndex) { long totalTblSize = rowCountAllSegments(false); size.add(totalTblSize); } tblStats = new TableStatistics(0, 0); }

Target:
public GridH2Table( CreateTableData createTblData, GridH2RowDescriptor desc, H2TableDescriptor tblDesc, GridCacheContextInfo cacheInfo ) { super(createTblData); assert tblDesc != null; this.desc = desc; this.cacheInfo = cacheInfo; affKeyCol = calculateAffinityKeyColumn(); affKeyColIsKey = affKeyCol != null && desc.isKeyColumn(affKeyCol.column.getColumnId()); identifier = new QueryTable(getSchema().getName(), getName()); identifierStr = identifier.schema() + "." + identifier.table(); idxs = tblDesc.createSystemIndexes(this); assert idxs != null; List<Index> clones = new ArrayList<>(idxs.size()); for (Index index : idxs) { Index clone = createDuplicateIndexIfNeeded(index); if (clone != null) clones.add(clone); } idxs.addAll(clones); boolean hasHashIndex = idxs.size() >= 2 && index(0).getIndexType().isHash(); if (hasHashIndex) idxs.add(0, new H2TableScanIndex(this, index(1), index(0))); else idxs.add(0, new H2TableScanIndex(this, index(0), null)); pkIndexPos = hasHashIndex ? 2 : 1; sysIdxsCnt = idxs.size(); lock = new ReentrantReadWriteLock(); if (cacheInfo.affinityNode()) { long totalTblSize = rowCount(false); size.add(totalTblSize); } tblStats = new TableStatistics(0, 0); }
Source:
private void checkConnection() { Boolean hasRemoteSrvNodes = null; long elapsed = (lastRingMsgSentTime + U.millisToNanos(connCheckInterval)) - System.nanoTime(); if (elapsed > 0) return; if (hasRemoteSrvNodes == null) hasRemoteSrvNodes = ring.hasRemoteServerNodes(); if (hasRemoteSrvNodes) sendMessageAcrossRing(new TcpDiscoveryConnectionCheckMessage(locNode)); }

Target:
private void checkConnection() { long elapsed = (lastRingMsgSentTime + U.millisToNanos(connCheckInterval)) - System.nanoTime(); if (elapsed > 0) return; if (ring.hasRemoteServerNodes()) sendMessageAcrossRing(new TcpDiscoveryConnectionCheckMessage(locNode)); }
Source:
public static TileEntity getBlockTile(IBlockAccess world, BlockPos pos) { return world instanceof ChunkCache ? ((ChunkCache) world).getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK) : world.getTileEntity(pos); }

Target:
public static TileEntity getBlockTile(IBlockAccess world, BlockPos pos) { if (pos.getY() < 0) { Game.log(Level.INFO, "Attempted to access tile entity in an invalid position"); } return world instanceof ChunkCache ? ((ChunkCache) world).getTileEntity(pos, Chunk.EnumCreateEntityType.CHECK) : world.getTileEntity(pos); }
Source:
public void fooMethod() { for(int i = 1, J = 1; i <10; i++) { } int i = 0; for(int index = 1; index < 10; index++) { } for(int Index = 1; Index < 10; Index++) { } int index = 1; for(; index < 10; index++) { } for(; i < 12; i++) { } Map<String, String> map = new HashMap<String, String>(); for (Map.Entry<String, String> e : map.entrySet()) { } for (Map.Entry<String, String> E : map.entrySet()) { } }

Target:
public void fooMethod() { for(int i = 1; i <10; i++) { int j = 1; } for(int K = 1; K < 10; K++) { int A = 1; } int i = 0; for(int index = 1; index < 10; index++) { } for(int Index = 1; Index < 10; Index++) { } int index = 1; for(; index < 10; index++) { } for(; i < 12; i++) { } Map<String, String> map = new HashMap<String, String>(); for (Map.Entry<String, String> e : map.entrySet()) { String a = ""; } for (Map.Entry<String, String> E : map.entrySet()) { String B = ""; } }
Source:
public void testGetPreviousOffsets() throws IOException, InterruptedException, CopycatException { Properties props = createProps(); HdfsSinkConnectorConfig connectorConfig = new HdfsSinkConnectorConfig(props); String topicsDir = connectorConfig.getString(HdfsSinkConnectorConfig.TOPIC_DIR_CONFIG); String topic = "topic"; int partition = 0; TopicPartition topicPart = new TopicPartition(topic, partition); long[] startOffsets = {0, 3}; long[] endOffsets = {2, 5}; for (int i = 0; i < startOffsets.length; ++i) { Path path = new Path(FileUtils.committedFileName(url, topicsDir, topicPart, startOffsets[i], endOffsets[i])); fs.createNewFile(path); } Path path = new Path(FileUtils.tempFileName(url, topicsDir, topicPart)); fs.createNewFile(path); path = new Path(FileUtils.fileName(url, topicsDir, topicPart, "abcd")); fs.createNewFile(path); HdfsWriter hdfsWriter = new HdfsWriter(connectorConfig); Map<TopicPartition, Long> previousOffsets = hdfsWriter.getPreviousOffsets(); assertTrue(previousOffsets.containsKey(topicPart)); long previousOffset = previousOffsets.get(topicPart); assertEquals(previousOffset, 6L); hdfsWriter.close(); }

Target:
public void testGetPreviousOffsets() throws Exception { long[] startOffsets = {0, 3}; long[] endOffsets = {2, 5}; for (int i = 0; i < startOffsets.length; ++i) { Path path = new Path(FileUtils.committedFileName(url, topicsDir, TOPIC_PARTITION, startOffsets[i], endOffsets[i])); fs.createNewFile(path); } Path path = new Path(FileUtils.tempFileName(url, topicsDir, TOPIC_PARTITION)); fs.createNewFile(path); path = new Path(FileUtils.fileName(url, topicsDir, TOPIC_PARTITION, "abcd")); fs.createNewFile(path); HdfsWriter hdfsWriter = new HdfsWriter(connectorConfig, context, avroData); hdfsWriter.recover(TOPIC_PARTITION); Map<TopicPartition, Long> committedOffsets = hdfsWriter.getCommittedOffsets(); assertTrue(committedOffsets.containsKey(TOPIC_PARTITION)); long previousOffset = committedOffsets.get(TOPIC_PARTITION); assertEquals(previousOffset, 5L); hdfsWriter.close(); }
Source:
public CruelCelebrant(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{B}"); this.subtype.add(SubType.VAMPIRE); this.power = new MageInt(1); this.toughness = new MageInt(2); Ability ability = new DiesThisOrAnotherCreatureOrPlaneswalkerTriggeredAbility(new LoseLifeOpponentsEffect(1), false, filter); ability.addEffect(new GainLifeEffect(1)); this.addAbility(ability); }

Target:
public CruelCelebrant(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}{B}"); this.subtype.add(SubType.VAMPIRE); this.power = new MageInt(1); this.toughness = new MageInt(2); Ability ability = new DiesThisOrAnotherCreatureOrPlaneswalkerTriggeredAbility(new LoseLifeOpponentsEffect(1), false, filter); ability.addEffect(new GainLifeEffect(1).concatBy("and")); this.addAbility(ability); }
Source:
public CertificateValidator validateTimestamps(boolean isValidationEnabled) throws GeneralSecurityException { if (!isValidationEnabled) { return this; } X509Certificate x509Certificate = _certChain[_certChain.length - 1]; if (x509Certificate.getNotBefore().getTime() > Instant.now().toEpochMilli()) { String message = "certificate is not valid yet: " + x509Certificate.getNotBefore().toInstant().toString(); throw new GeneralSecurityException(message); } if (x509Certificate.getNotAfter().getTime() < Instant.now().toEpochMilli()) { String message = "certificate has expired on: " + x509Certificate.getNotAfter().toInstant().toString(); throw new GeneralSecurityException(message); } return this; }

Target:
public CertificateValidator validateTimestamps(boolean isValidationEnabled) throws GeneralSecurityException { if (!isValidationEnabled) { return this; } for (int i = 0; i < _certChain.length; i++) { X509Certificate x509Certificate = _certChain[i]; if (x509Certificate.getNotBefore().getTime() > Time.currentTimeMillis()) { String serialNumber = x509Certificate.getSerialNumber().toString(16).replaceAll("..(?!$)", "$0 "); String message = "certificate with serialnumber '" + serialNumber + "' is not valid yet: " + x509Certificate.getNotBefore().toString(); throw new GeneralSecurityException(message); } if (x509Certificate.getNotAfter().getTime() < Time.currentTimeMillis()) { String serialNumber = x509Certificate.getSerialNumber().toString(16).replaceAll("..(?!$)", "$0 "); String message = "certificate with serialnumber '" + serialNumber + "' has expired on: " + x509Certificate.getNotAfter().toString(); throw new GeneralSecurityException(message); } } return this; }
Source:
public void setMinMaxFromBytes(byte[] minBytes, byte[] maxBytes) { max = Binary.fromUnmodifiedByteArray(maxBytes); min = Binary.fromUnmodifiedByteArray(minBytes); this.markAsNotEmpty(); }

Target:
public void setMinMaxFromBytes(byte[] minBytes, byte[] maxBytes) { max = Binary.fromReusedByteArray(maxBytes); min = Binary.fromReusedByteArray(minBytes); this.markAsNotEmpty(); }
Source:
public WebSocketMessagePanel(ChannelSortedListModel channelsModel, JToolBar controlToolbar, HttpPanel messagePanel, WebSocketPanelSender sender) throws IllegalArgumentException { super(new BorderLayout()); if (messagePanel == null) { throw new IllegalArgumentException("The request panel cannot be null."); } this.messagePanel = messagePanel; wsUiHelper = new WebSocketUiHelper(); wsUiHelper.setChannelsModel(channelsModel); controlToolbar.add(wsUiHelper.getChannelLabel()); controlToolbar.add(wsUiHelper.getChannelSingleSelect()); wsUiHelper.getChannelSingleSelect().setSelectedIndex(0); addWebSocketReopenListener(sender); JButton btnReopen = getBtnReopen(sender); JButton btnReopenEdit = getBtnReopenEdit(sender); controlToolbar.add(btnReopen); controlToolbar.add(btnReopenEdit); wsUiHelper.disableButtonsWhenComboBoxSelectedNull(btnReopen,btnReopenEdit); controlToolbar.addSeparator(new Dimension(15, 21)); controlToolbar.add(wsUiHelper.getOpcodeLabel()); controlToolbar.add(wsUiHelper.getOpcodeSingleSelect()); wsUiHelper.getOpcodeSingleSelect().setSelectedItem(WebSocketMessage.opcode2string(WebSocketMessage.OPCODE_TEXT)); controlToolbar.addSeparator(new Dimension(15, 21)); controlToolbar.add(wsUiHelper.getDirectionLabel()); controlToolbar.add(wsUiHelper.getDirectionSingleSelect()); }

Target:
public WebSocketMessagePanel(ChannelSortedListModel channelsModel, JToolBar controlToolbar, HttpPanel messagePanel, WebSocketPanelSender sender) throws IllegalArgumentException { super(new BorderLayout()); if (messagePanel == null) { throw new IllegalArgumentException("The request panel cannot be null."); } this.messagePanel = messagePanel; this.sender = sender; wsUiHelper = new WebSocketUiHelper(); wsUiHelper.setChannelsModel(channelsModel); setControlToolbar(controlToolbar); }
Source:
private void rejectDeathDateIfBeforeBirthDate(Errors errors, Date deathdate, Date birthdate, String dateField) { if (deathdate.before(birthdate)) { errors.rejectValue(dateField, "error.date.nonsensical"); } }

Target:
private void rejectDeathDateIfBeforeBirthDate(Errors errors, Date deathdate, Date birthdate, String dateField) { if (deathdate.before(birthdate)) { errors.rejectValue(dateField, "error.deathdate.before.birthdate"); } }
Source:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @SuppressWarnings({"UnusedParameters", "For future"}) @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitParameters(@NotNull GoParameters o) { super.visitParameters(o); if (o.getParameterDeclarationList().size() == 0) return; if (PsiTreeUtil.getParentOfType(o, GoInterfaceType.class, GoTypeDeclaration.class, GoConversionExpr.class, GoTypeCaseClause.class) != null) return; GoFunctionType funcType = PsiTreeUtil.getParentOfType(o, GoFunctionType.class); if (funcType != null) { if (PsiTreeUtil.getParentOfType(funcType, GoParameterDeclaration.class) != null) return; } boolean isResult = PsiTreeUtil.getParentOfType(o, GoResult.class) != null; for (GoParameterDeclaration parameterDeclaration : o.getParameterDeclarationList()) { for (GoParamDefinition parameter : parameterDeclaration.getParamDefinitionList()) { ProgressManager.checkCanceled(); String paramName = parameter.getIdentifier().getText(); if (paramName.equals("_")) continue; Query<PsiReference> search = ReferencesSearch.search(parameter, o.getUseScope()); if (search.findFirst() == null) { String what = "parameter"; if (isResult) what = "named return parameter"; holder.registerProblem(parameter, "Unused " + what + " '" + paramName + "'", ProblemHighlightType.LIKE_UNUSED_SYMBOL); } } } } }; }

Target:
protected GoVisitor buildGoVisitor(@NotNull final ProblemsHolder holder, @SuppressWarnings({"UnusedParameters", "For future"}) @NotNull LocalInspectionToolSession session) { return new GoVisitor() { @Override public void visitMethodDeclaration(@NotNull GoMethodDeclaration o) { super.visitMethodDeclaration(o); visitDeclaration(o); } @Override public void visitFunctionDeclaration(@NotNull GoFunctionDeclaration o) { super.visitFunctionDeclaration(o); visitDeclaration(o); } private void visitDeclaration(@NotNull GoFunctionOrMethodDeclaration o) { GoSignature signature = o.getSignature(); if (signature == null) return; GoParameters parameters = signature.getParameters(); visitParameterList(parameters.getParameterDeclarationList(), "parameter"); GoResult result = signature.getResult(); if (result == null) return; parameters = result.getParameters(); if (parameters == null) return; visitParameterList(parameters.getParameterDeclarationList(), "named return parameter"); } private void visitParameterList(List<GoParameterDeclaration> parameters, String what) { if (parameters.isEmpty()) return; for (GoParameterDeclaration parameterDeclaration : parameters) { for (GoParamDefinition parameter : parameterDeclaration.getParamDefinitionList()) { ProgressManager.checkCanceled(); if (parameter.isBlank()) continue; Query<PsiReference> search = ReferencesSearch.search(parameter, parameter.getUseScope()); if (search.findFirst() != null) continue; String paramName = parameter.getIdentifier().getText(); holder.registerProblem(parameter, "Unused " + what + " '" + paramName + "'", ProblemHighlightType.LIKE_UNUSED_SYMBOL); } } } }; }
Source:
private void broadcastGlobalMinimumClock() { if (!minimumClockWorkers.isEmpty()) { throw new RuntimeException("minimum worker clock list should be empty and updated now"); } for (final Map.Entry<String, Integer> elem : workerClockMap.entrySet()) { final String workerId = elem.getKey(); try { final byte[] data = codec.encode(getBroadcastGlobalMinimumClockMessage(globalMinimumClock)); aggregationMaster.send(AGGREGATION_CLIENT_NAME, workerId, data); } catch (final NetworkException e) { LOG.log(Level.INFO, "Target worker failed to receive global minimum clock message", e); } if (elem.getValue() == globalMinimumClock) { minimumClockWorkers.add(workerId); } } }

Target:
private void broadcastGlobalMinimumClock() { if (!minimumClockWorkers.isEmpty()) { throw new RuntimeException("Minimum worker clock list should be empty and updated now"); } for (final Map.Entry<String, Integer> elem : workerClockMap.entrySet()) { final String workerId = elem.getKey(); int retryCount = 0; while (true) { if (retryCount++ > MAXIMUM_RETRY_COUNTS) { throw new RuntimeException(String.format("Sending global minimum clock message to %s has failed %d times", workerId, MAXIMUM_RETRY_COUNTS + 1)); } try { final byte[] data = codec.encode(getBroadcastMinClockMessage(globalMinimumClock)); aggregationMaster.send(AGGREGATION_CLIENT_NAME, workerId, data); break; } catch (final NetworkException e) { LOG.log(Level.INFO, String.format("ClockManager failed to send global minimum clock message to %s", workerId), e); } } if (elem.getValue() == globalMinimumClock) { minimumClockWorkers.add(workerId); } } }
Source:
public AccountPB readFrom(ProtoStreamReader reader) throws IOException { int id = reader.readInt("id"); String description = reader.readString("description"); long creationDate = reader.readLong("creationDate"); Limits limits = reader.readObject("limits", LimitsPB.class); Limits hardLimits = reader.readObject("hardLimits", LimitsPB.class); List<byte[]> blurb = reader.readCollection("blurb", new ArrayList<>(), byte[].class); List<Account.Currency> currencies = reader.readCollection("currencies", new ArrayList<>(), Account.Currency.class); AccountPB account = new AccountPB(); account.setId(id); account.setDescription(description); account.setCreationDate(new Date(creationDate)); account.setLimits(limits); account.setHardLimits(hardLimits); account.setBlurb(blurb); account.setCurrencies(currencies); return account; }

Target:
public AccountPB readFrom(ProtoStreamReader reader) throws IOException { int id = reader.readInt("id"); String description = reader.readString("description"); long creationDate = reader.readLong("creationDate"); Limits limits = reader.readObject("limits", LimitsPB.class); Limits hardLimits = reader.readObject("hardLimits", LimitsPB.class); List<byte[]> blurb = reader.readCollection("blurb", new ArrayList<>(), byte[].class); Account.Currency[] currencies = reader.readArray("currencies", Account.Currency.class); AccountPB account = new AccountPB(); account.setId(id); account.setDescription(description); account.setCreationDate(new Date(creationDate)); account.setLimits(limits); account.setHardLimits(hardLimits); account.setBlurb(blurb); account.setCurrencies(currencies); return account; }
Source:
public static void addRecoveryListenerIfNecessary(Channel channel) { if (channel instanceof ChannelProxy) { if (((ChannelProxy) channel).getTargetChannel() instanceof AutorecoveringChannel) { AutorecoveringChannel autorecoveringChannel = (AutorecoveringChannel) ((ChannelProxy) channel) .getTargetChannel(); if (hasListener.putIfAbsent(autorecoveringChannel, Boolean.TRUE) == null) { autorecoveringChannel.addRecoveryListener(INSTANCE); } } } }

Target:
public static void addRecoveryListenerIfNecessary(Channel channel) { AutorecoveringChannel autorecoveringChannel = null; if (channel instanceof ChannelProxy) { if (((ChannelProxy) channel).getTargetChannel() instanceof AutorecoveringChannel) { autorecoveringChannel = (AutorecoveringChannel) ((ChannelProxy) channel) .getTargetChannel(); } } else if (channel instanceof AutorecoveringChannel) { autorecoveringChannel = (AutorecoveringChannel) channel; } if (autorecoveringChannel != null && hasListener.putIfAbsent(autorecoveringChannel, Boolean.TRUE) == null) { autorecoveringChannel.addRecoveryListener(INSTANCE); } }
Source:
private static void deleteDir(Path root) { if (root == null || !Files.exists(root)) { return; } try { Files.walkFileTree(root, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { try { Files.delete(file); } catch (IOException ex) { } return FileVisitResult.CONTINUE; } @Override public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOException { if (e != null) { throw e; } try { Files.delete(dir); } catch (IOException ex) { } return FileVisitResult.CONTINUE; } }); } catch (IOException e) { } }

Target:
private void deleteDir(Path root) { if (root == null || !Files.exists(root)) { return; } try { Files.walkFileTree(root, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { try { Files.delete(file); } catch (IOException ex) { log.cantDelete(file.toString(), ex); } return FileVisitResult.CONTINUE; } @Override public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOException { try { Files.delete(dir); } catch (IOException ex) { log.cantDelete(dir.toString(), ex); } return FileVisitResult.CONTINUE; } }); } catch (IOException e) { } }
Source:
public synchronized BreakpointEnabling<MessageReceiverBreakpoint> getReceiverBreakpoint( final FullSourceCoordinate section) { BreakpointEnabling<MessageReceiverBreakpoint> bkp = receiverBreakpoints.computeIfAbsent(section, ss -> new BreakpointEnabling<>(new MessageReceiverBreakpoint(false, section))); if (bkp.isDisabled() && stepping != null) { bkp.setEnabled(stepping.getSteppingTypeOperation(section) == SteppingType.STEP_INTO); } return bkp; }

Target:
public synchronized BreakpointEnabling<SectionBreakpoint> getReceiverBreakpoint( final FullSourceCoordinate section) { return receiverBreakpoints.computeIfAbsent(section, ss -> new BreakpointEnabling<SectionBreakpoint>( new SectionBreakpoint(false, section, BreakpointType.MSG_RECEIVER))); }
Source:
protected Optional<KubernetesNamespaceMeta> fetchNamespace(String name) throws KubernetesClientException, InfrastructureException { try { Project project = clientFactory.createOC().projects().withName(name).get(); return Optional.of(asNamespaceMeta(project)); } catch (KubernetesClientException e) { if (e.getCode() == 403) { return Optional.empty(); } else { throw new InfrastructureException( "Error occurred when tried to fetch default project. Cause: " + e.getMessage(), e); } } }

Target:
protected Optional<KubernetesNamespaceMeta> fetchNamespace(String name) throws InfrastructureException { try { Project project = clientFactory.createOC().projects().withName(name).get(); return Optional.of(asNamespaceMeta(project)); } catch (KubernetesClientException e) { if (e.getCode() == 403) { return Optional.empty(); } else { throw new InfrastructureException( "Error occurred when tried to fetch default project. Cause: " + e.getMessage(), e); } } }
Source:
protected UpdateInfo call() throws Exception { RestTemplate restTemplate = new RestTemplate(); LinkedMultiValueMap<String, String> headers = new LinkedMultiValueMap<>(); headers.add("Accept", "application/vnd.github.v3+json"); HttpEntity<String> entity = new HttpEntity<>(null, headers); ResponseEntity<List<GitHubRelease>> response = restTemplate.exchange(clientProperties.getGitHubRepo().getApiUrl() + PATH_FOR_RELEASE, HttpMethod.GET, entity, new ParameterizedTypeReference<List<GitHubRelease>>() { }); List<GitHubRelease> responseBody = response.getBody(); if (responseBody == null || responseBody.isEmpty()) { return null; } GitHubRelease latestRelease = responseBody.get(0); if (!latestRelease.isPrerelease()) { return null; } GitHubAssets asset; if (org.bridj.Platform.isWindows()) { asset = getAssetOfFileWithEnding(latestRelease, ".exe"); } else if (org.bridj.Platform.isLinux()) { asset = getAssetOfFileWithEnding(latestRelease, ".tar.gz"); } else if (org.bridj.Platform.isMacOSX()) { asset = getAssetOfFileWithEnding(latestRelease, ".tar.gz"); } else { return null; } String version = latestRelease.getTagName().substring(1); return new UpdateInfo( version, asset.getName(), asset.getBrowserDownloadUrl(), asset.getSize(), latestRelease.getReleaseNotes(), latestRelease.isPrerelease() ); }

Target:
protected UpdateInfo call() throws Exception { LinkedMultiValueMap<String, String> headers = new LinkedMultiValueMap<>(); headers.add("Accept", "application/vnd.github.v3+json"); HttpEntity<String> entity = new HttpEntity<>(null, headers); ClientConfiguration clientConfiguration = preferencesService.getRemotePreferences(); ResponseEntity<List<GitHubRelease>> response = restTemplate.exchange(clientConfiguration.getGitHubRepo().getApiUrl() + PATH_FOR_RELEASE, HttpMethod.GET, entity, new ParameterizedTypeReference<List<GitHubRelease>>() { }); List<GitHubRelease> responseBody = response.getBody(); if (responseBody == null || responseBody.isEmpty()) { return null; } GitHubRelease latestRelease = responseBody.get(0); if (!latestRelease.isPrerelease()) { return null; } GitHubAssets asset; if (org.bridj.Platform.isWindows()) { asset = getAssetOfFileWithEnding(latestRelease, ".exe"); } else if (org.bridj.Platform.isLinux()) { asset = getAssetOfFileWithEnding(latestRelease, ".tar.gz"); } else if (org.bridj.Platform.isMacOSX()) { asset = getAssetOfFileWithEnding(latestRelease, ".tar.gz"); } else { return null; } String version = latestRelease.getTagName().substring(1); return new UpdateInfo( version, asset.getName(), asset.getBrowserDownloadUrl(), asset.getSize(), latestRelease.getReleaseNotes(), latestRelease.isPrerelease() ); }
Source:
private void requestChildViewOnScreen(View child) { Rect vitalPortion = new Rect(); child.getDrawingRect(vitalPortion); Rect vitalPortionSaved = new Rect(); child.getDrawingRect(vitalPortionSaved); Rect wholeView = new Rect(); this.getDrawingRect(wholeView); if(mFrameHeight == -1){ child.requestRectangleOnScreen(vitalPortion); } if(wholeView.height() < mFrameHeight) { this.requestRectangleOnScreen(wholeView); return; } int topY = wholeView.top; int bottomY = wholeView.bottom; wholeView.inset(0, (wholeView.height() - mFrameHeight) / 2); wholeView.offsetTo(wholeView.left, topY); this.offsetDescendantRectToMyCoords(child, vitalPortion); if(wholeView.contains(vitalPortion)) { this.requestRectangleOnScreen(wholeView); return; } wholeView.offsetTo(wholeView.left, bottomY - wholeView.height()); if(wholeView.contains(vitalPortion)) { this.requestRectangleOnScreen(wholeView); return; } child.requestRectangleOnScreen(vitalPortionSaved); }

Target:
private void requestChildViewOnScreen(View child) { Rect vitalPortion = new Rect(); child.getDrawingRect(vitalPortion); Rect vitalPortionSaved = new Rect(); child.getDrawingRect(vitalPortionSaved); Rect wholeView = new Rect(); this.getDrawingRect(wholeView); if(mFrameHeight == -1){ child.requestRectangleOnScreen(vitalPortion); return; } if(wholeView.height() < mFrameHeight) { this.requestRectangleOnScreen(wholeView); return; } int topY = wholeView.top; int bottomY = wholeView.bottom; wholeView.inset(0, (wholeView.height() - mFrameHeight) / 2); wholeView.offsetTo(wholeView.left, topY); this.offsetDescendantRectToMyCoords(child, vitalPortion); if(wholeView.contains(vitalPortion)) { this.requestRectangleOnScreen(wholeView); return; } wholeView.offsetTo(wholeView.left, bottomY - wholeView.height()); if(wholeView.contains(vitalPortion)) { this.requestRectangleOnScreen(wholeView); return; } child.requestRectangleOnScreen(vitalPortionSaved); }
Source:
private List<HostNetwork> calculateNetworksToConfigure(Network managementNetworkOfThisCluster) { List<HostNetwork> networksToConfigure = new ArrayList<>(getParameters().getNetworkAttachments().size()); BusinessEntityMap<VdsNetworkInterface> nics = getExistingNicsBusinessEntityMap(); Guid managementNetworkId = managementNetworkOfThisCluster.getId(); for (NetworkAttachment attachment : getParameters().getNetworkAttachments()) { Network network = existingNetworkRelatedToAttachment(attachment); HostNetwork networkToConfigure = new HostNetwork(network, attachment); networkToConfigure.setBonding(isBonding(attachment, nics)); boolean attachmentOfManagementNetwork = attachment.getNetworkId().equals(managementNetworkId); if (attachmentOfManagementNetwork) { DnsResolverConfiguration dnsResolverConfiguration = calculateDnsConfigurationToUse(attachment, network); if (dnsResolverConfiguration != null) { networkToConfigure.setNameServers(dnsResolverConfiguration.getNameServers()); } } if (defaultRouteSupported() && defaultRouteRequired(network, attachment.getIpConfiguration())) { networkToConfigure.setDefaultRoute(true); } if (NetworkUtils.qosConfiguredOnInterface(attachment, network)) { networkToConfigure.setQosConfiguredOnInterface(true); HostNetworkQos hostNetworkQos = effectiveHostNetworkQos.getQos(attachment, network); networkToConfigure.setQos(hostNetworkQos); } networksToConfigure.add(networkToConfigure); } return networksToConfigure; }

Target:
private List<HostNetwork> calculateNetworksToConfigure(Network managementNetworkOfThisCluster) { List<HostNetwork> networksToConfigure = new ArrayList<>(getParameters().getNetworkAttachments().size()); BusinessEntityMap<VdsNetworkInterface> nics = getExistingNicsBusinessEntityMap(); Guid managementNetworkId = managementNetworkOfThisCluster.getId(); for (NetworkAttachment attachment : getParameters().getNetworkAttachments()) { Network network = existingNetworkRelatedToAttachment(attachment); HostNetwork networkToConfigure = new HostNetwork(network, attachment); networkToConfigure.setBonding(isBonding(attachment, nics)); boolean isAttachmentOfManagementNetwork = attachment.getNetworkId().equals(managementNetworkId); if (shouldIncludeDnsConfigurationData(isAttachmentOfManagementNetwork, attachment)) { DnsResolverConfiguration dnsResolverConfiguration = calculateDnsConfigurationToUse(attachment, network); if (dnsResolverConfiguration != null) { networkToConfigure.setNameServers(dnsResolverConfiguration.getNameServers()); } } if (defaultRouteSupported() && defaultRouteRequired(isAttachmentOfManagementNetwork, attachment.getIpConfiguration())) { networkToConfigure.setDefaultRoute(true); } if (NetworkUtils.qosConfiguredOnInterface(attachment, network)) { networkToConfigure.setQosConfiguredOnInterface(true); HostNetworkQos hostNetworkQos = effectiveHostNetworkQos.getQos(attachment, network); networkToConfigure.setQos(hostNetworkQos); } networksToConfigure.add(networkToConfigure); } return networksToConfigure; }
Source:
public BrokerEnvironmentFactory( String cheWebsocketEndpoint, String brokerPullPolicy, AgentAuthEnableEnvVarProvider authEnableEnvVarProvider, MachineTokenEnvVarProvider machineTokenEnvVarProvider, String artifactsBrokerImage, String metadataBrokerImage, String pluginRegistryUrl, String pluginRegistryInternalUrl, CertificateProvisioner certProvisioner) { this.cheWebsocketEndpoint = cheWebsocketEndpoint; this.brokerPullPolicy = brokerPullPolicy; this.authEnableEnvVarProvider = authEnableEnvVarProvider; this.machineTokenEnvVarProvider = machineTokenEnvVarProvider; this.artifactsBrokerImage = artifactsBrokerImage; this.metadataBrokerImage = metadataBrokerImage; if (!isNullOrEmpty(pluginRegistryInternalUrl)) { pluginRegistryUrl = pluginRegistryInternalUrl; } LOGGER.info("Plugin registry url: {}", pluginRegistryUrl); this.pluginRegistryUrl = pluginRegistryUrl; this.certProvisioner = certProvisioner; }

Target:
public BrokerEnvironmentFactory( String cheWebsocketEndpoint, String brokerPullPolicy, AgentAuthEnableEnvVarProvider authEnableEnvVarProvider, MachineTokenEnvVarProvider machineTokenEnvVarProvider, String artifactsBrokerImage, String metadataBrokerImage, String pluginRegistryUrl, String pluginRegistryInternalUrl, CertificateProvisioner certProvisioner) { this.cheWebsocketEndpoint = cheWebsocketEndpoint; this.brokerPullPolicy = brokerPullPolicy; this.authEnableEnvVarProvider = authEnableEnvVarProvider; this.machineTokenEnvVarProvider = machineTokenEnvVarProvider; this.artifactsBrokerImage = artifactsBrokerImage; this.metadataBrokerImage = metadataBrokerImage; this.pluginRegistryUrl = isNullOrEmpty(pluginRegistryInternalUrl) ? pluginRegistryUrl : pluginRegistryInternalUrl; this.certProvisioner = certProvisioner; }
Source:
private void initializeZkStructure() throws InterruptedException { LOG.info("Starting initialization"); if (!checkZkStructureInited()) { try { zooKeeperHolder.get().create().creatingParentsIfNeeded().withMode(CreateMode.PERSISTENT) .forPath(toZkPath("/version"), "0".getBytes(Charsets.UTF_8)); zooKeeperHolder.get().create().creatingParentsIfNeeded().withMode(CreateMode.PERSISTENT) .forPath(toZkPath("/locked_et"), "[]".getBytes(Charsets.UTF_8)); zooKeeperHolder.get().create().creatingParentsIfNeeded().withMode(CreateMode.PERSISTENT) .forPath(toZkPath("/nodes"), "[]".getBytes(Charsets.UTF_8)); } catch (final KeeperException.NodeExistsException ignore) { } catch (final Exception e) { LOG.error("Failed to check zk structures", e); throw new RuntimeException(e); } } runLocked(() -> { try { LOG.info("Registering node in zk"); updateSelfVersionTo(0); } catch (final Exception e) { LOG.error("Failed to initialize timeline synchronization", e); throw new RuntimeException(e); } }); reactOnEventTypesChange(); }

Target:
private void initializeZkStructure() throws InterruptedException, RuntimeException { LOG.info("Starting initialization"); checkAndCreateZkNode("version", "0"); checkAndCreateZkNode("locked_et", "[]"); checkAndCreateZkNode("nodes", "[]"); runLocked(() -> { try { LOG.info("Registering node in zk"); updateSelfVersionTo(0); } catch (final Exception e) { LOG.error("Failed to initialize timeline synchronization", e); throw new RuntimeException(e); } }); reactOnEventTypesChange(); }
Source:
public int approveUserRequest(String sUserId, String sRoles, String sAdminId) throws QuadrigaStorageException { QuadrigaUserRequestsDTO userRequestDTO = (QuadrigaUserRequestsDTO) sessionFactory.getCurrentSession().get( QuadrigaUserRequestsDTO.class, sUserId); if (userRequestDTO != null) { QuadrigaUserDTO userDTO = new QuadrigaUserDTO(); userDTO.setFullname(userRequestDTO.getFullname()); userDTO.setUsername(userRequestDTO.getUsername()); userDTO.setPasswd(userRequestDTO.getPasswd()); userDTO.setEmail(userRequestDTO.getEmail()); userDTO.setQuadrigarole(sRoles); userDTO.setCreatedby(sAdminId); userDTO.setCreateddate(new Date()); userDTO.setUpdatedby(sAdminId); userDTO.setUpdateddate(new Date()); userDTO.setProvider(userRequestDTO.getProvider()); userDTO.setUserIdOfProvider(userRequestDTO.getUserIdOfProvider()); Session session = sessionFactory.getCurrentSession(); session.save(userDTO); session.delete(userRequestDTO); return SUCCESS; } else return FAILURE; }

Target:
public int approveUserRequest(String sUserId, String sRoles, String sAdminId) throws QuadrigaStorageException { try { QuadrigaUserRequestsDTO userRequestDTO = (QuadrigaUserRequestsDTO) sessionFactory.getCurrentSession() .get(QuadrigaUserRequestsDTO.class, sUserId); if (userRequestDTO != null) { QuadrigaUserDTO userDTO = new QuadrigaUserDTO(); userDTO.setFullname(userRequestDTO.getFullname()); userDTO.setUsername(userRequestDTO.getUsername()); userDTO.setPasswd(userRequestDTO.getPasswd()); userDTO.setEmail(userRequestDTO.getEmail()); userDTO.setQuadrigarole(sRoles); userDTO.setCreatedby(sAdminId); userDTO.setCreateddate(new Date()); userDTO.setUpdatedby(sAdminId); userDTO.setUpdateddate(new Date()); userDTO.setProvider(userRequestDTO.getProvider()); userDTO.setUserIdOfProvider(userRequestDTO.getUserIdOfProvider()); Session session = sessionFactory.getCurrentSession(); session.save(userDTO); session.delete(userRequestDTO); return SUCCESS; } else return FAILURE; } catch (HibernateException e) { throw new QuadrigaStorageException(e); } }
Source:
private TOTPSharedSecret createCredentials(final TOTPSharedSecret credsToSave) throws SegueDatabaseException { PreparedStatement pst; try (Connection conn = database.getDatabaseConnection()) { pst = conn .prepareStatement( "INSERT INTO user_totp(user_id, shared_secret, created) " + "VALUES (?, ?, ?);", Statement.RETURN_GENERATED_KEYS); setValueHelper(pst, 1, credsToSave.getUserId()); setValueHelper(pst, 2, credsToSave.getSharedSecret()); setValueHelper(pst, 3, credsToSave.getCreated()); if (pst.executeUpdate() == 0) { throw new SegueDatabaseException("Unable to save user."); } return credsToSave; } catch (SQLException e) { throw new SegueDatabaseException("Postgres exception", e); } }

Target:
private TOTPSharedSecret createCredentials(final TOTPSharedSecret credsToSave) throws SegueDatabaseException { PreparedStatement pst; try (Connection conn = database.getDatabaseConnection()) { pst = conn .prepareStatement( "INSERT INTO user_totp(user_id, shared_secret, created, last_updated) " + "VALUES (?, ?, ?,?);", Statement.RETURN_GENERATED_KEYS); setValueHelper(pst, 1, credsToSave.getUserId()); setValueHelper(pst, 2, credsToSave.getSharedSecret()); setValueHelper(pst, 3, credsToSave.getCreated()); setValueHelper(pst, 4, credsToSave.getLastUpdated()); if (pst.executeUpdate() == 0) { throw new SegueDatabaseException("Unable to save totp secret."); } return credsToSave; } catch (SQLException e) { throw new SegueDatabaseException("Postgres exception", e); } }
Source:
private String sanitizeLabel(String input) { String label = input; int max = 63; if (label.length() > max) { label = label.substring(label.length() - max); } label = label.replaceAll("[^_.a-zA-Z0-9-]", "_").replaceFirst("^[^a-zA-Z0-9]", "x"); return label; }

Target:
static String sanitizeLabel(String input) { String label = input; int max = 63; if (label.length() > max) { label = label.substring(label.length() - max); } label = label.replaceAll("[^_.a-zA-Z0-9-]", "_").replaceFirst("^[^a-zA-Z0-9]", "x"); return label; }
Source:
public void createPartControl(@Nullable Composite parent) { String name = getViewSite().getSecondaryId(); if (name != null) { fViewInfo.setName(name); } super.createPartControl(parent); TmfViewer tree = getLeftChildViewer(); TmfXYChartViewer chart = getChartViewer(); if (tree instanceof AbstractSegmentStoreScatterChartTreeViewer && chart instanceof AbstractSegmentStoreScatterChartViewer) { ILegendImageProvider legendImageProvider = new XYChartLegendImageProvider((TmfCommonXAxisChartViewer) chart); AbstractSegmentStoreScatterChartTreeViewer diskTree = (AbstractSegmentStoreScatterChartTreeViewer) tree; diskTree.setTreeListener((AbstractSegmentStoreScatterChartViewer) chart); diskTree.setLegendImageProvider(legendImageProvider); } Display.getDefault().asyncExec(new Runnable() { @Override public void run() { setPartName(fViewInfo.getLabel()); } }); }

Target:
public void createPartControl(@Nullable Composite parent) { String name = getViewSite().getSecondaryId(); if (name != null) { fViewInfo.setName(name); } super.createPartControl(parent); Display.getDefault().asyncExec(() -> setPartName(fViewInfo.getLabel())); }
Source:
public void resetPrintHistory() { for (Vertex vertex : graph) { Iterator it = vertex.getEdges() .entrySet() .iterator(); while (it.hasNext()) { Map.Entry pair = (Map.Entry) it.next(); ((Edge) pair.getValue()).setPrinted(false); } } }

Target:
public void resetPrintHistory(){ for (Vertex vertex : graph){ Iterator<Map.Entry<Vertex,Edge>> it = vertex.getEdges().entrySet().iterator(); while (it.hasNext()) { Map.Entry<Vertex,Edge> pair = it.next(); pair.getValue().setPrinted(false); } } }
Source:
public GroupLocation(boolean isCircular, Location... subLocations) { this(Arrays.asList(subLocations)); }

Target:
public GroupLocation(boolean isCircular, Location... subLocations) { this(Arrays.asList(subLocations)); setCircular(isCircular); }
Source:
public ReferenceCountingSegment getIncrementedSegment() { ReferenceCountingSegment segment = adapter.get(); while (true) { if (segment.increment()) { return segment; } ReferenceCountingSegment newSegment = adapter.get(); if (segment == newSegment) { throw new ISE("segment.close() is called somewhere outside FireHydrant.swapSegment()"); } segment = newSegment; } }

Target:
public ReferenceCountingSegment getIncrementedSegment() { ReferenceCountingSegment segment = adapter.get(); while (true) { if (segment.increment()) { return segment; } ReferenceCountingSegment newSegment = adapter.get(); if (segment == newSegment) { throw new ISE("segment.close() is called somewhere outside FireHydrant.swapSegment()"); } if (newSegment == null) { throw new ISE("FireHydrant was 'closed' by swapping segment to null while acquiring a segment"); } segment = newSegment; } }
Source:
public DataCenterNetworkPopupView(EventBus eventBus, ApplicationResources resources, ApplicationConstants constants, ApplicationTemplates templates) { super(eventBus, resources); isVmNetworkEditor = new EntityModelCheckBoxEditor(Align.RIGHT); vlanTagging = new EntityModelCheckBoxEditor(Align.RIGHT); hasMtuEditor = new EntityModelCheckBoxEditor(Align.RIGHT); this.clustersTable = new EntityModelCellTable<ListModel>(SelectionMode.NONE, true){ @Override public void setRowData(int start, List<? extends EntityModel> values) { super.setRowData(start, values); redraw(); } @Override public void setSelectionModel(SelectionModel<? super EntityModel> selectionModel) { super.setSelectionModel(new NoSelectionModel<EntityModel>()); } }; initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); initEntityModelCellTable(constants, templates); updateVisibility(); localize(constants); addStyles(); Driver.driver.initialize(this); }

Target:
public DataCenterNetworkPopupView(EventBus eventBus, ApplicationResources resources, ApplicationConstants constants, ApplicationTemplates templates) { super(eventBus, resources); isVmNetworkEditor = new EntityModelCheckBoxEditor(Align.RIGHT); vlanTagging = new EntityModelCheckBoxEditor(Align.RIGHT); hasMtuEditor = new EntityModelCheckBoxEditor(Align.RIGHT); this.clustersTable = new EntityModelCellTable<ListModel>(SelectionMode.NONE, true){ @Override public void setRowData(int start, List<? extends EntityModel> values) { super.setRowData(start, values); redraw(); } }; initWidget(ViewUiBinder.uiBinder.createAndBindUi(this)); initEntityModelCellTable(constants, templates); updateVisibility(); localize(constants); addStyles(); Driver.driver.initialize(this); }
Source:
private static Qualifier buildQualifierWithClassId(String classId) { Qualifier.Builder builder = Qualifier.newBuilder(); builder.setClassid(classId); return builder.build(); }

Target:
private static Qualifier buildQualifierWithClassId(String classId) { return Qualifier.newBuilder().setClassid(classId).build(); }
Source:
public void run() { try { InputStream inputStream = TestDataCreationHelper.createRandomInputStream(options.getSize()); BlobOutputStream outputStream = cloudBlockBlob.openOutputStream(); TestDataCreationHelper.copyStream(inputStream, outputStream, DEFAULT_BUFFER_SIZE); outputStream.close(); } catch (StorageException | IOException e) { throw new RuntimeException(e); } }

Target:
public void run() { try { BlobOutputStream outputStream = cloudBlockBlob.openOutputStream(); TestDataCreationHelper.writeBytesToOutputStream(outputStream, options.getSize()); outputStream.close(); } catch (StorageException | IOException e) { throw new RuntimeException(e); } }
Source:
public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass().equals(o.getClass())) { return false; } if (!super.equals(o)) { return false; } final ArrayOfDoublesSketchAggregatorFactory that = (ArrayOfDoublesSketchAggregatorFactory) o; if (!name.equals(that.name)) { return false; } if (!fieldName.equals(that.fieldName)) { return false; } if (nominalEntries != that.nominalEntries) { return false; } if (!metricColumns.equals(that.metricColumns)) { return false; } return numberOfValues != that.numberOfValues; }

Target:
public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof ArrayOfDoublesSketchAggregatorFactory)) { return false; } final ArrayOfDoublesSketchAggregatorFactory that = (ArrayOfDoublesSketchAggregatorFactory) o; if (!name.equals(that.name)) { return false; } if (!fieldName.equals(that.fieldName)) { return false; } if (nominalEntries != that.nominalEntries) { return false; } if (!Objects.equals(metricColumns, that.metricColumns)) { return false; } return numberOfValues != that.numberOfValues; }
Source:
public void setDefaultPoolWidth(final int defaultWidth) { final IPreferenceStore store = (IPreferenceStore) ProcessDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT.getPreferenceStore(); store.setDefault("poolDefaultWidth", defaultWidth); }

Target:
public void setDefaultPoolWidth(final int defaultWidth) { final IPreferenceStore store = (IPreferenceStore) ProcessDiagramEditorPlugin.DIAGRAM_PREFERENCES_HINT.getPreferenceStore(); store.setDefault(POOL_DEFAULT_WIDTH, defaultWidth); }