auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static Object object(Map<String, Object> arguments) { ConfigBag config = ConfigBag.newInstance(arguments); String typeName = BrooklynYamlTypeInstantiator.InstantiatorFromKey.extractTypeName("object", config).orNull(); Map<String,Object> fields = Maybe.fromNullable((Map<String, Object>) config.getStringKey("object.fields")) .or(MutableMap.<String, Object>of()); try { Class<?> type = Class.forName(typeName); if (!Reflections.hasNoArgConstructor(type)) { throw new IllegalStateException(String.format("Cannot construct %s bean: No public no-arg constructor available present", type)); } if (fields.isEmpty() || DslUtils.resolved(fields.values())) { try { Object bean = Reflections.invokeConstructorWithArgs(type).get(); BeanUtils.populate(bean, fields); return bean; } catch (Exception e) { throw Exceptions.propagate(e); } } else { return new DslObject(type, fields); } } catch (ClassNotFoundException e) { throw Exceptions.propagate(e); } }

Target:
public static Object object(Map<String, Object> arguments) { ConfigBag config = ConfigBag.newInstance(arguments); String typeName = BrooklynYamlTypeInstantiator.InstantiatorFromKey.extractTypeName("object", config).orNull(); Map<String,Object> objectFields = (Map<String, Object>) config.getStringKeyMaybe("object.fields").or(MutableMap.of()); Map<String,Object> brooklynConfig = (Map<String, Object>) config.getStringKeyMaybe("brooklyn.config").or(MutableMap.of()); try { Class<?> type = Class.forName(typeName); if (!Reflections.hasNoArgConstructor(type)) { throw new IllegalStateException(String.format("Cannot construct %s bean: No public no-arg constructor available", type)); } if ((objectFields.isEmpty() || DslUtils.resolved(objectFields.values())) && (brooklynConfig.isEmpty() || DslUtils.resolved(brooklynConfig.values()))) { return DslObject.create(type, objectFields, brooklynConfig); } else { return new DslObject(type, objectFields, brooklynConfig); } } catch (ClassNotFoundException e) { throw Exceptions.propagate(e); } }
Source:
public void initialize() { final Map<Long, NeuralNetworkData> workloadMap = memoryStore.getAll(); final Collection<NeuralNetworkData> workload = workloadMap.values(); LOG.log(Level.INFO, "Number of input instances = {0}", workload.size()); }

Target:
public void initialize() { }
Source:
public final Type getType() { if (beginA == endA && beginB < endB) return Type.INSERT; if (beginA < endA && beginB == endB) return Type.DELETE; if (isEmpty()) return Type.EMPTY; return Type.REPLACE; }

Target:
public final Type getType() { if (beginA == endA && beginB < endB) return Type.INSERT; if (beginA < endA && beginB == endB) return Type.DELETE; if (beginA == endA && beginB == endB) return Type.EMPTY; return Type.REPLACE; }
Source:
@Override protected void onEntityRemoved(Entity member) { try { ((MongoDBReplicaSetImpl) entity).serverRemoved((MongoDBServer) member); } catch (Exception e) { ServiceStateLogic.ServiceNotUpLogic.updateNotUpIndicator((EntityLocal)member, "Failed to update replicaset", e); } }

Target:
@Override protected void onEntityRemoved(Entity member) { ((MongoDBReplicaSetImpl) entity).serverRemoved((MongoDBServer) member); }
Source:
public LinkedIdentifierColumn(MainTableColumnModel model, CellFactory cellFactory, BibDatabaseContext database, DialogService dialogService) { super(model); this.database = database; this.cellFactory = cellFactory; this.dialogService = dialogService; Node headerGraphic = IconTheme.JabRefIcons.WWW.getGraphicNode(); Tooltip.install(headerGraphic, new Tooltip(Localization.lang("Linked identifiers"))); this.setGraphic(headerGraphic); this.getStyleClass().add(MainTableColumnFactory.STYLE_ICON_COLUMN); MainTableColumnFactory.setExactWidth(this, ColumnPreferences.ICON_COLUMN_WIDTH); this.setResizable(false); this.setCellValueFactory(cellData -> cellData.getValue().getLinkedIdentifiers()); new ValueTableCellFactory<BibEntryTableViewModel, Map<Field, String>>() .withGraphic(values -> createIdentifierGraphic(values)) .withTooltip(this::createIdentifierTooltip) .withMenu(this::createIdentifierMenu) .withOnMouseClickedEvent((entry, linkedFiles) -> event -> { if ((event.getButton() == MouseButton.PRIMARY) && (linkedFiles.size() == 1)) { try { for (Field field : linkedFiles.keySet()) { JabRefDesktop.openExternalViewer(database, linkedFiles.get(field), field); } } catch (IOException e) { dialogService.showErrorDialogAndWait(Localization.lang("Unable to open link."), e); } } }) .install(this); }

Target:
public LinkedIdentifierColumn(MainTableColumnModel model, CellFactory cellFactory, BibDatabaseContext database, DialogService dialogService) { super(model); this.database = database; this.cellFactory = cellFactory; this.dialogService = dialogService; Node headerGraphic = IconTheme.JabRefIcons.WWW.getGraphicNode(); Tooltip.install(headerGraphic, new Tooltip(Localization.lang("Linked identifiers"))); this.setGraphic(headerGraphic); this.getStyleClass().add(MainTableColumnFactory.STYLE_ICON_COLUMN); MainTableColumnFactory.setExactWidth(this, ColumnPreferences.ICON_COLUMN_WIDTH); this.setResizable(false); this.setCellValueFactory(cellData -> cellData.getValue().getLinkedIdentifiers()); new ValueTableCellFactory<BibEntryTableViewModel, Map<Field, String>>() .withGraphic(this::createIdentifierGraphic) .withTooltip(this::createIdentifierTooltip) .withMenu(this::createIdentifierMenu) .withOnMouseClickedEvent((entry, linkedFiles) -> event -> { if ((event.getButton() == MouseButton.PRIMARY) && (linkedFiles.size() == 1)) { try { for (Field field : linkedFiles.keySet()) { JabRefDesktop.openExternalViewer(database, linkedFiles.get(field), field); } } catch (IOException e) { dialogService.showErrorDialogAndWait(Localization.lang("Unable to open link."), e); } } }) .install(this); }
Source:
void test(DataSource dataSource) throws SQLException { Connection connection = null; try { connection = dataSource.getConnection(); } }

