auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void execute(IProgressMonitor m) throws CoreException { IProgressMonitor monitor; if (m == null) monitor = new NullProgressMonitor(); else monitor = m; IWorkspaceRunnable action = new IWorkspaceRunnable() { public void run(IProgressMonitor actMonitor) throws CoreException { final String taskName = NLS.bind( CoreText.RenameRemoteOperation_TaskName, oldName, newName); actMonitor.beginTask(taskName, 1); try { final String REMOTE = "remote"; final StoredConfig config = repository.getConfig(); final Set<String> names = config.getNames(REMOTE, oldName); if (names.size() == 0) throw new IOException("Remote not found"); for (String name : names) { config.setString(REMOTE, newName, name, config.getString(REMOTE, oldName, name)); config.unset(REMOTE, oldName, name); } config.unsetSection(REMOTE, oldName); config.save(); } catch (IOException e) { throw new CoreException(Activator.error(e.getMessage(), e)); } actMonitor.worked(1); actMonitor.done(); } }; ResourcesPlugin.getWorkspace().run(action, getSchedulingRule(), IWorkspace.AVOID_UPDATE, monitor); }

Target:
public void execute(IProgressMonitor m) throws CoreException { IProgressMonitor monitor; if (m == null) monitor = new NullProgressMonitor(); else monitor = m; IWorkspaceRunnable action = new IWorkspaceRunnable() { public void run(IProgressMonitor actMonitor) throws CoreException { final String taskName = NLS.bind( CoreText.RenameRemoteOperation_TaskName, oldName, newName); actMonitor.beginTask(taskName, 1); try { new Git(repository).remoteRename().setOldName(oldName) .setNewName(newName).call(); repository.getConfig().save(); } catch (Exception e) { throw new CoreException(Activator.error(e.getMessage(), e)); } actMonitor.worked(1); actMonitor.done(); } }; ResourcesPlugin.getWorkspace().run(action, monitor); }
Source:
public void setLoadMeterTimerPeriod(int p) { assert (p > m_LoadMeterTimerPeriodMin); m_LoadMeterTimerPeriod = p; disposeLoadMeterTimer(); initializeLoadMeterTimer(); }

Target:
public void setLoadMeterTimerPeriod(int p) { if (m_loadMeterTimerPeriod == p) return; m_loadMeterTimerPeriod = p > LOAD_METER_TIMER_MIN ? p : LOAD_METER_TIMER_MIN; disposeLoadMeterTimer(); initializeLoadMeterTimer(); }
Source:
public void onUpdate() { if (!firstUpdate && !this.onGround) { float f = 0.98F; this.motionX = this.motionX / f; this.motionY = this.motionY / f; this.motionZ = this.motionZ / f; } firstUpdate = false; super.onUpdate(); }

Target:
public void onUpdate() { super.onUpdate(); if (!this.onGround) { double f = 0.98F; this.motionX = this.motionX / f; this.motionY = this.motionY / f; this.motionZ = this.motionZ / f; } }
Source:
@Test public void testIntersectToIntersect0() { final String mv = "" + "select \"deptno\" from\n" + "\"emps\" intersect select \"deptno\" from \"depts\""; final String query = "" + "select \"deptno\" from\n" + "\"depts\" intersect select \"deptno\" from \"emps\""; checkMaterialize(mv, query, true); }

Target:
@Test public void testIntersectToIntersect0() { final String mv = "" + "select \"deptno\" from \"emps\"\n" + "intersect\n" + "select \"deptno\" from \"depts\""; final String query = "" + "select \"deptno\" from \"depts\"\n" + "intersect\n" + "select \"deptno\" from \"emps\""; checkMaterialize(mv, query, true); }
Source:
public boolean shouldBlockFeedbackPrompt(@NonNull final Long cachedEventValue, @NonNull final Context applicationContext) { return cachedEventValue == Long.MAX_VALUE || (System.currentTimeMillis() - cachedEventValue) < TimeUnit.DAYS.toMillis(cooldownPeriodDays); }

Target:
public boolean shouldBlockFeedbackPrompt(@NonNull final Long cachedEventValue, @NonNull final Context applicationContext) { return (System.currentTimeMillis() - cachedEventValue) < TimeUnit.DAYS.toMillis(cooldownPeriodDays); }
Source:
public Object[][] provideScenarios() { try { List<Object[]> scenarios = new ArrayList<>(); List<CucumberFeature> features = getFeatures(); for (CucumberFeature feature : features) { for (PickleEvent pickle : feature.getPickles()) { if (filters.test(pickle)) { scenarios.add(new Object[]{new PickleEventWrapperImpl(pickle), new CucumberFeatureWrapperImpl(feature)}); } } } return scenarios.toArray(new Object[][]{}); } catch (CucumberException e) { return new Object[][]{new Object[]{new CucumberExceptionWrapper(e), null}}; } }

Target:
public Object[][] provideScenarios() { try { return getFeatures().stream() .flatMap(feature -> feature.getPickles().stream() .filter(filters) .map(pickle -> new Object[]{ new PickleEventWrapperImpl(pickle), new CucumberFeatureWrapperImpl(feature)})) .collect(toList()) .toArray(new Object[0][0]); } catch (CucumberException e) { return new Object[][]{new Object[]{new CucumberExceptionWrapper(e), null}}; } }
Source:
public static List<DataSegment> getPublishedSegments(HadoopDruidIndexerConfig config) { final Configuration conf = JobHelper.injectJobProperties(JobHelper.injectSystemProperties(new Configuration()), config); final ObjectMapper jsonMapper = HadoopDruidIndexerConfig.JSON_MAPPER; ImmutableList.Builder<DataSegment> publishedSegmentsBuilder = ImmutableList.builder(); final Path descriptorInfoDir = config.makeDescriptorInfoDir(); try { FileSystem fs = descriptorInfoDir.getFileSystem(conf); for (FileStatus status : fs.listStatus(descriptorInfoDir)) { final DataSegment segment = jsonMapper.readValue(fs.open(status.getPath()), DataSegment.class); publishedSegmentsBuilder.add(segment); log.info("Adding segment %s to the list of published segments", segment.getIdentifier()); } } catch (FileNotFoundException e) { log.error( "[%s] SegmentDescriptorInfo is not found usually when indexing process did not produce any segments meaning" + " either there was no input data to process or all the input events were discarded due to some error", e.getMessage() ); Throwables.propagate(e); } catch (IOException e) { throw Throwables.propagate(e); } List<DataSegment> publishedSegments = publishedSegmentsBuilder.build(); return publishedSegments; }

