auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void downloadBlob(BlobId blobId, OutputStream outputStream) throws CloudStorageException { azureMetrics.blobDownloadRequestCount.inc(); Timer.Context storageTimer = azureMetrics.blobDownloadTime.time(); try { CloudBlobContainer azureContainer = getContainer(blobId, false); String azureBlobName = getAzureBlobName(blobId); CloudBlockBlob azureBlob = azureContainer.getBlockBlobReference(azureBlobName); azureBlob.download(outputStream); azureMetrics.blobUploadSuccessCount.inc(); } catch (URISyntaxException | StorageException e) { <START> throw new CloudStorageException("Error donwloading blob " + blobId, e); <END> } finally { storageTimer.stop(); } }</code><technical_language>typo . donwloading--> downloading</technical_language>

Target:
public void downloadBlob(BlobId blobId, OutputStream outputStream) throws CloudStorageException { azureMetrics.blobDownloadRequestCount.inc(); Timer.Context storageTimer = azureMetrics.blobDownloadTime.time(); try { CloudBlockBlob azureBlob = getAzureBlobReference(blobId); azureBlob.download(outputStream); azureMetrics.blobDownloadSuccessCount.inc(); } catch (URISyntaxException | StorageException e) { azureMetrics.blobDownloadErrorCount.inc(); throw new CloudStorageException("Error downloading blob " + blobId, e); } finally { storageTimer.stop(); } }
Source:
<code>public void estimateVoterMatchStrengths_for_DocOrgRelationMatcher() throws IOException { createInputDataFromJsonFiles( <START> ImmutableList.of("src/test/resources/experimentalData/input/all_organizations.json"), <END> ImmutableList.of("src/test/resources/experimentalData/input/set4/docs_with_aff_real_data.json"), ImmutableList.of("src/test/resources/experimentalData/input/set4/doc_project.json"), ImmutableList.of(), ImmutableList.of("src/test/resources/experimentalData/input/set4/org_project.json")); AffOrgMatcher affOrgMatcher = createDocOrgRelationMatcher(sparkContext, inputDocProjDirPath, inputInferredDocProjDirPath, inputProjOrgDirPath, inputDocProjConfidenceThreshold); List<AffOrgMatchVoter> voters = createDocOrgRelationMatcherVoters(); estimateVoterMatchStrengths(affOrgMatcher, "Doc-Org Relation Matcher", voters, ImmutableList.of("src/test/resources/experimentalData/expectedOutput/set4/matched_aff.json")); }</code><technical_language>src/test/resources/experimentalData/input/ base path appears in 42 places in affmatch tests, consider extracting this root path some shared test variable</technical_language>

Target:
public void estimateVoterMatchStrengths_for_DocOrgRelationMatcher() throws IOException { createInputDataFromJsonFiles( ImmutableList.of(INPUT_DATA_DIR_PATH + "/all_organizations.json"), ImmutableList.of(INPUT_DATA_DIR_PATH + "/set4/docs_with_aff_real_data.json"), ImmutableList.of(INPUT_DATA_DIR_PATH + "/set4/doc_project.json"), ImmutableList.of(), ImmutableList.of(INPUT_DATA_DIR_PATH + "/set4/org_project.json")); AffOrgMatcher affOrgMatcher = createDocOrgRelationMatcher(sparkContext, inputDocProjDirPath, inputInferredDocProjDirPath, inputProjOrgDirPath, inputDocProjConfidenceThreshold); List<AffOrgMatchVoter> voters = createDocOrgRelationMatcherVoters(); estimateVoterMatchStrengths(affOrgMatcher, "Doc-Org Relation Matcher", voters, ImmutableList.of("src/test/resources/experimentalData/expectedOutput/set4/matched_aff.json")); }
Source:
<code><START> public final String getFileStem() <END> { return Pattern .create("/((?:[^/]|\\\\/)+?)\\.rstheme$") .match(getUrl(), 0) .getGroup(1); }</code><technical_language>This done FileSystemItem.getStem(). If want a one-shot function instead, create in FilePathUtils for reuse</technical_language>

Target:
public final String getFileStem() { return FileSystemItem.createFile(this.getUrl()).getStem(); }
Source:
<code>public String showForm(@RequestParam(required = false, value = "userId") Integer userId, @RequestParam(required = false, value = "createNewPerson") String createNewPerson, @ModelAttribute("user") User user, ModelMap model) { model.addAttribute("isNewUser", isNewUser(user)); if (isNewUser(user) || Context.hasPrivilege(PrivilegeConstants.EDIT_USER_PASSWORDS)) { model.addAttribute("modifyPasswords", true); } if (createNewPerson != null) { model.addAttribute("createNewPerson", createNewPerson); } if (!isNewUser(user)) { model.addAttribute("changePassword", new UserProperties(user.getUserProperties()).isSupposedToChangePassword()); model.addAttribute("secretQuestion", userService.getSecretQuestion(user)); } <START> Collection<Provider> col = Context.getProviderService().getProvidersByPerson(user.getPerson()); <END> System.out.println(Context.getProviderService().getProvidersByPerson(user.getPerson()).isEmpty()); if (user.getPerson().getId() != null && !Context.getProviderService().getProvidersByPerson(user.getPerson()).isEmpty()) { model.addAttribute("isProvider", true); } else { model.addAttribute("isProvider", false); } return "module/legacyui/admin/users/userForm"; }</code><technical_language>Get rid of this</technical_language>

