auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void downloadPart(DataChannel channel, Part part, String objectId, File outputDir) throws IOException { retry.execute(new RetryCallback<Void, IOException>() { @Override public Void doWithRetry(RetryContext ctx) throws IOException { log.debug("Download Part URL: {}", part.getUrl()); final RequestCallback requestCallback = new RequestCallback() { @Override public void doWithRequest(final ClientHttpRequest request) throws IOException { request.getHeaders().set(HttpHeaders.RANGE, Parts.getHttpRangeValue(part)); } }; final ResponseExtractor<String> headersExtractor = new ResponseExtractor<String>() { @Override public String extractData(ClientHttpResponse response) throws IOException { try (HashingInputStream his = new HashingInputStream(Hashing.md5(), response.getBody())) { channel.readFrom(his); return his.hash().toString(); } } }; try { log.debug("performing GET {}", part.getUrl()); val md5 = dataTemplate.execute(new URI(part.getUrl()), HttpMethod.GET, requestCallback, headersExtractor); part.setMd5(md5); if (part.hasFailedChecksum()) { val msg = String.format("Checksum failed for Part# %d: %s", part.getPartNumber(), part.getMd5()); throw new Exception(msg); } downloadStateStore.commit(outputDir, objectId, part); log.debug("committed part# to download state store", objectId, part.getPartNumber()); } catch (NotResumableException | NotRetryableException e) { log.error("Cannot proceed. Failed to receive part for part# : {}", part.getPartNumber(), e.getMessage()); throw e; } catch (Throwable e) { log.warn("Failed to receive part for part number: {}. Retrying. {}", part.getPartNumber(), e.getMessage()); channel.reset(); throw new RetryableException(e); } return null; } }); }

Target:
public void downloadPart(DataChannel channel, Part part, String objectId, File outputDir) throws IOException { retry.execute(new RetryCallback<Void, IOException>() { @Override public Void doWithRetry(RetryContext ctx) throws IOException { log.debug("Download Part URL: {}", part.getUrl()); try { log.debug("performing GET {}", part.getUrl()); String md5 = dataTemplate.execute(new URI(part.getUrl()), HttpMethod.GET, request -> request.getHeaders().set(HttpHeaders.RANGE, Parts.getHttpRangeValue(part)), response -> { try (HashingInputStream his = new HashingInputStream(Hashing.md5(), response.getBody())) { channel.readFrom(his); return his.hash().toString(); } } ); part.setMd5(md5); checkState(!part.hasFailedChecksum(), "Checksum failed for Part# %d: %s", part.getPartNumber(), part.getMd5()); downloadStateStore.commit(outputDir, objectId, part); log.debug("committed part# to download state store", objectId, part.getPartNumber()); } catch (NotResumableException | NotRetryableException e) { log.error("Cannot proceed. Failed to receive part for part# : {}", part.getPartNumber(), e.getMessage()); throw e; } catch (Throwable e) { log.warn("Failed to receive part for part number: {}. Retrying. {}", part.getPartNumber(), e.getMessage()); channel.reset(); throw new RetryableException(e); } return null; } }); }
Source:
public void testPrivateKeyInRange() { BigInteger primeP = BigInteger.valueOf(23); List<BigInteger> privateKeys = new ArrayList<>(); for (int i = 0; i < 10; i++) privateKeys.add(diffieHellman.privateKey(primeP)); for (BigInteger privateKey : privateKeys) { assertTrue((privateKey.compareTo(BigInteger.ONE) >= 0) && (privateKey.compareTo(primeP) < 0)); } }

Target:
public void testPrivateKeyInRange() { BigInteger prime = BigInteger.valueOf(23); List<BigInteger> privateKeys = new ArrayList<>(); for (int i = 0; i < 10; i++) { privateKeys.add(diffieHellman.privateKey(prime)); } for (BigInteger privateKey : privateKeys) { assertTrue(privateKey.compareTo(BigInteger.ONE) >= 0); assertTrue(privateKey.compareTo(prime) < 0); } }
Source:
public void deleteElement(IInteractionElement element) { deleteElement(element, getActiveContext()); notifyElementsDeleted(getActiveContext(), Arrays.asList(new IInteractionElement[] { element }), false); }

Target:
public void deleteElement(IInteractionElement element) { deleteElements(Arrays.asList(new IInteractionElement[] { element }), getActiveContext(), false, true); }
Source:
private String echo(final String uid, final String summary) { final String xembly = new XemblyLine( new Directives() .xpath(this.xpath(uid)) .add("summary") .set(Terminal.escape(summary)) ).toString(); return String.format( "echo -e '%s'", xembly.replace("'", "\\x27").replace( XemblyLine.MARK, IncrementalBash.ESCAPED_MARK ) ); }

Target:
private String echo(final String uid, final String summary) { final String xembly = new XemblyLine( new Directives() .xpath(this.xpath(uid)) .add("summary") .set(summary.replaceAll("([_*`\\\\])", "\\\\$1")) ).toString(); return String.format( "echo -e '%s'", xembly.replace("'", "\\x27").replace( XemblyLine.MARK, IncrementalBash.ESCAPED_MARK ) ); }
Source:
private List<Pair<Integer, String>> getContacts(@NonNull final String searchName, final Uri uri, @NonNull final String idColumnName, @NonNull final String selectionColumnName, final boolean like) { final String[] projection = { idColumnName, selectionColumnName, ContactsContract.Contacts.DISPLAY_NAME }; final String selection = selectionColumnName + (like ? " LIKE" : " =") + " ? COLLATE NOCASE"; final String[] selectionArgs = { like ? "%" + searchName + "%" : searchName }; final List<Pair<Integer, String>> result = new ArrayList<>(); try (Cursor cursor = getContentResolver().query(uri, projection, selection, selectionArgs, null)) { while (cursor != null && cursor.moveToNext()) { final int foundId = cursor.getInt(0); final String foundName = cursor.getString(1); final String displayName = cursor.getString(2); result.add(new Pair<>(foundId, StringUtils.isNotEmpty(displayName) && !StringUtils.equalsIgnoreCase(foundName, displayName) ? foundName + " (" + displayName + ")" : foundName)); } } catch (final Exception e) { Log.e(LOG_TAG, "ContactsActivity.getContactId", e); } return result; }