Target:
public static List<DataSegment> getPublishedSegments(HadoopDruidIndexerConfig config) { final Configuration conf = JobHelper.injectSystemProperties(new Configuration()); config.addJobProperties(conf); final ObjectMapper jsonMapper = HadoopDruidIndexerConfig.JSON_MAPPER; ImmutableList.Builder<DataSegment> publishedSegmentsBuilder = ImmutableList.builder(); final Path descriptorInfoDir = config.makeDescriptorInfoDir(); try { FileSystem fs = descriptorInfoDir.getFileSystem(conf); for (FileStatus status : fs.listStatus(descriptorInfoDir)) { final DataSegment segment = jsonMapper.readValue(fs.open(status.getPath()), DataSegment.class); publishedSegmentsBuilder.add(segment); log.info("Adding segment %s to the list of published segments", segment.getIdentifier()); } } catch (FileNotFoundException e) { log.error( "[%s] SegmentDescriptorInfo is not found usually when indexing process did not produce any segments meaning" + " either there was no input data to process or all the input events were discarded due to some error", e.getMessage() ); Throwables.propagate(e); } catch (IOException e) { throw Throwables.propagate(e); } List<DataSegment> publishedSegments = publishedSegmentsBuilder.build(); return publishedSegments; }
Source:
protected boolean parseArgs(final String[] argv) { commandLineParser = determineArgParser(argv); boolean ret; try { ret = commandLineParser.parseArguments(System.err, argv); } catch (CommandLineException e) { System.err.println(commandLineParser.usage(false,false)); System.err.println(e.getMessage()); ret = false; } commandLine = commandLineParser.getCommandLine(); if (!ret) { return false; } REFERENCE_SEQUENCE = referenceSequence.getReferenceFile(); final String[] customErrorMessages = customCommandLineValidation(); if (customErrorMessages != null) { System.err.print(commandLineParser.usage(false, false)); for (final String msg : customErrorMessages) { System.err.println(msg); } return false; } return true; }

Target:
protected boolean parseArgs(final String[] argv) { commandLineParser = getCommandLineParserForArgs(argv); boolean ret; try { ret = commandLineParser.parseArguments(System.err, argv); } catch (CommandLineException e) { System.err.println(commandLineParser.usage(false,false)); System.err.println(e.getMessage()); ret = false; } commandLine = commandLineParser.getCommandLine(); if (!ret) { return false; } REFERENCE_SEQUENCE = referenceSequence.getReferenceFile(); final String[] customErrorMessages = customCommandLineValidation(); if (customErrorMessages != null) { System.err.print(commandLineParser.usage(false, false)); for (final String msg : customErrorMessages) { System.err.println(msg); } return false; } return true; }
Source:
private BufferIndexed singleThreadedVersionOne() { final ByteBuffer copyBuffer = firstValueBuffer.asReadOnlyBuffer(); return new BufferIndexed() { @Override public T get(final int index) { checkIndex(index); final int startOffset; final int endOffset; if (index == 0) { startOffset = Ints.BYTES; endOffset = headerBuffer.getInt(0); } else { int headerPosition = (index - 1) * Ints.BYTES; startOffset = headerBuffer.getInt(headerPosition) + Ints.BYTES; endOffset = headerBuffer.getInt(headerPosition + Ints.BYTES); } return bufferedIndexedGet(copyBuffer, startOffset, endOffset); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("headerBuffer", headerBuffer); inspector.visit("copyBuffer", copyBuffer); inspector.visit("strategy", strategy); } }; }

Target:
private BufferIndexed singleThreadedVersionOne() { final ByteBuffer copyBuffer = firstValueBuffer.asReadOnlyBuffer(); return new BufferIndexed() { @Override public T get(final int index) { checkIndex(index); final int startOffset; final int endOffset; if (index == 0) { startOffset = Integer.BYTES; endOffset = headerBuffer.getInt(0); } else { int headerPosition = (index - 1) * Integer.BYTES; startOffset = headerBuffer.getInt(headerPosition) + Integer.BYTES; endOffset = headerBuffer.getInt(headerPosition + Integer.BYTES); } return bufferedIndexedGet(copyBuffer, startOffset, endOffset); } @Override public void inspectRuntimeShape(RuntimeShapeInspector inspector) { inspector.visit("headerBuffer", headerBuffer); inspector.visit("copyBuffer", copyBuffer); inspector.visit("strategy", strategy); } }; }
Source:
public void addMetadataRecord(InputStream stream, String name) throws DataStoreException { }

Target:
public void addMetadataRecord(InputStream stream, String name) throws DataStoreException { if (null == stream) { throw new IllegalArgumentException("Input stream must not be null"); } File tmpFile = null; try { tmpFile = File.createTempFile("compositeds-temp", null); try (FileOutputStream out = new FileOutputStream(tmpFile)) { IOUtils.copy(stream, out); } addMetadataRecord(tmpFile, name); } catch (IOException e) { throw new DataStoreException(e); } finally { if (null != tmpFile) { tmpFile.delete(); } } }
Source:
SnapshotFileSender localSnapshotSender(String snpName) throws IgniteCheckedException { File snpLocDir = snapshotLocalDir(snpName); return new LocalSnapshotFileSender(log, snpRunner, () -> { String dbNodePath = relativeNodePath(cctx.kernalContext().pdsFolderResolver().resolveFolders()); return U.resolveWorkDirectory(snpLocDir.getAbsolutePath(), dbNodePath, false); }, ioFactory, storeFactory, types -> cctx.kernalContext() .cacheObjects() .saveMetadata(types, snpLocDir), mappings -> saveMappings(cctx.kernalContext(), mappings, snpLocDir), pageSize); }

