auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void importProjects(final Set<File> dotProjectFiles) { WorkspaceJob job = new WorkspaceJob( UIText.ImportChangedProjectsCommand_ImportingChangedProjects) { @Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { for (File f : dotProjectFiles) { if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } String ap = f.getAbsolutePath(); importProject(ap); } return Status.OK_STATUS; } }; job.schedule(); }

Target:
private void importProjects(final Set<File> dotProjectFiles) { WorkspaceJob job = new WorkspaceJob( UIText.ImportChangedProjectsCommand_ImportingChangedProjects) { @Override public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException { for (File f : dotProjectFiles) { if (monitor.isCanceled()) return Status.CANCEL_STATUS; String ap = f.getAbsolutePath(); importProject(ap); } return Status.OK_STATUS; } }; job.schedule(); }
Source:
public List<String> getListCasesHavingArtifactInstancesKnownBad(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException { String normalizeValuedd = CorrelationAttributeNormalizer.normalize(aType, value); Connection conn = connect(); Collection<String> caseNames = new LinkedHashSet<>(); PreparedStatement preparedStatement = null; ResultSet resultSet = null; String tableName = EamDbUtil.correlationTypeToInstanceTableName(aType); String sql = "SELECT DISTINCT case_name FROM " + tableName + " INNER JOIN cases ON " + tableName + ".case_id=cases.id WHERE " + tableName + ".value=? AND " + tableName + ".known_status=?"; try { preparedStatement = conn.prepareStatement(sql); preparedStatement.setString(1, normalizeValuedd); preparedStatement.setByte(2, TskData.FileKnown.BAD.getFileKnownValue()); resultSet = preparedStatement.executeQuery(); while (resultSet.next()) { caseNames.add(resultSet.getString("case_name")); } } catch (SQLException ex) { throw new EamDbException("Error getting notable artifact instances.", ex); } finally { EamDbUtil.closeStatement(preparedStatement); EamDbUtil.closeResultSet(resultSet); EamDbUtil.closeConnection(conn); } return caseNames.stream().collect(Collectors.toList()); }

Target:
public List<String> getListCasesHavingArtifactInstancesKnownBad(CorrelationAttributeInstance.Type aType, String value) throws EamDbException, CorrelationAttributeNormalizationException { String normalizedValue = CorrelationAttributeNormalizer.normalize(aType, value); Connection conn = connect(); Collection<String> caseNames = new LinkedHashSet<>(); PreparedStatement preparedStatement = null; ResultSet resultSet = null; String tableName = EamDbUtil.correlationTypeToInstanceTableName(aType); String sql = "SELECT DISTINCT case_name FROM " + tableName + " INNER JOIN cases ON " + tableName + ".case_id=cases.id WHERE " + tableName + ".value=? AND " + tableName + ".known_status=?"; try { preparedStatement = conn.prepareStatement(sql); preparedStatement.setString(1, normalizedValue); preparedStatement.setByte(2, TskData.FileKnown.BAD.getFileKnownValue()); resultSet = preparedStatement.executeQuery(); while (resultSet.next()) { caseNames.add(resultSet.getString("case_name")); } } catch (SQLException ex) { throw new EamDbException("Error getting notable artifact instances.", ex); } finally { EamDbUtil.closeStatement(preparedStatement); EamDbUtil.closeResultSet(resultSet); EamDbUtil.closeConnection(conn); } return caseNames.stream().collect(Collectors.toList()); }
Source:
public void onInit() { this.createdAt = Timer.nanos(); }

Target:
public void onInit() { this.startNanos = Timer.nanos(); }
Source:
public MesosCloud(String nativeLibraryPath, String master, String description, String frameworkName, int slaveCpus, int slaveMem, int maxExecutors, int executorCpus, int executorMem, int idleTerminationMinutes) throws NumberFormatException { super("MesosCloud"); this.nativeLibraryPath = nativeLibraryPath; this.master = master; this.description = description; if (StringUtils.isNotBlank(frameworkName)) { this.frameworkName = frameworkName; } else { this.frameworkName = DEFAULT_FRAMEWORK_NAME; } this.slaveCpus = slaveCpus; this.slaveMem = slaveMem; this.maxExecutors = maxExecutors; this.executorCpus = executorCpus; this.executorMem = executorMem; this.idleTerminationMinutes = idleTerminationMinutes; restartMesos(); }

Target:
public MesosCloud(String nativeLibraryPath, String master, String description, String frameworkName, int slaveCpus, int slaveMem, int maxExecutors, int executorCpus, int executorMem, int idleTerminationMinutes) throws NumberFormatException { super("MesosCloud"); this.nativeLibraryPath = nativeLibraryPath; this.master = master; this.description = description; this.frameworkName = StringUtils.isNotBlank(frameworkName) ? frameworkName : DEFAULT_FRAMEWORK_NAME; this.slaveCpus = slaveCpus; this.slaveMem = slaveMem; this.maxExecutors = maxExecutors; this.executorCpus = executorCpus; this.executorMem = executorMem; this.idleTerminationMinutes = idleTerminationMinutes; restartMesos(); }
Source:
private void loadNews() { Platform.runLater(() -> { newsWebView.getEngine().load("<LINK_0>"); onLoadingStop(); }); }

Target:
private void loadNews() { Platform.runLater(() -> { Website website = clientProperties.getWebsite(); newsWebView.getEngine().load(website.getNewsHubUrl()); }); }
Source:
public void zoomToFit(List<LatLong> coords) { final BaiduMap map = getBaiduMap(); if (map == null) return; if (!coords.isEmpty()) { final List<LatLng> points = new ArrayList<LatLng>(); for (LatLong coord : coords) points.add(CoordToLatLang(coord)); final LatLngBounds bounds = getBounds(points); final Activity activity = getActivity(); if(activity == null) return; final View rootView = ((ViewGroup)activity.findViewById(android.R.id.content)).getChildAt(0); if(rootView == null) return; final int height = rootView.getHeight(); final int width = rootView.getWidth(); Log.d(TAG, String.format(Locale.US, "Screen W %d, H %d", width, height)); if(height > 0 && width > 0) { MapStatusUpdate animation = MapStatusUpdateFactory.newLatLngBounds(bounds, width, height); map.animateMapStatus(animation); } } }

Target:
public void zoomToFit(List<LatLong> coords) { final BaiduMap map = getBaiduMap(); if (map == null) return; if (!coords.isEmpty()) { final List<LatLng> points = new ArrayList<LatLng>(); for (LatLong coord : coords) points.add(CoordToLatLng(coord)); final LatLngBounds bounds = getBounds(points); final Activity activity = getActivity(); if (activity == null) return; final View rootView = ((ViewGroup)activity.findViewById(android.R.id.content)).getChildAt(0); if (rootView == null) return; final int height = rootView.getHeight(); final int width = rootView.getWidth(); Log.d(TAG, String.format(Locale.US, "Screen W %d, H %d", width, height)); if (height > 0 && width > 0) { MapStatusUpdate animation = MapStatusUpdateFactory.newLatLngBounds(bounds, width, height); map.animateMapStatus(animation); } } }
Source:
private void handleRequest(HttpRequest httpRequest) throws RestServiceException { if (responseChannel == null || responseChannel.isResponseComplete()) { long processingStartTime = System.currentTimeMillis(); try { refreshState(); nettyMetrics.requestArrivalRate.mark(); if (!httpRequest.getDecoderResult().isSuccess()) { logger.warn("Decoder failed because of malformed request on channel {}", ctx.channel()); nettyMetrics.malformedRequestError.inc(); throw new RestServiceException("Decoder failed because of malformed request", RestServiceErrorCode.MalformedRequest); } request = new NettyRequest(httpRequest, nettyMetrics); responseChannel.setRequest(request, HttpHeaders.isKeepAlive(httpRequest)); logger.trace("Channel now handling request {}", ctx.channel(), request.getUri()); if (request.getRestMethod().equals(RestMethod.POST)) { requestHandler.handleRequest(request, responseChannel); } } finally { request.getMetricsTracker().nioMetricsTracker .addToRequestProcessingTime(System.currentTimeMillis() - processingStartTime); } } else { logger.warn("Discarding unexpected request on channel {}. Request under processing: {}. Unexpected request: {}", ctx.channel(), request.getUri(), httpRequest.getUri()); nettyMetrics.duplicateRequestError.inc(); } }

Target:
private void handleRequest(HttpRequest httpRequest) throws RestServiceException { if (responseChannel == null || responseChannel.isResponseComplete()) { long processingStartTime = System.currentTimeMillis(); try { resetState(); nettyMetrics.requestArrivalRate.mark(); if (!httpRequest.getDecoderResult().isSuccess()) { logger.warn("Decoder failed because of malformed request on channel {}", ctx.channel()); nettyMetrics.malformedRequestError.inc(); throw new RestServiceException("Decoder failed because of malformed request", RestServiceErrorCode.MalformedRequest); } request = new NettyRequest(httpRequest, nettyMetrics); responseChannel.setRequest(request); logger.trace("Channel now handling request {}", ctx.channel(), request.getUri()); if (request.getRestMethod().equals(RestMethod.POST)) { requestHandler.handleRequest(request, responseChannel); } } finally { request.getMetricsTracker().nioMetricsTracker .addToRequestProcessingTime(System.currentTimeMillis() - processingStartTime); } } else { logger.warn("Discarding unexpected request on channel {}. Request under processing: {}. Unexpected request: {}", ctx.channel(), request.getUri(), httpRequest.getUri()); nettyMetrics.duplicateRequestError.inc(); } }
Source:
static FilterOutInJectedTypesResult filterOutInJectedTypesFromOptionalValues(Class<?>[] parameterTypes, String[] optionalValues) { List<Class<?>> typeList = Lists.newArrayList(); List<String> optionalValueList = Lists.newArrayList(); Collections.addAll(typeList, parameterTypes); Collections.addAll(optionalValueList, optionalValues); Iterator<Class<?>> typeIterator = typeList.iterator(); Iterator<String> optionalIterator = optionalValueList.iterator(); while (typeIterator.hasNext()) { Class<?> parameterType = typeIterator.next(); optionalIterator.next(); if (INJECTED_TYPES.contains(parameterType)) { optionalIterator.remove(); typeIterator.remove(); } } return new FilterOutInJectedTypesResult(typeList.toArray(new Class<?>[0]), optionalValueList.toArray(new String[0])); }

Target:
static FilterOutInJectedTypesResult filterOutInJectedTypesFromOptionalValues(Class<?>[] parameterTypes, String[] optionalValues) { List<Class<?>> typeList = Lists.newArrayList(parameterTypes); List<String> optionalValueList = Lists.newArrayList(optionalValues); Iterator<Class<?>> typeIterator = typeList.iterator(); Iterator<String> optionalIterator = optionalValueList.iterator(); while (typeIterator.hasNext()) { Class<?> parameterType = typeIterator.next(); optionalIterator.next(); if (INJECTED_TYPES.contains(parameterType)) { optionalIterator.remove(); typeIterator.remove(); } } return new FilterOutInJectedTypesResult(typeList.toArray(new Class<?>[typeList.size()]), optionalValueList.toArray(new String[optionalValueList.size()])); }
Source:
public ReactiveAuthenticationManagerResolver<ServerHttpRequest> resolver() { return request -> { if (request .getPath() .subPath(0) .value() .startsWith("/employee")) return Mono.just(employeesAuthenticationManager()); return Mono.just(customersAuthenticationManager()); }; }

Target:
public ReactiveAuthenticationManagerResolver<ServerHttpRequest> resolver() { return request -> { if (request .getPath() .subPath(0) .value() .startsWith("/employee")) { return Mono.just(employeesAuthenticationManager()); } return Mono.just(customersAuthenticationManager()); }; }
Source:
public long commitBlockLocked(long sessionId, long blockId, boolean pinOnCreate) throws BlockAlreadyExistsException, InvalidWorkerStateException, BlockDoesNotExistException, IOException { LOG.debug("commitBlock: sessionId={}, blockId={}", sessionId, blockId); long lockId = mLockManager.lockBlock(sessionId, blockId, BlockLockType.WRITE); try { BlockStoreLocation loc = commitBlockInternal(sessionId, blockId, pinOnCreate); synchronized (mBlockStoreEventListeners) { for (BlockStoreEventListener listener : mBlockStoreEventListeners) { listener.onCommitBlock(sessionId, blockId, loc); } } } catch (Exception e) { mLockManager.unlockBlock(lockId); throw e; } return lockId; }

Target:
public long commitBlockLocked(long sessionId, long blockId, boolean pinOnCreate) throws BlockAlreadyExistsException, InvalidWorkerStateException, BlockDoesNotExistException, IOException { LOG.debug("commitBlock: sessionId={}, blockId={}, pinOnCreate={}", sessionId, blockId, pinOnCreate); long lockId = mLockManager.lockBlock(sessionId, blockId, BlockLockType.WRITE); try { BlockStoreLocation loc = commitBlockInternal(sessionId, blockId, pinOnCreate); synchronized (mBlockStoreEventListeners) { for (BlockStoreEventListener listener : mBlockStoreEventListeners) { listener.onCommitBlock(sessionId, blockId, loc); } } } catch (Exception e) { mLockManager.unlockBlock(lockId); throw e; } return lockId; }
Source:
private GraphicalEditPart getContainerEditPart(Object container) { GraphicalEditPart containerEditpart = null; Iterator<?> iterator = getHost().getRoot().getViewer().getEditPartRegistry().keySet().iterator(); while (iterator.hasNext() && null == containerEditpart) { Object key = iterator.next(); if (key instanceof Node) { Node keyNode = (Node) key; Element element = (Element) keyNode.getElement(); if (element == container) { GraphicalEditPart tempEditpart = (GraphicalEditPart) getHost().getRoot().getViewer().getEditPartRegistry().get(keyNode); if (tempEditpart instanceof InteractionInteractionCompartmentEditPart || tempEditpart instanceof InteractionOperandEditPart) { containerEditpart = tempEditpart; } } } } return containerEditpart; }

Target:
private GraphicalEditPart getContainerEditPart(Object container) { GraphicalEditPart containerEditpart = null; if (null != getHost().getRoot() && null != getHost().getRoot().getViewer() && null != getHost().getRoot().getViewer().getEditPartRegistry()) { Iterator<?> iterator = getHost().getRoot().getViewer().getEditPartRegistry().keySet().iterator(); while (iterator.hasNext() && null == containerEditpart) { Object key = iterator.next(); if (key instanceof Node) { Node keyNode = (Node) key; Element element = (Element) keyNode.getElement(); if (element == container) { GraphicalEditPart tempEditpart = (GraphicalEditPart) getHost().getRoot().getViewer().getEditPartRegistry().get(keyNode); if (tempEditpart instanceof InteractionInteractionCompartmentEditPart || tempEditpart instanceof InteractionOperandEditPart) { containerEditpart = tempEditpart; } } } } } return containerEditpart; }
Source:
private String getFullPath(String strValue) throws IOException { File file = new File(strValue); if (!file.isAbsolute()) { file = new File(reference, strValue); } return file.getPath(); }

Target:
private String getFullPath(String strValue) throws IOException { File file = new File(strValue); if (!file.isAbsolute()) { file = new File(reference, strValue); } return file.getCanonicalPath(); }
Source:
public void report(Trace trace) { backingTraceRecorder.report(trace); }

Target:
public void report(Trace trace) { if (trace.getNodes() != null && trace.getNodes().size() > 0) { Node rootNode = trace.getNodes().get(0); if (this.deploymentMetaData != null) { if (!rootNode.hasProperty(Constants.PROP_SERVICE_NAME)) { rootNode.getProperties().add(new Property(Constants.PROP_SERVICE_NAME, this.deploymentMetaData.getServiceName())); } if (!rootNode.hasProperty(Constants.PROP_BUILD_STAMP)) { rootNode.getProperties().add(new Property(Constants.PROP_BUILD_STAMP, this.deploymentMetaData.getBuildStamp())); } } } backingTraceRecorder.report(trace); }
Source:
protected void addCurrentImageToLayout() { answerLayout.removeView(imageView); if (binaryName != null) { DisplayMetrics metrics = getContext().getResources().getDisplayMetrics(); int screenWidth = metrics.widthPixels; int screenHeight = metrics.heightPixels; File f = new File(getInstanceFolder() + File.separator + binaryName); if (!f.exists()) { f = addDefaultImageIfExists(f); } if (f.exists()) { Bitmap bmp = FileUtils.getBitmapScaledToDisplay(f, screenHeight, screenWidth); if (bmp == null) { errorTextView.setVisibility(View.VISIBLE); } else { imageView = getAnswerImageView(bmp); imageView.setOnClickListener(v -> { if (imageClickHandler != null) { imageClickHandler.clickImage("viewImage"); } }); answerLayout.addView(imageView); } } } }

Target:
protected void addCurrentImageToLayout() { answerLayout.removeView(imageView); if (binaryName != null) { DisplayMetrics metrics = getContext().getResources().getDisplayMetrics(); int screenWidth = metrics.widthPixels; int screenHeight = metrics.heightPixels; File f = getFile(); if (f.exists()) { Bitmap bmp = FileUtils.getBitmapScaledToDisplay(f, screenHeight, screenWidth); if (bmp == null) { errorTextView.setVisibility(View.VISIBLE); } else { imageView = createAnswerImageView(getContext(), bmp); imageView.setOnClickListener(v -> { if (imageClickHandler != null) { imageClickHandler.clickImage("viewImage"); } }); answerLayout.addView(imageView); } } } }
Source:
public void loadRatisSnapshotIndex() throws IOException { if (ratisSnapshotFile.exists()) { try (BufferedReader reader = new BufferedReader(new FileReader( ratisSnapshotFile))) { String termStr = reader.readLine(); String indexStr = reader.readLine(); updateTermIndex(Long.parseLong(termStr.split(SEPARATOR)[1]), Long.parseLong(indexStr.split(SEPARATOR)[1])); } catch (IOException e) { LOG.error("Failed to load Ratis Snapshot file {}", ratisSnapshotFile); throw e; } } }

Target:
private void loadRatisSnapshotIndex() throws IOException { if (ratisSnapshotFile.exists()) { RatisSnapshotYaml ratisSnapshotYaml = readRatisSnapshotYaml(); updateTermIndex(ratisSnapshotYaml.term, ratisSnapshotYaml.snapshotIndex); } }
Source:
public CopyNumberTriStateHiddenMarkovModel(@Nonnull final TargetLikelihoodCalculator<D> emissionProbabilityCalculator, final double eventStartProbability, final double meanEventSize) { ParamUtils.inRange(eventStartProbability, 0, 1, "Event probability must be between 0 and 1."); ParamUtils.isPositive(meanEventSize, "Mean event size must be positive."); this.eventStartProbability = eventStartProbability; this.meanEventSize = meanEventSize; logTransitionProbabilityCache = new CopyNumberTriStateTransitionProbabilityCache(meanEventSize, eventStartProbability); this.targetLikelihoodCalculator = emissionProbabilityCalculator; }

Target:
public CopyNumberTriStateHiddenMarkovModel(@Nonnull final TargetLikelihoodCalculator<D> emissionProbabilityCalculator, final double eventStartProbability, final double meanEventSize) { ParamUtils.inRange(eventStartProbability, 0, 1, "Event probability must be between 0 and 1."); ParamUtils.isPositive(meanEventSize, "Mean event size must be positive."); this.eventStartProbability = eventStartProbability; this.meanEventSize = meanEventSize; logTransitionProbabilityCache = new CopyNumberTriStateTransitionProbabilityCache(meanEventSize, eventStartProbability); this.targetLikelihoodCalculator = Utils.nonNull(emissionProbabilityCalculator, "The emission probability calculator must be non-null"); }
Source:
public void tookAndTimedOut_elasticsearch() { Assume.assumeTrue( backendConfiguration instanceof ElasticsearchBackendConfiguration ); OrmUtils.withinJPATransaction( entityManagerFactory, entityManager -> { SearchSession searchSession = Search.session( entityManager ); SearchQuery<Book> query = searchSession.search( Book.class ) .predicate( f -> f.match() .field( "title" ) .matching( "robot" ) ) .toQuery(); ElasticsearchSearchQuery<Book> elasticsearchQuery = query.extension( ElasticsearchExtension.get() ); ElasticsearchSearchResult<Book> result = elasticsearchQuery.fetchAll(); Integer took = result.getTook(); Boolean timedOut = result.getTimedOut(); assertThat( took ).isNotNull(); assertThat( timedOut ).isNotNull(); } ); }

Target:
public void tookAndTimedOut_elasticsearch() { Assume.assumeTrue( backendConfiguration instanceof ElasticsearchBackendConfiguration ); OrmUtils.withinJPATransaction( entityManagerFactory, entityManager -> { SearchSession searchSession = Search.session( entityManager ); SearchQuery<Book> query = searchSession.search( Book.class ) .predicate( f -> f.match() .field( "title" ) .matching( "robot" ) ) .toQuery(); ElasticsearchSearchQuery<Book> elasticsearchQuery = query.extension( ElasticsearchExtension.get() ); ElasticsearchSearchResult<Book> result = elasticsearchQuery.fetchAll(); Duration took = result.getTook(); Boolean timedOut = result.isTimedOut(); assertThat( took ).isNotNull(); assertThat( timedOut ).isNotNull(); } ); }
Source:
private void calculateTxFee() { if (buyerPayoutAmount.getText().length() > 0 && sellerPayoutAmount.getText().length() > 0 && amountInMultisig.getText().length() > 0) { Coin txFeeValue = Coin.parseCoin(amountInMultisig.getText()) .subtract(Coin.parseCoin(buyerPayoutAmount.getText())) .subtract(Coin.parseCoin(sellerPayoutAmount.getText())); txFee.setText(txFeeValue.toPlainString()); } }

Target:
private void calculateTxFee() { if (buyerPayoutAmount.getText().length() > 0 && sellerPayoutAmount.getText().length() > 0 && amountInMultisig.getText().length() > 0) { Coin txFeeValue = getInputFieldAsCoin(amountInMultisig) .subtract(getInputFieldAsCoin(buyerPayoutAmount)) .subtract(getInputFieldAsCoin(sellerPayoutAmount)); txFee.setText(txFeeValue.toPlainString()); } }
Source:
protected void internalReceiveCommand(String itemName, Command command) { logger.debug("internalReceiveCommand() called"); logger.debug("itemName={}", itemName); logger.debug("command={}", command); if (providesBindingFor(itemName)) { for (Enigma2BindingProvider provider : providers) { Enigma2BindingConfig bindingConfig = provider .getBindingConfigFor(itemName); if (bindingConfig == null) { continue; } Enigma2Node node = enigmaNodes.get(bindingConfig.getDeviceId()); if (node == null) { logger.error("Invalid deviceId {}", bindingConfig.getDeviceId()); } switch (bindingConfig.getCmdId()) { case VOLUME: node.setVolume(command); break; case CHANNEL: node.setChannel(command); break; case PAUSE: node.sendPlayPause(command); break; case MUTE: node.sendMuteUnmute(command); break; case REMOTE_CONTROL: node.sendRcCommand(command, bindingConfig.getCmdValue()); break; case POWERSTATE: node.sendOnOff(command, Enigma2PowerState.STANDBY); break; default: logger.error("Unknown cmdId \"{}\"", bindingConfig.getCmdId()); } } } else { logger.trace("No provider found for this item"); } }

Target:
protected void internalReceiveCommand(String itemName, Command command) { logger.debug( "internalReceiveCommand() called, itemName={}, command={}", itemName, command); if (providesBindingFor(itemName)) { for (Enigma2BindingProvider provider : providers) { Enigma2BindingConfig bindingConfig = provider .getBindingConfigFor(itemName); if (bindingConfig == null) { continue; } Enigma2Node node = enigmaNodes.get(bindingConfig.getDeviceId()); if (node == null) { logger.error("Invalid deviceId {}", bindingConfig.getDeviceId()); } switch (bindingConfig.getCmdId()) { case VOLUME: node.setVolume(command); break; case CHANNEL: node.setChannel(command); break; case PAUSE: node.sendPlayPause(command); break; case MUTE: node.sendMuteUnmute(command); break; case REMOTECONTROL: node.sendRcCommand(command, bindingConfig.getCmdValue()); break; case POWERSTATE: node.sendOnOff(command, Enigma2PowerState.STANDBY); break; default: logger.error("Unknown cmdId \"{}\"", bindingConfig.getCmdId()); } } } else { logger.trace("No provider found for this item"); } }
Source:
public boolean checkValidity() { boolean isValid = false; try { isValid = !(StringUtils.isBlank(this.getEndpoint()) || StringUtils.isBlank(this.getTypeName())); new URL(this.getEndpoint()).toString(); } catch (MalformedURLException ex) { isValid = false; } return isValid; }

Target:
public boolean checkValidity() { try { new URL(this.getEndpoint()); return StringUtils.isNotBlank(this.getTypeName()); } catch (MalformedURLException ex) { return false; } }
Source:
public Account createAccount(Account account, String organizationName) { notNull(account, "account"); notNull(organizationName, "organizationName"); try { final UriResponse uriResponse = restTemplate.postForObject(Account.CREATE_URI, account, UriResponse.class, organizationName); return getAccount(Account.getId(uriResponse.getUri())); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to create account", e); } }

Target:
public Account createAccount(Account account, String organizationName) { notNull(account, "account"); notEmpty(organizationName, "organizationName"); try { final UriResponse uriResponse = restTemplate.postForObject(Account.ACCOUNTS_URI, account, UriResponse.class, organizationName); return getAccount(Account.getId(uriResponse.getUri())); } catch (GoodDataException | RestClientException e) { throw new GoodDataException("Unable to create account", e); } }
Source:
private Guid GetVdsRunOnDestination() { Guid result = Guid.Empty; if (getDestinationVdsId() != null) { VDS target_vds = getVdsDAO().get(getDestinationVdsId()); log.infoFormat("Checking for a specific VDS only - id:{0}, name:{1}, host_name(ip):{2}", getDestinationVdsId(), target_vds.getvds_name(), target_vds.gethost_name()); VmHandler.UpdateVmGuestAgentVersion(getVm()); if (target_vds.getvds_type() == VDSType.PowerClient && !Config.<Boolean> GetValue(ConfigValues.PowerClientAllowRunningGuestsWithoutTools) && getVm() != null && getVm().getHasAgent()) { log.infoFormat( "VdcBLL.RunVmCommandBase.getVdsToRunOn - VM {0} has no tools - skipping power client check", getVm().getId()); } else { result = getVdsToRunOn(Arrays.asList(new VDS[] { target_vds })); } } return result; }

Target:
private Guid GetVdsRunOnDestination() { if (getDestinationVdsId() != null) { VDS target_vds = getVdsDAO().get(getDestinationVdsId()); log.infoFormat("Checking for a specific VDS only - id:{0}, name:{1}, host_name(ip):{2}", getDestinationVdsId(), target_vds.getvds_name(), target_vds.gethost_name()); VmHandler.UpdateVmGuestAgentVersion(getVm()); if (target_vds.getvds_type() == VDSType.PowerClient && !Config.<Boolean> GetValue(ConfigValues.PowerClientAllowRunningGuestsWithoutTools) && getVm() != null && getVm().getHasAgent()) { log.infoFormat( "VdcBLL.RunVmCommandBase.getVdsToRunOn - VM {0} has no tools - skipping power client check", getVm().getId()); } else { if (!target_vds.getvds_group_id().equals(getVm().getvds_group_id()) || target_vds.getstatus() != VDSStatus.Up || (target_vds.getcpu_cores() != null && getVm().getnum_of_cpus() > target_vds.getcpu_cores())) { return Guid.Empty; } return getVdsToRunOn(Arrays.asList(new VDS[] { target_vds })); } } return Guid.Empty; }
Source:
private static GerritCallback<JavaScriptObject> cs( final Change.Id id) { return new GerritCallback<JavaScriptObject>() { public void onSuccess(JavaScriptObject result) { redisplay(); } public void onFailure(Throwable err) { if (SubmitFailureDialog.isConflict(err)) { new SubmitFailureDialog(err.getMessage()).center(); redisplay(); } else { super.onFailure(err); } } private void redisplay() { Gerrit.display(PageLinks.toChange2(id)); } }; }

Target:
private static GerritCallback<JavaScriptObject> cs( final Change.Id id) { return new GerritCallback<JavaScriptObject>() { public void onSuccess(JavaScriptObject result) { Gerrit.display(PageLinks.toChange2(id)); } public void onFailure(Throwable err) { if (SubmitFailureDialog.isConflict(err)) { new SubmitFailureDialog(err.getMessage()).center(); Gerrit.display(PageLinks.toChange2(id)); } else { super.onFailure(err); } } }; }
Source:
public void callbackRunsOnlyOnceAsInitializationStatusChanges() { setInitializationStatus(true, true, true, true); Awaitility.waitAtMost(2L, TimeUnit.SECONDS).until(() -> manager.isInitialized()); setInitializationStatus(false, false, false, false); assertNotInitializedWithinTwoSeconds(); setInitializationStatus(true, true, true, true); assertTrue(manager.isInitialized()); verify(mockCallback).runWithRetry(); }

Target:
public void callbackRunsOnlyOnceAsInitializationStatusChanges() { everythingInitialized(); Awaitility.waitAtMost(2L, TimeUnit.SECONDS).until(() -> manager.isInitialized()); nothingInitialized(); assertNotInitializedWithinTwoSeconds(); everythingInitialized(); assertTrue(manager.isInitialized()); verify(mockCallback).runWithRetry(any(SerializableTransactionManager.class)); }
Source:
protected Reader createInputReader(URL apiUrl) throws UnsupportedEncodingException, IOException { if (serverContent == null) { throw new IllegalStateException( "Please specify some server content for images used during the tests. See: TestMediaWikiApiImageFetchingStrategy#serverContent"); } String key = apiUrl.toString(); if (!serverContent.containsKey(key)) { throw new IllegalStateException("Please define a server content used during the tests for the key: " + key); } String pageContent = serverContent.get(key); return new StringReader(pageContent); }

Target:
protected Reader createInputReader(URL apiUrl) throws UnsupportedEncodingException, IOException { String key = apiUrl.toString(); if (!serverContent.containsKey(key)) { throw new IllegalStateException("Please define a server content used during the tests for the key: " + key); } String pageContent = serverContent.get(key); return new StringReader(pageContent); }
Source:
public BooleanStreamReader(StreamDescriptor streamDescriptor, LocalMemoryContext systemMemoryContext) { this.streamDescriptor = requireNonNull(streamDescriptor, "stream is null"); this.systemMemoryContext = requireNonNull(systemMemoryContext, "memory context is null"); }

Target:
public BooleanStreamReader(StreamDescriptor streamDescriptor, LocalMemoryContext systemMemoryContext) { this.streamDescriptor = requireNonNull(streamDescriptor, "stream is null"); this.systemMemoryContext = requireNonNull(systemMemoryContext, "systemMemoryContext is null"); }
Source:
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { if (position == Settings.NAME.ordinal()){ changeNameListener(); } else if (position == Settings.TYPE.ordinal()){ changeTypeListener(); } else if (position == Settings.IMAGE.ordinal()){ changeImageListener(); } else { addUsersListener(); } }

Target:
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { Settings[] settings = Settings.values(); switch(settings[position]){ case NAME: changeNameListener(); break; case TYPE: changeTypeListener(); break; case IMAGE: changeImageListener(); break; default: addUsersListener(); break; } }
Source:
private void addToSpread(List<Integer> spread, ZonedDateTime startTime, ZonedDateTime endTime) { int spreadStartIndex = getSpreadIndex(startTime); int spreadEndIndex = getSpreadIndex(endTime); for (int spreadItemIndex = spreadStartIndex; spreadItemIndex <= spreadEndIndex; spreadItemIndex++) { if (spreadItemIndex > 95) break; int durationInSpreadItem = getDurationInSpreadItem(startTime, endTime, spreadStartIndex, spreadEndIndex, spreadItemIndex); spread.set(spreadItemIndex, spread.get(spreadItemIndex) + durationInSpreadItem); } }

Target:
private void addToSpread(List<Integer> spread, ZonedDateTime startTime, ZonedDateTime endTime) { int spreadStartIndex = getSpreadIndex(startTime); int spreadEndIndex = getSpreadIndex(endTime); for (int spreadItemIndex = spreadStartIndex; spreadItemIndex <= spreadEndIndex; spreadItemIndex++) { if (spreadItemIndex > 95) { break; } int durationInSpreadItem = getDurationInSpreadItem(startTime, endTime, spreadStartIndex, spreadEndIndex, spreadItemIndex); spread.set(spreadItemIndex, spread.get(spreadItemIndex) + durationInSpreadItem); } }
Source:
public ProviderNotificationManager createProviderNotificationManager(final DiagramEventBroker diagramEventBroker, final EObject view, final NotificationListener notificationListener) { if (manager != null) { return manager; } manager = new ProviderNotificationManager(diagramEventBroker, view, notificationListener) { @Override protected void registerListeners() { } }; return manager; }

Target:
public ProviderNotificationManager createProviderNotificationManager(final DiagramEventBroker diagramEventBroker, final EObject view, final NotificationListener notificationListener) { if (null != manager) { return manager; } manager = new ProviderNotificationManager(diagramEventBroker, view, notificationListener) { @Override protected void registerListeners() { } }; return manager; }
Source:
private TestResult runAll3x() throws Exception { List<String> testClassNames = new ArrayList<>(); Files.walk(Paths.get(projectPath, "target", "test-classes")).forEach(filePath -> { if (Files.isRegularFile(filePath) && filePath.toString().toLowerCase().endsWith(".class")) { String path = Paths.get(projectPath, "target", "test-classes").relativize(filePath).toString(); String className = path.replace('/', '.'); className = className.replace('\\', '.'); className = className.substring(0, className.length() - 6); testClassNames.add(className); } }); List<Class> testableClasses = new ArrayList<>(); for (String className : testClassNames) { Class<?> clazz = Class.forName(className, false, projectClassLoader); if (isTestable3x(clazz)) { testableClasses.add(clazz); } } return run3xTestClasses(testableClasses.toArray(new Class[testableClasses.size()])); }

Target:
private TestResult runAll3x() throws Exception { List<String> testClassNames = new ArrayList<>(); Files.walk(Paths.get(projectPath, "target", "test-classes")).forEach(filePath -> { if (Files.isRegularFile(filePath) && filePath.toString().toLowerCase().endsWith(".class")) { String path = Paths.get(projectPath, "target", "test-classes").relativize(filePath).toString(); String className = path.replace(File.separatorChar, '.'); className = className.substring(0, className.length() - 6); testClassNames.add(className); } }); List<Class> testableClasses = new ArrayList<>(); for (String className : testClassNames) { Class<?> clazz = Class.forName(className, false, projectClassLoader); if (isTestable3x(clazz)) { testableClasses.add(clazz); } } return run3xTestClasses(testableClasses.toArray(new Class[testableClasses.size()])); }
Source:
public void shouldRecordBufferedRecords() { task = createStatelessTask(createConfig(false, "0"), StreamsConfig.METRICS_LATEST); final KafkaMetric metric = getMetric("active-process", "%s-ratio", task.id().toString(), StreamsConfig.METRICS_LATEST); assertThat(metric.metricValue(), equalTo(0.0d)); task.recordProcessBatchTime(10L); task.recordProcessBatchTime(15L); task.recordProcessTimeRatioAndBufferSize(100L); assertThat(metric.metricValue(), equalTo(0.25d)); task.recordProcessBatchTime(10L); assertThat(metric.metricValue(), equalTo(0.25d)); task.recordProcessBatchTime(10L); task.recordProcessTimeRatioAndBufferSize(20L); assertThat(metric.metricValue(), equalTo(1.0d)); }

Target:
public void shouldRecordBufferedRecords() { task = createStatelessTask(createConfig(false, "0"), StreamsConfig.METRICS_LATEST); final KafkaMetric metric = getMetric("active-buffer", "%s-count", task.id().toString(), StreamsConfig.METRICS_LATEST); assertThat(metric.metricValue(), equalTo(0.0d)); task.addRecords(partition1, asList( getConsumerRecord(partition1, 10), getConsumerRecord(partition1, 20) )); task.recordProcessTimeRatioAndBufferSize(100L); assertThat(metric.metricValue(), equalTo(2.0d)); task.process(0L); task.recordProcessTimeRatioAndBufferSize(100L); assertThat(metric.metricValue(), equalTo(1.0d)); }
Source:
private void copyParentDetails(final BasicDBObject insertQuery, final String itemId, final School.ItemType itemType, final String parentId) throws DatabaseAccessException { final School.ItemType collectionType = getParentItemType(itemType); final DBCollection collection = database.getCollection(getCollectionFromType(collectionType)); final DBObject result = collection.findOne(new ObjectId(parentId), new BasicDBObject(DatabaseStringConstants.USER_LIST, true) .append(DatabaseStringConstants.COURSE_ID, true) .append(DatabaseStringConstants.OWNER_ID, true)); if (result == null) { throw new DatabaseAccessException("The item with the id " + itemId + " Was not found in the database"); } result.removeField(DatabaseStringConstants.SELF_ID); insertQuery.putAll(result); }

Target:
private void copyParentDetails(final BasicDBObject insertQuery, final String itemId, final School.ItemType itemType, final String parentId) throws DatabaseAccessException { final School.ItemType collectionType = getParentItemType(itemType); final DBCollection collection = database.getCollection(getCollectionFromType(collectionType)); final DBObject result = collection.findOne(new ObjectId(parentId), new BasicDBObject(DatabaseStringConstants.USER_LIST, true) .append(DatabaseStringConstants.COURSE_ID, true) .append(DatabaseStringConstants.OWNER_ID, true)); if (result == null) { throw new DatabaseAccessException("The item with the id " + itemId + " was not found in the database."); } result.removeField(DatabaseStringConstants.SELF_ID); insertQuery.putAll(result); }
Source:
private void updateQuota(StoragePool datacenter) { if (datacenter.getQuotaEnforcementType().equals(QuotaEnforcementTypeEnum.DISABLED) || !getDiskStorageType().getEntity().isInternal()) { getQuota().setIsAvailable(false); return; } getQuota().setIsAvailable(true); StorageDomain storageDomain = getStorageDomain().getSelectedItem(); if (storageDomain == null) { return; } IdQueryParameters parameters = new IdQueryParameters(storageDomain.getId()); Frontend.getInstance().runQuery(VdcQueryType.GetAllRelevantQuotasForStorage, parameters, new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object innerModel, Object innerReturnValue) { ArrayList<Quota> quotaList = ((VdcQueryReturnValue) innerReturnValue).getReturnValue(); if (quotaList != null && !quotaList.isEmpty()) { getQuota().setItems(quotaList); } Guid diskQuota = getDisk() != null ? ((DiskImage) getDisk()).getQuotaId() : null; Guid vmQuota = getVm() != null ? getVm().getQuotaId() : null; Guid defaultQuota = diskQuota != null ? diskQuota : vmQuota; if (defaultQuota == null) { return; } for (Quota quota : quotaList) { if (quota.getId().equals(defaultQuota)) { getQuota().setSelectedItem(quota); return; } } if (diskQuota != null) { Quota quota = new Quota(); quota.setId(diskQuota); quota.setQuotaName(getDiskImage().getQuotaName()); quotaList.add(quota); getQuota().setItems(quotaList); getQuota().setSelectedItem(quota); } } })); }

