auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void populateSettingsMap(Plugin plugin, PluginInfo pluginInfo) { final ConfigurationPropertyBuilder builder = new ConfigurationPropertyBuilder(); for (String settingsKey : plugin.getAllConfigurationKeys()) { final PluginConfiguration configuration = pluginInfo.getPluginSettings().getConfiguration(settingsKey); if (configuration != null) { settingsMap.add(builder.create(settingsKey, plugin.getConfigurationValue(settingsKey), null, configuration.isSecure())); <START> } <END> } }</code><technical_language>here, lets ignore unknown configurations</technical_language>

Target:
public void populateSettingsMap(Plugin plugin, PluginInfo pluginInfo) { final ConfigurationPropertyBuilder builder = new ConfigurationPropertyBuilder(); for (String settingsKey : plugin.getAllConfigurationKeys()) { final PluginConfiguration configuration = pluginInfo.getPluginSettings().getConfiguration(settingsKey); if (configuration != null) { settingsMap.add(builder.create(settingsKey, plugin.getConfigurationValue(settingsKey), null, configuration.isSecure())); } else { settingsMap.add(builder.create(settingsKey, plugin.getConfigurationValue(settingsKey), null, false)); } } }
Source:
<code>public String open(int id, String referringView) { try { this.referringView = referringView; Helper.getRequestParameter("referringView"); this.process = ServiceManager.getProcessService().getById(id); this.currentChildren.addAll(process.getChildren()); this.user = ServiceManager.getUserService().getCurrentUser(); ruleset = openRuleset(process.getRuleset()); openMetsFile(); init(); <START> openProcesses.put(Integer.valueOf(id), user); <END> } catch (IOException | DAOException e) { Helper.setErrorMessage(e.getLocalizedMessage(), logger, e); return referringView; } return PAGE_METADATA_EDITOR; }</code><technical_language>Unnecessary boxing of Integer</technical_language>

Target:
public String open(int id, String referringView) { try { this.referringView = referringView; Helper.getRequestParameter("referringView"); this.process = ServiceManager.getProcessService().getById(id); this.currentChildren.addAll(process.getChildren()); this.user = ServiceManager.getUserService().getCurrentUser(); ruleset = openRuleset(process.getRuleset()); openMetsFile(); init(); openProcesses.put(id, user); } catch (IOException | DAOException e) { Helper.setErrorMessage(e.getLocalizedMessage(), logger, e); return referringView; } return PAGE_METADATA_EDITOR; }
Source:
<code>public StartpointManager(MetadataStore metadataStore) { Preconditions.checkNotNull(metadataStore, "MetadataStore cannot be null"); this.metadataStore = metadataStore; this.readWriteStore = new NamespaceAwareCoordinatorStreamStore(metadataStore, NAMESPACE); this.fanOutStore = new NamespaceAwareCoordinatorStreamStore(metadataStore, NAMESPACE_FAN_OUT); <START> LOG.info("Lifecycle of metadata store: is managed externally", metadataStore.getClass().getCanonicalName()); <END> LOG.info("Startpoints are written to namespace: and fanned out to namespace: in the metadata store", NAMESPACE, NAMESPACE_FAN_OUT); }</code><technical_language>Minor: unnecessary log</technical_language>

Target:
public StartpointManager(MetadataStore metadataStore) { Preconditions.checkNotNull(metadataStore, "MetadataStore cannot be null"); this.readWriteStore = new NamespaceAwareCoordinatorStreamStore(metadataStore, NAMESPACE); this.fanOutStore = new NamespaceAwareCoordinatorStreamStore(metadataStore, NAMESPACE_FAN_OUT); LOG.info("Startpoints are written to namespace: and fanned out to namespace: in the metadata store of type: {}", NAMESPACE, NAMESPACE_FAN_OUT, metadataStore.getClass().getCanonicalName()); }
Source:
<code>public void updated(Map<String, Object> properties) { KuraGPIOPin pin = this.myservice.getPinByTerminal(6); this.options = new LedOptions(properties); try { pin.open(); } catch (KuraGPIODeviceException | KuraUnavailableDeviceException | IOException e) { e.printStackTrace(); } <START> if (this.options.isEnableLed()) { <END> try { pin.setValue(true); TimeUnit.SECONDS.sleep(1); } catch (KuraUnavailableDeviceException | IOException | KuraClosedDeviceException e) { s_logger.error("Exception GPIOService ", e); } catch (InterruptedException e) { e.printStackTrace(); } } else { try { pin.setValue(false); TimeUnit.SECONDS.sleep(1); pin.close(); } catch (KuraUnavailableDeviceException | KuraClosedDeviceException | IOException e) { s_logger.error("Exception GPIOService ", e); } catch (InterruptedException e) { e.printStackTrace(); } } }</code><technical_language>I refactor this code snippet a method reuse code for switching off</technical_language>

Target:
public void updated(Map<String, Object> properties) { this.options = new LedOptions(properties); close(); pin = this.myservice.getPinByTerminal(this.options.isConfigPin()); if (pin == null) { return; } open(); setValue(this.options.isEnableLed()); }
Source:
<code>protected void verifySafeObject(final AnyObjectId id, final int type, final byte[] data) { try { super.verifySafeObject(id, type, data); } catch (CorruptObjectException e) { <START> CorruptObject o = new CorruptObject(id.toObjectId(), type, <END> e.getErrorType()); corruptObjects.add(o); } }</code><technical_language>simplify avoiding temporary: corruptObjects.add(new CorruptObject(...));</technical_language>

Target:
protected void verifySafeObject(final AnyObjectId id, final int type, final byte[] data) { try { super.verifySafeObject(id, type, data); } catch (CorruptObjectException e) { corruptObjects.add( new CorruptObject(id.toObjectId(), type, e.getErrorType())); } }
Source:
<code>public String getBuildStartedMessage(AbstractBuild build) { <START> if (thisOverrides("getBuildsStartedMessage", Run.class)) { <END> return getBuildStartedMessage((Run)build); } return null; }</code><technical_language>This unrelated wrong. reading rest of PR, wrong, check is if a specific method is overridden in case method called, method checked for is method called</technical_language>

