auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void onDeath(DoDestroyEvent event, EntityRef entity) { CharacterComponent character = entity.getComponent(CharacterComponent.class); DeathEvent deathEvent = new DeathEvent(); deathEvent.lastDamageType = event.getDamageTypeString(); if (event.getInstigatorString() != null) { deathEvent.lastInstigator = event.getInstigatorString(); <START> } else { <END> deathEvent.lastInstigator = translationSystem.translate("${engine:menu#unknown}"); } character.controller.send(deathEvent); }</code><technical_language>I this class is a place convert prefabs/entities readable names, expect logic in events in systems instead. Move conversion methods event this system</technical_language>

Target:
public void onDeath(DoDestroyEvent event, EntityRef entity) { CharacterComponent character = entity.getComponent(CharacterComponent.class); DeathEvent deathEvent = new DeathEvent(); deathEvent.damageTypeName = getDamageTypeName(event.getDamageType()); deathEvent.instigatorName = getInstigatorName(event.getInstigator()); character.controller.send(deathEvent); }
Source:
<code>public Preview.PreviewSurfaceCallback getPreviewSurfaceCallback() { return <START> new Preview.PreviewSurfaceCallback() <END> { final Map<Surface, SurfaceTexture> mSurfaceTextureMap = new HashMap<>(); @NonNull @Override public ListenableFuture<Surface> createSurfaceFuture(@NonNull Size resolution, int imageFormat) { final SurfaceTexture surfaceTexture = new SurfaceTexture(0); surfaceTexture.setDefaultBufferSize(resolution.getWidth(), resolution.getHeight()); surfaceTexture.detachFromGLContext(); final ViewGroup parent = (ViewGroup) mTextureView.getParent(); parent.removeView(mTextureView); parent.addView(mTextureView); mTextureView.setSurfaceTexture(surfaceTexture); final Surface surface = new Surface(surfaceTexture); mSurfaceTextureMap.put(surface, surfaceTexture); return Futures.immediateFuture(surface); } @Override public void onSafeToRelease(@NonNull ListenableFuture<Surface> surfaceFuture) { try { final Surface surface = surfaceFuture.get(); final SurfaceTexture surfaceTexture = mSurfaceTextureMap.get(surface); if (surfaceTexture != null) { surfaceTexture.release(); mSurfaceTextureMap.remove(surface); } surface.release(); } catch (ExecutionException | InterruptedException e) { e.printStackTrace(); } } }; }</code><technical_language>for unclear. simply call PreivewUtil.createPreviewSurfaceCallback(), instead of duplicating code here</technical_language>

Target:
public Preview.PreviewSurfaceCallback getPreviewSurfaceCallback() { return PreviewUtil.createPreviewSurfaceCallback(new PreviewUtil.SurfaceTextureCallback() { @Override public void onSurfaceTextureReady(@NonNull SurfaceTexture surfaceTexture) { Log.d(TAG, "onSurfaceTextureReady"); final ViewGroup parent = (ViewGroup) mTextureView.getParent(); parent.removeView(mTextureView); parent.addView(mTextureView); mTextureView.setSurfaceTexture(surfaceTexture); } @Override public void onSafeToRelease(@NonNull SurfaceTexture surfaceTexture) { Log.d(TAG, "onSafeToRelease"); surfaceTexture.release(); } }); }
Source:
<code>private boolean defaultKubernetesMasterReachable() { try { <START> InetAddress.getByName("kubernetes.default.svc"); <END> return true; } catch (UnknownHostException e) { LOGGER.warning("Hazelcast running on Kubernetes, but \"kubernetes.default.svc\" is not reachable. " + "Check your Kubernetes DNS configuration."); LOGGER.finest(e); return false; } }</code><technical_language>is a timeout for this call</technical_language>

Target:
private boolean defaultKubernetesMasterReachable() { try { InetAddress.getByName("kubernetes.default.svc"); return true; } catch (UnknownHostException e) { ILogger logger = Logger.getLogger(HazelcastKubernetesDiscoveryStrategyFactory.class); logger.warning("Hazelcast running on Kubernetes, but \"kubernetes.default.svc\" is not reachable. " + "Check your Kubernetes DNS configuration."); logger.finest(e); return false; } }
Source:
<code>public void send(byte[] payload) throws TTransportException { if (payload == null || payload.length == 0) { return; } int requestSizeLimit = this.getMaxRequestSize(); <START> if (requestSizeLimit > 0 && payload.length > requestSizeLimit) { <END> throw new FMessageSizeException( String.format("Message exceeds %d bytes, was %d bytes", requestSizeLimit, payload.length)); } byte[] response = makeRequest(payload); if (response.length < 4) { throw new TTransportException("invalid frame size"); } if (response.length == 4) { if (ByteBuffer.wrap(response).getInt() != 0) { throw new TTransportException("missing data"); } return; } try { executeFrame(response); } catch (TException e) { throw new TTransportException("could not execute response callback: " + e.getMessage()); } }</code><technical_language>point of setting this.maxRequestSize if requestSizeLimit instead</technical_language>

Target:
public void send(byte[] payload) throws TTransportException { int requestSizeLimit = getRequestSizeLimit(); if (requestSizeLimit > 0 && payload.length > requestSizeLimit) { throw new FMessageSizeException( String.format("Message exceeds %d bytes, was %d bytes", requestSizeLimit, payload.length)); } byte[] response = makeRequest(payload); if (response.length < 4) { throw new TTransportException("invalid frame size"); } if (response.length == 4) { if (ByteBuffer.wrap(response).getInt() != 0) { throw new TTransportException("missing data"); } return; } try { executeFrame(response); } catch (TException e) { throw new TTransportException("could not execute response callback: " + e.getMessage()); } }
Source:
<code>private void sortByPrice(ArrayList<Order> orders) { int i = 0; while (i < orders.size()) { int j = 0; while (j < orders.size() - 1) { Order <START> tempTarg = <END> orders.get(j); Order tempNext = orders.get(j+1); if (tempTarg.getPrice() < tempNext.getPrice()) { Collections.swap(orders, j, j+1); } j++; } i++; } }</code><technical_language>i understand point of this variable is based name. pick a more descriptive</technical_language>

