auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void handleValue(ObjectInput in) throws IOException { try { Type[] returnType = RpcUtils.getReturnTypes(invocation); <START> setValue(returnType == null || returnType.length == 0 ? in.readObject() : <END> (returnType.length == 1 ? in.readObject((Class<?>) returnType[0]) : in.readObject((Class<?>) returnType[0], returnType[1]))); } catch (ClassNotFoundException e) { rethrow(e); } }</code><technical_language>refactore a method setValue(getInvocationReturnType(returnTypes,in)); private Object getInvocationReturnType(Type[] returnType,ObjectInput in) { if(returnType == null || returnType.length == 0) { return in.readObject(); } if( returnType.length ==1 ) { return in.readObject((Class<?>) returnType[0]; } return in.readObject((Class<?>) returnType[0], returnType[1]); } do say? this code I done editor some braces syntactical error plz excuse for that</technical_language>

Target:
private void handleValue(ObjectInput in) throws IOException { try { Type[] returnTypes = RpcUtils.getReturnTypes(invocation); Object value = null; if (ArrayUtils.isEmpty(returnTypes)) { value = in.readObject(); } else if (returnTypes.length == 1) { value = in.readObject((Class<?>) returnTypes[0]); } else { value = in.readObject((Class<?>) returnTypes[0], returnTypes[1]); } setValue(value); } catch (ClassNotFoundException e) { rethrow(e); } }
Source:
<code>private void testResultForAbortedParentProcessAndChildProcessInProcessInstanceList(Long parentProcessInstanceId){ Collection<ProcessInstanceDesc> instances = runtimeDataService.getProcessInstancesByParent(parentProcessInstanceId, Arrays.asList(ProcessInstance.STATE_ACTIVE), new QueryContext()); assertNotNull(instances); assertEquals(2, instances.size()); List<Long> processInstanceList = instances.stream().map(p -> p.getId()).collect(Collectors.toList()); processInstanceList.add(0, parentProcessInstanceId); processService.abortProcessInstances(processInstanceList); <START> processService.abortProcessInstances(processInstanceList); <END> ProcessInstance parent = processService.getProcessInstance(parentProcessInstanceId); assertNull(parent); instances = runtimeDataService.getProcessInstancesByParent(parentProcessInstanceId, Arrays.asList(ProcessInstance.STATE_ABORTED), new QueryContext()); assertNotNull(instances); assertEquals(2, instances.size()); }</code><technical_language>abort twice</technical_language>

Target:
private void testResultForAbortedParentProcessAndChildProcessInProcessInstanceList(Long parentProcessInstanceId){ Collection<ProcessInstanceDesc> instances = runtimeDataService.getProcessInstancesByParent(parentProcessInstanceId, Arrays.asList(ProcessInstance.STATE_ACTIVE), new QueryContext()); assertNotNull(instances); assertEquals(2, instances.size()); List<Long> processInstanceList = instances.stream().map(p -> p.getId()).collect(Collectors.toList()); processInstanceList.add(0, parentProcessInstanceId); processService.abortProcessInstances(processInstanceList); ProcessInstance parent = processService.getProcessInstance(parentProcessInstanceId); assertNull(parent); instances = runtimeDataService.getProcessInstancesByParent(parentProcessInstanceId, Arrays.asList(ProcessInstance.STATE_ABORTED), new QueryContext()); assertNotNull(instances); assertEquals(2, instances.size()); }
Source:
<code>public void testModelSerialization() throws IOException { <START> Map<String, String> trainParams = new HashMap<String, String>(); <END> trainParams.put(AbstractTrainer.ALGORITHM_PARAM, PerceptronTrainer.PERCEPTRON_VALUE); trainParams.put(AbstractTrainer.CUTOFF_PARAM, Integer.toString(1)); trainParams.put("UseSkippedAveraging", Boolean.toString(true)); EventTrainer trainer = TrainerFactory.getEventTrainer(trainParams, null); AbstractModel model = (AbstractModel) trainer.train(createTrainingStream()); testModel(model, 0.773706362961129); ByteArrayOutputStream modelBytes = new ByteArrayOutputStream(); BinaryPerceptronModelWriter writer = new BinaryPerceptronModelWriter(model, new DataOutputStream(modelBytes)); writer.persist(); writer.close(); MaxentModel restoredModelA = new BinaryPerceptronModelReader( new DataInputStream(new ByteArrayInputStream(modelBytes.toByteArray()))).getModel(); testModel(restoredModelA, 0.773706362961129); MaxentModel restoredModelB = new BinaryPerceptronModelReader( new DataInputStream(new ByteArrayInputStream(modelBytes.toByteArray()))).getModel(); Assert.assertEquals(restoredModelA, restoredModelB); }</code><technical_language>need of type RHS</technical_language>

Target:
public void testModelSerialization() throws IOException { Map<String, String> trainParams = new HashMap<>(); trainParams.put(AbstractTrainer.ALGORITHM_PARAM, PerceptronTrainer.PERCEPTRON_VALUE); trainParams.put(AbstractTrainer.CUTOFF_PARAM, Integer.toString(1)); trainParams.put("UseSkippedAveraging", Boolean.toString(true)); EventTrainer trainer = TrainerFactory.getEventTrainer(trainParams, null); AbstractModel model = (AbstractModel) trainer.train(createTrainingStream()); testModel(model, 0.773706362961129); ByteArrayOutputStream modelBytes = new ByteArrayOutputStream(); BinaryPerceptronModelWriter writer = new BinaryPerceptronModelWriter(model, new DataOutputStream(modelBytes)); writer.persist(); writer.close(); MaxentModel restoredModel = new BinaryPerceptronModelReader( new DataInputStream(new ByteArrayInputStream(modelBytes.toByteArray()))).getModel(); testModel(restoredModel, 0.773706362961129); }
Source:
<code><START> protected ScheduledExecutorService createDefaultRetryExecutor() { <END> return Executors.newScheduledThreadPool( RETRY_THREAD_COUNT, new ThreadFactoryBuilder() .setDaemon(true) .setNameFormat(RETRY_THREADPOOL_NAME + "-%d") .build()); }</code><technical_language>changed static non-static</technical_language>

Target:
protected static ScheduledExecutorService createDefaultRetryExecutor() { return Executors.newScheduledThreadPool( RETRY_THREAD_COUNT, new ThreadFactoryBuilder() .setDaemon(true) .setNameFormat(RETRY_THREADPOOL_NAME + "-%d") .build()); }
Source:
<code>public Iterator<ITimeEvent> getTimeEventsIterator(long startTime, long stopTime, long visibleDuration) { <START> return new EventIterator(fEventList, fZoomedEventList, startTime, stopTime); <END> }</code><technical_language>return null if hasTimeEvents() is false</technical_language>

Target:
public Iterator<ITimeEvent> getTimeEventsIterator(long startTime, long stopTime, long visibleDuration) { if (!hasTimeEvents()) { return null; } return new EventIterator(fEventList, fZoomedEventList, startTime, stopTime); }
Source:
<code>public void setupRoutes() { path(controllerBasePath(), () -> { before("", mimeType, this::setContentType); <START> before("/*", mimeType, this::setContentType); <END> before("", mimeType, this.apiAuthenticationHelper::checkAdminUserOrGroupAdminUserAnd403); get("", mimeType, this::index); post("", mimeType, this::createOrUpdate); put("", mimeType, this::createOrUpdate); exception(RuntimeException.class, (RuntimeException exception, Request request, Response response) -> { response.status(HttpStatus.UNPROCESSABLE_ENTITY.value()); response.body(MessageJson.create(exception.getMessage())); }); }); }</code><technical_language>redundant</technical_language>

Target:
public void setupRoutes() { path(controllerBasePath(), () -> { before("", mimeType, this::setContentType); before("", mimeType, this.apiAuthenticationHelper::checkAdminUserOrGroupAdminUserAnd403); get("", mimeType, this::index); post("", mimeType, this::createOrUpdate); put("", mimeType, this::createOrUpdate); exception(RuntimeException.class, (RuntimeException exception, Request request, Response response) -> { response.status(HttpStatus.UNPROCESSABLE_ENTITY.value()); response.body(MessageJson.create(exception.getMessage())); }); }); }
Source:
<code>private void _setupUI() { removeAllComponents(); QLBuilder proQB=_facultyMemberDao.getAllFacultyQB(); proQB.appendCriteria("id", PropertyConstraint.Operator.eq,_id); List<FacultyMemberProfile> facultyMemberProfileList=proQB.getQueryResolver().list(); <START> Container con=new FacultyMemberEditorUI(facultyMemberProfileList.get(0),false); <END> PushButton backBtn = new PushButton(); backBtn.setLabel(TextSources.create("BACK")); backBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ev) { Response response = Event.getResponse(); response.redirect(response.createURL(_contentBuilder.getListFacultyPage())); } }); add(backBtn); add(con); }</code><technical_language>visits page this component is id is invalid</technical_language>