Target:
private void updateQuota(StoragePool datacenter) { if (datacenter.getQuotaEnforcementType().equals(QuotaEnforcementTypeEnum.DISABLED) || !getDiskStorageType().getEntity().isInternal()) { getQuota().setIsAvailable(false); return; } getQuota().setIsAvailable(true); StorageDomain storageDomain = getStorageDomain().getSelectedItem(); if (storageDomain == null) { return; } IdQueryParameters parameters = new IdQueryParameters(storageDomain.getId()); Frontend.getInstance().runQuery(VdcQueryType.GetAllRelevantQuotasForStorage, parameters, new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object innerModel, Object innerReturnValue) { ArrayList<Quota> quotaList = ((VdcQueryReturnValue) innerReturnValue).getReturnValue(); if (quotaList != null && !quotaList.isEmpty()) { getQuota().setItems(quotaList); } Guid diskQuota = getDisk() != null ? ((DiskImage) getDisk()).getQuotaId() : null; Guid vmQuota = getVm() != null ? getVm().getQuotaId() : null; Guid defaultQuota = diskQuota != null ? diskQuota : vmQuota; if (defaultQuota == null) { return; } if (quotaList != null) { for (Quota quota : quotaList) { if (quota.getId().equals(defaultQuota)) { getQuota().setSelectedItem(quota); return; } } } if (diskQuota != null) { Quota quota = new Quota(); quota.setId(diskQuota); quota.setQuotaName(getDiskImage().getQuotaName()); if (quotaList == null){ quotaList = new ArrayList<>(); } quotaList.add(quota); getQuota().setItems(quotaList); getQuota().setSelectedItem(quota); } } })); }
Source:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append(getName()) .append(" {id=") .append(getId()) .append(", networkId=") .append(getNetworkId()) .append(", networkQoSId=") .append(getNetworkQoSId()) .append(", portMirroring=") .append(isPortMirroring()) .append(", customProperties=") .append(getCustomProperties()) .append(", description=") .append(getDescription()) .append("}"); return builder.toString(); }

