auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected void endWithFailure() { setVmTemplateId(getParameters().getVmTemplateId()); setVmId(getVmIdFromImageParameters()); for (VdcActionParametersBase p : getParameters().getImagesParameters()) { p.setTaskGroupSuccess(false); Backend.getInstance().endAction(VdcActionType.CreateImageTemplate, p, cloneContextAndDetachFromParent()); } <START> if (TaskManagerUtil.getCommandExecutionStatus(getParameters().getCommandId()) == CommandExecutionStatus.EXECUTED) { <END> if (getVmTemplate() != null) { DbFacade.getInstance().getVmTemplateDao().remove(getVmTemplateId()); removeNetwork(); } } if (!getVmId().equals(Guid.Empty) && getVm() != null) { VmHandler.unLockVm(getVm()); } setSucceeded(true); }</code><technical_language>This fixed in master</technical_language>

Target:
protected void endWithFailure() { setVmTemplateId(getParameters().getVmTemplateId()); setVmId(getVmIdFromImageParameters()); for (VdcActionParametersBase p : getParameters().getImagesParameters()) { p.setTaskGroupSuccess(false); Backend.getInstance().endAction(VdcActionType.CreateImageTemplate, p, cloneContextAndDetachFromParent()); } if (CommandCoordinatorUtil.getCommandExecutionStatus(getParameters().getCommandId()) == CommandExecutionStatus.EXECUTED) { if (getVmTemplate() != null) { DbFacade.getInstance().getVmTemplateDao().remove(getVmTemplateId()); removeNetwork(); } } if (!getVmId().equals(Guid.Empty) && getVm() != null) { VmHandler.unLockVm(getVm()); } setSucceeded(true); }
Source:
<code>public Dog fromJson(JsonValue jsonObject, Type targetType, MappingParser parser) { <START> String javaType = ((JsonObject) jsonObject).getString(" END> Class targetClass = javaType != null ? getSubClass(targetType, javaType) : (Class) targetType; return parser.readObject(jsonObject, targetClass); }</code><technical_language>asJsonObject() ;)</technical_language>

Target:
public Dog fromJson(JsonValue jsonObject, Type targetType, MappingParser parser) { String javaType = jsonObject.asJsonObject().getString(" Class targetClass = javaType != null ? getSubClass(targetType, javaType) : (Class) targetType; return parser.readObject(jsonObject, targetClass); }
Source:
<code>private void handOverVM(VM vmToRemove) { vmToRemove.setRunOnVds(vmToRemove.getmigrating_to_vds()); log.infoFormat("Handing over VM {0} {1} to Host {2}. Setting VM to status {3}", vmToRemove.getName(), vmToRemove.getId(), vmToRemove.getmigrating_to_vds(), VMStatus.MigratingTo); <START> ResourceManager.getInstance().InternalSetVmStatus(vmToRemove, VMStatus.MigratingTo); <END> addVmDynamicToList(vmToRemove.getDynamicData()); addVmStatisticsToList(vmToRemove.getStatisticsData()); addVmInterfaceStatisticsToList(vmToRemove.getInterfaces()); }</code><technical_language>if host in non-operational status? check move unknown in this scenario</technical_language>

Target:
private void handOverVM(VM vmToRemove) { NGuid destinationHostId = vmToRemove.getmigrating_to_vds(); VMStatus newVmStatus = (VDSStatus.NonResponsive == getDbFacade().getVdsDao().get(destinationHostId).getStatus()) ? VMStatus.Unknown : VMStatus.MigratingTo; vmToRemove.setRunOnVds(destinationHostId); log.infoFormat("Handing over VM {0} {1} to Host {2}. Setting VM to status {3}", vmToRemove.getName(), vmToRemove.getId(), destinationHostId, newVmStatus); ResourceManager.getInstance().InternalSetVmStatus(vmToRemove, newVmStatus); addVmDynamicToList(vmToRemove.getDynamicData()); addVmStatisticsToList(vmToRemove.getStatisticsData()); addVmInterfaceStatisticsToList(vmToRemove.getInterfaces()); }
Source:
<code>private List<Entity> searchHasAllExplicitTypes(final ImmutableList<RyaURI> explicitTypeIds) throws EntityStorageException { RyaURI firstType = null; if (!explicitTypeIds.isEmpty()) { <START> firstType = explicitTypeIds.get(0); <END> } final List<RyaURI> subjects = new ArrayList<>(); Optional<Type> type; try { type = mongoTypeStorage.get(firstType); } catch (final TypeStorageException e) { throw new EntityStorageException("Unable to get entity type: " + firstType, e); } if (type.isPresent()) { final ConvertingCursor<TypedEntity> cursor = search(Optional.empty(), type.get(), Collections.emptySet()); while (cursor.hasNext()) { final TypedEntity typedEntity = cursor.next(); final RyaURI subject = typedEntity.getSubject(); subjects.add(subject); } } final List<Entity> hasAllExplicitTypesEntities = new ArrayList<>(); for (final RyaURI subject : subjects) { final Optional<Entity> entityFromSubject = get(subject); if (entityFromSubject.isPresent()) { final Entity candidateEntity = entityFromSubject.get(); if (explicitTypeIds.containsAll(explicitTypeIds)) { hasAllExplicitTypesEntities.add(candidateEntity); } } } return hasAllExplicitTypesEntities; }</code><technical_language>do remaining typeIds</technical_language>

Target:
private List<Entity> searchHasAllExplicitTypes(final ImmutableList<RyaURI> explicitTypeIds) throws EntityStorageException { final List<Entity> hasAllExplicitTypesEntities = new ArrayList<>(); if (!explicitTypeIds.isEmpty()) { final RyaURI firstType = explicitTypeIds.get(0); final List<RyaURI> subjects = new ArrayList<>(); Optional<Type> type; try { if (mongoTypeStorage == null) { mongoTypeStorage = new MongoTypeStorage(mongo, ryaInstanceName); } type = mongoTypeStorage.get(firstType); } catch (final TypeStorageException e) { throw new EntityStorageException("Unable to get entity type: " + firstType, e); } if (type.isPresent()) { final ConvertingCursor<TypedEntity> cursor = search(Optional.empty(), type.get(), Collections.emptySet()); while (cursor.hasNext()) { final TypedEntity typedEntity = cursor.next(); final RyaURI subject = typedEntity.getSubject(); subjects.add(subject); } } for (final RyaURI subject : subjects) { final Optional<Entity> entityFromSubject = get(subject); if (entityFromSubject.isPresent()) { final Entity candidateEntity = entityFromSubject.get(); if (candidateEntity.getExplicitTypeIds().containsAll(explicitTypeIds)) { hasAllExplicitTypesEntities.add(candidateEntity); } } } } return hasAllExplicitTypesEntities; }
Source:
<code>DefaultPerChannelBookieClientPool(ClientConfiguration conf, PerChannelBookieClientFactory factory, BookieSocketAddress address, int coreSize) throws SecurityException { checkArgument(coreSize > 0); this.factory = factory; this.address = address; this.conf = conf; this.shFactory = SecurityProviderFactoryFactory.getSecurityProviderFactory(conf.getTLSProviderFactoryClass()); <START> this.clients = new PerChannelBookieClient[coreSize]; <END> for (int i = 0; i < coreSize; i++) { this.clients[i] = factory.create(address, this, shFactory, VERSION_TWO); } this.clientsV3 = new PerChannelBookieClient[coreSize]; for (int i = 0; i < coreSize; i++) { this.clientsV3[i] = factory.create(address, this, shFactory, VERSION_THREE); } }</code><technical_language>Do create v2 clients if I v3</technical_language>

Target:
DefaultPerChannelBookieClientPool(ClientConfiguration conf, PerChannelBookieClientFactory factory, BookieSocketAddress address, int coreSize) throws SecurityException { checkArgument(coreSize > 0); this.factory = factory; this.address = address; this.conf = conf; this.shFactory = SecurityProviderFactoryFactory.getSecurityProviderFactory(conf.getTLSProviderFactoryClass()); this.clients = new PerChannelBookieClient[coreSize]; for (int i = 0; i < coreSize; i++) { this.clients[i] = factory.create(address, this, shFactory, false); } if (conf.getUseV2WireProtocol()) { this.clientsV3Enforced = new PerChannelBookieClient[coreSize]; for (int i = 0; i < coreSize; i++) { this.clientsV3Enforced[i] = factory.create(address, this, shFactory, true); } } else { this.clientsV3Enforced = this.clients; } }
Source:
<code>public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { try { fConfigDir = null; SubMonitor subMonitor = SubMonitor.convert(monitor, 4); try { preLaunchCheck(configuration, launch, subMonitor.newChild(2)); } catch (CoreException e) { if (e.getStatus().getSeverity() == IStatus.CANCEL) { monitor.setCanceled(true); return; } throw e; } VMRunnerConfiguration runnerConfig = new VMRunnerConfiguration(getMainClass(), getClasspath(configuration)); runnerConfig.setVMArguments(getVMArguments(configuration)); runnerConfig.setProgramArguments(getProgramArguments(configuration)); runnerConfig.setWorkingDirectory(getWorkingDirectory(configuration).getAbsolutePath()); runnerConfig.setEnvironment(getEnvironment(configuration)); runnerConfig.setVMSpecificAttributesMap(getVMSpecificAttributesMap(configuration)); subMonitor.worked(1); setDefaultSourceLocator(configuration); manageLaunch(launch); IVMRunner runner = getVMRunner(configuration, mode); if (runner != null) <START> runner.run(runnerConfig, launch, subMonitor); <END> else subMonitor.setCanceled(true); } catch (final CoreException e) { throw e; } }</code><technical_language>newChild</technical_language>

Target:
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { try { fConfigDir = null; SubMonitor subMonitor = SubMonitor.convert(monitor, 4); try { preLaunchCheck(configuration, launch, subMonitor.newChild(2)); } catch (CoreException e) { if (e.getStatus().getSeverity() == IStatus.CANCEL) { monitor.setCanceled(true); return; } throw e; } VMRunnerConfiguration runnerConfig = new VMRunnerConfiguration(getMainClass(), getClasspath(configuration)); runnerConfig.setVMArguments(getVMArguments(configuration)); runnerConfig.setProgramArguments(getProgramArguments(configuration)); runnerConfig.setWorkingDirectory(getWorkingDirectory(configuration).getAbsolutePath()); runnerConfig.setEnvironment(getEnvironment(configuration)); runnerConfig.setVMSpecificAttributesMap(getVMSpecificAttributesMap(configuration)); subMonitor.worked(1); setDefaultSourceLocator(configuration); manageLaunch(launch); IVMRunner runner = getVMRunner(configuration, mode); if (runner != null) runner.run(runnerConfig, launch, subMonitor.newChild(1)); else subMonitor.setCanceled(true); } catch (final CoreException e) { throw e; } }
Source:
<code>public Object getTarget() { if (!SKIP_PERMISSION_CHECK) { <START> Jenkins.get().checkPermission(Jenkins.CONFIGURE); <END> } return this; }</code><technical_language>Jenkins component is logging secrets FINE below</technical_language>

Target:
public Object getTarget() { if (!SKIP_PERMISSION_CHECK) { Jenkins.get().checkPermission(Jenkins.ADMINISTER); } return this; }
Source:
<code>public MockSCMSource build() { MockSCMSource source = controller == null ? new MockSCMSource(controllerId, repository, traits()) : new MockSCMSource(controller, repository, traits()); <START> source.setId(id); <END> return source; }</code><technical_language>id optional for MockSCMSourceBuilder too</technical_language>

Target:
public MockSCMSource build() { MockSCMSource source = controller == null ? new MockSCMSource(controllerId, repository, traits()) : new MockSCMSource(controller, repository, traits()); source.setId(id()); return source; }
Source:
<code>public boolean accept(String dimVal) { if (dimVal == null) { return false; } final String input = caseSensitive ? dimVal : dimVal.toLowerCase(); for (String value : target) { <START> if (!input.contains(value)) { <END> return false; } } return true; }</code><technical_language>I docs wrong fragment queries match if "any part of a dimension contains of values specified" code matches if values found</technical_language>

Target:
public boolean accept(String dimVal) { if (dimVal == null || values == null) { return false; } if (caseSensitive) { return containsAny(target, dimVal); } for (String search : target) { if (!org.apache.commons.lang.StringUtils.containsIgnoreCase(dimVal, search)) { return false; } } return true; }
Source:
<code>protected Points.Point createPoint( Long timestamp, Object value ) { <START> if( value instanceof Rollup || value instanceof String) <END> return new Points.Point( timestamp, value); else return new Points.Point( timestamp, new SimpleNumber( value ) ); }</code><technical_language>I missed bounded type parameters :-) I if create separate versions of createPoint methods? this? protected Points.Point createPoint(Long timestamp, Rollup value); protected Points.Point createPoint(Long timestamp, String value); protected Points.Point createPoint(Long timestamp, Object value);</technical_language>

Target:
protected Points.Point createPoint( Long timestamp, Object value ) { if( value instanceof Rollup ) return new Points.Point( timestamp, value); else return new Points.Point( timestamp, new SimpleNumber( value ) ); }
Source:
<code>public SftpSession getSession() { Assert.hasText(this.host, "host must not be empty"); Assert.hasText(this.user, "user must not be empty"); Assert.isTrue(StringUtils.hasText(this.userInfoWrapper.getPassword()) || this.privateKey != null, "either a password or a private key is required"); try { JSchSessionWrapper jschSession; if (this.isSharedSession) { this.sharedSessionLock.readLock().lock(); try { if (this.sharedJschSession == null || !this.sharedJschSession.isConnected()) { this.sharedSessionLock.readLock().unlock(); this.sharedSessionLock.writeLock().lock(); try { if (this.sharedJschSession == null || !this.sharedJschSession.isConnected()) { this.sharedJschSession = new JSchSessionWrapper(initJschSession()); } } finally { this.sharedSessionLock.readLock().lock(); this.sharedSessionLock.writeLock().unlock(); } } } finally { this.sharedSessionLock.readLock().unlock(); } jschSession = this.sharedJschSession; } else { jschSession = new JSchSessionWrapper(initJschSession()); } SftpSession sftpSession = new SftpSession(jschSession); if (this.isSharedSession) { this.sharedSessionLock.readLock().lock(); } try { <START> sftpSession.connect(); <END> } finally { if (this.isSharedSession) { this.sharedSessionLock.readLock().unlock(); } } jschSession.addChannel(); return sftpSession; } catch (Exception e) { throw new IllegalStateException("failed to create SFTP Session", e); } }</code><technical_language>connect jschSession lock (and add a catch); connect SftpSession a no-op for shared sessions avoid this extra lock() try/finally for cases a shared session is used</technical_language>

Target:
public SftpSession getSession() { Assert.hasText(this.host, "host must not be empty"); Assert.hasText(this.user, "user must not be empty"); Assert.isTrue(StringUtils.hasText(this.userInfoWrapper.getPassword()) || this.privateKey != null, "either a password or a private key is required"); try { JSchSessionWrapper jschSession; if (this.isSharedSession) { this.sharedSessionLock.readLock().lock(); try { if (this.sharedJschSession == null || !this.sharedJschSession.isConnected()) { this.sharedSessionLock.readLock().unlock(); this.sharedSessionLock.writeLock().lock(); try { if (this.sharedJschSession == null || !this.sharedJschSession.isConnected()) { this.sharedJschSession = new JSchSessionWrapper(initJschSession()); try { this.sharedJschSession.getSession().connect(); } catch (JSchException e) { throw new IllegalStateException("failed to connect", e); } } } finally { this.sharedSessionLock.readLock().lock(); this.sharedSessionLock.writeLock().unlock(); } } } finally { this.sharedSessionLock.readLock().unlock(); } jschSession = this.sharedJschSession; } else { jschSession = new JSchSessionWrapper(initJschSession()); } SftpSession sftpSession = new SftpSession(jschSession); sftpSession.connect(); jschSession.addChannel(); return sftpSession; } catch (Exception e) { throw new IllegalStateException("failed to create SFTP Session", e); } }
Source:
<code><R> R executeOnEndPoint(ServiceEndPoint endPoint, ServiceCallback<S, R> callback) throws Exception { ServiceHandle<S> handle = null; try { handle = _serviceCache.checkOut(endPoint); Timer.Context timer = _callbackExecutionTime.time(); try { return callback.call(handle.getService()); } finally { timer.stop(); } } catch (NoCachedInstancesAvailableException e) { LOG.debug("Service cache exhausted. End point: {}", endPoint, e); throw e; } catch (Exception e) { if (_serviceFactory.isRetriableException(e)) { markEndPointAsBad(endPoint); <START> LOG.debug("Bad end point discovered. End point: {}", endPoint, e); <END> } throw e; } finally { if (handle != null) { try { _serviceCache.checkIn(handle); } catch (Exception e) { LOG.warn("Error returning end point to cache. End point: {}, {}", endPoint, e.toString()); LOG.debug("Exception", e); } } } }</code><technical_language>Is debug log level for these? apps deployed is set info higher</technical_language>

Target:
<R> R executeOnEndPoint(ServiceEndPoint endPoint, ServiceCallback<S, R> callback) throws Exception { ServiceHandle<S> handle = null; try { handle = _serviceCache.checkOut(endPoint); Timer.Context timer = _callbackExecutionTime.time(); try { return callback.call(handle.getService()); } finally { timer.stop(); } } catch (NoCachedInstancesAvailableException e) { LOG.info("Service cache exhausted. End point: {}", endPoint, e); throw e; } catch (Exception e) { if (_serviceFactory.isRetriableException(e)) { markEndPointAsBad(endPoint); LOG.info("Bad end point discovered. End point: {}", endPoint, e); } throw e; } finally { if (handle != null) { try { _serviceCache.checkIn(handle); } catch (Exception e) { LOG.warn("Error returning end point to cache. End point: {}, {}", endPoint, e.toString()); LOG.debug("Exception", e); } } } }
Source:
<code>public void startup(ICluster cluster) { sync(() -> { try { mkdirs(); assert config.networkTopology().contains(config.broadcastAddressAndPort()); DistributedTestSnitch.assign(config.networkTopology()); DatabaseDescriptor.setDaemonInitialized(); DatabaseDescriptor.createAllDirectories(); SystemKeyspace.persistLocalMetadata(); try { Schema.instance.loadFromDisk(); } catch (Exception e) { throw e; } Keyspace.setInitialized(); try { CommitLog.instance.recover(); } catch (IOException e) { throw new RuntimeException(e); } if (config.has(NETWORK)) { registerFilter(cluster); MessagingService.instance().listen(); } else { registerMockMessaging(cluster); } if (config.has(GOSSIP)) { StorageService.instance.initServer(); StorageService.instance.removeShutdownHook(); } else { initializeRing(cluster); } <START> if (config.has(NATIVE_PROTOCOL)) { <END> CassandraDaemon.getInstanceForTesting().initializeNativeTransport(); CassandraDaemon.getInstanceForTesting().startNativeTransport(); } StorageService.instance.ensureTraceKeyspace(); SystemKeyspace.finishStartup(); if (!FBUtilities.getBroadcastAddress().equals(broadcastAddressAndPort().address)) throw new IllegalStateException(); if (DatabaseDescriptor.getStoragePort() != broadcastAddressAndPort().port) throw new IllegalStateException(); } catch (Throwable t) { if (t instanceof RuntimeException) throw (RuntimeException) t; throw new RuntimeException(t); } }).run(); }</code><technical_language>move startup of native protocol for finished setting traces finished startup? This step</technical_language>

Target:
public void startup(ICluster cluster) { sync(() -> { try { mkdirs(); assert config.networkTopology().contains(config.broadcastAddressAndPort()); DistributedTestSnitch.assign(config.networkTopology()); DatabaseDescriptor.setDaemonInitialized(); DatabaseDescriptor.createAllDirectories(); SystemKeyspace.persistLocalMetadata(); try { Schema.instance.loadFromDisk(); } catch (Exception e) { throw e; } Keyspace.setInitialized(); try { CommitLog.instance.recover(); } catch (IOException e) { throw new RuntimeException(e); } if (config.has(NETWORK)) { registerFilter(cluster); MessagingService.instance().listen(); } else { registerMockMessaging(cluster); } if (config.has(GOSSIP)) { StorageService.instance.initServer(); StorageService.instance.removeShutdownHook(); } else { initializeRing(cluster); } StorageService.instance.ensureTraceKeyspace(); SystemKeyspace.finishStartup(); if (config.has(NATIVE_PROTOCOL)) { CassandraDaemon.getInstanceForTesting().initializeNativeTransport(); CassandraDaemon.getInstanceForTesting().startNativeTransport(); } if (!FBUtilities.getBroadcastAddress().equals(broadcastAddressAndPort().address)) throw new IllegalStateException(); if (DatabaseDescriptor.getStoragePort() != broadcastAddressAndPort().port) throw new IllegalStateException(); } catch (Throwable t) { if (t instanceof RuntimeException) throw (RuntimeException) t; throw new RuntimeException(t); } }).run(); }
Source:
<code>public Iterator<SpreadsheetRecord> iterator() { <START> final Iterator<Row> iterator = myBook.getSheetAt(0).iterator(); <END> return new Iterator<SpreadsheetRecord>() { @Override public boolean hasNext() { return iterator.hasNext(); } @Override public SpreadsheetRecord next() { return new XlsRecordImpl(getCellValues(iterator.next()), myHeaders); } @Override public void remove() { throw new UnsupportedOperationException(); } }; }</code><technical_language>Iterators.transform</technical_language>

Target:
public Iterator<SpreadsheetRecord> iterator() { return Iterators.transform(myBook.getSheetAt(0).iterator(), (input) -> new XlsRecordImpl(getCellValues(input), myHeaders)); }
Source:
<code>public HueLightHandler(Thing hueLight) { super(hueLight); lightId = null; lastSentColorTemp = null; lastSentBrightness = null; isOsramPar16 = false; propertiesInitializedSuccessfully = false; bridgeHandler = null; <START> scheduledFuture = null; <END> }</code><technical_language>reasons for initializations here? done implicit already</technical_language>

Target:
public HueLightHandler(Thing hueLight) { super(hueLight); }
Source:
<code>protected void bindWidgetToSetting(UIWidget widget) { UISlider slider = widget.find("slider", UISlider.class); assert slider != null; updateSliderIfInteger(slider); setSliderRange(slider); slider.bindValue(new Binding<Float>() { @Override public Float get() { return getSetting().getValue().floatValue(); } @Override public void set(Float value) { <START> setSettingValue(value); <END> } }); }</code><technical_language>need this in a separate function if a oneliner, IMO</technical_language>

Target:
protected void bindWidgetToSetting(UIWidget widget) { UISlider slider = widget.find("slider", UISlider.class); assert slider != null; updateSliderIfInteger(slider); setSliderRange(slider); slider.bindValue(new Binding<Float>() { @Override public Float get() { return getSetting().get().floatValue(); } @Override public void set(Float value) { setSettingValue(value); } }); }
Source:
<code>Sequence<ScanResultValue> nWayMergeAndLimit( List<List<QueryRunner<ScanResultValue>>> groupedRunners, QueryPlus<ScanResultValue> queryPlus, Map<String, Object> responseContext ) { return Sequences.concat( Sequences.map( Sequences.simple(groupedRunners), runnerGroup -> Sequences.map( Sequences.simple(runnerGroup), (input) -> Sequences.concat( Sequences.map( input.run(queryPlus, responseContext), srv -> Sequences.simple(srv.toSingleEventScanResultValues()) ) ) ).flatMerge( seq -> seq, Ordering.from(new ScanResultValueTimestampComparator( (ScanQuery) queryPlus.getQuery() )).reverse() ) ) ).limit( <START> Math.toIntExact(((ScanQuery) (queryPlus.getQuery())).getLimit()) <END> ); }</code><technical_language>I _think_ ok too. skip sequence limit if limit is default Long.MAX_VALUE</technical_language>

Target:
Sequence<ScanResultValue> nWayMergeAndLimit( List<List<QueryRunner<ScanResultValue>>> groupedRunners, QueryPlus<ScanResultValue> queryPlus, Map<String, Object> responseContext ) { Sequence<ScanResultValue> resultSequence = Sequences.concat( Sequences.map( Sequences.simple(groupedRunners), runnerGroup -> Sequences.map( Sequences.simple(runnerGroup), (input) -> Sequences.concat( Sequences.map( input.run(queryPlus, responseContext), srv -> Sequences.simple(srv.toSingleEventScanResultValues()) ) ) ).flatMerge( seq -> seq, Ordering.from(new ScanResultValueTimestampComparator( (ScanQuery) queryPlus.getQuery() )).reverse() ) ) ); long limit = ((ScanQuery) (queryPlus.getQuery())).getLimit(); if (limit == Long.MAX_VALUE) { return resultSequence; } return resultSequence.limit(limit); }
Source:
<code>public void remove() { if (getConfirmWindow() != null) { return; } <START> ConfirmationModel model = getRemoveQosModel(); <END> setConfirmWindow(model); }</code><technical_language>variable removed</technical_language>

Target:
public void remove() { if (getConfirmWindow() != null) { return; } setConfirmWindow(getRemoveQosModel()); }
Source:
<code>public Resource getConfigFile(String profile, String label, String path) { Assert.isTrue( configClientProperties.getName() != null && !configClientProperties.getName().isEmpty(), "Spring application name is undefined."); Assert.isTrue( configClientProperties.getUri() != null && !configClientProperties.getUri().isEmpty(), "Config server URI is undefined."); if (profile == null) { profile = configClientProperties.getProfile(); if (profile == null || profile.isEmpty()) { profile = "default"; } } if (label == null) { label = configClientProperties.getLabel(); } String url = configClientProperties.getUri() + "/" + configClientProperties.getName() + "/" + profile + "/" + (label == null ? path + "?useDefaultLabel" : label + "/" + path); <START> System.out.println(url); <END> ResponseEntity<Resource> forEntity = restTemplate.getForEntity(url, Resource.class); return forEntity.getBody(); }</code><technical_language>Debugging println removed</technical_language>

Target:
public Resource getConfigFile(String profile, String label, String path) { Assert.isTrue( configClientProperties.getName() != null && !configClientProperties.getName().isEmpty(), "Spring application name is undefined."); Assert.isTrue( configClientProperties.getUri() != null && !configClientProperties.getUri().isEmpty(), "Config server URI is undefined."); if (profile == null) { profile = configClientProperties.getProfile(); if (profile == null || profile.isEmpty()) { profile = "default"; } } if (label == null) { label = configClientProperties.getLabel(); } String url = configClientProperties.getUri() + "/" + configClientProperties.getName() + "/" + profile + "/" + (label == null ? path + "?useDefaultLabel" : label + "/" + path); ResponseEntity<Resource> forEntity = restTemplate.getForEntity(url, Resource.class); return forEntity.getBody(); }
Source:
<code>public EventListWriter(AnnotationRegistry<Event> annotationRegistry) { <START> this.annotationRegistry = annotationRegistry; <END> }</code><technical_language>checkNotNull constructor params Ditto for other constructors</technical_language>

Target:
public EventListWriter(AnnotationRegistry<Event> annotationRegistry) { this.annotationRegistry = checkNotNull(annotationRegistry); }
Source:
<code>public ReadModifyWriteRowRequest.Builder adapt(Append operation) { ReadModifyWriteRowRequest.Builder result = ReadModifyWriteRowRequest.newBuilder(); result.setRowKey(ByteString.copyFrom(operation.getRow())); for (Map.Entry<byte[], List<Cell>> entry : operation.getFamilyCellMap().entrySet()){ String familyName = Bytes.toString(entry.getKey()); for (Cell cell : entry.getValue()) { <START> ReadModifyWriteRule.Builder rule = result.addRulesBuilder(); <END> rule.setFamilyName(familyName); rule.setColumnQualifier( ByteString.copyFrom( cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength())); rule.setAppendValue( ByteString.copyFrom( cell.getValueArray(), cell.getValueOffset(), cell.getValueLength())); } } return result; }</code><technical_language>missing something, this properly handles HBase's bizarre "last append wins" behavior</technical_language>

Target:
public ReadModifyWriteRowRequest.Builder adapt(Append operation) { ReadModifyWriteRowRequest.Builder result = ReadModifyWriteRowRequest.newBuilder(); result.setRowKey(ByteString.copyFrom(operation.getRow())); for (Map.Entry<byte[], List<Cell>> entry : operation.getFamilyCellMap().entrySet()){ String familyName = Bytes.toString(entry.getKey()); List<Cell> cells = CellDeduplicationHelper.deduplicateFamily(operation, entry.getKey()); for (Cell cell : cells) { ReadModifyWriteRule.Builder rule = result.addRulesBuilder(); rule.setFamilyName(familyName); rule.setColumnQualifier( ByteString.copyFrom( cell.getQualifierArray(), cell.getQualifierOffset(), cell.getQualifierLength())); rule.setAppendValue( ByteString.copyFrom( cell.getValueArray(), cell.getValueOffset(), cell.getValueLength())); } } return result; }
Source:
<code>public void visitTryStatement(TryStatementTree tree) { boolean hasAutoCloseableSoftAssertion = tree.resources().stream() .map(VariableTree::symbol) <START> .map(Symbol::type) <END> .filter(type -> type != null) .filter(type -> type.isSubtypeOf("org.assertj.core.api.AutoCloseableSoftAssertions")) .findFirst() .isPresent(); super.visitTryStatement(tree); if (hasAutoCloseableSoftAssertion) { checkAssertJAssertAll(tree.block().closeBraceToken()); } }</code><technical_language>![MAJOR](<LINK_0> Unknown method [![rule](<LINK_1>](<LINK_2></technical_language>

Target:
public void visitTryStatement(TryStatementTree tree) { boolean hasAutoCloseableSoftAssertion = tree.resources().stream() .map(VariableTree::symbol) .map(Symbol::type) .filter(type -> type != null) .filter(type -> type.isSubtypeOf("org.assertj.core.api.AutoCloseableSoftAssertions")) .findFirst() .isPresent(); super.visitTryStatement(tree); if (hasAutoCloseableSoftAssertion) { checkAssertJAssertAll(tree.block().closeBraceToken(), "Add one or more 'assertThat' before the end of this try block."); } }
Source:
<code>public void updateUserShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); <START> return null; <END> } }).build(); final UserService userService = adapter.create(UserService.class); userService.updateUser(new HashMap<String, Object>(), new RetrofitPromise<User>()); latch.await(); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me", MOCK_URL)); Assert.assertEquals(bodyRef.get().getMethod(), "PATCH"); }</code><technical_language>Add newline return</technical_language>

Target:
public void updateUserShouldReturnTheRequest() throws Exception { final AtomicReference<Request> bodyRef = new AtomicReference<>(); final CountDownLatch latch = new CountDownLatch(1); final RestAdapter adapter = new RestAdapter.Builder().setEndpoint(MOCK_URL).setClient(new Client() { @Override public Response execute(Request request) throws IOException { bodyRef.set(request); latch.countDown(); return null; } }).build(); final UserService userService = adapter.create(UserService.class); userService.updateUser(new HashMap<String, Object>(), new RetrofitPromise<User>()); latch.await(); Assert.assertEquals(bodyRef.get().getMethod(), "PATCH"); Assert.assertEquals(bodyRef.get().getUrl(), String.format("%s/v0/me", MOCK_URL)); }
Source:
<code><START> public static void renameTempIndexFile(File workDir) throws IgniteCheckedException { <END> File defragmentedIdxTmpFile = defragmentedIndexTmpFile(workDir); File defragmentedIdxFile = defragmentedIndexFile(workDir); try { Files.move(defragmentedIdxTmpFile.toPath(), defragmentedIdxFile.toPath(), ATOMIC_MOVE); } catch (IOException e) { throw new IgniteCheckedException(e); } }</code><technical_language>once, do need all? simple actions inlined</technical_language>

Target:
public static void renameTempIndexFile(File workDir) throws IgniteException { File defragmentedIdxTmpFile = defragmentedIndexTmpFile(workDir); File defragmentedIdxFile = defragmentedIndexFile(workDir); try { Files.move(defragmentedIdxTmpFile.toPath(), defragmentedIdxFile.toPath(), ATOMIC_MOVE); } catch (IOException e) { throw new IgniteException(e); } }
Source:
<code>public void start() { long interval = randomTimeInterval(); logger.info("Scheduling CardCaptureProcess to run every seconds (will start in seconds)", interval, initialDelayInSeconds); scheduledExecutorService.scheduleAtFixedRate(() -> { for (int threadNumber = 1; threadNumber <= schedulerThreads; threadNumber++) { final int finalThreadNumber = threadNumber; <START> cardCaptureProcess.loadCaptureQueue(); <END> scheduleCaptureThreads(finalThreadNumber); } }, initialDelayInSeconds, interval, TimeUnit.SECONDS); }</code><technical_language>need load capture queue once. this line for loop</technical_language>

Target:
public void start() { long interval = randomTimeInterval(); logger.info("Scheduling CardCaptureProcess to run every seconds (will start in seconds)", interval, initialDelayInSeconds); scheduledExecutorService.scheduleAtFixedRate(() -> { cardCaptureProcess.loadCaptureQueue(); scheduleCaptureThreads(); }, initialDelayInSeconds, interval, TimeUnit.SECONDS); }
Source:
<code>private void transformers_2_0_0(ChainedTransformationDescriptionBuilder parentBuilder) { <START> AttributeTransformationDescriptionBuilder attributeBuilder = parentBuilder.createBuilder(VERSION_2_0_0, VERSION_1_0_0).getAttributeBuilder(); <END> attributeBuilder.setDiscard(DiscardAttributeChecker.UNDEFINED, RECOVERY_USERNAME_ATTRIBUTE, RECOVERY_PASSWORD_ATTRIBUTE, RECOVERY_AUTHENTICATION_CONTEXT, RECOVERY_CREDENTIAL_REFERENCE); attributeBuilder.addRejectCheck(RejectAttributeChecker.DEFINED, RECOVERY_USERNAME_ATTRIBUTE, RECOVERY_PASSWORD_ATTRIBUTE, RECOVERY_AUTHENTICATION_CONTEXT, RECOVERY_CREDENTIAL_REFERENCE); attributeBuilder.addRejectCheck(new RejectAttributeChecker.SimpleAcceptAttributeChecker(ModelNode.FALSE), RECOVERY); }</code><technical_language>This adds attribute transformers subsystem resource, - xa-datasource=* child resources. So: do: parentBuilder.createBuilder(.....) .addChildResource(PathElement.pathElement("xa-datasource")) .getAttributeBuilder() This add in right place</technical_language>

Target:
private static void transformers_2_0_0(ChainedTransformationDescriptionBuilder parentBuilder) { ResourceTransformationDescriptionBuilder resourceTransformation = parentBuilder.createBuilder(VERSION_2_0_0, VERSION_1_0_0); AttributeTransformationDescriptionBuilder xaAttributeBuilder = resourceTransformation.addChildResource(pathElement("xa-datasource")).getAttributeBuilder(); xaAttributeBuilder.setDiscard(DiscardAttributeChecker.ALWAYS, RECOVERY_USERNAME_ATTRIBUTE, RECOVERY_PASSWORD_ATTRIBUTE, RECOVERY_AUTHENTICATION_CONTEXT, RECOVERY_CREDENTIAL_REFERENCE); xaAttributeBuilder.setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(ModelNode.FALSE), RECOVERY ); xaAttributeBuilder.addRejectCheck(RejectAttributeChecker.ALL, RECOVERY); }
Source:
<code>public void update(Bounds bounds, double zoom) { int minRank = (int) (Math.max(bounds.getMinX() / RANK_WIDTH, 0)); int maxRank = (int) (RANK_WIDTH + bounds.getMaxX() / RANK_WIDTH); if (minRank < lastLoaded.getX() || maxRank > lastLoaded.getY()) { minRank = Math.min(Math.max(minRank, 0), graph.getMaxRank()); maxRank = Math.min(Math.max(minRank, maxRank), graph.getMaxRank()); minRankProperty().set(minRank); maxRankProperty().set(maxRank); <START> lastLoaded = new Range(minRank / 2, maxRank * 2); <END> loadContent(new Range(lastLoaded.getX(), lastLoaded.getY()), zoom); } }</code><technical_language>is this</technical_language>

Target:
public void update(Bounds bounds, double zoom) { int minRank = (int) (Math.max(bounds.getMinX() / RANK_WIDTH, 0)); int maxRank = (int) (RANK_WIDTH + bounds.getMaxX() / RANK_WIDTH); minRank = Math.min(Math.max(minRank, 0), graph.getMaxRank()); maxRank = Math.min(Math.max(minRank, maxRank), graph.getMaxRank()); minRankProperty().set(minRank); maxRankProperty().set(maxRank); loadContent(new Range(minRank, maxRank), zoom); }
Source:
<code>public void addIndex(final UUID applicationId,final String indexSuffix,final int shards,final int replicas){ EntityIndex entityIndex = getManagerCache().getEntityIndex(CpNamingUtils.getApplicationScope(applicationId)); if(entityIndex instanceof AliasedEntityIndex) { ((AliasedEntityIndex)entityIndex).addIndex(indexSuffix, shards, replicas); <START> } <END> }</code><technical_language>if right instance? throw UnsupportedOperationException? Or, is a create factory, right instance type? this rarely, I need worry cache for efficiency</technical_language>

Target:
public void addIndex(final UUID applicationId,final String indexSuffix,final int shards,final int replicas){ EntityIndex entityIndex = getManagerCache().getEntityIndex(CpNamingUtils.getApplicationScope(applicationId)); entityIndex.addIndex(indexSuffix, shards, replicas); }
Source:
<code><START> @Override public int score(Capabilities capabilites) { <END> int score = 0; if(capabilites.getCapability(PLATFORM_NAME) != null) { score++; } return score; }</code><technical_language>is purpose of this method</technical_language>

Target:
@Override public int score(Capabilities capabilites) { int score = 0; if (capabilites.getCapability(PLATFORM_NAME) != null) { score++; } String browserName = capabilites.getBrowserName(); if (browserName.equals(BrowserType.CHROME) || browserName.equals(BrowserType.ANDROID) || browserName.equals(BrowserType.SAFARI)) { score++; } return score; }
Source:
<code>public static JFreeChart createXYStepChart(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { ParamChecks.nullNotPermitted(orientation, "orientation"); DateAxis xAxis = new DateAxis(xAxisLabel); NumberAxis yAxis = new NumberAxis(yAxisLabel); yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); XYToolTipGenerator toolTipGenerator = null; <START> if (tooltips) { <END> toolTipGenerator = new StandardXYToolTipGenerator(); } XYURLGenerator urlGenerator = null; if (urls) { urlGenerator = new StandardXYURLGenerator(); } XYItemRenderer renderer = new XYFilteringStepRenderer(toolTipGenerator, urlGenerator); XYPlotWithFiltering plot = new XYPlotWithFiltering(dataset, xAxis, yAxis, null); plot.setRenderer(renderer); plot.setOrientation(orientation); plot.setDomainCrosshairVisible(false); plot.setRangeCrosshairVisible(false); JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); ChartFactory.getChartTheme().apply(chart); return chart; }</code><technical_language>tooltips -> useToolTips</technical_language>

