auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void emitTuples() { if (currentWindowId <= windowDataManager.getLargestCompletedWindow()) { return; } int count = consumer.getQueueSize(); if(maxTuplesPerWindow > 0) count = Math.min(count, maxTuplesPerWindow - emitCount); for (int i = 0; i < count; i++) { Pair<String, Record> data = consumer.pollRecord(); String shardId = data.getFirst(); String recordId = data.getSecond().getSequenceNumber(); T tuple = getTuple(data.getSecond()); outputPort.emit(tuple); if(!currentWindowRecoveryState.containsKey(shardId)) { currentWindowRecoveryState.put(shardId, new MutablePair<String, Integer>(recordId, 1)); } else { MutablePair<String, Integer> second = currentWindowRecoveryState.get(shardId); Integer noOfRecords = second.getRight(); currentWindowRecoveryState.put(data.getFirst(), new MutablePair<String, Integer>(second.getLeft(), noOfRecords+1)); } shardPosition.put(shardId, recordId); } if(isReplayState) { isReplayState = false; Map<String, String> statsData = new HashMap<String, String>(getConsumer().getShardPosition()); statsData.putAll(shardPosition); getConsumer().resetShardPositions(statsData); consumer.start(); } emitCount += count; }

Target:
public void emitTuples() { if (currentWindowId <= windowDataManager.getLargestCompletedWindow()) { return; } int count = consumer.getQueueSize(); if(maxTuplesPerWindow > 0) count = Math.min(count, maxTuplesPerWindow - emitCount); for (int i = 0; i < count; i++) { Pair<String, Record> data = consumer.pollRecord(); String shardId = data.getFirst(); String recordId = data.getSecond().getSequenceNumber(); emitTuple(data); MutablePair<String, Integer> shardOffsetAndCount = currentWindowRecoveryState.get(shardId); if (shardOffsetAndCount == null) { currentWindowRecoveryState.put(shardId, new MutablePair<String, Integer>(recordId, 1)); } else { shardOffsetAndCount.setRight(shardOffsetAndCount.right+1); } shardPosition.put(shardId, recordId); } emitCount += count; }
Source:
private static Optional<FastpassData> extractFastpassData(Project project) { try { String path = project.getBasePath(); if (path != null) { Path bloopSettingsPath = Paths.get(path, ".bloop", "bloop.settings.json"); VirtualFile bloopSettings = LocalFileSystem.getInstance().findFileByIoFile(bloopSettingsPath.toFile()); if (bloopSettings != null && bloopSettings.exists()) { String content = new String(bloopSettings.contentsToByteArray()); Gson gson = new Gson(); BloopSettings settings = gson.fromJson(content, BloopSettings.class); Pattern pattern = Pattern.compile("org\\.scalameta:metals_2\\.12:(.*)"); Optional<String> version = settings.refreshProjectsCommand.stream().map(pattern::matcher).filter(Matcher::find).map(m -> m.group(1)).findFirst(); return version.map(fastpassVersion -> { String projectName = settings.refreshProjectsCommand.get(settings.refreshProjectsCommand.size() - 1); return new FastpassData(fastpassVersion, projectName); }); } } } catch (Exception e) { LOG.warn("Failed to extract fastpass data from " + project, e); } return Optional.empty(); }

Target:
private static Optional<FastpassData> extractFastpassData(Project project) { try { String path = project.getBasePath(); if (path != null) { Optional<FastpassData> fromBsp = readJsonFile(Paths.get(path, ".bsp", "bloop.json"), BspSettings.class) .flatMap(settings -> { if (settings.fastpassVersion != null && settings.fastpassProjectName != null) { return Optional.of(new FastpassData(settings.fastpassVersion, settings.fastpassProjectName)); } else { return Optional.empty(); } }); Supplier<Optional<FastpassData>> fromBloopSettings = () -> readJsonFile(Paths.get(path, ".bloop", "bloop.settings.json"), BloopSettings.class).flatMap(settings -> { Pattern pattern = Pattern.compile("org\\.scalameta:metals_2\\.12:(.*)"); Optional<String> version = settings.refreshProjectsCommand.stream().map(pattern::matcher).filter(Matcher::find).map(m -> m.group(1)).findFirst(); return version.map(fastpassVersion -> { String projectName = settings.refreshProjectsCommand.get(settings.refreshProjectsCommand.size() - 1); return new FastpassData(fastpassVersion, projectName); }); }); return fromBsp.map(Optional::of).orElseGet(fromBloopSettings); } } catch (Exception e) { LOG.warn("Failed to extract fastpass data from " + project, e); } return Optional.empty(); }
Source:
public TextView addTextField(String message) { LinearLayout field = (LinearLayout) mInflater.inflate(R.layout.openmrs_text_view_field, null); TextView textView = (TextView) field.findViewById(R.id.openmrsTextView); textView.setText(message); textView.setSingleLine(false); FontsUtil.setFont(textView, FontsUtil.OpenFonts.OPEN_SANS_REGULAR); if(null != mCustomDialogBundle.getLocationList()){ textView.setTextSize(18); } mFieldsLayout.addView(field, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); return textView; }

Target:
public TextView addTextField(String message) { LinearLayout field = (LinearLayout) mInflater.inflate(R.layout.openmrs_text_view_field, null); TextView textView = (TextView) field.findViewById(R.id.openmrsTextView); textView.setText(message); textView.setSingleLine(false); if(null != mCustomDialogBundle.getLocationList()){ textView.setTextSize(18); } mFieldsLayout.addView(field, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); return textView; }
Source:
AttributesNode load() throws IOException { AttributesNode r; if (entry != null) { r = super.load(); if (r == null) r = new AttributesNode(); } else { r = new AttributesNode(); } FS fs = repository.getFS(); String path = repository.getConfig().get(CoreConfig.KEY) .getExcludesFile(); if (path != null) { File excludesfile; if (path.startsWith("~/")) excludesfile = fs.resolve(fs.userHome(), path.substring(2)); else excludesfile = fs.resolve(null, path); loadRulesFromFile(r, excludesfile); } File attributes = fs.resolve(repository.getDirectory(), "info/attributes"); loadRulesFromFile(r, attributes); return r.getRules().isEmpty() ? null : r; }

