auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Instance createInstance(Machine machine, LineConsumer lineConsumer) throws UnsupportedRecipeException, InvalidRecipeException, NotFoundException, MachineException { requireNonNull(machine, "Non null machine required"); requireNonNull(lineConsumer, "Non null logs consumer required"); if (machine.getConfig().isDev()) { throw new MachineException("Dev machine is not supported for Ssh machine implementation"); } Recipe recipe = recipeDownloader.getRecipe(machine.getConfig()); SshMachineRecipe sshMachineRecipe = GSON.fromJson(recipe.getScript(), SshMachineRecipe.class); SshClient sshClient = sshMachineFactory.createSshClient(sshMachineRecipe, machine.getConfig().getEnvVariables()); sshClient.start(); return sshMachineFactory.createInstance(machine, sshClient, lineConsumer); }

Target:
public Instance createInstance(Machine machine, LineConsumer lineConsumer) throws UnsupportedRecipeException, InvalidRecipeException, NotFoundException, MachineException { requireNonNull(machine, "Non null machine required"); requireNonNull(lineConsumer, "Non null logs consumer required"); requireNonNull(machine.getConfig().getSource().getLocation(), "Location in machine source is required"); if (machine.getConfig().isDev()) { throw new MachineException("Dev machine is not supported for Ssh machine implementation"); } Recipe recipe = recipeDownloader.getRecipe(machine.getConfig()); SshMachineRecipe sshMachineRecipe = GSON.fromJson(recipe.getScript(), SshMachineRecipe.class); SshClient sshClient = sshMachineFactory.createSshClient(sshMachineRecipe, machine.getConfig().getEnvVariables()); sshClient.start(); return sshMachineFactory.createInstance(machine, sshClient, lineConsumer); }
Source:
private Set<PVariable> calculatePatternAdornmentForPlanner(Set<PParameter> boundParameters, PBody normalizedBody) { Set<PVariable> boundVariables = Sets.<PVariable> newHashSet(); for (PParameter parameter : boundParameters) { boundVariables.add(normalizedBody.getVariableByNameChecked(parameter.getName())); } return boundVariables; }

Target:
private Set<PVariable> calculatePatternAdornmentForPlanner(Set<PParameter> boundParameters, PBody normalizedBody) { Map<PParameter, PVariable> parameterMapping = Maps.newHashMap(); for (ExportedParameter constraint : normalizedBody.getSymbolicParameters()) { parameterMapping.put(constraint.getPatternParameter(), constraint.getParameterVariable()); } Set<PVariable> boundVariables = Sets.newHashSet(); for (PParameter parameter : boundParameters) { boundVariables.add(parameterMapping.get(parameter)); } return boundVariables; }
Source:
public void ArticleCRUDUser_003_addDropdown() { WikiBasePageObject base = new WikiBasePageObject(driver); String articleContent = PageContent.articleText; String articleTitle = PageContent.articleNamePrefix + base.getTimeStamp(); ArticlePageObject article = base.openRandomArticleOnWiki(wikiURL); VisualEditModePageObject visualEditMode = article.createArticleUsingDropdown(articleTitle); visualEditMode.addContent(articleContent); visualEditMode.submit(); article.compareContent(articleContent); article.compareTitle(articleTitle); }

Target:
public void ArticleCRUDUser_003_addDropdown() { WikiBasePageObject base = new WikiBasePageObject(driver); String articleContent = PageContent.articleText; String articleTitle = PageContent.articleNamePrefix + base.getTimeStamp(); ArticlePageObject article = base.openRandomArticle(wikiURL); VisualEditModePageObject visualEditMode = article.createArticleUsingDropdown(articleTitle); visualEditMode.addContent(articleContent); visualEditMode.submit(); article.verifyContent(articleContent); article.verifyArticleTitle(articleTitle); }
Source:
<T> CompletableFuture<T> scheduleTimeout(CompletableFuture<T> future) { Scheduled scheduled = context.schedule(Duration.ofMillis(100), () -> { if (!future.isDone()) { future.completeExceptionally(new TimeoutException()); } }); return future.whenComplete((r, e) -> scheduled.cancel()); }

Target:
<T> CompletableFuture<T> scheduleTimeout(CompletableFuture<T> future) { Scheduled scheduled = context.schedule(Duration.ofSeconds(1), () -> { if (!future.isDone()) { future.completeExceptionally(new TimeoutException()); } }); return future.whenComplete((r, e) -> scheduled.cancel()); }
Source:
public void testToJavaWrongID() throws IOException { mapper.readValue(JSON_ITEM_ID_VALUE_WRONG_ID, ValueImpl.class); }

Target:
public void testToJavaWrongID() throws IOException { Value unsupported = mapper.readValue(JSON_ITEM_ID_VALUE_WRONG_ID, ValueImpl.class); assertTrue(unsupported instanceof UnsupportedEntityIdValue); }
Source:
private void setCurrentUnit(CourseComponent component){ this.selectedUnit = component; if ( this.selectedUnit == null ) return; environment.getDatabase().updateAccess(null, selectedUnit.getId(), true); CourseComponent parentSectionComponent = component.getParent().getParent(); String prefName = PrefManager.getPrefNameForLastAccessedBy(getProfile() .username, selectedUnit.getCourseId()); final PrefManager prefManager = new PrefManager(MainApplication.instance(), prefName); prefManager.putLastAccessedSubsection(parentSectionComponent.getId(), false); Intent resultData = new Intent(); resultData.putExtra(Router.EXTRA_COURSE_UNIT, selectedUnit); setResult(RESULT_OK, resultData); }