Target:
private List<Pair<Integer, String>> getContacts(@NonNull final String searchName, final Uri uri, @NonNull final String idColumnName, @NonNull final String selectionColumnName, final boolean like) { final String[] projection = { idColumnName, selectionColumnName, ContactsContract.Contacts.DISPLAY_NAME }; final String selection = selectionColumnName + (like ? " LIKE" : " =") + " ? COLLATE NOCASE"; final String[] selectionArgs = { like ? "%" + searchName + "%" : searchName }; Cursor cursor = null; final List<Pair<Integer, String>> result = new ArrayList<>(); try { cursor = getContentResolver().query(uri, projection, selection, selectionArgs, null); while (cursor != null && cursor.moveToNext()) { final int foundId = cursor.getInt(0); final String foundName = cursor.getString(1); final String displayName = cursor.getString(2); result.add(new Pair<>(foundId, StringUtils.isNotEmpty(displayName) && !StringUtils.equalsIgnoreCase(foundName, displayName) ? foundName + " (" + displayName + ")" : foundName)); } } catch (final Exception e) { Log.e(LOG_TAG, "ContactsActivity.getContactId", e); } finally { if (cursor != null) { cursor.close(); } } return result; }
Source:
public Map<String, String> getSegmentsMetadata(String tableNameWithType, int timeoutMs) throws InvalidConfigException, IOException { final Map<String, List<String>> serversToSegmentsMap = pinotHelixResourceManager.getServerToSegmentsMap(tableNameWithType); BiMap<String, String> endpoints = pinotHelixResourceManager.getDataInstanceAdminEndpoints(serversToSegmentsMap.keySet()); ServerSegmentMetadataReader serverSegmentMetadataReader = new ServerSegmentMetadataReader(executor, connectionManager); List<String> segmentsMetadata = serverSegmentMetadataReader.getSegmentMetadataFromServer(tableNameWithType, serversToSegmentsMap, endpoints, timeoutMs); Map<String, String> response = new HashMap<>(); for (String segmentMetadata : segmentsMetadata) { JsonNode responseJson = JsonUtils.stringToJsonNode(segmentMetadata); ObjectNode objectNode = responseJson.deepCopy(); response.put(objectNode.get("segmentName").asText(), segmentMetadata); } return response; }

Target:
public JsonNode getSegmentsMetadata(String tableNameWithType, int timeoutMs) throws InvalidConfigException, IOException { final Map<String, List<String>> serverToSegments = _pinotHelixResourceManager.getServerToSegmentsMap(tableNameWithType); BiMap<String, String> endpoints = _pinotHelixResourceManager.getDataInstanceAdminEndpoints(serverToSegments.keySet()); ServerSegmentMetadataReader serverSegmentMetadataReader = new ServerSegmentMetadataReader(_executor, _connectionManager); List<String> segmentsMetadata = serverSegmentMetadataReader.getSegmentMetadataFromServer(tableNameWithType, serverToSegments, endpoints, timeoutMs); Map<String, JsonNode> response = new HashMap<>(); for (String segmentMetadata : segmentsMetadata) { JsonNode responseJson = JsonUtils.stringToJsonNode(segmentMetadata); response.put(responseJson.get("segmentName").asText(), responseJson); } return JsonUtils.objectToJsonNode(response); }
Source:
protected String getQuery(VitroRequest vreq) { Locale locale = SelectedLocale.getCurrentLocale(vreq); ParameterizedSparqlString queryPstr = new ParameterizedSparqlString( WEBPAGE_QUERY); queryPstr.setLiteral("locale", locale.toString().replace("_", "-")); queryPstr.setLiteral("language", locale.getLanguage().toString()); return queryPstr.toString(); }

Target:
protected String getQuery(VitroRequest vreq) { Locale locale = SelectedLocale.getCurrentLocale(vreq); ParameterizedSparqlString queryPstr = new ParameterizedSparqlString( WEBPAGE_QUERY); queryPstr.setLiteral("locale", locale.replace("_", "-")); queryPstr.setLiteral("language", locale.getLanguage()); return queryPstr.toString(); }
Source:
remoteApiDomain.contains(":") ? Integer.parseInt(remoteApiDomain.split(":")[1]) : 443; TEAMMATES_VERSION = extractVersionNumber(FileHelper.readFile("src/main/webapp/WEB-INF/appengine-web.xml")); TEST_ADMIN_ACCOUNT = prop.getProperty("test.admin.account"); TEST_ADMIN_PASSWORD = prop.getProperty("test.admin.password"); TEST_INSTRUCTOR_ACCOUNT = prop.getProperty("test.instructor.account"); TEST_INSTRUCTOR_PASSWORD = prop.getProperty("test.instructor.password"); TEST_STUDENT1_ACCOUNT = prop.getProperty("test.student1.account"); TEST_STUDENT1_PASSWORD = prop.getProperty("test.student1.password"); TEST_STUDENT2_ACCOUNT = prop.getProperty("test.student2.account"); TEST_STUDENT2_PASSWORD = prop.getProperty("test.student2.password"); TEST_UNREG_ACCOUNT = prop.getProperty("test.unreg.account"); TEST_UNREG_PASSWORD = prop.getProperty("test.unreg.password"); BACKDOOR_KEY = prop.getProperty("test.backdoor.key"); BROWSER = prop.getProperty("test.selenium.browser"); FIREFOX_PATH = prop.getProperty("test.firefox.path"); IS_HEADLESS_FIREFOX = Boolean.parseBoolean(prop.getProperty("test.is_headless_firefox")); XVFB_PORT = prop.getProperty("test.xvfb_port"); TEST_TIMEOUT = Integer.parseInt(prop.getProperty("test.timeout")); } catch (IOException | NumberFormatException e) { throw new RuntimeException(e); }