Target:
public String showForm( @RequestParam(required = false, value = "userId") Integer userId, @RequestParam(required = false, value = "createNewPerson") String createNewPerson, @ModelAttribute("user") User user, ModelMap model) { model.addAttribute("isNewUser", isNewUser(user)); if (isNewUser(user) || Context.hasPrivilege(PrivilegeConstants.EDIT_USER_PASSWORDS)) { model.addAttribute("modifyPasswords", true); } if (createNewPerson != null) { model.addAttribute("createNewPerson", createNewPerson); } if (!isNewUser(user)) { model.addAttribute("changePassword", new UserProperties(user.getUserProperties()).isSupposedToChangePassword()); model.addAttribute("secretQuestion", userService.getSecretQuestion(user)); } if (user.getPerson().getId() != null && !Context.getProviderService().getProvidersByPerson(user.getPerson()).isEmpty()) { model.addAttribute("isProvider", true); model.addAttribute("providerList", Context.getProviderService().getProvidersByPerson(user.getPerson())); } else { model.addAttribute("isProvider", false); } return "module/legacyui/admin/users/userForm"; }
Source:
<code>public void testLeaderInConnectingFollowers() throws Exception { File tmpDir = File.createTempFile("test", "dir", testData); tmpDir.delete(); tmpDir.mkdir(); Leader leader = null; try { <START> QuorumPeer peer = ZabUtils.createQuorumPeer(tmpDir); <END> leader = ZabUtils.createLeader(tmpDir, peer); peer.leader = leader; peer.setAcceptedEpoch(5); FollowerMockThread f1 = new FollowerMockThread(1, leader, true); FollowerMockThread f2 = new FollowerMockThread(2, leader, true); f1.start(); f2.start(); f1.join(leader.self.getInitLimit()*leader.self.getTickTime() + 5000); f2.join(leader.self.getInitLimit()*leader.self.getTickTime() + 5000); try { long epoch = leader.getEpochToPropose(leader.self.getId(), leader.self.getAcceptedEpoch()); Assert.assertEquals("leader got wrong epoch from getEpochToPropose", 6, epoch); } catch (Exception e){ Assert.fail("leader timed out in getEpochToPropose"); } } finally { if (leader != null) { leader.shutdown("end of test"); } recursiveDelete(tmpDir); } }</code><technical_language>import static org.apache.zookeeper.server.quorum. ZabUtil.* simplify method invocation createQuorumPeer(tmpDir); instead of ZabUtils.createQuorumPeer(tmpDir);</technical_language>

Target:
public void testLeaderInConnectingFollowers() throws Exception { File tmpDir = File.createTempFile("test", "dir", testData); tmpDir.delete(); tmpDir.mkdir(); Leader leader = null; try { QuorumPeer peer = createQuorumPeer(tmpDir); leader = createLeader(tmpDir, peer); peer.leader = leader; peer.setAcceptedEpoch(5); FollowerMockThread f1 = new FollowerMockThread(1, leader, true); FollowerMockThread f2 = new FollowerMockThread(2, leader, true); f1.start(); f2.start(); f1.join(leader.self.getInitLimit()*leader.self.getTickTime() + 5000); f2.join(leader.self.getInitLimit()*leader.self.getTickTime() + 5000); try { long epoch = leader.getEpochToPropose(leader.self.getId(), leader.self.getAcceptedEpoch()); Assert.assertEquals("leader got wrong epoch from getEpochToPropose", 6, epoch); } catch (Exception e){ Assert.fail("leader timed out in getEpochToPropose"); } } finally { if (leader != null) { leader.shutdown("end of test"); } recursiveDelete(tmpDir); } }
Source:
<code>public void destroy() { <START> this.gatewayMap.values().forEach(gw -> gw.destroy()); <END> }</code><technical_language>suggestion this.gatewayMap.values().forEach(MethodInvocationGateway::destroy); do live this before? consider back-port a bug? is a consequence this destroy()</technical_language>

Target:
public void destroy() { this.gatewayMap.values().forEach(MethodInvocationGateway::destroy); }
Source:
<code>public static void buildFixtureIndices(SQLiteDatabase database, String tableName, Set<String> indices) { try { database.beginTransaction(); for (String index : indices) { String indexName = index + "_index"; <START> if (index.contains(",")) { <END> indexName = index.replaceAll(",", "_") + "_index"; } String indexStmt = DatabaseAppOpenHelper.indexOnTableCommand(indexName, tableName, index); database.execSQL(indexStmt); } database.setTransactionSuccessful(); } finally { database.endTransaction(); } }</code><technical_language>This a good candidate split out some smaller methods clarify</technical_language>

Target:
public static void buildFixtureIndices(SQLiteDatabase database, String tableName, Set<String> indices) { try { database.beginTransaction(); for (String indexStmt : DatabaseIndexingUtils.getIndexStatements(tableName, indices)) { database.execSQL(indexStmt); } database.setTransactionSuccessful(); } finally { database.endTransaction(); } }
Source:
<code>public ArchaiusModule withApplicationOverrides(Config config) { try { <START> applicationLayer.addConfig(getUniqueName("override-"), config); <END> } catch (ConfigException e) { throw new ProvisionException("Failed to add application overrides" , e); } return this; }</code><technical_language>delete "-" if is longer a trailing counter</technical_language>

Target:
public ArchaiusModule withApplicationOverrides(Config config) { try { applicationLayer.addConfig(getUniqueName("override"), config); } catch (ConfigException e) { throw new ProvisionException("Failed to add application overrides" , e); } return this; }
Source:
<code>public boolean retainAll(final Collection<?> c) { if (size < 1) { return false; } final IdentityHashMap<Object, Object> toKeep = new IdentityHashMap<Object, Object>(); for (Object o : c) { <START> if (indexOf(o) > 0) { <END> toKeep.put(o, o); } } if (toKeep.size() == size) { return false; } for (int i = 0; i < size; i++) { if(!toKeep.containsKey(get(i))) { remove(i); } } return true; }</code><technical_language>this >=? consider calling contains() instead</technical_language>

Target:
public boolean retainAll(final Collection<?> c) { if (size < 1) { return false; } final Map<Object,Object> toRetain = new IdentityHashMap<Object,Object>(); for (Object o : c) { toRetain.put(o, null); } final List<IonValue> toRemove = new ArrayList<IonValue>(size - c.size()); for (int i = 0; i < size; i++) { final IonValue ionValue = get(i); if (!toRetain.containsKey(ionValue)) { toRemove.add(ionValue); } } return removeAll(toRemove); }
Source:
<code><START> public static UnixResolverOptions.Builder newBuilder() { <END> return new UnixResolverOptions.Builder(); }</code><technical_language>nit: of methods package-private class is package-private well. This ensures expose mistake some point</technical_language>