Target:
SnapshotSender localSnapshotSender(String snpName) { return new LocalSnapshotSender(snpName); }
Source:
public Response toResponse(CreateChargeConnectorErrorResponseException exception) { int errorStatus = exception.getErrorStatus(); if (errorStatus == NOT_FOUND.getStatusCode()) { LOGGER.warn("Authorization succeeded but Gateway account was not found in Connector", errorStatus); return P0199.response(); } LOGGER.info("Error response from Connector unrecognised. status {}, body {}", errorStatus, exception.getErrorBody()); return P0198.response(); }

Target:
public Response toResponse(CreateChargeConnectorErrorResponseException exception) { int errorStatus = exception.getErrorStatus(); if (errorStatus == NOT_FOUND.getStatusCode()) { LOGGER.error("Authorization succeeded but Gateway account was not found in Connector", errorStatus); return P0199.response(); } LOGGER.info("Error response from Connector unrecognised. status {}, body {}", errorStatus, exception.getErrorBody()); return P0198.response(); }
Source:
public void validate(Class<?> originalType) { boolean implementsInterceptor = Interceptor.class.isAssignableFrom(originalType); boolean containsIntercepts = originalType.isAnnotationPresent(Intercepts.class); if (implementsInterceptor || containsIntercepts) { applyNewInterceptorValidationRules(originalType, implementsInterceptor); } else { throw new VRaptorException(format("Annotation @%s found in %s, " + "but it is neither an Interceptor nor an InterceptorSequence.", Intercepts.class.getSimpleName(), originalType)); } }

Target:
public void validate(Class<?> originalType) { boolean implementsInterceptor = Interceptor.class.isAssignableFrom(originalType); boolean containsIntercepts = originalType.isAnnotationPresent(Intercepts.class); if (implementsInterceptor || containsIntercepts) { applyNewInterceptorValidationRules(originalType, implementsInterceptor); } else { throw new IllegalStateException(format("Annotation @Intercepts found in %s, " + "but it is not an Interceptor.", originalType)); } }
Source:
public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("name"); description.addProperty("javaClassName"); description.addProperty("retired"); description.addProperty("description"); description.addSelfLink(); if (rep instanceof DefaultRepresentation) { description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); } else { description.addProperty("auditInfo", findMethod("getAuditInfo")); } return description; } return null; }

Target:
public DelegatingResourceDescription getRepresentationDescription(Representation rep) { if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { DelegatingResourceDescription description = new DelegatingResourceDescription(); description.addProperty("uuid"); description.addProperty("name"); description.addProperty("javaClassName"); description.addProperty("retired"); description.addProperty("description"); description.addProperty("conceptClasses"); description.addProperty("parent"); description.addSelfLink(); if (rep instanceof DefaultRepresentation) { description.addLink("full", ".?v=" + RestConstants.REPRESENTATION_FULL); } else { description.addProperty("auditInfo", findMethod("getAuditInfo")); } return description; } return null; }
Source:
private static boolean shouldIgnore( Symbol.MethodSymbol methodSymbol, LambdaExpressionTree root, MethodInvocationTree methodInvocation) { if (!methodSymbol.isStatic()) { if (root.getParameters().size() == 1) { Symbol paramSymbol = ASTHelpers.getSymbol(Iterables.getOnlyElement(root.getParameters())); Symbol receiverSymbol = ASTHelpers.getSymbol(ASTHelpers.getReceiver(methodInvocation)); return !paramSymbol.equals(receiverSymbol); } return true; } return false; }

Target:
private static boolean shouldIgnore( Symbol.MethodSymbol methodSymbol, LambdaExpressionTree root, MethodInvocationTree methodInvocation) { if (!methodSymbol.isStatic()) { if (root.getParameters().size() == 1) { Symbol paramSymbol = ASTHelpers.getSymbol(Iterables.getOnlyElement(root.getParameters())); Symbol receiverSymbol = ASTHelpers.getSymbol(ASTHelpers.getReceiver(methodInvocation)); return !paramSymbol.equals(receiverSymbol); } return true; } return !root.getParameters().isEmpty(); }
Source:
public void setup() { country.add(PRESIDENT, REAGAN); state.add(GOVERNOR, SCHWARZENEGGER); county.add(MAYOR, EASTWOOD); country.add(ACTOR, EASTWOOD); state.add(ACTOR, SCHWARZENEGGER); county.add(ACTOR, REAGAN); }

Target:
public void setup() { country.add(PRESIDENT, REAGAN); state.add(GOVERNOR, SCHWARZENEGGER); city.add(MAYOR, EASTWOOD); country.add(ACTOR, EASTWOOD); state.add(ACTOR, SCHWARZENEGGER); city.add(ACTOR, REAGAN); }
Source:
public Response getSearchResponse(Account account, Map<String, String> queryParams) { if (account.getPaymentType().equals(TokenPaymentType.DIRECT_DEBIT)) { throw new BadRequestException(PaymentError .aPaymentError(PaymentError.Code.SEARCH_PAYMENTS_VALIDATION_ERROR, "agreement_id")); } String url = uriGenerator.refundsURIWithParams(account, queryParams); Response connectorResponse = client .target(url) .request() .header(HttpHeaders.ACCEPT, APPLICATION_JSON) .get(); logger.info("response from connector for refunds search: " + connectorResponse); if (connectorResponse.getStatus() == SC_OK) { return processResponse(account.getAccountId(), connectorResponse); } throw new SearchRefundsException(connectorResponse); }

Target:
public Response getSearchResponse(Account account, Map<String, String> queryParams) { validateSupportedSearchParams(queryParams); String url = connectorUriGenerator.refundsURIWithParams(account, queryParams); Response connectorResponse = client .target(url) .request() .header(HttpHeaders.ACCEPT, APPLICATION_JSON) .get(); logger.info("response from connector for refunds search: " + connectorResponse); if (connectorResponse.getStatus() == SC_OK) { return processResponse(connectorResponse); } throw new SearchRefundsException(connectorResponse); }
Source:
public void visitClassPropertyDeclaration(ClassPropertyDeclarationTree tree) { if (tree.hasModifiers("private")) { tree.declarations().forEach(varDec -> privateProperties.add(varDec.identifier().text())); } }