Target:
void test(DataSource dataSource) throws SQLException { Connection connection = null; try { connection = dataSource.getConnection(); } catch (Exception ex) { ex.printStackTrace(); } }
Source:
static MessageNano createFromParcel(Parcel in) { String className = in.readString(); byte[] data = in.createByteArray(); MessageNano proto = null; try { Class<?> clazz = Class.forName(className); Object instance = clazz.newInstance(); proto = (MessageNano) instance; MessageNano.mergeFrom(proto, data); } catch (ClassNotFoundException e) { Log.e(TAG, "Exception trying to create proto from parcel", e); } catch (IllegalAccessException e) { Log.e(TAG, "Exception trying to create proto from parcel", e); } catch (InstantiationException e) { Log.e(TAG, "Exception trying to create proto from parcel", e); } catch (InvalidProtocolBufferNanoException e) { Log.e(TAG, "Exception trying to create proto from parcel", e); } return proto; }

Target:
static <T extends MessageNano> T createFromParcel(Parcel in) { String className = in.readString(); byte[] data = in.createByteArray(); MessageNano proto = null; try { Class<?> clazz = Class.forName(className); Object instance = clazz.newInstance(); proto = (MessageNano) instance; MessageNano.mergeFrom(proto, data); } catch (ClassNotFoundException e) { Log.e(TAG, "Exception trying to create proto from parcel", e); } catch (IllegalAccessException e) { Log.e(TAG, "Exception trying to create proto from parcel", e); } catch (InstantiationException e) { Log.e(TAG, "Exception trying to create proto from parcel", e); } catch (InvalidProtocolBufferNanoException e) { Log.e(TAG, "Exception trying to create proto from parcel", e); } return (T) proto; }
Source:
public TChange getChangeAtIndex(int index) { if (index < 0 || index >= this.getCount()) { throw new IndexOutOfBoundsException("index is out of range."); } return this.changes.get(index); }

Target:
public TChange getChangeAtIndex(int index) { if (index < 0 || index >= this.getCount()) { throw new IndexOutOfBoundsException( String.format("index %d is out of range [0..%d[.", index, this.getCount())); } return this.changes.get(index); }
Source:
public static TripsConfig initTripsConfig() { return new TripsConfig( config.getLong("report.trip.minimalTripDistance", 500), config.getLong("report.trip.minimalTripDuration", 300) * 1000, config.getLong("report.trip.minimalParkingDuration", 300) * 1000, config.getLong("report.trip.minimalNoDataDuration", 3600) * 1000, config.getBoolean("report.trip.useIgnition"), config.getBoolean("event.motion.processInvalidPositions")); }

Target:
public static TripsConfig initTripsConfig() { return new TripsConfig( config.getLong("report.trip.minimalTripDistance", 500), config.getLong("report.trip.minimalTripDuration", 300) * 1000, config.getLong("report.trip.minimalParkingDuration", 300) * 1000, config.getLong("report.trip.minimalNoDataDuration", 3600) * 1000, config.getBoolean("report.trip.useIgnition"), config.getBoolean("event.motion.processInvalidPositions"), config.getDouble("event.motion.speedThreshold", 0.01)); }
Source:
public boolean shouldCaptureBuildInfo(@NotNull TaskContext taskContext) { boolean shouldCaptureBuildInfo = false; if (isCaptureBuildInfo()) { shouldCaptureBuildInfo = true; } else { if (isPublishBuildInfo()) { List<? extends TaskDefinition> taskDefinitions = taskContext.getBuildContext().getRuntimeTaskDefinitions(); if (TaskDefinitionHelper.isBuildPublishTaskExists(taskDefinitions)) { shouldCaptureBuildInfo = true; resetPublishBuildInfo(); } } } return shouldCaptureBuildInfo; }

Target:
public boolean shouldCaptureBuildInfo(@NotNull TaskContext taskContext) { if (isCaptureBuildInfo()) { return true; } if (isPublishBuildInfo()) { List<? extends TaskDefinition> taskDefinitions = taskContext.getBuildContext().getRuntimeTaskDefinitions(); if (TaskDefinitionHelper.isBuildPublishTaskExists(taskDefinitions)) { resetPublishBuildInfo(); return true; } } return false; }
Source:
public ItemIterator getItems() throws SQLException { String myQuery ="SELECT item.* FROM item, communities2item WHERE " + "item.item_id=communities2item.item_id AND " + "communities2item.community_id= ? " + "AND item.in_archive='1'"; System.out.println(myQuery); TableRowIterator rows = DatabaseManager.queryTable(ourContext, "item", myQuery, getID()); return new ItemIterator(ourContext, rows); }