Target:
private void setCurrentUnit(CourseComponent component){ this.selectedUnit = component; if ( this.selectedUnit == null ) return; environment.getDatabase().updateAccess(null, selectedUnit.getId(), true); String prefName = PrefManager.getPrefNameForLastAccessedBy(getProfile() .username, selectedUnit.getCourseId()); final PrefManager prefManager = new PrefManager(MainApplication.instance(), prefName); prefManager.putLastAccessedSubsection(this.selectedUnit.getId(), false); Intent resultData = new Intent(); resultData.putExtra(Router.EXTRA_COURSE_UNIT, selectedUnit); setResult(RESULT_OK, resultData); }
Source:
private InMemoryNoteBucket mergeLeafBucket(int treeDepth, LeafBucket bb, LeafBucket ob, LeafBucket tb) throws MissingObjectException, IOException { bb = notNullOrEmpty(bb); ob = notNullOrEmpty(ob); tb = notNullOrEmpty(tb); InMemoryNoteBucket result = new LeafBucket(treeDepth * 2); int bi = 0, oi = 0, ti = 0; while (bi < bb.size() || oi < ob.size() || ti < tb.size()) { Note b = get(bb, bi), o = get(ob, oi), t = get(tb, ti); Note min = min(b, o, t); b = sameNoteOrNull(min, b); o = sameNoteOrNull(min, o); t = sameNoteOrNull(min, t); if (sameNoteAndContent(o, t)) result = addIfNotNull(result, o); else if (sameNoteAndContent(b, o)) result = addIfNotNull(result, t); else if (sameNoteAndContent(b, t)) result = addIfNotNull(result, o); else result = addIfNotNull(result, noteMerger.merge(b, o, t)); if (b != null) bi++; if (o != null) oi++; if (t != null) ti++; } return result; }

Target:
private InMemoryNoteBucket mergeLeafBucket(int treeDepth, LeafBucket bb, LeafBucket ob, LeafBucket tb) throws MissingObjectException, IOException { bb = notNullOrEmpty(bb); ob = notNullOrEmpty(ob); tb = notNullOrEmpty(tb); InMemoryNoteBucket result = new LeafBucket(treeDepth * 2); int bi = 0, oi = 0, ti = 0; while (bi < bb.size() || oi < ob.size() || ti < tb.size()) { Note b = get(bb, bi), o = get(ob, oi), t = get(tb, ti); Note min = min(b, o, t); b = sameNoteOrNull(min, b); o = sameNoteOrNull(min, o); t = sameNoteOrNull(min, t); if (sameContent(o, t)) result = addIfNotNull(result, o); else if (sameContent(b, o)) result = addIfNotNull(result, t); else if (sameContent(b, t)) result = addIfNotNull(result, o); else result = addIfNotNull(result, noteMerger.merge(b, o, t)); if (b != null) bi++; if (o != null) oi++; if (t != null) ti++; } return result; }
Source:
private void header(@NonNull NewsCard card) { headerView.setTitle(R.string.view_card_news_title) .setLangCode(card.wikiSite().languageCode()) .setCard(card) .setCallback(getCallback()); }

Target:
private void header(@NonNull NewsCard card) { headerView.setTitle(card.title()) .setLangCode(card.wikiSite().languageCode()) .setCard(card); }
Source:
private void putUpWebUI() throws IOException { if (zookeeperMode) { LOG.info("WebUI is not supported in Zookeeper mode"); } else if (regionServerMode) { LOG.info("WebUI is not supported in RegionServer mode"); } else { Configuration conf = new Configuration(); int port = conf.getInt(HBASE_CANARY_INFO_PORT, DEFAULT_CANARY_INFOPORT); if (port < 0) return; String addr = conf.get(HBASE_CANARY_INFO_BINDADDRESS, "0.0.0.0"); try { InfoServer infoServer = new InfoServer("canary", addr, port, false, conf); infoServer.addUnprivilegedServlet("canary", "/canary-status", CanaryStatusServlet.class); infoServer.setAttribute("sink", this.sink); infoServer.start(); LOG.info("Bind Canary http info server to port: " + port); } catch (BindException e) { LOG.warn("Failed binding Canary http info server to port: " + port, e); } } }

Target:
private void putUpWebUI() throws IOException { int port = conf.getInt(HBASE_CANARY_INFO_PORT, DEFAULT_CANARY_INFOPORT); if (port < 0) { return; } if (zookeeperMode) { LOG.info("WebUI is not supported in Zookeeper mode"); } else if (regionServerMode) { LOG.info("WebUI is not supported in RegionServer mode"); } else { String addr = conf.get(HBASE_CANARY_INFO_BINDADDRESS, "0.0.0.0"); try { infoServer = new InfoServer("canary", addr, port, false, conf); infoServer.addUnprivilegedServlet("canary", "/canary-status", CanaryStatusServlet.class); infoServer.setAttribute("sink", this.sink); infoServer.start(); LOG.info("Bind Canary http info server to {}:{} ", addr, port); } catch (BindException e) { LOG.warn("Failed binding Canary http info server to {}:{}", addr, port, e); } } }
Source:
public Object getAttribute(String s) throws IOException { throw new UnsupportedOperationException("No FileStoreAttributeViews are currently supported."); }

Target:
public Object getAttribute(String s) throws IOException { throw new UnsupportedOperationException("FileStoreAttributeViews aren't supported."); }
Source:
public static final byte[] toBytes(final InputRow row, AggregatorFactory[] aggs, boolean reportParseExceptions) { try { ByteArrayDataOutput out = ByteStreams.newDataOutput(); out.writeLong(row.getTimestampFromEpoch()); List<String> dimList = row.getDimensions(); WritableUtils.writeVInt(out, dimList.size()); if (dimList != null) { for (String dim : dimList) { List<String> dimValues = row.getDimension(dim); writeString(dim, out); writeStringArray(dimValues, out); } } Supplier<InputRow> supplier = new Supplier<InputRow>() { @Override public InputRow get() { return row; } }; WritableUtils.writeVInt(out, aggs.length); for (AggregatorFactory aggFactory : aggs) { String k = aggFactory.getName(); writeString(k, out); Aggregator agg = aggFactory.factorize( IncrementalIndex.makeColumnSelectorFactory( aggFactory, supplier, true ) ); try { agg.aggregate(); } catch (ParseException e) { if (reportParseExceptions) { throw new ParseException(e, "Encountered parse error for aggregator[%s]", agg.getName()); } else { log.debug(e, "Encountered parse error, skipping aggregator[%s].", agg.getName()); } } String t = aggFactory.getTypeName(); if (t.equals("float")) { out.writeFloat(agg.getFloat()); } else if (t.equals("long")) { WritableUtils.writeVLong(out, agg.getLong()); } else { Object val = agg.get(); ComplexMetricSerde serde = getComplexMetricSerde(t); writeBytes(serde.toBytes(val), out); } } return out.toByteArray(); } catch(IOException ex) { throw Throwables.propagate(ex); } }

