auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void close() throws IOException { <START> IOUtils.close(log, activeLogChannel); <END> }</code><technical_language>unrelated note. current method definition java public static void close(Logger log, java.io.Closeable... closeables) { java create new Object[] for single closeable is passed method. benefit a variant takes parameter. Do this method more closeable</technical_language>

Target:
public void close() throws IOException { if (activeLogChannel != null) { activeLogChannel.close(); } }
Source:
<code>private static List<TableDescriptor> getTablesInSchema(DataDictionary dataDictionary, Connection connection, String schemaId) throws SQLException, StandardException { PreparedStatement statement = connection.prepareStatement(sqlGetTablesInSchema); statement.setString(1, schemaId); ResultSet resultSet = statement.executeQuery(); List<TableDescriptor> tableDescriptors = new ArrayList<>(); while(resultSet.next()) { tableDescriptors.add(dataDictionary.getTableDescriptor(new BasicUUID(resultSet.getString(1)))); <START> } <END> return tableDescriptors; }</code><technical_language>close resultSet end</technical_language>

Target:
private static List<TableDescriptor> getTablesInSchema(DataDictionary dataDictionary, Connection connection, String schemaId) throws SQLException, StandardException { try(PreparedStatement statement = connection.prepareStatement(sqlGetTablesInSchema)) { statement.setString(1, schemaId); try (ResultSet resultSet = statement.executeQuery()) { List<TableDescriptor> tableDescriptors = new ArrayList<>(); while (resultSet.next()) { tableDescriptors.add(dataDictionary.getTableDescriptor(new BasicUUID(resultSet.getString(1)))); } return tableDescriptors; } } }
Source:
<code>public void setNull(long columnIndex) { RealmFieldType columnType = getColumnType(columnIndex); if (columnType == RealmFieldType.STRING) { <START> if (!this.getTable().isColumnNullable(columnIndex)) { <END> throw new IllegalArgumentException("field is not nullable"); } super.setString(columnIndex, null); } else if (columnType == RealmFieldType.BINARY) { super.setBinaryByteArray(columnIndex, null); } else { if (!this.getTable().isColumnNullable(columnIndex)) { throw new IllegalArgumentException("field is not nullable"); } super.setNull(columnIndex); } }</code><technical_language>this checked JNI</technical_language>

Target:
public void setNull(long columnIndex) { RealmFieldType columnType = getColumnType(columnIndex); if (columnType == RealmFieldType.BINARY) { super.setBinaryByteArray(columnIndex, null); } else { super.setNull(columnIndex); } }
Source:
<code>public PageFunctionCompiler(Metadata metadata, CompilerConfig config) { <START> this(metadata, config.isExpressionCacheEnabled()); <END> }</code><technical_language>consistent similar classes add requireNonNull for args</technical_language>

Target:
public PageFunctionCompiler(Metadata metadata, CompilerConfig config) { this(metadata, requireNonNull(config, "config is null").getExpressionCacheSize()); }
Source:
<code><START> public GetTrackerDataResponse getTrackerDataForDates(@Valid final List<String> dateStrings, @Scope({OAuthScope.API_INTERNAL_DATA_READ}) final AccessToken accessToken) { <END> if(dateStrings.size() > 31 || dateStrings.size() == 0){ throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).build()); } final Map<DateTime, String> dateToStringMapping = new HashMap<DateTime, String>(); for(final String dateString:dateStrings){ try { dateToStringMapping.put(DateTime.parse(dateString, DateTimeFormat.forPattern(DateTimeFormatString.FORMAT_TO_DAY)), dateString); }catch (IllegalArgumentException iae){ throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).build()); } } try { final ImmutableMap<DateTime, List<TrackerMotion>> result = this.trackerMotionDAODynamoDB.getTrackerMotionForDates(accessToken.accountId, dateToStringMapping.keySet()); final Map<String, List<TrackerMotion>> convertedResult = new HashMap<String, List<TrackerMotion>>(); for (final DateTime date : result.keySet()) { if (dateToStringMapping.containsKey(date)) { convertedResult.put(dateToStringMapping.get(date), result.get(date)); } } final GetTrackerDataResponse response = new GetTrackerDataResponse(convertedResult); return response; }catch (AmazonServiceException ase){ throw new WebApplicationException(Response.serverError().build()); } }</code><technical_language>HTTP POST request for a getTrackerDataForDates</technical_language>

Target:
public GetTrackerDataResponse getTrackerDataForDates(@Valid final List<String> dateStrings, @Scope({OAuthScope.API_INTERNAL_DATA_READ}) final AccessToken accessToken) { if(dateStrings.size() > 31 || dateStrings.size() == 0){ throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).build()); } final Map<DateTime, String> dateToStringMapping = new HashMap<DateTime, String>(); for(final String dateString:dateStrings){ try { dateToStringMapping.put(DateTime.parse(dateString, DateTimeFormat.forPattern(DateTimeFormatString.FORMAT_TO_DAY)), dateString); }catch (IllegalArgumentException iae){ throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).build()); } } try { final ImmutableMap<DateTime, List<TrackerMotion>> result = this.trackerMotionDAODynamoDB.getTrackerMotionForDates(accessToken.accountId, dateToStringMapping.keySet()); final Map<String, List<TrackerMotion>> convertedResult = new HashMap<String, List<TrackerMotion>>(); for (final DateTime date : result.keySet()) { if (dateToStringMapping.containsKey(date)) { convertedResult.put(dateToStringMapping.get(date), result.get(date)); } } final GetTrackerDataResponse response = new GetTrackerDataResponse(convertedResult); return response; }catch (AmazonServiceException ase){ LOGGER.error("Amazon Service error: {}", ase.getErrorMessage()); throw new WebApplicationException(Response.serverError().build()); } }
Source:
<code>public CommandExecutor() { try { context.registerFunction("bindingResult", CommandUtils.class.getDeclaredMethod("getBindingResult")); context.registerFunction("call", Command.class.getDeclaredMethod("newInstance", String.class, String[].class)); } catch (NoSuchMethodException ex) { throw new BeanInitializationException("Unable to register SpEL functions", ex); } try (InputStream in = getClass().getClassLoader().getResourceAsStream("component/plugins/digitalExchange/commands.xml")) { <START> commands = JAXB.unmarshal(in, Commands.class); <END> } catch (IOException ex) { throw new BeanInitializationException("Unable to load installation commands", ex); } }</code><technical_language>In this line input stream (in) null. treat log</technical_language>

