auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void onReceiveComplete(Delivery delivery) { Message responseMessage; try { responseMessage = Util.readMessageFromDelivery(this.receiveLink, delivery); delivery.disposition(Accepted.getInstance()); delivery.settle(); } catch (Exception e) { TRACE_LOGGER.warn("Reading message from delivery failed with unexpected exception.", e); delivery.disposition(Released.getInstance()); delivery.settle(); return; } final Message finalResponseMessage = responseMessage; <START> try { <END> MessagingFactory.INTERNAL_THREAD_POOL.submit(() -> { String requestMessageId = (String) finalResponseMessage.getCorrelationId(); if (requestMessageId != null) { TRACE_LOGGER.debug("RequestRespnseLink received response for request with id :{}", requestMessageId); this.parent.completeRequestWithResponse(requestMessageId, finalResponseMessage); } else { TRACE_LOGGER.warn("RequestRespnseLink received a message with null correlationId"); } }); } catch (RejectedExecutionException | NullPointerException e) { TRACE_LOGGER.error("RequestRespnseLink error message:" + e.getMessage()); } }</code><technical_language>double check service team if this is want do exceptions</technical_language>

Target:
public void onReceiveComplete(Delivery delivery) { Message responseMessage; try { responseMessage = Util.readMessageFromDelivery(this.receiveLink, delivery); delivery.disposition(Accepted.getInstance()); delivery.settle(); } catch (Exception e) { TRACE_LOGGER.warn("Reading message from delivery failed with unexpected exception.", e); delivery.disposition(Released.getInstance()); delivery.settle(); return; } final Message finalResponseMessage = responseMessage; MessagingFactory.INTERNAL_THREAD_POOL.submit(() -> { String requestMessageId = (String) finalResponseMessage.getCorrelationId(); if (requestMessageId != null) { TRACE_LOGGER.debug("RequestRespnseLink received response for request with id :{}", requestMessageId); this.parent.completeRequestWithResponse(requestMessageId, finalResponseMessage); } else { TRACE_LOGGER.warn("RequestRespnseLink received a message with null correlationId"); } }); }
Source:
<code>public static BatteryObject getMjBattery (Object o) { BatteryField f = getMjBattery (o.getClass()); if (f != null) { if (f.kind == BatteryKind.Value) { BatteryObject obj = new BatteryObject(); obj.o = o; obj.f = f; return obj; } else { try { return getMjBattery(f.field.get(o)); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); <START> } <END> } } return null; }</code><technical_language>confused this change. Is else other code reorganization? If not, current version is desirable, more clear branches returning values</technical_language>

Target:
public static BatteryObject getMjBattery (Object o) { BatteryField f = getMjBattery (o.getClass()); if (f == null) { return null; } else if (f.kind == BatteryKind.Value) { BatteryObject obj = new BatteryObject(); obj.o = o; obj.f = f; return obj; } else { try { return getMjBattery(f.field.get(o)); } catch (IllegalArgumentException e) { e.printStackTrace(); return null; } catch (IllegalAccessException e) { e.printStackTrace(); return null; } } }
Source:
<code>static int getUnusedByte(final byte[] array) { final byte[] usage = new byte[256]; <START> for (final byte b : array) { <END> usage[0xFF & b] = 1; } for (int i = 0; i < 256; i++) { if (usage[i] == 0) return i; } return -1; }</code><technical_language>size of usage array based length of input array. If 256 is required, check ensure input array is size</technical_language>

Target:
static int getUnusedByte(final byte[] array) { final byte[] usage = new byte[BYTE_SPACE_SIZE]; for (final byte b : array) { usage[0xFF & b] = 1; } for (int i = 0; i < usage.length; i++) { if (usage[i] == 0) return i; } return ALL_BYTES_USED; }
Source:
<code>public void itPrefersPrimaryConfigForNonMergableFieldsWhenMergingConfigs() { <START> BuildConfigUtils configUtils = new BuildConfigUtils(blazarConfiguration, gitHubHelper); <END> BuildConfig mergedConfig = configUtils.mergeConfig(primaryConfig, secondaryConfig); assertThat(mergedConfig.getSteps()).isEqualTo(primaryConfig.getSteps()); assertThat(mergedConfig.getBefore()).isEqualTo(primaryConfig.getBefore()); assertThat(mergedConfig.getAfter()).isEqualTo(primaryConfig.getAfter()); assertThat(mergedConfig.getBuildpack()).isEqualTo(primaryConfig.getBuildpack()); assertThat(mergedConfig.getUser()).isEqualTo(primaryConfig.getUser()); assertThat(mergedConfig.getBuildResources()).isEqualTo(primaryConfig.getBuildResources()); }</code><technical_language>Refactor a static reuse in tests</technical_language>

Target:
public void itPrefersPrimaryConfigForNonMergableFieldsWhenMergingConfigs() { BuildConfig mergedConfig = configUtils.mergeConfig(primaryConfig, secondaryConfig); assertThat(mergedConfig.getSteps()).isEqualTo(primaryConfig.getSteps()); assertThat(mergedConfig.getBefore()).isEqualTo(primaryConfig.getBefore()); assertThat(mergedConfig.getAfter()).isEqualTo(primaryConfig.getAfter()); assertThat(mergedConfig.getBuildpack()).isEqualTo(primaryConfig.getBuildpack()); assertThat(mergedConfig.getUser()).isEqualTo(primaryConfig.getUser()); assertThat(mergedConfig.getBuildResources()).isEqualTo(primaryConfig.getBuildResources()); }
Source:
<code><START> public int hashCode() { <END> return Objects.hash( id, autoStartup, cpuPerSocket, threadsPerCpu, creationDate, defaultBootSequence, description, failBack, initrdUrl, isoPath, kernelParams, kernelUrl, osId, memSizeMb, maxMemorySizeMb, niceLevel, cpuShares, numOfSockets, numOfMonitors, origin, priority, stateless, smartcardEnabled, timeZone, usbPolicy, clusterId, vmType, quotaId, allowConsoleReconnect, dedicatedVmForVdsList, migrationSupport, tunnelMigration, vncKeyboardLayout, createdByUserId, defaultDisplayType, migrationDowntime, serialNumberPolicy, customSerialNumber, bootMenuEnabled, spiceFileTransferEnabled, spiceCopyPasteEnabled, cpuProfileId, numaTuneMode, vNumaNodeList, autoConverge, migrateCompressed, predefinedProperties, userDefinedProperties, customEmulatedMachine, customCpuName, smallIconId, largeIconId, consoleDisconnectAction, customCompatibilityVersion ); }</code><technical_language>want include resumeBehavior field hashCode() equals() methods</technical_language>