Target:
public static final byte[] toBytes(final InputRow row, AggregatorFactory[] aggs, boolean reportParseExceptions) { try { ByteArrayDataOutput out = ByteStreams.newDataOutput(); out.writeLong(row.getTimestampFromEpoch()); List<String> dimList = row.getDimensions(); WritableUtils.writeVInt(out, dimList.size()); if (dimList != null) { for (String dim : dimList) { List<String> dimValues = row.getDimension(dim); writeString(dim, out); writeStringArray(dimValues, out); } } Supplier<InputRow> supplier = new Supplier<InputRow>() { @Override public InputRow get() { return row; } }; WritableUtils.writeVInt(out, aggs.length); for (AggregatorFactory aggFactory : aggs) { String k = aggFactory.getName(); writeString(k, out); Aggregator agg = aggFactory.factorize( IncrementalIndex.makeColumnSelectorFactory( aggFactory, supplier, true ) ); try { agg.aggregate(); } catch (ParseException e) { if (reportParseExceptions) { throw new ParseException(e, "Encountered parse error for aggregator[%s]", agg.getName()); } log.debug(e, "Encountered parse error, skipping aggregator[%s].", agg.getName()); } String t = aggFactory.getTypeName(); if (t.equals("float")) { out.writeFloat(agg.getFloat()); } else if (t.equals("long")) { WritableUtils.writeVLong(out, agg.getLong()); } else { Object val = agg.get(); ComplexMetricSerde serde = getComplexMetricSerde(t); writeBytes(serde.toBytes(val), out); } } return out.toByteArray(); } catch(IOException ex) { throw Throwables.propagate(ex); } }
Source:
public boolean hasNext() { if ( next == RelationshipSelections.UNINITIALIZED ) { this.next(); next = relationshipCursor.relationshipReference(); } if ( next == RelationshipSelections.NO_ID ) { close(); return false; } return true; }

Target:
public boolean hasNext() { if ( next == RelationshipSelections.UNINITIALIZED ) { fetchNext(); next = relationshipCursor.relationshipReference(); } if ( next == RelationshipSelections.NO_ID ) { close(); return false; } return true; }
Source:
public Object unmarshal(Exchange exchange, InputStream stream) throws Exception { if (usingIterator) { if (clazzName != null || clazz != null) { if (clazz != null && clazz.getName() != null) { clazzName = clazz.getName(); } clazz = exchange.getContext().getClassResolver().resolveMandatoryClass(clazzName); ASN1GenericIterator asn1GenericIterator = new ASN1GenericIterator(clazz, stream); return asn1GenericIterator; } ASN1MessageIterator asn1MessageIterator = new ASN1MessageIterator(exchange, stream); return asn1MessageIterator; } else { ASN1InputStream ais = new ASN1InputStream(stream); ASN1Primitive asn1Record = null; ByteArrayOutputStream asn1Out = null; try { asn1Out = new ByteArrayOutputStream(); while (ais.available() > 0) { asn1Record = ais.readObject(); asn1Out.write(asn1Record.getEncoded()); } } finally { if (asn1Out != null) { asn1Out.close(); } if (ais != null) { ais.close(); } } return asn1Out.toByteArray(); } }

Target:
public Object unmarshal(Exchange exchange, InputStream stream) throws Exception { if (usingIterator) { if (clazzName != null) { Class<?> clazz = exchange.getContext().getClassResolver().resolveMandatoryClass(clazzName); ASN1GenericIterator asn1GenericIterator = new ASN1GenericIterator(clazz, stream); return asn1GenericIterator; } ASN1MessageIterator asn1MessageIterator = new ASN1MessageIterator(exchange, stream); return asn1MessageIterator; } else { ASN1Primitive asn1Record = null; byte[] asn1Bytes; try (ASN1InputStream ais = new ASN1InputStream(stream); ByteArrayOutputStream asn1Out = new ByteArrayOutputStream();) { while (ais.available() > 0) { asn1Record = ais.readObject(); asn1Out.write(asn1Record.getEncoded()); } asn1Bytes = asn1Out.toByteArray(); } return asn1Bytes; } }
Source:
public ApplicationContext connect(Map<String, String> parameters) throws ConnectionException { AoSession aoSession = null; try (ServiceLocator serviceLocator = new ServiceLocator(orb, getParameter(parameters, PARAM_NAMESERVICE))) { String nameOfService = getParameter(parameters, PARAM_SERVICENAME).replace(".ASAM-ODS", ""); AoFactory aoFactory = serviceLocator.resolveFactory(nameOfService); LOGGER.info("Connecting to ODS Server ..."); LOGGER.info("AoFactory name: {}", aoFactory.getName()); LOGGER.info("AoFactory description: {}", aoFactory.getDescription()); LOGGER.info("AoFactory interface version: {}", aoFactory.getInterfaceVersion()); LOGGER.info("AoFactory type: {}", aoFactory.getType()); aoSession = aoFactory.newSession(String.format(AUTH_TEMPLATE, getParameter(parameters, PARAM_USER), getParameter(parameters, PARAM_PASSWORD))); LOGGER.info("Connection to ODS server established."); CORBAFileServerIF fileServer = serviceLocator.resolveFileServer(nameOfService); return new ODSContext(orb, aoSession, fileServer, parameters); } catch (AoException e) { closeSession(aoSession); throw new ConnectionException("Unablte to connect to ODS server due to: " + e.reason, e); } }