Target:
public CommandExecutor() { try { context.registerFunction("bindingResult", CommandUtils.class.getDeclaredMethod("getBindingResult")); context.registerFunction("call", Command.class.getDeclaredMethod("newInstance", String.class, String[].class)); } catch (NoSuchMethodException ex) { throw new BeanInitializationException("Unable to register SpEL functions", ex); } try (InputStream in = getClass().getClassLoader().getResourceAsStream("component/plugins/digitalExchange/commands.xml")) { if(in == null) { throw new BeanInitializationException("Unable to load installation commands. File commands.xml not found"); } commands = JAXB.unmarshal(in, Commands.class); } catch (IOException ex) { throw new BeanInitializationException("Unable to load installation commands", ex); } }
Source:
<code>public static long getDuration(File file) { MediaMetadataRetriever mediaMetadataRetriever = new MediaMetadataRetriever(); <START> mediaMetadataRetriever.setDataSource(file.getAbsolutePath()); <END> String durationStr = mediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION); return Long.parseLong(durationStr); }</code><technical_language>Note: mentioning in docs method signature, [at this call](<LINK_0> (and potentially below) fail untyped RuntimeException for reasons. Additionally, I media types unable parse effectively, handled edge case anywhere. wrap this method catch runtime exceptions generally gracefully handle knowing length of a video file</technical_language>

Target:
public static long getDuration(File file) { try { MediaMetadataRetriever mediaMetadataRetriever = new MediaMetadataRetriever(); mediaMetadataRetriever.setDataSource(file.getAbsolutePath()); String durationStr = mediaMetadataRetriever.extractMetadata(MediaMetadataRetriever.METADATA_KEY_DURATION); return Long.parseLong(durationStr); } catch (Exception e) { Logger.exception("Exception while trying to get duration of a media file", e); return -1; } }
Source:
<code>public void testExtraSessionsNotCreated() throws Exception { Callback c = (request, response) -> { response.getWriter().write("done"); }; servlet.getServletContext().setAttribute("callback", c); WebConversation wc = new WebConversation(); WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port)); req.setParameter("cmd", QueryCommand.CALLBACK.name()); req.setParameter("param", "callback"); WebResponse response = wc.getResponse(req); assertThat(response.getText()).isEqualTo("done"); <START> assertThat(region.size()).as("The region should be empty").isEqualTo(1); <END> }</code><technical_language>update description testing for empty region</technical_language>

Target:
public void testExtraSessionsNotCreated() throws Exception { Callback c = (request, response) -> { response.getWriter().write("done"); }; servlet.getServletContext().setAttribute("callback", c); WebConversation wc = new WebConversation(); WebRequest req = new GetMethodWebRequest(String.format("http://localhost:%d/test", port)); req.setParameter("cmd", QueryCommand.CALLBACK.name()); req.setParameter("param", "callback"); WebResponse response = wc.getResponse(req); assertThat(response.getText()).isEqualTo("done"); assertThat(region.size()).as("The region should contain one entry").isEqualTo(1); }
Source:
<code>static Tuple getDataRow(SQLiteStatement stmt) throws SQLiteException { <START> logger.entering(SQLiteWrapperUtils.class.getCanonicalName(),"getDataRow",stmt); <END> Tuple result = new Tuple(getColumnTypes(stmt)); for (int i = 0; i < stmt.columnCount(); i++) { Integer type = stmt.columnType(i); switch (type) { case SQLiteConstants.SQLITE_NULL: result.put(i); break; case SQLiteConstants.SQLITE_TEXT: result.put(i, stmt.columnString(i)); break; case SQLiteConstants.SQLITE_INTEGER: result.put(i, stmt.columnLong(i)); break; case SQLiteConstants.SQLITE_FLOAT: result.put(i, Double.valueOf(stmt.columnDouble(i)).floatValue()); break; case SQLiteConstants.SQLITE_BLOB: result.put(i, stmt.columnBlob(i)); break; default: throw new IllegalArgumentException("Unsupported data type: " + type); } } return result; }</code><technical_language>If hardcode class, hardcode string, _know_ be, making a call is silly</technical_language>

Target:
static Tuple getDataRow(SQLiteStatement stmt) throws SQLiteException { logger.entering("com.cloudant.sync.sqlite.sqlite4java.SQLiteWrapperUtils","getDataRow",stmt); Tuple result = new Tuple(getColumnTypes(stmt)); for (int i = 0; i < stmt.columnCount(); i++) { Integer type = stmt.columnType(i); switch (type) { case SQLiteConstants.SQLITE_NULL: result.put(i); break; case SQLiteConstants.SQLITE_TEXT: result.put(i, stmt.columnString(i)); break; case SQLiteConstants.SQLITE_INTEGER: result.put(i, stmt.columnLong(i)); break; case SQLiteConstants.SQLITE_FLOAT: result.put(i, Double.valueOf(stmt.columnDouble(i)).floatValue()); break; case SQLiteConstants.SQLITE_BLOB: result.put(i, stmt.columnBlob(i)); break; default: throw new IllegalArgumentException("Unsupported data type: " + type); } } return result; }
Source:
<code>protected void restartMining() { Block newMiningBlock = getNewBlockForMining(); synchronized(this) { cancelCurrentBlock(); miningBlock = newMiningBlock; if (externalMiner != null) { currentMiningTasks.add(externalMiner.mine(cloneBlock(miningBlock))); } if (isLocalMining) { MinerIfc localMiner = config.getBlockchainConfig() .getConfigForBlock(miningBlock.getNumber()) .getMineAlgorithm(config); if (localMiner instanceof EthashMiner) { <START> Set<EthashMinerListener> ethashMinerListeners = listeners.stream() <END> .filter(listener -> listener instanceof EthashMinerListener) .map(listener -> (EthashMinerListener) listener) .collect(Collectors.toSet()); ((EthashMiner) localMiner).setListeners(ethashMinerListeners); } currentMiningTasks.add(localMiner.mine(cloneBlock(miningBlock))); } for (final ListenableFuture<MiningResult> task : currentMiningTasks) { task.addListener(() -> { try { final Block minedBlock = task.get().block; blockMined(minedBlock); } catch (InterruptedException | CancellationException e) { } catch (Exception e) { logger.warn("Exception during mining: ", e); } }, MoreExecutors.directExecutor()); } } fireBlockStarted(newMiningBlock); logger.debug("New block mining started: {}", newMiningBlock.getShortHash()); }</code><technical_language>do filtering in EthashMiner.setListeners() main flow clean</technical_language>