Target:
public String getBuildStartedMessage(AbstractBuild build) { if (thisOverrides("getBuildStartedMessage", Run.class)) { return getBuildStartedMessage((Run)build); } return null; }
Source:
<code>public void respondsToChangesInSingleQueryLimitBatchParameter() { AtomicReference<CassandraCellLoadingConfig> config = new AtomicReference<>(LOADING_CONFIG); CellLoadingBatcher reloadingBatcher = new CellLoadingBatcher(config::get, rebatchingCallback); reloadingBatcher.partitionIntoBatches(rowRange(SINGLE_QUERY_LIMIT, 0), ADDRESS, TABLE_REFERENCE); <START> config.set(ImmutableCassandraCellLoadingConfig.builder() <END> .crossColumnLoadBatchLimit(CROSS_COLUMN_LIMIT) .singleQueryLoadBatchLimit(2 * SINGLE_QUERY_LIMIT) .build()); List<List<Cell>> largerBatches = reloadingBatcher.partitionIntoBatches( rowRange(2 * SINGLE_QUERY_LIMIT, 0), ADDRESS, TABLE_REFERENCE); assertBatchContentsMatch(largerBatches, rowRange(2 * SINGLE_QUERY_LIMIT, 0)); verify(rebatchingCallback, never()).consume(any(), any(), anyInt()); }</code><technical_language>do this method call? extract a method</technical_language>

Target:
public void respondsToChangesInSingleQueryLimitBatchParameter() { AtomicReference<CassandraCellLoadingConfig> config = new AtomicReference<>(LOADING_CONFIG); CellLoadingBatcher reloadingBatcher = new CellLoadingBatcher(config::get, rebatchingCallback); updateConfig(config, CROSS_COLUMN_LIMIT, 2 * SINGLE_QUERY_LIMIT); List<List<Cell>> largerBatches = reloadingBatcher.partitionIntoBatches( rowRange(2 * SINGLE_QUERY_LIMIT, 0), ADDRESS, TABLE_REFERENCE); assertBatchContentsMatch(largerBatches, rowRange(2 * SINGLE_QUERY_LIMIT, 0)); verify(rebatchingCallback, never()).consume(any(), any(), anyInt()); }
Source:
<code>private boolean applyFilters(Instance instance) { if (this.unconditionalFilters.size() == 0 && this.typeFilters.size() == 0 && this.excludedTypes.size() == 0) return true; return (this.unconditionalFilters.size() == 0 ? false : applyUnconditionalFilter(instance)) || (this.typeFilters.size() == 0 ? false : applyTypedFilter(instance)) <START> || (this.excludedTypes.size() == 0 ? false : applyExcludeFilters(instance)); <END> }</code><technical_language>I "or" for excluded types. check expensive, done first, false returned a failed check</technical_language>

Target:
private boolean applyFilters(Instance instance) { if (this.unconditionalFilters.size() == 0 && this.typeFilters.size() == 0 && this.excludedTypes.size() == 0) return true; if (applyExcludeFilters(instance)) return false; if (this.unconditionalFilters.size() == 0 && this.typeFilters.size() == 0) return true; return applyTypedFilter(instance) || applyUnconditionalFilter(instance); }
Source:
<code>private Mono<Void> handleFireAndForget(Payload payload) { if (payload.refCnt() <= 0) { return Mono.error(new IllegalReferenceCountException()); } if (isDisposed()) { payload.release(); final Throwable t = terminationError; return Mono.error(t); } if (!PayloadValidationUtils.isValid(this.mtu, payload)) { payload.release(); return Mono.error(new IllegalArgumentException(INVALID_PAYLOAD_ERROR_MESSAGE)); } final AtomicBoolean once = new AtomicBoolean(); return Mono.<Void>defer( () -> { if (once.getAndSet(true)) { return Mono.error( new IllegalStateException("FireAndForgetMono allows only a single subscriber")); } if (isDisposed()) { payload.release(); final Throwable t = terminationError; return Mono.error(t); } RequesterLeaseHandler lh = leaseHandler; if (!lh.useLease()) { <START> return Mono.error(lh.leaseError()); <END> } final int streamId = streamIdSupplier.nextStreamId(receivers); final ByteBuf requestFrame = RequestFireAndForgetFrameCodec.encodeReleasingPayload( allocator, streamId, payload); sendProcessor.onNext(requestFrame); return Mono.empty(); }) .subscribeOn(serialScheduler); }</code><technical_language>release payload here</technical_language>

Target:
private Mono<Void> handleFireAndForget(Payload payload) { if (payload.refCnt() <= 0) { return Mono.error(new IllegalReferenceCountException()); } if (isDisposed()) { payload.release(); final Throwable t = terminationError; return Mono.error(t); } if (!PayloadValidationUtils.isValid(this.mtu, payload)) { payload.release(); return Mono.error(new IllegalArgumentException(INVALID_PAYLOAD_ERROR_MESSAGE)); } final AtomicBoolean once = new AtomicBoolean(); return Mono.<Void>defer( () -> { if (once.getAndSet(true)) { return Mono.error( new IllegalStateException("FireAndForgetMono allows only a single subscriber")); } if (isDisposed()) { payload.release(); final Throwable t = terminationError; return Mono.error(t); } RequesterLeaseHandler lh = leaseHandler; if (!lh.useLease()) { payload.release(); return Mono.error(lh.leaseError()); } final int streamId = streamIdSupplier.nextStreamId(receivers); final ByteBuf requestFrame = RequestFireAndForgetFrameCodec.encodeReleasingPayload( allocator, streamId, payload); sendProcessor.onNext(requestFrame); return Mono.empty(); }) .subscribeOn(serialScheduler); }
Source:
<code>public RelyingPartyRegistration build() { return new RelyingPartyRegistration( registrationId, assertionConsumerServiceUrlTemplate, <START> new ProviderDetails( <END> providerDetailsBuilder.entityId, providerDetailsBuilder.webSsoUrl, providerDetailsBuilder.signAuthNRequest, providerDetailsBuilder.binding ), credentials, localEntityIdTemplate ); }</code><technical_language>put this construction a build() method for ProviderDetails's builder. a bit odd a builder, builder perform actual construction</technical_language>

Target:
public RelyingPartyRegistration build() { return new RelyingPartyRegistration( this.registrationId, this.assertionConsumerServiceUrlTemplate, this.providerDetails.build(), this.credentials, this.localEntityIdTemplate ); }
Source:
<code>public static List<CloneSourceProvider> getCloneSourceProvider() { List<CloneSourceProvider> cloneSourceProvider = new ArrayList<CloneSourceProvider>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IConfigurationElement[] config = registry .getConfigurationElementsFor(CLONE_SOURCE_PROVIDER_ID); <START> if (config.length > 0) { <END> addCloneSourceProvider(cloneSourceProvider, config, 0); } return cloneSourceProvider; }</code><technical_language>style nit: curlies</technical_language>