Target:
public ApplicationContext connect(Map<String, String> parameters) throws ConnectionException { AoSession aoSession = null; try (ServiceLocator serviceLocator = new ServiceLocator(orb, getParameter(parameters, PARAM_NAMESERVICE))) { String nameOfService = getParameter(parameters, PARAM_SERVICENAME).replace(".ASAM-ODS", ""); AoFactory aoFactory = serviceLocator.resolveFactory(nameOfService); LOGGER.info("Connecting to ODS Server ..."); LOGGER.info("AoFactory name: {}", aoFactory.getName()); LOGGER.info("AoFactory description: {}", aoFactory.getDescription()); LOGGER.info("AoFactory interface version: {}", aoFactory.getInterfaceVersion()); LOGGER.info("AoFactory type: {}", aoFactory.getType()); aoSession = aoFactory.newSession(String.format(AUTH_TEMPLATE, getParameter(parameters, PARAM_USER), getParameter(parameters, PARAM_PASSWORD))); LOGGER.info("Connection to ODS server established."); CORBAFileServerIF fileServer = serviceLocator.resolveFileServer(nameOfService); return new ODSContext(orb, aoSession, fileServer, parameters); } catch (AoException e) { closeSession(aoSession); throw new ConnectionException("Unable to connect to ODS server due to: " + e.reason, e); } }
Source:
public String translatePath(String path) { String translated; if (path.startsWith("~" + File.separator)) { translated = System.getProperty("user.home") + path.substring(1); } else if (path.startsWith("~") && !Util.isWindows()) { String userName = path.substring(1); translated = new File(new File(System.getProperty("user.home")).getParent(), userName).getAbsolutePath(); translated = userName.isEmpty() || path.endsWith(File.separator) ? translated + File.separator : translated; } else if (!new File(path).isAbsolute()) { translated = ctx.getCurrentDir().getAbsolutePath() + File.separator + path; } else { translated = path; } return translated; }

Target:
public String translatePath(String path) { String translated; if (path.startsWith("~" + File.separator)) { translated = System.getProperty("user.home") + path.substring(1); } else if (path.startsWith("~")) { String userName = path.substring(1); translated = new File(new File(System.getProperty("user.home")).getParent(), userName).getAbsolutePath(); translated = userName.isEmpty() || path.endsWith(File.separator) ? translated + File.separator : translated; } else if (!new File(path).isAbsolute()) { translated = ctx.getCurrentDir().getAbsolutePath() + File.separator + path; } else { translated = path; } return translated; }
Source:
public Extension getExtensionInstance(Class<? extends Extension> extensionClass) { if(extensionClass.equals(LockingSupport.class)) return new MongoLockingSupport(this); else return null; }

Target:
public <E extends Extension> E getExtensionInstance(Class<? extends Extension> extensionClass) { if(extensionClass.equals(LockingSupport.class)) return (E)new MongoLockingSupport(this); else return null; }
Source:
public boolean configure(StaplerRequest req, JSONObject json) throws FormException { Jenkins j = Jenkins.getInstance(); if (json.has("primaryView")) { final String viewName = json.getString("primaryView"); final View newPrimaryView = j.getView(viewName); if (newPrimaryView == null) { throw new FormException("The specified primary view does not exist: " + viewName, "primaryView"); } j.setPrimaryView(newPrimaryView); } else { j.setPrimaryView(j.getViews().iterator().next()); } return true; }

Target:
public boolean configure(StaplerRequest req, JSONObject json) throws FormException { Jenkins j = Jenkins.getInstance(); if (json.has("primaryView")) { final String viewName = json.getString("primaryView"); final View newPrimaryView = j.getView(viewName); if (newPrimaryView == null) { throw new FormException(Messages.GlobalDefaultViewConfiguration_ViewDoesNotExist(viewName), "primaryView"); } j.setPrimaryView(newPrimaryView); } else { j.setPrimaryView(j.getViews().iterator().next()); } return true; }
Source:
public boolean validateTopologySettingInInstanceConfig(ClusterConfig clusterConfig, String instanceName) throws IllegalArgumentException{ Topology.computeInstanceTopologyMap(clusterConfig, instanceName, this, false ); return true; }

Target:
public boolean validateTopologySettingInInstanceConfig(ClusterConfig clusterConfig, String instanceName) { Topology.computeInstanceTopologyMap(clusterConfig, instanceName, this, false ); return true; }
Source:
protected File getReportsDirectory(MavenProject pom, MojoInfo mojo) throws ComponentConfigurationException { String reportsDirectoryOverride = getReportsDirectoryOverride(mojo); if (reportsDirectoryOverride != null) return mojo.expressionEvaluator.alignToBaseDirectory(new File(reportsDirectoryOverride)); if (this.reportDirectoryConfigKey != null) { File reportsDir = mojo.getConfigurationValue(this.reportDirectoryConfigKey, File.class); if (reportsDir != null) return reportsDir; } return new File(pom.getBuild().getDirectory(), "surefire-reports"); }

Target:
@Nonnull protected File getReportsDirectory(MavenProject pom, MojoInfo mojo) throws ComponentConfigurationException { String reportsDirectoryOverride = getReportsDirectoryOverride(mojo); if (reportsDirectoryOverride != null) return mojo.expressionEvaluator.alignToBaseDirectory(new File(reportsDirectoryOverride)); if (this.reportDirectoryConfigKey != null) { File reportsDir = mojo.getConfigurationValue(this.reportDirectoryConfigKey, File.class); if (reportsDir != null) return reportsDir; } return new File(pom.getBuild().getDirectory(), "surefire-reports"); }
Source:
private static String createDescription(Object args) { if (args instanceof Collection) { return Arrays.toString(((Collection) args).toArray()); } return ObjectUtils.toString(args); }

Target:
private static String createDescription(Object args) { if (args instanceof Collection) { return Arrays.toString(((Collection) args).toArray()); } if (args instanceof SerializableVoid) { return ""; } return ObjectUtils.toString(args); }
Source:
public Object get(String column) { if ( column.contains( "." ) ) { String[] fields = column.split( "\\." ); return this.getObject( this.dbObject.toMap(), fields ); } else { return this.dbObject.get( column ); } }

Target:
public Object get(String column) { if ( column.contains( "." ) ) { String[] fields = column.split( EMBEDDED_FIELDNAME_SEPARATOR ); return this.getObject( this.dbObject.toMap(), fields, 0 ); } else { return this.dbObject.get( column ); } }
Source:
public static <INPUT, OUTPUT> List<Callable<Collection<OUTPUT>>> partitionWork(Collection<INPUT> work, PartitionFactory<INPUT, OUTPUT> factory) throws Exception { List<Callable<Collection<OUTPUT>>> callables = new LinkedList<Callable<Collection<OUTPUT>>>(); if (!work.isEmpty()) { int partitionSize = Math.max(1, work.size() / partitions); List<INPUT> workList = new LinkedList<INPUT>(work); List<List<INPUT>> partitioned = Lists.partition(workList, partitionSize); for (List<INPUT> partition : partitioned) { Callable<Collection<OUTPUT>> worker = factory.createWorker(partition); callables.add(worker); } } return callables; }

