idx
int32 46
1.86M
| input
stringlengths 321
6.6k
| target
stringlengths 9
1.24k
|
|---|---|---|
828,718
|
final DBCluster executeRestoreDBClusterToPointInTime(RestoreDBClusterToPointInTimeRequest restoreDBClusterToPointInTimeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(restoreDBClusterToPointInTimeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RestoreDBClusterToPointInTimeRequest> request = null;<NEW_LINE>Response<DBCluster> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RestoreDBClusterToPointInTimeRequestMarshaller().marshall(super.beforeMarshalling(restoreDBClusterToPointInTimeRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "RDS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RestoreDBClusterToPointInTime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DBCluster> responseHandler = new StaxResponseHandler<DBCluster>(new DBClusterStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
|
401,813
|
public Mono<ReplicationFactorChangeResponseDTO> changeReplicationFactor(KafkaCluster cluster, String topicName, ReplicationFactorChangeDTO replicationFactorChange) {<NEW_LINE>return loadTopic(cluster, topicName).flatMap(topic -> adminClientService.get(cluster).flatMap(ac -> {<NEW_LINE>Integer actual = topic.getReplicationFactor();<NEW_LINE><MASK><NEW_LINE>Integer brokersCount = metricsCache.get(cluster).getClusterDescription().getNodes().size();<NEW_LINE>if (requested.equals(actual)) {<NEW_LINE>return Mono.error(new ValidationException(String.format("Topic already has replicationFactor %s.", actual)));<NEW_LINE>}<NEW_LINE>if (requested > brokersCount) {<NEW_LINE>return Mono.error(new ValidationException(String.format("Requested replication factor %s more than brokers count %s.", requested, brokersCount)));<NEW_LINE>}<NEW_LINE>return changeReplicationFactor(cluster, ac, topicName, getPartitionsReassignments(cluster, topic, replicationFactorChange));<NEW_LINE>}).map(t -> new ReplicationFactorChangeResponseDTO().topicName(t.getName()).totalReplicationFactor(t.getReplicationFactor())));<NEW_LINE>}
|
Integer requested = replicationFactorChange.getTotalReplicationFactor();
|
1,282,283
|
private static void storeLastFocusedComponent(@Nonnull WindowEvent we) {<NEW_LINE>final Window eventWindow = we.getWindow();<NEW_LINE>if (we.getID() == WindowEvent.WINDOW_DEACTIVATED || we.getID() == WindowEvent.WINDOW_LOST_FOCUS) {<NEW_LINE>Component <MASK><NEW_LINE>Component focusOwnerInDeactivatedWindow = eventWindow.getMostRecentFocusOwner();<NEW_LINE>IdeFrame[] allProjectFrames = WindowManager.getInstance().getAllProjectFrames();<NEW_LINE>if (focusOwnerInDeactivatedWindow != null) {<NEW_LINE>for (IdeFrame ideFrame : allProjectFrames) {<NEW_LINE>Window aFrame = TargetAWT.to(WindowManager.getInstance().getWindow(ideFrame.getProject()));<NEW_LINE>if (aFrame.equals(frame)) {<NEW_LINE>IdeFocusManager focusManager = IdeFocusManager.getGlobalInstance();<NEW_LINE>if (focusManager instanceof FocusManagerImpl) {<NEW_LINE>((FocusManagerImpl) focusManager).setLastFocusedAtDeactivation(ideFrame, focusOwnerInDeactivatedWindow);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
frame = UIUtil.findUltimateParent(eventWindow);
|
1,521,230
|
private void writeExportedFileRules(Project rootBuckProject, OkBuckExtension okBuckExtension) {<NEW_LINE>Set<String> currentProjectPaths = okBuckExtension.buckProjects.stream().filter(project -> ProjectUtil.getType(project) != ProjectType.UNKNOWN).map(project -> rootBuckProject.getProjectDir().toPath().relativize(project.getProjectDir().toPath()).toString()).collect(MoreCollectors.toImmutableSet());<NEW_LINE>Map<String, Set<Rule>> pathToRules = new HashMap<>();<NEW_LINE>for (String exportedPath : exportedPaths) {<NEW_LINE>File exportedFile = rootBuckProject.file(exportedPath);<NEW_LINE>String containingPath = FileUtil.getRelativePath(rootBuckProject.getProjectDir(), exportedFile.getParentFile());<NEW_LINE>Set<Rule> rules = pathToRules.getOrDefault(containingPath, new HashSet<>());<NEW_LINE>rules.add(new ExportFile().name(exportedFile.getName()));<NEW_LINE>pathToRules.put(containingPath, rules);<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, Set<Rule>> entry : pathToRules.entrySet()) {<NEW_LINE>File buckFile = rootBuckProject.getRootDir().toPath().resolve(entry.getKey()).resolve(<MASK><NEW_LINE>try (OutputStream os = new FileOutputStream(buckFile, currentProjectPaths.contains(entry.getKey()))) {<NEW_LINE>entry.getValue().stream().sorted((rule1, rule2) -> rule1.name().compareToIgnoreCase(rule2.name())).forEach(rule -> rule.render(os));<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
okBuckExtension.buildFileName).toFile();
|
1,046,191
|
private void saveOrUpdateJobRankDistribution(List<JobStatistics> jobList, String zkBsKey) {<NEW_LINE>try {<NEW_LINE>Map<Integer, Integer> jobDegreeCountMap = new HashMap<>();<NEW_LINE>for (JobStatistics jobStatistics : jobList) {<NEW_LINE>int jobDegree = jobStatistics.getJobDegree();<NEW_LINE>Integer count = jobDegreeCountMap.get(jobDegree);<NEW_LINE>jobDegreeCountMap.put(jobDegree, count == null ? 1 : count + 1);<NEW_LINE>}<NEW_LINE>String jobDegreeMapString = JSON.toJSONString(jobDegreeCountMap);<NEW_LINE>SaturnStatistics jobDegreeMapFromDB = saturnStatisticsService.findStatisticsByNameAndZkList(StatisticsTableKeyConstant.JOB_RANK_DISTRIBUTION, zkBsKey);<NEW_LINE>if (jobDegreeMapFromDB == null) {<NEW_LINE>SaturnStatistics ss = new SaturnStatistics(StatisticsTableKeyConstant.JOB_RANK_DISTRIBUTION, zkBsKey, jobDegreeMapString);<NEW_LINE>saturnStatisticsService.create(ss);<NEW_LINE>} else {<NEW_LINE>jobDegreeMapFromDB.setResult(jobDegreeMapString);<NEW_LINE>saturnStatisticsService.updateByPrimaryKey(jobDegreeMapFromDB);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error(<MASK><NEW_LINE>}<NEW_LINE>}
|
e.getMessage(), e);
|
526,001
|
public void methodReached(DependencyAgent agent, MethodDependency method) {<NEW_LINE>reachedMethods.put(method.getReference(), new HashSet<>());<NEW_LINE>if (method.isMissing()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AnnotationReader annot = method.getMethod().getAnnotations().get(JavaScriptBody.class.getName());<NEW_LINE>if (annot != null) {<NEW_LINE>includeDefaultDependencies(agent);<NEW_LINE>AnnotationValue javacall = annot.getValue("javacall");<NEW_LINE>if (method.getResult() != null) {<NEW_LINE>allClassesNode.connect(method.getResult());<NEW_LINE>allClassesNode.addConsumer(new OneDirectionalConnection(method.getResult().getArrayItem()));<NEW_LINE>allClassesNode.addConsumer(new OneDirectionalConnection(method.getResult().getArrayItem().getArrayItem()));<NEW_LINE>}<NEW_LINE>for (int i = 0; i < method.getParameterCount(); ++i) {<NEW_LINE>method.getVariable(i).connect(allClassesNode);<NEW_LINE>method.getVariable(i).addConsumer(type -> {<NEW_LINE>if (agent.getClassHierarchy().isSuperType("java.lang.Enum", type.getName(), false)) {<NEW_LINE>MethodReference toStringMethod = new MethodReference(type.getName(), "toString", ValueType<MASK><NEW_LINE>MethodDependency dependency = agent.linkMethod(toStringMethod);<NEW_LINE>dependency.getVariable(0).propagate(type);<NEW_LINE>dependency.use();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>allClassesNode.addConsumer(new OneDirectionalConnection(method.getVariable(i).getArrayItem()));<NEW_LINE>allClassesNode.addConsumer(new OneDirectionalConnection(method.getVariable(i).getArrayItem().getArrayItem()));<NEW_LINE>}<NEW_LINE>if (javacall != null && javacall.getBoolean()) {<NEW_LINE>String body = annot.getValue("body").getString();<NEW_LINE>new GeneratorJsCallback(agent, method).parse(body);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
.parse(String.class));
|
832,401
|
// ***********************************************************************************<NEW_LINE>// METHODS<NEW_LINE>// ***********************************************************************************<NEW_LINE>@Override<NEW_LINE>public void propagate(int evtmask) throws ContradictionException {<NEW_LINE>ISetIterator iter;<NEW_LINE>for (int i = 0; i < n; i++) {<NEW_LINE>iter = sets[i].getUB().iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>int j = iter.nextInt();<NEW_LINE>if (j < offSet1 || j >= n2 + offSet1 || !invsets[j - offSet2].getUB().contains(i + offSet1)) {<NEW_LINE>sets[i].remove(j, this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>iter = sets[i].getLB().iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>invsets[iter.nextInt() - offSet2].<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < n2; i++) {<NEW_LINE>iter = invsets[i].getUB().iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>int j = iter.nextInt();<NEW_LINE>if (j < offSet2 || j >= n + offSet2 || !sets[j - offSet1].getUB().contains(i + offSet2)) {<NEW_LINE>invsets[i].remove(j, this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>iter = invsets[i].getLB().iterator();<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>sets[iter.nextInt() - offSet1].force(i + offSet2, this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < n + n2; i++) {<NEW_LINE>sdm[i].startMonitoring();<NEW_LINE>}<NEW_LINE>}
|
force(i + offSet1, this);
|
1,810,062
|
public static DescribeVpnPbrRouteEntriesResponse unmarshall(DescribeVpnPbrRouteEntriesResponse describeVpnPbrRouteEntriesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeVpnPbrRouteEntriesResponse.setRequestId(_ctx.stringValue("DescribeVpnPbrRouteEntriesResponse.RequestId"));<NEW_LINE>describeVpnPbrRouteEntriesResponse.setPageSize(_ctx.integerValue("DescribeVpnPbrRouteEntriesResponse.PageSize"));<NEW_LINE>describeVpnPbrRouteEntriesResponse.setPageNumber(_ctx.integerValue("DescribeVpnPbrRouteEntriesResponse.PageNumber"));<NEW_LINE>describeVpnPbrRouteEntriesResponse.setTotalCount(_ctx.integerValue("DescribeVpnPbrRouteEntriesResponse.TotalCount"));<NEW_LINE>List<VpnPbrRouteEntry> vpnPbrRouteEntries = new ArrayList<VpnPbrRouteEntry>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeVpnPbrRouteEntriesResponse.VpnPbrRouteEntries.Length"); i++) {<NEW_LINE>VpnPbrRouteEntry vpnPbrRouteEntry = new VpnPbrRouteEntry();<NEW_LINE>vpnPbrRouteEntry.setNextHop(_ctx.stringValue("DescribeVpnPbrRouteEntriesResponse.VpnPbrRouteEntries[" + i + "].NextHop"));<NEW_LINE>vpnPbrRouteEntry.setWeight(_ctx.integerValue("DescribeVpnPbrRouteEntriesResponse.VpnPbrRouteEntries[" + i + "].Weight"));<NEW_LINE>vpnPbrRouteEntry.setRouteDest(_ctx.stringValue("DescribeVpnPbrRouteEntriesResponse.VpnPbrRouteEntries[" + i + "].RouteDest"));<NEW_LINE>vpnPbrRouteEntry.setState(_ctx.stringValue("DescribeVpnPbrRouteEntriesResponse.VpnPbrRouteEntries[" + i + "].State"));<NEW_LINE>vpnPbrRouteEntry.setCreateTime(_ctx.longValue<MASK><NEW_LINE>vpnPbrRouteEntry.setVpnInstanceId(_ctx.stringValue("DescribeVpnPbrRouteEntriesResponse.VpnPbrRouteEntries[" + i + "].VpnInstanceId"));<NEW_LINE>vpnPbrRouteEntry.setRouteSource(_ctx.stringValue("DescribeVpnPbrRouteEntriesResponse.VpnPbrRouteEntries[" + i + "].RouteSource"));<NEW_LINE>vpnPbrRouteEntries.add(vpnPbrRouteEntry);<NEW_LINE>}<NEW_LINE>describeVpnPbrRouteEntriesResponse.setVpnPbrRouteEntries(vpnPbrRouteEntries);<NEW_LINE>return describeVpnPbrRouteEntriesResponse;<NEW_LINE>}
|
("DescribeVpnPbrRouteEntriesResponse.VpnPbrRouteEntries[" + i + "].CreateTime"));
|
415,675
|
public static SuggestionWindow ofDecompilerChange(String switchMessage, String title, GuiController controller, ClassViewport view) {<NEW_LINE>GridPane grid = new GridPane();<NEW_LINE>grid.setPadding(new Insets(15));<NEW_LINE>grid.setVgap(4);<NEW_LINE>grid.setAlignment(Pos.CENTER);<NEW_LINE>int col = 0;<NEW_LINE>for (col = 0; col < 3; col++) {<NEW_LINE>ColumnConstraints cc = new ColumnConstraints();<NEW_LINE>cc.setHgrow(Priority.ALWAYS);<NEW_LINE>cc.setFillWidth(true);<NEW_LINE>grid.getColumnConstraints().add(cc);<NEW_LINE>}<NEW_LINE>grid.add(new Label(switchMessage), 0, 0, 3, 1);<NEW_LINE>SuggestionWindow window = of(title, grid);<NEW_LINE>// Add decompiler switch buttons<NEW_LINE>col = 0;<NEW_LINE>ConfDecompile confDecompile = controller.config().decompile();<NEW_LINE>ConfDisplay confDisplay = controller.config().display();<NEW_LINE>for (DecompileImpl impl : DecompileImpl.values()) {<NEW_LINE>String text = impl.name();<NEW_LINE>ActionButton btn = new ActionButton(text, () -> {<NEW_LINE>confDecompile.decompiler = impl;<NEW_LINE>refreshConfigWindow(controller);<NEW_LINE>view.setOverrideDecompiler(null);<NEW_LINE>window.close();<NEW_LINE>});<NEW_LINE>btn.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);<NEW_LINE>// Disable current<NEW_LINE>if (impl == view.getDecompiler())<NEW_LINE>btn.setDisable(true);<NEW_LINE>grid.add(btn, col, 2);<NEW_LINE>col++;<NEW_LINE>}<NEW_LINE>grid.add(new Label(translate("suggest.switchmodes")), 0, 3, 3, 1);<NEW_LINE>// Add class mode switch button<NEW_LINE>col = 0;<NEW_LINE>for (ClassViewport.ClassMode mode : ClassViewport.ClassMode.values()) {<NEW_LINE>String text = mode.name();<NEW_LINE>ActionButton btn = new ActionButton(text, () -> {<NEW_LINE>confDisplay.classEditorMode = mode;<NEW_LINE>refreshConfigWindow(controller);<NEW_LINE>view.setOverrideMode(confDisplay.classEditorMode);<NEW_LINE>window.close();<NEW_LINE>});<NEW_LINE>btn.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);<NEW_LINE>// Disable current<NEW_LINE>if (mode == view.getClassMode())<NEW_LINE>btn.setDisable(true);<NEW_LINE>grid.<MASK><NEW_LINE>col++;<NEW_LINE>}<NEW_LINE>return window;<NEW_LINE>}
|
add(btn, col, 4);
|
1,682,268
|
public Object2IntRBTreeMap<SearchHit> execute(final int limit) {<NEW_LINE>final <MASK><NEW_LINE>final Sequence<Cursor> cursors = adapter.makeCursors(filter, interval, VirtualColumns.EMPTY, query.getGranularity(), query.isDescending(), null);<NEW_LINE>final Object2IntRBTreeMap<SearchHit> retVal = new Object2IntRBTreeMap<>(query.getSort().getComparator());<NEW_LINE>retVal.defaultReturnValue(0);<NEW_LINE>cursors.accumulate(retVal, (map, cursor) -> {<NEW_LINE>if (map.size() >= limit) {<NEW_LINE>return map;<NEW_LINE>}<NEW_LINE>final ColumnSelectorPlus<SearchColumnSelectorStrategy>[] selectorPlusList = DimensionHandlerUtils.createColumnSelectorPluses(SearchQueryRunner.SEARCH_COLUMN_SELECTOR_STRATEGY_FACTORY, dimsToSearch, cursor.getColumnSelectorFactory());<NEW_LINE>while (!cursor.isDone()) {<NEW_LINE>for (ColumnSelectorPlus<SearchColumnSelectorStrategy> selectorPlus : selectorPlusList) {<NEW_LINE>selectorPlus.getColumnSelectorStrategy().updateSearchResultSet(selectorPlus.getOutputName(), selectorPlus.getSelector(), searchQuerySpec, limit, map);<NEW_LINE>if (map.size() >= limit) {<NEW_LINE>return map;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cursor.advance();<NEW_LINE>}<NEW_LINE>return map;<NEW_LINE>});<NEW_LINE>return retVal;<NEW_LINE>}
|
StorageAdapter adapter = segment.asStorageAdapter();
|
660,595
|
synchronized Optional<BlockingQueue<Event>> registerStream(final String streamName) {<NEW_LINE>if (!streamQueuesMap.containsKey(streamName)) {<NEW_LINE>cleanupInactiveStreamQueues();<NEW_LINE>if (streamQueuesMap.keySet().size() >= config.maxNumStreams()) {<NEW_LINE>LOG.debug("failed to create queue for stream {} (MAX_NUM_STREAMS {} exceeded)", streamName, config.maxNumStreams());<NEW_LINE>mantisStreamCreateFailed.increment();<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>int qSize = config.streamQueueSize(streamName);<NEW_LINE>LOG.<MASK><NEW_LINE>streamQueuesMap.putIfAbsent(streamName, new LinkedBlockingQueue<>(qSize));<NEW_LINE>// Stream metrics are created and registered only after<NEW_LINE>// an app tries to emit an event to that stream.<NEW_LINE>// Having a subscription for a stream does not create the StreamMetrics.<NEW_LINE>streamMetricsMap.putIfAbsent(streamName, new StreamMetrics(registry, streamName));<NEW_LINE>}<NEW_LINE>return Optional.ofNullable(streamQueuesMap.get(streamName));<NEW_LINE>}
|
info("creating queue for stream {} (size: {})", streamName, qSize);
|
1,553,741
|
/* (non-Javadoc)<NEW_LINE>* @see com.dotmarketing.business.PermissionFactory#assignPermissions<NEW_LINE>* @deprecated Use save(permission) instead.<NEW_LINE>*/<NEW_LINE>@WrapInTransaction<NEW_LINE>@Override<NEW_LINE>@Deprecated<NEW_LINE>public void assignPermissions(List<Permission> permissions, Permissionable permissionable, User user, boolean respectFrontendRoles) throws DotDataException, DotSecurityException {<NEW_LINE>if (!doesUserHavePermission(permissionable, PermissionAPI.PERMISSION_EDIT_PERMISSIONS, user))<NEW_LINE>throw new DotSecurityException("User id: " + user.getUserId() + " does not have permission to alter permissions on asset " + permissionable.getPermissionId());<NEW_LINE>if (permissions == null || permissions.size() == 0) {<NEW_LINE>throw new DotDataException("This method is not intented to remove all permissionable permissions, instead use deletePermissions");<NEW_LINE>}<NEW_LINE>RoleAPI roleAPI = APILocator.getRoleAPI();<NEW_LINE>List<Permission> currentPermissions = permissionFactory.getPermissions(permissionable, true);<NEW_LINE>List<String> rolesIncluded = new ArrayList<String>();<NEW_LINE>List<Permission> includingLockedRolePermissions <MASK><NEW_LINE>for (Permission current : currentPermissions) {<NEW_LINE>Role role = roleAPI.loadRoleById(current.getRoleId());<NEW_LINE>if (!role.isEditPermissions()) {<NEW_LINE>Permission perm = new Permission(permissionable.getPermissionId(), current.getRoleId(), current.getPermission());<NEW_LINE>includingLockedRolePermissions.add(perm);<NEW_LINE>rolesIncluded.add(role.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Permission p : permissions) {<NEW_LINE>Role role = roleAPI.loadRoleById(p.getRoleId());<NEW_LINE>if (!role.isEditPermissions()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!p.getInode().equals(permissionable.getPermissionId()))<NEW_LINE>throw new DotDataException("Can't assign permissions to a diferent permissionable");<NEW_LINE>rolesIncluded.add(role.getId());<NEW_LINE>includingLockedRolePermissions.add(p);<NEW_LINE>}<NEW_LINE>for (Permission current : currentPermissions) {<NEW_LINE>Role role = roleAPI.loadRoleById(current.getRoleId());<NEW_LINE>if (role.isLocked() && !rolesIncluded.contains(role.getId())) {<NEW_LINE>current.setInode(permissionable.getPermissionId());<NEW_LINE>includingLockedRolePermissions.add(current);<NEW_LINE>rolesIncluded.add(role.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NOTE: Method "assignPermissions" is deprecated in favor of "savePermission", which has subtle functional differences. Please take these differences into consideration if planning to replace this method with the "savePermission"<NEW_LINE>permissionFactory.assignPermissions(includingLockedRolePermissions, permissionable);<NEW_LINE>if (permissionable instanceof Host) {<NEW_LINE>// Send a websocket event to notificate a site permission change<NEW_LINE>systemEventsAPI.pushAsync(SystemEventType.UPDATE_SITE_PERMISSIONS, new Payload(permissionable, Visibility.GLOBAL, (String) null));<NEW_LINE>}<NEW_LINE>AdminLogger.log(PermissionBitAPIImpl.class, "assign Permissions Action", "Assigning permissions to :" + permissionable.getPermissionId(), user);<NEW_LINE>}
|
= new ArrayList<Permission>();
|
1,447,801
|
public void lowerStoreIndexedNode(StoreIndexedNode storeIndexed, LoweringTool tool) {<NEW_LINE>StructuredGraph graph = storeIndexed.graph();<NEW_LINE>JavaKind elementKind = storeIndexed.elementKind();<NEW_LINE>ValueNode value = storeIndexed.value();<NEW_LINE>ValueNode array = storeIndexed.array();<NEW_LINE>AddressNode address = createArrayAddress(graph, array, elementKind, storeIndexed.index());<NEW_LINE>ValueNode writeValue = value;<NEW_LINE>Stamp valueStamp = <MASK><NEW_LINE>if (!(valueStamp instanceof PTXStamp) || !((PTXStamp) valueStamp).getPTXKind().isVector()) {<NEW_LINE>writeValue = implicitStoreConvert(graph, elementKind, value);<NEW_LINE>}<NEW_LINE>AbstractWriteNode memoryWrite = createMemWriteNode(elementKind, writeValue, array, address, graph, storeIndexed);<NEW_LINE>memoryWrite.setStateAfter(storeIndexed.stateAfter());<NEW_LINE>graph.replaceFixedWithFixed(storeIndexed, memoryWrite);<NEW_LINE>}
|
value.stamp(NodeView.DEFAULT);
|
1,769,415
|
private List<Pair<TicketReservation, Event>> findStuckPaymentsToBeNotified(Date expirationDate) {<NEW_LINE>List<ReservationIdAndEventId> <MASK><NEW_LINE>Map<Integer, Event> events;<NEW_LINE>if (!stuckReservations.isEmpty()) {<NEW_LINE>events = eventRepository.findByIds(stuckReservations.stream().map(ReservationIdAndEventId::getEventId).collect(toSet())).stream().collect(toMap(Event::getId, Function.identity()));<NEW_LINE>} else {<NEW_LINE>events = Map.of();<NEW_LINE>}<NEW_LINE>return stuckReservations.stream().map(id -> Pair.of(ticketReservationRepository.findReservationById(id.getId()), events.get(id.getEventId()))).filter(reservationAndEvent -> {<NEW_LINE>var event = reservationAndEvent.getRight();<NEW_LINE>var reservation = reservationAndEvent.getLeft();<NEW_LINE>var optionalTransaction = transactionRepository.loadOptionalByReservationIdAndStatusForUpdate(reservation.getId(), Transaction.Status.PENDING);<NEW_LINE>if (optionalTransaction.isEmpty()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>var transaction = optionalTransaction.get();<NEW_LINE>PaymentContext paymentContext = new PaymentContext(event, reservation.getId());<NEW_LINE>var paymentResultOptional = checkTransactionStatus(event, reservation);<NEW_LINE>if (paymentResultOptional.isEmpty()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>var providerAndWebhookResult = paymentResultOptional.get();<NEW_LINE>var paymentWebhookResult = providerAndWebhookResult.getRight();<NEW_LINE>handlePaymentWebhookResult(event, providerAndWebhookResult.getLeft(), paymentWebhookResult, reservation, transaction, paymentContext, "stuck-check", false);<NEW_LINE>return paymentWebhookResult.getType() == PaymentWebhookResult.Type.NOT_RELEVANT;<NEW_LINE>}).collect(toList());<NEW_LINE>}
|
stuckReservations = ticketReservationRepository.findStuckReservationsForUpdate(expirationDate);
|
1,809,128
|
final CreateFleetMetricResult executeCreateFleetMetric(CreateFleetMetricRequest createFleetMetricRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createFleetMetricRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateFleetMetricRequest> request = null;<NEW_LINE>Response<CreateFleetMetricResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateFleetMetricRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createFleetMetricRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateFleetMetric");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateFleetMetricResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateFleetMetricResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
invoke(request, responseHandler, executionContext);
|
525,582
|
private Page parsePage(NextPageData overflow, List<TokenWithWidth> wordsAndSpaces, Predicate<List<String>> canPlaceAnchors, Function<List<String>, Integer> getLines) {<NEW_LINE>List<List<Token>> page = new ArrayList<>();<NEW_LINE>NextLineData lineOverflow = overflow.topLine;<NEW_LINE>List<String> anchorsOnPage = new ArrayList<>();<NEW_LINE>while (page.size() < getLines.apply(anchorsOnPage) && lineOverflow != null) {<NEW_LINE>Function<List<String>, AnchorViability> getAnchorViability = anchors -> {<NEW_LINE>List<String> withNewAnchor = new ArrayList<>(anchorsOnPage);<NEW_LINE>withNewAnchor.addAll(anchors);<NEW_LINE>if (!canPlaceAnchors.test(withNewAnchor))<NEW_LINE>return AnchorViability.NOT_VALID;<NEW_LINE>else if (page.size() + 1 > getLines.apply(withNewAnchor))<NEW_LINE>// Allow specials larger than the page only if nothing else is placed on that page<NEW_LINE>return AnchorViability.VALID_IF_ALONE;<NEW_LINE>else<NEW_LINE>return AnchorViability.VALID;<NEW_LINE>};<NEW_LINE>Line next = parseLine(lineOverflow, getAnchorViability, wordsAndSpaces);<NEW_LINE>AnchorViability viability = getAnchorViability.apply(next.anchorsBeforeLine);<NEW_LINE>Preconditions.<MASK><NEW_LINE>if (viability == AnchorViability.VALID_IF_ALONE && !page.isEmpty())<NEW_LINE>break;<NEW_LINE>else<NEW_LINE>anchorsOnPage.addAll(next.anchorsBeforeLine);<NEW_LINE>if (!page.isEmpty() || !next.line.isEmpty())<NEW_LINE>page.add(next.line);<NEW_LINE>lineOverflow = next.overflow;<NEW_LINE>if (lineOverflow != null && lineOverflow.putOnNewPage)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// Remove empty lines at the end of the page<NEW_LINE>while (!page.isEmpty() && page.get(page.size() - 1).stream().allMatch(t -> t.getText().trim().isEmpty())) page.remove(page.size() - 1);<NEW_LINE>return new Page(page, anchorsOnPage, lineOverflow);<NEW_LINE>}
|
checkState(viability != AnchorViability.NOT_VALID);
|
1,686,035
|
public ListPredictorBacktestExportJobsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListPredictorBacktestExportJobsResult listPredictorBacktestExportJobsResult = new ListPredictorBacktestExportJobsResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return listPredictorBacktestExportJobsResult;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("PredictorBacktestExportJobs", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listPredictorBacktestExportJobsResult.setPredictorBacktestExportJobs(new ListUnmarshaller<PredictorBacktestExportJobSummary>(PredictorBacktestExportJobSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listPredictorBacktestExportJobsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listPredictorBacktestExportJobsResult;<NEW_LINE>}
|
String currentParentElement = context.getCurrentParentElement();
|
166,289
|
public String buildInsertQuery(final String ksName, final String cfName, final Map<String, ByteBuffer> map, final String id, final boolean ifNotExists, ByteBuffer[] values, final int valuesOffset) {<NEW_LINE>final StringBuilder questionsMarks = new StringBuilder();<NEW_LINE>final StringBuilder columnNames = new StringBuilder();<NEW_LINE>int i = 0;<NEW_LINE>for (Entry<String, ByteBuffer> entry : map.entrySet()) {<NEW_LINE>if (entry.getKey().equals(TokenFieldMapper.NAME))<NEW_LINE>continue;<NEW_LINE>if (columnNames.length() > 0) {<NEW_LINE>columnNames.append(',');<NEW_LINE>questionsMarks.append(',');<NEW_LINE>}<NEW_LINE>columnNames.append("\"").append(entry.getKey()).append("\"");<NEW_LINE>questionsMarks.append('?');<NEW_LINE>values[valuesOffset + i] = entry.getValue();<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>final StringBuilder query = new StringBuilder();<NEW_LINE>query.append("INSERT INTO \"").append(ksName).append("\".\"").append(cfName).append("\" (").append(columnNames.toString()).append(") VALUES (").append(questionsMarks.toString<MASK><NEW_LINE>if (ifNotExists)<NEW_LINE>query.append("IF NOT EXISTS ");<NEW_LINE>return query.toString();<NEW_LINE>}
|
()).append(") ");
|
429,620
|
public int loadTable(ResultSet rs) {<NEW_LINE>int no = 0;<NEW_LINE>int row = 0;<NEW_LINE>//<NEW_LINE>clearTable();<NEW_LINE>try {<NEW_LINE>while (rs.next()) {<NEW_LINE>no++;<NEW_LINE>setRowCount(row + 1);<NEW_LINE>int colOffset = 1;<NEW_LINE>int col = 0;<NEW_LINE>// BR [ 257 ]<NEW_LINE>for (MBrowseField field : getFields()) {<NEW_LINE>Object value = null;<NEW_LINE>if (field.isKey() && DisplayType.isID(field.getAD_Reference_ID()) && !field.getAD_View_Column().getColumnSQL().equals("'Row' AS \"Row\""))<NEW_LINE>value = new IDColumn(rs.getInt(col + colOffset));<NEW_LINE>else if (field.isKey() && (DisplayType.isNumeric(field.getAD_Reference_ID()) && field.getAD_View_Column().getColumnSQL().equals("'Row' AS \"Row\"") || (!DisplayType.isID(field.getAD_Reference_ID()) && DisplayType.Integer != field.getAD_Reference_ID())))<NEW_LINE>value = new IDColumn(no);<NEW_LINE>else if (DisplayType.isID(field.getAD_Reference_ID()) || field.getAD_Reference_ID() == DisplayType.Integer) {<NEW_LINE>Integer id = rs.getInt(col + colOffset);<NEW_LINE>value = id != 0 ? id : null;<NEW_LINE>} else if (DisplayType.isNumeric(field.getAD_Reference_ID()))<NEW_LINE>value = rs.getBigDecimal(col + colOffset);<NEW_LINE>else if (DisplayType.isDate(field.getAD_Reference_ID()))<NEW_LINE>value = rs.getTimestamp(col + colOffset);<NEW_LINE>else if (DisplayType.YesNo == field.getAD_Reference_ID()) {<NEW_LINE>value = rs.getString(col + colOffset);<NEW_LINE>if (value != null)<NEW_LINE>value = value.equals("Y");<NEW_LINE>} else<NEW_LINE>value = rs.getObject(col + colOffset);<NEW_LINE>GridField gridField = MBrowseField.createGridFieldVO(field, browser.getWindowNo());<NEW_LINE><MASK><NEW_LINE>// Set Value<NEW_LINE>setValueAnyColumn(row, col, gridField);<NEW_LINE>col++;<NEW_LINE>}<NEW_LINE>row++;<NEW_LINE>}<NEW_LINE>} catch (SQLException exception) {<NEW_LINE>logger.log(Level.SEVERE, "", exception);<NEW_LINE>}<NEW_LINE>autoSize();<NEW_LINE>if (isShowTotals())<NEW_LINE>addTotals();<NEW_LINE>// repaint the table<NEW_LINE>this.repaint();<NEW_LINE>logger.config("Row(rs)=" + getRowCount());<NEW_LINE>// Return Row No<NEW_LINE>return no;<NEW_LINE>}
|
gridField.setValue(value, true);
|
178,679
|
public void writeImage(JRImage image) throws IOException {<NEW_LINE>writer.startElement(JRXmlConstants.ELEMENT_image, getNamespace());<NEW_LINE>writer.addAttribute(JRXmlConstants.ATTRIBUTE_scaleImage, image.getOwnScaleImageValue());<NEW_LINE>if (isNewerVersionOrEqual(JRConstants.VERSION_6_10_0)) {<NEW_LINE>writer.addAttribute(JRXmlConstants.ATTRIBUTE_rotation, image.getOwnRotation());<NEW_LINE>}<NEW_LINE>writer.addAttribute(JRXmlConstants.ATTRIBUTE_hAlign, image.getOwnHorizontalImageAlign());<NEW_LINE>writer.addAttribute(JRXmlConstants.ATTRIBUTE_vAlign, image.getOwnVerticalImageAlign());<NEW_LINE>writer.addAttribute(JRXmlConstants.ATTRIBUTE_isUsingCache, image.getUsingCache());<NEW_LINE>writer.addAttribute(JRXmlConstants.ATTRIBUTE_isLazy, image.isLazy(), false);<NEW_LINE>writer.addAttribute(JRXmlConstants.ATTRIBUTE_onErrorType, image.getOnErrorTypeValue(), OnErrorTypeEnum.ERROR);<NEW_LINE>writer.addAttribute(JRXmlConstants.ATTRIBUTE_evaluationTime, image.getEvaluationTimeValue(), EvaluationTimeEnum.NOW);<NEW_LINE>if (image.getEvaluationGroup() != null) {<NEW_LINE>writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_evaluationGroup, image.getEvaluationGroup().getName());<NEW_LINE>}<NEW_LINE>writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_hyperlinkType, image.getLinkType(), <MASK><NEW_LINE>writer.addEncodedAttribute(JRXmlConstants.ATTRIBUTE_hyperlinkTarget, image.getLinkTarget(), HyperlinkTargetEnum.SELF.getName());<NEW_LINE>writer.addAttribute(JRXmlConstants.ATTRIBUTE_bookmarkLevel, image.getBookmarkLevel(), JRAnchor.NO_BOOKMARK);<NEW_LINE>writeReportElement(image);<NEW_LINE>writeBox(image.getLineBox());<NEW_LINE>writeGraphicElement(image);<NEW_LINE>// FIXME class is mandatory in verifier<NEW_LINE>writeExpression(JRXmlConstants.ELEMENT_imageExpression, image.getExpression(), true);<NEW_LINE>writeExpression(JRXmlConstants.ELEMENT_anchorNameExpression, image.getAnchorNameExpression(), false);<NEW_LINE>if (isNewerVersionOrEqual(JRConstants.VERSION_6_13_0)) {<NEW_LINE>writeExpression(JRXmlConstants.ELEMENT_bookmarkLevelExpression, image.getBookmarkLevelExpression(), false);<NEW_LINE>}<NEW_LINE>writeExpression(JRXmlConstants.ELEMENT_hyperlinkReferenceExpression, image.getHyperlinkReferenceExpression(), false);<NEW_LINE>// FIXMENOW can we reuse method for writing hyperlink?<NEW_LINE>writeExpression(JRXmlConstants.ELEMENT_hyperlinkWhenExpression, image.getHyperlinkWhenExpression(), false);<NEW_LINE>writeExpression(JRXmlConstants.ELEMENT_hyperlinkAnchorExpression, image.getHyperlinkAnchorExpression(), false);<NEW_LINE>writeExpression(JRXmlConstants.ELEMENT_hyperlinkPageExpression, image.getHyperlinkPageExpression(), false);<NEW_LINE>writeExpression(JRXmlConstants.ELEMENT_hyperlinkTooltipExpression, image.getHyperlinkTooltipExpression(), false);<NEW_LINE>writeHyperlinkParameters(image.getHyperlinkParameters());<NEW_LINE>writer.closeElement();<NEW_LINE>}
|
HyperlinkTypeEnum.NONE.getName());
|
1,460,732
|
public IRubyObject onEvent(final ThreadContext context, final IRubyObject[] args) {<NEW_LINE>String message = <MASK><NEW_LINE>long eventDurationNanos = ((RubyNumeric) args[3]).getLongValue();<NEW_LINE>if (warnThreshold >= 0 && eventDurationNanos > warnThreshold) {<NEW_LINE>slowLogger.warn(message, asData(context, args[1], args[2], args[3]));<NEW_LINE>} else if (infoThreshold >= 0 && eventDurationNanos > infoThreshold) {<NEW_LINE>slowLogger.info(message, asData(context, args[1], args[2], args[3]));<NEW_LINE>} else if (debugThreshold >= 0 && eventDurationNanos > debugThreshold) {<NEW_LINE>slowLogger.debug(message, asData(context, args[1], args[2], args[3]));<NEW_LINE>} else if (traceThreshold >= 0 && eventDurationNanos > traceThreshold) {<NEW_LINE>slowLogger.trace(message, asData(context, args[1], args[2], args[3]));<NEW_LINE>}<NEW_LINE>return context.nil;<NEW_LINE>}
|
args[0].asJavaString();
|
1,076,859
|
protected IStatus updateDataSource(DBRProgressMonitor monitor) {<NEW_LINE>UIServiceConnections serviceConnections = DBWorkbench.getService(UIServiceConnections.class);<NEW_LINE>if (serviceConnections != null) {<NEW_LINE>synchronized (CONFIRM_SYNC) {<NEW_LINE>if (!serviceConnections.confirmTransactionsClose(txnToEnd.keySet().toArray(new DBCExecutionContext[0]))) {<NEW_LINE>return Status.CANCEL_STATUS;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>log.debug("End idle " + txnToEnd.size() + " transactions for " + dataSource.getContainer().getId());<NEW_LINE>for (Map.Entry<DBCExecutionContext, DBCTransactionManager> tee : txnToEnd.entrySet()) {<NEW_LINE>try (DBCSession session = tee.getKey().openSession(monitor, DBCExecutionPurpose.UTIL, "End idle transaction")) {<NEW_LINE>try {<NEW_LINE>tee.getValue().rollback(session, null);<NEW_LINE>} catch (DBCException e) {<NEW_LINE>log.error("Error ending idle transaction", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>DBeaverNotifications.showNotification(dataSource, DBeaverNotifications.<MASK><NEW_LINE>return Status.OK_STATUS;<NEW_LINE>}
|
NT_ROLLBACK, "Transactions have been rolled back after long idle period", DBPMessageType.ERROR);
|
206,631
|
protected void configure() {<NEW_LINE>bind(AclManagerImpl.class).to(AclManager.class);<NEW_LINE>bind(BrokerConfigManagerImpl.class).to(BrokerConfigManager.class);<NEW_LINE>bind(BrokerManagerImpl.class).to(BrokerManager.class);<NEW_LINE>bind(ClusterConfigManagerImpl.class).to(ClusterConfigManager.class);<NEW_LINE>bind(ClusterManagerImpl.class).to(ClusterManager.class);<NEW_LINE>bind(ConsumerAssignmentManagerImpl.class<MASK><NEW_LINE>bind(ConsumerGroupLagSummaryManagerImpl.class).to(ConsumerGroupLagSummaryManager.class);<NEW_LINE>bind(ConsumerGroupManagerImpl.class).to(ConsumerGroupManager.class);<NEW_LINE>bind(ConsumerLagManagerImpl.class).to(ConsumerLagManager.class);<NEW_LINE>bind(ConsumerManagerImpl.class).to(ConsumerManager.class);<NEW_LINE>bindAsContract(NoSchemaRecordSerializer.class).in(Singleton.class);<NEW_LINE>bind(PartitionManagerImpl.class).to(PartitionManager.class);<NEW_LINE>bind(ProduceControllerImpl.class).to(ProduceController.class);<NEW_LINE>bind(ReassignmentManagerImpl.class).to(ReassignmentManager.class);<NEW_LINE>bind(RecordSerializerFacade.class).to(RecordSerializer.class);<NEW_LINE>bind(ReplicaManagerImpl.class).to(ReplicaManager.class);<NEW_LINE>bindFactory(SchemaManagerFactory.class).to(SchemaManager.class);<NEW_LINE>bind(TopicConfigManagerImpl.class).to(TopicConfigManager.class);<NEW_LINE>bind(TopicManagerImpl.class).to(TopicManager.class);<NEW_LINE>bindFactory(SchemaRecordSerializerFactory.class).to(SchemaRecordSerializer.class);<NEW_LINE>}
|
).to(ConsumerAssignmentManager.class);
|
1,350,834
|
List<String> listEditable(Business business, EffectivePerson effectivePerson) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Portal.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Portal> root = cq.from(Portal.class);<NEW_LINE>Predicate p = cb.conjunction();<NEW_LINE>if (!effectivePerson.isSecurityManager() && !business.isPortalManager(effectivePerson)) {<NEW_LINE>p = cb.isMember(effectivePerson.getDistinguishedName(), root<MASK><NEW_LINE>p = cb.or(p, cb.equal(root.get(Portal_.creatorPerson), effectivePerson.getDistinguishedName()));<NEW_LINE>}<NEW_LINE>cq.select(root.get(Portal_.id)).where(p);<NEW_LINE>List<String> list = em.createQuery(cq).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>return list;<NEW_LINE>}
|
.get(Portal_.controllerList));
|
91,814
|
public static void main(String[] args) {<NEW_LINE>Properties options = StringUtils.argsToProperties(args, argOptionDefs);<NEW_LINE>if (!options.containsKey("") || options.containsKey("help")) {<NEW_LINE>log.info(usage());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean retainNER = PropertiesUtils.getBool(options, "ner", false);<NEW_LINE>boolean normalize = PropertiesUtils.getBool(options, "normalize", true);<NEW_LINE>final File treeFile = new File(options.getProperty(""));<NEW_LINE>TwoDimensionalCounter<String, String> labelTerm = new TwoDimensionalCounter<>();<NEW_LINE>TwoDimensionalCounter<String, String> termLabel = new TwoDimensionalCounter<>();<NEW_LINE>TwoDimensionalCounter<String, String> labelPreterm = new TwoDimensionalCounter<>();<NEW_LINE>TwoDimensionalCounter<String, String> pretermLabel = new TwoDimensionalCounter<>();<NEW_LINE>TwoDimensionalCounter<String, String> unigramTagger = new TwoDimensionalCounter<>();<NEW_LINE>try {<NEW_LINE>BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(treeFile), "UTF-8"));<NEW_LINE>TreeReaderFactory trf = new SpanishTreeReaderFactory();<NEW_LINE>TreeReader tr = trf.newTreeReader(br);<NEW_LINE>for (Tree t; (t = tr.readTree()) != null; ) {<NEW_LINE>updateTagger(unigramTagger, t);<NEW_LINE>}<NEW_LINE>// Closes the underlying reader<NEW_LINE>tr.close();<NEW_LINE>System.out.println("Resolving DUMMY tags");<NEW_LINE>resolveDummyTags(treeFile, unigramTagger, retainNER, normalize ? new SpanishTreeNormalizer(true<MASK><NEW_LINE>System.out.println("#Unknown Word Types: " + ManualUWModel.nUnknownWordTypes);<NEW_LINE>System.out.println(String.format("#Missing POS: %d (fixed: %d, %.2f%%)", nMissingPOS, nFixedPOS, (double) nFixedPOS / nMissingPOS * 100));<NEW_LINE>System.out.println(String.format("#Missing Phrasal: %d (fixed: %d, %.2f%%)", nMissingPhrasal, nFixedPhrasal, (double) nFixedPhrasal / nMissingPhrasal * 100));<NEW_LINE>System.out.println("Done!");<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
|
, false, false) : null);
|
211,761
|
public void selected() {<NEW_LINE>Coordinator c = _root.getCoordinator();<NEW_LINE>c.getShowLiveDeploymentFiltersAction().setEnabled(false);<NEW_LINE>c.getCloseApplicationAction().setEnabled(true);<NEW_LINE>c.getSaveAction().setEnabled(_root.needsSaving() && (_root.isLive() && c.connectedToMaster() || _root.hasFile()));<NEW_LINE>c.getDiscardUpdatesAction().setEnabled(_root.needsSaving() && (_root.isLive() || _root.hasFile()));<NEW_LINE>if (_root.isLive()) {<NEW_LINE>c.getSaveToRegistryAction().setEnabled(_root.needsSaving(<MASK><NEW_LINE>c.getSaveToRegistryWithoutRestartAction().setEnabled(_root.needsSaving() && c.connectedToMaster());<NEW_LINE>} else {<NEW_LINE>c.getSaveToRegistryAction().setEnabled(c.connectedToMaster());<NEW_LINE>c.getSaveToRegistryWithoutRestartAction().setEnabled(c.connectedToMaster());<NEW_LINE>}<NEW_LINE>c.getSaveToFileAction().setEnabled(true);<NEW_LINE>c.getBackAction().setEnabled(_previousNodes.size() > 0);<NEW_LINE>c.getForwardAction().setEnabled(_nextNodes.size() > 0);<NEW_LINE>c.showActions(_currentNode);<NEW_LINE>}
|
) && c.connectedToMaster());
|
583,679
|
private Clipboard readVersion3(CompoundTag schematicTag, VersionedDataFixer fixer) throws IOException {<NEW_LINE>Map<String, Tag> schematic = schematicTag.getValue();<NEW_LINE>int width = requireTag(schematic, "Width", ShortTag.class).getValue() & 0xFFFF;<NEW_LINE>int height = requireTag(schematic, "Height", ShortTag.class).getValue() & 0xFFFF;<NEW_LINE>int length = requireTag(schematic, "Length", ShortTag.class).getValue() & 0xFFFF;<NEW_LINE>BlockVector3 offset = ReaderUtil.decodeBlockVector3(SchematicNbtUtil.getTag(schematic, "Offset", IntArrayTag.class));<NEW_LINE>BlockVector3 origin = BlockVector3.ZERO;<NEW_LINE>CompoundTag metadataTag = getTag(schematic, "Metadata", CompoundTag.class);<NEW_LINE>if (metadataTag != null && metadataTag.containsKey("WorldEdit")) {<NEW_LINE>// We appear to have WorldEdit Metadata<NEW_LINE>Map<String, Tag> worldedit = requireTag(metadataTag.getValue(), "WorldEdit", CompoundTag.class).getValue();<NEW_LINE>origin = ReaderUtil.decodeBlockVector3(SchematicNbtUtil.getTag(worldedit, "Origin", IntArrayTag.class));<NEW_LINE>}<NEW_LINE>BlockVector3 <MASK><NEW_LINE>BlockArrayClipboard clipboard = new BlockArrayClipboard(new CuboidRegion(min, min.add(width, height, length).subtract(BlockVector3.ONE)));<NEW_LINE>clipboard.setOrigin(origin);<NEW_LINE>decodeBlocksIntoClipboard(fixer, schematic, clipboard);<NEW_LINE>CompoundTag biomeContainer = getTag(schematic, "Biomes", CompoundTag.class);<NEW_LINE>if (biomeContainer != null) {<NEW_LINE>readBiomes3(clipboard, biomeContainer.getValue(), fixer);<NEW_LINE>}<NEW_LINE>ListTag entities = getTag(schematic, "Entities", ListTag.class);<NEW_LINE>if (entities != null) {<NEW_LINE>ReaderUtil.readEntities(clipboard, entities.getValue(), fixer, true);<NEW_LINE>}<NEW_LINE>return clipboard;<NEW_LINE>}
|
min = offset.add(origin);
|
355,901
|
public static SketchHolder sketchSetOperation(Func func, int sketchSize, Object... holders) {<NEW_LINE>// in the code below, I am returning SetOp.getResult(false, null)<NEW_LINE>// "false" gets us an unordered sketch which is faster to build<NEW_LINE>// "true" returns an ordered sketch but slower to compute. advantage of ordered sketch<NEW_LINE>// is that they are faster to "union" later but given that this method is used in<NEW_LINE>// the final stages of query processing, ordered sketch would be of no use.<NEW_LINE>switch(func) {<NEW_LINE>case UNION:<NEW_LINE>Union union = (Union) SetOperation.builder().setNominalEntries(sketchSize).build(Family.UNION);<NEW_LINE>for (Object o : holders) {<NEW_LINE>((SketchHolder) o).updateUnion(union);<NEW_LINE>}<NEW_LINE>return SketchHolder.of(union);<NEW_LINE>case INTERSECT:<NEW_LINE>Intersection intersection = (Intersection) SetOperation.builder().setNominalEntries(sketchSize).build(Family.INTERSECTION);<NEW_LINE>for (Object o : holders) {<NEW_LINE>intersection.intersect(((SketchHolder) o).getSketch());<NEW_LINE>}<NEW_LINE>return SketchHolder.of(intersection.getResult(false, null));<NEW_LINE>case NOT:<NEW_LINE>if (holders.length < 1) {<NEW_LINE>throw new IllegalArgumentException("A-Not-B requires at least 1 sketch");<NEW_LINE>}<NEW_LINE>if (holders.length == 1) {<NEW_LINE>return (SketchHolder) holders[0];<NEW_LINE>}<NEW_LINE>Sketch result = ((SketchHolder) holders<MASK><NEW_LINE>for (int i = 1; i < holders.length; i++) {<NEW_LINE>AnotB anotb = (AnotB) SetOperation.builder().setNominalEntries(sketchSize).build(Family.A_NOT_B);<NEW_LINE>result = anotb.aNotB(result, ((SketchHolder) holders[i]).getSketch());<NEW_LINE>}<NEW_LINE>return SketchHolder.of(result);<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Unknown sketch operation " + func);<NEW_LINE>}<NEW_LINE>}
|
[0]).getSketch();
|
44,351
|
public void paint(Graphics g) {<NEW_LINE>Graphics2D g2 = (Graphics2D) g;<NEW_LINE>g2.setStroke(new BasicStroke(2));<NEW_LINE>for (int i = 1; i < w; i += RectSize) {<NEW_LINE>for (int j = 1; j < h; j += RectSize) {<NEW_LINE>Node current = arr[i <MASK><NEW_LINE>if (currently.contains(current)) {<NEW_LINE>g2.setColor(Color.green);<NEW_LINE>g2.fillRect(i, j, RectSize, RectSize);<NEW_LINE>} else if (visited.contains(current)) {<NEW_LINE>g2.setColor(Color.WHITE);<NEW_LINE>if (current.isHasTop())<NEW_LINE>g2.drawLine(i, j, i + RectSize, j);<NEW_LINE>if (current.isHasRight())<NEW_LINE>g2.drawLine(i + RectSize, j, i + RectSize, j + RectSize);<NEW_LINE>if (current.isHasBottom())<NEW_LINE>g2.drawLine(i, j + RectSize, i + RectSize, j + RectSize);<NEW_LINE>if (current.isHasLeft())<NEW_LINE>g2.drawLine(i, j, i, j + RectSize);<NEW_LINE>g2.setColor(Color.BLACK);<NEW_LINE>g2.fillRect(i, j, RectSize, RectSize);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
/ RectSize][j / RectSize];
|
924,269
|
private void modifyForSoundVibrationAndLight(Builder mBuilder, boolean notify, boolean quietHours, SharedPreferences preferences) {<NEW_LINE>final Resources resources = mXmppConnectionService.getResources();<NEW_LINE>final String ringtone = preferences.getString("notification_ringtone", resources.getString(R.string.notification_ringtone));<NEW_LINE>final boolean vibrate = preferences.getBoolean("vibrate_on_notification", resources.getBoolean(R.bool.vibrate_on_notification));<NEW_LINE>final boolean led = preferences.getBoolean("led", resources.getBoolean(R.bool.led));<NEW_LINE>final boolean headsup = preferences.getBoolean("notification_headsup", resources.getBoolean(R.bool.headsup_notifications));<NEW_LINE>if (notify && !quietHours) {<NEW_LINE>if (vibrate) {<NEW_LINE>final int dat = 70;<NEW_LINE>final long[] pattern = { 0, 3 * dat, dat, dat };<NEW_LINE>mBuilder.setVibrate(pattern);<NEW_LINE>} else {<NEW_LINE>mBuilder.setVibrate(new long[] { 0 });<NEW_LINE>}<NEW_LINE>Uri uri = Uri.parse(ringtone);<NEW_LINE>try {<NEW_LINE>mBuilder.setSound(fixRingtoneUri(uri));<NEW_LINE>} catch (SecurityException e) {<NEW_LINE>Log.d(Config.LOGTAG, <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>mBuilder.setLocalOnly(true);<NEW_LINE>}<NEW_LINE>if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {<NEW_LINE>mBuilder.setCategory(Notification.CATEGORY_MESSAGE);<NEW_LINE>}<NEW_LINE>mBuilder.setPriority(notify ? (headsup ? NotificationCompat.PRIORITY_HIGH : NotificationCompat.PRIORITY_DEFAULT) : NotificationCompat.PRIORITY_LOW);<NEW_LINE>setNotificationColor(mBuilder);<NEW_LINE>mBuilder.setDefaults(0);<NEW_LINE>if (led) {<NEW_LINE>mBuilder.setLights(LED_COLOR, 2000, 3000);<NEW_LINE>}<NEW_LINE>}
|
"unable to use custom notification sound " + uri.toString());
|
367,544
|
private void updateAgencyLogo(String path) throws IOException {<NEW_LINE>agencyLogoPathField.setText(path);<NEW_LINE>ImageIcon agencyLogoIcon = new ImageIcon();<NEW_LINE>agencyLogoPreview.setText(NbBundle.getMessage(AutopsyOptionsPanel.class, "AutopsyOptionsPanel.agencyLogoPreview.text"));<NEW_LINE>if (!agencyLogoPathField.getText().isEmpty()) {<NEW_LINE>File file = new <MASK><NEW_LINE>if (file.exists()) {<NEW_LINE>// create it as an image first to support BMP files<NEW_LINE>BufferedImage image = ImageIO.read(file);<NEW_LINE>if (image == null) {<NEW_LINE>throw new IOException("Unable to read file as a BufferedImage for file " + file.toString());<NEW_LINE>}<NEW_LINE>agencyLogoIcon = new ImageIcon(image.getScaledInstance(64, 64, 4));<NEW_LINE>agencyLogoPreview.setText("");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>agencyLogoPreview.setIcon(agencyLogoIcon);<NEW_LINE>agencyLogoPreview.repaint();<NEW_LINE>}
|
File(agencyLogoPathField.getText());
|
1,673,542
|
private static Set<Class<?>> sumNonJerseyBoundInjectables() {<NEW_LINE>final Set<Class<?>> injectables = new HashSet<>();<NEW_LINE>// JAX-RS<NEW_LINE>injectables.add(Application.class);<NEW_LINE>injectables.add(Configuration.class);<NEW_LINE>injectables.add(ContainerRequestContext.class);<NEW_LINE>injectables.add(HttpHeaders.class);<NEW_LINE>injectables.add(ParamConverterProvider.class);<NEW_LINE>injectables.add(Providers.class);<NEW_LINE>injectables.add(Request.class);<NEW_LINE>injectables.add(ResourceContext.class);<NEW_LINE><MASK><NEW_LINE>injectables.add(SecurityContext.class);<NEW_LINE>injectables.add(Sse.class);<NEW_LINE>injectables.add(UriInfo.class);<NEW_LINE>// Servlet if available<NEW_LINE>addOptionally("javax.servlet.http.HttpServletRequest", injectables);<NEW_LINE>addOptionally("javax.servlet.http.HttpServletResponse", injectables);<NEW_LINE>addOptionally("javax.servlet.ServletConfig", injectables);<NEW_LINE>addOptionally("javax.servlet.ServletContext", injectables);<NEW_LINE>addOptionally("javax.servlet.FilterConfig", injectables);<NEW_LINE>return injectables;<NEW_LINE>}
|
injectables.add(ResourceInfo.class);
|
1,193,300
|
private OperationExt newRouteDescriptor(ParserContext ctx, MethodNode node, String httpMethod, String prefix) {<NEW_LINE>Optional<RequestBodyExt> requestBody = RequestParser.requestBody(ctx, node);<NEW_LINE>List<ParameterExt> arguments = RequestParser.parameters(node);<NEW_LINE>ResponseExt response = new ResponseExt();<NEW_LINE>List<String> returnTypes = ReturnTypeParser.parse(ctx, node);<NEW_LINE>response.setJavaTypes(returnTypes);<NEW_LINE>OperationExt operation = new OperationExt(node, <MASK><NEW_LINE>boolean notSynthetic = (node.access & Opcodes.ACC_SYNTHETIC) == 0;<NEW_LINE>boolean lambda = node.name.equals("apply") || node.name.equals("invoke");<NEW_LINE>if (notSynthetic && !lambda) {<NEW_LINE>operation.setOperationId(node.name);<NEW_LINE>}<NEW_LINE>requestBody.ifPresent(operation::setRequestBody);<NEW_LINE>return operation;<NEW_LINE>}
|
httpMethod, prefix, arguments, response);
|
178,279
|
public static Certificate createMasterCert(PublicKey pubKey, PrivateKey privKey) throws Exception {<NEW_LINE>//<NEW_LINE>// signers name<NEW_LINE>//<NEW_LINE>String issuer = "C=AU, O=The Legion of the Bouncy Castle, OU=Bouncy Primary Certificate";<NEW_LINE>//<NEW_LINE>// subjects name - the same as we are self signed.<NEW_LINE>//<NEW_LINE>String subject = "C=AU, O=The Legion of the Bouncy Castle, OU=Bouncy Primary Certificate";<NEW_LINE>//<NEW_LINE>// create the certificate - version 1<NEW_LINE>//<NEW_LINE>X509v1CertificateBuilder v1Bldr = new JcaX509v1CertificateBuilder(new X500Name(issuer), BigInteger.valueOf(1), new Date(System.currentTimeMillis() - 1000L * 60 * 60 * 24 * 30), new Date(System.currentTimeMillis() + (1000L * 60 * 60 * 24 * 30)), new X500Name(subject), pubKey);<NEW_LINE>X509CertificateHolder certHldr = v1Bldr.build(new JcaContentSignerBuilder("SHA1WithRSA").setProvider("BC").build(privKey));<NEW_LINE>X509Certificate cert = new JcaX509CertificateConverter().setProvider("BC").getCertificate(certHldr);<NEW_LINE>cert<MASK><NEW_LINE>cert.verify(pubKey);<NEW_LINE>PKCS12BagAttributeCarrier bagAttr = (PKCS12BagAttributeCarrier) cert;<NEW_LINE>//<NEW_LINE>// this is actually optional - but if you want to have control<NEW_LINE>// over setting the friendly name this is the way to do it...<NEW_LINE>//<NEW_LINE>bagAttr.setBagAttribute(PKCSObjectIdentifiers.pkcs_9_at_friendlyName, new DERBMPString("Bouncy Primary Certificate"));<NEW_LINE>return cert;<NEW_LINE>}
|
.checkValidity(new Date());
|
1,611,548
|
private ArrayBuilder arrayBuilderFor(IPCClient client, Field field) throws VineyardException {<NEW_LINE>if (field.getType().equals(Arrow.Type.Boolean)) {<NEW_LINE>return new BooleanArrayBuilder(client, rows);<NEW_LINE>} else if (field.getType().equals(Arrow.Type.Int)) {<NEW_LINE><MASK><NEW_LINE>} else if (field.getType().equals(Arrow.Type.Int64)) {<NEW_LINE>return new Int64ArrayBuilder(client, rows);<NEW_LINE>} else if (field.getType().equals(Arrow.Type.Float)) {<NEW_LINE>return new FloatArrayBuilder(client, rows);<NEW_LINE>} else if (field.getType().equals(Arrow.Type.Double)) {<NEW_LINE>return new DoubleArrayBuilder(client, rows);<NEW_LINE>} else if (field.getType().equals(Arrow.Type.VarChar)) {<NEW_LINE>return new StringArrayBuilder(client, rows);<NEW_LINE>} else if (field.getType().equals(Arrow.Type.Null)) {<NEW_LINE>return new NullArrayBuilder(client, rows);<NEW_LINE>} else {<NEW_LINE>throw new VineyardException.NotImplemented("array builder for type " + field.getType() + " is not supported");<NEW_LINE>}<NEW_LINE>}
|
return new Int32ArrayBuilder(client, rows);
|
976,769
|
public List<Integer> countSmaller(int[] nums) {<NEW_LINE>Set<Integer> <MASK><NEW_LINE>for (int v : nums) {<NEW_LINE>s.add(v);<NEW_LINE>}<NEW_LINE>List<Integer> alls = new ArrayList<>(s);<NEW_LINE>alls.sort(Comparator.comparingInt(a -> a));<NEW_LINE>int n = alls.size();<NEW_LINE>Map<Integer, Integer> m = new HashMap<>(n);<NEW_LINE>for (int i = 0; i < n; ++i) {<NEW_LINE>m.put(alls.get(i), i + 1);<NEW_LINE>}<NEW_LINE>BinaryIndexedTree tree = new BinaryIndexedTree(n);<NEW_LINE>LinkedList<Integer> ans = new LinkedList<>();<NEW_LINE>for (int i = nums.length - 1; i >= 0; --i) {<NEW_LINE>int x = m.get(nums[i]);<NEW_LINE>tree.update(x, 1);<NEW_LINE>ans.addFirst(tree.query(x - 1));<NEW_LINE>}<NEW_LINE>return ans;<NEW_LINE>}
|
s = new HashSet<>();
|
101,544
|
private void initCards() {<NEW_LINE>ArrayList<Card> cards = new ArrayList<Card>();<NEW_LINE>for (int i = 0; i < 50; i++) {<NEW_LINE>CardExample card = new CardExample(getActivity(), "My title " + i, "Inner text " + i);<NEW_LINE>cards.add(card);<NEW_LINE>CardExample2 cardx = new CardExample2(this.getActivity());<NEW_LINE>cardx.title = "Application example " + i;<NEW_LINE>cardx.secondaryTitle = "A company inc..." + i;<NEW_LINE>cardx.rating = (float) (Math.<MASK><NEW_LINE>cardx.count = i;<NEW_LINE>cards.add(cardx);<NEW_LINE>MayKnowCard card2 = new MayKnowCard(getActivity());<NEW_LINE>// Very important with different inner layout<NEW_LINE>card2.setType(2);<NEW_LINE>card2.setSwipeable(true);<NEW_LINE>cards.add(card2);<NEW_LINE>}<NEW_LINE>// Provide a custom adapter.<NEW_LINE>// It is important to set the viewTypeCount<NEW_LINE>// You have to provide in your card the type value with {@link Card#setType(int)} method.<NEW_LINE>CardArrayAdapter mCardArrayAdapter = new CardArrayAdapter(getActivity(), cards);<NEW_LINE>mCardArrayAdapter.setInnerViewTypeCount(3);<NEW_LINE>// An alternative is to write a own CardArrayAdapter<NEW_LINE>// MyCardArrayAdapter mCardArrayAdapter = new MyCardArrayAdapter(getActivity(),cards);<NEW_LINE>CardListView listView = (CardListView) getActivity().findViewById(R.id.carddemo_list_base1);<NEW_LINE>if (listView != null) {<NEW_LINE>listView.setAdapter(mCardArrayAdapter);<NEW_LINE>}<NEW_LINE>}
|
random() * (5.0));
|
419,142
|
public static Figure create(String title, Table table, String xCol, String yCol, String zCol, String sizeColumn, String groupCol) {<NEW_LINE>TableSliceGroup tables = table.splitOn(table.categoricalColumn(groupCol));<NEW_LINE>Layout layout = standardLayout(title, xCol, yCol, zCol, false);<NEW_LINE>Scatter3DTrace[] traces = new <MASK><NEW_LINE>for (int i = 0; i < tables.size(); i++) {<NEW_LINE>List<Table> tableList = tables.asTableList();<NEW_LINE>Marker marker = // .opacity(.75)<NEW_LINE>Marker.builder().size(tableList.get(i).numberColumn(sizeColumn)).build();<NEW_LINE>traces[i] = Scatter3DTrace.builder(tableList.get(i).numberColumn(xCol), tableList.get(i).numberColumn(yCol), tableList.get(i).numberColumn(zCol)).marker(marker).showLegend(true).name(tableList.get(i).name()).build();<NEW_LINE>}<NEW_LINE>return new Figure(layout, traces);<NEW_LINE>}
|
Scatter3DTrace[tables.size()];
|
1,639,024
|
private String[] validateSearchBases(String[] searchBases, List<HashMap<String, String>> baseEntries) {<NEW_LINE>final String METHODNAME = "validateSearchBases(String[], List<HashMap<String, String>>)";<NEW_LINE>List<String> validSearchBase = new ArrayList<String>();<NEW_LINE>boolean isValid = false;<NEW_LINE>for (int j = 0; j < searchBases.length; j++) {<NEW_LINE>for (int i = 0; i < baseEntries.size(); i++) {<NEW_LINE>Set<String> keys = baseEntries.get(i).keySet();<NEW_LINE>Iterator<String<MASK><NEW_LINE>while (itr.hasNext()) {<NEW_LINE>String key = itr.next();<NEW_LINE>if (searchBases[j].trim().toLowerCase().endsWith(key.toLowerCase())) {<NEW_LINE>isValid = true;<NEW_LINE>validSearchBase.add(searchBases[j]);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>isValid = false;<NEW_LINE>}<NEW_LINE>if (isValid)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (!isValid && tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, METHODNAME + " Invalid search bases are" + searchBases[j]);<NEW_LINE>}<NEW_LINE>return validSearchBase.toArray(new String[0]);<NEW_LINE>}
|
> itr = keys.iterator();
|
1,745,821
|
public void loadInitialConfiguration(ConfigVariableRegistry variableRegistry) throws ConfigValidationException, ConfigParserException {<NEW_LINE>if (configRoot != null && configRoot.exists()) {<NEW_LINE>try {<NEW_LINE>serverConfiguration = loadServerConfiguration();<NEW_LINE>if (serverConfiguration == null) {<NEW_LINE>// This only happens if there is a parser error and onError has been set to IGNORE or WARN.<NEW_LINE>// We're just avoiding an NPE here. The user will see the server start up with a warning<NEW_LINE>// that nothing has been configured. This is less than ideal in the case of IGNORE, but it's<NEW_LINE>// the behavior the user has asked for.<NEW_LINE>serverConfiguration = new ServerConfiguration();<NEW_LINE>}<NEW_LINE>} catch (ConfigParserTolerableException ex) {<NEW_LINE>// This only gets caught here if OnError = FAIL.. rethrow so the server will shut down<NEW_LINE>throw ex;<NEW_LINE>} catch (ConfigParserException ex) {<NEW_LINE>Tr.error(tc, "error.config.update.init", ex.getMessage());<NEW_LINE>serverConfiguration = new ServerConfiguration();<NEW_LINE>if (ErrorHandler.INSTANCE.fail())<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>serverConfiguration.setDefaultConfiguration(new BaseConfiguration());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>variableRegistry.updateSystemVariables(getVariables());<NEW_LINE>// Register the ConfigVariables service now that we have populated the registry<NEW_LINE>Hashtable<String, Object> properties = new Hashtable<String, Object>();<NEW_LINE>properties.put("service.vendor", "IBM");<NEW_LINE>bundleContext.registerService(<MASK><NEW_LINE>} catch (ConfigMergeException e) {<NEW_LINE>// Rethrow if onError=FAIL. An error message has already been issued otherwise.<NEW_LINE>if (ErrorHandler.INSTANCE.fail()) {<NEW_LINE>throw new ConfigParserTolerableException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
ConfigVariables.class, variableRegistry, properties);
|
1,184,292
|
private static DetailedExitCode createDetailedExitCodeForUndetailedExecutionCause(EvaluationResult<?> result, Throwable undetailedCause) {<NEW_LINE>// TODO(b/227660368): These warning logs should be a bug report, but tests currently fail.<NEW_LINE>if (undetailedCause == null) {<NEW_LINE>logger.atWarning().log("No exceptions found despite error in %s", result);<NEW_LINE>return createDetailedExecutionExitCode("keep_going execution failed without an action failure", Execution.Code.NON_ACTION_EXECUTION_FAILURE);<NEW_LINE>}<NEW_LINE>logger.atWarning().withCause(undetailedCause).log("No detailed exception found in %s", result);<NEW_LINE>return createDetailedExecutionExitCode("keep_going execution failed without an action failure: " + undetailedCause.getMessage() + " (" + undetailedCause.getClass().getSimpleName() + <MASK><NEW_LINE>}
|
")", Execution.Code.NON_ACTION_EXECUTION_FAILURE);
|
1,426,488
|
private Publisher<?> fallbackForReactiveType(MethodInvocationContext<Object, Object> context, Publisher<?> publisher) {<NEW_LINE>return Flux.from(publisher).onErrorResume(throwable -> {<NEW_LINE>Optional<? extends MethodExecutionHandle<?, Object>> fallbackMethod = findFallbackMethod(context);<NEW_LINE>if (fallbackMethod.isPresent()) {<NEW_LINE>MethodExecutionHandle<?, Object> fallbackHandle = fallbackMethod.get();<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Type [{}] resolved fallback: {}", context.getTarget().getClass(), fallbackHandle);<NEW_LINE>}<NEW_LINE>Object fallbackResult;<NEW_LINE>try {<NEW_LINE>fallbackResult = fallbackHandle.<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>return Flux.error(throwable);<NEW_LINE>}<NEW_LINE>if (fallbackResult == null) {<NEW_LINE>return Flux.error(new FallbackException("Fallback handler [" + fallbackHandle + "] returned null value"));<NEW_LINE>} else {<NEW_LINE>return ConversionService.SHARED.convert(fallbackResult, Publisher.class).orElseThrow(() -> new FallbackException("Unsupported Reactive type: " + fallbackResult));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Flux.error(throwable);<NEW_LINE>});<NEW_LINE>}
|
invoke(context.getParameterValues());
|
1,503,047
|
protected void configure() {<NEW_LINE>final CacheConfig cacheConfig = new ConfigurationObjectFactory(skifeConfigSource).build(CacheConfig.class);<NEW_LINE>bind(CacheConfig.class).toInstance(cacheConfig);<NEW_LINE>final EhCacheConfig ehCacheConfig = new ConfigurationObjectFactory(skifeConfigSource).build(EhCacheConfig.class);<NEW_LINE>bind(EhCacheConfig.class).toInstance(ehCacheConfig);<NEW_LINE>final RedisCacheConfig redisCacheConfig = new ConfigurationObjectFactory(skifeConfigSource).build(RedisCacheConfig.class);<NEW_LINE>bind(RedisCacheConfig.class).toInstance(redisCacheConfig);<NEW_LINE>if (redisCacheConfig.isRedisCachingEnabled()) {<NEW_LINE>bind(RedissonClient.class).annotatedWith(Names.named(REDIS_CACHE_CLIENT)).toProvider(RedissonCacheClientProvider.class).asEagerSingleton();<NEW_LINE>bind(CacheManager.class).toProvider(Redis107CacheManagerProvider.class).asEagerSingleton();<NEW_LINE>} else {<NEW_LINE>bind(RedissonClient.class).annotatedWith(Names.named(REDIS_CACHE_CLIENT)).toProvider(Providers.<RedissonClient>of(null));<NEW_LINE>bind(CacheManager.class).toProvider(Eh107CacheManagerProvider.class).asEagerSingleton();<NEW_LINE>}<NEW_LINE>// Kill Bill generic cache dispatcher<NEW_LINE>bind(CacheControllerDispatcher.class).toProvider(CacheControllerDispatcherProvider.class).asEagerSingleton();<NEW_LINE>final Multibinder<BaseCacheLoader> resultSetMapperSetBinder = Multibinder.newSetBinder(binder(), BaseCacheLoader.class);<NEW_LINE>resultSetMapperSetBinder.addBinding().to(ImmutableAccountCacheLoader.class).asEagerSingleton();<NEW_LINE>resultSetMapperSetBinder.addBinding().to(AccountBCDCacheLoader.class).asEagerSingleton();<NEW_LINE>resultSetMapperSetBinder.addBinding().to(RecordIdCacheLoader.class).asEagerSingleton();<NEW_LINE>resultSetMapperSetBinder.addBinding().to(AccountRecordIdCacheLoader.class).asEagerSingleton();<NEW_LINE>resultSetMapperSetBinder.addBinding().to(TenantRecordIdCacheLoader.class).asEagerSingleton();<NEW_LINE>resultSetMapperSetBinder.addBinding().to(ObjectIdCacheLoader.class).asEagerSingleton();<NEW_LINE>resultSetMapperSetBinder.addBinding().to(TenantCatalogCacheLoader.class).asEagerSingleton();<NEW_LINE>resultSetMapperSetBinder.addBinding().to(TenantConfigCacheLoader.class).asEagerSingleton();<NEW_LINE>resultSetMapperSetBinder.addBinding().to(TenantOverdueConfigCacheLoader.class).asEagerSingleton();<NEW_LINE>resultSetMapperSetBinder.addBinding().to(<MASK><NEW_LINE>resultSetMapperSetBinder.addBinding().to(TenantCacheLoader.class).asEagerSingleton();<NEW_LINE>resultSetMapperSetBinder.addBinding().to(OverriddenPlanCacheLoader.class).asEagerSingleton();<NEW_LINE>resultSetMapperSetBinder.addBinding().to(TenantStateMachineConfigCacheLoader.class).asEagerSingleton();<NEW_LINE>resultSetMapperSetBinder.addBinding().to(AccountIdFromBundleIdCacheLoader.class).asEagerSingleton();<NEW_LINE>resultSetMapperSetBinder.addBinding().to(BundleIdFromSubscriptionIdCacheLoader.class).asEagerSingleton();<NEW_LINE>}
|
TenantKVCacheLoader.class).asEagerSingleton();
|
878,361
|
private // with all possible modifiers (Ctrl, Shift, Alt, etc.)<NEW_LINE>void registerSelectItemAction() {<NEW_LINE>int[] allowedModifiers = new int[] { 0, InputEvent.SHIFT_MASK, InputEvent.CTRL_MASK, InputEvent.META_MASK, InputEvent.ALT_MASK };<NEW_LINE>ShortcutSet selectShortcuts = ActionManager.getInstance().getAction(SearchEverywhereActions.SELECT_ITEM).getShortcutSet();<NEW_LINE>Collection<KeyboardShortcut> keyboardShortcuts = Arrays.stream(selectShortcuts.getShortcuts()).filter(shortcut -> shortcut instanceof KeyboardShortcut).map(shortcut -> (KeyboardShortcut) shortcut).collect(Collectors.toList());<NEW_LINE>for (int modifiers : allowedModifiers) {<NEW_LINE>Collection<Shortcut> newShortcuts = new ArrayList<>();<NEW_LINE>for (KeyboardShortcut shortcut : keyboardShortcuts) {<NEW_LINE>boolean hasSecondStroke = shortcut.getSecondKeyStroke() != null;<NEW_LINE>KeyStroke originalStroke = hasSecondStroke ? shortcut.getSecondKeyStroke() : shortcut.getFirstKeyStroke();<NEW_LINE>if ((originalStroke.getModifiers() & modifiers) != 0)<NEW_LINE>continue;<NEW_LINE>KeyStroke newStroke = KeyStroke.getKeyStroke(originalStroke.getKeyCode(), originalStroke.getModifiers() | modifiers);<NEW_LINE>newShortcuts.add(hasSecondStroke ? new KeyboardShortcut(shortcut.getFirstKeyStroke(), newStroke) : new KeyboardShortcut(newStroke, null));<NEW_LINE>}<NEW_LINE>if (newShortcuts.isEmpty())<NEW_LINE>continue;<NEW_LINE>ShortcutSet newShortcutSet = new CustomShortcutSet(newShortcuts.toArray(Shortcut.EMPTY_ARRAY));<NEW_LINE>DumbAwareAction.create(event -> {<NEW_LINE>int[<MASK><NEW_LINE>elementsSelected(indices, modifiers);<NEW_LINE>}).registerCustomShortcutSet(newShortcutSet, this, this);<NEW_LINE>}<NEW_LINE>}
|
] indices = myResultsList.getSelectedIndices();
|
1,240,255
|
public Request<DetectSyntaxRequest> marshall(DetectSyntaxRequest detectSyntaxRequest) {<NEW_LINE>if (detectSyntaxRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DetectSyntaxRequest)");<NEW_LINE>}<NEW_LINE>Request<DetectSyntaxRequest> request = new DefaultRequest<DetectSyntaxRequest>(detectSyntaxRequest, "AmazonComprehend");<NEW_LINE>String target = "Comprehend_20171127.DetectSyntax";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (detectSyntaxRequest.getText() != null) {<NEW_LINE>String text = detectSyntaxRequest.getText();<NEW_LINE>jsonWriter.name("Text");<NEW_LINE>jsonWriter.value(text);<NEW_LINE>}<NEW_LINE>if (detectSyntaxRequest.getLanguageCode() != null) {<NEW_LINE>String languageCode = detectSyntaxRequest.getLanguageCode();<NEW_LINE>jsonWriter.name("LanguageCode");<NEW_LINE>jsonWriter.value(languageCode);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] <MASK><NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
|
content = snippet.getBytes(UTF8);
|
114,136
|
public AwsElasticsearchDomainEncryptionAtRestOptions unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsElasticsearchDomainEncryptionAtRestOptions awsElasticsearchDomainEncryptionAtRestOptions = new AwsElasticsearchDomainEncryptionAtRestOptions();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Enabled", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>awsElasticsearchDomainEncryptionAtRestOptions.setEnabled(context.getUnmarshaller(Boolean.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("KmsKeyId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>awsElasticsearchDomainEncryptionAtRestOptions.setKmsKeyId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return awsElasticsearchDomainEncryptionAtRestOptions;<NEW_LINE>}
|
String currentParentElement = context.getCurrentParentElement();
|
408,339
|
public void configure(Parameterization config) {<NEW_LINE>//<NEW_LINE>new ObjectParameter<NumberVectorDistance<? super NumberVector>>(Algorithm.Utils.DISTANCE_FUNCTION_ID, NumberVectorDistance.class, EuclideanDistance.class).grab(config, x -> distance = x);<NEW_LINE>//<NEW_LINE>//<NEW_LINE>new IntParameter(REP_ID, 1).//<NEW_LINE>addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT).grab(<MASK><NEW_LINE>//<NEW_LINE>//<NEW_LINE>new IntParameter(K_ID, 1).//<NEW_LINE>addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT).grab(config, x -> k = x);<NEW_LINE>//<NEW_LINE>//<NEW_LINE>new IntParameter(SAMPLESIZE_ID).//<NEW_LINE>addConstraint(CommonConstraints.GREATER_EQUAL_ONE_INT).grab(config, x -> sampleSize = x);<NEW_LINE>new RandomParameter(SEED_ID).grab(config, x -> random = x);<NEW_LINE>//<NEW_LINE>DoubleListParameter //<NEW_LINE>minimaP = new DoubleListParameter(MINIMA_ID).setOptional(true);<NEW_LINE>minimaP.grab(config, x -> minima = x.clone());<NEW_LINE>//<NEW_LINE>DoubleListParameter //<NEW_LINE>maximaP = new DoubleListParameter(MAXIMA_ID).setOptional(minima == null);<NEW_LINE>maximaP.grab(config, x -> maxima = x.clone());<NEW_LINE>// Non-formalized parameter constraint:<NEW_LINE>if (minima != null && maxima != null && minima.length != maxima.length) {<NEW_LINE>config.reportError(new WrongParameterValueException(minimaP, "and", maximaP, "must have the same number of values."));<NEW_LINE>}<NEW_LINE>}
|
config, x -> rep = x);
|
1,725,002
|
public CommandFuture<?> migrate(BeaconMigrationRequest migrationRequest) {<NEW_LINE>logger.debug("[migrate][{}] begin", migrationRequest.getClusterName());<NEW_LINE>SequenceCommandChain migrateSequenceCmd = new SequenceCommandChain();<NEW_LINE>migrateSequenceCmd.add(new MigrationPreCheckCmd(migrationRequest, checker, configService, clusterService, dcCache, beaconMetaService));<NEW_LINE>migrateSequenceCmd.add(new MigrationFetchProcessingEventCmd(migrationRequest, clusterService, migrationClusterDao, dcCache));<NEW_LINE>migrateSequenceCmd.add(new MigrationChooseTargetDcCmd(migrationRequest, dcCache, dcClusterService));<NEW_LINE>migrateSequenceCmd.add(new MigrationBuildEventCmd<MASK><NEW_LINE>migrateSequenceCmd.add(new MigrationDoExecuteCmd(migrationRequest, migrationEventManager, migrationExecutors));<NEW_LINE>CommandFuture<?> future = migrateSequenceCmd.execute(prepareExecutors);<NEW_LINE>long timeoutMilli = config.getMigrationTimeoutMilli();<NEW_LINE>ScheduledFuture<?> scheduledFuture = scheduled.schedule(() -> {<NEW_LINE>if (future.isDone()) {<NEW_LINE>// already done, do nothing<NEW_LINE>} else if (migrateSequenceCmd.executeCount() <= 0) {<NEW_LINE>logger.info("[migrate][{}] timeout", migrationRequest.getClusterName());<NEW_LINE>future.cancel(false);<NEW_LINE>} else {<NEW_LINE>logger.info("[migrate][{}] timeout but already running, continue", migrationRequest.getClusterName());<NEW_LINE>}<NEW_LINE>}, timeoutMilli, TimeUnit.MILLISECONDS);<NEW_LINE>future.addListener(commandFuture -> {<NEW_LINE>boolean cancelTimeout = true;<NEW_LINE>if (commandFuture.isSuccess()) {<NEW_LINE>// do nothing<NEW_LINE>} else if (commandFuture.isCancelled()) {<NEW_LINE>// already timeout<NEW_LINE>cancelTimeout = false;<NEW_LINE>} else if (!(commandFuture.cause() instanceof CommandChainException)) {<NEW_LINE>logger.info("[migrate][{}] unexpected exception", migrationRequest.getClusterName(), commandFuture.cause());<NEW_LINE>} else if (commandFuture.cause().getCause() instanceof UnexpectMigrationDataException) {<NEW_LINE>alertManager.alert(migrationRequest.getClusterName(), null, null, ALERT_TYPE.MIGRATION_DATA_CONFLICT, commandFuture.cause().getMessage());<NEW_LINE>}<NEW_LINE>if (cancelTimeout) {<NEW_LINE>scheduledFuture.cancel(false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return future;<NEW_LINE>}
|
(migrationRequest, migrationEventDao, migrationEventManager));
|
1,634,398
|
private int doStartService(Context context, Intent intent) {<NEW_LINE>// It seems that startService with intent without ClassName can fail due to a framework bug<NEW_LINE>// See: http://b/19873307 and http://b/24065801 for GCM<NEW_LINE>String className = resolveServiceClassName(context, intent);<NEW_LINE>if (className != null) {<NEW_LINE>if (Log.isLoggable(TAG, Log.DEBUG)) {<NEW_LINE>Log.d(TAG, "Restricting intent to a specific service: " + className);<NEW_LINE>}<NEW_LINE>intent.setClassName(<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>ComponentName service;<NEW_LINE>if (hasWakeLockPermission(context)) {<NEW_LINE>service = WakeLockHolder.startWakefulService(context, intent);<NEW_LINE>} else {<NEW_LINE>service = context.startService(intent);<NEW_LINE>Log.d(TAG, "Missing wake lock permission, service start may be delayed");<NEW_LINE>}<NEW_LINE>if (service == null) {<NEW_LINE>Log.e(TAG, "Error while delivering the message: ServiceIntent not found.");<NEW_LINE>return ERROR_NOT_FOUND;<NEW_LINE>}<NEW_LINE>return SUCCESS;<NEW_LINE>} catch (SecurityException ex) {<NEW_LINE>// It seems that startService with intent without ClassName can fail with<NEW_LINE>// SecurityException due to a framework bug. See: http://b/19873307 http://b/24065801<NEW_LINE>Log.e(TAG, "Error while delivering the message to the serviceIntent", ex);<NEW_LINE>return ERROR_SECURITY_EXCEPTION;<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>// We tried to start a service while in the background, avoid crashing the app. This should<NEW_LINE>// never happen any more, but keep this catch here just in case.<NEW_LINE>Log.e(TAG, "Failed to start service while in background: " + e);<NEW_LINE>return ERROR_ILLEGAL_STATE_EXCEPTION;<NEW_LINE>}<NEW_LINE>}
|
context.getPackageName(), className);
|
979,564
|
public com.squareup.okhttp.Call orderCancelAllAsync(String symbol, String filter, String text, final ApiCallback<List<Order>> callback) throws ApiException {<NEW_LINE>ProgressResponseBody.ProgressListener progressListener = null;<NEW_LINE>ProgressRequestBody.ProgressRequestListener progressRequestListener = null;<NEW_LINE>if (callback != null) {<NEW_LINE>progressListener = new ProgressResponseBody.ProgressListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void update(long bytesRead, long contentLength, boolean done) {<NEW_LINE>callback.onDownloadProgress(bytesRead, contentLength, done);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>progressRequestListener = new ProgressRequestBody.ProgressRequestListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRequestProgress(long bytesWritten, long contentLength, boolean done) {<NEW_LINE>callback.onUploadProgress(bytesWritten, contentLength, done);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>com.squareup.okhttp.Call call = orderCancelAllValidateBeforeCall(symbol, filter, text, progressListener, progressRequestListener);<NEW_LINE>Type localVarReturnType = new TypeToken<List<Order>>() {<NEW_LINE>}.getType();<NEW_LINE>apiClient.<MASK><NEW_LINE>return call;<NEW_LINE>}
|
executeAsync(call, localVarReturnType, callback);
|
529,134
|
private Queue<String> collect(Node node, StringBuilder prefix) {<NEW_LINE>Queue<String> queue = new Queue<>();<NEW_LINE>Stack<NodeWithInformation> stack = new Stack<>();<NEW_LINE>stack.push(new NodeWithInformation(node<MASK><NEW_LINE>while (!stack.isEmpty()) {<NEW_LINE>NodeWithInformation currentNodeWithInformation = stack.pop();<NEW_LINE>Node currentNode = currentNodeWithInformation.node;<NEW_LINE>StringBuilder currentPrefix = currentNodeWithInformation.prefix;<NEW_LINE>StringBuilder prefixWithCharacter = new StringBuilder(currentPrefix).append(currentNode.character);<NEW_LINE>if (currentNode.value != null) {<NEW_LINE>queue.enqueue(prefixWithCharacter.toString());<NEW_LINE>}<NEW_LINE>if (currentNode.right != null) {<NEW_LINE>stack.push(new NodeWithInformation(currentNode.right, currentPrefix));<NEW_LINE>}<NEW_LINE>if (currentNode.middle != null) {<NEW_LINE>stack.push(new NodeWithInformation(currentNode.middle, prefixWithCharacter));<NEW_LINE>}<NEW_LINE>if (currentNode.left != null) {<NEW_LINE>stack.push(new NodeWithInformation(currentNode.left, currentPrefix));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return queue;<NEW_LINE>}
|
, new StringBuilder(prefix)));
|
1,741,869
|
protected Clustering<Model> buildResult(final DBIDs ids, int clusterid) {<NEW_LINE>FiniteProgress pprog = LOG.isVerbose() ? new FiniteProgress("Building final result", ids.size(), LOG) : null;<NEW_LINE>ModifiableDBIDs[] clusters = new ModifiableDBIDs[clusterid];<NEW_LINE>ModifiableDBIDs noise = DBIDUtil.newArray();<NEW_LINE>for (DBIDIter it = ids.iter(); it.valid(); it.advance()) {<NEW_LINE>Assignment cids = clusterids.get(it);<NEW_LINE>if (cids == null) {<NEW_LINE>noise.add(it);<NEW_LINE>} else {<NEW_LINE>if (cids instanceof MultiBorder) {<NEW_LINE>cids = ((MultiBorder) cids).getCore();<NEW_LINE>} else if (cids instanceof Border) {<NEW_LINE>cids = ((Border) cids).core;<NEW_LINE>}<NEW_LINE>assert (cids instanceof Core);<NEW_LINE>Core co = (Core) cids;<NEW_LINE>while (cores[co.num].num != co.num) {<NEW_LINE>co = cores[co.num = cores[co.num].num];<NEW_LINE>}<NEW_LINE>ModifiableDBIDs clu = clusters[co.num];<NEW_LINE>if (clu == null) {<NEW_LINE>clu = clusters[co.num] = DBIDUtil.newArray();<NEW_LINE>}<NEW_LINE>clu.add(it);<NEW_LINE>}<NEW_LINE>LOG.incrementProcessed(pprog);<NEW_LINE>}<NEW_LINE>LOG.ensureCompleted(pprog);<NEW_LINE>clusterids.destroy();<NEW_LINE>Clustering<Model> result = new Clustering<>();<NEW_LINE>Metadata.of<MASK><NEW_LINE>for (int i = NOISE + 1; i < clusters.length; i++) {<NEW_LINE>if (clusters[i] != null) {<NEW_LINE>result.addToplevelCluster(new Cluster<Model>(clusters[i], ClusterModel.CLUSTER));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (noise.size() > 0) {<NEW_LINE>result.addToplevelCluster(new Cluster<Model>(noise, true, ClusterModel.CLUSTER));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
|
(result).setLongName("DBSCAN Clustering");
|
1,802,479
|
private Mono<Response<Flux<ByteBuffer>>> resetWithResponseAsync(String resourceGroupName, String virtualNetworkGatewayName, String gatewayVip, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (virtualNetworkGatewayName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter virtualNetworkGatewayName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2018-11-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.reset(this.client.getEndpoint(), resourceGroupName, virtualNetworkGatewayName, gatewayVip, apiVersion, this.client.<MASK><NEW_LINE>}
|
getSubscriptionId(), accept, context);
|
652,075
|
private void processChildMouseEvent(MouseEvent e) {<NEW_LINE>boolean isIn = contains(e.getX(), e.getY());<NEW_LINE>boolean isPopupSide = e.getX<MASK><NEW_LINE>switch(e.getID()) {<NEW_LINE>case MouseEvent.MOUSE_ENTERED:<NEW_LINE>if (!wasIn) {<NEW_LINE>button.processEventImpl(fromEvent((MouseEvent) e, button, MouseEvent.MOUSE_ENTERED));<NEW_LINE>popup.processEventImpl(fromEvent((MouseEvent) e, popup, MouseEvent.MOUSE_ENTERED));<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case MouseEvent.MOUSE_EXITED:<NEW_LINE>if (!isIn) {<NEW_LINE>popup.processEventImpl(fromEvent((MouseEvent) e, popup, MouseEvent.MOUSE_EXITED));<NEW_LINE>button.processEventImpl(fromEvent((MouseEvent) e, button, MouseEvent.MOUSE_EXITED));<NEW_LINE>exposeButton();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case MouseEvent.MOUSE_MOVED:<NEW_LINE>if (isPopupSide) {<NEW_LINE>exposePopup();<NEW_LINE>MouseEvent ee = fromEvent((MouseEvent) e, popup, MouseEvent.MOUSE_MOVED);<NEW_LINE>popup.processEventImpl(ee);<NEW_LINE>ToolTipManager.sharedInstance().mouseMoved(ee);<NEW_LINE>} else {<NEW_LINE>exposeButton();<NEW_LINE>MouseEvent ee = fromEvent((MouseEvent) e, button, MouseEvent.MOUSE_MOVED);<NEW_LINE>button.processEventImpl(ee);<NEW_LINE>ToolTipManager.sharedInstance().mouseMoved(ee);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>if (isPopupSide) {<NEW_LINE>popup.processEventImpl(e);<NEW_LINE>} else {<NEW_LINE>button.processEventImpl(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>wasIn = isIn;<NEW_LINE>}
|
() >= getWidth() - POPUP_EXTENT;
|
390,092
|
public Pair<INDArray, MaskState> feedForwardMaskArray(INDArray maskArray, MaskState currentMaskState, int minibatchSize) {<NEW_LINE>// Assume mask array is 1d - a mask array that has been reshaped from [minibatch,timeSeriesLength] to [minibatch*timeSeriesLength, 1]<NEW_LINE>if (maskArray == null) {<NEW_LINE>return new Pair<>(maskArray, currentMaskState);<NEW_LINE>} else if (maskArray.isVector()) {<NEW_LINE>// Need to reshape mask array from [minibatch*timeSeriesLength, 1] to [minibatch,timeSeriesLength]<NEW_LINE>return new Pair<>(TimeSeriesUtils.reshapeVectorToTimeSeriesMask<MASK><NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Received mask array with shape " + Arrays.toString(maskArray.shape()) + "; expected vector.");<NEW_LINE>}<NEW_LINE>}
|
(maskArray, minibatchSize), currentMaskState);
|
618,966
|
public boolean doConnectionVendorPropertyReset(Connection connImpl, Map<String, Object> props) throws SQLException {<NEW_LINE>try {<NEW_LINE>if (Autosave == null)<NEW_LINE>Autosave = WSManagedConnectionFactoryImpl.priv.loadClass(mcf.jdbcDriverLoader, "org.postgresql.jdbc.AutoSave");<NEW_LINE>Class<?> PGConnection = connImpl.getClass();<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.<MASK><NEW_LINE>PGConnection.getMethod("setDefaultFetchSize", int.class).invoke(connImpl, props.get(PROP_DEFAULT_FETCH_SIZE));<NEW_LINE>PGConnection.getMethod("setPrepareThreshold", int.class).invoke(connImpl, props.get(PROP_PREPARE_THRESHOLD));<NEW_LINE>PGConnection.getMethod("setAutosave", Autosave).invoke(connImpl, props.get(PROP_AUTOSAVE));<NEW_LINE>} catch (RuntimeException x) {<NEW_LINE>throw x;<NEW_LINE>} catch (Exception x) {<NEW_LINE>throw AdapterUtil.toSQLException(x);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
debug(tc, "Resetting PGConnection vendor-specific properties to defaults: " + props);
|
562,804
|
public static void renamePartitionTableMeta(Connection metaDbConn, String schemaName, String logicalTableName, String newLogicalTableName, ExecutionContext executionContext) {<NEW_LINE>String tableListDataId = MetaDbDataIdBuilder.getTableListDataId(schemaName);<NEW_LINE>String tableDataId = MetaDbDataIdBuilder.getTableDataId(schemaName, logicalTableName);<NEW_LINE>String newTableDataId = MetaDbDataIdBuilder.getTableDataId(schemaName, newLogicalTableName);<NEW_LINE>// Rename sequence if exists.<NEW_LINE>SystemTableRecord sequenceRecord = null;<NEW_LINE>SequenceBean sequenceBean = SequenceMetaChanger.<MASK><NEW_LINE>if (sequenceBean != null) {<NEW_LINE>sequenceRecord = SequenceUtil.convert(sequenceBean, schemaName, executionContext);<NEW_LINE>}<NEW_LINE>TableInfoManager tableInfoManager = new TableInfoManager();<NEW_LINE>tableInfoManager.setConnection(metaDbConn);<NEW_LINE>// Replace with new table name<NEW_LINE>tableInfoManager.renamePartitionTable(schemaName, logicalTableName, newLogicalTableName, sequenceRecord);<NEW_LINE>// Unregister the old table data id.<NEW_LINE>CONFIG_MANAGER.unregister(tableDataId, metaDbConn);<NEW_LINE>// Register new table data id.<NEW_LINE>CONFIG_MANAGER.register(newTableDataId, metaDbConn);<NEW_LINE>CONFIG_MANAGER.notify(tableListDataId, metaDbConn);<NEW_LINE>}
|
renameSequenceIfExists(schemaName, logicalTableName, newLogicalTableName);
|
1,277,121
|
/* @Asynchronous defined on interface class only. */<NEW_LINE>public void testNotInLocalIf_NOasyncOnBean() throws Exception {<NEW_LINE>// Names of interface, application, module, and bean used in the test for lookup.<NEW_LINE>String Interface = AsyncNotInLocalIf.class.getName();<NEW_LINE>String Application = "AsyncNotInLocalIf3Bean";<NEW_LINE>String Module = "AsyncNotInLocalIf3Bean";<NEW_LINE>String BeanName = "AsyncNotInLocalIf3Bean";<NEW_LINE>AsyncNotInLocalIf bean = null;<NEW_LINE>try {<NEW_LINE>bean = (AsyncNotInLocalIf) FATHelper.lookupDefaultBindingEJBJavaGlobal(Interface, Application, Module, BeanName);<NEW_LINE>// call method to ensure bean has been initialized<NEW_LINE>bean.test2();<NEW_LINE>} catch (Exception e) {<NEW_LINE>svLogger.logp(Level.SEVERE, <MASK><NEW_LINE>fail("--> Unexpected Exception: " + e.getClass().getName() + ":" + e);<NEW_LINE>}<NEW_LINE>}
|
CLASS_NAME, "testNotInLocalIf_NOasyncOnBean", "--> Caught Exception:", e);
|
552,101
|
public int read(byte[] out, int off, int len) throws IOException {<NEW_LINE>int nRead = 0;<NEW_LINE>if (buffered != null) {<NEW_LINE>int avail = buffered.length - pos;<NEW_LINE>if (avail != 0) {<NEW_LINE>int k = Math.min(len, avail);<NEW_LINE>int p1 = pos + k;<NEW_LINE>int p2 = off + k;<NEW_LINE>pos = p1;<NEW_LINE>while (--p2 >= off) {<NEW_LINE>out[<MASK><NEW_LINE>}<NEW_LINE>off += k;<NEW_LINE>len -= k;<NEW_LINE>nRead = k;<NEW_LINE>} else {<NEW_LINE>buffered = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (len == 0) {<NEW_LINE>return nRead;<NEW_LINE>}<NEW_LINE>int nFromTail = tail.read(out, off, len);<NEW_LINE>if (nFromTail > 0) {<NEW_LINE>return nFromTail + nRead;<NEW_LINE>}<NEW_LINE>return nRead != 0 ? nRead : -1;<NEW_LINE>}
|
p2] = buffered[--p1];
|
1,410,531
|
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = new String[] { "id", "s1totals.v1", "s1totals.v2" };<NEW_LINE>String text = "@name('s0') select id, (select count(*) as v1, sum(id) as v2 from SupportBean_S1#length(3)) as s1totals " + "from SupportBean_S0 s0";<NEW_LINE>env.compileDeploy(text).addListener("s0");<NEW_LINE>env.sendEventBean(new SupportBean_S0(1, "G1"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 1, 0L, null });<NEW_LINE>env.sendEventBean(new SupportBean_S1(200, "G2"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(2, "G2"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 2, 1L, 200 });<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportBean_S1(210, "G2"));<NEW_LINE>env.sendEventBean(<MASK><NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 3, 2L, 410 });<NEW_LINE>env.milestone(1);<NEW_LINE>env.sendEventBean(new SupportBean_S1(220, "G2"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(4, "G2"));<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 4, 3L, 630 });<NEW_LINE>env.undeployAll();<NEW_LINE>}
|
new SupportBean_S0(3, "G2"));
|
737,961
|
public Request<DescribeLogGroupsRequest> marshall(DescribeLogGroupsRequest describeLogGroupsRequest) {<NEW_LINE>if (describeLogGroupsRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(DescribeLogGroupsRequest)");<NEW_LINE>}<NEW_LINE>Request<DescribeLogGroupsRequest> request = new DefaultRequest<DescribeLogGroupsRequest>(describeLogGroupsRequest, "AmazonCloudWatchLogs");<NEW_LINE>String target = "Logs_20140328.DescribeLogGroups";<NEW_LINE>request.addHeader("X-Amz-Target", target);<NEW_LINE><MASK><NEW_LINE>String uriResourcePath = "/";<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>try {<NEW_LINE>StringWriter stringWriter = new StringWriter();<NEW_LINE>AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter);<NEW_LINE>jsonWriter.beginObject();<NEW_LINE>if (describeLogGroupsRequest.getLogGroupNamePrefix() != null) {<NEW_LINE>String logGroupNamePrefix = describeLogGroupsRequest.getLogGroupNamePrefix();<NEW_LINE>jsonWriter.name("logGroupNamePrefix");<NEW_LINE>jsonWriter.value(logGroupNamePrefix);<NEW_LINE>}<NEW_LINE>if (describeLogGroupsRequest.getNextToken() != null) {<NEW_LINE>String nextToken = describeLogGroupsRequest.getNextToken();<NEW_LINE>jsonWriter.name("nextToken");<NEW_LINE>jsonWriter.value(nextToken);<NEW_LINE>}<NEW_LINE>if (describeLogGroupsRequest.getLimit() != null) {<NEW_LINE>Integer limit = describeLogGroupsRequest.getLimit();<NEW_LINE>jsonWriter.name("limit");<NEW_LINE>jsonWriter.value(limit);<NEW_LINE>}<NEW_LINE>jsonWriter.endObject();<NEW_LINE>jsonWriter.close();<NEW_LINE>String snippet = stringWriter.toString();<NEW_LINE>byte[] content = snippet.getBytes(UTF8);<NEW_LINE>request.setContent(new StringInputStream(snippet));<NEW_LINE>request.addHeader("Content-Length", Integer.toString(content.length));<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new AmazonClientException("Unable to marshall request to JSON: " + t.getMessage(), t);<NEW_LINE>}<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
|
request.setHttpMethod(HttpMethodName.POST);
|
622,730
|
public static void resizeHeap(int newHeapSize) {<NEW_LINE>if (newHeapSize <= heapSize) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int newStorageSize = calculateStorageSize(newHeapSize);<NEW_LINE>int newRegionsCount = calculateRegionsCount(newHeapSize, regionSize);<NEW_LINE>int newRegionsSize = calculateRegionsSize(newRegionsCount);<NEW_LINE>Address newRegionsAddress = WasmRuntime.align(heapAddress.add(newHeapSize), 16);<NEW_LINE>Address newCardTable = WasmRuntime.align(newRegionsAddress.add(newRegionsSize), 16);<NEW_LINE>Address newStorageAddress = WasmRuntime.align(newCardTable.add(newRegionsCount), 16);<NEW_LINE>Address newMemoryLimit = WasmRuntime.align(newStorageAddress.add(newStorageSize), PAGE_SIZE);<NEW_LINE>if (newMemoryLimit != memoryLimit) {<NEW_LINE>growMemory((int) (newMemoryLimit.toLong() - memoryLimit.toLong()) / PAGE_SIZE);<NEW_LINE>memoryLimit = newMemoryLimit;<NEW_LINE>}<NEW_LINE>if (storageSize > 0) {<NEW_LINE>WasmRuntime.moveMemoryBlock(storageAddress, newStorageAddress, storageSize);<NEW_LINE>}<NEW_LINE>if (regionsSize > 0) {<NEW_LINE>WasmRuntime.<MASK><NEW_LINE>WasmRuntime.moveMemoryBlock(regionsAddress, newRegionsAddress, regionsSize);<NEW_LINE>}<NEW_LINE>storageAddress = newStorageAddress;<NEW_LINE>regionsAddress = newRegionsAddress;<NEW_LINE>cardTable = newCardTable;<NEW_LINE>storageSize = newStorageSize;<NEW_LINE>regionsCount = newRegionsCount;<NEW_LINE>regionsSize = newRegionsSize;<NEW_LINE>heapSize = newHeapSize;<NEW_LINE>}
|
moveMemoryBlock(cardTable, newCardTable, regionsCount);
|
1,853,689
|
private static void reorderAndFilterChildOperators(List<BaseFilterOperator> filterOperators, @Nullable Map<String, String> debugOptions) {<NEW_LINE>filterOperators.sort(new Comparator<BaseFilterOperator>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(BaseFilterOperator o1, BaseFilterOperator o2) {<NEW_LINE>return getPriority(o1) - getPriority(o2);<NEW_LINE>}<NEW_LINE><NEW_LINE>int getPriority(BaseFilterOperator filterOperator) {<NEW_LINE>if (filterOperator instanceof SortedIndexBasedFilterOperator) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>if (filterOperator instanceof BitmapBasedFilterOperator) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>if (filterOperator instanceof RangeIndexBasedFilterOperator || filterOperator instanceof TextMatchFilterOperator || filterOperator instanceof JsonMatchFilterOperator || filterOperator instanceof H3IndexFilterOperator) {<NEW_LINE>return 2;<NEW_LINE>}<NEW_LINE>if (filterOperator instanceof AndFilterOperator) {<NEW_LINE>return 3;<NEW_LINE>}<NEW_LINE>if (filterOperator instanceof OrFilterOperator) {<NEW_LINE>return 4;<NEW_LINE>}<NEW_LINE>if (filterOperator instanceof NotFilterOperator) {<NEW_LINE>return getPriority(((NotFilterOperator) filterOperator).getChildFilterOperator());<NEW_LINE>}<NEW_LINE>if (filterOperator instanceof ScanBasedFilterOperator) {<NEW_LINE>return getScanBasedFilterPriority((<MASK><NEW_LINE>}<NEW_LINE>if (filterOperator instanceof ExpressionFilterOperator) {<NEW_LINE>return 10;<NEW_LINE>}<NEW_LINE>throw new IllegalStateException(filterOperator.getClass().getSimpleName() + " should not be reordered, remove it from the list before calling this method");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
|
ScanBasedFilterOperator) filterOperator, 5, debugOptions);
|
965,799
|
static boolean insert_door_ok(ExpansionRoom p_room_1, ExpansionRoom p_room_2, TileShape p_door_shape) {<NEW_LINE>if (p_room_1.door_exists(p_room_2)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (p_room_1 instanceof ObstacleExpansionRoom && p_room_2 instanceof ObstacleExpansionRoom) {<NEW_LINE>Item first_item = ((ObstacleExpansionRoom) p_room_1).get_item();<NEW_LINE>Item second_item = ((ObstacleExpansionRoom) p_room_2).get_item();<NEW_LINE>// insert only overlap_doors between items of the same net for performance reasons.<NEW_LINE>return (first_item.shares_net(second_item));<NEW_LINE>}<NEW_LINE>if (!(p_room_1 instanceof ObstacleExpansionRoom) && !(p_room_2 instanceof ObstacleExpansionRoom)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Insert 1 dimensional doors of trace rooms only, if they are parallel to the trace line.<NEW_LINE>// Otherwise there may be check ripup problems with entering at the wrong side at a fork.<NEW_LINE>Line door_line = null;<NEW_LINE>Point prev_corner = p_door_shape.corner(0);<NEW_LINE>int corner_count = p_door_shape.border_line_count();<NEW_LINE>for (int i = 1; i < corner_count; ++i) {<NEW_LINE>Point <MASK><NEW_LINE>if (!curr_corner.equals(prev_corner)) {<NEW_LINE>door_line = p_door_shape.border_line(i - 1);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>prev_corner = curr_corner;<NEW_LINE>}<NEW_LINE>if (p_room_1 instanceof ObstacleExpansionRoom) {<NEW_LINE>if (!insert_door_ok((ObstacleExpansionRoom) p_room_1, door_line)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (p_room_2 instanceof ObstacleExpansionRoom) {<NEW_LINE>return insert_door_ok((ObstacleExpansionRoom) p_room_2, door_line);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
curr_corner = p_door_shape.corner(i);
|
1,117,022
|
public // }<NEW_LINE>Object construct(Object reference, JSFunction function, Object... args) {<NEW_LINE>if (!function.isConstructor()) {<NEW_LINE>throw new ThrowException<MASK><NEW_LINE>}<NEW_LINE>Object ctorName = function.get(this, "name");<NEW_LINE>if (ctorName == Types.UNDEFINED) {<NEW_LINE>if (reference instanceof Reference) {<NEW_LINE>ctorName = ((Reference) reference).getReferencedName();<NEW_LINE>} else {<NEW_LINE>ctorName = function.getDebugContext();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// 13.2.2<NEW_LINE>// 1. create the new object<NEW_LINE>JSObject obj = function.createNewObject(this);<NEW_LINE>// 2. set internal methods per 8.12 [DynObject]<NEW_LINE>// 3. set class name [DynObject subclass (defaults true)]<NEW_LINE>// 4. Set Extensible [DynObject subclass (defaults true)]<NEW_LINE>// 5. Get the function's prototype<NEW_LINE>// 6. If prototype is an object make that the new object's prototype<NEW_LINE>// 7. If prototype is not an object set to the standard builtin object prototype 15.2.4 [AbstractJavascriptFunction]<NEW_LINE>// [AbstractJavascriptFunction] handles #7, subclasses may handle #6 if necessary (see BuiltinArray#createNewObject)<NEW_LINE>Object p = function.get(this, "prototype");<NEW_LINE>if (p != Types.UNDEFINED && p instanceof JSObject) {<NEW_LINE>obj.setPrototype((JSObject) p);<NEW_LINE>} else {<NEW_LINE>JSObject defaultObjectProto = getPrototypeFor("Object");<NEW_LINE>obj.setPrototype(defaultObjectProto);<NEW_LINE>}<NEW_LINE>// 8. Call the function with obj as self<NEW_LINE>Object result = call(true, reference, function, obj, args);<NEW_LINE>// 9. If result is a JSObject return it<NEW_LINE>if (result instanceof JSObject) {<NEW_LINE>obj = (JSObject) result;<NEW_LINE>}<NEW_LINE>// Otherwise return obj<NEW_LINE>return obj;<NEW_LINE>}
|
(this, createTypeError("not a constructor"));
|
1,090,134
|
public static ItemStack fillItem(Level world, int requiredAmount, ItemStack stack, FluidStack availableFluid) {<NEW_LINE>FluidStack toFill = availableFluid.copy();<NEW_LINE>toFill.setAmount(requiredAmount);<NEW_LINE>wrapper.setItem(0, stack);<NEW_LINE>FillingRecipe fillingRecipe = SequencedAssemblyRecipe.getRecipe(world, wrapper, AllRecipeTypes.FILLING.getType(), FillingRecipe.class).filter(fr -> fr.getRequiredFluid().test(toFill)).orElseGet(() -> {<NEW_LINE>for (Recipe<RecipeWrapper> recipe : world.getRecipeManager().getRecipesFor(AllRecipeTypes.FILLING.getType(), wrapper, world)) {<NEW_LINE>FillingRecipe fr = (FillingRecipe) recipe;<NEW_LINE>FluidIngredient requiredFluid = fr.getRequiredFluid();<NEW_LINE>if (requiredFluid.test(toFill))<NEW_LINE>return fr;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>if (fillingRecipe != null) {<NEW_LINE>List<ItemStack> results = fillingRecipe.rollResults();<NEW_LINE>availableFluid.shrink(requiredAmount);<NEW_LINE>stack.shrink(1);<NEW_LINE>return results.isEmpty() ? ItemStack.<MASK><NEW_LINE>}<NEW_LINE>return GenericItemFilling.fillItem(world, requiredAmount, stack, availableFluid);<NEW_LINE>}
|
EMPTY : results.get(0);
|
1,168,416
|
private ImportResults doSkosImport(String format, String url, String rdfFragment, Map<String, Object> props) throws RDFImportException {<NEW_LINE>SkosImporter skosImporter = null;<NEW_LINE>RDFParserConfig conf = null;<NEW_LINE>RDFFormat rdfFormat = null;<NEW_LINE>ImportResults importResults = new ImportResults();<NEW_LINE>try {<NEW_LINE>checkConstraintExist();<NEW_LINE>conf = new RDFParserConfig(props, new GraphConfig(tx));<NEW_LINE>rdfFormat = getFormat(format);<NEW_LINE>skosImporter = new SkosImporter(db, tx, conf, log);<NEW_LINE>} catch (RDFImportPreRequisitesNotMet e) {<NEW_LINE>importResults.setTerminationKO(e.getMessage());<NEW_LINE>} catch (RDFImportBadParams e) {<NEW_LINE>importResults.setTerminationKO(e.getMessage());<NEW_LINE>} catch (GraphConfig.GraphConfigNotFound e) {<NEW_LINE>throw new RDFImportException("A Graph Config is required for the SKOS import procedure to run");<NEW_LINE>}<NEW_LINE>if (skosImporter != null) {<NEW_LINE>try {<NEW_LINE>parseRDFPayloadOrFromUrl(rdfFormat, url, rdfFragment, props, skosImporter);<NEW_LINE>importResults.setTriplesLoaded(skosImporter.totalTriplesMapped);<NEW_LINE><MASK><NEW_LINE>importResults.setConfigSummary(props);<NEW_LINE>} catch (IOException | RDFHandlerException | QueryExecutionException | RDFParseException e) {<NEW_LINE>importResults.setTerminationKO(e.getMessage());<NEW_LINE>importResults.setTriplesLoaded(skosImporter.totalTriplesMapped);<NEW_LINE>importResults.setTriplesParsed(skosImporter.totalTriplesParsed);<NEW_LINE>importResults.setConfigSummary(props);<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return importResults;<NEW_LINE>}
|
importResults.setTriplesParsed(skosImporter.totalTriplesParsed);
|
227,091
|
private Mono<Response<Void>> patchWithResponseAsync(String vaultName, String resourceGroupName, BackupResourceConfigResourceInner parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (vaultName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.patch(this.client.getEndpoint(), this.client.getApiVersion(), vaultName, resourceGroupName, this.client.getSubscriptionId(), parameters, accept, context);<NEW_LINE>}
|
error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
|
1,006,507
|
public void changeNumReplicas(final String tableName) throws Exception {<NEW_LINE>// Get the number of replicas in the tableconfig.<NEW_LINE>final String offlineTableName = TableNameBuilder.OFFLINE.tableNameWithType(tableName);<NEW_LINE>final TableConfig offlineTableConfig = ZKMetadataProvider.getOfflineTableConfig(_propertyStore, offlineTableName);<NEW_LINE>final int newNumReplicas = Integer.parseInt(offlineTableConfig.getValidationConfig().getReplication());<NEW_LINE>// Now get the idealstate, and get the number of replicas in it.<NEW_LINE>IdealState currentIdealState = _helixAdmin.getResourceIdealState(_clusterName, offlineTableName);<NEW_LINE>int currentNumReplicas = Integer.parseInt(currentIdealState.getReplicas());<NEW_LINE>if (newNumReplicas > currentNumReplicas) {<NEW_LINE>LOGGER.info("Increasing replicas not yet supported");<NEW_LINE>} else if (newNumReplicas == currentNumReplicas) {<NEW_LINE>LOGGER.info("Number of replicas ({}) match in table definition and Idealstate. Nothing to do for {}", newNumReplicas, offlineTableName);<NEW_LINE>} else if (newNumReplicas < currentNumReplicas) {<NEW_LINE>if (_dryRun) {<NEW_LINE>IdealState <MASK><NEW_LINE>LOGGER.info("Final segment Assignment:");<NEW_LINE>printSegmentAssignment(newIdealState.getRecord().getMapFields());<NEW_LINE>} else {<NEW_LINE>HelixHelper.updateIdealState(_helixManager, offlineTableName, new Function<IdealState, IdealState>() {<NEW_LINE><NEW_LINE>@Nullable<NEW_LINE>@Override<NEW_LINE>public IdealState apply(IdealState idealState) {<NEW_LINE>return updateIdealState(idealState, newNumReplicas);<NEW_LINE>}<NEW_LINE>}, RetryPolicies.exponentialBackoffRetryPolicy(5, 500L, 2.0f));<NEW_LINE>waitForStable(offlineTableName);<NEW_LINE>LOGGER.info("Successfully changed numReplicas to {} for table {}", newNumReplicas, offlineTableName);<NEW_LINE>LOGGER.warn("*** You need to rebalance table {} ***", offlineTableName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
newIdealState = updateIdealState(currentIdealState, newNumReplicas);
|
127,240
|
public void init() {<NEW_LINE>if (currentStatus == LifecycleStatus.NONE) {<NEW_LINE>currentStatus = changedStatus(<MASK><NEW_LINE>try {<NEW_LINE>instance.init();<NEW_LINE>currentStatus = changedStatus(instance, currentStatus, LifecycleStatus.STOPPED);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>currentStatus = changedStatus(instance, currentStatus, LifecycleStatus.NONE);<NEW_LINE>try {<NEW_LINE>instance.shutdown();<NEW_LINE>} catch (Throwable se) {<NEW_LINE>LifecycleException lifecycleException = new LifecycleException("Exception during graceful " + "attempt to shutdown partially initialized component. Please use non suppressed" + " exception to see original component failure.", se);<NEW_LINE>e.addSuppressed(lifecycleException);<NEW_LINE>}<NEW_LINE>if (e instanceof LifecycleException) {<NEW_LINE>throw (LifecycleException) e;<NEW_LINE>}<NEW_LINE>throw new LifecycleException(instance, LifecycleStatus.NONE, LifecycleStatus.STOPPED, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
instance, currentStatus, LifecycleStatus.INITIALIZING);
|
1,207,806
|
public void build(VBox box) {<NEW_LINE>LogArea logArea = logArea().withDecorations(box(BoxType.DOUBLE, "Log")).withPreferredSize(box.getContentSize().withRelativeHeight(-1)).build();<NEW_LINE>logArea.<MASK><NEW_LINE>logArea.addParagraph("This is a log row with a typing effect", false, 200);<NEW_LINE>logArea.addNewRows(2);<NEW_LINE>logArea.addInlineText("This is a log row with a ");<NEW_LINE>Button btn = button().withText("Button").build();<NEW_LINE>logArea.addInlineComponent(btn);<NEW_LINE>logArea.commitInlineElements();<NEW_LINE>logArea.addNewRows(2);<NEW_LINE>logArea.addParagraph("This is a long log row, which gets wrapped, since it is long", false, 0);<NEW_LINE>logArea.addNewRows(1);<NEW_LINE>ComponentStyleSet paragraphStyleSet = ComponentStyleSet.newBuilder().withDefaultStyle(StyleSet.newBuilder().withForegroundColor(YELLOW).withBackgroundColor(TileColor.defaultBackgroundColor()).build()).build();<NEW_LINE>logArea.addParagraph(ParagraphBuilder.newBuilder().withText("This is a long log row, which gets wrapped, since it is long with a different style").withComponentStyleSet(paragraphStyleSet), false);<NEW_LINE>box.addComponent(logArea);<NEW_LINE>}
|
addParagraph("This is a simple log row", false, 0);
|
137,832
|
public ImportResult importItem(UUID jobId, IdempotentImportExecutor idempotentImportExecutor, TokenAuthData authData, ContactsModelWrapper wrapper) {<NEW_LINE>JCardReader reader = new JCardReader(wrapper.getVCards());<NEW_LINE>try {<NEW_LINE>List<VCard> cards = reader.readAll();<NEW_LINE>List<String> <MASK><NEW_LINE>int[] id = new int[] { 1 };<NEW_LINE>List<Map<String, Object>> requests = cards.stream().map(card -> {<NEW_LINE>TransformResult<LinkedHashMap> result = transformerService.transform(LinkedHashMap.class, card);<NEW_LINE>problems.addAll(result.getProblems());<NEW_LINE>LinkedHashMap contact = result.getTransformed();<NEW_LINE>Map<String, Object> request = createRequest(id[0], CONTACTS_URL, contact);<NEW_LINE>id[0]++;<NEW_LINE>return request;<NEW_LINE>}).collect(toList());<NEW_LINE>if (!problems.isEmpty()) {<NEW_LINE>// TODO log problems<NEW_LINE>}<NEW_LINE>return batchRequest(authData, requests, baseUrl, client, objectMapper).getResult();<NEW_LINE>} catch (IOException e) {<NEW_LINE>// TODO log<NEW_LINE>e.printStackTrace();<NEW_LINE>return new ImportResult(e);<NEW_LINE>}<NEW_LINE>}
|
problems = new ArrayList<>();
|
1,142,477
|
protected void translateCore(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) {<NEW_LINE>final IOperandTreeNode sourceOperand = instruction.getOperands().get(1).getRootNode().getChildren().get(0);<NEW_LINE>final String sourceRegister = (sourceOperand.getValue());<NEW_LINE>final OperandSize bt = OperandSize.BYTE;<NEW_LINE>final OperandSize dw = OperandSize.DWORD;<NEW_LINE>final String tmpZ = environment.getNextVariableString();<NEW_LINE>final String tmpC = environment.getNextVariableString();<NEW_LINE>final String tmpV = environment.getNextVariableString();<NEW_LINE>final String tmpQ = environment.getNextVariableString();<NEW_LINE>long baseOffset = (instruction.getAddress().toLong() * 0x100) + instructions.size();<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, sourceRegister, dw, String.valueOf(-<MASK><NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, sourceRegister, dw, String.valueOf(-30), bt, tmpZ));<NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, bt, tmpZ, bt, String.valueOf(1L), bt, "Z"));<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, sourceRegister, dw, String.valueOf(-29), bt, tmpC));<NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, bt, tmpC, bt, String.valueOf(1L), bt, "C"));<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, sourceRegister, dw, String.valueOf(-28), bt, tmpV));<NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, bt, tmpV, bt, String.valueOf(1L), bt, "C"));<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, sourceRegister, dw, String.valueOf(-29), bt, tmpQ));<NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, bt, tmpQ, bt, String.valueOf(1L), bt, "C"));<NEW_LINE>}
|
31), bt, "N"));
|
500,464
|
final DeletePackagingGroupResult executeDeletePackagingGroup(DeletePackagingGroupRequest deletePackagingGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deletePackagingGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeletePackagingGroupRequest> request = null;<NEW_LINE>Response<DeletePackagingGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeletePackagingGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deletePackagingGroupRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "MediaPackage Vod");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeletePackagingGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeletePackagingGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeletePackagingGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
HandlerContextKey.SIGNING_REGION, getSigningRegion());
|
1,218,462
|
public IntermediateLayer constructIntermediateLayer(long queryId, UDTFPlan udtfPlan, RawQueryInputLayer rawTimeSeriesInputLayer, Map<Expression, IntermediateLayer> expressionIntermediateLayerMap, Map<Expression, TSDataType> expressionDataTypeMap, LayerMemoryAssigner memoryAssigner) throws QueryProcessException, IOException {<NEW_LINE>if (!expressionIntermediateLayerMap.containsKey(this)) {<NEW_LINE>float memoryBudgetInMB = memoryAssigner.assign();<NEW_LINE>Transformer transformer;<NEW_LINE>if (isBuiltInAggregationFunctionExpression) {<NEW_LINE>transformer = new TransparentTransformer(rawTimeSeriesInputLayer.constructPointReader(udtfPlan.<MASK><NEW_LINE>} else {<NEW_LINE>IntermediateLayer udfInputIntermediateLayer = constructUdfInputIntermediateLayer(queryId, udtfPlan, rawTimeSeriesInputLayer, expressionIntermediateLayerMap, expressionDataTypeMap, memoryAssigner);<NEW_LINE>transformer = constructUdfTransformer(queryId, udtfPlan, expressionDataTypeMap, memoryAssigner, udfInputIntermediateLayer);<NEW_LINE>}<NEW_LINE>expressionDataTypeMap.put(this, transformer.getDataType());<NEW_LINE>expressionIntermediateLayerMap.put(this, memoryAssigner.getReference(this) == 1 ? new SingleInputColumnSingleReferenceIntermediateLayer(this, queryId, memoryBudgetInMB, transformer) : new SingleInputColumnMultiReferenceIntermediateLayer(this, queryId, memoryBudgetInMB, transformer));<NEW_LINE>}<NEW_LINE>return expressionIntermediateLayerMap.get(this);<NEW_LINE>}
|
getReaderIndexByExpressionName(toString())));
|
725,558
|
private static String formatDocumentation(String input) {<NEW_LINE>StringBuilder builder = new <MASK><NEW_LINE>String[] paragraphs = PARAGRAPH.split(input);<NEW_LINE>for (String paragraph : paragraphs) {<NEW_LINE>if (builder.length() != 0) {<NEW_LINE>builder.append("\n\n");<NEW_LINE>}<NEW_LINE>Matcher matcher = WHITESPACE.matcher(paragraph);<NEW_LINE>int lineLen = 8;<NEW_LINE>int lastMatch = 0;<NEW_LINE>while (matcher.find()) {<NEW_LINE>int wordLen = matcher.start() - lastMatch;<NEW_LINE>if (160 < lineLen + wordLen + 1) {<NEW_LINE>builder.append("\n");<NEW_LINE>lineLen = 8;<NEW_LINE>}<NEW_LINE>builder.append(lineLen == 8 ? " " : " ");<NEW_LINE>builder.append(paragraph, lastMatch, matcher.start());<NEW_LINE>lineLen += wordLen + 1;<NEW_LINE>lastMatch = matcher.end();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return builder.toString();<NEW_LINE>}
|
StringBuilder(input.length());
|
842,959
|
private JSONObject decode17(ByteBuffer buf) {<NEW_LINE>JSONObject m = new JSONObject();<NEW_LINE>while (buf.position() < buf.array().length) {<NEW_LINE>long tl = uint32(buf);<NEW_LINE>int t = (int) (tl >>> 3);<NEW_LINE>switch(t) {<NEW_LINE>case 1:<NEW_LINE>m.put<MASK><NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>m.put("AAA303", uint64(buf));<NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>m.put("AAA312", uint32(buf));<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>m.put("AAA77", uint32(buf));<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>m.put("AAA78", uint32(buf));<NEW_LINE>break;<NEW_LINE>case 6:<NEW_LINE>int len = (int) uint32(buf);<NEW_LINE>byte[] newB = new byte[len];<NEW_LINE>buf.get(newB, 0, len);<NEW_LINE>m.put("AAA79", decode2(ByteBuffer.wrap(newB)));<NEW_LINE>break;<NEW_LINE>case 7:<NEW_LINE>// TODO AAA80<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// r.skipType(t&7)<NEW_LINE>// break;<NEW_LINE>return m;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return m;<NEW_LINE>}
|
("AAA311", uint32(buf));
|
936,641
|
public static DescribeContactsResponse unmarshall(DescribeContactsResponse describeContactsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeContactsResponse.setRequestId(_ctx.stringValue("DescribeContactsResponse.RequestId"));<NEW_LINE>PageBean pageBean = new PageBean();<NEW_LINE>pageBean.setTotal(_ctx.longValue("DescribeContactsResponse.PageBean.Total"));<NEW_LINE>pageBean.setPage(_ctx.longValue("DescribeContactsResponse.PageBean.Page"));<NEW_LINE>pageBean.setSize(_ctx.longValue("DescribeContactsResponse.PageBean.Size"));<NEW_LINE>List<Contacts> alertContacts <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeContactsResponse.PageBean.AlertContacts.Length"); i++) {<NEW_LINE>Contacts contacts = new Contacts();<NEW_LINE>contacts.setContactId(_ctx.floatValue("DescribeContactsResponse.PageBean.AlertContacts[" + i + "].ContactId"));<NEW_LINE>contacts.setContactName(_ctx.stringValue("DescribeContactsResponse.PageBean.AlertContacts[" + i + "].ContactName"));<NEW_LINE>contacts.setPhone(_ctx.stringValue("DescribeContactsResponse.PageBean.AlertContacts[" + i + "].Phone"));<NEW_LINE>contacts.setEmail(_ctx.stringValue("DescribeContactsResponse.PageBean.AlertContacts[" + i + "].Email"));<NEW_LINE>contacts.setIsVerify(_ctx.booleanValue("DescribeContactsResponse.PageBean.AlertContacts[" + i + "].IsVerify"));<NEW_LINE>alertContacts.add(contacts);<NEW_LINE>}<NEW_LINE>pageBean.setAlertContacts(alertContacts);<NEW_LINE>describeContactsResponse.setPageBean(pageBean);<NEW_LINE>return describeContactsResponse;<NEW_LINE>}
|
= new ArrayList<Contacts>();
|
595,236
|
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>binding = DataBindingUtil.inflate(inflater, R.layout.event_create_layout, container, false);<NEW_LINE>validator = new Validator(binding.form);<NEW_LINE>createEventViewModel = ViewModelProviders.of(getActivity(), viewModelFactory).get(CreateEventViewModel.class);<NEW_LINE>if (getArguments() != null) {<NEW_LINE>Bundle bundle = getArguments();<NEW_LINE>eventId = bundle.getLong(CreateEventActivity.EVENT_ID);<NEW_LINE>}<NEW_LINE>AppCompatActivity activity = <MASK><NEW_LINE>activity.setSupportActionBar(binding.toolbar);<NEW_LINE>ActionBar actionBar = activity.getSupportActionBar();<NEW_LINE>if (actionBar != null) {<NEW_LINE>actionBar.setHomeButtonEnabled(true);<NEW_LINE>actionBar.setDisplayHomeAsUpEnabled(true);<NEW_LINE>}<NEW_LINE>setHasOptionsMenu(true);<NEW_LINE>if ("fdroid".equals(BuildConfig.FLAVOR)) {<NEW_LINE>binding.form.paymentPrefs.setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>binding.form.paymentPrefs.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>binding.form.eventOriginalImageLayout.setOnClickListener(view -> {<NEW_LINE>Intent intent = new Intent();<NEW_LINE>intent.setType("image/*");<NEW_LINE>intent.setAction(Intent.ACTION_GET_CONTENT);<NEW_LINE>startActivityForResult(Intent.createChooser(intent, "Select Picture"), IMAGE_CHOOSER_REQUEST_CODE);<NEW_LINE>});<NEW_LINE>binding.form.description.setOnClickListener(view -> {<NEW_LINE>Intent richEditorIntent = new Intent(getContext(), RichEditorActivity.class);<NEW_LINE>richEditorIntent.putExtra(TAG_RICH_TEXT, binding.form.description.getText().toString());<NEW_LINE>startActivityForResult(richEditorIntent, RICH_TEXT_REQUEST);<NEW_LINE>});<NEW_LINE>binding.form.paymentPrefs.setOnClickListener(view -> {<NEW_LINE>getFragmentManager().beginTransaction().replace(R.id.fragment_container, PaymentPrefsFragment.newInstance()).addToBackStack(null).commit();<NEW_LINE>});<NEW_LINE>setupSpinners();<NEW_LINE>attachCountryList(createEventViewModel.getCountryList());<NEW_LINE>attachCurrencyCodesList(createEventViewModel.getCurrencyCodesList());<NEW_LINE>setupPlacesAutocomplete();<NEW_LINE>return binding.getRoot();<NEW_LINE>}
|
((AppCompatActivity) getActivity());
|
1,579,761
|
protected <S extends StylingString> S format(Widget widget, Object element, S string) {<NEW_LINE>if (element instanceof Group) {<NEW_LINE>Group group = (Group) element;<NEW_LINE>string.append(trimGroupString(group.name), string.defaultStyle());<NEW_LINE>string.append(" " + group.group.getItemsCount(), string.structureStyle());<NEW_LINE>} else if (element instanceof Item) {<NEW_LINE>Item item = (Item) element;<NEW_LINE>string.startLink(item.item.getCommand());<NEW_LINE>string.append(Formatter.commandIndex(item.item.getCommand()), string.linkStyle());<NEW_LINE>string.endLink();<NEW_LINE>string.append(": ", string.structureStyle());<NEW_LINE>switch(item.item.getSeverity()) {<NEW_LINE>case FatalLevel:<NEW_LINE>case ErrorLevel:<NEW_LINE>string.append(trimSeverity(item.item), string.errorStyle());<NEW_LINE>break;<NEW_LINE>case WarningLevel:<NEW_LINE>string.append(trimSeverity(item.item<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>string.append(trimSeverity(item.item), string.defaultStyle());<NEW_LINE>}<NEW_LINE>String sep = " ";<NEW_LINE>for (Service.MsgRef tag : item.item.getTagsList()) {<NEW_LINE>string.append(sep, string.structureStyle());<NEW_LINE>string.append(trimTagString(messages.get(item.report, tag)), string.defaultStyle());<NEW_LINE>sep = ", ";<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return string;<NEW_LINE>}
|
), string.errorStyle());
|
1,550,857
|
public ClusterStateChangeReason unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ClusterStateChangeReason clusterStateChangeReason = new ClusterStateChangeReason();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Code", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>clusterStateChangeReason.setCode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Message", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>clusterStateChangeReason.setMessage(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return clusterStateChangeReason;<NEW_LINE>}
|
class).unmarshall(context));
|
940,013
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {<NEW_LINE>rootView = inflater.inflate(R.<MASK><NEW_LINE>mainActivity = (MainActivity) getActivity();<NEW_LINE>accentColor = mainActivity.getAccent();<NEW_LINE>if (mainActivity.getAppTheme().equals(AppTheme.DARK) || mainActivity.getAppTheme().equals(AppTheme.BLACK))<NEW_LINE>rootView.setBackgroundResource((R.color.cardView_background));<NEW_LINE>mCardView = rootView.findViewById(R.id.card_view);<NEW_LINE>mLineChart = rootView.findViewById(R.id.progress_chart);<NEW_LINE>mProgressImage = rootView.findViewById(R.id.progress_image);<NEW_LINE>mCancelButton = rootView.findViewById(R.id.delete_button);<NEW_LINE>mProgressTypeText = rootView.findViewById(R.id.text_view_progress_type);<NEW_LINE>mProgressFileNameText = rootView.findViewById(R.id.text_view_progress_file_name);<NEW_LINE>mProgressBytesText = rootView.findViewById(R.id.text_view_progress_bytes);<NEW_LINE>mProgressFileText = rootView.findViewById(R.id.text_view_progress_file);<NEW_LINE>mProgressSpeedText = rootView.findViewById(R.id.text_view_progress_speed);<NEW_LINE>mProgressTimer = rootView.findViewById(R.id.text_view_progress_timer);<NEW_LINE>if (mainActivity.getAppTheme().equals(AppTheme.DARK) || mainActivity.getAppTheme().equals(AppTheme.BLACK)) {<NEW_LINE>mCancelButton.setImageResource(R.drawable.ic_action_cancel);<NEW_LINE>mCardView.setCardBackgroundColor(Utils.getColor(getContext(), R.color.cardView_foreground));<NEW_LINE>mCardView.setCardElevation(0f);<NEW_LINE>}<NEW_LINE>mCopyConnection = new CustomServiceConnection(this, mLineChart, SERVICE_COPY);<NEW_LINE>mExtractConnection = new CustomServiceConnection(this, mLineChart, SERVICE_EXTRACT);<NEW_LINE>mCompressConnection = new CustomServiceConnection(this, mLineChart, SERVICE_COMPRESS);<NEW_LINE>mEncryptConnection = new CustomServiceConnection(this, mLineChart, SERVICE_ENCRYPT);<NEW_LINE>mDecryptConnection = new CustomServiceConnection(this, mLineChart, SERVICE_DECRYPT);<NEW_LINE>return rootView;<NEW_LINE>}
|
layout.processparent, container, false);
|
1,124,588
|
private static CdmEntityAttributeDefinition CreateEntityAttributeForRelationshipBetweenTwoEntities(final CdmCorpusDefinition cdmCorpus, final String associatedEntityName, final String foreignKeyName, final String attributeExplanation) {<NEW_LINE>// Define a relationship by creating an entity attribute<NEW_LINE>CdmEntityAttributeDefinition entityAttributeDef = cdmCorpus.makeObject(CdmObjectType.EntityAttributeDef, foreignKeyName);<NEW_LINE>entityAttributeDef.setExplanation(attributeExplanation);<NEW_LINE>// Creating an entity reference for the associated entity<NEW_LINE>CdmEntityReference associatedEntityRef = cdmCorpus.makeRef(CdmObjectType.EntityRef, associatedEntityName, false);<NEW_LINE>// Creating a "is.identifiedBy" trait for entity reference<NEW_LINE>CdmTraitReference traitReference = cdmCorpus.makeObject(CdmObjectType.TraitRef, "is.identifiedBy", false);<NEW_LINE>String s = associatedEntityName + "/(resolvedAttributes)/" + associatedEntityName + "Id";<NEW_LINE>traitReference.getArguments().add(null, associatedEntityName + "/(resolvedAttributes)/" + associatedEntityName + "Id");<NEW_LINE>// Add the trait to the attribute's entity reference<NEW_LINE>associatedEntityRef.getAppliedTraits().add(traitReference);<NEW_LINE>entityAttributeDef.setEntity(associatedEntityRef);<NEW_LINE>entityAttributeDef.setPurpose(CreateRelationshipMeanings(cdmCorpus, "Non-simple resolution guidance sample"));<NEW_LINE>// Add resolution guidance<NEW_LINE>CdmAttributeResolutionGuidance attributeResolution = <MASK><NEW_LINE>attributeResolution.setEntityByReference(attributeResolution.makeEntityByReference());<NEW_LINE>attributeResolution.getEntityByReference().setAllowReference(true);<NEW_LINE>attributeResolution.setRenameFormat("{m}");<NEW_LINE>CdmTypeAttributeDefinition entityAttribute = CreateTypeAttributeWithPurposeAndDataType(cdmCorpus, foreignKeyName + "Id", "identifiedBy", "entityId");<NEW_LINE>attributeResolution.getEntityByReference().setForeignKeyAttribute(entityAttribute);<NEW_LINE>entityAttributeDef.setResolutionGuidance(attributeResolution);<NEW_LINE>return entityAttributeDef;<NEW_LINE>}
|
cdmCorpus.makeObject(CdmObjectType.AttributeResolutionGuidanceDef);
|
1,615,573
|
public Request<GetSegmentRequest> marshall(GetSegmentRequest getSegmentRequest) {<NEW_LINE>if (getSegmentRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(GetSegmentRequest)");<NEW_LINE>}<NEW_LINE>Request<GetSegmentRequest> request = new DefaultRequest<MASK><NEW_LINE>request.setHttpMethod(HttpMethodName.GET);<NEW_LINE>String uriResourcePath = "/v1/apps/{application-id}/segments/{segment-id}";<NEW_LINE>uriResourcePath = uriResourcePath.replace("{application-id}", (getSegmentRequest.getApplicationId() == null) ? "" : StringUtils.fromString(getSegmentRequest.getApplicationId()));<NEW_LINE>uriResourcePath = uriResourcePath.replace("{segment-id}", (getSegmentRequest.getSegmentId() == null) ? "" : StringUtils.fromString(getSegmentRequest.getSegmentId()));<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.1");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
|
<GetSegmentRequest>(getSegmentRequest, "AmazonPinpoint");
|
1,758,516
|
public static void main(final String[] args) throws IOException {<NEW_LINE>final String fileZip = "src/main/resources/unzipTest/compressed.zip";<NEW_LINE>final File destDir = new File("src/main/resources/unzipTest");<NEW_LINE>final byte[] buffer = new byte[1024];<NEW_LINE>final ZipInputStream zis = new ZipInputStream(new FileInputStream(fileZip));<NEW_LINE>ZipEntry zipEntry = zis.getNextEntry();<NEW_LINE>while (zipEntry != null) {<NEW_LINE>final File newFile = newFile(destDir, zipEntry);<NEW_LINE>if (zipEntry.isDirectory()) {<NEW_LINE>if (!newFile.isDirectory() && !newFile.mkdirs()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>File parent = newFile.getParentFile();<NEW_LINE>if (!parent.isDirectory() && !parent.mkdirs()) {<NEW_LINE>throw new IOException("Failed to create directory " + parent);<NEW_LINE>}<NEW_LINE>final FileOutputStream fos = new FileOutputStream(newFile);<NEW_LINE>int len;<NEW_LINE>while ((len = zis.read(buffer)) > 0) {<NEW_LINE>fos.write(buffer, 0, len);<NEW_LINE>}<NEW_LINE>fos.close();<NEW_LINE>}<NEW_LINE>zipEntry = zis.getNextEntry();<NEW_LINE>}<NEW_LINE>zis.closeEntry();<NEW_LINE>zis.close();<NEW_LINE>}
|
throw new IOException("Failed to create directory " + newFile);
|
1,246,338
|
final UpdateResponseHeadersPolicyResult executeUpdateResponseHeadersPolicy(UpdateResponseHeadersPolicyRequest updateResponseHeadersPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateResponseHeadersPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<UpdateResponseHeadersPolicyRequest> request = null;<NEW_LINE>Response<UpdateResponseHeadersPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateResponseHeadersPolicyRequestMarshaller().marshall(super.beforeMarshalling(updateResponseHeadersPolicyRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "CloudFront");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateResponseHeadersPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<UpdateResponseHeadersPolicyResult> responseHandler = new StaxResponseHandler<UpdateResponseHeadersPolicyResult>(new UpdateResponseHeadersPolicyResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
|
284,058
|
// createAccounting<NEW_LINE>private boolean createCalendar(Timestamp startDate, int historyYears) {<NEW_LINE>m_calendar = new MCalendar(m_client);<NEW_LINE>if (!m_calendar.save()) {<NEW_LINE>String err = "Calendar NOT inserted";<NEW_LINE>log.log(Level.SEVERE, err);<NEW_LINE>m_info.append(err);<NEW_LINE>m_trx.rollback();<NEW_LINE>m_trx.close();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Info<NEW_LINE>m_info.append(Msg.translate(m_lang, "C_Calendar_ID")).append("=").append(m_calendar.getName()).append("\n");<NEW_LINE>Calendar cal = Calendar.getInstance(m_client.getLocale());<NEW_LINE>if (startDate != null)<NEW_LINE>cal.setTime(startDate);<NEW_LINE>else {<NEW_LINE>cal.set(Calendar.DATE, 1);<NEW_LINE>cal.set(Calendar.MONTH, 0);<NEW_LINE>}<NEW_LINE>if (historyYears < 0)<NEW_LINE>historyYears = 0;<NEW_LINE>cal.add(Calendar.YEAR, -historyYears);<NEW_LINE>// get last day of financial year<NEW_LINE>Calendar lastday = Calendar.getInstance();<NEW_LINE>lastday.setTime(cal.getTime());<NEW_LINE>lastday.add(Calendar.YEAR, 1);<NEW_LINE>lastday.add(Calendar.DATE, -1);<NEW_LINE>for (// create next 5 years<NEW_LINE>// create next 5 years<NEW_LINE>int i = 0; // create next 5 years<NEW_LINE>i < historyYears + 5; i++) {<NEW_LINE>MYear year = new MYear(m_calendar);<NEW_LINE>String Year = String.valueOf(lastday.get(Calendar.YEAR));<NEW_LINE>year.setFiscalYear(Year);<NEW_LINE>if (year.save())<NEW_LINE>year.createStdPeriods(m_client.getLocale(), new Timestamp(cal.getTimeInMillis()), "yyyy-MM");<NEW_LINE>if (year == null)<NEW_LINE>log.log(Level.SEVERE, "Year NOT inserted");<NEW_LINE>cal.add(Calendar.YEAR, 1);<NEW_LINE>lastday.<MASK><NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
|
add(Calendar.YEAR, 1);
|
355,042
|
// TODO: sub file cache<NEW_LINE>public static Output provideOutput(OpenDocument document, TranslationSettings settings, String cachePrefix, String cacheSuffix) throws IOException {<NEW_LINE>Output output = new Output();<NEW_LINE><MASK><NEW_LINE>if (!settings.isSplitPages() || (document instanceof OpenDocumentText)) {<NEW_LINE>output.count = 1;<NEW_LINE>output.titles = SINGLE_TITLE;<NEW_LINE>} else {<NEW_LINE>if (document instanceof OpenDocumentSpreadsheet) {<NEW_LINE>output.count = document.getAsSpreadsheet().getTableCount();<NEW_LINE>output.titles = document.getAsSpreadsheet().getTableNames();<NEW_LINE>} else if (document instanceof OpenDocumentPresentation) {<NEW_LINE>output.count = document.getAsPresentation().getPageCount();<NEW_LINE>output.titles = document.getAsPresentation().getPageNames();<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("unsupported document");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>output.names = new ArrayList<String>();<NEW_LINE>LWXMLWriter[] outs = new LWXMLWriter[output.count];<NEW_LINE>for (int i = 0; i < output.count; i++) {<NEW_LINE>String name = cachePrefix + i + cacheSuffix;<NEW_LINE>output.names.add(name);<NEW_LINE>File file = cache.create(name);<NEW_LINE>outs[i] = new LWXMLStreamWriter(new FileWriter(file));<NEW_LINE>}<NEW_LINE>output.cache = cache;<NEW_LINE>output.names = Collections.unmodifiableList(output.names);<NEW_LINE>output.titles = Collections.unmodifiableList(output.titles);<NEW_LINE>output.writer = new LWXMLMultiWriter(outs);<NEW_LINE>return output;<NEW_LINE>}
|
FileCache cache = settings.getCache();
|
1,146,173
|
public void run(RegressionEnvironment env) {<NEW_LINE>env.compileDeploy("@name('s0') select p0.n0 as a, p1[0].n0 as b, p1[1].n0 as c, p0 as d, p1 as e from MyOAWithAMap");<NEW_LINE>env.addListener("s0");<NEW_LINE>Map<String, Object> n0Bean1 = makeMap(new Object[][] { { "n0", 1 } });<NEW_LINE>Map<String, Object> n0Bean21 = makeMap(new Object[][] { { "n0", 2 } });<NEW_LINE>Map<String, Object> n0Bean22 = makeMap(new Object[][] { { "n0", 3 } });<NEW_LINE>Map[] n0Bean2 = new Map[] { n0Bean21, n0Bean22 };<NEW_LINE>env.sendEventObjectArray(new Object[] { n0Bean1, n0Bean2 }, "MyOAWithAMap");<NEW_LINE>env.assertEventNew("s0", eventResult -> {<NEW_LINE>EPAssertionUtil.assertProps(eventResult, "a,b,c,d".split(","), new Object[] { 1, 2, 3, n0Bean1 });<NEW_LINE>Map[] valueE = (Map[]) eventResult.get("e");<NEW_LINE>assertEquals(valueE[0], n0Bean2[0]);<NEW_LINE>assertEquals(valueE[1], n0Bean2[1]);<NEW_LINE>});<NEW_LINE>env.assertStatement("s0", statement -> {<NEW_LINE>EventType eventType = statement.getEventType();<NEW_LINE>assertEquals(Integer.class, eventType.getPropertyType("a"));<NEW_LINE>assertEquals(Integer.class, eventType.getPropertyType("b"));<NEW_LINE>assertEquals(Integer.class<MASK><NEW_LINE>assertEquals(Map.class, eventType.getPropertyType("d"));<NEW_LINE>assertEquals(Map[].class, eventType.getPropertyType("e"));<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>}
|
, eventType.getPropertyType("c"));
|
975,006
|
private static void tryMT(RegressionEnvironment env, int numSeconds) throws InterruptedException {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String eplCreateVariable = "@public create table vartotal (topgroup int primary key, subgroup int primary key, thecnt count(*))";<NEW_LINE>env.compileDeploy(eplCreateVariable, path);<NEW_LINE>String eplCreateIndex = "create index myindex on vartotal (topgroup)";<NEW_LINE>env.compileDeploy(eplCreateIndex, path);<NEW_LINE>// populate<NEW_LINE>String eplInto = "into table vartotal select count(*) as thecnt from SupportTopGroupSubGroupEvent#length(100) group by topgroup, subgroup";<NEW_LINE>env.compileDeploy(eplInto, path);<NEW_LINE>// delete empty groups<NEW_LINE>String eplDelete = "on SupportBean_S0 merge vartotal when matched and thecnt = 0 then delete";<NEW_LINE>env.compileDeploy(eplDelete, path);<NEW_LINE>// seed with {0, 0} group<NEW_LINE>env.sendEventBean(new SupportTopGroupSubGroupEvent(0, 0));<NEW_LINE>// select/read<NEW_LINE>String eplMergeSelect = "@public on SupportBean merge vartotal as vt " + "where vt.topgroup = intPrimitive and vt.thecnt > 0 " + "when matched then insert into MyOutputStream select *";<NEW_LINE>env.compileDeploy(eplMergeSelect, path);<NEW_LINE>env.compileDeploy("@name('s0') select * from MyOutputStream", path).addListener("s0");<NEW_LINE>SupportListener listener = env.listener("s0");<NEW_LINE>WriteRunnable writeRunnable = new WriteRunnable(env);<NEW_LINE>ReadRunnable readRunnable <MASK><NEW_LINE>// start<NEW_LINE>Thread writeThread = new Thread(writeRunnable, InfraTableMTGroupedMergeReadMergeWriteSecondaryIndexUpd.class.getSimpleName() + "-write");<NEW_LINE>Thread readThread = new Thread(readRunnable, InfraTableMTGroupedMergeReadMergeWriteSecondaryIndexUpd.class.getSimpleName() + "-read");<NEW_LINE>writeThread.start();<NEW_LINE>readThread.start();<NEW_LINE>// wait<NEW_LINE>Thread.sleep(numSeconds * 1000);<NEW_LINE>// shutdown<NEW_LINE>writeRunnable.setShutdown(true);<NEW_LINE>readRunnable.setShutdown(true);<NEW_LINE>// join<NEW_LINE>log.info("Waiting for completion");<NEW_LINE>writeThread.join();<NEW_LINE>readThread.join();<NEW_LINE>assertNull(writeRunnable.getException());<NEW_LINE>assertNull(readRunnable.getException());<NEW_LINE>assertTrue(writeRunnable.numEvents > 100);<NEW_LINE>assertTrue(readRunnable.numQueries > 100);<NEW_LINE>System.out.println("Send " + writeRunnable.numEvents + " and performed " + readRunnable.numQueries + " reads");<NEW_LINE>env.undeployAll();<NEW_LINE>}
|
= new ReadRunnable(env, listener);
|
1,549,759
|
protected List findByLayoutId(String layoutId, int begin, int end, OrderByComparator obc) throws SystemException {<NEW_LINE>Session session = null;<NEW_LINE>try {<NEW_LINE>session = openSession();<NEW_LINE>StringBuffer query = new StringBuffer();<NEW_LINE>query.append("FROM PortletPreferences IN CLASS com.liferay.portal.ejb.PortletPreferencesHBM WHERE ");<NEW_LINE>query.append("layoutId = ?");<NEW_LINE>query.append(" ");<NEW_LINE>if (obc != null) {<NEW_LINE>query.append("ORDER BY " + obc.getOrderBy());<NEW_LINE>}<NEW_LINE>Query q = session.createQuery(query.toString());<NEW_LINE>int queryPos = 0;<NEW_LINE>q.setString(queryPos++, layoutId);<NEW_LINE>List list = new ArrayList();<NEW_LINE>if (getDialect().supportsLimit()) {<NEW_LINE>q.setMaxResults(end - begin);<NEW_LINE>q.setFirstResult(begin);<NEW_LINE>Iterator itr = q.list().iterator();<NEW_LINE>while (itr.hasNext()) {<NEW_LINE>PortletPreferencesHBM portletPreferencesHBM = (PortletPreferencesHBM) itr.next();<NEW_LINE>list.add(PortletPreferencesHBMUtil.model(portletPreferencesHBM));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>if (sr.first() && sr.scroll(begin)) {<NEW_LINE>for (int i = begin; i < end; i++) {<NEW_LINE>PortletPreferencesHBM portletPreferencesHBM = (PortletPreferencesHBM) sr.get(0);<NEW_LINE>list.add(PortletPreferencesHBMUtil.model(portletPreferencesHBM));<NEW_LINE>if (!sr.next()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} catch (HibernateException he) {<NEW_LINE>throw new SystemException(he);<NEW_LINE>} finally {<NEW_LINE>HibernateUtil.closeSession(session);<NEW_LINE>}<NEW_LINE>}
|
ScrollableResults sr = q.scroll();
|
1,782,910
|
protected Parse buildCells(Object row) {<NEW_LINE>if (row == null) {<NEW_LINE>Parse nil = new Parse(<MASK><NEW_LINE>nil.addToTag(" colspan=" + columnBindings.length);<NEW_LINE>return nil;<NEW_LINE>}<NEW_LINE>Parse root = new Parse(null, null, null, null);<NEW_LINE>Parse next = root;<NEW_LINE>for (Binding columnBinding : columnBindings) {<NEW_LINE>next = next.more = new Parse("td", " ", null, null);<NEW_LINE>TypeAdapter a = columnBinding.adapter;<NEW_LINE>if (a == null) {<NEW_LINE>ignore(next);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>a.target = row;<NEW_LINE>next.body = gray(escape(a.toString(a.get())));<NEW_LINE>} catch (Exception e) {<NEW_LINE>exception(next, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return root.more;<NEW_LINE>}
|
"td", "null", null, null);
|
1,606,889
|
public void execute(final String sql, final List<Object> parameters, final ConnectionInformation connectionInformation) {<NEW_LINE>if (check()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HmilyStatement statement;<NEW_LINE>try {<NEW_LINE>statement = HmilySqlParserEngineFactory.newInstance().parser(sql, <MASK><NEW_LINE>log.debug("TAC-parse-sql ::: statement: {}", statement);<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String resourceId = ResourceIdUtils.INSTANCE.getResourceId(connectionInformation.getUrl());<NEW_LINE>HmilySQLComputeEngine sqlComputeEngine = HmilySQLComputeEngineFactory.newInstance(statement);<NEW_LINE>HmilyDataSnapshot snapshot = sqlComputeEngine.execute(sql, parameters, connectionInformation.getConnection(), resourceId);<NEW_LINE>log.debug("TAC-compute-sql ::: {}", snapshot);<NEW_LINE>HmilyUndoContext undoContext = buildUndoContext(HmilyContextHolder.get(), snapshot, resourceId);<NEW_LINE>HmilyLockManager.INSTANCE.tryAcquireLocks(undoContext.getHmilyLocks());<NEW_LINE>log.debug("TAC-try-lock ::: {}", undoContext.getHmilyLocks());<NEW_LINE>HmilyUndoContextCacheManager.INSTANCE.set(undoContext);<NEW_LINE>}
|
DatabaseTypes.INSTANCE.getDatabaseType());
|
945,213
|
public void run() {<NEW_LINE>TcpProxy <MASK><NEW_LINE>MapPack p = null;<NEW_LINE>try {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put("objHash", objHash);<NEW_LINE>param.put("class", className);<NEW_LINE>p = (MapPack) tcp.getSingle(RequestCmd.OBJECT_CLASS_DESC, param);<NEW_LINE>} catch (Exception e) {<NEW_LINE>ConsoleProxy.errorSafe(e.getMessage());<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>if (p != null) {<NEW_LINE>final String error = CastUtil.cString(p.get("error"));<NEW_LINE>final Value v = p.get("class");<NEW_LINE>ExUtil.exec(tableViewer.getTable(), new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>if (StringUtil.isNotEmpty(error)) {<NEW_LINE>new EditableMessageDialog().show("ERROR", error);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>new EditableMessageDialog().show(className, CastUtil.cString(v));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
|
tcp = TcpProxy.getTcpProxy(serverId);
|
188,663
|
private void matchUp() throws ContradictionException {<NEW_LINE><MASK><NEW_LINE>int y, x = SORTMIN[i];<NEW_LINE>for (y = 0; y < n; y++) {<NEW_LINE>while (i < n && !lexLt(YUB[y], XLB[x], k + 1)) {<NEW_LINE>CHUNK[x] = y;<NEW_LINE>i++;<NEW_LINE>if (i < n) {<NEW_LINE>x = SORTMIN[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (i == e) {<NEW_LINE>this.fails();<NEW_LINE>} else {<NEW_LINE>ARRAY[y] = y;<NEW_LINE>e++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (i != e) {<NEW_LINE>this.fails();<NEW_LINE>}<NEW_LINE>for (e = 0; e < n; e++) {<NEW_LINE>x = SORTMAX[e];<NEW_LINE>y = CHUNK[x];<NEW_LINE>while (y < ARRAY[y]) {<NEW_LINE>// path compression<NEW_LINE>ARRAY[y] = ARRAY[ARRAY[y]];<NEW_LINE>y = ARRAY[y];<NEW_LINE>}<NEW_LINE>if (lexLt(XUB[x], YLB[y], k + 1)) {<NEW_LINE>this.fails();<NEW_LINE>}<NEW_LINE>YMATE[y] = x;<NEW_LINE>XMATE[x] = y;<NEW_LINE>ARRAY[y] = y + 1;<NEW_LINE>}<NEW_LINE>for (y = 0; y < n; y++) {<NEW_LINE>x = YMATE[y];<NEW_LINE>if (!lexFixMax(YLB[y], YUB[y], XUB[x])) {<NEW_LINE>this.fails();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
int e = 0, i = 0;
|
1,814,501
|
public void xor(final RoaringBitmap x2) {<NEW_LINE>int pos1 = 0, pos2 = 0;<NEW_LINE>int length1 = highLowContainer.size();<NEW_LINE>final int length2 = x2.highLowContainer.size();<NEW_LINE>main: if (pos1 < length1 && pos2 < length2) {<NEW_LINE>char s1 = highLowContainer.getKeyAtIndex(pos1);<NEW_LINE>char s2 = x2.highLowContainer.getKeyAtIndex(pos2);<NEW_LINE>while (true) {<NEW_LINE>if (s1 == s2) {<NEW_LINE>final Container c = highLowContainer.getContainerAtIndex(pos1).ixor(x2.highLowContainer.getContainerAtIndex(pos2));<NEW_LINE>if (!c.isEmpty()) {<NEW_LINE>this.highLowContainer.setContainerAtIndex(pos1, c);<NEW_LINE>pos1++;<NEW_LINE>} else {<NEW_LINE>highLowContainer.removeAtIndex(pos1);<NEW_LINE>--length1;<NEW_LINE>}<NEW_LINE>pos2++;<NEW_LINE>if ((pos1 == length1) || (pos2 == length2)) {<NEW_LINE>break main;<NEW_LINE>}<NEW_LINE>s1 = highLowContainer.getKeyAtIndex(pos1);<NEW_LINE>s2 = <MASK><NEW_LINE>} else if (s1 < s2) {<NEW_LINE>pos1++;<NEW_LINE>if (pos1 == length1) {<NEW_LINE>break main;<NEW_LINE>}<NEW_LINE>s1 = highLowContainer.getKeyAtIndex(pos1);<NEW_LINE>} else {<NEW_LINE>highLowContainer.insertNewKeyValueAt(pos1, s2, x2.highLowContainer.getContainerAtIndex(pos2).clone());<NEW_LINE>pos1++;<NEW_LINE>length1++;<NEW_LINE>pos2++;<NEW_LINE>if (pos2 == length2) {<NEW_LINE>break main;<NEW_LINE>}<NEW_LINE>s2 = x2.highLowContainer.getKeyAtIndex(pos2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pos1 == length1) {<NEW_LINE>highLowContainer.appendCopy(x2.highLowContainer, pos2, length2);<NEW_LINE>}<NEW_LINE>}
|
x2.highLowContainer.getKeyAtIndex(pos2);
|
785,836
|
public void marshall(ListRecommendedIntentsRequest listRecommendedIntentsRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (listRecommendedIntentsRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(listRecommendedIntentsRequest.getBotId(), BOTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(listRecommendedIntentsRequest.getBotVersion(), BOTVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(listRecommendedIntentsRequest.getBotRecommendationId(), BOTRECOMMENDATIONID_BINDING);<NEW_LINE>protocolMarshaller.marshall(listRecommendedIntentsRequest.getNextToken(), NEXTTOKEN_BINDING);<NEW_LINE>protocolMarshaller.marshall(listRecommendedIntentsRequest.getMaxResults(), MAXRESULTS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
listRecommendedIntentsRequest.getLocaleId(), LOCALEID_BINDING);
|
1,426,198
|
public AviatorObject call(Map<String, Object> env, AviatorObject arg1) {<NEW_LINE>switch(arg1.getAviatorType()) {<NEW_LINE>case Boolean:<NEW_LINE>return new AviatorDouble(arg1.booleanValue(env) ? 1 : 0);<NEW_LINE>case JavaType:<NEW_LINE>Object obj = arg1.getValue(env);<NEW_LINE>if (obj instanceof Number) {<NEW_LINE>return new AviatorDouble(((Number) obj).doubleValue());<NEW_LINE>} else if (obj instanceof String) {<NEW_LINE>return new AviatorDouble(Double.parseDouble((String) obj));<NEW_LINE>} else if (obj instanceof Character) {<NEW_LINE>return new AviatorDouble(Double.parseDouble(String.valueOf(obj)));<NEW_LINE>} else {<NEW_LINE>throw new ClassCastException("Could not cast " + obj.getClass().getName() + " to double");<NEW_LINE>}<NEW_LINE>case String:<NEW_LINE>return new AviatorDouble(Double.parseDouble((String) <MASK><NEW_LINE>case BigInt:<NEW_LINE>case Decimal:<NEW_LINE>case Long:<NEW_LINE>case Double:<NEW_LINE>return new AviatorDouble(((Number) arg1.getValue(env)).doubleValue());<NEW_LINE>default:<NEW_LINE>throw new ClassCastException("Could not cast " + arg1 + " to double");<NEW_LINE>}<NEW_LINE>}
|
arg1.getValue(env)));
|
699,168
|
public void run(CompilationController controller) throws Exception {<NEW_LINE>Elements elems = controller.getElements();<NEW_LINE>TypeElement appletElement = elems.getTypeElement("java.applet.Applet");<NEW_LINE>ElementHandle<TypeElement> appletHandle = ElementHandle.create(appletElement);<NEW_LINE>TypeElement jappletElement = elems.getTypeElement("javax.swing.JApplet");<NEW_LINE>ElementHandle<TypeElement> <MASK><NEW_LINE>Set<ElementHandle<TypeElement>> appletHandles = classIndex.getElements(appletHandle, kinds, scopes);<NEW_LINE>for (ElementHandle<TypeElement> elemHandle : appletHandles) {<NEW_LINE>appletNames.add(elemHandle.getQualifiedName());<NEW_LINE>}<NEW_LINE>Set<ElementHandle<TypeElement>> jappletElemHandles = classIndex.getElements(jappletHandle, kinds, scopes);<NEW_LINE>for (ElementHandle<TypeElement> elemHandle : jappletElemHandles) {<NEW_LINE>appletNames.add(elemHandle.getQualifiedName());<NEW_LINE>}<NEW_LINE>}
|
jappletHandle = ElementHandle.create(jappletElement);
|
1,548,031
|
public Description matchCompilationUnit(CompilationUnitTree tree, VisitorState state) {<NEW_LINE>ImmutableChecker immutableChecker = new ImmutableChecker(ImmutableSet.of(javax.annotation.concurrent.Immutable.class.getName(), com.google.errorprone.annotations.Immutable<MASK><NEW_LINE>Optional<? extends ImportTree> immutableImport = tree.getImports().stream().filter(i -> {<NEW_LINE>Symbol s = ASTHelpers.getSymbol(i.getQualifiedIdentifier());<NEW_LINE>return s != null && s.getQualifiedName().contentEquals(javax.annotation.concurrent.Immutable.class.getName());<NEW_LINE>}).findFirst();<NEW_LINE>if (!immutableImport.isPresent()) {<NEW_LINE>return Description.NO_MATCH;<NEW_LINE>}<NEW_LINE>boolean[] ok = { true };<NEW_LINE>new TreePathScanner<Void, Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void visitClass(ClassTree node, Void unused) {<NEW_LINE>if (immutableChecker.matchClass(node, createVisitorState().withPath(getCurrentPath())) != Description.NO_MATCH) {<NEW_LINE>ok[0] = false;<NEW_LINE>}<NEW_LINE>return super.visitClass(node, null);<NEW_LINE>}<NEW_LINE><NEW_LINE>private VisitorState createVisitorState() {<NEW_LINE>return VisitorState.createConfiguredForCompilation(state.context, description -> ok[0] = false, ImmutableMap.of(), state.errorProneOptions());<NEW_LINE>}<NEW_LINE>}.scan(state.getPath(), null);<NEW_LINE>if (!ok[0]) {<NEW_LINE>// TODO(cushon): replace non-compliant @Immutable annotations with javadoc<NEW_LINE>return Description.NO_MATCH;<NEW_LINE>}<NEW_LINE>return describeMatch(immutableImport.get(), SuggestedFix.builder().removeImport(javax.annotation.concurrent.Immutable.class.getName()).addImport(com.google.errorprone.annotations.Immutable.class.getName()).build());<NEW_LINE>}
|
.class.getName()));
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.