Target:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append(getName()) .append(" {id=") .append(getId()) .append(", networkId=") .append(getNetworkId()) .append(", networkQosId=") .append(getNetworkQosId()) .append(", portMirroring=") .append(isPortMirroring()) .append(", customProperties=") .append(getCustomProperties()) .append(", description=") .append(getDescription()) .append("}"); return builder.toString(); }
Source:
private NPFPacket decipherFromSeqnum(byte[] buf, int offset, int length, SessionKey sessionKey, int sequenceNumber) { BlockCipher ivCipher = sessionKey.ivCipher; byte[] IV = new byte[ivCipher.getBlockSize() / 8]; System.arraycopy(sessionKey.ivNonce, 0, IV, 0, IV.length); IV[IV.length - 4] = (byte) (sequenceNumber >>> 24); IV[IV.length - 3] = (byte) (sequenceNumber >>> 16); IV[IV.length - 2] = (byte) (sequenceNumber >>> 8); IV[IV.length - 1] = (byte) (sequenceNumber); ivCipher.encipher(IV, IV); byte[] payload = Arrays.copyOfRange(buf, offset + hmacLength, offset + length); byte[] hash = Arrays.copyOfRange(buf, offset, offset + hmacLength); byte[] localHash = Arrays.copyOf(HMAC.macWithSHA256(sessionKey.hmacKey, payload), HMAC_LENGTH); if (!MessageDigest.isEqual(hash, localHash)) { if (logMINOR) { Logger.minor(this, "Failed to validate the HMAC using TrackerID="+sessionKey.trackerID); } return null; } PCFBMode payloadCipher = PCFBMode.create(sessionKey.incommingCipher, IV); payloadCipher.blockDecipher(payload, 0, payload.length); NPFPacket p = NPFPacket.create(payload, pn); NewPacketFormatKeyContext keyContext = sessionKey.packetContext; synchronized(this) { if(seqNumGreaterThan(sequenceNumber, keyContext.highestReceivedSeqNum, 31)) { keyContext.highestReceivedSeqNum = sequenceNumber; } } return p; }

