auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void addDataDirectory(String name, String path, boolean skipIO) { validateDataDirectory(name, path, skipIO); Path dataDirectory = compute(Paths.get(path)); LOGGER.debug("Defined directory with name: at location: {}", name, dataDirectory); dataRootMap.put(name, dataDirectory); for (EntityManagementRegistry registry : registries) { registry.register(new DataRootBinding(name, dataDirectory)); registry.refresh(); } }

Target:
public void addDataDirectory(String name, String path, boolean skipIO) { validateDataDirectory(name, path, skipIO); Path dataDirectory = compute(Paths.get(path)); LOGGER.debug("Defined directory with name: at location: {}", name, dataDirectory); dataRootMap.put(name, dataDirectory); for (EntityManagementRegistry registry : registries) { registry.registerAndRefresh(new DataRootBinding(name, dataDirectory)); } }
Source:
public InputStream getStream(URL uri) throws IOException { Cache<URL, AudioStreamCache> cache = getCache(); if (!cache.containsKey(uri)) { lock.lock(); try { if (!cache.containsKey(uri)) { cache.put(uri, new AudioStreamCache(uri)); } } finally { lock.unlock(); } } return new ByteArrayInputStream(cache.get(uri).getBytes()); }

Target:
public InputStream getStream(URL uri) throws IOException { Cache<URL, AudioStreamCache> cache = getCache(); AudioStreamCache stream = cache.get(uri); if (stream == null) { stream = cache.putIfAbsent(uri, new AudioStreamCache(uri)); } return new ByteArrayInputStream(stream.getBytes()); }
Source:
protected MergeStatus mergeTo(IProgressMonitor monitor, String branchName, String targetBranchName) throws CoreException { try { if (!repository.hasBranch(targetBranchName)) { throw new RuntimeException(String.format( CoreText.GitFlowOperation_branchNotFound, targetBranchName)); } boolean dontCloseProjects = false; BranchOperation branchOperation = new BranchOperation( repository.getRepository(), targetBranchName, dontCloseProjects); branchOperation.execute(monitor); Status status = branchOperation.getResult().getStatus(); if (!CheckoutResult.Status.OK.equals(status)) { throw new CoreException(error(format( CoreText.GitFlowOperation_unableToCheckout, branchName, status.toString()))); } MergeOperation mergeOperation = new MergeOperation( repository.getRepository(), branchName); mergeOperation.execute(monitor); return mergeOperation.getResult().getMergeStatus(); } catch (GitAPIException e) { throw new RuntimeException(e); } }

Target:
protected MergeResult mergeTo(IProgressMonitor monitor, String branchName, String targetBranchName) throws CoreException { try { if (!repository.hasBranch(targetBranchName)) { throw new RuntimeException(String.format( CoreText.GitFlowOperation_branchNotFound, targetBranchName)); } boolean dontCloseProjects = false; BranchOperation branchOperation = new BranchOperation( repository.getRepository(), targetBranchName, dontCloseProjects); branchOperation.execute(monitor); Status status = branchOperation.getResult().getStatus(); if (!CheckoutResult.Status.OK.equals(status)) { throw new CoreException(error(format( CoreText.GitFlowOperation_unableToCheckout, branchName, status.toString()))); } MergeOperation mergeOperation = new MergeOperation( repository.getRepository(), branchName); mergeOperation.execute(monitor); return mergeOperation.getResult(); } catch (GitAPIException e) { throw new RuntimeException(e); } }
Source:
public static ChannelManager getInstance() { if (instance == null) { instance = new ChannelManager(); } return instance; }

Target:
public static ChannelManager getInstance() { if (instance == null) { synchronized (ChannelManager.class) { if (instance == null) { instance = new ChannelManager(); } } } return instance; }
Source:
public Response createClusterStateModelDefinition( @PathParam("clusterId") String clusterId, @PathParam("statemodel") String statemodel, String content ) { ZNRecord record; try { record = toZNRecord(content); } catch (IOException e) { _logger.error("Failed to deserialize user's input " + content + ", Exception: " + e); return badRequest("Input is not a valid ZNRecord!"); } HelixZkClient zkClient = getHelixZkClient(); String path = PropertyPathBuilder.stateModelDef(clusterId); try { ZKUtil.createChildren(zkClient, path, record); } catch (Exception e) { _logger.error("Failed to create zk node with path " + path + ", Exception:" + e); return badRequest("Failed to create a Znode for stateModel!"); } return OK(); }

Target:
public Response createClusterStateModelDefinition(@PathParam("clusterId") String clusterId, @PathParam("statemodel") String statemodel, String content) { ZNRecord record; try { record = toZNRecord(content); } catch (IOException e) { _logger.error("Failed to deserialize user's input " + content + ", Exception: " + e); return badRequest("Input is not a valid ZNRecord!"); } HelixZkClient zkClient = getHelixZkClient(); String path = PropertyPathBuilder.stateModelDef(clusterId); try { ZKUtil.createChildren(zkClient, path, record); } catch (Exception e) { _logger.error("Failed to create zk node with path " + path + ", Exception:" + e); return badRequest("Failed to create a Znode for stateModel! " + e); } return OK(); }
Source:
private void initializeMocks(long[] blockSizes, short[] replication) throws IOException, BlockNotFoundException { when(appFS.exists(Matchers.any(Path.class))).thenReturn(true); when(status0.getReplication()).thenReturn(replication[0]); when(status1.getReplication()).thenReturn(replication[1]); when(status2.getReplication()).thenReturn(replication[2]); when(status0.getLen()).thenReturn(blockSizes[0]); when(status1.getLen()).thenReturn(blockSizes[1]); when(status2.getLen()).thenReturn(blockSizes[2]); when(appFS.getFileStatus(new Path("/0"))).thenReturn(status0); when(appFS.getFileStatus(new Path("/1"))).thenReturn(status1); when(appFS.getFileStatus(new Path("/2"))).thenReturn(status2); }