Target:
AttributesNode load() throws IOException { AttributesNode r; if (entry != null) { r = super.load(); if (r == null) r = new AttributesNode(); } else { r = new AttributesNode(); } FS fs = repository.getFS(); String path = repository.getConfig().get(CoreConfig.KEY) .getAttributesFile(); if (path != null) { File attributesFile; if (path.startsWith("~/")) attributesFile = fs.resolve(fs.userHome(), path.substring(2)); else attributesFile = fs.resolve(null, path); loadRulesFromFile(r, attributesFile); } File attributes = fs.resolve(repository.getDirectory(), "info/attributes"); loadRulesFromFile(r, attributes); return r.getRules().isEmpty() ? null : r; }
Source:
public EventBookingDTO createBookingOrAddToWaitingList(final IsaacEventPageDTO event, final RegisteredUserDTO user, final Map<String, String> additionalEventInformation) throws SegueDatabaseException, DuplicateBookingException { if (this.isUserReserved(event.getId(), user.getId())) { this.deleteBooking(event, user); } if (this.isUserBooked(event.getId(), user.getId())) { throw new DuplicateBookingException(String.format("Unable to book onto event (%s) as user (%s) is already" + " booked on to it.", event.getId(), user.getEmail())); } EventBookingDTO booking; if (EventStatus.WAITING_LIST_ONLY.equals(event.getEventStatus())) { try { booking = this.createBooking(event, user, additionalEventInformation, BookingStatus.WAITING_LIST); } catch (EventIsFullException e1) { throw new RuntimeException("Creating a waiting list booking should never throw an event is full exception " + "- something went terribly wrong for this to have happened", e1); } return booking; } try { booking = this.createBooking(event, user, additionalEventInformation, BookingStatus.CONFIRMED); } catch (EventIsFullException e) { try { booking = this.createBooking(event, user, additionalEventInformation, BookingStatus.WAITING_LIST); } catch (EventIsFullException e1) { throw new RuntimeException("Creating a waiting list booking should never throw an event is full exception " + "- something went terribly wrong for this to have happened", e1); } } return booking; }

Target:
public EventBookingDTO createBookingOrAddToWaitingList(final IsaacEventPageDTO event, final RegisteredUserDTO user, final Map<String, String> additionalEventInformation) throws SegueDatabaseException, DuplicateBookingException { if (this.isUserBooked(event.getId(), user.getId())) { throw new DuplicateBookingException(String.format("Unable to book onto event (%s) as user (%s) is already" + " booked on to it.", event.getId(), user.getEmail())); } EventBookingDTO booking; if (EventStatus.WAITING_LIST_ONLY.equals(event.getEventStatus())) { try { booking = this.createBooking(event, user, additionalEventInformation, BookingStatus.WAITING_LIST); } catch (EventIsFullException e1) { throw new RuntimeException("Creating a waiting list booking should never throw an event is full exception " + "- something went terribly wrong for this to have happened", e1); } return booking; } try { booking = this.createBooking(event, user, additionalEventInformation, BookingStatus.CONFIRMED); } catch (EventIsFullException e) { try { booking = this.createBooking(event, user, additionalEventInformation, BookingStatus.WAITING_LIST); } catch (EventIsFullException e1) { throw new RuntimeException("Creating a waiting list booking should never throw an event is full exception " + "- something went terribly wrong for this to have happened", e1); } } return booking; }
Source:
protected List<MoveDiskParameters> getMoveDisksParametersList() { for (MoveDiskParameters moveDiskParameters : moveParametersList) { moveDiskParameters.setSessionId(getParameters().getSessionId()); } return moveParametersList; }

Target:
protected ArrayList<VdcActionParametersBase> getMoveDisksParametersList() { for (MoveDiskParameters moveDiskParameters : moveParametersList) { moveDiskParameters.setSessionId(getParameters().getSessionId()); } return new ArrayList<VdcActionParametersBase>(moveParametersList); }
Source:
default <A> BiConstraintStream<A, A> fromUniquePair(Class<A> fromClass, BiJoiner<A, A> joiner) { MemberAccessor planningIdMemberAccessor = ConfigUtils.findPlanningIdMemberAccessor(fromClass); if (planningIdMemberAccessor == null) { throw new IllegalArgumentException("The fromClass (" + fromClass + ") has no member with a @" + PlanningId.class.getSimpleName() + " annotation," + " so the pairs can not be made unique ([A,B] vs [B,A])."); } Function<A, Comparable> planningIdGetter = (fact) -> (Comparable<?>) planningIdMemberAccessor.executeGetter(fact); return from(fromClass).join(fromClass, lessThan(planningIdGetter), joiner); }

Target:
default <A> BiConstraintStream<A, A> fromUniquePair(Class<A> fromClass, BiJoiner<A, A> joiner) { MemberAccessor planningIdMemberAccessor = ConfigUtils.findPlanningIdMemberAccessor(fromClass); if (planningIdMemberAccessor == null) { throw new IllegalArgumentException("The fromClass (" + fromClass + ") has no member with a @" + PlanningId.class.getSimpleName() + " annotation," + " so the pairs can not be made unique ([A,B] vs [B,A])."); } Function<A, Comparable> planningIdGetter = fact -> (Comparable<?>) planningIdMemberAccessor.executeGetter(fact); if (joiner instanceof FilteringBiJoiner) { BiPredicate<A, A> filter = ((FilteringBiJoiner<A, A>)joiner).getFilter(); return from(fromClass) .join(fromClass, lessThan(planningIdGetter)) .filter(filter); } else { return from(fromClass) .join(fromClass, joiner, lessThan(planningIdGetter)); } }
Source:
Notification<Void> executeServerCalls() { Observable<Void> resultObservable = registerMovies().materialize().flatMap( new Func1<Notification<ByteBuf>, Observable<Void>>() { @Override public Observable<Void> call(Notification<ByteBuf> notif) { if (!verifyStatus(notif)) { return Observable.error(notif.getThrowable()); } System.out.print("Updating user recommendations..."); return updateRecommendations().materialize().flatMap( new Func1<Notification<ByteBuf>, Observable<Void>>() { @Override public Observable<Void> call(Notification<ByteBuf> notif) { if (!verifyStatus(notif)) { return Observable.error(notif.getThrowable()); } System.out.println("Searching through the movie catalog..."); return searchCatalog(); } }); } } ); return resultObservable.materialize().toBlockingObservable().last(); }

Target:
Notification<Void> executeServerCalls() { Observable<Void> resultObservable = registerMovies().materialize().flatMap( new Func1<Notification<ByteBuf>, Observable<Void>>() { @Override public Observable<Void> call(Notification<ByteBuf> notif) { if (!verifyStatus(notif)) { return Observable.error(notif.getThrowable()); } System.out.print("Updating user recommendations..."); return updateRecommendations().materialize().flatMap( new Func1<Notification<ByteBuf>, Observable<Void>>() { @Override public Observable<Void> call(Notification<ByteBuf> notif) { if (!verifyStatus(notif)) { return Observable.error(notif.getThrowable()); } System.out.println("Searching through the movie catalog..."); return searchCatalog(); } }); } } ); return resultObservable.materialize().toBlocking().last(); }
Source:
private RefCountingFSDataInputStream(SupplierWithException<FSDataInputStream, IOException> streamSupplier, ChannelStateDeserializer serializer) { this.streamSupplier = streamSupplier; this.serializer = serializer; }