Target:
remoteApiDomain.contains(":") ? Integer.parseInt(remoteApiDomain.split(":")[1]) : 443; TEAMMATES_VERSION = extractVersionNumber(FileHelper.readFile("src/main/webapp/WEB-INF/appengine-web.xml")); TEST_ADMIN_ACCOUNT = prop.getProperty("test.admin.account"); TEST_ADMIN_PASSWORD = prop.getProperty("test.admin.password"); TEST_INSTRUCTOR_ACCOUNT = prop.getProperty("test.instructor.account"); TEST_INSTRUCTOR_PASSWORD = prop.getProperty("test.instructor.password"); TEST_STUDENT1_ACCOUNT = prop.getProperty("test.student1.account"); TEST_STUDENT1_PASSWORD = prop.getProperty("test.student1.password"); TEST_STUDENT2_ACCOUNT = prop.getProperty("test.student2.account"); TEST_STUDENT2_PASSWORD = prop.getProperty("test.student2.password"); TEST_UNREG_ACCOUNT = prop.getProperty("test.unreg.account"); TEST_UNREG_PASSWORD = prop.getProperty("test.unreg.password"); BACKDOOR_KEY = prop.getProperty("test.backdoor.key"); BROWSER = prop.getProperty("test.selenium.browser"); FIREFOX_PATH = prop.getProperty("test.firefox.path"); TEST_TIMEOUT = Integer.parseInt(prop.getProperty("test.timeout")); } catch (IOException | NumberFormatException e) { throw new RuntimeException(e); }
Source:
public NettyAsyncHttpClient build() { HttpClient nettyHttpClient = HttpClient.create() .port(port) .wiretap(enableWiretap) .tcpConfiguration(tcpConfig -> { if (nioEventLoopGroup != null) { tcpConfig = tcpConfig.runOn(nioEventLoopGroup); } if (proxyOptions != null) { ProxyProvider.Proxy nettyProxy; switch (proxyOptions.getType()) { case HTTP: nettyProxy = ProxyProvider.Proxy.HTTP; break; case SOCKS4: nettyProxy = ProxyProvider.Proxy.SOCKS4; break; case SOCKS5: nettyProxy = ProxyProvider.Proxy.SOCKS5; break; default: throw logger.logExceptionAsWarning(new IllegalStateException( String.format("Unknown Proxy type '%s' in use. Not configuring Netty proxy.", proxyOptions.getType()))); } return tcpConfig.proxy(ts -> ts.type(nettyProxy).address(proxyOptions.getAddress())); } return tcpConfig; }); return new NettyAsyncHttpClient(nettyHttpClient); }

Target:
public NettyAsyncHttpClient build() { HttpClient nettyHttpClient = HttpClient.create() .port(port) .wiretap(enableWiretap) .tcpConfiguration(tcpConfig -> { if (nioEventLoopGroup != null) { tcpConfig = tcpConfig.runOn(nioEventLoopGroup); } if (proxyOptions != null) { ProxyProvider.Proxy nettyProxy; switch (proxyOptions.getType()) { case HTTP: nettyProxy = ProxyProvider.Proxy.HTTP; break; case SOCKS4: nettyProxy = ProxyProvider.Proxy.SOCKS4; break; case SOCKS5: nettyProxy = ProxyProvider.Proxy.SOCKS5; break; default: throw logger.logExceptionAsError(new IllegalStateException( String.format("Unknown Proxy type '%s' in use. Not configuring Netty proxy.", proxyOptions.getType()))); } return tcpConfig.proxy(ts -> ts.type(nettyProxy).address(proxyOptions.getAddress())); } return tcpConfig; }); return new NettyAsyncHttpClient(nettyHttpClient); }
Source:
public Client findClient(String clientUUID, Integer profileId) throws Exception { logger.info("HELLOOOOOOOOOOOOOOOOOOOOooooooš", "TIFFANY"); Client client = null; if (clientUUID.compareTo(Constants.PROFILE_CLIENT_DEFAULT_ID) != 0 && !clientUUID.matches("[\\w]{8}-[\\w]{4}-[\\w]{4}-[\\w]{4}-[\\w]{12}")) { Client tmpClient = this.findClientFromFriendlyName(profileId, clientUUID); if (tmpClient == null) { clientUUID = Constants.PROFILE_CLIENT_DEFAULT_ID; } else { return tmpClient; } } PreparedStatement statement = null; ResultSet results = null; try (Connection sqlConnection = sqlService.getConnection()) { String queryString = "SELECT * FROM " + Constants.DB_TABLE_CLIENT + " WHERE " + Constants.CLIENT_CLIENT_UUID + " = ?"; if (profileId != null) { queryString += " AND " + Constants.GENERIC_PROFILE_ID + "=?"; } statement = sqlConnection.prepareStatement(queryString); statement.setString(1, clientUUID); if (profileId != null) { statement.setInt(2, profileId); } results = statement.executeQuery(); if (results.next()) { client = this.getClientFromResultSet(results); } } catch (Exception e) { throw e; } finally { try { if (results != null) { results.close(); } } catch (Exception e) { } try { if (statement != null) { statement.close(); } } catch (Exception e) { } } return client; }

Target:
public Client findClient(String clientUUID, Integer profileId) throws Exception { Client client = null; if (clientUUID.compareTo(Constants.PROFILE_CLIENT_DEFAULT_ID) != 0 && !clientUUID.matches("[\\w]{8}-[\\w]{4}-[\\w]{4}-[\\w]{4}-[\\w]{12}")) { Client tmpClient = this.findClientFromFriendlyName(profileId, clientUUID); if (tmpClient == null) { clientUUID = Constants.PROFILE_CLIENT_DEFAULT_ID; } else { return tmpClient; } } PreparedStatement statement = null; ResultSet results = null; try (Connection sqlConnection = sqlService.getConnection()) { String queryString = "SELECT * FROM " + Constants.DB_TABLE_CLIENT + " WHERE " + Constants.CLIENT_CLIENT_UUID + " = ?"; if (profileId != null) { queryString += " AND " + Constants.GENERIC_PROFILE_ID + "=?"; } statement = sqlConnection.prepareStatement(queryString); statement.setString(1, clientUUID); if (profileId != null) { statement.setInt(2, profileId); } results = statement.executeQuery(); if (results.next()) { client = this.getClientFromResultSet(results); } } catch (Exception e) { throw e; } finally { try { if (results != null) { results.close(); } } catch (Exception e) { } try { if (statement != null) { statement.close(); } } catch (Exception e) { } } return client; }
Source:
void removeAndValidateIntegerLiteralUnderscore() { if ( PTRN_FAULTY_UNDERSCORE_INT.matcher( val ).find() ) { throw new NumberFormatException(); } else { val = val.replace( "_", "" ); } }

Target:
void removeAndValidateIntegerLiteralUnderscore() { if ( PTRN_FAULTY_UNDERSCORE_INT.matcher( val ).find() ) { throw new NumberFormatException("Improperly placed underscores"); } else { val = val.replace( "_", "" ); } }
Source:
public double[] transformToDoubleValuesSV(ProjectionBlock projectionBlock) { if (_results == null) { _results = new double[DocIdSetPlanNode.MAX_DOC_PER_CALL]; } byte[][] firstValues = _firstArgument.transformToBytesValuesSV(projectionBlock); byte[][] secondValues = _secondArgument.transformToBytesValuesSV(projectionBlock); for (int i = 0; i < projectionBlock.getNumDocs(); i++) { Geometry firstGeometry = GeometrySerializer.deserialize(firstValues[i]); Geometry secondGeometry = GeometrySerializer.deserialize(secondValues[i]); if (GeometryUtils.isGeography(firstGeometry) != GeometryUtils.isGeography(secondGeometry)) { throw new RuntimeException( String.format("The first and second arguments shall either all be geometry" + " or all geography")); } if (GeometryUtils.isGeography(firstGeometry)) { _results[i] = sphericalDistance(firstGeometry, secondGeometry); } else { _results[i] = firstGeometry.isEmpty() || secondGeometry.isEmpty() ? null : firstGeometry.distance(secondGeometry); } } return _results; }

