auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void runInitScriptIfRequired(final ConnectionUrl connectionUrl, DatabaseDelegate databaseDelegate) throws SQLException { if (connectionUrl.getInitScriptPath().isPresent()) { String initScriptPath = connectionUrl.getInitScriptPath().get(); try { URL resource; if (initScriptPath.startsWith("file:")) { String relativePath = System.getProperty("user.dir") + "/" + initScriptPath.substring(5); resource = new File(relativePath).toURI().toURL(); } else { resource = Thread.currentThread().getContextClassLoader().getResource(initScriptPath); } if (resource == null) { LOGGER.warn("Could not load classpath init script: {}", initScriptPath); throw new SQLException("Could not load classpath init script: " + initScriptPath + ". Resource not found."); } String sql = IOUtils.toString(resource, StandardCharsets.UTF_8); ScriptUtils.executeDatabaseScript(databaseDelegate, initScriptPath, sql); } catch (IOException e) { LOGGER.warn("Could not load classpath init script: {}", initScriptPath); throw new SQLException("Could not load classpath init script: " + initScriptPath, e); } catch (ScriptException e) { LOGGER.error("Error while executing init script: {}", initScriptPath, e); throw new SQLException("Error while executing init script: " + initScriptPath, e); } } }

Target:
private void runInitScriptIfRequired(final ConnectionUrl connectionUrl, DatabaseDelegate databaseDelegate) throws SQLException { if (connectionUrl.getInitScriptPath().isPresent()) { String initScriptPath = connectionUrl.getInitScriptPath().get(); try { URL resource = Thread.currentThread().getContextClassLoader().getResource(initScriptPath); if (resource == null) { LOGGER.warn("Could not load classpath init script: {}", initScriptPath); throw new SQLException("Could not load classpath init script: " + initScriptPath + ". Resource not found."); } String sql = IOUtils.toString(resource, StandardCharsets.UTF_8); ScriptUtils.executeDatabaseScript(databaseDelegate, initScriptPath, sql); } catch (IOException e) { LOGGER.warn("Could not load classpath init script: {}", initScriptPath); throw new SQLException("Could not load classpath init script: " + initScriptPath, e); } catch (ScriptException e) { LOGGER.error("Error while executing init script: {}", initScriptPath, e); throw new SQLException("Error while executing init script: " + initScriptPath, e); } } }
Source:
private void refreshIdleConsumerGroupOffset() { Map<String, KafkaFuture<ConsumerGroupDescription>> consumerGroupsDesc = targetAdminClient .describeConsumerGroups(consumerGroups).describedGroups(); for (String group : consumerGroups) { try { if (consumerGroupsDesc.get(group) == null) { newConsumerGroup.add(group); continue; } ConsumerGroupDescription consumerGroupDesc = consumerGroupsDesc.get(group).get(); if (consumerGroupDesc.state().equals(ConsumerGroupState.EMPTY)) { idleConsumerGroupsOffset.put(group, targetAdminClient.listConsumerGroupOffsets(group) .partitionsToOffsetAndMetadata().get().entrySet()); } } catch (InterruptedException | ExecutionException e) { log.error("Error querying for consumer group on cluster {}.", group, targetClusterAlias, e); } } }

Target:
private void refreshIdleConsumerGroupOffset() { Map<String, KafkaFuture<ConsumerGroupDescription>> consumerGroupsDesc = targetAdminClient .describeConsumerGroups(consumerGroups).describedGroups(); for (String group : consumerGroups) { try { ConsumerGroupDescription consumerGroupDesc = consumerGroupsDesc.get(group).get(); ConsumerGroupState consumerGroupState = consumerGroupDesc.state(); if (consumerGroupState.equals(ConsumerGroupState.EMPTY)) { idleConsumerGroupsOffset.put(group, targetAdminClient.listConsumerGroupOffsets(group) .partitionsToOffsetAndMetadata().get().entrySet().stream().collect( Collectors.toMap(e -> e.getKey(), e -> e.getValue()))); } } catch (InterruptedException | ExecutionException e) { log.error("Error querying for consumer group on cluster {}.", group, targetClusterAlias, e); } } }
Source:
public void refreshExtendedPermissions() { if (getDataManager() != null) { try { Collection<Map<String, Long>> databaseGroupPermissions = getDataManager().getPermissions("Group", getBaseClassName()); clearGroupItems(); for (Map<String, Long> groupPermission : databaseGroupPermissions) { getGroupItems(groupPermission.get("groupId")).add(groupPermission.get(getBaseClassIdName())); } Collection<Map<String, Long>> databaseDevicePermissions = getDataManager().getPermissions("Device", getBaseClassName()); Collection<Device> allDevices = Context.getDeviceManager().getAllDevices(); clearDeviceItems(); deviceItemsWithGroups.clear(); for (Map<String, Long> devicePermission : databaseDevicePermissions) { getDeviceItems(devicePermission.get("deviceId")).add(devicePermission.get(getBaseClassIdName())); getAllDeviceItems(devicePermission.get("deviceId")).add(devicePermission.get(getBaseClassIdName())); } for (Device device : allDevices) { long groupId = device.getGroupId(); while (groupId != 0) { getAllDeviceItems(device.getId()).addAll(getGroupItems(groupId)); if (Context.getDeviceManager().getGroupById(groupId) != null) { groupId = Context.getDeviceManager().getGroupById(groupId).getGroupId(); } else { groupId = 0; } } } } catch (SQLException error) { Log.warning(error); } } }

Target:
public void refreshExtendedPermissions() { if (getDataManager() != null) { try { Collection<Map<String, Long>> databaseGroupPermissions = getDataManager().getPermissions(Group.class, getBaseClass()); clearGroupItems(); for (Map<String, Long> groupPermission : databaseGroupPermissions) { getGroupItems(groupPermission.get(DataManager.makeNameId(Group.class))) .add(groupPermission.get(getBaseClassIdName())); } Collection<Map<String, Long>> databaseDevicePermissions = getDataManager().getPermissions(Device.class, getBaseClass()); Collection<Device> allDevices = Context.getDeviceManager().getAllDevices(); clearDeviceItems(); deviceItemsWithGroups.clear(); for (Map<String, Long> devicePermission : databaseDevicePermissions) { getDeviceItems(devicePermission.get(DataManager.makeNameId(Device.class))) .add(devicePermission.get(getBaseClassIdName())); getAllDeviceItems(devicePermission.get(DataManager.makeNameId(Device.class))) .add(devicePermission.get(getBaseClassIdName())); } for (Device device : allDevices) { long groupId = device.getGroupId(); while (groupId != 0) { getAllDeviceItems(device.getId()).addAll(getGroupItems(groupId)); if (Context.getDeviceManager().getGroupById(groupId) != null) { groupId = Context.getDeviceManager().getGroupById(groupId).getGroupId(); } else { groupId = 0; } } } } catch (SQLException error) { Log.warning(error); } } }
Source:
private void addAttribute(AttributesImpl attribute, String key, String value) { attribute.addAttribute("", key, key, "", org.eclipse.mylyn.internal.commons.core.XmlStringConverter.convertToXmlString(value)); }