Target:
private RefCountingFSDataInputStream( SupplierWithException<FSDataInputStream, IOException> streamSupplier, ChannelStateDeserializer serializer) { this.streamSupplier = checkNotNull(streamSupplier); this.serializer = checkNotNull(serializer); }
Source:
private void scheduleStatsCollection() { if (scheduler != null) { cancelScheduledCollection(); } if (isEnabled()) { scheduler = threadPool.scheduleWithFixedDelay(statsCollector, getInterval(), threadPoolName()); } }

Target:
private void scheduleStatsCollection() { cancelScheduledCollection(); if (isEnabled()) { scheduledTask = threadPool.scheduleWithFixedDelay(statsCollector, interval, ThreadPool.Names.GENERIC); } }
Source:
public void run() { while (true) { try { final int size = size(); if (size > MIN_FLUSH_THRESHOLD) { final int maxflushes = Math.max(MIN_FLUSH_THRESHOLD, size * FLUSH_INTERVAL * FLUSH_SPEED / Const.MAX_TIMESPAN); final long now = System.currentTimeMillis(); flush(now / 1000 - Const.MAX_TIMESPAN - 1, maxflushes); if (LOG.isDebugEnabled()) { final int newsize = size(); LOG.debug("flush() took {}ms, new queue size={} ({}" + ')', System.currentTimeMillis() - now, newsize, newsize - size); } } } catch (Exception e) { LOG.error("Uncaught exception in compaction thread", e); } catch (OutOfMemoryError e) { final int sz = size.get(); CompactionQueue.super.clear(); size.set(0); LOG.error("Discarded the compaction queue, size={}", sz, e); } catch (Throwable e) { LOG.error("Uncaught *Throwable* in compaction thread", e); try { Thread.sleep(1000); } catch (InterruptedException i) { LOG.error("Compaction thread interrupted in error handling", i); return; } startCompactionThread(); return; } try { Thread.sleep(FLUSH_INTERVAL * 1000); } catch (InterruptedException e) { LOG.error("Compaction thread interrupted, doing one last flush", e); flush(); return; } } }

Target:
public void run() { while (true) { try { final int size = size(); if (size > MIN_FLUSH_THRESHOLD) { final int maxflushes = Math.max(MIN_FLUSH_THRESHOLD, size * FLUSH_INTERVAL * FLUSH_SPEED / Const.MAX_TIMESPAN); final long now = System.currentTimeMillis(); flush(now / 1000 - Const.MAX_TIMESPAN - 1, maxflushes); if (LOG.isDebugEnabled()) { final int newsize = size(); LOG.debug("flush() took {}ms, new queue size={} ({})", System.currentTimeMillis() - now, newsize, newsize - size); } } } catch (Exception e) { LOG.error("Uncaught exception in compaction thread", e); } catch (OutOfMemoryError e) { final int sz = size.get(); CompactionQueue.super.clear(); size.set(0); LOG.error("Discarded the compaction queue, size={}", sz, e); } catch (Throwable e) { LOG.error("Uncaught *Throwable* in compaction thread", e); try { Thread.sleep(1000); } catch (InterruptedException i) { LOG.error("Compaction thread interrupted in error handling", i); return; } startCompactionThread(); return; } try { Thread.sleep(FLUSH_INTERVAL * 1000); } catch (InterruptedException e) { LOG.error("Compaction thread interrupted, doing one last flush", e); flush(); return; } } }
Source:
public Response putDecision(final DecisionUpdate update) throws Exception { System.out.println(String.format("update [%s]", update)); ResultSet<ArtifactReadable> results = AtsUtilServer.getQuery(orcsApi).and(AtsAttributeTypes.AtsId, Operator.EQUAL, update.getUuids()).getResults(); IAtsChangeSet changes = atsServer.getStoreFactory().createAtsChangeSet("Update CPA Decision", AtsCoreUsers.SYSTEM_USER); for (ArtifactReadable art : results) { IAtsTeamWorkflow teamWf = atsServer.getWorkItemFactory().getTeamWf(art); updateRationale(update, changes, teamWf); updateDuplicatedPcrId(update, changes, teamWf); updateApplicability(update, changes, teamWf); updateAssignees(update, changes, teamWf); } if (!changes.isEmpty()) { changes.execute(); } return Response.ok().entity(AHTML.simplePage("Ok")).build(); }

Target:
public Response putDecision(final DecisionUpdate update) throws Exception { ResultSet<ArtifactReadable> results = AtsUtilServer.getQuery(orcsApi).and(AtsAttributeTypes.AtsId, Operator.EQUAL, update.getUuids()).getResults(); IAtsChangeSet changes = atsServer.getStoreFactory().createAtsChangeSet("Update CPA Decision", AtsCoreUsers.SYSTEM_USER); for (ArtifactReadable art : results) { IAtsTeamWorkflow teamWf = atsServer.getWorkItemFactory().getTeamWf(art); updateRationale(update, changes, teamWf); updateDuplicatedPcrId(update, changes, teamWf); updateApplicability(update, changes, teamWf); updateAssignees(update, changes, teamWf); } if (!changes.isEmpty()) { changes.execute(); } return Response.ok().entity(AHTML.simplePage("Ok")).build(); }
Source:
private void validateJoinKeySchemas(Map<String, Schema> inputSchemas) { perStageJoinKeys = conf.getPerStageJoinKeys(); List<Schema> prevSchemaList = null; for (Map.Entry<String, List<String>> entry : perStageJoinKeys.entrySet()) { ArrayList<Schema> schemaList = new ArrayList<>(); String stageName = entry.getKey(); Schema schema = inputSchemas.get(stageName); for (String joinKey : entry.getValue()) { Schema.Field field = schema.getField(joinKey); schemaList.add(field.getSchema()); } if (prevSchemaList != null && !prevSchemaList.equals(schemaList)) { throw new IllegalArgumentException(String.format("For stage %s, Schemas of joinKeys %s are expected to be: " + "%s, but found: %s", stageName, entry.getValue(), prevSchemaList.toString(), schemaList.toString())); } prevSchemaList = new ArrayList<>(schemaList); } }

