auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void unpackAndValidateId(String keyId) { if (keyId != null && keyId.length() > 0) { try { URL url = new URL(keyId); String[] tokens = url.getPath().split("/"); String endpoint = url.getProtocol() + "://" + url.getHost(); String keyName = (tokens.length >= 3 ? tokens[2] : null); version = (tokens.length >= 4 ? tokens[3] : null); if(Strings.isNullOrEmpty(endpoint)) { throw new IllegalArgumentException("Key endpoint in key id is invalid"); } else if (Strings.isNullOrEmpty(keyName)) { throw new IllegalArgumentException("Key name in key id is invalid"); } else if(Strings.isNullOrEmpty(version)) { throw new IllegalArgumentException("Key version in key id is invalid"); } } catch (MalformedURLException e) { <START> e.printStackTrace(); <END> } } else { throw new IllegalArgumentException("Key Id is invalid"); } }</code><technical_language>printStackTrace(). Wrap in IllegalArgumentException throw if want throw, log warning</technical_language>

Target:
private void unpackAndValidateId(String keyId) { if (ImplUtils.isNullOrEmpty(keyId)) { throw new IllegalArgumentException("Key Id is invalid"); } try { URL url = new URL(keyId); String[] tokens = url.getPath().split("/"); String endpoint = url.getProtocol() + "://" + url.getHost(); String keyName = (tokens.length >= 3 ? tokens[2] : null); String version = (tokens.length >= 4 ? tokens[3] : null); if (Strings.isNullOrEmpty(endpoint)) { throw new IllegalArgumentException("Key endpoint in key id is invalid"); } else if (Strings.isNullOrEmpty(keyName)) { throw new IllegalArgumentException("Key name in key id is invalid"); } else if (Strings.isNullOrEmpty(version)) { throw new IllegalArgumentException("Key version in key id is invalid"); } } catch (MalformedURLException e) { throw new IllegalArgumentException("The key identifier is malformed", e); } }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; DefaultManagementRegistryConfiguration that = (DefaultManagementRegistryConfiguration) o; return Objects.equals(tags, that.tags) && Objects.equals(productInstanceId, that.productInstanceId) && Objects.equals(context, that.context) && <START> Objects.equals(collectorExecutorAlias, that.collectorExecutorAlias); <END> }</code><technical_language>productInstanceId enough hashcode</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; DefaultManagementRegistryConfiguration that = (DefaultManagementRegistryConfiguration) o; return Objects.equals(tags, that.tags) && Objects.equals(instanceId, that.instanceId) && Objects.equals(context, that.context) && Objects.equals(collectorExecutorAlias, that.collectorExecutorAlias); }
Source:
<code>Context prepareDefaultContext(boolean parseAsFlume) { Context context = new Context(); context.put(BOOTSTRAP_SERVERS_CONFIG, testUtil.getKafkaServerUrl()); context.put(PARSE_AS_FLUME_EVENT, String.valueOf(parseAsFlume)); <START> context.put("offsets.topic.replication.factor", "1"); <END> context.put(TOPIC_CONFIG, topic); return context; }</code><technical_language>this change bring? need this get test working</technical_language>

Target:
Context prepareDefaultContext(boolean parseAsFlume) { Context context = new Context(); context.put(BOOTSTRAP_SERVERS_CONFIG, testUtil.getKafkaServerUrl()); context.put(PARSE_AS_FLUME_EVENT, String.valueOf(parseAsFlume)); context.put(TOPIC_CONFIG, topic); return context; }
Source:
<code>private void writeCacheInfo(PayloadOutputChannel payloadCh) { BinaryOutputStream out = payloadCh.out(); out.writeInt(cacheId); byte flags = keepBinary ? KEEP_BINARY_FLAG_MASK : 0; TcpClientTransaction tx = transactions.tx(); if (expiryPlc != null) { <START> ProtocolContext protocolContext = payloadCh.clientChannel().protocolContext(); <END> if (!protocolContext.isExpirationPolicySupported()) { throw new ClientProtocolError(String.format("Expire policies are not supported by the server " + "version %s, required version %s", protocolContext.version(), V1_6_0)); } flags |= WITH_EXPIRY_POLICY_FLAG_MASK; } if (tx != null) { if (tx.clientChannel() != payloadCh.clientChannel()) { throw new ClientException("Transaction context has been lost due to connection errors. " + "Cache operations are prohibited until current transaction closed."); } flags |= TRANSACTIONAL_FLAG_MASK; } out.writeByte(flags); if ((flags & WITH_EXPIRY_POLICY_FLAG_MASK) != 0) { out.writeLong(convertDuration(expiryPlc.getExpiryForCreation())); out.writeLong(convertDuration(expiryPlc.getExpiryForUpdate())); out.writeLong(convertDuration(expiryPlc.getExpiryForAccess())); } if ((flags & TRANSACTIONAL_FLAG_MASK) != 0) out.writeInt(tx.txId()); }</code><technical_language>Newline missed (codestyle)</technical_language>

Target:
private void writeCacheInfo(PayloadOutputChannel payloadCh) { BinaryOutputStream out = payloadCh.out(); out.writeInt(cacheId); byte flags = keepBinary ? KEEP_BINARY_FLAG_MASK : 0; TcpClientTransaction tx = transactions.tx(); if (expiryPlc != null) { ProtocolContext protocolCtx = payloadCh.clientChannel().protocolCtx(); if (!protocolCtx.isFeatureSupported(EXPIRY_POLICY)) { throw new ClientProtocolError(String.format("Expire policies are not supported by the server " + "version %s, required version %s", protocolCtx.version(), EXPIRY_POLICY.verIntroduced())); } flags |= WITH_EXPIRY_POLICY_FLAG_MASK; } if (tx != null) { if (tx.clientChannel() != payloadCh.clientChannel()) { throw new ClientException("Transaction context has been lost due to connection errors. " + "Cache operations are prohibited until current transaction closed."); } flags |= TRANSACTIONAL_FLAG_MASK; } out.writeByte(flags); if ((flags & WITH_EXPIRY_POLICY_FLAG_MASK) != 0) { out.writeLong(convertDuration(expiryPlc.getExpiryForCreation())); out.writeLong(convertDuration(expiryPlc.getExpiryForUpdate())); out.writeLong(convertDuration(expiryPlc.getExpiryForAccess())); } if ((flags & TRANSACTIONAL_FLAG_MASK) != 0) out.writeInt(tx.txId()); }
Source:
<code>public HaxeDocumentModel getDocument() { <START> if (_document == null) _document = new HaxeDocumentModel(haxeClass); <END> return _document; }</code><technical_language>I local caches in models Carlos introduced. :/ Besides, creating of is dirt cheap. I idea wanted a cache</technical_language>

