auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ShapelessCraftingRecipe build() { <START> Preconditions.checkState(this.exemplaryResult != null && this.exemplaryResult != ItemStackSnapshot.NONE, <END> "The result is not set."); Preconditions.checkState(!this.ingredients.isEmpty(), "The ingredients are not set."); return new SpongeShapelessCraftingRecipe(exemplaryResult, ingredients); }</code><technical_language>static import checkState method</technical_language>

Target:
public ShapelessCraftingRecipe build() { checkState(this.exemplaryResult != null && this.exemplaryResult != ItemStackSnapshot.NONE, "The result is not set."); checkState(!this.ingredients.isEmpty(), "The ingredients are not set."); return new SpongeShapelessCraftingRecipe(this.exemplaryResult, this.ingredients); }
Source:
<code>public void baseClassTearDown() { releaseBrowser(); <START> removeTestData(); <END> }</code><technical_language>need removeTestData? Is done in removeAndRestoreDataBundle</technical_language>

Target:
public void baseClassTearDown() { releaseBrowser(); }
Source:
<code>public void before() throws Throwable { if (Thread.interrupted()) { <START> System.err.println("was interrupted before start"); <END> } if(Functions.isWindows()) { URLConnection aConnection = new File(".").toURI().toURL().openConnection(); origDefaultUseCache = aConnection.getDefaultUseCaches(); aConnection.setDefaultUseCaches(false); } if (Boolean.getBoolean("ignore.random.failures")) { RandomlyFails rf = testDescription.getAnnotation(RandomlyFails.class); if (rf != null) { throw new AssumptionViolatedException("Known to randomly fail: " + rf.value()); } } env = new TestEnvironment(testDescription); env.pin(); recipe(); AbstractProject.WORKSPACE.toString(); User.clear(); try { jenkins = hudson = newHudson(); } catch (Exception e) { Field f = Jenkins.class.getDeclaredField("theInstance"); f.setAccessible(true); f.set(null,null); throw e; } jenkins.setNoUsageStatistics(true); jenkins.setCrumbIssuer(new TestCrumbIssuer()); jenkins.servletContext.setAttribute("app",jenkins); jenkins.servletContext.setAttribute("version","?"); WebAppMain.installExpressionFactory(new ServletContextEvent(jenkins.servletContext)); jenkins.getJDKs().add(new JDK("default",System.getProperty("java.home"))); configureUpdateCenter(); jenkins.getActions().add(this); JenkinsLocationConfiguration.get().setUrl(getURL().toString()); setUpTimeout(); }</code><technical_language>logger</technical_language>

Target:
public void before() throws Throwable { if (Thread.interrupted()) { LOGGER.warning("was interrupted before start"); } if(Functions.isWindows()) { URLConnection aConnection = new File(".").toURI().toURL().openConnection(); origDefaultUseCache = aConnection.getDefaultUseCaches(); aConnection.setDefaultUseCaches(false); } if (Boolean.getBoolean("ignore.random.failures")) { RandomlyFails rf = testDescription.getAnnotation(RandomlyFails.class); if (rf != null) { throw new AssumptionViolatedException("Known to randomly fail: " + rf.value()); } } env = new TestEnvironment(testDescription); env.pin(); recipe(); AbstractProject.WORKSPACE.toString(); User.clear(); try { jenkins = hudson = newHudson(); } catch (Exception e) { Field f = Jenkins.class.getDeclaredField("theInstance"); f.setAccessible(true); f.set(null,null); throw e; } jenkins.setNoUsageStatistics(true); jenkins.setCrumbIssuer(new TestCrumbIssuer()); jenkins.servletContext.setAttribute("app",jenkins); jenkins.servletContext.setAttribute("version","?"); WebAppMain.installExpressionFactory(new ServletContextEvent(jenkins.servletContext)); jenkins.getJDKs().add(new JDK("default",System.getProperty("java.home"))); configureUpdateCenter(); jenkins.getActions().add(this); JenkinsLocationConfiguration.get().setUrl(getURL().toString()); setUpTimeout(); }
Source:
<code>public void testIPv4CountryOnly() throws Exception { <START> morphline = buildCommand("ip", "GeoLite2-Country.mmdb"); <END> final Record record = new Record(); final String ip = "128.101.101.101"; record.put("ip", ip); processAndVerifySuccess(record, true, false, 6252001, null); }</code><technical_language>original unit test well</technical_language>

Target:
public void testIPv4CountryOnly() throws Exception { morphline = buildCommand("ip", "GeoLite2-Country.mmdb"); final Record record = new Record(); final String ip = "128.101.101.101"; record.put("ip", ip); processAndVerifySuccess2(record, true, false, 6252001, null); }
Source:
<code>private static String processNumericType(String mgrsPart) { String[] numericParts = mgrsPart.split("[ ]+"); StringBuilder numericBuilder = new StringBuilder(); Runnable appendZero = () -> numericBuilder.append("0"); if (numericParts.length == 1) { String eastingAndNorthing = numericParts[0]; LOGGER.trace( "NUMERIC had no white space; easting and northing will be parsed as one [{}]", mgrsPart, <START> eastingAndNorthing); <END> if (eastingAndNorthing.length() >= MIN_EASTING_NORTHING_LENGTH) { return eastingAndNorthing; } int numberOfZerosNeeded = MIN_EASTING_NORTHING_LENGTH - eastingAndNorthing.length(); repeat(numberOfZerosNeeded, appendZero); return numericBuilder.append(eastingAndNorthing).toString(); } else { String easting = numericParts[0]; String northing = numericParts[1]; LOGGER.trace( "NUMERIC had white space; easting = and northing = [{}]", mgrsPart, easting, northing); if (easting.length() == MIN_EASTING_LENGTH) { return easting + northing; } int numberOfZerosNeeded = MIN_EASTING_LENGTH - easting.length(); repeat(numberOfZerosNeeded, appendZero); return numericBuilder.append(easting).append(northing).toString(); } }</code><technical_language>If spaces in mgrsPart, mgrsPart eastingAndNorthing string? If this is case, purpose of putting in LOGGER</technical_language>