Target:
public int hashCode() { return Objects.hash( id, autoStartup, cpuPerSocket, threadsPerCpu, creationDate, defaultBootSequence, description, failBack, initrdUrl, isoPath, kernelParams, kernelUrl, osId, memSizeMb, maxMemorySizeMb, niceLevel, cpuShares, numOfSockets, numOfMonitors, origin, priority, stateless, smartcardEnabled, timeZone, usbPolicy, clusterId, vmType, quotaId, allowConsoleReconnect, dedicatedVmForVdsList, migrationSupport, tunnelMigration, vncKeyboardLayout, createdByUserId, defaultDisplayType, migrationDowntime, serialNumberPolicy, customSerialNumber, bootMenuEnabled, spiceFileTransferEnabled, spiceCopyPasteEnabled, cpuProfileId, numaTuneMode, vNumaNodeList, autoConverge, migrateCompressed, predefinedProperties, userDefinedProperties, customEmulatedMachine, customCpuName, smallIconId, largeIconId, consoleDisconnectAction, customCompatibilityVersion, resumeBehavior ); }
Source:
<code>public static String toString(Serializable o) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = null; try { if(useJBoss){ oos=new JBossObjectOutputStream(baos); } else{ oos=new ObjectOutputStream(baos); } oos.writeObject(o); } catch (IOException e) { log.error("Serialization exception ", e); throw new TechnicalException(e); } finally { if (oos!=null){ try { oos.close(); } catch (IOException e) { log.warn("Exception during closing OutputStream: ",e); } } } String s = new String(Base64Coder.encode(baos.toByteArray())); if (s.isEmpty()) { log.info("toString({}, '{}', '{}')", new Object[] {toStringCount.getAndIncrement(), s, o}); } try { <START> baos.close(); <END> } catch (IOException e) { log.warn("Exception during closing OutputStream: ",e); } return s; }</code><technical_language>do close baos here, while do in finally block in another situations</technical_language>

Target:
public static String toString(Serializable o) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream oos = null; try { if(useJBoss){ oos=new JBossObjectOutputStream(baos); } else{ oos=new ObjectOutputStream(baos); } oos.writeObject(o); } catch (IOException e) { log.error("Serialization exception ", e); throw new TechnicalException(e); } finally { String s = new String(Base64Coder.encode(baos.toByteArray())); if (s.isEmpty()) { log.info("toString({}, '{}', '{}')", new Object[] {toStringCount.getAndIncrement(), s, o}); } Closeables.closeQuietly(oos); return s; } }
Source:
<code>public String getStreamConsumerArn(String stream) { if (this.streamConsumerArns == null) { return null; } <START> return streamConsumerArns.get(stream); <END> }</code><technical_language>@xiaolong-sn nit: Optional means do need null check: return Optional.ofNullable(streamConsumerArns).map(arns -> arns.get(stream));</technical_language>

Target:
public Optional<String> getStreamConsumerArn(String stream) { return Optional.ofNullable(streamConsumerArns).map(arns -> arns.get(stream)); }
Source:
<code>private void initializeDataNodeMetrics() { Gauge<Long> dataNodeCount = new Gauge<Long>() { <START> @Override <END> public Long getValue() { return clusterMapCallback.getDatanodeCount(); } }; registry.register(MetricRegistry.name(HelixClusterManager.class, "dataNodeCount"), dataNodeCount); Gauge<Long> dataNodeDownCount = new Gauge<Long>() { @Override public Long getValue() { return clusterMapCallback.getDownDatanodesCount(); } }; registry.register(MetricRegistry.name(HelixClusterManager.class, "dataNodeDownCount"), dataNodeDownCount); for (final AmbryDataNode datanode : clusterMapCallback.getDatanodes()) { final String metricName = datanode.getHostname() + "-" + datanode.getPort() + "-ResourceState"; Gauge<Long> dataNodeState = new Gauge<Long>() { @Override public Long getValue() { return datanode.getState() == HardwareState.AVAILABLE ? 1L : 0L; } }; registry.register(MetricRegistry.name(HelixClusterManager.class, metricName), dataNodeState); } }</code><technical_language>how/why is this expected change</technical_language>

Target:
void initializeDataNodeMetrics() { Gauge<Long> dataNodeCount = new Gauge<Long>() { @Override public Long getValue() { return clusterMapCallback.getDatanodeCount(); } }; registry.register(MetricRegistry.name(HelixClusterManager.class, "dataNodeCount"), dataNodeCount); Gauge<Long> dataNodeDownCount = new Gauge<Long>() { @Override public Long getValue() { return clusterMapCallback.getDownDatanodesCount(); } }; registry.register(MetricRegistry.name(HelixClusterManager.class, "dataNodeDownCount"), dataNodeDownCount); for (final AmbryDataNode datanode : clusterMapCallback.getDatanodes()) { final String metricName = datanode.getHostname() + "-" + datanode.getPort() + "-DataNodeResourceState"; Gauge<Boolean> dataNodeState = new Gauge<Boolean>() { @Override public Boolean getValue() { return datanode.getState() == HardwareState.AVAILABLE; } }; registry.register(MetricRegistry.name(HelixClusterManager.class, metricName), dataNodeState); } }
Source:
<code>public void bindEntity(Class<?> cls) { if (lookupBoundClass(cls) != null) { return; } Class<?> declaredClass = lookupIncludeClass(cls); if (declaredClass == null) { log.trace("Missing include or excluded class {}", cls.getName()); return; } Include include = (Include) getFirstAnnotation(cls, Arrays.asList(Include.class)); <START> Entity entity = (Entity) getFirstAnnotation(cls, Arrays.asList(Entity.class)); <END> String name; if (entity == null || "".equals(entity.name())) { name = StringUtils.uncapitalize(cls.getSimpleName()); } else { name = entity.name(); } String type; if ("".equals(include.type())) { type = name; } else { type = include.type(); } bindJsonApiToEntity.put(type, declaredClass); entityBindings.put(declaredClass, new EntityBinding(this, declaredClass, type, name)); if (include.rootLevel()) { bindEntityRoots.add(declaredClass); } }</code><technical_language>if getFirstAnnotation(declaredClass, Arrays.asList(Include.class))</technical_language>

