auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
DictionaryMergeIterator(Indexed<String>[] dimValueLookups, boolean useDirect) { final Ordering<String> stringOrdering = Comparators.naturalNullsFirst(); pQueue = new PriorityQueue<>( dimValueLookups.length, (lhs, rhs) -> stringOrdering.compare(lhs.rhs.peek(), rhs.rhs.peek()) ); conversions = new IntBuffer[dimValueLookups.length]; for (int i = 0; i < conversions.length; i++) { if (dimValueLookups[i] == null) { continue; } Indexed<String> indexed = dimValueLookups[i]; if (useDirect) { int allocationSize = indexed.size() * Ints.BYTES; log.info("Allocating dictionary merging direct buffer with size[%,d]", allocationSize); final ByteBuffer conversionDirectBuffer = ByteBuffer.allocateDirect(allocationSize); conversions[i] = conversionDirectBuffer.asIntBuffer(); directBufferAllocations.add(new Pair<>(conversionDirectBuffer, allocationSize)); } else { conversions[i] = IntBuffer.allocate(indexed.size()); } final PeekingIterator<String> iter = Iterators.peekingIterator( Iterators.transform( indexed.iterator(), input -> NullHandling.nullToEmptyIfNeeded(input) ) ); if (iter.hasNext()) { pQueue.add(Pair.of(i, iter)); } } }

Target:
DictionaryMergeIterator(Indexed<String>[] dimValueLookups, boolean useDirect) { final Ordering<String> stringOrdering = Comparators.naturalNullsFirst(); pQueue = new PriorityQueue<>( dimValueLookups.length, (lhs, rhs) -> stringOrdering.compare(lhs.rhs.peek(), rhs.rhs.peek()) ); conversions = new IntBuffer[dimValueLookups.length]; for (int i = 0; i < conversions.length; i++) { if (dimValueLookups[i] == null) { continue; } Indexed<String> indexed = dimValueLookups[i]; if (useDirect) { int allocationSize = indexed.size() * Integer.BYTES; log.info("Allocating dictionary merging direct buffer with size[%,d]", allocationSize); final ByteBuffer conversionDirectBuffer = ByteBuffer.allocateDirect(allocationSize); conversions[i] = conversionDirectBuffer.asIntBuffer(); directBufferAllocations.add(new Pair<>(conversionDirectBuffer, allocationSize)); } else { conversions[i] = IntBuffer.allocate(indexed.size()); } final PeekingIterator<String> iter = Iterators.peekingIterator( Iterators.transform( indexed.iterator(), NullHandling::nullToEmptyIfNeeded ) ); if (iter.hasNext()) { pQueue.add(Pair.of(i, iter)); } } }
Source:
public Set<VmDeviceGeneralType> getDeviceTypesWithProperties(Version version) { if (!FeatureSupported.deviceCustomProperties(version)) { return Collections.emptySet(); } Set<VmDeviceGeneralType> types; EnumMap<VmDeviceGeneralType, Map<String, Pattern>> map = deviceProperties.get(version); if (map.isEmpty()) { types = Collections.emptySet(); } else { types = Collections.unmodifiableSet(map.keySet()); } return types; }

Target:
public Set<VmDeviceGeneralType> getDeviceTypesWithProperties(Version version) { if (!FeatureSupported.deviceCustomProperties(version)) { return Collections.emptySet(); } EnumMap<VmDeviceGeneralType, Map<String, Pattern>> map = deviceProperties.get(version); if (map.isEmpty()) { return Collections.emptySet(); } else { return Collections.unmodifiableSet(map.keySet()); } }
Source:
private static void assertGetResult(VmTemplate result) { assertNotNull(result); assertEquals(EXISTING_TEMPLATE_ID, result.getId()); assertEquals("Template generation wasn't loaded as expected", new Long(1), result.getDbGeneration()); }

Target:
private static void assertGetResult(VmTemplate result) { assertNotNull(result); assertEquals(EXISTING_TEMPLATE_ID, result.getId()); assertTrue("Template generation wasn't loaded as expected", result.getDbGeneration() == 1); }
Source:
private void awaitInternal(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (jobClient == null) { return; } ExecutorService executor = Executors.newFixedThreadPool( 1, new ThreadFactoryBuilder().setNameFormat("TableResult-await-thread").build()); try { CompletableFuture<Void> future = CompletableFuture.runAsync(() -> { while (!data.isFirstRowReady()) { try { Thread.sleep(100); } catch (InterruptedException e) { throw new TableException("Thread is interrupted"); } } }, executor); if (timeout >= 0) { future.get(timeout, unit); } else { future.get(); } } finally { executor.shutdown(); } }

