auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void shouldReturnDifferentResourceVariant() throws Exception { String fileName = "Main.java"; File file = testRepo.createFile(iProject, fileName); testRepo.appendContentAndCommit(iProject, file, "class Main {}", "initial commit"); IFile mainJava = testRepo.getIFile(iProject, file); testRepo.createAndCheckoutBranch(Constants.R_HEADS + Constants.MASTER, Constants.R_HEADS + "test"); testRepo.appendContentAndCommit(iProject, file, " GitSynchronizeData data = new GitSynchronizeData(repo, Constants.HEAD, Constants.MASTER, false); GitSynchronizeDataSet dataSet = new GitSynchronizeDataSet(data); GitResourceVariantTree grvt = new GitRemoteResourceVariantTree(dataSet); IResourceVariant actual = grvt.getResourceVariant(mainJava); assertNotNull(actual); assertEquals(fileName, actual.getName()); InputStream actualIn = actual.getStorage(new NullProgressMonitor()) .getContents(); byte[] actualByte = new byte[actualIn.available()]; actualIn.read(actualByte); <START> InputStream expectedIn = mainJava.getContents(); <END> byte[] expectedByte = new byte[expectedIn.available()]; expectedIn.read(expectedByte); if (Arrays.equals(expectedByte, actualByte)) fail(); else assertTrue(true); }</code><technical_language>This input stream is closed</technical_language>

Target:
public void shouldReturnDifferentResourceVariant() throws Exception { String fileName = "Main.java"; File file = testRepo.createFile(iProject, fileName); testRepo.appendContentAndCommit(iProject, file, "class Main {}", "initial commit"); IFile mainJava = testRepo.getIFile(iProject, file); testRepo.createAndCheckoutBranch(Constants.R_HEADS + Constants.MASTER, Constants.R_HEADS + "test"); testRepo.appendContentAndCommit(iProject, file, " GitSynchronizeData data = new GitSynchronizeData(repo, Constants.HEAD, Constants.MASTER, false); GitSynchronizeDataSet dataSet = new GitSynchronizeDataSet(data); GitResourceVariantTree grvt = new GitRemoteResourceVariantTree(dataSet); IResourceVariant actual = grvt.getResourceVariant(mainJava); assertNotNull(actual); assertEquals(fileName, actual.getName()); InputStream actualIn = actual.getStorage(new NullProgressMonitor()) .getContents(); byte[] actualByte = getBytesAndCloseStream(actualIn); InputStream expectedIn = mainJava.getContents(); byte[] expectedByte = getBytesAndCloseStream(expectedIn); if (Arrays.equals(expectedByte, actualByte)) fail(); else assertTrue(true); }
Source:
<code>public void generateDiskDescriptionWhenDescriptionIsCompletelyTruncated() throws IOException { <START> String alias = generateRandomString(194); <END> disk.setDiskAlias(alias); disk.setDiskDescription("DiskDescription"); assertDiskDescriptionMap(disk, generateDiskAliasJsonEntry(alias)); }</code><technical_language>Please a constant for 194 (like MAXIMUM_STRING_LENGTH)</technical_language>

Target:
public void generateDiskDescriptionWhenDescriptionIsCompletelyTruncated() throws IOException { String alias = generateRandomString(DISK_ALIAS_MAX_LENGTH); disk.setDiskAlias(alias); disk.setDiskDescription("DiskDescription"); assertDiskDescriptionMap(disk, generateDiskAliasJsonEntry(alias)); }
Source:
<code><START> protected boolean isConnWithSameDetailsExists(StorageServerConnections connection, Guid storagePoolId) { List<StorageServerConnections> connections = null; connections = getConnWithSameDetailsExists(connection, storagePoolId); if (connections == null) { return false; } boolean isDuplicateConnExists = connections.size() > 1 || (connections.size() == 1 && !connections.get(0).getId().equalsIgnoreCase(connection.getId())); return isDuplicateConnExists; } <END></code><technical_language>do need this for</technical_language>

Target:
protected String isConnWithSameDetailsExists(StorageServerConnections connection, Guid storagePoolId) { List<StorageServerConnections> connections = null; if (connection.getStorageType() == StorageType.LOCALFS) { List<StorageServerConnections> connectionsForPool = storagePoolId == null ? Collections.emptyList() : storageServerConnectionDao.getAllConnectableStorageSeverConnection(storagePoolId); List<StorageServerConnections> connectionsForPath = storageServerConnectionDao.getAllForStorage(connection.getConnection()); connections = (List<StorageServerConnections>) CollectionUtils.intersection(connectionsForPool, connectionsForPath); } else if (connection.getStorageType().isFileDomain()) { String connectionField = connection.getConnection(); connections = storageServerConnectionDao.getAllForStorage(connectionField); } else { StorageServerConnections sameConnection = iscsiStorageHelper.findConnectionWithSameDetails(connection); connections = sameConnection != null ? Collections.singletonList(sameConnection) : Collections.emptyList(); } return (connections != null && connections.size() == 1 && connections.get(0) != null) ? connections.get(0).getId() : ""; }
Source:
<code>@Override public void attach(Linker linker) { String requiredBy = type.getQualifiedName().toString(); for (int i = 0; i < keys.size(); i++) { bindings[i] = linker.requestBinding(keys.get(i), requiredBy); } if (supertypeKey != null) { <START> linker.requestBinding(supertypeKey, requiredBy, false, true); <END> } }</code><technical_language>oh, I a bug. supertypeBinding show in getDependencies? I a bug</technical_language>

Target:
@Override public void attach(Linker linker) { String requiredBy = type.getQualifiedName().toString(); for (int i = 0; i < keys.size(); i++) { bindings[i] = linker.requestBinding(keys.get(i), requiredBy, getClass().getClassLoader()); } if (supertypeKey != null) { linker.requestBinding(supertypeKey, requiredBy, getClass().getClassLoader(), false, true); } }
Source:
<code>public ParsedIteratorConfig getParsedIteratorConfig(IteratorScope scope) { long count = getUpdateCount(); AtomicReference<ParsedIteratorConfig> ref = iteratorConfig.get(scope); ParsedIteratorConfig pic = ref.get(); if (pic == null || pic.updateCount != count) { Map<String,Map<String,String>> allOpts = new HashMap<>(); <START> List<IterInfo> iters = IterConfigUtil.parseIterConf(scope, new ArrayList<>(), allOpts, this); <END> ParsedIteratorConfig newPic = new ParsedIteratorConfig(iters, allOpts, get(Property.TABLE_CLASSPATH), count); ref.compareAndSet(pic, newPic); pic = newPic; } return pic; }</code><technical_language>This pass Collections.emptyList()</technical_language>

Target:
public ParsedIteratorConfig getParsedIteratorConfig(IteratorScope scope) { long count = getUpdateCount(); AtomicReference<ParsedIteratorConfig> ref = iteratorConfig.get(scope); ParsedIteratorConfig pic = ref.get(); if (pic == null || pic.updateCount != count) { Map<String,Map<String,String>> allOpts = new HashMap<>(); List<IterInfo> iters = IterConfigUtil.parseIterConf(scope, Collections.emptyList(), allOpts, this); ParsedIteratorConfig newPic = new ParsedIteratorConfig(iters, allOpts, get(Property.TABLE_CLASSPATH), count); ref.compareAndSet(pic, newPic); pic = newPic; } return pic; }
Source:
<code>public static IJavaElement resolveJavaElement(Object object, ILaunch launch) throws CoreException { Object sourceElement = resolveSourceElement(object, launch); IJavaElement javaElement = getJavaElement(sourceElement); if (javaElement == null) { sourceElement = resolveSourceElement(object, JAVA_STRATUM, launch); <START> if (sourceElement != null) <END> javaElement = getJavaElement(sourceElement); } return javaElement; }</code><technical_language>need this null-check, getJavaElement method that</technical_language>

Target:
public static IJavaElement resolveJavaElement(Object object, ILaunch launch) throws CoreException { Object sourceElement = resolveSourceElement(object, launch); IJavaElement javaElement = getJavaElement(sourceElement); if (javaElement == null) { sourceElement = resolveSourceElement(object, JAVA_STRATUM, launch); javaElement = getJavaElement(sourceElement); } return javaElement; }
Source:
<code>private static Set<Integer> extractCpuSet(Map<String, Object> parameters) { Object cpus = parameters.get(CPUS_PARAMETER_KEY); if (cpus instanceof Collection<?>) { <START> Set<Integer> cpuSet = new HashSet<>(); if (!((Collection<?>) cpus).isEmpty()) { for (Integer cpu : (Collection<Integer>) cpus) { cpuSet.add(cpu); } } return cpuSet; <END> } return Collections.emptySet(); }</code><technical_language>Collection<?> cpuCol = (Collection<?>) cpus; return cpuCol.stream().filter(c -> c instanceof Integer).map(c -> (Integer) c).collect(Collectors.toSet());</technical_language>

Target:
private static Set<Integer> extractCpuSet(Map<String, Object> parameters) { Object cpus = parameters.get(CPUS_PARAMETER_KEY); if (cpus instanceof Collection<?>) { return ((Collection<?>) cpus).stream().filter(cpu -> cpu instanceof Integer) .map(cpu -> (Integer) cpu) .collect(Collectors.toSet()); } return Collections.emptySet(); }
Source:
<code>public void info(Throwable thrown) { long startTime = System.nanoTime(); <START> delegate.fine(thrown); <END> logOnSlowLogging(startTime); }</code><technical_language>info instead of fine</technical_language>

Target:
public void info(Throwable thrown) { long startTime = System.nanoTime(); delegate.info(thrown); logOnSlowLogging(startTime); }
Source:
<code>static String readString(ByteBuf buffer, int length, Charset charset) { if (buffer.isDirect()) { final String result = buffer.toString(buffer.readerIndex(), length, charset); buffer.skipBytes(length); return result; } else { if (buffer.hasArray()) { final int offset = buffer.arrayOffset() + buffer.readerIndex(); final String result; <START> if (offset == 0 && length == buffer.array().length) { <END> result = new String(buffer.array(), charset); } else { result = new String(buffer.array(), offset, length, charset); } buffer.skipBytes(length); return result; } final byte[] array = new byte[length]; buffer.readBytes(array); return new String(array, charset); } }</code><technical_language>IMHO, testing this is useless perform branch</technical_language>

Target:
static String readString(ByteBuf buffer, int length, Charset charset) { if (buffer.isDirect()) { final String result = buffer.toString(buffer.readerIndex(), length, charset); buffer.skipBytes(length); return result; } else if (buffer.hasArray()) { final String result = new String(buffer.array(), buffer.arrayOffset() + buffer.readerIndex(), length, charset); buffer.skipBytes(length); return result; } else { final byte[] array = new byte[length]; buffer.readBytes(array); return new String(array, charset); } }
Source:
<code>private IItemPropertyDescriptor getPropertyDescriptor(final EObject instance, final String featureName) { final EStructuralFeature structuralFeature = instance.eClass().getEStructuralFeature(featureName); ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); final IItemPropertySource propertySource = (IItemPropertySource) adapterFactory.adapt(instance, IItemPropertySource.class); IItemPropertyDescriptor propertyDescriptor = null; if (propertySource != null) { final Iterator<?> iterDescriptors = propertySource.getPropertyDescriptors(instance).iterator(); while (iterDescriptors.hasNext() && propertyDescriptor == null) { final IItemPropertyDescriptor currentPropertyDescriptor = (IItemPropertyDescriptor) iterDescriptors.next(); final Object currentFeature = currentPropertyDescriptor.getFeature(instance); if (currentFeature != null && currentFeature.equals(structuralFeature)) { propertyDescriptor = currentPropertyDescriptor; } } } <START> adapterFactory.dispose(); <END> return propertyDescriptor; }</code><technical_language>above, dispose() protected a finally block</technical_language>

Target:
private IItemPropertyDescriptor getPropertyDescriptor(final EObject instance, final String featureName) { IItemPropertyDescriptor propertyDescriptor = null; final EStructuralFeature structuralFeature = instance.eClass().getEStructuralFeature(featureName); ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); try { final IItemPropertySource propertySource = (IItemPropertySource) adapterFactory.adapt(instance, IItemPropertySource.class); if (propertySource != null) { final Iterator<?> iterDescriptors = propertySource.getPropertyDescriptors(instance).iterator(); while (iterDescriptors.hasNext() && propertyDescriptor == null) { final IItemPropertyDescriptor currentPropertyDescriptor = (IItemPropertyDescriptor) iterDescriptors.next(); final Object currentFeature = currentPropertyDescriptor.getFeature(instance); if (currentFeature != null && currentFeature.equals(structuralFeature)) { propertyDescriptor = currentPropertyDescriptor; } } } } finally { adapterFactory.dispose(); } return propertyDescriptor; }
Source:
<code>public void configure(final DeploymentPhaseContext context, final ComponentDescription description, final ComponentConfiguration configuration) throws DeploymentUnitProcessingException { final ClassReflectionIndex classIndex = context.getDeploymentUnit().getAttachment(Attachments.REFLECTION_INDEX).getClassIndex(configuration.getComponentClass()); final Constructor<?> ctor = classIndex.getConstructor(new String[0]); boolean noInterface = false; for(ViewDescription view : description.getViews()) { if(view.getViewClassName().equals(description.getComponentClassName())) { noInterface = true; } } EjbValidationsUtil.verifyEjbClassAndDefaultConstructor(ctor, configuration.getComponentClass().getEnclosingClass(), noInterface, description.getComponentName(), description.getComponentClassName(), configuration.getComponentClass().getModifiers()); <START> EjbValidationsUtil.verifyEjbMethodAreNotFinalNorStatic(configuration.getComponentClass().getDeclaredMethods(),description.getComponentClassName()); <END> for ( Class<?> interfaceClass : configuration.getComponentClass().getInterfaces()) EjbValidationsUtil.verifyEjbMethodAreNotFinalNorStatic(interfaceClass.getDeclaredMethods(), interfaceClass.getCanonicalName()); }</code><technical_language>@rpelisse @mjurc Jira states: "The ejb 3.2 core specification state in chapter 4.9.6 business methods declared final static.". class.getDeclaredMethods() methods of class itself, verifying those. wrong getDeclaredMethods() return private methods well, business methods. Also, a method public necessarily need a business method (e.g. if a local/remote interfaces defined method is declared there)? Finally, ejb class inherit some business methods a super class, check well</technical_language>

Target:
public void configure(final DeploymentPhaseContext context, final ComponentDescription description, final ComponentConfiguration configuration) throws DeploymentUnitProcessingException { final ClassReflectionIndex classIndex = context.getDeploymentUnit().getAttachment(Attachments.REFLECTION_INDEX).getClassIndex(configuration.getComponentClass()); final Constructor<?> ctor = classIndex.getConstructor(new String[0]); boolean noInterface = false; for(ViewDescription view : description.getViews()) { if(view.getViewClassName().equals(description.getComponentClassName())) { noInterface = true; } } EjbValidationsUtil.getBusinessMethods(configuration.getComponentClass()); EjbValidationsUtil.verifyEjbClassAndDefaultConstructor(ctor, configuration.getComponentClass().getEnclosingClass(), noInterface, description.getComponentName(), description.getComponentClassName(), configuration.getComponentClass().getModifiers()); EjbValidationsUtil.verifyEjbPublicMethodAreNotFinalNorStatic(configuration.getComponentClass().getDeclaredMethods(),description.getComponentClassName()); for ( Class<?> interfaceClass : configuration.getComponentClass().getInterfaces()) EjbValidationsUtil.verifyEjbPublicMethodAreNotFinalNorStatic(interfaceClass.getDeclaredMethods(), interfaceClass.getCanonicalName()); }
Source:
<code>public void progress() { if (!this.bPlayer.canBendIgnoreBinds(this) || !this.bPlayer.hasElement(Element.CHI)) { this.remove(); return; <START> } else if (duration != 0 && System.currentTimeMillis() > this.getStartTime() + duration) { <END> remove(); return; } if (!this.player.hasPotionEffect(PotionEffectType.SPEED)) { this.player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 60, this.speed, true)); } if (!this.player.hasPotionEffect(PotionEffectType.JUMP)) { this.player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 60, this.jump, true)); } }</code><technical_language>duration variable qualified this keyword</technical_language>