Target:
private void sortByPrice(ArrayList<Order> orders) { int i = 0; while (i < orders.size()) { int j = 0; while (j < orders.size() - 1) { Order tempOrder = orders.get(j); Order tempNext = orders.get(j+1); if (tempOrder.getPrice() < tempNext.getPrice()) { Collections.swap(orders, j, j+1); } j++; } i++; } }
Source:
<code>public <T> void testWriteToTable_dataWritten() throws Exception { <START> int INSERT_COUNT = 50; <END> try (Admin admin = connection.getAdmin()) { LOG.info("Creating table in testWriteToTable_dataWritten()"); TableName tableName = createNewTable(admin); try { writeThroughDataflow(tableName, INSERT_COUNT); checkTableRowCount(tableName, INSERT_COUNT); } finally { admin.deleteTable(tableName); } } }</code><technical_language>final int INSERT_COUNT</technical_language>

Target:
public void testWriteToTable_dataWritten() throws Exception { final int INSERT_COUNT = 50; try (Admin admin = connection.getAdmin()) { LOG.info("Creating table in testWriteToTable_dataWritten()"); TableName tableName = createNewTable(admin); try { writeThroughDataflow(tableName, INSERT_COUNT); checkTableRowCount(tableName, INSERT_COUNT); } finally { admin.deleteTable(tableName); } } }
Source:
<code><START> public Factories.LeaderPingerFactory leaderPingerFactory() { <END> return leaderPingerFactoryBuilder().from(this).build(); }</code><technical_language>nit: renaming reduce diff</technical_language>

Target:
public Factories.LeaderPingerFactoryContainer leaderPingerFactory() { return leaderPingerFactoryBuilder().from(this).build(); }
Source:
<code>public boolean setEnableAutoJoinWhenAssociated(boolean enabled) { enforceChangePermission(); <START> mLog.trace("setEnableAutoJoinWhenAssociated uid=%").c(Binder.getCallingUid()).flush(); <END> return mWifiStateMachine.setEnableAutoJoinWhenAssociated(enabled); }</code><technical_language>log param if is off</technical_language>

Target:
public boolean setEnableAutoJoinWhenAssociated(boolean enabled) { enforceChangePermission(); mLog.trace("setEnableAutoJoinWhenAssociated uid=% enabled=%") .c(Binder.getCallingUid()) .c(enabled ? "true" : "false").flush(); return mWifiStateMachine.setEnableAutoJoinWhenAssociated(enabled); }
Source:
<code>private void initDetachableFields() { detachableMemSizeEditor = new EntityModelDetachableWidgetWithLabel(memSizeEditor); isHighlyAvailableEditorWithDetachable = new EntityModelDetachableWidget(isHighlyAvailableEditor, Align.RIGHT); overrideMigrationDowntimeEditorWithDetachable = new EntityModelDetachableWidget(overrideMigrationDowntimeEditor, Align.RIGHT); overrideMigrationDowntimeEditor.getContentWidgetContainer().getElement().getStyle().setWidth(20, Unit.PX); migrationModeEditorWithDetachable = new EntityModelDetachableWidget(migrationModeEditor, Align.RIGHT); <START> migrationModeEditor.getContentWidgetContainer().getElement().getStyle().setWidth(300, Unit.PX); <END> StringEntityModelLabel rnglabel = new StringEntityModelLabel(); rnglabel.setText(constants.rngDevEnabled()); isRngEnabledCheckboxWithInfoIcon = new EntityModelWidgetWithInfo<String>(rnglabel, isRngEnabledEditor); isRngEnabledCheckboxWithInfoIcon.setExplanation(SafeHtmlUtils.fromTrustedString(constants.rngDevExplanation())); }</code><technical_language>I a big fan of adding fixed width editors this. I simply define a style class in ui.xml file class instead of putting width in this. for overrideMigrationDowntimeEditor problem</technical_language>

Target:
private void initDetachableFields() { detachableMemSizeEditor = new EntityModelDetachableWidgetWithLabel(memSizeEditor); isHighlyAvailableEditorWithDetachable = new EntityModelDetachableWidget(isHighlyAvailableEditor, Align.RIGHT); overrideMigrationDowntimeEditorWithDetachable = new EntityModelDetachableWidget(overrideMigrationDowntimeEditor, Align.IGNORE); overrideMigrationDowntimeEditorWithDetachable.setupContentWrapper(Align.RIGHT); overrideMigrationDowntimeEditor.getContentWidgetContainer().getElement().getStyle().setWidth(20, Unit.PX); migrationModeEditorWithDetachable = new EntityModelDetachableWidget(migrationModeEditor, Align.IGNORE); migrationModeEditorWithDetachable.setupContentWrapper(Align.RIGHT); StringEntityModelLabel rnglabel = new StringEntityModelLabel(); rnglabel.setText(constants.rngDevEnabled()); isRngEnabledCheckboxWithInfoIcon = new EntityModelWidgetWithInfo<String>(rnglabel, isRngEnabledEditor); isRngEnabledCheckboxWithInfoIcon.setExplanation(SafeHtmlUtils.fromTrustedString(constants.rngDevExplanation())); }
Source:
<code>AzureFileSystem(AzureFileSystemProvider parentFileSystemProvider, String accountName, Map<String, ?> config) throws IOException { if (Objects.isNull(parentFileSystemProvider)) { throw new IllegalArgumentException("AzureFileSystem cannot be instantiated without a parent " + "FileSystemProvider"); } this.parentFileSystemProvider = parentFileSystemProvider; try { this.blobServiceClient = this.buildBlobServiceClient(accountName, config); <START> this.blockSize = (Integer) config.get(AZURE_STORAGE_BLOCK_SIZE); <END> this.downloadResumeRetries = (Integer) config.get(AZURE_STORAGE_DOWNLOAD_RESUME_RETRIES); } catch (Exception e) { throw new IllegalArgumentException("There was an error parsing the configurations map. Please ensure all" + "fields are set to a legal value of the correct type."); } try { this.fileStores = this.initializeFileStores(config); } catch (IOException e) { throw new IOException("Initializing FileStores failed. FileSystem could not be opened.", e); } this.closed = false; }</code><technical_language>Is this block size for upload? Do want clarify in name</technical_language>

