auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public AsyncRabbitTemplate(ConnectionFactory connectionFactory, String exchange, String routingKey) { Assert.notNull(connectionFactory, "'connectionFactory' cannot be null"); Assert.notNull(routingKey, "'routingKey' cannot be null"); this.template = new RabbitTemplate(connectionFactory); this.template.setExchange(exchange == null ? "" : exchange); this.template.setRoutingKey(routingKey); this.container = null; this.replyAddress = null; this.directReplyToContainer = new DirectReplyToMessageListenerContainer(this.template.getConnectionFactory()); <START> this.directReplyToContainer.setQueueNames(Address.AMQ_RABBITMQ_REPLY_TO); <END> this.directReplyToContainer.setChannelAwareMessageListener(this); }</code><technical_language>Redundant. DirectReplyToMessageListenerContainer ctor</technical_language>

Target:
public AsyncRabbitTemplate(ConnectionFactory connectionFactory, String exchange, String routingKey) { Assert.notNull(connectionFactory, "'connectionFactory' cannot be null"); Assert.notNull(routingKey, "'routingKey' cannot be null"); this.template = new RabbitTemplate(connectionFactory); this.template.setExchange(exchange == null ? "" : exchange); this.template.setRoutingKey(routingKey); this.container = null; this.replyAddress = null; this.directReplyToContainer = new DirectReplyToMessageListenerContainer(this.template.getConnectionFactory()); this.directReplyToContainer.setChannelAwareMessageListener(this); }
Source:
<code>public void onMediaUploadFailed(final String mediaId, final String errorMessage) { mWebView.post(new Runnable() { @Override public void run() { mWebView.execJavaScriptFromString("ZSSEditor.markImageUploadFailed(" + mediaId + ", '" <START> + errorMessage + "');"); <END> mFailedMediaIds.add(mediaId); mUploadingMediaIds.remove(mediaId); } }); }</code><technical_language>errorMessage needs single quotes escaped. permission error ('You permission upload media site'), for example, error. errorMessage.replaceAll("'", "\\\\'") do it. do this sending string literals Android, a translated String a single quote if default doesn't</technical_language>

Target:
public void onMediaUploadFailed(final String mediaId, final String errorMessage) { mWebView.post(new Runnable() { @Override public void run() { mWebView.execJavaScriptFromString("ZSSEditor.markImageUploadFailed(" + mediaId + ", '" + errorMessage.replace("'", "\\'").replace("\"", "\\\"") + "');"); mFailedMediaIds.add(mediaId); mUploadingMediaIds.remove(mediaId); } }); }
Source:
<code>public void put(String orcid, OrcidProfile orcidProfile) { try { <START> profileCache.acquireWriteLockOnKey(orcid); <END> profileCache.put(new Element(new OrcidCacheKey(orcid, releaseName), orcidProfile)); } finally { profileCache.releaseWriteLockOnKey(orcid); } }</code><technical_language>Hey @rcpeters, i create key _new OrcidCacheKey(orcid, releaseName)_ acquire lock key, in orcid id right</technical_language>