Target:
public void progress() { if (!this.bPlayer.canBendIgnoreBinds(this) || !this.bPlayer.hasElement(Element.CHI)) { this.remove(); return; } else if (this.duration != 0 && System.currentTimeMillis() > this.getStartTime() + this.duration) { remove(); return; } if (!this.player.hasPotionEffect(PotionEffectType.SPEED)) { this.player.addPotionEffect(new PotionEffect(PotionEffectType.SPEED, 60, this.speed, true)); } if (!this.player.hasPotionEffect(PotionEffectType.JUMP)) { this.player.addPotionEffect(new PotionEffect(PotionEffectType.JUMP, 60, this.jump, true)); } }
Source:
<code>public void evaluate_shouldReturnAllPatientsTakingDrugsBeforeSpecifiedDate() throws Exception { cohortDefinition.setActivatedOnOrBefore(DateUtil.getDateTime(2008, 8, 2)); Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); <START> System.out.println("Taking Drugs in before " + cohort.getMemberIds() + " " + cohortDefinition); <END> Assert.assertTrue(cohort.contains(2)); Assert.assertTrue(cohort.contains(8)); Assert.assertTrue(cohort.contains(22)); Assert.assertEquals(3, cohort.size()); }</code><technical_language>a this? <LINK_0></technical_language>