Target:
public void bindEntity(Class<?> cls) { if (lookupBoundClass(cls) != null) { return; } Class<?> declaredClass = lookupIncludeClass(cls); if (declaredClass == null) { log.trace("Missing include or excluded class {}", cls.getName()); return; } Include include = (Include) getFirstAnnotation(declaredClass, Arrays.asList(Include.class)); Entity entity = (Entity) getFirstAnnotation(declaredClass, Arrays.asList(Entity.class)); String name; if (entity == null || "".equals(entity.name())) { name = StringUtils.uncapitalize(cls.getSimpleName()); } else { name = entity.name(); } String type; if ("".equals(include.type())) { type = name; } else { type = include.type(); } bindJsonApiToEntity.put(type, declaredClass); entityBindings.put(declaredClass, new EntityBinding(this, declaredClass, type, name)); if (include.rootLevel()) { bindEntityRoots.add(declaredClass); } }
Source:
<code><START> public static <@NonNull T> Iterable<@NonNull T> getAnalysisModulesOfClass(ITmfTrace trace, Class<T> moduleClass) { <END> Iterable<@NonNull IAnalysisModule> analysisModules = trace.getAnalysisModules(); Set<T> modules = new HashSet<>(); for (IAnalysisModule module : analysisModules) { if (moduleClass.isAssignableFrom(module.getClass())) { modules.add(moduleClass.cast(module)); } } return modules; }</code><technical_language>annotate part</technical_language>

Target:
public static <T> Iterable<@NonNull T> getAnalysisModulesOfClass(ITmfTrace trace, Class<T> moduleClass) { Iterable<IAnalysisModule> analysisModules = trace.getAnalysisModules(); Set<@NonNull T> modules = new HashSet<>(); for (IAnalysisModule module : analysisModules) { if (moduleClass.isAssignableFrom(module.getClass())) { modules.add(moduleClass.cast(module)); } } return modules; }
Source:
<code>public static Map<String, String> CreateStructFromConnection(final storage_server_connections connection, final storage_pool storage_pool) { <START> class ConnParamMap extends HashMap<String, String> { <END> void put(String key, Object value, Object def) { put(key, value != null ? value.toString() : def.toString()); } void putIfNotEmpty(String key, Object value) { if (value != null && !"".equals(value.toString())) { put(key, value.toString()); } } }; ConnParamMap con = new ConnParamMap(); con.put("id", connection.getid(), Guid.Empty.toString()); con.put("connection", connection.getconnection(), ""); con.put("portal", connection.getportal(), ""); con.put("port", connection.getport(), ""); con.put("iqn", connection.getiqn(), ""); con.put("user", connection.getuser_name(), ""); con.put("password", connection.getpassword(), ""); if (storage_pool != null && Config.<Boolean> GetValue(ConfigValues.AdvancedNFSOptionsEnabled, storage_pool.getcompatibility_version().getValue())) { con.putIfNotEmpty("mnt_options", connection.getMountOptions()); con.putIfNotEmpty("vfs_type", connection.getVfsType()); con.put("protocol_version", connection.getNfsVersion(), "auto"); con.putIfNotEmpty("timeout", connection.getNfsTimeo()); con.putIfNotEmpty("retrans", connection.getNfsRetrans()); } return con; }</code><technical_language>Consider moving this a top-level class in commons package (e.g., DefaultValueMaps)</technical_language>

Target:
public static Map<String, String> CreateStructFromConnection(final storage_server_connections connection, final storage_pool storage_pool) { DefaultValueMap con = new DefaultValueMap(); con.put("id", connection.getid(), Guid.Empty.toString()); con.put("connection", connection.getconnection(), ""); con.put("portal", connection.getportal(), ""); con.put("port", connection.getport(), ""); con.put("iqn", connection.getiqn(), ""); con.put("user", connection.getuser_name(), ""); con.put("password", connection.getpassword(), ""); if (storage_pool == null) { addIfNotNullOrEmpty(con, connection.getVfsType(), "vfs_type"); } else if (Config.<Boolean> GetValue(ConfigValues.AdvancedNFSOptionsEnabled, storage_pool.getcompatibility_version().getValue())) { con.putIfNotEmpty("mnt_options", connection.getMountOptions()); con.putIfNotEmpty("vfs_type", connection.getVfsType()); con.put("protocol_version", connection.getNfsVersion(), "auto"); con.putIfNotEmpty("timeout", connection.getNfsTimeo()); con.putIfNotEmpty("retrans", connection.getNfsRetrans()); } return con; }
Source:
<code>private Broadcaster<Object> getBroadcaster() { long idToUse = Thread.currentThread().getId(); Broadcaster<Object> broadcaster = broadcasterMap.get(idToUse); if (broadcaster == null) { <START> Broadcaster<Object> existingBroadcaster = broadcasterMap.putIfAbsent(idToUse, Streams.broadcast()); <END> if (existingBroadcaster == null) { broadcaster = broadcasterMap.get(idToUse); synchronized (this.monitor) { if (broadcaster.getSubscription() == null) { Stream<?> outputStream = reactorProcessor.process(broadcaster); outputStream.when(Throwable.class, new Consumer<Throwable>() { @Override public void accept(Throwable throwable) { logger.error(throwable); } }); Controls controls = outputStream.consume(new Consumer<Object>() { @Override public void accept(Object outputObject) { if (ClassUtils.isAssignable(Message.class, outputObject.getClass())) { getOutputChannel().send((Message) outputObject); } else { getOutputChannel().send(MessageBuilder.withPayload(outputObject).build()); } } }); if (logger.isDebugEnabled()) { logger.debug(controls.debug()); } } } } } return broadcaster; }</code><technical_language>need handle equivalent of a "Subscription", is currently a potential leak here, I guess</technical_language>