Target:
private static String processNumericType(String mgrsPart) { final String[] numericParts = mgrsPart.split("(\\W)+"); if (numericParts.length >= 3 || numericParts.length == 0) { throw new IllegalArgumentException( "The mgrs part provided is not a valid NUMERIC type: " + mgrsPart); } if (numericParts.length == 2) { return assemble(numericParts[0], numericParts[1]); } String eastingAndNorthing = numericParts[0]; if (eastingAndNorthing.length() % 2 > 0) { eastingAndNorthing = eastingAndNorthing.substring(0, eastingAndNorthing.length() - 1); } final int halfway = eastingAndNorthing.length() / 2; final String easting = eastingAndNorthing.substring(0, halfway); final String northing = eastingAndNorthing.substring(halfway); return assemble(easting, northing); }
Source:
<code>public static void main(String[] args) { if (args.length == 0) { System.err.println("No message id specified"); System.exit(1); } String messageId = args[0]; List<String> scopes = new ArrayList<String>(); scopes.add(YouTubeScopes.YOUTUBE_FORCE_SSL); scopes.add(YouTubeScopes.YOUTUBE); try { Credential credential = Auth.authorize(scopes, "deletelivechatmessage"); youtube = new YouTube.Builder(Auth.HTTP_TRANSPORT, Auth.JSON_FACTORY, credential) .setApplicationName("youtube-cmdline-deletechatmessages-sample").build(); String liveChatId = GetLiveChatId.getLiveChatId( youtube, args.length == 2 ? args[1] : null); if (liveChatId != null) { System.out.println("Live chat id: " + liveChatId); } else { System.err.println("Unable to find a live chat id"); System.exit(1); <START> } <END> YouTube.LiveChatMessages.Delete liveChatDelete = youtube.liveChatMessages().delete(messageId); liveChatDelete.execute(); System.out.println("Deleted message id " + messageId); } catch (GoogleJsonResponseException e) { System.err .println("GoogleJsonResponseException code: " + e.getDetails().getCode() + " : " + e.getDetails().getMessage()); e.printStackTrace(); } catch (IOException e) { System.err.println("IOException: " + e.getMessage()); e.printStackTrace(); } catch (Throwable t) { System.err.println("Throwable: " + t.getMessage()); t.printStackTrace(); } }</code><technical_language>I need retrieve a liveChatId (lines 69-78). (The liveChatId is in this method.)</technical_language>

Target:
public static void main(String[] args) { if (args.length == 0) { System.err.println("No message id specified"); System.exit(1); } String messageId = args[0]; List<String> scopes = Lists.newArrayList(YouTubeScopes.YOUTUBE_FORCE_SSL); try { Credential credential = Auth.authorize(scopes, "deletelivechatmessage"); youtube = new YouTube.Builder(Auth.HTTP_TRANSPORT, Auth.JSON_FACTORY, credential) .setApplicationName("youtube-cmdline-deletechatmessages-sample").build(); YouTube.LiveChatMessages.Delete liveChatDelete = youtube.liveChatMessages().delete(messageId); liveChatDelete.execute(); System.out.println("Deleted message id " + messageId); } catch (GoogleJsonResponseException e) { System.err .println("GoogleJsonResponseException code: " + e.getDetails().getCode() + " : " + e.getDetails().getMessage()); e.printStackTrace(); } catch (IOException e) { System.err.println("IOException: " + e.getMessage()); e.printStackTrace(); } catch (Throwable t) { System.err.println("Throwable: " + t.getMessage()); t.printStackTrace(); } }
Source:
<code>public void shouldCreateAndDropIndex() { String indexName = "test_index"; Mono<Boolean> indexExists = reactorClient.indexExists(null, args.namespace, indexName); StepVerifier.create(indexExists) .expectNext(false) .verifyComplete(); Mono<Void> created = reactorClient.createIndex(null, args.namespace, args.set, indexName, indexName, IndexType.NUMERIC, IndexCollectionType.DEFAULT); <START> <END> StepVerifier.create(created) .verifyComplete(); indexExists = reactorClient.indexExists(null, args.namespace, indexName); StepVerifier.create(indexExists) .expectNext(true) .verifyComplete(); Mono<Void> dropped = reactorClient.dropIndex(null, args.namespace, args.set, indexName); StepVerifier.create(dropped) .verifyComplete(); indexExists = reactorClient.indexExists(null, args.namespace, indexName); StepVerifier.create(indexExists) .expectNext(false) .verifyComplete(); }</code><technical_language>If call create index params 2 times is expected result? please cover test? for delete operation nice</technical_language>

Target:
public void shouldCreateAndDropIndex() { Mono<Void> created = reactorClient.createIndex(null, args.namespace, args.set, indexName, args.getBinName(binName), IndexType.NUMERIC, IndexCollectionType.DEFAULT); StepVerifier.create(created) .verifyComplete(); Mono<Void> dropped = reactorClient.dropIndex(null, args.namespace, args.set, indexName); StepVerifier.create(dropped) .verifyComplete(); }
Source:
<code>private synchronized String mergeItem(Item item) { String id; try(DataDomainManager dm = new DataDomainManager()){ if (anyCycles(item)) { throw new CycleIntroductionException(); } List<Item> children = item.getChildren(); List<Item> replaceList = new LinkedList<>(); if (children != null) { for (Item child : children) { replaceList.add(load(child.getId())); } item.setChildren(replaceList); } em.merge(item); id = item.getId(); if(dm.load(id) != null){ List<Item> domainsToDelete = findVisibleAncestors(item); for(Item toDelete : domainsToDelete){ dm.regenerateDomainForItem(toDelete); } } <START> dm.close(); <END> } catch (Exception e){ log.error("Failed to save item: " + item.getId() + " | Error: " + e.getMessage()); id = null; } return id; }</code><technical_language>close own, need close it</technical_language>

Target:
private synchronized String mergeItem(Item item) { String id; try(DataDomainManager dm = new DataDomainManager()){ if (anyCycles(item)) { throw new CycleIntroductionException(); } List<Item> children = item.getChildren(); List<Item> replaceList = new LinkedList<>(); if (children != null) { for (Item child : children) { replaceList.add(load(child.getId())); } item.setChildren(replaceList); } em.merge(item); id = item.getId(); if(dm.load(id) != null){ List<Item> domainsToDelete = findVisibleAncestors(item); for(Item toDelete : domainsToDelete){ dm.regenerateDomainForItem(toDelete); } } } catch (Exception e){ log.error("Failed to save item: " + item.getId() + " | Error: " + e.getMessage()); id = null; } return id; }
Source:
<code>public void before() { <START> when(this.environment.jersey()).thenReturn(this.jerseyEnvironment); <END> }</code><technical_language>I avoid this reference fields in unit test, name conflicts</technical_language>

