auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void spillToDisk() { try { Arrays.sort(this.ramRecords, 0, this.numRecordsInRam, this.comparator); final Path f = newTempFile(); OutputStream os = null; try { os = tempStreamFactory.wrapTempOutputStream(Files.newOutputStream(f), Defaults.BUFFER_SIZE); this.codec.setOutputStream(os); for (int i = 0; i < this.numRecordsInRam; ++i) { this.codec.encode(ramRecords[i]); this.ramRecords[i] = null; } os.flush(); } catch (RuntimeIOException ex) { <START> throw new RuntimeIOException("Problem writing temporary file " + f.toUri().toString() + <END> ". Try setting TMP_DIR to a file system with lots of space.", ex); } finally { if (os != null) { os.close(); } } this.numRecordsInRam = 0; this.files.add(f); } catch (IOException e) { throw new RuntimeIOException(e); } }</code><technical_language>presumably, need for final .toString() here</technical_language>

Target:
private void spillToDisk() { try { Arrays.sort(this.ramRecords, 0, this.numRecordsInRam, this.comparator); final Path f = newTempFile(); OutputStream os = null; try { os = tempStreamFactory.wrapTempOutputStream(Files.newOutputStream(f), Defaults.BUFFER_SIZE); this.codec.setOutputStream(os); for (int i = 0; i < this.numRecordsInRam; ++i) { this.codec.encode(ramRecords[i]); this.ramRecords[i] = null; } os.flush(); } catch (RuntimeIOException ex) { throw new RuntimeIOException("Problem writing temporary file " + f.toUri() + ". Try setting TMP_DIR to a file system with lots of space.", ex); } finally { if (os != null) { os.close(); } } this.numRecordsInRam = 0; this.files.add(f); } catch (IOException e) { throw new RuntimeIOException(e); } }
Source:
<code>public int getItemViewType(int position) { <START> return layoutsForItems.get(position).layoutRes; <END> }</code><technical_language>really, enum determine view type layout resource: java public enum EventViewType { TALK(EventType.TALK, R.layout.view_schedule_talk), CEREMONY(EventType.CEREMONY, R.layout.view_schedule_ceremony), COFFEE_BREAK(EventType.COFFEE_BREAK, R.layout.view_schedule_break), PLACEHOLDER(EventType.PLACEHOLDER, R.layout.view_schedule_placeholder); private final EventType eventType; private final int layoutResId; public EventViewType(EventType eventType, @LayoutRes int layoutResId) { this.eventType = eventType; this.layoutResId = layoutResId; } // ... }</technical_language>

Target:
public int getItemViewType(int position) { Event event = getItem(position).first; return EventViewType.valueOf(event).getLayoutRes(); }
Source:
<code>void decrement() { AtomicLong localCount = count; if ( localCount != null ) { if ( (localCount.decrementAndGet() == 0) ) { <START> count = null; <END> if ( localCount.compareAndSet(0, Long.MIN_VALUE) ) { completionProc.run(); } } } }</code><technical_language>I this trick works. another thread calls increment function. a lock</technical_language>

Target:
void decrement() { if ( active && (count.decrementAndGet() == 0) ) { Runnable proc = completionProc.getAndSet(null); if ( proc != null ) { active = false; proc.run(); } } }
Source:
<code>public void test30(@Injectable final List<AuthorizationValue> auths) throws Exception{ String pathFile = FileUtils.readFileToString(new File("src/test/resources/oas3.yaml.template")); pathFile = pathFile.replace("${dynamicPort}", String.valueOf(this.serverPort)); ParseOptions options = new ParseOptions(); options.setResolve(true); SwaggerParseResult result = new OpenAPIV3Parser().readContents(pathFile, auths, options ); Assert.assertNotNull(result); Assert.assertNotNull(result.getOpenAPI()); <START> Assert.assertEquals(result.getOpenAPI().getOpenapi(), "3.0"); <END> Assert.assertEquals(result.getOpenAPI().getComponents().getSchemas().get("OrderRef").getType(),"object"); }</code><technical_language>This 3.0.0</technical_language>

Target:
public void test30(@Injectable final List<AuthorizationValue> auths) throws Exception{ String pathFile = FileUtils.readFileToString(new File("src/test/resources/oas3.yaml.template")); pathFile = pathFile.replace("${dynamicPort}", String.valueOf(this.serverPort)); ParseOptions options = new ParseOptions(); options.setResolve(true); SwaggerParseResult result = new OpenAPIV3Parser().readContents(pathFile, auths, options ); Assert.assertNotNull(result); Assert.assertNotNull(result.getOpenAPI()); Assert.assertEquals(result.getOpenAPI().getOpenapi(), "3.0.0"); Assert.assertEquals(result.getOpenAPI().getComponents().getSchemas().get("OrderRef").getType(),"object"); }
Source:
<code>public <START> CommonTargetToModelUpdateStrategy(VElement <END> vElement, EStructuralFeature eStructuralFeature) { this.vElement = vElement; this.eStructuralFeature = eStructuralFeature; }</code><technical_language>Missing super() call</technical_language>

Target:
public CommonTargetToModelUpdateStrategy(VElement vElement, EStructuralFeature eStructuralFeature) { super(POLICY_UPDATE); this.vElement = vElement; this.eStructuralFeature = eStructuralFeature; }
Source:
<code>public DockerImageName(String fullImageName) { this.rawName = fullImageName; final int slashIndex = fullImageName.indexOf('/'); String remoteName; if (slashIndex == -1 || (!fullImageName.substring(0, slashIndex).contains(".") && !fullImageName.substring(0, slashIndex).contains(":") && !fullImageName.substring(0, slashIndex).equals("localhost"))) { registry = ""; remoteName = fullImageName; } else { registry = fullImageName.substring(0, slashIndex); remoteName = fullImageName.substring(slashIndex + 1); } if (remoteName.contains("@sha256:")) { repo = remoteName.split("@sha256:")[0]; <START> versioning = new Versioning.Sha256Versioning(remoteName.split("@sha256:")[1]); <END> } else if (remoteName.contains(":")) { repo = remoteName.split(":")[0]; versioning = new Versioning.TagVersioning(remoteName.split(":")[1]); } else { repo = remoteName; versioning = Versioning.TagVersioning.LATEST; } compatibleSubstituteFor = null; }</code><technical_language>tiny nit: if import Versioning.Sha256Versioning other Versioning.* classes, changelog smaller :)</technical_language>