Target:
public static JFreeChart createXYStepChart(String title, String xAxisLabel, String yAxisLabel, XYDataset dataset, PlotOrientation orientation, boolean legend, boolean tooltips, boolean urls) { ParamChecks.nullNotPermitted(orientation, "orientation"); final DateAxis xAxis = new DateAxis(xAxisLabel); final NumberAxis yAxis = new NumberAxis(yAxisLabel); yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); final XYItemRenderer renderer = new XYFilteringStepRenderer(null, null); final XYPlotWithFiltering plot = new XYPlotWithFiltering(dataset, xAxis, yAxis, renderer); plot.setOrientation(orientation); plot.setDomainCrosshairVisible(false); plot.setRangeCrosshairVisible(false); final JFreeChart chart = new JFreeChart(title, JFreeChart.DEFAULT_TITLE_FONT, plot, legend); ChartFactory.getChartTheme().apply(chart); return chart; }
Source:
<code>private Map<String, Attribute> getCachedOwnAttrs() { if (cachedOwnAttrs == null) { cachedOwnAttrs = newLinkedHashMap(); <START> getEntities(ATTRIBUTES, Attribute.class) <END> .forEach(attr -> cachedOwnAttrs.put(attr.getName(), attr)); } return cachedOwnAttrs; }</code><technical_language>new LinkedHashMap<>();</technical_language>