Target:
public static <INPUT, OUTPUT> List<Callable<Collection<OUTPUT>>> partitionWork(Collection<INPUT> work, PartitionFactory<INPUT, OUTPUT> factory) throws Exception { List<Callable<Collection<OUTPUT>>> callables = new LinkedList<Callable<Collection<OUTPUT>>>(); if (!work.isEmpty()) { int partitionSize = Math.max(1, work.size() / partitions); List<INPUT> subList = new LinkedList<INPUT>(); int index = 0; Iterator<INPUT> iterator = work.iterator(); while (iterator.hasNext()) { subList.add(iterator.next()); if (index != 0 && partitionSize != 0 && (index % partitionSize == 0)) { Callable<Collection<OUTPUT>> worker = factory.createWorker(subList); callables.add(worker); subList = new LinkedList<INPUT>(); } index++; } if (!subList.isEmpty()) { Callable<Collection<OUTPUT>> worker = factory.createWorker(subList); callables.add(worker); } } return callables; }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); imageViewContact = (ImageView) findViewById(R.id.image_contact); imageViewLookup = (ImageView) findViewById(R.id.image_lookup); imageViewPhoto = (ImageView) findViewById(R.id.image_photo); imageViewDisplayPhoto = (ImageView) findViewById(R.id.image_display_photo); numberEntry = (EditText) findViewById(R.id.number_entry); if (ContextCompat.checkSelfPermission(this.getApplication(), Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_CONTACTS}, READ_CONTACTS); } findViewById(R.id.button_pick_contact).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI); startActivityForResult(intent, REQUEST_CONTACT); } }); findViewById(R.id.button_find).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Uri uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(numberEntry.getText().toString())); GlideRequests glideRequests = GlideApp.with(MainActivity.this); RequestOptions originalSize = new RequestOptions().override(Target.SIZE_ORIGINAL); glideRequests.load(uri).apply(originalSize).into(imageViewLookup); } }); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); imageViewContact = (ImageView) findViewById(R.id.image_contact); imageViewLookup = (ImageView) findViewById(R.id.image_lookup); imageViewPhoto = (ImageView) findViewById(R.id.image_photo); imageViewDisplayPhoto = (ImageView) findViewById(R.id.image_display_photo); numberEntry = (EditText) findViewById(R.id.number_entry); if (ContextCompat.checkSelfPermission( getApplication(), Manifest.permission.READ_CONTACTS) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.READ_CONTACTS}, READ_CONTACTS); } findViewById(R.id.button_pick_contact).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(Intent.ACTION_PICK, Contacts.CONTENT_URI); startActivityForResult(intent, REQUEST_CONTACT); } }); findViewById(R.id.button_find).setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Uri uri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(numberEntry.getText().toString())); GlideApp.with(MainActivity.this) .load(uri) .override(Target.SIZE_ORIGINAL) .into(imageViewLookup); } }); }
Source:
private boolean validatePage() { if (dcc.getDirectory() == null || dcc.getDirectory().equals("")) { setErrorMessage("Destination not selected!"); return false; } if(0 == systemTree.getCheckedElements().length){ setErrorMessage("Nothing selected for FMU generation!"); return false; } if (!isSomeLibrarySelected()){ setErrorMessage("No libraries selected to include"); return false; } setErrorMessage(null); return true; }

Target:
private boolean validatePage() { if ("".equals(dcc.getDirectory())){ setErrorMessage("Destination not selected!"); return false; } if(0 == systemTree.getCheckedElements().length){ setErrorMessage("Nothing selected for FMU generation!"); return false; } if (!isSomeLibrarySelected()){ setErrorMessage("No libraries selected to include"); return false; } setErrorMessage(null); return true; }
Source:
public void applyEnrichmentTag_NotHandledTagType() { when(enrichmentTag.getTagType()).thenReturn("ABC"); defaultEnrichmentTagApplier.applyEnrichmentTag(judgment, enrichmentTag); verifyZeroInteractions(enrichmentTagValueConverter, jsonStringParser, judgmentUpdater); }

Target:
public void applyEnrichmentTag_NotHandledTagType() { when(enrichmentTag.getTagType()).thenReturn("ABC"); catchException(defaultEnrichmentTagApplier).applyEnrichmentTag(judgment, enrichmentTag); assertTrue(caughtException() instanceof IllegalArgumentException); verifyZeroInteractions(enrichmentTagValueConverter, jsonStringParser, judgmentUpdater); }
Source:
public void testPrepareSolution() throws IOException { System.out.println("prepareSolution"); File originProject = new File("src/test/resources/arith_funcs/"); File targetFolder = createTemporaryCopyOf(originProject); ExerciseBuilder instance = new ExerciseBuilder(); instance.prepareSolution(targetFolder.toPath()); File expectedFolder = new File("src/test/resources/arith_funcs_solution/src"); File outputFolder = new File(targetFolder.getAbsolutePath() + "/src"); Map<String, File> expectedFiles = getFileMap(expectedFolder); Map<String, File> actualFiles = getFileMap(outputFolder); for(String fileName : expectedFiles.keySet()) { File expected = expectedFiles.get(fileName); File actual = actualFiles.get(fileName); List<String> expectedLines = FileUtils.readLines(expected); List<String> actualLines = FileUtils.readLines(actual); for (int i = 0 ; i < expectedLines.size() ; ++i) { String expectedLine = expectedLines.get(i); String actualLine = actualLines.get(i); assertEquals("Line in file " + fileName + " did not match ", expectedLine, actualLine); } } }

Target:
public void testPrepareSolution() throws IOException { File originProject = new File("src/test/resources/arith_funcs/"); File targetFolder = createTemporaryCopyOf(originProject); ExerciseBuilder instance = new ExerciseBuilder(); instance.prepareSolution(targetFolder.toPath()); File expectedFolder = new File("src/test/resources/arith_funcs_solution/src"); File outputFolder = new File(targetFolder.getAbsolutePath() + "/src"); assertFileLines(expectedFolder, outputFolder); }
Source:
public void testNoUriUnsubscribeOutput() throws Exception { StoredConfig dbconfig = db.getConfig(); RemoteConfig remoteConfig = new RemoteConfig(dbconfig, "origin"); remoteConfig.setTimeout(0); remoteConfig.update(dbconfig); dbconfig.save(); String[] output = execute("git unsubscribe origin"); assertArrayEquals("expected unsuccessful unsubscribe", new String[] { MessageFormat.format( CLIText.get().noRemoteUriUnsubscribe, "origin"), "" }, output); }