Target:
public void evaluate_shouldReturnAllPatientsTakingDrugsBeforeSpecifiedDate() throws Exception { cohortDefinition.setActivatedOnOrBefore(DateUtil.getDateTime(2008, 8, 2)); Cohort cohort = Context.getService(CohortDefinitionService.class).evaluate(cohortDefinition, null); Assert.assertTrue(cohort.contains(2)); Assert.assertTrue(cohort.contains(22)); Assert.assertEquals(2, cohort.size()); }
Source:
<code>private static List<List<Integer>> generateKeys(int beginInclusive, int endExclusive) { <START> ImmutableList.Builder<List<Integer>> result = ImmutableList.builder(); <END> for (int value = beginInclusive; value < endExclusive; value++) { result.add(ImmutableList.of(value)); } return result.build(); }</code><technical_language>IntStream.ofRange(beginInclusive, endExclusive) .mapToObj(ImmutableList::of) .collecto(toImmutableList());</technical_language>

Target:
private static List<List<Integer>> generateKeys(int beginInclusive, int endExclusive) { return IntStream.range(beginInclusive, endExclusive) .mapToObj(ImmutableList::of) .collect(toImmutableList()); }
Source:
<code>public void testFetchEmptyRecentlyFinishedFlows() throws Exception { final ExecutableFlow flow1 = createExecution(System.currentTimeMillis(), Status.SUCCEEDED); flow1.setEndTime(System.currentTimeMillis()); this.executionFlowDao.updateExecutableFlow(flow1); <START> DateTimeUtils.setCurrentMillisOffset(-FLOW_FINISHED_TIME.toMillis()); <END> flow1.setEndTime(DateTimeUtils.currentTimeMillis()); this.executionFlowDao.updateExecutableFlow(flow1); final List<ExecutableFlow> flows = this.executionFlowDao .fetchRecentlyFinishedFlows(RECENTLY_FINISHED_LIFETIME); assertThat(flows).isEmpty(); }</code><technical_language>[understand there!] consider alternative _long twoMinutesAgo = currentTime - FLOW_FINISHED_TIME.toMillis(); setEndTime(twoMinutesAgo)_ more readable</technical_language>