Target:
AzureFileSystem(AzureFileSystemProvider parentFileSystemProvider, String accountName, Map<String, ?> config) throws IOException { if (Objects.isNull(parentFileSystemProvider)) { throw Utility.logError(logger, new IllegalArgumentException("AzureFileSystem cannot be instantiated" + " without a parent FileSystemProvider")); } this.parentFileSystemProvider = parentFileSystemProvider; try { this.blobServiceClient = this.buildBlobServiceClient(accountName, config); this.blockSize = (Integer) config.get(AZURE_STORAGE_UPLOAD_BLOCK_SIZE); this.downloadResumeRetries = (Integer) config.get(AZURE_STORAGE_DOWNLOAD_RESUME_RETRIES); } catch (Exception e) { throw Utility.logError(logger, new IllegalArgumentException("There was an error parsing the configurations " + "map. Please ensure all fields are set to a legal value of the correct type.")); } try { this.fileStores = this.initializeFileStores(config); } catch (IOException e) { throw Utility.logError(logger, new IOException("Initializing FileStores failed. FileSystem could not be opened.", e)); } this.closed = false; }
Source:
<code>public ScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionRegistry functionRegistry) { Type fromType = boundVariables.getTypeVariable("F"); Type toType = boundVariables.getTypeVariable("T"); Class<?> returnType = Primitives.wrap(toType.getJavaType()); List<ArgumentProperty> argumentProperties; MethodHandle tryCastHandle; if (fromType.equals(UNKNOWN)) { argumentProperties = ImmutableList.of(valueTypeArgumentProperty(USE_BOXED_TYPE)); <START> tryCastHandle = dropArguments(constant(returnType, null), 0, Boolean.class); <END> } else { Signature signature = functionRegistry.getCoercion(fromType, toType); ScalarFunctionImplementation implementation = functionRegistry.getScalarFunctionImplementation(signature); argumentProperties = ImmutableList.of(implementation.getArgumentProperty(0)); MethodHandle coercion = implementation.getMethodHandle(); coercion = coercion.asType(methodType(returnType, coercion.type())); MethodHandle exceptionHandler = dropArguments(constant(returnType, null), 0, RuntimeException.class); tryCastHandle = catchException(coercion, RuntimeException.class, exceptionHandler); } return new ScalarFunctionImplementation(true, argumentProperties, tryCastHandle, isDeterministic()); }</code><technical_language>need this if more</technical_language>

Target:
public ScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionRegistry functionRegistry) { Type fromType = boundVariables.getTypeVariable("F"); Type toType = boundVariables.getTypeVariable("T"); Class<?> returnType = Primitives.wrap(toType.getJavaType()); List<ArgumentProperty> argumentProperties; MethodHandle tryCastHandle; Signature signature = functionRegistry.getCoercion(fromType, toType); ScalarFunctionImplementation implementation = functionRegistry.getScalarFunctionImplementation(signature); argumentProperties = ImmutableList.of(implementation.getArgumentProperty(0)); MethodHandle coercion = implementation.getMethodHandle(); coercion = coercion.asType(methodType(returnType, coercion.type())); MethodHandle exceptionHandler = dropArguments(constant(returnType, null), 0, RuntimeException.class); tryCastHandle = catchException(coercion, RuntimeException.class, exceptionHandler); return new ScalarFunctionImplementation(true, argumentProperties, tryCastHandle, isDeterministic()); }
Source:
<code>void resourceNegotiationRequestReceived( JID remoteAddress, List<ResourceNegotiationData> resourceNegotiationData, String negotiationID) { INegotiationHandler handler = negotiationHandler; if (handler == null) { log.warn("could not accept resource negotiation because no handler is installed"); return; } AbstractIncomingResourceNegotiation negotiation; synchronized (this) { if (!startStopSessionLock.tryLock()) { log.warn( "could not accept resource negotiation because the current session is about to stop"); return; } ResourceNegotiationFactory currentResourceNegotiationFactory = resourceNegotiationFactory; if (currentResourceNegotiationFactory == null) { log.warn( <START> "could not accept resource negotiation because no resource negotiation factory is present"); <END> return; } try { negotiation = currentResourceNegotiationFactory.newIncomingResourceNegotiation( remoteAddress, negotiationID, resourceNegotiationData, this, session); negotiation.setNegotiationListener(negotiationListener); currentResourceNegotiations.add(negotiation); } finally { startStopSessionLock.unlock(); } } handler.handleIncomingResourceNegotiation(negotiation); }</code><technical_language>marked volatile, is memory fence compiler optimize this</technical_language>

Target:
void resourceNegotiationRequestReceived( JID remoteAddress, List<ResourceNegotiationData> resourceNegotiationData, String negotiationID) { INegotiationHandler handler = negotiationHandler; if (handler == null) { log.warn("could not accept resource negotiation because no handler is installed"); return; } AbstractIncomingResourceNegotiation negotiation; synchronized (this) { if (!startStopSessionLock.tryLock()) { log.warn( "could not accept resource negotiation because the current session is about to stop"); return; } ResourceNegotiationFactory currentResourceNegotiationFactory = resourceNegotiationFactory; if (currentResourceNegotiationFactory == null) { log.warn("could not accept resource negotiation as no session is running"); return; } try { negotiation = currentResourceNegotiationFactory.newIncomingResourceNegotiation( remoteAddress, negotiationID, resourceNegotiationData, this, session); negotiation.setNegotiationListener(negotiationListener); currentResourceNegotiations.add(negotiation); } finally { startStopSessionLock.unlock(); } } handler.handleIncomingResourceNegotiation(negotiation); }
Source:
<code>public boolean initializeContainerInfo() { this.imageMeta = lookupImageMetadata(); if (this.imageMeta == null) { return false; } <START> final List<EnvironmentVariable> envVars = this.imageMeta.env().stream().map(env -> env.split("=")) <END> .map(splittedEnv -> new EnvironmentVariable(splittedEnv[0], splittedEnv[1])) .collect(Collectors.toList()); setEnvironmentVariables(envVars); final List<IPort> portSpecs = this.imageMeta.exposedPorts().stream().map(spec -> new PortSpecAdapter(spec)) .collect(Collectors.toList()); setPortSpecs(portSpecs); setVolumes(new ArrayList<>(this.imageMeta.volumes())); setReplicas(DEFAULT_REPLICA_COUNT); return true; }</code><technical_language>Is of variable is empty: "name="? In this case "name=".split("=").length = 1 next map() throw array out of index</technical_language>