Target:
public ItemIterator getItems() throws SQLException { String in_archive = ""; if (DatabaseManager.isOracle() { in_archive = "item.in_archive='1'"; } else { in_archive = "item.in_archive IS TRUE"; } String myQuery ="SELECT item.* FROM item, communities2item WHERE " + "item.item_id=communities2item.item_id AND " + "communities2item.community_id= ? " + "AND " + in_archive; TableRowIterator rows = DatabaseManager.queryTable(ourContext, "item", myQuery, getID()); return new ItemIterator(ourContext, rows); }
Source:
public void setDefaultValues(final Map<String, String> details) { this.protocol = details.get(Params.PROTOCOL.name()) == null ? Protocol.OSPF : Protocol.valueOf(details.get(Params.PROTOCOL.name())); this.ospfArea = details.get(Params.AREA.name()) == null ? "0" : details.get(Params.AREA.name()); this.helloInterval = Short.valueOf(details.get(Params.HELLO_INTERVAL.name()) == null ? "10" : details.get(Params.HELLO_INTERVAL.name())); this.deadInterval = Short.valueOf(details.get(Params.DEAD_INTERVAL.name()) == null ? "40" : details.get(Params.DEAD_INTERVAL.name())); this.retransmitInterval = Short.valueOf(details.get(Params.RETRANSMIT_INTERVAL.name()) == null ? "5" : details.get(Params.RETRANSMIT_INTERVAL.name())); this.transitDelay = Short.valueOf(details.get(Params.TRANSIT_DELAY.name()) == null ? "1" : details.get(Params.TRANSIT_DELAY.name())); this.authentication = details.get(Params.AUTHENTICATION.name()) == null ? Authentication.MD5 : Authentication.valueOf(details.get(Params.AUTHENTICATION.name())); this.password = details.get(Params.PASSWORD.name()) == null ? "" : details.get(Params.PASSWORD.name()); String cidr_list = details.get(Params.SUPER_CIDR.name()) == null ? "200.100.0.0/20" : details.get(Params.SUPER_CIDR.name()); this.superCIDRList = cidr_list.split(","); this.enabled = details.get(Params.ENABLED.name()) == null ? Boolean.FALSE : Boolean.valueOf(details.get(Params.ENABLED.name())); }

Target:
public void setDefaultValues(final Map<String, String> details) throws BadCIDRException { this.protocol = details.get(Params.PROTOCOL.name()) == null ? Protocol.OSPF : Protocol.valueOf(details.get(Params.PROTOCOL.name())); this.ospfArea = details.get(Params.AREA.name()) == null ? "0" : details.get(Params.AREA.name()); this.helloInterval = Short.valueOf(details.get(Params.HELLO_INTERVAL.name()) == null ? "10" : details.get(Params.HELLO_INTERVAL.name())); this.deadInterval = Short.valueOf(details.get(Params.DEAD_INTERVAL.name()) == null ? "40" : details.get(Params.DEAD_INTERVAL.name())); this.retransmitInterval = Short.valueOf(details.get(Params.RETRANSMIT_INTERVAL.name()) == null ? "5" : details.get(Params.RETRANSMIT_INTERVAL.name())); this.transitDelay = Short.valueOf(details.get(Params.TRANSIT_DELAY.name()) == null ? "1" : details.get(Params.TRANSIT_DELAY.name())); this.authentication = details.get(Params.AUTHENTICATION.name()) == null ? Authentication.MD5 : Authentication.valueOf(details.get(Params.AUTHENTICATION.name())); this.password = details.get(Params.PASSWORD.name()) == null ? "" : details.get(Params.PASSWORD.name()); this.superCIDRList = details.get(Params.SUPER_CIDR.name()) == null ? new CIDR[0] : NetUtils.convertToCIDR(details.get(Params.SUPER_CIDR.name()).split(",")); this.enabled = details.get(Params.ENABLED.name()) == null ? Boolean.FALSE : Boolean.valueOf(details.get(Params.ENABLED.name())); }
Source:
public void tearDown() throws Exception { if (mRef != null) { mRef.removeValue(); } if (mArray != null) { mArray.cleanup(); } }

Target:
public void tearDown() throws Exception { if (mRef != null) { mRef.getRoot().removeValue(); } if (mArray != null) { mArray.cleanup(); } }
Source:
protected AbstractArtifactoryConfiguration(String builderContextPrefix, @Nullable String capabilityPrefix) { serverConfigManager = ServerConfigManager.getInstance(); if (administrationConfiguration == null) { administrationConfiguration = (AdministrationConfiguration) ContainerManager.getComponent("administrationConfiguration"); } this.builderContextPrefix = builderContextPrefix; this.capabilityPrefix = capabilityPrefix; this.taskConfiguratorHelper = new TaskConfiguratorHelperImpl(); }

Target:
protected AbstractArtifactoryConfiguration(String builderContextPrefix, @Nullable String capabilityPrefix) { serverConfigManager = ServerConfigManager.getInstance(); if (administrationConfiguration == null) { administrationConfiguration = (AdministrationConfiguration) ContainerManager.getComponent("administrationConfiguration"); } this.builderContextPrefix = builderContextPrefix; this.capabilityPrefix = capabilityPrefix; }
Source:
public Map<String, Object> getSpecificEventStyle(ITimeEvent event) { if (event instanceof MarkerEvent) { MarkerEvent markerEvent = (MarkerEvent) event; if(markerEvent.getValue() == 1) { Map<String, Object> ret = new HashMap<>(); ret.put(ITimeEventStyleStrings.fillColor(), RGBAUtil.fromRGBA(markerEvent.getColor())); ret.put(ITimeEventStyleStrings.fillStyle(), "diamond"); ret.put(ITimeEventStyleStrings.label(), markerEvent.getLabel()); return ret; } } return super.getSpecificEventStyle(event); }

Target:
public Map<String, Object> getSpecificEventStyle(ITimeEvent event) { if (event instanceof SpanMarkerEvent) { SpanMarkerEvent markerEvent = (SpanMarkerEvent) event; Map<String, Object> ret = new HashMap<>(); ret.put(ITimeEventStyleStrings.fillColor(), RGBAUtil.fromRGBA(markerEvent.getColor())); String type = markerEvent.getType(); String fillStyle = ITimeEventStyleStrings.symbolStyle(); if (type.contains(ERROR_KIND)) { ret.put(fillStyle, IYAppearance.SymbolStyle.PLUS); } else if (type.contains(ERROR_OBJECT)) { ret.put(fillStyle, IYAppearance.SymbolStyle.CROSS); } else if (type.contains(EVENT)) { ret.put(fillStyle, IYAppearance.SymbolStyle.CIRCLE); } else if (type.contains(MESSAGE)) { ret.put(fillStyle, IYAppearance.SymbolStyle.TRIANGLE); } else if (type.contains(STACK)) { ret.put(fillStyle, IYAppearance.SymbolStyle.INVERTED_TRIANGLE); } else { ret.put(fillStyle, IYAppearance.SymbolStyle.DIAMOND); } ret.put(ITimeEventStyleStrings.heightFactor(), 0.5f); ret.put(ITimeEventStyleStrings.label(), markerEvent.getLabel()); return ret; } return super.getSpecificEventStyle(event); }
Source:
public Set<File> findConfigurableLocations(File root, IProgressMonitor monitor) { Set<File> projectFiles = new HashSet<>(); Set<String> visitedDirectories = new HashSet<>(); WizardProjectsImportPage.collectProjectFilesFromDirectory(projectFiles, root, visitedDirectories, true, monitor); Set<File> res = new HashSet<>(); for (File projectFile : projectFiles) { res.add(projectFile.getParentFile()); } return res; }

Target:
public Set<File> findConfigurableLocations(File root, IProgressMonitor monitor) { Set<File> projectFiles = new LinkedHashSet<>(); Set<String> visitedDirectories = new LinkedHashSet<>(); WizardProjectsImportPage.collectProjectFilesFromDirectory(projectFiles, root, visitedDirectories, true, monitor); Set<File> res = new HashSet<>(); for (File projectFile : projectFiles) { res.add(projectFile.getParentFile()); } return res; }
Source:
protected void onLoad() { if (fetch == null) { RestApi call = ChangeApi.detail(changeId.get()); ChangeList.addOptions(call, EnumSet.of(ListChangesOption.ALL_REVISIONS, ListChangesOption.DOWNLOAD_COMMANDS)); call.get(new AsyncCallback<ChangeInfo>() { @Override public void onSuccess(ChangeInfo result) { fetch = result.revision(revision).fetch(); renderScheme(); } @Override public void onFailure(Throwable caught) { } }); } }

Target:
protected void onLoad() { if (fetch == null) { RestApi call = ChangeApi.detail(change.legacy_id().get()); ChangeList.addOptions(call, EnumSet.of( revision.equals(change.current_revision()) ? ListChangesOption.CURRENT_REVISION : ListChangesOption.ALL_REVISIONS, ListChangesOption.DOWNLOAD_COMMANDS)); call.get(new AsyncCallback<ChangeInfo>() { @Override public void onSuccess(ChangeInfo result) { fetch = result.revision(revision).fetch(); renderScheme(); } @Override public void onFailure(Throwable caught) { } }); } }
Source:
public synchronized MembersOrderPreferenceCache getMemberOrderPreferenceCache() { if (fMembersOrderPreferenceCache == null) { try { fMembersOrderPreferenceCache = fMembersOrderPreferenceCachePromise.getValue(); } catch (InvocationTargetException e) { log(e); e.printStackTrace(); } catch (InterruptedException e) { log(e); e.printStackTrace(); } } return fMembersOrderPreferenceCache; }

Target:
public synchronized MembersOrderPreferenceCache getMemberOrderPreferenceCache() { if (fMembersOrderPreferenceCache == null) { try { fMembersOrderPreferenceCache = fMembersOrderPreferenceCachePromise.getValue(); } catch (InvocationTargetException e) { log(e); } catch (InterruptedException e) { log(e); } } return fMembersOrderPreferenceCache; }
Source:
public void onActivityResult(final int requestCode, final int resultCode, final Intent data) { if (requestCode == AuthenticationConstants.UIRequest.BROWSER_FLOW) { if (data == null) { Logger.e(TAG, "onActivityResult BROWSER_FLOW data is null.", "", ADALError.ON_ACTIVITY_RESULT_INTENT_NULL); return; } AuthenticationRequestState waitingRequest; final Bundle extras = data.getExtras(); final int requestId = extras.getInt(AuthenticationConstants.Browser.REQUEST_ID); synchronized (mDelegateMap) { waitingRequest = mDelegateMap.get(requestId); } if (waitingRequest != null) { final AcquireTokenRequest acquireTokenRequest = new AcquireTokenRequest(mContext, this, waitingRequest.getAPIEvent()); acquireTokenRequest.onActivityResult(requestCode, resultCode, data); } else { Logger.e(TAG, "onActivityResult did not find waiting request for RequestId:" + requestId, "", ADALError.ON_ACTIVITY_RESULT_INTENT_NULL); } } }

Target:
public void onActivityResult(final int requestCode, final int resultCode, final Intent data) { if (requestCode == AuthenticationConstants.UIRequest.BROWSER_FLOW) { if (data == null) { Logger.e(TAG, "onActivityResult BROWSER_FLOW data is null.", "", ADALError.ON_ACTIVITY_RESULT_INTENT_NULL); return; } AuthenticationRequestState waitingRequest; final Bundle extras = data.getExtras(); final int requestId = extras.getInt(AuthenticationConstants.Browser.REQUEST_ID); synchronized (DELEGATE_MAP) { waitingRequest = DELEGATE_MAP.get(requestId); } if (waitingRequest != null) { final AcquireTokenRequest acquireTokenRequest = new AcquireTokenRequest(mContext, this, waitingRequest.getAPIEvent()); acquireTokenRequest.onActivityResult(requestCode, resultCode, data); } else { Logger.e(TAG, "onActivityResult did not find waiting request for RequestId:" + requestId, "", ADALError.ON_ACTIVITY_RESULT_INTENT_NULL); } } }
Source:
protected void saveTableOrdering() { Logger.debug(this, "saveTableOrdering"); ((DraggableEditableCardsAdapter)adapter).saveNewOrder(getTableController()); }

Target:
protected void saveTableOrdering() { Logger.debug(this, "saveTableOrdering"); adapter.saveNewOrder(getTableController()); }
Source:
Connection newConnection() throws Exception { Connection connection = null; try { String username = config.getUsername(); String password = config.getPassword(); connection = (username == null) ? dataSource.getConnection() : dataSource.getConnection(username, password); setupConnection(connection); return connection; } catch (Exception e) { lastConnectionFailure.set(e); quietlyCloseConnection(connection, "(exception during connection creation)"); throw e; } }

Target:
Connection newConnection() throws Exception { Connection connection = null; try { String username = config.getUsername(); String password = config.getPassword(); connection = (username == null) ? dataSource.getConnection() : dataSource.getConnection(username, password); setupConnection(connection); lastConnectionFailure.set(null); return connection; } catch (Exception e) { lastConnectionFailure.set(e); String reason = e.getMessage(); quietlyCloseConnection(connection, reason != null ? reason : "(Failed to create/set connection)"); throw e; } }
Source:
public int compareTo(BendableBigDecimalScore other) { validateCompatible(other); if (initScore != other.getInitScore()) { return initScore < other.getInitScore() ? -1 : 1; } for (int i = 0; i < hardScores.length; i++) { int hardScoreComparison = hardScores[i].compareTo(other.getHardScore(i)); if (hardScoreComparison != 0) { return hardScoreComparison; } } for (int i = 0; i < softScores.length; i++) { int softScoreComparison = softScores[i].compareTo(other.getSoftScore(i)); if (softScoreComparison != 0) { return softScoreComparison; } } return 0; }

Target:
public int compareTo(BendableBigDecimalScore other) { validateCompatible(other); if (initScore != other.getInitScore()) { return Integer.compare(initScore, other.getInitScore()); } for (int i = 0; i < hardScores.length; i++) { int hardScoreComparison = hardScores[i].compareTo(other.getHardScore(i)); if (hardScoreComparison != 0) { return hardScoreComparison; } } for (int i = 0; i < softScores.length; i++) { int softScoreComparison = softScores[i].compareTo(other.getSoftScore(i)); if (softScoreComparison != 0) { return softScoreComparison; } } return 0; }
Source:
public final void testUnionAll1() throws Exception { Optional<TajoResultSetBase[]> existing = runSimpleTests(); assertTrue(existing.isPresent()); TajoResultSetBase[] resultSet = existing.get(); QueryId qid = resultSet[0].getQueryId(); QueryInfo queryInfo = testingCluster.getMaster().getContext().getQueryJobManager().getFinishedQuery(qid); TableDesc desc = queryInfo.getResultDesc(); TableStats stats = desc.getStats(); assertEquals(8L, stats.getNumRows().longValue()); assertEquals(96L, stats.getNumBytes().longValue()); }

Target:
public final void testUnionAll1() throws Exception { Optional<TajoResultSetBase[]> existing = runSimpleTests(); verifyResultStats(existing, 8L); }
Source:
public HotPlugDiskToVmCommand(T parameters) { super(parameters); disk = getDiskDao().get(getParameters().getDiskId()); }

Target:
public HotPlugDiskToVmCommand(T parameters) { super(parameters); }
Source:
private void sendLogOut(String pmsId) { String pmsIp = pmsIpConfig.get(pmsId); String url = "http://"+pmsIp; try { URL obj = new URL(url); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestProperty("User-Agent", USER_AGENT); con.setRequestMethod("GET"); int responseCode = con.getResponseCode(); BufferedReader in = new BufferedReader( new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); logger.trace("energenie: responseCode : {}", responseCode); logger.trace("energenie: logout from ip {}", pmsIp); } catch (Exception e) { logger.error("energenie: failed to logout from ip {}", pmsIp); } }

Target:
private void sendLogOut(String pmsId) { String pmsIp = pmsIpConfig.get(pmsId); String url = "http://"+pmsIp; try { HttpUtil.executeUrl("POST", url, timeout); logger.trace("logout from ip {}", pmsIp); } catch (Exception e) { logger.error("failed to logout from ip {}", pmsIp); } }
Source:
protected void installLooseConfigWar(MavenProject proj, LooseConfigData config) throws Exception { File dir = new File(proj.getBuild().getOutputDirectory()); if (!dir.exists() && containsJavaSource(proj)) { throw new MojoExecutionException( MessageFormat.format(messages.getString("error.project.not.compile"), proj.getId())); } LooseWarApplication looseWar = new LooseWarApplication(proj, config); looseWar.addSourceDir(proj); looseWar.addOutputDir(looseWar.getDocumentRoot(), new File(proj.getBuild().getOutputDirectory()), "/WEB-INF/classes"); String webResources[] = MavenProjectUtil.getPluginConfiguration(proj, "org.apache.maven.plugins", "maven-war-plugin", "webResources", "resource", "directory"); for (int i = 0; i < webResources.length; i++) { looseWar.addOutputDir(looseWar.getDocumentRoot(), new File(proj.getBasedir().getAbsolutePath(), webResources[i]), "/"); } addEmbeddedLib(looseWar.getDocumentRoot(), proj, looseWar, "/WEB-INF/lib/"); File manifestFile = MavenProjectUtil.getManifestFile(proj, "maven-war-plugin"); looseWar.addManifestFile(manifestFile); }

Target:
protected void installLooseConfigWar(MavenProject proj, LooseConfigData config) throws Exception { File dir = new File(proj.getBuild().getOutputDirectory()); if (!dir.exists() && containsJavaSource(proj)) { throw new MojoExecutionException( MessageFormat.format(messages.getString("error.project.not.compile"), proj.getId())); } LooseWarApplication looseWar = new LooseWarApplication(proj, config); looseWar.addSourceDir(proj); looseWar.addOutputDir(looseWar.getDocumentRoot(), new File(proj.getBuild().getOutputDirectory()), "/WEB-INF/classes"); String webResources[] = MavenProjectUtil.getPluginConfiguration(proj, "org.apache.maven.plugins", "maven-war-plugin", "webResources", "resource", "directory"); if (webResources != null) { for (int i = 0; i < webResources.length; i++) { looseWar.addOutputDir(looseWar.getDocumentRoot(), new File(proj.getBasedir().getAbsolutePath(), webResources[i]), "/"); } } addEmbeddedLib(looseWar.getDocumentRoot(), proj, looseWar, "/WEB-INF/lib/"); File manifestFile = MavenProjectUtil.getManifestFile(proj, "maven-war-plugin"); looseWar.addManifestFile(manifestFile); }
Source:
public void decrementRemainFiles(FadvisedFileRegion filePart, long fileStartTime) { synchronized(remainFiles) { long fileSendTime = System.currentTimeMillis() - fileStartTime; if (fileSendTime > 20 * 1000) { LOG.info("PullServer send too long time: filePos=" + filePart.getPosition() + ", fileLen=" + filePart.getCount()); numSlowFile++; } if (fileSendTime > maxTime) { maxTime = fileSendTime; } if (fileSendTime < minTime) { minTime = fileSendTime; } int remain = remainFiles.decrementAndGet(); if (remain <= 0) { synchronized(processingStatusMap) { processingStatusMap.remove(requestUri); } LOG.info("PullServer processing status: totalTime=" + (System.currentTimeMillis() - startTime) + " ms, " + "makeFileListTime=" + makeFileListTime + " ms, minTime=" + minTime + " ms, maxTime=" + maxTime + " ms, " + "numFiles=" + numFiles + ", numSlowFile=" + numSlowFile); } } }

Target:
public void decrementRemainFiles(FadvisedFileRegion filePart, long fileStartTime) { synchronized(remainFiles) { long fileSendTime = System.currentTimeMillis() - fileStartTime; if (fileSendTime > 20 * 1000) { LOG.info("PullServer send too long time: filePos=" + filePart.getPosition() + ", fileLen=" + filePart.getCount()); numSlowFile++; } if (fileSendTime > maxTime) { maxTime = fileSendTime; } if (fileSendTime < minTime) { minTime = fileSendTime; } int remain = remainFiles.decrementAndGet(); if (remain <= 0) { processingStatusMap.remove(requestUri); LOG.info("PullServer processing status: totalTime=" + (System.currentTimeMillis() - startTime) + " ms, " + "makeFileListTime=" + makeFileListTime + " ms, minTime=" + minTime + " ms, maxTime=" + maxTime + " ms, " + "numFiles=" + numFiles + ", numSlowFile=" + numSlowFile); } } }
Source:
public JUnitResultAssert fails(Class expectedException, String exceptionMessage) { fails(1, expectedException); Failure f = result.getFailures().iterator().next(); assertEquals(filterLineNo(exceptionMessage), filterLineNo(f.getException().getMessage())); return this; }

Target:
public JUnitResultAssert fails(Class expectedException, String exceptionMessage) { fails(1, expectedException); Failure f = firstOf(result.getFailures()); assertEquals(filterLineNo(exceptionMessage), filterLineNo(f.getException().getMessage())); return this; }
Source:
public static Optional<HiveBucketProperty> fromStorageDescriptor(StorageDescriptor storageDescriptor, String tablePartitionName) { boolean bucketColsSet = storageDescriptor.isSetBucketCols() && !storageDescriptor.getBucketCols().isEmpty(); boolean numBucketsSet = storageDescriptor.isSetNumBuckets() && storageDescriptor.getNumBuckets() > 0; if (!numBucketsSet) { return Optional.empty(); } if (!bucketColsSet) { throw new PrestoException(HIVE_INVALID_METADATA, "Table/partition metadata has 'numBuckets' set, but 'bucketCols' is not set: " + tablePartitionName); } checkState( storageDescriptor.getSortCols().stream().allMatch(sortCol -> sortCol.getOrder() == 1 || sortCol.getOrder() == 0), "Expect only 0 or 1 for elements of sortCols in storageDescriptor"); List<HiveSortOrder> sortedBy = storageDescriptor.getSortCols().stream() .map(sortCol -> new HiveSortOrder(sortCol.getCol(), sortCol.getOrder() == 1 ? ASCENDING : DESCENDING)) .collect(toImmutableList()); return Optional.of(new HiveBucketProperty(storageDescriptor.getBucketCols(), storageDescriptor.getNumBuckets(), sortedBy)); }

Target:
public static Optional<HiveBucketProperty> fromStorageDescriptor(StorageDescriptor storageDescriptor, String tablePartitionName) { boolean bucketColsSet = storageDescriptor.isSetBucketCols() && !storageDescriptor.getBucketCols().isEmpty(); boolean numBucketsSet = storageDescriptor.isSetNumBuckets() && storageDescriptor.getNumBuckets() > 0; if (!numBucketsSet) { return Optional.empty(); } if (!bucketColsSet) { throw new PrestoException(HIVE_INVALID_METADATA, "Table/partition metadata has 'numBuckets' set, but 'bucketCols' is not set: " + tablePartitionName); } checkState( storageDescriptor.getSortCols().stream().allMatch(sortCol -> sortCol.getOrder() == 1 || sortCol.getOrder() == 0), "Order in sorting columns can only be 0 or 1"); List<HiveSortOrder> sortedBy = storageDescriptor.getSortCols().stream() .map(sortCol -> new HiveSortOrder(sortCol.getCol(), sortCol.getOrder() == 1 ? ASCENDING : DESCENDING)) .collect(toImmutableList()); return Optional.of(new HiveBucketProperty(storageDescriptor.getBucketCols(), storageDescriptor.getNumBuckets(), sortedBy)); }
Source:
public void onMessage(WebSocketTextMessage textMessage) { if ("ping".equals(textMessage.getText())) { try { textMessage.getChannelSession().getBasicRemote().sendPing(ByteBuffer.wrap(new byte[]{1, 2, 3, 4, 5})); } catch (IOException e) { errorsQueue.add(e); } } textQueue.add(textMessage.getText()); latch.countDown(); }

Target:
public void onMessage(WebSocketTextMessage textMessage) { if (PING.equals(textMessage.getText())) { try { textMessage.getChannelSession().getBasicRemote().sendPing(ByteBuffer.wrap(new byte[]{1, 2, 3, 4, 5})); } catch (IOException e) { errorsQueue.add(e); } } textQueue.add(textMessage.getText()); latch.countDown(); }
Source:
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException { try { vlanMgr.deleteRct(this); SuccessResponse response = new SuccessResponse(getCommandName()); setResponseObject(response); } catch (Exception e) { s_logger.warn(String.format("unable to delete baremetal RCT[%s]", getId()), e); throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage()); } }