Target:
public void testFetchEmptyRecentlyFinishedFlows() throws Exception { final long currentTime = System.currentTimeMillis(); final long endTime = currentTime - FLOW_FINISHED_TIME.toMillis(); final long startTime = currentTime - FLOW_FINISHED_TIME.toMillis() - 10; final ExecutableFlow flow1 = createExecution(startTime, Status.SUCCEEDED); flow1.setEndTime(endTime); this.executionFlowDao.updateExecutableFlow(flow1); final List<ExecutableFlow> flows = this.executionFlowDao .fetchRecentlyFinishedFlows(RECENTLY_FINISHED_LIFETIME); assertThat(flows).isEmpty(); }
Source:
<code>@Test void testTypeMismatch() { VolcanoPlanner planner = new VolcanoPlanner(); planner.addRelTraitDef(ConventionTraitDef.INSTANCE); planner.addRule(MockPhysLeafRule.INSTANCE); RelOptCluster cluster = newCluster(planner); NoneLeafRel leafRel = new NoneLeafRel( cluster, "a"); RelNode convertedRel = planner.changeTraits( leafRel, cluster.traitSetOf(PHYS_CALLING_CONVENTION)); planner.setRoot(convertedRel); try { planner.chooseDelegate().findBestExp(); <START> } catch (RuntimeException e) { <END> Throwable exception = ExceptionUtils.getRootCause(e); assertThat(exception, instanceOf(IllegalArgumentException.class)); assertThat( exception.getMessage(), isLinux("Type mismatch: \n" + "this: JavaType(class java.lang.Integer) -> JavaType(void) NOT NULL\n")); } }</code><technical_language>Please assertThrows exception is thrown</technical_language>

Target:
@Test void testTypeMismatch() { VolcanoPlanner planner = new VolcanoPlanner(); planner.addRelTraitDef(ConventionTraitDef.INSTANCE); planner.addRule(MockPhysLeafRule.INSTANCE); RelOptCluster cluster = newCluster(planner); NoneLeafRel leafRel = new NoneLeafRel( cluster, "a"); RelNode convertedRel = planner.changeTraits( leafRel, cluster.traitSetOf(PHYS_CALLING_CONVENTION)); planner.setRoot(convertedRel); RuntimeException ex = assertThrows(RuntimeException.class, () -> { planner.chooseDelegate().findBestExp(); }, "Should throw exception fail since the type mismatches after applying rule."); Throwable exception = ExceptionUtils.getRootCause(ex); assertThat(exception, instanceOf(IllegalArgumentException.class)); assertThat( exception.getMessage(), isLinux("Type mismatch:\n" + "rel rowtype: RecordType(JavaType(class java.lang.Integer) this) NOT NULL\n" + "equiv rowtype: RecordType(JavaType(void) NOT NULL this) NOT NULL\n" + "Difference:\n" + "this: JavaType(class java.lang.Integer) -> JavaType(void) NOT NULL\n")); }
Source:
<code>private void doVersionUpdate(Session session, String keyspace, long delay, int maxRetries) throws InterruptedException { String configId = "org.hawkular.metrics"; String configName = "version"; String version = VersionUtil.getVersion(); PreparedStatement updateVersion = null; int retries = 0; while (true) { try { if (updateVersion == null) { updateVersion = session.prepare( "INSERT INTO " + keyspace + ".sys_config (config_id, name, value) VALUES (?, ?, ?)"); } session.execute(updateVersion.bind(configId, configName, version)); logger.info("Updated system configuration to version {}", version); break; } catch (Exception e) { retries++; if (retries > maxRetries) { <START> throw new RuntimeException("Failed to update version in system configuration after " + maxRetries + <END> " attempts.", e); } logger.warn("Failed to update version in system configuration. Retrying in " + delay + " ms", e); Thread.sleep(delay); } } }</code><technical_language>this throw VersionUpdateException? ;)</technical_language>

Target:
private void doVersionUpdate(Session session, String keyspace, long delay, int maxRetries) { String configId = "org.hawkular.metrics"; String configName = "version"; String version = VersionUtil.getVersion(); SimpleStatement updateVersion = new SimpleStatement( "INSERT INTO sys_config (config_id, name, value) VALUES (?, ?, ?)", configId, configName, version) .setKeyspace(keyspace); int retries = 0; while (true) { try { session.execute(updateVersion); logger.info("Updated system configuration to version {}", version); break; } catch (Exception e) { retries++; if (retries > maxRetries) { throw new VersionUpdateException("Failed to update version in system configuration after " + maxRetries + " attempts.", e); } logger.warn("Failed to update version in system configuration. Retrying in " + delay + " ms", e); try { Thread.sleep(delay); } catch (InterruptedException e1) { throw new VersionUpdateException("Aborting version update due to interrupt", e1); } } } }
Source:
<code>protected Bitmap getBitmapFromUrl(String url) { ImageStore is = new ImageStore(context, "MixpanelPushNotification"); try { Bitmap bm = is.getImage(url); <START> return bm; <END> } catch (ImageStore.CantGetImageException e) { return null; } }</code><technical_language>return is.getImage(url) need create a local var</technical_language>