Target:
void validateJoinKeySchemas(Map<String, Schema> inputSchemas) { perStageJoinKeys = conf.getPerStageJoinKeys(); if (perStageJoinKeys.size() != inputSchemas.size()) { throw new IllegalArgumentException("There should be join keys present from each stage"); } List<Schema> prevSchemaList = null; for (Map.Entry<String, List<String>> entry : perStageJoinKeys.entrySet()) { ArrayList<Schema> schemaList = new ArrayList<>(); String stageName = entry.getKey(); Schema schema = inputSchemas.get(stageName); for (String joinKey : entry.getValue()) { Schema.Field field = schema.getField(joinKey); schemaList.add(field.getSchema()); } if (prevSchemaList != null && !prevSchemaList.equals(schemaList)) { throw new IllegalArgumentException(String.format("For stage %s, Schemas of joinKeys %s are expected to be: " + "%s, but found: %s", stageName, entry.getValue(), prevSchemaList.toString(), schemaList.toString())); } prevSchemaList = schemaList; } }
Source:
public int get(final long timestampUTC) { Map.Entry<Long,Integer> higherEntry = offsetByTimeUTC.ceilingEntry(timestampUTC); Map.Entry<Long,Integer> lowerEntry = offsetByTimeUTC.floorEntry(timestampUTC); if (higherEntry == null && lowerEntry == null) { return 0; } if (higherEntry == null) { higherEntry = lowerEntry; } if (lowerEntry == null) { lowerEntry = higherEntry; } final long diffHigher = Math.abs(higherEntry.getKey() - timestampUTC); final long diffLower = Math.abs(lowerEntry.getKey() - timestampUTC); if (diffHigher > diffLower) { return lowerEntry.getValue(); } else { return higherEntry.getValue(); } }

Target:
public int get(final long timestampUTC) { if (offsetByTimeUTC.isEmpty()) { return 0; } Map.Entry<Long,Integer> higherEntry = offsetByTimeUTC.ceilingEntry(timestampUTC); Map.Entry<Long,Integer> lowerEntry = offsetByTimeUTC.floorEntry(timestampUTC); if (higherEntry == null) { higherEntry = lowerEntry; } if (lowerEntry == null) { lowerEntry = higherEntry; } final long diffHigher = Math.abs(higherEntry.getKey() - timestampUTC); final long diffLower = Math.abs(lowerEntry.getKey() - timestampUTC); if (diffHigher > diffLower) { return lowerEntry.getValue(); } else { return higherEntry.getValue(); } }
Source:
public void associateID(String idpID, String associatedID) throws UserProfileException { Connection connection = null; PreparedStatement prepStmt = null; String sql = null; int tenantID = CarbonContext.getThreadLocalCarbonContext().getTenantId(); String tenantAwareUsername = MultitenantUtils.getTenantAwareUsername(CarbonContext.getThreadLocalCarbonContext() .getUsername()); String domainName = getDomainName(tenantAwareUsername); tenantAwareUsername = getUsernameWithoutDomain(tenantAwareUsername); try { connection = JDBCPersistenceManager.getInstance().getDBConnection(); sql = "INSERT INTO IDN_ASSOCIATED_ID (TENANT_ID, IDP_ID, IDP_USER_ID, DOMAIN_ID, USER_NAME) " + "VALUES (? , (SELECT ID FROM IDP WHERE NAME = ? AND TENANT_ID = ? ), ? , " + "(SELECT UM_DOMAIN_ID FROM UM_DOMAIN WHERE UM_DOMAIN_NAME = ? AND UM_TENANT_ID= ? ), ?);"; prepStmt = connection.prepareStatement(sql); prepStmt.setInt(1, tenantID); prepStmt.setString(2, idpID); prepStmt.setInt(3, tenantID); prepStmt.setString(4, associatedID); prepStmt.setString(5, domainName); prepStmt.setInt(6, tenantID); prepStmt.setString(7, tenantAwareUsername); prepStmt.execute(); connection.commit(); } catch (IdentityException e) { log.error(persistenceErrorMsg, e); throw new UserProfileException(persistenceErrorMsg, e); } catch (SQLException e) { log.error(SQLErrorMsg + sql); log.error(e.getMessage(), e); throw new UserProfileException("Error occurred while persisting the federated user ID"); } finally { IdentityDatabaseUtil.closeAllConnections(connection, null, prepStmt); } }

Target:
public void associateID(String idpID, String associatedID) throws UserProfileException { Connection connection = null; PreparedStatement prepStmt = null; String sql = null; int tenantID = CarbonContext.getThreadLocalCarbonContext().getTenantId(); String tenantAwareUsername = MultitenantUtils.getTenantAwareUsername(CarbonContext.getThreadLocalCarbonContext() .getUsername()); String domainName = getDomainName(tenantAwareUsername); tenantAwareUsername = getUsernameWithoutDomain(tenantAwareUsername); try { connection = JDBCPersistenceManager.getInstance().getDBConnection(); sql = "INSERT INTO IDN_ASSOCIATED_ID (TENANT_ID, IDP_ID, IDP_USER_ID, DOMAIN_ID, USER_NAME) " + "VALUES (? , (SELECT ID FROM IDP WHERE NAME = ? AND TENANT_ID = ? ), ? , " + "(SELECT UM_DOMAIN_ID FROM UM_DOMAIN WHERE UM_DOMAIN_NAME = ? AND UM_TENANT_ID= ? ), ?);"; prepStmt = connection.prepareStatement(sql); prepStmt.setInt(1, tenantID); prepStmt.setString(2, idpID); prepStmt.setInt(3, tenantID); prepStmt.setString(4, associatedID); prepStmt.setString(5, domainName); prepStmt.setInt(6, tenantID); prepStmt.setString(7, tenantAwareUsername); prepStmt.execute(); connection.commit(); } catch (IdentityException e) { log.error(persistenceErrorMsg, e); throw new UserProfileException(persistenceErrorMsg, e); } catch (SQLException e) { log.error(SQLErrorMsg + sql, e); throw new UserProfileException("Error occurred while persisting the federated user ID"); } finally { IdentityDatabaseUtil.closeAllConnections(connection, null, prepStmt); } }
Source:
public AtlasDbServices connect() { if (services != null) { throw new IllegalStateException("connect() has already been called"); } DockerizedDatabaseUri dburi = DockerizedDatabaseUri.fromUriString(uri); KeyValueServiceConfig config = dburi.getKeyValueServiceInstrumentation() .getKeyValueServiceConfig(dburi.getAddress()); ServicesConfigModule servicesConfigModule = ServicesConfigModule.create( ImmutableAtlasDbConfig.builder() .keyValueService(config) .build(), ImmutableAtlasDbRuntimeConfig .defaultRuntimeConfig()); services = DaggerAtlasDbServices.builder() .servicesConfigModule(servicesConfigModule) .build(); return services; }