Target:
private void initializeMocks(long[] blockSizes, short[] replication) throws IOException, BlockNotFoundException { when(status0.getReplication()).thenReturn(replication[0]); when(status1.getReplication()).thenReturn(replication[1]); when(status2.getReplication()).thenReturn(replication[2]); when(status0.getLen()).thenReturn(blockSizes[0]); when(status1.getLen()).thenReturn(blockSizes[1]); when(status2.getLen()).thenReturn(blockSizes[2]); when(appFS.getFileStatus(new Path("/0"))).thenReturn(status0); when(appFS.getFileStatus(new Path("/1"))).thenReturn(status1); when(appFS.getFileStatus(new Path("/2"))).thenReturn(status2); }
Source:
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { try { if (!consumer.getEndpoint().isAutoAck()) { lock.acquire(); } doHandleDelivery(consumerTag, envelope, properties, body); if (!consumer.getEndpoint().isAutoAck()) { lock.release(); } } catch (InterruptedException e) { log.error("Thread Interrupted!"); } }

Target:
public void handleDelivery(String consumerTag, Envelope envelope, AMQP.BasicProperties properties, byte[] body) throws IOException { try { if (!consumer.getEndpoint().isAutoAck()) { lock.acquire(); } if (!channel.isOpen()) return; try { doHandleDelivery(consumerTag, envelope, properties, body); } finally { if (!consumer.getEndpoint().isAutoAck()) { lock.release(); } } } catch (InterruptedException e) { log.error("Thread Interrupted!"); } }
Source:
public Condition saveCondition(Condition condition) throws APIException { return conditionDAO.saveCondition(condition); }

Target:
public Condition saveCondition(Condition condition) { return conditionDAO.saveCondition(condition); }
Source:
public FixedRealVarImpl(String name, double value, Model model) { super(name, model); this.lb = value; this.ub = value; }

Target:
public FixedRealVarImpl(String name, double value, Model model) { this(name, value, value, model); }
Source:
public ImmutableBeaconData clearEffects() { return this; }

Target:
public ImmutableBeaconData clearEffects() { return new ImmutableSpongeBeaconData(null, null); }
Source:
public void generate(final Ds3ApiSpec spec, final FileUtils fileUtils, final Path destDir) throws IOException { this.fileUtils = fileUtils; try { final ImmutableList<Request> allRequests = getAllRequests(spec); final ImmutableList<Enum> allEnums = getAllEnums(spec); final ImmutableSet<String> enumNames = EnumHelper.getEnumNamesSet(allEnums); final Queue<Struct> allStructs = new LinkedList<>(getAllStructs(spec, enumNames, allRequests)); final ImmutableList<Struct> allOrderedStructs = StructHelper.getStructsOrderedList(allStructs, enumNames); generateHeader(allEnums, allOrderedStructs, allRequests); generateSource(allEnums, allOrderedStructs, allRequests); } catch (final ParseException e) { LOG.error("Caught exception: ", e); } }

Target:
public void generate(final Ds3ApiSpec spec, final FileUtils fileUtils, final Path destDir) throws IOException { this.fileUtils = fileUtils; try { final ImmutableList<Request> allRequests = getAllRequests(spec); final ImmutableList<Enum> allEnums = getAllEnums(spec); final ImmutableSet<String> enumNames = EnumHelper.getEnumNamesSet(allEnums); final ImmutableList<Struct> allStructs = getAllStructs(spec, enumNames, allRequests); final ImmutableList<Struct> allOrderedStructs = StructHelper.getStructsOrderedList(allStructs, enumNames); generateHeader(allEnums, allOrderedStructs, allRequests); generateSource(allEnums, allOrderedStructs, allRequests); } catch (final ParseException e) { LOG.error("Caught exception: ", e); } }
Source:
private Service getCheServiceBySelector(String selectorKey, String selectorValue) { ServiceList svcs = openShiftClient.services() .inNamespace(this.cheOpenShiftProjectName) .list(); Service svc = svcs.getItems().stream() .filter(s->s.getSpec().getSelector().containsKey(selectorKey)) .filter(s->s.getSpec().getSelector().get(selectorKey).equals(selectorValue)).findAny().orElse(null); if (svc == null) { LOG.warn("No Service with selector " + selectorKey + "=" + selectorValue + " could be found."); } return svc; }

Target:
private Service getCheServiceBySelector(String selectorKey, String selectorValue) { ServiceList svcs = openShiftClient.services() .inNamespace(this.openShiftCheProjectName) .list(); Service svc = svcs.getItems().stream() .filter(s->s.getSpec().getSelector().containsKey(selectorKey)) .filter(s->s.getSpec().getSelector().get(selectorKey).equals(selectorValue)).findAny().orElse(null); if (svc == null) { LOG.warn("No Service with selector {}={} could be found", selectorKey, selectorValue); } return svc; }
Source:
public void onLogin(User user) { mIconsHidden = false; supportInvalidateOptionsMenu(); Log.e("LOGGED IN", "EFCEF"); ((LoginListener)mMediaView).onLogin(user); if (((MainApplication)getApplication()).isFirstTimeGalleryUser()) { MediaFragment.createHelpDialog(this).show(); ((MainApplication)getApplication()).setFirstTimeGalleryUser(false); } }

Target:
public void onLogin(User user) { mIconsHidden = false; supportInvalidateOptionsMenu(); ((LoginListener)mMediaView).onLogin(user); if (((MainApplication)getApplication()).isFirstTimeGalleryUser()) { MediaFragment.createHelpDialog(this).show(); ((MainApplication)getApplication()).setFirstTimeGalleryUser(false); } }
Source:
public ScheduleException(PeriodicSchedule definition, String msgTemplate, Object... msgArguments) { super(ArgChecker.formatMessage(msgTemplate, msgArguments)); this.definition = definition; }

Target:
public ScheduleException(PeriodicSchedule definition, String msgTemplate, Object... msgArguments) { super(Messages.format(msgTemplate, msgArguments)); this.definition = definition; }
Source:
public CompletionStage<Result> queryMetrics() { try { final MetricsQuery metricsQuery = _mapper.treeToValue(request().body().asJson(), MetricsQuery.class); if (_requireAggregators && metricsQuery.getMetrics().stream().anyMatch(metric -> metric.getAggregators().isEmpty())) { return CompletableFuture.completedFuture( Results.badRequest("All queried metrics must have at least one aggregator")); } if (_addMergeAggregator) { return _kairosService.queryMetrics(addMergeAggregator(metricsQuery)) .<JsonNode>thenApply(_mapper::valueToTree) .thenApply(Results::ok); } return _kairosService.queryMetrics(metricsQuery) .<JsonNode>thenApply(_mapper::valueToTree) .thenApply(Results::ok); } catch (final IOException e) { return CompletableFuture.completedFuture(Results.internalServerError(e.getMessage())); } }