Target:
private void awaitInternal(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException { if (jobClient == null) { return; } ExecutorService executor = Executors.newFixedThreadPool(1, r -> new Thread(r, "TableResult-await-thread")); try { CompletableFuture<Void> future = CompletableFuture.runAsync(() -> { while (!data.isFirstRowReady()) { try { Thread.sleep(100); } catch (InterruptedException e) { throw new TableException("Thread is interrupted"); } } }, executor); if (timeout >= 0) { future.get(timeout, unit); } else { future.get(); } } finally { executor.shutdown(); } }
Source:
public Quota getUnlimitedQuota(storage_pool storagePool, boolean isDefaultQuota) { if (storagePool == null || storagePool.getId() == null) { log.error("Unlimited Quota cannot be created, Storage pool is not valid "); return null; } Quota quota = new Quota(); Guid quotaId = Guid.NewGuid(); quota.setId(quotaId); quota.setStoragePoolId(storagePool.getId()); quota.setQuotaName(getDefaultQuotaName(storagePool)); quota.setDescription("Automatic generated Quota for Data Center " + storagePool.getname()); quota.setThresholdVdsGroupPercentage(getIntegerConfig(ConfigValues.QuotaThresholdVdsGroup)); quota.setThresholdStoragePercentage(getIntegerConfig(ConfigValues.QuotaThresholdStorage)); quota.setGraceVdsGroupPercentage(getIntegerConfig(ConfigValues.QuotaGraceVdsGroup)); quota.setGraceStoragePercentage(getIntegerConfig(ConfigValues.QuotaGraceStorage)); quota.setIsDefaultQuota(isDefaultQuota); quota.setQuotaVdsGroups(new ArrayList<QuotaVdsGroup>()); quota.setQuotaStorages(new ArrayList<QuotaStorage>()); QuotaStorage quotaStorage = new QuotaStorage(); quotaStorage.setStorageSizeGB(UNLIMITED); quota.setGlobalQuotaStorage(quotaStorage); QuotaVdsGroup quotaVdsGroup = new QuotaVdsGroup(); quotaVdsGroup.setVirtualCpu(UNLIMITED.intValue()); quotaVdsGroup.setMemSizeMB(UNLIMITED); quota.setGlobalQuotaVdsGroup(quotaVdsGroup); return quota; }

Target:
public Quota getUnlimitedQuota(storage_pool storagePool, boolean isDefaultQuota) { if (storagePool == null || storagePool.getId() == null) { log.error("Unlimited Quota cannot be created, Storage pool is not valid "); return null; } Quota quota = new Quota(); Guid quotaId = Guid.NewGuid(); quota.setId(quotaId); quota.setStoragePoolId(storagePool.getId()); quota.setQuotaName(getDefaultQuotaName(storagePool)); quota.setDescription("Automatic generated Quota for Data Center " + storagePool.getname()); quota.setThresholdVdsGroupPercentage(getQuotaThresholdVdsGroup()); quota.setThresholdStoragePercentage(getQuotaThresholdStorage()); quota.setGraceVdsGroupPercentage(getQuotaGraceVdsGroup()); quota.setGraceStoragePercentage(getQuotaGraceStorage()); quota.setIsDefaultQuota(isDefaultQuota); quota.setQuotaVdsGroups(new ArrayList<QuotaVdsGroup>()); quota.setQuotaStorages(new ArrayList<QuotaStorage>()); QuotaStorage quotaStorage = new QuotaStorage(); quotaStorage.setStorageSizeGB(UNLIMITED); quota.setGlobalQuotaStorage(quotaStorage); QuotaVdsGroup quotaVdsGroup = new QuotaVdsGroup(); quotaVdsGroup.setVirtualCpu(UNLIMITED.intValue()); quotaVdsGroup.setMemSizeMB(UNLIMITED); quota.setGlobalQuotaVdsGroup(quotaVdsGroup); return quota; }
Source:
protected void onFinishInflate() { super.onFinishInflate(); View.inflate(getContext(), R.layout.merge_server_declaration, this); final EditText serverAddressDeclaration = Views.findById(this, R.id.bot_server_declaration); View connectToServer = Views.findById(this, R.id.bot_server_connect); connectToServer.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { String serverAddress = String.valueOf(serverAddressDeclaration.getText()); serverDeclarationListener.onConnect(serverAddress); } }); }

Target:
protected void onFinishInflate() { super.onFinishInflate(); View.inflate(getContext(), R.layout.merge_server_declaration, this); final EditText serverAddressDeclaration = Views.findById(this, R.id.bot_server_declaration); View connectToServer = Views.findById(this, R.id.bot_server_connect); connectToServer.setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { String serverAddress = serverAddressDeclaration.getText().toString(); serverDeclarationListener.onConnect(serverAddress); } }); }
Source:
protected DocumentModel captureAndVerifyAnnotationEventNotification(Supplier<DocumentModel> supplier, String annotationEventType, String documentEventType) { try (CapturingEventListener listener = new CapturingEventListener(annotationEventType, documentEventType)) { DocumentModel annotationDocumentModel = supplier.get(); DocumentModel annotationParentDocumentModel = session.getDocument(new IdRef( (String) annotationDocumentModel.getPropertyValue(COMMENT_PARENT_ID))); transactionalFeature.nextTransaction(); assertTrue(listener.hasBeenFired(annotationEventType)); assertTrue(listener.hasBeenFired(documentEventType)); List<Event> handledEvents = listener.getCapturedEvents() .stream() .filter(e -> annotationEventType.equals(e.getName())) .collect(Collectors.toList()); assertEquals(1, handledEvents.size()); Event expectedEvent = handledEvents.get(0); assertEquals(annotationEventType, expectedEvent.getName()); checkDocumentEventContext(expectedEvent, annotationDocumentModel, annotationParentDocumentModel, annotatedDocumentModel); checkReceivedMail(emailsResult.getMails(), annotationDocumentModel, annotatedDocumentModel, handledEvents.get(0), annotationEventType); return annotationDocumentModel; } }

Target:
protected void captureAndVerifyAnnotationEventNotification(Supplier<DocumentModel> supplier, String annotationEventType, String documentEventType) { try (CapturingEventListener listener = new CapturingEventListener(annotationEventType, documentEventType)) { DocumentModel annotationDocumentModel = supplier.get(); DocumentModel annotationParentDocumentModel = session.getDocument(new IdRef( (String) annotationDocumentModel.getPropertyValue(COMMENT_PARENT_ID))); transactionalFeature.nextTransaction(); assertTrue(listener.hasBeenFired(annotationEventType)); assertTrue(listener.hasBeenFired(documentEventType)); List<Event> handledEvents = listener.getCapturedEvents() .stream() .filter(e -> annotationEventType.equals(e.getName())) .collect(Collectors.toList()); assertEquals(1, handledEvents.size()); Event expectedEvent = handledEvents.get(0); assertEquals(annotationEventType, expectedEvent.getName()); checkDocumentEventContext(expectedEvent, annotationDocumentModel, annotationParentDocumentModel, annotatedDocumentModel); checkReceivedMail(emailsResult.getMails(), annotationDocumentModel, annotatedDocumentModel, handledEvents.get(0), annotationEventType); } }
Source:
public void setValue(String value) { this.fValue = value; fValueNumber = null; fValueTimestamp = null; if (value == null) { return; } if (fType == Type.NUM) { try { fValueNumber = NumberFormat.getInstance().parse(value).doubleValue(); } catch (ParseException e) { } } else if (fType == Type.TIMESTAMP) { try { fValueTimestamp = new TmfNanoTimestamp((long) (1E9 * NumberFormat.getInstance().parse(value.toString()).doubleValue())); } catch (ParseException e) { } } }