Target:
public boolean initializeContainerInfo() { this.imageMeta = lookupImageMetadata(); if (this.imageMeta == null) { return false; } final List<EnvironmentVariable> envVars = this.imageMeta.env().stream().filter(env -> env.indexOf('=') != -1) .map(env -> env.split("=")).map(splittedEnv -> new EnvironmentVariable(splittedEnv[0], splittedEnv[1])) .collect(Collectors.toList()); setEnvironmentVariables(envVars); final List<IPort> portSpecs = this.imageMeta.exposedPorts().stream().map(spec -> new PortSpecAdapter(spec)) .collect(Collectors.toList()); setPortSpecs(portSpecs); if(this.imageMeta.volumes() != null && !this.imageMeta.volumes().isEmpty()) { setVolumes(new ArrayList<>(this.imageMeta.volumes())); } else { setVolumes(new ArrayList<>()); } setReplicas(DEFAULT_REPLICA_COUNT); return true; }
Source:
<code>public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) { JsonAdapter<?> adapter = moshi.adapter(type, jsonAnnotations(annotations)); if (lenient) { adapter = adapter.lenient(); } if (failOnUnknown) { <START> adapter.failOnUnknown(); <END> } return new MoshiResponseBodyConverter<>(adapter); }</code><technical_language>this need adapter = adapter.failOnUnknown()</technical_language>

Target:
public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) { JsonAdapter<?> adapter = moshi.adapter(type, jsonAnnotations(annotations)); if (lenient) { adapter = adapter.lenient(); } if (failOnUnknown) { adapter = adapter.failOnUnknown(); } return new MoshiResponseBodyConverter<>(adapter); }
Source:
<code>public void testChronologizeWithStartTimestampGreaterThanEndTimestampInKeyInRecord() { long record = Variables.register("record", client.create()); String key = Variables.register("key", TestData.getString()); int testSize = Variables.register("testSize", 5); Set<Object> initValues = Variables.register("initValues", Sets.newHashSet()); List<Timestamp> timestamps = new ArrayList<Timestamp>(); for (int i = 0; i < testSize; i++) { Object value = null; while (value == null || initValues.contains(value)) { value = TestData.getObject(); } initValues.add(value); client.add(key, value, record); timestamps.add(Timestamp.now()); <START> for (int j = 0; j < 10000000; j++); END> } Map<Timestamp, Set<Object>> result = client.chronologize( key, record, timestamps.get(3), timestamps.get(2)); assertTrue(result.isEmpty()); }</code><technical_language>StandardActions.wait(int, TimeUnit) introduce a delay in tests</technical_language>

Target:
public void testChronologizeWithStartTimestampGreaterThanEndTimestampInKeyInRecord() { long record = Variables.register("record", client.create()); String key = Variables.register("key", TestData.getString()); int testSize = Variables.register("testSize", 5); Set<Object> initValues = Variables.register("initValues", Sets.newHashSet()); List<Timestamp> timestamps = new ArrayList<Timestamp>(); for (int i = 0; i < testSize; i++) { Object value = null; while (value == null || initValues.contains(value)) { value = TestData.getObject(); } initValues.add(value); client.add(key, value, record); timestamps.add(Timestamp.now()); StandardActions.wait(200, TimeUnit.MILLISECONDS); } client.chronologize(key, record, timestamps.get(3), timestamps.get(2)); }
Source:
<code>void testAborted() { assumeFalse( true ); <START> throw new IllegalStateException( "his exception should never happen" ); <END> }</code><technical_language>his</technical_language>

Target:
void testAborted() { assumeFalse( true ); throw new IllegalStateException( "this exception should never happen" ); }
Source:
<code>private void createLanguageDialog() { FormController formController = getFormController(); final String[] languages = formController.getLanguages(); int selected = -1; if (languages != null) { String language = formController.getLanguage(); for (int i = 0; i < languages.length; i++) { if (language.equals(languages[i])) { selected = i; } } } alertDialog = new AlertDialog.Builder(this) .setSingleChoiceItems(languages, selected, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int whichButton) { ContentValues values = new ContentValues(); values.put(FormsColumns.LANGUAGE, languages[whichButton]); String selection = FormsColumns.FORM_FILE_PATH + "=?"; <START> String[] selectArgs = {StorageManager.getFormFilePath(StorageManager.getRelativeFormFilePath(formPath))}; <END> int updated = new FormsDao().updateForm(values, selection, selectArgs); Timber.i("Updated language to: %s in %d rows", languages[whichButton], updated); FormController formController = getFormController(); formController.setLanguage(languages[whichButton]); dialog.dismiss(); if (formController.currentPromptIsQuestion()) { saveAnswersForCurrentScreen(DO_NOT_EVALUATE_CONSTRAINTS); } refreshCurrentView(); } }) .setTitle(getString(R.string.change_language)) .setNegativeButton(getString(R.string.do_not_change), null).create(); alertDialog.show(); }</code><technical_language>relativized first? getFormFilePath deal it</technical_language>

Target:
private void createLanguageDialog() { FormController formController = getFormController(); final String[] languages = formController.getLanguages(); int selected = -1; if (languages != null) { String language = formController.getLanguage(); for (int i = 0; i < languages.length; i++) { if (language.equals(languages[i])) { selected = i; } } } alertDialog = new AlertDialog.Builder(this) .setSingleChoiceItems(languages, selected, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int whichButton) { ContentValues values = new ContentValues(); values.put(FormsColumns.LANGUAGE, languages[whichButton]); String selection = FormsColumns.FORM_FILE_PATH + "=?"; String[] selectArgs = {new StoragePathProvider().getFormDbPath(formPath)}; int updated = new FormsDao().updateForm(values, selection, selectArgs); Timber.i("Updated language to: %s in %d rows", languages[whichButton], updated); FormController formController = getFormController(); formController.setLanguage(languages[whichButton]); dialog.dismiss(); if (formController.currentPromptIsQuestion()) { saveAnswersForCurrentScreen(DO_NOT_EVALUATE_CONSTRAINTS); } refreshCurrentView(); } }) .setTitle(getString(R.string.change_language)) .setNegativeButton(getString(R.string.do_not_change), null).create(); alertDialog.show(); }
Source:
<code>public void serializesPayloadFieldstoJsonString() { assertThat(actual, hasJsonPath("$.event_details.amount", equalTo(100))); assertThat(actual, hasJsonPath("$.event_details.description", equalTo("new passport"))); assertThat(actual, hasJsonPath("$.event_details.reference", equalTo("myref"))); assertThat(actual, hasJsonPath("$.event_details.return_url", equalTo("<LINK_0>"))); assertThat(actual, hasJsonPath("$.event_details.gateway_account_id", equalTo(chargeEntity.getGatewayAccount().getId().toString()))); assertThat(actual, hasJsonPath("$.event_details.payment_provider", equalTo(chargeEntity.getGatewayAccount().getGatewayName()))); assertThat(actual, hasJsonPath("$.event_details.language", equalTo(chargeEntity.getLanguage().toString()))); assertThat(actual, hasJsonPath("$.event_details.delayed_capture", equalTo(chargeEntity.isDelayedCapture()))); <START> assertThat(actual, hasJsonPath("$.event_details.external_metadata", equalTo("{\"key1\":\"value1\",\"key2\":\"value2\"}"))); <END> }</code><technical_language>good return this JSON object</technical_language>