Target:
private NPFPacket decipherFromSeqnum(byte[] buf, int offset, int length, SessionKey sessionKey, int sequenceNumber) { BlockCipher ivCipher = sessionKey.ivCipher; byte[] IV = new byte[ivCipher.getBlockSize() / 8]; System.arraycopy(sessionKey.ivNonce, 0, IV, 0, IV.length); IV[IV.length - 4] = (byte) (sequenceNumber >>> 24); IV[IV.length - 3] = (byte) (sequenceNumber >>> 16); IV[IV.length - 2] = (byte) (sequenceNumber >>> 8); IV[IV.length - 1] = (byte) (sequenceNumber); ivCipher.encipher(IV, IV); byte[] payload = Arrays.copyOfRange(buf, offset + HMAC_LENGTH, offset + length); byte[] hash = Arrays.copyOfRange(buf, offset, offset + HMAC_LENGTH); byte[] localHash = Arrays.copyOf(HMAC.macWithSHA256(sessionKey.hmacKey, payload), HMAC_LENGTH); if (!MessageDigest.isEqual(hash, localHash)) { if (logMINOR) { Logger.minor(this, "Failed to validate the HMAC using TrackerID="+sessionKey.trackerID); } return null; } PCFBMode payloadCipher = PCFBMode.create(sessionKey.incommingCipher, IV); payloadCipher.blockDecipher(payload, 0, payload.length); NPFPacket p = NPFPacket.create(payload, pn); NewPacketFormatKeyContext keyContext = sessionKey.packetContext; synchronized(this) { if(seqNumGreaterThan(sequenceNumber, keyContext.highestReceivedSeqNum, 31)) { keyContext.highestReceivedSeqNum = sequenceNumber; } } return p; }
Source:
public void cannot_delete_built_in_profile_even_when_non_default() { QualityProfile builtInProfile = getProfile(p -> p.getIsBuiltIn() && "Basic".equals(p.getName()) && "xoo".equals(p.getLanguage())); QualityProfiles.CopyWsResponse copiedProfile = adminWsClient.qualityProfiles().copy(new CopyRequest(builtInProfile.getKey(), randomAscii(20))); adminWsClient.qualityProfiles().setDefault(new SetDefaultRequest(copiedProfile.getKey())); try { adminWsClient.qualityProfiles().delete(new DeleteRequest(builtInProfile.getKey())); } catch (HttpException e) { assertThat(e.code()).isEqualTo(400); assertThat(e.content()).contains("Operation forbidden for built-in Quality Profile 'Basic' with language 'xoo'"); } }