Target:
public void setValue(String value) { this.fValue = value; fValueNumber = null; fValueTimestamp = null; if (value == null) { return; } if (fType == Type.NUM) { try { fValueNumber = NumberFormat.getInstance().parse(value).doubleValue(); } catch (ParseException e) { } } else if (fType == Type.TIMESTAMP) { try { fValueTimestamp = new TmfNanoTimestamp(fTimestampFormat.parseValue(value.toString())); } catch (ParseException e) { } } }
Source:
private PluginDescriptor getPluginDescriptor(JSONObject p, String pluginName) { String pluginDescription = p.get("pluginDescription").isString().stringValue(); PluginDescriptor desc = new PluginDescriptor(pluginName, pluginDescription); JSONArray fields = p.get("configurableFields").isArray(); for (int j = 0; j < fields.size(); j++) { JSONObject field = fields.get(j).isObject(); String name = field.get("name").isString().stringValue(); String value = field.get("value").isString().stringValue(); JSONObject meta = field.get("meta").isObject(); String metaType = meta.get("type").isString().stringValue(); String descr = meta.get("description").isString().stringValue(); boolean pass = false; boolean cred = false; boolean file = false; if (metaType.equalsIgnoreCase("password")) pass = true; else if (metaType.equalsIgnoreCase("fileBrowser")) file = true; else if (metaType.equalsIgnoreCase("credential")) cred = true; Field f = new Field(name, value, descr, pass, cred, file); desc.getConfigurableFields().add(f); } return desc; }

Target:
private PluginDescriptor getPluginDescriptor(JSONObject p, String pluginName) { String pluginDescription = p.get("pluginDescription").isString().stringValue(); PluginDescriptor desc = new PluginDescriptor(pluginName, pluginDescription); JSONArray fields = p.get("configurableFields").isArray(); for (int j = 0; j < fields.size(); j++) { JSONObject field = fields.get(j).isObject(); String name = field.get("name").isString().stringValue(); String value = field.get("value").isString().stringValue(); JSONObject meta = field.get("meta").isObject(); String metaType = meta.get("type").isString().stringValue(); String descr = meta.get("description").isString().stringValue(); boolean password = false; boolean credentials = false; boolean file = false; if (metaType.equalsIgnoreCase("password")) password = true; else if (metaType.equalsIgnoreCase("fileBrowser")) file = true; else if (metaType.equalsIgnoreCase("credential")) credentials = true; Field f = new Field(name, value, descr, password, credentials, file); desc.getConfigurableFields().add(f); } return desc; }
Source:
public void loadUserWhenUserInfoSuccessResponseThenReturnUser() { String userInfoResponse = "{\n" + " \"id\": \"12345\",\n" + " \"name\": \"first last\",\n" + " \"login\": \"user1\",\n" + " \"email\": \"user1@example.com\"\n" + "}\n"; this.server.enqueue(jsonResponse(userInfoResponse)); String userInfoUri = this.server.url("/user").toString(); ClientRegistration clientRegistration = this.clientRegistrationBuilder .userInfoUri(userInfoUri).build(); OAuth2User user = this.userService.loadUser(new OAuth2UserRequest(clientRegistration, this.accessToken)); assertThat(user.getName()).isEqualTo("first last"); assertThat(user.getAttributes().size()).isEqualTo(4); assertThat((Object) user.getAttribute("id")).isEqualTo("12345"); assertThat((Object) user.getAttribute("name")).isEqualTo("first last"); assertThat((Object) user.getAttribute("login")).isEqualTo("user1"); assertThat((Object) user.getAttribute("email")).isEqualTo("user1@example.com"); assertThat(user.getAuthorities().size()).isEqualTo(1); assertThat(user.getAuthorities().iterator().next().getAuthority()).isEqualTo("ROLE_USER"); }

Target:
public void loadUserWhenUserInfoSuccessResponseThenReturnUser() { String userInfoResponse = "{\n" + " \"id\": \"12345\",\n" + " \"name\": \"first last\",\n" + " \"login\": \"user1\",\n" + " \"email\": \"user1@example.com\"\n" + "}\n"; this.server.enqueue(jsonResponse(userInfoResponse)); String userInfoUri = this.server.url("/user").toString(); ClientRegistration clientRegistration = this.clientRegistrationBuilder .userInfoUri(userInfoUri).build(); OAuth2User user = this.userService.loadUser(new OAuth2UserRequest(clientRegistration, this.accessToken)); assertThat(user.getName()).isEqualTo("first last"); assertThat(user.getAttributes().size()).isEqualTo(4); assertThat((String) user.getAttribute("id")).isEqualTo("12345"); assertThat((String) user.getAttribute("name")).isEqualTo("first last"); assertThat((String) user.getAttribute("login")).isEqualTo("user1"); assertThat((String) user.getAttribute("email")).isEqualTo("user1@example.com"); assertThat(user.getAuthorities().size()).isEqualTo(1); assertThat(user.getAuthorities().iterator().next().getAuthority()).isEqualTo("ROLE_USER"); }
Source:
public void testUpdate() throws Exception { setUpEntityQueryExpectations(1, false); setUpEntityQueryExpectations(1, true); setUpVDSGroupExpectations(GUIDS[1]); setUriInfo(setUpActionExpectations(VdcActionType.UpdateNetworkOnCluster, NetworkClusterAttachmentParameters.class, new String[] {}, new Object[] {}, true, true)); verifyUpdate(resource.update(getModel(0)), 0); }

Target:
public void testUpdate() throws Exception { setUpEntityQueryExpectations(1, false); setUpEntityQueryExpectations(1, true); setUpVDSGroupExpectations(GUIDS[1]); setUriInfo(setUpActionExpectations(VdcActionType.UpdateNetworkOnCluster, NetworkClusterParameters.class, new String[] {}, new Object[] {}, true, true)); verifyUpdate(resource.update(getModel(0)), 0); }
Source:
public void testObserver() throws Exception { try { final EntityManagerFactory emf = Persistence.createEntityManagerFactory( "jpajtastandalone-datastoreobserver" ); Assert.fail( "StartStoppable provider not executed" ); } catch (RuntimeException e) { boolean found = false; Throwable cause = e; do { if ( cause.getMessage().equals( "STARTED!" ) ) { break; } cause = cause.getCause(); } while ( cause != null ); if ( cause == null ) { Assert.fail( "StartStoppable proviTder not executed" ); } } }

Target:
public void testObserver() throws Exception { try { final EntityManagerFactory emf = Persistence.createEntityManagerFactory( "jpajtastandalone-datastoreobserver" ); Assert.fail( "StartStoppable provider not executed" ); } catch (RuntimeException e) { Throwable cause = e; do { if ( cause.getMessage().equals( "STARTED!" ) ) { break; } cause = cause.getCause(); } while ( cause != null ); if ( cause == null ) { Assert.fail( "StartStoppable provider not executed" ); } } }
Source:
public Connector tagImageActionName() { return integrationContext -> { Map<String, Object> inBoundVariables = integrationContext.getInBoundVariables(); System.out.println("tagImageActionName inbound variables keys: " + inBoundVariables.keySet()); System.out.println("tagImageActionName inbound variables values: " + inBoundVariables.values()); boolean expectedValue = (Boolean) inBoundVariables.get("expectedKey"); integrationContext.addOutBoundVariable("approved", expectedValue); assertThat(((String) inBoundVariables.get("input-variable-name-2"))).isEqualTo("input-variable-name-2"); return integrationContext; }; }