Target:
public HaxeDocumentModel getDocument() { return new HaxeDocumentModel(haxeClass); }
Source:
<code>private <T extends Projectile> T launchProjectile(Class<? extends T> type, Location location, double x, double y, double z, float speed) { double magnitude = Math.sqrt(x * x + y * y + z * z); if (magnitude > 0) { x += (x * (speed - magnitude)) / magnitude; y += (y * (speed - magnitude)) / magnitude; z += (z * (speed - magnitude)) / magnitude; } location.add(location.getDirection()); location.setPitch(0); location.setYaw(0); T projectile = null; if (EntityRegistry.getEntity(type) != null) { projectile = EntityStorage.create(type, location); } else { throw new IllegalArgumentException("Could not find projectile of type '" + type.getSimpleName() + "'"); } ProjectileLaunchEvent launchEvent = EventFactory.getInstance() .callEvent(new ProjectileLaunchEvent(projectile)); if (launchEvent.isCancelled()) { <START> projectile.remove();; <END> } else { ((GlowWorld) location.getWorld()).spawn(location, (GlowProjectile) projectile, CreatureSpawnEvent.SpawnReason.CUSTOM); } projectile.setVelocity(new Vector(x, y, z)); ((GlowProjectile) projectile).setRawLocation(location); return projectile; }</code><technical_language>Spotted double semicolon ;)</technical_language>

Target:
private <T extends Projectile> T launchProjectile(Class<? extends T> type, Location location, double x, double y, double z, float speed) { double magnitude = Math.sqrt(x * x + y * y + z * z); if (magnitude > 0) { x += (x * (speed - magnitude)) / magnitude; y += (y * (speed - magnitude)) / magnitude; z += (z * (speed - magnitude)) / magnitude; } location.add(location.getDirection()); location.setPitch(0); location.setYaw(0); T projectile = ((GlowWorld) location.getWorld()).spawn(location, type); ProjectileLaunchEvent launchEvent = EventFactory.getInstance() .callEvent(new ProjectileLaunchEvent(projectile)); if (launchEvent.isCancelled()) { projectile.remove(); } projectile.setVelocity(new Vector(x, y, z)); ((GlowProjectile) projectile).setRawLocation(location); return projectile; }
Source:
<code>private Set<String> jsonArrayToSet(JSONArray jsonArray) { if (jsonArray == null) { return null; } List<String> list = new ArrayList<>(); for (int i = 0;i < jsonArray.length(); i++) { list.add((String) jsonArray.get(i)); } <START> return ImmutableSet.<String>builder().addAll(list).build(); <END> }</code><technical_language>this ImmutableSet builder converted a FetchHints care of</technical_language>

Target:
private static Set<String> jsonArrayToSet(JSONArray jsonArray) { if (jsonArray == null) { return null; } Set<String> set = new HashSet<>(); for (int i = 0;i < jsonArray.length(); i++) { set.add((String) jsonArray.get(i)); } return set; }
Source:
<code>public void updateModel(final OperationContext context, ModelNode model, AttributeDefinition attributeDefinition, ModelNode attribute) throws OperationFailedException { String key = KEY.resolveModelAttribute(context, model).asString(); <START> context.getResult().set(attribute.get(key)); <END> }</code><technical_language>WFLY-1069 stuff tie this</technical_language>

Target:
void updateModel(final OperationContext context, ModelNode model, AttributeDefinition attributeDefinition, ModelNode attribute) throws OperationFailedException { String key = KEY.resolveModelAttribute(context, model).asString(); context.getResult().set(attribute.get(key)); }
Source:
<code>public int hashCode() { <START> return clazz.hashCode(); <END> }</code><technical_language>I canonical name here, avoid classes marked equal a hashCode</technical_language>

Target:
public int hashCode() { return clazz.getCanonicalName().hashCode(); }
Source:
<code>public static Comparator<FavouritePoint> getComparator() { final Collator collator = Collator.getInstance(); collator.setStrength(Collator.SECONDARY); Comparator<FavouritePoint> favoritesComparator = new Comparator<FavouritePoint>() { @Override public int compare(FavouritePoint o1, FavouritePoint o2) { String s1 = o1.getName(); String s2 = o2.getName(); int i1 = Algorithms.extractIntegerNumber(s1); int i2 = Algorithms.extractIntegerNumber(s2); String ot1 = Algorithms.extractIntegerPrefix(s1); String ot2 = Algorithms.extractIntegerPrefix(s2); if (ot1.length() == 0) { ot1 = s1; } if (ot2.length() == 0) { ot2 = s2; } int res = collator.compare(ot1, ot2); if (res == 0) { res = i1 - i2; } if (res == 0) { res = collator.compare(s1, s2); } <START> if (s1.equals(WORK) && s2.equals(PARKING) && o1.getCategory().equals(PERSONAL) && o2.getCategory().equals(PERSONAL)) { <END> res = -1; } if (s1.equals(PARKING) && s2.equals(WORK) && o1.getCategory().equals(PERSONAL) && o2.getCategory().equals(PERSONAL)) { res = 1; } return res; } }; return favoritesComparator; }</code><technical_language>wrong sorting. Home absent is translation dependent</technical_language>