Target:
public void execute() throws ResourceUnavailableException, InsufficientCapacityException, ServerApiException, ConcurrentOperationException, ResourceAllocationException, NetworkRuleConflictException { try { vlanMgr.deleteRct(this); SuccessResponse response = new SuccessResponse(getCommandName()); setResponseObject(response); } catch (Exception e) { s_logger.warn(String.format("unable to delete baremetal RCT[%s]", getId()), e); throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, e.getMessage(), e); } }
Source:
public void clickStartNewWiki(){ startNewWikiButton.click(); }

Target:
public CreateNewWikiPageObjectStep1 clickStartNewWiki(){ startNewWikiButton.click(); return new CreateNewWikiPageObjectStep1(driver); }
Source:
private PaymentWithAllLinks aSuccessfullyCreatedPayment() { final Address cardholderAddress = new Address("123 Acacia Ave", "", "", "London", "GB"); return new PaymentWithAllLinks( "abc123", 100L, new PaymentState("created", false), "<LINK_0>", "New Passport", "my_ref", "made.up@example.com", "sandbox", "2018-01-01T11:12:13Z", SupportedLanguage.ENGLISH, false, new RefundSummary(), new SettlementSummary(), new CardDetails("9876", "482393", "Anne Onymous", "12/20", cardholderAddress, "visa"), Collections.emptyList(), URI.create(paymentUri), URI.create(paymentUri + "/events"), URI.create(paymentUri + "/cancel"), URI.create(paymentUri + "/refunds"), null, null, null ); }