Target:
public Connector tagImageActionName() { return integrationContext -> { Map<String, Object> inBoundVariables = integrationContext.getInBoundVariables(); LOGGER.info("tagImageActionName inbound variables keys: " + inBoundVariables.keySet()); LOGGER.info("tagImageActionName inbound variables values: " + inBoundVariables.values()); boolean expectedValue = (Boolean) inBoundVariables.get("expectedKey"); integrationContext.addOutBoundVariable("approved", expectedValue); assertThat(((String) inBoundVariables.get("input-variable-name-2"))).isEqualTo("input-variable-name-2"); return integrationContext; }; }
Source:
private List<InternalJob> loadJobs(final boolean fullState, final Collection<JobStatus> status, final long period) { return executeReadOnlyTransaction(session -> { logger.info("Loading Jobs from database"); Query query; if (period > 0) { query = session.getNamedQuery("loadJobsWithPeriod") .setParameter("minSubmittedTime", System.currentTimeMillis() - period) .setParameterList("status", status) .setReadOnly(true); } else { query = session.getNamedQuery("loadJobs").setParameterList("status", status).setReadOnly(true); } List<Long> ids = query.list(); logger.info(ids.size() + " Jobs to fetch from database"); return loadInternalJobs(fullState, session, ids); }); }

Target:
private List<InternalJob> loadJobs(final boolean fullState, final Collection<JobStatus> status, final long period) { return executeReadOnlyTransaction(session -> { logger.info("Loading Jobs from database"); Query query; if (period > 0L) { query = session.getNamedQuery("loadJobsWithPeriod") .setParameter("minSubmittedTime", System.currentTimeMillis() - period) .setParameterList("status", status) .setReadOnly(true); } else { query = session.getNamedQuery("loadJobs").setParameterList("status", status).setReadOnly(true); } List<Long> ids = query.list(); logger.info(ids.size() + " Jobs to fetch from database"); return loadInternalJobs(fullState, session, ids); }); }
Source:
public String process(String query) { _logger.info("Processing query: {}", query); try { URI uri = new URI(query); String path = getPath(query, _logger); if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.DATASTREAM_STATE.toString())) { return processDatastreamStateRequest(uri); } else { _logger.error("Could not process query with path {}", query, path); } } catch (Exception e) { _logger.error("Failed to process query {}", query, e); } return null; }

Target:
public String process(String query) { _logger.info("Processing query: {}", query); try { URI uri = new URI(query); String path = getPath(query, _logger); if (path != null && path.equalsIgnoreCase(DiagnosticsRequestType.DATASTREAM_STATE.toString())) { String response = processDatastreamStateRequest(uri); _logger.info("Query: returns response: {}", query, response); return response; } else { _logger.error("Could not process query with path {}", query, path); } } catch (Exception e) { _logger.error("Failed to process query {}", query, e); } return null; }
Source:
private void assertRedirect(URI baseUri, HttpClient client, String path, String redirect) { HttpUriBuilder uriBuilder = uriBuilderFrom(baseUri); StringResponse response = client.execute( prepareGet() .setFollowRedirects(false) .setUri(uriBuilder.appendPath(path).build()) .build(), createStringResponseHandler()); assertEquals(response.getStatusCode(), HttpStatus.TEMPORARY_REDIRECT.code()); assertEquals(response.getHeader("Location"), redirect); assertNull(response.getHeader(CONTENT_TYPE), CONTENT_TYPE + " header should be absent"); assertEquals(response.getBody(), "", "Response body"); }

Target:
private void assertRedirect(URI baseUri, HttpClient client, String path, String redirect) { HttpUriBuilder uriBuilder = uriBuilderFrom(baseUri); StringResponse response = client.execute( prepareGet() .setFollowRedirects(false) .setUri(uriBuilder.appendPath(path).build()) .build(), createStringResponseHandler()); assertEquals(response.getStatusCode(), HttpStatus.TEMPORARY_REDIRECT.code()); assertEquals(response.getHeader(LOCATION), redirect); assertNull(response.getHeader(CONTENT_TYPE), CONTENT_TYPE + " header should be absent"); assertEquals(response.getBody(), "", "Response body"); }
Source:
public void testEstimatedAndSplitForLargeTable() throws Exception { TableName tableName = newTestTableName(); try (Admin admin = connection.getAdmin()) { admin.createTable( new HTableDescriptor(tableName).addFamily(new HColumnDescriptor(COLUMN_FAMILY))); try (BufferedMutator mutator = connection.getBufferedMutator(tableName)) { for (int i = 0; i < 1000; i++ ) { mutator.mutate( new Put(Bytes.toBytes("row" + i)) .addColumn(COLUMN_FAMILY, QUALIFIER1, getLargeValue())); } } List<SampleRowKeysResponse> sampleRowKeys = getSampleKeys(tableName); try { CloudBigtableIO.Source source = new CloudBigtableIO.Source(new CloudBigtableScanConfiguration( projectId, zoneId, clusterId, tableName.getQualifierAsString(), new Scan())); long estimatedSizeBytes = source.getEstimatedSizeBytes(null); SampleRowKeysResponse lastSample = sampleRowKeys.get(sampleRowKeys.size() - 1); Assert.assertEquals(lastSample.getOffsetBytes(), estimatedSizeBytes); List<SourceWithKeys> bundles = source.splitIntoBundles(sampleRowKeys.get(0).getOffsetBytes() / 2, null); END_ROW key, which cannot be split. Assert.assertEquals(sampleRowKeys.size() * 2 - 1, bundles.size()); } finally { admin.deleteTable(tableName); } } }