Target:
public static List<CloneSourceProvider> getCloneSourceProvider() { List<CloneSourceProvider> cloneSourceProvider = new ArrayList<CloneSourceProvider>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IConfigurationElement[] config = registry .getConfigurationElementsFor(CLONE_SOURCE_PROVIDER_ID); if (config.length > 0) addCloneSourceProvider(cloneSourceProvider, config, 0); return cloneSourceProvider; }
Source:
<code>public boolean update(Change change) throws IOException { try { return new ChangeUpdateTask(schemaFactory, change).call(); <START> } catch (RuntimeException e) { throw e; <END> } catch (Exception e) { throw MAPPER.apply(e); } }</code><technical_language>Unnecessary</technical_language>

Target:
public boolean update(Change change) throws IOException { try { return new ChangeUpdateTask(schemaFactory, change).call(); } catch (Exception e) { Throwables.propagateIfPossible(e); throw MAPPER.apply(e); } }
Source:
<code>protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch(requestCode) { case BARCODE_CAPTURE: if (resultCode == RESULT_OK) { String scanResult = data.getStringExtra("SCAN_RESULT"); try { Pair<String, String[]> activatedPrivileges = new PrivilegesUtility(GlobalConstants.TRUSTED_SOURCE_PUBLIC_KEY). processPrivilegePayloadForActivatedPrivileges(scanResult); for(String p : activatedPrivileges.second) { <START> if (!GlobalPrivilegesManager.allGlobalPrivilegesList.contains(p)) { <END> Log.d(TAG, "Request to activate unknown privilege: " + p); } else { GlobalPrivilegesManager.enablePrivilege(p, activatedPrivileges.first); } } refreshUI(); } catch (PrivilegesUtility.UnrecognizedPayloadVersionException e) { e.printStackTrace(); privilegeClaimTooNew(); } catch (PrivilegesUtility.PrivilagePayloadException e) { e.printStackTrace(); privilegeClaimFailed(); } } } }</code><technical_language>I copied this behavior code I previously, wondering this is necessary harmful. want prevent earlier versions of CommCare able activate privileges conceived of point? This is severely limiting</technical_language>

Target:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch (requestCode) { case BARCODE_CAPTURE: if (resultCode == RESULT_OK) { String scanResult = data.getStringExtra("SCAN_RESULT"); try { Pair<String, String[]> activatedPrivileges = new PrivilegesUtility(GlobalConstants.TRUSTED_SOURCE_PUBLIC_KEY). processPrivilegePayloadForActivatedPrivileges(scanResult); for (String p : activatedPrivileges.second) { if (!GlobalPrivilegesManager.allGlobalPrivilegesList.contains(p)) { Log.d(TAG, "Request to activate unknown privilege: " + p); } else { GlobalPrivilegesManager.enablePrivilege(p, activatedPrivileges.first); } } refreshUI(); } catch (PrivilegesUtility.UnrecognizedPayloadVersionException e) { e.printStackTrace(); privilegePayloadVersionTooNew(); } catch (PrivilegesUtility.PrivilagePayloadException e) { e.printStackTrace(); privilegeClaimFailed(); } } } }
Source:
<code>public void triggerAdHocFragment(String caseId, String stageId, String fragmentName, Object data) throws CaseNotFoundException { <START> authorizationManager.checkAuthorization(caseId); <END> ProcessInstanceDesc pi = verifyCaseIdExists(caseId); triggerAdHocFragment(pi.getId(), stageId, fragmentName, data); }</code><technical_language>This call is missing in method</technical_language>

Target:
public void triggerAdHocFragment(String caseId, String stageId, String fragmentName, Object data) throws CaseNotFoundException { ProcessInstanceDesc pi = verifyCaseIdExists(caseId); triggerAdHocFragment(pi.getId(), stageId, fragmentName, data); }
Source:
<code>private void processJoinMessage(final Message message, final JoinMessage joinMessage) { String joinedMember = channel.getName(message.getSrc()); if (joinedMember != null) { int loadFactor = joinMessage.getLoadFactor(); Predicate<CommandMessage<?>> commandFilter = joinMessage.messageFilter(); <START> SimpleMember<Address> member = new SimpleMember<>(joinedMember, message.getSrc(), false, null); <END> members.put(member.endpoint(), member); consistentHash.updateAndGet(ch -> ch.with(member, loadFactor, commandFilter)); if (logger.isInfoEnabled() && !message.getSrc().equals(channel.getAddress())) { logger.info("{} joined with load factor: {}", joinedMember, loadFactor); } if (logger.isDebugEnabled()) { logger.debug("Got a network of members: {}", members.values()); } } else { logger.warn("Received join message from '{}', but a connection with the sender has been lost.", message.getSrc().toString()); } }</code><technical_language>Similarly, NON_LOCAL_MEMBER</technical_language>

Target:
private void processJoinMessage(final Message message, final JoinMessage joinMessage) { String joinedMember = channel.getName(message.getSrc()); if (joinedMember != null) { int loadFactor = joinMessage.getLoadFactor(); Predicate<CommandMessage<?>> commandFilter = joinMessage.messageFilter(); SimpleMember<Address> member = new SimpleMember<>(joinedMember, message.getSrc(), NON_LOCAL_MEMBER, null); members.put(member.endpoint(), member); consistentHash.updateAndGet(ch -> ch.with(member, loadFactor, commandFilter)); if (logger.isInfoEnabled() && !message.getSrc().equals(channel.getAddress())) { logger.info("{} joined with load factor: {}", joinedMember, loadFactor); } if (logger.isDebugEnabled()) { logger.debug("Got a network of members: {}", members.values()); } } else { logger.warn("Received join message from '{}', but a connection with the sender has been lost.", message.getSrc().toString()); } }
Source:
<code>private void retrieveTenantsConfiguration(PlatformAPI platformAPI) throws IOException { Map<Long, Map<String, byte[]>> clientPlatformConfigurations = platformAPI.getClientTenantConfigurations(); <START> for (Map.Entry<Long, Map<String, byte[]>> longMapEntry : clientPlatformConfigurations.entrySet()) { <END> ConfigurationFilesManager.getInstance().setTenantConfigurations(longMapEntry.getValue(), longMapEntry.getKey()); } }</code><technical_language>rename local variable</technical_language>