Target:
public CompletionStage<Result> queryMetrics() { try { MetricsQuery metricsQuery = _mapper.treeToValue(request().body().asJson(), MetricsQuery.class); if (_requireAggregators && metricsQuery.getMetrics().stream().anyMatch(metric -> metric.getAggregators().isEmpty())) { return CompletableFuture.completedFuture( Results.badRequest("All queried metrics must have at least one aggregator")); } if (_addMergeAggregator) { metricsQuery = checkAndAddMergeAggregator(metricsQuery); } return _kairosService.queryMetrics(metricsQuery) .<JsonNode>thenApply(_mapper::valueToTree) .thenApply(Results::ok); } catch (final IOException e) { return CompletableFuture.completedFuture(Results.internalServerError(e.getMessage())); } }
Source:
public ValidationResult snapshotAlreadyExists(Map<Guid, Guid> diskToImageIds) { Set<Guid> diskIds = diskImages.stream() .flatMap(diskImage -> getDiskImageDao().getAllSnapshotsForImageGroup(diskImage.getId()).stream()) .map(diskImage -> diskImage.getImageId()) .collect(Collectors.toSet()); Set<Guid> passedImageIds = new HashSet(diskToImageIds.values()); Set<Guid> invalidGuids = passedImageIds.stream().filter(diskIds::contains).collect(Collectors.toSet()); if (!invalidGuids.isEmpty()) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_IMAGE_ALREADY_EXISTS, ReplacementUtils.createSetVariableString("ImageId", invalidGuids)); } return ValidationResult.VALID; }

Target:
public ValidationResult snapshotAlreadyExists(Map<Guid, Guid> diskToImageIds) { Set<Guid> diskIds = diskImages.stream() .flatMap(diskImage -> getDiskImageDao().getAllSnapshotsForImageGroup(diskImage.getId()).stream()) .map(diskImage -> diskImage.getImageId()) .collect(Collectors.toSet()); Set<Guid> passedImageIds = new HashSet(diskToImageIds.values()); Set<Guid> existingGuids = passedImageIds.stream().filter(diskIds::contains).collect(Collectors.toSet()); if (!existingGuids.isEmpty()) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_VM_SNAPSHOT_IMAGE_ALREADY_EXISTS, ReplacementUtils.createSetVariableString("ImageId", existingGuids)); } return ValidationResult.VALID; }
Source:
public MethodConstraintMappingContext method(String name, Class<?>... parameterTypes) { Contracts.assertNotNull( name, MESSAGES.methodNameMustNotBeNull() ); Method method = run( GetDeclaredMethod.action( beanClass, name, parameterTypes ) ); if ( method == null || method.getDeclaringClass() != beanClass ) { throw LOG.getBeanDoesNotContainMethodException( beanClass, name, parameterTypes ); } JavaBeanMethod javaBeanExecutable = (JavaBeanMethod) JavaBeanExecutable.of( method ); if ( configuredMembers.contains( javaBeanExecutable ) ) { throw LOG.getMethodHasAlreadyBeenConfiguredViaProgrammaticApiException( beanClass, ExecutableHelper.getExecutableAsString( name, parameterTypes ) ); } MethodConstraintMappingContextImpl context = new MethodConstraintMappingContextImpl( this, javaBeanExecutable ); configuredMembers.add( javaBeanExecutable ); executableContexts.add( context ); return context; }

Target:
public MethodConstraintMappingContext method(String name, Class<?>... parameterTypes) { Contracts.assertNotNull( name, MESSAGES.methodNameMustNotBeNull() ); Method method = run( GetDeclaredMethod.action( beanClass, name, parameterTypes ) ); if ( method == null || method.getDeclaringClass() != beanClass ) { throw LOG.getBeanDoesNotContainMethodException( beanClass, name, parameterTypes ); } JavaBeanMethod javaBeanMethod = JavaBeanExecutable.of( method ); if ( configuredMembers.contains( javaBeanMethod ) ) { throw LOG.getMethodHasAlreadyBeenConfiguredViaProgrammaticApiException( beanClass, ExecutableHelper.getExecutableAsString( name, parameterTypes ) ); } MethodConstraintMappingContextImpl context = new MethodConstraintMappingContextImpl( this, javaBeanMethod ); configuredMembers.add( javaBeanMethod ); executableContexts.add( context ); return context; }
Source:
private String getAzureSubnetToUseWithPrivateEndpoint(DetailedEnvironmentResponse detailedEnvironmentResponse, DBStack dbStack) { String subscriptionId = subnetListerService.getAzureSubscriptionId(detailedEnvironmentResponse.getCrn()); return subnetChooserService.chooseSubnetForPrivateEndpoint(detailedEnvironmentResponse.getNetwork().getSubnetMetas().values(), dbStack).stream() .findFirst() .map(csn -> SubnetListerService.expandAzureResourceId(csn, detailedEnvironmentResponse, subscriptionId)) .map(sn -> sn.getId()).orElse(null); }

Target:
private String getAzureSubnetToUseWithPrivateEndpoint(DetailedEnvironmentResponse detailedEnvironmentResponse, DBStack dbStack) { String subscriptionId = subnetListerService.getAzureSubscriptionId(detailedEnvironmentResponse.getCrn()); return subnetChooserService.chooseSubnetForPrivateEndpoint( detailedEnvironmentResponse.getNetwork().getSubnetMetas().values(), dbStack, detailedEnvironmentResponse.getNetwork().isExistingNetwork()).stream() .findFirst() .map(csn -> subnetListerService.expandAzureResourceId(csn, detailedEnvironmentResponse, subscriptionId)) .map(sn -> sn.getId()).orElse(null); }
Source:
public Double getLastPos() { return lastPos; }

Target:
public Double getLastPos() { return currentPos; }
Source:
ConfigFileConfigProvider(@JsonProperty("configFile") String configFile){ this.configFile = configFile; loadProperties(); }