Target:
public void before() { when(environment.jersey()).thenReturn(jerseyEnvironment); }
Source:
<code>public RecConstructDeclaration(String fieldName, ValueType type, IExpr iExpr, FileLocation loc) { super(fieldName, iExpr, loc); this.type = type; <START> System.out.println(); <END> System.out.println("target/corewyvernIL/decl/RecConstructDeclaration"); System.out.println("RecConstructDeclaration Called"); System.out.println(" RecConstruct Name: " + fieldName); System.out.println(" RecConstruct Type: " + type); System.out.println(" RecConstruct Body: " + iExpr); System.out.println(" RecConstruct Location: " + loc); System.out.println(); }</code><technical_language>remove printlns this is merged</technical_language>

Target:
public RecConstructDeclaration(String fieldName, ValueType type, IExpr iExpr, FileLocation loc) { super(fieldName, iExpr, loc); this.type = type; }
Source:
<code>public void query( IndexProgressor.NodeValueClient cursor, IndexOrder indexOrder, IndexQuery... predicates ) { if ( predicates.length != 1 ) { <START> throw new IllegalArgumentException( "Only single property temporal indexes are supported." ); <END> } IndexQuery predicate = predicates[0]; if ( predicate instanceof ExistsPredicate ) { BridgingIndexProgressor multiProgressor = new BridgingIndexProgressor( cursor, descriptor.schema().getPropertyIds() ); cursor.initialize( descriptor, multiProgressor, predicates ); for ( NativeSchemaIndexReader reader : this ) { reader.query( multiProgressor, indexOrder, predicates ); } } else { if ( validPredicate( predicate ) ) { CoordinateReferenceSystem crs; if ( predicate instanceof IndexQuery.ExactPredicate ) { crs = ((PointValue) ((IndexQuery.ExactPredicate) predicate).value()).getCoordinateReferenceSystem(); } else if ( predicate instanceof IndexQuery.GeometryRangePredicate ) { crs = ((IndexQuery.GeometryRangePredicate) predicate).crs(); } else { throw new IllegalArgumentException( "Wrong type of predicate, couldn't get CoordinateReferenceSystem" ); } SpatialIndexPartReader<SpatialSchemaKey,NativeSchemaValue> part = uncheckedSelect( crs ); if ( part != null ) { part.query( cursor, indexOrder, predicates ); } else { cursor.initialize( descriptor, IndexProgressor.EMPTY, predicates ); } } else { cursor.initialize( descriptor, IndexProgressor.EMPTY, predicates ); } } }</code><technical_language>temporal</technical_language>

Target:
public void query( IndexProgressor.NodeValueClient cursor, IndexOrder indexOrder, IndexQuery... predicates ) { if ( predicates.length != 1 ) { throw new IllegalArgumentException( "Only single property spatial indexes are supported." ); } IndexQuery predicate = predicates[0]; if ( predicate instanceof ExistsPredicate ) { loadAll(); BridgingIndexProgressor multiProgressor = new BridgingIndexProgressor( cursor, descriptor.schema().getPropertyIds() ); cursor.initialize( descriptor, multiProgressor, predicates ); for ( NativeSchemaIndexReader reader : this ) { reader.query( multiProgressor, indexOrder, predicates ); } } else { if ( validPredicate( predicate ) ) { CoordinateReferenceSystem crs; if ( predicate instanceof IndexQuery.ExactPredicate ) { crs = ((PointValue) ((IndexQuery.ExactPredicate) predicate).value()).getCoordinateReferenceSystem(); } else if ( predicate instanceof IndexQuery.GeometryRangePredicate ) { crs = ((IndexQuery.GeometryRangePredicate) predicate).crs(); } else { throw new IllegalArgumentException( "Wrong type of predicate, couldn't get CoordinateReferenceSystem" ); } SpatialIndexPartReader<SpatialSchemaKey,NativeSchemaValue> part = uncheckedSelect( crs ); if ( part != null ) { part.query( cursor, indexOrder, predicates ); } else { cursor.initialize( descriptor, IndexProgressor.EMPTY, predicates ); } } else { cursor.initialize( descriptor, IndexProgressor.EMPTY, predicates ); } } }
Source:
<code>EhcacheActiveEntity(ServiceRegistry services, byte[] config) { this.identity = ClusteredEhcacheIdentity.deserialize(config); this.services = services; this.responseFactory = new EhcacheEntityResponseFactory(); this.clientCommunicator = services.getService(new CommunicatorServiceConfiguration()); OffHeapResources offHeapResources = services.getService(new OffHeapResourcesServiceConfiguration()); <START> if(offHeapResources == null) { <END> this.offHeapResourceIdentifiers = Collections.EMPTY_SET; } else { this.offHeapResourceIdentifiers = offHeapResources.getAllIdentifiers(); } }</code><technical_language>Nit: "if ("</technical_language>

Target:
EhcacheActiveEntity(ServiceRegistry services, byte[] config) { this.identity = ClusteredEhcacheIdentity.deserialize(config); this.services = services; this.responseFactory = new EhcacheEntityResponseFactory(); this.clientCommunicator = services.getService(new CommunicatorServiceConfiguration()); OffHeapResources offHeapResources = services.getService(new OffHeapResourcesServiceConfiguration()); if (offHeapResources == null) { this.offHeapResourceIdentifiers = Collections.emptySet(); } else { this.offHeapResourceIdentifiers = offHeapResources.getAllIdentifiers(); } }
Source:
<code>public void addInput(Page page) { checkState(aggregationWork == null, "Operator has unfinished work"); checkState(!finishing, "Operator is already finishing"); requireNonNull(page, "page is null"); inputProcessed = true; if (aggregationBuilder == null) { if (step.isOutputPartial() || !spillEnabled) { aggregationBuilder = new InMemoryHashAggregationBuilder( accumulatorFactories, step, expectedGroups, groupByTypes, groupByChannels, hashChannel, operatorContext, maxPartialMemory, joinCompiler, true); } else { aggregationBuilder = new SpillableHashAggregationBuilder( accumulatorFactories, step, expectedGroups, groupByTypes, groupByChannels, hashChannel, operatorContext, memoryLimitForMerge, memoryLimitForMergeWithMemory, spillerFactory, joinCompiler); } } else { checkState(!aggregationBuilder.isFull(), "Aggregation buffer is full"); } aggregationWork = aggregationBuilder.processPage(page); if (aggregationWork.process()) { aggregationWork = null; } <START> aggregationBuilder.updateMemory(); <END> }</code><technical_language>This wrong. delegate updateMemoryWithReservation(0), remove extra reservation operator block enough memory for rehash. I confirmed this debugger. Tests need improvement</technical_language>