Target:
public static Comparator<FavouritePoint> getComparator() { final Collator collator = Collator.getInstance(); collator.setStrength(Collator.SECONDARY); Comparator<FavouritePoint> favoritesComparator = new Comparator<FavouritePoint>() { @Override public int compare(FavouritePoint o1, FavouritePoint o2) { String s1 = o1.getName(); String s2 = o2.getName(); int i1 = Algorithms.extractIntegerNumber(s1); int i2 = Algorithms.extractIntegerNumber(s2); String ot1 = Algorithms.extractIntegerPrefix(s1); String ot2 = Algorithms.extractIntegerPrefix(s2); if (ot1.length() == 0) { ot1 = s1; } if (ot2.length() == 0) { ot2 = s2; } int res = collator.compare(ot1, ot2); if (res == 0) { res = i1 - i2; } if (res == 0) { res = collator.compare(s1, s2); } if (s1.equals(PersonalPoint.WORK.name) && s2.equals(PersonalPoint.PARKING.name) && o1.getCategory().equals(PERSONAL_CATEGORY_NAME) && o2.getCategory().equals(PERSONAL_CATEGORY_NAME)) { res = -1; } if (s1.equals(PersonalPoint.PARKING.name) && s2.equals(PersonalPoint.WORK.name) && o1.getCategory().equals(PERSONAL_CATEGORY_NAME) && o2.getCategory().equals(PERSONAL_CATEGORY_NAME)) { res = 1; } return res; } }; return favoritesComparator; }
Source:
<code><START> public java.util.Collection<Consumer> getConsumers() { <END> return this.virtUuidToConsumerMap.values(); }</code><technical_language>A bit more PoC code left over. do a proper import fully qualify this fly</technical_language>

Target:
public Collection<Consumer> getConsumers() { return this.virtUuidToConsumerMap.values(); }
Source:
<code>private IStatus saveImpl(IProgressMonitor monitor) { final BufferedWriter bw; try { bw = new BufferedWriter(new FileWriter(destination)); } catch (IOException _) { Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, MessageFormat.format(Messages.ExportToTextJob_Unable_to_export_trace, destination), _); return status; } try { bw.write(Messages.ExportToTextJob_Header); return saveImpl(bw, monitor); <START> } catch (IOException _) { <END> Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, MessageFormat.format(Messages.ExportToTextJob_Unable_to_export_trace, destination), _); return status; } finally { try { bw.close(); } catch (IOException e) { } } }</code><technical_language>please a name</technical_language>

Target:
private IStatus saveImpl(IProgressMonitor monitor) { final BufferedWriter bw; try { bw = new BufferedWriter(new FileWriter(destination)); } catch (IOException ex) { Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, MessageFormat.format(Messages.ExportToTextJob_Unable_to_export_trace, destination), ex); return status; } try { if (fHeader != null) { bw.write(fHeader); } return saveImpl(bw, monitor); } catch (IOException ex) { Status status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, MessageFormat.format(Messages.ExportToTextJob_Unable_to_export_trace, destination), ex); return status; } finally { try { bw.close(); } catch (IOException e) { } } }
Source:
<code>public String getTranslatorName() { final String result; if (this.translatorForeign != null) { <START> result = this.translator; <END> } else if (this.translator != null) { result = this.translator; } else { result = this.name; } return result; }</code><technical_language>wanted put result = this.translatorForeign;</technical_language>

Target:
public String getTranslatorName() { final String result; if (this.translatorForeign != null) { result = this.translatorForeign; } else if (this.translator != null) { result = this.translator; } else { result = this.name; } return result; }
Source:
<code>public synchronized Object clone() { if (isReference()) { <START> return getRef(getProject()).clone(); <END> } try { AbstractFileSet fs = (AbstractFileSet) super.clone(); fs.defaultPatterns = (PatternSet) defaultPatterns.clone(); fs.additionalPatterns = additionalPatterns.stream().map(PatternSet::clone) .map(PatternSet.class::cast).collect(Collectors.toList()); fs.selectors = new ArrayList<>(selectors); return fs; } catch (CloneNotSupportedException e) { throw new BuildException(e); } }</code><technical_language>please style changes separate PRs (or create all)</technical_language>

Target:
public synchronized Object clone() { if (isReference()) { return (getRef(getProject())).clone(); } try { AbstractFileSet fs = (AbstractFileSet) super.clone(); fs.defaultPatterns = (PatternSet) defaultPatterns.clone(); fs.additionalPatterns = additionalPatterns.stream().map(PatternSet::clone) .map(PatternSet.class::cast).collect(Collectors.toList()); fs.selectors = new ArrayList<>(selectors); return fs; } catch (CloneNotSupportedException e) { throw new BuildException(e); } }
Source:
<code>public void truncateToSequenceNumber(final long truncationSeqNo) throws IOException { assert(m_memoryDeque.isEmpty()); m_persistentDeque.parseAndTruncate(new BinaryDequeTruncator() { @Override public TruncatorResponse parse(BBContainer bbc) { ByteBuffer b = bbc.b(); ByteOrder endianness = b.order(); b.order(ByteOrder.LITTLE_ENDIAN); try { final long startSequenceNumber = b.getLong(); if (startSequenceNumber > truncationSeqNo) { return PersistentBinaryDeque.fullTruncateResponse(); } final int tupleCountPos = b.position(); final int tupleCount = b.getInt(); final long lastSequenceNumber = startSequenceNumber + tupleCount - 1; if (lastSequenceNumber <= truncationSeqNo) { return null; } long uniqueId = b.getLong(); <START> String uniqueIdString = UniqueIdGenerator.toString(uniqueId); <END> int offset = 0; while (b.hasRemaining()) { if (startSequenceNumber + offset > truncationSeqNo) { b.limit(b.position()); b.putInt(tupleCountPos, offset - 1); b.position(0); return new ByteBufferTruncatorResponse(b); } offset++; final int rowLength = b.getInt(); if (b.position() + rowLength > b.limit()) { System.out.println(rowLength); } b.position(b.position() + rowLength); } return null; } finally { b.order(endianness); } } }); m_persistentDeque.close(); StreamTableSchemaSerializer ds = new StreamTableSchemaSerializer( VoltDB.instance().getCatalogContext(), m_streamName); m_persistentDeque = new PersistentBinaryDeque(m_nonce, ds, new VoltFile(m_path), exportLog); m_reader = m_persistentDeque.openForRead(m_nonce); exportLog.info("After truncate, PBD size is " + (m_reader.sizeInBytes() - (8 * m_reader.getNumObjects()))); }</code><technical_language>Is this anywhere</technical_language>