Target:
protected void restartMining() { Block newMiningBlock = getNewBlockForMining(); synchronized(this) { cancelCurrentBlock(); miningBlock = newMiningBlock; if (externalMiner != null) { externalMiner.setListeners(listeners); currentMiningTasks.add(externalMiner.mine(cloneBlock(miningBlock))); } if (isLocalMining) { MinerIfc localMiner = config.getBlockchainConfig() .getConfigForBlock(miningBlock.getNumber()) .getMineAlgorithm(config); localMiner.setListeners(listeners); currentMiningTasks.add(localMiner.mine(cloneBlock(miningBlock))); } for (final ListenableFuture<MiningResult> task : currentMiningTasks) { task.addListener(() -> { try { final Block minedBlock = task.get().block; blockMined(minedBlock); } catch (InterruptedException | CancellationException e) { } catch (Exception e) { logger.warn("Exception during mining: ", e); } }, MoreExecutors.directExecutor()); } } fireBlockStarted(newMiningBlock); logger.debug("New block mining started: {}", newMiningBlock.getShortHash()); }
Source:
<code><START> public static AddonArchive getDeployment() <END> { AddonArchive archive = ShrinkWrap .create(AddonArchive.class) .addBeansXML() .addAsAddonDependencies( AddonDependencyEntry.create("org.jboss.forge.addon:ui"), AddonDependencyEntry.create("org.jboss.forge.addon:shell-test-harness"), AddonDependencyEntry.create("org.jboss.forge.addon:resources"), AddonDependencyEntry.create("org.jboss.forge.furnace.container:cdi") ); return archive; }</code><technical_language>Remove @AddonDeployment annotations leave @AddonDeployments. Also, remove addAsAddonDependencies below</technical_language>

Target:
public static AddonArchive getDeployment() { return ShrinkWrap .create(AddonArchive.class) .addBeansXML(); }
Source:
<code>public void handleAction(ActionParameters params) throws ActionException { params.requireLoggedInUser(); int datasourceId = params.getRequiredParamInt(StatisticsHelper.PARAM_DATASOURCE_ID); StatisticalDatasourcePlugin datasource = StatisticalDatasourcePluginManager.getInstance().getPlugin(datasourceId); if(datasource == null) { throw new ActionParamsException("Invalid datasource:" + datasourceId); } if(!datasource.canModify(params.getUser())) { throw new ActionDeniedException("User doesn't have permission to modify datasource:" + datasourceId); } String id = params.getHttpParam(ActionConstants.PARAM_ID); StatisticalIndicator existingIndicator = null; if (id != null) { existingIndicator = datasource.getIndicator(params.getUser(), id); if(existingIndicator == null) { throw new ActionParamsException("Requested invalid indicator:" + id); } } StatisticalIndicator indicator = parseIndicator(params, existingIndicator); try { <START> existingIndicator = datasource.saveIndicator(indicator, params.getUser()); <END> } catch (Exception ex) { throw new ActionException("Couldn't save indicator", ex); } try { ResponseHelper.writeResponse(params, StatisticsHelper.toJSON(existingIndicator)); } catch (JSONException shouldNeverHappen) { ResponseHelper.writeResponse(params, JSONHelper.createJSONObject("id", id)); } }</code><technical_language>local variables for "same" indicator is a bit confusing. change parseIndicator(ActionParameters, StatisticalDatasourcePlugin) move existingIndicator logic function</technical_language>

Target:
public void handleAction(ActionParameters params) throws ActionException { params.requireLoggedInUser(); int datasourceId = params.getRequiredParamInt(StatisticsHelper.PARAM_DATASOURCE_ID); StatisticalDatasourcePlugin datasource = StatisticalDatasourcePluginManager.getInstance().getPlugin(datasourceId); if(datasource == null) { throw new ActionParamsException("Invalid datasource:" + datasourceId); } if(!datasource.canModify(params.getUser())) { throw new ActionDeniedException("User doesn't have permission to modify datasource:" + datasourceId); } String id = params.getHttpParam(ActionConstants.PARAM_ID); StatisticalIndicator indicator = parseIndicator(params, datasource); StatisticalIndicator savedIndicator; try { savedIndicator = datasource.saveIndicator(indicator, params.getUser()); } catch (Exception ex) { throw new ActionException("Couldn't save indicator", ex); } try { ResponseHelper.writeResponse(params, StatisticsHelper.toJSON(savedIndicator)); } catch (JSONException shouldNeverHappen) { ResponseHelper.writeResponse(params, JSONHelper.createJSONObject("id", id)); } }
Source:
<code><START> public void deconfigure() { <END> }</code><technical_language>This changes API. While exceptions is valid, extending this class longer override throw CoreException (at experiment a checked IOException shows). I flag internal classes changed if needed</technical_language>

Target:
public void deconfigure() throws CoreException { }
Source:
<code>public boolean passes(final String scope) { if (skipTestScope && org.apache.maven.artifact.Artifact.SCOPE_TEST.equals(scope)) { return true; } if (skipProvidedScope && org.apache.maven.artifact.Artifact.SCOPE_PROVIDED.equals(scope)) { return true; } if (skipSystemScope && org.apache.maven.artifact.Artifact.SCOPE_SYSTEM.equals(scope)) { return true; } if (skipRuntimeScope && org.apache.maven.artifact.Artifact.SCOPE_RUNTIME.equals(scope)) { return true; } <START> <END> return false; }</code><technical_language>this include: java if (skipRuntimeScope && skipCompileScope && org.apache.maven.artifact.Artifact.SCOPE_COMPILE_PLUS_RUNTIME.equals(scope)) { return true; } if (skipRuntimeScope && skipSystemScope && org.apache.maven.artifact.Artifact.SCOPE_COMPILE_PLUS_RUNTIME.equals(SCOPE_RUNTIME_PLUS_SYSTEM)) { return true; }</technical_language>