Target:
private Map<String, Attribute> getCachedOwnAttrs() { if (cachedOwnAttrs == null) { cachedOwnAttrs = new LinkedHashMap<>(); getEntities(ATTRIBUTES, Attribute.class) .forEach(attr -> cachedOwnAttrs.put(attr.getName(), attr)); } return cachedOwnAttrs; }
Source:
<code>public ResultScanner getScanner(Scan scan) throws IOException { LOG.trace("getScanner(Scan)"); com.google.cloud.bigtable.grpc.scanner.ResultScanner<FlatRow> scanner = null; try { scanner = client.readFlatRows(hbaseAdapter.adapt(scan)); if (hasWhileMatchFilter(scan.getFilter())) { return Adapters.BIGTABLE_WHILE_MATCH_RESULT_RESULT_SCAN_ADAPTER.adapt(scanner); } return Adapters.BIGTABLE_RESULT_SCAN_ADAPTER.adapt(scanner); } catch (Throwable throwable) { LOG.error("Encountered exception when executing getScanner.", throwable); if (scanner != null) { scanner.close(); <START> } <END> throw new IOException( makeGenericExceptionMessage( "getScanner", options.getProjectId(), tableName.getQualifierAsString()), throwable); } }</code><technical_language>this pulled out a separate PR</technical_language>

