auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public final void write(String path) { final Path savepointPath = new Path(path); List<BootstrapTransformationWithID<?>> newOperatorTransformations = metadata.getNewOperators(); DataSet<OperatorState> newOperatorStates = writeOperatorStates(newOperatorTransformations, savepointPath); List<OperatorState> existingOperatorStateList = metadata.getExistingOperators(); DataSet<OperatorState> finalOperatorStates; if (existingOperatorStateList.isEmpty()) { finalOperatorStates = newOperatorStates; } else { DataSet<OperatorState> existingOperatorStates = newOperatorStates.getExecutionEnvironment() .fromCollection(existingOperatorStateList); existingOperatorStates .map(new OperatorState2PathSetMapFunction()) .flatMap(new FlatMapFunction<Set<Optional<Path>>, Optional<Path>>() { @Override public void flatMap(Set<Optional<Path>> value, Collector<Optional<Path>> out) throws Exception { for (Optional<Path> path : value) { out.collect(path); } } }) .filter(Optional<Path>::isPresent) .map(Optional<Path>::get) .returns(TypeInformation.of(new TypeHint<Path>(){})) .map(new MapFunction<Path, Path>() { @Override public Path map(Path existingStateFile) throws IOException { savepointPath.getFileSystem().mkdirs(savepointPath); Files.copy( Paths.get(existingStateFile.getPath()), Paths.get(path + "/" + existingStateFile.getName()) ); return existingStateFile; } }) .output(new DiscardingOutputFormat<>()); finalOperatorStates = newOperatorStates.union(existingOperatorStates); } finalOperatorStates .reduceGroup(new MergeOperatorStates(metadata.getMasterStates())) .name("reduce(OperatorState)") .output(new SavepointOutputFormat(savepointPath)) .name(path); }

Target:
public final void write(String path) { final Path savepointPath = new Path(path); List<BootstrapTransformationWithID<?>> newOperatorTransformations = metadata.getNewOperators(); DataSet<OperatorState> newOperatorStates = writeOperatorStates(newOperatorTransformations, savepointPath); List<OperatorState> existingOperators = metadata.getExistingOperators(); DataSet<OperatorState> finalOperatorStates; if (existingOperators.isEmpty()) { finalOperatorStates = newOperatorStates; } else { DataSet<OperatorState> existingOperatorStates = newOperatorStates.getExecutionEnvironment() .fromCollection(existingOperators); existingOperatorStates .flatMap(new StatePathExtractor()) .setParallelism(1) .map(new FileCopyMapFunction(path)) .output(new DiscardingOutputFormat<>()); finalOperatorStates = newOperatorStates.union(existingOperatorStates); } finalOperatorStates .reduceGroup(new MergeOperatorStates(metadata.getMasterStates())) .name("reduce(OperatorState)") .output(new SavepointOutputFormat(savepointPath)) .name(path); }
Source:
public void testPlaceOrderTypeText() throws Exception { Axis2BackEndServerController axis2Server = getAxis2Server(); if (axis2Server == null) { fail("Failed to load the Axis2BackEndServerController"); } assertEquals(0, axis2Server.getMessageCount("SimpleStockQuoteService", "placeOrder")); JMSSampleClient client = new JMSSampleClient(); client.connect("dynamicQueues/JMSTextProxy"); client.sendTextMessage("12.33 1000 ACP"); Thread.sleep(2000); assertEquals(1, axis2Server.getMessageCount("SimpleStockQuoteService", "placeOrder")); client.shutdown(); }

Target:
public void testPlaceOrderTypeText() throws Exception { JMSSampleClient client = new JMSSampleClient(); Axis2BackEndServerController axis2Server = getAxis2Server(); if (axis2Server == null) { fail("Failed to load the Axis2BackEndServerController"); } assertEquals(0, axis2Server.getMessageCount("SimpleStockQuoteService", "placeOrder")); try { client.connect("dynamicQueues/JMSTextProxy"); client.sendTextMessage("12.33 1000 ACP"); boolean expectedMessageCountReceived = SynapseTestUtils.waitForMessageCount(axis2Server, "SimpleStockQuoteService", "placeOrder", 1, 2000); assertTrue("Backend service not received the expected message count", expectedMessageCountReceived); } finally { client.shutdown(); } }
Source:
public Map<String, Template> parseTemplateFile(File file) throws IOException, SAXException, ParserConfigurationException{ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setValidating(true); dbf.setNamespaceAware(true); dbf.setFeature("<LINK_0>", false); dbf.setFeature("<LINK_1>", false); DocumentBuilder bd = dbf.newDocumentBuilder(); bd.setEntityResolver(new DefaultEntityResolver()); LoggingErrorHandler errorHandler = new LoggingErrorHandler(log); bd.setErrorHandler(errorHandler); Document document = bd.parse(file.getAbsolutePath()); document.getDocumentElement().normalize(); Map<String, Template> templates = new TreeMap<>(); NodeList templateNodes = document.getElementsByTagName("template"); for (int i = 0; i < templateNodes.getLength(); i++) { Node node = templateNodes.item(i); parseTemplateNode(templates, node); } return templates; }

Target:
public Map<String, Template> parseTemplateFile(File file) throws IOException, SAXException, ParserConfigurationException{ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setValidating(true); dbf.setNamespaceAware(true); dbf.setFeature("<LINK_0>", false); dbf.setFeature("<LINK_1>", false); DocumentBuilder bd = dbf.newDocumentBuilder(); bd.setEntityResolver(new DefaultEntityResolver()); LoggingErrorHandler errorHandler = new LoggingErrorHandler(log, file); bd.setErrorHandler(errorHandler); Document document = bd.parse(file.getAbsolutePath()); document.getDocumentElement().normalize(); Map<String, Template> templates = new TreeMap<>(); NodeList templateNodes = document.getElementsByTagName("template"); for (int i = 0; i < templateNodes.getLength(); i++) { Node node = templateNodes.item(i); parseTemplateNode(templates, node); } return templates; }
Source:
public synchronized TmfExperiment getExperiment(boolean deleteSuppFiles) { Set<@NonNull ITmfTrace> traces = new HashSet<>(); for (VmTraces trace : fTraces) { ITmfTrace tmfTrace = trace.getTrace(); if (tmfTrace != null) { traces.add(tmfTrace); } } String expName = this.name(); VirtualMachineExperiment experiment = new VirtualMachineExperiment(expName, traces); if (deleteSuppFiles) { File suppDir = new File(TmfTraceManager.getSupplementaryFileDir(experiment)); for (File file : suppDir.listFiles()) { file.delete(); } } return experiment; }