Target:
public void truncateToSequenceNumber(final long truncationSeqNo) throws IOException { assert(m_memoryDeque.isEmpty()); m_persistentDeque.parseAndTruncate(new BinaryDequeTruncator() { @Override public TruncatorResponse parse(BBContainer bbc) { ByteBuffer b = bbc.b(); ByteOrder endianness = b.order(); b.order(ByteOrder.LITTLE_ENDIAN); try { final long startSequenceNumber = b.getLong(); if (startSequenceNumber > truncationSeqNo) { return PersistentBinaryDeque.fullTruncateResponse(); } final int tupleCountPos = b.position(); final int tupleCount = b.getInt(); final long lastSequenceNumber = startSequenceNumber + tupleCount - 1; if (lastSequenceNumber <= truncationSeqNo) { return null; } b.getLong(); int offset = 0; while (b.hasRemaining()) { if (startSequenceNumber + offset > truncationSeqNo) { b.limit(b.position()); b.putInt(tupleCountPos, offset - 1); b.position(0); return new ByteBufferTruncatorResponse(b); } offset++; final int rowLength = b.getInt(); b.position(b.position() + rowLength); } return null; } finally { b.order(endianness); } } }); m_persistentDeque.close(); StreamTableSchemaSerializer ds = new StreamTableSchemaSerializer( VoltDB.instance().getCatalogContext(), m_streamName); m_persistentDeque = new PersistentBinaryDeque(m_nonce, ds, new VoltFile(m_path), exportLog); m_reader = m_persistentDeque.openForRead(m_nonce); exportLog.info("After truncate, PBD size is " + (m_reader.sizeInBytes() - (8 * m_reader.getNumObjects()))); }
Source:
<code>public void addClient(final Client client) { if(! client.isClosed() && client.getProtocol() == WireProtocol.TCP && isRunning()) { client.setClientsThreadExecutor(clientDistributer.getSubmitterForKey(client)); client.setClientsSocketExecuter(this); <START> if(client.getChannel() != null && client.getChannel().isConnected()) { <END> Client nc = clients.putIfAbsent(client.getChannel(), client); if(nc == null) { if(client.canRead()) { readScheduler.execute(new AddToSelector(client, readSelector, SelectionKey.OP_READ)); readSelector.wakeup(); } if(client.canWrite()) { writeScheduler.execute(new AddToSelector(client, writeSelector, SelectionKey.OP_WRITE)); writeSelector.wakeup(); } } } else { if(client.getChannel() == null) { client.connect(); } Client nc = clients.putIfAbsent(client.getChannel(), client); if(nc == null) { readScheduler.execute(new AddToSelector(client, readSelector, SelectionKey.OP_CONNECT)); readSelector.wakeup(); schedulerPool.schedule(new Runnable() { @Override public void run() { if(!client.hasConnectionTimedOut()) { SelectionKey sk = client.getChannel().keyFor(readSelector); if(sk != null) { sk.cancel(); } removeClient(client); client.close(); } }}, client.getTimeout()+10); } } } }</code><technical_language>Is chance a client channel null checks? If do need store a reference check if reference is null, connected</technical_language>

Target:
public void addClient(final Client client) { ArgumentVerifier.assertNotNull(client, "Client"); if(! client.isClosed() && client.getProtocol() == WireProtocol.TCP && isRunning()) { client.setClientsThreadExecutor(clientDistributer.getSubmitterForKey(client)); client.setClientsSocketExecuter(this); if(client.getChannel() != null && client.getChannel().isConnected()) { Client nc = clients.putIfAbsent(client.getChannel(), client); if(nc == null) { if(client.canRead()) { readScheduler.execute(new AddToSelector(client, readSelector, SelectionKey.OP_READ)); readSelector.wakeup(); } if(client.canWrite()) { writeScheduler.execute(new AddToSelector(client, writeSelector, SelectionKey.OP_WRITE)); writeSelector.wakeup(); } } } else { if(client.getChannel() == null) { client.connect(); } Client nc = clients.putIfAbsent(client.getChannel(), client); if(nc == null) { readScheduler.execute(new AddToSelector(client, readSelector, SelectionKey.OP_CONNECT)); readSelector.wakeup(); schedulerPool.schedule(new Runnable() { @Override public void run() { if(client.hasConnectionTimedOut()) { SelectionKey sk = client.getChannel().keyFor(readSelector); if(sk != null) { sk.cancel(); } removeClient(client); client.close(); client.setConnectionStatus(new TimeoutException("Timed out while connecting!")); } }}, client.getTimeout()+100); } } } }
Source:
<code>public void run() { <START> log.info("Starting cloud provider string migration"); <END> for (Application a : applicationDAO.all()) { if (a.details().containsKey("accounts")) { migrate(a); } } }</code><technical_language>string string I want migrate strings</technical_language>

Target:
public void run() { log.info("Starting account field removal migration"); for (Application a : applicationDAO.all()) { if (a.details().containsKey("accounts")) { migrate(a); } } }
Source:
<code>private void resolvePatterns() { for ( final Pattern52 pattern52 : model.getPatterns() ) { final Pattern pattern = resolvePattern( rule, pattern52 ); new FieldConditionsBuilder( index, model, rule, row, utils, pattern ).buildConditions( pattern52.getChildColumns() ); } <START> for ( final CompositeColumn<? extends BaseColumn> column : model.getConditions() ) { <END> if ( column instanceof BRLConditionColumn ) { new BRLConditionsBuilder( index, model, rule, row, utils ).buildConditions( (( BRLConditionColumn ) column).getChildColumns() ); } } for ( final ActionCol52 actionCol52 : model.getActionCols() ) { new ActionBuilder( index, model, rule, row, utils, actionCol52 ).build(); } }</code><technical_language>possibly wrap iterator getPatterns() getConditions() a single loop instanceof Pattern52 instanceof BRLConditionColumn loop. getConditions() iterator</technical_language>

Target:
private void resolvePatterns() { for ( final CompositeColumn<? extends BaseColumn> column : model.getConditions() ) { if ( column instanceof Pattern52 ) { final Pattern pattern = resolvePattern( rule, ( Pattern52 ) column ); new FieldConditionsBuilder( index, model, rule, row, utils, pattern ).buildConditions( (( Pattern52 ) column).getChildColumns() ); } else if ( column instanceof BRLConditionColumn ) { new BRLConditionsBuilder( index, model, rule, row, utils ).buildConditions( (( BRLConditionColumn ) column).getChildColumns() ); } } for ( final ActionCol52 actionCol52 : model.getActionCols() ) { new ActionBuilder( index, model, rule, row, utils, actionCol52 ).build(); } }
Source:
<code>public void write(OutputStream out) { try { IOUtils.copy(results.getInputStream(), out); } catch (IOException e) { <START> log.warn(e.getMessage()); <END> throw new WebApplicationException(Response.status(Status.SERVICE_UNAVAILABLE) .entity("Service Unavailable, IO Exception with Search Engine").build()); } finally { results.disconnect(); } }</code><technical_language>exception logged completely</technical_language>