Target:
public ResultScanner getScanner(Scan scan) throws IOException { LOG.trace("getScanner(Scan)"); try { com.google.cloud.bigtable.grpc.scanner.ResultScanner<FlatRow> scanner = client.readFlatRows(hbaseAdapter.adapt(scan)); if (hasWhileMatchFilter(scan.getFilter())) { return Adapters.BIGTABLE_WHILE_MATCH_RESULT_RESULT_SCAN_ADAPTER.adapt(scanner); } return Adapters.BIGTABLE_RESULT_SCAN_ADAPTER.adapt(scanner); } catch (Throwable throwable) { LOG.error("Encountered exception when executing getScanner.", throwable); throw new IOException( makeGenericExceptionMessage( "getScanner", options.getProjectId(), tableName.getQualifierAsString()), throwable); } }
Source:
<code>private String getAnnotationNameFromExportFileElement(final Element e) { <START> return ExportFileName.decodeAnnotationClassNameFromExportFileName(e.asType().toString()); <END> }</code><technical_language>a fun I learned week is toString() TypeElement is standard compiler implementations. In Eclipse give a string "class org.acme.Foo" instead of name. portable do this is call e.asType().getQualifiedName().toString()</technical_language>

Target:
private String getAnnotationNameFromExportFileElement(final Element e) { final TypeElement typeElement = (TypeElement) e; return ExportFileName.decodeAnnotationClassNameFromExportFileName(typeElement.getQualifiedName().toString()); }
Source:
<code>private List<Workflow> getBioworkflows(User user) { <START> return serviceDAO.findMyEntries(user.getId()).stream().map(BioWorkflow.class::cast).collect(Collectors.toList()); <END> }</code><technical_language>this work, asking serviceDAO for workflows workflowDAO is I expected. Tests passing ... this needs tests</technical_language>