Target:
private void retrieveTenantsConfiguration(PlatformAPI platformAPI) throws IOException { Map<Long, Map<String, byte[]>> clientPlatformConfigurations = platformAPI.getClientTenantConfigurations(); for (Map.Entry<Long, Map<String, byte[]>> tenantConfiguration : clientPlatformConfigurations.entrySet()) { ConfigurationFilesManager.getInstance().setTenantConfigurations(tenantConfiguration.getValue(), tenantConfiguration.getKey()); } }
Source:
<code>private static void whoAmI(boolean canLogOut) { Account account = getUserAccount(); final CurrentUserPopupPanel userPopup = new CurrentUserPopupPanel(account, canLogOut); final String name = FormatUtil.name(account); <START> String[] names = name.split("\\s+", 2); <END> final InlineLabel l = new InlineLabel(names[0] + " ▾"); l.setStyleName(RESOURCES.css().menuBarUserName()); l.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (userPopup.isShowing()) { userPopup.hide(); } else { userPopup.showRelativeTo(l); } } }); userPopup.addAutoHidePartner(l.getElement()); menuRight.add(l); }</code><technical_language>This work if user name is formatted "Surname, Firstname". name is displayed "Surname,"</technical_language>

Target:
private static void whoAmI(boolean canLogOut) { Account account = getUserAccount(); final CurrentUserPopupPanel userPopup = new CurrentUserPopupPanel(account, canLogOut); final InlineLabel l = new InlineLabel(FormatUtil.name(account) + " ▾"); l.setStyleName(RESOURCES.css().menuBarUserName()); l.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (userPopup.isShowing()) { userPopup.hide(); } else { userPopup.showRelativeTo(l); } } }); userPopup.addAutoHidePartner(l.getElement()); FocusPanel fp = new FocusPanel(l); fp.setStyleName(RESOURCES.css().menuBarUserNameFocusPanel()); fp.addKeyDownHandler(new KeyDownHandler() { @Override public void onKeyDown(KeyDownEvent event) { if(event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { if (userPopup.isShowing()) { userPopup.hide(); } else { userPopup.showRelativeTo(l); } event.preventDefault(); } } }); menuRight.add(fp); }
Source:
<code>public Builder withCreatedAt(Date createdAt) { <START> if (createdAt != null) { <END> accountAttributes.createdAt = createdAt; } return this; }</code><technical_language>null check necessary if add validation checks end</technical_language>

Target:
public Builder withCreatedAt(Date createdAt) { accountAttributes.createdAt = createdAt; return this; }
Source:
<code>public static ZoneOffset ofHoursMinutes(int hours, int minutes) { <START> checkArgument(Math.abs(hours) <= 17, "offset hour size must be between -17 and 17 hours inclusive"); <END> checkArgument(Math.abs(minutes) <= 60, "offset minute size must be between -60 and 60 minutes inclusive"); @SuppressWarnings("NumericCastThatLosesPrecision") final int secondsInHours = (int) Durations.toSeconds(Durations.ofHours(hours)) ; final int secondsInMinutes = (int) Durations.toSeconds(Durations.ofMinutes(minutes)) ; final int seconds = secondsInHours + secondsInMinutes; return ZoneOffset.newBuilder() .setAmountSeconds(seconds) .build(); }</code><technical_language>constants for 17 60</technical_language>

Target:
public static ZoneOffset ofHoursMinutes(int hours, int minutes) { final int maxHoursBound = 17; final int maxMinutesBound = 60; checkArgument(Math.abs(hours) <= maxHoursBound, "offset hour size must be between -17 and 17 hours inclusive"); checkArgument(Math.abs(minutes) <= maxMinutesBound, "offset minute size must be between -60 and 60 minutes inclusive"); final int secondsInHours = (int) Durations.toSeconds(Durations.ofHours(hours)); final int secondsInMinutes = (int) Durations.toSeconds(Durations.ofMinutes(minutes)); final int seconds = secondsInHours + secondsInMinutes; return ZoneOffset.newBuilder() .setAmountSeconds(seconds) .build(); }
Source:
<code>private Statement withClassRules(Statement statement) { <START> return RunRules.applyAll(statement, classRules(), getDescription()); <END> }</code><technical_language>applying rules in this method. Instead, return a Statement applies rules, rules applied final statement is evaluated. RunRules is a Statement</technical_language>

Target:
private Statement withClassRules(Statement statement) { List<TestRule> classRules = classRules(); return classRules.isEmpty() ? statement : new RunRules(statement, classRules, getDescription()); }
Source:
<code>default <U> Seq<U> flatMap(Function<? super Tuple2<K, V>, ? extends Iterable<? extends U>> mapper) { Objects.requireNonNull(mapper, "mapper is null"); <START> return Stream.ofAll(iterator()).flatMap(mapper); <END> }</code><technical_language>built-in toStream() instead: java return toStream().flatMap(mapper);</technical_language>

Target:
default <U> Seq<U> flatMap(Function<? super Tuple2<K, V>, ? extends Iterable<? extends U>> mapper) { Objects.requireNonNull(mapper, "mapper is null"); return (Seq<U>) iterator().flatMap(mapper).toStream(); }
Source:
<code>NonBlockingRouter(RouterConfig routerConfig, NonBlockingRouterMetrics routerMetrics, NetworkClientFactory networkClientFactory, NotificationSystem notificationSystem, ClusterMap clusterMap, KeyManagementService kms, CryptoService cryptoService, CryptoJobHandler cryptoJobHandler, Time time) throws IOException { this.routerConfig = routerConfig; this.routerMetrics = routerMetrics; this.networkClientFactory = networkClientFactory; this.notificationSystem = notificationSystem; this.clusterMap = clusterMap; responseHandler = new ResponseHandler(clusterMap); this.kms = kms; this.cryptoService = cryptoService; this.cryptoJobHandler = cryptoJobHandler; if (cryptoJobHandler != null) { <START> cryptoJobHandler.start(); <END> } this.time = time; ocCount = routerConfig.routerScalingUnitCount; ocList = new ArrayList<>(); for (int i = 0; i < ocCount; i++) { ocList.add(new OperationController(Integer.toString(i))); } backgroundDeleter = new BackgroundDeleter(); ocList.add(backgroundDeleter); routerMetrics.initializeNumActiveOperationsMetrics(currentOperationsCount, currentBackgroundOperationsCount); }</code><technical_language>this unnecessary step - factory do yet, constructor of CryptoJobHandler do it</technical_language>