Target:
public synchronized TmfExperiment getExperiment(boolean deleteSuppFiles) { Set<@NonNull ITmfTrace> traces = new HashSet<>(); for (VmTraces trace : fTraces) { ITmfTrace tmfTrace = trace.getTrace(); if (tmfTrace != null) { traces.add(tmfTrace); } } String expName = name(); VirtualMachineExperiment experiment = new VirtualMachineExperiment(expName, traces); if (deleteSuppFiles) { File suppDir = new File(TmfTraceManager.getSupplementaryFileDir(experiment)); for (File file : suppDir.listFiles()) { file.delete(); } } return experiment; }
Source:
public @ResponseBody List<UnitDto> sortUnits(@PathVariable("tenderId") Integer tenderId, @RequestParam("direction") String direction, @RequestParam("field") String field) { Sort sort = new Sort(Sort.Direction.fromString(direction), field); Pageable pageRequest = new PageRequest(0, 100, sort); return tenderFacade.findUnitsByTenderId(tenderId, pageRequest); }

Target:
public @ResponseBody List<UnitDto> sortUnits(@PathVariable("tenderId") Integer tenderId, @RequestParam("direction") String direction, @RequestParam("field") String field) { Sort sort = new Sort(Sort.Direction.fromString(direction), field); Pageable pageRequest = new PageRequest(0, Integer.MAX_VALUE, sort); return tenderFacade.findUnitsByTenderId(tenderId, pageRequest); }
Source:
public CompletableFuture<FileWrapper> overwriteFileJS(AsyncReader fileData, int endHigh, int endLow, NetworkAccess network, Crypto crypto, ProgressConsumer<Long> monitor) { long size = getSize(); long newSize = LongUtil.intsToLong(endHigh, endLow); return network.synchronizer.applyComplexUpdate(owner(), signingPair(), (s, committer) -> clean(s, committer, network, crypto) .thenCompose(u -> u.left.overwriteSection(u.right, committer, fileData, 0L, newSize, network, crypto, monitor) .thenCompose(v -> newSize >= size ? Futures.of(v) : getUpdated(v, network) .thenCompose(f -> f.truncate(v, committer, newSize, network, crypto))))) .thenCompose(v -> getUpdated(v, network)); }

Target:
public CompletableFuture<FileWrapper> overwriteFileJS(AsyncReader fileData, int endHigh, int endLow, NetworkAccess network, Crypto crypto, ProgressConsumer<Long> monitor) { long size = getSize(); long newSize = LongUtil.intsToLong(endHigh, endLow); return network.synchronizer.applyComplexUpdate(owner(), signingPair(), (s, committer) -> clean(s, committer, network, crypto) .thenCompose(u -> u.left.overwriteSection(u.right, committer, fileData, 0L, newSize, network, crypto, monitor)) .thenCompose(v -> newSize >= size ? Futures.of(v) : getUpdated(v, network).thenCompose(f -> f.truncate(v, committer, newSize, network, crypto))) ).thenCompose(v -> getUpdated(v, network)); }
Source:
public Map<Integer, Long> pause(final String id, final long timeout) { log.debug("Pause task[%s] timeout[%d]", id, timeout); try { final FullResponseHolder response = submitRequest( id, HttpMethod.POST, "pause", timeout > 0 ? StringUtils.format("timeout=%d", timeout) : null, true ); if (response.getStatus().equals(HttpResponseStatus.OK)) { log.info("Task [%s] paused successfully", id); return jsonMapper.readValue(response.getContent(), new TypeReference<Map<Integer, Long>>() { }); } final RetryPolicy retryPolicy = retryPolicyFactory.makeRetryPolicy(); while (true) { if (getStatus(id) == KafkaIndexTask.Status.PAUSED) { return getCurrentOffsets(id, true); } final Duration delay = retryPolicy.getAndIncrementRetryDelay(); if (delay == null) { log.error("Task [%s] failed to pause, aborting", id); throw new ISE("Task [%s] failed to pause, aborting", id); } else { final long sleepTime = delay.getMillis(); log.info( "Still waiting for task [%s] to pause; will try again in [%s]", id, new Duration(sleepTime).toString() ); Thread.sleep(sleepTime); } } } catch (NoTaskLocationException e) { log.error("Exception [%s] while pausing Task [%s]", e.getMessage(), id); return ImmutableMap.of(); } catch (IOException | InterruptedException e) { log.error("Exception [%s] while pausing Task [%s]", e.getMessage(), id); throw new RuntimeException(e); } }

Target:
public Map<Integer, Long> pause(final String id, final long timeout) { log.debug("Pause task[%s] timeout[%d]", id, timeout); try { final FullResponseHolder response = submitRequest( id, HttpMethod.POST, "pause", timeout > 0 ? StringUtils.format("timeout=%d", timeout) : null, true ); if (response.getStatus().equals(HttpResponseStatus.OK)) { log.info("Task [%s] paused successfully", id); return jsonMapper.readValue(response.getContent(), new TypeReference<Map<Integer, Long>>() { }); } final RetryPolicy retryPolicy = retryPolicyFactory.makeRetryPolicy(); while (true) { if (getStatus(id) == KafkaIndexTask.Status.PAUSED) { return getCurrentOffsets(id, true); } final Duration delay = retryPolicy.getAndIncrementRetryDelay(); if (delay == null) { log.error("Task [%s] failed to pause, aborting", id); throw new ISE("Task [%s] failed to pause, aborting", id); } else { final long sleepTime = delay.getMillis(); log.info( "Still waiting for task [%s] to pause; will try again in [%s]", id, new Duration(sleepTime).toString() ); Thread.sleep(sleepTime); } } } catch (NoTaskLocationException e) { log.error("Exception [%s] while pausing Task [%s]", e.getMessage(), id); return ImmutableMap.of(); } catch (IOException | InterruptedException e) { throw new RuntimeException( StringUtils.format("Exception [%s] while pausing Task [%s]", e.getMessage(), id), e ); } }
Source:
public List<String> getFileExtensions(){ ArrayList<String> extensions = new ArrayList(1); extensions.add("blastxml"); return extensions; }