Target:
private Broadcaster<Object> getBroadcaster() { long idToUse = Thread.currentThread().getId(); Broadcaster<Object> broadcaster = broadcasterMap.get(idToUse); if (broadcaster == null) { Broadcaster<Object> existingBroadcaster = broadcasterMap.putIfAbsent(idToUse, Streams.broadcast()); if (existingBroadcaster == null) { broadcaster = broadcasterMap.get(idToUse); Stream<?> outputStream = reactorProcessor.process(broadcaster); outputStream.when(Throwable.class, new Consumer<Throwable>() { @Override public void accept(Throwable throwable) { logger.error(throwable); } }); Controls controls = outputStream.consume(new Consumer<Object>() { @Override public void accept(Object outputObject) { if (ClassUtils.isAssignable(Message.class, outputObject.getClass())) { getOutputChannel().send((Message) outputObject); } else { getOutputChannel().send(MessageBuilder.withPayload(outputObject).build()); } } }); controlsMap.put(idToUse, controls); broadcaster.observeComplete(new Consumer<Void>() { @Override public void accept(Void aVoid) { broadcasterMap.remove(Thread.currentThread().getId()); } }); if (logger.isDebugEnabled()) { logger.debug(controls.debug()); } } } return broadcaster; }
Source:
<code>public static ImmutableMap<String, Object> buildScalingPolicyMap(ScalingPolicy scalingPolicy) { ImmutableMap.Builder<String, Object> scalingPolicyMapBuilder = ImmutableMap.builder(); scalingPolicyMapBuilder.put("cooldown", scalingPolicy.getCooldown()); scalingPolicyMapBuilder.put("type", scalingPolicy.getType().toString()); scalingPolicyMapBuilder.put("name", scalingPolicy.getName()); String targetString = scalingPolicy.getTarget(); Integer targetInt = Ints.tryParse(targetString); Float targetFloat; if (targetInt != null) { scalingPolicyMapBuilder.put(scalingPolicy.getTargetType().toString(), targetInt); } else if ((targetFloat = Floats.tryParse(targetString)) != null) { scalingPolicyMapBuilder.put(scalingPolicy.getTargetType().toString(), targetFloat); } else { scalingPolicyMapBuilder.put(scalingPolicy.getTargetType().toString(), targetString); } <START> if(scalingPolicy.getSchedulingArgs() != null <END> && scalingPolicy.getType().equals(ScalingPolicy.ScalingPolicyType.SCHEDULE)) { scalingPolicyMapBuilder.put("args", scalingPolicy.getSchedulingArgs()); } return scalingPolicyMapBuilder.build(); }</code><technical_language>Space if</technical_language>

Target:
public static ImmutableMap<String, Object> buildScalingPolicyMap(ScalingPolicy scalingPolicy) { ImmutableMap.Builder<String, Object> scalingPolicyMapBuilder = ImmutableMap.builder(); scalingPolicyMapBuilder.put("cooldown", scalingPolicy.getCooldown()); scalingPolicyMapBuilder.put("type", scalingPolicy.getType().toString()); scalingPolicyMapBuilder.put("name", scalingPolicy.getName()); String targetString = scalingPolicy.getTarget(); Integer targetInt = Ints.tryParse(targetString); Float targetFloat; if (targetInt != null) { scalingPolicyMapBuilder.put(scalingPolicy.getTargetType().toString(), targetInt); } else if ((targetFloat = Floats.tryParse(targetString)) != null) { scalingPolicyMapBuilder.put(scalingPolicy.getTargetType().toString(), targetFloat); } else { scalingPolicyMapBuilder.put(scalingPolicy.getTargetType().toString(), targetString); } if (scalingPolicy.getSchedulingType() != null && scalingPolicy.getType().equals(ScalingPolicyType.SCHEDULE)) { scalingPolicyMapBuilder.put("args", ImmutableMap.of(scalingPolicy.getSchedulingType().toString(),scalingPolicy.getSchedulingString())); } return scalingPolicyMapBuilder.build(); }
Source:
<code>public SipMessage.Builder<T> withViaHeaders(final ViaHeader... vias) { if (vias != null) { this.viaHeaders = ensureList(this.viaHeaders); this.viaHeaders.clear(); for (final ViaHeader via : vias) { this.viaHeaders.add(via); <START> viaHeader = via; <END> } } return this; }</code><technical_language>bug; need remember header..</technical_language>

Target:
public SipMessage.Builder<T> withViaHeaders(final ViaHeader... vias) { if (vias != null && vias.length > 0) { this.viaHeaders = ensureList(this.viaHeaders); this.viaHeaders.clear(); viaHeader = vias[0]; this.viaHeaders.addAll(Arrays.asList(vias)); } return this; }
Source:
<code><START> public void setMtu(String iface, int mtu) { <END> final NativeDaemonEvent event; try { event = mConnector.execute("interface", "setmtu", iface, mtu); } catch (NativeDaemonConnectorException e) { throw e.rethrowAsParcelableException(); } }</code><technical_language>please enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG);</technical_language>

Target:
public void setMtu(String iface, int mtu) { mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); final NativeDaemonEvent event; try { event = mConnector.execute("interface", "setmtu", iface, mtu); } catch (NativeDaemonConnectorException e) { throw e.rethrowAsParcelableException(); } }
Source:
<code><START> public String getType() { <END> return _type; }</code><technical_language>this enum</technical_language>

Target:
public Type getType() { return _type; }
Source:
<code>private boolean showWarning(int nb) { IPreferenceStore corePreferenceStore = Activator.getDefault().getPreferenceStore(); boolean hide = corePreferenceStore.getBoolean(ITmfUIPreferences.HIDE_MANY_ENTRIES_SELECTED_TOGGLE); <START> if (nb > 20 && !hide) { <END> MessageDialogWithToggle openOkCancelConfirm = MessageDialogWithToggle.openOkCancelConfirm(getShell(), Messages.AbstractSelectTreeViewer_ManyEntriesSelectedTitle, String.format(Messages.AbstractSelectTreeViewer_ManyEntriesSelectedMessage, nb), Messages.AbstractSelectTreeViewer_ManyEntriesSelectedDontShowAgain, false, null, null); corePreferenceStore.setValue(ITmfUIPreferences.HIDE_MANY_ENTRIES_SELECTED_TOGGLE, openOkCancelConfirm.getToggleState()); int retCode = openOkCancelConfirm.getReturnCode(); return retCode == Window.CANCEL; } return false; }</code><technical_language>preference text refers 'chart', 'querying' view. This class is a tree supports grayed state maintains consistent checked states. coupled a chart is data query elements checked. place a TriStateFilteredCheckboxTree coupled a XY chart viewer is in TmfChartView.coupleSelectViewer(). I 'install' in tree viewer a listener prompt user abort selection. a method added ICheckboxTreeViewerListener interface, a 'preCheckStateChanged'? TmfChartView right class choose limit of 20</technical_language>