Target:
NonBlockingRouter(RouterConfig routerConfig, NonBlockingRouterMetrics routerMetrics, NetworkClientFactory networkClientFactory, NotificationSystem notificationSystem, ClusterMap clusterMap, KeyManagementService kms, CryptoService cryptoService, CryptoJobHandler cryptoJobHandler, Time time) throws IOException { this.routerConfig = routerConfig; this.routerMetrics = routerMetrics; this.networkClientFactory = networkClientFactory; this.notificationSystem = notificationSystem; this.clusterMap = clusterMap; responseHandler = new ResponseHandler(clusterMap); this.kms = kms; this.cryptoService = cryptoService; this.cryptoJobHandler = cryptoJobHandler; this.time = time; ocCount = routerConfig.routerScalingUnitCount; ocList = new ArrayList<>(); for (int i = 0; i < ocCount; i++) { ocList.add(new OperationController(Integer.toString(i))); } backgroundDeleter = new BackgroundDeleter(); ocList.add(backgroundDeleter); routerMetrics.initializeNumActiveOperationsMetrics(currentOperationsCount, currentBackgroundOperationsCount); }
Source:
<code>public void topic() throws Exception { PushOneCommit.Result r = createChange(); assertEquals("", gApi.changes() <START> .id("p~master~" + r.getChangeId()) <END> .topic()); gApi.changes() .id("p~master~" + r.getChangeId()) .topic("mytopic"); assertEquals("mytopic", gApi.changes() .id("p~master~" + r.getChangeId()) .topic()); gApi.changes() .id("p~master~" + r.getChangeId()) .topic(""); assertEquals("", gApi.changes() .id("p~master~" + r.getChangeId()) .topic()); }</code><technical_language>[Optional] r.getChangeId(). below</technical_language>

Target:
public void topic() throws Exception { PushOneCommit.Result r = createChange(); assertEquals("", gApi.changes() .id(r.getChangeId()) .topic()); gApi.changes() .id(r.getChangeId()) .topic("mytopic"); assertEquals("mytopic", gApi.changes() .id(r.getChangeId()) .topic()); gApi.changes() .id(r.getChangeId()) .topic(""); assertEquals("", gApi.changes() .id(r.getChangeId()) .topic()); }
Source:
<code>public void testAlterSchema() throws Exception { String topic = "test"; Schema avroSchema = AvroData.fromCopycatSchema(createSchema()); HiveExec hiveExec = new HiveExec(conf, connectorConfig); runHive(hiveExec, "DROP TABLE " + topic); hiveExec.createAvroTable(topic, avroSchema); <START> Schema newAvroSchema = AvroData.fromCopycatSchema(createNewSchema()); <END> hiveExec.alterScheam(topic, newAvroSchema); String description = runHive(hiveExec, "DESCRIBE " + topic); String[] colTypes = {"boolean", "int", "bigint", "float", "double", "string"}; String[] lines = description.split("\n"); for (int i = 0; i < colTypes.length; ++i) { String[] parts = lines[i].replace(" ", "").split("\t"); assertEquals(colTypes[i], parts[1]); } }</code><technical_language>Is worth testing this data? altering table</technical_language>

Target:
public void testAlterSchema() throws Exception { prepareData(TOPIC, PARTITION); Schema avroSchema = avroData.fromCopycatSchema(createSchema()); HiveExec hiveExec = new HiveExec(conf, connectorConfig); runHive(hiveExec, "DROP TABLE " + TOPIC); hiveExec.createAvroTable(TOPIC, avroSchema); hiveExec.addPartition(TOPIC, PARTITION); hiveExec.setPartitionLoc(TOPIC, PARTITION); Schema newAvroSchema = avroData.fromCopycatSchema(createNewSchema()); hiveExec.alterSchema(TOPIC, newAvroSchema); String description = runHive(hiveExec, "DESCRIBE " + TOPIC); String[] colTypes = {"boolean", "int", "bigint", "float", "double", "string"}; String[] lines = description.split("\n"); for (int i = 0; i < colTypes.length; ++i) { String[] parts = parseOutput(lines[i]); assertEquals(colTypes[i], parts[1]); } String[] expectedResult = {"true", "12", "12", "12.2", "12.2", "abc", "12"}; String result = runHive(hiveExec, "SELECT * from " + TOPIC); String[] rows = result.split("\n"); assertEquals(7, rows.length); for (String row: rows) { String[] parts = parseOutput(row); for (int j = 0; j < expectedResult.length; ++j) { assertEquals(expectedResult[j], parts[j]); } } }
Source:
<code>public static void writeUpdateMessagesToFile(String text) { PrintWriter writer = null; File destFile = new File(OpenmrsUtil.getApplicationDataDirectory(), DatabaseUpdater.DATABASE_UPDATES_LOG_FILE); try { String lineSeparator = System.getProperty("line.separator"); Date date = Calendar.getInstance().getTime(); <START> writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(destFile, true), StandardCharsets.UTF_8))); <END> writer.write("********** START OF DATABASE UPDATE LOGS AS AT " + date + " **********"); writer.write(lineSeparator); writer.write(lineSeparator); writer.write(text); writer.write(lineSeparator); writer.write(lineSeparator); writer.write("*********** END OF DATABASE UPDATE LOGS AS AT " + date + " ***********"); writer.write(lineSeparator); writer.write(lineSeparator); if (writer.checkError()) { log.warn("An Error occured while writing warnings to the database update log file'"); } writer.close(); } catch (FileNotFoundException e) { log.warn("Failed to find the database update log file", e); } catch (IOException e) { log.warn("Failed to write to the database update log file", e); } finally { IOUtils.closeQuietly(writer); } }</code><technical_language>approve this for now. separate some of lines though. :- Reader reader = new InputStreamReader(new FileInputStream(fileName), StandardCharsets.UTF_8); BufferedReader br = new BufferedReader(reader); @dkayiwa if is required :)</technical_language>