Target:
public void write(OutputStream out) { try { IOUtils.copy(results.getInputStream(), out); } catch (IOException e) { log.warn(e.getMessage(), e); throw new WebApplicationException(Response.status(Status.SERVICE_UNAVAILABLE) .entity("Service Unavailable, IO Exception with Search Engine").build()); } finally { results.disconnect(); } }
Source:
<code>public void adsTrackingOptOutFandom() { networkTrafficInterceptor.startIntercepting(); Boolean noKikimoraRequestFound = false; Boolean noKruxRequestFound = false; String url = TestAdsTrackingOptOutOasis.appendTrackingOptOutParameters(urlBuilder.getFandomUrl()); AdsFandomObject adsFandomObject = new AdsFandomObject(driver, url); try { adsFandomObject.wait.forSuccessfulResponseByUrlPattern(networkTrafficInterceptor, TestAdsTrackingOptOutOasis.KIKIMORA_PATTERN); } catch (TimeoutException exception) { noKikimoraRequestFound = true; } try { adsFandomObject.wait.forSuccessfulResponseByUrlPattern(networkTrafficInterceptor, TestAdsTrackingOptOutOasis.KRUX_PATTERN); <START> } catch (TimeoutException exception) { <END> noKruxRequestFound = true; } assertTrue(noKikimoraRequestFound); assertTrue(noKruxRequestFound); }</code><technical_language>![MAJOR](<LINK_0> 'Severity: MAJOR') log rethrow this exception. [![rule](<LINK_1>](http://sonar-s4/coding_rules#rule_key=squid%3AS1166)</technical_language>

Target:
public void adsTrackingOptOutFandom() { networkTrafficInterceptor.startIntercepting(); Boolean noKikimoraRequestFound = false; Boolean noKruxRequestFound = false; String url = TestAdsTrackingOptOutOasis.appendTrackingOptOutParameters(urlBuilder.getFandomUrl()); AdsFandomObject adsFandomObject = new AdsFandomObject(driver, url); try { adsFandomObject.wait.forSuccessfulResponseByUrlPattern(networkTrafficInterceptor, TestAdsTrackingOptOutOasis.KIKIMORA_PATTERN); } catch (TimeoutException exception) { noKikimoraRequestFound = true; } try { adsFandomObject.wait.forSuccessfulResponseByUrlPattern(networkTrafficInterceptor, TestAdsTrackingOptOutOasis.KRUX_PATTERN); } catch (TimeoutException exception) { noKruxRequestFound = true; } Assertion.assertTrue( noKikimoraRequestFound, "Kikimora tracking is not disabled, request to Data Warehouse was found" ); Assertion.assertTrue( noKruxRequestFound, "Krux tracking is not disabled, request to Krux services was found" ); }
Source:
<code>public void streamStoreTablesSupportAdditionalCleanupTasks() { Schema schema = new Schema("Table", TEST_PACKAGE, Namespace.EMPTY_NAMESPACE); String shortName = "l"; <START> String longName = "llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch"; <END> schema.addStreamStoreDefinition( new StreamStoreDefinitionBuilder(shortName, longName, ValueType.VAR_SIGNED_LONG) .hashRowComponents() .build()); schema.addCleanupTask(StreamTableType.HASH.getTableName(shortName), () -> (cells, tx) -> false); schema.addCleanupTask(StreamTableType.INDEX.getTableName(shortName), () -> (cells, tx) -> false); assertCleanupMetadataInSchemaSatisfies( schema, StreamTableType.VALUE.getTableName(shortName), NULL_CLEANUP_METADATA_ASSERTION); assertCleanupMetadataInSchemaSatisfies( schema, StreamTableType.HASH.getTableName(shortName), ARBITRARY_CLEANUP_METADATA_ASSERTION); assertCleanupMetadataInSchemaSatisfies( schema, StreamTableType.METADATA.getTableName(shortName), getStreamStoreMetadataAssertion(2, ValueType.VAR_SIGNED_LONG)); assertCleanupMetadataInSchemaSatisfies( schema, StreamTableType.INDEX.getTableName(shortName), ARBITRARY_CLEANUP_METADATA_ASSERTION); }</code><technical_language>showing weather forecast guy</technical_language>

Target:
public void streamStoreTablesSupportAdditionalCleanupTasks() { Schema schema = new Schema("Table", TEST_PACKAGE, Namespace.EMPTY_NAMESPACE); String shortName = "l"; String longName = "Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch"; schema.addStreamStoreDefinition( new StreamStoreDefinitionBuilder(shortName, longName, ValueType.VAR_SIGNED_LONG) .hashRowComponents() .build()); schema.addCleanupTask(StreamTableType.HASH.getTableName(shortName), () -> (cells, tx) -> false); schema.addCleanupTask(StreamTableType.INDEX.getTableName(shortName), () -> (cells, tx) -> false); assertCleanupMetadataInSchemaSatisfies( schema, StreamTableType.VALUE.getTableName(shortName), NULL_CLEANUP_METADATA_ASSERTION); assertCleanupMetadataInSchemaSatisfies( schema, StreamTableType.HASH.getTableName(shortName), ARBITRARY_CLEANUP_METADATA_ASSERTION); assertCleanupMetadataInSchemaSatisfies( schema, StreamTableType.METADATA.getTableName(shortName), getStreamStoreMetadataAssertion(2, ValueType.VAR_SIGNED_LONG)); assertCleanupMetadataInSchemaSatisfies( schema, StreamTableType.INDEX.getTableName(shortName), ARBITRARY_CLEANUP_METADATA_ASSERTION); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_expense_item_add); dialogOptions = getResources().getStringArray(R.array.receipt_dialog_array); nameField = (EditText)findViewById(R.id.et_name); descriptionField = (EditText)findViewById(R.id.et_description); amountField = (EditText)findViewById(R.id.et_amount); dateField = (DateEditText)findViewById(R.id.et_date); categorySpinner = (Spinner)findViewById(R.id.sp_category); SpinnerUtils.configureSpinner(this, categorySpinner, R.array.categories_array); currencySpinner = (Spinner)findViewById(R.id.sp_currency); SpinnerUtils.configureSpinner(this, currencySpinner, R.array.currency_array); receiptButton = (ImageButton) findViewById(R.id.btn_receipt); receiptButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { <START> startDialog(); <END> } }); }</code><technical_language>nice if startDialog() renamed more descriptive. startImagePickerDialog() maybe</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_expense_item_add); dialogOptions = getResources().getStringArray(R.array.receipt_dialog_array); ActionBarUtils.showCancelDoneActionBar( this, new View.OnClickListener() { @Override public void onClick(View v) { onCancel(); } }, new View.OnClickListener() { @Override public void onClick(View v) { onDone(); } } ); nameField = (EditText)findViewById(R.id.et_name); descriptionField = (EditText)findViewById(R.id.et_description); amountField = (EditText)findViewById(R.id.et_amount); dateField = (DateEditText)findViewById(R.id.et_date); categorySpinner = (Spinner)findViewById(R.id.sp_category); SpinnerUtils.configureSpinner(this, categorySpinner, R.array.categories_array); currencySpinner = (Spinner)findViewById(R.id.sp_currency); SpinnerUtils.configureSpinner(this, currencySpinner, R.array.currency_array); receiptButton = (ImageButton) findViewById(R.id.btn_receipt); receiptButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startImagePickerDialog(); } }); }
Source:
<code>private InstanceConfig createInstanceConfig(int nodeNum) { String ipPrefix = "127.0." + subnet + "."; String seedIp = ipPrefix + "1"; String ipAddress = ipPrefix + nodeNum; long token = tokenSupplier.token(nodeNum); <START> NetworkTopology topology = NetworkTopology.build(ipPrefix, BROADCAST_PORT, nodeIdTopology); <END> InstanceConfig config = InstanceConfig.generate(nodeNum, ipAddress, topology, root, String.valueOf(token), seedIp); if (configUpdater != null) configUpdater.accept(config); return config; }</code><technical_language>Do leave createInstanceConfig in Builder IntFunction a factory method instead? wondering grow, really, in mind this is code inevitably duplicate 4 times</technical_language>