Target:
private boolean showWarning(int nb) { IPreferenceStore corePreferenceStore = Activator.getDefault().getPreferenceStore(); boolean hide = corePreferenceStore.getBoolean(ITmfUIPreferences.HIDE_MANY_ENTRIES_SELECTED_TOGGLE); if (nb > 20 && !hide) { MessageDialogWithToggle openOkCancelConfirm = MessageDialogWithToggle.openOkCancelConfirm(getShell(), Messages.AbstractSelectTreeViewer_ManyEntriesSelectedTitle, NLS.bind(Messages.AbstractSelectTreeViewer_ManyEntriesSelectedMessage, nb), Messages.AbstractSelectTreeViewer_ManyEntriesSelectedDontShowAgain, false, null, null); corePreferenceStore.setValue(ITmfUIPreferences.HIDE_MANY_ENTRIES_SELECTED_TOGGLE, openOkCancelConfirm.getToggleState()); int retCode = openOkCancelConfirm.getReturnCode(); return retCode == Window.CANCEL; } return false; }
Source:
<code>public void testPossibleParsingWithSqlCalcFoundRowsHint() throws JSQLParserException { <START> AtomicReference<MySqlSqlCalcFoundRows> ref = new AtomicReference<MySqlSqlCalcFoundRows>(); <END> accept(CCJSqlParserUtil.parse("SELECT SQL_CALC_FOUND_ROWS * FROM TABLE"), ref); assertNotNull(ref); assertEquals(MySqlSqlCalcFoundRows.DESCRIPTION, ref.get().getDescription()); ref.set(null); accept(CCJSqlParserUtil.parse("SELECT * FROM TABLE"), ref); assertNull(ref.get()); }</code><technical_language>do need atomic reference? assign a variable</technical_language>

Target:
public void testPossibleParsingWithSqlCalcFoundRowsHint() throws JSQLParserException { MySqlSqlCalcFoundRowRef ref = new MySqlSqlCalcFoundRowRef(false); String sqlCalcFoundRowsContainingSql = "SELECT SQL_CALC_FOUND_ROWS * FROM TABLE"; String generalSql = "SELECT * FROM TABLE"; accept(CCJSqlParserUtil.parse(sqlCalcFoundRowsContainingSql), ref); assertTrue(ref.sqlCalcFoundRows); accept(CCJSqlParserUtil.parse(generalSql), ref); assertFalse(ref.sqlCalcFoundRows); assertSqlCanBeParsedAndDeparsed(sqlCalcFoundRowsContainingSql); assertSqlCanBeParsedAndDeparsed(generalSql); }
Source:
<code>private Multimap<ComponentCategory, SnomedComponentCreateRequest> collectCreateRequests(final BulkRequest<?> bulkRequest) { return FluentIterable.from(bulkRequest.getRequests()).filter(SnomedComponentCreateRequest.class) .index(new Function<Request<?, ?>, ComponentCategory>() { @Override public ComponentCategory apply(final Request<?, ?> input) { if (input instanceof SnomedConceptCreateRequest) { return ComponentCategory.CONCEPT; } else if (input instanceof SnomedDescriptionCreateRequest) { return ComponentCategory.DESCRIPTION; } else if (input instanceof SnomedRelationshipCreateRequest) { return ComponentCategory.RELATIONSHIP; } <START> throw new IllegalArgumentException(String.format("Unknown create request type: %s", input.getClass().getName())); <END> } }); }</code><technical_language>Throw BadRequestException instead of IllegalArgumentExceptions in Request implementations</technical_language>

Target:
private Multimap<ComponentCategory, BaseSnomedComponentCreateRequest> collectCreateRequests(final BulkRequest<?> bulkRequest) { return FluentIterable.from(bulkRequest.getRequests()).filter(BaseSnomedComponentCreateRequest.class) .index(new Function<Request<?, ?>, ComponentCategory>() { @Override public ComponentCategory apply(final Request<?, ?> input) { if (input instanceof SnomedConceptCreateRequest) { return ComponentCategory.CONCEPT; } else if (input instanceof SnomedDescriptionCreateRequest) { return ComponentCategory.DESCRIPTION; } else if (input instanceof SnomedRelationshipCreateRequest) { return ComponentCategory.RELATIONSHIP; } throw new NotImplementedException("Unknown create request type: %s", input.getClass().getName()); } }); }
Source:
<code>void encode(final ByteBuf out) { final int expectedLength = RntbdRequestFrame.LENGTH + this.headers.computeLength(); <START> final int start = out.writerIndex(); <END> out.writeIntLE(expectedLength); this.frame.encode(out); this.headers.encode(out); checkState(out.writerIndex() - start == expectedLength, "encoding error: {\"expectedLength\": %s, \"observedLength\": %s}", expectedLength, out.writerIndex() - expectedLength); if (this.payload.length > 0) { out.writeIntLE(this.payload.length); out.writeBytes(this.payload); } }</code><technical_language>please explain scenario this bug shows itself? do need this</technical_language>