Target:
public void cannot_delete_built_in_profile_even_when_non_default() { QualityProfile defaultBuiltInProfile = getProfile(p -> p.getIsBuiltIn() && p.getIsDefault() && "Basic".equals(p.getName()) && "xoo".equals(p.getLanguage())); QualityProfiles.CopyWsResponse copiedProfile = adminWsClient.qualityProfiles().copy(new CopyRequest(defaultBuiltInProfile.getKey(), randomAscii(20))); adminWsClient.qualityProfiles().setDefault(new SetDefaultRequest(copiedProfile.getKey())); try { adminWsClient.qualityProfiles().delete(new DeleteRequest(defaultBuiltInProfile.getKey())); fail(); } catch (HttpException e) { assertThat(e.code()).isEqualTo(400); assertThat(e.content()).contains("Operation forbidden for built-in Quality Profile 'Basic' with language 'xoo'"); } finally { adminWsClient.qualityProfiles().setDefault(new SetDefaultRequest(defaultBuiltInProfile.getKey())); adminWsClient.qualityProfiles().delete(new DeleteRequest(copiedProfile.getKey())); } }
Source:
private Constraint parseOR() { List<Constraint> constraints = Lists.newArrayList(); while (!reader.current().isEndOfInput() && !reader.current().is(')')) { Constraint inner = parseAND(); if (inner != null) { constraints.add(inner); } if (!isAtOR(reader)) { break; } else { reader.consume(2); } } if (constraints.isEmpty()) { return null; } else { System.out.println(constraints); return Or.of(constraints); } }