Target:
private void addAttribute(AttributesImpl attribute, String key, String value) { attribute.addAttribute("", key, key, "", value); }
Source:
public void close() { final State oldState = state; try { synchronized (lock) { state = State.DONE; if (yielder != null) { Yielder<Object[]> theYielder = this.yielder; this.yielder = null; yielderOpenCloseExecutor.submit( () -> { theYielder.close(); return null; } ).get(); yielderOpenCloseExecutor.shutdownNow(); } } } catch (Throwable t) { if (oldState != State.DONE) { try { onClose.run(); } catch (Throwable t1) { t.addSuppressed(t1); } } throw Throwables.propagate(t); } if (oldState != State.DONE) { try { onClose.run(); } catch (Throwable t) { throw Throwables.propagate(t); } } }

Target:
public void close() { State oldState = null; try { synchronized (lock) { oldState = state; state = State.DONE; if (yielder != null) { Yielder<Object[]> theYielder = this.yielder; this.yielder = null; yielderOpenCloseExecutor.submit( () -> { theYielder.close(); return null; } ).get(); yielderOpenCloseExecutor.shutdownNow(); } } } catch (Throwable t) { if (oldState != State.DONE) { try { onClose.run(); sqlLifecycle.emitLogsAndMetrics(t, null, -1); } catch (Throwable t1) { t.addSuppressed(t1); } } throw Throwables.propagate(t); } if (oldState != State.DONE) { try { if (!(this.throwable instanceof ForbiddenException)) { sqlLifecycle.emitLogsAndMetrics(this.throwable, null, -1); } onClose.run(); } catch (Throwable t) { throw Throwables.propagate(t); } } }
Source:
protected void createCacheConf(final ColumnFamilyDescriptor family) { this.cacheConf = new CacheConfig(conf, family, region.getRegionInfo(), region.getBlockCache(), region.getRegionServicesForStores().getByteBuffAllocator()); }

Target:
protected void createCacheConf(final ColumnFamilyDescriptor family) { this.cacheConf = new CacheConfig(conf, family, region.getBlockCache(), region.getRegionServicesForStores().getByteBuffAllocator()); LOG.info("Created cacheConfig: " + this.getCacheConfig() + " for " + this); }
Source:
public void testCall() { String revision_id = null, change_id = null; try { GitAccess gAccess = new GitAccess(); Git git = gAccess.getGitProject(); gAccess.addFile("EGerritTestReviewFile.java", "Hello reviewers community !"); gAccess.pushFile(); change_id = gAccess.getChangeId(); revision_id = gAccess.getCommitId(); } catch (Exception e1) { e1.printStackTrace(); } ListDraftsCommand command = fGerrit.listDraftsComments(change_id, revision_id); Map<String, ArrayList<CommentInfo>> result = null; try { result = command.call(); } catch (EGerritException | ClientProtocolException e) { fail(e.getMessage()); } assert (result.size() == 1); }

Target:
public void testCall() { String revision_id = null, change_id = null; try { GitAccess gAccess = new GitAccess(); Git git = gAccess.getGitProject(); gAccess.addFile("EGerritTestReviewFile.java", "Hello reviewers community !"); gAccess.pushFile(); change_id = gAccess.getChangeId(); revision_id = gAccess.getCommitId(); } catch (Exception e1) { fail(e1.getMessage()); } CreateDraftCommand command = fGerrit.createDraftComments(change_id, revision_id); CommentInfo commentInfo = new CommentInfo(); commentInfo.setLine(2); commentInfo.setMessage("This is a test comment"); commentInfo.setPath("EGerritTestReviewFile.java"); command.setCommentInfo(commentInfo); CommentInfo result = null; try { result = command.call(); } catch (EGerritException e) { fail(e.getMessage()); } catch (ClientProtocolException e) { fail(e.getMessage()); } ListDraftsCommand command2 = fGerrit.listDraftsComments(change_id, revision_id); Map<String, ArrayList<CommentInfo>> result2 = null; try { result2 = command2.call(); } catch (EGerritException | ClientProtocolException e) { fail(e.getMessage()); } assert (result2.size() == 1); }
Source:
private HashSet<NetworkComponent> getNetworkComponents(VirtualGuest virtualGuest) { if(virtualGuest.getVirtualGuestNetworkComponents() == null) return null; return Sets.newHashSet(Iterables.transform(virtualGuest.getVirtualGuestNetworkComponents(), new Function<VirtualGuestNetworkComponent, NetworkComponent>() { @Override public NetworkComponent apply(VirtualGuestNetworkComponent input) { return new NetworkComponent(input.getSpeed()); } })); }

Target:
private Set<NetworkComponent> getNetworkComponents(VirtualGuest virtualGuest) { if (virtualGuest.getVirtualGuestNetworkComponents() == null) { return null; } ImmutableSet.Builder networkComponents = ImmutableSet.builder(); for (VirtualGuestNetworkComponent networkComponent : virtualGuest.getVirtualGuestNetworkComponents()) { networkComponents.add(new NetworkComponent(networkComponent.getSpeed())); } return networkComponents.build(); }
Source:
private void createTableIfNotExists(String tableName, String zkQuorum, int zkClientPort) throws IOException { Configuration conf = HBaseConfiguration.create(); <LINK_0> conf.setClassLoader(HBaseConfiguration.class.getClassLoader()); conf.set(HConstants.ZOOKEEPER_QUORUM, zkQuorum); conf.setInt(HConstants.ZOOKEEPER_CLIENT_PORT, zkClientPort); conf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, zkParentNode); HBaseAdmin hBaseAdmin = new HBaseAdmin(conf); if (!hBaseAdmin.tableExists(tableName)) { HTableDescriptor tableDescriptor = new HTableDescriptor(TableName.valueOf(tableName)); tableDescriptor.addFamily(new HColumnDescriptor(family)); hBaseAdmin.createTable(tableDescriptor); } }