Target:
ConfigFileConfigProvider(@JsonProperty("configFile") String configFile){ loadProperties(configFile); }
Source:
IndexValue(String logSegmentName, ByteBuffer value, short version) { this.version = version; switch (version) { case PersistentIndex.VERSION_0: if (value.capacity() != INDEX_VALUE_SIZE_IN_BYTES_V0) { throw new IllegalArgumentException("Invalid buffer size for version 0"); } size = value.getLong(); offset = new Offset(logSegmentName, value.getLong()); flags = value.get(); expiresAtMs = value.getLong(); originalMessageOffset = value.getLong(); operationTimeInMs = (int) Utils.Infinite_Time; serviceId = SERVICE_CONTAINER_ID_DEFAULT_VALUE; containerId = SERVICE_CONTAINER_ID_DEFAULT_VALUE; break; case PersistentIndex.VERSION_1: if (value.capacity() != INDEX_VALUE_SIZE_IN_BYTES_V1) { throw new IllegalArgumentException("Invalid buffer size for version 1"); } size = value.getLong(); offset = new Offset(logSegmentName, value.getLong()); flags = value.get(); long expiresAt = value.getInt(); expiresAtMs = expiresAt > Utils.Infinite_Time ? (expiresAt * Time.MsPerSec) : Utils.Infinite_Time; originalMessageOffset = value.getLong(); long operationTimeInSecs = value.getInt(); operationTimeInMs = operationTimeInSecs != Utils.Infinite_Time ? (operationTimeInSecs * Time.MsPerSec) : Utils.Infinite_Time; serviceId = value.getShort(); containerId = value.getShort(); break; default: throw new IllegalArgumentException("Unsupported version " + version + " passed in for IndexValue "); } }

Target:
IndexValue(String logSegmentName, ByteBuffer value, short version) { this.version = version; switch (version) { case PersistentIndex.VERSION_0: if (value.capacity() != INDEX_VALUE_SIZE_IN_BYTES_V0) { throw new IllegalArgumentException("Invalid buffer size for version 0"); } size = value.getLong(); offset = new Offset(logSegmentName, value.getLong()); flags = value.get(); expiresAtMs = value.getLong(); originalMessageOffset = value.getLong(); operationTimeInMs = (int) Utils.Infinite_Time; serviceId = SERVICE_CONTAINER_ID_DEFAULT_VALUE; containerId = SERVICE_CONTAINER_ID_DEFAULT_VALUE; break; case PersistentIndex.VERSION_1: if (value.capacity() != INDEX_VALUE_SIZE_IN_BYTES_V1) { throw new IllegalArgumentException("Invalid buffer size for version 1"); } size = value.getLong(); offset = new Offset(logSegmentName, value.getLong()); flags = value.get(); long expiresAt = value.getInt(); expiresAtMs = expiresAt >= 0 ? TimeUnit.SECONDS.toMillis(expiresAt) : Utils.Infinite_Time; originalMessageOffset = value.getLong(); long operationTimeInSecs = value.getInt(); operationTimeInMs = operationTimeInSecs != Utils.Infinite_Time ? TimeUnit.SECONDS.toMillis(operationTimeInSecs) : Utils.Infinite_Time; serviceId = value.getShort(); containerId = value.getShort(); break; default: throw new IllegalArgumentException("Unsupported version " + version + " passed in for IndexValue "); } }
Source:
public FeedbackResponse getFeedbackResponseEntityWithCheck ( String feedbackQuestionId, String giverEmail, String receiverEmail) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, feedbackQuestionId); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, giverEmail); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, receiverEmail); FeedbackResponse fr = getFeedbackResponseEntity(feedbackQuestionId, giverEmail, receiverEmail); if (fr == null || JDOHelper.isDeleted(fr)) { log.warning("Trying to get non-existent response: " + feedbackQuestionId + "/" + "from: " + giverEmail + " to: " + receiverEmail ); return null; } return fr; }

Target:
public FeedbackResponse getFeedbackResponseEntityWithCheck ( String feedbackQuestionId, String giverEmail, String receiverEmail) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, feedbackQuestionId); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, giverEmail); Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, receiverEmail); FeedbackResponse fr = getFeedbackResponseEntity(feedbackQuestionId, giverEmail, receiverEmail); if (fr == null) { log.warning("Trying to get non-existent response: " + feedbackQuestionId + "/" + "from: " + giverEmail + " to: " + receiverEmail ); return null; } return fr; }
Source:
private void bccWatchesNotifySubmittedChanges() { if (db != null) { try { final ProjectState ps = getProjectState(); if (ps != null) { for (AccountProjectWatch w : db.accountProjectWatches() .notifySubmittedChanges(ps.getProject().getNameKey())) { final List<Patch> patches = getPatches(patchSet.getId()); final List<String> patchFileNames = getPatchesFileNames(patches); if (canAddRecipient(w, patchFileNames)) { add(RecipientType.BCC, w.getAccountId()); } } } } catch (OrmException err) { } } }

Target:
private void bccWatchesNotifySubmittedChanges() { try { for (final AccountProjectWatch w : getWatches()) { if (w.isNotifySubmittedChanges()) { add(RecipientType.BCC, w.getAccountId()); } } } catch (OrmException err) { } }
Source:
private void logPoolStats() { if (log.isTraceEnabled()) { State stateLocal = state; HikariPoolMXBean poolProxy = stateLocal.poolProxy; if (poolProxy != null) { try { log.trace( "[{}] HikariCP: " + "numBusyConnections = {}, " + "numIdleConnections = {}, " + "numConnections = {}, " + "numThreadsAwaitingCheckout = {}", connConfig.getConnectionPoolName(), poolProxy.getActiveConnections(), poolProxy.getIdleConnections(), poolProxy.getTotalConnections(), poolProxy.getThreadsAwaitingConnection()); } catch (Exception e) { log.error("[{}] Unable to log pool statistics.", connConfig.getConnectionPoolName(), e); } } } }