Target:
private void _setupUI() { removeAllComponents(); QLBuilder proQB=_facultyMemberDao.getAllFacultyQB(); proQB.appendCriteria("slug", PropertyConstraint.Operator.eq,_slug); List<FacultyMemberProfile> facultyMemberProfileList=proQB.getQueryResolver().list(); Container con=new FacultyMemberViewerUI(facultyMemberProfileList.get(0)); PushButton backBtn = new PushButton(); backBtn.setLabel(TextSources.create("BACK")); backBtn.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ev) { Response response = Event.getResponse(); response.redirect(response.createURL(_contentBuilder.getListFacultyPage())); } }); add(backBtn); add(con); }
Source:
<code>private TaskContext prepareContext() { <START> TaskContext context = new TaskContext(); <END> if (parameters != null) context.parameters(parameters); if (cache != null) context.cache(cache); Marshaller marshaller = componentRegistry.getComponent(Marshaller.class); if (marshaller != null) context.marshaller(marshaller); return context; }</code><technical_language>Optional.ofNullable(...).ifPresent(...) flatMap constructs here</technical_language>

Target:
private TaskContext prepareContext() { TaskContext context = new TaskContext(); if (parameters.isPresent()) context.parameters(parameters.get()); if (cache != null) context.cache(cache); if (marshaller != null) context.marshaller(marshaller); return context; }
Source:
<code>public Status insert(String table, String key, Map<String, ByteIterator> values) { try { final XContentBuilder doc = jsonBuilder(); doc.startObject(); for (final Entry<String, String> entry : StringByteIterator.getStringMap(values).entrySet()) { doc.field(entry.getKey(), entry.getValue()); } doc.field(KEY, key); doc.endObject(); final IndexResponse indexResponse = client.prepareIndex(indexKey, table).setSource(doc).get(); if (indexResponse.getResult() != DocWriteResponse.Result.CREATED) { return Status.ERROR; } if (!isRefreshNeeded) { synchronized (this) { isRefreshNeeded = true; } } return Status.OK; } catch (final Exception e) { <START> e.printStackTrace(); <END> return Status.ERROR; } }</code><technical_language>Exception#printStackTrace stderr default</technical_language>

Target:
public Status insert(String table, String key, Map<String, ByteIterator> values) { try (XContentBuilder doc = jsonBuilder()) { doc.startObject(); for (final Entry<String, String> entry : StringByteIterator.getStringMap(values).entrySet()) { doc.field(entry.getKey(), entry.getValue()); } doc.field(KEY, key); doc.endObject(); final IndexResponse indexResponse = client.prepareIndex(indexKey, table).setSource(doc).get(); if (indexResponse.getResult() != DocWriteResponse.Result.CREATED) { return Status.ERROR; } if (!isRefreshNeeded) { synchronized (this) { isRefreshNeeded = true; } } return Status.OK; } catch (final Exception e) { e.printStackTrace(); return Status.ERROR; } }
Source:
<code>public RestartVdsReturnValue getReturnValue() { <START> return (RestartVdsReturnValue)(super.getReturnValue()); <END> }</code><technical_language>Please remove unnecessary brackets: return (RestartVdsReturnValue) super.getReturnValue();</technical_language>