Target:
void encode(final ByteBuf out) { final int expectedLength = RntbdRequestFrame.LENGTH + this.headers.computeLength(); final int start = out.writerIndex(); out.writeIntLE(expectedLength); this.frame.encode(out); this.headers.encode(out); final int observedLength = out.writerIndex() - start; checkState(observedLength == expectedLength, "encoding error: {\"expectedLength\": %s, \"observedLength\": %s}", expectedLength, observedLength); if (this.payload.length > 0) { out.writeIntLE(this.payload.length); out.writeBytes(this.payload); } }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root = super.onCreateViewHelper(inflater, container, savedInstanceState, R.layout.new_episodes_fragment, R.string.new_episodes_label); listView.setRemoveListener(new DragSortListView.RemoveListener() { @Override public void remove(int which) { Log.d(TAG, "remove(" + which + ")"); stopItemLoader(); FeedItem item = (FeedItem) listView.getAdapter().getItem(which); DBWriter.markItemRead(getActivity(), true, item.getId()); undoBarController.showUndoBar(false, getString(R.string.marked_as_read_label), new FeedItemUndoToken(item, which) ); } }); undoBarController = new UndoBarController<FeedItemUndoToken>(root.findViewById(R.id.undobar), new UndoBarController.UndoListener<FeedItemUndoToken>() { private final Context context = getActivity(); @Override public void onUndo(FeedItemUndoToken token) { if (token != null) { long itemId = token.getFeedItemId(); DBWriter.markItemRead(context, false, itemId); } } @Override public void onHide(FeedItemUndoToken token) { if (token != null && context != null) { long itemId = token.getFeedItemId(); FeedItem item = DBReader.getFeedItem(context, itemId); FeedMedia media = item.getMedia(); <START> if(media != null && media.hasAlmostEnded() && item.getFeed().getPreferences().getCurrentAutoDelete(UserPreferences.isAutoDelete())) { <END> DBWriter.deleteFeedMediaOfItem(context, media.getId()); } } } }); return root; }</code><technical_language>strange. removing isAutoDelete parameter case DEFAULT: return UserPreferences.isAutoDelete();</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View root = super.onCreateViewHelper(inflater, container, savedInstanceState, R.layout.new_episodes_fragment, R.string.new_episodes_label); listView.setRemoveListener(new DragSortListView.RemoveListener() { @Override public void remove(int which) { Log.d(TAG, "remove(" + which + ")"); stopItemLoader(); FeedItem item = (FeedItem) listView.getAdapter().getItem(which); DBWriter.markItemRead(getActivity(), true, item.getId()); undoBarController.showUndoBar(false, getString(R.string.marked_as_read_label), new FeedItemUndoToken(item, which) ); } }); undoBarController = new UndoBarController<FeedItemUndoToken>(root.findViewById(R.id.undobar), new UndoBarController.UndoListener<FeedItemUndoToken>() { private final Context context = getActivity(); @Override public void onUndo(FeedItemUndoToken token) { if (token != null) { long itemId = token.getFeedItemId(); DBWriter.markItemRead(context, false, itemId); } } @Override public void onHide(FeedItemUndoToken token) { if (token != null && context != null) { long itemId = token.getFeedItemId(); FeedItem item = DBReader.getFeedItem(context, itemId); FeedMedia media = item.getMedia(); if(media != null && media.hasAlmostEnded() && item.getFeed().getPreferences().getCurrentAutoDelete()) { DBWriter.deleteFeedMediaOfItem(context, media.getId()); } } } }); return root; }
Source:
<code>private void executeGroupSearch(String filter, Set<Map<String, String>> groupDetailsMap, InitialLdapContext ctx, SearchControls searchControls, String[] baseDNs, int x) throws NamingException { NamingEnumeration<SearchResult> answer = ctx.search(baseDNs[x], filter, searchControls); boolean ldapApiEnumerationBugEncountered = false; int resultCount = 0; while ((resultCount <= LDAP_GROUP_QUERY_LIMIT) && (groupDetailsMap.size() <= LDAP_GROUP_QUERY_LIMIT) && (!ldapApiEnumerationBugEncountered) && answer.hasMoreElements()) { SearchResult si = null; try { si = answer.next(); } catch (NullPointerException npe) { ldapApiEnumerationBugEncountered = true; break; } Map<String, String> entry = new HashMap<String, String>(); Attribute nameAttribute = si.getAttributes().get("cn"); if (nameAttribute == null) { continue; } <START> String name = ((String) nameAttribute.get()).trim(); <END> Attribute desc = si.getAttributes().get("description"); String description = desc != null ? (String) desc.get() : ""; description = description.trim(); entry.put("id", name); entry.put("name", name); entry.put("description", description); groupDetailsMap.add(entry); resultCount++; groupQueryResultCount = resultCount; if (groupQueryPageCount == 0) { groupQueryPageCount++; } groupQueryCurrentTime = System.currentTimeMillis(); } }</code><technical_language>a small question.. nameAttribute non-null .get() null? checked in nameAttribute == null || nameAttribute.get() == null</technical_language>

Target:
private void executeGroupSearch(String filter, Set<Map<String, String>> groupDetailsMap, InitialLdapContext ctx, SearchControls searchControls, String[] baseDNs, int x) throws NamingException { NamingEnumeration<SearchResult> answer = ctx.search(baseDNs[x], filter, searchControls); boolean ldapApiEnumerationBugEncountered = false; int resultCount = 0; while ((resultCount <= LDAP_GROUP_QUERY_LIMIT) && (groupDetailsMap.size() <= LDAP_GROUP_QUERY_LIMIT) && (!ldapApiEnumerationBugEncountered) && answer.hasMoreElements()) { SearchResult si = null; try { si = answer.next(); } catch (NullPointerException npe) { ldapApiEnumerationBugEncountered = true; break; } Map<String, String> entry = new HashMap<String, String>(); Attribute nameAttribute = si.getAttributes().get("cn"); if (nameAttribute == null || nameAttribute.get() == null) { continue; } String name = ((String) nameAttribute.get()).trim(); Attribute desc = si.getAttributes().get("description"); String description = desc != null ? (String) desc.get() : ""; description = description.trim(); entry.put("id", name); entry.put("name", name); entry.put("description", description); groupDetailsMap.add(entry); resultCount++; groupQueryResultCount = resultCount; if (groupQueryPageCount == 0) { groupQueryPageCount++; } groupQueryCurrentTime = System.currentTimeMillis(); } }
Source:
<code>private void setupLookAndFeel() { if (Constant.isMacOsX()) { OsXGui.setup(); } if (lookAndFeelSet) { return; } lookAndFeelSet = true; if (setLookAndFeel(System.getProperty("swing.defaultlaf"))) { return; } OptionsParam options = Model.getSingleton().getOptionsParam(); if (setLookAndFeel(getLookAndFeelClassname(options.getViewParam().getLookAndFeel())) || setLookAndFeel(options.getViewParam().getLookAndFeelInfo().getClassName())) { return; <START> } <END> if (setLookAndFeel(getLookAndFeelClassname("Nimbus"))) { return; } setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); }</code><technical_language>incompatibility (prettier?) feel default running macOS</technical_language>

Target:
private void setupLookAndFeel() { if (lookAndFeelSet) { return; } lookAndFeelSet = true; if (Constant.isMacOsX()) { OsXGui.setup(); } if (setLookAndFeel(System.getProperty("swing.defaultlaf"))) { return; } OptionsParam options = Model.getSingleton().getOptionsParam(); if (setLookAndFeel(getLookAndFeelClassname(options.getViewParam().getLookAndFeel())) || setLookAndFeel(options.getViewParam().getLookAndFeelInfo().getClassName())) { return; } if (!Constant.isMacOsX() && setLookAndFeel(getLookAndFeelClassname("Nimbus"))) { return; } setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); }
Source:
<code><START> protected String createSearchPattern(Collection<ImportTemplateData> entities) { <END> String vmt_guidKey = "_VMT_ID ="; String orKey = " or "; StringBuilder searchPattern = new StringBuilder(); searchPattern.append("Template: "); for (ImportTemplateData templateData : entities) { VmTemplate template = templateData.getTemplate(); searchPattern.append(vmt_guidKey); searchPattern.append(template.getId().toString()); searchPattern.append(orKey); searchPattern.append(vmt_guidKey); searchPattern.append(template.getBaseTemplateId().toString()); searchPattern.append(orKey); } return searchPattern.substring(0, searchPattern.length() - orKey.length()); }</code><technical_language>This pattern (and query) similar ImportTemplateFromExportDomainModel.createSearchPattern() Do extract code shared classes? AsyncDataProvider async callback parameter (there other methods there)</technical_language>