Target:
static UnixResolverOptions.Builder newBuilder() { return new UnixResolverOptions.Builder(); }
Source:
<code>private long updateWaterMark(int reqNewLowWater, int reqNewHighWater) { assert reqNewLowWater != -1 || reqNewHighWater != -1; assert reqNewLowWater == -1 || reqNewHighWater == -1 || reqNewLowWater <= reqNewHighWater; long oldVal, newVal; int oldHighWater, oldLowWater; int newLowWater, newHighWater; do { oldVal = connectionStatus; oldLowWater = getLowWater(oldVal); oldHighWater = getHighWater(oldVal); newLowWater = reqNewLowWater == -1 ? oldLowWater : reqNewLowWater; newHighWater = reqNewHighWater == -1 ? oldHighWater : reqNewHighWater; if (reqNewLowWater != -1 && newLowWater > newHighWater) { newHighWater = newLowWater; } else if (reqNewHighWater != -1 && newHighWater < newLowWater) { newLowWater = newHighWater; } if (oldLowWater == newLowWater && oldHighWater == newHighWater) { return oldVal; } newVal = (long)newLowWater << CONN_LOW_BIT | (long)newHighWater << CONN_HIGH_BIT; } while (! connectionStatusUpdater.compareAndSet(this, oldVal, newVal)); getIoThread().execute(new Runnable() { @Override public void run() { if(openConnections >= getHighWater(connectionStatus)) { synchronized (QueuedNioTcpServer.this) { suspendedDueToWatermark = true; } } else if(suspendedDueToWatermark && openConnections <= getLowWater(connectionStatus)) { <START> synchronized (QueuedNioTcpServer.this) { <END> suspendedDueToWatermark = false; } } } }); return oldVal; }</code><technical_language>field is volatile; is a specific problem adding synchronization solves</technical_language>

Target:
private long updateWaterMark(int reqNewLowWater, int reqNewHighWater) { assert reqNewLowWater != -1 || reqNewHighWater != -1; assert reqNewLowWater == -1 || reqNewHighWater == -1 || reqNewLowWater <= reqNewHighWater; long oldVal, newVal; int oldHighWater, oldLowWater; int newLowWater, newHighWater; do { oldVal = connectionStatus; oldLowWater = getLowWater(oldVal); oldHighWater = getHighWater(oldVal); newLowWater = reqNewLowWater == -1 ? oldLowWater : reqNewLowWater; newHighWater = reqNewHighWater == -1 ? oldHighWater : reqNewHighWater; if (reqNewLowWater != -1 && newLowWater > newHighWater) { newHighWater = newLowWater; } else if (reqNewHighWater != -1 && newHighWater < newLowWater) { newLowWater = newHighWater; } if (oldLowWater == newLowWater && oldHighWater == newHighWater) { return oldVal; } newVal = (long)newLowWater << CONN_LOW_BIT | (long)newHighWater << CONN_HIGH_BIT; } while (! connectionStatusUpdater.compareAndSet(this, oldVal, newVal)); getIoThread().execute(new Runnable() { @Override public void run() { if(openConnections >= getHighWater(connectionStatus)) { synchronized (QueuedNioTcpServer.this) { suspendedDueToWatermark = true; tcpServerLog.logf(FQCN, Logger.Level.DEBUG, null, "Total open connections reach high water limit (%s) after updating water mark", getHighWater(connectionStatus)); } } else if(suspendedDueToWatermark && openConnections <= getLowWater(connectionStatus)) { suspendedDueToWatermark = false; } } }); return oldVal; }
Source:
<code>@Override public void onConfigurationOpen( HadoopConfiguration hadoopConfiguration, boolean defaultConfiguration ) { try { shimBridgingServiceTracker.registerWithClassloader( hadoopConfiguration, NamedClusterServiceFactory.class, SHIMCONFIG_SERVICE_FACTORY_CANONICAL_NAME, bundleContext, hadoopConfiguration.getHadoopShim().getClass().getClassLoader(), new Class<?>[] { boolean.class, HadoopConfiguration.class }, new Object[] { defaultConfiguration, hadoopConfiguration } ); } catch ( Exception e ) { <START> LOGGER.error( "Unable to register " + hadoopConfiguration.getIdentifier() + " shim", e ); <END> } }</code><technical_language>this need change a more specific Exception</technical_language>

Target:
@Override public void onConfigurationOpen( HadoopConfiguration hadoopConfiguration, boolean defaultConfiguration ) { try { shimBridgingServiceTracker.registerWithClassloader( hadoopConfiguration, NamedClusterServiceFactory.class, SHIMCONFIG_SERVICE_FACTORY_CANONICAL_NAME, bundleContext, hadoopConfiguration.getHadoopShim().getClass().getClassLoader(), new Class<?>[] { boolean.class, HadoopConfiguration.class }, new Object[] { defaultConfiguration, hadoopConfiguration } ); } catch ( Exception e ) { LOGGER.error( BaseMessages.getString( JaasConfigServiceLoader.class, "jaas.config.service.load.error", hadoopConfiguration.getIdentifier() ) ); } }
Source:
<code>public void testV2FetchWantRefIfNotAllowed() throws Exception { RevCommit one = remote.commit().message("1").create(); remote.update("one", one); <START> thrown.expect(PackProtocolException.class); <END> thrown.expectMessage("unexpected want-ref refs/heads/one"); uploadPackV2( "command=fetch\n", PacketLineIn.DELIM, "want-ref refs/heads/one\n", "done\n", PacketLineIn.END); }</code><technical_language>I tend prefer more explicit style try { ... } catch (PackProtocolException e) { assertThat(e.getMessage(), is(...)); } fail("expected PackProtocolException"); better, JUnit assertThrows: PackProtocolException e = assertThrows( PackProtocolException.class, () -> ...); assertThat(e.getMessage(), is(...));</technical_language>

Target:
public void testV2FetchWantRefIfNotAllowed() throws Exception { RevCommit one = remote.commit().message("1").create(); remote.update("one", one); try { uploadPackV2( "command=fetch\n", PacketLineIn.DELIM, "want-ref refs/heads/one\n", "done\n", PacketLineIn.END); } catch (PackProtocolException e) { assertThat( e.getMessage(), containsString("unexpected want-ref refs/heads/one")); return; } fail("expected PackProtocolException"); }
Source:
<code>private static String resolvePathParameters(final String basePath, final String classPathAnnotation, final String methodPathAnnotation, final Map<String, Object> pathParameterValues) { final UriBuilder builder = UriBuilder.fromUri(basePath); if (classPathAnnotation != null && !classPathAnnotation.equals("")) { builder.path(classPathAnnotation); } if (methodPathAnnotation != null && !methodPathAnnotation.equals("")) { builder.path(methodPathAnnotation); } String returnUri = null; Map<String, Object> parameters = pathParameterValues; if (parameters == null) { <START> parameters = new HashMap<>(); <END> } final URI resolvedUri = builder.buildFromMap(parameters); if (resolvedUri != null) { returnUri = resolvedUri.toString(); } log.warn("Could not build a path URI for basePath={}", basePath); return returnUri; }</code><technical_language>I motivation for this change. handle case input parameter pathParameterValues is null, caller path parameters. Fine, caller simple send new HashMap<>() instead of null? This way, risk of changing this method in core. I this caller doing</technical_language>