Target:
public void serializesPayloadFieldstoJsonString() { assertThat(actual, hasJsonPath("$.event_details.amount", equalTo(100))); assertThat(actual, hasJsonPath("$.event_details.description", equalTo("new passport"))); assertThat(actual, hasJsonPath("$.event_details.reference", equalTo("myref"))); assertThat(actual, hasJsonPath("$.event_details.return_url", equalTo("<LINK_0>"))); assertThat(actual, hasJsonPath("$.event_details.gateway_account_id", equalTo(chargeEntity.getGatewayAccount().getId().toString()))); assertThat(actual, hasJsonPath("$.event_details.payment_provider", equalTo(chargeEntity.getGatewayAccount().getGatewayName()))); assertThat(actual, hasJsonPath("$.event_details.language", equalTo(chargeEntity.getLanguage().toString()))); assertThat(actual, hasJsonPath("$.event_details.delayed_capture", equalTo(chargeEntity.isDelayedCapture()))); assertThat(actual, hasJsonPath("$.event_details.external_metadata.key1", equalTo("value1"))); assertThat(actual, hasJsonPath("$.event_details.external_metadata.key2", equalTo("value2"))); }
Source:
<code>public Object[] factory() { return new Object[] { new DenyReadWriteRemoveAllTest().init(REPL_SYNC, "PD-5N", new int[]{0,1,2}, new int[]{3,4}), new DenyReadWriteRemoveAllTest().init(REPL_SYNC, "AD-4N", DEGRADED_MODE, new int[]{0,1}, new int[]{2,3}), new DenyReadWriteRemoveAllTest().init(REPL_SYNC, "PD-4N", new int[]{0,1,2}, new int[]{3}), new DenyReadWriteRemoveAllTest().init(REPL_SYNC, "PD-3N", new int[]{0,1}, new int[]{2}), new DenyReadWriteRemoveAllTest().init(REPL_SYNC, "AD-2N", DEGRADED_MODE, new int[]{0}, new int[]{1}), <START> new DenyReadWriteRemoveAllTest().init("AD-5N", DEGRADED_MODE, new int[]{0,1,2}, new int[]{3,4}), <END> new DenyReadWriteRemoveAllTest().init("AD-4N", DEGRADED_MODE, new int[]{0,1}, new int[]{2,3}), new DenyReadWriteRemoveAllTest().init("PD-4N", new int[]{0,1,2}, new int[]{3}), new DenyReadWriteRemoveAllTest().init("PD-3N", new int[]{0,1}, new int[]{2}), new DenyReadWriteRemoveAllTest().init("AD-2N", DEGRADED_MODE, new int[]{0}, new int[]{1}), }; }</code><technical_language>DIST_SYNC explicity..</technical_language>

Target:
public Object[] factory() { return new Object[] { new DenyReadWriteRemoveAllTest(REPL_SYNC, "PD-5N", new int[]{0,1,2}, new int[]{3,4}), new DenyReadWriteRemoveAllTest(REPL_SYNC, "AD-4N", DEGRADED_MODE, new int[]{0,1}, new int[]{2,3}), new DenyReadWriteRemoveAllTest(REPL_SYNC, "PD-4N", new int[]{0,1,2}, new int[]{3}), new DenyReadWriteRemoveAllTest(REPL_SYNC, "PD-3N", new int[]{0,1}, new int[]{2}), new DenyReadWriteRemoveAllTest(REPL_SYNC, "AD-2N", DEGRADED_MODE, new int[]{0}, new int[]{1}), new DenyReadWriteRemoveAllTest(DIST_SYNC, "AD-5N", DEGRADED_MODE, new int[]{0,1,2}, new int[]{3,4}), new DenyReadWriteRemoveAllTest(DIST_SYNC, "AD-4N", DEGRADED_MODE, new int[]{0,1}, new int[]{2,3}), new DenyReadWriteRemoveAllTest(DIST_SYNC, "PD-4N", new int[]{0,1,2}, new int[]{3}), new DenyReadWriteRemoveAllTest(DIST_SYNC, "PD-3N", new int[]{0,1}, new int[]{2}), new DenyReadWriteRemoveAllTest(DIST_SYNC, "AD-2N", DEGRADED_MODE, new int[]{0}, new int[]{1}), }; }
Source:
<code>void writeUTF(OutputStream out) throws IOException { DataOutputStream dos = new DataOutputStream(out); for (int i = 0; i < 25000; i++) { <START> dos.writeUTF("abcdefghilmnopqrstuvzABCDEFGHILMNOPQRSTUVZabcdefghilmnopqrstuvzABCDEFGHILMNOPQRSTUVZ"); <END> } dos.flush(); dos.close(); }</code><technical_language>reason left out "jk" "wxy" sequences of alphabetic characters? give reasonable a measurement (albeit identical) if wrote a single sequence of a-zA-Z 50k times</technical_language>