Target:
protected Bitmap getBitmapFromUrl(String url) { ImageStore is = new ImageStore(context, "MixpanelPushNotification"); try { return is.getImage(url); } catch (ImageStore.CantGetImageException e) { return null; } }
Source:
<code>private String sign(final Long timestamp) throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeyException { String stringToSign = timestamp + "\n" + SECRET; System.out.println(stringToSign); Mac mac = Mac.getInstance("HmacSHA256"); <START> mac.init(new SecretKeySpec(SECRET.getBytes("UTF-8"), "HmacSHA256")); byte[] signData = mac.doFinal(stringToSign.getBytes("UTF-8")); return new String(Base64.getEncoder().encode(signData), "UTF-8"); <END> }</code><technical_language>Consider java.nio.charset.StandardCharsets#UTF_8</technical_language>

Target:
private String sign(final Long timestamp) throws NoSuchAlgorithmException, UnsupportedEncodingException, InvalidKeyException { String stringToSign = timestamp + "\n" + SECRET; System.out.println(stringToSign); Mac mac = Mac.getInstance("HmacSHA256"); mac.init(new SecretKeySpec(SECRET.getBytes(StandardCharsets.UTF_8.name()), "HmacSHA256")); byte[] signData = mac.doFinal(stringToSign.getBytes(StandardCharsets.UTF_8.name())); return new String(Base64.getEncoder().encode(signData), StandardCharsets.UTF_8.name()); }
Source:
<code><START> private List<Object> searchKnowledgeGraph(String query) throws IOException { <END> Kgsearch.Entities.Search kgRequest = kgClient.entities().search(); kgRequest.setQuery(query); kgRequest.setKey(API_KEY); return kgRequest.execute().getItemListElement(); }</code><technical_language>rarely need private, List<Object> is rarely correct</technical_language>

Target:
JsonObject searchKnowledgeGraph(String query) throws IOException { Kgsearch.Entities.Search kgRequest = kgClient.entities().search(); kgRequest.setQuery(query); kgRequest.setKey(API_KEY); return gson.fromJson(kgRequest.execute().toString(), JsonObject.class); }
Source:
<code>public void shouldUseSpecifiedNameForLeftJoinOperationBetweenKStreamAndKStream() { final KStream<String, String> streamOne = builder.stream(STREAM_TOPIC); final KStream<String, String> streamTwo = builder.stream(STREAM_TOPIC_TWO); <START> streamOne.leftJoin(streamTwo, (value1, value2) -> value1, JoinWindows.of(Duration.ofHours(1)), Joined.as(STREAM_OPERATION_NAME), Materialized.as(STREAM_OPERATION_NAME)); <END> builder.build(); final ProcessorTopology topology = builder.internalTopologyBuilder.rewriteTopology(new StreamsConfig(props)).build(); assertSpecifiedNameForStateStore(topology.stateStores(), STREAM_OPERATION_NAME + "-this-join-store", STREAM_OPERATION_NAME + "-outer-other-join-store" ); assertSpecifiedNameForOperation(topology, "KSTREAM-SOURCE-0000000000", "KSTREAM-SOURCE-0000000001", STREAM_OPERATION_NAME + "-this-windowed", STREAM_OPERATION_NAME + "-other-windowed", STREAM_OPERATION_NAME + "-this-join", STREAM_OPERATION_NAME + "-outer-other-join", STREAM_OPERATION_NAME + "-merge"); }</code><technical_language>tests (one for case)</technical_language>

Target:
public void shouldUseSpecifiedNameForLeftJoinOperationBetweenKStreamAndKStream() { final KStream<String, String> streamOne = builder.stream(STREAM_TOPIC); final KStream<String, String> streamTwo = builder.stream(STREAM_TOPIC_TWO); streamOne.leftJoin(streamTwo, (value1, value2) -> value1, JoinWindows.of(Duration.ofHours(1)), StreamJoined.<String, String, String>as(STREAM_OPERATION_NAME).withName(STREAM_OPERATION_NAME)); builder.build(); final ProcessorTopology topology = builder.internalTopologyBuilder.rewriteTopology(new StreamsConfig(props)).build(); assertNamesForStateStore(topology.stateStores(), STREAM_OPERATION_NAME + "-this-join-store", STREAM_OPERATION_NAME + "-outer-other-join-store" ); assertNamesForOperation(topology, "KSTREAM-SOURCE-0000000000", "KSTREAM-SOURCE-0000000001", STREAM_OPERATION_NAME + "-this-windowed", STREAM_OPERATION_NAME + "-other-windowed", STREAM_OPERATION_NAME + "-this-join", STREAM_OPERATION_NAME + "-outer-other-join", STREAM_OPERATION_NAME + "-merge"); }
Source:
<code>protected void doSetup(ManagementClient client, String containerId) throws Exception { ModelControllerClient mcc = client.getControllerClient(); <START> ModelNode addRaOperation = Operations.createWriteAttributeOperation(RA_ADDRESS.toModelNode(), "default-jsf-impl-slot", "idontexist"); <END> addRaOperation.get("archive").set("wf-ra-ely-security.rar"); addRaOperation.get("transaction-support").set("NoTransaction"); ModelNode response = mcc.execute(addRaOperation); ServerReload.executeReloadAndWaitForCompletion(client); }</code><technical_language>Minor addRaOperation reworded writeJSFAttributeOperation that</technical_language>

Target:
protected void doSetup(ManagementClient client, String containerId) throws Exception { ModelControllerClient mcc = client.getControllerClient(); ModelNode writeJSFAttributeOperation = Operations.createWriteAttributeOperation(JSF_ADDRESS.toModelNode(), "default-jsf-impl-slot", "idontexist"); ModelNode response = mcc.execute(writeJSFAttributeOperation); Assert.assertEquals(SUCCESS, response.get(OUTCOME).asString()); ServerReload.executeReloadAndWaitForCompletion(client); }
Source:
<code>private void createButtons() { <START> btnClose = createButton(locale.buttonClose(), "git-compare-branch-close", new ClickHandler() { <END> @Override public void onClick(ClickEvent event) { delegate.onCloseClicked(); } }); addButtonToFooter(btnClose); btnCompare = createButton(locale.buttonCompare(), "git-compare-branch-compare", new ClickHandler() { @Override public void onClick(ClickEvent event) { delegate.onCompareClicked(); } }); addButtonToFooter(btnCompare); }</code><technical_language>89 line -> this.ensureDebugId("git-compare-revision-window"); "git-compare-branch"</technical_language>