Target:
public double[] transformToDoubleValuesSV(ProjectionBlock projectionBlock) { if (_results == null) { _results = new double[DocIdSetPlanNode.MAX_DOC_PER_CALL]; } byte[][] firstValues = _firstArgument.transformToBytesValuesSV(projectionBlock); byte[][] secondValues = _secondArgument.transformToBytesValuesSV(projectionBlock); for (int i = 0; i < projectionBlock.getNumDocs(); i++) { Geometry firstGeometry = GeometrySerializer.deserialize(firstValues[i]); Geometry secondGeometry = GeometrySerializer.deserialize(secondValues[i]); if (GeometryUtils.isGeography(firstGeometry) != GeometryUtils.isGeography(secondGeometry)) { throw new RuntimeException("The first and second arguments shall either all be geometry or all geography"); } if (GeometryUtils.isGeography(firstGeometry)) { _results[i] = sphericalDistance(firstGeometry, secondGeometry); } else { _results[i] = firstGeometry.isEmpty() || secondGeometry.isEmpty() ? Double.NaN : firstGeometry.distance(secondGeometry); } } return _results; }
Source:
public HttpEntity<CategoriesResource> getRelevantCategories() { CategoriesDTO categories = new CategoriesDTO(goalService.getAllCategories()); return new ResponseEntity<CategoriesResource>( new CategoriesResource(categories), HttpStatus.OK); }

Target:
public HttpEntity<CategoriesResource> getRelevantCategories() { CategoriesDTO categories = new CategoriesDTO(analysisEngineService.getRelevantCategories()); return new ResponseEntity<CategoriesResource>( new CategoriesResource(categories), HttpStatus.OK); }
Source:
private boolean isAssignQuotaAllowed() { List<Disk> disks = getSelectedItems(); return disks != null && disks.size() != 0; }

Target:
private boolean isAssignQuotaAllowed() { List<Disk> disks = getSelectedItems(); return disks != null && !disks.isEmpty(); }
Source:
NodeLevelMetrics getDataNodeBasedMetrics(DataNodeId dataNodeId) { return dataNodeToMetrics.containsKey(dataNodeId) ? dataNodeToMetrics.get(dataNodeId) : dataNodeToMetrics.get(null); }

Target:
NodeLevelMetrics getDataNodeBasedMetrics(DataNodeId dataNodeId) { return dataNodeToMetrics.get(dataNodeId); }
Source:
public void verifyAddEmptyCollectionMessage() { validationResult.addMessage(TEST_STRING_ONE); validationResult.addMessages(new ArrayList()); assertEquals("There should only be one line", 1, validationResult.getMessages().size()); }

Target:
public void verifyAddEmptyCollectionMessage() { validationResult.addMessage(TEST_STRING_ONE); validationResult.addMessages(new ArrayList<String>()); assertEquals("There should only be one line", 1, validationResult.getMessages().size()); }
Source:
public void run() throws SQLException { rs = statement.executeQuery(); }

Target:
public void run() throws SQLException { try (ResultSet rs = statement.executeQuery()) { rs.next(); returnValue = rs.getObject(1); } }
Source:
public String docs() { return "boolean {char} Determines if the character provided is uppercase or not."; }

Target:
public String docs() { return "boolean {char} Determines if the character provided is uppercase or not. The string must be exactly 1 character long and" + " a letter, otherwise a FormatException is thrown."; }
Source:
private static void warn(String func, Exception ex) { logger.warn(String.format("Unexpected exception in ActivityHelper.%s: %s", func, ex)); }

Target:
private static void warn(String func, Exception ex) { logger.warn(String.format("Unexpected exception in ActivityHelper.%s", func), ex); }
Source:
protected boolean set(IMixinMobSpawner container, Short value) { container.getSpawnerBaseLogic().maxNearbyEntities = Preconditions.checkNotNull(value); return true; }

Target:
protected boolean set(IMixinMobSpawner container, Short value) { container.getSpawnerBaseLogic().maxNearbyEntities = value; return true; }
Source:
public void testLogin() { runOnMainSync(new Runnable() { public void run() { new AMLoginInfoTask() { @Override public void onCatch(Throwable caught) { L.e("AMLoginInfoTask failed: " + caught.getMessage()); } @Override public void onFinish(AMLoginInfoResult result) { if (result.getEnabled()) { amLoginTestTask.execute(); } else { legacyLoginTestTask.execute(); } } }.execute(); } }); completionLatch.await(); }

Target:
public void testLogin() { runOnMainSync(new Runnable() { @Override public void run() { new AMLoginInfoTask() { @Override public void onCatch(Throwable caught) { L.e(caught); fail(); } @Override public void onFinish(AMLoginInfoResult result) { if (result.getEnabled()) { amLoginTestTask.execute(); } else { legacyLoginTestTask.execute(); } } }.execute(); } }); completionLatch.await(); }
Source:
public void handleData(final ITmfEvent event) { super.handleData(event); if (isCancelled()) { return; } try { if (fFilter == null || fFilter.matches(event)) { fWriter.write(event.getTimestamp().toString()); fWriter.write('\t'); fWriter.write(event.getSource()); fWriter.write('\t'); fWriter.write(event.getType().getName()); fWriter.write('\t'); fWriter.write(event.getReference()); fWriter.write('\t'); ITmfEventField content = event.getContent(); String value = content.getFormattedValue(); fWriter.write(value); fWriter.write('\n'); } } catch (IOException _) { fIOException = _; fail(); } }

Target:
public void handleData(final ITmfEvent event) { super.handleData(event); if (isCancelled()) { return; } try { if (fFilter == null || fFilter.matches(event)) { if (fTable != null) { ITmfEventField[] fields = fTable.extractItemFields(event); boolean needTab = false; for (ITmfEventField field: fields) { if (needTab) { fWriter.write('\t'); } fWriter.write(field.getValue().toString()); needTab = true; } } else { fWriter.write(event.getTimestamp().toString()); fWriter.write('\t'); fWriter.write(event.getSource()); fWriter.write('\t'); fWriter.write(event.getType().getName()); fWriter.write('\t'); fWriter.write(event.getReference()); fWriter.write('\t'); ITmfEventField content = event.getContent(); String value = content.getFormattedValue(); fWriter.write(value); } fWriter.write('\n'); } } catch (IOException ex) { fIOException = ex; fail(); } }
Source:
public RuntimeContext prepare(RuntimeIdentity id, InternalEnvironment environment) throws ValidationException, InfrastructureException { final KubernetesEnvironment kubernetesEnvironment = asKubernetesEnv(environment); workspaceNext.provision(id, kubernetesEnvironment); return super.prepare(id, kubernetesEnvironment); }