Target:
private static String resolvePathParameters(final String basePath, final String classPathAnnotation, final String methodPathAnnotation, final Map<String, Object> pathParameterValues) { final UriBuilder builder = UriBuilder.fromUri(basePath); if (classPathAnnotation != null && !classPathAnnotation.equals("")) { builder.path(classPathAnnotation); } if (methodPathAnnotation != null && !methodPathAnnotation.equals("")) { builder.path(methodPathAnnotation); } final URI resolvedUri = builder.buildFromMap(pathParameterValues); if (resolvedUri != null) { return resolvedUri.toString(); } log.warn("Could not build a path URI for basePath={} and path annotations (class='{}',method='{}')", basePath, classPathAnnotation, methodPathAnnotation ); return null; }
Source:
<code><START> public void testNonSerializableParentConstructor() throws Exception { <END> final MarshallerFactory factory = new RiverMarshallerFactory(); final MarshallingConfiguration configuration = new MarshallingConfiguration(); final Marshaller marshaller = factory.createMarshaller(configuration); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); marshaller.start(Marshalling.createByteOutput(baos)); final MySerializable input = new MySerializable("test"); assertTrue("Sanity check failed", input.is_mutable_one()); marshaller.writeObject(input); marshaller.finish(); final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray()); final Unmarshaller unmarshaller = factory.createUnmarshaller(configuration); unmarshaller.start(Marshalling.createByteInput(bais)); final MySerializable result = unmarshaller.readObject(MySerializable.class); assertTrue("JBMAR-221: NonSerializableParent constructor was not executed", result.is_mutable_one()); unmarshaller.finish(); }</code><technical_language>test follow format of others in file. If is a configuration for test is valid, test skipped for configuration</technical_language>

Target:
public void testNonSerializableParentConstructor() throws Throwable { runReadWriteTest(new ReadWriteTest() { @Override public void runWrite(Marshaller marshaller) throws Throwable { final MySerializable input = new MySerializable("test"); assertTrue("Sanity check failed", input.is_mutable_one()); marshaller.writeObject(input); } @Override public void runRead(Unmarshaller unmarshaller) throws Throwable { final MySerializable result = unmarshaller.readObject(MySerializable.class); assertTrue("JBMAR-221: NonSerializableParent constructor was not executed", result.is_mutable_one()); } }); }
Source:
<code>public static void createJob() throws IOException { String projectId = "your-project-id"; String tenantId = "your-tenant-id"; String companyId = "your-company-id"; String requisitionId = "your-unique-req-id"; <START> String title = "your-job-title"; String description = "your-job-description"; String jobApplicationUrl = "your-job-url"; String addressOne = "your-job-address-1"; String addressTwo = "your-job-address-2"; String languageCode = "your-lang-code"; <END> createJob( projectId, tenantId, companyId, requisitionId, title, description, jobApplicationUrl, addressOne, addressTwo, languageCode); }</code><technical_language>inline of these</technical_language>

Target:
public static void createJob() throws IOException { String projectId = "your-project-id"; String tenantId = "your-tenant-id"; String companyId = "your-company-id"; String requisitionId = "your-unique-req-id"; String jobApplicationUrl = "your-job-url"; createJob(projectId, tenantId, companyId, requisitionId, jobApplicationUrl); }
Source:
<code>public void updateCallback(Map<String, Object> properties) { synchronized (lock) { <START> if (properties != null) { <END> setMonitoredDirectoryPath((String) properties.get("monitoredDirectoryPath")); setProcessingMechanism((String) properties.get("processingMechanism")); setNumThreads((Integer) properties.get("numThreads")); setReadLockIntervalMilliseconds((Integer) properties.get("readLockIntervalMilliseconds")); String[] parameterArray = (String[]) properties.get(Constants.ATTRIBUTE_OVERRIDES_KEY); if (parameterArray != null) { setAttributeOverrides(Arrays.asList(parameterArray)); } destroy(0); destroyed.set(false); init(); } } }</code><technical_language>Move if(...) of lock</technical_language>

Target:
public void updateCallback(Map<String, Object> properties) { if (properties != null) { setMonitoredDirectoryPath((String) properties.get("monitoredDirectoryPath")); setProcessingMechanism((String) properties.get("processingMechanism")); setNumThreads((Integer) properties.get("numThreads")); setReadLockIntervalMilliseconds((Integer) properties.get("readLockIntervalMilliseconds")); String[] parameterArray = (String[]) properties.get(Constants.ATTRIBUTE_OVERRIDES_KEY); if (parameterArray != null) { setAttributeOverrides(Arrays.asList(parameterArray)); } destroy(0); init(); } }
Source:
<code>private Object[] getTagsChildren(TagsNode parentNode, Repository repo) { List<RepositoryTreeNode<?>> nodes = new ArrayList<>(); try (RevWalk walk = new RevWalk(repo)) { walk.setRetainBody(true); String filterText = filters != null ? filters.get(parentNode) : null; NodesByCommitTimeFilter timeFilter = new NodesByCommitTimeFilter( filterText); Matcher nameFilter = matcher(filterText); for (Ref tagRef : getRefs(repo, Constants.R_TAGS).values()) { if (!timeFilter.isFilterActive() && !nameFilter .matches(Repository.shortenRefName(tagRef.getName()))) { continue; } ObjectId objectId = tagRef.getLeaf().getObjectId(); RevObject revObject = walk.parseAny(objectId); RevObject peeledObject = walk.peel(revObject); TagNode tagNode = createTagNode(parentNode, repo, tagRef, revObject, peeledObject); timeFilter.addNode(tagNode, peeledObject); } <START> nodes.addAll(timeFilter.getFilteredFilteredNodes()); <END> } catch (IOException e) { return handleException(e, parentNode); } return nodes.toArray(); }</code><technical_language>2 times filtered</technical_language>