Target:
public void testEstimatedAndSplitForLargeTable() throws Exception { TableName tableName = newTestTableName(); try (Admin admin = connection.getAdmin()) { admin.createTable( new HTableDescriptor(tableName).addFamily(new HColumnDescriptor(COLUMN_FAMILY))); final int rowCount = 1000; try (BufferedMutator mutator = connection.getBufferedMutator(tableName)) { for (int i = 0; i < rowCount; i++ ) { mutator.mutate( new Put(Bytes.toBytes("row" + i)) .addColumn(COLUMN_FAMILY, QUALIFIER1, getLargeValue())); } } List<SampleRowKeysResponse> sampleRowKeys = getSampleKeys(tableName); try { BoundedSource<Result> source = CloudBigtableIO.read(new CloudBigtableScanConfiguration(projectId, zoneId, clusterId, tableName.getQualifierAsString(), new Scan())); long estimatedSizeBytes = source.getEstimatedSizeBytes(null); SampleRowKeysResponse lastSample = sampleRowKeys.get(sampleRowKeys.size() - 1); Assert.assertEquals(lastSample.getOffsetBytes(), estimatedSizeBytes); List<? extends BoundedSource<Result>> bundles = source.splitIntoBundles(sampleRowKeys.get(0).getOffsetBytes() / 2, null); END_ROW key, which cannot be split. Assert.assertEquals(sampleRowKeys.size() * 2 - 1, bundles.size()); int count = 0; for (BoundedSource<Result> bundle : bundles) { BoundedReader<Result> reader = bundle.createReader(null); reader.start(); while(reader.getCurrent() != null) { count++; reader.advance(); } reader.close(); } Assert.assertEquals(rowCount, count); } finally { admin.deleteTable(tableName); } } }
Source:
static boolean shouldPublishImmediately(PostModel postModel) { boolean optionAvailable = shouldPublishImmediatelyOptionBeAvailable(postModel); Date pubDate = DateTimeUtils.dateFromIso8601(postModel.getDateCreated()); Date now = new Date(); return optionAvailable && !pubDate.after(now); }

Target:
static boolean shouldPublishImmediately(PostModel postModel) { if (!shouldPublishImmediatelyOptionBeAvailable(postModel)) { return false; } Date pubDate = DateTimeUtils.dateFromIso8601(postModel.getDateCreated()); Date now = new Date(); return !pubDate.after(now); }
Source:
public void stopWorkspace(String workspaceId, Map<String, String> options) throws ServerException, NotFoundException, ConflictException { requireNonNull(workspaceId, "Required non-null workspace id"); final WorkspaceImpl workspace = normalizeState(workspaceDao.get(workspaceId), true); if (!workspace.isTemporary()) { workspace.getAttributes().put(UPDATED_ATTRIBUTE_NAME, Long.toString(currentTimeMillis())); workspaceDao.update(workspace); } runtimes .stopAsync(workspace, options) .whenComplete( (aVoid, throwable) -> { if (workspace.isTemporary()) { removeWorkspaceQuietly(workspace); } }); }

Target:
public void stopWorkspace(String workspaceId, Map<String, String> options) throws ServerException, NotFoundException, ConflictException { requireNonNull(workspaceId, "Required non-null workspace id"); final WorkspaceImpl workspace = normalizeState(workspaceDao.get(workspaceId), true); checkWorkspaceIsRunningOrStarting(workspace); if (!workspace.isTemporary()) { workspace.getAttributes().put(UPDATED_ATTRIBUTE_NAME, Long.toString(currentTimeMillis())); workspaceDao.update(workspace); } runtimes .stopAsync(workspace, options) .whenComplete( (aVoid, throwable) -> { if (workspace.isTemporary()) { removeWorkspaceQuietly(workspace); } }); }
Source:
public void receiveCommand(String itemName, Command command) { logger.trace("receiveCommand({},{}) called.", itemName, command.toString()); if (this.eventPublisher == null) { logger.error("receiveCommand(): eventPublisher is NULL. Should NEVER occur."); return; } super.receiveCommand(itemName, command); }

Target:
public void receiveCommand(String itemName, Command command) { logger.trace("receiveCommand({},{}) called.", itemName, command.toString()); if (this.eventPublisher == null) { logger.warn("receiveCommand(): eventPublisher is NULL. Should NEVER occur."); return; } super.receiveCommand(itemName, command); }
Source:
private DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system, String localRepoPath) { DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession(); LocalRepository localRepo = new LocalRepository(localRepoPath); session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo)); session.setOffline(this.offline); if (isProxyEnabled()) { DefaultProxySelector proxySelector = new DefaultProxySelector(); Proxy proxy = new Proxy(proxyProperties.getProtocol(), proxyProperties.getHost(), Integer.parseInt(proxyProperties.getPort()), authentication); proxySelector.add(proxy, proxyProperties.getNonProxyHosts()); session.setProxySelector(proxySelector); } return session; }

Target:
private DefaultRepositorySystemSession newRepositorySystemSession(RepositorySystem system, String localRepoPath) { DefaultRepositorySystemSession session = MavenRepositorySystemUtils.newSession(); LocalRepository localRepo = new LocalRepository(localRepoPath); session.setLocalRepositoryManager(system.newLocalRepositoryManager(session, localRepo)); session.setOffline(this.offline); if (isProxyEnabled()) { DefaultProxySelector proxySelector = new DefaultProxySelector(); Proxy proxy = new Proxy(proxyProperties.getProtocol(), proxyProperties.getHost(), proxyProperties.getPort(), authentication); proxySelector.add(proxy, proxyProperties.getNonProxyHosts()); session.setProxySelector(proxySelector); } return session; }
Source:
public BooleanWrapper removeNode(String nodeUrl, Client initiator) { Node node = null; if (this.nodes.containsKey(nodeUrl)) { logger.info("Remove node " + nodeUrl + " from node source " + this.name); node = this.nodes.remove(nodeUrl); } else if (this.downNodes.containsKey(nodeUrl)) { logger.info("Remove down node " + nodeUrl + " from node source " + this.name); node = this.downNodes.remove(nodeUrl); } if (node == null) { logger.error("Node " + nodeUrl + " cannot be removed from node source " + this.name + " because it is not known"); return new BooleanWrapper(false); } else { RMCore.topologyManager.removeNode(node); try { this.infrastructureManager.internalRemoveNode(node); } catch (RMException e) { logger.error(e.getCause().getMessage(), e); } return new BooleanWrapper(true); } }