Target:
public RuntimeContext prepare(RuntimeIdentity id, InternalEnvironment environment) throws ValidationException, InfrastructureException { final KubernetesEnvironment kubernetesEnvironment = asKubernetesEnv(environment); toolingProvisioner.provision(id, kubernetesEnvironment); return super.prepare(id, kubernetesEnvironment); }
Source:
private ClientBuilder(URL url) { int port = url.getPort(); if (port < 0) { port = url.getDefaultPort(); } if (url.getUserInfo() != null) { this.username = url.getUserInfo().substring(0, url .getUserInfo() .indexOf(":")); this.password = url.getUserInfo().substring(url .getUserInfo() .indexOf(":")); } try { this.url = URIBuilder.buildUri() .scheme(url.getProtocol()) .host(url.getHost()) .port(port) .build().toURL(); } catch (MalformedURLException e) { throw new CouchDbException(e); } }

Target:
private ClientBuilder(URL url) { int port = url.getPort(); if (port < 0) { port = url.getDefaultPort(); } if (url.getUserInfo() != null) { this.username = url.getUserInfo().substring(0, url .getUserInfo() .indexOf(":")); this.password = url.getUserInfo().substring(url .getUserInfo() .indexOf(":") + 1); } try { this.url = URIBuilder.buildUri() .scheme(url.getProtocol()) .host(url.getHost()) .port(port) .build().toURL(); } catch (MalformedURLException e) { throw new RuntimeException(e); } }
Source:
public synchronized void rollback() throws SQLException { if (activeConnection != null && activeConnection.isValid(5)) { activeConnection.rollback(); } else { logger.debug("Connection to MySql DB is not available"); } }

Target:
public synchronized void rollback() throws SQLException { activeConnection.rollback(); }
Source:
private Optional<VirtualObject> findFile(String key) { Optional<StoredObject> file = storage.findByKey(tenants.getRequiredTenant(), "jobs", key); if (!file.isPresent() && Strings.isFilled(defaultFilePath)) { file = storage.findByPath(tenants.getRequiredTenant(), "jobs", defaultFilePath); } return file.map(storedObject -> { if (storedObject instanceof VirtualObject) { return (VirtualObject) storedObject; } return null; }); }

Target:
private Optional<VirtualObject> findFile(String key) { Optional<StoredObject> file = storage.findByKey(tenants.getRequiredTenant(), getBucketName(), key); if (!file.isPresent() && Strings.isFilled(defaultFilePath)) { file = storage.findByPath(tenants.getRequiredTenant(), getBucketName(), defaultFilePath); } return file.map(storedObject -> { if (storedObject instanceof VirtualObject) { return (VirtualObject) storedObject; } return null; }); }
Source:
protected List<LUNs> getDeviceList(Set<String> lunsIds) { if (getParameters().getDeviceList() == null) { return runGetDeviceList(lunsIds); } if (lunsIds == null) { return getParameters().getDeviceList(); } Set<String> lunsIdsSet = new HashSet<>(lunsIds); return getParameters().getDeviceList().stream() .filter(lun -> lunsIdsSet.contains(lun.getId())) .collect(Collectors.toList()); }

Target:
protected List<LUNs> getDeviceList(Set<String> lunsIds) { if (getParameters().getDeviceList() == null) { return runGetDeviceList(lunsIds); } if (lunsIds == null) { return getParameters().getDeviceList(); } return getParameters().getDeviceList().stream() .filter(lun -> lunsIds.contains(lun.getId())) .collect(Collectors.toList()); }
Source:
private ConnectionSettings providersXmlDiscoveryDiscover(String email, DiscoveryTarget discoveryTarget) { DiscoveryResults discoveryResults = providersXmlDiscovery.discover(email, DiscoveryTarget.INCOMING_AND_OUTGOING); if (discoveryResults == null || (discoveryResults.getIncoming().size() != 1 || discoveryResults.getOutgoing().size() != 1)) { return null; } DiscoveredServerSettings incoming = discoveryResults.getIncoming().get(0); DiscoveredServerSettings outgoing = discoveryResults.getOutgoing().get(0); return new ConnectionSettings(new ServerSettings( incoming.getProtocol(), incoming.getHost(), incoming.getPort(), incoming.getSecurity(), incoming.getAuthType(), incoming.getUsername(), null, null ), new ServerSettings( outgoing.getProtocol(), outgoing.getHost(), outgoing.getPort(), outgoing.getSecurity(), outgoing.getAuthType(), outgoing.getUsername(), null, null )); }

Target:
private ConnectionSettings providersXmlDiscoveryDiscover(String email, DiscoveryTarget discoveryTarget) { DiscoveryResults discoveryResults = providersXmlDiscovery.discover(email, DiscoveryTarget.INCOMING_AND_OUTGOING); if (discoveryResults == null || (discoveryResults.getIncoming().size() < 1 || discoveryResults.getOutgoing().size() < 1)) { return null; } DiscoveredServerSettings incoming = discoveryResults.getIncoming().get(0); DiscoveredServerSettings outgoing = discoveryResults.getOutgoing().get(0); return new ConnectionSettings(new ServerSettings( incoming.getProtocol(), incoming.getHost(), incoming.getPort(), incoming.getSecurity(), incoming.getAuthType(), incoming.getUsername(), null, null ), new ServerSettings( outgoing.getProtocol(), outgoing.getHost(), outgoing.getPort(), outgoing.getSecurity(), outgoing.getAuthType(), outgoing.getUsername(), null, null )); }
Source:
public void visitNode(Tree tree) { if(!hasSemantic()) { return; } ClassTree classTree = (ClassTree) tree; if(classTree.symbol().isPrivate() && classTree.symbol().usages().isEmpty()) { reportIssue(classTree.simpleName(), "Remove this unused private \""+classTree.symbol().name()+"\" class."); } }