Target:
public static void writeUpdateMessagesToFile(String text) { OutputStreamWriter streamWriter = null; PrintWriter writer = null; File destFile = new File(OpenmrsUtil.getApplicationDataDirectory(), DatabaseUpdater.DATABASE_UPDATES_LOG_FILE); try { String lineSeparator = System.getProperty("line.separator"); Date date = Calendar.getInstance().getTime(); streamWriter = new OutputStreamWriter(new FileOutputStream(destFile, true), StandardCharsets.UTF_8); writer = new PrintWriter(new BufferedWriter(streamWriter)); writer.write("********** START OF DATABASE UPDATE LOGS AS AT " + date + " **********"); writer.write(lineSeparator); writer.write(lineSeparator); writer.write(text); writer.write(lineSeparator); writer.write(lineSeparator); writer.write("*********** END OF DATABASE UPDATE LOGS AS AT " + date + " ***********"); writer.write(lineSeparator); writer.write(lineSeparator); if (writer.checkError()) { log.warn("An Error occured while writing warnings to the database update log file'"); } writer.close(); } catch (FileNotFoundException e) { log.warn("Failed to find the database update log file", e); } catch (IOException e) { log.warn("Failed to write to the database update log file", e); } finally { IOUtils.closeQuietly(streamWriter); IOUtils.closeQuietly(writer); } }
Source:
<code>public boolean handleHeaderCell(final GridWidget gridWidget, final Point2D relativeLocation, final int uiHeaderRowIndex, final int uiHeaderColumnIndex, final AbstractNodeMouseEvent event) { final double cx = relativeLocation.getX(); final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper(); final BaseGridRendererHelper.ColumnInformation ci = rendererHelper.getColumnInformation(cx); final GridColumn<?> column = ci.getColumn(); if (column == null) { return false; } if (!EditableHeaderUtilities.hasEditableHeader(column)) { return false; } if (!EditableHeaderUtilities.isEditableHeader(column, uiHeaderRowIndex)) { return false; } final Point2D gridWidgetComputedLocation = gridWidget.getComputedLocation(); final BaseGridRendererHelper.RenderingInformation ri = rendererHelper.getRenderingInformation(); final EditableHeaderMetaData headerMetaData = (EditableHeaderMetaData) column.getHeaderMetaData().get(uiHeaderRowIndex); final GridBodyCellEditContext context = EditableHeaderUtilities.makeRenderContext(gridWidget, ri, ci, relativeLocation.add(gridWidgetComputedLocation), uiHeaderRowIndex); final GridData gridData = gridWidget.getModel(); <START> if (gridData.getSelectedHeaderCells().size() == 1) { <END> if (Objects.equals(headerMetaData.getSupportedEditAction(), GridCellEditAction.getSupportedEditAction(event))) { headerMetaData.edit(context); return true; } } return false; }</code><technical_language>Please double check in decision table multiple outputs invocation header cell BKM name is filled</technical_language>

Target:
public boolean handleHeaderCell(final GridWidget gridWidget, final Point2D relativeLocation, final int uiHeaderRowIndex, final int uiHeaderColumnIndex, final AbstractNodeMouseEvent event) { final double cx = relativeLocation.getX(); final BaseGridRendererHelper rendererHelper = gridWidget.getRendererHelper(); final BaseGridRendererHelper.ColumnInformation ci = rendererHelper.getColumnInformation(cx); final GridColumn<?> column = ci.getColumn(); if (column == null) { return false; } if (!EditableHeaderUtilities.hasEditableHeader(column)) { return false; } if (!EditableHeaderUtilities.isEditableHeader(column, uiHeaderRowIndex)) { return false; } final Point2D gridWidgetComputedLocation = gridWidget.getComputedLocation(); final BaseGridRendererHelper.RenderingInformation ri = rendererHelper.getRenderingInformation(); final EditableHeaderMetaData headerMetaData = (EditableHeaderMetaData) column.getHeaderMetaData().get(uiHeaderRowIndex); final GridBodyCellEditContext context = EditableHeaderUtilities.makeRenderContext(gridWidget, ri, ci, relativeLocation.add(gridWidgetComputedLocation), uiHeaderRowIndex); if (isHeaderSelectionValid(gridWidget)) { if (Objects.equals(headerMetaData.getSupportedEditAction(), GridCellEditAction.getSupportedEditAction(event))) { headerMetaData.edit(context); return true; } } return false; }
Source:
<code>public void waitTextNotPresentIntoLeftEditor(String expText) { <START> webDriverWaitFactory <END> .get() .until( (ExpectedCondition<Boolean>) webDriver -> !(getTextFromLeftEditorCompare().contains(expText))); }</code><technical_language>rewrite code SeleniumWebDriverHelper class</technical_language>

Target:
public void waitTextNotPresentIntoLeftEditor(String expText) { seleniumWebDriverHelper.waitTextIsNotPresented(leftCompareEditor, expText); }
Source:
<code>protected void checkArgType(ObjectInspector[] arguments, int i, PrimitiveCategory type) throws UDFArgumentTypeException{ PrimitiveCategory primitiveCategory = ((PrimitiveObjectInspector) arguments[i]).getPrimitiveCategory(); if (primitiveCategory != type) { throw new <START> UDFArgumentTypeException(0, <END> "A " + type.getClass().getSimpleName() + " argument was expected for " + getFuncName() + " but an argument of type " + arguments[i].getTypeName() + " was given." ); } }</code><technical_language>i? 0 previously... if existing bug if set purpose</technical_language>

Target:
protected void checkArgType(ObjectInspector[] arguments, int i, PrimitiveCategory type) throws UDFArgumentTypeException{ checkArgType(arguments[i], i, type); }
Source:
<code>public void close() throws Exception { <START> if (!closed.get()) { <END> closed.set(true); socket.close(); executorService.shutdown(); } }</code><technical_language>closed.compareAndSet</technical_language>

Target:
public void close() throws Exception { if (closed.compareAndSet(false, true)) { socket.close(); executorService.shutdown(); } }
Source:
<code>private void markChildComponentsAsUnsafeWhereApplicable(Component component) { Component initialComponent = component.getParentComponent(); <START> if (component.getParentComponent().getParentComponent() != null) { <END> initialComponent = component.getParentComponent().getParentComponent(); } for (ComponentStatusChange statusChange : initialComponent.getStatusChanges()) { boolean dontMarkComponentAsUnsafeForThisStatusChange = statusChange.getStatusChangeReason().getType() .equals(ComponentStatusChangeReasonType.TEST_RESULTS_CONTAINS_PLASMA) && !component.getComponentType().getContainsPlasma(); if (!dontMarkComponentAsUnsafeForThisStatusChange) { markComponentAsUnsafe(component, ComponentStatusChangeReasonType.UNSAFE_PARENT); return; } } }</code><technical_language>This in a while loop n levels of processing in system</technical_language>