Target:
public BooleanWrapper removeNode(String nodeUrl, Client initiator) { Node node = null; if (this.nodes.containsKey(nodeUrl)) { logger.info("[" + this.name + "] removing node: " + nodeUrl); node = this.nodes.remove(nodeUrl); } else if (this.downNodes.containsKey(nodeUrl)) { logger.info("[" + this.name + "] removing down node: " + nodeUrl); node = this.downNodes.remove(nodeUrl); } if (node == null) { logger.error("[" + this.name + "] cannot remove node: " + nodeUrl + " because it is unknown"); return new BooleanWrapper(false); } else { RMCore.topologyManager.removeNode(node); try { this.infrastructureManager.internalRemoveNode(node); } catch (RMException e) { logger.error(e.getCause().getMessage(), e); } return new BooleanWrapper(true); } }
Source:
private NickManager(XMPPConnection connection) { super(connection); connection.addSyncStanzaListener(new StanzaListener() { @Override public void processStanza(Stanza packet) throws SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException { final Message message = (Message) packet; asyncButOrdered.performAsyncButOrdered(message, new Runnable() { @Override public void run() { for (NickListener listener : nickListeners) { listener.newNickMessage(message); } } }); } }, INCOMING_MESSAGE_FILTER); }

Target:
private NickManager(XMPPConnection connection) { super(connection); connection.addSyncStanzaListener(new StanzaListener() { @Override public void processStanza(Stanza packet) throws SmackException.NotConnectedException, InterruptedException, SmackException.NotLoggedInException { final Message message = (Message) packet; Jid from = message.getFrom(); if (from != null) { asyncButOrdered.performAsyncButOrdered(from, new Runnable() { @Override public void run() { synchronized (nickListeners) { for (NickListener listener : nickListeners) { listener.newNickMessage(message); } } } }); } } }, INCOMING_MESSAGE_FILTER); }
Source:
public void testCompaction(int N) throws Exception { FileReftableStack stack = new FileReftableStack(new File(reftableDir, "refs"), reftableDir, null, () -> new Config()); for (int i = 0; i < N; i++) { final long next = stack.getMergedReftable().maxUpdateIndex()+1; String name = String.format("refs/heads/branch%d", Integer.valueOf(i)); Ref r = newRef(name, ObjectId.zeroId()); boolean ok = stack.addReftable(rw -> { rw.setMinUpdateIndex(next).setMaxUpdateIndex(next).begin() .writeRef(r); }); assertTrue(ok); } MergedReftable table = stack.getMergedReftable(); for (int i = 1; i < N; i++) { String name = String.format("refs/heads/branch%d", Integer.valueOf(i)); RefCursor c = table.seekRef(name); assertTrue(c.next()); assertEquals(ObjectId.zeroId(), c.getRef().getObjectId()); } List<String> files = Arrays.asList(reftableDir.listFiles()).stream() .map(File::getName).collect(Collectors.toList()); Collections.sort(files); assertTrue(files.size() < 20); FileReftableStack.CompactionStats stats = stack.getStats(); assertEquals(0, stats.failed); assertTrue(stats.attempted < N); assertTrue(stats.refCount < FileReftableStack.log(N) * N); }

Target:
public void testCompaction(int N) throws Exception { try (FileReftableStack stack = new FileReftableStack( new File(reftableDir, "refs"), reftableDir, null, () -> new Config())) { for (int i = 0; i < N; i++) { final long next = stack.getMergedReftable().maxUpdateIndex() + 1; String name = String.format("refs/heads/branch%d", Integer.valueOf(i)); Ref r = newRef(name, ObjectId.zeroId()); boolean ok = stack.addReftable(rw -> { rw.setMinUpdateIndex(next).setMaxUpdateIndex(next).begin() .writeRef(r); }); assertTrue(ok); } MergedReftable table = stack.getMergedReftable(); for (int i = 1; i < N; i++) { String name = String.format("refs/heads/branch%d", Integer.valueOf(i)); RefCursor c = table.seekRef(name); assertTrue(c.next()); assertEquals(ObjectId.zeroId(), c.getRef().getObjectId()); } List<String> files = Arrays.asList(reftableDir.listFiles()).stream() .map(File::getName).collect(Collectors.toList()); Collections.sort(files); assertTrue(files.size() < 20); FileReftableStack.CompactionStats stats = stack.getStats(); assertEquals(0, stats.failed); assertTrue(stats.attempted < N); assertTrue(stats.refCount < FileReftableStack.log(N) * N); } }
Source:
public void tokenize(SourceCode sourceCode, Tokens tokenEntries) { StringBuilder buffer = sourceCode.getCodeBuffer(); GroovyLexer lexer = new GroovyLexer(IOUtils.toInputStream(buffer.toString(), StandardCharsets.UTF_8)); TokenStream tokenStream = lexer.plumb(); try { Token token = tokenStream.nextToken(); while (token.getType() != Token.EOF_TYPE) { TokenEntry tokenEntry = new TokenEntry(token.getText(), sourceCode.getFileName(), token.getLine()); tokenEntries.add(tokenEntry); token = tokenStream.nextToken(); } } catch (TokenStreamException err) { throw new TokenMgrError("Lexical error in file " + sourceCode.getFileName() + " at line " + lexer.getLine() + ", column " + lexer.getColumn() + ". Encountered: " + err.getMessage(), TokenMgrError.LEXICAL_ERROR); } finally { tokenEntries.add(TokenEntry.getEOF()); } }

Target:
public void tokenize(SourceCode sourceCode, Tokens tokenEntries) { StringBuilder buffer = sourceCode.getCodeBuffer(); GroovyLexer lexer = new GroovyLexer(new StringReader(buffer.toString())); TokenStream tokenStream = lexer.plumb(); try { Token token = tokenStream.nextToken(); while (token.getType() != Token.EOF_TYPE) { TokenEntry tokenEntry = new TokenEntry(token.getText(), sourceCode.getFileName(), token.getLine()); tokenEntries.add(tokenEntry); token = tokenStream.nextToken(); } } catch (TokenStreamException err) { throw new TokenMgrError("Lexical error in file " + sourceCode.getFileName() + " at line " + lexer.getLine() + ", column " + lexer.getColumn() + ". Encountered: " + err.getMessage(), TokenMgrError.LEXICAL_ERROR); } finally { tokenEntries.add(TokenEntry.getEOF()); } }
Source:
V put(final K key, final V value) { final V returnValue = clusterRegistry.put(scope, key, value); localCacheInsert(key, value); return returnValue; }

Target:
void put(final K key, final V value) { clusterRegistry.put(scope, key, value); localCacheInsert(key, value); }
Source:
public void sendCssText(String cssText) { waitForElementByElement(aceLayerTextArea); executeScript("ace.edit('cssEditorContainer').setValue('"+ cssText +"');"); PageObjectLogging.log("sendCssText", "the following text was send to ace editor: "+cssText, true, driver); }