Target:
private void createTableIfNotExists(String tableName, String zkQuorum, int zkClientPort) throws IOException { Configuration conf = HBaseConfiguration.create(); conf.setClassLoader(HBaseConfiguration.class.getClassLoader()); conf.set(HConstants.ZOOKEEPER_QUORUM, zkQuorum); conf.setInt(HConstants.ZOOKEEPER_CLIENT_PORT, zkClientPort); conf.set(HConstants.ZOOKEEPER_ZNODE_PARENT, zkParentNode); HBaseAdmin hBaseAdmin = new HBaseAdmin(conf); if (!hBaseAdmin.tableExists(tableName)) { HTableDescriptor tableDescriptor = new HTableDescriptor(TableName.valueOf(tableName)); tableDescriptor.addFamily(new HColumnDescriptor(family)); hBaseAdmin.createTable(tableDescriptor); } }
Source:
public void runInPodWithRestartWithMultipleContainerCalls() throws Exception { story.addStep(new Statement() { @Override public void evaluate() throws Throwable { configureCloud(); story.j.jenkins.addNode(new DumbSlave("slave", "dummy", tmp.newFolder("remoteFS").getPath(), "1", Node.Mode.NORMAL, "", new JNLPLauncher(), RetentionStrategy.NOOP, Collections.<NodeProperty<?>>emptyList())); WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p"); p.setDefinition(new CpsFlowDefinition(loadPipelineScript("runInPodWithRestartWithMultipleContainerCalls.groovy") , true)); WorkflowRun b = p.scheduleBuild2(0).waitForStart(); SemaphoreStep.waitForStart("wait/1", b); SemaphoreStep.success("wait/1", false); Thread.sleep(10000); } }); story.addStep(new Statement() { @SuppressWarnings("SleepWhileInLoop") @Override public void evaluate() throws Throwable { WorkflowRun b = story.j.jenkins.getItemByFullName("p", WorkflowJob.class).getBuildByNumber(1); story.j.assertLogContains("finished the test!", story.j.assertBuildStatusSuccess(story.j.waitForCompletion(b))); } }); }

Target:
public void runInPodWithRestartWithMultipleContainerCalls() throws Exception { story.then(r -> { configureCloud(); r.jenkins.addNode(new DumbSlave("slave", "dummy", tmp.newFolder("remoteFS").getPath(), "1", Node.Mode.NORMAL, "", new JNLPLauncher(), RetentionStrategy.NOOP, Collections.<NodeProperty<?>>emptyList())); WorkflowJob p = r.jenkins.createProject(WorkflowJob.class, "p"); p.setDefinition(new CpsFlowDefinition(loadPipelineScript("runInPodWithRestartWithMultipleContainerCalls.groovy") , true)); WorkflowRun b = p.scheduleBuild2(0).waitForStart(); r.waitForMessage("+ sleep 5", b); }); story.then(r -> { WorkflowRun b = r.jenkins.getItemByFullName("p", WorkflowJob.class).getBuildByNumber(1); r.assertLogContains("finished the test!", r.assertBuildStatusSuccess(r.waitForCompletion(b))); }); }
Source:
public void testOperationCanceledExceptionAreHandled() { try { SafeRunner.run(() -> { throw new OperationCanceledException(); }); } catch (OperationCanceledException e) { fail("OperationCanceledException unexpectedly catched.", e); } }

Target:
public void testOperationCanceledExceptionAreHandled() { try { SafeRunner.run(() -> { throw new OperationCanceledException(); }); } catch (OperationCanceledException e) { fail("OperationCanceledException unexpectedly caught.", e); } }
Source:
private void addNewElement(int hashPosition, Block block, int position) { elementType.appendTo(block, position, elementBlock); if (elementBlock.getSizeInBytes() > FOUR_MEGABYTES) { throw new PrestoException(EXCEEDED_FUNCTION_MEMORY_LIMIT, String.format("the argument of %s exceeds of %s", functionName, MAX_FUNCTION_MEMORY)); } blockPositionByHash.set(hashPosition, elementBlock.getPositionCount() - 1); if (elementBlock.getPositionCount() >= maxFill) { rehash(); } }

Target:
private void addNewElement(int hashPosition, Block block, int position) { elementType.appendTo(block, position, elementBlock); if (elementBlock.getSizeInBytes() > FOUR_MEGABYTES) { throw new PrestoException( EXCEEDED_FUNCTION_MEMORY_LIMIT, format("The input to %s is too large. More than %s of memory is needed to hold the intermediate hash set.\n", functionName, MAX_FUNCTION_MEMORY)); } blockPositionByHash.set(hashPosition, elementBlock.getPositionCount() - 1); if (elementBlock.getPositionCount() >= maxFill) { rehash(); } }
Source:
public void removeBackupReminder(long masterKeyId) { String reminders = mSharedPreferences.getString(Pref.BACKUP_REMINDERS,null); if (reminders != null) { List<String> masterKeyIds = new ArrayList<>(Arrays.asList(reminders.split(","))); masterKeyIds.remove(masterKeyId+""); reminders = TextUtils.join(",", masterKeyIds); SharedPreferences.Editor editor = mSharedPreferences.edit(); if (reminders == "") editor.remove(Pref.BACKUP_REMINDERS); else editor.putString(Pref.BACKUP_REMINDERS, reminders); editor.apply(); } }

Target:
public void removeBackupReminder(long masterKeyId) { String reminders = mSharedPreferences.getString(Pref.BACKUP_REMINDERS, null); if (reminders != null) { List<String> masterKeyIds = new ArrayList<>(Arrays.asList(reminders.split(","))); masterKeyIds.remove(Long.toString(masterKeyId)); reminders = TextUtils.join(",", masterKeyIds); SharedPreferences.Editor editor = mSharedPreferences.edit(); if (reminders.equals("")) { editor.remove(Pref.BACKUP_REMINDERS); } else { editor.putString(Pref.BACKUP_REMINDERS, reminders); } editor.apply(); } }
Source:
static StatsSnapshot convertStoreUsageToContainerStatsSnapshot(Map<String, Map<String, Long>> utilizationMap) { Map<String, StatsSnapshot> containerValidSizeMap = new HashMap<>(); long totalSize = 0; for (Map.Entry<String, Map<String, Long>> accountEntry : utilizationMap.entrySet()) { for (Map.Entry<String, Long> containerEntry : accountEntry.getValue().entrySet()) { totalSize += containerEntry.getValue(); containerValidSizeMap.put(accountEntry.getKey() + "_" + containerEntry.getKey(), new StatsSnapshot(containerEntry.getValue(), null)); } } return new StatsSnapshot(totalSize, containerValidSizeMap); }

Target:
static StatsSnapshot convertStoreUsageToContainerStatsSnapshot(Map<String, Map<String, Long>> utilizationMap) { Map<String, StatsSnapshot> containerValidSizeMap = new HashMap<>(); long totalSize = 0; for (Map.Entry<String, Map<String, Long>> accountEntry : utilizationMap.entrySet()) { for (Map.Entry<String, Long> containerEntry : accountEntry.getValue().entrySet()) { totalSize += containerEntry.getValue(); containerValidSizeMap.put(accountEntry.getKey() + Utils.ACCOUNT_CONTAINER_SEPARATOR + containerEntry.getKey(), new StatsSnapshot(containerEntry.getValue(), null)); } } return new StatsSnapshot(totalSize, containerValidSizeMap); }
Source:
public Wrapper startCache(Classification classification, Properties properties) throws Exception { ServiceContainer target = currentServiceContainer(); String container = properties.getProperty(CONTAINER); String cacheType = properties.getProperty(CACHE_TYPE); ServiceName containerServiceName = ServiceName.parse(InfinispanRequirement.CONTAINER.resolve(container)); String name = properties.getProperty(NAME, UUID.randomUUID().toString()); ServiceBuilder<?> builder = target.addService(ServiceName.JBOSS.append(DEFAULT_CACHE_CONTAINER, name)); Supplier<EmbeddedCacheManager> manager = builder.requires(containerServiceName); if (CACHE_PRIVATE.equals(cacheType)) { String[] caches = properties.getProperty(CACHES).split("\\s+"); for (String cache : caches) { ServiceName dependencyName = ServiceName.parse(InfinispanCacheRequirement.CONFIGURATION.resolve(container, cache)); builder.requires(dependencyName); } } final UninterruptibleCountDownLatch latch = new UninterruptibleCountDownLatch(1); builder.addListener(new LifecycleListener() { @Override public void handleEvent(final ServiceController<?> controller, final LifecycleEvent event) { if (event == LifecycleEvent.UP) { latch.countDown(); controller.removeListener(this); } } }); ServiceController<?> controller = builder.install(); latch.awaitUninterruptibly(); return new CacheWrapper(manager.get(), controller); }

Target:
public Wrapper startCache(Classification classification, Properties properties) throws Exception { ServiceContainer target = currentServiceContainer(); String container = properties.getProperty(CONTAINER); String cacheType = properties.getProperty(CACHE_TYPE); ServiceName containerServiceName = ServiceNameFactory.parseServiceName(InfinispanRequirement.CONTAINER.getName()).append(container); String name = properties.getProperty(NAME, UUID.randomUUID().toString()); ServiceBuilder<?> builder = target.addService(ServiceName.JBOSS.append(DEFAULT_CACHE_CONTAINER, name)); Supplier<EmbeddedCacheManager> manager = builder.requires(containerServiceName); if (CACHE_PRIVATE.equals(cacheType)) { String[] caches = properties.getProperty(CACHES).split("\\s+"); for (String cache : caches) { builder.requires(ServiceNameFactory.parseServiceName(InfinispanCacheRequirement.CONFIGURATION.getName()).append(container, cache)); } } final CountDownLatch latch = new CountDownLatch(1); builder.addListener(new LifecycleListener() { @Override public void handleEvent(final ServiceController<?> controller, final LifecycleEvent event) { if (event == LifecycleEvent.UP) { latch.countDown(); controller.removeListener(this); } } }); ServiceController<?> controller = builder.install(); latch.await(); return new CacheWrapper(manager.get(), controller); }
Source:
public SBIIndexWriter(final OutputStream out, final long granularity) { this.out = out; this.granularity = granularity; try { this.tempOffsetsFile = File.createTempFile("offsets-", ".headerless.sbi"); this.tempOffsetsCodec = new BinaryCodec(new BufferedOutputStream(new FileOutputStream(tempOffsetsFile))); } catch (IOException e) { throw new RuntimeIOException(e); } }

Target:
public SBIIndexWriter(final OutputStream out, final long granularity) { this.out = out; this.granularity = granularity; try { this.tempOffsetsFile = Files.createTempFile("offsets-", ".headerless.sbi"); this.tempOffsetsCodec = new BinaryCodec(new BufferedOutputStream(Files.newOutputStream(tempOffsetsFile))); } catch (IOException e) { throw new RuntimeIOException(e); } }
Source:
public synchronized Connection handleActiveConnection(ChannelHandlerContext ctx, Connection.Direction direction) { Channel channel = ctx.channel(); Connection conn; conn = add(channel, direction); if (conn.direction == Connection.Direction.OUT) { InitRequest initRequest = new InitRequest(0, InitMessage.DEFAULT_VERSION, new HashMap<String, String>() { } ); initRequest.setHostPort(this.manager.getHostPort()); initRequest.setProcessName("java-process"); ChannelFuture f = ctx.writeAndFlush(initRequest); f.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); } return conn; }

Target:
public Connection handleActiveConnection(ChannelHandlerContext ctx, Connection.Direction direction) { Channel channel = ctx.channel(); Connection conn = add(channel, direction); if (conn.direction == Connection.Direction.OUT) { InitRequest initRequest = new InitRequest(0, InitMessage.DEFAULT_VERSION, new HashMap<String, String>() { } ); initRequest.setHostPort(this.manager.getHostPort()); initRequest.setProcessName("java-process"); ChannelFuture f = ctx.writeAndFlush(initRequest); f.addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); } return conn; }
Source:
protected void executeCommand() { updateQuotaCache(); copyUnchangedStoragePoolProperties(getStoragePool(), oldStoragePool); getStoragePoolDao().updatePartial(getStoragePool()); updateStoragePoolFormatType(); moveMacsFromOldMacPoolToNewOne(); setSucceeded(true); }

Target:
protected void executeCommand() { updateQuotaCache(); copyUnchangedStoragePoolProperties(getStoragePool(), oldStoragePool); TransactionSupport.executeInScope(TransactionScopeOption.RequiresNew, () -> { getStoragePoolDao().updatePartial(getStoragePool()); moveMacsFromOldMacPoolToNewOne(); return null; }); updateStoragePoolFormatType(); setSucceeded(true); }
Source:
public String toString() { this.requireDelegate(); return this.delegate.toString(); }

Target:
public String toString() { return getDelegate().toString(); }
Source:
private void verifyOutput(StoreCopier.Message output, StoreCopier.Message expected) throws IOException { assertTrue("MessageInfos not equal, Output: " + output.getMessageInfo() + " Expected: " + expected.getMessageInfo(), output.getMessageInfo().equals(expected.getMessageInfo())); assertInputStreamEqual(output.getStream(), expected.getStream()); }

Target:
private void verifyOutput(StoreCopier.Message output, StoreCopier.Message expected) throws IOException { if (expected == null) { assertNull("output should be null", output); } else { assertEquals("MessageInfos not equal", expected.getMessageInfo(), output.getMessageInfo()); TestUtils.assertInputStreamEqual(output.getStream(), expected.getStream(), (int) expected.getMessageInfo().getSize(), true); } }
Source:
public String toString() { return "ParameterizedMetricKey{key=" + key.name() + ", version=" + options + '}'; }

Target:
public String toString() { return "ParameterizedMetricKey{key=" + key.name() + ", options=" + options + '}'; }
Source:
public void setup(com.datatorrent.api.Context.OperatorContext context) { try { JAXBContext ctx = JAXBContext.newInstance(getClazz()); unmarshaller = ctx.createUnmarshaller(); if (schemaXSDFile != null) { Path filePath = new Path(schemaXSDFile); Configuration configuration = new Configuration(); FileSystem fs = FileSystem.newInstance(filePath.toUri(), configuration); FSDataInputStream inputStream = fs.open(filePath); SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = factory.newSchema(new StreamSource(inputStream)); unmarshaller.setSchema(schema); validator = schema.newValidator(); } } catch (SAXException e) { DTThrowable.wrapIfChecked(e); } catch (JAXBException e) { DTThrowable.wrapIfChecked(e); } catch (IOException e) { DTThrowable.wrapIfChecked(e); } }

Target:
public void setup(com.datatorrent.api.Context.OperatorContext context) { try { JAXBContext ctx = JAXBContext.newInstance(getClazz()); unmarshaller = ctx.createUnmarshaller(); if (schemaXSDFile != null) { Path filePath = new Path(schemaXSDFile); Configuration configuration = new Configuration(); FileSystem fs = FileSystem.newInstance(filePath.toUri(), configuration); FSDataInputStream inputStream = fs.open(filePath); SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); Schema schema = factory.newSchema(new StreamSource(inputStream)); unmarshaller.setSchema(schema); validator = schema.newValidator(); fs.close(); } } catch (SAXException e) { DTThrowable.wrapIfChecked(e); } catch (JAXBException e) { DTThrowable.wrapIfChecked(e); } catch (IOException e) { DTThrowable.wrapIfChecked(e); } }
Source:
private ITypedElement getElement(Repository repository, IFileRevision reviewFileRevision) { if (repository != null) { org.eclipse.team.core.history.IFileRevision repoFileRevision = ReviewUtils.getIFileRevision(repository, reviewFileRevision); InputStream repoFileContents = null; try { repoFileContents = repoFileRevision.getStorage(null).getContents(); } catch (CoreException e) { } if (repoFileRevision != null && repoFileContents != null) { return new FileRevisionTypedElement(repoFileRevision, reviewFileRevision.getPath()); } } return new ByteArrayInput(ReviewUtils.getContent(reviewFileRevision), reviewFileRevision.getPath()); }

Target:
private ITypedElement getElement(Repository repository, IFileRevision reviewFileRevision) { if (repository != null) { org.eclipse.team.core.history.IFileRevision repoFileRevision = ReviewUtils.getFileRevision(repository, reviewFileRevision); InputStream repoFileContents = null; try { repoFileContents = repoFileRevision.getStorage(null).getContents(); } catch (CoreException e) { } if (repoFileRevision != null && repoFileContents != null) { return new FileRevisionTypedElement(repoFileRevision, reviewFileRevision.getPath()); } } return new ByteArrayInput(ReviewUtils.getContent(reviewFileRevision), reviewFileRevision.getPath()); }
Source:
public void equalsAndHashCodeEvenWithDifferentFileMode() throws Exception { final Path file = createTempFile("somepath"); final MountableFile mountableFile1 = MountableFile.forHostPath(file.toString(), 365); final MountableFile mountableFile2 = MountableFile.forHostPath(file.toString(), 356); assertEquals("should not be equal", mountableFile1, mountableFile2); assertEquals("should not have same hash code", mountableFile1.hashCode(), mountableFile2.hashCode()); }

Target:
public void equalsAndHashCodeEvenWithDifferentFileMode() throws Exception { final Path file = createTempFile("somepath"); final MountableFile mountableFile1 = MountableFile.forHostPath(file.toString(), 365); final MountableFile mountableFile2 = MountableFile.forHostPath(file.toString(), 356); assertEquals("should be equal", mountableFile1, mountableFile2); assertEquals("should have same hash code", mountableFile1.hashCode(), mountableFile2.hashCode()); }
Source:
private Integer getCategoryIdByTitle(long accountId, @NonNull String categoryTitle) { validateAccountId(accountId); SQLiteDatabase db = getReadableDatabase(); Cursor cursor = db.query( table_category, new String[]{key_category_id}, key_category_title + " = ? AND " + key_category_account_id + " = ? ", new String[]{categoryTitle, String.valueOf(accountId)}, key_category_id, null, key_category_id); int id = -1; if (cursor.moveToNext()) { id = cursor.getInt(0); } else { id = (int) addCategory(categoryTitle, accountId); if (id == -1) { Log.e(TAG, String.format("Error occurs when creating category: %s", categoryTitle)); } } cursor.close(); return id; }

Target:
private Integer getCategoryIdByTitle(long accountId, @NonNull String categoryTitle) { validateAccountId(accountId); SQLiteDatabase db = getReadableDatabase(); Cursor cursor = db.query( table_category, new String[]{key_category_id}, key_category_title + " = ? AND " + key_category_account_id + " = ? ", new String[]{categoryTitle, String.valueOf(accountId)}, null, null, null); int id = -1; if (cursor.moveToNext()) { id = cursor.getInt(0); } else { id = (int) addCategory(accountId, categoryTitle); if (id == -1) { Log.e(TAG, String.format("Error occurs when creating category: %s", categoryTitle)); } } cursor.close(); return id; }
Source:
public void perform( List<Pair<VmDynamic, VdsmVm>> monitoredVms, long fetchTime, VdsManager vdsManager, boolean updateStatistics) { if (monitoredVms.isEmpty()) { return; } List<VmAnalyzer> vmAnalyzers = Collections.emptyList(); try { vmAnalyzers = analyzeVms(monitoredVms, fetchTime, vdsManager, updateStatistics); addUnmanagedVms(vmAnalyzers, vdsManager.getVdsId()); flush(vmAnalyzers); postFlush(vmAnalyzers, vdsManager); vdsManager.vmsMonitoringInitFinished(); } catch (RuntimeException ex) { log.error("Failed during vms monitoring on host error is: {}", vdsManager.getVdsName(), ex); log.error("Exception:", ex); } finally { unlockVms(vmAnalyzers); } }

Target:
public void perform( List<Pair<VmDynamic, VdsmVm>> monitoredVms, long fetchTime, VdsManager vdsManager, boolean updateStatistics) { if (monitoredVms.isEmpty()) { return; } List<VmAnalyzer> vmAnalyzers = Collections.emptyList(); try { vmAnalyzers = analyzeVms(monitoredVms, fetchTime, vdsManager, updateStatistics); addUnmanagedVms(vmAnalyzers, vdsManager.getVdsId()); flush(vmAnalyzers); postFlush(vmAnalyzers, vdsManager, fetchTime); vdsManager.vmsMonitoringInitFinished(); } catch (RuntimeException ex) { log.error("Failed during vms monitoring on host error is: {}", vdsManager.getVdsName(), ex); log.error("Exception:", ex); } finally { unlockVms(vmAnalyzers); } }
Source:
private void initTragetDomains() { templateDisks = diskDao.getAllForVm(getParameters().getVmStaticData().getVmtGuid()); targetDomains = new HashMap<>(); for (Disk disk: templateDisks) { for (Guid id: ((DiskImage)disk).getStorageIds()) { StorageDomain domain = domainDao.get(id); if (!targetDomains.keySet().contains(domain)) { targetDomains.put(domain, domain.getAvailableDiskSizeInBytes()); } } } }

Target:
private void initTragetDomains() { templateDisksList = diskDao.getAllForVm(getParameters().getVmStaticData().getVmtGuid()); targetDomainsSize = new HashMap<>(); diskToProfileMap = new HashMap<>(); for (Disk disk: templateDisksList) { diskToProfileMap.put(disk.getId(), ((DiskImage)disk).getDiskProfileIds()); for (Guid id: ((DiskImage)disk).getStorageIds()) { StorageDomain domain = domainDao.get(id); if (!targetDomainsSize.keySet().contains(domain)) { targetDomainsSize.put(domain, domain.getAvailableDiskSizeInBytes()); } } } }
Source:
public HttpResponse delete(String identifier) { return deleteWithResponse(uri("/workbooks/%s", identifier)).executeWithResponse(); }

Target:
public ActionResponse delete(String identifier) { return deleteWithResponse(uri("/workbooks/%s", identifier)).execute(); }
Source:
public static void main(String[] args) { if (args.length < 4) { System.out.println("Please specify your access key, number, country code and billing interval months, eg: ExamplePurchaseNumber test_accesskey 3197010240563 NL 1"); return; } final MessageBirdService wsr = new MessageBirdServiceImpl(args[0], "<LINK_0>"); final MessageBirdClient messageBirdClient = new MessageBirdClient(wsr); try { PurchasedNumberCreatedResponse purchasedNumberCreatedResponse = messageBirdClient.purchaseNumber(args[1], args[2], Integer.parseInt(args[3])); System.out.println(purchasedNumberCreatedResponse); return; } catch (UnauthorizedException | GeneralException exception) { if (exception.getErrors() != null) { System.out.println(exception.getErrors().toString()); } exception.printStackTrace(); } }

Target:
public static void main(String[] args) { if (args.length < 4) { System.out.println("Please specify your access key, number, country code and billing interval months, eg: ExamplePurchaseNumber test_accesskey 3197010240563 NL 1"); return; } final MessageBirdService wsr = new MessageBirdServiceImpl(args[0], "<LINK_0>"); final MessageBirdClient messageBirdClient = new MessageBirdClient(wsr); try { PurchasedNumberCreatedResponse purchasedNumberCreatedResponse = messageBirdClient.purchaseNumber(args[1], args[2], Integer.parseInt(args[3])); System.out.println(purchasedNumberCreatedResponse); } catch (UnauthorizedException | GeneralException exception) { if (exception.getErrors() != null) { System.out.println(exception.getErrors().toString()); } exception.printStackTrace(); } }
Source:
protected ExtensionRegistry getExtensionRegistry() { return extensionRegistry; }

Target:
ExtensionRegistry getExtensionRegistry() { return extensionRegistry; }
Source:
public void getReserveScopes() { Set<SystemScope> reserved = SystemScopeService.reservedScopes; assertThat(service.getReserved(), equalTo(reserved)); }

Target:
public void getReserveScopes() { assertThat(service.getReserved(), equalTo(SystemScopeService.reservedScopes)); }
Source:
public void testDisableLayerServiceResponse() throws Exception { enableWCS(); String layerName = "wcs:BlueMarble"; LayerInfo linfo = getCatalog().getLayerByName(layerName); ResourceInfo ri = linfo.getResource(); ri.setServiceConfiguration(true); ri.setDisabledServices(new ArrayList<>(Arrays.asList("WCS"))); getCatalog().save(ri); getCatalog().save(linfo); Document doc = getAsDOM("wcs?service=WCS&request=getCapabilities"); assertXpathEvaluatesTo( "0", "count( }

Target:
public void testDisableLayerServiceResponse() throws Exception { enableWCS(); CoverageInfo cinfo = getCatalog().getCoverageByName("wcs:BlueMarble"); cinfo.setServiceConfiguration(true); cinfo.setDisabledServices(new ArrayList<>(Arrays.asList("WCS"))); getCatalog().save(cinfo); Document doc = getAsDOM("wcs?service=WCS&request=getCapabilities"); assertXpathEvaluatesTo( "0", "count( }
Source:
private Runnable getBufferConsumerRunnable() { return new Runnable() { @Override public void run() { while (true) { try { eventsToSend.put(eventBuffer.take()); if (eventsToSend.size() >= bufferSize) { List<TrackerEvent> events = new ArrayList<>(); eventsToSend.drainTo(events); execute(getRequestRunnable(events)); } } catch (InterruptedException ex) { if (isClosing) { return; } } } } }; }

Target:
private Runnable getBufferConsumerRunnable() { return new Runnable() { @Override public void run() { while (true) { try { eventsToSend.put(eventBuffer.take()); if (eventsToSend.size() >= bufferSize) { drainBufferAndSend(); } } catch (InterruptedException ex) { if (isClosing) { return; } } } } }; }
Source:
public void resize(final int newMapSize, final double newMapAvgKey) throws IOException { if (newMapSize < 0) { throw new IllegalArgumentException("Cannot resize chronicle map to negative size"); } if (newMapAvgKey < 0) { throw new IllegalArgumentException("Cannot resize chronicle map to map with negative key size"); } Path tempFile = Files.createTempFile("opengrok", "chronicle"); ChronicleMap<BytesRef, Integer> m; try { map.getAll(tempFile.toFile()); String field = map.name(); map.close(); Files.delete(f.toPath()); m = ChronicleMap.of(BytesRef.class, Integer.class) .name(field) .averageKeySize(newMapAvgKey) .entries(newMapSize) .keyReaderAndDataAccess(BytesRefSizedReader.INSTANCE, new BytesRefDataAccess()) .createOrRecoverPersistedTo(f); m.putAll(tempFile.toFile()); } catch (IOException e) { throw e; } finally { Files.delete(tempFile); } map = m; }

Target:
public void resize(final int newMapSize, final double newMapAvgKey) throws IOException { if (newMapSize < 0) { throw new IllegalArgumentException("Cannot resize chronicle map to negative size"); } if (newMapAvgKey < 0) { throw new IllegalArgumentException("Cannot resize chronicle map to map with negative key size"); } Path tempFile = Files.createTempFile("opengrok", "chronicle"); try { map.getAll(tempFile.toFile()); String field = map.name(); map.close(); Files.delete(chronicleMapFile.toPath()); ChronicleMap<BytesRef, Integer> m = ChronicleMap.of(BytesRef.class, Integer.class) .name(field) .averageKeySize(newMapAvgKey) .entries(newMapSize) .keyReaderAndDataAccess(BytesRefSizedReader.INSTANCE, new BytesRefDataAccess()) .createOrRecoverPersistedTo(chronicleMapFile); m.putAll(tempFile.toFile()); map = m; } finally { Files.delete(tempFile); } }
Source:
public boolean hasRequestType(@NonNull final DocTypeId docTypeId) { return Services.get(IDocTypeDAO.class).getById(docTypeId).getR_RequestType_ID() > 0; }

Target:
public boolean hasRequestType(@NonNull final DocTypeId docTypeId) { return docTypesRepo.getById(docTypeId).getR_RequestType_ID() > 0; }
Source:
public ExtractionType getExtractionType() { return ExtractionType.ONE_TO_ONE; }

Target:
public ExtractionType getExtractionType() { return ExtractionType.MANY_TO_ONE; }
Source:
private static void generateTransferSteps(final String namespace, final Collection<EvaluatorSummary> evaluatorSummaries, final PlanImpl.Builder builder) { final PriorityQueue<EvaluatorSummary> senderPriorityQueue = new PriorityQueue<>(evaluatorSummaries.size(), NUM_BLOCKS_TO_MOVE_COMPARATOR); final PriorityQueue<EvaluatorSummary> receiverPriorityQueue = new PriorityQueue<>(evaluatorSummaries.size(), NUM_BLOCKS_TO_MOVE_COMPARATOR); for (final EvaluatorSummary eval : evaluatorSummaries) { if (eval.getNumBlocks() > eval.getNumOptimalBlocks()) { senderPriorityQueue.add(eval); } else if (eval.getNumBlocks() < eval.getNumOptimalBlocks()) { receiverPriorityQueue.add(eval); } } while (!senderPriorityQueue.isEmpty()) { final EvaluatorSummary sender = senderPriorityQueue.poll(); final EvaluatorSummary receiver = receiverPriorityQueue.poll(); final int numToSend = sender.getNumBlocks() - sender.getNumOptimalBlocks(); final int numToReceive = receiver.getNumOptimalBlocks() - receiver.getNumBlocks(); final int numToMove = Math.min(numToSend, numToReceive); if (numToMove == numToSend) { receiver.setNumOptimalBlocks(receiver.getNumOptimalBlocks() - numToMove); receiverPriorityQueue.add(receiver); } else if (numToMove == numToReceive) { sender.setNumOptimalBlocks(sender.getNumOptimalBlocks() + numToMove); senderPriorityQueue.add(sender); } builder.addTransferStep(namespace, new TransferStepImpl(sender.id, receiver.id, new DataInfoImpl(numToMove))); } }

Target:
private static void generateTransferSteps(final String namespace, final Collection<EvaluatorSummary> evaluatorSummaries, final PlanImpl.Builder builder) { final PriorityQueue<EvaluatorSummary> senderPriorityQueue = new PriorityQueue<>(evaluatorSummaries.size(), NUM_BLOCKS_TO_MOVE_COMPARATOR); final PriorityQueue<EvaluatorSummary> receiverPriorityQueue = new PriorityQueue<>(evaluatorSummaries.size(), NUM_BLOCKS_TO_MOVE_COMPARATOR); for (final EvaluatorSummary eval : evaluatorSummaries) { if (eval.getNumBlocks() > eval.getNumOptimalBlocks()) { senderPriorityQueue.add(eval); } else if (eval.getNumBlocks() < eval.getNumOptimalBlocks()) { receiverPriorityQueue.add(eval); } } while (!senderPriorityQueue.isEmpty()) { final EvaluatorSummary sender = senderPriorityQueue.poll(); final EvaluatorSummary receiver = receiverPriorityQueue.poll(); final int numToSend = sender.getNumBlocks() - sender.getNumOptimalBlocks(); final int numToReceive = receiver.getNumOptimalBlocks() - receiver.getNumBlocks(); final int numToMove = Math.min(numToSend, numToReceive); builder.addTransferStep(namespace, new TransferStepImpl(sender.getId(), receiver.getId(), new DataInfoImpl(numToMove))); if (numToSend == numToReceive) { continue; } else if (numToMove == numToSend) { receiver.setNumBlocks(receiver.getNumBlocks() + numToMove); receiverPriorityQueue.add(receiver); } else { sender.setNumBlocks(sender.getNumBlocks() - numToMove); senderPriorityQueue.add(sender); } } }
Source:
public Map multi(String[] urls, Map options) throws IOException { options.put("urls", urls); return multi(options); }

Target:
public Map multi(String[] urls, Map options) throws IOException { if (options == null) { options = Collections.singletonMap("urls", urls); } else { options.put("urls", urls); } return multi(options); }
Source:
private boolean testReferencePoint(Envelope probeEnvelope, OGCGeometry buildGeometry, int partition) { Envelope buildEnvelope = getEnvelope(buildGeometry); Envelope intersection = buildEnvelope.intersection(probeEnvelope); if (intersection.isNull()) { return false; } com.esri.core.geometry.Envelope2D extent = partitions.get(partition); double x = intersection.getMinX(); double y = intersection.getMinY(); return x >= extent.xmin && x < extent.xmax && y >= extent.ymin && y < extent.ymax; }

Target:
private boolean testReferencePoint(Envelope probeEnvelope, OGCGeometry buildGeometry, int partition) { Envelope buildEnvelope = getEnvelope(buildGeometry); Envelope intersection = buildEnvelope.intersection(probeEnvelope); if (intersection.isNull()) { return false; } Rectangle extent = partitions.get(partition); double x = intersection.getMinX(); double y = intersection.getMinY(); return x >= extent.getXMin() && x < extent.getXMax() && y >= extent.getYMin() && y < extent.getYMax(); }
Source:
private void createBoard(List<PanelInfo> panelData, String boardName) { panelControl.closeAllPanels(); FilterPanel panelAdded; for (int i = 0; i < panelData.size(); i++) { panelAdded = panelControl.addPanelAt(i); panelAdded.setPanelName(panelData.get(i).getPanelName()); panelAdded.setFilterByString(panelData.get(i).getPanelFilter()); } panelControl.selectFirstPanel(); triggerBoardSaveEventSequence(boardName); }

Target:
private void createBoard(List<PanelInfo> panelData, String boardName) { panelControl.closeAllPanels(); FilterPanel panelAdded; for (PanelInfo panelInfo : panelData) { panelAdded = panelControl.addPanelAt(panelControl.getNumberOfPanels()); panelAdded.setPanelName(panelInfo.getPanelName()); panelAdded.setFilterByString(panelInfo.getPanelFilter()); } panelControl.selectFirstPanel(); triggerBoardSaveEventSequence(boardName); }
Source:
public void addEvent(KeenProject project, String eventCollection, Map<String, Object> event, Map<String, Object> keenProperties, KeenCallback callback) { if (!isActive) { handleLibraryInactive(callback); return; } if (project == null && defaultProject == null) { handleFailure(null, project, eventCollection, event, keenProperties, new IllegalStateException("No project specified, but no default project found")); return; } KeenProject useProject = (project == null ? defaultProject : project); try { if (eventCollection.contains(" ")){ eventCollection = URLEncoder.encode(eventCollection, "UTF-8").replace("+", "%20"); } Map<String, Object> newEvent = validateAndBuildEvent(useProject, eventCollection, event, keenProperties); publish(useProject, eventCollection, newEvent); handleSuccess(callback, project, eventCollection, event, keenProperties); } catch (Exception e) { handleFailure(callback, project, eventCollection, event, keenProperties, e); } }

Target:
public void addEvent(KeenProject project, String eventCollection, Map<String, Object> event, Map<String, Object> keenProperties, KeenCallback callback) { if (!isActive) { handleLibraryInactive(callback); return; } if (project == null && defaultProject == null) { handleFailure(null, project, eventCollection, event, keenProperties, new IllegalStateException("No project specified, but no default project found")); return; } KeenProject useProject = (project == null ? defaultProject : project); try { Map<String, Object> newEvent = validateAndBuildEvent(useProject, eventCollection, event, keenProperties); publish(useProject, eventCollection, newEvent); handleSuccess(callback, project, eventCollection, event, keenProperties); } catch (Exception e) { handleFailure(callback, project, eventCollection, event, keenProperties, e); } }
Source:
public void decompress(ByteBuffer in, int numBytes, ByteBuffer out) { final byte[] bytes = new byte[numBytes]; in.get(bytes); try (final ResourceHolder<byte[]> outputBytesHolder = CompressedPools.getOutputBytes()) { final byte[] outputBytes = outputBytesHolder.get(); final int numDecompressedBytes = lz4Fast.decompress(bytes, 0, outputBytes, 0, outputBytes.length); out.put(outputBytes, 0, numDecompressedBytes); out.flip(); } catch (IOException e) { Throwables.propagate(e); } }

Target:
public void decompress(ByteBuffer in, int numBytes, ByteBuffer out) { final byte[] bytes = new byte[numBytes]; in.get(bytes); try (final ResourceHolder<byte[]> outputBytesHolder = CompressedPools.getOutputBytes()) { final byte[] outputBytes = outputBytesHolder.get(); final int numDecompressedBytes = lz4Safe.decompress(bytes, outputBytes); out.put(outputBytes, 0, numDecompressedBytes); out.flip(); } catch (IOException e) { log.error(e, "IOException thrown while closing ChunkEncoder."); } }
Source:
private User getUserByEmail(String email) { UserService.Iface client = new ThriftClients().makeUserClient(); User user = null; try { if (!Strings.isNullOrEmpty(email) && client != null) { user = client.getByEmail(email); } } catch (TException e) { user = null; } return user; }

Target:
private User getUserByEmail(String email) { UserService.Iface client = new ThriftClients().makeUserClient(); try { if (!Strings.isNullOrEmpty(email) && client != null) { return client.getByEmail(email); } } catch (TException e) { return null; } return null; }
Source:
protected Scan operationScan() { Scan scan; if (getLastReadRow() == null && getStartRow() == null) { scan = new Scan(); } else if (getEndRow() == null) { scan = new Scan(Bytes.toBytes(getLastReadRow() == null ? getStartRow() : getLastReadRow())); } else { scan = new Scan(Bytes.toBytes(getLastReadRow() == null ? getStartRow() : getLastReadRow()), Bytes.toBytes(getEndRow())); } for (HBaseFieldInfo field : tableInfo.getFieldsInfo()) { scan.addColumn(Bytes.toBytes(field.getFamilyName()), Bytes.toBytes(field.getColumnName())); } scan.setAttribute(Scan.HINT_LOOKAHEAD, Bytes.toBytes(getHintScanLookahead())); return scan; }

Target:
protected Scan operationScan() { if (getLastReadRow() == null && getStartRow() == null) { if (scan == null) { scan = new Scan(); } } else if (getEndRow() == null) { scan.setStartRow(Bytes.toBytes(getLastReadRow() == null ? getStartRow() : getLastReadRow())); } else { scan.setStartRow(Bytes.toBytes(getLastReadRow() == null ? getStartRow() : getLastReadRow())); scan.setStopRow(Bytes.toBytes(getEndRow())); } for (HBaseFieldInfo field : tableInfo.getFieldsInfo()) { scan.addColumn(Bytes.toBytes(field.getFamilyName()), Bytes.toBytes(field.getColumnName())); } scan.setAttribute(Scan.HINT_LOOKAHEAD, Bytes.toBytes(getHintScanLookahead())); return scan; }