Target:
public void visitNode(Tree tree) { if(!hasSemantic()) { return; } ClassTree classTree = (ClassTree) tree; Symbol.TypeSymbol classSymbol = classTree.symbol(); if(classSymbol.isPrivate() && classSymbol.usages().isEmpty()) { reportIssue(classTree.simpleName(), "Remove this unused private \""+ classSymbol.name()+"\" class."); } }
Source:
private String generateContinuationTokenForXns(final String firstEntryName) { if (firstEntryName == null || firstEntryName.isEmpty() || firstEntryName.startsWith(AbfsHttpConstants.ROOT_PATH)) { throw new IllegalArgumentException("startFrom must be a dir/file name and it can not be a full path"); } StringBuilder sb = new StringBuilder(); sb.append(firstEntryName).append("#$").append("0"); CRC64 crc64 = new CRC64(); StringBuilder token = new StringBuilder(); token.append(crc64.compute(sb.toString().getBytes(StandardCharsets.UTF_8))) .append(SINGLE_WHITE_SPACE) .append("0") .append(SINGLE_WHITE_SPACE) .append(firstEntryName); return Base64.encode(token.toString().getBytes(StandardCharsets.UTF_8)); }

Target:
private String generateContinuationTokenForXns(final String firstEntryName) { Preconditions.checkArgument(!Strings.isNullOrEmpty(firstEntryName) && !firstEntryName.startsWith(AbfsHttpConstants.ROOT_PATH), "startFrom must be a dir/file name and it can not be a full path"); StringBuilder sb = new StringBuilder(); sb.append(firstEntryName).append("#$").append("0"); CRC64 crc64 = new CRC64(); StringBuilder token = new StringBuilder(); token.append(crc64.compute(sb.toString().getBytes(StandardCharsets.UTF_8))) .append(SINGLE_WHITE_SPACE) .append("0") .append(SINGLE_WHITE_SPACE) .append(firstEntryName); return Base64.encode(token.toString().getBytes(StandardCharsets.UTF_8)); }
Source:
public Construct execs(Target t, Environment env, Script parent, ParseTree... nodes) { ParseTree syncObjectTree = nodes[0]; ParseTree code = nodes[1]; Construct cSyncObject = parent.seval(syncObjectTree, env); if(cSyncObject instanceof CNull) { throw new CRENullPointerException("Synchronization object may not be null in " + getName() + "().", t); } Object syncObject; if(cSyncObject instanceof CArray) { syncObject = cSyncObject; } else { syncObject = cSyncObject.val(); } if(syncObject instanceof String) { synchronized(syncObjectMap) { searchLabel: { for(Entry<Object, Integer> entry : syncObjectMap.entrySet()) { Object key = entry.getKey(); if(key instanceof String && key.equals(syncObject)) { syncObject = key; entry.setValue(entry.getValue() + 1); break searchLabel; } } syncObjectMap.put(syncObject, 1); } } } Construct ret; try { synchronized(syncObject) { ret = parent.seval(code, env); } } catch(RuntimeException e) { throw e; } finally { if(syncObject instanceof String) { synchronized(syncObjectMap) { int count = syncObjectMap.get(syncObject); if(count <= 1) { syncObjectMap.remove(syncObject); } else { for(Entry<Object, Integer> entry : syncObjectMap.entrySet()) { if(entry.getKey() == syncObject) { entry.setValue(count - 1); break; } } } } } } return ret; }

Target:
public Construct execs(Target t, Environment env, Script parent, ParseTree... nodes) { ParseTree syncObjectTree = nodes[0]; ParseTree code = nodes[1]; Construct cSyncObject = parent.seval(syncObjectTree, env); if(cSyncObject instanceof CNull) { throw new CRENullPointerException("Synchronization object may not be null in " + getName() + "().", t); } Object syncObject; if(cSyncObject instanceof CArray) { syncObject = cSyncObject; } else { syncObject = cSyncObject.val(); } if(syncObject instanceof String) { synchronized(syncObjectMap) { searchLabel: { for(Entry<Object, Integer> entry : syncObjectMap.entrySet()) { Object key = entry.getKey(); if(key instanceof String && key.equals(syncObject)) { syncObject = key; entry.setValue(entry.getValue() + 1); break searchLabel; } } syncObjectMap.put(syncObject, 1); } } } try { synchronized(syncObject) { parent.seval(code, env); } } catch(RuntimeException e) { throw e; } finally { if(syncObject instanceof String) { synchronized(syncObjectMap) { int count = syncObjectMap.get(syncObject); if(count <= 1) { syncObjectMap.remove(syncObject); } else { for(Entry<Object, Integer> entry : syncObjectMap.entrySet()) { if(entry.getKey() == syncObject) { entry.setValue(count - 1); break; } } } } } } return CVoid.VOID; }
Source:
static String typeString(Collector.Type t) { switch (t) { case GAUGE: return "gauge"; case COUNTER: return "counter"; case SUMMARY: return "summary"; default: return "uptyped"; } }

Target:
static String typeString(Collector.Type t) { switch (t) { case GAUGE: return "gauge"; case COUNTER: return "counter"; case SUMMARY: return "summary"; default: return "untyped"; } }
Source:
private LegacyLDAPSecuritySettingPlugin populateSecurityRoles() { ActiveMQServerLogger.LOGGER.populatingSecurityRolesFromLDAP(connectionURL); try { open(); } catch (Exception e) { ActiveMQServerLogger.LOGGER.errorOpeningContextForLDAP(e); return this; } SearchControls searchControls = new SearchControls(); searchControls.setReturningAttributes(new String[]{roleAttribute}); searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE); securityRoles = new HashMap<>(); try { if (logger.isDebugEnabled()) { logger.debug("Performing LDAP search: " + destinationBase); logger.debug("\tfilter: " + filter); logger.debug("\tcontrols:"); logger.debug("\t\treturningAttributes: " + roleAttribute); logger.debug("\t\tsearchScope: SUBTREE_SCOPE"); } NamingEnumeration<SearchResult> searchResults = context.search(destinationBase, filter, searchControls); while (searchResults.hasMore()) { processSearchResult(securityRoles, searchResults.next()); } } catch (Exception e) { ActiveMQServerLogger.LOGGER.errorPopulatingSecurityRolesFromLDAP(e); } return this; }

Target:
private LegacyLDAPSecuritySettingPlugin populateSecurityRoles() { ActiveMQServerLogger.LOGGER.populatingSecurityRolesFromLDAP(connectionURL); try { open(); } catch (Exception e) { ActiveMQServerLogger.LOGGER.errorOpeningContextForLDAP(e); return this; } SearchControls searchControls = new SearchControls(); searchControls.setReturningAttributes(new String[]{roleAttribute}); searchControls.setSearchScope(SearchControls.SUBTREE_SCOPE); securityRoles = new HashMap<>(); try { if (logger.isDebugEnabled()) { logger.debug(new StringBuilder().append("Performing LDAP search: ").append(destinationBase) .append("\tfilter: ").append(filter) .append("\tcontrols:") .append("\t\treturningAttributes: ").append(roleAttribute) .append("\t\tsearchScope: SUBTREE_SCOPE")); } NamingEnumeration<SearchResult> searchResults = context.search(destinationBase, filter, searchControls); while (searchResults.hasMore()) { processSearchResult(securityRoles, searchResults.next()); } } catch (Exception e) { ActiveMQServerLogger.LOGGER.errorPopulatingSecurityRolesFromLDAP(e); } return this; }
Source:
public void invoke(String[] cmd) throws Exception { context.getOutput().println("bye!"); context.getOutput().flush(); System.exit(0); }