Target:
private PaymentWithAllLinks aSuccessfullyCreatedPayment() { final Address cardholderAddress = new Address("123 Acacia Ave", "", "", "London", "GB"); return new PaymentWithAllLinks( "abc123", 100L, new PaymentState("created", false), "<LINK_0>", "New Passport", "my_ref", "made.up@example.com", "sandbox", "2018-01-01T11:12:13Z", SupportedLanguage.ENGLISH, false, new RefundSummary(), new SettlementSummary(), new CardDetails("9876", "482393", "Anne Onymous", "12/20", cardholderAddress, "visa"), Collections.emptyList(), URI.create(paymentUri), URI.create(paymentUri + "/events"), URI.create(paymentUri + "/cancel"), URI.create(paymentUri + "/refunds"), URI.create(paymentUri + "/capture"), null, null ); }
Source:
public void subscribe(String topic, FAsyncCallback callback) throws TException { if (conn.getStatus() != Status.CONNECTED) { throw new TTransportException(TTransportExceptionType.NOT_OPEN, "NATS not connected, has status " + conn.getStatus()); } subject = topic; if ("".equals(subject)) { throw new TTransportException("Subject cannot be empty."); } dispatcher = conn.createDispatcher(msg -> { if (msg.getData().length < 4) { LOGGER.warn("discarding invalid scope message frame"); return; } try { callback.onMessage( new TMemoryInputTransport(Arrays.copyOfRange(msg.getData(), 4, msg.getData().length)) ); } catch (TException ignored) { } }); if (queue.equals("")) { dispatcher.subscribe(getFormattedSubject()); } else { dispatcher.subscribe(getFormattedSubject(), queue); } }