Target:
protected String createSearchPattern(Collection<ImportTemplateData> entities) { String vmt_guidKey = "_VMT_ID = "; String orKey = " or "; String prefix = "Template: "; StringJoiner sj = new StringJoiner(orKey, prefix, ""); entities.stream().map(ImportTemplateData::getTemplate).forEach(template -> { sj.add(vmt_guidKey + template.getId().toString()); sj.add(vmt_guidKey + template.getBaseTemplateId().toString()); }); return sj.toString(); }
Source:
<code>void createFileSizeCount(Connection conn) { DSL.using(conn).createTableIfNotExists(FILE_COUNT_BY_SIZE_TABLE_NAME) <START> .column("file_size_kb", SQLDataType.BIGINT) <END> .column("count", SQLDataType.BIGINT) .constraint(DSL.constraint("pk_file_size_kb") .primaryKey("file_size_kb")) .execute(); }</code><technical_language>storing file size in bytes? change this file_size</technical_language>

Target:
void createFileSizeCount(Connection conn) { DSL.using(conn).createTableIfNotExists(FILE_COUNT_BY_SIZE_TABLE_NAME) .column("file_size", SQLDataType.BIGINT) .column("count", SQLDataType.BIGINT) .constraint(DSL.constraint("pk_file_size") .primaryKey("file_size")) .execute(); }
Source:
<code>public int dispatch() { boolean subject = (getSubject() == null || getSubject().isEmpty()); if (subject) { return 0; } boolean body = (getBody() == null || getBody().isEmpty()); boolean htmlBody = (getHtmlBody() == null || getHtmlBody().isEmpty()); if (body || htmlBody) { return 0; <START> } <END> final Person person = getPerson(); final Set<String> destinationBccs = getDestinationBccs(); final Set<String> tos = getRecipientAddresses(getTosSet()); final Set<String> ccs = getRecipientAddresses(getCcsSet()); createEmailBatch(person, tos, ccs, split(destinationBccs)); return destinationBccs.size() + tos.size() + ccs.size(); }</code><technical_language>a single if Strings.isNullOrEmpty</technical_language>

Target:
public int dispatch() { if (Strings.isNullOrEmpty(getSubject())) { return 0; } if (Strings.isNullOrEmpty(getBody()) && Strings.isNullOrEmpty(getHtmlBody())) { return 0; } final Person person = getPerson(); final Set<String> destinationBccs = getDestinationBccs(); final Set<String> tos = getRecipientAddresses(getTosSet()); final Set<String> ccs = getRecipientAddresses(getCcsSet()); createEmailBatch(person, tos, ccs, split(destinationBccs)); return destinationBccs.size() + tos.size() + ccs.size(); }
Source:
<code>public void sourceContainersChanged(final ISourceLookupDMContext sourceLookupCtx, final DataRequestMonitor<Boolean> rm) { if (!fDirectors.containsKey(sourceLookupCtx)) { <START> rm.done(false); <END> return; } Map<String, String> entries = getSubstitutionsPaths(sourceLookupCtx); if (entries.equals(fCachedEntries)) { rm.done(false); } else { fCommand.queueCommand(fCommandFactory.createCLIUnsetSubstitutePath(sourceLookupCtx), new DataRequestMonitor<MIInfo>(getExecutor(), rm) { @Override protected void handleSuccess() { initializeSourceSubstitutions(sourceLookupCtx, new RequestMonitor(getExecutor(), rm) { @Override protected void handleSuccess() { rm.done(true); } }); } }); } }</code><technical_language>proper, this return error status. is change necessary, is sourceLookupDMC is unknown</technical_language>

Target:
public void sourceContainersChanged(final ISourceLookupDMContext sourceLookupCtx, final DataRequestMonitor<Boolean> rm) { if (!fDirectors.containsKey(sourceLookupCtx)) { rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, IDsfStatusConstants.INVALID_HANDLE, "No source director configured for given context", null)); rm.done(); return; } Map<String, String> entries = getSubstitutionsPaths(sourceLookupCtx); if (entries.equals(fCachedEntries)) { rm.done(false); } else { fCommand.queueCommand(fCommandFactory.createCLIUnsetSubstitutePath(sourceLookupCtx), new DataRequestMonitor<MIInfo>(getExecutor(), rm) { @Override protected void handleSuccess() { initializeSourceSubstitutions(sourceLookupCtx, new RequestMonitor(getExecutor(), rm) { @Override protected void handleSuccess() { rm.done(true); } }); } }); } }
Source:
<code>private void deleteDir(FileSystem fs, String target) throws Exception { <START> Path path = new Path(target.replaceAll(".*://.*?(?=/)", "")); <END> if (fs.exists(path)) { fs.delete(path, true); if (fs.exists(path)) { warn("Could not delete temp directory " + path + " in CDN!"); } else { info("Deleted " + path); } } }</code><technical_language>do this in a places. deserves function in HadoopUtils that</technical_language>

Target:
private void deleteDir(FileSystem fs, String target) throws Exception { Path path = new Path(extractPathFromUrl(target)); if (fs.exists(path)) { fs.delete(path, true); if (fs.exists(path)) { warn("Could not delete temp directory " + path + " in CDN!"); } else { info("Deleted " + path); } } }
Source:
<code>public void exportMeasurements(MeasurementsExporter exporter) throws IOException { Histogram intervalHistogram = getIntervalHistogramAndAccumulate(); if (histogramLogWriter != null) { histogramLogWriter.outputIntervalHistogram(intervalHistogram); log.close(); } exporter.write(getName(), "Operations", totalHistogram.getTotalCount()); exporter.write(getName(), "AverageLatency(us)", totalHistogram.getMean()); exporter.write(getName(), "MinLatency(us)", totalHistogram.getMinValue()); exporter.write(getName(), "MaxLatency(us)", totalHistogram.getMaxValue()); for (Integer percentile: percentiles) { <START> exporter.write(getName(), percentile + "thPercentileLatency(us)", totalHistogram.getValueAtPercentile(percentile)); <END> } exportReturnCodes(exporter); }</code><technical_language>nit: change label here? This grammatically incorrect for, say, 91st percentile</technical_language>