Target:
private Constraint parseOR() { List<Constraint> constraints = Lists.newArrayList(); while (!reader.current().isEndOfInput() && !reader.current().is(')')) { Constraint inner = parseAND(); if (inner != null) { constraints.add(inner); } if (!isAtOR(reader)) { break; } else { reader.consume(2); } } if (constraints.isEmpty()) { return null; } else { return Or.of(constraints); } }
Source:
private static String toLispString(Tree<?> tree) { final String value = String.valueOf(tree.getValue()); if (tree.isLeaf()) { return value; } else { return "(" + value + " " + (tree.getChildren().map(Node::toLispString).mkString(" ")) + ")"; } }

Target:
private static String toLispString(Tree<?> tree) { final String value = String.valueOf(tree.getValue()); if (tree.isLeaf()) { return value; } else { final String children = tree.getChildren().map(Node::toLispString).mkString(" "); return "(" + value + " " + children + ")"; } }
Source:
public void createVersionSnapshot(final String path,final String versionId) { try { final FcrepoHttpClientBuilder client = new FcrepoHttpClientBuilder(username, password, new URI(baseUri).toURL().getHost()); final CloseableHttpClient c = client.build(); final HttpMethods method = HttpMethods.POST; final URI uri = pathToURI(path + "/fcr:versions"); final HttpEntityEnclosingRequestBase request = (HttpEntityEnclosingRequestBase) method.createRequest(uri); request.addHeader("Slug", versionId); final HttpResponse response = c.execute(request); final int statusCode = response.getStatusLine().getStatusCode(); if (!(statusCode >= 200 && statusCode < 300)) { throw new RuntimeException("Unable to create version! " + response.getStatusLine().toString()); } } catch (URISyntaxException | IOException e) { throw new RuntimeException(e); } }