Target:
public void sendCssText(String cssText) { waitForElementByElement(aceLayerTextArea); waitForElementByElement(aceInputTextArea); aceInputTextArea.sendKeys(cssText); PageObjectLogging.log("sendCssText", "the following text was send to ace editor: "+cssText, true, driver); }
Source:
public BtMpxChannelDataIngester productionChannelGroupUpdater() { return perEnvironmentChannelGroupUpdater(Publisher.BT_TV_CHANNELS, PROD_ALIAS_NAMESPACE_PREFIX, baseUri, Boolean.parseBoolean(productionIngestAdvertiseFrom), productionNamespace); }

Target:
public BtMpxChannelDataIngester productionChannelGroupUpdater() { return perEnvironmentChannelGroupUpdater(Publisher.BT_TV_CHANNELS, ALIAS_NAMESPACE_PREFIX, baseUri, Boolean.parseBoolean(productionIngestAdvertiseFrom), productionNamespace); }
Source:
public void testGetVdsCountByStoragePoolId() { Integer result = dao.GetVdsCountByStoragePoolId(existingVds.getstorage_pool_id()); assertNotNull(result); assertEquals(new Integer(getAllForStoragePool(existingVds).size()), result); }

Target:
public void testGetVdsCountByStoragePoolId() { Integer result = dao.getVdsCountByStoragePoolId(existingVds.getstorage_pool_id()); assertNotNull(result); assertEquals(new Integer(getAllForStoragePool(existingVds).size()), result); }
Source:
private static void setup(DistributedQueryRunner queryRunner, H2ResourceGroupsDao dao, String environment) throws InterruptedException { JsonCodec<List<String>> clientTagCodec = listJsonCodec(String.class); dao.insertResourceGroupsGlobalProperties("cpu_quota_period", "1h"); dao.insertResourceGroup(1, "global", "1MB", 100, 1000, 1000, null, null, null, null, null, null, null, null, TEST_ENVIRONMENT); dao.insertResourceGroup(2, "bi-${USER}", "1MB", 3, 2, 2, null, null, null, null, null, null, null, 1L, TEST_ENVIRONMENT); dao.insertResourceGroup(3, "user-${USER}", "1MB", 3, 3, 3, null, null, null, null, null, null, null, 1L, TEST_ENVIRONMENT); dao.insertResourceGroup(4, "adhoc-${USER}", "1MB", 3, 3, 3, null, null, null, null, null, null, null, 3L, TEST_ENVIRONMENT); dao.insertResourceGroup(5, "dashboard-${USER}", "1MB", 1, 1, 1, null, null, null, null, null, null, null, 3L, TEST_ENVIRONMENT); dao.insertResourceGroup(6, "no-queueing", "1MB", 0, 1, 1, null, null, null, null, null, null, null, null, TEST_ENVIRONMENT_2); dao.insertSelector(2, "user.*", "test", null); dao.insertSelector(4, "user.*", "(?i).*adhoc.*", null); dao.insertSelector(5, "user.*", "(?i).*dashboard.*", null); dao.insertSelector(4, "user.*", null, clientTagCodec.toJson(ImmutableList.of("tag1", "tag2"))); dao.insertSelector(2, "user.*", null, clientTagCodec.toJson(ImmutableList.of("tag1"))); dao.insertSelector(6, ".*", ".*", null); int expectedSelectors = 5; if (environment.equals(TEST_ENVIRONMENT_2)) { expectedSelectors = 1; } while (getSelectors(queryRunner).size() != expectedSelectors) { MILLISECONDS.sleep(500); } }

Target:
private static void setup(DistributedQueryRunner queryRunner, H2ResourceGroupsDao dao, String environment) throws InterruptedException { dao.insertResourceGroupsGlobalProperties("cpu_quota_period", "1h"); dao.insertResourceGroup(1, "global", "1MB", 100, 1000, 1000, null, null, null, null, null, null, null, null, TEST_ENVIRONMENT); dao.insertResourceGroup(2, "bi-${USER}", "1MB", 3, 2, 2, null, null, null, null, null, null, null, 1L, TEST_ENVIRONMENT); dao.insertResourceGroup(3, "user-${USER}", "1MB", 3, 3, 3, null, null, null, null, null, null, null, 1L, TEST_ENVIRONMENT); dao.insertResourceGroup(4, "adhoc-${USER}", "1MB", 3, 3, 3, null, null, null, null, null, null, null, 3L, TEST_ENVIRONMENT); dao.insertResourceGroup(5, "dashboard-${USER}", "1MB", 1, 1, 1, null, null, null, null, null, null, null, 3L, TEST_ENVIRONMENT); dao.insertResourceGroup(6, "no-queueing", "1MB", 0, 1, 1, null, null, null, null, null, null, null, null, TEST_ENVIRONMENT_2); dao.insertSelector(2, "user.*", "test", null); dao.insertSelector(4, "user.*", "(?i).*adhoc.*", null); dao.insertSelector(5, "user.*", "(?i).*dashboard.*", null); dao.insertSelector(4, "user.*", null, CLIENT_TAGS_CODEC.toJson(ImmutableList.of("tag1", "tag2"))); dao.insertSelector(2, "user.*", null, CLIENT_TAGS_CODEC.toJson(ImmutableList.of("tag1"))); dao.insertSelector(6, ".*", ".*", null); int expectedSelectors = 5; if (environment.equals(TEST_ENVIRONMENT_2)) { expectedSelectors = 1; } while (getSelectors(queryRunner).size() != expectedSelectors) { MILLISECONDS.sleep(500); } }
Source:
private void warnIfJavaVersionOutdated() { try { JavaVersion javaRuntimeVersion = JavaVersion.fromString(System.getProperty("java.runtime.version")); JavaVersion javaRequiredVersion = JavaVersion.fromString(JavaVersion.REQUIRED_VERSION); if (JavaVersion.isJavaVersionTooLow(javaRuntimeVersion, javaRequiredVersion)) { showJavaVersionOutdatedWarning(javaRuntimeVersion, javaRequiredVersion); } } catch (IllegalArgumentException e) { logger.error("Java Version string failed to be parsed.", e); } }