Target:
private void createButtons() { btnClose = createButton(locale.buttonClose(), "git-compare-revision-close", new ClickHandler() { @Override public void onClick(ClickEvent event) { delegate.onCloseClicked(); } }); addButtonToFooter(btnClose); btnCompare = createButton(locale.buttonCompare(), "git-compare-revision-compare", new ClickHandler() { @Override public void onClick(ClickEvent event) { delegate.onCompareClicked(); } }); addButtonToFooter(btnCompare); }
Source:
<code><START> public boolean isRESTRequest(String contentType) { <END> return contentType != null && (contentType.indexOf(HTTPConstants.MEDIA_TYPE_APPLICATION_XML) > -1 || contentType.indexOf(HTTPConstants.MEDIA_TYPE_X_WWW_FORM) > -1 || contentType.indexOf(HTTPConstants.MEDIA_TYPE_MULTIPART_FORM_DATA) > -1 || contentType.indexOf(HTTPConstants.MEDIA_TYPE_APPLICATION_JSON) > -1); }</code><technical_language>Do need this a public method? change this private</technical_language>

Target:
private boolean isRESTRequest(String contentType) { return contentType != null && (contentType.indexOf(HTTPConstants.MEDIA_TYPE_APPLICATION_XML) > -1 || contentType.indexOf(HTTPConstants.MEDIA_TYPE_X_WWW_FORM) > -1 || contentType.indexOf(HTTPConstants.MEDIA_TYPE_MULTIPART_FORM_DATA) > -1 || contentType.indexOf(HTTPConstants.MEDIA_TYPE_APPLICATION_JSON) > -1); }
Source:
<code>private void setSSLOptions() { if (sslMode != null && sslMode != SSLMode.DISABLED) { this.useSSL(true); this.verifyServerCertificate(false); this.requireSSL(false); if (sslMode == SSLMode.REQUIRED || sslMode == SSLMode.VERIFY_CA || sslMode == SSLMode.VERIFY_IDENTITY) { this.requireSSL(true); <START> } <END> if (sslMode == SSLMode.VERIFY_IDENTITY) { this.verifyServerCertificate(true); } } else { this.useSSL(false); } }</code><technical_language>boil this to: this.requireSSL(sslMode == SSLMode.REQUIRED || sslMode == SSLMode.VERIFY_CA || sslMode == SSLMode.VERIFY_IDENTITY)</technical_language>

Target:
private void setSSLOptions() { if (sslMode != null && sslMode != SSLMode.DISABLED) { this.useSSL(true); this.verifyServerCertificate(false); this.requireSSL(false); this.requireSSL(sslMode == SSLMode.REQUIRED || sslMode == SSLMode.VERIFY_CA || sslMode == SSLMode.VERIFY_IDENTITY); this.verifyServerCertificate(sslMode == SSLMode.VERIFY_IDENTITY); } else { this.useSSL(false); } }
Source:
<code><START> public String category$getId() { <END> return this.id; }</code><technical_language>implement interface here</technical_language>

Target:
public String getId() { return this.id; }
Source:
<code>private List<CramCompressionRecord> getNoRefRecords() { final List<CramCompressionRecord> records = new ArrayList<>(); for (int i = 0; i < TEST_RECORD_COUNT; i++) { <START> records.add(createRecord(i, SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX)); <END> } return records; }</code><technical_language>This test data is a bit suspicious. createRecord alternately creates mapped unmapped records, means some of records created wind "mapped/half-unplaced" others wind "unmapped/half-placed", due alignment start reference index. weird states for test data, clear this method intentional. want test "aberrant" cases, need a cleaner separation valid test data invalid</technical_language>

Target:
private List<CramCompressionRecord> getNoRefRecords() { final List<CramCompressionRecord> records = new ArrayList<>(); for (int index = 0; index < TEST_RECORD_COUNT; index++) { final CramCompressionRecord record = createRecord(index, SAMRecord.NO_ALIGNMENT_REFERENCE_INDEX); record.setSegmentUnmapped(true); records.add(record); } return records; }
Source:
<code>public void execute(DelegateExecution execution) throws Exception { Pool pool = (Pool) execution.getVariable(CoreProcessVariables.POOL); checkNotNull(pool, "Please add the pool description as a process " + "variable with the name '%s'.", CoreProcessVariables.POOL); Machine machine = (Machine) execution.getVariable("machine"); LOG.info(">> Connecting to machine to setup admin access", machine); SSHClient client = Ssh.newClient(machine, pool.getAdminAccess().toBuilder().username("ubuntu").createAdminAccess(), <START> 5 * 60000 ); <END> try { String puppetScript = renderAndUploadAdminAccessPuppetScript(client, pool); renderAndUploadSshdConfig(client, pool); uploadSudoersFile(client); Session session = client.startSession(); try { session.allocateDefaultPTY(); final String shellCommand = "while ! which puppet &> /dev/null ; " + "do echo 'Puppet command not found. Waiting for userdata.sh script to finish (10s)' " + "&& sleep 10; " + "done " + "&& sudo puppet apply " + puppetScript; Session.Command command = session.exec(shellCommand); Ssh.logCommandOutput(LOG, machine.getExternalId(), command); command.join(); if (command.getExitStatus() != 0) { throw new RuntimeException(String.format("Failed to execute '%s'. Exit code: %d. Exit message: %s", shellCommand, command.getExitStatus(), command.getExitErrorMessage())); } else { LOG.info("<< Command completed successfully with exit code 0"); } } finally { session.close(); } } finally { client.close(); } }</code><technical_language>a good candidate introduce a constant</technical_language>