Target:
public boolean passes(final String scope) { if (skipTestScope && org.apache.maven.artifact.Artifact.SCOPE_TEST.equals(scope)) { return true; } if (skipProvidedScope && org.apache.maven.artifact.Artifact.SCOPE_PROVIDED.equals(scope)) { return true; } if (skipSystemScope && org.apache.maven.artifact.Artifact.SCOPE_SYSTEM.equals(scope)) { return true; } if (skipRuntimeScope && org.apache.maven.artifact.Artifact.SCOPE_RUNTIME.equals(scope)) { return true; } if (skipRuntimeScope && skipSystemScope && org.apache.maven.artifact.Artifact.SCOPE_COMPILE_PLUS_RUNTIME.equals(SCOPE_RUNTIME_PLUS_SYSTEM)) { return true; } return false; }
Source:
<code>public Map<WithSeq<Client>, PaxosUpdate> apply(Set<WithSeq<Client>> request) { Map<Client, Long> remoteRequest = request.stream() .collect(toMap(WithSeq::value, WithSeq::seq, Math::min)); SetMultimap<Client, PaxosValue> learnedValuesSince = delegate.getLearnedValuesSince(remoteRequest); Map<Client, NavigableMap<Long, PaxosValue>> results = KeyedStream.stream(learnedValuesSince.asMap()) .map(LearnedValuesSinceCoalescingFunction::toTreeMapBySeq) .collectToMap(); return KeyedStream.of(request) .map(clientWithSeq -> results.getOrDefault(clientWithSeq.value(), ImmutableSortedMap.of())) <START> .map((clientWithSeq, paxosValuesByRound) -> paxosValuesByRound.tailMap(clientWithSeq.seq()).values()) <END> .map(values -> new PaxosUpdate(ImmutableList.copyOf(values))) .collectToMap(); }</code><technical_language>This is correct pretty nice, prefer a method this step is</technical_language>

Target:
public Map<WithSeq<Client>, PaxosUpdate> apply(Set<WithSeq<Client>> request) { Map<Client, Long> remoteRequest = request.stream() .collect(toMap(WithSeq::value, WithSeq::seq, Math::min)); SetMultimap<Client, PaxosValue> learnedValuesSince = delegate.getLearnedValuesSince(remoteRequest); Map<Client, ImmutableSortedMap<Long, PaxosValue>> results = KeyedStream.stream(learnedValuesSince.asMap()) .map(LearnedValuesSinceCoalescingFunction::toNavigableMapBySeq) .collectToMap(); return KeyedStream.of(request) .map(clientWithSeq -> results.getOrDefault(clientWithSeq.value(), ImmutableSortedMap.of())) .map(LearnedValuesSinceCoalescingFunction::getPaxosValuesSinceSeq) .map(values -> new PaxosUpdate(ImmutableList.copyOf(values))) .collectToMap(); }
Source:
<code>public T get(int index) { <START> if ((index < 0) || (index >= length())) throw new IndexOutOfBoundsException("get(" + index + ")"); <END> return trie.get(index + indexShift).get(); }</code><technical_language>Please, revert this. hard read..</technical_language>

Target:
public T get(int index) { if ((index < 0) || (index >= length())) { throw new IndexOutOfBoundsException("get(" + index + ")"); } else { return trie.get(index + indexShift).get(); } }
Source:
<code>public boolean isInCurrentMainProject(IRepositoryNode node) { if (node != null) { Project curP = getCurrentProject(); if (PluginChecker.isRefProjectLoaded()) { IReferencedProjectService service = (IReferencedProjectService) GlobalServiceRegister.getDefault() .getService(IReferencedProjectService.class); if (service != null && service.isMergeRefProject() && curP != null) { IRepositoryViewObject object = node.getObject(); if (object == null) { return true; } <START> if (object.getId() != null && cachedObjects.containsKey(object.getId())) { <END> return cachedObjects.get(object.getId()); } org.talend.core.model.properties.Project emfProject = getProject(object.getProperty().getItem()); org.talend.core.model.properties.Project curProject = curP.getEmfProject(); boolean ret = emfProject.equals(curProject); if (object.getId() != null) { cachedObjects.put(object.getId(), ret); } return ret; } else { IProjectRepositoryNode root = node.getRoot(); if (root != null) { Project project = root.getProject(); if (project != null) { return project.equals(curP); } else { return true; } } } } else { IProjectRepositoryNode root = node.getRoot(); if (root != null) { Project project = root.getProject(); if (project != null && curP != null) { return project.getTechnicalLabel().equals(curP.getTechnicalLabel()); } else { return true; } } } } return false; }</code><technical_language>is extreme condition work: main reference project some item ID. do support guarantee customer do this kind of case . this commit , object id in reference project editable. store key project id+object id</technical_language>

Target:
public boolean isInCurrentMainProject(IRepositoryNode node) { if (node != null) { Project curP = getCurrentProject(); if (PluginChecker.isRefProjectLoaded()) { IReferencedProjectService service = (IReferencedProjectService) GlobalServiceRegister.getDefault() .getService(IReferencedProjectService.class); if (service != null && service.isMergeRefProject() && curP != null) { IRepositoryViewObject object = node.getObject(); if (object == null) { return true; } if (cachedObjects.containsKey(object)) { return cachedObjects.get(object); } org.talend.core.model.properties.Project emfProject = getProject(object.getProperty().getItem()); org.talend.core.model.properties.Project curProject = curP.getEmfProject(); boolean ret = emfProject.equals(curProject); cachedObjects.put(object, ret); return ret; } else { IProjectRepositoryNode root = node.getRoot(); if (root != null) { Project project = root.getProject(); if (project != null) { return project.equals(curP); } else { return true; } } } } else { IProjectRepositoryNode root = node.getRoot(); if (root != null) { Project project = root.getProject(); if (project != null && curP != null) { return project.getTechnicalLabel().equals(curP.getTechnicalLabel()); } else { return true; } } } } return false; }
Source:
<code>public Collection<String> getReviewUrls(String taskUrl) { <START> List<String> reviewUrls = taskReviewsMap.get(taskUrl); <END> if (reviewUrls == null) { return Collections.emptyList(); } return reviewUrls; }</code><technical_language>Multimap returns null, get rid of this method</technical_language>