Target:
private void markChildComponentsAsUnsafeWhereApplicable(Component component) { Component initialComponent = component.getParentComponent(); while (initialComponent.getParentComponent() != null) { initialComponent = initialComponent.getParentComponent(); } boolean markComponentAsUnsafe = false; if (initialComponent.getStatusChanges() != null) { for (ComponentStatusChange statusChange : initialComponent.getStatusChanges()) { if (statusChange.getIsDeleted()) { continue; } if (!component.getComponentType().getContainsPlasma() && statusChange.getStatusChangeReason().getCategory() == ComponentStatusChangeReasonCategory.UNSAFE && statusChange.getStatusChangeReason().getType() == ComponentStatusChangeReasonType.TEST_RESULTS_CONTAINS_PLASMA) { continue; } if (statusChange.getStatusChangeReason().getCategory() == ComponentStatusChangeReasonCategory.UNSAFE) { markComponentAsUnsafe = true; break; } } } if (markComponentAsUnsafe) { markComponentAsUnsafe(component, ComponentStatusChangeReasonType.UNSAFE_PARENT); } }
Source:
<code>public void createNewRAVESettings() throws InterruptedException { homePage.openAdmin(); adminPage.manageModules(); modulesPage.openEbodacSettings(); Long startTime = Long.valueOf(System.currentTimeMillis()); while (System.currentTimeMillis() - startTime.longValue() < START_TIME_LONG_VALUE) { try { ebodacSettingsPage.enableRAVE(); ebodacSettingsPage.setHostName(); ebodacSettingsPage.setPort(); ebodacSettingsPage.setRemoteFolder(); ebodacSettingsPage.setUsername(); ebodacSettingsPage.setPassword(); ebodacSettingsPage.setEmail(); } catch (Exception e) { <START> Log.info("createNewRAVESettings exception"); <END> } } ebodacSettingsPage.saveValues(); }</code><technical_language>In Ebodac logger, for in code</technical_language>

Target:
public void createNewRAVESettings() throws InterruptedException { homePage.openAdmin(); adminPage.manageModules(); modulesPage.openEbodacSettings(); Long startTime = Long.valueOf(System.currentTimeMillis()); while (System.currentTimeMillis() - startTime.longValue() < START_TIME_LONG_VALUE) { try { ebodacSettingsPage.enableRAVE(); ebodacSettingsPage.setHostName(); ebodacSettingsPage.setPort(); ebodacSettingsPage.setRemoteFolder(); ebodacSettingsPage.setUsername(); ebodacSettingsPage.setPassword(); ebodacSettingsPage.setEmail(); } catch (Exception e) { LOGGER.info("CreateNewRAVESettings exception"); } } ebodacSettingsPage.saveValues(); }
Source:
<code>public void testApply(DimensionSpec dimensionSpec, Map<String, String> map) { for (Map.Entry<String, String> entry : map.entrySet()) { <START> Assert.assertEquals(StringUtils.emptyToNullNonDruidDataString(entry.getValue()), dimensionSpec.getExtractionFn().apply(entry.getKey())); <END> } }</code><technical_language>question</technical_language>

Target:
public void testApply(DimensionSpec dimensionSpec, Map<String, String> map) { for (Map.Entry<String, String> entry : map.entrySet()) { Assert.assertEquals( NullHandling.emptyToNullIfNeeded(entry.getValue()), dimensionSpec.getExtractionFn().apply(entry.getKey()) ); } }
Source:
<code>public static GeoIndexerType getGeoIndexerType(final Configuration conf) { <START> String confType[] = conf.getStrings(GEO_INDEXER_TYPE); <END> if (confType==null){ return null; } try { return GeoIndexerType.valueOf(GeoIndexerType.class, confType[0]); } catch (IllegalArgumentException e) { throw new Error("Configuration contains an unknown GeoIndexerType, found: \""+GEO_INDEXER_TYPE+"\"="+confType[0]); } }</code><technical_language>a get() a default need do a null check confType</technical_language>

Target:
public static GeoIndexerType getGeoIndexerType(final Configuration conf) { String confType[] = conf.getStrings(GEO_INDEXER_TYPE, GeoIndexerType.UNSPECIFIED.name()); try { return GeoIndexerType.valueOf(GeoIndexerType.class, confType[0]); } catch (IllegalArgumentException e) { throw new Error("Configuration contains an unknown GeoIndexerType, found: \""+GEO_INDEXER_TYPE+"\"="+confType[0]); } }
Source:
<code>public static ResourceMapping[] getResourceMappings( @NonNull IResource resource, ResourceMappingContext context) { final IModelProviderDescriptor[] modelDescriptors = ModelProvider .getModelProviderDescriptors(); final Set<ResourceMapping> mappings = new LinkedHashSet<ResourceMapping>(); for (IModelProviderDescriptor candidate : modelDescriptors) { <START> if (candidate.getId().startsWith("org.eclipse.egit")) { END> continue; } try { final IResource[] resources = candidate .getMatchingResources(new IResource[] { resource, }); if (resources.length > 0) { final ModelProvider model = candidate.getModelProvider(); final ResourceMapping[] modelMappings = model.getMappings( resource, context, new NullProgressMonitor()); for (ResourceMapping mapping : modelMappings) mappings.add(mapping); } } catch (CoreException e) { Activator.logError(e.getMessage(), e); } } return mappings.toArray(new ResourceMapping[mappings.size()]); }</code><technical_language>is this related this change</technical_language>