Target:
public void execute(DelegateExecution execution) throws Exception { Pool pool = (Pool) execution.getVariable(CoreProcessVariables.POOL); checkNotNull(pool, "Please add the pool description as a process " + "variable with the name '%s'.", CoreProcessVariables.POOL); Machine machine = (Machine) execution.getVariable("machine"); LOG.info(">> Connecting to machine to setup admin access", machine); SSHClient client = Ssh.newClient(machine, pool.getAdminAccess().toBuilder().username("ubuntu").createAdminAccess()); try { String puppetScript = renderAndUploadAdminAccessPuppetScript(client, pool); renderAndUploadSshdConfig(client, pool); uploadSudoersFile(client); Session session = client.startSession(); try { session.allocateDefaultPTY(); final String shellCommand = "while ! which puppet &> /dev/null ; " + "do echo 'Puppet command not found. Waiting for userdata.sh script to finish (10s)' " + "&& sleep 10; " + "done " + "&& sudo puppet apply " + puppetScript; Session.Command command = session.exec(shellCommand); Ssh.logCommandOutput(LOG, machine.getExternalId(), command); command.join(); if (command.getExitStatus() != 0) { throw new RuntimeException(String.format("Failed to execute '%s'. Exit code: %d. Exit message: %s", shellCommand, command.getExitStatus(), command.getExitErrorMessage())); } else { LOG.info("<< Command completed successfully with exit code 0"); } } finally { session.close(); } } finally { client.close(); } }
Source:
<code>public void afterDelete(AbstractProject project) { if (Util.isOverridden(WorkspaceListener.class, getClass(), "afterDelete", Job.class)) { afterDelete((Job) project); } else { <START> throw new AssertionError("The plugin '" + this.getClass().getName() + "' still uses " + <END> "deprecated afterDelete(AbstractProject) method. " + "Update the plugin to use afterDelete(Job) instead."); } }</code><technical_language>This wrong me. method abstract force forcing a client override this afterDelete(Job). a listener implemented beforeUse in order do something</technical_language>

Target:
@Deprecated public void afterDelete(AbstractProject project) { if (Util.isOverridden(WorkspaceListener.class, getClass(), "afterDelete", Job.class)) { afterDelete((Job) project); } }
Source:
<code>synchronized public Tracker getDefaultTracker() { if (mTracker == null) { mTracker = getAnalyticsInstance().newTracker(DEV_TRACKING_ID); mTracker.enableAutoActivityTracking(true); } String userId = getCurrentUserId(); if (!"".equals(userId)) { mTracker.set("&uid", userId); } else { mTracker.set("&uid", null); } <START> return mTracker; <END> }</code><technical_language>getDefaultTracker is called time event is reported. is worth thinking setting default tracker in a manner require set user id time getDefaultTracker is called. if setup part of tracker time a new user logs in, need do time call getDefaultTracker. said, a more complex implementation worth effort. leave decide</technical_language>

Target:
synchronized public Tracker getDefaultTracker() { if (analyticsTracker == null) { analyticsTracker = analyticsInstance.newTracker(DEV_TRACKING_ID); analyticsTracker.enableAutoActivityTracking(true); } String userId = getCurrentUserId(); if (!"".equals(userId)) { analyticsTracker.set("&uid", userId); } else { analyticsTracker.set("&uid", null); } return analyticsTracker; }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_provider_dashboard); <START> provider = (Provider) (getIntent().getSerializableExtra(ApplicationConstants.BundleKeys.PROVIDER_ID_BUNDLE)); <END> setupBackdrop(provider); initViewPager(); if (savedInstanceState != null) { mPresenter = new ProviderDashboardPresenter(this); } else { mPresenter = new ProviderDashboardPresenter(this); } }</code><technical_language>This a Presenter code, activity one. presenter get provider intent</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_provider_dashboard); if (savedInstanceState != null) { mPresenter = new ProviderDashboardPresenter(this); } else { mPresenter = new ProviderDashboardPresenter(this); } provider = mPresenter.getProviderFromIntent(getIntent()); setupBackdrop(provider); initViewPager(); }
Source:
<code>PostReviewers(Reviewers.Parser parser, ReviewerResource.Factory reviewerFactory, AddReviewerSender.Factory addReviewerSenderFactory, Provider<GroupsCollection> groupsCollection, GroupMembers.Factory groupMembersFactory, AccountInfo.Loader.Factory accountLoaderFactory, Provider<ReviewDb> db, IdentifiedUser currentUser, IdentifiedUser.GenericFactory identifiedUserFactory, ApprovalTypes approvalTypes, @GerritServerConfig Config cfg, ChangeHooks hooks, AccountCache accountCache, ReviewerJson json) { this.parser = parser; this.reviewerFactory = reviewerFactory; this.addReviewerSenderFactory = addReviewerSenderFactory; this.groupsCollection = groupsCollection; this.groupMembersFactory = groupMembersFactory; this.accountLoaderFactory = accountLoaderFactory; this.db = db; this.currentUser = currentUser; this.identifiedUserFactory = identifiedUserFactory; this.cfg = cfg; this.hooks = hooks; this.accountCache = accountCache; this.json = json; this.addReviewerCategoryId = new ApprovalCategory.Id(Iterables.getLast( <START> approvalTypes.getApprovalTypes()).getId()); <END> }</code><technical_language>[optional] this.addReviewerCategoryId = Iterables.getLast(approvalTypes.getApprovalTypes()).getApprovalCategoryId();</technical_language>

Target:
PostReviewers(Reviewers.Parser parser, ReviewerResource.Factory reviewerFactory, AddReviewerSender.Factory addReviewerSenderFactory, Provider<GroupsCollection> groupsCollection, GroupMembers.Factory groupMembersFactory, AccountInfo.Loader.Factory accountLoaderFactory, Provider<ReviewDb> db, IdentifiedUser currentUser, IdentifiedUser.GenericFactory identifiedUserFactory, ApprovalTypes approvalTypes, @GerritServerConfig Config cfg, ChangeHooks hooks, AccountCache accountCache, ReviewerJson json) { this.parser = parser; this.reviewerFactory = reviewerFactory; this.addReviewerSenderFactory = addReviewerSenderFactory; this.groupsCollection = groupsCollection; this.groupMembersFactory = groupMembersFactory; this.accountLoaderFactory = accountLoaderFactory; this.db = db; this.currentUser = currentUser; this.identifiedUserFactory = identifiedUserFactory; this.cfg = cfg; this.hooks = hooks; this.accountCache = accountCache; this.json = json; this.addReviewerCategoryId = Iterables.getLast(approvalTypes.getApprovalTypes()) .getApprovalCategoryId(); }
Source:
<code>public void testDownloadAndExtractSuccessWithRealZip() throws Exception { verifyZeroInteractions(langs); TmcServerCommunicationTaskFactory realFactory = new TmcServerCommunicationTaskFactory(); assertNotNull(TmcSettingsHolder.get()); command = new DownloadAdaptiveExercise(mockObserver, realFactory); Path testPath = Paths.get(System.getProperty("user.dir")); when(settings.getTmcProjectDirectory()).thenReturn(testPath); Exercise exercise = command.call(); assertTrue(Files.exists(testPath.resolve(exercise.getCourseName()))); <START> FileUtils.deleteDirectory(testPath.resolve(exercise.getCourseName()).toFile()); <END> }</code><technical_language>Do delete stuff home, if directory existed. createTemporaryDirectory (or called, version creates dir in sys.temp) Files get a directory is safe(r) delete later</technical_language>