Target:
private void warnIfJavaVersionOutdated() { JavaVersion requiredVersion; try { requiredVersion = JavaVersion.fromString(REQUIRED_JAVA_VERSION); } catch (IllegalArgumentException e) { logger.error("Required Java Version string cannot be parsed. This should have been covered by test."); assert false; return; } JavaVersion runtimeVersion; String javaRuntimeVersionString = System.getProperty("java.runtime.version"); try { runtimeVersion = JavaVersion.fromString(javaRuntimeVersionString); } catch (IllegalArgumentException e) { logger.error("Runtime Java Version string cannot be parsed. Look at Java Doc about other version format."); showJavaRuntimeVersionNotCompatible(System.getProperty("java.runtime.version")); return; } if (JavaVersion.isJavaVersionLower(runtimeVersion, requiredVersion)) { showJavaVersionOutdatedWarning(runtimeVersion, requiredVersion); } }
Source:
public void addRemoveContentToIndex () throws Exception { Structure testStructure = loadTestStructure(); Contentlet testContentlet = loadTestContentlet( testStructure ); try { testContentlet.setIndexPolicy(IndexPolicy.WAIT_FOR); indexAPI.addContentToIndex( testContentlet ); contentletAPI.isInodeIndexed( testContentlet.getInode(), true ); String query = "+structureName:" + testStructure.getVelocityVarName() + " +deleted:false +live:true"; List<Contentlet> result = contentletAPI.search( query, 0, -1, "modDate desc", user, true ); assertNotNull( result ); assertTrue( !result.isEmpty() ); indexAPI.removeContentFromIndex( testContentlet ); wasContentRemoved( query + " " + UUIDGenerator.generateUuid() ); result = contentletAPI.search( query + " " + UUIDGenerator.generateUuid(), 0, -1, "modDate desc", user, true ); assertTrue( result == null || result.isEmpty() ); } finally { try { contentletAPI.destroy(testContentlet, user, false ); } catch (Exception e) { e.printStackTrace(); } contentTypeAPI.delete(new StructureTransformer(testStructure).from()); } }

Target:
public void addRemoveContentToIndex () throws Exception { Structure testStructure = loadTestStructure(); Contentlet testContentlet = loadTestContentlet( testStructure ); try { testContentlet.setIndexPolicy(IndexPolicy.WAIT_FOR); indexAPI.addContentToIndex( testContentlet ); contentletAPI.isInodeIndexed( testContentlet.getInode(), true ); String query = "+structureName:" + testStructure.getVelocityVarName() + " +deleted:false +live:true"; List<Contentlet> result = contentletAPI.search( query, 0, -1, "modDate desc", user, true ); assertNotNull( result ); assertTrue( !result.isEmpty() ); indexAPI.removeContentFromIndex( testContentlet ); wasContentRemoved( query ); result = contentletAPI.search( query, 0, -1, "modDate desc", user, true ); assertTrue( result == null || result.isEmpty() ); } finally { try { contentletAPI.destroy(testContentlet, user, false ); } catch (Exception e) { e.printStackTrace(); } contentTypeAPI.delete(new StructureTransformer(testStructure).from()); } }
Source:
private String getKey(OMElement pool, QName qName) { OMElement ele = pool.getFirstChildWithName(qName); if (ele != null) { return ele.getAttributeValue(new QName(ATT_KEY)); } else { return null; } }

Target:
private String getKey(OMElement pool, QName qName) { OMElement ele = pool.getFirstChildWithName(qName); if (ele != null) { return ele.getAttributeValue(new QName(ATT_KEY)); } return null; }
Source:
public FileChangeWatcher(Path dirPath, Consumer<WatchEvent<?>> callback) throws IOException { FileSystem fs = dirPath.getFileSystem(); WatchService watchService = fs.newWatchService(); if (LOG.isDebugEnabled()) { LOG.debug("Registering with watch service: " + dirPath); } dirPath.register( watchService, new WatchEvent.Kind<?>[]{ StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY, StandardWatchEventKinds.OVERFLOW}, SensitivityWatchEventModifier.HIGH); this.watcherThread = new WatcherThread(watchService, callback); this.watcherThread.setDaemon(true); this.watcherThread.start(); }

Target:
public FileChangeWatcher(Path dirPath, Consumer<WatchEvent<?>> callback) throws IOException { FileSystem fs = dirPath.getFileSystem(); WatchService watchService = fs.newWatchService(); if (LOG.isDebugEnabled()) { LOG.debug("Registering with watch service: " + dirPath); } dirPath.register( watchService, new WatchEvent.Kind<?>[]{ StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY, StandardWatchEventKinds.OVERFLOW}, SensitivityWatchEventModifier.HIGH); state = State.NEW; this.watcherThread = new WatcherThread(watchService, callback); this.watcherThread.setDaemon(true); }
Source:
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) { ItemStack itemstack = player.getHeldItem(hand); if(!world.isRemote){return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, itemstack);} player.openGui(LogisticsPipes.instance, GuiIDs.GUI_Guide_Book_ID, world, player.getPosition().getX(), player.getPosition().getY(), player.getPosition().getZ()); return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, itemstack); }

Target:
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) { ItemStack itemstack = player.getHeldItem(hand); if (world.isRemote) MainProxy.proxy.openGuideBookGui(hand); return new ActionResult<>(EnumActionResult.SUCCESS, itemstack); }
Source:
public Collection<KeyValueAnnotation> responseAnnotations() { KeyValueAnnotation statusAnnotation = KeyValueAnnotation.create( "http.responsecode", String.valueOf(response.getHttpStatusCode())); return Arrays.asList(statusAnnotation); }

Target:
public Collection<KeyValueAnnotation> responseAnnotations() { KeyValueAnnotation statusAnnotation = KeyValueAnnotation.create( TraceKeys.HTTP_STATUS_CODE, String.valueOf(response.getHttpStatusCode())); return Arrays.asList(statusAnnotation); }
Source:
public TrieRoutingData(Map<String, List<String>> routingData) throws InvalidRoutingDataException { if (isRootShardingKey(routingData)) { Map.Entry<String, List<String>> entry = routingData.entrySet().iterator().next(); _rootNode = new TrieNode(Collections.emptyMap(), "/", true, entry.getKey()); } else { _rootNode = new TrieNode(new HashMap<>(), "/", false, ""); constructTrie(routingData); } }

Target:
public TrieRoutingData(Map<String, List<String>> routingData) throws InvalidRoutingDataException { if (routingData == null || routingData.isEmpty()) { throw new InvalidRoutingDataException("routingData cannot be null or empty"); } if (isRootShardingKey(routingData)) { Map.Entry<String, List<String>> entry = routingData.entrySet().iterator().next(); _rootNode = new TrieNode(Collections.emptyMap(), "/", true, entry.getKey()); } else { _rootNode = new TrieNode(new HashMap<>(), "/", false, ""); constructTrie(routingData); } }