Target:
public void subscribe(String topic, FAsyncCallback callback) throws TException { if (conn.getStatus() != Status.CONNECTED) { throw new TTransportException(TTransportExceptionType.NOT_OPEN, "NATS not connected, has status " + conn.getStatus()); } subject = topic; if ("".equals(subject)) { throw new TTransportException("Subject cannot be empty."); } dispatcher = conn.createDispatcher(msg -> { if (msg.getData().length < 4) { LOGGER.warn("discarding invalid scope message frame"); return; } try { callback.onMessage( new TMemoryInputTransport(Arrays.copyOfRange(msg.getData(), 4, msg.getData().length)) ); } catch (TException ignored) { } }); if (queue != null && !queue.isEmpty()) { dispatcher.subscribe(getFormattedSubject(), queue); } else { dispatcher.subscribe(getFormattedSubject()); } }
Source:
void assertValidUserFields(UserDto userResource, UserPurpose userPurpose) { if (StringUtils.isBlank(userResource.getFirstName())) { throw InvalidDataException.blankFirstName(); } if (StringUtils.isBlank(userResource.getLastName())) { throw InvalidDataException.blankLastName(); } if (userPurpose == UserPurpose.USER && StringUtils.isBlank(userResource.getPrivateData().getNickname())) { throw InvalidDataException.blankNickname(); } if (StringUtils.isBlank(userResource.getMobileNumber())) { throw InvalidDataException.blankMobileNumber(); } assertValidMobileNumber(userResource.getMobileNumber()); if (userPurpose == UserPurpose.BUDDY) { if (StringUtils.isBlank(userResource.getEmailAddress())) { throw InvalidDataException.blankEmailAddress(); } assertValidEmailAddress(userResource.getEmailAddress()); } }