Target:
private List<Workflow> getBioworkflows(User user) { return workflowDAO.findMyEntries(user.getId()).stream().map(BioWorkflow.class::cast).collect(Collectors.toList()); }
Source:
<code>public Mono<ConfigurationSetting> getSetting(String key, String label, OffsetDateTime asOfDateTime) { return withContext(context -> getSetting(new ConfigurationSetting().setKey(key).setLabel(label), asOfDateTime, <START> false, context)).map(response -> response.getValue()); <END> }</code><technical_language>is a FluxUtil method handle pulling a response out, I is called toMono. in places update</technical_language>

Target:
public Mono<ConfigurationSetting> getSetting(String key, String label, OffsetDateTime asOfDateTime) { return withContext(context -> getSetting(new ConfigurationSetting().setKey(key).setLabel(label), asOfDateTime, false, context)) .flatMap(response -> Mono.justOrEmpty(response.getValue())); }
Source:
<code>public boolean evaluate(HttpServletRequest request, HttpServletResponse response, Instance instance) { boolean evalSuccess; if(request.getSession().getAttribute(instance.sessionKey) == null){ <START> if(instance.comparison.equals(IS_NOT)){ <END> evalSuccess = true; }else { evalSuccess = false; } } else { String sessionActualValue = request.getSession().getAttribute(instance.sessionKey).toString(); if(instance.comparison == EXISTS) { evalSuccess = EXISTS.perform(sessionActualValue); } else { if(instance.comparison != REGEX) { evalSuccess = instance.comparison.perform(sessionActualValue.toLowerCase(), instance.sessionValue.toLowerCase()); } else { evalSuccess = REGEX.perform(sessionActualValue, instance.sessionValue); } } } return evalSuccess; }</code><technical_language>do evalSuccess = instance.comparison.equals(IS_NOT);</technical_language>