Target:
public DockerImageName(String fullImageName) { this.rawName = fullImageName; final int slashIndex = fullImageName.indexOf('/'); String remoteName; if (slashIndex == -1 || (!fullImageName.substring(0, slashIndex).contains(".") && !fullImageName.substring(0, slashIndex).contains(":") && !fullImageName.substring(0, slashIndex).equals("localhost"))) { registry = ""; remoteName = fullImageName; } else { registry = fullImageName.substring(0, slashIndex); remoteName = fullImageName.substring(slashIndex + 1); } if (remoteName.contains("@sha256:")) { repo = remoteName.split("@sha256:")[0]; versioning = new Sha256Versioning(remoteName.split("@sha256:")[1]); } else if (remoteName.contains(":")) { repo = remoteName.split(":")[0]; versioning = new TagVersioning(remoteName.split(":")[1]); } else { repo = remoteName; versioning = Versioning.ANY; } compatibleSubstituteFor = null; }
Source:
<code><START> protected HttpJsonRequest createPingRequest(Machine machine) throws ServerException { <END> Map<String, ? extends Server> servers = machine.getRuntime().getServers(); Server wsAgentServer = servers.get(Constants.WS_AGENT_PORT); if (wsAgentServer == null) { LOG.error("{} WorkspaceId: {}, DevMachine Id: {}, found servers: {}", WS_AGENT_SERVER_NOT_FOUND_ERROR, machine.getWorkspaceId(), machine.getId(), servers); throw new ServerException(WS_AGENT_SERVER_NOT_FOUND_ERROR); } String wsAgentPingUrl = wsAgentServer.getUrl(); if (!wsAgentPingUrl.endsWith("/")) { wsAgentPingUrl = wsAgentPingUrl.concat("/"); } return httpJsonRequestFactory.fromUrl(wsAgentPingUrl) .setMethod(HttpMethod.GET) .setTimeout(wsAgentPingConnectionTimeoutMs); }</code><technical_language>This method reuse server of ws-agent</technical_language>

Target:
protected HttpJsonRequest createPingRequest(Machine machine) throws ServerException { return wsAgentPingRequestFactory.createRequest(machine); }
Source:
<code>protected ValidatorLocator getValidatorLocator() { if (validatorLocator == null) { validatorLocator = new ValidatorLocator(); <START> validatorLocator.populate(); <END> } return validatorLocator; }</code><technical_language>do need creating new instance of validatorLocator for new sub-resource/subcollection, reuse instance defined in BackendApplication adding [resource.setValidatorLocator(X);] in AbstractBackendResource.inject(). - inject context ('backend', etc.) in sub-resource/subcollection,</technical_language>

Target:
protected ValidatorLocator getValidatorLocator() { return validatorLocator; }
Source:
<code>public void testSaveAsXml() { final String xml = "xml"; final String comment = "comment"; <START> final Map<String, Object> attributes = new HashMap<>(); <END> final Path path = mock(Path.class); final Metadata metadata = mock(Metadata.class); final CommentedOption options = mock(CommentedOption.class); when(metadataService.setUpAttributes(path, metadata)).thenReturn(attributes); when(commentedOptionFactory.makeCommentedOption(comment)).thenReturn(options); diagramService.saveAsXml(path, xml, metadata, comment); verify(diagramServiceController, times(1)).saveAsXml(eq(path), eq(xml), eq(attributes), eq(options)); }</code><technical_language>special reason previous test Collections.singletonMap("key", "value"); this empty HashMap</technical_language>

Target:
public void testSaveAsXml() { final String xml = "xml"; final String comment = "comment"; final Map<String, Object> attributes = Collections.singletonMap("key", "value"); final Path path = mock(Path.class); final Metadata metadata = mock(Metadata.class); final CommentedOption options = mock(CommentedOption.class); when(metadataService.setUpAttributes(path, metadata)).thenReturn(attributes); when(commentedOptionFactory.makeCommentedOption(comment)).thenReturn(options); diagramService.saveAsXml(path, xml, metadata, comment); verify(diagramServiceController, times(1)).saveAsXml(eq(path), eq(xml), eq(attributes), eq(options)); }
Source:
<code>public void removeMessagesFromGroup(Object groupId, Collection<Message<?>> messages) { Assert.notNull(groupId, "'groupId' must not be null"); Assert.notNull(messages, "'messageToRemove' must not be null"); for (Message<?> messageToRemove : messages) { <START> doRemove(groupId, messageToRemove); <END> } updateGroup(groupId, lastModifiedUpdate()); }</code><technical_language>existing behavior, of course, try find similar a batch for JDBC increase performance</technical_language>

Target:
public void removeMessagesFromGroup(Object groupId, Collection<Message<?>> messages) { Assert.notNull(groupId, "'groupId' must not be null"); Assert.notNull(messages, "'messageToRemove' must not be null"); Collection<UUID> ids = new ArrayList<UUID>(); for (Message<?> messageToRemove : messages) { ids.add(messageToRemove.getHeaders().getId()); if (ids.size() >= getRemoveBatchSize()) { removeMessages(groupId, ids); ids.clear(); } } if (ids.size() > 0) { removeMessages(groupId, ids); } updateGroup(groupId, lastModifiedUpdate()); }
Source:
<code>public boolean onPreferenceClick(Preference preference) { String preferenceKey = preference != null ? preference.getKey() : ""; if (preferenceKey.equals(getString(R.string.pref_key_device_settings))) { return handleDevicePreferenceClick(); } else if (preferenceKey.equals(getString(R.string.pref_key_app_about))) { return handleAboutPreferenceClick(); } else if (preferenceKey.equals(getString(R.string.pref_key_oss_licenses))) { return handleOssPreferenceClick(); } else if (preference == mPrivacySettings) { <START> setupPrivacySettings(); <END> } return false; }</code><technical_language>onPreferenceClick returns true click is handled false is not, return setupPrivacySettings similar other methods (i.e. handleDevicePreferenceClick, handleAboutPreferenceClick, handleOssPreferenceClick)</technical_language>