Target:
public List<String> getFileExtensions(){ ArrayList<String> extensions = new ArrayList<String>(1); extensions.add("blastxml"); return extensions; }
Source:
public void testCreateLoadBalancer() { List<String> serverIds = com.google.common.collect.Lists.newArrayList(); serverIds.add("server-ids"); LoadBalancer.Request.CreatePayload payload = LoadBalancer.Request.creatingBuilder() .dataCenterId(dataCenterId) .loadBalancerName("testName") .loadBalancerAlgorithm(LoadbalancerAlgorithm.ROUND_ROBIN) .ip("0.0.0.1") .lanId("1") .serverIds(serverIds) .build(); LoadBalancer loadBalancer = api.loadBalancerApi().createLoadBalancer(payload); System.out.println(loadBalancer); assertNotNull(loadBalancer); }

Target:
public void testCreateLoadBalancer() { List<String> serverIds = com.google.common.collect.Lists.newArrayList(); serverIds.add("server-ids"); LoadBalancer.Request.CreatePayload payload = LoadBalancer.Request.creatingBuilder() .dataCenterId(dataCenterId) .loadBalancerName("testName") .loadBalancerAlgorithm(Algorithm.ROUND_ROBIN) .ip("0.0.0.1") .lanId("1") .serverIds(serverIds) .build(); String requestId = api.loadBalancerApi().createLoadBalancer(payload); assertNotNull(requestId); }
Source:
public void getJobCompletedNotification() throws IOException, SignatureException { UUID notificationUUID = null; try { notificationUUID = client.putJobCompletedNotificationRegistrationSpectraS3( new PutJobCompletedNotificationRegistrationSpectraS3Request("test@test.test")) .getJobCompletedNotificationRegistrationResult().getId(); final GetJobCompletedNotificationRegistrationSpectraS3Response response = client .getJobCompletedNotificationRegistrationSpectraS3( new GetJobCompletedNotificationRegistrationSpectraS3Request(notificationUUID)); assertThat(response.getStatusCode(), is(200)); } finally { client.deleteJobCompletedNotificationRegistrationSpectraS3( new DeleteJobCompletedNotificationRegistrationSpectraS3Request(notificationUUID)); } }

Target:
public void getJobCompletedNotification() throws IOException, SignatureException { UUID notificationUUID = null; try { notificationUUID = client.putJobCompletedNotificationRegistrationSpectraS3( new PutJobCompletedNotificationRegistrationSpectraS3Request("test@test.test")) .getJobCompletedNotificationRegistrationResult().getId(); final GetJobCompletedNotificationRegistrationSpectraS3Response response = client .getJobCompletedNotificationRegistrationSpectraS3( new GetJobCompletedNotificationRegistrationSpectraS3Request(notificationUUID)); assertThat(response.getStatusCode(), is(200)); } finally { if (notificationUUID != null) { client.deleteJobCompletedNotificationRegistrationSpectraS3( new DeleteJobCompletedNotificationRegistrationSpectraS3Request(notificationUUID)); } } }
Source:
public AuthHeader fromString(final String value) { if (value == null) { throw UnauthorizedException.missingCredentials(); } try { return AuthHeader.valueOf(value); } catch (RuntimeException e) { throw UnauthorizedException.malformedCredentials(e); } }

Target:
public AuthHeader fromString(final String value) { if (value == null) { return null; } try { return AuthHeader.valueOf(value); } catch (RuntimeException e) { throw UnauthorizedException.malformedCredentials(e); } }
Source:
public void unload(Catalog catalog) throws SQLException { conn.setAutoCommit(false); conn.setTransactionIsolation(workConf.getIsolationMode()); Statement st = conn.createStatement(); for (Table catalog_tbl : catalog.getTables()) { LOG.debug(String.format("Deleting data from %s.%s", workConf.getDBName(), catalog_tbl.getName())); String sql = "truncate " + catalog_tbl.getEscapedName(); st.execute(sql); } conn.commit(); }

Target:
public void unload(Catalog catalog) throws SQLException { conn.setAutoCommit(false); conn.setTransactionIsolation(workConf.getIsolationMode()); Statement st = conn.createStatement(); for (Table catalog_tbl : catalog.getTables()) { LOG.debug(String.format("Deleting data from %s.%s", workConf.getDBName(), catalog_tbl.getName())); String sql = "DELETE FROM " + catalog_tbl.getEscapedName(); st.execute(sql); } conn.commit(); }
Source:
protected void buildScript(int age) { if (!DeviceUtil.isOnline() && OfflineManager.hasCompilation()) { if (age == 0) { addPendingClient(new SearchClient()); addPendingClient(new OfflineCompilationClient()); } addPendingClient(new ContinueReadingClient()); if (age == 0) { addPendingClient(new RandomClient()); } } else { if (age == 0) { addPendingClient(new SearchClient()); addPendingClient(new AnnouncementClient()); } addPendingClient(new AggregatedFeedContentClient()); addPendingClient(new ContinueReadingClient()); if (age == 0) { addPendingClient(new MainPageClient()); } addPendingClient(new BecauseYouReadClient()); if (age == 0) { addPendingClient(new RandomClient()); } } }

Target:
protected void buildScript(int age) { boolean online = DeviceUtil.isOnline(); conditionallyAddPendingClient(new SearchClient(), age == 0); conditionallyAddPendingClient(new OfflineCompilationClient(), age == 0 && !online); conditionallyAddPendingClient(new AnnouncementClient(), age == 0 && online); conditionallyAddPendingClient(new AggregatedFeedContentClient(), online); addPendingClient(new ContinueReadingClient()); conditionallyAddPendingClient(new MainPageClient(), age == 0 && online); conditionallyAddPendingClient(new BecauseYouReadClient(), online); conditionallyAddPendingClient(new RandomClient(), age == 0); }
Source:
public void createLoansAccount(LoansPayload loansPayload) { checkViewAttached(); getMvpView().showProgressbar(true); mSubscription.add(mDataManagerLoan.createLoansAccount(loansPayload) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<Loans>() { @Override public void onCompleted() { getMvpView().showProgressbar(false); } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); getMvpView().showMessage(R.string.generic_failure_message, "fail"); } @Override public void onNext(Loans loans) { getMvpView().showProgressbar(false); getMvpView().showMessage(R.string.loan_creation_success, "success"); } })); }