Target:
private void logPoolStats() { if (log.isWarnEnabled()) { State stateLocal = state; HikariPoolMXBean poolProxy = stateLocal.poolProxy; if (poolProxy != null) { try { log.warn( "[{}] HikariCP: " + "numBusyConnections = {}, " + "numIdleConnections = {}, " + "numConnections = {}, " + "numThreadsAwaitingCheckout = {}", connConfig.getConnectionPoolName(), poolProxy.getActiveConnections(), poolProxy.getIdleConnections(), poolProxy.getTotalConnections(), poolProxy.getThreadsAwaitingConnection()); } catch (Exception e) { log.error("[{}] Unable to log pool statistics.", connConfig.getConnectionPoolName(), e); } } } }
Source:
public static void main(String[] args) { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "applicationContext.xml"); PersonRepository repository = context.getBean(PersonRepository.class); Person peter = new Person("Peter", "Sagan", 17); Person nasta = new Person("Nasta", "Kuzminova", 25); Person john = new Person("John", "lawrence", 35); Person terry = new Person("Terry", "Law", 36); repository.save(peter); repository.save(nasta); repository.save(john); repository.save(terry); LOGGER.info("Count Person records: {}", repository.count()); List<Person> persons = (List<Person>) repository.findAll(); for (Person person : persons) { LOGGER.info(person.toString()); } nasta.setName("Barbora"); nasta.setSurname("Spotakova"); repository.save(nasta); LOGGER.info("Find by id 2: {}", repository.findById(2L)); repository.deleteById(2L); LOGGER.info("Count Person records: {}", repository.count()); Optional<Person> p = repository.findOne(new PersonSpecifications.NameEqualSpec("John")); LOGGER.info("Find by John is {}", p.get()); persons = repository.findAll(new PersonSpecifications.AgeBetweenSpec(20, 40)); LOGGER.info("Find Person with age between 20,40: "); for (Person person : persons) { LOGGER.info(person.toString()); } repository.deleteAll(); context.close(); }

Target:
public static void main(String[] args) { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext( "applicationContext.xml"); PersonRepository repository = context.getBean(PersonRepository.class); Person peter = new Person("Peter", "Sagan", 17); Person nasta = new Person("Nasta", "Kuzminova", 25); Person john = new Person("John", "lawrence", 35); Person terry = new Person("Terry", "Law", 36); repository.save(peter); repository.save(nasta); repository.save(john); repository.save(terry); LOGGER.info("Count Person records: {}", repository.count()); List<Person> persons = (List<Person>) repository.findAll(); for (Person person : persons) { LOGGER.info(person.toString()); } nasta.setName("Barbora"); nasta.setSurname("Spotakova"); repository.save(nasta); LOGGER.info("Find by id 2: {}", repository.findById(2L).get()); repository.deleteById(2L); LOGGER.info("Count Person records: {}", repository.count()); Optional<Person> p = repository.findOne(new PersonSpecifications.NameEqualSpec("John")); LOGGER.info("Find by John is {}", p.get()); persons = repository.findAll(new PersonSpecifications.AgeBetweenSpec(20, 40)); LOGGER.info("Find Person with age between 20,40: "); for (Person person : persons) { LOGGER.info(person.toString()); } repository.deleteAll(); context.close(); }
Source:
public Sheet getDataSheet(File file) { stream = new PushbackInputStream(new FileInputStream(file)); Workbook wb = null; try { wb = WorkbookFactory.create(stream); } catch (Exception e) { Log.error("Workbook creation exception:" + e); } return wb.getSheetAt(0); }

Target:
public Sheet getDataSheet(File file) { Workbook wb = null; try { stream = new PushbackInputStream(new FileInputStream(file)); wb = WorkbookFactory.create(stream); } catch (Exception e) { log.error("Workbook creation exception:" + e); } return wb.getSheetAt(0); }
Source:
public void setPrice1(int price3) { if (price3 < 0 || price3 > 10000) { throw new IllegalArgumentException("Invalid price: " + price3); } if (true) { assert price3 > 1000; } }

Target:
public void setPrice1(int price3) { if (true) { assert price3 > 1000; } }
Source:
@Test public void slave() throws Exception { DumbSlave s = j.createOnlineSlave(); project.setAssignedLabel(s.getSelfLabel()); FilePath src = new FilePath(j.jenkins.getRootPath(), "jobs/junit/workspace/"); assertNotNull(src); FilePath dest = s.getWorkspaceFor(project); assertNotNull(dest); src.copyRecursiveTo("*.xml", dest); basic(); }

Target:
public void slave() throws Exception { DumbSlave s = j.createOnlineSlave(); project.setAssignedLabel(s.getSelfLabel()); FilePath src = new FilePath(j.jenkins.getRootPath(), "jobs/junit/workspace/"); assertNotNull(src); FilePath dest = s.getWorkspaceFor(project); assertNotNull(dest); src.copyRecursiveTo("*.xml", dest); basic(); }
Source:
private void setVmLeasesAvailability() { TModel model = getModel(); Version compVer = model.getSelectedCluster().getCompatibilityVersion(); if (model.getCustomCompatibilityVersion().getSelectedItem() != null) { compVer = model.getCustomCompatibilityVersion().getSelectedItem(); } model.getLease().setIsAvailable(AsyncDataProvider.getInstance().isVmLeasesFeatureSupported(compVer)); }

Target:
private void setVmLeasesAvailability() { TModel model = getModel(); Version compVer = model.getSelectedCluster().getCompatibilityVersion(); if (model.getCustomCompatibilityVersion().getSelectedItem() != null) { compVer = model.getCustomCompatibilityVersion().getSelectedItem(); } model.getLease().setIsChangeable( AsyncDataProvider.getInstance().isVmLeasesFeatureSupported(compVer), constants.vmLeasesSupported()); }
Source:
private void detectIndexChanges() { if (isBare()) { return; } File indexFile = getIndexFile(); synchronized (this) { if (snapshot == null) { snapshot = FileSnapshot.save(indexFile); } else if (snapshot.isModified(indexFile)) { notifyIndexChanged(false); } } }

Target:
private void detectIndexChanges() { if (isBare()) { return; } File indexFile = getIndexFile(); boolean notify = false; synchronized (this) { if (snapshot == null) { snapshot = FileSnapshot.save(indexFile); } else if (snapshot.isModified(indexFile)) { notify = true; } } if (notify) { notifyIndexChanged(false); } }
Source:
public void run() { LogUtils.registerLoggingContext(ss.getConf()); runner = Thread.currentThread(); try { SessionState.start(ss); runSequential(); } finally { try { Hive.closeCurrent(); } catch (Exception e) { LOG.warn("Exception closing Metastore connection:" + e.getMessage()); } runner = null; result.setRunning(false); } }