Target:
public void addInput(Page page) { checkState(unfinishedWork == null, "Operator has unfinished work"); checkState(!finishing, "Operator is already finishing"); requireNonNull(page, "page is null"); inputProcessed = true; if (aggregationBuilder == null) { if (step.isOutputPartial() || !spillEnabled) { aggregationBuilder = new InMemoryHashAggregationBuilder( accumulatorFactories, step, expectedGroups, groupByTypes, groupByChannels, hashChannel, operatorContext, maxPartialMemory, joinCompiler, true); } else { aggregationBuilder = new SpillableHashAggregationBuilder( accumulatorFactories, step, expectedGroups, groupByTypes, groupByChannels, hashChannel, operatorContext, memoryLimitForMerge, memoryLimitForMergeWithMemory, spillerFactory, joinCompiler); } } else { checkState(!aggregationBuilder.isFull(), "Aggregation buffer is full"); } unfinishedWork = aggregationBuilder.processPage(page); if (unfinishedWork.process()) { unfinishedWork = null; } aggregationBuilder.updateMemory(); }
Source:
<code><START> public void eachNonZero(VectorProcedure procedure) { <END> for (int i = 0; i < cardinality; i++) { if (Math.abs(values[i])>Vectors.EPS) procedure.apply(indices[i], values[i]); } }</code><technical_language>is necessary check in compressed vector zero. is guaranteed non-zero values store. means, need rename eachNonZero in CompressedVector class. Please MatrixMarketStream proper iteration method. TIP: eachNonZero</technical_language>

Target:
public void eachNonZero(VectorProcedure procedure) { for (int i = 0; i < cardinality; i++) { procedure.apply(indices[i], values[i]); } }
Source:
<code>private void validateExpectedColumnIndices(List<Integer> expectedColumnIndices, List<PinotColumnHandle> expectedColumnHandles) { int numValid = 0; Set<Integer> uniqueIndices = new HashSet<>(); <START> for (int i : expectedColumnIndices) { <END> assertTrue(i == -1 || i >= 0 && i < expectedColumnHandles.size()); if (i >= 0) { ++numValid; uniqueIndices.add(i); } } assertEquals(numValid, uniqueIndices.size()); }</code><technical_language>i -> expectedColumnIndex</technical_language>

Target:
private void validateExpectedColumnIndices(List<Integer> expectedColumnIndices, List<PinotColumnHandle> expectedColumnHandles) { int numValid = 0; Set<Integer> uniqueIndices = new HashSet<>(); for (int expectedColumnIndex : expectedColumnIndices) { assertTrue(expectedColumnIndex == -1 || expectedColumnIndex >= 0 && expectedColumnIndex < expectedColumnHandles.size()); if (expectedColumnIndex >= 0) { numValid++; uniqueIndices.add(expectedColumnIndex); } } assertEquals(numValid, uniqueIndices.size()); }
Source:
<code>public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length > 0 && args[0].contains("lock") && user.isAuthorized("essentials.jump.lock")) { if (user.isFlyClickJump()) { user.setRightClickJump(false); user.sendMessage("Flying wizard mode disabled"); } else { user.setRightClickJump(true); user.sendMessage("Enabling flying wizard mode"); } return; } Location loc; final Location cloc = user.getLocation(); try { loc = LocationUtil.getTarget(user.getBase()); loc.setYaw(cloc.getYaw()); loc.setPitch(cloc.getPitch()); loc.setY(loc.getY() + 1); } catch (NullPointerException ex) { throw new Exception(tl("jumpError"), ex); } final Trade charge = new Trade(this.getName(), ess); charge.isAffordableFor(user); <START> if(Bukkit.getWorld(user.getWorld().getUID()).getWorldBorder().isInside(loc) || user.isAuthorized("essentials.jump.pastWorldBorder")) { <END> user.getTeleport().teleport(loc, charge, TeleportCause.COMMAND); }else { user.sendMessage("You can not jump outside of the world border"); } throw new NoChargeException(); }</code><technical_language>add a space "if" "(" follow convention of other code in this file. Also, likewise, conventionally permissions case short / point. "essentials.jump.border" better</technical_language>

Target:
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length > 0 && args[0].contains("lock") && user.isAuthorized("essentials.jump.lock")) { if (user.isFlyClickJump()) { user.setRightClickJump(false); user.sendMessage("Flying wizard mode disabled"); } else { user.setRightClickJump(true); user.sendMessage("Enabling flying wizard mode"); } return; } Location loc; final Location cloc = user.getLocation(); try { loc = LocationUtil.getTarget(user.getBase()); loc.setYaw(cloc.getYaw()); loc.setPitch(cloc.getPitch()); loc.setY(loc.getY() + 1); } catch (NullPointerException ex) { throw new Exception(tl("jumpError"), ex); } final Trade charge = new Trade(this.getName(), ess); charge.isAffordableFor(user); if (Bukkit.getWorld(user.getWorld().getUID()).getWorldBorder().isInside(loc) || user.isAuthorized("essentials.jump.border")) { user.getTeleport().teleport(loc, charge, TeleportCause.COMMAND); } else { user.sendMessage(tl("jumpBorder", user.getName())); } throw new NoChargeException(); }
Source:
<code>public static ImmutableSet<String> getArrayMemberTypes(final Ds3ApiSpec spec) { final ImmutableSet.Builder<String> allArrayMemberTypesBuilder = ImmutableSet.builder(); <START> for (final Ds3Type ds3TypeEntry : spec.getTypes().values()) { <END> ds3TypeEntry.getElements().stream() .filter(element -> element.getType().equalsIgnoreCase("array")) .forEach(element -> allArrayMemberTypesBuilder.add(StructHelper.getResponseTypeName(element.getComponentType()))); } return allArrayMemberTypesBuilder.build(); }</code><technical_language>If modify this slightly a builder: java return spec.getTypes().values().stream() .flatMap(entry -> entry.getElements().stream()) .filter(element -> element.getType().equalsIgnoreCase("array")) .map(element -> StructHelper.getResponseTypeName(element.getComponentType())) .collect(GuavaCollectors.immutableList());</technical_language>