Target:
public Collection<String> getReviewUrls(String taskUrl) { return taskReviewsMap.get(taskUrl); }
Source:
<code><START> void clearNotification(@NotificationId <END> final int id) { mNotificationManager.cancel(null , id); }</code><technical_language>Is this visible for testing</technical_language>

Target:
private void clearNotification(@NotificationId final int id) { mNotificationManager.cancel(null , id); }
Source:
<code>public Iterable<Commit> log() throws IOException { final Iterator<Commit> iterator = this.origin.log().iterator(); <START> return new Iterable<Commit>() { <END> private final transient Time current = new Time(); @Override public Iterator<Commit> iterator() { return Iterators.filter( iterator, new Predicate<Commit>() { @Override public boolean apply(final Commit commit) { return Seasoned.this.isBefore(commit, current); } } ); } @Override public String toString() { return "Seasoned commits"; } }; }</code><technical_language>Iterables Guava. code shorter</technical_language>

Target:
public Iterable<Commit> log() throws IOException { final Time current = new Time(); return Iterables.filter( this.origin.log(), new Predicate<Commit>() { @Override public boolean apply(final Commit commit) { return Seasoned.this.isBefore(commit, current); } } ); }
Source:
<code>private void auditVmOnRebooting() { AuditLogableBase logable = Injector.injectMembers(new AuditLogableBase(vdsManager.getVdsId(), getVmId())); logable.addCustomValue("UserName", String.format("%s", <START> dbVm.getConsoleCurrentUserName())); <END> auditLog(logable, AuditLogType.USER_REBOOT_VM); }</code><technical_language>user name incorrect if VM rebooted SSH a script. Please a generic message "Guest OS". need String.format()</technical_language>

Target:
private void auditVmOnRebooting() { AuditLogableBase logable = Injector.injectMembers(new AuditLogableBase(vdsManager.getVdsId(), getVmId())); logable.addCustomValue("UserName", "Guest OS"); auditLog(logable, AuditLogType.USER_REBOOT_VM); }
Source:
<code><START> private String getString(String param) { <END> return Constant.messages.getString(MESSAGE_PREFIX + param); }</code><technical_language>static</technical_language>

Target:
private static String getString(String param) { return Constant.messages.getString(MESSAGE_PREFIX + param); }
Source:
<code><START> private Map<String, String> toMachineAttributes( <END> String pluginId, Map<String, String> wsAttributes) { String pluginComponentAliases = wsAttributes.get(PLUGINS_COMPONENTS_ALIASES_WORKSPACE_ATTRIBUTE); String editorComponentAlias = wsAttributes.get(EDITOR_COMPONENT_ALIAS_WORKSPACE_ATTRIBUTE); List<String> aliases = new ArrayList<>(); if (!isNullOrEmpty(pluginComponentAliases)) { aliases.addAll(asList(pluginComponentAliases.split(","))); } if (!isNullOrEmpty(editorComponentAlias)) { aliases.add(editorComponentAlias); } if (!aliases.isEmpty()) { return aliases .stream() .map(value -> value.split("=")) .filter(arr -> arr[0].equals(pluginId)) .map(arr -> arr[1]) .collect(toMap(alias -> DEVFILE_COMPONENT_ALIAS_ATTRIBUTE, Function.identity())); } return null; }</code><technical_language>I rewrite in more Single Responsibility Principle style java private Map<String, String> toMachineAttributes(String pluginId, Map<String, String> wsAttributes) { Map<String, String> attributes = new HashMap<>(); Optional<String> pluginAlias = findPluginAlias(pluginId, wsAttributes); pluginAlias.ifPresent(s -> attributes.put(DEVFILE_COMPONENT_ALIAS_ATTRIBUTE, s)); return attributes; } private Optional<String> findPluginAlias(String pluginId, Map<String, String> wsAttributes) { List<String> aliases = new ArrayList<>(); String pluginComponentAliases = wsAttributes.get(PLUGINS_COMPONENTS_ALIASES_WORKSPACE_ATTRIBUTE); if (!isNullOrEmpty(pluginComponentAliases)) { aliases.addAll(asList(pluginComponentAliases.split(","))); } String editorComponentAlias = wsAttributes.get(EDITOR_COMPONENT_ALIAS_WORKSPACE_ATTRIBUTE); if (!isNullOrEmpty(editorComponentAlias)) { aliases.add(editorComponentAlias); } if (aliases.isEmpty()) { return Optional.empty(); } return aliases .stream() .map(value -> value.split("=")) .filter(arr -> arr[0].equals(pluginId)) .map(arr -> arr[1]) .findAny(); }</technical_language>

Target:
private Map<String, String> toMachineAttributes( String pluginId, Map<String, String> wsAttributes) { Map<String, String> attributes = new HashMap<>(); Optional<String> pluginAlias = findPluginAlias(pluginId, wsAttributes); pluginAlias.ifPresent(s -> attributes.put(DEVFILE_COMPONENT_ALIAS_ATTRIBUTE, s)); return attributes; }
Source:
<code>public static boolean isNormalSequence(final String s) { <START> if (s.length() == 0) { <END> return false; } for (int i = 0; i < s.length(); i++) { char ch = s.charAt(i); if (ch == A || ch == T || ch == C || ch == G || ch == a || ch == t || ch == c || ch == g || ch == n || ch == N) { ; } else { return false; } } return true; }</code><technical_language>s == null</technical_language>

Target:
public static boolean isNormalSequence(final String s) { if (s == null || s.length() == 0) { return false; } for (int i = 0; i < s.length(); i++) { char ch = s.charAt(i); if (ch == A || ch == T || ch == C || ch == G || ch == a || ch == t || ch == c || ch == g || ch == n || ch == N) { ; } else { return false; } } return true; }
Source:
<code>default ProjectedTimeDimension toProjectedDimension(final TimeGrainDefinition requestedGrain) { <START> TimeZone requestedTimeZone = getTimeZone(); <END> String name = getName(); return new ProjectedTimeDimension() { @Override public TimeZone getTimeZone() { return requestedTimeZone; } @Override public TimeGrainDefinition getTimeGrain() { return requestedGrain; } @Override public String getName() { return name; } }; }</code><technical_language>double check requestedGrain is supported</technical_language>