Target:
public AtlasDbServices connect() { if (services != null) { throw new IllegalStateException("connect() has already been called"); } DockerizedDatabaseUri dburi = DockerizedDatabaseUri.fromUriString(uri); KeyValueServiceConfig config = dburi.getKeyValueServiceInstrumentation() .getKeyValueServiceConfig(dburi.getAddress()); ImmutableAtlasDbConfig atlasDbConfig = ImmutableAtlasDbConfig.builder().keyValueService(config).build(); ImmutableAtlasDbRuntimeConfig runtimeConfig = ImmutableAtlasDbRuntimeConfig.defaultRuntimeConfig(); ServicesConfigModule servicesConfigModule = ServicesConfigModule.create(atlasDbConfig, runtimeConfig); services = DaggerAtlasDbServices.builder() .servicesConfigModule(servicesConfigModule) .build(); return services; }
Source:
protected void onPostExecute(final ArrayList<Theme> result) { runOnUiThread(new Runnable() { @Override public void run() { mFetchingThemes = false; if (mThemeBrowserFragment != null && mThemeBrowserFragment.isVisible()) { mThemeBrowserFragment.mEmptyTextView.setText(R.string.theme_no_search_result_found); mThemeBrowserFragment.setRefreshing(false); } else if (mThemeSearchFragment != null && mThemeSearchFragment.isVisible()) { mThemeSearchFragment.mEmptyTextView.setText(R.string.theme_no_search_result_found); mThemeSearchFragment.setRefreshing(false); } } }); }

Target:
protected void onPostExecute(final ArrayList<Theme> result) { runOnUiThread(new Runnable() { @Override public void run() { mFetchingThemes = false; if (mThemeBrowserFragment != null && mThemeBrowserFragment.isVisible()) { mThemeBrowserFragment.getEmptyTextView().setText(R.string.theme_no_search_result_found); mThemeBrowserFragment.setRefreshing(false); } else if (mThemeSearchFragment != null && mThemeSearchFragment.isVisible()) { mThemeSearchFragment.getEmptyTextView().setText(R.string.theme_no_search_result_found); mThemeSearchFragment.setRefreshing(false); } } }); }
Source:
protected void updateInternal() { if (!(getContainer().isNewStorage() || getContainer().isStorageActive())) { return; } VDS host = getContainer().getHost().getSelectedItem(); if (host == null) { proposeDiscover(); return; } final Collection<EntityModel<?>> prevSelected = Linq.findSelectedItems((Collection<EntityModel<?>>) getSelectedItem()); clearItems(); initializeItems(null, null); final SanStorageModelBase model = this; AsyncQuery<QueryReturnValue> asyncQuery = new AsyncQuery<>(response -> { if (response.getSucceeded()) { boolean isInMaintenance = false; Set<String> metadata = null; if (!model.getContainer().isNewStorage()) { isInMaintenance = model.getContainer().getStorage().getStatus() == StorageDomainStatus.Maintenance; metadata = model.getMetadataDevices(); } model.applyData(isInMaintenance, metadata, (ArrayList<LUNs>) response.getReturnValue(), false, prevSelected); model.setGetLUNsFailure(""); } else { model.setGetLUNsFailure( ConstantsManager.getInstance().getConstants().couldNotRetrieveLUNsLunsFailure()); } }, true); Frontend.getInstance().runQuery(QueryType.GetDeviceList, new GetDeviceListQueryParameters(host.getId(), getType(), false, null, false), asyncQuery); }

Target:
protected void updateInternal() { if (!(getContainer().isNewStorage() || getContainer().isStorageActive())) { return; } VDS host = getContainer().getHost().getSelectedItem(); if (host == null) { proposeDiscover(); return; } final Collection<EntityModel<?>> prevSelected = Linq.findSelectedItems((Collection<EntityModel<?>>) getSelectedItem()); clearItems(); initializeItems(null, null); final SanStorageModelBase model = this; AsyncQuery<QueryReturnValue> asyncQuery = new AsyncQuery<>(response -> { if (response.getSucceeded()) { boolean isInMaintenance = false; Set<String> metadata = null; if (!model.getContainer().isNewStorage()) { isInMaintenance = model.getContainer().getStorage().getStatus() == StorageDomainStatus.Maintenance; metadata = model.getMetadataDevices(); } model.applyData((ArrayList<LUNs>) response.getReturnValue(), false, prevSelected, isInMaintenance, metadata); model.setGetLUNsFailure(""); } else { model.setGetLUNsFailure( ConstantsManager.getInstance().getConstants().couldNotRetrieveLUNsLunsFailure()); } }, true); Frontend.getInstance().runQuery(QueryType.GetDeviceList, new GetDeviceListQueryParameters(host.getId(), getType(), false, null, false), asyncQuery); }
Source:
protected void onReset() { super.onReset(); FaviconRefreshUtil.refreshFavicon(); if (user.isLoggedIn()) { placeManager.revealDefaultPlace(); } else { RevealRootPopupContentEvent.fire(this, loginPopup); } }

Target:
protected void onReset() { super.onReset(); if ("firefox".equalsIgnoreCase(clientAgentType.getBrowser())) { FaviconRefreshUtil.refreshFavicon(); } if (user.isLoggedIn()) { placeManager.revealDefaultPlace(); } else { RevealRootPopupContentEvent.fire(this, loginPopup); } }
Source:
public ValidationWhiteListSearchRequestBuilder filterByComponentIdentifier(ComponentIdentifier componentIdentifier) { return addOption(OptionKey.COMPONENTENT_IDENTIFIER, componentIdentifier); }

Target:
public ValidationWhiteListSearchRequestBuilder filterByComponentIdentifier(ComponentIdentifier componentIdentifier) { return addOption(OptionKey.COMPONENT_IDENTIFIER, componentIdentifier); }
Source:
public boolean registerMessageListener(LIRCMessageListener listener) { if (listener == null) { throw new IllegalArgumentException("The listener parameter may not be null."); } return deviceStatusListeners.contains(listener) ? false : deviceStatusListeners.add(listener); }