Target:
public void visitClassPropertyDeclaration(ClassPropertyDeclarationTree tree) { }
Source:
public String toShellString() { ArrayList<Character> escapeList = Lists.newArrayList('"', '\\', '\''); ArrayList<String> componentStrings = Lists.newArrayList(); for (Object component : mComponentValues) { if (component == null) { componentStrings.add("null"); } else { String unescapedString = component.toString(); ArrayList<Character> escapedString = Lists.newArrayList(); for (char c: unescapedString.toCharArray()) { if (escapeList.contains(c)) { escapedString.add('\\'); } escapedString.add(c); } if (getType(component) == ComponentType.STRING) { componentStrings.add(String.format("'%s'", StringUtils.join(escapedString, ""))); } else { componentStrings.add(component.toString()); } } } return "[" + StringUtils.join(componentStrings, ", ") + "]"; }

Target:
public String toShellString() { HashSet<Character> escapeSet = Sets.newHashSet('"', '\\', '\''); ArrayList<String> componentStrings = Lists.newArrayList(); for (Object component : mComponentValues) { if (component == null) { componentStrings.add("null"); } else { String unescapedString = component.toString(); ArrayList<Character> escapedString = Lists.newArrayList(); for (char c: unescapedString.toCharArray()) { if (escapeSet.contains(c)) { escapedString.add('\\'); } escapedString.add(c); } if (getType(component) == ComponentType.STRING) { componentStrings.add(String.format("'%s'", StringUtils.join(escapedString, ""))); } else { componentStrings.add(component.toString()); } } } return "[" + StringUtils.join(componentStrings, ", ") + "]"; }
Source:
public IDescriptionPreprocessor getDescriptionPreprocessor(EObject description) { if (!this.hasReadDescriptionPreprocessorRegistry) { this.descriptionPreprocessorListener.readRegistry(Platform.getExtensionRegistry()); this.hasReadDescriptionPreprocessorRegistry = true; } IDescriptionPreprocessor preprocessor = null; List<IItemDescriptor<IDescriptionPreprocessor>> itemDescriptors = this.descriptionPreprocessorRegistry.getItemDescriptors(); for (IItemDescriptor<IDescriptionPreprocessor> itemDescriptor : itemDescriptors) { IDescriptionPreprocessor descriptionPreprocessor = itemDescriptor.getItem(); if (descriptionPreprocessor.canHandle(description)) { preprocessor = descriptionPreprocessor; break; } } if (preprocessor == null) { PropertiesDescriptionPreprocessorSwitch descriptionPreprocessorSwitch = new PropertiesDescriptionPreprocessorSwitch(); preprocessor = descriptionPreprocessorSwitch.doSwitch(description); } return preprocessor; }

Target:
public Optional<IDescriptionPreprocessor> getDescriptionPreprocessor(EObject description) { if (!this.hasReadDescriptionPreprocessorRegistry) { this.descriptionPreprocessorListener.readRegistry(Platform.getExtensionRegistry()); this.hasReadDescriptionPreprocessorRegistry = true; } List<IItemDescriptor<IDescriptionPreprocessor>> itemDescriptors = this.descriptionPreprocessorRegistry.getItemDescriptors(); Optional<IDescriptionPreprocessor> preprocessor = itemDescriptors.stream().map(IItemDescriptor::getItem).filter(descriptionPreprocessor -> descriptionPreprocessor.canHandle(description)) .findFirst(); if (!preprocessor.isPresent()) { PropertiesDescriptionPreprocessorSwitch descriptionPreprocessorSwitch = new PropertiesDescriptionPreprocessorSwitch(); preprocessor = descriptionPreprocessorSwitch.doSwitch(description); } return preprocessor; }
Source:
private List<Matches> findMatch(final String uri) throws DotDataException { for (final String backendFilter : CMSUrlUtil.BACKEND_FILTERED_LIST_ARRAY) { if (uri.startsWith(backendFilter)) { return new ArrayList<>(); } } if (this.shouldLoadPatterns()) { this.loadPatterns(); } List<Matches> foundMatches = new ArrayList<>(); final String url = !uri.endsWith(StringPool.FORWARD_SLASH) ? uri + StringPool.FORWARD_SLASH : uri; for (final ContentTypeURLPattern contentTypeURLPattern : this.patternsCache) { final List<RegExMatch> matches = RegEX .findForUrlMap(url, contentTypeURLPattern.getRegEx()); if (matches != null && !matches.isEmpty()) { for (RegExMatch regExMatch : matches) { if (regExMatch.getMatch().equals(url)) { foundMatches.add(new Matches(contentTypeURLPattern, matches)); } } } } return foundMatches; }

Target:
private List<Matches> findMatch(final String uri) throws DotDataException { final boolean filtered = CMSUrlUtil.BACKEND_FILTERED_COLLECTION.stream() .anyMatch(uri::startsWith); if (filtered) { return Collections.emptyList(); } if (this.shouldLoadPatterns()) { this.loadPatterns(); } final List<Matches> foundMatches = new ArrayList<>(); final String url = !uri.endsWith(StringPool.FORWARD_SLASH) ? uri + StringPool.FORWARD_SLASH : uri; for (final ContentTypeURLPattern contentTypeURLPattern : this.patternsCache) { final List<RegExMatch> matches = RegEX .findForUrlMap(url, contentTypeURLPattern.getRegEx()); if (matches != null && !matches.isEmpty()) { for (final RegExMatch regExMatch : matches) { if (regExMatch.getMatch().equals(url)) { foundMatches.add(new Matches(contentTypeURLPattern, matches)); } } } } return foundMatches; }
Source:
public static RequestOptions getDefault() { return new RequestOptions(Stripe.apiKey, Stripe.apiVersion, Stripe.getApiBase()); }