Target:
public void run() { LogUtils.registerLoggingContext(tsk.getConf()); runner = Thread.currentThread(); try { SessionState.start(ss); runSequential(); } finally { try { Hive.closeCurrent(); } catch (Exception e) { LOG.warn("Exception closing Metastore connection:" + e.getMessage()); } runner = null; result.setRunning(false); } }
Source:
public static String host() { String host = System.getenv("HOST"); return host == null ? currentHost() : host; }

Target:
public static String host() { String host = ObjectUtils.firstNonNull(System.getenv("HOST"), System.getenv("MESOS_HOSTNAME")); return host == null ? currentHost() : host; }
Source:
public String getTrace() { StringWriter stringWriter = new StringWriter(); PrintWriter writer = new PrintWriter(stringWriter); Throwable exc = getException(); exc.printStackTrace(writer); if (exc instanceof ExceptionWithThread) { ExceptionWithThread ewt = (ExceptionWithThread) exc; if (ewt.getDescription() == null) { writer.println("Stack for thread " + ewt.getThread().getName() + ":"); } else { writer.println(ewt.getDescription() + ":"); } StackTraceElement[] threadTrace = ewt.getThreadStackTrace(); for (StackTraceElement traceElement : threadTrace) { writer.println("\tat " + traceElement); } } StringBuffer buffer = stringWriter.getBuffer(); return buffer.toString(); }

Target:
public String getTrace() { StringWriter stringWriter = new StringWriter(); PrintWriter writer = new PrintWriter(stringWriter); getException().printStackTrace(writer); StringBuffer buffer = stringWriter.getBuffer(); return buffer.toString(); }
Source:
private static RealmAwareZkClient getHelixZkClient(String zkAddr) { if (Boolean.getBoolean(SystemPropertyKeys.MULTI_ZK_ENABLED)) { try { RealmAwareZkClient.RealmAwareZkConnectionConfig connectionConfig = new RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder().build(); RealmAwareZkClient.RealmAwareZkClientConfig clientConfig = new RealmAwareZkClient.RealmAwareZkClientConfig(); return new FederatedZkClient(connectionConfig, clientConfig); } catch (IllegalArgumentException | IOException | InvalidRoutingDataException e) { throw new HelixException("Not able to connect on realm-aware mode", e); } } else { if (zkAddr == null || zkAddr.isEmpty()) { throw new HelixException("ZK Address given is either null or empty!"); } HelixZkClient.ZkClientConfig clientConfig = new HelixZkClient.ZkClientConfig(); clientConfig.setZkSerializer(new ZNRecordSerializer()); return DedicatedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkAddr), clientConfig); } }

Target:
private static RealmAwareZkClient getHelixZkClient(String zkAddr) { if (Boolean.getBoolean(SystemPropertyKeys.MULTI_ZK_ENABLED)) { try { RealmAwareZkClient.RealmAwareZkConnectionConfig connectionConfig = new RealmAwareZkClient.RealmAwareZkConnectionConfig.Builder().build(); RealmAwareZkClient.RealmAwareZkClientConfig clientConfig = new RealmAwareZkClient.RealmAwareZkClientConfig(); return new FederatedZkClient(connectionConfig, clientConfig); } catch (IllegalArgumentException | IOException | InvalidRoutingDataException e) { throw new HelixException("Not able to connect on realm-aware mode", e); } } if (zkAddr == null || zkAddr.isEmpty()) { throw new HelixException("ZK Address given is either null or empty!"); } HelixZkClient.ZkClientConfig clientConfig = new HelixZkClient.ZkClientConfig(); clientConfig.setZkSerializer(new ZNRecordSerializer()); return DedicatedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(zkAddr), clientConfig); }
Source:
private static void run( ZestScript zs, Map<String, String> parameters, boolean debug, Integer timeoutInSeconds, boolean skipSSLCertificateCheck) { ZestBasicRunner zbr = (timeoutInSeconds == null) ? new ZestBasicRunner() : new ZestBasicRunner(timeoutInSeconds, skipSSLCertificateCheck); zbr.setOutputWriter(new OutputStreamWriter(System.out)); zbr.setStopOnAssertFail(false); zbr.setDebug(debug); try { zbr.run(zs, parameters); } catch (Exception e) { System.out.println("Error running script: " + e); e.printStackTrace(); } }

Target:
private static void run( ZestScript zs, Map<String, String> parameters, boolean debug, Integer timeoutInSeconds, boolean skipSSLCertificateCheck) { ZestBasicRunner zbr = new ZestBasicRunner(timeoutInSeconds, skipSSLCertificateCheck); zbr.setOutputWriter(new OutputStreamWriter(System.out)); zbr.setStopOnAssertFail(false); zbr.setDebug(debug); try { zbr.run(zs, parameters); } catch (Exception e) { System.out.println("Error running script: " + e); e.printStackTrace(); } }
Source:
public PagedFlux<BlobItem> listBlobsFlat(ListBlobsOptions options) { return new PagedFlux<>( () -> listBlobsFlatSegment(null, options) .map(response -> new PagedResponseBase<>( response.request(), response.statusCode(), response.headers(), response.value().segment().blobItems(), response.value().nextMarker(), response.deserializedHeaders() )), (marker) -> listBlobsFlatSegment(marker, options) .map(response -> new PagedResponseBase<>( response.request(), response.statusCode(), response.headers(), response.value().segment().blobItems(), response.value().nextMarker(), response.deserializedHeaders() )) ); }

Target:
public PagedFlux<BlobItem> listBlobsFlat(ListBlobsOptions options) { return listBlobsFlatWithOptionalTimeout(options, null); }
Source:
private void writeAssets(final XMLStreamWriter stream, final Resource assetFolder, final ResourceResolver resolver) throws XMLStreamException { for (Iterator<Resource> children = assetFolder.listChildren(); children.hasNext();) { Resource assetFolderChild = children.next(); if (assetFolderChild.isResourceType("dam:Asset")) { Asset asset = assetFolderChild.adaptTo(Asset.class); if (damAssetTypes.contains(asset.getMimeType())) { writeAsset(asset, stream, resolver); } } } }