Target:
public boolean registerMessageListener(LIRCMessageListener listener) { if (listener == null) { throw new IllegalArgumentException("The listener parameter may not be null."); } return deviceStatusListeners.add(listener); }
Source:
public synchronized boolean addShardingKey(String realm, String shardingKey) { if (_leaderElection.isLeader()) { if (_zkClient.isClosed()) { throw new IllegalStateException("ZkClient is closed!"); } String realmPath = MetadataStoreRoutingConstants.ROUTING_DATA_PATH + "/" + realm; if (!_zkClient.exists(realmPath)) { if (!createZkRealm(realm)) { LOG.error( "Failed to add sharding key because ZkRealm creation failed! Namespace: {}, Realm: {}, Sharding key: {}", _namespace, realm, shardingKey); return false; } } ZNRecord znRecord; try { znRecord = _zkClient.readData(realmPath); } catch (Exception e) { LOG.error( "Failed to read the realm ZNRecord in addShardingKey()! Namespace: {}, Realm: {}, ShardingKey: {}", _namespace, realm, shardingKey, e); return false; } znRecord.setListField(MetadataStoreRoutingConstants.ZNRECORD_LIST_FIELD_KEY, Collections.singletonList(shardingKey)); try { _zkClient.writeData(realmPath, znRecord); } catch (Exception e) { LOG.error( "Failed to write the realm ZNRecord in addShardingKey()! Namespace: {}, Realm: {}, ShardingKey: {}", _namespace, realm, shardingKey, e); return false; } return true; } String leaderHostName = _leaderElection.getCurrentLeaderInfo().getId(); String url = leaderHostName + "/admin/v2/namespaces/" + _namespace + "/metadata-store-realms/" + realm + "/sharding-keys/" + shardingKey; HttpPut putRequest = new HttpPut(url); try { HttpResponse response = _forwardHttpClient.execute(putRequest); if (response.getStatusLine().getStatusCode() != 201) { HttpEntity respEntity = response.getEntity(); LOG.error("the forwarded request to leader has failed for addShardingKey: {}", respEntity != null ? EntityUtils.toString(respEntity) : ""); return false; } } catch (IOException e) { LOG.error("the forwarded request to leader raised an exception for addShardingKey", e); return false; } return true; }

Target:
public synchronized boolean addShardingKey(String realm, String shardingKey) { if (_leaderElection.isLeader()) { if (_zkClient.isClosed()) { throw new IllegalStateException("ZkClient is closed!"); } return createZkShardingKey(realm, shardingKey); } String urlSuffix = constructUrlSuffix(MetadataStoreRoutingConstants.MSDS_GET_ALL_REALMS_ENDPOINT, realm, MetadataStoreRoutingConstants.MSDS_GET_ALL_SHARDING_KEYS_ENDPOINT, shardingKey); return forwardRequestToLeader(urlSuffix, HttpConstants.RestVerbs.PUT, Response.Status.CREATED.getStatusCode()); }
Source:
public RegistrationData findByToken(Context context, String token) throws SQLException { CriteriaBuilder criteriaBuilder = getCriteriaBuilder(context); CriteriaQuery criteriaQuery = getCriteriaQuery(criteriaBuilder, RegistrationData.class); Root<RegistrationData> registrationDataRoot = criteriaQuery.from(RegistrationData.class); criteriaQuery.select(registrationDataRoot); criteriaQuery.where(criteriaBuilder.equal(registrationDataRoot.get(RegistrationData_.token), token)); return uniqueResult(context, criteriaQuery, true, RegistrationData.class, -1, -1); }

Target:
public RegistrationData findByToken(Context context, String token) throws SQLException { CriteriaBuilder criteriaBuilder = getCriteriaBuilder(context); CriteriaQuery criteriaQuery = getCriteriaQuery(criteriaBuilder, RegistrationData.class); Root<RegistrationData> registrationDataRoot = criteriaQuery.from(RegistrationData.class); criteriaQuery.select(registrationDataRoot); criteriaQuery.where(criteriaBuilder.equal(registrationDataRoot.get(RegistrationData_.token), token)); return uniqueResult(context, criteriaQuery, false, RegistrationData.class, -1, -1); }
Source:
public Seq<? extends E> getErrors() throws RuntimeException { throw new NoSuchElementException("errors of 'valid' Validation"); }

Target:
public Seq<E> getErrors() throws RuntimeException { throw new NoSuchElementException("errors of 'valid' Validation"); }
Source:
public BoardPanel(BoardSize boardSize, SquareConfig squareConfig, Function<BoardCoordinate, Set<BoardCoordinate>> getMovesCallback) { super(false); mSquareConfig = squareConfig; mGetMovesCallback = getMovesCallback; mBoardSize = boardSize; mSquareLabels = new ArrayList<>(boardSize.width * boardSize.height); addComponentListener(new ComponentListener() { @Override public void componentResized(ComponentEvent e) { Rectangle b = e.getComponent().getBounds(); if(b.height > b.width){ setMinimumSize(new Dimension(b.width, b.width)); setPreferredSize(new Dimension(b.width, b.width)); setMaximumSize(new Dimension(b.width, b.width)); } else{ setMinimumSize(new Dimension(b.height, b.height)); setPreferredSize(new Dimension(b.height, b.height)); setMaximumSize(new Dimension(b.height, b.height)); } } @Override public void componentMoved(ComponentEvent e) { } @Override public void componentShown(ComponentEvent e) { } @Override public void componentHidden(ComponentEvent e) { } }); GridLayout gridLayout = new GridLayout(mBoardSize.width + 2, mBoardSize.height + 2); setLayout(gridLayout); createGrid(gridLayout); }

Target:
public BoardPanel(BoardSize boardSize, SquareConfig squareConfig, Function<BoardCoordinate, Set<BoardCoordinate>> getMovesCallback) { super(false); mSquareConfig = squareConfig; mGetMovesCallback = getMovesCallback; mBoardSize = boardSize; mSquareLabels = new ArrayList<>(boardSize.width * boardSize.height); GridLayout gridLayout = new GridLayout(mBoardSize.width + 2, mBoardSize.height + 2); setLayout(gridLayout); createGrid(gridLayout); }
Source:
public boolean onActivate(Level level, Player player, Block block, Block target, int face, double fx, double fy, double fz) { Block targetBlock = Block.get(this.meta); if (targetBlock instanceof BlockAir) { if (target instanceof BlockLiquid && target.getDamage() == 0) { Item result = Item.get(BUCKET, this.getDamageByTarget(target.getId()), 1); PlayerBucketFillEvent ev; player.getServer().getPluginManager().callEvent(ev = new PlayerBucketFillEvent(player, block, face, this, result)); if (!ev.isCancelled()) { player.getLevel().setBlock(target, new BlockAir(), true, true); if (player.isSurvival()) { this.setCount(this.getCount() - 1); player.getInventory().setItemInHand(this.getCount() >= 1 ? this : Item.get(0)); player.getInventory().addItem(ev.getItem()); } return true; } else { player.getInventory().sendContents(player); } } } else if (targetBlock instanceof BlockLiquid) { Item result = Item.get(BUCKET, 0, 1); PlayerBucketEmptyEvent ev; player.getServer().getPluginManager().callEvent(ev = new PlayerBucketEmptyEvent(player, block, face, this, result)); if (!ev.isCancelled()) { player.getLevel().setBlock(block, targetBlock, true, true); if (player.isSurvival()) { this.setCount(this.getCount() - 1); player.getInventory().setItemInHand(this.getCount() >= 1 ? this : Item.get(0)); player.getInventory().addItem(ev.getItem()); } return true; } else { player.getInventory().sendContents(player); } } return false; }