Target:
public static RequestOptions getDefault() { return new RequestOptions(Stripe.apiKey, Stripe.apiVersion); }
Source:
public void startingServerInstance(DesiredCapabilities iosCaps, DesiredCapabilities androidCaps) throws Exception { if (prop.getProperty("APP_TYPE").equalsIgnoreCase("web")) { driver = new AndroidDriver<>(appiumMan.getAppiumUrl(), androidWeb()); } else { if (System.getProperty("os.name").toLowerCase().contains("mac")) { if (iosDevice.checkiOSDevice(device_udid)) { if (iosCaps == null) { iosCaps = iosNative(); } driver = new IOSDriver<>(appiumMan.getAppiumUrl(), iosCaps); } else if (!iosDevice.checkiOSDevice(device_udid)) { if (androidCaps == null) { androidCaps = androidNative(); } checkSelendroid(androidCaps); driver = new AndroidDriver<>(appiumMan.getAppiumUrl(), androidCaps); } } else { if (androidCaps == null) { androidCaps = androidNative(); } checkSelendroid(androidCaps); driver = new AndroidDriver<>(appiumMan.getAppiumUrl(), androidCaps); } } }

Target:
public void startingServerInstance(DesiredCapabilities iosCaps, DesiredCapabilities androidCaps) throws Exception { if (prop.getProperty("APP_TYPE").equalsIgnoreCase("web")) { driver = new AndroidDriver<>(appiumMan.getAppiumUrl(), androidWeb()); } else { if (System.getProperty("os.name").toLowerCase().contains("mac")) { if (prop.getProperty("IOS_APP_PATH") != null && iosDevice.checkiOSDevice(device_udid)) { if (iosCaps == null) { iosCaps = iosNative(); } driver = new IOSDriver<>(appiumMan.getAppiumUrl(), iosCaps); } else if (!iosDevice.checkiOSDevice(device_udid)) { if (androidCaps == null) { androidCaps = androidNative(); } checkSelendroid(androidCaps); driver = new AndroidDriver<>(appiumMan.getAppiumUrl(), androidCaps); } } else { if (androidCaps == null) { androidCaps = androidNative(); } checkSelendroid(androidCaps); driver = new AndroidDriver<>(appiumMan.getAppiumUrl(), androidCaps); } } }
Source:
private Object defaultWebFlux(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, String methodName) throws Throwable { CircuitBreakerUtils.isCallPermitted(circuitBreaker); long start = System.nanoTime(); try { Object returnValue = proceedingJoinPoint.proceed(); if (returnValue instanceof Flux) { Flux fluxReturnValue = (Flux) returnValue; return fluxReturnValue.transform(CircuitBreakerOperator.of(circuitBreaker)); } else if (returnValue instanceof Mono) { Mono fluxReturnValue = (Mono) returnValue; return fluxReturnValue.transform(CircuitBreakerOperator.of(circuitBreaker)); } else { throw new IllegalArgumentException("Not Supported type for the circuit breaker in web flux :" + returnValue.getClass().getName()); } } catch (Throwable throwable) { long durationInNanos = System.nanoTime() - start; circuitBreaker.onError(durationInNanos, throwable); if (logger.isDebugEnabled()) { logger.debug("Invocation of method '" + methodName + "' failed!", throwable); } throw throwable; } }

Target:
private Object defaultWebFlux(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.circuitbreaker.CircuitBreaker circuitBreaker, String methodName) throws Throwable { CircuitBreakerUtils.isCallPermitted(circuitBreaker); long start = System.nanoTime(); try { Object returnValue = proceedingJoinPoint.proceed(); if (returnValue instanceof Flux) { Flux fluxReturnValue = (Flux) returnValue; return fluxReturnValue.transform(CircuitBreakerOperator.of(circuitBreaker)); } else if (returnValue instanceof Mono) { Mono monoReturnValue = (Mono) returnValue; return monoReturnValue.transform(CircuitBreakerOperator.of(circuitBreaker)); } else { throw new IllegalArgumentException("Not Supported type for the circuit breaker in web flux :" + returnValue.getClass().getName()); } } catch (Throwable throwable) { long durationInNanos = System.nanoTime() - start; circuitBreaker.onError(durationInNanos, throwable); if (logger.isDebugEnabled()) { logger.debug("Invocation of method '" + methodName + "' failed!", throwable); } throw throwable; } }
Source:
protected boolean canDoAction() { if (!validate(new StoragePoolValidator(getStoragePool()).isUp())) { return false; } if (getParameters().getImportAsTemplate()) { if (getParameters().getClusterId() == null) { addCanDoActionMessage(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID); return false; } setVdsGroupId(getParameters().getClusterId()); if (getVdsGroup() == null) { addCanDoActionMessage(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID); return false; } if (getVdsGroup().getArchitecture() == ArchitectureType.undefined) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_UNDEFINED_ARCHITECTURE); } setStoragePoolId(getParameters().getStoragePoolId()); if (getStoragePool().getcompatibility_version().compareTo(Version.v3_4) < 0) { return failCanDoAction(VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL); } } DiskImage diskImage = null; try { diskImage = getDiskImage(); } catch (OpenStackImageException e) { log.errorFormat("Unable to get the disk image from the provider proxy: {0} ({1})", e.getMessage(), e.getErrorType()); switch (e.getErrorType()) { case UNSUPPORTED_CONTAINER_FORMAT: case UNSUPPORTED_DISK_FORMAT: return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_IMAGE_NOT_SUPPORTED); case UNABLE_TO_DOWNLOAD_IMAGE: return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_IMAGE_DOWNLOAD_ERROR); case UNRECOGNIZED_IMAGE_FORMAT: return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_IMAGE_UNRECOGNIZED); } } if (diskImage == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST); } return true; }