Target:
public void testNoUriUnsubscribeOutput() throws Exception { setupEmptyConfig(); try { execute("git unsubscribe origin"); } catch (Exception e) { assertEquals(MessageFormat.format( CLIText.get().noRemoteUriUnsubscribe, "origin"), e.getMessage()); return; } fail("Should have died"); }
Source:
Interval findIntervalForKillTask(String dataSource, int limit) { List<Interval> unusedSegmentIntervals = segmentManager.getUnusedSegmentIntervals( dataSource, new Interval( 0, System.currentTimeMillis() - retainDuration ), limit ); if (unusedSegmentIntervals != null && unusedSegmentIntervals.size() > 0) { long start = -1; long end = -1; for (Interval interval : unusedSegmentIntervals) { if (start == -1 || start > interval.getStartMillis()) { start = interval.getStartMillis(); } if (end == -1 || end < interval.getEndMillis()) { end = interval.getEndMillis(); } } return new Interval(start, end); } else { return null; } }

Target:
Interval findIntervalForKillTask(String dataSource, int limit) { List<Interval> unusedSegmentIntervals = segmentManager.getUnusedSegmentIntervals( dataSource, new Interval( 0, System.currentTimeMillis() - retainDuration ), limit ); if (unusedSegmentIntervals != null && unusedSegmentIntervals.size() > 0) { return JodaUtils.umbrellaInterval(unusedSegmentIntervals); } else { return null; } }
Source:
public abstract void doExecute() throws MojoExecutionException, MojoFailureException; public void initMojo() { if (projectBuildDirectory != null) { new ProjectDirectoryUpdater(project).updateBuildDirectory(projectBuildDirectory); } if (!lightweightPackage) { useLocalRepository = false; } }

Target:
public abstract void doExecute() throws MojoExecutionException, MojoFailureException; public void initMojo() { if (projectBuildDirectory != null) { new ProjectDirectoryUpdater(project).updateBuildDirectory(projectBuildDirectory); } if (!lightweightPackage && useLocalRepository) { getLog().info("'useLocalRepository' would be ignored, it could only be used when 'lightweightPackage' is enabled"); useLocalRepository = false; } }
Source:
public WifiParsedResult parse(Result result) { String rawText = getMassagedText(result); if (!rawText.startsWith("WIFI:")) { return null; } rawText = ";" + rawText.substring("WIFI:".length()); String ssid = matchSinglePrefixedField(";S:", rawText, ';', false); if (ssid == null || ssid.isEmpty()) { return null; } String pass = matchSinglePrefixedField(";P:", rawText, ';', false); String type = matchSinglePrefixedField(";T:", rawText, ';', false); if (type == null) { type = "nopass"; } boolean hidden = Boolean.parseBoolean(matchSinglePrefixedField(";H:", rawText, ';', false)); String identity = matchSinglePrefixedField(";I:", rawText, ';', false); String anonymousIdentity = matchSinglePrefixedField(";AI:", rawText, ';', false); String eapMethod = matchSinglePrefixedField(";E:", rawText, ';', false); String phase2Method = matchSinglePrefixedField(";PH2:", rawText, ';', false); return new WifiParsedResult(type, ssid, pass, hidden, identity, anonymousIdentity, eapMethod, phase2Method); }

Target:
public WifiParsedResult parse(Result result) { String rawText = getMassagedText(result); if (!rawText.startsWith("WIFI:")) { return null; } rawText = rawText.substring("WIFI:".length()); String ssid = matchSinglePrefixedField("S:", rawText, ';', false); if (ssid == null || ssid.isEmpty()) { return null; } String pass = matchSinglePrefixedField("P:", rawText, ';', false); String type = matchSinglePrefixedField("T:", rawText, ';', false); if (type == null) { type = "nopass"; } boolean hidden = Boolean.parseBoolean(matchSinglePrefixedField("H:", rawText, ';', false)); String identity = matchSinglePrefixedField("I:", rawText, ';', false); String anonymousIdentity = matchSinglePrefixedField("A:", rawText, ';', false); String eapMethod = matchSinglePrefixedField("E:", rawText, ';', false); String phase2Method = matchSinglePrefixedField("H:", rawText, ';', false); return new WifiParsedResult(type, ssid, pass, hidden, identity, anonymousIdentity, eapMethod, phase2Method); }
Source:
public static Password promptUser() throws IOException { if (System.console() == null) { return null; } ConsoleReader reader = new ConsoleReader(); String enteredPass = reader.readLine("Enter password: ", '*'); return new Password(enteredPass); }

Target:
public static Password promptUser() throws IOException { if (System.console() == null) { throw new IOException("Attempted to prompt user on the console when System.console = null"); } ConsoleReader reader = new ConsoleReader(); String enteredPass = reader.readLine("Enter password: ", '*'); return new Password(enteredPass); }
Source:
public void toSchemaOrgTest() throws IOException, URISyntaxException { FullBeanImpl bean = MockFullBean.mock(); String output = SchemaOrgUtils.toSchemaOrg(bean); Assert.assertNotNull(output); InputStream stream = getClass().getResourceAsStream(FULL_BEAN_FILE); String expectedOutput = IOUtils.toString(stream, StandardCharsets.UTF_8); System.out.println(output); assertEquals(expectedOutput.length(), output.length()); }

Target:
public void toSchemaOrgTest() throws IOException, URISyntaxException { FullBeanImpl bean = MockFullBean.mock(); String output = SchemaOrgUtils.toSchemaOrg(bean); Assert.assertNotNull(output); try (InputStream stream = getClass().getResourceAsStream(FULL_BEAN_FILE)) { String expectedOutput = IOUtils.toString(stream, StandardCharsets.UTF_8); assertEquals(expectedOutput.length(), output.length()); } }
Source:
public String clientAddress() { try { return session.getRemoteAddress().toString(); } catch (NullPointerException ex) { return null; } }