Target:
default TimeDimensionProjection toProjectedDimension(final TimeGrainDefinition requestedGrain) { Preconditions.checkArgument(getSupportedGrains().contains(requestedGrain)); TimeZone requestedTimeZone = getTimeZone(); String name = getName(); return new TimeDimensionProjection() { @Override public TimeZone getTimeZone() { return requestedTimeZone; } @Override public TimeGrainDefinition getTimeGrain() { return requestedGrain; } @Override public String getName() { return name; } }; }
Source:
<code>public void addContainer(final UUID uuid, final ContainerID containerId) throws NodeNotFoundException { if (!nodeToContainer.containsKey(uuid)) { throw new NodeNotFoundException("Node UUID: " + uuid); } <START> nodeToContainer.get(uuid).add(containerId); <END> }</code><technical_language>check get calls race remove call. code, is remove call, remove dn is dead</technical_language>

Target:
public void addContainer(final UUID uuid, final ContainerID containerId) throws NodeNotFoundException { lock.writeLock().lock(); try { checkIfNodeExist(uuid); nodeToContainer.get(uuid).add(containerId); } finally { lock.writeLock().unlock(); } }
Source:
<code>public void testDescribeWithTimestamp(){ client.add("name", "Gerald"); client.add("address", "123 Main St"); Timestamp stamp = Timestamp.now(); client.add("title", "Person"); <START> String[] expecteds = {"address", "name"}; <END> Set<String> actuals = client.describe(stamp); Assert.assertArrayEquals(expecteds, actuals.toArray(new String[actuals.size()])); }</code><technical_language>@aunyks expected a Set convert return of describe method array</technical_language>

Target:
public void testDescribeWithTimestamp(){ client.add("name", "Gerald"); client.add("address", "123 Main St"); Timestamp stamp = Timestamp.now(); client.add("title", "Person"); Set<String> expecteds = Sets.newHashSet(); expecteds.add("name"); expecteds.add("address"); Set<String> actuals = client.describe(stamp); Assert.assertEquals(expecteds, actuals); }
Source:
<code>public SmallIntSet(Set<Integer> set) { if (set instanceof SmallIntSet) { BitSet bitSet = ((SmallIntSet) set).bitSet; this.bitSet = new BitSet(bitSet.size()); this.bitSet.or(bitSet); } else if (set instanceof IntSet) { this.bitSet = new BitSet(); <START> ((IntSet) set).iterator().forEachRemaining((IntConsumer) bitSet::set); <END> } else { bitSet = new BitSet(set.size()); set.forEach(bitSet::set); } }</code><technical_language>forEach</technical_language>

Target:
public SmallIntSet(Set<Integer> set) { if (set instanceof SmallIntSet) { BitSet bitSet = ((SmallIntSet) set).bitSet; this.bitSet = new BitSet(bitSet.size()); this.bitSet.or(bitSet); } else if (set instanceof IntSet) { this.bitSet = new BitSet(); ((IntSet) set).forEach((IntConsumer) bitSet::set); } else { bitSet = new BitSet(set.size()); set.forEach(bitSet::set); } }
Source:
<code>public Optional<Instant> nextRun(final Optional<Instant> lastRun) { final Instant now = _clock.instant(); final Instant start = lastRun .filter(run -> run.isAfter(now)) .orElse(now) <START> .plus(_fullPeriod); END> final long excessMillis = start.toEpochMilli() % _fullPeriod.toMillis(); return Optional.of(start.minusMillis(excessMillis)); }</code><technical_language>this behavior is initial delay of _fullPeriod</technical_language>

Target:
public Optional<Instant> nextRun(final Optional<Instant> lastRun) { final Instant now = _clock.instant(); final Instant nextRun = truncateToPeriod(now).plus(_fullPeriod); lastRun.ifPresent(run -> checkForSkippedPeriods(run, nextRun)); return Optional.of(nextRun); }
Source:
<code>public <E> void assertNoneSatisfy(AssertionInfo info, Iterable<? extends E> actual, Consumer<? super E> requirements) { assertNotNull(info, actual); requireNonNull(requirements, "The Consumer<T> expressing the assertions requirements must not be null"); <START> boolean nonMatch = stream(actual.spliterator(), false).noneMatch(e -> { <END> try { requirements.accept(e); } catch (AssertionError ex) { return false; } return true; }); if (!nonMatch) { throw failures.failure(info, noneElementsShouldSatisfy(actual)); } }</code><technical_language>anyMatch find elements matching requirements (if any), simplify code a lot</technical_language>

Target:
public <E> void assertNoneSatisfy(AssertionInfo info, Iterable<? extends E> actual, Consumer<? super E> requirements) { assertNotNull(info, actual); requireNonNull(requirements, "The Consumer<T> expressing the assertions requirements must not be null"); for(E element : actual) { try { requirements.accept(element); } catch(AssertionError e) { return; } } throw failures.failure(info, noElementsShouldSatisfy(actual)); }
Source:
<code>private void resetToolBarsCActions(List<Action> actions) { Map<String,CLocation> lastToolBarLocation = new HashMap<String, CLocation>(); ToolBarActions toolBarCActions = new ToolBarActions(); toolBarCActions.setActions(actions); List<CAction> rootActions = toolBarCActions.getCustomActions(); Map<String,CAction> actionMap = new HashMap<String, CAction>(rootActions.size()); <START> List<String> generatedId = new LinkedList(); <END> for(CAction action : rootActions) { if(action instanceof CActionHolder) { String key = ActionTools.getMenuId(((CActionHolder) action).getAction()); actionMap.put(key,action); generatedId.add(key); } else { } } for(ToolBarItem item : getToolBarItems()) { String shownRootMenuId = ActionTools.getMenuId(item.getAction()); CAction newCAction = actionMap.get(shownRootMenuId); if(newCAction==null) { commonControl.removeSingleDockable(shownRootMenuId); } else { generatedId.remove(shownRootMenuId); item.setItem(newCAction); } } for(String newActionId : generatedId) { CAction newCAction = actionMap.get(newActionId); Action action = ((CActionHolder)newCAction).getAction(); String logicalGroup = ActionTools.getLogicalGroup(action); CLocation defaultLocation = getDefaultLocation(lastToolBarLocation, logicalGroup); lastToolBarLocation.put(logicalGroup,defaultLocation); addToolbarItem(newCAction, action, defaultLocation); } }</code><technical_language>add, search in this list. contains String instances presented HashSet<String>. work if need of order access data. If need guarantees, a LinkedHashSet<String>. consider need performances</technical_language>