Target:
protected boolean canDoAction() { if (!validate(new StoragePoolValidator(getStoragePool()).isUp())) { return false; } if (getParameters().getImportAsTemplate()) { if (getParameters().getClusterId() == null) { addCanDoActionMessage(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID); return false; } setVdsGroupId(getParameters().getClusterId()); if (getVdsGroup() == null) { addCanDoActionMessage(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID); return false; } if (getVdsGroup().getArchitecture() == ArchitectureType.undefined) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CLUSTER_UNDEFINED_ARCHITECTURE); } setStoragePoolId(getParameters().getStoragePoolId()); if (!FeatureSupported.importGlanceImageAsTemplate(getStoragePool().getcompatibility_version())) { return failCanDoAction(VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL); } } DiskImage diskImage = null; try { diskImage = getDiskImage(); } catch (OpenStackImageException e) { log.errorFormat("Unable to get the disk image from the provider proxy: {0} ({1})", e.getMessage(), e.getErrorType()); switch (e.getErrorType()) { case UNSUPPORTED_CONTAINER_FORMAT: case UNSUPPORTED_DISK_FORMAT: return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_IMAGE_NOT_SUPPORTED); case UNABLE_TO_DOWNLOAD_IMAGE: return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_IMAGE_DOWNLOAD_ERROR); case UNRECOGNIZED_IMAGE_FORMAT: return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_IMAGE_UNRECOGNIZED); } } if (diskImage == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_DISK_NOT_EXIST); } return true; }
Source:
public void taskCompletedComplete() { cTestEvent.cTasksCompleted = 20; TestStrollEvent spy = Mockito.spy(cTestEvent); Mockito.doNothing().when(spy).clearEvent(); spy.taskCompleted(); Mockito.verify(spy).clearEvent(); }

Target:
public void taskCompletedComplete() { cSpyEvent.cTasksCompleted = TestStrollEvent.MAX_TASKS; Mockito.doNothing().when(cSpyEvent).clearEvent(); cSpyEvent.taskCompleted(); Mockito.verify(cSpyEvent).clearEvent(); }
Source:
public void authenticate() throws AccumuloSecurityException, AccumuloException { if (context.getCredentials().getToken().isDestroyed()) throw new AccumuloSecurityException(context.getCredentials().getPrincipal(), SecurityErrorCode.TOKEN_EXPIRED); final String tokenClassName = context.getCredentials().getToken().getClass().getName(); if (!SYSTEM_TOKEN_NAME.equals(tokenClassName)) { ServerClient.executeVoid(context, iface -> { if (!iface.authenticate(Tracer.traceInfo(), context.rpcCreds())) throw new AccumuloSecurityException("Authentication failed, access denied", SecurityErrorCode.BAD_CREDENTIALS); }); } }

Target:
void authenticate() throws AccumuloSecurityException, AccumuloException { if (context.getCredentials().getToken().isDestroyed()) throw new AccumuloSecurityException(context.getCredentials().getPrincipal(), SecurityErrorCode.TOKEN_EXPIRED); final String tokenClassName = context.getCredentials().getToken().getClass().getName(); if (!SYSTEM_TOKEN_NAME.equals(tokenClassName)) { ServerClient.executeVoid(context, iface -> { if (!iface.authenticate(Tracer.traceInfo(), context.rpcCreds())) throw new AccumuloSecurityException("Authentication failed, access denied", SecurityErrorCode.BAD_CREDENTIALS); }); } }
Source:
void check(HttpServerExchange exchange, int contentLength, AttachmentContent attachment) throws InvalidContentLengthException, ContentTooLargeException { int max = attachment.getCachedTopic().getTopic().getMaxMessageSize(); long expected = exchange.getRequestContentLength(); if (expected != contentLength && !isChunked(exchange.getRequestHeaders(), expected)) { throw new InvalidContentLengthException(expected, contentLength); } else if (contentLength > max) { if (forceMaxMessageSizePerTopic) { throw new ContentTooLargeException(contentLength, max); } else { logger.info("Content-Length is larger than max on this topic [length:{}, max:{}, topic: {}]", contentLength, max, attachment.getCachedTopic().getQualifiedName()); } } }

Target:
void check(HttpServerExchange exchange, int contentLength, AttachmentContent attachment) throws InvalidContentLengthException, ContentTooLargeException { int max = attachment.getCachedTopic().getTopic().getMaxMessageSize(); long expected = exchange.getRequestContentLength(); if (expected != contentLength && !isChunked(exchange.getRequestHeaders(), expected)) { throw new InvalidContentLengthException(expected, contentLength); } else if (contentLength > max) { if (forceMaxMessageSizePerTopic) { throw new ContentTooLargeException(contentLength, max); } else { logger.warn("Content-Length is larger than max on this topic [length:{}, max:{}, topic: {}]", contentLength, max, attachment.getCachedTopic().getQualifiedName()); } } }
Source:
int read() { if (this.hasNext() == false) { throw new IllegalStateException("This stream hasn't any other value, all values were already read."); } int value = this.interval[nextPos]; this.nextPos++; return value; }

Target:
int read() { if (!this.hasNext()) { throw new IllegalStateException("This stream hasn't any other value, all values were already read."); } int value = this.interval[nextPos]; this.nextPos++; return value; }
Source:
private void validateDescriptors() { Map<String, List<AttributeDescriptor>> descriptorMap = new HashMap<>(); for (AttributeDescriptor descriptor : descriptors) { if (descriptor == null) { continue; } descriptorMap.putIfAbsent(descriptor.getName(), new ArrayList<>()); descriptorMap.get(descriptor.getName()).add(descriptor); } for (Map.Entry<String, List<AttributeDescriptor>> entry : descriptorMap.entrySet()) { if (entry.getValue().size() > 1) { LOGGER.warn( "Conflicting attribute definitions on for {}. Conflicting definitions: {}", name, entry.getKey(), entry.getValue()); } } }

Target:
private void validateDescriptors() { Set<String> names = new HashSet<>(); descriptors .stream() .filter(Objects::nonNull) .forEach( attributeDescriptor -> { if (!names.contains(attributeDescriptor.getName())) { names.add(attributeDescriptor.getName()); } else { LOGGER.warn( "Conflicting attribute definitions on for {}.", name, attributeDescriptor.getName()); } }); }
Source:
private boolean shouldPublishIndividualGaugeMetric(Gauge<T> constituentGauge) { T value = constituentGauge.getValue(); return lowerBoundSupplier.get() .map(lowerBound -> isAtLeastLowerBound(value, lowerBound)) .orElse(true); }

Target:
private boolean shouldPublishIndividualGaugeMetric(Gauge<T> constituentGauge) { return publishableGauges.get().contains(constituentGauge); }
Source:
protected Object handleRequestMessage(Message<?> requestMessage) { if (!this.initialized.getAndSet(true)) { initialize(); } return exchanger.exchange(requestMessage); }