Target:
private InstanceConfig createInstanceConfig(int nodeNum) { String ipPrefix = "127.0." + subnet + "."; String seedIp = ipPrefix + "1"; String ipAddress = ipPrefix + nodeNum; long token = tokenSupplier.token(nodeNum); NetworkTopology topology = NetworkTopology.build(ipPrefix, broadcastPort, nodeIdTopology); InstanceConfig config = InstanceConfig.generate(nodeNum, ipAddress, topology, root, String.valueOf(token), seedIp); if (configUpdater != null) configUpdater.accept(config); return config; }
Source:
<code>private Topology createConnectedStateStoreTopology(final String storeName) { <START> final StoreBuilder<KeyValueStore<String, String>> storeBuilder = Stores.keyValueStoreBuilder(Stores.inMemoryKeyValueStore(storeName), Serdes.String(), Serdes.String()); <END> return topology .addSource("source", STRING_DESERIALIZER, STRING_DESERIALIZER, INPUT_TOPIC_1) .addProcessor("processor", defineWithStores(new StatefulProcessor(storeName), Collections.singleton(storeBuilder)), "source") .addSink("counts", OUTPUT_TOPIC_1, "processor"); }</code><technical_language>nit: line long</technical_language>

Target:
private Topology createConnectedStateStoreTopology(final String storeName) { final StoreBuilder<KeyValueStore<String, String>> storeBuilder = Stores.keyValueStoreBuilder(Stores.inMemoryKeyValueStore(storeName), Serdes.String(), Serdes.String()); return topology .addSource("source", STRING_DESERIALIZER, STRING_DESERIALIZER, INPUT_TOPIC_1) .addProcessor("processor", defineWithStores(() -> new StatefulProcessor(storeName), Collections.singleton(storeBuilder)), "source") .addSink("counts", OUTPUT_TOPIC_1, "processor"); }
Source:
<code>public List<Component> getPipelines() { try { LOG.fine("Getting pipelines!"); List<Component> components = new ArrayList<Component>(); if (componentSpecs != null) { for (ComponentSpec componentSpec : componentSpecs) { AbstractProject firstJob = ProjectUtil.getProject(componentSpec.getFirstJob(), getOwnerItemGroup()); AbstractProject lastJob = ProjectUtil.getProject(componentSpec.getLastJob(), getOwnerItemGroup()); if (firstJob != null) { components.add(getComponent(componentSpec.getName(), firstJob, lastJob, showAggregatedPipeline, (componentSpecs.indexOf(componentSpec) + 1))); } else { throw new PipelineException("Could not find project: " + componentSpec.getFirstJob()); } } } if (regexpFirstJobs != null) { for (RegExpSpec regexp : regexpFirstJobs) { Map<String, AbstractProject> matches = ProjectUtil.getProjects(regexp.getRegexp()); int i=0; for (Map.Entry<String, AbstractProject> entry : matches.entrySet()) { <START> components.add(getComponent(entry.getKey(), entry.getValue(), null, showAggregatedPipeline, (i + 1))); <END> i++; } } } if (getSorting() != null && !getSorting().equals(NONE_SORTER)) { ComponentComparatorDescriptor comparatorDescriptor = ComponentComparator.all().find(sorting); if (comparatorDescriptor != null) { Collections.sort(components, comparatorDescriptor.createInstance()); } } LOG.fine("Returning: " + components); error = null; return components; } catch (PipelineException e) { error = e.getMessage(); return new ArrayList<Component>(); } }</code><technical_language>initialize i = 1</technical_language>