Target:
public void createLoansAccount(LoansPayload loansPayload) { checkViewAttached(); getMvpView().showProgressbar(true); mSubscription.add(mDataManagerLoan.createLoansAccount(loansPayload) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<Loans>() { @Override public void onCompleted() { getMvpView().showProgressbar(false); } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); getMvpView().showMessage(R.string.generic_failure_message); } @Override public void onNext(Loans loans) { getMvpView().showProgressbar(false); getMvpView().showMessage(R.string.loan_creation_success); } })); }
Source:
public void errorSubscribeRace() throws Exception { for (int i = 0; i < 1000; i++) { final BehaviorProcessor<Object> p = BehaviorProcessor.create(); final TestSubscriber<Object> ts = new TestSubscriber<Object>(); final TestException ex = new TestException(); Runnable r1 = new Runnable() { @Override public void run() { p.subscribe(ts); } }; Runnable r2 = new Runnable() { @Override public void run() { p.onError(ex); } }; TestHelper.race(r1, r2); ts.assertError(TestException.class); } }

Target:
public void errorSubscribeRace() throws Exception { for (int i = 0; i < 1000; i++) { final BehaviorProcessor<Object> p = BehaviorProcessor.create(); final TestSubscriber<Object> ts = new TestSubscriber<Object>(); final TestException ex = new TestException(); Runnable r1 = new Runnable() { @Override public void run() { p.subscribe(ts); } }; Runnable r2 = new Runnable() { @Override public void run() { p.onError(ex); } }; TestHelper.race(r1, r2); ts.assertFailure(TestException.class); } }
Source:
private ActivityCommentMessage createMessage(UserDto sendingUser, UUID relatedUserAnonymizedId, IntervalActivity intervalActivityEntity, Optional<Message> repliedMessage, boolean isSentItem, String messageText) { ActivityCommentMessage message; BuddyInfoParameters buddyInfoParameters = new BuddyInfoParameters(sendingUser.getId(), relatedUserAnonymizedId, sendingUser.getPrivateData().getNickname(), sendingUser.getPrivateData().getUserPhotoId()); if (repliedMessage.isPresent()) { message = ActivityCommentMessage.createInstance(buddyInfoParameters, intervalActivityEntity, isSentItem, messageText, repliedMessage.get()); } else { message = ActivityCommentMessage.createThreadHeadInstance(buddyInfoParameters, intervalActivityEntity, isSentItem, messageText); } messageRepository.save(message); return message; }

Target:
private ActivityCommentMessage createMessage(UserDto sendingUser, UUID relatedUserAnonymizedId, IntervalActivity intervalActivityEntity, Optional<Message> repliedMessage, boolean isSentItem, String messageText) { ActivityCommentMessage message; BuddyInfoParameters buddyInfoParameters = BuddyMessageDto.createBuddyInfoParametersInstance(sendingUser, relatedUserAnonymizedId); if (repliedMessage.isPresent()) { message = ActivityCommentMessage.createInstance(buddyInfoParameters, intervalActivityEntity, isSentItem, messageText, repliedMessage.get()); } else { message = ActivityCommentMessage.createThreadHeadInstance(buddyInfoParameters, intervalActivityEntity, isSentItem, messageText); } messageRepository.save(message); return message; }
Source:
private @Nullable ByteBuffer parsePacketISB(ByteBuffer pcapPacketHeader, int blockLength) throws IOException { ByteBuffer pcapPacketData; pcapPacketHeader.getInt(); pcapPacketHeader.getInt(); pcapPacketHeader.getInt(); pcapPacketData = ByteBuffer.allocate(blockLength - 20); pcapPacketData.clear(); SeekableByteChannel fFileChannel; ByteOrder byteOrder = getByteOrder(); pcapPacketHeader.order(byteOrder); try { fFileChannel = getFileChannel(); fFileChannel.read(pcapPacketData); } catch (BadPcapFileException e) { } pcapPacketData.flip(); return pcapPacketData; }

Target:
private @Nullable ByteBuffer parsePacketISB(ByteBuffer pcapPacketHeader, int blockLength) throws IOException { ByteBuffer pcapPacketData; pcapPacketHeader.getInt(); pcapPacketHeader.getInt(); pcapPacketHeader.getInt(); pcapPacketData = ByteBuffer.allocate(blockLength - 20); pcapPacketData.clear(); SeekableByteChannel fileChannel; ByteOrder byteOrder = getByteOrder(); pcapPacketHeader.order(byteOrder); try { fileChannel = getFileChannel(); fileChannel.read(pcapPacketData); } catch (BadPcapFileException e) { } pcapPacketData.flip(); return pcapPacketData; }
Source:
public void leaseShouldExpireBeforeReapingLocks() { LeasableLockToken result = lock(REQUEST_1, LOCK_A).get(); assertThat(result.lease().isValid(service.identifiedTime())).isTrue(); waitForTimeout(TimeLimit.of( LockLeaseConstants.SERVER_LEASE_TIMEOUT.minus(LockLeaseConstants.BUFFER).toMillis())); assertThat(result.lease().isValid(service.identifiedTime())).isFalse(); assertLocked(LOCK_A); }

Target:
public void leaseShouldExpireBeforeReapingLocks() { Leased<LockToken> result = lock(REQUEST_1, LOCK_A).get(); assertThat(result.lease().isValid(service.leaderTime())).isTrue(); waitForTimeout(TimeLimit.of( LockLeaseContract.CLIENT_LEASE_TIMEOUT.toMillis())); assertThat(result.lease().isValid(service.leaderTime())).isFalse(); assertLocked(LOCK_A); }
Source:
public String configList(File workingDirectory, List<String> extraArgs) throws IOException, InterruptedException { List<String> args = new ArrayList<>(extraArgs); args.remove("--json=false"); args.add("-s"); return runCommand(workingDirectory, new String[]{"c", "ls", "--json"}, args); }

Target:
public String configList(File workingDirectory, List<String> extraArgs) throws IOException, InterruptedException { List<String> args = new ArrayList<>(extraArgs); args.add("-s"); args.add("--json"); return runCommand(workingDirectory, new String[]{"c", "ls"}, args); }
Source:
public String toString() { String id = getNodeID() == null ? "" : getNodeID(); String addr64 = get64BitAddress() == null || get64BitAddress().equals(XBee64BitAddress.UNKNOWN_ADDRESS) ? "" : get64BitAddress().toString(); if (id.length() == 0 && addr64.length() == 0) return super.toString(); StringBuilder message = new StringBuilder(super.toString()); message.append(addr64); if (id.length() > 0) { message.append(" ("); message.append(id); message.append(")"); } message.append(" - "); return message.toString(); }