Target:
public RestartVdsReturnValue getReturnValue() { return (RestartVdsReturnValue) super.getReturnValue(); }
Source:
<code>public void visitIfStatement(IfStatementTree tree) { ExpressionTree condition = tree.condition().expression(); if (condition.is(Kind.BOOLEAN_LITERAL)) { <START> context().newIssue(this.KEY, MESSAGE).tree(condition); <END> } super.visitIfStatement(tree); }</code><technical_language>![MAJOR](<LINK_0> Change this instance-reference a static reference. [![rule](<LINK_2>](<LINK_1></technical_language>

Target:
public void visitIfStatement(IfStatementTree tree) { ExpressionTree condition = tree.condition().expression(); if (condition.is(Kind.BOOLEAN_LITERAL)) { context().newIssue(KEY, MESSAGE).tree(condition); } super.visitIfStatement(tree); }
Source:
<code>public void enableAccelerometer(byte[] config) { BluetoothLeGattCharacteristic accEnableChar; if (this.cc2650) { try { accEnableChar = this.gattServices.get(MOVEMENT) .findCharacteristic(TiSensorTagGatt.UUID_MOV_SENSOR_ENABLE); <START> byte[] oldConfig = accEnableChar.readValue(); <END> Integer newConfig = ByteBuffer.wrap(config).getShort() | ByteBuffer.wrap(oldConfig).getShort(); ByteBuffer bb = ByteBuffer.allocate(2); bb.putShort(newConfig.shortValue()); accEnableChar.writeValue(bb.array()); } catch (KuraException e) { logger.error(MOV_ERROR_MESSAGE, e); } } else { try { accEnableChar = this.gattServices.get(ACCELEROMETER) .findCharacteristic(TiSensorTagGatt.UUID_ACC_SENSOR_ENABLE); accEnableChar.writeValue(config); } catch (KuraException e) { logger.error("Accelerometer enable failed", e); } } }</code><technical_language>this code extracted a separate method, reduce code duplication</technical_language>

Target:
public void enableAccelerometer(byte[] config) { BluetoothLeGattCharacteristic enableChar; if (this.cc2650) { try { enableChar = this.gattServices.get(MOVEMENT).findCharacteristic(TiSensorTagGatt.UUID_MOV_SENSOR_ENABLE); writeOnCharacteristic(config, enableChar); } catch (KuraException e) { logger.error(MOV_ERROR_MESSAGE, e); } } else { try { enableChar = this.gattServices.get(ACCELEROMETER) .findCharacteristic(TiSensorTagGatt.UUID_ACC_SENSOR_ENABLE); enableChar.writeValue(config); } catch (KuraException e) { logger.error("Accelerometer enable failed", e); } } }
Source:
<code>protected void startProcess(Feed inputFeed, Feed outputFeed, <START> String engineType, String scriptPath) throws FalconException { <END> LOG.info("submitting input feed: {}", inputFeed.getName()); jobManager.submitJob(EntityType.FEED.name(), inputFeed.getEntityxml()); LOG.info("submitting output feed: {}", outputFeed.getName()); jobManager.submitJob(EntityType.FEED.name(), outputFeed.getEntityxml()); String processRequest = new Process.Builder().withProcessName(jobEntityName()).withFrequency(frequency) .withStartTime(startTime).withEndTime(endTime).withClusterName(getClusterNameToRunProcessOn()) .withInputFeedName(inputFeed.getName()).withOutputFeedName(outputFeed.getName()) .withEngineType(engineType).withWFPath(scriptPath).withAclOwner(proxyUser) .build().getEntityxml(); LOG.info("submitting/scheduling process: {}", processRequest); submitAndScheduleJob(EntityType.PROCESS.name(), processRequest); LOG.info("submitted and scheduled process: {}", jobEntityName()); }</code><technical_language>JobType passed logged accordingly</technical_language>

Target:
protected void startProcess(Feed inputFeed, Feed outputFeed, String engineType, String scriptPath) throws FalconException { LOG.info("submitting input feed for process", inputFeed.getName(), engineType); jobManager.submitJob(EntityType.FEED.name(), inputFeed.getEntityxml()); LOG.info("submitting output feed for process", outputFeed.getName(), engineType); jobManager.submitJob(EntityType.FEED.name(), outputFeed.getEntityxml()); String processRequest = new Process.Builder().withProcessName(jobEntityName()).withFrequency(frequency) .withStartTime(startTime).withEndTime(endTime).withClusterName(getClusterNameToRunProcessOn()) .withInputFeedName(inputFeed.getName()).withOutputFeedName(outputFeed.getName()) .withEngineType(engineType).withWFPath(scriptPath).withAclOwner(proxyUser) .build().getEntityxml(); LOG.info("submitting/scheduling process: {}", engineType, processRequest); submitAndScheduleJob(EntityType.PROCESS.name(), processRequest); LOG.info("submitted and scheduled process: {}", engineType, jobEntityName()); }
Source:
<code>static void attach(Log log) { <START> on(ExportProgressEvent.class, (ExportProgressEvent event) -> { <END> if (event.getText().contains("Cause:")) { log.warn(event.getText()); System.err.println(event.getText()); } else { log.info(event.getText()); System.out.println(event.getText()); } }); on(ExportSucceededEvent.class, (ExportSucceededEvent event) -> { log.info("Succeeded."); System.out.println("Succeeded."); }); on(TransferSucceededEvent.class, (TransferSucceededEvent event) -> { log.info("Transfer Succeeded"); System.out.println("Transfer Succeeded"); }); on(FormStatusEvent.class, (FormStatusEvent fse) -> { log.info(fse.getStatusString()); System.out.println(fse.getStatusString()); }); on(StartPullEvent.class, (StartPullEvent event) -> { log.info("Start pull form " + event.form.getFormName()); System.out.println("Start pull form " + event.form.getFormName()); }); }</code><technical_language>type inferred these, for easier reading? on(ExportProgressEvent.class, event -> {</technical_language>

Target:
static void attach(Log log) { on(ExportProgressEvent.class, event -> { if (event.getText().contains("Cause:")) { log.warn(event.getText()); System.err.println(event.getText()); } else { log.info(event.getText()); System.out.println(event.getText()); } }); on(ExportSucceededEvent.class, event -> { log.info("Succeeded."); System.out.println("Succeeded."); }); on(TransferSucceededEvent.class, event -> { log.info("Transfer Succeeded"); System.out.println("Transfer Succeeded"); }); on(FormStatusEvent.class, fse -> { log.info(fse.getStatusString()); System.out.println(fse.getStatusString()); }); on(StartPullEvent.class, event -> { log.info("Start pull form " + event.form.getFormName()); System.out.println("Start pull form " + event.form.getFormName()); }); }
Source:
<code>public static Object getFieldValue(Object svc, String fieldName) { Object result = null; try { Field field = getField(svc, fieldName); field.setAccessible(true); result = field.get(svc); <START> } catch (IllegalArgumentException e) { <END> logger.warn(e.getMessage(), e); } catch (IllegalAccessException e) { logger.warn(e.getMessage(), e); } catch (NoSuchFieldException e) { logger.warn(e.getMessage(), e); } return result; }</code><technical_language>null a valid for field get null if some exception happens. I handle exceptions all</technical_language>

Target:
public static Object getFieldValue(Object svc, String fieldName) throws NoSuchFieldException { Object result = null; Field field = getField(svc, fieldName); try { field.setAccessible(true); result = field.get(svc); } catch (IllegalArgumentException e) { logger.warn(e.getMessage(), e); } catch (IllegalAccessException e) { logger.warn(e.getMessage(), e); } return result; }
Source:
<code>static GatewayServer startGatewayServer() throws ExecutionException, InterruptedException { <START> CompletableFuture<GatewayServer> gatewayServer = new CompletableFuture<>(); <END> Thread thread = new Thread(() -> { int freePort; try { freePort = findFreePort(); } catch (IOException e) { throw new RuntimeException("Could not find a free port for Py4jCallbackClient."); } GatewayServer server = new GatewayServer.GatewayServerBuilder() .gateway(new Gateway(new ConcurrentHashMap<String, Object>(), new CallbackClient(freePort))) .javaPort(0) .build(); gatewayServer.complete(server); server.start(true); }); thread.setName("py4j-gateway"); thread.setDaemon(true); thread.start(); thread.join(); return gatewayServer.get(); }</code><technical_language>Rename gatewayServerFuture</technical_language>

Target:
static GatewayServer startGatewayServer() throws ExecutionException, InterruptedException { CompletableFuture<GatewayServer> gatewayServerFuture = new CompletableFuture<>(); Thread thread = new Thread(() -> { try { int freePort = NetUtils.getAvailablePort(); GatewayServer server = new GatewayServer.GatewayServerBuilder() .gateway(new Gateway(new ConcurrentHashMap<String, Object>(), new CallbackClient(freePort))) .javaPort(0) .build(); CallbackClient callbackClient = (CallbackClient) server.getCallbackClient(); Field executor = CallbackClient.class.getDeclaredField("executor"); executor.setAccessible(true); ((ScheduledExecutorService) executor.get(callbackClient)).shutdown(); executor.set(callbackClient, Executors.newScheduledThreadPool(1, Thread::new)); Method setupCleaner = CallbackClient.class.getDeclaredMethod("setupCleaner"); setupCleaner.setAccessible(true); setupCleaner.invoke(callbackClient); gatewayServerFuture.complete(server); server.start(true); } catch (Throwable e) { gatewayServerFuture.completeExceptionally(e); } }); thread.setName("py4j-gateway"); thread.setDaemon(true); thread.start(); thread.join(); return gatewayServerFuture.get(); }
Source:
<code><START> public Meetup(int monthOfYear, int year) { <END> startOfMonth = LocalDate.of(year, monthOfYear, 1); }</code><technical_language>This package private :)</technical_language>

Target:
Meetup(int monthOfYear, int year) { startOfMonth = LocalDate.of(year, monthOfYear, 1); }
Source:
<code>private <T> T _to(String tailApiUrl, Class<T> type, T instance) throws IOException { int retries = 5; while (true) { try { return __to(tailApiUrl, type, instance); <START> } catch (IOException e) { <END> retries--; if (retries == 0) { throw e; } else { LOGGER.log(Level.INFO, "Sleeping before retrying... (" + retries + ")"); try { Thread.sleep(5000); } catch (InterruptedException _) { throw (IOException)new InterruptedIOException().initCause(e); } } } } }</code><technical_language>this limited SocketTimeoutException, in original</technical_language>

Target:
private <T> T _to(String tailApiUrl, Class<T> type, T instance) throws IOException { if (!isMethodWithBody() && !args.isEmpty()) { boolean questionMarkFound = tailApiUrl.indexOf('?') != -1; tailApiUrl += questionMarkFound ? '&' : '?'; for (Iterator<Entry> it = args.listIterator(); it.hasNext();) { Entry arg = it.next(); tailApiUrl += arg.key + '=' + URLEncoder.encode(arg.value.toString(),"UTF-8"); if (it.hasNext()) { tailApiUrl += '&'; } } } while (true) { setupConnection(root.getApiURL(tailApiUrl)); buildRequest(); try { T result = parse(type, instance); if (type != null && type.isArray()) { final String links = uc.getHeaderField("link"); if (links != null && links.contains("rel=\"next\"")) { Pattern nextLinkPattern = Pattern.compile(".*<(.*)>; rel=\"next\""); Matcher nextLinkMatcher = nextLinkPattern.matcher(links); if (nextLinkMatcher.find()) { final String link = nextLinkMatcher.group(1); T nextResult = _to(link, type, instance); setResponseHeaders(nextResult); final int resultLength = Array.getLength(result); final int nextResultLength = Array.getLength(nextResult); T concatResult = (T) Array.newInstance(type.getComponentType(), resultLength + nextResultLength); System.arraycopy(result, 0, concatResult, 0, resultLength); System.arraycopy(nextResult, 0, concatResult, resultLength, nextResultLength); result = concatResult; } } } return setResponseHeaders(result); } catch (IOException e) { handleApiError(e); } finally { noteRateLimit(tailApiUrl); } } }
Source:
<code>public final boolean equals(Object o) { if (this == o) { return true; } <START> if (!(o instanceof TableDataSource) || !getClass().equals(o.getClass())) { <END> return false; } TableDataSource that = (TableDataSource) o; if (!name.equals(that.name)) { return false; } return true; }</code><technical_language>This change is causing SegmentMetadataQueryTest.testSerde() fail: <LINK_0> query variable a LegacyDataSource deserialized serialized version a TableDataSource</technical_language>

Target:
public final boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof TableDataSource)) { return false; } if ((o instanceof GlobalTableDataSource || this instanceof GlobalTableDataSource) && !getClass().equals(o.getClass())) { return false; } TableDataSource that = (TableDataSource) o; if (!name.equals(that.name)) { return false; } return true; }
Source:
<code>public Args(String arg) throws BadFencingConfigurationException { try { <START> user = UserGroupInformation.getCurrentUser().getShortUserName(); <END> } catch(IOException ex) { LOG.warn("Unable to get user name. Fall back to system property " + "user.name", ex); user = System.getProperty("user.name"); } sshPort = DEFAULT_SSH_PORT; if (arg != null && !arg.isEmpty()) { Matcher m = USER_PORT_RE.matcher(arg); if (!m.matches()) { throw new BadFencingConfigurationException( "Unable to parse user and SSH port: "+ arg); } if (m.group(1) != null) { user = m.group(1); } if (m.group(2) != null) { sshPort = parseConfiggedPort(m.group(2)); } } }</code><technical_language>this part of change. ssh fencer is logging in a unix user, unix username is more important kerberos username for daemon</technical_language>

Target:
public Args(String arg) throws BadFencingConfigurationException { user = System.getProperty("user.name"); sshPort = DEFAULT_SSH_PORT; if (arg != null && !arg.isEmpty()) { Matcher m = USER_PORT_RE.matcher(arg); if (!m.matches()) { throw new BadFencingConfigurationException( "Unable to parse user and SSH port: "+ arg); } if (m.group(1) != null) { user = m.group(1); } if (m.group(2) != null) { sshPort = parseConfiggedPort(m.group(2)); } } }
Source:
<code><START> private static NioClient createClient( Peer peer, int port, int connectionTimeout ) throws IOException { <END> InetSocketAddress serverAddress = new InetSocketAddress(InetAddress.getLocalHost(), port); NioClient client = new NioClient(serverAddress, peer, connectionTimeout); return client; }</code><technical_language>follow convention, formatting be: java private static NioClient createClient(Peer peer, int port, int connectionTimeout) throws IOException {</technical_language>

Target:
private static NioClient createClient(Peer peer, int port, int connectionTimeout) throws IOException { InetSocketAddress serverAddress = new InetSocketAddress(InetAddress.getLocalHost(), port); return new NioClient(serverAddress, peer, connectionTimeout); }
Source:
<code>public Object execute(ExecutionEvent event) throws ExecutionException { TransactionalEditingDomain editingDomain = getTableEditingDomain(); Table table = getTable(); if (null != editingDomain && null != table) { BooleanValueStyle wrapTextValue = (BooleanValueStyle) table.getNamedStyle(NattablestylePackage.eINSTANCE.getBooleanValueStyle(), NamedStyleConstants.WRAP_TEXT); if (null != wrapTextValue) { Assert.isTrue(wrapTextValue.isBooleanValue()); BooleanValueStyle autoResizeValue = (BooleanValueStyle) table.getNamedStyle(NattablestylePackage.eINSTANCE.getBooleanValueStyle(), NamedStyleConstants.AUTO_RESIZE_CELL_HEIGHT); if (null != autoResizeValue && autoResizeValue.isBooleanValue()) { NatEventData natEventData = getNatEventData(); if (null != natEventData && null != natEventData.getNatTable()) { final NatTable natTable = natEventData.getNatTable(); natTable.getConfigRegistry().registerConfigAttribute(NattableConfigAttributes.REINITIALISE_ROW_HEIGHT, true); } } StyleUtils.deleteBooleanNamedStyle(editingDomain, table, NamedStyleConstants.WRAP_TEXT); } else { StyleUtils.initBooleanNamedStyle(editingDomain, table, NamedStyleConstants.WRAP_TEXT, <START> true); <END> } } return null; }</code><technical_language>a const please</technical_language>

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { TransactionalEditingDomain editingDomain = getTableEditingDomain(); Table table = getTable(); if (null != editingDomain && null != table) { BooleanValueStyle wrapTextValue = (BooleanValueStyle) table.getNamedStyle(NattablestylePackage.eINSTANCE.getBooleanValueStyle(), NamedStyleConstants.WRAP_TEXT); if (null != wrapTextValue) { if (wrapTextValue.isBooleanValue()) { BooleanValueStyle autoResizeValue = (BooleanValueStyle) table.getNamedStyle(NattablestylePackage.eINSTANCE.getBooleanValueStyle(), NamedStyleConstants.AUTO_RESIZE_CELL_HEIGHT); if (null != autoResizeValue && autoResizeValue.isBooleanValue()) { NatEventData natEventData = getNatEventData(); if (null != natEventData && null != natEventData.getNatTable()) { final NatTable natTable = natEventData.getNatTable(); natTable.getConfigRegistry().registerConfigAttribute(NattableConfigAttributes.REINITIALISE_ROW_HEIGHT, true); } } StyleUtils.deleteBooleanNamedStyle(editingDomain, table, NamedStyleConstants.WRAP_TEXT); } else { StyleUtils.setBooleanNamedStyle(editingDomain, table, NamedStyleConstants.WRAP_TEXT, NamedStyleConstants.ENABLE_WRAP_TEXT); } } else { StyleUtils.initBooleanNamedStyle(editingDomain, table, NamedStyleConstants.WRAP_TEXT, NamedStyleConstants.ENABLE_WRAP_TEXT); } } return null; }
Source:
<code><START> public static K parseWithModule(CharSequence theTextToParse, String startSymbol, org.kframework.definition.Module kastModule) { <END> ParseInModule parser = new ParseInModule(kastModule); Term cleaned = parser.parseString(theTextToParse, startSymbol)._1().right().get(); return TreeNodesToKORE.apply(cleaned); }</code><technical_language>this</technical_language>

Target:
public static K parseWithModule(CharSequence theTextToParse, String startSymbol, org.kframework.definition.Module kastModule) { ParseInModule parser = new ParseInModule(kastModule); return parseWithModule(theTextToParse, startSymbol, parser); }
Source:
<code><START> private PageId ensureValue() { <END> if (mValue == null) { for (; mIter.isValid(); mIter.next()) { PageId id = getPageId(mIter.key()); if (id != null) { mValue = id; break; } } } return mValue; }</code><technical_language>mark nullable</technical_language>

Target:
private PageId ensureValue() { if (mValue == null) { for (; mIter.isValid(); mIter.next()) { PageId id = getPageIdFromKey(mIter.key()); if (id != null) { mValue = id; break; } } } return mValue; }
Source:
<code>protected String getLabel(final EObject element, final String type) { String result = null; IItemLabelProvider provider = getDelegate(element); String umlResult = (provider == null) ? ModelUtils.getDefaultName(element) : provider.getText(element); <START> if (umlResult != null) { <END> Matcher m = UML2_LABEL_PATTERN.matcher(umlResult); if (m.matches()) { LabelTypesEnum typeEnum = LabelTypesEnum.getByLiteral(type); switch (typeEnum) { case LABEL: result = m.group(3); break; case STEREOTYPE: result = m.group(1); break; case METACLASS: result = m.group(2); break; case DASH_SEPARATOR: result = SEPARATOR_DASH; break; case COLON_SEPARATOR: result = SEPARATOR_COLON; break; case QUALIFY_NAME: result = ((NamedElement) element).getQualifiedName(); break; default: break; } } } return null != result ? result : ""; }</code><technical_language>PLease invert operande</technical_language>

Target:
protected String getLabel(final EObject element, final String type) { String result = null; IItemLabelProvider provider = getDelegate(element); String umlResult = (provider == null) ? ModelUtils.getDefaultName(element) : provider.getText(element); if (null != umlResult) { Matcher m = UML2_LABEL_PATTERN.matcher(umlResult); if (m.matches()) { LabelTypesEnum typeEnum = LabelTypesEnum.getByLiteral(type); switch (typeEnum) { case LABEL: result = m.group(3); break; case STEREOTYPE: result = m.group(1); break; case METACLASS: result = m.group(2); break; case DASH_SEPARATOR: result = SEPARATOR_DASH; break; case COLON_SEPARATOR: result = SEPARATOR_COLON; break; case QUALIFY_NAME: result = ((NamedElement) element).getQualifiedName(); break; default: break; } } } return null != result ? result : ""; }
Source:
<code>public void testSortedSerialization() throws Exception { final String[] strings = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l"}; GenericIndexed<String> deserialized = serializeAndDeserialize( GenericIndexed.fromArray( strings, GenericIndexed.STRING_STRATEGY ) ); <START> checkBasicAPIs(strings, deserialized, deserialized.isAllowReverseLookup()); <END> Assert.assertEquals(-13, deserialized.indexOf("q")); Assert.assertEquals(-9, deserialized.indexOf("howdydo")); Assert.assertEquals(-1, deserialized.indexOf("1111")); }</code><technical_language>this checkBasicAPIs(strings, deserialized, true);</technical_language>

Target:
public void testSortedSerialization() throws Exception { final String[] strings = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l"}; GenericIndexed<String> deserialized = serializeAndDeserialize( GenericIndexed.fromArray( strings, GenericIndexed.STRING_STRATEGY ) ); checkBasicAPIs(strings, deserialized, true); Assert.assertEquals(-13, deserialized.indexOf("q")); Assert.assertEquals(-9, deserialized.indexOf("howdydo")); Assert.assertEquals(-1, deserialized.indexOf("1111")); }
Source:
<code>private CallerContext(Builder builder) { <START> this.context = builder.sb.length() > 0 ? builder.sb.toString() : null; <END> this.signature = builder.signature; }</code><technical_language>I is cleaner a method: getContext() in Builder do checks there</technical_language>

Target:
private CallerContext(Builder builder) { this.context = builder.getContext(); this.signature = builder.getSignature(); }
Source:
<code>private static File unmarshalFile( ReadableChannel channel ) throws IOException { int characters = channel.getInt(); byte[] name = new byte[characters]; channel.get( name, characters ); <START> return new File( new String( name ) ); <END> }</code><technical_language>platform encoding</technical_language>

Target:
private static File unmarshalFile( ReadableChannel channel ) throws IOException { byte[] name = readBytes( channel ); return new File( UTF8.decode( name ) ); }
Source:
<code>public void descriptorOnHeapTest() <START> { <END> CacheConfiguration<Long, String> cacheConfiguration = CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, heap(10)) .build(); ManagementRegistryService managementRegistry = new DefaultManagementRegistryService(new DefaultManagementRegistryConfiguration().setCacheManagerAlias("myCM")); CacheManager cacheManager1 = CacheManagerBuilder.newCacheManagerBuilder() .withCache("aCache", cacheConfiguration) .using(managementRegistry) .build(true); assertThat(managementRegistry.getCapabilities(), hasSize(4)); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(0).getName(), equalTo("ActionsCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(1).getName(), equalTo("StatisticsCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(2).getName(), equalTo("StatisticCollectorCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(3).getName(), equalTo("SettingsCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(0).getDescriptors(), hasSize(4)); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(1).getDescriptors(), hasSize(35)); cacheManager1.close(); }</code><technical_language>Code formatting</technical_language>

Target:
public void descriptorOnHeapTest() { CacheManager cacheManager1 = null; try { CacheConfiguration<Long, String> cacheConfiguration = CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, heap(10)) .build(); ManagementRegistryService managementRegistry = new DefaultManagementRegistryService(new DefaultManagementRegistryConfiguration().setCacheManagerAlias("myCM")); cacheManager1 = CacheManagerBuilder.newCacheManagerBuilder() .withCache("aCache", cacheConfiguration) .using(managementRegistry) .build(true); assertThat(managementRegistry.getCapabilities(), hasSize(4)); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(0).getName(), equalTo("ActionsCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(1).getName(), equalTo("StatisticsCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(2).getName(), equalTo("StatisticCollectorCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(3).getName(), equalTo("SettingsCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(0).getDescriptors(), hasSize(4)); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(1).getDescriptors(), hasSize(35)); } finally { if(cacheManager1 != null) cacheManager1.close(); } }
Source:
<code>public SynchronizedStatesManager() { m_ssm_es = s_shared_es; m_zk = null; <START> m_registeredStateMachines = null; <END> m_ssmRootNode = "MockRootForZooKeeper"; m_stateMachineRoot = "MockRootForSSM"; m_stateMachineMemberPath = "MockRootMembershipNode"; m_memberId = "MockMemberId"; m_canonical_memberId = "MockCanonicalMemberId"; m_resetAllowance = 5; m_resetLimit = m_resetAllowance; }</code><technical_language>change public constructors for test mocking a bit suspicious</technical_language>

Target:
public SynchronizedStatesManager() { m_executor = s_sharedExecutor; m_zk = null; m_registeredStateMachines = null; m_ssmRootNode = "MockRootForZooKeeper"; m_stateMachineRoot = "MockRootForSSM"; m_stateMachineMemberPath = "MockRootMembershipNode"; m_memberId = "MockMemberId"; m_canonical_memberId = "MockCanonicalMemberId"; m_resetAllowance = 5; m_resetLimit = m_resetAllowance; }
Source:
<code>private static List<String> tokens(final Request req) throws IOException { <START> final Pattern pattern = Pattern.compile("(\\w+)\\/([\\d\\.]+)"); <END> final List<String> tokens = new LinkedList<>(); final Iterable<String> headers = new RqHeaders.Base(req).header("User-Agent"); for (final String header : headers) { final Matcher matcher = pattern.matcher(header); if (matcher.matches()) { tokens.add(matcher.group()); } } return tokens; }</code><technical_language>@neonailol I this pattern private static final, produces immutable Pattern object (like a constant) degrade performance if called outside</technical_language>

Target:
private static List<String> tokens(final Request req) throws IOException { final List<String> tokens = new LinkedList<>(); final Iterable<String> headers = new RqHeaders.Base(req).header("User-Agent"); for (final String header : headers) { final Matcher matcher = PATTERN.matcher(header); if (matcher.matches()) { tokens.add(matcher.group()); } } return tokens; }
Source:
<code>public static boolean allowed(@NotNull PsiFile file) { final String name = file.getName(); if (StringUtil.startsWithChar(name, '_') || StringUtil.startsWithChar(name, '.')) { return false; } if (!goodOSArchFile(file)) { return false; } if (!(file instanceof GoFile)) { return false; } String flags = ((GoFile)file).getBuildFlags(); <START> if (null == flags || flags.isEmpty()) { <END> return true; } Collection<String> lines = StringUtil.split(flags, "|"); loop: for (final String line : lines) { for (final String tag : WHITESPACES.split(line)) { if (match(tag)) { continue loop; } } return false; } return true; }</code><technical_language>empty anyway: StringUtil.isEmpty checks conditions</technical_language>

Target:
public static boolean allowed(@NotNull PsiFile file) { return buildMatcher.matchFile(file); }
Source:
<code>public void onStartup(final PlaceRequest placeRequest) { view.init(this); final String title = placeRequest.getParameter("title", view.getTrySamplesLabel()); view.setTitle(title); final String repositoryUrl = placeRequest.getParameter("repositoryUrl", null); view.showBusyIndicator(view.getLoadingMessage()); libraryService.call((Set<ExampleProject> projects) -> { view.hideBusyIndicator(); if (projects == null || projects.isEmpty()) { showNoProjects(); return; } projectWidgetsByName = new HashMap<>(); projects.forEach(project -> { <START> TileWidget tileWidget = tileWidgets.get(); <END> tileWidget.init(project.getName(), project.getDescription(), null, null, selectCommand(tileWidget)); projectWidgetsByName.put(project, tileWidget); }); updateView(projectWidgetsByName.values()); }, new DefaultErrorCallback() { @Override public boolean error(final Message message, final Throwable throwable) { showNoProjects(); return super.error(message, throwable); } }).getProjects(repositoryUrl); }</code><technical_language>split this widget creation separate method this big callback more readable.. prefer functional style forEach, I FP freak :P projectWidgetsByName = projects.stream() .collect(Collectors.toMap(Function.identity() , this::createProjectWidget) ); private TileWidget createProjectWidget(ExampleProject project) { TileWidget tileWidget = tileWidgets.get(); tileWidget.init(project.getName(), project.getDescription(), null, null, selectCommand(tileWidget)); return tileWidget; }</technical_language>

Target:
public void onStartup(final PlaceRequest placeRequest) { view.init(this); final String title = placeRequest.getParameter("title", view.getTrySamplesLabel()); view.setTitle(title); final String repositoryUrl = placeRequest.getParameter("repositoryUrl", null); view.showBusyIndicator(view.getLoadingMessage()); libraryService.call((Set<ExampleProject> projects) -> { view.hideBusyIndicator(); if (projects == null || projects.isEmpty()) { showNoProjects(); return; } projectWidgetsByName = new HashMap<>(); projects.forEach(project -> { TileWidget projectWidget = createProjectWidget(project); projectWidgetsByName.put(project, projectWidget); }); updateView(projectWidgetsByName.values()); }, new DefaultErrorCallback() { @Override public boolean error(final Message message, final Throwable throwable) { view.hideBusyIndicator(); showNoProjects(); return super.error(message, throwable); } }).getProjects(repositoryUrl); }
Source:
<code>public void deleteTicket(Guid ticketUUID) { BasicHttpRequest request = getRequest("DELETE", TICKETS_URI + ticketUUID); HttpEntity response = sendRequest(request); <START> consumeEntity(response); <END> }</code><technical_language>Error handling is incorrect, hiding request errors</technical_language>

Target:
public void deleteTicket(Guid ticketUUID) { BasicHttpRequest request = getRequest("DELETE", TICKETS_URI + ticketUUID); HttpEntity response = executeRequest(request); consumeEntity(response); }
Source:
<code><START> public void setUp() <END> { gambling = ActivityCategory.createInstance("gambling", false, new HashSet<String>(Arrays.asList("poker", "lotto")), Collections.emptySet()); news = ActivityCategory.createInstance("news", false, new HashSet<String>(Arrays.asList("refdag", "bbc")), Collections.emptySet()); activityCategories.add(gambling); activityCategories.add(news); when(mockRepository.findAll()).thenReturn(Collections.unmodifiableSet(activityCategories)); when(mockRepository.findOne(gambling.getID())).thenReturn(gambling); when(mockRepository.findOne(news.getID())).thenReturn(news); when(mockRepository.save(any(ActivityCategory.class))).thenAnswer(new Answer<ActivityCategory>() { @Override public ActivityCategory answer(InvocationOnMock invocation) throws Throwable { Object[] args = invocation.getArguments(); return (ActivityCategory) args[0]; } }); }</code><technical_language>This setup is a straight copy of in ActivityCategoryServiceIntegrationTest. put shared? Common base class</technical_language>

Target:
public void setUp() { setUp(mockRepository); }
Source:
<code>private void mill(Game game, MoveContext context, Player currentPlayer) { if (currentPlayer.getHand().size() <= 1) { return; } ArrayList<Card> handCopy = Util.copy(currentPlayer.getHand()); Card[] cardsToDiscard = currentPlayer.controlPlayer.mill_cardsToDiscard(context); <START> if (cardsToDiscard == null || cardsToDiscard.length != 2) { <END> return; } ArrayList<Card> copy = Util.copy(currentPlayer.hand); for (Card cardToKeep : cardsToDiscard) { if (!copy.remove(cardToKeep)) { return; } } for (Card card : cardsToDiscard) { currentPlayer.discard(card, this.controlCard, null); currentPlayer.hand.remove(card); } context.addCoins(2, this.controlCard); }</code><technical_language>discard 1 card if 1 card in hand</technical_language>

Target:
private void mill(Game game, MoveContext context, Player currentPlayer) { if (currentPlayer.getHand().size() == 0) { return; } ArrayList<Card> handCopy = Util.copy(currentPlayer.getHand()); Card[] cardsToDiscard = currentPlayer.controlPlayer.mill_cardsToDiscard(context); if (cardsToDiscard == null || !(cardsToDiscard.length == 2 || cardsToDiscard.length == 1 && currentPlayer.getHand().size() == 1)) { return; } ArrayList<Card> copy = Util.copy(currentPlayer.hand); for (Card cardToKeep : cardsToDiscard) { if (!copy.remove(cardToKeep)) { return; } } for (Card card : cardsToDiscard) { currentPlayer.discard(card, this.controlCard, context); currentPlayer.hand.remove(card); } if (cardsToDiscard.length == 2) { context.addCoins(2, this.controlCard); } }
Source:
<code>public boolean isValid(RealmModel realm, UserModel user, CredentialInput input) { if (!WebAuthnCredentialModel.class.isInstance(input)) return false; WebAuthnCredentialModel context = WebAuthnCredentialModel.class.cast(input); List<WebAuthnCredentialModel> auths = getWebAuthnCredentialModelList(realm, user); WebAuthnAuthenticationContextValidator webAuthnAuthenticationContextValidator = new WebAuthnAuthenticationContextValidator(); try { for (WebAuthnCredentialModel auth : auths) { byte[] credentialId = auth.getAttestedCredentialData().getCredentialId(); if (Arrays.equals(credentialId, context.getAuthenticationContext().getCredentialId())) { Authenticator authenticator = new AuthenticatorImpl( auth.getAttestedCredentialData(), auth.getAttestationStatement(), auth.getCount() ); WebAuthnAuthenticationContextValidationResponse response = webAuthnAuthenticationContextValidator.validate( context.getAuthenticationContext(), authenticator); logger.infov("response.getAuthenticatorData().getFlags() = {0}", response.getAuthenticatorData().getFlags()); long count = auth.getCount(); auth.setCount(count + 1); CredentialModel cred = createCredentialModel(auth); <START> session.userCredentialManager().updateCredential(realm, user, cred); <END> dumpCredentialModel(cred); dumpWebAuthnCredentialModel(auth); return true; } } } catch (WebAuthnException wae) { wae.printStackTrace(); throw(wae); } return false; }</code><technical_language>Calling "updateCredential" authentication lots of unecessary DB writes. I update is needed counters used, is always? a blocker for this PR - create follow-up JIRA doublecheck eventually improve IMO</technical_language>

Target:
public boolean isValid(RealmModel realm, UserModel user, CredentialInput input) { if (!WebAuthnCredentialModel.class.isInstance(input)) return false; WebAuthnCredentialModel context = WebAuthnCredentialModel.class.cast(input); List<WebAuthnCredentialModel> auths = getWebAuthnCredentialModelList(realm, user); WebAuthnAuthenticationContextValidator webAuthnAuthenticationContextValidator = new WebAuthnAuthenticationContextValidator(); try { for (WebAuthnCredentialModel auth : auths) { byte[] credentialId = auth.getAttestedCredentialData().getCredentialId(); if (Arrays.equals(credentialId, context.getAuthenticationContext().getCredentialId())) { Authenticator authenticator = new AuthenticatorImpl( auth.getAttestedCredentialData(), auth.getAttestationStatement(), auth.getCount() ); WebAuthnAuthenticationContextValidationResponse response = webAuthnAuthenticationContextValidator.validate( context.getAuthenticationContext(), authenticator); logger.infov("response.getAuthenticatorData().getFlags() = {0}", response.getAuthenticatorData().getFlags()); long count = auth.getCount(); auth.setCount(count + 1); CredentialModel cred = createCredentialModel(auth); session.userCredentialManager().updateCredential(realm, user, cred); if(logger.isDebugEnabled()) { dumpCredentialModel(cred); dumpWebAuthnCredentialModel(auth); } return true; } } } catch (WebAuthnException wae) { wae.printStackTrace(); throw(wae); } return false; }
Source:
<code>Mono<Response<Void>> deleteDigitalTwinWithResponse(String digitalTwinId, DeleteDigitalTwinRequestOptions options, Context context) { return protocolLayer .getDigitalTwins() <START> .deleteWithResponseAsync(digitalTwinId, options.getIfMatch(), context); <END> }</code><technical_language>well, null check for options</technical_language>

Target:
Mono<Response<Void>> deleteDigitalTwinWithResponse(String digitalTwinId, DeleteDigitalTwinRequestOptions options, Context context) { String ifMatch = options != null ? options.getIfMatch() : null; return protocolLayer .getDigitalTwins() .deleteWithResponseAsync(digitalTwinId, ifMatch, context); }