Target:
public List<Component> getPipelines() { try { LOG.fine("Getting pipelines!"); List<Component> components = new ArrayList<Component>(); if (componentSpecs != null) { for (ComponentSpec componentSpec : componentSpecs) { AbstractProject firstJob = ProjectUtil.getProject(componentSpec.getFirstJob(), getOwnerItemGroup()); AbstractProject lastJob = ProjectUtil.getProject(componentSpec.getLastJob(), getOwnerItemGroup()); if (firstJob != null) { components.add(getComponent(componentSpec.getName(), firstJob, lastJob, showAggregatedPipeline, (componentSpecs.indexOf(componentSpec) + 1))); } else { throw new PipelineException("Could not find project: " + componentSpec.getFirstJob()); } } } if (regexpFirstJobs != null) { for (RegExpSpec regexp : regexpFirstJobs) { Map<String, AbstractProject> matches = ProjectUtil.getProjects(regexp.getRegexp()); int index = 1; for (Map.Entry<String, AbstractProject> entry : matches.entrySet()) { components.add(getComponent(entry.getKey(), entry.getValue(), null, showAggregatedPipeline, index)); index++; } } } if (getSorting() != null && !getSorting().equals(NONE_SORTER)) { ComponentComparatorDescriptor comparatorDescriptor = ComponentComparator.all().find(sorting); if (comparatorDescriptor != null) { Collections.sort(components, comparatorDescriptor.createInstance()); } } LOG.fine("Returning: " + components); error = null; return components; } catch (PipelineException e) { error = e.getMessage(); return new ArrayList<Component>(); } }
Source:
<code>public static Expression avg(@NonNull Expression expression) { if(expression == null) { throw new IllegalArgumentException("expression is null"); <START> } <END> return new Expression.FunctionExpression("AVG()", Arrays.asList(expression)); }</code><technical_language>Summary: 1. Removed @throws IllegalArgumentException alias is null. is required declare throwing a runtime exception. declared this in other places e.g. Database class well. 2. Remove extra empty line if(<variable> == null) {. 3. Add a space if (. if (<variable> == null). 4. Add . (full stop) end of "... is null" -> ... is null. 5. Do for other methods</technical_language>

Target:
public static Expression avg(@NonNull Expression expression) { if (expression == null) { throw new IllegalArgumentException("expression is null."); } return new Expression.FunctionExpression("AVG()", Arrays.asList(expression)); }
Source:
<code><START> public Boolean getLiveMergeSupport() { <END> return this.mVdsDynamic.getLiveMergeSupport(); }</code><technical_language>VdsDynamic a primitive boolean - here</technical_language>

Target:
public boolean getLiveMergeSupport() { return this.mVdsDynamic.getLiveMergeSupport(); }
Source:
<code>public void testLongNotification() throws IOException { Notification notification = longNotification(); try { <START> curationApiAdmin.createNotification(notification); <END> } catch (ApiException e) { assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), e.getCode()); } Notification updateNotification = curationApiAdmin.createNotification(testNotification()); long id = updateNotification.getId(); notification.setId(id); try { curationApiAdmin.updateNotification(id, notification); } catch (ApiException e) { assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), e.getCode()); } String message = testingPostgres.runSelectStatement(String.format("select message from notification where id = '%s'", id), String.class); assertEquals(updateNotification.getMessage(), message); }</code><technical_language>need a fail this line; if test throw error pass</technical_language>

Target:
public void testLongNotification() throws IOException { Notification notification = longNotification(1024); Notification result = curationApiAdmin.createNotification(notification); assertNotNull(result); notification = longNotification(1025); try { curationApiAdmin.createNotification(notification); fail("create should fail since message is too long"); } catch (ApiException e) { assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), e.getCode()); } Notification updateNotification = curationApiAdmin.createNotification(testNotification()); long id = updateNotification.getId(); notification.setId(id); try { curationApiAdmin.updateNotification(id, notification); fail("update should fail since update notification is too long"); } catch (ApiException e) { assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), e.getCode()); } String message = testingPostgres.runSelectStatement(String.format("select message from notification where id = '%s'", id), String.class); assertEquals(updateNotification.getMessage(), message); }
Source:
<code>public void initialize(Context context, MediationAdRequest adRequest, String unused, MediationRewardedVideoAdListener listener, Bundle serverParameters, Bundle networkExtras) { <START> String[] placements = networkExtras.getStringArray(VungleExtrasBuilder.EXTRA_ALL_PLACEMENTS); <END> if (placements == null || placements.length == 0) { Log.e(TAG, "Placements should be specified!"); if (listener != null) listener.onInitializationFailed(VungleAdapter.this, 0); return; } mMediationRewardedVideoAdListener = listener; String appId = serverParameters.getString("appid"); mVunglePub = VungleManager.getInstance(appId, placements, context); mVunglePub.addListener(ID, vungleListener); if (mVunglePub.isInitialized()) { mInitialized = true; mMediationRewardedVideoAdListener.onInitializationSucceeded(VungleAdapter.this); } else { vungleListener.setWaitingInit(true); mVunglePub.init(); } }</code><technical_language>Please note networkExtras null checked accessing. code snippet do null check: if (networkExtras == null) { Log.e(TAG, "Network extras placements specified."); if (listener != null) { listener.onInitializationFailed(VungleAdapter.this, AdRequest.ERROR_CODE_INVALID_REQUEST); } return; }</technical_language>

Target:
public void initialize(Context context, MediationAdRequest adRequest, String unused, MediationRewardedVideoAdListener listener, Bundle serverParameters, Bundle networkExtras) { String[] placements; if (networkExtras != null) { placements = networkExtras.getStringArray(VungleExtrasBuilder.EXTRA_ALL_PLACEMENTS); if (placements == null || placements.length == 0) { Log.e(TAG, "Placements should be specified!"); if (listener != null) listener.onInitializationFailed(VungleAdapter.this, AdRequest.ERROR_CODE_INVALID_REQUEST); return; } } else { Log.e(TAG, "networkExtras is null."); if (listener != null) listener.onInitializationFailed(VungleAdapter.this, AdRequest.ERROR_CODE_INVALID_REQUEST); return; } mMediationRewardedVideoAdListener = listener; String appId = serverParameters.getString("appid"); mVungleManager = VungleManager.getInstance(appId, placements); mVungleManager.addListener(ID, vungleListener); if (mVungleManager.isInitialized()) { mInitialized = true; mMediationRewardedVideoAdListener.onInitializationSucceeded(VungleAdapter.this); } else { vungleListener.setWaitingInit(true); mVungleManager.init(context); } }
Source:
<code>public ResponseEntity<String> updateCategory(@PathVariable("id") Long id, @RequestBody Category category){ Category oldCategory = categoryDao.findOne(id); if(oldCategory == null){ return new ResponseEntity<String>("Category not found", HttpStatus.NOT_FOUND); } category.setId(id); <START> category.setUser(oldCategory.getUser()); <END> categoryDao.save(category); return new ResponseEntity<String>("Category updated", HttpStatus.NO_CONTENT); }</code><technical_language>A validation compare oldCategory.getUser() current authenticated user. Maybe...what do think</technical_language>