Target:
public static ImmutableSet<String> getArrayMemberTypes(final Ds3ApiSpec spec) { return spec.getTypes().values().stream() .flatMap(entry -> entry.getElements().stream()) .filter(element -> element.getType().equalsIgnoreCase("array")) .map(element -> StructHelper.getResponseTypeName(element.getComponentType())) .collect(GuavaCollectors.immutableSet()); }
Source:
<code>public MinioClient(String endpoint, int port, String accessKey, String secretKey, boolean secure) throws InvalidEndpointException, InvalidPortException { <START> this(endpoint, port, accessKey, secretKey, "", secure); <END> }</code><technical_language>pass null instead of ""</technical_language>

Target:
public MinioClient(String endpoint, int port, String accessKey, String secretKey, boolean secure) throws InvalidEndpointException, InvalidPortException { this(endpoint, port, accessKey, secretKey, null, secure); }
Source:
<code>public void testIdUniqueness() throws Exception { Class clazz = ProtoStreamTypeIds.class; Field[] fields = clazz.getFields(); Set<Integer> messageIds = new HashSet<>(); Set<Integer> lowerBounds = new HashSet<>(); for (Field f : fields) { if (f.getName().endsWith("_LOWER_BOUND")) <START> lowerBounds.add(f.getInt(clazz)); <END> else messageIds.add(f.getInt(clazz)); } assertTrue(messageIds.size() > 0); assertTrue(lowerBounds.size() > 0); assertEquals(fields.length - lowerBounds.size(), messageIds.size()); assertEquals(fields.length - messageIds.size(), lowerBounds.size()); }</code><technical_language>assert this next return true. a duplicate number</technical_language>

Target:
public void testIdUniqueness() throws Exception { Class clazz = ProtoStreamTypeIds.class; Field[] fields = clazz.getFields(); Set<Integer> messageIds = new HashSet<>(); Set<Integer> lowerBounds = new HashSet<>(); for (Field f : fields) { if (f.getName().endsWith("_LOWER_BOUND")) assertTrue(lowerBounds.add(f.getInt(clazz))); else assertTrue(messageIds.add(f.getInt(clazz))); } assertTrue(messageIds.size() > 0); assertTrue(lowerBounds.size() > 0); assertEquals(fields.length - lowerBounds.size(), messageIds.size()); assertEquals(fields.length - messageIds.size(), lowerBounds.size()); }
Source:
<code>public void testJsonEmptyDiskDescription() throws IOException { <START> String jsonDescription = null; <END> jsonDescription = ImagesHandler.getJsonDiskDescription("DiskAlias", ""); assertTrue("Should be map of disk alias and disk description", jsonDescription.equals("{\"DiskDescription\":\"\",\"DiskAlias\":\"DiskAlias\"}")); }</code><technical_language>please define next row</technical_language>

Target:
public void testJsonEmptyDiskDescription() throws IOException { String jsonDescription = ImagesHandler.getJsonDiskDescription("DiskAlias", ""); assertTrue("Should be map of disk alias and disk description", jsonDescription.equals("{\"DiskDescription\":\"\",\"DiskAlias\":\"DiskAlias\"}")); }
Source:
<code>private void assertTags(Node element) { Node tagsElement = element.getFirstChild(); <START> if (tagsElement != null) { <END> assertThat(tagsElement.getNodeName(), is("mgm:tags")); assertThat(tagsElement.getAttributes().getLength(), is(0)); Node tag1 = tagsElement.getFirstChild(); assertThat(tag1, is(notNullValue())); assertThat(tag1.getFirstChild(), is(notNullValue())); assertThat(tag1.getFirstChild().getNodeValue(), is("tag1")); Node tag2 = tagsElement.getLastChild(); assertThat(tag2, is(notNullValue())); assertThat(tag2.getFirstChild(), is(notNullValue())); assertThat(tag2.getFirstChild().getNodeValue(), is("tag2")); } }</code><technical_language>Weird. calling this assert tags</technical_language>

Target:
private void assertTags(Node element) { Node tagsElement = element.getFirstChild(); assertThat(tagsElement.getNodeName(), is("mgm:tags")); assertThat(tagsElement.getAttributes().getLength(), is(0)); Node tag1 = tagsElement.getFirstChild(); assertThat(tag1, is(notNullValue())); assertThat(tag1.getFirstChild(), is(notNullValue())); assertThat(tag1.getFirstChild().getNodeValue(), is("tag1")); Node tag2 = tagsElement.getLastChild(); assertThat(tag2, is(notNullValue())); assertThat(tag2.getFirstChild(), is(notNullValue())); assertThat(tag2.getFirstChild().getNodeValue(), is("tag2")); }
Source:
<code>protected HttpAction redirectToOriginallyRequestedUrl(final C context, final String defaultUrl) { <START> final Optional<String> requestedUrlOpt = context.getSessionStore().get(context, Pac4jConstants.REQUESTED_URL); <END> String redirectUrl = requestedUrlOpt.filter(url -> isNotBlank(url)).orElse(defaultUrl); if (!defaultUrl.equals(redirectUrl)) { context.getSessionStore().set(context, Pac4jConstants.REQUESTED_URL, null); } logger.debug("redirectUrl: {}", redirectUrl); return HttpAction.redirect(context, redirectUrl); }</code><technical_language>avoid intermediary variable if :)</technical_language>

Target:
protected HttpAction redirectToOriginallyRequestedUrl(final C context, final String defaultUrl) { String redirectUrl = (String) context.getSessionStore() .get(context, Pac4jConstants.REQUESTED_URL) .filter(url -> CommonHelper.isNotBlank((String) url)) .orElse(defaultUrl); if (!defaultUrl.equals(redirectUrl)) { context.getSessionStore().set(context, Pac4jConstants.REQUESTED_URL, null); } logger.debug("redirectUrl: {}", redirectUrl); return HttpAction.redirect(context, redirectUrl); }
Source:
<code>public byte[] getBody() { <START> byte[] body = null; <END> final AmqpBodyType bodyType = amqpAnnotatedMessage.getBody().getBodyType(); switch (bodyType) { case DATA: final BinaryData binaryData = ((AmqpDataBody) amqpAnnotatedMessage.getBody()).getBinaryData(); if (binaryData != null) { body = binaryData.getData(); } break; case SEQUENCE: case VALUE: throw logger.logExceptionAsError(new UnsupportedOperationException("Body type not supported yet " + bodyType.toString())); default: logger.warning("Invalid body type {}.", bodyType); throw logger.logExceptionAsError(new IllegalStateException("Body type not valid " + bodyType.toString())); } return body; }</code><technical_language>point I is this data in constructor. do this logic in constructor simply return a copy of binary data. Before, iterating Iterable of BinaryData time, creating a new List object throwing get item copying it</technical_language>