Target:
private Object[] getTagsChildren(TagsNode parentNode, Repository repo) { List<RepositoryTreeNode<?>> nodes = new ArrayList<>(); try (RevWalk walk = new RevWalk(repo)) { walk.setRetainBody(true); String filterText = filters != null ? filters.get(parentNode) : null; NodesByCommitTimeFilter timeFilter = new NodesByCommitTimeFilter( filterText); Matcher nameFilter = matcher(filterText); for (Ref tagRef : getRefs(repo, Constants.R_TAGS).values()) { if (!timeFilter.isFilterActive() && !nameFilter .matches(Repository.shortenRefName(tagRef.getName()))) { continue; } ObjectId objectId = tagRef.getLeaf().getObjectId(); RevObject revObject = walk.parseAny(objectId); RevObject peeledObject = walk.peel(revObject); TagNode tagNode = createTagNode(parentNode, repo, tagRef, revObject, peeledObject); timeFilter.addNode(tagNode, peeledObject); } nodes.addAll(timeFilter.getFilteredNodes()); } catch (IOException e) { return handleException(e, parentNode); } return nodes.toArray(); }
Source:
<code>public String getTitle(){ if(map.get("title") !=null){ return map.get("title").toString(); } try { <START> String x = null; <END> if (!(this.getContentType() instanceof WidgetContentType)){ ContentletAPI conAPI = APILocator.getContentletAPI(); x = conAPI.getName(this, APILocator.getUserAPI().getSystemUser(), false); map.put("title", x); } return x; } catch (Exception e) { Logger.error(this,"Unable to get title."); return ""; } }</code><technical_language>Please rename x for title similar</technical_language>

Target:
public String getTitle(){ try { Optional<com.dotcms.contenttype.model.field.Field> fieldFound = this.getContentType().fields().stream(). filter(field -> field.variable().equals("title")).findAny(); if (!fieldFound.isPresent()) { return map.get("title")!=null?map.get("title").toString():null; } ContentletAPI conAPI = APILocator.getContentletAPI(); String title = conAPI.getName(this, APILocator.getUserAPI().getSystemUser(), false); map.put("title", title); return title; } catch (Exception e) { Logger.error(this,"Unable to get title."); return ""; } }
Source:
<code>public static void moveFile(String source, String dest) throws IOException { try { Files.move(Paths.get(source), Paths.get(dest)); } catch (IOException e) { String errorMessage = "Error while moving file from" + source + "to" + dest; <START> throw new IOException(errorMessage, e); <END> } }</code><technical_language>Wrapping exception another exception of type confusing in a stack trace. if wrap IOException in another type of exception APIMgtException</technical_language>

Target:
public static void moveFile(String source, String dest) throws APIManagementException { try { Files.move(Paths.get(source), Paths.get(dest)); } catch (IOException e) { String errorMessage = "Error while moving file from" + source + "to" + dest; throw new APIManagementException(errorMessage, e); } }
Source:
<code>public Timestamp parse(String text) throws TimestampParseException { Temporal tmp = parser.date_strptime(compiledPattern, text); if (tmp == null) { <START> throw new TimestampParseException(); <END> } String zone = tmp.getZone(); DateTimeZone timeZone = defaultTimeZone; if (zone != null) { timeZone = parseDateTimeZone(zone); if (timeZone == null) { throw new TimestampParseException(); } } long localSec = tmp.getSec(); long sec = timeZone.convertLocalToUTC(localSec*1000, false) / 1000; return Timestamp.ofEpochSecond(sec, tmp.getNsec()); }</code><technical_language>ok, i removed it. <LINK_0></technical_language>

Target:
public Timestamp parse(String text) throws TimestampParseException { FormatBag bag = parser.parseInternal(compiledPattern, text); if (bag == null) { throw new TimestampParseException("Cannot parse '" + text + "' by '" + format + "'"); } LocalTime local = bag.makeLocalTime(); String zone = local.getZone(); DateTimeZone timeZone = defaultTimeZone; if (zone != null) { timeZone = parseDateTimeZone(zone); if (timeZone == null) { throw new TimestampParseException("Invalid time zone name '" + text + "'"); } } long sec = timeZone.convertLocalToUTC(local.getSeconds()*1000, false) / 1000; return Timestamp.ofEpochSecond(sec, local.getNsecFraction()); }
Source:
<code>private boolean checkAndDisableCliScheduler() { GlusterVolumeEntity metaVolume = getGlusterVolumeDao().getByName(getVdsGroupId(), Config.<String> getValue(ConfigValues.GlusterMetaVolumeName)); VDSGroup cluster = getVdsGroup(); if (metaVolume != null && cluster.isGlusterCliBasedSchedulingOn()) { VdcReturnValueBase returnValue = runInternalAction(VdcActionType.DisableGlusterCliSnapshotScheduleInternal, new GlusterVolumeActionParameters(getGlusterVolumeId(), true)); if (!returnValue.getSucceeded()) { handleVdsErrors(AuditLogType.GLUSTER_CLI_SNAPSHOT_SCHEDULE_DISABLE_FAILED, returnValue.getExecuteFailedMessages()); } else { AuditLogableBase logable = new AuditLogableBase(); logable.setVds(getVds()); logable.setVdsGroupId(getVdsGroupId()); <START> auditLogDirector.log(logable, AuditLogType.GLUSTER_CLI_SNAPSHOT_SCHEDULE_DISABLED); <END> } return returnValue.getSucceeded(); } return true; }</code><technical_language>'this' instead of creating a new AuditLogableBase instance, - command logging mechanism for this logging ? all, command is failed, getAuditLogTypeValue() report event</technical_language>