Target:
public boolean onActivate(Level level, Player player, Block block, Block target, int face, double fx, double fy, double fz) { Block targetBlock = Block.get(this.meta); if (targetBlock instanceof BlockAir) { if (target instanceof BlockLiquid && target.getDamage() == 0) { Item result = Item.get(BUCKET, this.getDamageByTarget(target.getId()), 1); PlayerBucketFillEvent ev; player.getServer().getPluginManager().callEvent(ev = new PlayerBucketFillEvent(player, block, face, this, result)); if (!ev.isCancelled()) { player.getLevel().setBlock(target, new BlockAir(), true, true); if (player.isSurvival()) { this.setCount(this.getCount() - 1); player.getInventory().setItemInHand(this); player.getInventory().addItem(ev.getItem()); } return true; } else { player.getInventory().sendContents(player); } } } else if (targetBlock instanceof BlockLiquid) { Item result = Item.get(BUCKET, 0, 1); PlayerBucketEmptyEvent ev; player.getServer().getPluginManager().callEvent(ev = new PlayerBucketEmptyEvent(player, block, face, this, result)); if (!ev.isCancelled()) { player.getLevel().setBlock(block, targetBlock, true, true); if (player.isSurvival()) { this.setCount(this.getCount() - 1); player.getInventory().setItemInHand(this); player.getInventory().addItem(ev.getItem()); } return true; } else { player.getInventory().sendContents(player); } } return false; }
Source:
public synchronized void add(PrestoWarning warning) { requireNonNull(warning, "warning is null"); switch(config.getWarningHandlingLevel()) { case SUPPRESS: break; case NORMAL: if (warnings.size() < config.getMaxWarnings()) { warnings.putIfAbsent(warning.getWarningCode(), warning); } break; case AS_ERROR: throw new PrestoException(StandardErrorCode.WARNING_AS_ERROR, warning.toString()); } }

Target:
public synchronized void add(PrestoWarning warning) { requireNonNull(warning, "warning is null"); switch (warningHandlingLevel) { case SUPPRESS: break; case NORMAL: addWarningIfNumWarningsLessThanConfig(warning); break; case AS_ERROR: if (warning.getWarningCode() == PARSER_WARNING.toWarningCode()) { addWarningIfNumWarningsLessThanConfig(warning); } else { throw new PrestoException(WARNING_AS_ERROR, warning.toString()); } } }
Source:
protected void executeCommand() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { updateNetworkAttachment( getVdsGroupId(), getNetworkCluster(), getNetwork(), AttachNetworkToVdsGroupCommand.this); return null; } }); if (!getPersistedNetwork().isExternal() && NetworkUtils.isLabeled(getPersistedNetwork()) && NetworkHelper.setupNetworkSupported(getVdsGroup().getcompatibility_version())) { addNetworkToHosts(); } setSucceeded(true); }

Target:
protected void executeCommand() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { attachNetwork(getVdsGroupId(), getNetworkCluster(), getNetwork()); return null; } }); if (!getPersistedNetwork().isExternal() && NetworkUtils.isLabeled(getPersistedNetwork()) && NetworkHelper.setupNetworkSupported(getVdsGroup().getcompatibility_version())) { addNetworkToHosts(); } setSucceeded(true); }
Source:
private WrappedNetworkMonitor makeMonitor(NetworkCapabilities nc) { final WrappedNetworkMonitor nm = new WrappedNetworkMonitor(); nm.start(); setNetworkCapabilities(nm, nc); HandlerUtilsKt.waitForIdle(nm.getHandler(), HANDLER_TIMEOUT_MS); mCreatedNetworkMonitors.add(nm); return nm; }

Target:
private WrappedNetworkMonitor makeMonitor(NetworkCapabilities nc) { final WrappedNetworkMonitor nm = new WrappedNetworkMonitor(); nm.start(); setNetworkCapabilities(nm, nc); HandlerUtilsKt.waitForIdle(nm.getHandler(), HANDLER_TIMEOUT_MS); mCreatedNetworkMonitors.add(nm); when(mTstDependencies.isTcpInfoParsingSupported()).thenReturn(false); return nm; }
Source:
private EdgeMapping createEdgeMappingReference(Layer layer, ToolSection toolSection, ContainerMapping classMapping) { EdgeMapping edgeMappingReference = DescriptionFactory.eINSTANCE.createEdgeMapping(); EdgeStyleDescription edgeStyleR = StyleFactory.eINSTANCE.createEdgeStyleDescription(); edgeMappingReference.setName(BASE_ID + ".edge.reference"); edgeMappingReference.setLabel("Reference"); edgeMappingReference.setUseDomainElement(true); edgeStyleR.setCenterLabelStyleDescription(StyleFactory.eINSTANCE.createCenterLabelStyleDescription()); edgeMappingReference.setStyle(edgeStyleR); edgeMappingReference.getSourceMapping().add(classMapping); edgeMappingReference.getTargetMapping().add(classMapping); layer.getEdgeMappings().add(edgeMappingReference); EdgeCreationDescription edgeCreationDescription = ToolFactory.eINSTANCE.createEdgeCreationDescription(); edgeCreationDescription.setName(BASE_ID + ".package.toolsection.containerEdgeMappingReference"); edgeCreationDescription.setLabel("Container EdgeMapping Reference"); edgeCreationDescription.getEdgeMappings().add(edgeMappingReference); toolSection.getOwnedTools().add(edgeCreationDescription); return edgeMappingReference; }