Target:
public String toString() { String id = getNodeID() == null ? "" : getNodeID(); String addr64 = get64BitAddress() == null || get64BitAddress().equals(XBee64BitAddress.UNKNOWN_ADDRESS) ? "" : get64BitAddress().toString(); if (id.length() == 0 && addr64.length() == 0) return connectionInterface.toString(); StringBuilder message = new StringBuilder(connectionInterface.toString()); message.append(addr64); if (id.length() > 0) { message.append(" ("); message.append(id); message.append(")"); } message.append(" - "); return message.toString(); }
Source:
private Node createClusterTree() { Node root = new Node(); root.setName("root"); root.setId(computeId("root")); root.setType(Types.ROOT.name()); for (String instance : _allInstances) { InstanceConfig insConfig = _instanceConfigMap.get(instance); LinkedHashMap<String, String> instanceTopologyMap = new LinkedHashMap<>(); if (computeInstanceTopologyMap(_clusterConfig, instance, insConfig, instanceTopologyMap)) { int weight = insConfig.getWeight(); if (weight < 0 || weight == InstanceConfig.WEIGHT_NOT_SET) { weight = DEFAULT_NODE_WEIGHT; } addEndNode(root, instance, instanceTopologyMap, weight, _liveInstances); } } return root; }

Target:
private Node createClusterTree() { Node root = new Node(); root.setName("root"); root.setId(computeId("root")); root.setType(Types.ROOT.name()); for (String instanceName : _allInstances) { InstanceConfig insConfig = _instanceConfigMap.get(instanceName); try { LinkedHashMap<String, String> instanceTopologyMap = computeInstanceTopologyMap(_clusterConfig.isTopologyAwareEnabled(), instanceName, insConfig, _clusterTopologyKeys); int weight = insConfig.getWeight(); if (weight < 0 || weight == InstanceConfig.WEIGHT_NOT_SET) { weight = DEFAULT_NODE_WEIGHT; } addEndNode(root, instanceName, instanceTopologyMap, weight, _liveInstances); } catch (IllegalArgumentException e) { if (isInstanceEnabled(_clusterConfig, instanceName, insConfig)) { throw e; } else { logger .warn("Topology setting for instance is unset or invalid, ignore the instance!", insConfig.getDomainAsString(), instanceName); } } } return root; }
Source:
public boolean isSelected() { return (this.selected); }

Target:
public boolean isSelected() { return this.selected; }
Source:
private void addMultiPointMethods(ParameterSignature sig, List<PotentialAssignment> list) throws Throwable { for (FrameworkMethod dataPointsMethod : getDataPointsMethods(sig)) { Class<?> returnType = dataPointsMethod.getReturnType(); if (returnType.isArray() && sig.canPotentiallyAcceptType(returnType.getComponentType())) { try { addArrayValues(sig, dataPointsMethod.getName(), list, dataPointsMethod.invokeExplosively(null)); } catch (Throwable t) { DataPoints annotation = dataPointsMethod.getAnnotation(DataPoints.class); if (annotation != null) { for (Class<? extends Throwable> ignored : annotation.ignoredExceptions()) { if (ignored.isAssignableFrom(t.getClass())) { return; } } } throw t; } } } }

Target:
private void addMultiPointMethods(ParameterSignature sig, List<PotentialAssignment> list) throws Throwable { for (FrameworkMethod dataPointsMethod : getDataPointsMethods(sig)) { Class<?> returnType = dataPointsMethod.getReturnType(); if (returnType.isArray() && sig.canPotentiallyAcceptType(returnType.getComponentType())) { try { addArrayValues(sig, dataPointsMethod.getName(), list, dataPointsMethod.invokeExplosively(null)); } catch (Throwable throwable) { DataPoints annotation = dataPointsMethod.getAnnotation(DataPoints.class); if (annotation != null && isAssignableToAnyOf(annotation.ignoredExceptions(), throwable)) { return; } else { throw throwable; } } } } }
Source:
public boolean hasExplicitWriteIndex() { return writeAlias != null && ! writeAlias.isEmpty(); }

Target:
public boolean hasExplicitWriteIndex() { return StringUtils.isNotBlank(writeAlias); }
Source:
private void addTypes(List<String> files, List<SymbolAction> actions, Node node) { Iterator<String> it = files.iterator(); while(it.hasNext()) { String next = it.next(); if (next.endsWith(".class")) { String[] split = next.split("\\$\\d"); if (split.length == 1) { String asClass = next.replaceAll(File.separator, "\\."); String fullName = asClass.substring(0, asClass.length() - 6); addType(fullName, false, node, actions); } } } }

Target:
private void addTypes(List<String> files, List<SymbolAction> actions, Node node) { for (String classFile: files) { if (isClassFile(classFile) && !isAnonymousClass(classFile)) { String asClass = classFile.replaceAll(File.separator, "\\."); String fullName = asClass.substring(0, asClass.length() - 6); addType(fullName, false, node, actions); } } }
Source:
protected Object encodeCommand(Command command) { initDevicePassword(command, defaultDevicePassword); String cmd = ""; switch (command.getType()) { case Command.TYPE_CUSTOM: cmd = formatCommand(command, "${%s}", Command.KEY_DATA); break; case Command.TYPE_POSITION_SINGLE: cmd = formatCommand(command, "$AVREQ,{%s},1", Command.KEY_DEVICE_PASSWORD); break; case Command.TYPE_REBOOT_DEVICE: cmd = formatCommand(command, "$AVRESET,{%s},{%s}", Command.KEY_UNIQUE_ID, Command.KEY_DEVICE_PASSWORD); break; default: break; } if (cmd.length() > 0) { cmd += Checksum.nmea(cmd) + "\r\n"; return cmd; } return null; }

Target:
protected Object encodeCommand(Command command) { initDevicePassword(command, LaipacProtocolDecoder.DEFAULT_DEVICE_PASSWORD); switch (command.getType()) { case Command.TYPE_CUSTOM: return formatCommand(command, "{%s}", Command.KEY_DATA); case Command.TYPE_POSITION_SINGLE: return formatCommand(command, "AVREQ,{%s},1", Command.KEY_DEVICE_PASSWORD); case Command.TYPE_REBOOT_DEVICE: return formatCommand(command, "AVRESET,{%s},{%s}", Command.KEY_UNIQUE_ID, Command.KEY_DEVICE_PASSWORD); default: return null; } }
Source:
default Mono<ResponseEntity<Problem>> handleAuthentication(final AuthenticationException e, final ServerWebExchange request) { if (e instanceof AuthenticationServiceException) { return handleAuthenticationService((AuthenticationServiceException) e, request); } return create(UNAUTHORIZED, e, request); }