Target:
private boolean checkAndDisableCliScheduler() { GlusterVolumeEntity metaVolume = getGlusterVolumeDao().getByName(getVdsGroupId(), Config.<String> getValue(ConfigValues.GlusterMetaVolumeName)); VDSGroup cluster = getVdsGroup(); if (metaVolume != null && cluster.isGlusterCliBasedSchedulingOn()) { VdcReturnValueBase returnValue = runInternalAction(VdcActionType.DisableGlusterCliSnapshotScheduleInternal, new GlusterVolumeActionParameters(getGlusterVolumeId(), true)); if (!returnValue.getSucceeded()) { handleVdsErrors(AuditLogType.GLUSTER_CLI_SNAPSHOT_SCHEDULE_DISABLE_FAILED, returnValue.getExecuteFailedMessages()); } else { auditLogDirector.log(this, AuditLogType.GLUSTER_CLI_SNAPSHOT_SCHEDULE_DISABLED); } return returnValue.getSucceeded(); } return true; }
Source:
<code><START> private double[] calculateTranslationFactors(BpmnNode current) { <END> double[] translationFactors = {0, 0}; Bounds bounds; BpmnNode parent = current.getParent(); while(parent != null) { bounds = parent.value().getContent().getBounds(); translationFactors[0] = translationFactors[0] + bounds.getX(); translationFactors[1] = translationFactors[1] + bounds.getY(); parent = parent.getParent(); } return translationFactors; }</code><technical_language>option is return a Point2D</technical_language>

Target:
private Point2D calculateTranslationFactors(BpmnNode current) { double xFactor = 0; double yFactor = 0; Bounds bounds; BpmnNode parent = current.getParent(); while (parent != null) { bounds = parent.value().getContent().getBounds(); xFactor += bounds.getX(); yFactor += bounds.getY(); parent = parent.getParent(); } return Point2D.create(xFactor, yFactor); }
Source:
<code>private QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr, LearnerType type) { this.id = id; this.addr = addr; this.electionAddr = electionAddr; this.type = type; String checkIPReachableValue = System.getProperty("zookeeper.checkIPTimeout"); <START> if(checkIPReachableValue != null){ <END> this.checkIPReachableTO = Integer.parseInt(checkIPReachableValue); } }</code><technical_language>nit: space if (</technical_language>

Target:
private QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr, LearnerType type) { this.id = id; this.addr = addr; this.electionAddr = electionAddr; this.type = type; }
Source:
<code>public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof TestFilter)) { return false; } TestFilter f = (TestFilter) o; return f.testSizeFilterSet.equals(testSizeFilterSet) && f.testTimeoutFilterSet.equals(testTimeoutFilterSet) <START> && (f.testTagFilter == null && testTagFilter == null <END> || f.testTagFilter != null && f.testTagFilter.equals(testTagFilter)) && f.testLangFilterList.equals(testLangFilterList); }</code><technical_language>Objects.equal(f.testTagFilter, testTagFilter) (it handles null)</technical_language>

Target:
public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof TestFilter)) { return false; } TestFilter f = (TestFilter) o; return f.testSizeFilterSet.equals(testSizeFilterSet) && f.testTimeoutFilterSet.equals(testTimeoutFilterSet) && Objects.equals(f.testTagFilter, testTagFilter) && f.testLangFilterList.equals(testLangFilterList); }
Source:
<code>boolean cancelJob(String instanceId, String jobId) throws IOException { if (null == jobsUrl) { <START> String restUrl = jstring(credentials, "rest_url"); <END> String resourcesPath = jstring(credentials, "resources_path"); StringBuilder sb = new StringBuilder(restUrl.length() + resourcesPath.length()); sb.append(restUrl); sb.append(resourcesPath); String statusUrl = sb.toString(); JsonObject response = StreamsRestUtils.getGsonResponse(executor, getAuthorization(), statusUrl); JsonElement element = response.get("jobs"); if (null != element) { jobsUrl = element.getAsString(); } else { throw new RESTException("Unable to get jobs URL"); } } Instance instance = getInstance(); if (!instance.getId().equals(instanceId)) { throw new RESTException("Unable to cancel job in instance " + instanceId); } return delete(jobsUrl + "/" + jobId); }</code><technical_language>this is part of V2 implementation, this v2_rest_url instead of rest_url</technical_language>

Target:
boolean cancelJob(String instanceId, String jobId) throws IOException { if (null == jobsUrl) { String restUrl = jstring(credentials, "v2_rest_url"); JsonObject response = StreamsRestUtils.getGsonResponse(executor, getAuthorization(), restUrl); JsonElement element = response.get("jobs"); if (null != element) { jobsUrl = element.getAsString(); } else { throw new RESTException("Unable to get jobs URL"); } } Instance instance = getInstance(); if (!instance.getId().equals(instanceId)) { throw new RESTException("Unable to cancel job in instance " + instanceId); } return delete(jobsUrl + "/" + jobId); }
Source:
<code>public void setTimestamp(long timestamp) { <START> this.fTimestamp = timestamp; <END> }</code><technical_language>this</technical_language>

Target:
public void setTimestamp(long timestamp) { fTimestamp = timestamp; }
Source:
<code>public <T> T construct(Class<T> componentType) { if (componentType.equals(ExpirationManager.class)) { <START> return componentType.cast(componentRegistry.getOrCreateComponent(InternalExpirationManager.class)); <END> } CacheMode cacheMode = configuration.clustering().cacheMode(); if (cacheMode.needsStateTransfer()) { if (configuration.transaction().transactionMode().isTransactional()) { return componentType.cast(new TxClusterExpirationManager<>()); } return componentType.cast(new ClusterExpirationManager<>()); } else { return componentType.cast(new ExpirationManagerImpl<>()); } }</code><technical_language>IMO component injects ExpirationManager inject InternalExpirationManager instead</technical_language>

Target:
public <T> T construct(Class<T> componentType) { CacheMode cacheMode = configuration.clustering().cacheMode(); if (cacheMode.needsStateTransfer()) { if (configuration.transaction().transactionMode().isTransactional()) { return componentType.cast(new TxClusterExpirationManager<>()); } return componentType.cast(new ClusterExpirationManager<>()); } else { return componentType.cast(new ExpirationManagerImpl<>()); } }
Source:
<code>public Map<NamedKey, byte[]> getBulk(Iterable<NamedKey> keys) { Set<NamedKey> remaining = Sets.newHashSet(keys); Map<NamedKey, byte[]> res1 = level1.getBulk(keys); hitCount.addAndGet(res1.size()); remaining = Sets.difference(remaining, res1.keySet()); if (!remaining.isEmpty()) { Map<NamedKey, byte[]> res2 = level2.getBulk(remaining); int size = res2.size(); hitCount.addAndGet(size); missCount.addAndGet(remaining.size() - size); res1.putAll(res2); <START> } <END> return res1; }</code><technical_language>warm l1 cache</technical_language>