Target:
public void exportMeasurements(MeasurementsExporter exporter) throws IOException { Histogram intervalHistogram = getIntervalHistogramAndAccumulate(); if (histogramLogWriter != null) { histogramLogWriter.outputIntervalHistogram(intervalHistogram); log.close(); } exporter.write(getName(), "Operations", totalHistogram.getTotalCount()); exporter.write(getName(), "AverageLatency(us)", totalHistogram.getMean()); exporter.write(getName(), "MinLatency(us)", totalHistogram.getMinValue()); exporter.write(getName(), "MaxLatency(us)", totalHistogram.getMaxValue()); for (Integer percentile: percentiles) { exporter.write(getName(), ordinal(percentile) + "PercentileLatency(us)", totalHistogram.getValueAtPercentile(percentile)); } exportReturnCodes(exporter); }
Source:
<code>public void setLocked(boolean locked) { <START> mLocked = locked; <END> }</code><technical_language>notifyDataSetChanged() missing</technical_language>

Target:
public void setLocked(boolean locked) { mLocked = locked; notifyDataSetChanged(); }
Source:
<code>public DeviceResourceAssembler(CurieProvider curieProvider, UUID userId) { <START> super(BuddyController.class, DeviceResource.class); <END> this.curieProvider = curieProvider; this.userId = userId; }</code><technical_language>DeviceController instead of BuddyController</technical_language>

Target:
public DeviceResourceAssembler(CurieProvider curieProvider, UUID userId) { super(DeviceController.class, DeviceResource.class); this.curieProvider = curieProvider; this.userId = userId; }
Source:
<code>private Tuple<EntityRef<ConcurrentClusteredMap, Object>, ConcurrentClusteredMap> createConcurrentClusteredMap(String name, Class<?> keyClass, Class<?> valueClass) { try { EntityRef<ConcurrentClusteredMap, Object> clusteredMapRef = clusterConnection.getEntityRef(ConcurrentClusteredMap.class, ConcurrentClusteredMap.VERSION, name); ConcurrentClusteredMap clusteredMap; try { <START> clusteredMap = clusteredMapRef.fetchEntity(); <END> } catch (EntityNotFoundException e) { clusteredMapRef.create(null); clusteredMap = clusteredMapRef.fetchEntity(); } clusteredMap.setTypes(keyClass, valueClass); return new Tuple<EntityRef<ConcurrentClusteredMap, Object>, ConcurrentClusteredMap>(clusteredMapRef, clusteredMap); } catch (EntityNotFoundException e) { throw new AssertionError("Should not happen"); } catch (EntityException e) { LOGGER.error("Classpath issue - missing entity provider", e); throw new AssertionError("Classpath issues as expected entity is not resolvable"); } }</code><technical_language>If existing problem entity create locking done this other round</technical_language>

Target:
private ConcurrentClusteredMap createConcurrentClusteredMap(String name, Class<?> keyClass, Class<?> valueClass) { try { EntityRef<ConcurrentClusteredMap, Object> clusteredMapRef = clusterConnection.getEntityRef(ConcurrentClusteredMap.class, ConcurrentClusteredMap.VERSION, name); ConcurrentClusteredMap clusteredMap; try { clusteredMap = clusteredMapRef.fetchEntity(); } catch (EntityNotFoundException e) { clusteredMapRef.create(null); clusteredMap = clusteredMapRef.fetchEntity(); } clusteredMap.setTypes(keyClass, valueClass); return clusteredMap; } catch (EntityNotFoundException e) { throw new AssertionError("Should not happen"); } catch (EntityException e) { LOGGER.error("Classpath issue - missing entity provider", e); throw new AssertionError("Classpath issues as expected entity is not resolvable"); } }
Source:
<code><START> protected void checkout() throws NoWorkTreeException, IOException { <END> ObjectReader r = db.getObjectDatabase().newReader(); try { for (Map.Entry<String, DirCacheEntry> entry : toBeCheckedOut .entrySet()) { File f = new File(db.getWorkTree(), entry.getKey()); createDir(f.getParentFile()); DirCacheCheckout.checkoutEntry(db, f, entry.getValue(), r); modifiedFiles.add(entry.getKey()); } for (int i = toBeDeleted.size() - 1; i >= 0; i--) { String fileName = toBeDeleted.get(i); File f = new File(db.getWorkTree(), fileName); if (!f.delete()) failingPaths.put(fileName, MergeFailureReason.COULD_NOT_DELETE); modifiedFiles.add(fileName); } } finally { r.release(); } }</code><technical_language>need change this method signature. I leave a private method</technical_language>

Target:
private void checkout() throws NoWorkTreeException, IOException { ObjectReader r = db.getObjectDatabase().newReader(); try { for (Map.Entry<String, DirCacheEntry> entry : toBeCheckedOut .entrySet()) { File f = new File(db.getWorkTree(), entry.getKey()); createDir(f.getParentFile()); DirCacheCheckout.checkoutEntry(db, f, entry.getValue(), r); modifiedFiles.add(entry.getKey()); } for (int i = toBeDeleted.size() - 1; i >= 0; i--) { String fileName = toBeDeleted.get(i); File f = new File(db.getWorkTree(), fileName); if (!f.delete()) failingPaths.put(fileName, MergeFailureReason.COULD_NOT_DELETE); modifiedFiles.add(fileName); } } finally { r.release(); } }
Source:
<code>void onSelectChange(final JQuerySelectPickerEvent event) { final String constraintType = event.target.value; if (!isEmpty(constraintType)) { <START> ConstraintType constraint = ConstraintType.fromString(constraintType); <END> loadComponent(constraint); presenter.setConstraintType(constraint); } }</code><technical_language>I add a final here: suggestion final ConstraintType constraint = ConstraintType.fromString(constraintType);</technical_language>

Target:
void onSelectChange(final JQuerySelectPickerEvent event) { final String constraintType = event.target.value; if (!isEmpty(constraintType)) { final ConstraintType constraint = ConstraintType.fromString(constraintType); loadComponent(constraint); presenter.setConstraintType(constraint); } }