Target:
private void resetToolBarsCActions(List<Action> actions) { Map<String,CLocation> lastToolBarLocation = new HashMap<String, CLocation>(); ToolBarActions toolBarCActions = new ToolBarActions(); toolBarCActions.setActions(actions); List<CAction> rootActions = toolBarCActions.getCustomActions(); Map<String,CAction> actionMap = new HashMap<String, CAction>(rootActions.size()); Set<String> generatedId = new LinkedHashSet<String>(); for(CAction action : rootActions) { if(action instanceof CActionHolder) { String key = ActionTools.getMenuId(((CActionHolder) action).getAction()); actionMap.put(key,action); generatedId.add(key); } else { } } for(ToolBarItem item : getToolBarItems()) { String shownRootMenuId = ActionTools.getMenuId(item.getAction()); CAction newCAction = actionMap.get(shownRootMenuId); if(newCAction==null) { commonControl.removeSingleDockable(shownRootMenuId); } else { generatedId.remove(shownRootMenuId); item.setItem(newCAction); } } for(String newActionId : generatedId) { CAction newCAction = actionMap.get(newActionId); Action action = ((CActionHolder)newCAction).getAction(); String logicalGroup = ActionTools.getLogicalGroup(action); CLocation defaultLocation = getDefaultLocation(lastToolBarLocation, logicalGroup); lastToolBarLocation.put(logicalGroup,defaultLocation); addToolbarItem(newCAction, action, defaultLocation); } }
Source:
<code>public ContentValues getContentValues(Externalizable e) throws StorageFullException { boolean encrypt = e instanceof EncryptedModel; ByteArrayOutputStream bos = new ByteArrayOutputStream(); OutputStream out = bos; try { e.writeExternal(new DataOutputStream(out)); out.close(); } catch (IOException e1) { e1.printStackTrace(); throw new RuntimeException("Failed to serialize externalizable for content values"); } byte[] blob = bos.toByteArray(); ContentValues values = new ContentValues(); if(e instanceof IMetaData) { IMetaData m = (IMetaData)e; for(String key : m.getMetaDataFields()) { Object o = m.getMetaData(key); if(o == null ) { continue;} String value = o.toString(); values.put(TableBuilder.scrubName(key), value); } } <START> if(blob.length > 1000000){ <END> throw new StorageFullException("You tried to restore some data sized " + (blob.length / 1000000) + " MB which exceeds" + "the maximum allowed size of 1MB. Please reduce the size of this fixture."); } values.put(DbUtil.DATA_COL,blob); return values; }</code><technical_language>This 1024 ^ 2, right</technical_language>

Target:
public ContentValues getContentValues(Externalizable e) throws RecordTooLargeException { boolean encrypt = e instanceof EncryptedModel; ByteArrayOutputStream bos = new ByteArrayOutputStream(); OutputStream out = bos; try { e.writeExternal(new DataOutputStream(out)); out.close(); } catch (IOException e1) { e1.printStackTrace(); throw new RuntimeException("Failed to serialize externalizable for content values"); } byte[] blob = bos.toByteArray(); ContentValues values = new ContentValues(); if(e instanceof IMetaData) { IMetaData m = (IMetaData)e; for(String key : m.getMetaDataFields()) { Object o = m.getMetaData(key); if(o == null ) { continue;} String value = o.toString(); values.put(TableBuilder.scrubName(key), value); } } if(blob.length > Math.pow(1024, 2)){ throw new RecordTooLargeException(blob.length / Math.pow(1024, 2)); } values.put(DbUtil.DATA_COL,blob); return values; }
Source:
<code>public Response refreshPaymentMethods(@PathParam("accountId") final String accountId, @QueryParam(QUERY_PAYMENT_PLUGIN_NAME) final String pluginName, @QueryParam(QUERY_PLUGIN_PROPERTY) final List<String> pluginPropertiesString, @HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_COMMENT) final String comment, @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException, PaymentApiException { final Iterable<PluginProperty> pluginProperties = extractPluginProperties(pluginPropertiesString); final CallContext callContext = context.createContext(createdBy, reason, comment, request); final Account account = accountUserApi.getAccountById(UUID.fromString(accountId), callContext); <START> paymentApi.refreshPaymentMethods(account, pluginName, pluginProperties, callContext); <END> return Response.status(Status.OK).build(); }</code><technical_language>If pluginName is null, need call other refreshPaymentMethods API</technical_language>

Target:
public Response refreshPaymentMethods(@PathParam("accountId") final String accountId, @QueryParam(QUERY_PAYMENT_PLUGIN_NAME) final String pluginName, @QueryParam(QUERY_PLUGIN_PROPERTY) final List<String> pluginPropertiesString, @HeaderParam(HDR_CREATED_BY) final String createdBy, @HeaderParam(HDR_REASON) final String reason, @HeaderParam(HDR_COMMENT) final String comment, @javax.ws.rs.core.Context final HttpServletRequest request) throws AccountApiException, PaymentApiException { final Iterable<PluginProperty> pluginProperties = extractPluginProperties(pluginPropertiesString); final CallContext callContext = context.createContext(createdBy, reason, comment, request); final Account account = accountUserApi.getAccountById(UUID.fromString(accountId), callContext); if (pluginName != null && !pluginName.isEmpty()) { paymentApi.refreshPaymentMethods(account, pluginName, pluginProperties, callContext); } else { paymentApi.refreshPaymentMethods(account, pluginProperties, callContext); } return Response.status(Status.OK).build(); }
Source:
<code>public <T> T[] toObjectArray(LogicalType elementType) { Class<T> elementClass = (Class<T>) LogicalTypeUtils.toInternalConversionClass(elementType); T[] values = (T[]) Array.newInstance(elementClass, size); for (int i = 0; i < size; i++) { if (!isNullAt(i)) { <START> ArrayData.ElementGetter elementGetter = ArrayData.createElementGetter(elementType); <END> values[i] = (T) elementGetter.getElementOrNull(this, i); } } return values; }</code><technical_language>elementGetter out of for loop</technical_language>