Target:
public String clientAddress() { Session session = getSession(); return session != null ? session.getRemoteAddress().toString() : null; }
Source:
protected void drawWithoutTransforms(Context2D context, double alpha, BoundingBox bb) { final boolean isSelectionLayer = context.isSelection(); if (isSelectionLayer && (false == isListening())) { return; } alpha = alpha * getAttributes().getAlpha(); if (alpha <= 0) { return; } if (model.getColumns().isEmpty()) { return; } this.removeAll(); if (!isSelectionLayer) { this.renderingInformation = prepare(); if (renderingInformation == null) { destroyDOMElementResources(); return; } makeRenderingCommands(); } layerRenderGroups(); executeRenderQueueCommands(isSelectionLayer); if (!isSelectionLayer) { for (GridColumn<?> column : bodyColumns) { if (column instanceof HasMultipleDOMElementResources) { ((HasMultipleDOMElementResources) column).freeUnusedResources(); } } for (GridColumn<?> column : floatingColumns) { if (column instanceof HasMultipleDOMElementResources) { ((HasMultipleDOMElementResources) column).freeUnusedResources(); } } } super.drawWithoutTransforms(context, alpha, bb); }

Target:
protected void drawWithoutTransforms(Context2D context, double alpha, BoundingBox bb) { final boolean isSelectionLayer = context.isSelection(); if (isSelectionLayer && (false == isListening())) { return; } alpha = alpha * getAttributes().getAlpha(); if (alpha <= 0) { return; } if (model.getColumns().isEmpty()) { return; } this.removeAll(); if (!isSelectionLayer) { this.renderingInformation = prepare(); if (renderingInformation == null) { destroyDOMElementResources(); return; } makeRenderingCommands(); } layerRenderGroups(); executeRenderQueueCommands(isSelectionLayer); if (!isSelectionLayer) { Stream.concat(bodyColumns.stream(), floatingColumns.stream()) .filter(column -> column instanceof HasMultipleDOMElementResources) .map(column -> (HasMultipleDOMElementResources) column) .forEach(HasMultipleDOMElementResources::freeUnusedResources); } super.drawWithoutTransforms(context, alpha, bb); }
Source:
public CompletableFuture<FileWrapper> getLatest(NetworkAccess network) { return network.synchronizer.getValue(owner(), writer()) .thenCompose(finished -> getUpdated(finished, network)); }

Target:
public CompletableFuture<FileWrapper> getLatest(NetworkAccess network) { return network.synchronizer.getValue(owner(), writer()) .thenCompose(latest -> getUpdated(latest, network)); }
Source:
public Predicate<? super T> getConstraint() { if (constraint != null) { constraint = Predicates.alwaysTrue(); } return constraint; }

Target:
public Predicate<? super T> getConstraint() { if (constraint != null) { return constraint; } else { return Predicates.alwaysTrue(); } }
Source:
public EnvironmentCDI() { List<BeanManagerImpl> managers = new ArrayList<BeanManagerImpl>(getContainer().beanDeploymentArchives().values()); Collections.sort(managers, BeanManagers.ID_COMPARATOR); try { this.fallbackBeanManager = managers.get(0); } catch (IndexOutOfBoundsException e) { throw new IllegalStateException(e); } }

Target:
public EnvironmentCDI() { List<BeanManagerImpl> managers = new ArrayList<BeanManagerImpl>(getContainer().beanDeploymentArchives().values()); if (!managers.isEmpty()) { Collections.sort(managers, BeanManagers.ID_COMPARATOR); this.fallbackBeanManager = managers.get(0); } else { this.fallbackBeanManager = null; } }
Source:
public void transformModifiers(@NotNull PsiModifierList modifierList, @NotNull final Set<String> modifiers) { if (UtilityClassModifierProcessor.isModifierListSupported(modifierList) || modifiers.contains(PsiModifier.STATIC)) { return; } final PsiClass searchableClass = PsiTreeUtil.getParentOfType(modifierList, PsiClass.class, true); if (searchableClass == null) { return; } @Nullable final PsiAnnotation fieldDefaultsAnnotation = PsiAnnotationSearchUtil.findAnnotation(searchableClass, lombok.experimental.FieldDefaults.class); final boolean isConfigDefaultFinal = isConfigDefaultFinal(searchableClass); final boolean isConfigDefaultPrivate = isConfigDefaultPrivate(searchableClass); final PsiField parentField = (PsiField) modifierList.getParent(); if (shouldMakeFinal(parentField, fieldDefaultsAnnotation, isConfigDefaultFinal)) { modifiers.add(PsiModifier.FINAL); } if (canChangeVisibility(parentField, modifierList)) { final AccessLevel defaultAccessLevel = detectDefaultAccessLevel(fieldDefaultsAnnotation, isConfigDefaultPrivate); switch (defaultAccessLevel) { case PRIVATE: modifiers.add(PsiModifier.PRIVATE); modifiers.remove(PsiModifier.PACKAGE_LOCAL); break; case PROTECTED: modifiers.add(PsiModifier.PROTECTED); modifiers.remove(PsiModifier.PACKAGE_LOCAL); break; case PUBLIC: modifiers.add(PsiModifier.PUBLIC); modifiers.remove(PsiModifier.PACKAGE_LOCAL); break; } } }