Target:
protected Object handleRequestMessage(Message<?> requestMessage) { if (this.exchanger == null) { synchronized (this) { if (this.exchanger == null) { initialize(); } } } return this.exchanger.exchange(requestMessage); }
Source:
public static void main(String[] args) throws IOException, InterruptedException { SamplesArguments parsedArguments = new SamplesArguments(args); client = new DigitalTwinsClientBuilder() .tokenCredential( new ClientSecretCredentialBuilder() .tenantId(parsedArguments.getTenantId()) .clientId(parsedArguments.getClientId()) .clientSecret(parsedArguments.getClientSecret()) .build() ) .endpoint(parsedArguments.getDigitalTwinUrl()) .httpLogOptions( new HttpLogOptions() .setLogLevel(HttpLogDetailLevel.NONE)) .buildAsyncClient(); deleteTwins(); createTwins(); }

Target:
public static void main(String[] args) throws IOException, InterruptedException { SamplesArguments parsedArguments = new SamplesArguments(args); client = new DigitalTwinsClientBuilder() .tokenCredential( new ClientSecretCredentialBuilder() .tenantId(parsedArguments.getTenantId()) .clientId(parsedArguments.getClientId()) .clientSecret(parsedArguments.getClientSecret()) .build() ) .endpoint(parsedArguments.getDigitalTwinEndpoint()) .httpLogOptions( new HttpLogOptions() .setLogLevel(parsedArguments.getHttpLogDetailLevel())) .buildAsyncClient(); deleteTwins(); createTwins(); }
Source:
public SupportLevel getCredentialAcquireSupport(final Class<? extends Credential> credentialType, final String algorithmName) { if (credentialType != PasswordCredential.class) { return SupportLevel.UNSUPPORTED; } if (algorithmName == null) { return SupportLevel.SUPPORTED; } DirContext context = null; try { context = contextFactory.obtainDirContext(null); Attributes attributes = context.getAttributes(distinguishedName, new String[] { algorithmAttributeName, hashAttributeName, seedAttributeName, sequenceAttributeName }); Attribute algorithmAttribute = attributes.get(algorithmAttributeName); Attribute hashAttribute = attributes.get(hashAttributeName); Attribute seedAttribute = attributes.get(seedAttributeName); Attribute sequenceAttribute = attributes.get(sequenceAttributeName); if (algorithmAttribute != null && hashAttribute != null && seedAttribute != null && sequenceAttribute != null && algorithmAttribute.contains(algorithmName)) { return SupportLevel.SUPPORTED; } } catch (NamingException e) { } finally { contextFactory.returnContext(context); } return SupportLevel.UNSUPPORTED; }

Target:
public SupportLevel getCredentialAcquireSupport(final Class<? extends Credential> credentialType, final String algorithmName) { if (credentialType != PasswordCredential.class) { return SupportLevel.UNSUPPORTED; } DirContext context = null; try { context = contextFactory.obtainDirContext(null); Attributes attributes = context.getAttributes(distinguishedName, new String[] { algorithmAttributeName, hashAttributeName, seedAttributeName, sequenceAttributeName }); Attribute algorithmAttribute = attributes.get(algorithmAttributeName); Attribute hashAttribute = attributes.get(hashAttributeName); Attribute seedAttribute = attributes.get(seedAttributeName); Attribute sequenceAttribute = attributes.get(sequenceAttributeName); if (algorithmAttribute != null && hashAttribute != null && seedAttribute != null && sequenceAttribute != null && (algorithmName == null || algorithmAttribute.contains(algorithmName))) { return SupportLevel.SUPPORTED; } } catch (NamingException e) { } finally { contextFactory.returnContext(context); } return SupportLevel.UNSUPPORTED; }
Source:
public static CompletionStage<Void> writeTo(final InputStream in, final AsyncOutputStream out) { byte[] buf = new byte[2048]; int read; try { while ((read = in.read(buf)) != -1) { out.asyncWrite(buf, 0, read); buf = new byte[2048]; } } catch (IOException e) { return completedException(e); } return CompletableFuture.completedFuture(null); }

Target:
public static CompletionStage<Void> writeTo(final InputStream in, final AsyncOutputStream out) { byte[] buf = new byte[2048]; int read; try { while ((read = in.read(buf)) != -1) { out.asyncWrite(buf, 0, read); } } catch (IOException e) { return completedException(e); } return CompletableFuture.completedFuture(null); }
Source:
private Pool findPool(String poolId) { Pool pool = poolManager.find(poolId); if (pool == null) { throw new BadRequestException(i18n.tr("Pool with id {0} could not be found.", poolId)); } return pool; }

Target:
private Pool findPool(String poolId) { Pool pool; if (poolId != null && !poolId.isEmpty()) { pool = poolManager.find(poolId); } else { throw new BadRequestException(i18n.tr("Pool id is null or empty.")); } if (pool == null) { throw new BadRequestException(i18n.tr("Pool with id {0} could not be found.", poolId)); } return pool; }
Source:
public int[] getAcceptableTokens() { return new int[] { TokenTypes.CLASS_DEF, TokenTypes.INTERFACE_DEF, TokenTypes.PACKAGE_DEF, TokenTypes.ENUM_CONSTANT_DEF, TokenTypes.ENUM_DEF, TokenTypes.METHOD_DEF, TokenTypes.CTOR_DEF, TokenTypes.VARIABLE_DEF, TokenTypes.PARAMETER_DEF, TokenTypes.ANNOTATION_DEF, TokenTypes.TYPECAST, TokenTypes.LITERAL_THROWS, TokenTypes.IMPLEMENTS_CLAUSE, TokenTypes.TYPE_ARGUMENT, TokenTypes.LITERAL_NEW, TokenTypes.DOT, TokenTypes.ANNOTATION_FIELD_DEF, }; }

Target:
public int[] getAcceptableTokens() { return new int[] { TokenTypes.CLASS_DEF, TokenTypes.INTERFACE_DEF, TokenTypes.PACKAGE_DEF, TokenTypes.ENUM_CONSTANT_DEF, TokenTypes.ENUM_DEF, TokenTypes.METHOD_DEF, TokenTypes.CTOR_DEF, TokenTypes.VARIABLE_DEF, TokenTypes.PARAMETER_DEF, TokenTypes.ANNOTATION_DEF, TokenTypes.ANNOTATION_FIELD_DEF, }; }
Source:
public void tearDown() throws Exception { LogReaderService logReaderService = appContext.get(LogReaderService.class); logReaderService.removeLogListener(listener); if (wb != null) { wb.close(); } appContext.dispose(); }