Target:
public Map<NamedKey, byte[]> getBulk(Iterable<NamedKey> keys) { Set<NamedKey> remaining = Sets.newHashSet(keys); Map<NamedKey, byte[]> res = level1.getBulk(keys); hitCount.addAndGet(res.size()); remaining = Sets.difference(remaining, res.keySet()); if (!remaining.isEmpty()) { Map<NamedKey, byte[]> res2 = level2.getBulk(remaining); for(Map.Entry<NamedKey, byte[]> entry : res2.entrySet()) { level1.put(entry.getKey(), entry.getValue()); } int size = res2.size(); hitCount.addAndGet(size); missCount.addAndGet(remaining.size() - size); if (size != 0) { res = Maps.newHashMap(res); res.putAll(res2); } } return res; }
Source:
<code>private void setAllows() { modifyInLock(configuration -> { final Map<String, MutableStorage> storages = configuration.getStorages(); if (storages != null && !storages.isEmpty()) { for (MutableStorage storage : storages.values()) { if (storage.getRepositories() != null && !storage.getRepositories().isEmpty()) { <START> for (Repository repository : storage.getRepositories().values()) <END> { if (repository.getType().equals(RepositoryTypeEnum.GROUP.getType())) { ((MutableRepository)repository).setAllowsDelete(false); ((MutableRepository)repository).setAllowsDeployment(false); ((MutableRepository)repository).setAllowsRedeployment(false); } if (repository.getType().equals(RepositoryTypeEnum.PROXY.getType())) { ((MutableRepository)repository).setAllowsDeployment(false); ((MutableRepository)repository).setAllowsRedeployment(false); } } } } } }, false); }</code><technical_language>do: for (Repository r : storage.getRepositories().values()) { MutableRepository repository = (MutableRepository) repository; ... } this? If I recall correctly, casting a sub-class expensive. (I wrong, a bit unpleasant)</technical_language>

Target:
private void setAllows() { modifyInLock(configuration -> { final Map<String, MutableStorage> storages = configuration.getStorages(); if (storages != null && !storages.isEmpty()) { for (MutableStorage storage : storages.values()) { if (storage.getRepositories() != null && !storage.getRepositories().isEmpty()) { for (Repository repository : storage.getRepositories().values()) { MutableRepository mutableRepository = (MutableRepository)repository; if (repository.getType().equals(RepositoryTypeEnum.GROUP.getType())) { mutableRepository.setAllowsDelete(false); mutableRepository.setAllowsDeployment(false); mutableRepository.setAllowsRedeployment(false); } if (repository.getType().equals(RepositoryTypeEnum.PROXY.getType())) { mutableRepository.setAllowsDeployment(false); mutableRepository.setAllowsRedeployment(false); } } } } } }, false); }
Source:
<code>private Map<String, ArrayList<CommentInfo>> queryDraftComments(GerritRepository gerritRepository, String change_id, String revision_id, IProgressMonitor monitor) { try { monitor.beginTask("Executing query", IProgressMonitor.UNKNOWN); Gerrit gerrit = gerritRepository.instantiateGerrit(); if (gerrit != null) { ListDraftsCommand command = gerrit.listDraftsComments(change_id, revision_id); Map<String, ArrayList<CommentInfo>> res = null; try { res = command.call(); return res; } catch (EGerritException <START> | ClientProtocolException e) { EGerritCorePlugin.logError(e.getMessage()); <END> } } } catch (UnsupportedClassVersionError e) { return null; } finally { monitor.done(); } return null; }</code><technical_language>logging is duplicated, error is reported end-user</technical_language>

Target:
private Map<String, ArrayList<CommentInfo>> queryDraftComments(GerritRepository gerritRepository, String change_id, String revision_id, IProgressMonitor monitor) { try { monitor.beginTask("Executing query", IProgressMonitor.UNKNOWN); Gerrit gerrit = gerritRepository.instantiateGerrit(); if (gerrit != null) { ListDraftsCommand command = gerrit.listDraftsComments(change_id, revision_id); Map<String, ArrayList<CommentInfo>> res = null; try { res = command.call(); return res; } catch (EGerritException e) { EGerritCorePlugin.logError(e.getMessage()); } catch (ClientProtocolException e) { UIUtils.displayInformation(null, TITLE, e.getLocalizedMessage() + "\n " + command.formatRequest()); } } } catch (UnsupportedClassVersionError e) { return null; } finally { monitor.done(); } return null; }
Source:
<code>private void setNotFoundBackgroundColor() { patternField.setData(CCS_CLASS_KEY, NO_RESULTS_CLASS); patternField.reskin(SWT.ALL); <START> patternField.update(); <END> noResults = true; }</code><technical_language>Is this necessary? If I remove update line work</technical_language>

Target:
private void setNotFoundBackgroundColor() { patternField.setData(CCS_CLASS_KEY, NO_RESULTS_CLASS); patternField.reskin(SWT.ALL); noResults = true; }
Source:
<code>protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(@NonNull ITmfTrace trace) { <START> return TmfTraceUtils.getAnalysisModuleOfClass(trace, CallGraphAnalysis.class, CallGraphViewAnalysis.ID); <END> }</code><technical_language>name... CallGraphViewAnalysis, View part sound good me..</technical_language>

Target:
protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(@NonNull ITmfTrace trace) { return TmfTraceUtils.getAnalysisModuleOfClass(trace, CallGraphAnalysis.class, CallGraphAnalysisUI.ID); }
Source:
<code>public void obtainsAuthor() throws Exception { final User user = NbRule.get(); final Alias alias = user.aliases().iterate().iterator().next(); final Inbox inbox = alias.inbox(); <START> final Bout bout = inbox.bout(inbox.start()); <END> final Attachments attachments = bout.attachments(); final String name = "name"; attachments.create(name); final Attachment attachment = attachments.get(name); MatcherAssert.assertThat( attachment.author(), Matchers.equalTo(alias.name()) ); attachments.delete(name); }</code><technical_language>@CarlosGines please read <LINK_0></technical_language>