Target:
private void writeAssets(final XMLStreamWriter stream, final Resource assetFolder, final ResourceResolver resolver) throws XMLStreamException { for (Iterator<Resource> children = assetFolder.listChildren(); children.hasNext();) { Resource assetFolderChild = children.next(); if (assetFolderChild.isResourceType("dam:Asset")) { Asset asset = assetFolderChild.adaptTo(Asset.class); if (damAssetTypes.contains(asset.getMimeType())) { writeAsset(asset, stream, resolver); } } else { writeAssets(stream, assetFolderChild, resolver); } } }
Source:
public JoinerType flip() { switch (this) { case LESS_THAN: return GREATER_THAN; case LESS_THAN_OR_EQUAL: return GREATER_THAN_OR_EQUAL; case GREATER_THAN: return LESS_THAN; case GREATER_THAN_OR_EQUAL: return LESS_THAN_OR_EQUAL; default: throw new IllegalStateException("The joinerType (" + this + ") is not supported."); } }

Target:
public JoinerType flip() { switch (this) { case LESS_THAN: return GREATER_THAN; case LESS_THAN_OR_EQUAL: return GREATER_THAN_OR_EQUAL; case GREATER_THAN: return LESS_THAN; case GREATER_THAN_OR_EQUAL: return LESS_THAN_OR_EQUAL; default: throw new IllegalStateException("The joinerType (" + this + ") cannot be flipped."); } }
Source:
public UploadPack create(HttpServletRequest req, Repository repo) throws ServiceNotEnabledException, ServiceNotAuthorizedException { final ProjectControl pc = getProjectControl(req); if (!pc.canPerformPackAction(uploadGroup)) { throw new ServiceNotAuthorizedException(); } UploadPack up = new UploadPack(repo); if (!pc.allRefsAreVisible()) { up.setRefFilter(new VisibleRefFilter(repo, pc, db.get())); } return up; }

Target:
public UploadPack create(HttpServletRequest req, Repository repo) throws ServiceNotEnabledException, ServiceNotAuthorizedException { ProjectControl pc = getProjectControl(req); if (!pc.canRunUploadPack()) { throw new ServiceNotAuthorizedException(); } UploadPack up = new UploadPack(repo); up.setPackConfig(packConfig); if (!pc.allRefsAreVisible()) { up.setRefFilter(new VisibleRefFilter(repo, pc, db.get())); } return up; }
Source:
public HelixDataAccessorWrapper(ZKHelixDataAccessor dataAccessor) { super(dataAccessor); _restClient = CustomRestClientFactory.get(); }

Target:
public HelixDataAccessorWrapper(ZKHelixDataAccessor dataAccessor) { this(dataAccessor, CustomRestClientFactory.get(), HelixRestNamespace.DEFAULT_NAMESPACE_NAME); }
Source:
private static void fillSwaggerAuthentication(Definition definition, Swagger swagger) { Map<String, SecuritySchemeDefinition> securitySchemes = new HashMap<>(); String httpBasic = ChallengeScheme.HTTP_BASIC.getName(); for (Endpoint endpoint : definition.getEndpoints()) { if (httpBasic.equals(endpoint.getAuthenticationProtocol())) { securitySchemes.put(httpBasic, new BasicAuthDefinition()); } } swagger.setSecurityDefinitions(securitySchemes.isEmpty() ? null : securitySchemes); }

Target:
private static void fillSwaggerAuthentication(Definition definition, Swagger swagger) { Map<String, SecuritySchemeDefinition> securitySchemes = new LinkedHashMap<>(); String httpBasic = ChallengeScheme.HTTP_BASIC.getName(); for (Endpoint endpoint : definition.getEndpoints()) { if (httpBasic.equals(endpoint.getAuthenticationProtocol())) { securitySchemes.put(httpBasic, new BasicAuthDefinition()); } } swagger.setSecurityDefinitions(securitySchemes.isEmpty() ? null : securitySchemes); }
Source:
static String transformXmlByXslt(URI xmlFile, URI xslFile) throws TransformerException, IOException { FileManagementInterface fileManagementModule = new KitodoServiceLoader<FileManagementInterface>( FileManagementInterface.class).loadModule(); StreamSource source = new StreamSource(fileManagementModule.getFile(xmlFile).toURI().toString()); StreamSource styleSource = new StreamSource(xslFile.getPath()); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(styleSource); try (StringWriter stringWriter = new StringWriter()) { StreamResult result = new StreamResult(stringWriter); transformer.transform(source, result); return stringWriter.toString(); } }

Target:
static String transformXmlByXslt(URI xmlFile, URI xslFile) throws TransformerException, IOException { FileManagementInterface fileManagementModule = new KitodoServiceLoader<FileManagementInterface>( FileManagementInterface.class).loadModule(); TransformerFactory factory = TransformerFactory.newInstance(); StreamSource styleSource = new StreamSource(xslFile.getPath()); Transformer transformer = factory.newTransformer(styleSource); try (InputStream inputStream = fileManagementModule.read(xmlFile); StringWriter stringWriter = new StringWriter()) { StreamSource source = new StreamSource(inputStream); StreamResult result = new StreamResult(stringWriter); transformer.transform(source, result); return stringWriter.toString(); } }
Source:
private void assertJtsEnvelope(String wkt, Envelope expected) { OGCGeometry geometry = OGCGeometry.fromText(wkt); Envelope calculated = GeometryUtils.getJtsEnvelope(geometry); assertEquals(calculated, expected); }

Target:
private void assertJtsEnvelope(String wkt, Envelope expected) { Envelope calculated = GeometryUtils.getJtsEnvelope(OGCGeometry.fromText(wkt)); assertEquals(calculated, expected); }
Source:
public SolenoidExtend(SolenoidSubsystem system, BooleanSupplier... booleanSuppliers) { super("Extending " + system.getName(), system, SolenoidState.EXTEND, booleanSuppliers); }