Target:
void writeUTF(OutputStream out) throws IOException { DataOutputStream dos = new DataOutputStream(out); for (int i = 0; i < 50000; i++) { dos.writeUTF("abcdefghilmnopqrstuvzABCDEFGHILMNOPQRSTUVZ"); } dos.flush(); dos.close(); }
Source:
<code>public static boolean testPermission(CommandSource source, String commandName) { if (commandName.equals(CommandPermissions.SELECTOR_COMMAND)) { return source.hasPermission(CommandPermissions.SELECTOR_PERMISSION); } if (commandName.equals(CommandPermissions.COMMAND_BLOCK_COMMAND)) { return source.hasPermission(CommandPermissions.COMMAND_BLOCK_PERMISSION); } final List<? extends CommandMapping> nativeMappings = SpongeImpl.getGame().getCommandManager().getAll(commandName).stream() .filter(m -> m.getCallable() instanceof MinecraftCommandWrapper) .collect(Collectors.toList()); <START> if(nativeMappings.size() > 1) throw new IllegalStateException("Only one native mapping expected for "+commandName); <END> final CommandMapping mapping = nativeMappings.isEmpty() ? null : nativeMappings.get(0); if (mapping != null) { MinecraftCommandWrapper callable = (MinecraftCommandWrapper) mapping.getCallable(); return source.hasPermission(callable.getCommandPermission()); } return source.hasPermission(commandName); }</code><technical_language>if ( (space), missing braces</technical_language>

Target:
public static boolean testPermission(CommandSource source, String commandName) { if (commandName.equals(CommandPermissions.SELECTOR_COMMAND)) { return source.hasPermission(CommandPermissions.SELECTOR_PERMISSION); } if (commandName.equals(CommandPermissions.COMMAND_BLOCK_COMMAND)) { return source.hasPermission(CommandPermissions.COMMAND_BLOCK_PERMISSION); } final List<? extends CommandMapping> nativeMappings = SpongeImpl.getGame().getCommandManager().getAll(commandName).stream() .filter(m -> m.getCallable() instanceof MinecraftCommandWrapper) .collect(Collectors.toList()); if (nativeMappings.size() > 1) { final int size = nativeMappings.size(); final StringJoiner commaSeparated = new StringJoiner(", "); nativeMappings.stream() .map(m -> ((MinecraftCommandWrapper) m).getOwner().getName() + ':' + m.getPrimaryAlias()) .forEach(commaSeparated::add); throw new IllegalStateException("Only one native mapping expected for /" + commandName + "found " + size + "(" + commaSeparated + ")"); } final CommandMapping mapping = nativeMappings.isEmpty() ? null : nativeMappings.get(0); if (mapping != null) { MinecraftCommandWrapper callable = (MinecraftCommandWrapper) mapping.getCallable(); return source.hasPermission(callable.getCommandPermission()); } return source.hasPermission(commandName); }
Source:
<code>public BreakpointContainer[] getRoots(IBreakpoint breakpoint) { if (isShowingGroups()) { List<BreakpointContainer> list = new ArrayList<>(); for (Object <START> fElement : <END> fElements) { BreakpointContainer container = (BreakpointContainer) fElement; if (container.contains(breakpoint)) { list.add(container); } } return list.toArray(new BreakpointContainer[list.size()]); } return null; }</code><technical_language>rename element</technical_language>

Target:
public BreakpointContainer[] getRoots(IBreakpoint breakpoint) { if (isShowingGroups()) { List<BreakpointContainer> list = new ArrayList<>(); for (Object element : fElements) { BreakpointContainer container = (BreakpointContainer) element; if (container.contains(breakpoint)) { list.add(container); } } return list.toArray(new BreakpointContainer[list.size()]); } return null; }
Source:
<code>public static Properties getDatasourceProperties() { String propertiesNotFoundMessage = "Unable to load datasource properties [" + DATASOURCE_PROPERTIES + "]"; boolean propertiesNotFound = false; System.setProperty("h2.lobInDatabase", "true"); InputStream propsInputStream = PersistenceUtil.class.getResourceAsStream(DATASOURCE_PROPERTIES); assertNotNull(propertiesNotFoundMessage, propsInputStream); Properties props = new Properties(); if (propsInputStream != null) { try { props.load(propsInputStream); <START> propsInputStream.close(); <END> } catch (IOException ioe) { propertiesNotFound = true; logger.warn("Unable to find properties, using default H2 properties: {}", ioe.getMessage()); logger.warn("Stacktrace:", ioe); } } else { propertiesNotFound = true; } String password = props.getProperty("password"); if ("${maven.jdbc.password}".equals(password) || propertiesNotFound) { props = getDefaultProperties(); } return props; }</code><technical_language>putting this finally clause do try/catch log warning stream closed in case close throws exception. this, stream attempted closed if reading of properties fails</technical_language>

Target:
public static Properties getDatasourceProperties() { String propertiesNotFoundMessage = "Unable to load datasource properties [" + DATASOURCE_PROPERTIES + "]"; boolean propertiesNotFound = false; System.setProperty("h2.lobInDatabase", "true"); Properties props = new Properties(); try (InputStream propsInputStream = PersistenceUtil.class.getResourceAsStream(DATASOURCE_PROPERTIES)){ assertNotNull(propertiesNotFoundMessage, propsInputStream); props.load(propsInputStream); } catch (IOException ioe) { propertiesNotFound = true; logger.warn("Unable to find properties, using default H2 properties: {}", ioe.getMessage()); logger.warn("Stacktrace:", ioe); } String password = props.getProperty("password"); if ("${maven.jdbc.password}".equals(password) || propertiesNotFound) { props = getDefaultProperties(); } return props; }
Source:
<code>private void executeScriptWithCommandShellEmulation(String script) { <START> List<HiveSqlStatement> statements = statementFactory.newInstanceForScript(script); <END> executeStatementsWithCommandShellEmulation(statements); }</code><technical_language>Consider renaming statementsForScript()</technical_language>

Target:
private void executeScriptWithCommandShellEmulation(String script) { List<String> statements = lexer.applyToScript(script); executeStatementsWithCommandShellEmulation(statements); }
Source:
<code>private void disposeUnspilledLookupSourceIfRequested() { <START> if (!spilledLookupSourceHandle.getDisposeRequested().isDone()) { <END> return; } index.clear(); operatorContext.setMemoryReservation(index.getEstimatedSize().toBytes()); state = State.DISPOSED; }</code><technical_language>If follow advice disposeLookupSourceIfRequested end a method called disposeLookupSource, call here... I put if in call-site</technical_language>

Target:
private void disposeUnspilledLookupSourceIfRequested() { checkState(state == State.INPUT_UNSPILLED_AND_BUILT); if (!spilledLookupSourceHandle.getDisposeRequested().isDone()) { return; } index.clear(); operatorContext.setMemoryReservation(index.getEstimatedSize().toBytes()); state = State.DISPOSED; }
Source:
<code>public DecimalWidget(Context context, FormEntryPrompt prompt, boolean secret, boolean compact) { super(context, prompt, secret, compact); mAnswer.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mAnswerFontSize); mAnswer.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_ACTION_NEXT); <START> mAnswer.setHorizontallyScrolling(isInCompactMode() ? true : false); <END> mAnswer.setKeyListener(new DigitsKeyListener(true, true)); InputFilter[] fa = new InputFilter[1]; fa[0] = new InputFilter.LengthFilter(15); mAnswer.setFilters(fa); Double d = null; if (getCurrentAnswer() != null) { d = (Double)getCurrentAnswer().getValue(); } NumberFormat nf = NumberFormat.getNumberInstance(); nf.setMaximumFractionDigits(15); nf.setMaximumIntegerDigits(15); nf.setGroupingUsed(false); if (d != null) { Double dAnswer = (Double)getCurrentAnswer().getValue(); String dString = nf.format(dAnswer); d = Double.parseDouble(dString.replace(',', '.')); mAnswer.setText(d.toString()); } if (prompt.isReadOnly()) { setBackgroundDrawable(null); setFocusable(false); setClickable(false); } }</code><technical_language>this simplified isInCompactMode()</technical_language>