Target:
public boolean onPreferenceClick(Preference preference) { String preferenceKey = preference != null ? preference.getKey() : ""; if (preferenceKey.equals(getString(R.string.pref_key_device_settings))) { return handleDevicePreferenceClick(); } else if (preferenceKey.equals(getString(R.string.pref_key_app_about))) { return handleAboutPreferenceClick(); } else if (preferenceKey.equals(getString(R.string.pref_key_oss_licenses))) { return handleOssPreferenceClick(); } else if (preference == mPrivacySettings) { return handlePrivacyClick(); } return false; }
Source:
<code>private void pump(final SSEProcessor processor, final SseEventInputImpl input) { Map<Class<?>, Object> contextDataMap = ResteasyContext.getContextDataMap(); <START> executor.execute(() -> { <END> ResteasyContext.pushContextDataMap(contextDataMap); Type typeArgument; InboundSseEvent event; if (genericType instanceof ParameterizedType) { typeArgument = ((ParameterizedType) genericType).getActualTypeArguments()[0]; if (typeArgument.equals(InboundSseEvent.class)) { try { while ((event = input.read(providers)) != null) { processor.emit(event); } } catch (Exception e) { processor.onError(e); return; } processor.onCompletion(); } else { try { while ((event = input.read(providers)) != null) { processor.emit(event.readData((Class) typeArgument)); } } catch (Exception e) { processor.onError(e); return; } } processor.onCompletion(); } }); }</code><technical_language>handle rejection</technical_language>

Target:
private void pump(final SSEProcessor processor, final SseEventInputImpl input) { Map<Class<?>, Object> contextDataMap = ResteasyContext.getContextDataMap(); Runnable readEventTask = new Runnable() { @Override public void run() { ResteasyContext.pushContextDataMap(contextDataMap); Type typeArgument; InboundSseEvent event; if (genericType instanceof ParameterizedType) { typeArgument = ((ParameterizedType) genericType).getActualTypeArguments()[0]; if (typeArgument.equals(InboundSseEvent.class)) { try { while ((event = input.read(providers)) != null) { processor.emit(event); } } catch (Exception e) { processor.onError(e); return; } processor.onCompletion(); } else { try { while ((event = input.read(providers)) != null) { processor.emit(event.readData((Class) typeArgument)); } } catch (Exception e) { processor.onError(e); return; } } processor.onCompletion(); } } }; try { executor.execute(readEventTask); } catch (RejectedExecutionException e) { LOGGER.warnf("Executor %s rejected emit event task", executor); new Thread(readEventTask, "SseClientPublisherNewThread").start(); } }
Source:
<code>public void deleteUpload(final Contribution contribution) { <START> ioThreadScheduler.scheduleDirect(() -> repository.deleteContributionFromDB(contribution)); <END> }</code><technical_language>Completeable.fromAction more idiomatic</technical_language>