Target:
void assertValidUserFields(UserDto userResource, UserPurpose userPurpose) { if (StringUtils.isBlank(userResource.getFirstName())) { throw InvalidDataException.blankFirstName(); } if (StringUtils.isBlank(userResource.getLastName())) { throw InvalidDataException.blankLastName(); } if (userPurpose == UserPurpose.USER && StringUtils.isBlank(userResource.getPrivateData().getNickname())) { throw InvalidDataException.blankNickname(); } if (StringUtils.isBlank(userResource.getMobileNumber())) { throw InvalidDataException.blankMobileNumber(); } assertValidMobileNumber(userResource.getMobileNumber()); if (userPurpose == UserPurpose.BUDDY) { if (StringUtils.isBlank(userResource.getEmailAddress())) { throw InvalidDataException.blankEmailAddress(); } assertValidEmailAddress(userResource.getEmailAddress()); } else { if (!StringUtils.isBlank(userResource.getEmailAddress())) { throw InvalidDataException.excessEmailAddress(); } } }
Source:
public void testPutDictionaryFile() throws Exception { final File file = new File("src/test/resources/testdictionary"); final MockMultipartFile multipartFile = new MockMultipartFile("file", "testDictionary", "text/plain", new FileInputStream(file)); final MvcResult mvcResult = _mockMvc.perform( fileUpload("/test/referencedata/dictionary/testDictionary").file(multipartFile).with(withPut()) .contentType(MediaType.MULTIPART_FORM_DATA).param("casesensitive", "false")).andExpect(status().isCreated()).andExpect( header().string("Location", is("http://localhost/test/referencedata/dictionary/testDictionary"))) .andReturn(); final String location = mvcResult.getResponse().getHeader("Location"); _mockMvc.perform(get(location)).andExpect(status().isOk()).andExpect(jsonPath("$.name", is("testDictionary"))) .andExpect(jsonPath("$.entries", hasSize(3))).andExpect(jsonPath("$.entries[2]", is("baz"))) .andExpect(jsonPath("$.caseSensitive", is(false))); }

Target:
public void testPutDictionaryFile() throws Exception { final byte[] bytes = Files.readAllBytes(Paths.get("src/test/resources/testdictionary")); final MvcResult mvcResult = _mockMvc.perform( put("/test/referencedata/dictionary/testDictionary").content(bytes).param("casesensitive", "false")) .andExpect(status().isCreated()).andExpect(header().string("Location", is("http://localhost/test/referencedata/dictionary/testDictionary"))).andReturn(); final String location = mvcResult.getResponse().getHeader("Location"); _mockMvc.perform(get(location)).andExpect(status().isOk()).andExpect(jsonPath("$.name", is("testDictionary"))) .andExpect(jsonPath("$.entries", hasSize(3))).andExpect(jsonPath("$.entries[2]", is("baz"))) .andExpect(jsonPath("$.caseSensitive", is(false))); }
Source:
private static Supplier<ClientRegistration.Builder> getRfc8414Builder(URI issuer, URI uri) { return () -> { RequestEntity<Void> request = RequestEntity.get(uri).build(); Map<String, Object> configuration = rest.exchange(request, typeReference).getBody(); AuthorizationServerMetadata metadata = parse(configuration, AuthorizationServerMetadata::parse); ClientRegistration.Builder builder = withProviderConfiguration(metadata, issuer.toASCIIString()) .jwkSetUri(metadata.getJWKSetURI() != null ? metadata.getJWKSetURI().toASCIIString() : null); String userinfoEndpoint = (String) configuration.get("userinfo_endpoint"); if (userinfoEndpoint != null) { builder.userInfoUri(userinfoEndpoint); } return builder; }; }