Target:
public void transformModifiers(@NotNull PsiModifierList modifierList, @NotNull final Set<String> modifiers) { if (modifiers.contains(PsiModifier.STATIC) || UtilityClassModifierProcessor.isModifierListSupported(modifierList)) { return; } final PsiClass searchableClass = PsiTreeUtil.getParentOfType(modifierList, PsiClass.class, true); if (searchableClass == null) { return; } @Nullable final PsiAnnotation fieldDefaultsAnnotation = PsiAnnotationSearchUtil.findAnnotation(searchableClass, lombok.experimental.FieldDefaults.class); final boolean isConfigDefaultFinal = isConfigDefaultFinal(searchableClass); final boolean isConfigDefaultPrivate = isConfigDefaultPrivate(searchableClass); final PsiField parentField = (PsiField) modifierList.getParent(); if (shouldMakeFinal(parentField, fieldDefaultsAnnotation, isConfigDefaultFinal)) { modifiers.add(PsiModifier.FINAL); } if (canChangeVisibility(parentField, modifierList)) { final AccessLevel defaultAccessLevel = detectDefaultAccessLevel(fieldDefaultsAnnotation, isConfigDefaultPrivate); switch (defaultAccessLevel) { case PRIVATE: modifiers.add(PsiModifier.PRIVATE); modifiers.remove(PsiModifier.PACKAGE_LOCAL); break; case PROTECTED: modifiers.add(PsiModifier.PROTECTED); modifiers.remove(PsiModifier.PACKAGE_LOCAL); break; case PUBLIC: modifiers.add(PsiModifier.PUBLIC); modifiers.remove(PsiModifier.PACKAGE_LOCAL); break; } } }
Source:
protected void verifyName() throws CoreException { if (fNameWidget.isVisible()) { ILaunchManager mgr = DebugPlugin.getDefault().getLaunchManager(); String currentName = fNameWidget.getText().trim(); if (currentName.length() < 1) { throw new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, LaunchConfigurationsMessages.LaunchConfigurationDialog_Name_required_for_launch_configuration_11, null)); } try { mgr.isValidLaunchConfigurationName(currentName); } catch(IllegalArgumentException iae) { throw new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, iae.getMessage(), null)); } if (fOriginal != null && !fOriginal.getName().equals(currentName)) { Set<String> reservednames = ((LaunchConfigurationsDialog) getLaunchConfigurationDialog()).getReservedNameSet(); if (mgr.isExistingLaunchConfigurationName(currentName) || (reservednames != null ? reservednames.contains(currentName) : false)) { ILaunchConfiguration config = ((LaunchManager)mgr).findLaunchConfiguration(currentName); String configTypeName = (config != null) ? config.getType().getName() : fOriginal.getType().getName(); throw new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, NLS.bind(LaunchConfigurationsMessages.LaunchConfigurationDialog_Launch_configuration_already_exists_with_this_name_12, configTypeName), null)); } } } }

Target:
protected void verifyName() throws CoreException { if (fNameWidget.isVisible()) { ILaunchManager mgr = DebugPlugin.getDefault().getLaunchManager(); String currentName = fNameWidget.getText().trim(); if (currentName.length() < 1) { throw new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, LaunchConfigurationsMessages.LaunchConfigurationDialog_Name_required_for_launch_configuration_11, null)); } try { mgr.isValidLaunchConfigurationName(currentName); } catch(IllegalArgumentException iae) { throw new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, iae.getMessage(), null)); } if (fOriginal != null && !fOriginal.getName().equals(currentName)) { Set<String> reservednames = ((LaunchConfigurationsDialog) getLaunchConfigurationDialog()).getReservedNameSet(); if (mgr.isExistingLaunchConfigurationName(currentName) || (reservednames != null ? reservednames.contains(currentName) : false)) { ILaunchConfiguration config = ((LaunchManager)mgr).findLaunchConfiguration(currentName); String configTypeName = config != null ? config.getType().getName() : fOriginal.getType().getName(); throw new CoreException(new Status(IStatus.ERROR, DebugUIPlugin.getUniqueIdentifier(), 0, NLS.bind(LaunchConfigurationsMessages.LaunchConfigurationDialog_Launch_configuration_already_exists_with_this_name_12, configTypeName), null)); } } } }
Source:
private void readPipelinedResponse(Queue<String> pipelinedCommands) throws IOException, MessagingException { int noOfPipelinedResponse = pipelinedCommands.size(); String responseLine = null; List<String> results = new ArrayList<>(); while (noOfPipelinedResponse > 0) { results.clear(); responseLine = readCommandResponseLine(results); try { responseLineToCommandResponse(responseLine, results); } catch (NegativeSmtpReplyException exception) { Log.d(LOG_TAG, "SMTP <<< " + exception.getReplyCode() + exception.getReplyText()); } catch (MessagingException exception) { } noOfPipelinedResponse-- ; } try { responseLineToCommandResponse(responseLine, results); } catch (NegativeSmtpReplyException exception) { throw exception; } }

Target:
private void readPipelinedResponse(Queue<String> pipelinedCommands) throws IOException, MessagingException { String responseLine; List<String> results = new ArrayList<>(); NegativeSmtpReplyException negativeRecipient = null; for (String command : pipelinedCommands) { results.clear(); responseLine = readCommandResponseLine(results); try { responseLineToCommandResponse(responseLine, results); } catch (MessagingException exception) { if (command.equals("DATA")) { throw exception; } if (command.startsWith("RCPT")) { negativeRecipient = (NegativeSmtpReplyException) exception; } } } if (negativeRecipient != null) { try { executeCommand("."); throw negativeRecipient; } catch (NegativeSmtpReplyException e) { throw negativeRecipient; } } }
Source:
private ReaderWithOffsets createOffsetReader(RecordReader<?, ?> sourceReader, TableDesc tableDesc) throws IOException { int headerCount = Utilities.getHeaderCount(tableDesc); int footerCount = Utilities.getFooterCount(tableDesc, jobConf); if (LlapIoImpl.LOG.isDebugEnabled()) { LlapIoImpl.LOG.debug("Using to read data with HeaderSkip and FooterSkip {}", sourceReader.getClass().getSimpleName(), headerCount, footerCount); } if (isLrrEnabled && sourceReader instanceof LineRecordReader) { return LineRrOffsetReader.create((LineRecordReader)sourceReader, jobConf, headerCount, footerCount); } return new PassThruOffsetReader(sourceReader, jobConf, headerCount, footerCount); }

Target:
private ReaderWithOffsets createOffsetReader(RecordReader<?, ?> sourceReader, TableDesc tableDesc) throws IOException { int headerCount = Utilities.getHeaderCount(tableDesc); int footerCount = Utilities.getFooterCount(tableDesc, jobConf); if (LlapIoImpl.LOG.isDebugEnabled()) { LlapIoImpl.LOG.debug("Using to read data with skip.header.line.count and skip.footer.line.count {}", sourceReader.getClass().getSimpleName(), headerCount, footerCount); } if (isLrrEnabled && sourceReader instanceof LineRecordReader) { return LineRrOffsetReader.create((LineRecordReader)sourceReader, jobConf, headerCount, footerCount); } return new PassThruOffsetReader(sourceReader, jobConf, headerCount, footerCount); }