Target:
public DecimalWidget(Context context, FormEntryPrompt prompt, boolean secret, boolean compact) { super(context, prompt, secret, compact); mAnswer.setTextSize(TypedValue.COMPLEX_UNIT_DIP, mAnswerFontSize); mAnswer.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI | EditorInfo.IME_ACTION_NEXT); mAnswer.setHorizontallyScrolling(isInCompactMode()); mAnswer.setKeyListener(new DigitsKeyListener(true, true)); InputFilter[] fa = new InputFilter[1]; fa[0] = new InputFilter.LengthFilter(15); mAnswer.setFilters(fa); Double d = null; if (getCurrentAnswer() != null) { d = (Double)getCurrentAnswer().getValue(); } NumberFormat nf = NumberFormat.getNumberInstance(); nf.setMaximumFractionDigits(15); nf.setMaximumIntegerDigits(15); nf.setGroupingUsed(false); if (d != null) { Double dAnswer = (Double)getCurrentAnswer().getValue(); String dString = nf.format(dAnswer); d = Double.parseDouble(dString.replace(',', '.')); mAnswer.setText(d.toString()); } if (prompt.isReadOnly()) { setBackgroundDrawable(null); setFocusable(false); setClickable(false); } }
Source:
<code>protected void activate(ComponentContext componentContext) { this.m_ctx = componentContext; this.m_pppState = PppState.NOT_CONNECTED; this.m_resetTimerStart = 0L; Dictionary<String, String[]> d = new Hashtable<String, String[]>(); d.put(EventConstants.EVENT_TOPIC, EVENT_TOPICS); this.m_ctx.getBundleContext().registerService(EventHandler.class.getName(), this, d); this.m_modems = new HashMap<String, CellularModem>(); this.m_interfaceStatuses = new HashMap<String, InterfaceState>(); this.m_listeners = new ArrayList<ModemMonitorListener>(); stopThread = new AtomicBoolean(); <START> this.m_executor = Executors.newSingleThreadExecutor(); <END> try { this.m_networkConfig = this.m_netConfigService.getNetworkConfiguration(); for (NetInterface<? extends NetInterfaceAddress> netInterface : this.m_networkService .getNetworkInterfaces()) { if (netInterface instanceof ModemInterface) { ModemDevice modemDevice = ((ModemInterface<?>) netInterface).getModemDevice(); trackModem(modemDevice); } } } catch (Exception e) { s_logger.error("Error getting installed modems", e); } submitMonitorTask(); this.m_serviceActivated = true; s_logger.debug("ModemMonitor activated and ready to receive events"); }</code><technical_language>If 1k lines, I rename variables new conventions</technical_language>

Target:
protected void activate(ComponentContext componentContext) { this.pppState = PppState.NOT_CONNECTED; this.resetTimerStart = 0L; Dictionary<String, String[]> d = new Hashtable<>(); d.put(EventConstants.EVENT_TOPIC, EVENT_TOPICS); componentContext.getBundleContext().registerService(EventHandler.class.getName(), this, d); this.modems = new HashMap<>(); this.interfaceStatuses = new HashMap<>(); this.listeners = new ArrayList<>(); stopThread = new AtomicBoolean(); this.executor = Executors.newSingleThreadExecutor(); try { this.networkConfig = this.netConfigService.getNetworkConfiguration(); for (NetInterface<? extends NetInterfaceAddress> netInterface : this.networkService .getNetworkInterfaces()) { if (netInterface instanceof ModemInterface) { ModemDevice modemDevice = ((ModemInterface<?>) netInterface).getModemDevice(); trackModem(modemDevice); } } } catch (Exception e) { logger.error("Error getting installed modems", e); } submitMonitorTask(); this.serviceActivated = true; logger.debug("ModemMonitor activated and ready to receive events"); }
Source:
<code>public void testCreateTableWithInvalidTableUpdateCacheFreqShouldThrow() throws Exception { String tableName = generateUniqueName(); Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES); ArrayList<String> invalidUCF = new ArrayList<>(); invalidUCF.add("GIBBERISH"); invalidUCF.add("10000.6"); for (String tableLevelUCF : invalidUCF) { String createTableString = "CREATE TABLE " + tableName + " (k VARCHAR PRIMARY KEY," + "v1 VARCHAR, v2 VARCHAR) UPDATE_CACHE_FREQUENCY = " + tableLevelUCF; try { verifyUCFValueInSysCat(tableName, createTableString, props, -1L); fail(); } catch (IllegalArgumentException e) { <START> assertEquals("Table's UPDATE_CACHE_FREQUENCY can only be set to 'ALWAYS', 'NEVER' or a millisecond numeric value.", <END> e.getMessage()); } } }</code><technical_language>I dislike comparing actual string messages in exception, a subtle change test failures. Is other confirm this a sqlCode comparison for example</technical_language>