Target:
public boolean evaluate(HttpServletRequest request, HttpServletResponse response, Instance instance) { boolean evalSuccess; if(request.getSession().getAttribute(instance.sessionKey) == null){ evalSuccess = instance.comparison.equals(IS_NOT); } else { String sessionActualValue = request.getSession().getAttribute(instance.sessionKey).toString(); if(instance.comparison == EXISTS) { evalSuccess = EXISTS.perform(sessionActualValue); } else { if(instance.comparison != REGEX) { evalSuccess = instance.comparison.perform(sessionActualValue.toLowerCase(), instance.sessionValue.toLowerCase()); } else { evalSuccess = REGEX.perform(sessionActualValue, instance.sessionValue); } } } return evalSuccess; }
Source:
<code>public static BootConfigValidationResult validateBootConfig(BootConfig config) { if (config == null) { return new BootConfigValidationResult(false, "No boot config provided."); } if (SalesforceSDKManager.getInstance().isHybrid()) { String startPage = config.getStartPage(); if (startPage == null) { return new BootConfigValidationResult(false, "No start page configured."); } if (config.isLocal() && config.isStartPageAbsoluteUrl()) { return new BootConfigValidationResult(false, "Local start page should not be absolute URL."); } <START> if (!config.isLocal()) { <END> if (config.shouldAuthenticate()) { if (config.isStartPageAbsoluteUrl()) { return new BootConfigValidationResult(false, "Cannot authenticate using an absolute URL for start page."); } } else { if (!config.isStartPageAbsoluteUrl()) { return new BootConfigValidationResult(false, "Cannot configure relative URL start page with deferred authentication."); } } } return new BootConfigValidationResult(true); } else { return new BootConfigValidationResult(true); } }</code><technical_language>easier read this: java if (!config.isLocal() && config.shouldAuthenticate() && config.isStartPageAbsoluteUrl()) { return new BootConfigValidationResult(false, "Cannot authenticate absolute URL for start page."); } if (!config.isLocal() && !config.shouldAuthenticate() && !config.isStartPageAbsoluteUrl()) { return new BootConfigValidationResult(false, "Cannot configure relative URL start page deferred authentication."); }</technical_language>