Target:
public <T> T[] toObjectArray(LogicalType elementType) { Class<T> elementClass = (Class<T>) LogicalTypeUtils.toInternalConversionClass(elementType); ArrayData.ElementGetter elementGetter = ArrayData.createElementGetter(elementType); T[] values = (T[]) Array.newInstance(elementClass, size); for (int i = 0; i < size; i++) { if (!isNullAt(i)) { values[i] = (T) elementGetter.getElementOrNull(this, i); } } return values; }
Source:
<code>@Test public void testEliminateCommonExprInCondition() { RexSimplify rexSimplify = new RexSimplify(rexBuilder, RelOptPredicateList.EMPTY, EXECUTOR); RexNode or1 = or( and(vBool(0), vBool(1)), and(vBool(0), vBool(1), vBool(2)) ); <START> RexNode orSimplified2 = rexSimplify.eliminateCommonExprInCondition(or1); <END> checkDigest(orSimplified2, "AND(?0.bool0, ?0.bool1)"); RexNode or2 = or( and(vBool(0), vBool(1)), and(vBool(0), vBool(2)), and(vBool(0), vBool(3)) ); RexNode orSimplified1 = rexSimplify.eliminateCommonExprInCondition(or2); checkDigest(orSimplified1, "AND(?0.bool0, OR(?0.bool1, ?0.bool2, ?0.bool3))"); RexNode and1 = and( or(vBool(0), vBool(1)), or(vBool(0), vBool(1), vBool(2)) ); RexNode andSimplified1 = rexSimplify.eliminateCommonExprInCondition(and1); checkDigest(andSimplified1, "OR(?0.bool0, ?0.bool1)"); RexNode and2 = and( or(vBool(0), vBool(1), vBool(2)), or(vBool(0), vBool(3), vBool(4)) ); RexNode andSimplified2 = rexSimplify.eliminateCommonExprInCondition(and2); checkDigest(andSimplified2, "OR(?0.bool0, AND(OR(?0.bool1, ?0.bool2), OR(?0.bool3, ?0.bool4)))"); }</code><technical_language>minor: I guess this named orSimplified1 (and in line 3182 orSimplified2)</technical_language>

Target:
@Test public void testEliminateCommonExprInCondition() { RexSimplify rexSimplify = new RexSimplify(rexBuilder, RelOptPredicateList.EMPTY, EXECUTOR); RexNode or1 = or( and(vBool(0), vBool(1)), and(vBool(0), vBool(1), vBool(2)) ); RexNode orSimplified1 = rexSimplify.eliminateCommonExprInCondition(or1); checkDigest(orSimplified1, "AND(?0.bool0, ?0.bool1)"); RexNode or2 = or( and(vBool(0), vBool(1)), and(vBool(0), vBool(2)), and(vBool(0), vBool(3)) ); RexNode orSimplified2 = rexSimplify.eliminateCommonExprInCondition(or2); checkDigest(orSimplified2, "AND(?0.bool0, OR(?0.bool1, ?0.bool2, ?0.bool3))"); RexNode and1 = and( or(vBool(0), vBool(1)), or(vBool(0), vBool(1), vBool(2)) ); RexNode andSimplified1 = rexSimplify.eliminateCommonExprInCondition(and1); checkDigest(andSimplified1, "OR(?0.bool0, ?0.bool1)"); RexNode and2 = and( or(vBool(0), vBool(1), vBool(2)), or(vBool(0), vBool(3), vBool(4)) ); RexNode andSimplified2 = rexSimplify.eliminateCommonExprInCondition(and2); checkDigest(andSimplified2, "OR(?0.bool0, AND(OR(?0.bool1, ?0.bool2), OR(?0.bool3, ?0.bool4)))"); }
Source:
<code>public Aggregator factorize(ColumnSelectorFactory metricFactory) { <START> return null; <END> }</code><technical_language>I thinks this method return null. Please throw UnsupportedOperationException instead</technical_language>

Target:
public Aggregator factorize(ColumnSelectorFactory metricFactory) throws UnsupportedOperationException { throw new UnsupportedOperationException("Invalid operation for AveragerFactoryWrapper."); }
Source:
<code>public boolean setTrace(@NonNull ITmfTrace trace) throws TmfAnalysisException { boolean ret = super.setTrace(trace); if (!ret) { return ret; } ret = fCriticalPathModule.setTrace(trace); <START> fCriticalPathModule.setParameter(CriticalPathModule.PARAM_GRAPH, getId()); <END> return ret; }</code><technical_language>this set if ret is false? I know</technical_language>

Target:
public boolean setTrace(@NonNull ITmfTrace trace) throws TmfAnalysisException { boolean ret = super.setTrace(trace); if (!ret) { return ret; } ret = fCriticalPathModule.setTrace(trace); if (ret) { fCriticalPathModule.setParameter(CriticalPathModule.PARAM_GRAPH, getId()); } return ret; }
Source:
<code><START> static <E, T> Validation<E, Seq<T>> sequence(Iterable<? extends Validation<E, T>> values) { <END> Objects.requireNonNull(values, "values is null"); List<E> errors = List.empty(); List<T> list = List.empty(); for (Validation<E, T> value : values) { if (value.isInvalid()) { Seq<? extends E> otherErrors = value.getErrors().reverse(); errors = errors.prependAll(otherErrors); } else if (errors.isEmpty()) { list = list.prepend(value.get()); } } return errors.isEmpty() ? valid(list.reverse()) : invalid(errors.reverse()); }</code><technical_language>I generics. java sequence(Iterable<? extends Validation<? extends E, ? extends T>> values) (see Either.sequence for example)</technical_language>

Target:
static <E, T> Validation<E, Seq<T>> sequence(Iterable<? extends Validation<E, T>> values) { Objects.requireNonNull(values, "values is null"); List<E> errors = List.empty(); List<T> list = List.empty(); for (Validation<E, T> value : values) { if (value.isInvalid()) { errors = errors.prependAll(value.getErrors().reverse()); } else if (errors.isEmpty()) { list = list.prepend(value.get()); } } return errors.isEmpty() ? valid(list.reverse()) : invalid(errors.reverse()); }
Source:
<code>public final static String tupleName(final int arity) { StringBuilder out = new StringBuilder(); out.append('('); for (int n = 1; n < arity; n++) { out.append(','); } out.append('('); <START> return out.toString(); <END> }</code><technical_language>Alternatively, String.format("(%s)", Strings.repeat(",", arity));</technical_language>

Target:
public final static String tupleName(final int arity) { return String.format("(%s)", Strings.repeat(",", arity)); }