Target:
default Mono<ResponseEntity<Problem>> handleAuthentication(final AuthenticationException e, final ServerWebExchange request) { return create(UNAUTHORIZED, e, request); }
Source:
public String getReviewer() { final String footer = getFooter(); if (footer == null) { return null; } return footer.split(" on ")[0].trim(); }

Target:
public Optional<String> getReviewer() { return getFooter().map(footer -> footer.split(" on ")[0].trim()); }
Source:
public void testDiffResults() throws Exception { TestUtills.runRepairabilityPrint("ALL", "/dataset/commons-lang/"); }

Target:
public void testDiffResults() throws Exception { int count=0; FinalResult result = TestUtills.runRepairabilityGit("ALL", "repogit4testv0"); Map<IRevision, RevisionResult> revisionsMap = result.getAllResults(); assertEquals(13, revisionsMap.keySet().size()); for (Map.Entry<IRevision, RevisionResult> entry : revisionsMap.entrySet()) { RevisionResult rr = entry.getValue(); PatternInstancesFromRevision instances = (PatternInstancesFromRevision) rr.getResultFromClass(RepairabilityAnalyzer.class); List<DiffRow> row_list = instances.getRow_list(); switch (count){ case 1: assertEquals(row_list,null); case 9: assertEquals(row_list,null); case 2: assertEquals(row_list,"[[INSERT,, ], [INSERT,,package org.apache.commons.lang3;], [EQUAL,,], [INSERT,, ], [INSERT,,public class CharSequenceUtils {], [INSERT,,], [INSERT,, private static final int NOT_FOUND = -1;], [INSERT,,], [INSERT,, ], [INSERT,, public CharSequenceUtils() {], [INSERT,, super();], [INSERT,, }], [INSERT,,], [INSERT,, } } }
Source:
public void traceUpdated(final TmfTraceUpdatedSignal signal) { if (signal.getTrace() == fTrace) { setStartTime(fTrace.getStartTime().toNanos()); setEndTime(fTrace.getEndTime().toNanos()); refresh(); } }

Target:
public void traceUpdated(final TmfTraceUpdatedSignal signal) { if (signal.getTrace() == fTrace) { setTimeBoundsAndRefresh(); } }
Source:
public void navigateToTitle(@NonNull PageTitle title, boolean inNewTab, int position) { if (!isAdded()) { return; } funnel.searchClick(position, searchLanguageCode); HistoryEntry historyEntry = new HistoryEntry(title, HistoryEntry.SOURCE_SEARCH); startActivity(inNewTab ? PageActivity.newIntentForNewTab(requireContext(), historyEntry, historyEntry.getTitle()) : invokeSource == PAGE_ACTION_TAB ? PageActivity.newIntentForCurrentTab(requireContext(), historyEntry, historyEntry.getTitle(), false) : PageActivity.newIntentForExistingTab(requireContext(), historyEntry, historyEntry.getTitle())); closeSearch(); }

Target:
public void navigateToTitle(@NonNull PageTitle title, boolean inNewTab, int position) { if (!isAdded()) { return; } funnel.searchClick(position, searchLanguageCode); HistoryEntry historyEntry = new HistoryEntry(title, HistoryEntry.SOURCE_SEARCH); startActivity(inNewTab ? PageActivity.newIntentForNewTab(requireContext(), historyEntry, historyEntry.getTitle()) : PageActivity.newIntentForCurrentTab(requireContext(), historyEntry, historyEntry.getTitle(), false)); closeSearch(); }
Source:
public DockerConnection query(String name, Object... values) { if (name == null) { throw new IllegalArgumentException("Name is null"); } if (values == null) { throw new IllegalArgumentException("Values are null"); } for (Object value : values) { if (value == null) { throw new IllegalArgumentException("Value is null"); } if (query.length() > 0) { query.append('&'); } query.append(name).append('=').append(value.toString()); } return this; }

Target:
public DockerConnection query(String name, Object... values) { if (name == null) { throw new NullPointerException("Name is null"); } if (values == null) { throw new NullPointerException("Values are null"); } for (Object value : values) { if (value == null) { throw new NullPointerException("Value is null"); } if (query.length() > 0) { query.append('&'); } query.append(name).append('=').append(value.toString()); } return this; }
Source:
private void visitCatchBlock(DetailAST catchAst) { if (isEmptyCatchBlock(catchAst)) { final String commentContent = getCommentFirstLine(catchAst); if (isVerifiable(catchAst, commentContent)) { log(EmptyBlockCheck.findLeftCurly(catchAst), MSG_KEY_CATCH_BLOCK_EMPTY); } } }

Target:
private void visitCatchBlock(DetailAST catchAst) { if (isEmptyCatchBlock(catchAst)) { final String commentContent = getCommentFirstLine(catchAst); if (isVerifiable(catchAst, commentContent)) { log(catchAst.findFirstToken(TokenTypes.SLIST), MSG_KEY_CATCH_BLOCK_EMPTY); } } }
Source:
private void tick() { recordCounter("tick", 1); final Instant now = _clock.instant(); if (_schedule.nextRun(_lastRun).map(run -> run.isBefore(now)).orElse(true)) { final LocalDate startDate = ZonedDateTime.ofInstant(now, _clock.getZone()).toLocalDate(); final LocalDate endDate = startDate.plusDays(_lookahead); final CreateForRange createPartitions = new CreateForRange.Builder() .setStart(startDate) .setEnd(endDate) .build(); getSelf().tell(createPartitions, getSelf()); } }

Target:
private void tick() { recordCounter("tick", 1); final Instant now = _clock.instant(); if (_schedule.nextRun(_lastRun).map(run -> run.isBefore(now)).orElse(true)) { final LocalDate startDate = ZonedDateTime.ofInstant(now, ZoneOffset.UTC).toLocalDate(); final LocalDate endDate = startDate.plusDays(_lookaheadDays); final CreateForRange createPartitions = new CreateForRange.Builder() .setStart(startDate) .setEnd(endDate) .build(); getSelf().tell(createPartitions, ActorRef.noSender()); } }
Source:
public ASTValue eval(WordsEnvironment environment) throws WordsRuntimeException { ASTValue referenceObject = children.get(0).eval(environment); ASTValue identifier = children.get(1).eval(environment); AST message = children.get(2); ASTValue doNow = children.get(3) != null ? children.get(3).eval(environment) : null; WordsObject object; if (referenceObject.type.equals(ASTValue.ValueType.OBJ)){ WordsProperty property = referenceObject.objValue.getProperty(identifier.stringValue); if (property.type != WordsProperty.PropertyType.OBJECT) { throw new WordsInvalidTypeException(ASTValue.ValueType.OBJ.toString(), property.type.toString()); } object = property.objProperty; } else { object = environment.getObject(identifier.stringValue); } if (object == null) { throw new WordsObjectNotFoundException(identifier.stringValue); } WordsSay action = new WordsSay(message); if (doNow == null) { object.enqueueAction(action); } else { object.enqueueActionAtFront(action); } return null; }

Target:
public ASTValue eval(WordsEnvironment environment) throws WordsRuntimeException { ASTValue referenceObject = children.get(0).eval(environment); ASTValue identifier = children.get(1).eval(environment); AST message = children.get(2); ASTValue doNow = children.get(3) != null ? children.get(3).eval(environment) : null; WordsObject object; if (referenceObject.type.equals(ASTValue.ValueType.OBJ)){ WordsProperty property = referenceObject.objValue.getProperty(identifier.stringValue); if (property.type != WordsProperty.PropertyType.OBJECT) { throw new WordsInvalidTypeException(ASTValue.ValueType.OBJ.toString(), property.type.toString()); } object = property.objProperty; } else { object = environment.getObject(identifier.stringValue); } WordsSay action = new WordsSay(message); if (doNow == null) { object.enqueueAction(action); } else { object.enqueueActionAtFront(action); } return null; }
Source:
void doesNotReopenCDataWithinCDataContent() throws Exception { UniqueId uniqueId = engineDescriptor.getUniqueId().append("test", "test"); engineDescriptor.addChild(new TestDescriptorStub(uniqueId, "test")); TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); XmlReportData reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); AssertionError assertionError = new AssertionError("<foo><![CDATA[bar]]></foo>"); reportData.markFinished(testPlan.getTestIdentifier(uniqueId.toString()), failed(assertionError)); Writer assertingNullWriter = new Writer() { @Override public void write(char[] cbuf, int off, int len) { assertThat(new String(cbuf, off, len)) .doesNotContain("]]><![CDATA["); } @Override public void flush() { } @Override public void close() { } }; writeXmlReport(testPlan, reportData, assertingNullWriter); }

Target:
void doesNotReopenCDataWithinCDataContent() throws Exception { UniqueId uniqueId = engineDescriptor.getUniqueId().append("test", "test"); engineDescriptor.addChild(new TestDescriptorStub(uniqueId, "test")); TestPlan testPlan = TestPlan.from(singleton(engineDescriptor)); XmlReportData reportData = new XmlReportData(testPlan, Clock.systemDefaultZone()); AssertionError assertionError = new AssertionError("<foo><![CDATA[bar]]></foo>"); reportData.markFinished(testPlan.getTestIdentifier(uniqueId.toString()), failed(assertionError)); Writer assertingWriter = new StringWriter() { @Override public void write(char[] cbuf, int off, int len) { assertThat(new String(cbuf, off, len)).doesNotContain("]]><![CDATA["); } }; writeXmlReport(testPlan, reportData, assertingWriter); }
Source:
private Element createSharedPoolElement(Document doc, String poolName, ServerSideConfiguration.Pool pool) { Element poolElement = doc.createElement(TC_CLUSTERED_NAMESPACE_PREFIX + COLON + SHARED_POOL_ELEMENT_NAME); poolElement.setAttribute(NAME_ATTRIBUTE_NAME, poolName); String from = pool.getServerResource(); if (!(from == null || from.trim().length() == 0)) { poolElement.setAttribute(FROM_ATTRIBUTE_NAME, from); } long memoryInBytes = MemoryUnit.B.convert(pool.getSize(), MemoryUnit.B); poolElement.setAttribute(UNIT_ATTRIBUTE_NAME, MemoryUnit.B.toString()); poolElement.setTextContent(Long.toString(memoryInBytes)); return poolElement; }

Target:
private Element createSharedPoolElement(Document doc, String poolName, ServerSideConfiguration.Pool pool) { Element poolElement = doc.createElement(TC_CLUSTERED_NAMESPACE_PREFIX + COLON + SHARED_POOL_ELEMENT_NAME); poolElement.setAttribute(NAME_ATTRIBUTE_NAME, poolName); String from = pool.getServerResource(); if (from != null) { if (from.trim().length() == 0) { throw new XmlConfigurationException("Resource pool name can not be empty."); } poolElement.setAttribute(FROM_ATTRIBUTE_NAME, from); } long memoryInBytes = MemoryUnit.B.convert(pool.getSize(), MemoryUnit.B); poolElement.setAttribute(UNIT_ATTRIBUTE_NAME, MemoryUnit.B.toString()); poolElement.setTextContent(Long.toString(memoryInBytes)); return poolElement; }
Source:
public String getApiCall(int startingPoint, String channelId, DateTime dateTime) { DateTimeFormatter formatter = DateTimeFormat.forPattern("y-M-d'T'hh:mm:ss'Z'"); String baseUri = "<LINK_0>" + "?expand=watchable&from_time=%s&until_time=%s"; if (timeFrame == TimeFrame.TODAY) { DateTime todayStartDateTime = dateTime.withTimeAtStartOfDay(); DateTime todayEndDateTime = todayStartDateTime .plusDays(1) .withTimeAtStartOfDay() .minusMinutes(1); String todayStart = todayStartDateTime.toString(formatter); String todayFinish = todayEndDateTime.toString(formatter); return String.format(baseUri, channelId, todayStart, todayFinish); } else if (timeFrame == TimeFrame.PLUS_MINUS_7_DAYS) { DateTime weekAgo = dateTime.minusDays(7); DateTime weekAhead = weekAgo.plusDays(14); String sevenDaysAgo = weekAgo.toString(formatter); String sevenDaysAhead = weekAhead.toString(formatter); return String.format(baseUri, channelId, sevenDaysAgo, sevenDaysAhead); } else { return String.format("%s/shows?offset=%d&limit=%d", BASE_API_URL, startingPoint, LIMIT); } }

Target:
String getApiCall(int startingPoint, String channelId, DateTime dateTime) { DateTimeFormatter formatter = ISODateTimeFormat.dateTimeNoMillis(); String baseUri = "<LINK_0>" + "?expand=watchable&from_time=%s&until_time=%s"; if (timeFrame == TimeFrame.TODAY) { DateTime todayStartDateTime = dateTime .withTimeAtStartOfDay() .withZone(DateTimeZone.UTC); DateTime todayEndDateTime = todayStartDateTime .plusDays(1) .withTimeAtStartOfDay() .minusSeconds(1); String todayStart = todayStartDateTime.toString(formatter); String todayFinish = todayEndDateTime.toString(formatter); return String.format(baseUri, channelId, todayStart, todayFinish); } else if (timeFrame == TimeFrame.PLUS_MINUS_7_DAYS) { DateTime weekAgo = dateTime.minusDays(7); DateTime weekAhead = weekAgo.plusDays(14); String sevenDaysAgo = weekAgo.toString(formatter); String sevenDaysAhead = weekAhead.toString(formatter); return String.format(baseUri, channelId, sevenDaysAgo, sevenDaysAhead); } else { return String.format( "%s/shows?offset=%d&limit=%d", BASE_API_URL, startingPoint, LIMIT ); } }
Source:
private static int[] stringsToIntegers(String[] strings) { if (strings == null) { return new int[0]; } return Arrays.stream(strings).map(x -> { try { return OptionalInt.of(Integer.parseInt(x)); } catch (NumberFormatException e) { return OptionalInt.empty(); } }).filter(OptionalInt::isPresent).mapToInt(OptionalInt::getAsInt).toArray(); }

Target:
private static int[] stringsToIntegers(String[] strings) { if (strings == null) { return new int[0]; } return Arrays.stream(strings).map(x -> { try { return Integer.parseInt(x); } catch (NumberFormatException e) { return null; } }).filter(Objects::nonNull).mapToInt(x -> x).toArray(); }
Source:
protected InternalCompletableFuture<Boolean> callRemoveAsync(K key, Data keyData, Data oldValueData, boolean withCompletionEvent, BiConsumer<Boolean, Throwable> statsCallback) { InternalCompletableFuture<Boolean> future = super.callRemoveAsync(key, keyData, oldValueData, withCompletionEvent, null); future.whenCompleteAsync((removed, throwable) -> { try { if (statsCallback != null) { statsCallback.accept(removed, throwable); } } finally { invalidateNearCache(toNearCacheKey(key, keyData)); } }); return future; }

Target:
protected CompletableFuture<Boolean> callRemoveAsync(K key, Data keyData, Data oldValueData, boolean withCompletionEvent, BiConsumer<Boolean, Throwable> statsCallback) { CompletableFuture<Boolean> future = super.callRemoveAsync(key, keyData, oldValueData, withCompletionEvent, null); return future.whenCompleteAsync((removed, throwable) -> { try { if (statsCallback != null) { statsCallback.accept(removed, throwable); } } finally { invalidateNearCache(toNearCacheKey(key, keyData)); } }); }
Source:
public void test() throws Exception { final UriPage uri = new UriPage("uri?offset=god&limit=10"); final UriComponentsBuilder builder = fromUriString("/this/is/{template}").query("other=false"); uri.updateWithPageParams(builder); uri.updateWithPageParams(builder); uri.updateWithPageParams(builder); final UriComponents components = builder.build(); assertThat(components, is(notNullValue())); assertThat(components.getPath(), is("/this/is/{template}")); assertThat(components.getQueryParams(), hasEntry("other", singletonList("false"))); assertThat(components.getQueryParams(), hasEntry("offset", singletonList("god"))); assertThat(components.getQueryParams(), hasEntry("limit", singletonList("10"))); }

Target:
public void test() throws Exception { final UriPage uri = new UriPage("uri?offset=god&limit=10"); final UriComponentsBuilder builder = fromUriString("/this/is/{template}").query("other=false"); uri.updateWithPageParams(builder); final UriComponents components = builder.build(); assertThat(components, is(notNullValue())); assertThat(components.getPath(), is("/this/is/{template}")); assertThat(components.getQueryParams(), hasEntry("other", singletonList("false"))); assertThat(components.getQueryParams(), hasEntry("offset", singletonList("god"))); assertThat(components.getQueryParams(), hasEntry("limit", singletonList("10"))); }
Source:
public NonAnnotatedVariantsMongoReader(MongoOperations template, String collectionsVariantsName, String studyId) throws JobParametersInvalidException { if (studyId == null) { throw new JobParametersInvalidException("NonAnnotatedVariantsMongoReader needs a non-null studyId " + "(it can take a studyId or an empty string for reading every study)"); } setTemplate(template); setCollection(collectionsVariantsName); BasicDBObjectBuilder queryBuilder = BasicDBObjectBuilder.start(); if (!studyId.isEmpty()) { queryBuilder.add(STUDY_KEY, studyId); } DBObject query = queryBuilder.add("annot.ct.so", new BasicDBObject("$exists", false)).get(); setQuery(query); String[] fields = { "chr", "start", "end", "ref", "alt" }; setFields(fields); }

Target:
public NonAnnotatedVariantsMongoReader(MongoOperations template, String collectionsVariantsName, String studyId) { if (studyId == null) { throw new IllegalArgumentException("NonAnnotatedVariantsMongoReader needs a non-null studyId " + "(it can take a studyId or an empty string for reading every study)"); } setTemplate(template); setCollection(collectionsVariantsName); BasicDBObjectBuilder queryBuilder = BasicDBObjectBuilder.start(); if (!studyId.isEmpty()) { queryBuilder.add(STUDY_KEY, studyId); } DBObject query = queryBuilder.add("annot.ct.so", new BasicDBObject("$exists", false)).get(); setQuery(query); String[] fields = { "chr", "start", "end", "ref", "alt" }; setFields(fields); }
Source:
public SslHandler newSSLHandler(SocketChannel channel) { throw new UnsupportedOperationException("This is a placeholder, please use newSSLHandler(SocketChannel channel, InetSocketAddress address)"); }

Target:
public SslHandler newSSLHandler(SocketChannel channel) { SSLEngine engine = newSSLEngine(channel); return new SslHandler(engine); }
Source:
protected VmDevice createDiskVmDevice(final DiskImage diskImage) { final VmDevice vmDevice = new VmDevice(); vmDevice.setIsPlugged(true); vmDevice.setId(new VmDeviceId(diskImage.getimage_group_id(), Guid.NewGuid())); return vmDevice; }

Target:
private VmDevice createDiskVmDevice(final DiskImage diskImage) { final VmDevice vmDevice = new VmDevice(); vmDevice.setIsPlugged(true); vmDevice.setId(new VmDeviceId(diskImage.getimage_group_id(), Guid.NewGuid())); return vmDevice; }