Target:
public SolenoidExtend(SolenoidSubsystem system, BooleanSupplier... booleanSuppliers) { this("Extending " + system.getName(), system, booleanSuppliers); }
Source:
public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == ApplicationConstants.RequestCodes.IMAGE_REQUEST) { if (resultCode == Activity.RESULT_OK) { Uri sourceUri = Uri.fromFile(output); openCropActivity(sourceUri, sourceUri); } else { output = null; } } else if (requestCode == ApplicationConstants.RequestCodes.GALLERY_IMAGE_REQUEST) { if (resultCode == Activity.RESULT_OK) { Uri sourceUri = data.getData(); File dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM); output = new File(dir, getUniqueImageFileName()); Uri destinationUri = Uri.fromFile(output); openCropActivity(sourceUri, destinationUri); } } else if (requestCode == UCrop.REQUEST_CROP) { if (resultCode == Activity.RESULT_OK) { patientPhoto = getResizedPortraitImage(output.getPath()); Bitmap bitmap = ThumbnailUtils.extractThumbnail(patientPhoto, patientImageView.getWidth(), patientImageView.getHeight()); patientImageView.setImageBitmap(bitmap); patientImageView.invalidate(); } else { output = null; } } else if (requestCode == UCrop.RESULT_ERROR) { ToastUtil.error(String.valueOf(UCrop.getError(data))); } }

Target:
public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == ApplicationConstants.RequestCodes.IMAGE_REQUEST) { if (resultCode == Activity.RESULT_OK) { Uri sourceUri = Uri.fromFile(output); openCropActivity(sourceUri, sourceUri); } else { output = null; } } else if (requestCode == ApplicationConstants.RequestCodes.GALLERY_IMAGE_REQUEST) { if(resultCode == Activity.RESULT_OK) { Uri sourceUri = data.getData(); File dir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DCIM); output = new File(dir, getUniqueImageFileName()); Uri destinationUri = Uri.fromFile(output); openCropActivity(sourceUri, destinationUri); } else { output= null; } } else if (requestCode == UCrop.REQUEST_CROP) { if (resultCode == Activity.RESULT_OK) { patientPhoto = getResizedPortraitImage(output.getPath()); Bitmap bitmap = ThumbnailUtils.extractThumbnail(patientPhoto, binding.patientPhoto.getWidth(), binding.patientPhoto.getHeight()); binding.patientPhoto.setImageBitmap(bitmap); binding.patientPhoto.invalidate(); } else { output = null; } } else if (requestCode == UCrop.RESULT_ERROR) { ToastUtil.error(String.valueOf(UCrop.getError(data))); } }
Source:
public static org.ovirt.engine.core.common.businessentities.VmPool map(VmPool model, org.ovirt.engine.core.common.businessentities.VmPool template) { org.ovirt.engine.core.common.businessentities.VmPool entity = template != null ? template : new org.ovirt.engine.core.common.businessentities.VmPool(); if (model.isSetId()) { entity.setVmPoolId(GuidUtils.asGuid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetDescription()) { entity.setVmPoolDescription(model.getDescription()); } if (model.isSetComment()) { entity.setComment(model.getComment()); } if (model.isSetSize()) { entity.setAssignedVmsCount(model.getSize()); } if (model.isSetCluster()) { if (model.getCluster().isSetId()) { entity.setClusterId(GuidUtils.asGuid(model.getCluster().getId())); } else if (model.getCluster().isSetName()) { entity.setClusterName(model.getCluster().getName()); } } if (model.isSetPrestartedVms()) { entity.setPrestartedVms(model.getPrestartedVms()); } if (model.isSetMaxUserVms()) { entity.setMaxAssignedVmsPerUser(model.getMaxUserVms()); } if (model.isSetDisplay() && model.getDisplay().isSetProxy()) { entity.setSpiceProxy("".equals(model.getDisplay().getProxy()) ? null : model.getDisplay().getProxy()); } if (model.isSetType()) { entity.setVmPoolType(map(model.getType(), null)); } if (model.isSetStateful()) { entity.setStateful(model.isStateful()); } if (model.isAutoStorageSelect()) { entity.setAutoStorageSelect(model.isAutoStorageSelect()); } return entity; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmPool map(VmPool model, org.ovirt.engine.core.common.businessentities.VmPool template) { org.ovirt.engine.core.common.businessentities.VmPool entity = template != null ? template : new org.ovirt.engine.core.common.businessentities.VmPool(); if (model.isSetId()) { entity.setVmPoolId(GuidUtils.asGuid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetDescription()) { entity.setVmPoolDescription(model.getDescription()); } if (model.isSetComment()) { entity.setComment(model.getComment()); } if (model.isSetSize()) { entity.setAssignedVmsCount(model.getSize()); } if (model.isSetCluster()) { if (model.getCluster().isSetId()) { entity.setClusterId(GuidUtils.asGuid(model.getCluster().getId())); } else if (model.getCluster().isSetName()) { entity.setClusterName(model.getCluster().getName()); } } if (model.isSetPrestartedVms()) { entity.setPrestartedVms(model.getPrestartedVms()); } if (model.isSetMaxUserVms()) { entity.setMaxAssignedVmsPerUser(model.getMaxUserVms()); } if (model.isSetDisplay() && model.getDisplay().isSetProxy()) { entity.setSpiceProxy("".equals(model.getDisplay().getProxy()) ? null : model.getDisplay().getProxy()); } if (model.isSetType()) { entity.setVmPoolType(map(model.getType(), null)); } if (model.isSetStateful()) { entity.setStateful(model.isStateful()); } if (model.isSetAutoStorageSelect()) { entity.setAutoStorageSelect(model.isAutoStorageSelect()); } return entity; }
Source:
private void kill(String cluster, String jobId, String rangeType, String scope) throws FalconException { try { OozieClientFactory.get(cluster).kill(jobId, rangeType, scope); assertStatus(cluster, jobId, Status.KILLED, Status.SUCCEEDED, Status.FAILED); LOG.info("Killed job for instances on cluster {}", jobId, scope, cluster); } catch (OozieClientException e) { throw new FalconException(e); } }

Target:
private void kill(String cluster, String jobId, String rangeType, String scope) throws FalconException { try { OozieClientFactory.get(cluster).kill(jobId, rangeType, scope); LOG.info("Killed job for instances on cluster {}", jobId, scope, cluster); } catch (OozieClientException e) { throw new FalconException(e); } }