Target:
public void obtainsAuthor() throws Exception { final User user = NbRule.get(); final Alias alias = user.aliases().iterate().iterator().next(); final Inbox inbox = alias.inbox(); final Attachments attachments = inbox.bout(inbox.start()) .attachments(); final String name = "name"; attachments.create(name); final Attachment attachment = attachments.get(name); MatcherAssert.assertThat( attachment.author(), Matchers.equalTo(alias.name()) ); attachments.delete(name); }
Source:
<code>public FindByIndexOptions useIndex(String designDocument, String indexName) { JsonArray index = new JsonArray(); index.add(new JsonPrimitive(designDocument)); index.add(new JsonPrimitive(indexName)); <START> this.useIndex = index; <END> return this; }</code><technical_language>Do of useIndex methods need check args method null</technical_language>

Target:
public FindByIndexOptions useIndex(String designDocument, String indexName) { assertNotNull(designDocument, "designDocument"); assertNotNull(indexName, "indexName"); JsonArray index = new JsonArray(); index.add(new JsonPrimitive(designDocument)); index.add(new JsonPrimitive(indexName)); this.useIndex = index; return this; }
Source:
<code>public org.ovirt.engine.core.common.locks.LockInfo getLockInfo(String key) { InternalLockView internalLockView = locks.get(key); if (internalLockView == null) { return null; } Set<String> messages = internalLockView.getMessages(); messages.remove(VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED.name()); if (messages.isEmpty()) { return null; } <START> return new org.ovirt.engine.core.common.locks.LockInfo(internalLockView.getExclusive(), messages); <END> }</code><technical_language>need for fqdn - is collision in class name</technical_language>

Target:
public LockInfo getLockInfo(String key) { InternalLockView internalLockView = locks.get(key); if (internalLockView == null) { return null; } Set<String> messages = internalLockView.getMessages(); messages.remove(VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED.name()); if (messages.isEmpty()) { return null; } return new LockInfo(internalLockView.getExclusive(), messages); }
Source:
<code>public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { <START> String accessTokenString = (String) config.get("accessToken"); <END> if (isNotBlank(accessTokenString)) { accessToken = accessTokenString; } if (isBlank(accessToken)) { throw new ConfigurationException("ciscospark", "The parameters 'accessToken' is missing! Please refer to your config file."); } String defaultRoomIdString = (String) config.get("defaultRoomId"); if (isNotBlank(defaultRoomIdString)) { defaultRoomId = defaultRoomIdString; } isProperlyConfigured = true; start(); } }</code><technical_language>For compatibility OH2, Objects.toString instead. eg. >... = Objects.toString(config.get("accessToken"), null);</technical_language>

Target:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { String accessTokenString = Objects.toString(config.get("accessToken")); if (isNotBlank(accessTokenString)) { accessToken = accessTokenString; } if (isBlank(accessToken)) { throw new ConfigurationException("ciscospark", "The parameter 'accessToken' is missing! Please refer to your config file."); } String defaultRoomIdString = Objects.toString(config.get("defaultRoomId")); if (isNotBlank(defaultRoomIdString)) { defaultRoomId = defaultRoomIdString; } isProperlyConfigured = true; start(); } }
Source:
<code>public void successNotOverload(boolean realTime) { pRejected.report(0.0); if(logMINOR) Logger.minor(this, "Success not overload on " + this + " : pRejected=" + pRejected.currentValue()); Peer peer = getPeer(); long now = System.currentTimeMillis(); reportBackoffStatus(now); synchronized(this) { long until; <START> if (true) { END> if(realTime) routingBackoffLengthRT = INITIAL_ROUTING_BACKOFF_LENGTH; else routingBackoffLengthBulk = INITIAL_ROUTING_BACKOFF_LENGTH; if(logMINOR) Logger.minor(this, "Resetting routing backoff on " + peer); } else { if(logMINOR) Logger.minor(this, "Ignoring successNotOverload: " + (until - now) + "ms remaining on routing backoff on " + peer); return; } } setPeerNodeStatus(now); }</code><technical_language>No, reason this works is simply a timing issue: takes a while for requests complete. start more one. get backed get a timeout. another request completes successfully, cancel backoff</technical_language>

Target:
public void successNotOverload(boolean realTime) { pRejected.report(0.0); if(logMINOR) Logger.minor(this, "Success not overload on " + this + " : pRejected=" + pRejected.currentValue()); Peer peer = getPeer(); long now = System.currentTimeMillis(); reportBackoffStatus(now); synchronized(this) { long until; if(realTime) routingBackoffLengthRT = INITIAL_ROUTING_BACKOFF_LENGTH; else routingBackoffLengthBulk = INITIAL_ROUTING_BACKOFF_LENGTH; if(logMINOR) Logger.minor(this, "Resetting routing backoff on " + peer); } setPeerNodeStatus(now); }
Source:
<code>public void setUp() throws Exception { queryRunner = TpchQueryRunnerBuilder.builder().build(); queryRunner.installPlugin(new Plugin() { @Override public Iterable<ConnectorFactory> getConnectorFactories() { <START> MockConnectorFactory.Builder builder = new MockConnectorFactory.Builder(); <END> MockConnectorFactory connectorFactory = builder.withListSchemaNames(session -> ImmutableList.of("UPPER_CASE_SCHEMA")) .withListTables((session, schemaNameOrNull) -> { throw new UnsupportedOperationException(); }) .withGetViews((session, prefix) -> ImmutableMap.of()) .withGetColumnHandles((session, tableHandle) -> { throw new UnsupportedOperationException(); }) .build(); return ImmutableList.of(connectorFactory); } }); queryRunner.createCatalog("upper_case_schema_catalog", "mock"); metadataManager = (MetadataManager) queryRunner.getMetadata(); }</code><technical_language>inline builder variable</technical_language>

Target:
public void setUp() throws Exception { queryRunner = TpchQueryRunnerBuilder.builder().build(); queryRunner.installPlugin(new Plugin() { @Override public Iterable<ConnectorFactory> getConnectorFactories() { MockConnectorFactory connectorFactory = MockConnectorFactory.builder() .withListSchemaNames(session -> ImmutableList.of("UPPER_CASE_SCHEMA")) .withListTables((session, schemaNameOrNull) -> { throw new UnsupportedOperationException(); }) .withGetViews((session, prefix) -> ImmutableMap.of()) .withGetColumnHandles((session, tableHandle) -> { throw new UnsupportedOperationException(); }) .build(); return ImmutableList.of(connectorFactory); } }); queryRunner.createCatalog("upper_case_schema_catalog", "mock"); metadataManager = (MetadataManager) queryRunner.getMetadata(); }