Target:
public void testDownloadAndExtractSuccessWithRealZip() throws Exception { verifyZeroInteractions(langs); TmcServerCommunicationTaskFactory realFactory = new TmcServerCommunicationTaskFactory(); assertNotNull(TmcSettingsHolder.get()); command = new DownloadAdaptiveExercise(mockObserver, realFactory); when(settings.getTmcProjectDirectory()).thenReturn(arithFuncsTempDir); Exercise exercise = command.call(); assertTrue(Files.exists(arithFuncsTempDir)); }
Source:
<code>public void rewriteAST(CompilationUnitRewrite cuRewrite, LinkedProposalModel linkedModel) throws CoreException { TextEditGroup group= createTextEditGroup(isMove() ? FixMessages.TypeAnnotationFix_move : FixMessages.TypeAnnotationFix_remove, cuRewrite); ASTRewrite astRewrite= cuRewrite.getASTRewrite(); if (fAnnotation != null) { Annotation newAnnotation= (Annotation) <START> ASTNode.copySubtree(astRewrite.getAST(), fAnnotation); <END> if (fNewAnnotationTarget != null) { addTypeAnnotation(astRewrite, fNewAnnotationTarget, newAnnotation, group); } astRewrite.remove(fAnnotation, group); } }</code><technical_language>astRewrite.createMoveTarget(..)</technical_language>

Target:
public void rewriteAST(CompilationUnitRewrite cuRewrite, LinkedProposalModel linkedModel) throws CoreException { TextEditGroup group= createTextEditGroup(isMove() ? FixMessages.TypeAnnotationFix_move : FixMessages.TypeAnnotationFix_remove, cuRewrite); ASTRewrite astRewrite= cuRewrite.getASTRewrite(); if (fAnnotation != null) { if (fNewAnnotationTarget != null) { Annotation newAnnotation= (Annotation) astRewrite.createMoveTarget(fAnnotation); addTypeAnnotation(astRewrite, fNewAnnotationTarget, newAnnotation, group); } astRewrite.remove(fAnnotation, group); } }
Source:
<code>public int read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { try { MongoCollection<Document> collection = database.getCollection(table); Document query = new Document("_id", key); FindIterable<Document> findIterable = collection.find(query); if (fields != null) { Document projection = new Document(); for (String field : fields) { projection.put(field, INCLUDE); } findIterable.projection(projection); } Document queryResult = findIterable.first(); if (queryResult != null) { fillMap(result, queryResult); } <START> return queryResult != null ? StatusCode.OK : StatusCode.ERROR; <END> } catch (Exception e) { System.err.println(e.toString()); return StatusCode.ERROR; } }</code><technical_language>ERROR->NOT_FOUND</technical_language>

Target:
public Status read(String table, String key, Set<String> fields, HashMap<String, ByteIterator> result) { try { MongoCollection<Document> collection = database.getCollection(table); Document query = new Document("_id", key); FindIterable<Document> findIterable = collection.find(query); if (fields != null) { Document projection = new Document(); for (String field : fields) { projection.put(field, INCLUDE); } findIterable.projection(projection); } Document queryResult = findIterable.first(); if (queryResult != null) { fillMap(result, queryResult); } return queryResult != null ? Status.OK : Status.NOT_FOUND; } catch (Exception e) { System.err.println(e.toString()); return Status.ERROR; } }
Source:
<code>private void setDictionaryBlockData(byte[] dictionaryData, int[] dictionaryOffsets, int positionCount) { verify(positionCount > 0); <START> if (dictionaryBlock.getSlice().getBase() != dictionaryData) { <END> boolean[] isNullVector = new boolean[positionCount]; isNullVector[isNullVector.length - 1] = true; dictionaryBlock = new VariableWidthBlock(positionCount, Slices.wrappedBuffer(dictionaryData), dictionaryOffsets, isNullVector); } }</code><technical_language>a fan of adding a getSlice method block. Is other do this</technical_language>

Target:
private void setDictionaryBlockData(byte[] dictionaryData, int[] dictionaryOffsets, int positionCount) { verify(positionCount > 0); if (currentDictionaryData != dictionaryData) { boolean[] isNullVector = new boolean[positionCount]; isNullVector[isNullVector.length - 1] = true; dictionaryBlock = new VariableWidthBlock(positionCount, Slices.wrappedBuffer(dictionaryData), dictionaryOffsets, isNullVector); currentDictionaryData = dictionaryData; } }
Source:
<code>public void testLzoRawBytesStorage() throws Exception { if (!GPLNativeCodeLoader.isNativeCodeLoaded()) { return; } <START> setUp(); <END> pigServer.registerQuery(String.format( "B = LOAD 'file:%s-thrift' USING %s() AS (thrift: bytearray);", tempFilename, LzoRawBytesLoader.class.getName())); pigServer.registerQuery(String.format( "STORE B INTO 'file:%s-bytes' USING %s();", tempFilename, LzoRawBytesStorage.class.getName())); pigServer.executeBatch(); pigServer.registerQuery(String.format( "B2 = LOAD 'file:%s-bytes' USING %s() AS (thrift: bytearray);", tempFilename, LzoRawBytesLoader.class.getName())); validate(pigServer.openIterator("B2")); }</code><technical_language>I setUp() is run JUnit running tests</technical_language>

Target:
public void testLzoRawBytesStorage() throws Exception { runTest(new Callable<Object>() { @Override public Object call() throws Exception { pigServer.registerQuery(String.format( "B = LOAD 'file:%s-thrift' USING %s() AS (thrift: bytearray);", tempFilename, LzoRawBytesLoader.class.getName())); pigServer.registerQuery(String.format( "STORE B INTO 'file:%s-bytes' USING %s();", tempFilename, LzoRawBytesStorage.class.getName())); pigServer.executeBatch(); pigServer.registerQuery(String.format( "B2 = LOAD 'file:%s-bytes' USING %s() AS (thrift: bytearray);", tempFilename, LzoRawBytesLoader.class.getName())); validate(pigServer.openIterator("B2")); return null; } }); }