Target:
public void invoke(String[] cmd) throws Exception { context.getOutput().println("bye!"); context.getOutput().close(); System.exit(0); }
Source:
AggregationBuilder<?> metricAgg(final QueryFilter filter) { QueryFilter metric_only_filter = null; if (filter instanceof ChainFilter) { BoolFilterBuilder builder = FilterBuilders.boolFilter(); for (final QueryFilter sub_filter : ((ChainFilter) filter).getFilters()) { if (sub_filter instanceof MetricFilter) { metric_only_filter = ChainFilter.newBuilder().addFilter(sub_filter).build(); } } } FilterBuilder pair_filter = getTagPairFilter(metric_only_filter); return AggregationBuilders.nested(METRIC_AGG) .path(METRIC_PATH) .subAggregation(AggregationBuilders.filter(METRIC_AGG) .filter(pair_filter) .subAggregation(AggregationBuilders.terms(METRIC_UNIQUE) .field(RESULT_METRIC) .size(0) .order(query.order() == MetaQuery.Order.ASCENDING ? Order.term(true) : Order.term(false)))); }

Target:
AggregationBuilder<?> metricAgg(final QueryFilter filter) { ChainFilter.Builder metric_only_filter = ChainFilter.newBuilder(); if (filter instanceof ChainFilter) { for (final QueryFilter sub_filter : ((ChainFilter) filter).getFilters()) { if (sub_filter instanceof MetricFilter) { metric_only_filter.addFilter(sub_filter); } } } FilterBuilder pair_filter = getTagPairFilter(metric_only_filter.build(), false); return AggregationBuilders.nested(METRIC_AGG) .path(METRIC_PATH) .subAggregation(AggregationBuilders.filter(METRIC_AGG) .filter(pair_filter) .subAggregation(AggregationBuilders.terms(METRIC_UNIQUE) .field(RESULT_METRIC) .size(0) .order(query.order() == MetaQuery.Order.ASCENDING ? Order.term(true) : Order.term(false)))); }
Source:
public void testMatchesWithStatistics() throws Exception { RichColumnDescriptor tableColumn = getTableColumn(); String value = "Test"; TupleDomain<ColumnDescriptor> effectivePredicate = getEffectivePredicate(tableColumn, VarcharType.createVarcharType(255), value); List<RichColumnDescriptor> tableColumns = Collections.singletonList(tableColumn); TupleDomainParquetPredicate predicate = new TupleDomainParquetPredicate(effectivePredicate, tableColumns); Statistics stats = BinaryStatistics.getStatsBasedOnType(tableColumn.getType()); stats.setNumNulls(1L); stats.setMinMaxFromBytes(value.getBytes(), value.getBytes()); assertTrue(predicate.matches(2, Collections.singletonMap(tableColumn, stats))); }

Target:
public void testMatchesWithStatistics() { RichColumnDescriptor column = getColumn(); String value = "Test"; TupleDomain<ColumnDescriptor> effectivePredicate = getEffectivePredicate(column, createVarcharType(255), value); List<RichColumnDescriptor> columns = singletonList(column); TupleDomainParquetPredicate predicate = new TupleDomainParquetPredicate(effectivePredicate, columns); Statistics stats = getStatsBasedOnType(column.getType()); stats.setNumNulls(1L); stats.setMinMaxFromBytes(value.getBytes(), value.getBytes()); assertTrue(predicate.matches(2, singletonMap(column, stats))); }
Source:
protected String renderDryRunResponse(SubmitDryRunResponse resp) { SubmitDryRunRender render = new SubmitDryRunRender(resp); DryRunFormatType formatType = Context.dryRunFormatType(config); switch (formatType) { case RAW : return render.renderRaw(); case TABLE: return render.renderTable(); default: throw new IllegalArgumentException( String.format("Unexpected rendering format: %s", formatType)); } }

Target:
protected String renderDryRunResponse(SubmitDryRunResponse resp) { DryRunFormatType formatType = Context.dryRunFormatType(config); switch (formatType) { case RAW : return new SubmitRawDryRunRenderer(resp).render(); case TABLE: return new SubmitTableDryRunRenderer(resp).render(); default: throw new IllegalArgumentException( String.format("Unexpected rendering format: %s", formatType)); } }
Source:
public void begin(EntityId eid) { Preconditions.checkArgument(mPut == null, "There is already a Put object in use by this Putter." + " Call commit() or rollback() to clear the Put."); if (mPut == null) { mEntityId = eid; mId = eid.getHBaseRowKey(); mHopper = new ArrayList<KeyValue>(); mPut = new Put(mId); } }

Target:
public synchronized void begin(EntityId eid) { Preconditions.checkState(mPut == null, "There is already a transaction in progress on row: " + mEntityId + ". Call commit(), checkAndCommit(), or rollback() to clear the Put."); if (mPut == null) { mEntityId = eid; mId = eid.getHBaseRowKey(); mHopper = new ArrayList<KeyValue>(); mPut = new Put(mId); } }
Source:
void customContextClassLoader() { var thread = Thread.currentThread(); ClassLoader old = thread.getContextClassLoader(); ClassLoader tccl = new URLClassLoader("(-:", new URL[0], ClassLoader.getSystemClassLoader()); try { thread.setContextClassLoader(tccl); List<ExecutionEvent> executionEvents = execute(3, SuccessfulWithMethodLockTestCase.class); assertThat(executionEvents.stream().filter(event(test(), finishedSuccessfully())::matches)).hasSize(3); assertThat(ThreadReporter.getThreadNames(executionEvents)).hasSize(3); assertThat(ThreadReporter.getLoaderNames(executionEvents).collect(toList())).containsExactly("(-:"); } finally { thread.setContextClassLoader(old); } }