Target:
public byte[] getBody() { final AmqpBodyType bodyType = amqpAnnotatedMessage.getBody().getBodyType(); switch (bodyType) { case DATA: return Arrays.copyOf(binaryData, binaryData.length); case SEQUENCE: case VALUE: throw logger.logExceptionAsError(new UnsupportedOperationException("Body type not supported yet " + bodyType.toString())); default: logger.warning("Invalid body type {}.", bodyType); throw logger.logExceptionAsError(new IllegalStateException("Body type not valid " + bodyType.toString())); } }
Source:
<code>public void setup() { this.handler = new AbstractReplyProducingMessageHandler() { @Override protected Object handleRequestMessage(Message<?> requestMessage) { final SettableListenableFuture<String> future = new SettableListenableFuture<String>(); Executors.newSingleThreadExecutor().execute(new Runnable() { @Override public void run() { try { latch.await(10, TimeUnit.SECONDS); switch (whichTest) { case 0: try { future.set("reply"); } <START> catch (Exception e) { <END> failedCallbackException = e; noOutputChannelLatch.countDown(); } break; case 1: future.setException(new RuntimeException("foo")); break; case 2: try { future.setException(new MessagingException(requestMessage)); } catch (Exception e) { failedCallbackException = e; exceptionLatch.countDown(); } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }); return future; } }; this.handler.setAsyncReplySupported(true); this.handler.setOutputChannel(this.output); this.latch = new CountDownLatch(1); }</code><technical_language>This work SF-4.3 - ListenableFutureCallbackRegistry: private void notifySuccess(SuccessCallback<? super T> callback) { try { callback.onSuccess((T) this.result); } catch (Throwable ex) { // Ignore } } Investigating..</technical_language>

Target:
public void setup() { this.handler = new AbstractReplyProducingMessageHandler() { @Override protected Object handleRequestMessage(Message<?> requestMessage) { final SettableListenableFuture<String> future = new SettableListenableFuture<String>(); Executors.newSingleThreadExecutor().execute(new Runnable() { @Override public void run() { try { latch.await(10, TimeUnit.SECONDS); switch (whichTest) { case 0: future.set("reply"); break; case 1: future.setException(new RuntimeException("foo")); break; case 2: future.setException(new MessagingException(requestMessage)); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }); return future; } }; this.handler.setAsyncReplySupported(true); this.handler.setOutputChannel(this.output); this.latch = new CountDownLatch(1); this.logger = spy(TestUtils.getPropertyValue(this.handler, "logger", Log.class)); new DirectFieldAccessor(this.handler).setPropertyValue("logger", logger); doAnswer(new Answer<Void>() { @Override public Void answer(InvocationOnMock invocation) throws Throwable { failedCallbackMessage = (String) invocation.getArguments()[0]; failedCallbackException = (Exception) invocation.getArguments()[1]; exceptionLatch.countDown(); return null; } }).when(logger).error(anyString(), any(Throwable.class)); }
Source:
<code>private String formatClassPath(String filePath) { <START> String[] path = filePath.split("resources" + File.separator); <END> return (path.length == 2 ? path[1] : filePath); }</code><technical_language>File.separator + "resources" + File.separator safeguard creating xyz*resources subdirectory</technical_language>

Target:
private String formatClassPath(String filePath) { String[] path = filePath.split(File.separator + "resources" + File.separator); return (path.length == 2 ? path[1] : filePath); }
Source:
<code>private void impl$onRead(NBTTagCompound compound, CallbackInfo info) { <START> if (shadow$hasTagCompound() && shadow$getTagCompound().hasKey(Constants.Sponge.SPONGE_DATA, Constants.NBT.TAG_COMPOUND)) { <END> DataUtil.readCustomData(shadow$getTagCompound().getCompoundTag(Constants.Sponge.SPONGE_DATA), ((org.spongepowered.api.item.inventory.ItemStack) this)); } if (this.stackTagCompound != null && this.stackTagCompound.isEmpty()) { this.stackTagCompound = null; } }</code><technical_language>suggestion if (this.shadow$hasTagCompound() && this.shadow$getTagCompound().hasKey(Constants.Sponge.SPONGE_DATA, Constants.NBT.TAG_COMPOUND)) {</technical_language>

Target:
private void impl$onRead(NBTTagCompound compound, CallbackInfo info) { if (this.shadow$hasTagCompound() && this.shadow$getTagCompound().hasKey(Constants.Sponge.SPONGE_DATA, Constants.NBT.TAG_COMPOUND)) { DataUtil.readCustomData(this.shadow$getTagCompound().getCompoundTag(Constants.Sponge.SPONGE_DATA), ((org.spongepowered.api.item.inventory.ItemStack) this)); } if (this.stackTagCompound != null && this.stackTagCompound.isEmpty()) { this.stackTagCompound = null; } }
Source:
<code><START> public Object getInfo() { <END> return info; }</code><technical_language>Object. String</technical_language>

Target:
public String getInfo() { return player.getName(); }
Source:
<code>private void activeSpeakerChanged(long ssrc) { Conference conference = this.conference; if (conference != null) { if (logger.isTraceEnabled()) { logger.trace( "The dominant speaker in conference " + conference.getID() + " is now the SSRC " + ssrc + "."); } AbstractEndpoint endpoint = conference.findEndpointByReceiveSSRC(ssrc); if (endpoint == null) { logger.warn("Unable to find endpoint corresponding to active" + <START> "speaker SSRC " + ssrc); <END> return; } synchronized (syncRoot) { if (!endpoints.remove(endpoint)) { logger.warn("Got active speaker notification for an unknown" + " endpoint (ssrc: " + ssrc + ", epId " + endpoint.getID() + ")! Ignoring"); return; } endpoints.add(0, endpoint); TaskPools.IO_POOL.submit(() -> { if (conference != null) { conference.dominantSpeakerChanged(); } }); } } }</code><technical_language>Missing space line break</technical_language>

Target:
private void activeSpeakerChanged(long ssrc) { Conference conference = this.conference; if (conference != null) { if (logger.isTraceEnabled()) { logger.trace( "The dominant speaker in conference " + conference.getID() + " is now the SSRC " + ssrc + "."); } AbstractEndpoint endpoint = conference.findEndpointByReceiveSSRC(ssrc); if (endpoint == null) { logger.warn("Unable to find endpoint corresponding to " + "active speaker SSRC " + ssrc); return; } synchronized (syncRoot) { if (!endpoints.remove(endpoint)) { logger.warn("Got active speaker notification for an unknown" + " endpoint (ssrc: " + ssrc + ", epId " + endpoint.getID() + ")! Ignoring"); return; } endpoints.add(0, endpoint); TaskPools.IO_POOL.submit(() -> { if (conference != null) { conference.dominantSpeakerChanged(); } }); } } }
Source:
<code>private ApiResponse buildResponseFromAuthState(AuthenticationState state) { Map<String, String> fields = new HashMap<>(); fields.put("lastSuccessfulAuthTimeInMs", Long.toString(state.getLastSuccessfulAuthTime())); fields.put("lastAuthFailure", state.getLastAuthFailure()); fields.put("lastAuthHistoryId", Integer.toString(state.getLastAuthRequestHistoryId())); <START> fields.put(PARAM_LAST_POLL_RESULT, "" + state.getLastPollResult()); <END> fields.put(PARAM_REQUESTS_SINCE_LAST_POLL, Integer.toString(state.getRequestsSincePoll())); fields.put(PARAM_LAST_POLL_TIME_IN_MS, Long.toString(state.getLastPollTime())); return new ApiResponseSet<>("authenticationState", fields); }</code><technical_language>String.valueOf(...)</technical_language>

Target:
private ApiResponse buildResponseFromAuthState(AuthenticationState state) { Map<String, String> fields = new HashMap<>(); fields.put("lastSuccessfulAuthTimeInMs", Long.toString(state.getLastSuccessfulAuthTime())); fields.put("lastAuthFailure", state.getLastAuthFailure()); fields.put("lastAuthHistoryId", Integer.toString(state.getLastAuthRequestHistoryId())); fields.put(PARAM_LAST_POLL_RESULT, String.valueOf(state.getLastPollResult())); fields.put(PARAM_REQUESTS_SINCE_LAST_POLL, Integer.toString(state.getRequestsSincePoll())); fields.put(PARAM_LAST_POLL_TIME_IN_MS, Long.toString(state.getLastPollTime())); return new ApiResponseSet<>("authenticationState", fields); }
Source:
<code>public void testCorrectExceptionOnSQLException() throws Exception { Jdbi dbi = Jdbi.create(() -> { throw new SQLException(); }); try { dbi.open(); fail("Should have raised an exception"); } catch (UnableToObtainConnectionException e) { <START> assertThat(e).isNotNull(); <END> } }</code><technical_language>This assertion is buying</technical_language>

Target:
public void testCorrectExceptionOnSQLException() throws Exception { Jdbi dbi = Jdbi.create(() -> { throw new SQLException(); }); dbi.open(); }
Source:
<code>private void pushAndResetGradients() { for (int i = 0; i < numClasses; i++) { <START> gradient.get(i).scalei(stepSize / batchSize); <END> gradient.get(i).axpy(-stepSize * lambda, models.get(i)); worker.push(i, gradient.get(i)); gradient.set(i, vectorFactory.createDenseZeros(numFeatures)); } }</code><technical_language>Do divide gradient batchSize</technical_language>

Target:
private void pushAndResetGradients() { for (int i = 0; i < numClasses; i++) { gradient.get(i).scalei(stepSize / batchSize); if (lambda != 0) { gradient.get(i).axpy(-stepSize * lambda, models.get(i)); } worker.push(i, gradient.get(i)); gradient.set(i, vectorFactory.createDenseZeros(numFeatures)); } }
Source:
<code>public void createPartControl(final Composite parent) { final FormToolkit toolkit = new FormToolkit(parent.getDisplay()); form = toolkit.createForm(parent); form.setText(DVMessages.getString(NoConnectionSelected)); final Composite container = form.getBody(); GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0).applyTo(container); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(container); createTableViewer(container); getSite().registerContextMenu(new MenuManager(), null); getSite().getWorkbenchWindow().getSelectionService() .addSelectionListener(DockerExplorerView.VIEW_ID, this); hookContextMenu(); hookToolBarItems(); IEclipsePreferences preferences = InstanceScope.INSTANCE .getNode(Activator.PLUGIN_ID); boolean showAll = preferences.getBoolean(SHOW_ALL_CONTAINERS_PREFERENCE, true); showAllContainers(showAll); final ICommandService service = getViewSite().getWorkbenchWindow() .getService(ICommandService.class); service.getCommand(SHOW_ALL_CONTAINERS_COMMAND_ID) .getState(TOGGLE_STATE).setValue(showAll); service.refreshElements(SHOW_ALL_CONTAINERS_COMMAND_ID, null); boolean filterByLabels = preferences .getBoolean(FILTER_WITH_LABELS_PREFERENCE, false); showContainersWithLabels(filterByLabels); service.getCommand(FILTER_CONTAINERS_COMMAND_ID).getState(TOGGLE_STATE) .setValue(filterByLabels); service.refreshElements(FILTER_CONTAINERS_COMMAND_ID, null); DockerConnectionManager.getInstance() .addConnectionManagerListener(this); <START> viewer.refresh(); <END> }</code><technical_language>This work viewer.refresh()</technical_language>

Target:
public void createPartControl(final Composite parent) { final FormToolkit toolkit = new FormToolkit(parent.getDisplay()); form = toolkit.createForm(parent); form.setText(DVMessages.getString(NoConnectionSelected)); final Composite container = form.getBody(); GridLayoutFactory.fillDefaults().numColumns(1).margins(0, 0).applyTo(container); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(container); createTableViewer(container); getSite().registerContextMenu(new MenuManager(), null); getSite().getWorkbenchWindow().getSelectionService() .addSelectionListener(DockerExplorerView.VIEW_ID, this); hookContextMenu(); hookToolBarItems(); IEclipsePreferences preferences = InstanceScope.INSTANCE .getNode(Activator.PLUGIN_ID); boolean showAll = preferences.getBoolean(SHOW_ALL_CONTAINERS_PREFERENCE, true); showAllContainers(showAll); final ICommandService service = getViewSite().getWorkbenchWindow() .getService(ICommandService.class); service.getCommand(SHOW_ALL_CONTAINERS_COMMAND_ID) .getState(TOGGLE_STATE).setValue(showAll); service.refreshElements(SHOW_ALL_CONTAINERS_COMMAND_ID, null); boolean filterByLabels = preferences .getBoolean(FILTER_WITH_LABELS_PREFERENCE, false); showContainersWithLabels(filterByLabels); service.getCommand(FILTER_CONTAINERS_COMMAND_ID).getState(TOGGLE_STATE) .setValue(filterByLabels); service.refreshElements(FILTER_CONTAINERS_COMMAND_ID, null); DockerConnectionManager.getInstance() .addConnectionManagerListener(this); }
Source:
<code>public void onFluidInventoryChanged( final IFluidHandler inventory ) { <START> final int slot = getTankSlot( inventory ); <END> this.tankChanged[slot] = true; if( this.isWorking == slot ) { return; } final boolean had = this.hasWorkToDo(); this.updatePlan( slot ); final boolean now = this.hasWorkToDo(); if( had != now ) { try { if( now ) { this.gridProxy.getTick().alertDevice( this.gridProxy.getNode() ); } else { this.gridProxy.getTick().sleepDevice( this.gridProxy.getNode() ); } } catch( final GridAccessException e ) { } } }</code><technical_language>![MAJOR](<LINK_1> 'Severity: MAJOR') log rethrow this exception. [![rule](<LINK_2>](<LINK_0></technical_language>

Target:
public void onFluidInventoryChanged( final IFluidHandler inventory ) { final int slot = getTankSlot( inventory ); this.tankChanged[slot] = true; this.saveChanges(); if( this.isWorking == slot ) { return; } final boolean had = this.hasWorkToDo(); this.updatePlan( slot ); final boolean now = this.hasWorkToDo(); if( had != now ) { try { if( now ) { this.gridProxy.getTick().alertDevice( this.gridProxy.getNode() ); } else { this.gridProxy.getTick().sleepDevice( this.gridProxy.getNode() ); } } catch( final GridAccessException e ) { } } }
Source:
<code>public List<String> checkGlusterQuorum(Cluster cluster, Iterable<Guid> selectedHostIdsForMaintenance) { List<String> volumesWithoutQuorum = new ArrayList<>(); if (cluster.supportsGlusterService()) { List<GlusterBrickEntity> bricksGoingToMaintenance = new ArrayList<>(); for (Guid serverId : selectedHostIdsForMaintenance) { bricksGoingToMaintenance.addAll(getGlusterBrickDao().getGlusterVolumeBricksByServerId(serverId)); } List<GlusterVolumeEntity> volumesInCluster = getGlusterVolumeDao().getByClusterId(cluster.getId()); for (GlusterVolumeEntity volume : volumesInCluster) { if (volume.getVolumeType().isReplicatedType()) { <START> if (!isQuorumMet(volume, bricksGoingToMaintenance)) { <END> volumesWithoutQuorum.add(volume.getName()); } } } } return volumesWithoutQuorum; }</code><technical_language>combine if statements if (volume.getVolumeType().isReplicatedType() && !isQuorumMet(volume, bricksGoingToMaintenance))</technical_language>

Target:
public List<String> checkGlusterQuorum(Cluster cluster, Iterable<Guid> selectedHostIdsForMaintenance) { List<String> volumesWithoutQuorum = new ArrayList<>(); if (cluster.supportsGlusterService()) { List<GlusterBrickEntity> bricksGoingToMaintenance = new ArrayList<>(); for (Guid serverId : selectedHostIdsForMaintenance) { bricksGoingToMaintenance.addAll(getGlusterBrickDao().getGlusterVolumeBricksByServerId(serverId)); } List<GlusterVolumeEntity> volumesInCluster = getGlusterVolumeDao().getByClusterId(cluster.getId()); for (GlusterVolumeEntity volume : volumesInCluster) { if (volume.getVolumeType().isReplicatedType() && !isQuorumMet(volume, bricksGoingToMaintenance)) { volumesWithoutQuorum.add(volume.getName()); } } } return volumesWithoutQuorum; }
Source:
<code>private PrintLayer createMyPlacesPrintLayer(int categoryId, LayerProperties requestedLayer) { int opacity = requestedLayer.getOpacity() != null ? requestedLayer.getOpacity() : 100; if (opacity <= 0) { return null; } PrintLayer layer = new PrintLayer(); layer.setId(categoryId); layer.setType("myplaces"); layer.setVersion("1.3.0"); layer.setName("oskari:my_places_categories"); <START> layer.setSrsName("EPSG:3067"); <END> layer.setOpacity(opacity); return layer; }</code><technical_language>srs name properties. oskari.native.srs in codebase</technical_language>

Target:
private PrintLayer createMyPlacesPrintLayer(int categoryId, LayerProperties requestedLayer) { int opacity = requestedLayer.getOpacity() != null ? requestedLayer.getOpacity() : 100; if (opacity <= 0) { return null; } PrintLayer layer = new PrintLayer(); layer.setId(categoryId); layer.setType("myplaces"); layer.setVersion("1.3.0"); layer.setName("oskari:my_places_categories"); layer.setOpacity(opacity); return layer; }
Source:
<code>private Request make(final byte[] boundary, <START> final ReadableByteChannel body) <END> throws IOException { final File file = File.createTempFile( RqMultipart.class.getName(), ".tmp" ); final RandomAccessFile accessfile = new RandomAccessFile( file, "rw" ); final FileChannel channel = accessfile.getChannel(); try { channel.write( ByteBuffer.wrap( this.head().iterator().next().getBytes( StandardCharsets.UTF_8 ) ) ); channel.write(ByteBuffer.wrap(Base.CRLF.getBytes())); this.copy(channel, boundary, body); } finally { accessfile.close(); } return new RqWithHeader( new RqLive( new TempInputStream( new FileInputStream(file), file ) ), "Content-Length", String.valueOf(file.length()) ); }</code><technical_language>@2686747 whitespace final ReadableByteChannel</technical_language>

Target:
private Request make(final byte[] boundary, final ReadableByteChannel body) throws IOException { final File file = File.createTempFile( RqMultipart.class.getName(), ".tmp" ); try (RandomAccessFile accessfile = new RandomAccessFile( file, "rw" )) { final FileChannel channel = accessfile.getChannel(); channel.write( ByteBuffer.wrap( this.head().iterator().next().getBytes( StandardCharsets.UTF_8 ) ) ); channel.write( ByteBuffer.wrap(Base.CRLF.getBytes(StandardCharsets.UTF_8)) ); this.copy(channel, boundary, body); } return new RqWithHeader( new RqLive( new TempInputStream( new FileInputStream(file), file ) ), "Content-Length", String.valueOf(file.length()) ); }