Target:
private EdgeMapping createEdgeMappingReference(Layer layer, ToolSection toolSection, ContainerMapping classMapping) { EdgeMapping edgeMappingReference = DescriptionFactory.eINSTANCE.createEdgeMapping(); EdgeStyleDescription edgeStyleR = StyleFactory.eINSTANCE.createEdgeStyleDescription(); edgeMappingReference.setName(BASE_ID + ".edge.reference"); edgeMappingReference.setLabel("Reference"); edgeMappingReference.setUseDomainElement(true); edgeStyleR.setCenterLabelStyleDescription(StyleFactory.eINSTANCE.createCenterLabelStyleDescription()); edgeMappingReference.setStyle(edgeStyleR); edgeMappingReference.getSourceMapping().add(classMapping); edgeMappingReference.getTargetMapping().add(classMapping); layer.getEdgeMappings().add(edgeMappingReference); EdgeCreationDescription edgeCreationDescription = ToolFactory.eINSTANCE.createEdgeCreationDescription(); edgeCreationDescription.setName(BASE_ID + ".edge.reference.creation"); edgeCreationDescription.setLabel("Reference"); edgeCreationDescription.getEdgeMappings().add(edgeMappingReference); toolSection.getOwnedTools().add(edgeCreationDescription); return edgeMappingReference; }
Source:
public WildflyConfiguration build() { if (mode.equals(Mode.STANDALONE)) { script = new File(directory, "bin" + File.separator + (SystemUtils.IS_OS_WINDOWS ? "standalone.bat" : "standalone.sh")); } else { script = new File(directory, "bin" + File.separator + (SystemUtils.IS_OS_WINDOWS ? "domain.bat" : "domain.sh")); } javaOpts = javaOpts.stream().map(i -> i.replaceAll("\\s","")).collect(Collectors.toList()); if (!StringUtils.isEmpty(xms)) { replaceJavaOptIfExists("-Xms", xms); } if (!StringUtils.isEmpty(xmx)) { replaceJavaOptIfExists("-Xmx", xmx); } if (!StringUtils.isEmpty(permSize)) { replaceJavaOptIfExists("-XX:PermSize=", permSize); } if (!StringUtils.isEmpty(maxPermSize)) { replaceJavaOptIfExists("-XX:MaxPermSize=", maxPermSize); } replaceJavaOptIfExists("-Djava.net.preferIPv4Stack=", "true"); replaceJavaOptIfExists("-Djboss.modules.system.pkgs=", "org.jboss.byteman"); replaceJavaOptIfExists("-Djava.awt.headless=", "true"); replaceJavaOptIfExists("-Djboss.socket.binding.port-offset=", String.valueOf(portOffset)); if (baseDir != null) { replaceJavaOptIfExists("-Djboss.server.base.dir=", baseDir.toString()); } if (nodeName != null) { replaceJavaOptIfExists("-Djboss.node.name=", nodeName); } envProps.put(Configuration.JAVA_OPTS_ENV_NAME, String.join(" ", javaOpts)); return new WildflyConfiguration(this); }

Target:
public WildflyConfiguration build() { if (mode.equals(Mode.STANDALONE)) { script = new File(directory, "bin" + File.separator + (SystemUtils.IS_OS_WINDOWS ? "standalone.bat" : "standalone.sh")); } else { script = new File(directory, "bin" + File.separator + (SystemUtils.IS_OS_WINDOWS ? "domain.bat" : "domain.sh")); } for (int i = 0; i < javaOpts.size(); i++) { javaOpts.set(i, javaOpts.get(i).replaceAll("\\s", "")); } if (!StringUtils.isEmpty(xms)) { replaceJavaOptIfExists("-Xms", xms); } if (!StringUtils.isEmpty(xmx)) { replaceJavaOptIfExists("-Xmx", xmx); } if (!StringUtils.isEmpty(permSize)) { replaceJavaOptIfExists("-XX:PermSize=", permSize); } if (!StringUtils.isEmpty(maxPermSize)) { replaceJavaOptIfExists("-XX:MaxPermSize=", maxPermSize); } if (baseDir != null) { replaceJavaOptIfExists("-Djboss.server.base.dir=", baseDir.toString()); } if (nodeName != null) { replaceJavaOptIfExists("-Djboss.node.name=", nodeName); } addJavaOptIfNotExists("-Djava.net.preferIPv4Stack=", "true"); addJavaOptIfNotExists("-Djboss.modules.system.pkgs=", "org.jboss.byteman"); addJavaOptIfNotExists("-Djava.awt.headless=", "true"); addJavaOptIfNotExists("-Djboss.socket.binding.port-offset=", String.valueOf(portOffset)); envProps.put(Configuration.JAVA_OPTS_ENV_NAME, Joiner.on(" ").join(javaOpts)); return new WildflyConfiguration(this); }
Source:
private void sizeToWindow(int top, Style.Overflow overflowY) { NodeList<Element> e = this.menuBar_.getElement().getElementsByTagName("table"); if (e.getLength() < 1) return; Element table = e.getItem(0); int windowHeight = Window.getClientHeight(); table.getStyle().setOverflowY(overflowY); table.getStyle().setDisplay(Style.Display.BLOCK); table.getStyle().setPropertyPx("maxHeight", windowHeight - top - 30); }

Target:
private void sizeToWindow(int top, Style.Overflow overflowY) { NodeList<Element> e = menuBar_.getElement().getElementsByTagName("table"); if (e.getLength() < 1) return; Element table = e.getItem(0); int windowHeight = Window.getClientHeight(); table.getStyle().setOverflowY(overflowY); table.getStyle().setDisplay(Style.Display.BLOCK); table.getStyle().setPropertyPx("maxHeight", windowHeight - top - 30); }
Source:
public void deleteEntry(String id) throws DirectoryException { checkPermission(SecurityConstants.WRITE); checkDeleteConstraints(id); for (Reference reference : getDirectory().getReferences()) { if (reference.getClass() == referenceClassName) { reference.removeLinksForSource(id, this); } else { reference.removeLinksForSource(id); } } deleteEntryWithoutReferences(id); getDirectory().invalidateCaches(); }

Target:
public void deleteEntry(String id) throws DirectoryException { checkPermission(SecurityConstants.WRITE); checkDeleteConstraints(id); for (Reference reference : getDirectory().getReferences()) { if (reference.getClass() == referenceClass) { reference.removeLinksForSource(id, this); } else { reference.removeLinksForSource(id); } } deleteEntryWithoutReferences(id); getDirectory().invalidateCaches(); }
Source:
public static void createSchema(String url, String tableName, Long ts) throws SQLException { if (tableName.contains(".")) { String schema = tableName.substring(0, tableName.indexOf(".")); if (!schema.equals("")) { Properties props = new Properties(); if (ts != null) { props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts)); } try (Connection conn = DriverManager.getConnection(url, props);) { conn.createStatement().executeUpdate("CREATE SCHEMA IF NOT EXISTS " + schema); } catch (TableAlreadyExistsException e) { throw e; } } } }

Target:
public static void createSchema(String url, String tableName, Long ts) throws SQLException { String schema = SchemaUtil.getSchemaNameFromFullName(tableName); if (!schema.equals("")) { Properties props = new Properties(); if (ts != null) { props.setProperty(PhoenixRuntime.CURRENT_SCN_ATTRIB, Long.toString(ts)); } try (Connection conn = DriverManager.getConnection(url, props);) { if (SchemaUtil.isNamespaceMappingEnabled(null, conn.unwrap(PhoenixConnection.class).getQueryServices().getProps())) { conn.createStatement().executeUpdate("CREATE SCHEMA IF NOT EXISTS " + schema); } } } }