Target:
public void testCreateTableWithInvalidTableUpdateCacheFreqShouldThrow() throws Exception { String tableName = generateUniqueName(); Properties props = PropertiesUtil.deepCopy(TestUtil.TEST_PROPERTIES); ArrayList<String> invalidUCF = new ArrayList<>(); invalidUCF.add("GIBBERISH"); invalidUCF.add("10000.6"); for (String tableLevelUCF : invalidUCF) { String createTableString = "CREATE TABLE " + tableName + " (k VARCHAR PRIMARY KEY," + "v1 VARCHAR, v2 VARCHAR) UPDATE_CACHE_FREQUENCY = " + tableLevelUCF; try { verifyUCFValueInSysCat(tableName, createTableString, props, -1L); fail(); } catch (IllegalArgumentException e) { assertTrue(e.getMessage().contains("Table's " + PhoenixDatabaseMetaData.UPDATE_CACHE_FREQUENCY)); } } }
Source:
<code>public static com.azure.search.documents.indexes.implementation.models.SearchIndexerSkillset map(SearchIndexerSkillset obj) { if (obj == null) { return null; } Objects.requireNonNull(obj.getName(), "The SearchIndexerSkillset name cannot be null"); List<com.azure.search.documents.indexes.implementation.models.SearchIndexerSkill> skills = obj.getSkills() == null ? null : obj.getSkills().stream().map(SearchIndexerSkillConverter::map).collect(Collectors.toList()); com.azure.search.documents.indexes.implementation.models.SearchIndexerSkillset searchIndexerSkillset = new com.azure.search.documents.indexes.implementation.models.SearchIndexerSkillset() .setName(obj.getName()) .setSkills(skills); if (obj.getCognitiveServicesAccount() != null) { com.azure.search.documents.indexes.implementation.models.CognitiveServicesAccount cognitiveServicesAccount = CognitiveServicesAccountConverter.map(obj.getCognitiveServicesAccount()); searchIndexerSkillset.setCognitiveServicesAccount(cognitiveServicesAccount); } String description = obj.getDescription(); searchIndexerSkillset.setDescription(description); <START> searchIndexerSkillset.setDescription(obj.getDescription()); <END> searchIndexerSkillset.setETag(obj.getETag()); if (obj.getEncryptionKey() != null) { searchIndexerSkillset.setEncryptionKey(SearchResourceEncryptionKeyConverter.map(obj.getEncryptionKey())); } return searchIndexerSkillset; }</code><technical_language>setDescription() call twice</technical_language>

Target:
public static com.azure.search.documents.indexes.implementation.models.SearchIndexerSkillset map(SearchIndexerSkillset obj) { if (obj == null) { return null; } Objects.requireNonNull(obj.getName(), "The SearchIndexerSkillset name cannot be null"); List<com.azure.search.documents.indexes.implementation.models.SearchIndexerSkill> skills = obj.getSkills() == null ? null : obj.getSkills().stream().map(SearchIndexerSkillConverter::map).collect(Collectors.toList()); com.azure.search.documents.indexes.implementation.models.SearchIndexerSkillset searchIndexerSkillset = new com.azure.search.documents.indexes.implementation.models.SearchIndexerSkillset() .setName(obj.getName()) .setSkills(skills); if (obj.getCognitiveServicesAccount() != null) { com.azure.search.documents.indexes.implementation.models.CognitiveServicesAccount cognitiveServicesAccount = CognitiveServicesAccountConverter.map(obj.getCognitiveServicesAccount()); searchIndexerSkillset.setCognitiveServicesAccount(cognitiveServicesAccount); } searchIndexerSkillset.setDescription(obj.getDescription()); searchIndexerSkillset.setETag(obj.getETag()); if (obj.getEncryptionKey() != null) { searchIndexerSkillset.setEncryptionKey(SearchResourceEncryptionKeyConverter.map(obj.getEncryptionKey())); } return searchIndexerSkillset; }
Source:
<code>@Override public void completed(final Exchange exchange) { if (exchange.getOrigin() == Origin.LOCAL) { KeyMID idByMID = new KeyMID(exchange.getCurrentRequest().getMID()); KeyToken idByToken = new KeyToken(exchange.getCurrentRequest().getToken()); if (!exchange.getRequest().isMulticast() || isMulticastTimedOut(exchange)) { <START> exchangesByToken.remove(idByToken); <END> exchangesByMID.remove(idByMID); } } else { Response response = exchange.getCurrentResponse(); if (response != null && response.getType() != Type.ACK) { KeyMID midKey = new KeyMID(response.getMID(), null, 0); exchangesByMID.remove(midKey); } Request request = exchange.getCurrentRequest(); if (request != null && (request.getOptions().hasBlock1() || response.getOptions().hasBlock2())) { KeyUri uriKey = new KeyUri(request.getURI(), request.getSource().getAddress(), request.getSourcePort()); LOGGER.log(Level.FINE, "Remote ongoing completed, cleaning up ", uriKey); ongoingExchanges.remove(uriKey); } ObserveRelation relation = exchange.getRelation(); if (relation != null) { removeNotificationsOf(relation); } } }</code><technical_language>This basically means exchange for a multicast request stay in map if responses arrive _after_ exchange timed out, it</technical_language>

Target:
@Override public void completed(final Exchange exchange) { if (exchange.getOrigin() == Origin.LOCAL) { KeyMID idByMID = new KeyMID(exchange.getCurrentRequest().getMID()); KeyToken idByToken = new KeyToken(exchange.getCurrentRequest().getToken()); exchangesByToken.remove(idByToken); exchangesByMID.remove(idByMID); } else { Response response = exchange.getCurrentResponse(); if (response != null && response.getType() != Type.ACK) { KeyMID midKey = new KeyMID(response.getMID(), null, 0); exchangesByMID.remove(midKey); } Request request = exchange.getCurrentRequest(); if (request != null && (request.getOptions().hasBlock1() || response.getOptions().hasBlock2())) { KeyUri uriKey = new KeyUri(request.getURI(), request.getSource().getAddress(), request.getSourcePort()); LOGGER.log(Level.FINE, "Remote ongoing completed, cleaning up ", uriKey); ongoingExchanges.remove(uriKey); } ObserveRelation relation = exchange.getRelation(); if (relation != null) { removeNotificationsOf(relation); } } }