Target:
void customContextClassLoader() { var currentThread = Thread.currentThread(); var currentLoader = currentThread.getContextClassLoader(); var smilingLoader = new URLClassLoader("(-:", new URL[0], ClassLoader.getSystemClassLoader()); currentThread.setContextClassLoader(smilingLoader); try { var executionEvents = execute(3, SuccessfulWithMethodLockTestCase.class); assertThat(executionEvents.stream().filter(event(test(), finishedSuccessfully())::matches)).hasSize(3); assertThat(ThreadReporter.getThreadNames(executionEvents)).hasSize(3); assertThat(ThreadReporter.getLoaderNames(executionEvents)).containsExactly("(-:"); } finally { currentThread.setContextClassLoader(currentLoader); } }
Source:
public void testGet() { Vault vaultFound = api().getVault(vaultName); assertTrue(!vaultFound.name().isEmpty()); }

Target:
public void testGet() { Vault vaultFound = api().getVault(vaultName); assertNotNull(vaultFound); }
Source:
@Override protected <T extends APIEntity> void clone(T from) { }

Target:
protected <T extends APIEntity> void clone(T from) { cloneBase(from); APIBasicJiraIssue jiraIssueType = (APIBasicJiraIssue) from; this.self = jiraIssueType.self; this.key = jiraIssueType.key; }
Source:
public static double getHoursSpentFromStateTasks(IAtsObject atsObject, IStateToken relatedToState) throws OseeCoreException { double spent = 0; if (atsObject instanceof IAtsTeamWorkflow) { for (IAtsTask taskArt : AtsCore.getWorkItemService().getTaskArtifacts((IAtsTeamWorkflow) atsObject, relatedToState)) { spent += HoursSpentUtil.getHoursSpentTotal(taskArt); } } return spent; }

Target:
public static double getHoursSpentFromStateTasks(IAtsObject atsObject, IStateToken relatedToState) throws OseeCoreException { double hours = 0.0; if (atsObject instanceof IAtsTeamWorkflow) { for (IAtsTask taskArt : AtsCore.getWorkItemService().getTasks((IAtsTeamWorkflow) atsObject, relatedToState)) { hours += HoursSpentUtil.getHoursSpentTotal(taskArt); } } return hours; }
Source:
public void setInheritFrom(@CheckForNull String inheritFrom) { if (inheritFrom != null && inheritFrom.equals(",default,")) { this.inheritFrom = ""; } else { this.inheritFrom = Util.fixEmpty(inheritFrom); } }

Target:
public void setInheritFrom(@CheckForNull String inheritFrom) { if (DescriptorImpl.defaultInheritFrom.equals(inheritFrom)) { this.inheritFrom = null; } else { this.inheritFrom = inheritFrom; } }
Source:
private INewAsyncCallback createGetVmsFromExportDomainCallback() { return new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { List<VM> vmsInExportDomain; VdcQueryReturnValue retVal = (VdcQueryReturnValue) returnValue; if (retVal == null || retVal.getReturnValue() == null || !retVal.getSucceeded()) { return; } vmsInExportDomain = retVal.getReturnValue(); if ((vmsInExportDomain.size() > 0)) { TemplateBackupModel templateBackupModel = (TemplateBackupModel) model; HashMap<String, List<String>> problematicVmNames = getDependentVMsForTemplate(vmsInExportDomain, templateBackupModel); if (!problematicVmNames.isEmpty()) { showRemoveTemplateWithDependentVMConfirmationWindow(problematicVmNames); } else { removeTemplateBackup(); } } else { removeTemplateBackup(); } } }; }

Target:
private INewAsyncCallback createGetVmsFromExportDomainCallback() { return new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { VdcQueryReturnValue retVal = (VdcQueryReturnValue) returnValue; if (retVal == null || retVal.getReturnValue() == null || !retVal.getSucceeded()) { return; } List<VM> vmsInExportDomain = retVal.getReturnValue(); List<VmTemplate> templates = Linq.<VmTemplate> cast(getSelectedItems()); HashMap<String, List<String>> problematicVmNames = getDependentVMsForTemplates(vmsInExportDomain, templates); if (!problematicVmNames.isEmpty()) { showRemoveTemplateWithDependentVMConfirmationWindow(problematicVmNames); } else { removeTemplateBackup(); } } }; }
Source:
default boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) { return false; }

Target:
default boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session, Location clicked) { throw new AssertionError("actPrimary must be overridden"); }
Source:
private static ExpressionAnalysis analyzeExpressions( Session session, Metadata metadata, SqlParser sqlParser, RelationType tupleDescriptor, Map<Symbol, Type> types, Iterable<? extends Expression> expressions, List<Expression> parameters, boolean isDescribe) { Analysis analysis = new Analysis(null, parameters, isDescribe); ExpressionAnalyzer analyzer = create(analysis, session, metadata, sqlParser, new DenyAllAccessControl(), types); for (Expression expression : expressions) { analyzer.analyze(expression, Scope.builder().withRelationType(RelationId.anonymous(), tupleDescriptor).build()); } return new ExpressionAnalysis( NodeRefCollections.toIdentityMap(analyzer.getExpressionTypes()), NodeRefCollections.toIdentityMap(analyzer.getExpressionCoercions()), NodeRefCollections.toIdentitySet(analyzer.getSubqueryInPredicates()), NodeRefCollections.toIdentitySet(analyzer.getScalarSubqueries()), NodeRefCollections.toIdentitySet(analyzer.getExistsSubqueries()), NodeRefCollections.toIdentityMap(analyzer.getColumnReferences()), NodeRefCollections.toIdentitySet(analyzer.getTypeOnlyCoercions()), NodeRefCollections.toIdentitySet(analyzer.getQuantifiedComparisons()), NodeRefCollections.toIdentityMap(analyzer.getLambdaArgumentReferences())); }

Target:
private static ExpressionAnalysis analyzeExpressions( Session session, Metadata metadata, SqlParser sqlParser, RelationType tupleDescriptor, Map<Symbol, Type> types, Iterable<? extends Expression> expressions, List<Expression> parameters, boolean isDescribe) { Analysis analysis = new Analysis(null, parameters, isDescribe); ExpressionAnalyzer analyzer = create(analysis, session, metadata, sqlParser, new DenyAllAccessControl(), types); for (Expression expression : expressions) { analyzer.analyze(expression, Scope.builder().withRelationType(RelationId.anonymous(), tupleDescriptor).build()); } return new ExpressionAnalysis( analyzer.getExpressionTypes(), analyzer.getExpressionCoercions(), analyzer.getSubqueryInPredicates(), analyzer.getScalarSubqueries(), analyzer.getExistsSubqueries(), analyzer.getColumnReferences(), analyzer.getTypeOnlyCoercions(), analyzer.getQuantifiedComparisons(), analyzer.getLambdaArgumentReferences()); }