Target:
public void tearDown() { LogReaderService logReaderService = appContext.get(LogReaderService.class); logReaderService.removeLogListener(listener); if (wb != null) { wb.close(); } appContext.dispose(); }
Source:
private void handleRepeatedInvocation() { if (fContentAssistant.isRepeatedInvocationMode()) { fComputedProposals= computeProposals(fFilterOffset); setProposals(fComputedProposals, false); } }

Target:
void handleRepeatedInvocation() { if (fContentAssistant.isRepeatedInvocationMode()) { fComputedProposals= computeProposals(fFilterOffset); setProposals(fComputedProposals, false); } }
Source:
public void testRegistrationAndDiscoveryServices() throws Exception { EurekaClient eurekaClient = EurekaClientBuilder.newBuilder() .withReadServerResolver(ServerResolvers.just("localhost", writeServerResource.getDiscoveryPort())) .withWriteServerResolver(ServerResolvers.just("localhost", writeServerResource.getRegistrationPort())) .build(); InstanceInfo instanceInfo = SampleInstanceInfo.DiscoveryServer.build(); RegistrationRequest request = eurekaClient.connect(Observable.just(instanceInfo)); request.subscribe(); request.getInitObservable().toBlocking().lastOrDefault(null); List<ChangeNotification<InstanceInfo>> notifications = eurekaClient .forInterest(Interests.forFullRegistry()) .take(2) .toList() .toBlocking().single(); assertThat(notifications.size(), is(equalTo(2))); eurekaClient.shutdown(); }

Target:
public void testRegistrationAndDiscoveryServices() throws Exception { EurekaClient eurekaClient = EurekaClientBuilder.newBuilder() .withReadServerResolver(ServerResolvers.just("localhost", writeServerResource.getDiscoveryPort())) .withWriteServerResolver(ServerResolvers.just("localhost", writeServerResource.getRegistrationPort())) .build(); InstanceInfo instanceInfo = SampleInstanceInfo.DiscoveryServer.build(); RegistrationObservable request = eurekaClient.register(Observable.just(instanceInfo)); request.subscribe(); request.initialRegistrationResult().toBlocking().lastOrDefault(null); List<ChangeNotification<InstanceInfo>> notifications = eurekaClient .forInterest(Interests.forFullRegistry()) .take(2) .toList() .toBlocking().single(); assertThat(notifications.size(), is(equalTo(2))); eurekaClient.shutdown(); }
Source:
private String createProcessorId(Config config) { ApplicationConfig appConfig = new ApplicationConfig(config); if (appConfig.getProcessorId() != null) { return appConfig.getProcessorId(); } else if (!StringUtils.isEmpty(appConfig.getAppProcessorIdGeneratorClass())) { ProcessorIdGenerator idGenerator = ClassLoaderHelper.fromClassName(appConfig.getAppProcessorIdGeneratorClass(), ProcessorIdGenerator.class); return idGenerator.generateProcessorId(config); } else { throw new ConfigException(String .format("Expected either %s or %s to be configured", ApplicationConfig.PROCESSOR_ID, ApplicationConfig.APP_PROCESSOR_ID_GENERATOR_CLASS)); } }

Target:
private String createProcessorId(Config config) { ApplicationConfig appConfig = new ApplicationConfig(config); if (appConfig.getProcessorId() != null) { return appConfig.getProcessorId(); } else if (StringUtils.isNotBlank(appConfig.getAppProcessorIdGeneratorClass())) { ProcessorIdGenerator idGenerator = ClassLoaderHelper.fromClassName(appConfig.getAppProcessorIdGeneratorClass(), ProcessorIdGenerator.class); return idGenerator.generateProcessorId(config); } else { throw new ConfigException(String .format("Expected either %s or %s to be configured", ApplicationConfig.PROCESSOR_ID, ApplicationConfig.APP_PROCESSOR_ID_GENERATOR_CLASS)); } }
Source:
protected void run() throws Exception { CheckoutCommand command = new Git(db).checkout(); command.setCreateBranch(createBranch); command.setName(name); command.setForce(force); try { String oldBranch = db.getBranch(); Ref ref = command.call(); if (Repository.shortenRefName(ref.getName()).equals(oldBranch)) out.println(MessageFormat.format(CLIText.get().alreadyOnBranch, name)); if (createBranch) out.println(MessageFormat.format( CLIText.get().switchedToNewBranch, Repository.shortenRefName(ref.getName()))); else out.println(MessageFormat.format( CLIText.get().switchedToBranch, Repository.shortenRefName(ref.getName()))); } catch (RefNotFoundException e) { throw die(MessageFormat.format(CLIText.get().pathspecDidNotMatch, name)); } catch (RefAlreadyExistsException e) { throw die(MessageFormat.format( CLIText.get().checkoutBranchAlreadyExists, name)); } }

Target:
protected void run() throws Exception { if (createBranch) { final ObjectId head = db.resolve(Constants.HEAD); if (head == null) throw die(CLIText.get().onBranchToBeBorn); } CheckoutCommand command = new Git(db).checkout(); command.setCreateBranch(createBranch); command.setName(name); command.setForce(force); try { String oldBranch = db.getBranch(); Ref ref = command.call(); if (Repository.shortenRefName(ref.getName()).equals(oldBranch)) { out.println(MessageFormat.format(CLIText.get().alreadyOnBranch, name)); return; } if (createBranch) out.println(MessageFormat.format( CLIText.get().switchedToNewBranch, Repository.shortenRefName(ref.getName()))); else out.println(MessageFormat.format( CLIText.get().switchedToBranch, Repository.shortenRefName(ref.getName()))); } catch (RefNotFoundException e) { throw die(MessageFormat.format(CLIText.get().pathspecDidNotMatch, name)); } catch (RefAlreadyExistsException e) { throw die(MessageFormat.format( CLIText.get().checkoutBranchAlreadyExists, name)); } }