Target:
private static Supplier<ClientRegistration.Builder> getRfc8414Builder(URI issuer, URI uri) { return () -> { RequestEntity<Void> request = RequestEntity.get(uri).build(); Map<String, Object> configuration = rest.exchange(request, typeReference).getBody(); AuthorizationServerMetadata metadata = parse(configuration, AuthorizationServerMetadata::parse); ClientRegistration.Builder builder = withProviderConfiguration(metadata, issuer.toASCIIString()); URI jwkSetUri = metadata.getJWKSetURI(); if (jwkSetUri != null) { builder.jwkSetUri(jwkSetUri.toASCIIString()); } String userinfoEndpoint = (String) configuration.get("userinfo_endpoint"); if (userinfoEndpoint != null) { builder.userInfoUri(userinfoEndpoint); } return builder; }; }
Source:
public void askForFile(Controller controller, final FileChooserListener listener) { Gdx.input.getTextInput(new TextInputListener() { @Override public void input(final String text) { Gdx.app.postRunnable(new Runnable() { @Override public void run() { listener.fileChosen(text, null); } }); } @Override public void canceled() { } }, "File path!", "", ""); }

Target:
public void askForFile(Controller controller, final FileChooserListener listener) { Gdx.input.getTextInput(new TextInputListener() { @Override public void input(final String text) { Gdx.app.postRunnable(new Runnable() { @Override public void run() { listener.fileChosen(text, FileChooserListener.Result.SUCCESS); } }); } @Override public void canceled() { } }, "File path!", "", ""); }
Source:
private EntryPoint toEntryPoint(MachineConfig machineConfig) throws WorkspaceExportException { try { EntryPointParser entryPointParser = new EntryPointParser(); return entryPointParser.parse(machineConfig.getAttributes()); } catch (InfrastructureException e) { throw new WorkspaceExportException(e.getMessage()); } }

Target:
private EntryPoint toEntryPoint(MachineConfig machineConfig) throws WorkspaceExportException { try { return entryPointParser.parse(machineConfig.getAttributes()); } catch (InfrastructureException e) { throw new WorkspaceExportException(e.getMessage()); } }
Source:
public CodeModelGenerator(Filer filer, String aaVersion) { this.filer = filer; this.header = "DO NOT EDIT THIS FILE, IT HAS BEEN GENERATED USING AndroidAnnotations " + aaVersion + ".\n " + "You can create a larger work that contains this file and distribute that work under terms of your choice.\n"; }

Target:
public CodeModelGenerator(Filer filer, String aaVersion) { this.filer = filer; this.header = "DO NOT EDIT THIS FILE." + "Generated using AndroidAnnotations " + aaVersion + ".\n " + "You can create a larger work that contains this file and distribute that work under terms of your choice.\n"; }
Source:
public Writer(BlockFileWriter bfw, int blockSize) throws IOException { this(bfw, blockSize, (int) DefaultConfiguration.getInstance().getAsBytes(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE_INDEX), null, null); long indexBlockSize = DefaultConfiguration.getInstance().getAsBytes(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE_INDEX); if (indexBlockSize > Integer.MAX_VALUE || indexBlockSize < 0) { throw new IllegalArgumentException("table.file.compress.blocksize.index must be greater than 0 and no more than " + Integer.MAX_VALUE); } }

Target:
public Writer(BlockFileWriter bfw, int blockSize) throws IOException { this(bfw, blockSize, (int) DefaultConfiguration.getInstance().getAsBytes(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE_INDEX), null, null); }
Source:
private int[] propertyIds() { int props[] = new int[numberOfProps]; for ( int i = 0; i < numberOfProps; i++ ) { props[i] = i; } return props; }

Target:
private int[] propertyIds() { int[] props = new int[numberOfProps]; for ( int i = 0; i < numberOfProps; i++ ) { props[i] = i; } return props; }
Source:
Payload(String payloadAsString) { this.payloadAsString = payloadAsString; this.payloadAsJSONObject = JSONObject.fromObject(payloadAsString); }

Target:
Payload(String payloadAsString) { JSONObject json = JSONObject.fromObject(payloadAsString); this.payloadAsString = payloadAsString; this.taskId = json.getString("taskId"); this.taskStatus = json.getString("status"); if (CETask.STATUS_SUCCESS.equals(getTaskStatus())) { this.qualityGateStatus = json.has("qualityGate") ? json.getJSONObject("qualityGate").getString("status") : "NONE"; } else { this.qualityGateStatus = null; } }
Source:
CacheHolder(List<HRegionLocation> all) { this.all = Collections.unmodifiableList(all); NavigableMap<byte[], SortedSet<HRegionLocation>> startKeyToLocs = new TreeMap<>(Bytes.BYTES_COMPARATOR); for (HRegionLocation loc : all) { if (loc.getRegion().isSplitParent()) { continue; } startKeyToLocs.computeIfAbsent(loc.getRegion().getStartKey(), k -> new TreeSet<>((l1, l2) -> l1.getRegion().compareTo(l2.getRegion()))).add(loc); } this.cache = startKeyToLocs.entrySet().stream().collect(Collectors.collectingAndThen( Collectors.toMap(Map.Entry::getKey, e -> new RegionLocations(e.getValue()), (u, v) -> { throw new IllegalStateException(); }, () -> new TreeMap<>(Bytes.BYTES_COMPARATOR)), Collections::unmodifiableNavigableMap)); }

Target:
CacheHolder(List<HRegionLocation> all) { this.all = Collections.unmodifiableList(all); NavigableMap<byte[], SortedSet<HRegionLocation>> startKeyToLocs = new TreeMap<>(CellComparatorImpl.MetaCellComparator.ROW_COMPARATOR); for (HRegionLocation loc : all) { if (loc.getRegion().isSplitParent()) { continue; } startKeyToLocs.computeIfAbsent(loc.getRegion().getStartKey(), k -> new TreeSet<>((l1, l2) -> l1.getRegion().compareTo(l2.getRegion()))).add(loc); } this.cache = startKeyToLocs.entrySet().stream().collect(Collectors.collectingAndThen( Collectors.toMap(Map.Entry::getKey, e -> new RegionLocations(e.getValue()), (u, v) -> { throw new IllegalStateException(); }, () -> new TreeMap<>(CellComparatorImpl.MetaCellComparator.ROW_COMPARATOR)), Collections::unmodifiableNavigableMap)); }
Source:
protected void assertEventuallyStateTransferNotRunning() { eventually(() -> adminOperations().getRunningStateTransfer().isEmpty(), 30, TimeUnit.SECONDS); }

Target:
void assertEventuallyStateTransferNotRunning() { eventually(() -> adminOperations().getRunningStateTransfer().isEmpty(), 30, TimeUnit.SECONDS); }