Target:
public void createVersionSnapshot(final String path,final String versionId) { try { final FcrepoHttpClientBuilder client = new FcrepoHttpClientBuilder(username, password, new URI(baseUri).toURL().getHost()); try (final CloseableHttpClient c = client.build()) { final HttpMethods method = HttpMethods.POST; final URI uri = pathToURI(path + "/fcr:versions"); final HttpEntityEnclosingRequestBase request = (HttpEntityEnclosingRequestBase) method.createRequest(uri); request.addHeader("Slug", versionId); try (final CloseableHttpResponse response = c.execute(request)) { final int statusCode = response.getStatusLine().getStatusCode(); if (!(statusCode >= 200 && statusCode < 300)) { throw new RuntimeException("Unable to create version! " + response.getStatusLine().toString()); } } } } catch (URISyntaxException | IOException e) { throw new RuntimeException(e); } }
Source:
public void testMethodFilter_EnumValues() { analyzer.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC, "Foo", null, "java/lang/Enum", null); final MethodProbesVisitor mv = analyzer.visitMethod(0, "values", "()V", null, null); assertNull(mv); assertTrue(coverage.getMethods().isEmpty()); }

Target:
public void testMethodFilter_EnumValues() { analyzer.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC, "Foo", null, "java/lang/Enum", null); final MethodProbesVisitor mv = analyzer.visitMethod(0, "values", "()[LFoo;", null, null); assertNull(mv); assertTrue(coverage.getMethods().isEmpty()); }