Target:
public static void validateBootConfig(BootConfig config) { if (config == null) { throw new BootConfigException("No boot config provided."); } if (SalesforceSDKManager.getInstance().isHybrid()) { String startPage = config.getStartPage(); if (startPage == null) { throw new BootConfigException("No start page configured."); } if (config.isLocal() && config.isStartPageAbsoluteUrl()) { throw new BootConfigException("Local start page should not be absolute URL."); } if (!config.isLocal() && config.shouldAuthenticate() && config.isStartPageAbsoluteUrl()) { throw new BootConfigException("Cannot authenticate using an absolute URL for start page."); } if (!config.isLocal() && !config.shouldAuthenticate() && !config.isStartPageAbsoluteUrl()) { throw new BootConfigException("Cannot configure relative URL start page with deferred authentication."); } } }
Source:
<code>public void marshal(ITypeMarshalBuffer buffer) throws CoreException { final short SECOND_LAST_FLAG= ITypeMarshalBuffer.LAST_FLAG / 2; final int kind= getKind().ordinal(); final int shiftedKind= kind * ITypeMarshalBuffer.FIRST_FLAG; final int modifiers= getModifiers(); short firstBytes = (short) (ITypeMarshalBuffer.BASIC_TYPE | shiftedKind); if (modifiers != 0) firstBytes |= ITypeMarshalBuffer.LAST_FLAG; if (getAssociatedNumericalValue() != null) firstBytes |= SECOND_LAST_FLAG; buffer.putShort(firstBytes); if (modifiers != 0) buffer.putByte((byte) modifiers); <START> if (getAssociatedNumericalValue() != null) <END> buffer.putLong(getAssociatedNumericalValue()); }</code><technical_language>sense fAssociatedValue instead of getAssociatedNumericalValue() code more explicit</technical_language>

Target:
public void marshal(ITypeMarshalBuffer buffer) throws CoreException { final int kind= getKind().ordinal(); final int shiftedKind= kind * ITypeMarshalBuffer.FIRST_FLAG; final int modifiers= getModifiers(); short firstBytes = (short) (ITypeMarshalBuffer.BASIC_TYPE | shiftedKind); if (modifiers != 0) firstBytes |= ITypeMarshalBuffer.LAST_FLAG; if (fAssociatedValue != null) firstBytes |= ITypeMarshalBuffer.SECOND_LAST_FLAG; buffer.putShort(firstBytes); if (modifiers != 0) buffer.putByte((byte) modifiers); if (fAssociatedValue != null) buffer.putLong(getAssociatedNumericalValue()); }