Target:
public ResponseEntity<String> updateCategory(@PathVariable("id") Long id, @RequestBody Category category){ Category oldCategory = categoryDao.findOne(id); if(oldCategory == null){ return new ResponseEntity<String>("Category not found", HttpStatus.NOT_FOUND); } category.setId(id); String currentUsername = ControllerUtil.getCurrentLoggedUsername(); category.setUser(appUserDao.findByUsername(currentUsername)); categoryDao.save(category); return new ResponseEntity<String>("Category updated", HttpStatus.NO_CONTENT); }
Source:
<code>public void setUp() { when(vmDao.get(vm.getId())).thenReturn(vm); Cluster cluster = new Cluster(); cluster.setCpuName("Intel Conroe Family"); cluster.setArchitecture(ArchitectureType.x86_64); cluster.setId(vm.getClusterId()); cluster.setStoragePoolId(vm.getStoragePoolId()); cluster.setCompatibilityVersion(Version.getLast()); when(clusterDao.get(vm.getClusterId())).thenReturn(cluster); mockOsRepository(); doNothing().when(cmd).separateCustomProperties(any(VmStatic.class)); doReturn(getDisksList(vm.getStoragePoolId())).when(cmd).getVmDisksFromDB(); doReturn(vmDeviceUtils).when(cmd).getVmDeviceUtils(); <START> mcr.mockConfigValue(ConfigValues.VmPriorityMaxValue, 100); <END> cmd.init(); }</code><technical_language>If this is done for test case, point of instead of in MockConfigRule's constructor in line 67</technical_language>

Target:
public void setUp() { when(vmDao.get(vm.getId())).thenReturn(vm); Cluster cluster = new Cluster(); cluster.setCpuName("Intel Conroe Family"); cluster.setArchitecture(ArchitectureType.x86_64); cluster.setId(vm.getClusterId()); cluster.setStoragePoolId(vm.getStoragePoolId()); cluster.setCompatibilityVersion(Version.getLast()); when(clusterDao.get(vm.getClusterId())).thenReturn(cluster); mockOsRepository(); doNothing().when(cmd).separateCustomProperties(any(VmStatic.class)); doReturn(getDisksList(vm.getStoragePoolId())).when(cmd).getVmDisksFromDB(); doReturn(vmDeviceUtils).when(cmd).getVmDeviceUtils(); cmd.init(); }
Source:
<code>public void removeEventHandler(EventHandler eventHandler) { if (eventHandler != null && eventHandlers != null && eventHandlers.contains(eventHandler)) { List<String> tempSubsList = new ArrayList<String>(); int index = -1; EventHandler intEventHandler = null; boolean subscribedEventsChanged = false; for (int i = 0; i < eventHandlers.size(); i++) { intEventHandler = eventHandlers.get(i); <START> if (intEventHandler.getUID().equals(eventHandler.getUID())) { <END> index = i; } else { tempSubsList.addAll(intEventHandler.getSupportetEvents()); } } if (index != -1) { intEventHandler = eventHandlers.remove(index); for (String eventName : intEventHandler.getSupportetEvents()) { if (!tempSubsList.contains(eventName)) { subscribedEvents.remove(eventName); subscribedEventsChanged = true; } } } if (subscribedEventsChanged) { restartListener(); } } }</code><technical_language>storing handlers in a Set? do walk list remove it</technical_language>

Target:
public void removeEventHandler(EventHandler eventHandler) { if (eventHandler != null && eventHandlers.contains(eventHandler)) { List<String> tempSubsList = new ArrayList<String>(); int index = -1; EventHandler intEventHandler = null; boolean subscribedEventsChanged = false; for (int i = 0; i < eventHandlers.size(); i++) { intEventHandler = eventHandlers.get(i); if (intEventHandler.getUID().equals(eventHandler.getUID())) { index = i; } else { tempSubsList.addAll(intEventHandler.getSupportedEvents()); } } if (index != -1) { intEventHandler = eventHandlers.remove(index); for (String eventName : intEventHandler.getSupportedEvents()) { if (!tempSubsList.contains(eventName)) { subscribedEvents.remove(eventName); subscribedEventsChanged = true; } } } if (subscribedEventsChanged) { restartListener(); } } }
Source:
<code>public ExponentialBackoffRetry(long baseSleepTimeMs) { if (baseSleepTimeMs > 10000){ <START> this.baseSleepTimeMs = 10000; <END> } else { this.baseSleepTimeMs = baseSleepTimeMs; } }</code><technical_language>Add warning log line for</technical_language>

Target:
public ExponentialBackoffRetry(long baseSleepTimeMs) { this.baseSleepTimeMs = Math.min(10000, baseSleepTimeMs); }
Source:
<code>public InputRawSupplierColumnSelectorStrategy makeColumnSelectorStrategy( ColumnCapabilities capabilities, ColumnValueSelector selector ) { ValueType type = capabilities.getType(); switch(type) { case STRING: return new StringInputRawSupplierColumnSelectorStrategy(); case LONG: return new LongInputRawSupplierColumnSelectorStrategy(); case FLOAT: return new FloatInputRawSupplierColumnSelectorStrategy(); case DOUBLE: <START> return new DoubleInputRawSupplierColumnSelectorStrategy(); <END> default: throw new IAE("Cannot create query type helper from invalid type [%s]", type); } }</code><technical_language>selector -> selector::get</technical_language>

Target:
public InputRawSupplierColumnSelectorStrategy makeColumnSelectorStrategy( ColumnCapabilities capabilities, ColumnValueSelector selector ) { ValueType type = capabilities.getType(); switch(type) { case STRING: return new StringInputRawSupplierColumnSelectorStrategy(); case LONG: return (InputRawSupplierColumnSelectorStrategy<LongColumnSelector>) columnSelector -> columnSelector::get; case FLOAT: return (InputRawSupplierColumnSelectorStrategy<FloatColumnSelector>) columnSelector -> columnSelector::get; case DOUBLE: return (InputRawSupplierColumnSelectorStrategy<DoubleColumnSelector>) columnSelector -> columnSelector::get; default: throw new IAE("Cannot create query type helper from invalid type [%s]", type); } }