Target:
public static ResourceMapping[] getResourceMappings( @NonNull IResource resource, ResourceMappingContext context) { final IModelProviderDescriptor[] modelDescriptors = ModelProvider .getModelProviderDescriptors(); final Set<ResourceMapping> mappings = new LinkedHashSet<ResourceMapping>(); for (IModelProviderDescriptor candidate : modelDescriptors) { try { final IResource[] resources = candidate .getMatchingResources(new IResource[] { resource, }); if (resources.length > 0) { final ModelProvider model = candidate.getModelProvider(); IgnoreInGitSynchronizations adapter = model .getAdapter(IgnoreInGitSynchronizations.class); if (adapter != null) { continue; } final ResourceMapping[] modelMappings = model.getMappings( resource, context, new NullProgressMonitor()); for (ResourceMapping mapping : modelMappings) mappings.add(mapping); } } catch (CoreException e) { Activator.logError(e.getMessage(), e); } } return mappings.toArray(new ResourceMapping[mappings.size()]); }
Source:
<code>public void markRollbackOnly() { <START> if ( getStatus() != TransactionStatus.ROLLED_BACK ) { <END> if ( log.isDebugEnabled() ) { log.debug( "JDBC transaction marked for rollback-only (exception provided for stack trace)", new Exception( "exception just for purpose of providing stack trace" ) ); } rollbackOnly = true; } }</code><technical_language>I need check transaction is NOT_ACTIVE</technical_language>

Target:
public void markRollbackOnly() { if ( getStatus() != TransactionStatus.ROLLED_BACK && getStatus() != TransactionStatus.NOT_ACTIVE ) { if ( log.isDebugEnabled() ) { log.debug( "JDBC transaction marked for rollback-only (exception provided for stack trace)", new Exception( "exception just for purpose of providing stack trace" ) ); } rollbackOnly = true; } }
Source:
<code>protected void onCreate(Bundle b) { super.onCreate(b); String user = ""; String email = ""; String newSessionId = ""; Intent i = new Intent(); i.setAction("com.insecure.action.UserConnected"); i.putExtra("username", user); i.putExtra("email", email); i.putExtra("session", newSessionId); sendBroadcast(i); sendBroadcast(i, null); sendBroadcastAsUser(i, null); sendBroadcastAsUser(i,null,null); sendOrderedBroadcast(i,null); sendOrderedBroadcast(i,null,null,null,0,null,null); sendOrderedBroadcastAsUser(i,null,null,null,null,0,null,null); <START> LocalBroadcastManager.getInstance(this).sendBroadcast(i); <END> }</code><technical_language>Excellent doc. :+1:</technical_language>

Target:
protected void onCreate(Bundle b) { super.onCreate(b); String user = ""; String email = ""; String newSessionId = ""; Intent i = new Intent(); i.setAction("com.insecure.action.UserConnected"); i.putExtra("username", user); i.putExtra("email", email); i.putExtra("session", newSessionId); sendBroadcast(i); sendBroadcast(i, null); sendBroadcastAsUser(i, null); sendBroadcastAsUser(i,null,null); sendOrderedBroadcast(i,null); sendOrderedBroadcast(i,null,null,null,0,null,null); sendOrderedBroadcastAsUser(i,null,null,null,null,0,null,null); LocalBroadcastManager.getInstance(this).sendBroadcast(i); CustomLocalBroadcastManager.getInstance(this).sendBroadcast(i); }
Source:
<code>protected ContentMergeViewer(int style, ResourceBundle bundle, CompareConfiguration cc) { if (Policy.debugContentMergeViewer) { logTrace("constructed (fLeftLabel == null)"); logStackTrace(); } fStyles= style & ~(SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT); fBundle= bundle; fAncestorVisible= Utilities.getBoolean(cc, ICompareUIConstants.PROP_ANCESTOR_VISIBLE, fAncestorVisible); fConfirmSave= Utilities.getBoolean(cc, CompareEditor.CONFIRM_SAVE_PROPERTY, fConfirmSave); defaultContentProvider = new MergeViewerContentProvider(cc); leftToRight = <START> cc.getProperty(ComparePreferencePage.LAYOUT).equals(ICompareUIConstants.PREF_VALUE_LEFT_TO_RIGHT); <END> updateContentProvider(); fCompareInputChangeListener= new ICompareInputChangeListener() { public void compareInputChanged(ICompareInput input) { if (input == getInput()) { handleCompareInputChange(); } } }; if (cc == null) fCompareConfiguration = new CompareConfiguration(); else fCompareConfiguration= cc; fPropertyChangeListener= new IPropertyChangeListener() { public void propertyChange(PropertyChangeEvent event) { ContentMergeViewer.this.handlePropertyChangeEvent(event); } }; fCompareConfiguration.addPropertyChangeListener(fPropertyChangeListener); fIsLeftDirty = false; fIsRightDirty = false; }</code><technical_language>I personally exchange equals arguments, if property is null for reason..</technical_language>

Target:
protected ContentMergeViewer(int style, ResourceBundle bundle, CompareConfiguration cc) { if (Policy.debugContentMergeViewer) { logTrace("constructed (fLeftLabel == null)"); logStackTrace(); } fStyles= style & ~(SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT); fBundle= bundle; fAncestorVisible= Utilities.getBoolean(cc, ICompareUIConstants.PROP_ANCESTOR_VISIBLE, fAncestorVisible); fConfirmSave= Utilities.getBoolean(cc, CompareEditor.CONFIRM_SAVE_PROPERTY, fConfirmSave); defaultContentProvider = new MergeViewerContentProvider(cc); leftToRight = ICompareUIConstants.PREF_VALUE_LEFT_TO_RIGHT .equals(cc.getProperty(ComparePreferencePage.LAYOUT)); updateContentProvider(); fCompareInputChangeListener= new ICompareInputChangeListener() { @Override public void compareInputChanged(ICompareInput input) { if (input == getInput()) { handleCompareInputChange(); } } }; if (cc == null) fCompareConfiguration = new CompareConfiguration(); else fCompareConfiguration= cc; fPropertyChangeListener= new IPropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent event) { ContentMergeViewer.this.handlePropertyChangeEvent(event); } }; fCompareConfiguration.addPropertyChangeListener(fPropertyChangeListener); fIsLeftDirty = false; fIsRightDirty = false; }
Source:
<code>public JournalContext createJournalContext() throws UnavailableException { <START> return mJournal.createJournalContext(mMasterContext.stateChangeLock()); <END> }</code><technical_language>leave Journal interfaces wrap context a forwarder context holds lock. Journal implementations need manage lock</technical_language>

Target:
public JournalContext createJournalContext() throws UnavailableException { return new StateChangeJournalContext(mJournal.createJournalContext(), mMasterContext.stateChangeLock()); }