Target:
public void put(String orcid, OrcidProfile orcidProfile) { Object key = new OrcidCacheKey(orcid, releaseName); try { profileCache.acquireWriteLockOnKey(key); profileCache.put(new Element(key, orcidProfile)); } finally { profileCache.releaseWriteLockOnKey(key); } }
Source:
<code>public synchronized void start() { if (scanDirectoriesFuture == null) { scanDirectoriesFuture = scheduler.scheduleAtFixedRate(() -> { if (scanningNow) { reentered.inc(); return; } scanningNow = true; if (configurationFile != null && configurationFile.exists() && configurationFile.lastModified() > configurationLastRead.getEpochSecond()) { readConfiguration(); } scanLastStarted = Instant.now(); <START> UnreadableDirectories unreadableDirectories = new UnreadableDirectories(); <END> try (StreamCountSpy<Pair<File, Configuration>> newRuns = new StreamCountSpy<>(newRunsScanned); StreamCountSpy<Pair<File, Configuration>> attempted = new StreamCountSpy<>(attemptedDirectories); StreamCountSpy<Pair<File, Configuration>> accepted = new StreamCountSpy<>(acceptedDirectories); AutoCloseable timer = scanTime.start()) { roots.stream() .filter(Configuration::isValid) .flatMap(Configuration::getRuns) .peek(attempted) .filter(entry -> unreadableDirectories.test(entry.getKey())) .peek(accepted) .filter(entry -> isUnprocessed(entry.getKey())) .peek(newRuns) .forEach(entry -> { queueDirectory(entry.getKey(), entry.getValue().getProcessor(), entry.getValue().getTimeZone()); }); } catch (Exception e) { log.error("Error scanning directory.", e); } this.unreadableDirectories = unreadableDirectories; scanningNow = false; }, 1, 15, TimeUnit.MINUTES); } }</code><technical_language>![MAJOR](<LINK_1> 'Severity: MAJOR') Rename "unreadableDirectories" hides field declared line 220. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public synchronized void start() { if (scanDirectoriesFuture == null) { scanDirectoriesFuture = scheduler.scheduleAtFixedRate(() -> { if (scanningNow) { reentered.inc(); return; } scanningNow = true; if (configurationFile != null && configurationFile.exists() && configurationFile.lastModified() > configurationLastRead.getEpochSecond()) { readConfiguration(); } scanLastStarted = Instant.now(); UnreadableDirectories newUnreadableDirectories = new UnreadableDirectories(); try (StreamCountSpy<Pair<File, Configuration>> newRuns = new StreamCountSpy<>(newRunsScanned); StreamCountSpy<Pair<File, Configuration>> attempted = new StreamCountSpy<>(attemptedDirectories); StreamCountSpy<Pair<File, Configuration>> accepted = new StreamCountSpy<>(acceptedDirectories); AutoCloseable timer = scanTime.start()) { roots.stream() .filter(Configuration::isValid) .flatMap(Configuration::getRuns) .peek(attempted) .filter(entry -> newUnreadableDirectories.test(entry.getKey())) .peek(accepted) .filter(entry -> isUnprocessed(entry.getKey())) .peek(newRuns) .forEach(entry -> { queueDirectory(entry.getKey(), entry.getValue().getProcessor(), entry.getValue().getTimeZone()); }); } catch (Exception e) { log.error("Error scanning directory.", e); } unreadableDirectories = newUnreadableDirectories; scanningNow = false; }, 1, 15, TimeUnit.MINUTES); } }
Source:
<code>public void testRebind() throws Exception { origApp.createAndManageChild(EntitySpec.create(PostgreSqlNode.class) <START> .configure("mongodbConfTemplateUrl", "classpath:/ END> origApp.start(ImmutableList.of(loc)); rebind(); final PostgreSqlNode newEntity = (PostgreSqlNode) Iterables.find(newApp.getChildren(), Predicates.instanceOf(PostgreSqlNode.class)); EntityTestUtils.assertAttributeEqualsEventually(newEntity, PostgreSqlNode.SERVICE_UP, true); newEntity.stop(); EntityTestUtils.assertAttributeEqualsEventually(newEntity, PostgreSqlNode.SERVICE_UP, false); }</code><technical_language>mongodbConfTemplateUrl valid for PostgreSqlNode</technical_language>

Target:
public void testRebind() throws Exception { origApp.createAndManageChild(EntitySpec.create(PostgreSqlNode.class)); origApp.start(ImmutableList.of(loc)); rebind(); final PostgreSqlNode newEntity = (PostgreSqlNode) Iterables.find(newApp.getChildren(), Predicates.instanceOf(PostgreSqlNode.class)); EntityTestUtils.assertAttributeEqualsEventually(newEntity, PostgreSqlNode.SERVICE_UP, true); newEntity.stop(); EntityTestUtils.assertAttributeEqualsEventually(newEntity, PostgreSqlNode.SERVICE_UP, false); }
Source:
<code>protected void assertSiteUrlBase(Map<String, Object> row) { <START> throw new UnsupportedOperationException("Not supported yet."); END> }</code><technical_language>This check ORGANIZATION_WQP_URL</technical_language>

Target:
protected void assertSiteUrlBase(Map<String, Object> row) { assertUrl(OrganizationColumn.KEY_ORGANIZATION_SUMMARY_WQP_URL, row); }
Source:
<code><START> private String createBookmarkReport(IMarker[] markers) { <END> StringBuilder report = new StringBuilder(); report.append(BookmarkMessages.ColumnDescription_header + '\t'); report.append(BookmarkMessages.ColumnResource_header + '\t'); report.append(BookmarkMessages.ColumnFolder_header + '\t'); report.append(BookmarkMessages.ColumnLocation_header); report.append(System.getProperty("line.separator")); for (IMarker marker : markers) { report.append(MarkerUtil.getMessage(marker) + '\t'); report.append(MarkerUtil.getResourceName(marker) + '\t'); report.append(MarkerUtil.getContainerName(marker) + '\t'); int line = MarkerUtil.getLineNumber(marker); report.append(NLS.bind(BookmarkMessages.LineIndicator_text, String.valueOf(line))); report.append(System.getProperty("line.separator")); } return report.toString(); }</code><technical_language>mixed indentation: some lines tabs, others blanks. this function, avoid that</technical_language>

Target:
private String createBookmarkReport(IMarker[] markers) { StringBuilder report = new StringBuilder(); report.append(BookmarkMessages.ColumnDescription_header).append('\t'); report.append(BookmarkMessages.ColumnResource_header).append('\t'); report.append(BookmarkMessages.ColumnFolder_header).append('\t'); report.append(BookmarkMessages.ColumnLocation_header); report.append(System.getProperty("line.separator")); for (IMarker marker : markers) { report.append(MarkerUtil.getMessage(marker)).append('\t'); report.append(MarkerUtil.getResourceName(marker)).append('\t'); report.append(MarkerUtil.getContainerName(marker)).append('\t'); int line = MarkerUtil.getLineNumber(marker); report.append(NLS.bind(BookmarkMessages.LineIndicator_text, String.valueOf(line))); report.append(System.getProperty("line.separator")); } return report.toString(); }
Source:
<code>private void reportIssue(Tree tree) { ExpressionTree expression = getDenominator(tree); String operation = tree.is(Tree.Kind.REMAINDER, Tree.Kind.REMAINDER_ASSIGNMENT) ? "modulation" : "division"; String expressionName; String flowMessage; if (expression.is(Tree.Kind.IDENTIFIER)) { String name = ((IdentifierTree) expression).name(); expressionName = "'" + name + "'"; flowMessage = name + " is divided by zero"; } else { expressionName = "this expression"; flowMessage = "this expression contains division by zero"; } <START> context.reportIssue(expression, DivisionByZeroCheck.this, String.format("Make sure %s can't be zero before doing this %s.", expressionName, operation), <END> Flows.singleton(flowMessage, tree)); programState = null; }</code><technical_language>Please concatenation here. benefit format</technical_language>

Target:
private void reportIssue(Tree tree) { ExpressionTree expression = getDenominator(tree); String operation = tree.is(Tree.Kind.REMAINDER, Tree.Kind.REMAINDER_ASSIGNMENT) ? "modulation" : "division"; String expressionName; String flowMessage; if (expression.is(Tree.Kind.IDENTIFIER)) { String name = ((IdentifierTree) expression).name(); expressionName = "'" + name + "'"; flowMessage = name + " is divided by zero"; } else { expressionName = "this expression"; flowMessage = "this expression contains division by zero"; } context.reportIssue(expression, DivisionByZeroCheck.this, "Make sure " + expressionName + " can't be zero before doing this " + operation + ".", FlowComputation.singleton(flowMessage, tree)); programState = null; }
Source:
<code>protected void doPost(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (Subject.getSubject(AccessController.getContext()) == null) { servletResponse.sendError(HttpServletResponse.SC_FORBIDDEN); return; } lazyInit(servletRequest, servletResponse); try { createServletRunContext(servletRequest, servletResponse).run(() -> { ServiceTunnelRequest serviceRequest = deserializeServiceRequest(); ServiceTunnelResponse serviceResponse = doPost(serviceRequest); IRestorer interruption = ThreadInterruption.clear(); try { serializeServiceResponse(serviceResponse); } finally { interruption.restore(); } }, DefaultExceptionTranslator.class); } catch (Throwable e) { if (isConnectionError(e)) { LOG.debug("Connection Error", e); } else if (isInterruption(e)) { LOG.info("Interruption", e); servletResponse.sendError(HttpServletResponse.SC_ACCEPTED, "Request processing was interrupted"); } <START> else if (e instanceof DuplicateRequestException) { END> LOG.warn("Duplicate Request", e); servletResponse.sendError(HttpServletResponse.SC_CONFLICT, "Request is a duplicate"); } else { LOG.error("Client={}@{}/{}", servletRequest.getRemoteUser(), servletRequest.getRemoteAddr(), servletRequest.getRemoteHost(), e); servletResponse.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } }</code><technical_language>NOSONAR: additional catch-Block appropriate, sacrificy legibility. catch(DuplicateRequestException e){...} catch(Throwable e){...}</technical_language>

Target:
protected void doPost(HttpServletRequest servletRequest, HttpServletResponse servletResponse) throws ServletException, IOException { if (Subject.getSubject(AccessController.getContext()) == null) { servletResponse.sendError(HttpServletResponse.SC_FORBIDDEN); return; } lazyInit(servletRequest, servletResponse); try { createServletRunContext(servletRequest, servletResponse).run(() -> { ServiceTunnelRequest serviceRequest = deserializeServiceRequest(); ServiceTunnelResponse serviceResponse = doPost(serviceRequest); IRestorer interruption = ThreadInterruption.clear(); try { serializeServiceResponse(serviceResponse); } finally { interruption.restore(); } }, DefaultExceptionTranslator.class); } catch (Throwable e) { if (isConnectionError(e)) { LOG.debug("Connection Error", e); } else if (isInterruption(e)) { LOG.info("Interruption", e); servletResponse.setStatus(HttpServletResponse.SC_ACCEPTED, "Request processing was interrupted"); } else if (e instanceof DuplicateRequestException) { LOG.warn("Duplicate Request", e); servletResponse.sendError(HttpServletResponse.SC_CONFLICT, "Request is a duplicate"); } else { LOG.error("Client={}@{}/{}", servletRequest.getRemoteUser(), servletRequest.getRemoteAddr(), servletRequest.getRemoteHost(), e); servletResponse.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } } }
Source:
<code>private void buildFieldReadAccessInvocation(BlockBuilder blockBuilder, IdentifierGenerator idGenerator, Tree tree) { <START> Optional<Expression.FieldAccess> fieldAccess = buildFieldAccess(idGenerator, tree); <END> if (fieldAccess.isPresent()) { Expression.Variable aux = variableWithId(idGenerator.newId()); blockBuilder.assignTo(aux, call("__id").withArgs(fieldAccess.get()), location(tree)); idGenerator.varForExpression(tree, aux.id()); } }</code><technical_language>This simplified Optional.IfPresent(): java buildFieldAccess(idGenerator, tree).ifPresent(fieldAccess -> { Expression.Variable aux = variableWithId(idGenerator.newId()); blockBuilder.assignTo(aux, call("__id").withArgs(fieldAccess), location(tree)); idGenerator.varForExpression(tree, aux.id()); });</technical_language>

Target:
private void buildFieldReadAccessInvocation(BlockBuilder blockBuilder, IdentifierGenerator idGenerator, Tree tree) { buildFieldAccess(idGenerator, tree).ifPresent(fieldAccess -> { Expression.Variable aux = variableWithId(idGenerator.newId()); blockBuilder.assignTo(aux, call("__id").withArgs(fieldAccess), location(tree)); idGenerator.varForExpression(tree, aux.id()); }); }
Source:
<code>public int hashCode() { final int prime = 31; int result = 1; result = prime * result + (getTag() == null ? 0 : getTag().hashCode()); <START> return result; <END> }</code><technical_language>return (getTag() == null ? 0 : getTag().hashCode());</technical_language>

Target:
public int hashCode() { return 31 * super.hashCode() + (getTag() == null ? 0 : getTag().hashCode()); }
Source:
<code><START> private String getArticleTitle(Doi doi) { <END> String articleTitle; if (articleTitles.containsKey(doi)) { articleTitle = articleTitles.get(doi); } else { ArticleTable article; try { article = articleCrudService.getArticle(ArticleIdentifier.create(doi)); } catch (NoSuchArticleIdException e) { articleTitles.put(doi, null); return null; } ArticleIngestion ingestion; try { ingestion = articleCrudService.getLatestArticleRevision(article).getIngestion(); } catch (NoSuchArticleIdException e) { log.error("Could not retrieve latest revision for " + article.getDoi(), e); throw new RuntimeException(e); } ArticleXml targetArticleXml; try { targetArticleXml = new ArticleXml(articleCrudService.getManuscriptXml(ingestion)); } catch (IOException e) { log.error("Could not retrieve manuscript for " + ingestion, e); throw new RuntimeException(e); } articleTitle = targetArticleXml.parseTitle(); articleTitles.put(doi, articleTitle); } return articleTitle; }</code><technical_language>I feel this live in service, ArticleXmlParsingService. expect parse title xml in other places besides article relationships right</technical_language>

Target:
private String getArticleTitle(Doi doi) { ArticleTable article; try { article = articleCrudService.getArticle(ArticleIdentifier.create(doi)); } catch (NoSuchArticleIdException e) { log.error("Could not retrieve article for " + doi, e); throw new RuntimeException(e); } ArticleIngestion ingestion; try { ingestion = articleCrudService.getLatestArticleRevision(article).getIngestion(); } catch (NoSuchArticleIdException e) { log.error("Could not retrieve latest revision for " + article.getDoi(), e); throw new RuntimeException(e); } ArticleXml targetArticleXml; try { targetArticleXml = new ArticleXml(articleCrudService.getManuscriptXml(ingestion)); } catch (IOException e) { log.error("Could not retrieve manuscript for " + ingestion, e); throw new RuntimeException(e); } return targetArticleXml.parseTitle(); }
Source:
<code>public BigtableBufferedMutator( Configuration configuration, TableName tableName, int maxInflightRpcs, long maxHeapSize, BigtableDataClient client, BigtableOptions options, ExecutorService executorService, BufferedMutator.ExceptionListener listener) { this.sizeManager = new HeapSizeManager(maxHeapSize, maxInflightRpcs); this.configuration = configuration; this.tableName = tableName; this.exceptionListener = listener; this.host = options.getDataHost().toString(); PutAdapter putAdapter = <START> new PutAdapter(configuration.getInt("hbase.client.keyvalue.maxsize", -1)); <END> RowMutationsAdapter rowMutationsAdapter = new RowMutationsAdapter(Adapters.createMutationsAdapter(putAdapter)); ListeningExecutorService listeningExecutorService = MoreExecutors.listeningDecorator(executorService); batchExecutor = new BatchExecutor( client, options, options.getClusterName().toTableName(tableName.getNameAsString()), listeningExecutorService, putAdapter, rowMutationsAdapter); }</code><technical_language>wrap this logic in Adapters call Adapters.createPutAdapter()</technical_language>

Target:
public BigtableBufferedMutator( Configuration configuration, TableName tableName, int maxInflightRpcs, long maxHeapSize, BigtableDataClient client, BigtableOptions options, ExecutorService executorService, BufferedMutator.ExceptionListener listener) { this.sizeManager = new HeapSizeManager(maxHeapSize, maxInflightRpcs); this.configuration = configuration; this.tableName = tableName; this.exceptionListener = listener; this.host = options.getDataHost().toString(); PutAdapter putAdapter = Adapters.createPutAdapter(configuration); RowMutationsAdapter rowMutationsAdapter = new RowMutationsAdapter(Adapters.createMutationsAdapter(putAdapter)); ListeningExecutorService listeningExecutorService = MoreExecutors.listeningDecorator(executorService); batchExecutor = new BatchExecutor( client, options, options.getClusterName().toTableName(tableName.getNameAsString()), listeningExecutorService, putAdapter, rowMutationsAdapter); }
Source:
<code>public Object invoke(Signature function, ConnectorSession session, List<Object> arguments) { ScalarFunctionImplementation implementation = registry.getScalarFunctionImplementation(function); MethodHandle method = implementation.getMethodHandle(); if (method.type().parameterCount() > 0 && method.type().parameterType(0) == ConnectorSession.class) { method = method.bindTo(session); } Iterator<Object> iterator = arguments.iterator(); <START> List<Object> actualArguments = new ArrayList<>(arguments.size() + 1); <END> for (int i = 0; i < method.type().parameterCount(); i++) { Class<?> parameterType = method.type().parameterType(i); checkArgument(iterator.hasNext(), "Not enough arguments provided for method: %s", method.type()); Object argument = iterator.next(); if (implementation.getNullFlags().get(i)) { boolean isNull = argument == null; if (isNull) { argument = Defaults.defaultValue(parameterType); } actualArguments.add(argument); actualArguments.add(isNull); i++; } else { actualArguments.add(argument); } } checkArgument(!iterator.hasNext(), "Too many arguments provided for method: %s", method.type()); try { return method.invokeWithArguments(actualArguments); } catch (Throwable throwable) { throw Throwables.propagate(throwable); } }</code><technical_language>need for +1 now</technical_language>

Target:
public Object invoke(Signature function, ConnectorSession session, List<Object> arguments) { ScalarFunctionImplementation implementation = registry.getScalarFunctionImplementation(function); MethodHandle method = implementation.getMethodHandle(); method = bindInstanceFactory(method, implementation); if (method.type().parameterCount() > 0 && method.type().parameterType(0) == ConnectorSession.class) { method = method.bindTo(session); } List<Object> actualArguments = new ArrayList<>(); for (int i = 0; i < arguments.size(); i++) { Object argument = arguments.get(i); Optional<Class> lambdaArgument = implementation.getLambdaInterface().get(i); if (lambdaArgument.isPresent() && !MethodHandle.class.equals(lambdaArgument.get())) { argument = asInterfaceInstance(lambdaArgument.get(), (MethodHandle) argument); } if (implementation.getNullFlags().get(i)) { boolean isNull = argument == null; if (isNull) { argument = Defaults.defaultValue(method.type().parameterType(actualArguments.size())); } actualArguments.add(argument); actualArguments.add(isNull); } else { actualArguments.add(argument); } } try { return method.invokeWithArguments(actualArguments); } catch (Throwable throwable) { throw Throwables.propagate(throwable); } }
Source:
<code>private CheServicesEnvironmentImpl asCheEnvironment(ComposeEnvironment composeEnvironment) { Map<String, CheServiceImpl> services = Maps.newHashMapWithExpectedSize(composeEnvironment.getServices().size()); for (Map.Entry<String, ComposeServiceImpl> composeServiceEntry : composeEnvironment.getServices() .entrySet()) { ComposeServiceImpl service = composeServiceEntry.getValue(); CheServiceBuildContextImpl buildContext = null; <START> if (service.getBuild() != null) { <END> buildContext = new CheServiceBuildContextImpl().withContext(service.getBuild().getContext()) .withDockerfilePath(service.getBuild().getDockerfile()) .withArgs(service.getBuild().getArgs()); } CheServiceImpl cheService = new CheServiceImpl().withBuild(buildContext) .withCommand(service.getCommand()) .withContainerName(service.getContainerName()) .withDependsOn(service.getDependsOn()) .withEntrypoint(service.getEntrypoint()) .withEnvironment(service.getEnvironment()) .withExpose(service.getExpose()) .withImage(service.getImage()) .withLabels(service.getLabels()) .withLinks(service.getLinks()) .withMemLimit(service.getMemLimit()) .withNetworks(service.getNetworks()) .withPorts(service.getPorts()) .withVolumes(service.getVolumes()) .withVolumesFrom(service.getVolumesFrom()); services.put(composeServiceEntry.getKey(), cheService); } return new CheServicesEnvironmentImpl().withServices(services); }</code><technical_language>if move this section declaration of cheService able avoid buildConext variable e.g. java if (service.getBuild() != null) { cheService.setBuild(new CheServiceBuildContextImpl().withContext(service.getBuild().getContext()) .withDockerfilePath(service.getBuild().getDockerfile()) .withArgs(service.getBuild().getArgs())) } i creation of CheServiceBuildContextImpl replaced constructor call</technical_language>

Target:
private CheServicesEnvironmentImpl asCheEnvironment(ComposeEnvironment composeEnvironment) { Map<String, CheServiceImpl> services = Maps.newHashMapWithExpectedSize(composeEnvironment.getServices().size()); for (Map.Entry<String, ComposeServiceImpl> composeServiceEntry : composeEnvironment.getServices() .entrySet()) { ComposeServiceImpl service = composeServiceEntry.getValue(); CheServiceImpl cheService = new CheServiceImpl().withCommand(service.getCommand()) .withContainerName(service.getContainerName()) .withDependsOn(service.getDependsOn()) .withEntrypoint(service.getEntrypoint()) .withEnvironment(service.getEnvironment()) .withExpose(service.getExpose()) .withImage(service.getImage()) .withLabels(service.getLabels()) .withLinks(service.getLinks()) .withMemLimit(service.getMemLimit()) .withNetworks(service.getNetworks()) .withPorts(service.getPorts()) .withVolumes(service.getVolumes()) .withVolumesFrom(service.getVolumesFrom()); if (service.getBuild() != null) { cheService.setBuild(new CheServiceBuildContextImpl().withContext(service.getBuild().getContext()) .withDockerfilePath(service.getBuild().getDockerfile()) .withArgs(service.getBuild().getArgs())); } services.put(composeServiceEntry.getKey(), cheService); } return new CheServicesEnvironmentImpl(services); }
Source:
<code><START> public final void createTable(final TableDesc desc) throws DuplicateTableException, InsufficientPrivilegeException { <END> try { final BlockingInterface stub = getStub(); final ReturnState state = stub.createTable(null, desc.getProto()); throwsIfThisError(state, DuplicateTableException.class); throwsIfThisError(state, InsufficientPrivilegeException.class); ensureOk(state); } catch (ServiceException e) { throw new RuntimeException(e); } }</code><technical_language>UndefinedDatabaseException handled</technical_language>

Target:
public final void createTable(final TableDesc desc) throws UndefinedDatabaseException, DuplicateTableException, InsufficientPrivilegeException { try { final BlockingInterface stub = getStub(); final ReturnState state = stub.createTable(null, desc.getProto()); throwsIfThisError(state, UndefinedDatabaseException.class); throwsIfThisError(state, DuplicateTableException.class); throwsIfThisError(state, InsufficientPrivilegeException.class); ensureOk(state); } catch (ServiceException e) { throw new RuntimeException(e); } }
Source:
<code>public void testPackageWithTestPrefix() throws Throwable { VirtualFile file = WriteCommandAction.runWriteCommandAction(myFixture.getProject(), new ThrowableComputable<VirtualFile, Throwable>() { @NotNull @Override public VirtualFile compute() throws Throwable { myFixture.getTempDirFixture().createFile("pack1/pack1_test.go", "package pack1_test; func Test() {}"); return myFixture.getTempDirFixture().createFile("pack2/pack2_test.go", <START> "package pack2_test; import \"testing\"; func TestTest(*testing.T) {<error>pack1_test</error>.Test()}"); <END> } }); GoModuleLibrariesService.getInstance(myFixture.getModule()).setLibraryRootUrls(file.getParent().getParent().getUrl()); myFixture.configureFromExistingVirtualFile(file); myFixture.checkHighlighting(); }</code><technical_language>please rebase, this code do PR changed</technical_language>

Target:
public void testPackageWithTestPrefix() { myFixture.addFileToProject("pack1/pack1_test.go", "package pack1_test; func Test() {}"); PsiFile file = myFixture.addFileToProject("pack2/pack2_test.go", "package pack2_test; import \"testing\"; func TestTest(*testing.T) {<error>pack1_test</error>.Test()}"); myFixture.configureFromExistingVirtualFile(file.getVirtualFile()); myFixture.checkHighlighting(); }
Source:
<code>public APIResult submitAndScheduleExtensionJob(final String extensionName, final String jobName, final String configPath, final String doAsUser) { InputStream configStream = getServletInputStream(configPath); if (!validateExtension(extensionName, jobName, configStream)) { return null; } ClientResponse clientResponse = new ResourceBuilder() .path(ExtensionOperations.SUBMIT_AND_SCHEDULE.path, extensionName) .addQueryParam(DO_AS_OPT, doAsUser) <START> .call(ExtensionOperations.SUBMIT_AND_SCHEDULE, configStream); <END> return getResponse(APIResult.class, clientResponse); }</code><technical_language>entity definitions</technical_language>

Target:
public APIResult submitAndScheduleExtensionJob(final String extensionName, final String jobName, final String configPath, final String doAsUser) { FormDataMultiPart entitiesForm = getEntitiesForm(extensionName, jobName, configPath); ClientResponse clientResponse = new ResourceBuilder() .path(ExtensionOperations.SUBMIT_AND_SCHEDULE.path, extensionName) .addQueryParam(DO_AS_OPT, doAsUser) .call(ExtensionOperations.SUBMIT_AND_SCHEDULE, entitiesForm); return getResponse(APIResult.class, clientResponse); }
Source:
<code>public synchronized boolean updateLastSeenEpochIfNewer(TopicPartition topicPartition, int leaderEpoch) { Objects.requireNonNull(topicPartition, "TopicPartition cannot be null"); if (leaderEpoch < 0) throw new IllegalArgumentException("Invalid leader epoch " + leaderEpoch + " (must be non-negative)"); Integer oldEpoch = lastSeenLeaderEpochs.get(topicPartition); <START> log.trace("Determining if we should replace existing epoch with new epoch {}", oldEpoch, leaderEpoch); <END> final boolean updated; if (oldEpoch == null) { log.debug("Not replacing null epoch with new epoch for partition {}", leaderEpoch, topicPartition); updated = false; } else { if (leaderEpoch > oldEpoch) { log.debug("Updating last seen epoch from to for partition {}", oldEpoch, leaderEpoch, topicPartition); lastSeenLeaderEpochs.put(topicPartition, leaderEpoch); updated = true; } else { log.debug("Not replacing existing epoch with new epoch for partition {}", oldEpoch, leaderEpoch, topicPartition); updated = false; } } this.needFullUpdate = this.needFullUpdate || updated; return updated; }</code><technical_language>nit: add partition this message</technical_language>

Target:
public synchronized boolean updateLastSeenEpochIfNewer(TopicPartition topicPartition, int leaderEpoch) { Objects.requireNonNull(topicPartition, "TopicPartition cannot be null"); if (leaderEpoch < 0) throw new IllegalArgumentException("Invalid leader epoch " + leaderEpoch + " (must be non-negative)"); Integer oldEpoch = lastSeenLeaderEpochs.get(topicPartition); log.trace("Determining if we should replace existing epoch with new epoch for partition {}", oldEpoch, leaderEpoch, topicPartition); final boolean updated; if (oldEpoch == null) { log.debug("Not replacing null epoch with new epoch for partition {}", leaderEpoch, topicPartition); updated = false; } else if (leaderEpoch > oldEpoch) { log.debug("Updating last seen epoch from to for partition {}", oldEpoch, leaderEpoch, topicPartition); lastSeenLeaderEpochs.put(topicPartition, leaderEpoch); updated = true; } else { log.debug("Not replacing existing epoch with new epoch for partition {}", oldEpoch, leaderEpoch, topicPartition); updated = false; } this.needFullUpdate = this.needFullUpdate || updated; return updated; }
Source:
<code>@Override public ControlFlowGraph getCfg() { <START> return constructor.getMarker(ControlFlowGraph.class); <END> }</code><technical_language>need assert cfg != null, getMarker return @Nonnull</technical_language>

Target:
@Override public ControlFlowGraph getCfg() { ControlFlowGraph cfg = constructor.getMarker(ControlFlowGraph.class); assert cfg != null; return cfg; }
Source:
<code>public void setInSlot(Object slot, IsWidget content) { if (slot == MainSectionPresenter.TYPE_SetHeader) { setPanelContent(headerPanel, content); } else if (slot == MainSectionPresenter.TYPE_SetMainContent) { <START> if (!placeholderRemoved) { <END> removeHostPagePlaceholder(); placeholderRemoved = true; } setPanelContent(mainContentPanel, content); } else { super.setInSlot(slot, content); } }</code><technical_language>I remove boolean put this activateMenus() above. need call once</technical_language>

Target:
public void setInSlot(Object slot, IsWidget content) { if (slot == MainSectionPresenter.TYPE_SetHeader) { setPanelContent(headerPanel, content); } else if (slot == MainSectionPresenter.TYPE_SetMainContent) { setPanelContent(mainContentPanel, content); } else { super.setInSlot(slot, content); } }
Source:
<code><START> private static Object convertAttribute(Attribute attribute, AttributeDescriptor descriptor) { <END> if (descriptor.isMultiValued()) { List<Object> values = new ArrayList<>(); for (Serializable value : attribute.getValues()) { values.add( convertValue(attribute.getName(), value, descriptor.getType().getAttributeFormat())); } return values; } else { return convertValue( attribute.getName(), attribute.getValue(), descriptor.getType().getAttributeFormat()); } }</code><technical_language>I return a list of Serializables return a list of size 1 in case of a single value, method declarations more clear</technical_language>

Target:
private Serializable convertAttribute(Attribute attribute, AttributeDescriptor descriptor) { if (descriptor.isMultiValued()) { List<Serializable> values = new ArrayList<>(); for (Serializable value : attribute.getValues()) { Serializable convertedValue = convertValue(attribute.getName(), value, descriptor.getType().getAttributeFormat()); if (convertedValue != null) { values.add(convertedValue); } } return StringUtils.join(values, ","); } else { return convertValue( attribute.getName(), attribute.getValue(), descriptor.getType().getAttributeFormat()); } }
Source:
<code>private Object applyUpdateUnsafe(SMRRecord record) { log.trace("Apply[{}] of {}@{} ({})", this, record.getSMRMethod(), Address.isAddress(record.getGlobalAddress()) ? record.getGlobalAddress() : "OPT", record.getSMRArguments()); ICorfuSMRUpcallTarget<T> target = upcallTargetMap.get(record.getSMRMethod()); if (target == null) { throw new RuntimeException("Unknown upcall " + record.getSMRMethod()); } if (record.getGlobalAddress() >= rt.getAddressSpaceView().getCompactionMark() && <START> (!record.isUndoable() || !Address.isAddress(record.getGlobalAddress()))) { <END> IUndoRecordFunction<T> undoRecordTarget = undoRecordFunctionMap.get(record.getSMRMethod()); if (undoRecordTarget != null) { record.setUndoRecord(undoRecordTarget .getUndoRecord(object, record.getSMRArguments())); log.trace("Apply[{}] Undo->{}", this, record.getUndoRecord()); } else if (resetSet.contains(record.getSMRMethod())) { record.setUndoRecord(object); object = newObjectFn.get(); log.trace("Apply[{}] Undo->RESET", this); } } return target.upcall(object, record.getSMRArguments()); }</code><technical_language>!Address.isAddress(record.getGlobalAddress()) check. (i.e. check for valid address checking compactionMark undoable) This more sense prevents case record.getGlobalAddress == compactionMark == -1L</technical_language>

Target:
private Object applyUpdateUnsafe(SMRRecord record) { log.trace("Apply[{}] of {}@{} ({})", this, record.getSMRMethod(), Address.isAddress(record.getGlobalAddress()) ? record.getGlobalAddress() : "OPT", record.getSMRArguments()); ICorfuSMRUpcallTarget<T> target = upcallTargetMap.get(record.getSMRMethod()); if (target == null) { throw new RuntimeException("Unknown upcall " + record.getSMRMethod()); } if (!Address.isAddress(record.getGlobalAddress()) || !record.isUndoable() && record.getGlobalAddress() >= rt.getAddressSpaceView().getCompactionMark().get()) { IUndoRecordFunction<T> undoRecordTarget = undoRecordFunctionMap.get(record.getSMRMethod()); if (undoRecordTarget != null) { record.setUndoRecord(undoRecordTarget .getUndoRecord(object, record.getSMRArguments())); log.trace("Apply[{}] Undo->{}", this, record.getUndoRecord()); } else if (resetSet.contains(record.getSMRMethod())) { record.setUndoRecord(object); object = newObjectFn.get(); log.trace("Apply[{}] Undo->RESET", this); } } return target.upcall(object, record.getSMRArguments()); }
Source:
<code>public RuleModel unmarshalUsingDSL( final String str, final List<String> globals, final PackageDataModelOracle dmo, final String... dsls ) { <START> return unmarshalUsingDSL( str, globals, dmo, null, dsls ); <END> }</code><technical_language>of Collections.emptySet() Optional preferential</technical_language>

Target:
public RuleModel unmarshalUsingDSL(final String str, final List<String> globals, final PackageDataModelOracle dmo, final String... dsls) { return unmarshalUsingDSL(str, globals, dmo, Collections.emptyList(), dsls); }
Source:
<code>private static boolean matches(String refName, String refPattern) { <START> if (!refPattern.endsWith("*")) { <END> return refName.equals(refPattern); } else { return refName.startsWith( refPattern.substring(0, refPattern.length() - 1)); } }</code><technical_language>prefer refPattern.endsWith("/*") is rule Git remote.name.fetch remote.name.push pattern matching algorithm. Also, this method logic read. reorder it: if (refPattern.endsWith("/*") { return refName.startsWith(refPattern.substring(0, refPattern.length() - 1); } else { return refName.equals(refPattern); } yes, want length - 1 in "/*" case want verify "/" appears immediately * avoid "refs/heads/*" matching "refs/heads_and_other_crap"</technical_language>

Target:
public static boolean matches(String refName, String refPattern) { if (refPattern.endsWith("/*")) { return refName.startsWith( refPattern.substring(0, refPattern.length() - 1)); } else { return refName.equals(refPattern); } }
Source:
<code><START> public SqlSessionTemplate fudianSqlSessionTemplate(@Qualifier("fudianSqlSessionFactory") SqlSessionFactory sqlSessionFactory) throws Exception { <END> return new SqlSessionTemplate(sqlSessionFactory); }</code><technical_language>remove exception</technical_language>

Target:
public SqlSessionTemplate fudianSqlSessionTemplate(@Qualifier("fudianSqlSessionFactory") SqlSessionFactory sqlSessionFactory){ return new SqlSessionTemplate(sqlSessionFactory); }
Source:
<code>private void lookupClient() { try { log.tracef( "Retrieving MongoDatabase from JNDI at %1$s", configuration.getNativeClientResource() ); Driver driver = (Driver) jndiService.locate( configuration.getNativeClientResource() ); this.client = new BoltNeo4jClient( driver ); } catch (RuntimeException e) { throw log.errorOnFetchJndiClientProperty( configuration.getNativeClientResource() ); } <START> this.jndiService = null; <END> }</code><technical_language>critical I find counter intuitive lookup method clear, move end of start method</technical_language>

Target:
private void lookupClient() { try { log.tracef( "Retrieving MongoDatabase from JNDI at %1$s", configuration.getNativeClientResource() ); Driver driver = (Driver) jndiService.locate( configuration.getNativeClientResource() ); this.client = new BoltNeo4jClient( driver ); } catch (RuntimeException e) { throw log.errorOnFetchJndiClientProperty( configuration.getNativeClientResource() ); } }
Source:
<code>protected Boolean doInBackground(ArrayList<HybridFileParcelable>... files) { boolean success = true; this.files = files[0]; for (HybridFileParcelable file : files[0]) { Operator deleteOperation = new Operator(new DeleteOperation(context, rootMode, file)); <START> deleteOperation.start(); <END> success = success && deleteOperation.hasFailed(); } return success; }</code><technical_language>I recommend wrapping this array length nullity check, safe</technical_language>

Target:
protected Boolean doInBackground(ArrayList<HybridFileParcelable>... files) { if(files == null || files[0] == null || files.length != 1) { throw new IllegalArgumentException("execute() parameter must be one list!"); } boolean success = true; this.files = files[0]; for (HybridFileParcelable file : this.files) { Operator deleteOperation = new Operator(new DeleteOperation(context, rootMode, file)); deleteOperation.start(); success = success && deleteOperation.hasFailed(); } return success; }
Source:
<code>private void addNonceParameters(Map<String, Object> attributes, Map<String, Object> additionalParameters) { String nonce = this.stringKeyGenerator.generateKey(); attributes.put(IdTokenClaimNames.NONCE, nonce); try { String nonceHash = createHash(nonce); <START> additionalParameters.put(IdTokenClaimNames.NONCE, nonceHash); <END> } catch (NoSuchAlgorithmException e) { } }</code><technical_language>This OidcParameterNames.NONCE</technical_language>

Target:
private void addNonceParameters(Map<String, Object> attributes, Map<String, Object> additionalParameters) { try { String nonce = this.stringKeyGenerator.generateKey(); attributes.put(OidcParameterNames.NONCE, nonce); String nonceHash = createHash(nonce); additionalParameters.put(OidcParameterNames.NONCE, nonceHash); } catch (NoSuchAlgorithmException ignored) { } }
Source:
<code>public FirefoxOptions merge(Capabilities capabilities) { super.merge(capabilities); if (capabilities instanceof FirefoxOptions) { <START> Map options = (Map) capabilities.asMap().get("moz:firefoxOptions"); <END> mergeArguments(options); mergeBooleanPrefs(capabilities); mergeIntPrefs(capabilities); mergeStringPrefs(capabilities); mergeLogLevel(capabilities); } return this; }</code><technical_language>Generics, please</technical_language>

Target:
public FirefoxOptions merge(Capabilities capabilities) { super.merge(capabilities); return this; }
Source:
<code>public S hasValue(int expectedValue) { isNotNull(); if (!actual.isPresent()) throw failure(shouldContain(expectedValue)); try { <START> integers.assertEqual(info, actual.getAsInt(), expectedValue); <END> } catch (AssertionError assertionError) { throw Failures.instance().failure(info, shouldContain(actual, expectedValue)); } return myself; }</code><technical_language>In case, comparing int is easier: java if (expectedInt != actual.getAsInt()) throw Failures.instance().failure(info, shouldContain(actual, expectedValue));</technical_language>

Target:
public S hasValue(int expectedValue) { isNotNull(); if (!actual.isPresent()) throw failure(shouldContain(expectedValue)); if (expectedValue != actual.getAsInt()) throw Failures.instance().failure(info, shouldContain(actual, expectedValue)); return myself; }
Source:
<code>private void jobPropertiesCheck() { String maxXms = props.getString(JOB_MAX_XMS, MAX_XMS_DEFAULT); String maxXmx = props.getString(JOB_MAX_XMX, MAX_XMX_DEFAULT); long sizeMaxXms = azkaban.utils.Utils.parseMemString2KB(maxXms); long sizeMaxXmx = azkaban.utils.Utils.parseMemString2KB(maxXmx); for (String jobName : jobPropsMap.keySet()) { Props jobProps = jobPropsMap.get(jobName); String xms = jobProps.getString(XMS, null); <START> if (xms != null && azkaban.utils.Utils.parseMemString2KB(xms) > sizeMaxXms) { <END> errors.add(String.format("%s: Xms value has exceeded the allowed limit (max Xms = %s)", jobName, maxXms)); } String xmx = jobProps.getString(XMX, null); if (xmx != null && azkaban.utils.Utils.parseMemString2KB(xmx) > sizeMaxXmx) { errors.add(String.format("%s: Xmx value has exceeded the allowed limit (max Xmx = %s)", jobName, maxXmx)); } } }</code><technical_language>Do properties resolved this point ? a XMS={FROM_FLOW} a valid value, if unresolved</technical_language>

Target:
private void jobPropertiesCheck() { String maxXms = props.getString(JOB_MAX_XMS, MAX_XMS_DEFAULT); String maxXmx = props.getString(JOB_MAX_XMX, MAX_XMX_DEFAULT); long sizeMaxXms = azkaban.utils.Utils.parseMemString(maxXms); long sizeMaxXmx = azkaban.utils.Utils.parseMemString(maxXmx); for (String jobName : jobPropsMap.keySet()) { Props resolvedJobProps = PropsUtils.resolveProps(jobPropsMap.get(jobName)); String xms = resolvedJobProps.getString(XMS, null); if (xms != null && azkaban.utils.Utils.parseMemString(xms) > sizeMaxXms) { errors.add(String.format("%s: Xms value has exceeded the allowed limit (max Xms = %s)", jobName, maxXms)); } String xmx = resolvedJobProps.getString(XMX, null); if (xmx != null && azkaban.utils.Utils.parseMemString(xmx) > sizeMaxXmx) { errors.add(String.format("%s: Xmx value has exceeded the allowed limit (max Xmx = %s)", jobName, maxXmx)); } } }
Source:
<code>private Span[] overrideDefaultType(Span[] names) { for (int i = 0; i < names.length; i++) { Span n = names[i]; if (Objects.isNull(n.getType())) { names[i] = new Span(n.getStart(), n.getEnd(), this.defaultType, n.getProb()); } } return names; <START> } <END></code><technical_language>if modifying array in place, this method return void</technical_language>

Target:
private void overrideDefaultType(Span[] names) { for (int i = 0; i < names.length; i++) { Span n = names[i]; if (Objects.isNull(n.getType())) { names[i] = new Span(n.getStart(), n.getEnd(), this.defaultType, n.getProb()); } } }
Source:
<code>public void registerJsonShouldContainEntryView() throws Throwable { populateRegisterRegisterEntries(); Response registerRegisterEntryResponse = getRequest("register", "/register/address.json"); assertThat(registerRegisterEntryResponse.getStatus(), equalTo(200)); cleanDatabaseRule.before(); populateAddressRegisterEntries(); Response addressRegisterResourceResponse = getRequest("address", "/register.json"); assertThat(addressRegisterResourceResponse.getStatus(), equalTo(200)); String addressRegisterResourceJsonResponse = addressRegisterResourceResponse.readEntity(String.class); assertThat(addressRegisterResourceJsonResponse, containsString("\"total-entries\":5")); assertThat(addressRegisterResourceJsonResponse, containsString("\"total-records\":3")); assertThat(addressRegisterResourceJsonResponse, containsString("\"total-items\":5")); <START> assertThat(addressRegisterResourceJsonResponse, containsString("\"last-updated\":")); <END> String registerRegisterEntryJsonResponse = registerRegisterEntryResponse.readEntity(String.class); assertThat(addressRegisterResourceJsonResponse, containsString(registerRegisterEntryJsonResponse)); }</code><technical_language>assert a well-formatted timestamp</technical_language>

Target:
public void registerJsonShouldContainEntryView() throws Throwable { populateRegisterRegisterEntries(); Response registerRegisterEntryResponse = getRequest("register", "/register/address.json"); assertThat(registerRegisterEntryResponse.getStatus(), equalTo(200)); cleanDatabaseRule.before(); populateAddressRegisterEntries(); Response addressRegisterResourceResponse = getRequest("address", "/register.json"); assertThat(addressRegisterResourceResponse.getStatus(), equalTo(200)); JsonNode registerJson = addressRegisterResourceResponse.readEntity(JsonNode.class); assertThat(registerJson.get("total-entries").intValue(), equalTo(5)); assertThat(registerJson.get("total-records").intValue(), equalTo(3)); assertThat(registerJson.get("total-items").intValue(), equalTo(5)); verifyStringIsAnISODate(registerJson.get("last-updated").textValue()); JsonNode registerRecordJson = registerRegisterEntryResponse.readEntity(JsonNode.class); assertThat(registerJson.get("record"), equalTo(registerRecordJson)); }
Source:
<code>public List<String> getClassPath() { if (PantsUtil.isPantsProject(myProject)) { throw new RuntimeException(PantsConstants.EXTERNAL_BUILDER_ERROR); } <START> return new ArrayList<>(); <END> }</code><technical_language>Ah this meant guava Lists</technical_language>

Target:
public List<String> getClassPath() { if (PantsUtil.isPantsProject(myProject)) { throw new RuntimeException(PantsConstants.EXTERNAL_BUILDER_ERROR); } return Lists.newArrayList(); }
Source:
<code>public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) { for (Object bsmArg : bsmArgs) { <START> if (bsmArg instanceof Handle) <END> { Handle dynamicLambdaHandle = (Handle) bsmArg; dynamicLambdaHandles.add(dynamicLambdaHandle); } } }</code><technical_language>change this, a dynamic a handle argument a lambda. Also, this duplicates due targets multiple handle arguments</technical_language>

Target:
public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) { if (META_FACTORY.equals(bsm)) { Handle dynamicLambdaHandle = (Handle) bsmArgs[1]; dynamicLambdaHandles.add(dynamicLambdaHandle); } }
Source:
<code>public OrcSchema(Reader reader) throws IOException { <START> mAlluxioSchema = new ArrayList<>(); <END> final List<String> fieldNames = reader.getSchema().getFieldNames(); for (int i = 0; i < fieldNames.size(); i++) { final String fieldName = fieldNames.get(i); final String type = getType(reader.getSchema().getChildren().get(i)); mAlluxioSchema.add(new FieldSchema(i, fieldName, type, "")); } mWriteSchema = SchemaConversionUtils.buildWriteSchema(mAlluxioSchema); }</code><technical_language>this initialized size</technical_language>

Target:
public OrcSchema(Reader reader) throws IOException { final List<String> fieldNames = reader.getSchema().getFieldNames(); mAlluxioSchema = new ArrayList<>(fieldNames.size()); for (int i = 0; i < fieldNames.size(); i++) { final String fieldName = fieldNames.get(i); final String type = getType(reader.getSchema().getChildren().get(i)); mAlluxioSchema.add(new FieldSchema(i, fieldName, type, "")); } mWriteSchema = SchemaConversionUtils.buildWriteSchema(mAlluxioSchema); }