Target:
public void deleteUpload(final Contribution contribution) { compositeDisposable.add(repository .deleteContributionFromDB(contribution) .subscribeOn(ioThreadScheduler) .subscribe()); }
Source:
<code>public void writeTo(ParticipantStatus participantStatus, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { <START> entityStream.write(participantStatus.toString().getBytes()); <END> }</code><technical_language>is java participantStatus.name() overridden toString() can</technical_language>

Target:
public void writeTo(ParticipantStatus participantStatus, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { entityStream.write(participantStatus.name().getBytes()); }
Source:
<code>public final void removeSessionOnLogout(String sessionId) { <START> removeSessionImpl(sessionId, Acct.ReportReason.PRINCIPAL_LOGOUT, "Prinicial has performed logout"); <END> }</code><technical_language>add principal name message</technical_language>

Target:
public final void removeSessionOnLogout(String sessionId) { removeSessionImpl(sessionId, Acct.ReportReason.PRINCIPAL_LOGOUT, "Prinicial %1$s has performed logout", getPrincipalName(sessionId)); }
Source:
<code>protected Collection<StorageDomain> syncLunsForStorageDomains(Collection<StorageDomain> storageDomains) { List<Callable<Pair<Boolean, StorageDomain>>> syncLunsCommands = storageDomains.stream() .filter(storageDomain -> StorageDomainStatus.Active == storageDomain.getStatus()) .filter(storageDomain -> storageDomain.getStorageType().isBlockDomain()) .map(storageDomain -> (Callable<Pair<Boolean, StorageDomain>>) () -> syncDomainLuns(storageDomain)) .collect(Collectors.toList()); if (syncLunsCommands.isEmpty()) { return Collections.emptyList(); } return ThreadPoolUtil.invokeAll(syncLunsCommands).stream() .collect(Collectors.groupingBy( <START> Pair::getFirst, Collectors.mapping(Pair::getSecond, Collectors.toList()))) <END> .getOrDefault(false, Collections.emptyList()); }</code><technical_language>Please filter executions failed (and collect) instead of grouping</technical_language>

Target:
protected Collection<Guid> syncLunsForStorageDomains(Collection<StorageDomain> storageDomains) { List<Callable<Pair<Boolean, Guid>>> syncLunsCommands = storageDomains.stream() .filter(storageDomain -> StorageDomainStatus.Active == storageDomain.getStatus()) .filter(storageDomain -> storageDomain.getStorageType().isBlockDomain()) .map(storageDomain -> (Callable<Pair<Boolean, Guid>>) () -> syncDomainLuns(storageDomain)) .collect(Collectors.toList()); if (syncLunsCommands.isEmpty()) { return Collections.emptyList(); } return ThreadPoolUtil.invokeAll(syncLunsCommands).stream() .filter(domainSyncedPair -> !domainSyncedPair.getFirst()) .map(Pair::getSecond) .collect(Collectors.toList()); }
Source:
<code>public Iec61850MockServerMarkerWadden(final String serverName, final String icdFilename, final int port) { <START> super(); <END> this.serverName = serverName; this.icdFilename = icdFilename; this.port = port; }</code><technical_language>Is this super call needed here</technical_language>

Target:
public Iec61850MockServerMarkerWadden(final String serverName, final String icdFilename, final int port) { this.serverName = serverName; this.icdFilename = icdFilename; this.port = port; }
Source:
<code>public Vec3d getFogColor(World world, BlockPos pos, IBlockState state, Entity entity, Vec3d originalColor, float partialTicks) { if (getFluid() != null) { int color = getFluid().getColor(); int red = color >> 16 & 0xFF; int green = color >> 8 & 0xFF; int blue = color & 0xFF; <START> return new Vec3d(red, green, blue); <END> } else { return super.getFogColor(world, pos, state, entity, originalColor, partialTicks); } }</code><technical_language>This work, need / 255 value. getFogColor return 0 - 1 color values</technical_language>

Target:
public Vec3d getFogColor(World world, BlockPos pos, IBlockState state, Entity entity, Vec3d originalColor, float partialTicks) { if (getFluid() != null) { int color = getFluid().getColor(); float red = (color >> 16 & 0xFF) / 255.0F; float green = (color >> 8 & 0xFF) / 255.0F; float blue = (color & 0xFF) / 255.0F; return new Vec3d(red, green, blue); } else { return super.getFogColor(world, pos, state, entity, originalColor, partialTicks); } }
Source:
<code>private void initView(Context context, @Nullable AttributeSet attrs) { final boolean useLegacy = Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN || !EMDeviceUtil.isDeviceCTSCompliant(); if (useLegacy) { View.inflate(context, R.layout.exomedia_video_view_layout, this); } else { <START> View.inflate(context, R.layout.exomedia_exo_view_layout, this); <END> } shutterBottom = findViewById(R.id.exomedia_video_shutter_bottom); shutterTop = findViewById(R.id.exomedia_video_shutter_top); shutterLeft = findViewById(R.id.exomedia_video_shutter_left); shutterRight = findViewById(R.id.exomedia_video_shutter_right); previewImageView = (ImageView) findViewById(R.id.exomedia_video_preview_image); inflateVideoViewImpl(context, attrs, useLegacy); videoViewImpl = (VideoViewApi) findViewById(R.id.exomedia_video_view); muxNotifier = new MuxNotifier(); listenerMux = new EMListenerMux(muxNotifier); videoViewImpl.setListenerMux(listenerMux); videoViewImpl.setOnSizeChangedListener(muxNotifier); }</code><technical_language>If ViewStub need separate layouts for legacy exo</technical_language>

Target:
private void initView(Context context, @Nullable AttributeSet attrs) { View.inflate(context, R.layout.exomedia_video_view_layout, this); shutterBottom = findViewById(R.id.exomedia_video_shutter_bottom); shutterTop = findViewById(R.id.exomedia_video_shutter_top); shutterLeft = findViewById(R.id.exomedia_video_shutter_left); shutterRight = findViewById(R.id.exomedia_video_shutter_right); previewImageView = (ImageView) findViewById(R.id.exomedia_video_preview_image); inflateVideoViewImpl(context, attrs); videoViewImpl = (VideoViewApi) findViewById(R.id.exomedia_video_view); muxNotifier = new MuxNotifier(); listenerMux = new EMListenerMux(muxNotifier); videoViewImpl.setListenerMux(listenerMux); videoViewImpl.setOnSizeChangedListener(muxNotifier); }
Source:
<code>public void init(FMLInitializationEvent event) { if(!ENABLE) return; BrewingRecipeRegistry.addRecipe(new ItemStack(Items.diamond_sword), new ItemStack(Items.rotten_flesh), new ItemStack(Items.diamond_hoe)); ItemStack output0 = BrewingRecipeRegistry.getOutput(new ItemStack(Items.diamond_sword), new ItemStack(Items.rotten_flesh), null); if(output0.getItem() == Items.diamond_hoe) System.out.println("Recipe succefully registered and working. Diamond Hoe obtained."); BrewingRecipeRegistry.addRecipe(new ItemStack(Items.golden_sword), "gemDiamond", new ItemStack(Items.diamond_sword)); ItemStack output1 = BrewingRecipeRegistry.getOutput(new ItemStack(Items.golden_sword), new ItemStack(Items.diamond), null); if(output1.getItem() == Items.diamond_sword) System.out.println("Recipe succefully registered and working. Diamond Sword obtained."); <START> ItemStack output2 = BrewingRecipeRegistry.getOutput(new ItemStack(Items.potionitem, 1, 0), new ItemStack(Items.nether_wart), null); <END> if(output2 != null && output2.getItem() == Items.potionitem && output2.getItemDamage() == 16) System.out.println("Vanilla behaviour still in place. Brewed Water Bottle with Nether Wart and got Awkward Potion"); }</code><technical_language>If call null a TileEntity parameter, add @Nullable TileEntity parameter in getOutput method in interface notify users tile entity null</technical_language>

Target:
public void init(FMLInitializationEvent event) { if(!ENABLE) return; BrewingRecipeRegistry.addRecipe(new ItemStack(Items.diamond_sword), new ItemStack(Items.rotten_flesh), new ItemStack(Items.diamond_hoe)); ItemStack output0 = BrewingRecipeRegistry.getOutput(new ItemStack(Items.diamond_sword), new ItemStack(Items.rotten_flesh), null, null, null); if(output0.getItem() == Items.diamond_hoe) System.out.println("Recipe succefully registered and working. Diamond Hoe obtained."); BrewingRecipeRegistry.addRecipe(new ItemStack(Items.golden_sword), "gemDiamond", new ItemStack(Items.diamond_sword)); ItemStack output1 = BrewingRecipeRegistry.getOutput(new ItemStack(Items.golden_sword), new ItemStack(Items.diamond), null, null, null); if(output1.getItem() == Items.diamond_sword) System.out.println("Recipe succefully registered and working. Diamond Sword obtained."); ItemStack output2 = BrewingRecipeRegistry.getOutput(new ItemStack(Items.potionitem, 1, 0), new ItemStack(Items.nether_wart), null, null, null); if(output2 != null && output2.getItem() == Items.potionitem && output2.getItemDamage() == 16) System.out.println("Vanilla behaviour still in place. Brewed Water Bottle with Nether Wart and got Awkward Potion"); }
Source:
<code>public void testBlobIdFlag() throws Exception { boolean[] isEncrytpedValues = {true, false}; if (version >= BLOB_ID_V3) { for (BlobIdType type : BlobIdType.values()) { for (boolean isEncrypted : isEncrytpedValues) { BlobId blobId = new BlobId(BLOB_ID_V3, type, referenceDatacenterId, referenceAccountId, referenceContainerId, referencePartitionId, isEncrypted); BlobId blobIdSerDed = new BlobId(new DataInputStream(new ByteArrayInputStream(blobId.toBytes())), referenceClusterMap); assertEquals("The type should match the original's type", type, blobIdSerDed.getType()); assertEquals("The isEcnrypted should match the original", isEncrypted, blobIdSerDed.isEncrypted()); } <START> } <END> } }</code><technical_language>minor: typo in "isEncrypted" in message</technical_language>

Target:
public void testBlobIdFlag() throws Exception { boolean[] isEncryptedValues = {true, false}; if (version >= BLOB_ID_V3) { for (BlobIdType type : BlobIdType.values()) { for (boolean isEncrypted : isEncryptedValues) { BlobId blobId = new BlobId(BLOB_ID_V3, type, referenceDatacenterId, referenceAccountId, referenceContainerId, referencePartitionId, isEncrypted); BlobId blobIdSerDed = new BlobId(new DataInputStream(new ByteArrayInputStream(blobId.toBytes())), referenceClusterMap); assertEquals("The type should match the original's type", type, blobIdSerDed.getType()); assertEquals("The isEncrypted should match the original", isEncrypted, blobIdSerDed.isEncrypted()); } } } }
Source:
<code>public void equals() { Assert.assertEquals(new Version(), new Version()); Assert.assertEquals(new Version(1, 2), new Version(1, 2)); Assert.assertEquals(new Version(1, 2), new Version("1.2")); Assert.assertEquals(new Version(1, 2, 3), new Version("1.2.3")); Assert.assertEquals(new Version(1, 2, 3, 4), new Version("1.2.3.4")); <START> Assert.assertNotNull(new Version()); <END> Assert.assertNotEquals("foo", new Version()); Assert.assertNotEquals(1.0d, new Version()); }</code><technical_language>change static import</technical_language>

Target:
public void equals() { assertEquals(new Version(), new Version()); assertEquals(new Version(1, 2), new Version(1, 2)); assertEquals(new Version(1, 2), new Version("1.2")); assertEquals(new Version(1, 2, 3), new Version("1.2.3")); assertEquals(new Version(1, 2, 3, 4), new Version("1.2.3.4")); assertNotNull(new Version()); assertNotEquals("foo", new Version()); assertNotEquals(1.0d, new Version()); }
Source:
<code><START> public static int getTransactionId(long operationId) { <END> return (int) (operationId >>> LOG_ID_BITS); }</code><technical_language>visibility increased public</technical_language>

Target:
static int getTransactionId(long operationId) { return (int) (operationId >>> LOG_ID_BITS); }
Source:
<code>protected void commonInitialize() { priorityUtil = new PriorityUtil(getModel()); virtioScsiUtil = new VirtioScsiUtil(getModel()); getModel().getVmId().setIsAvailable(false); getModel().getLease().setIsChangeable(false); getModel().getIsHighlyAvailable().getEntityChangedEvent().addListener(new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { boolean ha = getModel().getIsHighlyAvailable().getEntity(); <START> getModel().getLease().setIsChangeable(vmLeasesSupported && ha); <END> if (!ha) { getModel().getLease().setSelectedItem(null); } } }); getModel().getMigrationPolicies() .setItems(AsyncDataProvider.getInstance().getMigrationPolicies(Version.getLast())); }</code><technical_language>consider this case: - vmLeasesSupported == false, in setVmLeasesAvailability() set changeProhibityReason - change HA option clear change prohibity reason restoring anyway, easier call setVmLeasesAvailability() add if (!ha) { getModel().getLease().setSelectedItem(null); } setVmLeasesAvailability()? work better</technical_language>

Target:
protected void commonInitialize() { priorityUtil = new PriorityUtil(getModel()); virtioScsiUtil = new VirtioScsiUtil(getModel()); getModel().getVmId().setIsAvailable(false); getModel().getLease().setIsChangeable(false); getModel().getIsHighlyAvailable().getEntityChangedEvent().addListener((ev, sender, args) -> { boolean ha = getModel().getIsHighlyAvailable().getEntity(); getModel().getLease().setIsChangeable(vmLeasesSupported && ha); if (!ha) { getModel().getLease().setSelectedItem(null); } }); getModel().getMigrationPolicies() .setItems(AsyncDataProvider.getInstance().getMigrationPolicies(Version.getLast())); }
Source:
<code>private void setFetchThresholds() { KafkaConfig kafkaConfig = new KafkaConfig(config); Option<String> fetchThresholdOption = kafkaConfig.getConsumerFetchThreshold(systemName); long fetchThreshold = FETCH_THRESHOLD; if (fetchThresholdOption.isDefined()) { fetchThreshold = Long.valueOf(fetchThresholdOption.get()); LOG.info("fetchThresholdOption is configured. fetchThreshold=" + fetchThreshold); } Option<String> fetchThresholdBytesOption = kafkaConfig.getConsumerFetchThresholdBytes(systemName); long fetchThresholdBytes = FETCH_THRESHOLD_BYTES; if (fetchThresholdBytesOption.isDefined()) { fetchThresholdBytes = Long.valueOf(fetchThresholdBytesOption.get()); LOG.info("fetchThresholdBytesOption is configured. fetchThresholdBytes=" + fetchThresholdBytes); } int numTPs = topicPartitions2SSP.size(); assert (numTPs == topicPartitions2Offset.size()); LOG.info("fetchThresholdBytes = " + fetchThresholdBytes + "; fetchThreshold=" + fetchThreshold); <START> LOG.info("number of topicPartitions " + numTPs); <END> if (numTPs > 0) { perPartitionFetchThreshold = fetchThreshold / numTPs; LOG.info("perPartitionFetchThreshold=" + perPartitionFetchThreshold); if (fetchThresholdBytesEnabled) { perPartitionFetchThresholdBytes = (fetchThresholdBytes / 2) / numTPs; LOG.info("perPartitionFetchThresholdBytes is enabled. perPartitionFetchThresholdBytes=" + perPartitionFetchThresholdBytes); } } }</code><technical_language>Strongly prefer combining messages a single log line. for other logs this method</technical_language>

Target:
private void setFetchThresholds() { KafkaConfig kafkaConfig = new KafkaConfig(config); Option<String> fetchThresholdOption = kafkaConfig.getConsumerFetchThreshold(systemName); long fetchThreshold = FETCH_THRESHOLD; if (fetchThresholdOption.isDefined()) { fetchThreshold = Long.valueOf(fetchThresholdOption.get()); } Option<String> fetchThresholdBytesOption = kafkaConfig.getConsumerFetchThresholdBytes(systemName); long fetchThresholdBytes = FETCH_THRESHOLD_BYTES; if (fetchThresholdBytesOption.isDefined()) { fetchThresholdBytes = Long.valueOf(fetchThresholdBytesOption.get()); } int numPartitions = topicPartitionsToSSP.size(); if (numPartitions != topicPartitionsToOffset.size()) { throw new SamzaException("topicPartitionsToSSP.size() doesn't match topicPartitionsToOffset.size()"); } if (numPartitions > 0) { perPartitionFetchThreshold = fetchThreshold / numPartitions; if (fetchThresholdBytesEnabled) { perPartitionFetchThresholdBytes = (fetchThresholdBytes / 2) / numPartitions; } } LOG.info("{}: fetchThresholdBytes = {}; fetchThreshold={}; numPartitions={}, perPartitionFetchThreshold={}, perPartitionFetchThresholdBytes(0 if disabled)={}", this, fetchThresholdBytes, fetchThreshold, numPartitions, perPartitionFetchThreshold, perPartitionFetchThresholdBytes); }
Source:
<code>public static ImmutableStorageProvider getStorageProvider(ImmutableStorageProviderFactory.AvailableImmutableStorages desiredProvider, AccountabilityConfigurationObject configuration) { if (Objects.isNull(storageProvider)) { switch (desiredProvider) { case SWARM: <START> storageProvider = new SwarmProvider(configuration.getSwarm_gateway_url()); <END> break; case TEST: default: storageProvider = new SwarmProvider("<LINK_0>"); break; } } return storageProvider; }</code><technical_language>Is a specific reason for naming fields variables in Configuration class snake case, i.e., _'s instead of camel case? If not, please rename camel case.</technical_language>

Target:
public static ImmutableStorageProvider getStorageProvider(ImmutableStorageProviderFactory.AvailableImmutableStorages desiredProvider, AccountabilityConfigurationObject configuration) { if (Objects.isNull(storageProvider)) { switch (desiredProvider) { case SWARM: storageProvider = new SwarmProvider(configuration.getSwarmGatewayUrl()); break; case TEST: default: storageProvider = new SwarmProvider("<LINK_0>"); break; } } return storageProvider; }
Source:
<code>public static int getArchivedFormsValidityInDays(CommCareApp app) { int daysForReview = -1; String daysToPurge = <START> app.getAppPreferences().getString("cc-days-form-retain", "-1"); <END> try { daysForReview = Integer.parseInt(daysToPurge); } catch (NumberFormatException nfe) { Logger.log(AndroidLogger.TYPE_ERROR_CONFIG_STRUCTURE, "Invalid days to purge: " + daysToPurge); } return daysForReview; }</code><technical_language>I generally put keys this a static class-level variable, I this is important. looked funny force of habit, you</technical_language>

Target:
public static int getArchivedFormsValidityInDays(CommCareApp app) { int daysForReview = -1; String daysToPurge = app.getAppPreferences().getString(DAYS_TO_RETAIN_SAVED_FORMS_KEY, "-1"); try { daysForReview = Integer.parseInt(daysToPurge); } catch (NumberFormatException nfe) { Logger.log(AndroidLogger.TYPE_ERROR_CONFIG_STRUCTURE, "Invalid days to purge: " + daysToPurge); } return daysForReview; }
Source:
<code>private void checkArgument(ExpressionTree arg, String name, String message) { LiteralTree literal = null; int sign = 1; if (arg.is(Tree.Kind.INT_LITERAL)) { literal = (LiteralTree) arg; <START> } else if (arg.is(Tree.Kind.UNARY_MINUS) && ((UnaryExpressionTree) arg).expression().is(Tree.Kind.INT_LITERAL)) { <END> sign = -1; literal = (LiteralTree) ((UnaryExpressionTree) arg).expression(); } if (literal != null) { int argValue = Integer.parseInt(literal.value()) * sign; if (argValue > Threshold.getThreshold(name) || argValue < 0) { addIssue(arg, MessageFormat.format(message, argValue, name)); } } }</code><technical_language>UNARY_PLUS</technical_language>

Target:
private void checkArgument(ExpressionTree arg, String name, String message) { LiteralTree literal = null; int sign = 1; if (arg.is(Tree.Kind.INT_LITERAL)) { literal = (LiteralTree) arg; } else if (arg.is(Tree.Kind.UNARY_MINUS, Tree.Kind.UNARY_PLUS) && ((UnaryExpressionTree) arg).expression().is(Tree.Kind.INT_LITERAL)) { if(arg.is(Tree.Kind.UNARY_MINUS)) { sign = -1; } literal = (LiteralTree) ((UnaryExpressionTree) arg).expression(); } if (literal != null) { int argValue = Integer.parseInt(literal.value()) * sign; if (argValue > Threshold.getThreshold(name) || argValue < 0) { addIssue(arg, MessageFormat.format(message, argValue, name)); } } }
Source:
<code>public YobitRateSource() { <START> api = RestProxyFactory.createProxy(IBity.class, "<LINK_0>"); <END> }</code><technical_language>correct class instead of IBity</technical_language>

Target:
public YobitRateSource() { api = RestProxyFactory.createProxy(IYobitAPI.class, "<LINK_0>"); }
Source:
<code>public SecureFamily(Family family) { if (family == null) { <START> throw new UnsupportedOperationException(); <END> } this.family = family; }</code><technical_language>IllegalArgumentException exception in other constructors this PR, SecurePatient for example. For consistency I propose removing check</technical_language>

Target:
public SecureFamily(Family family) { if (family == null) { throw new IllegalArgumentException(); } this.family = family; }
Source:
<code>public void sendResponse(Response response, ChannelHandlerContext ctx) { <START> ByteBuf outBuf = PooledByteBufAllocator.DEFAULT.buffer(); outBuf.writeByte(API.PROTO_CORFU_MSG_MARK); outBuf.writeBytes(response.toByteArray()); ctx.writeAndFlush(outBuf); } <END></code><technical_language>Pass allocator constructor. Accessing a resources multiple entry points hard change. wrap default allocator pass instance constructor</technical_language>

Target:
public void sendResponse(Response response, ChannelHandlerContext ctx) { ByteBuf outBuf = PooledByteBufAllocator.DEFAULT.buffer(); ByteBufOutputStream responseOutputStream = new ByteBufOutputStream(outBuf); try { responseOutputStream.writeByte(API.PROTO_CORFU_MSG_MARK); response.writeTo(responseOutputStream); ctx.writeAndFlush(outBuf); } catch(IOException e) { log.warn("sendResponse[{}]: Exception occurred when sending response {}, caused by {}", response.getHeader().getRequestId(), response.getHeader(), e.getCause(), e); } finally { IOUtils.closeQuietly(responseOutputStream); outBuf.release(); } }
Source:
<code>FluxComponent getFluxComponent(StreamlineComponent streamlineComponent) { ProxyUtil<FluxComponent> proxyUtil = new ProxyUtil<>(FluxComponent.class); try { <START> FluxComponent fluxComponent = proxyUtil.loadClassFromLibsDirectory(extraJarsLocation, streamlineComponent.getTransformationClass()); <END> return fluxComponent; } catch (ClassNotFoundException | MalformedURLException | InstantiationException | IllegalAccessException e) { LOG.error("Error while creating flux component", e); throw new RuntimeException(e); } }</code><technical_language>Is user expected build place jar "/tmp/storm-artifacts/jars" directory ? extrasJarsLocation is a dir. I UrlClassLoader handles directories. <LINK_0> "This class loader is load classes resources a search path of URLs referring JAR files directories. URL ends a '/' is assumed refer a directory. Otherwise, URL is assumed refer a JAR file opened needed."</technical_language>

Target:
FluxComponent getFluxComponent(StreamlineComponent streamlineComponent) { ProxyUtil<FluxComponent> proxyUtil = new ProxyUtil<>(FluxComponent.class); try { FluxComponent fluxComponent = proxyUtil.loadClassFromLibDirectory(extraJarsLocation, streamlineComponent.getTransformationClass()); return fluxComponent; } catch (ClassNotFoundException | MalformedURLException | InstantiationException | IllegalAccessException e) { LOG.error("Error while creating flux component", e); throw new RuntimeException(e); } }
Source:
<code>public void testChangeBrickField() throws InterpretationException { cloneBrickFormula.setRoot(new FormulaElement(FormulaElement.ElementType.NUMBER, CLONE_BRICK_FORMULA_VALUE, null)); <START> assertNotSame(brickFormula.interpretInteger(sprite), cloneBrickFormula.interpretInteger(sprite)); <END> }</code><technical_language>equals</technical_language>

Target:
public void testChangeBrickField() throws InterpretationException { cloneBrickFormula.setRoot(new FormulaElement(FormulaElement.ElementType.NUMBER, CLONE_BRICK_FORMULA_VALUE, null)); assertNotEquals(brickFormula.interpretInteger(sprite), cloneBrickFormula.interpretInteger(sprite)); }
Source:
<code>private List<String> recursiveFolderDownload(ChannelSftp channelSftp, String sftpRemoteRelativePath, String sftpLocalRelativePath) throws SftpException, IOException { List<String> filesRelativePathName = new ArrayList<>(); List<ChannelSftp.LsEntry> fileAndFolderList = channelSftp.ls(sftpRemoteRelativePath); if (isRemoteFile(fileAndFolderList)) { String localFilePath = Paths.get(sftpLocalRelativePath, fileAndFolderList.get(0).getFilename()).toString(); filesRelativePathName.add(downloadSingleFile(channelSftp, sftpRemoteRelativePath, localFilePath)); if (sftpExtractArchive && sftpRemoteRelativePath.endsWith(".zip")) { <START> getOut().println("Decompressing archive: " + localFilePath); <END> ZipUtil.unpack(new File(localFilePath), new File(sftpLocalRelativePath)); getOut().println("Archive decompressed successfully at: " + sftpLocalRelativePath); } return filesRelativePathName; } for (ChannelSftp.LsEntry item : fileAndFolderList) { String remoteFilePath = Paths.get(sftpRemoteRelativePath, item.getFilename()).toString(); String localFilePath = Paths.get(sftpLocalRelativePath, item.getFilename()).toString(); File localFile = new File(localFilePath); if (!item.getAttrs().isDir()) { filesRelativePathName.add(downloadSingleFile(channelSftp, remoteFilePath, localFilePath)); } else if (!(".".equals(item.getFilename()) || "..".equals(item.getFilename()))) { localFile.mkdirs(); filesRelativePathName.addAll(recursiveFolderDownload(channelSftp, remoteFilePath, localFilePath)); } } return filesRelativePathName; }</code><technical_language>move lines in a private method extractArchive</technical_language>

Target:
private List<String> recursiveFolderDownload(ChannelSftp channelSftp, String sftpRemoteRelativePath, String sftpLocalRelativePath) throws SftpException, IOException { List<String> filesRelativePathName = new ArrayList<>(); List<ChannelSftp.LsEntry> fileAndFolderList = null; try { fileAndFolderList = channelSftp.ls(sftpRemoteRelativePath); } catch (SftpException e) { throw new SftpException(e.id, "File not found or permission denied at " + sftpRemoteRelativePath, e.getCause()); } if (isRemoteFile(fileAndFolderList)) { String localFilePath = Paths.get(sftpLocalRelativePath, fileAndFolderList.get(0).getFilename()).toString(); filesRelativePathName.add(downloadSingleFile(channelSftp, sftpRemoteRelativePath, localFilePath)); if (sftpExtractArchive && sftpRemoteRelativePath.endsWith(".zip")) { extractArchive(localFilePath, sftpLocalRelativePath); } return filesRelativePathName; } for (ChannelSftp.LsEntry item : fileAndFolderList) { String remoteFilePath = Paths.get(sftpRemoteRelativePath, item.getFilename()).toString(); String localFilePath = Paths.get(sftpLocalRelativePath, item.getFilename()).toString(); File localFile = new File(localFilePath); if (!item.getAttrs().isDir()) { filesRelativePathName.add(downloadSingleFile(channelSftp, remoteFilePath, localFilePath)); } else if (!(CURRENT_FOLDER.equals(item.getFilename()) || PARENT_FOLDER.equals(item.getFilename()))) { localFile.mkdirs(); filesRelativePathName.addAll(recursiveFolderDownload(channelSftp, remoteFilePath, localFilePath)); } } return filesRelativePathName; }
Source:
<code><START> public void compile(ICompilationUnit[] sourceUnits, boolean lastRound) { <END> this.stats.startTime = System.currentTimeMillis(); try { reportProgress(Messages.compilation_beginningToCompile); if (this.annotationProcessorManager == null) { beginToCompile(sourceUnits); } else { ICompilationUnit[] originalUnits = sourceUnits.clone(); try { beginToCompile(sourceUnits); if (!lastRound) { processAnnotations(); } if (!this.options.generateClassFiles) { return; } } catch (SourceTypeCollisionException e) { backupAptProblems(); reset(); int originalLength = originalUnits.length; int newProcessedLength = e.newAnnotationProcessorUnits.length; ICompilationUnit[] combinedUnits = new ICompilationUnit[originalLength + newProcessedLength]; System.arraycopy(originalUnits, 0, combinedUnits, 0, originalLength); System.arraycopy(e.newAnnotationProcessorUnits, 0, combinedUnits, originalLength, newProcessedLength); this.annotationProcessorStartIndex = originalLength; compile(combinedUnits, e.isLastRound); return; } } restoreAptProblems(); processCompiledUnits(0, lastRound); } catch (AbortCompilation e) { this.handleInternalException(e, null); } if (this.options.verbose) { if (this.totalUnits > 1) { this.out.println( Messages.bind(Messages.compilation_units, String.valueOf(this.totalUnits))); } else { this.out.println( Messages.bind(Messages.compilation_unit, String.valueOf(this.totalUnits))); } } }</code><technical_language>out of curiosity, is this public</technical_language>

Target:
private void compile(ICompilationUnit[] sourceUnits, boolean lastRound) { this.stats.startTime = System.currentTimeMillis(); try { reportProgress(Messages.compilation_beginningToCompile); if (this.annotationProcessorManager == null) { beginToCompile(sourceUnits); } else { ICompilationUnit[] originalUnits = sourceUnits.clone(); try { beginToCompile(sourceUnits); if (!lastRound) { processAnnotations(); } if (!this.options.generateClassFiles) { return; } } catch (SourceTypeCollisionException e) { backupAptProblems(); reset(); int originalLength = originalUnits.length; int newProcessedLength = e.newAnnotationProcessorUnits.length; ICompilationUnit[] combinedUnits = new ICompilationUnit[originalLength + newProcessedLength]; System.arraycopy(originalUnits, 0, combinedUnits, 0, originalLength); System.arraycopy(e.newAnnotationProcessorUnits, 0, combinedUnits, originalLength, newProcessedLength); this.annotationProcessorStartIndex = originalLength; compile(combinedUnits, e.isLastRound); return; } } restoreAptProblems(); processCompiledUnits(0, lastRound); } catch (AbortCompilation e) { this.handleInternalException(e, null); } if (this.options.verbose) { if (this.totalUnits > 1) { this.out.println( Messages.bind(Messages.compilation_units, String.valueOf(this.totalUnits))); } else { this.out.println( Messages.bind(Messages.compilation_unit, String.valueOf(this.totalUnits))); } } }
Source:
<code>private void notifyAboutPendingChangesIfNotInTransaction() { if (changesBus != null && numberOfRunningTransactions.get() == 0) { for (final Changes changes : pendingChanges) { <START> pendingChanges.remove(changes); <END> changesBus.onNext(changes); } } }</code><technical_language>iterator throw concurrentModificationException, it</technical_language>

Target:
private void notifyAboutPendingChangesIfNotInTransaction() { if (changesBus != null && numberOfRunningTransactions.get() == 0) { final Set<Changes> changes = pendingChanges .getAndSet(newSetFromMap(new ConcurrentHashMap<Changes, Boolean>())); for (final Changes next : changes) { changesBus.onNext(next); } } }
Source:
<code><START> public String getLocalPath(IJavaBreakpoint bp) throws CoreException { <END> if (bp.getMarker() != null && bp.getMarker().getResource() != null && bp.getMarker().getResource().getType() == IResource.FILE) { String type = bp.getTypeName(); if (type != null) { String pkg = (type.lastIndexOf('.') >= 0 ? (type.substring(0, type.lastIndexOf('.')) + "/") : "").replace('.', '/'); return pkg + bp.getMarker().getResource().getName(); } } return null; }</code><technical_language>method need public. If so, please visibility 'private'</technical_language>

Target:
private String getLocalPath(IJavaBreakpoint bp) throws CoreException { if (bp.getMarker() != null && bp.getMarker().getResource() != null && bp.getMarker().getResource().getType() == IResource.FILE) { String type = bp.getTypeName(); if (type != null) { String pkg = (type.lastIndexOf('.') >= 0 ? (type.substring(0, type.lastIndexOf('.')) + "/") : "").replace('.', '/'); return pkg + bp.getMarker().getResource().getName(); } } return null; }
Source:
<code>private void seekInternal() throws IOException { if (pos == nextPos) { return; } if (nextPos > pos) { long skipped = wrappedStream.skip(nextPos - pos); pos = pos + skipped; } if (nextPos < pos) { wrappedStream.close(); try { wrappedStream = channel.get(path.toUri().getPath()); pos = wrappedStream.skip(nextPos); } catch (SftpException e) { <START> throw new UncheckedIOException(new IOException(e)); <END> } } }</code><technical_language>double wrap</technical_language>

Target:
private void seekInternal() throws IOException { if (pos == nextPos) { return; } if (nextPos > pos) { long skipped = wrappedStream.skip(nextPos - pos); pos = pos + skipped; } if (nextPos < pos) { wrappedStream.close(); try { wrappedStream = channel.get(path.toUri().getPath()); pos = wrappedStream.skip(nextPos); } catch (SftpException e) { throw new IOException(e); } } }
Source:
<code><START> private ArrayList getList(Group group) throws TranslatorException { <END> ArrayList<Object> outputList = new ArrayList(); int fieldCount = group.getType().getFieldCount(); for (int field = 0; field < fieldCount; field++) { int valueCount = group.getFieldRepetitionCount(field); for (int index = 0; index < valueCount; index++) { Group listGroup = group.getGroup(field, index); Type fieldType = listGroup.getType().getType(0); if(!fieldType.isPrimitive()) { throw new TranslatorException("We don't support any logical types in a list."); } PrimitiveType.PrimitiveTypeName type = fieldType.asPrimitiveType().getPrimitiveTypeName(); outputList.add(getPrimitiveTypeObject(type, 0, 0, listGroup, fieldType)); } } return outputList; }</code><technical_language>For engine properly handle result array need instance of array, ArrayList</technical_language>

Target:
private ArrayImpl getList(Group group) throws TranslatorException { ArrayList<Object> outputList = new ArrayList<Object>(); int fieldCount = group.getType().getFieldCount(); for (int field = 0; field < fieldCount; field++) { int valueCount = group.getFieldRepetitionCount(field); for (int index = 0; index < valueCount; index++) { Group listGroup = group.getGroup(field, index); Type fieldType = listGroup.getType().getType(0); if(!fieldType.isPrimitive()) { throw new TranslatorException("We don't support any logical types in a list."); } PrimitiveType.PrimitiveTypeName type = fieldType.asPrimitiveType().getPrimitiveTypeName(); outputList.add(getPrimitiveTypeObject(type, 0, 0, listGroup, fieldType)); } } return new ArrayImpl(outputList.toArray()); }