idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,040,727 | @Produces("application/json")<NEW_LINE>public Response evaluate(PolicyEvaluationRequest evaluationRequest) {<NEW_LINE>this.auth.realm().requireViewAuthorization();<NEW_LINE>CloseableKeycloakIdentity identity = createIdentity(evaluationRequest);<NEW_LINE>try {<NEW_LINE>AuthorizationRequest request = new AuthorizationRequest();<NEW_LINE>Map<String, List<String>> claims = new HashMap<>();<NEW_LINE>Map<String, String> givenAttributes = evaluationRequest.<MASK><NEW_LINE>if (givenAttributes != null) {<NEW_LINE>givenAttributes.forEach((key, entryValue) -> {<NEW_LINE>if (entryValue != null) {<NEW_LINE>List<String> values = new ArrayList<>();<NEW_LINE>Collections.addAll(values, entryValue.split(","));<NEW_LINE>claims.put(key, values);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>request.setClaims(claims);<NEW_LINE>return Response.ok(PolicyEvaluationResponseBuilder.build(evaluate(evaluationRequest, createEvaluationContext(evaluationRequest, identity), request), resourceServer, authorization, identity)).build();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Error while evaluating permissions", e);<NEW_LINE>throw new ErrorResponseException(OAuthErrorException.SERVER_ERROR, "Error while evaluating permissions.", Status.INTERNAL_SERVER_ERROR);<NEW_LINE>} finally {<NEW_LINE>identity.close();<NEW_LINE>}<NEW_LINE>} | getContext().get("attributes"); |
342,809 | public void updateNotification(@NonNull WeatherPresentation weatherPresentation, @NonNull NotificationCompat.Builder notification, @NonNull Context context) throws NullPointerException {<NEW_LINE>// noinspection ConstantConditions<NEW_LINE>if (weatherPresentation == null)<NEW_LINE>throw new NullPointerException("weatherPresentation is null");<NEW_LINE>// noinspection ConstantConditions<NEW_LINE>if (notification == null)<NEW_LINE>throw new NullPointerException("notification is null");<NEW_LINE>// noinspection ConstantConditions<NEW_LINE>if (context == null)<NEW_LINE>throw new NullPointerException("context is null");<NEW_LINE>super.updateNotification(weatherPresentation, notification, context);<NEW_LINE>notification.setCustomContentView(null).setContent(null).setCustomBigContentView(null).setColorized(false<MASK><NEW_LINE>if (formatter.isEnoughValidData(weatherPresentation.getWeather())) {<NEW_LINE>String temperature = formatter.getTemperature(weatherPresentation.getWeather(), weatherPresentation.getTemperatureUnits(), weatherPresentation.isRoundedTemperature());<NEW_LINE>notification.setContentTitle(temperature).setContentText(formatter.getDescription(weatherPresentation.getWeather())).setLargeIcon(formatter.getWeatherIconAsBitmap(weatherPresentation.getWeather(), context));<NEW_LINE>} else {<NEW_LINE>notification.setContentTitle(context.getString(R.string.no_data)).setContentText(null).setLargeIcon(null);<NEW_LINE>}<NEW_LINE>} | ).setColor(NotificationCompat.COLOR_DEFAULT); |
1,517,166 | public MLTrain create(final MLMethod method, final MLDataSet training, final String argsStr) {<NEW_LINE>if (!(method instanceof SVM)) {<NEW_LINE>throw new EncogError("SVM Train training cannot be used on a method of type: " + method.getClass().getName());<NEW_LINE>}<NEW_LINE>final double defaultGamma = 1.0 / ((<MASK><NEW_LINE>final double defaultC = 1.0;<NEW_LINE>final Map<String, String> args = ArchitectureParse.parseParams(argsStr);<NEW_LINE>final ParamsHolder holder = new ParamsHolder(args);<NEW_LINE>final double gamma = holder.getDouble(MLTrainFactory.PROPERTY_GAMMA, false, defaultGamma);<NEW_LINE>final double c = holder.getDouble(MLTrainFactory.PROPERTY_C, false, defaultC);<NEW_LINE>final SVMTrain result = new SVMTrain((SVM) method, training);<NEW_LINE>result.setGamma(gamma);<NEW_LINE>result.setC(c);<NEW_LINE>return result;<NEW_LINE>} | SVM) method).getInputCount(); |
503,493 | private FlowScope traverseOptChain(Node n, FlowScope scope) {<NEW_LINE>checkArgument(NodeUtil.isOptChainNode(n));<NEW_LINE>if (NodeUtil.isEndOfOptChainSegment(n)) {<NEW_LINE>// Create new optional chain tracking object and push it onto the stack.<NEW_LINE>final Node startOfChain = NodeUtil.getStartOfOptChainSegment(n);<NEW_LINE>OptChainInfo optChainInfo = new OptChainInfo(n, startOfChain);<NEW_LINE>optChainArrayDeque.addFirst(optChainInfo);<NEW_LINE>}<NEW_LINE>FlowScope lhsScope = traverse(n.getFirstChild(), scope);<NEW_LINE>if (n.isOptionalChainStart()) {<NEW_LINE>// Store lhsScope into top-of-stack as unexecuted (unconditional) scope.<NEW_LINE>optChainArrayDeque.peekFirst().unconditionalScope = lhsScope;<NEW_LINE>}<NEW_LINE>// Traverse the remaining children and capture their changes into a new FlowScope var<NEW_LINE>// `aboutToExecuteScope`. This FlowScope must be constructed on top of the `lhsScope` and not<NEW_LINE>// the original scope `scope`, otherwise changes to outer variable that are preserved in the<NEW_LINE>// lhsScope would not be captured in the `aboutToExecuteScope`.<NEW_LINE>FlowScope aboutToExecuteScope = lhsScope;<NEW_LINE>Node nextChild = n.getSecondChild();<NEW_LINE>while (nextChild != null) {<NEW_LINE>aboutToExecuteScope = traverse(nextChild, aboutToExecuteScope);<NEW_LINE>nextChild = nextChild.getNext();<NEW_LINE>}<NEW_LINE>// Assigns the type to `n` assuming the entire chain executes and returns the the executed<NEW_LINE>// scope.<NEW_LINE>FlowScope <MASK><NEW_LINE>// Unlike CALL, the OPTCHAIN_CALL nodes must not remain untyped when left child is untyped.<NEW_LINE>if (n.getJSType() == null) {<NEW_LINE>n.setJSType(unknownType);<NEW_LINE>}<NEW_LINE>if (NodeUtil.isEndOfOptChainSegment(n)) {<NEW_LINE>// Use the startNode's type to selectively join the executed scope with the unexecuted scope,<NEW_LINE>// and update the type assigned to `n` in `setXAfterChildrenTraversed()`<NEW_LINE>final Node startOfChain = NodeUtil.getStartOfOptChainSegment(n);<NEW_LINE>// Pop the stack to obtain the current chain.<NEW_LINE>OptChainInfo currentChain = optChainArrayDeque.removeFirst();<NEW_LINE>// Sanity check that the popped chain correctly corresponds to the current optional chain<NEW_LINE>checkState(currentChain.endOfChain == n);<NEW_LINE>checkState(currentChain.startOfChain == startOfChain);<NEW_LINE>final Node startNode = checkNotNull(startOfChain.getFirstChild());<NEW_LINE>return updateTypeWhenEndOfOptChain(n, startNode, currentChain, executedScope);<NEW_LINE>} else {<NEW_LINE>// `n` is just an inner node (i.e. not the end of the current chain). Simply return the<NEW_LINE>// executedScope.<NEW_LINE>return executedScope;<NEW_LINE>}<NEW_LINE>} | executedScope = setOptChainNodeTypeAfterChildrenTraversed(n, aboutToExecuteScope); |
789,546 | public static ListContactsResponse unmarshall(ListContactsResponse listContactsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listContactsResponse.setRequestId<MASK><NEW_LINE>listContactsResponse.setTotalCount(_ctx.integerValue("ListContactsResponse.TotalCount"));<NEW_LINE>listContactsResponse.setMessage(_ctx.stringValue("ListContactsResponse.Message"));<NEW_LINE>listContactsResponse.setNextToken(_ctx.integerValue("ListContactsResponse.NextToken"));<NEW_LINE>listContactsResponse.setCode(_ctx.stringValue("ListContactsResponse.Code"));<NEW_LINE>listContactsResponse.setSuccess(_ctx.booleanValue("ListContactsResponse.Success"));<NEW_LINE>List<Contact> contacts = new ArrayList<Contact>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListContactsResponse.Contacts.Length"); i++) {<NEW_LINE>Contact contact = new Contact();<NEW_LINE>contact.setEmail(_ctx.stringValue("ListContactsResponse.Contacts[" + i + "].Email"));<NEW_LINE>contact.setIsAccount(_ctx.booleanValue("ListContactsResponse.Contacts[" + i + "].IsAccount"));<NEW_LINE>contact.setPosition(_ctx.stringValue("ListContactsResponse.Contacts[" + i + "].Position"));<NEW_LINE>contact.setIsVerifiedEmail(_ctx.booleanValue("ListContactsResponse.Contacts[" + i + "].IsVerifiedEmail"));<NEW_LINE>contact.setLastMobileVerificationTimeStamp(_ctx.longValue("ListContactsResponse.Contacts[" + i + "].LastMobileVerificationTimeStamp"));<NEW_LINE>contact.setIsObsolete(_ctx.booleanValue("ListContactsResponse.Contacts[" + i + "].IsObsolete"));<NEW_LINE>contact.setIsVerifiedMobile(_ctx.booleanValue("ListContactsResponse.Contacts[" + i + "].IsVerifiedMobile"));<NEW_LINE>contact.setContactId(_ctx.longValue("ListContactsResponse.Contacts[" + i + "].ContactId"));<NEW_LINE>contact.setAccountUID(_ctx.longValue("ListContactsResponse.Contacts[" + i + "].AccountUID"));<NEW_LINE>contact.setMobile(_ctx.stringValue("ListContactsResponse.Contacts[" + i + "].Mobile"));<NEW_LINE>contact.setLastEmailVerificationTimeStamp(_ctx.longValue("ListContactsResponse.Contacts[" + i + "].LastEmailVerificationTimeStamp"));<NEW_LINE>contact.setName(_ctx.stringValue("ListContactsResponse.Contacts[" + i + "].Name"));<NEW_LINE>contacts.add(contact);<NEW_LINE>}<NEW_LINE>listContactsResponse.setContacts(contacts);<NEW_LINE>return listContactsResponse;<NEW_LINE>} | (_ctx.stringValue("ListContactsResponse.RequestId")); |
687,035 | private static Set<String> collectSourceRoots(Project prj) {<NEW_LINE>Set<String> toRet = new HashSet<String>();<NEW_LINE>NbMavenProject watcher = prj.getLookup().lookup(NbMavenProject.class);<NEW_LINE><MASK><NEW_LINE>// TODO this ought to be really configurable based on what class gets debugged.<NEW_LINE>toRet.addAll(mproject.getTestCompileSourceRoots());<NEW_LINE>// for poms also include all module projects recursively..<NEW_LINE>boolean isPom = NbMavenProject.TYPE_POM.equals(watcher.getPackagingType());<NEW_LINE>if (isPom) {<NEW_LINE>// only for pom is correct use of subprojectprovider<NEW_LINE>ProjectContainerProvider subs = prj.getLookup().lookup(ProjectContainerProvider.class);<NEW_LINE>ProjectContainerProvider.Result res = subs.getContainedProjects();<NEW_LINE>for (Project pr : res.getProjects()) {<NEW_LINE>toRet.addAll(collectSourceRoots(pr));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return toRet;<NEW_LINE>} | MavenProject mproject = watcher.getMavenProject(); |
391,097 | // Remove a consumer for a topic<NEW_LINE>public CompletableFuture<Void> removeConsumerAsync(String topicName) {<NEW_LINE>checkArgument(TopicName.isValid(topicName), "Invalid topic name:" + topicName);<NEW_LINE>if (getState() == State.Closing || getState() == State.Closed) {<NEW_LINE>return FutureUtil.failedFuture(new PulsarClientException.AlreadyClosedException("Topics Consumer was already closed"));<NEW_LINE>}<NEW_LINE>CompletableFuture<Void> unsubscribeFuture = new CompletableFuture<>();<NEW_LINE>String topicPartName = TopicName.<MASK><NEW_LINE>List<ConsumerImpl<T>> consumersToClose = consumers.values().stream().filter(consumer -> {<NEW_LINE>String consumerTopicName = consumer.getTopic();<NEW_LINE>return TopicName.get(consumerTopicName).getPartitionedTopicName().equals(topicPartName);<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>List<CompletableFuture<Void>> futureList = consumersToClose.stream().map(ConsumerImpl::closeAsync).collect(Collectors.toList());<NEW_LINE>FutureUtil.waitForAll(futureList).whenComplete((r, ex) -> {<NEW_LINE>if (ex == null) {<NEW_LINE>consumersToClose.forEach(consumer1 -> {<NEW_LINE>consumers.remove(consumer1.getTopic());<NEW_LINE>pausedConsumers.remove(consumer1);<NEW_LINE>allTopicPartitionsNumber.decrementAndGet();<NEW_LINE>});<NEW_LINE>removeTopic(topicName);<NEW_LINE>((UnAckedTopicMessageTracker) unAckedMessageTracker).removeTopicMessages(topicName);<NEW_LINE>unsubscribeFuture.complete(null);<NEW_LINE>log.info("[{}] [{}] [{}] Removed Topics Consumer, allTopicPartitionsNumber: {}", topicName, subscription, consumerName, allTopicPartitionsNumber);<NEW_LINE>} else {<NEW_LINE>unsubscribeFuture.completeExceptionally(ex);<NEW_LINE>setState(State.Failed);<NEW_LINE>log.error("[{}] [{}] [{}] Could not remove Topics Consumer", topicName, subscription, consumerName, ex.getCause());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return unsubscribeFuture;<NEW_LINE>} | get(topicName).getPartitionedTopicName(); |
913,587 | private void colorFilledInput(Theme theme) {<NEW_LINE>if (devices == null) {<NEW_LINE>// Don't mark anything red, until the devices are loaded.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>requiredFieldMessage.setVisible(!this.isReady());<NEW_LINE>deviceLabel.setForeground(getSelectedDevice() == null ? theme.missingInput() : theme.filledInput());<NEW_LINE>directoryLabel.setForeground(directory.getText().isEmpty() ? theme.missingInput() : theme.filledInput());<NEW_LINE>fileLabel.setForeground(file.getText().isEmpty() ? theme.missingInput() : theme.filledInput());<NEW_LINE>TraceTypeCapabilities config = getSelectedApi();<NEW_LINE>if (config != null) {<NEW_LINE>apiLabel.setForeground(theme.filledInput());<NEW_LINE>targetLabel.setForeground((config.getRequiresApplication() && traceTarget.getText().isEmpty()) ? theme.missingInput() : theme.filledInput());<NEW_LINE>} else {<NEW_LINE>apiLabel.setForeground(theme.missingInput());<NEW_LINE>targetLabel.<MASK><NEW_LINE>}<NEW_LINE>} | setForeground(theme.filledInput()); |
565,401 | public List<DataSetTableUnionDTO> listByTableId(String tableId) {<NEW_LINE>List<DataSetTableUnionDTO> sourceList = extDatasetTableUnionMapper.selectBySourceTableId(tableId);<NEW_LINE>List<DataSetTableUnionDTO> targetList = extDatasetTableUnionMapper.selectByTargetTableId(tableId);<NEW_LINE>sourceList.addAll(targetList.stream().map(ele -> {<NEW_LINE>DataSetTableUnionDTO dto = new DataSetTableUnionDTO();<NEW_LINE>dto.setId(ele.getId());<NEW_LINE>dto.setSourceTableId(ele.getTargetTableId());<NEW_LINE>dto.setSourceTableFieldId(ele.getTargetTableFieldId());<NEW_LINE>dto.setSourceTableName(ele.getTargetTableName());<NEW_LINE>dto.setSourceTableFieldName(ele.getTargetTableFieldName());<NEW_LINE>dto.setTargetTableId(ele.getSourceTableId());<NEW_LINE>dto.setTargetTableFieldId(ele.getSourceTableFieldId());<NEW_LINE>dto.setTargetTableName(ele.getSourceTableName());<NEW_LINE>dto.setTargetTableFieldName(ele.getSourceTableFieldName());<NEW_LINE>dto.setSourceUnionRelation(ele.getTargetUnionRelation());<NEW_LINE>dto.setTargetUnionRelation(ele.getSourceUnionRelation());<NEW_LINE>dto.<MASK><NEW_LINE>dto.setCreateTime(ele.getCreateTime());<NEW_LINE>return dto;<NEW_LINE>}).collect(Collectors.toList()));<NEW_LINE>sourceList.sort(Comparator.comparing(DatasetTableUnion::getCreateTime));<NEW_LINE>return sourceList;<NEW_LINE>} | setCreateBy(ele.getCreateBy()); |
784,939 | final GlobalCluster executeDeleteGlobalCluster(DeleteGlobalClusterRequest deleteGlobalClusterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteGlobalClusterRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteGlobalClusterRequest> request = null;<NEW_LINE>Response<GlobalCluster> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DeleteGlobalClusterRequestMarshaller().marshall(super.beforeMarshalling(deleteGlobalClusterRequest));<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, "RDS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteGlobalCluster");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GlobalCluster> responseHandler = new StaxResponseHandler<GlobalCluster>(new GlobalClusterStaxUnmarshaller());<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.RequestMarshallTime); |
946,942 | private void doRefresh() {<NEW_LINE>for (DockingAction action : actions) {<NEW_LINE>tool.removeAction(action);<NEW_LINE>}<NEW_LINE>actions.clear();<NEW_LINE>if (program == null || program.isClosed()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<MarkerSetImpl> list = markerManager.copyMarkerSets(program);<NEW_LINE>// separate the marker sets into grouped and non-grouped<NEW_LINE>List<List<MarkerSetImpl>> groupsList = extractManagerGroups(list);<NEW_LINE>Collections.sort(groupsList, (ms1, ms2) -> ms1.get(0).getName().compareTo(ms2.get(<MASK><NEW_LINE>for (List<MarkerSetImpl> group : groupsList) {<NEW_LINE>ActivateMarkerGroupAction action = new ActivateMarkerGroupAction(owner, group, navigationPanel, listOptions);<NEW_LINE>actions.add(action);<NEW_LINE>tool.addAction(action);<NEW_LINE>}<NEW_LINE>Collections.sort(list, (ms1, ms2) -> ms1.getName().compareTo(ms2.getName()));<NEW_LINE>for (MarkerSetImpl mgr : list) {<NEW_LINE>ActivateMarkerAction action = new ActivateMarkerAction(owner, mgr, navigationPanel, listOptions);<NEW_LINE>actions.add(action);<NEW_LINE>tool.addAction(action);<NEW_LINE>}<NEW_LINE>navigationPanel.repaint();<NEW_LINE>} | 0).getName())); |
587,677 | public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException {<NEW_LINE>Object[] params = new Object[3];<NEW_LINE>params[0] = context;<NEW_LINE>params[1] = component;<NEW_LINE>params[2] = value;<NEW_LINE>try {<NEW_LINE>methodExpression.invoke(<MASK><NEW_LINE>} catch (ELException e) {<NEW_LINE>Throwable cause = e.getCause();<NEW_LINE>ValidatorException vex = null;<NEW_LINE>if (cause != null) {<NEW_LINE>do {<NEW_LINE>if (cause != null && cause instanceof ValidatorException) {<NEW_LINE>vex = (ValidatorException) cause;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>cause = cause.getCause();<NEW_LINE>} while (cause != null);<NEW_LINE>}<NEW_LINE>if (vex != null) {<NEW_LINE>throw vex;<NEW_LINE>} else {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>// Throwable cause = e.getCause();<NEW_LINE>// if (cause instanceof ValidatorException)<NEW_LINE>// {<NEW_LINE>// throw (ValidatorException)cause;<NEW_LINE>// }<NEW_LINE>// else<NEW_LINE>// {<NEW_LINE>// throw e;<NEW_LINE>// }<NEW_LINE>}<NEW_LINE>} | context.getELContext(), params); |
1,150,619 | public static void vibrate(float duration) {<NEW_LINE>try {<NEW_LINE>if (sVibrateService != null && sVibrateService.hasVibrator()) {<NEW_LINE>if (android.os.Build.VERSION.SDK_INT >= 26) {<NEW_LINE>Class<?> vibrationEffectClass = Class.forName("android.os.VibrationEffect");<NEW_LINE>if (vibrationEffectClass != null) {<NEW_LINE>final int DEFAULT_AMPLITUDE = Cocos2dxReflectionHelper.<<MASK><NEW_LINE>// VibrationEffect.createOneShot(long milliseconds, int amplitude)<NEW_LINE>final Method method = vibrationEffectClass.getMethod("createOneShot", new Class[] { Long.TYPE, Integer.TYPE });<NEW_LINE>Class<?> type = method.getReturnType();<NEW_LINE>Object effect = method.invoke(vibrationEffectClass, new Object[] { (long) (duration * 1000), DEFAULT_AMPLITUDE });<NEW_LINE>// sVibrateService.vibrate(VibrationEffect effect);<NEW_LINE>Cocos2dxReflectionHelper.invokeInstanceMethod(sVibrateService, "vibrate", new Class[] { type }, new Object[] { (effect) });<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>sVibrateService.vibrate((long) (duration * 1000));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | Integer>getConstantValue(vibrationEffectClass, "DEFAULT_AMPLITUDE"); |
405,401 | protected void initialiseNewStoreFile(CursorContext cursorContext) throws IOException {<NEW_LINE>super.initialiseNewStoreFile(cursorContext);<NEW_LINE>long storeVersionAsLong = MetaDataStore.versionStringToLong(storeVersion);<NEW_LINE>StoreId storeId = new StoreId(storeVersionAsLong);<NEW_LINE>setCreationTime(storeId.getCreationTime(), cursorContext);<NEW_LINE>setRandomNumber(storeId.getRandomId(), cursorContext);<NEW_LINE>// If metaDataStore.creationTime == metaDataStore.upgradeTime && metaDataStore.upgradeTransactionId == BASE_TX_ID<NEW_LINE>// then store has never been upgraded<NEW_LINE>setUpgradeTime(storeId.getCreationTime(), cursorContext);<NEW_LINE>setUpgradeTransaction(<MASK><NEW_LINE>setCurrentLogVersion(0, cursorContext);<NEW_LINE>setLastCommittedAndClosedTransactionId(BASE_TX_ID, BASE_TX_CHECKSUM, BASE_TX_COMMIT_TIMESTAMP, BASE_TX_LOG_BYTE_OFFSET, BASE_TX_LOG_VERSION, cursorContext);<NEW_LINE>setStoreVersion(storeVersionAsLong, cursorContext);<NEW_LINE>setLatestConstraintIntroducingTx(0, cursorContext);<NEW_LINE>setExternalStoreUUID(UUID.randomUUID(), cursorContext);<NEW_LINE>setCheckpointLogVersion(0, cursorContext);<NEW_LINE>setKernelVersion(KernelVersion.LATEST, cursorContext);<NEW_LINE>setDatabaseIdUuid(NOT_INITIALIZED_UUID, cursorContext);<NEW_LINE>flush(cursorContext);<NEW_LINE>} | BASE_TX_ID, BASE_TX_CHECKSUM, BASE_TX_COMMIT_TIMESTAMP, cursorContext); |
251,430 | private JPanel buildSearchPanel() {<NEW_LINE>JPanel labelPanel = new JPanel();<NEW_LINE>labelPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 10));<NEW_LINE>labelPanel.setLayout(new GridLayout(0, 1));<NEW_LINE>labelPanel.add(new GLabel("Search Value: "));<NEW_LINE>labelPanel.add(new GLabel("Hex Sequence: "));<NEW_LINE>JPanel inputPanel = new JPanel();<NEW_LINE>inputPanel.setLayout(new GridLayout(0, 1));<NEW_LINE>valueComboBox = new GhidraComboBox<>();<NEW_LINE>valueComboBox.setEditable(true);<NEW_LINE>valueField = (JTextField) valueComboBox.getEditor().getEditorComponent();<NEW_LINE>valueField.setToolTipText(currentFormat.getToolTip());<NEW_LINE>valueField.setDocument(new RestrictedInputDocument());<NEW_LINE>valueField.addActionListener(ev -> {<NEW_LINE>if (nextButton.isEnabled()) {<NEW_LINE>nextPreviousCallback(true);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>inputPanel.add(valueComboBox);<NEW_LINE>hexSeqField = new GDLabel();<NEW_LINE>hexSeqField.setName("HexSequenceField");<NEW_LINE>hexSeqField.setBorder(BorderFactory.createLoweredBevelBorder());<NEW_LINE>// see note for field minimum size field above<NEW_LINE>Dimension size = new Dimension(INPUT_FIELD_MIN_SIZE_WIDTH, INPUT_FIELD_MIN_SIZE_HEIGHT);<NEW_LINE>valueComboBox.setPreferredSize(size);<NEW_LINE>valueComboBox.setMinimumSize(size);<NEW_LINE>hexSeqField.setPreferredSize(size);<NEW_LINE>hexSeqField.setMinimumSize(size);<NEW_LINE>inputPanel.add(hexSeqField);<NEW_LINE>JPanel searchPanel = new JPanel(new BorderLayout());<NEW_LINE>searchPanel.setBorder(BorderFactory.createEmptyBorder(5<MASK><NEW_LINE>searchPanel.add(labelPanel, BorderLayout.WEST);<NEW_LINE>searchPanel.add(inputPanel, BorderLayout.CENTER);<NEW_LINE>return searchPanel;<NEW_LINE>} | , 5, 5, 5)); |
33,414 | private void stop(AtomicBoolean hasAnythingChanged, ClassMapper classMapper, DependencyNode node) {<NEW_LINE>// Check if all its dependencies have been satisfied.<NEW_LINE>// when stopping.<NEW_LINE>if (node.canBe(State.STOPPED)) {<NEW_LINE>LOGGER_INSTANCE.debug(HORIZONTAL_LINE);<NEW_LINE>// Retrieve the instance for that node<NEW_LINE>final Object inst = find(node.getRepresentedType(), true);<NEW_LINE>// Execute all the executions for the next step.<NEW_LINE>node.getExecutions().stream().filter(e -> e.getState() == State.STOPPED).map(exec -> {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final Execution<Object> casted <MASK><NEW_LINE>return casted;<NEW_LINE>}).forEach(exec -> stopInstance(classMapper, inst, exec));<NEW_LINE>// Update its state to the new state.<NEW_LINE>node.setState(State.STOPPED);<NEW_LINE>hasAnythingChanged.set(true);<NEW_LINE>LOGGER_INSTANCE.debug("| %-66s %12s |", node.getRepresentedType().getSimpleName(), State.STOPPED.name());<NEW_LINE>}<NEW_LINE>} | = (Execution<Object>) exec; |
164,087 | public DkimAttributes unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DkimAttributes dkimAttributes = new DkimAttributes();<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("SigningEnabled", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dkimAttributes.setSigningEnabled(context.getUnmarshaller(Boolean.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Status", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dkimAttributes.setStatus(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Tokens", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dkimAttributes.setTokens(new ListUnmarshaller<String>(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 dkimAttributes;<NEW_LINE>} | class).unmarshall(context)); |
36,755 | // testargumentContainsExceptionInTwoCallbackClasses<NEW_LINE>public void testargumentContainsExceptionInTwoCallbackClasses(String BASE_URL, StringBuilder sb) throws Exception {<NEW_LINE><MASK><NEW_LINE>invokeClear(client, BASE_URL);<NEW_LINE>invokeReset(client, BASE_URL);<NEW_LINE>Future<Response> suspend2 = client.target(BASE_URL + "rest/resource/suspend").request().async().get();<NEW_LINE>Future<Response> register2 = client.target(BASE_URL + "rest/resource/registerclasses?stage=0").request().async().get();<NEW_LINE>sb.append(compareResult(register2, FALSE));<NEW_LINE>Future<Response> exception2 = client.target(BASE_URL + "rest/resource/resumechecked?stage=1").request().async().get();<NEW_LINE>Response response3 = exception2.get();<NEW_LINE>Response suspendResponse3 = suspend2.get();<NEW_LINE>sb.append(intequalCompare(suspendResponse3.getStatusInfo().getStatusCode(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), true));<NEW_LINE>// assertEquals(suspendResponse3.getStatusInfo().getStatusCode(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode());<NEW_LINE>suspendResponse3.close();<NEW_LINE>Future<Response> error3 = client.target(BASE_URL + "rest/resource/error").request().async().get();<NEW_LINE>sb.append(compareResult(error3, RuntimeException.class.getName()));<NEW_LINE>error3 = client.target(BASE_URL + "rest/resource/seconderror").request().async().get();<NEW_LINE>sb.append(compareResult(error3, RuntimeException.class.getName()));<NEW_LINE>System.out.println("from testargumentContainsExceptionInTwoCallbackClasses: " + sb);<NEW_LINE>// return sb.toString();<NEW_LINE>} | Client client = ClientBuilder.newClient(); |
1,149,040 | public void marshall(DestinationConnectorProperties destinationConnectorProperties, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (destinationConnectorProperties == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(destinationConnectorProperties.getRedshift(), REDSHIFT_BINDING);<NEW_LINE>protocolMarshaller.marshall(destinationConnectorProperties.getS3(), S3_BINDING);<NEW_LINE>protocolMarshaller.marshall(destinationConnectorProperties.getSalesforce(), SALESFORCE_BINDING);<NEW_LINE>protocolMarshaller.marshall(destinationConnectorProperties.getSnowflake(), SNOWFLAKE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(destinationConnectorProperties.getLookoutMetrics(), LOOKOUTMETRICS_BINDING);<NEW_LINE>protocolMarshaller.marshall(destinationConnectorProperties.getUpsolver(), UPSOLVER_BINDING);<NEW_LINE>protocolMarshaller.marshall(destinationConnectorProperties.getHoneycode(), HONEYCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(destinationConnectorProperties.getCustomerProfiles(), CUSTOMERPROFILES_BINDING);<NEW_LINE>protocolMarshaller.marshall(destinationConnectorProperties.getZendesk(), ZENDESK_BINDING);<NEW_LINE>protocolMarshaller.marshall(destinationConnectorProperties.getMarketo(), MARKETO_BINDING);<NEW_LINE>protocolMarshaller.marshall(destinationConnectorProperties.getCustomConnector(), CUSTOMCONNECTOR_BINDING);<NEW_LINE>protocolMarshaller.marshall(destinationConnectorProperties.getSAPOData(), SAPODATA_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | destinationConnectorProperties.getEventBridge(), EVENTBRIDGE_BINDING); |
1,103,590 | public void init(int WindowNo, FormFrame frame) {<NEW_LINE>m_WindowNo = WindowNo;<NEW_LINE>m_frame = frame;<NEW_LINE>log.info("WinNo=" + m_WindowNo + " - AD_Client_ID=" + m_AD_Client_ID + ", AD_Org_ID=" + m_AD_Org_ID + ", By=" + m_by);<NEW_LINE>Env.setContext(Env.getCtx(), m_WindowNo, "IsSOTrx", "N");<NEW_LINE>try {<NEW_LINE>// UI<NEW_LINE>onlyVendor = VLookup.createBPartner(m_WindowNo);<NEW_LINE>onlyProduct = VLookup.createProduct(m_WindowNo);<NEW_LINE>jbInit();<NEW_LINE>//<NEW_LINE>dynInit();<NEW_LINE>frame.getContentPane().add(panel, BorderLayout.CENTER);<NEW_LINE>frame.getContentPane().<MASK><NEW_LINE>//<NEW_LINE>new Thread() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>log.info("Starting ...");<NEW_LINE>MMatchPO.consolidate(Env.getCtx());<NEW_LINE>log.info("... Done");<NEW_LINE>}<NEW_LINE>}.start();<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.SEVERE, "", e);<NEW_LINE>}<NEW_LINE>} | add(statusBar, BorderLayout.SOUTH); |
405,406 | final UpdateReportGroupResult executeUpdateReportGroup(UpdateReportGroupRequest updateReportGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateReportGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateReportGroupRequest> request = null;<NEW_LINE>Response<UpdateReportGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateReportGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateReportGroupRequest));<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, "CodeBuild");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateReportGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateReportGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateReportGroupResultJsonUnmarshaller());<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); |
1,148,743 | static byte[] decrypt(String privateKey, byte[] secret) throws Exception {<NEW_LINE>String pkcs8Pem = privateKey;<NEW_LINE>pkcs8Pem = pkcs8Pem.replace("-----BEGIN RSA PRIVATE KEY-----", "");<NEW_LINE>pkcs8Pem = pkcs8Pem.replace("-----END RSA PRIVATE KEY-----", "");<NEW_LINE>pkcs8Pem = pkcs8Pem.replaceAll("\\s+", "");<NEW_LINE>byte[] pkcs8EncodedBytes = Base64.decode(pkcs8Pem, 0);<NEW_LINE>KeyFactory kf = KeyFactory.getInstance("RSA");<NEW_LINE>PrivateKey privKey = kf.generatePrivate(getRSAKeySpec(pkcs8EncodedBytes));<NEW_LINE>Cipher cipher = Cipher.getInstance("RSA/ECB/OAEPWithSHA-1AndMGF1Padding");<NEW_LINE>cipher.<MASK><NEW_LINE>return cipher.doFinal(secret);<NEW_LINE>} | init(Cipher.DECRYPT_MODE, privKey); |
623,947 | protected void paintComponent(Graphics g) {<NEW_LINE><MASK><NEW_LINE>final Rectangle bounds = getBounds();<NEW_LINE>final Insets insets = getInsets();<NEW_LINE>final GraphicsConfig cfg = new GraphicsConfig(g);<NEW_LINE>cfg.setAntialiasing(true);<NEW_LINE>final Shape shape = new RoundRectangle2D.Double(insets.left, insets.top, bounds.width - 1 - insets.left - insets.right, bounds.height - 1 - insets.top - insets.bottom, 6, 6);<NEW_LINE>g2d.setColor(JBColor.WHITE);<NEW_LINE>g2d.fill(shape);<NEW_LINE>Color bgColor = getBackground();<NEW_LINE>g2d.setColor(bgColor);<NEW_LINE>g2d.fill(shape);<NEW_LINE>g2d.setColor(getBackground().darker());<NEW_LINE>g2d.draw(shape);<NEW_LINE>cfg.restore();<NEW_LINE>super.paintComponent(g);<NEW_LINE>} | final Graphics2D g2d = (Graphics2D) g; |
636,480 | static boolean isOverlapPreventedInOtherDimension(LayoutInterval addingInterval, LayoutInterval existingInterval, int dimension) {<NEW_LINE>int otherDim = dimension ^ 1;<NEW_LINE>Iterator<LayoutInterval> addIt = getComponentIterator(addingInterval);<NEW_LINE>do {<NEW_LINE>LayoutInterval otherDimAdd = addIt.next().<MASK><NEW_LINE>Iterator<LayoutInterval> exIt = getComponentIterator(existingInterval);<NEW_LINE>do {<NEW_LINE>LayoutInterval otherDimEx = exIt.next().getComponent().getLayoutInterval(otherDim);<NEW_LINE>LayoutInterval parent = LayoutInterval.getCommonParent(otherDimAdd, otherDimEx);<NEW_LINE>if (parent == null || parent.isParallel()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} while (exIt.hasNext());<NEW_LINE>} while (addIt.hasNext());<NEW_LINE>// Here we know that all adding component intervals are in a sequence<NEW_LINE>// with the questioned interval in the orthogonal dimension (where<NEW_LINE>// already added), so there can't be an orthogonal overlap.<NEW_LINE>return true;<NEW_LINE>} | getComponent().getLayoutInterval(otherDim); |
389,829 | private void processDynamicPpcGotEntry(ElfLoadHelper elfLoadHelper) {<NEW_LINE>ElfHeader elfHeader = elfLoadHelper.getElfHeader();<NEW_LINE>// Presence of DT_PPC_GOT signals old ABI<NEW_LINE>ElfDynamicTable dynamicTable = elfHeader.getDynamicTable();<NEW_LINE>if (dynamicTable == null || !dynamicTable.containsDynamicValue(DT_PPC_GOT)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Address gotAddr = elfLoadHelper.getDefaultAddress(dynamicTable.getDynamicValue(DT_PPC_GOT));<NEW_LINE>Program program = elfLoadHelper.getProgram();<NEW_LINE>Memory memory = program.getMemory();<NEW_LINE>try {<NEW_LINE>// Update first got entry normally updated by link editor to refer to dynamic table<NEW_LINE>int dynamicOffset = memory.getInt(gotAddr) + (int) elfLoadHelper.getImageBaseWordAdjustmentOffset();<NEW_LINE>elfLoadHelper.addFakeRelocTableEntry(gotAddr, 4);<NEW_LINE><MASK><NEW_LINE>} catch (MemoryAccessException | AddressOverflowException e) {<NEW_LINE>elfLoadHelper.log(e);<NEW_LINE>}<NEW_LINE>} catch (NotFoundException e) {<NEW_LINE>throw new AssertException(e);<NEW_LINE>}<NEW_LINE>} | memory.setInt(gotAddr, dynamicOffset); |
814,552 | boolean anyOtherEndTag(Token t, HtmlTreeBuilder tb) {<NEW_LINE>// case insensitive search - goal is to preserve output case, not for the parse to be case sensitive<NEW_LINE>final String name = t.asEndTag().normalName;<NEW_LINE>final ArrayList<Element> stack = tb.getStack();<NEW_LINE>// deviate from spec slightly to speed when super deeply nested<NEW_LINE>Element <MASK><NEW_LINE>if (elFromStack == null) {<NEW_LINE>tb.error(this);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (int pos = stack.size() - 1; pos >= 0; pos--) {<NEW_LINE>Element node = stack.get(pos);<NEW_LINE>if (node.normalName().equals(name)) {<NEW_LINE>tb.generateImpliedEndTags(name);<NEW_LINE>if (!tb.currentElementIs(name))<NEW_LINE>tb.error(this);<NEW_LINE>tb.popStackToClose(name);<NEW_LINE>break;<NEW_LINE>} else {<NEW_LINE>if (tb.isSpecial(node)) {<NEW_LINE>tb.error(this);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | elFromStack = tb.getFromStack(name); |
523,378 | public void applyBlock(BlockCapsule block) {<NEW_LINE>long nowTime = System.currentTimeMillis();<NEW_LINE>String witnessAddress = Hex.toHexString(block.getWitnessAddress().toByteArray());<NEW_LINE>// witness info<NEW_LINE>if (witnessInfo.containsKey(witnessAddress)) {<NEW_LINE>BlockCapsule oldBlock = witnessInfo.get(witnessAddress);<NEW_LINE>if ((!oldBlock.getBlockId().equals(block.getBlockId())) && oldBlock.getTimeStamp() == block.getTimeStamp()) {<NEW_LINE>MetricsUtil.counterInc(MetricsKey.BLOCKCHAIN_DUP_WITNESS + witnessAddress);<NEW_LINE>dupWitnessBlockNum.put(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>witnessInfo.put(witnessAddress, block);<NEW_LINE>// latency<NEW_LINE>long netTime = nowTime - block.getTimeStamp();<NEW_LINE>MetricsUtil.histogramUpdate(MetricsKey.NET_LATENCY, netTime);<NEW_LINE>MetricsUtil.histogramUpdate(MetricsKey.NET_LATENCY_WITNESS + witnessAddress, netTime);<NEW_LINE>if (netTime >= 3000) {<NEW_LINE>MetricsUtil.counterInc(MetricsKey.NET_LATENCY + ".3S");<NEW_LINE>MetricsUtil.counterInc(MetricsKey.NET_LATENCY_WITNESS + witnessAddress + ".3S");<NEW_LINE>} else if (netTime >= 2000) {<NEW_LINE>MetricsUtil.counterInc(MetricsKey.NET_LATENCY + ".2S");<NEW_LINE>MetricsUtil.counterInc(MetricsKey.NET_LATENCY_WITNESS + witnessAddress + ".2S");<NEW_LINE>} else if (netTime >= 1000) {<NEW_LINE>MetricsUtil.counterInc(MetricsKey.NET_LATENCY + ".1S");<NEW_LINE>MetricsUtil.counterInc(MetricsKey.NET_LATENCY_WITNESS + witnessAddress + ".1S");<NEW_LINE>}<NEW_LINE>// TPS<NEW_LINE>if (block.getTransactions().size() > 0) {<NEW_LINE>MetricsUtil.meterMark(MetricsKey.BLOCKCHAIN_TPS, block.getTransactions().size());<NEW_LINE>}<NEW_LINE>} | witnessAddress, block.getNum()); |
207,007 | public static ClassMembers createMembers(Map<String, byte[]> classMap, ClassHierarchy hierarchy) {<NEW_LINE>Class<?>[] argTypes = new Class[] { ClassHierarchy.class };<NEW_LINE>Object[] argVals = new Object[] { hierarchy };<NEW_LINE>ClassMembers repo = ReflectUtil.quietNew(ClassMembers.class, argTypes, argVals);<NEW_LINE>try {<NEW_LINE>new ClassReader("java/lang/Object").accept(repo.new Feeder(), 0);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Log.error("Failed to get initial reader ClassMembers, could not lookup 'java/lang/Object'");<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, byte[]> e : classMap.entrySet()) {<NEW_LINE>try {<NEW_LINE>new ClassReader(e.getValue()).accept(repo<MASK><NEW_LINE>} catch (Throwable t) {<NEW_LINE>Log.debug("Could not supply {} to ClassMembers feeder", e.getKey(), t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return repo;<NEW_LINE>} | .new Feeder(), 0); |
1,148,276 | public void collectRowRecord(RowRecord rowRecord) {<NEW_LINE>if (numberOfInitializedColumns != columns.length) {<NEW_LINE>List<Integer> initializedDataTypeIndexes = trySetDataTypes(rowRecord);<NEW_LINE>tryInitColumns(initializedDataTypeIndexes);<NEW_LINE>numberOfInitializedColumns += initializedDataTypeIndexes.size();<NEW_LINE>}<NEW_LINE>times[rowCount] = rowRecord.getTimestamp();<NEW_LINE>for (int i = 0; i < columns.length; ++i) {<NEW_LINE>Field field = rowRecord.getFields().get(queryDataSetIndexes.get(i));<NEW_LINE>// if the field is NULL<NEW_LINE>if (field == null || field.getDataType() == null) {<NEW_LINE>// bit in bitMaps are marked as 1 (NULL) by default<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>bitMaps[i].unmark(rowCount);<NEW_LINE>switch(field.getDataType()) {<NEW_LINE>case INT32:<NEW_LINE>((int[]) columns[i])[rowCount] = field.getIntV();<NEW_LINE>break;<NEW_LINE>case INT64:<NEW_LINE>((long[]) columns[i])[rowCount] = field.getLongV();<NEW_LINE>break;<NEW_LINE>case FLOAT:<NEW_LINE>((float[]) columns[i])[rowCount] = field.getFloatV();<NEW_LINE>break;<NEW_LINE>case DOUBLE:<NEW_LINE>((double[]) columns[i])[rowCount] = field.getDoubleV();<NEW_LINE>break;<NEW_LINE>case BOOLEAN:<NEW_LINE>((boolean[]) columns[i])[rowCount] = field.getBoolV();<NEW_LINE>break;<NEW_LINE>case TEXT:<NEW_LINE>((Binary[]) columns[i])[rowCount] = field.getBinaryV();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new UnSupportedDataTypeException(String.format("data type %s is not supported when convert data at client"<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>++rowCount;<NEW_LINE>} | , field.getDataType())); |
1,368,370 | public InternalFuture<Void> deleteAttributes(DeleteProjectAttributes request) {<NEW_LINE>final var projectId = request.getId();<NEW_LINE>final var now = Calendar.getInstance().getTimeInMillis();<NEW_LINE>var validateArgumentFuture = InternalFuture.runAsync(() -> {<NEW_LINE>if (projectId.isEmpty()) {<NEW_LINE>throw new InvalidArgumentException(ModelDBMessages.PROJECT_ID_NOT_PRESENT_ERROR);<NEW_LINE>}<NEW_LINE>}, executor);<NEW_LINE>final Optional<List<String>> maybeKeys = request.getDeleteAll() ? Optional.empty() : Optional.of(request.getAttributeKeysList());<NEW_LINE>return validateArgumentFuture.thenCompose(unused -> checkProjectPermission(projectId, ModelDBActionEnum.ModelDBServiceActions.UPDATE), executor).thenCompose(unused -> jdbi.useHandle(handle -> attributeHandler.deleteKeyValues(handle, projectId, maybeKeys)), executor).thenCompose(unused -> updateModifiedTimestamp(projectId, now), executor).thenCompose(unused <MASK><NEW_LINE>} | -> updateVersionNumber(projectId), executor); |
34,516 | private void killDoomedServers(boolean dumpState) {<NEW_LINE>URL doomedServer = self().getDoomedServer();<NEW_LINE>if (doomedServer != null) {<NEW_LINE>// Kill the other guy<NEW_LINE>System.out.println("killDoomedServers: " + doomedServer.toString());<NEW_LINE>HttpURLConnection conn = null;<NEW_LINE>try {<NEW_LINE>conn = (HttpURLConnection) doomedServer.openConnection();<NEW_LINE>conn.setDoInput(true);<NEW_LINE>conn.setDoOutput(true);<NEW_LINE>conn.setConnectTimeout(10000);<NEW_LINE>conn.setReadTimeout(10000);<NEW_LINE>conn.setRequestMethod("GET");<NEW_LINE>// Get a connection to the server & retrieve the output stream<NEW_LINE>conn.connect();<NEW_LINE>// OutputStream out = conn.getOutputStream();<NEW_LINE><MASK><NEW_LINE>if (response_code == HttpURLConnection.HTTP_OK) {<NEW_LINE>conn.getInputStream();<NEW_LINE>System.out.println("Should not reach here.");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// we want to get here!!<NEW_LINE>e.printStackTrace();<NEW_LINE>if (conn != null)<NEW_LINE>conn.disconnect();<NEW_LINE>System.out.println("Get expected exception in killServer " + e.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (self().getCommitSuicide()) {<NEW_LINE>System.out.println("Committing suicide");<NEW_LINE>if (dumpState) {<NEW_LINE>dumpState();<NEW_LINE>}<NEW_LINE>Runtime.getRuntime().halt(DIE);<NEW_LINE>}<NEW_LINE>} | int response_code = conn.getResponseCode(); |
386,037 | private ListNode<Set<V>> lookupImpl(@NotNull Iterator<T> key) {<NEW_LINE>if (!key.hasNext()) {<NEW_LINE>if (root.values.size() > 0) {<NEW_LINE>return ListNode.of(root.values);<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// walk down the tree while terms of the key path sequence match the corresponding keys of the nodes<NEW_LINE>// till the end of the key sequence or boundary of the data structure, where no more child nodes could be matched<NEW_LINE>// - nodes to lookup down the tree by the current term from the key sequence<NEW_LINE>ListNode<TrieNode> activeNodes = ListNode.of(root);<NEW_LINE>// - total accumulated values from all the nodes met along the key sequence path<NEW_LINE>ListNode<Set<V>> results = null;<NEW_LINE>do {<NEW_LINE>T term = key.next();<NEW_LINE>ListNode<TrieNode> nextNodes = null;<NEW_LINE>// inspect active nodes on the current level of the tree data structure<NEW_LINE>for (ListNode<TrieNode> currNode = activeNodes; currNode != null; currNode = currNode.next) {<NEW_LINE>TrieNode node = currNode.data;<NEW_LINE>// accumulate values from the current node<NEW_LINE>Set<V> values = node.getValues();<NEW_LINE>if (values.size() > 0) {<NEW_LINE>results = ListNode.push(results, values);<NEW_LINE>}<NEW_LINE>// obtain children nodes by the current term for further inspection<NEW_LINE>nextNodes = node.accumulateSubnodesByTerm(term, nextNodes);<NEW_LINE>}<NEW_LINE>activeNodes = nextNodes;<NEW_LINE>// proceed to the next level of the tree if there is something to look at<NEW_LINE>} while (activeNodes != <MASK><NEW_LINE>// accumulate values from the deepest level being reached<NEW_LINE>for (ListNode<TrieNode> currNode = activeNodes; currNode != null; currNode = currNode.next) {<NEW_LINE>results = ListNode.push(results, currNode.data.getValues());<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>} | null && key.hasNext()); |
1,773,486 | public void log(TraceComponent tc) {<NEW_LINE>Tr.debug(tc, MessageFormat.format("Delayed Class [ {0} ]", getHashText()));<NEW_LINE>Tr.debug(tc, MessageFormat.format(" classInfo [ {0} ]", ((classInfo != null) ? classInfo.getHashText() : null)));<NEW_LINE>Tr.debug(tc, MessageFormat.format(" isArtificial [ {0} ]", Boolean.valueOf(isArtificial)));<NEW_LINE>// only write out the remainder of the messages if 'all' trace is enabled<NEW_LINE>if (!tc.isDumpEnabled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isModifiersSet [ {0} ]", Boolean.valueOf(isModifiersSet)));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" modifiers [ {0} ]", Integer.valueOf(modifiers)));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" packageName [ {0} ]", packageName));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" packageInfo [ {0} ]", ((packageInfo != null) ? packageInfo.getHashText() : null)));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isJavaClass [ {0} ]", Boolean.valueOf(isJavaClass)));<NEW_LINE>if (interfaceNames != null) {<NEW_LINE>for (String interfaceName : interfaceNames) {<NEW_LINE>Tr.dump(tc, MessageFormat.format(" [ {0} ]", interfaceName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isInterface [ {0} ]", isInterface));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isAnnotationClass [ {0} ]", isAnnotationClass));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" superclassName [ {0} ]", superclassName));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" superclass [ {0} ]", ((superclass != null) ? superclass.getHashText() : null)));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isEmptyDeclaredFields [ {0} ]", isEmptyDeclaredFields));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isEmptyDeclaredConstructors [ {0} ]", isEmptyDeclaredConstructors));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isEmptyDeclaredMethods [ {0} ]", isEmptyDeclaredMethods));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isEmptyMethods [ {0} ]", isEmptyMethods));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isDeclaredAnnotationPresent [ {0} ]", isDeclaredAnnotationPresent));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isAnnotationPresent [ {0} ]", isAnnotationPresent));<NEW_LINE>Tr.dump(tc, MessageFormat<MASK><NEW_LINE>Tr.dump(tc, MessageFormat.format(" isMethodAnnotationPresent [ {0} ]", isMethodAnnotationPresent));<NEW_LINE>// Don't log the underlying non-delayed class.<NEW_LINE>// Don't log the annotations.<NEW_LINE>} | .format(" isFieldAnnotationPresent [ {0} ]", isFieldAnnotationPresent)); |
1,226,366 | void resolve() throws InjectionException {<NEW_LINE>final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "resolve");<NEW_LINE>Map<String, Object> props = new HashMap<String, Object>();<NEW_LINE>if (properties != null) {<NEW_LINE>int i = 0;<NEW_LINE>for (Map.Entry<String, String> entry : properties.entrySet()) {<NEW_LINE>String key = entry.getKey();<NEW_LINE>props.put(KEY_PROPERTY + <MASK><NEW_LINE>props.put(KEY_PROPERTY + "." + i + ".value", entry.getValue());<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Insert all remaining attributes.<NEW_LINE>addOrRemoveProperty(props, KEY_DESCRIPTION, description);<NEW_LINE>addOrRemoveProperty(props, KEY_FROM, from);<NEW_LINE>addOrRemoveProperty(props, KEY_HOST, host);<NEW_LINE>addOrRemoveProperty(props, KEY_PASSWORD, password);<NEW_LINE>addOrRemoveProperty(props, KEY_STORE_PROTOCOL, storeProtocol);<NEW_LINE>addOrRemoveProperty(props, KEY_STORE_PROTOCOL_CLASS_NAME, storeProtocolClassName);<NEW_LINE>addOrRemoveProperty(props, KEY_TRANSPORT_PROTOCOL, transportProtocol);<NEW_LINE>addOrRemoveProperty(props, KEY_TRANSPORT_PROTOCOL_CLASS_NAME, transportProtocolClassName);<NEW_LINE>addOrRemoveProperty(props, KEY_USER, user);<NEW_LINE>setObjects(null, createDefinitionReference(null, javax.mail.Session.class.getName(), props));<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "resolve");<NEW_LINE>} | "." + i + ".name", key); |
392,501 | public static ConfigECoCheckMarkers parse(String description, double squareSize) {<NEW_LINE>// 9x7n1e3c6<NEW_LINE>int locN = -1;<NEW_LINE>int locE = -1;<NEW_LINE>int locC = -1;<NEW_LINE>for (int i = 0; i < description.length(); i++) {<NEW_LINE>switch(description.charAt(i)) {<NEW_LINE>case 'n' -><NEW_LINE>locN = i;<NEW_LINE>case 'e' -><NEW_LINE>locE = i;<NEW_LINE>case 'c' -><NEW_LINE>locC = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String[] shape = description.substring(0<MASK><NEW_LINE>int rows = Integer.parseInt(shape[0]);<NEW_LINE>int cols = Integer.parseInt(shape[1]);<NEW_LINE>int numMarkers;<NEW_LINE>if (locE == -1)<NEW_LINE>numMarkers = Integer.parseInt(description.substring(locN + 1));<NEW_LINE>else<NEW_LINE>numMarkers = Integer.parseInt(description.substring(locN + 1, locE));<NEW_LINE>ConfigECoCheckMarkers config = singleShape(rows, cols, numMarkers, squareSize);<NEW_LINE>if (locE != -1)<NEW_LINE>if (locC == -1)<NEW_LINE>config.errorCorrectionLevel = Integer.parseInt(description.substring(locE + 1));<NEW_LINE>else<NEW_LINE>config.errorCorrectionLevel = Integer.parseInt(description.substring(locE + 1, locC));<NEW_LINE>if (locC != -1)<NEW_LINE>config.checksumBits = Integer.parseInt(description.substring(locC + 1));<NEW_LINE>return config;<NEW_LINE>} | , locN).split("x"); |
583,051 | final DescribeDestinationsResult executeDescribeDestinations(DescribeDestinationsRequest describeDestinationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDestinationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDestinationsRequest> request = null;<NEW_LINE>Response<DescribeDestinationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDestinationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeDestinationsRequest));<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, "CloudWatch Logs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDestinations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeDestinationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeDestinationsResultJsonUnmarshaller());<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); |
403,063 | public int sendTCP(Object object) {<NEW_LINE>if (object == null)<NEW_LINE>throw new IllegalArgumentException("object cannot be null.");<NEW_LINE>try {<NEW_LINE>int length = tcp.send(this, object);<NEW_LINE>if (length == 0) {<NEW_LINE>if (TRACE)<NEW_LINE><MASK><NEW_LINE>} else if (DEBUG) {<NEW_LINE>String objectString = object == null ? "null" : object.getClass().getSimpleName();<NEW_LINE>if (!(object instanceof FrameworkMessage)) {<NEW_LINE>debug("kryonet", this + " sent TCP: " + objectString + " (" + length + ")");<NEW_LINE>} else if (TRACE) {<NEW_LINE>trace("kryonet", this + " sent TCP: " + objectString + " (" + length + ")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return length;<NEW_LINE>} catch (IOException ex) {<NEW_LINE>if (DEBUG)<NEW_LINE>debug("kryonet", "Unable to send TCP with connection: " + this, ex);<NEW_LINE>close();<NEW_LINE>return 0;<NEW_LINE>} catch (KryoNetException ex) {<NEW_LINE>if (ERROR)<NEW_LINE>error("kryonet", "Unable to send TCP with connection: " + this, ex);<NEW_LINE>close();<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>} | trace("kryonet", this + " TCP had nothing to send."); |
791,366 | public long select(final long j) throws IllegalArgumentException {<NEW_LINE>if (!doCacheCardinalities) {<NEW_LINE>return selectNoCache(j);<NEW_LINE>}<NEW_LINE>// Ensure all cumulatives as we we have straightforward way to know in advance the high of the<NEW_LINE>// j-th value<NEW_LINE>int indexOk = ensureCumulatives(highestHigh());<NEW_LINE>if (highToBitmap.isEmpty()) {<NEW_LINE>return throwSelectInvalidIndex(j);<NEW_LINE>}<NEW_LINE>// Use normal binarySearch as cardinality does not depends on considering longs signed or<NEW_LINE>// unsigned<NEW_LINE>// We need sortedCumulatedCardinality not to contain duplicated, else binarySearch may return<NEW_LINE>// any of the duplicates: we need to ensure it holds no high associated to an empty bitmap<NEW_LINE>int position = Arrays.binarySearch(sortedCumulatedCardinality, 0, indexOk, j);<NEW_LINE>if (position >= 0) {<NEW_LINE>if (position == indexOk - 1) {<NEW_LINE>// .select has been called on this.getCardinality<NEW_LINE>return throwSelectInvalidIndex(j);<NEW_LINE>}<NEW_LINE>// There is a bucket leading to this cardinality: the j-th element is the first element of<NEW_LINE>// next bucket<NEW_LINE>int high = sortedHighs[position + 1];<NEW_LINE>BitmapDataProvider nextBitmap = highToBitmap.get(high);<NEW_LINE>return RoaringIntPacking.pack(high<MASK><NEW_LINE>} else {<NEW_LINE>// There is no bucket with this cardinality<NEW_LINE>int insertionPoint = -position - 1;<NEW_LINE>final long previousBucketCardinality;<NEW_LINE>if (insertionPoint == 0) {<NEW_LINE>previousBucketCardinality = 0L;<NEW_LINE>} else if (insertionPoint >= indexOk) {<NEW_LINE>return throwSelectInvalidIndex(j);<NEW_LINE>} else {<NEW_LINE>previousBucketCardinality = sortedCumulatedCardinality[insertionPoint - 1];<NEW_LINE>}<NEW_LINE>// We get a 'select' query for a single bitmap: should fit in an int<NEW_LINE>final int givenBitmapSelect = (int) (j - previousBucketCardinality);<NEW_LINE>int high = sortedHighs[insertionPoint];<NEW_LINE>BitmapDataProvider lowBitmap = highToBitmap.get(high);<NEW_LINE>int low = lowBitmap.select(givenBitmapSelect);<NEW_LINE>return RoaringIntPacking.pack(high, low);<NEW_LINE>}<NEW_LINE>} | , nextBitmap.select(0)); |
1,503,432 | public AppendEntryResponse append(byte[] body) {<NEW_LINE>try {<NEW_LINE>waitOnUpdatingMetadata(1500, false);<NEW_LINE>if (leaderId == null) {<NEW_LINE>AppendEntryResponse appendEntryResponse = new AppendEntryResponse();<NEW_LINE>appendEntryResponse.setCode(<MASK><NEW_LINE>return appendEntryResponse;<NEW_LINE>}<NEW_LINE>AppendEntryRequest appendEntryRequest = new AppendEntryRequest();<NEW_LINE>appendEntryRequest.setGroup(group);<NEW_LINE>appendEntryRequest.setRemoteId(leaderId);<NEW_LINE>appendEntryRequest.setBody(body);<NEW_LINE>AppendEntryResponse response = dLedgerClientRpcService.append(appendEntryRequest).get();<NEW_LINE>if (response.getCode() == DLedgerResponseCode.NOT_LEADER.getCode()) {<NEW_LINE>waitOnUpdatingMetadata(1500, true);<NEW_LINE>if (leaderId != null) {<NEW_LINE>appendEntryRequest.setRemoteId(leaderId);<NEW_LINE>response = dLedgerClientRpcService.append(appendEntryRequest).get();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>} catch (Exception e) {<NEW_LINE>needFreshMetadata();<NEW_LINE>logger.error("{}", e);<NEW_LINE>AppendEntryResponse appendEntryResponse = new AppendEntryResponse();<NEW_LINE>appendEntryResponse.setCode(DLedgerResponseCode.INTERNAL_ERROR.getCode());<NEW_LINE>return appendEntryResponse;<NEW_LINE>}<NEW_LINE>} | DLedgerResponseCode.METADATA_ERROR.getCode()); |
427,794 | /*<NEW_LINE>* Verify the signature for the CMK<NEW_LINE>*/<NEW_LINE>static void verifyColumnMasterKeyMetadata(SQLServerConnection connection, SQLServerStatement statement, String keyStoreName, String keyPath, String serverName, boolean isEnclaveEnabled, byte[] CMKSignature) throws SQLServerException {<NEW_LINE>// check trusted key paths<NEW_LINE>Boolean[] hasEntry = new Boolean[1];<NEW_LINE>List<String> trustedKeyPaths = SQLServerConnection.getColumnEncryptionTrustedMasterKeyPaths(serverName, hasEntry);<NEW_LINE>if (hasEntry[0]) {<NEW_LINE>if ((null == trustedKeyPaths) || (0 == trustedKeyPaths.size()) || (!trustedKeyPaths.contains(keyPath))) {<NEW_LINE>MessageFormat form = new MessageFormat(SQLServerException.getErrString("R_UntrustedKeyPath"));<NEW_LINE>Object[] msgArgs = { keyPath, serverName };<NEW_LINE>throw new SQLServerException(form.format(msgArgs), null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>SQLServerColumnEncryptionKeyStoreProvider provider = null;<NEW_LINE>if (shouldUseInstanceLevelProviderFlow(keyStoreName, connection, statement)) {<NEW_LINE>provider = <MASK><NEW_LINE>} else {<NEW_LINE>provider = connection.getSystemOrGlobalColumnEncryptionKeyStoreProvider(keyStoreName);<NEW_LINE>}<NEW_LINE>if (!provider.verifyColumnMasterKeyMetadata(keyPath, isEnclaveEnabled, CMKSignature)) {<NEW_LINE>throw new SQLServerException(SQLServerException.getErrString("R_VerifySignature"), null);<NEW_LINE>}<NEW_LINE>} | getColumnEncryptionKeyStoreProvider(keyStoreName, connection, statement); |
1,509,480 | protected void flowThrough(AnalysisInfo in, Unit unit, AnalysisInfo outValue) {<NEW_LINE>AnalysisInfo out = new AnalysisInfo(in);<NEW_LINE>Stmt s = (Stmt) unit;<NEW_LINE>// in case of an if statement, we neet to compute the branch-flow;<NEW_LINE>// e.g. for a statement "if(x!=null) goto s" we have x==null for the fallOut and<NEW_LINE>// x!=null for the branchOut<NEW_LINE>// or for an instanceof expression<NEW_LINE>// if(s instanceof JIfStmt) {<NEW_LINE>// JIfStmt ifStmt = (JIfStmt) s;<NEW_LINE>// handleIfStmt(ifStmt, in, out, outBranch);<NEW_LINE>// }<NEW_LINE>// in case of a monitor statement, we know that the programmer assumes we have a non-null value<NEW_LINE>if (s instanceof MonitorStmt) {<NEW_LINE>out.put(((MonitorStmt) s<MASK><NEW_LINE>}<NEW_LINE>// if we have an array ref, set the info for this ref to TOP,<NEW_LINE>// cause we need to be conservative here<NEW_LINE>if (s.containsArrayRef()) {<NEW_LINE>handleArrayRef(s.getArrayRef(), out);<NEW_LINE>}<NEW_LINE>// same for field refs, but also set the receiver object to non-null, if there is one<NEW_LINE>if (s.containsFieldRef()) {<NEW_LINE>handleFieldRef(s.getFieldRef(), out);<NEW_LINE>}<NEW_LINE>// same for invoke expr., also set the receiver object to non-null, if there is one<NEW_LINE>if (s.containsInvokeExpr()) {<NEW_LINE>handleInvokeExpr(s.getInvokeExpr(), out);<NEW_LINE>}<NEW_LINE>// allow sublasses to define certain values as always-non-null<NEW_LINE>for (Map.Entry<Value, Object> entry : out.entrySet()) {<NEW_LINE>if (isAlwaysNonNull(entry.getKey())) {<NEW_LINE>entry.setValue(NON_NULL);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if we have a definition (assignment) statement to a ref-like type, handle it,<NEW_LINE>if (s instanceof DefinitionStmt) {<NEW_LINE>// need to copy the current out set because we need to assign under this assumption;<NEW_LINE>// so this copy becomes the in-set to handleRefTypeAssignment<NEW_LINE>DefinitionStmt defStmt = (DefinitionStmt) s;<NEW_LINE>if (defStmt.getLeftOp().getType() instanceof RefLikeType) {<NEW_LINE>handleRefTypeAssignment(defStmt, new AnalysisInfo(out), out);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// save memory by only retaining information about locals<NEW_LINE>for (Iterator<Value> outIter = out.keySet().iterator(); outIter.hasNext(); ) {<NEW_LINE>Value v = outIter.next();<NEW_LINE>if (!(v instanceof Local)) {<NEW_LINE>outIter.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// now copy the computed info to out<NEW_LINE>copy(out, outValue);<NEW_LINE>} | ).getOp(), NON_NULL); |
1,594,124 | private void visitGenericsTypeAnnotations(final GenericsType[] genericsTypes, final Object visitor, final String typePath, final TypeReference typeRef, final boolean typeUse) {<NEW_LINE>for (int paramIdx = 0; paramIdx < genericsTypes.length; paramIdx++) {<NEW_LINE>GenericsType gt = genericsTypes[paramIdx];<NEW_LINE><MASK><NEW_LINE>visitType(gt.getType(), visitor, typeRef, prefix, typeUse);<NEW_LINE>if (!gt.isPlaceholder()) {<NEW_LINE>if (gt.getLowerBound() != null) {<NEW_LINE>visitType(gt.getLowerBound(), visitor, typeRef, gt.isWildcard() ? prefix + "*" : prefix + "0;", typeUse);<NEW_LINE>}<NEW_LINE>if (gt.getUpperBounds() != null) {<NEW_LINE>ClassNode[] upperBounds = gt.getUpperBounds();<NEW_LINE>for (int boundIdx = 0; boundIdx < upperBounds.length; boundIdx++) {<NEW_LINE>visitType(upperBounds[boundIdx], visitor, typeRef, gt.isWildcard() ? prefix + "*" : prefix + boundIdx + ";", typeUse);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String prefix = typePath + paramIdx + ";"; |
672,149 | private void mapGtfsStopsToOtpTypes(GtfsRelationalDao data) {<NEW_LINE>StopToParentStationLinker stopToParentStationLinker = new StopToParentStationLinker(issueStore);<NEW_LINE>for (org.onebusaway.gtfs.model.Stop it : data.getAllStops()) {<NEW_LINE>if (it.getLocationType() == org.onebusaway.gtfs.model.Stop.LOCATION_TYPE_STOP) {<NEW_LINE>Stop stop = stopMapper.map(it);<NEW_LINE>builder.getStops().add(stop);<NEW_LINE>stopToParentStationLinker.addStationElement(stop, it.getParentStation());<NEW_LINE>} else if (it.getLocationType() == org.onebusaway.gtfs.model.Stop.LOCATION_TYPE_STATION) {<NEW_LINE>Station station = stationMapper.map(it);<NEW_LINE>builder.getStations().add(station);<NEW_LINE>stopToParentStationLinker.addStation(station);<NEW_LINE>} else if (it.getLocationType() == org.onebusaway.gtfs.model.Stop.LOCATION_TYPE_ENTRANCE_EXIT) {<NEW_LINE>Entrance entrance = entranceMapper.map(it);<NEW_LINE>builder.getEntrances().add(entrance);<NEW_LINE>stopToParentStationLinker.addStationElement(entrance, it.getParentStation());<NEW_LINE>} else if (it.getLocationType() == org.onebusaway.gtfs.model.Stop.LOCATION_TYPE_NODE) {<NEW_LINE>PathwayNode pathwayNode = pathwayNodeMapper.map(it);<NEW_LINE>builder.getPathwayNodes().add(pathwayNode);<NEW_LINE>stopToParentStationLinker.addStationElement(pathwayNode, it.getParentStation());<NEW_LINE>} else if (it.getLocationType() == org.onebusaway.gtfs.model.Stop.LOCATION_TYPE_BOARDING_AREA) {<NEW_LINE>BoardingArea boardingArea = boardingAreaMapper.map(it);<NEW_LINE>builder.getBoardingAreas().add(boardingArea);<NEW_LINE>stopToParentStationLinker.addBoardingArea(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>stopToParentStationLinker.link();<NEW_LINE>} | boardingArea, it.getParentStation()); |
699,622 | public BlackboardArtifact addArea(String areaName, GeoAreaPoints areaPoints, List<BlackboardAttribute> moreAttributes) throws TskCoreException, BlackboardException {<NEW_LINE>if (areaPoints == null || areaPoints.isEmpty()) {<NEW_LINE>throw new IllegalArgumentException(String.format("addArea was passed a null or empty list of points"));<NEW_LINE>}<NEW_LINE>List<BlackboardAttribute> attributes = new ArrayList<>();<NEW_LINE>attributes.add(BlackboardJsonAttrUtil.toAttribute(AREAPOINTS_ATTR_TYPE, getModuleName(), areaPoints));<NEW_LINE>if (areaName != null) {<NEW_LINE>attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME<MASK><NEW_LINE>}<NEW_LINE>if (programName != null) {<NEW_LINE>attributes.add(new BlackboardAttribute(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PROG_NAME, getModuleName(), programName));<NEW_LINE>}<NEW_LINE>if (moreAttributes != null) {<NEW_LINE>attributes.addAll(moreAttributes);<NEW_LINE>}<NEW_LINE>Content content = getContent();<NEW_LINE>BlackboardArtifact artifact = content.newDataArtifact(GPS_AREA_TYPE, attributes);<NEW_LINE>Optional<Long> ingestJobId = getIngestJobId();<NEW_LINE>getSleuthkitCase().getBlackboard().postArtifact(artifact, getModuleName(), ingestJobId.orElse(null));<NEW_LINE>return artifact;<NEW_LINE>} | , getModuleName(), areaName)); |
1,669,821 | private void generateSubstitutionParamMembers(List<MemberFieldPair> members) {<NEW_LINE>List<CodegenSubstitutionParamEntry<MASK><NEW_LINE>LinkedHashMap<String, CodegenSubstitutionParamEntry> named = packageScope.getSubstitutionParamsByName();<NEW_LINE>if (numbered.isEmpty() && named.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!numbered.isEmpty() && !named.isEmpty()) {<NEW_LINE>throw new IllegalStateException("Both named and numbered substitution parameters are non-empty");<NEW_LINE>}<NEW_LINE>List<CodegenSubstitutionParamEntry> fields;<NEW_LINE>if (!numbered.isEmpty()) {<NEW_LINE>fields = numbered;<NEW_LINE>} else {<NEW_LINE>fields = new ArrayList<>(named.values());<NEW_LINE>}<NEW_LINE>for (int i = 0; i < fields.size(); i++) {<NEW_LINE>CodegenField field = fields.get(i).getField();<NEW_LINE>String name = field.getName();<NEW_LINE>CodegenTypedParam member = new CodegenTypedParam(fields.get(i).getType(), name).setStatic(true).setFinal(false);<NEW_LINE>members.add(new MemberFieldPair(member, field));<NEW_LINE>}<NEW_LINE>} | > numbered = packageScope.getSubstitutionParamsByNumber(); |
909,451 | public void build() {<NEW_LINE>// row<NEW_LINE>String[] protocols = { "HTTP", "HTTPS", "UDP", "DHT" };<NEW_LINE>String[] descs = { "HTTP", "HTTPS (SSL)", "UDP", "Decentralised" };<NEW_LINE>StringListParameterImpl protocol = new StringListParameterImpl(SCFG_SHARING_PROTOCOL, "ConfigView.section.sharing.protocol", protocols, descs);<NEW_LINE>add(protocol);<NEW_LINE>// row<NEW_LINE>BooleanParameterImpl private_torrent = new BooleanParameterImpl(BCFG_SHARING_TORRENT_PRIVATE, "ConfigView.section.sharing.privatetorrent");<NEW_LINE>add(private_torrent);<NEW_LINE>// row<NEW_LINE>BooleanParameterImpl permit_dht_backup = new BooleanParameterImpl(BCFG_SHARING_PERMIT_DHT, "ConfigView.section.sharing.permitdht");<NEW_LINE>add(permit_dht_backup);<NEW_LINE>// Force "Permit DHT Tracking" off when "Private Torrent" is on<NEW_LINE>ParameterListener protocol_cl = p -> {<NEW_LINE>boolean not_dht = !protocol.getValue().equals("DHT");<NEW_LINE>private_torrent.setEnabled(not_dht);<NEW_LINE>permit_dht_backup.setEnabled(not_dht && !private_torrent.getValue());<NEW_LINE>if (private_torrent.getValue()) {<NEW_LINE>permit_dht_backup.setValue(false);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>protocol_cl.parameterChanged(protocol);<NEW_LINE>protocol.addListener(protocol_cl);<NEW_LINE>private_torrent.addListener(protocol_cl);<NEW_LINE>// row<NEW_LINE>add(new BooleanParameterImpl(BCFG_SHARING_ADD_HASHES, "wizard.createtorrent.extrahashes"));<NEW_LINE>// row<NEW_LINE>add(new BooleanParameterImpl(BCFG_SHARING_DISABLE_RCM, "ConfigView.section.sharing.disable_rcm"));<NEW_LINE>// row<NEW_LINE>BooleanParameterImpl rescan_enable = new BooleanParameterImpl(BCFG_SHARING_RESCAN_ENABLE, "ConfigView.section.sharing.rescanenable");<NEW_LINE>add(rescan_enable);<NEW_LINE>// row<NEW_LINE>IntParameterImpl rescan_period = new IntParameterImpl(ICFG_SHARING_RESCAN_PERIOD, "ConfigView.section.sharing.rescanperiod");<NEW_LINE>add(rescan_period);<NEW_LINE>rescan_period.setMinValue(1);<NEW_LINE>rescan_period.setIndent(1, true);<NEW_LINE>rescan_enable.addEnabledOnSelection(rescan_period);<NEW_LINE>// comment<NEW_LINE>StringParameterImpl torrent_comment = new StringParameterImpl(SCFG_SHARING_TORRENT_COMMENT, "ConfigView.section.sharing.torrentcomment");<NEW_LINE>add(torrent_comment);<NEW_LINE>torrent_comment.setMultiLine(2);<NEW_LINE>// row<NEW_LINE>add(new BooleanParameterImpl(BCFG_SHARING_IS_PERSISTENT, "ConfigView.section.sharing.persistentshares"));<NEW_LINE>// ///////////////////// NETWORKS GROUP ///////////////////<NEW_LINE>List<Parameter> listNetworks = new ArrayList<>();<NEW_LINE>BooleanParameterImpl network_global = new BooleanParameterImpl(BCFG_SHARING_NETWORK_SELECTION_GLOBAL, "label.use.global.defaults");<NEW_LINE>add(network_global, listNetworks);<NEW_LINE>List<BooleanParameterImpl> net_params = new ArrayList<>();<NEW_LINE>for (String net : AENetworkClassifier.AT_NETWORKS) {<NEW_LINE>String config_name = BCFG_PREFIX_SHARING_NETWORK_SELECTION_DEFAULT + net;<NEW_LINE>String msg_text = "ConfigView.section.connection.networks." + net;<NEW_LINE>BooleanParameterImpl network = new BooleanParameterImpl(config_name, msg_text);<NEW_LINE>add(network, listNetworks);<NEW_LINE>network.setIndent(1, false);<NEW_LINE>net_params.add(network);<NEW_LINE>}<NEW_LINE>network_global.addDisabledOnSelection(net_params.toArray<MASK><NEW_LINE>add(SECTION_ID + ".pgNetworks", new ParameterGroupImpl("ConfigView.section.connection.group.networks", listNetworks));<NEW_LINE>} | (new Parameter[0])); |
1,338,190 | private void loadNode923() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ServerType_ServerRedundancy_RedundancySupport, new QualifiedName(0, "RedundancySupport"), new LocalizedText("en", "RedundancySupport"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.RedundancySupport, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.ServerType_ServerRedundancy_RedundancySupport, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerType_ServerRedundancy_RedundancySupport, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerType_ServerRedundancy_RedundancySupport, Identifiers.HasProperty, Identifiers.ServerType_ServerRedundancy.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | (1), 0.0, false); |
251,725 | private void tagNote(List<Tag> tags, Integer[] selectedTags, Note note) {<NEW_LINE>Pair<String, List<Tag>> taggingResult = TagsHelper.addTagToNote(tags, selectedTags, note);<NEW_LINE>StringBuilder sb;<NEW_LINE>if (Boolean.TRUE.equals(noteTmp.isChecklist())) {<NEW_LINE>CheckListViewItem mCheckListViewItem = mChecklistManager.getFocusedItemView();<NEW_LINE>if (mCheckListViewItem != null) {<NEW_LINE>sb = new StringBuilder(mCheckListViewItem.getText());<NEW_LINE>sb.insert(contentCursorPosition, " " + taggingResult.first + " ");<NEW_LINE>mCheckListViewItem.setText(sb.toString());<NEW_LINE>mCheckListViewItem.getEditText().setSelection(contentCursorPosition + taggingResult.first.length() + 1);<NEW_LINE>} else {<NEW_LINE>binding.detailTitle.append(" " + taggingResult.first);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>sb = new StringBuilder(getNoteContent());<NEW_LINE>if (binding.fragmentDetailContent.detailContent.hasFocus()) {<NEW_LINE>sb.insert(contentCursorPosition, <MASK><NEW_LINE>binding.fragmentDetailContent.detailContent.setText(sb.toString());<NEW_LINE>binding.fragmentDetailContent.detailContent.setSelection(contentCursorPosition + taggingResult.first.length() + 1);<NEW_LINE>} else {<NEW_LINE>if (getNoteContent().trim().length() > 0) {<NEW_LINE>sb.append(System.getProperty("line.separator")).append(System.getProperty("line.separator"));<NEW_LINE>}<NEW_LINE>sb.append(taggingResult.first);<NEW_LINE>binding.fragmentDetailContent.detailContent.setText(sb.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>eventuallyRemoveDeselectedTags(taggingResult.second);<NEW_LINE>} | " " + taggingResult.first + " "); |
1,330,717 | protected void bindKeys() {<NEW_LINE>final InputMap inputMap = getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);<NEW_LINE>final ActionMap actionMap = getActionMap();<NEW_LINE>// Slight translation<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke("alt UP"), "UpTranslateAction");<NEW_LINE>actionMap.put("UpTranslateAction", getTranslateAction(0, -1));<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke("alt DOWN"), "DownTranslateAction");<NEW_LINE>actionMap.put("DownTranslateAction", getTranslateAction(0, 1));<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke("alt LEFT"), "LeftTranslateAction");<NEW_LINE>actionMap.put("LeftTranslateAction", getTranslateAction(-1, 0));<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke("alt RIGHT"), "RightTranslateAction");<NEW_LINE>actionMap.put("RightTranslateAction", getTranslateAction(1, 0));<NEW_LINE>// Zoom modifications<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke("ctrl ADD"), "ZoomInAction");<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke("ctrl PLUS"), "ZoomInAction");<NEW_LINE>actionMap.put("ZoomInAction", new ZoomAction(1));<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke("ctrl SUBTRACT"), "ZoomOutAction");<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke("ctrl MINUS"), "ZoomOutAction");<NEW_LINE>actionMap.put("ZoomOutAction", new ZoomAction(-1));<NEW_LINE>inputMap.put(KeyStroke.getKeyStroke("ctrl NUMPAD0"), "ZoomResetAction");<NEW_LINE>inputMap.put(KeyStroke<MASK><NEW_LINE>actionMap.put("ZoomResetAction", new ZoomAction(0));<NEW_LINE>} | .getKeyStroke("ctrl 0"), "ZoomResetAction"); |
119,979 | public List<Object> tracedQuery(Object objectToQuery, JsonPointerIterator iterator) {<NEW_LINE>List<Object> list = new ArrayList<>();<NEW_LINE>if (isRootPointer() && !iterator.isNull(objectToQuery))<NEW_LINE>list.add(objectToQuery);<NEW_LINE>else {<NEW_LINE>Object lastValue = walkTillLastElement(objectToQuery, iterator, false, list::add);<NEW_LINE>if (!iterator.isNull(lastValue))<NEW_LINE>list.add(lastValue);<NEW_LINE>String lastKey = decodedTokens.get(decodedTokens.size() - 1);<NEW_LINE>if (iterator.isObject(lastValue)) {<NEW_LINE>lastValue = iterator.<MASK><NEW_LINE>} else if (iterator.isArray(lastValue) && !"-".equals(lastKey)) {<NEW_LINE>try {<NEW_LINE>lastValue = iterator.getArrayElement(lastValue, Integer.parseInt(lastKey));<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!iterator.isNull(lastValue))<NEW_LINE>list.add(lastValue);<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} | getObjectParameter(lastValue, lastKey, false); |
1,153,123 | public CodecDocument openDocumentInner(String fileName, String password) {<NEW_LINE>try {<NEW_LINE>if (cacheFile.isFile()) {<NEW_LINE>LOG.d("OdtContext cache", cacheFile.getPath());<NEW_LINE>MuPdfDocument muPdfDocument = new MuPdfDocument(this, MuPdfDocument.FORMAT_PDF, cacheFile.getPath(), password);<NEW_LINE>return muPdfDocument;<NEW_LINE>}<NEW_LINE>CacheZipUtils.removeFiles(CacheZipUtils.CACHE_BOOK_DIR.listFiles());<NEW_LINE>LocatedOpenDocumentFile documentFile = new LocatedOpenDocumentFile(fileName);<NEW_LINE>OpenDocument openDocument = documentFile.getAsDocument();<NEW_LINE>TextTranslator translator = new TextTranslator();<NEW_LINE>TranslationSettings settings = new TranslationSettings();<NEW_LINE>String root = CacheZipUtils.CACHE_BOOK_DIR.getPath();<NEW_LINE>settings.setCache(new DefaultFileCache(root));<NEW_LINE>settings.setImageStoreMode(ImageStoreMode.CACHE);<NEW_LINE>String tempFileName <MASK><NEW_LINE>DocumentTranslatorUtil.Output output = DocumentTranslatorUtil.provideOutput(openDocument, settings, tempFileName + "-", ".html");<NEW_LINE>try {<NEW_LINE>translator.translate(openDocument, output.getWriter(), settings);<NEW_LINE>} finally {<NEW_LINE>output.getWriter().close();<NEW_LINE>}<NEW_LINE>documentFile.close();<NEW_LINE>LOG.d("OdtContext create", cacheFile.getPath());<NEW_LINE>try {<NEW_LINE>FileInputStream in = new FileInputStream(new File(root, tempFileName + "-0.html"));<NEW_LINE>OutputStream out = new BufferedOutputStream(new FileOutputStream(cacheFile));<NEW_LINE>HypenUtils.applyLanguage(AppSP.get().hypenLang);<NEW_LINE>Fb2Extractor.generateHyphenFileEpub(new InputStreamReader(in), null, out, null, null, 0);<NEW_LINE>out.close();<NEW_LINE>in.close();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.e(e);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.e(e);<NEW_LINE>}<NEW_LINE>MuPdfDocument muPdfDocument = new MuPdfDocument(this, MuPdfDocument.FORMAT_PDF, cacheFile.getPath(), password);<NEW_LINE>return muPdfDocument;<NEW_LINE>} | = fileNameCache.hashCode() + ".tmp"; |
408,335 | protected void onAccountChangeMessage(String topic, String message) {<NEW_LINE>if (!open.get()) {<NEW_LINE>// take no action instead of throwing an exception to silence noisy log messages when a message is received while<NEW_LINE>// closing the AccountService.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>switch(message) {<NEW_LINE>case FULL_ACCOUNT_METADATA_CHANGE_MESSAGE:<NEW_LINE>logger.<MASK><NEW_LINE>fetchAndUpdateCache();<NEW_LINE>logger.trace("Completed processing message={} for topic={}", message, topic);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>accountServiceMetrics.unrecognizedMessageErrorCount.inc();<NEW_LINE>throw new RuntimeException("Could not understand message=" + message + " for topic=" + topic);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Exception occurred when processing message={} for topic={}.", message, topic, e);<NEW_LINE>accountServiceMetrics.remoteDataCorruptionErrorCount.inc();<NEW_LINE>accountServiceMetrics.fetchRemoteAccountErrorCount.inc();<NEW_LINE>}<NEW_LINE>} | info("Processing message={} for topic={}", message, topic); |
1,685,199 | public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = new String[] { "key", "value" };<NEW_LINE>String epl = "@name('create') create window MyWindowFU#firstunique(key) as MySimpleKeyValueMap;\n" + "insert into MyWindowFU select theString as key, longBoxed as value from SupportBean;\n" + "@name('s0') select irstream key, value as value from MyWindowFU;\n" + "@name('delete') on SupportMarketDataBean as s0 delete from MyWindowFU as s1 where s0.symbol = s1.key;\n";<NEW_LINE>env.compileDeploy(epl).addListener("create").addListener("s0").addListener("delete");<NEW_LINE>sendSupportBean(env, "G1", 1L);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "G1", 1L });<NEW_LINE>env.assertPropsPerRowIterator("create", fields, new Object[][] <MASK><NEW_LINE>sendSupportBean(env, "G2", 20L);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "G2", 20L });<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("create", fields, new Object[][] { { "G1", 1L }, { "G2", 20L } });<NEW_LINE>// delete G2<NEW_LINE>sendMarketBean(env, "G2");<NEW_LINE>env.assertPropsOld("s0", fields, new Object[] { "G2", 20L });<NEW_LINE>env.assertPropsPerRowIterator("create", fields, new Object[][] { { "G1", 1L } });<NEW_LINE>// ignored<NEW_LINE>sendSupportBean(env, "G1", 2L);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.assertPropsPerRowIterator("create", fields, new Object[][] { { "G1", 1L } });<NEW_LINE>sendSupportBean(env, "G2", 21L);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "G2", 21L });<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("create", fields, new Object[][] { { "G1", 1L }, { "G2", 21L } });<NEW_LINE>// ignored<NEW_LINE>sendSupportBean(env, "G2", 22L);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.assertPropsPerRowIteratorAnyOrder("create", fields, new Object[][] { { "G1", 1L }, { "G2", 21L } });<NEW_LINE>sendMarketBean(env, "G1");<NEW_LINE>env.assertPropsOld("s0", fields, new Object[] { "G1", 1L });<NEW_LINE>env.assertPropsPerRowIterator("create", fields, new Object[][] { { "G2", 21L } });<NEW_LINE>env.undeployAll();<NEW_LINE>} | { { "G1", 1L } }); |
246,715 | protected void resumeVm(final Message msg, Completion completion) {<NEW_LINE>refreshVO();<NEW_LINE>ErrorCode allowed = validateOperationByState(msg, self.getState(), null);<NEW_LINE>if (allowed != null) {<NEW_LINE>completion.fail(allowed);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>VmInstanceInventory <MASK><NEW_LINE>final VmInstanceSpec spec = buildSpecFromInventory(inv, VmOperation.Resume);<NEW_LINE>spec.setMessage(msg);<NEW_LINE>final VmInstanceState originState = self.getState();<NEW_LINE>changeVmStateInDb(VmInstanceStateEvent.resuming);<NEW_LINE>FlowChain chain = getResumeVmWorkFlowChain(inv);<NEW_LINE>setFlowMarshaller(chain);<NEW_LINE>chain.setName(String.format("resume-vm-%s", self.getUuid()));<NEW_LINE>chain.getData().put(VmInstanceConstant.Params.VmInstanceSpec.toString(), spec);<NEW_LINE>chain.done(new FlowDoneHandler(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handle(Map Data) {<NEW_LINE>self = changeVmStateInDb(VmInstanceStateEvent.running);<NEW_LINE>completion.success();<NEW_LINE>}<NEW_LINE>}).error(new FlowErrorHandler(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handle(final ErrorCode errCode, Map data) {<NEW_LINE>self.setState(originState);<NEW_LINE>self = dbf.updateAndRefresh(self);<NEW_LINE>completion.fail(errCode);<NEW_LINE>}<NEW_LINE>}).start();<NEW_LINE>} | inv = VmInstanceInventory.valueOf(self); |
462,105 | protected void deleteFiles(@NonNull List<RemoteFile> remoteFiles) {<NEW_LINE>Map<String, String> commonParameters = new HashMap<>();<NEW_LINE>commonParameters.put("deviceid", <MASK><NEW_LINE>commonParameters.put("accessToken", getHelper().getAccessToken());<NEW_LINE>List<DeleteRemoteFileTask> tasks = new ArrayList<>();<NEW_LINE>for (RemoteFile remoteFile : remoteFiles) {<NEW_LINE>Map<String, String> parameters = new HashMap<>(commonParameters);<NEW_LINE>parameters.put("name", remoteFile.getName());<NEW_LINE>parameters.put("type", remoteFile.getType());<NEW_LINE>if (byVersion) {<NEW_LINE>parameters.put("updatetime", String.valueOf(remoteFile.getUpdatetimems()));<NEW_LINE>}<NEW_LINE>Request r = new Request(byVersion ? DELETE_FILE_VERSION_URL : DELETE_FILE_URL, parameters, null, false, true);<NEW_LINE>tasks.add(new DeleteRemoteFileTask(getApp(), r, remoteFile, byVersion));<NEW_LINE>}<NEW_LINE>ThreadPoolTaskExecutor<DeleteRemoteFileTask> executor = new ThreadPoolTaskExecutor<>(new OnThreadPoolTaskExecutorListener<DeleteRemoteFileTask>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onTaskStarted(@NonNull DeleteRemoteFileTask task) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onTaskFinished(@NonNull DeleteRemoteFileTask task) {<NEW_LINE>publishProgress(task);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onTasksFinished(@NonNull List<DeleteRemoteFileTask> tasks) {<NEW_LINE>BaseDeleteFilesCommand.this.tasks = tasks;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>executor.run(tasks);<NEW_LINE>} | getHelper().getDeviceId()); |
971,733 | public org.mlflow.api.proto.Service.Experiment buildPartial() {<NEW_LINE>org.mlflow.api.proto.Service.Experiment result = new org.mlflow.api.proto.Service.Experiment(this);<NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>result.experimentId_ = experimentId_;<NEW_LINE>if (((from_bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>to_bitField0_ |= 0x00000002;<NEW_LINE>}<NEW_LINE>result.name_ = name_;<NEW_LINE>if (((from_bitField0_ & 0x00000004) == 0x00000004)) {<NEW_LINE>to_bitField0_ |= 0x00000004;<NEW_LINE>}<NEW_LINE>result.artifactLocation_ = artifactLocation_;<NEW_LINE>if (((from_bitField0_ & 0x00000008) == 0x00000008)) {<NEW_LINE>to_bitField0_ |= 0x00000008;<NEW_LINE>}<NEW_LINE>result.lifecycleStage_ = lifecycleStage_;<NEW_LINE>if (((from_bitField0_ & 0x00000010) == 0x00000010)) {<NEW_LINE>to_bitField0_ |= 0x00000010;<NEW_LINE>}<NEW_LINE>result.lastUpdateTime_ = lastUpdateTime_;<NEW_LINE>if (((from_bitField0_ & 0x00000020) == 0x00000020)) {<NEW_LINE>to_bitField0_ |= 0x00000020;<NEW_LINE>}<NEW_LINE>result.creationTime_ = creationTime_;<NEW_LINE>if (tagsBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000040) == 0x00000040)) {<NEW_LINE>tags_ = java.util.Collections.unmodifiableList(tags_);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>result.tags_ = tags_;<NEW_LINE>} else {<NEW_LINE>result.tags_ = tagsBuilder_.build();<NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | bitField0_ = (bitField0_ & ~0x00000040); |
1,041,411 | protected long writeByteOffset(final byte[] bits, final int offset, long len) throws IOException {<NEW_LINE>if (len == 0)<NEW_LINE>return 0;<NEW_LINE>if (len <= free) {<NEW_LINE>return writeInCurrent(bits[offset] >>> 8 - len, (int) len);<NEW_LINE>} else {<NEW_LINE>final int shift = free;<NEW_LINE>int i, j;<NEW_LINE>writeInCurrent(bits[offset] >>> 8 - shift, shift);<NEW_LINE>len -= shift;<NEW_LINE>j = offset;<NEW_LINE>i = (int) (len >> 3);<NEW_LINE>while (i-- != 0) {<NEW_LINE>write(bits[j] << shift | (bits[j + 1] & 0xFF) >>> 8 - shift);<NEW_LINE>writtenBits += 8;<NEW_LINE>j++;<NEW_LINE>}<NEW_LINE>final int queue = (int) (len & 7);<NEW_LINE>if (queue != 0) {<NEW_LINE>if (queue <= 8 - shift) {<NEW_LINE>writeInCurrent(bits[j] >>> <MASK><NEW_LINE>} else {<NEW_LINE>writeInCurrent(bits[j], 8 - shift);<NEW_LINE>writeInCurrent(bits[j + 1] >>> 16 - queue - shift, queue + shift - 8);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return len + shift;<NEW_LINE>}<NEW_LINE>} | 8 - shift - queue, queue); |
111,735 | public static void main(String[] args) throws Exception {<NEW_LINE>String filename = "iris.data";<NEW_LINE>URL url = new URL("https://archive.ics.uci.edu/ml/machine-learning-databases/iris/iris.data");<NEW_LINE>File irisText = new File(filename);<NEW_LINE>if (!irisText.exists()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>SparkConf conf = new SparkConf();<NEW_LINE>conf.setMaster("local[*]");<NEW_LINE>conf.setAppName("DataVec Example");<NEW_LINE>JavaSparkContext sc = new JavaSparkContext(conf);<NEW_LINE>JavaRDD<String> stringData = sc.textFile(filename);<NEW_LINE>// Take out empty lines.<NEW_LINE>RecordReader rr = new CSVRecordReader();<NEW_LINE>JavaRDD<List<Writable>> parsedInputData = stringData.filter((x) -> !x.isEmpty()).map(new StringToWritablesFunction(rr));<NEW_LINE>// Print the original text file. Not the empty line at the bottom,<NEW_LINE>List<String> inputDataCollected = stringData.collect();<NEW_LINE>System.out.println("\n\n---- Original Data ----");<NEW_LINE>for (String s : inputDataCollected) System.out.println("'" + s + "'");<NEW_LINE>//<NEW_LINE>JavaRDD<String> processedAsString = parsedInputData.map(new WritablesToStringFunction(","));<NEW_LINE>List<String> inputDataParsed = processedAsString.collect();<NEW_LINE>System.out.println("\n\n---- Parsed Data ----");<NEW_LINE>for (String s : inputDataParsed) System.out.println("'" + s + "'");<NEW_LINE>// the String to label conversion. Define schema and transform:<NEW_LINE>Schema schema = new Schema.Builder().addColumnsDouble("Sepal length", "Sepal width", "Petal length", "Petal width").addColumnCategorical("Species", "Iris-setosa", "Iris-versicolor", "Iris-virginica").build();<NEW_LINE>TransformProcess tp = new TransformProcess.Builder(schema).categoricalToInteger("Species").build();<NEW_LINE>// do the transformation.<NEW_LINE>JavaRDD<List<Writable>> processedData = SparkTransformExecutor.execute(parsedInputData, tp);<NEW_LINE>// This is where we print the final result (which you would save to a text file.<NEW_LINE>processedAsString = processedData.map(new WritablesToStringFunction(","));<NEW_LINE>inputDataParsed = processedAsString.collect();<NEW_LINE>System.out.println("\n\n---- Parsed and filtered data ----");<NEW_LINE>for (String s : inputDataParsed) System.out.println(s);<NEW_LINE>} | FileUtils.copyURLToFile(url, irisText); |
283,051 | private void handleExchangeOperation(PrintWriter responseWriter, HttpServletRequest servletRequest, HttpServletResponse servletResponse) {<NEW_LINE>ExchangeData exchangeData = createExchangeData(responseWriter, servletRequest, servletResponse);<NEW_LINE>if (exchangeData == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>responseWriter.println("Initiating exchange ...");<NEW_LINE>responseWriter.println("========================");<NEW_LINE>String fromName = exchangeData.fromCurrency.getCountryName();<NEW_LINE>String toName = exchangeData.toCurrency.getCountryName();<NEW_LINE>responseWriter.println("[ " + fromName + " ] gives [ " + exchangeData.fromAmount + " ] from [ " + exchangeTotals.getExchangeTotal(fromName) + " ]");<NEW_LINE>responseWriter.println("[ " + toName + " ] receives [ " + exchangeData.toAmount + " ] to [ " + exchangeTotals.getExchangeTotal(toName) + " ]");<NEW_LINE>// @formatter:off<NEW_LINE>exchangeInitiator.initiateExchange(exchangeData.fromCurrency, exchangeData.fromAmount, exchangeData.toCurrency, exchangeData.toAmount);<NEW_LINE>// @formatter:on<NEW_LINE>responseWriter.println("[ " + fromName + " ] now has [ " + exchangeTotals.getExchangeTotal(fromName) + " ]");<NEW_LINE>responseWriter.println("[ " + toName + " ] now has [ " + exchangeTotals<MASK><NEW_LINE>responseWriter.println("========================");<NEW_LINE>responseWriter.println("Completed exchange");<NEW_LINE>} | .getExchangeTotal(toName) + " ]"); |
991,650 | protected Byte coerceToByte(Object value) {<NEW_LINE>if (value == null || "".equals(value)) {<NEW_LINE>return Byte.valueOf((byte) 0);<NEW_LINE>}<NEW_LINE>if (value instanceof Byte) {<NEW_LINE>return (Byte) value;<NEW_LINE>}<NEW_LINE>if (value instanceof Number) {<NEW_LINE>return Byte.valueOf(((Number) value).byteValue());<NEW_LINE>}<NEW_LINE>if (value instanceof String) {<NEW_LINE>try {<NEW_LINE>return Byte.valueOf((String) value);<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new ELException(LocalMessages.get("error.coerce.value", value, value.getClass(), Byte.class), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (value instanceof Character) {<NEW_LINE>return Byte.valueOf(Short.valueOf((short) ((Character) value).charValue<MASK><NEW_LINE>}<NEW_LINE>throw new ELException(LocalMessages.get("error.coerce.type", value, value.getClass(), Byte.class));<NEW_LINE>} | ()).byteValue()); |
590,608 | public static void plotData(List<INDArray> xyVsIter, INDArray labels, double axisMin, double axisMax, int plotFrequency) {<NEW_LINE>JPanel panel = new ChartPanel(createChart(xyVsIter.get(0), labels, axisMin, axisMax));<NEW_LINE>JSlider slider = new JSlider(0, xyVsIter.size() - 1, 0);<NEW_LINE>slider.setSnapToTicks(true);<NEW_LINE>final JFrame f = new JFrame();<NEW_LINE>slider.addChangeListener(new ChangeListener() {<NEW_LINE><NEW_LINE>private JPanel lastPanel = panel;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void stateChanged(ChangeEvent e) {<NEW_LINE>JSlider slider = (JSlider) e.getSource();<NEW_LINE>int value = slider.getValue();<NEW_LINE>JPanel panel = new ChartPanel(createChart(xyVsIter.get(value), labels, axisMin, axisMax));<NEW_LINE>if (lastPanel != null) {<NEW_LINE>f.remove(lastPanel);<NEW_LINE>}<NEW_LINE>lastPanel = panel;<NEW_LINE>f.<MASK><NEW_LINE>f.setTitle(getTitle(value, plotFrequency));<NEW_LINE>f.revalidate();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>f.setLayout(new BorderLayout());<NEW_LINE>f.add(slider, BorderLayout.NORTH);<NEW_LINE>f.add(panel, BorderLayout.CENTER);<NEW_LINE>f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);<NEW_LINE>f.pack();<NEW_LINE>f.setTitle(getTitle(0, plotFrequency));<NEW_LINE>f.setVisible(true);<NEW_LINE>} | add(panel, BorderLayout.CENTER); |
1,664,566 | public void layoutContainer(Container target) {<NEW_LINE><MASK><NEW_LINE>int maxheight = target.getSize().height - (insets.top + insets.bottom + vgap * 2);<NEW_LINE>int maxwidth = target.getSize().width - (insets.left + insets.right + hgap * 2);<NEW_LINE>int nmembers = target.getComponentCount();<NEW_LINE>int x = insets.left + hgap;<NEW_LINE>int y = 0;<NEW_LINE>int colw = 0, start = 0;<NEW_LINE>for (int i = 0; i < nmembers; i++) {<NEW_LINE>Component m = target.getComponent(i);<NEW_LINE>if (m.isVisible()) {<NEW_LINE>Dimension d = m.getPreferredSize();<NEW_LINE>if ((this.vfill) && (i == (nmembers - 1))) {<NEW_LINE>d.height = Math.max((maxheight - y), d.height);<NEW_LINE>}<NEW_LINE>if (this.hfill) {<NEW_LINE>m.setSize(maxwidth, d.height);<NEW_LINE>d.width = maxwidth;<NEW_LINE>} else {<NEW_LINE>m.setSize(d.width, d.height);<NEW_LINE>}<NEW_LINE>if (y + d.height > maxheight) {<NEW_LINE>move(target, x, insets.top + vgap, colw, maxheight - y, start, i);<NEW_LINE>y = d.height;<NEW_LINE>x += hgap + colw;<NEW_LINE>colw = d.width;<NEW_LINE>start = i;<NEW_LINE>} else {<NEW_LINE>if (y > 0)<NEW_LINE>y += vgap;<NEW_LINE>y += d.height;<NEW_LINE>colw = Math.max(colw, d.width);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>move(target, x, insets.top + vgap, colw, maxheight - y, start, nmembers);<NEW_LINE>} | Insets insets = target.getInsets(); |
451,174 | private static ImageData processImage(ImageData image, int size) {<NEW_LINE>size = DPIUtil.autoScaleUp(size);<NEW_LINE>if (image.width >= image.height) {<NEW_LINE>if (image.width > size) {<NEW_LINE>return image.scaledTo(size, Math.max(1, (image.height * size) / image.width));<NEW_LINE>} else if (image.width < MIN_SIZE) {<NEW_LINE>return image.scaledTo(MIN_SIZE, Math.max(1, (image.height * MIN_SIZE) / image.width));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (image.height > size) {<NEW_LINE>return image.scaledTo(Math.max(1, (image.width * size) / image.height), size);<NEW_LINE>} else if (image.height < MIN_SIZE) {<NEW_LINE>return image.scaledTo(Math.max(1, (image.width * MIN_SIZE) <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return image;<NEW_LINE>} | / image.height), MIN_SIZE); |
1,430,908 | protected DaemonForkOptions toDaemonForkOptions(T spec) {<NEW_LINE>MinimalJavaCompilerDaemonForkOptions javaOptions = spec.getCompileOptions().getForkOptions();<NEW_LINE>MinimalScalaCompilerDaemonForkOptions scalaOptions = spec.getScalaCompileOptions().getForkOptions();<NEW_LINE>JavaForkOptions javaForkOptions = new BaseForkOptionsConverter(forkOptionsFactory).transform(mergeForkOptions(javaOptions, scalaOptions));<NEW_LINE>javaForkOptions.setWorkingDir(daemonWorkingDir);<NEW_LINE><MASK><NEW_LINE>if (javaExecutable != null) {<NEW_LINE>javaForkOptions.setExecutable(javaExecutable);<NEW_LINE>}<NEW_LINE>ClassPath compilerClasspath = classPathRegistry.getClassPath("SCALA-COMPILER").plus(DefaultClassPath.of(zincClasspath));<NEW_LINE>HierarchicalClassLoaderStructure classLoaderStructure = new HierarchicalClassLoaderStructure(classLoaderRegistry.getGradleWorkerExtensionSpec()).withChild(getScalaFilterSpec()).withChild(new VisitableURLClassLoader.Spec("compiler", compilerClasspath.getAsURLs()));<NEW_LINE>return new DaemonForkOptionsBuilder(forkOptionsFactory).javaForkOptions(javaForkOptions).withClassLoaderStructure(classLoaderStructure).keepAliveMode(KeepAliveMode.SESSION).build();<NEW_LINE>} | String javaExecutable = javaOptions.getExecutable(); |
1,554,415 | public void importData(ColumnList source, boolean keepVisibleColumns) {<NEW_LINE>for (ColumnImpl column : myColumns) {<NEW_LINE>if (keepVisibleColumns) {<NEW_LINE>Boolean visible = myTableHeaderFacade.findColumnByID(column.getID()).isVisible();<NEW_LINE>column.getStub().setVisible(visible);<NEW_LINE>} else {<NEW_LINE>column.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!importColumnList(source)) {<NEW_LINE>importColumnList(ColumnList.Immutable.fromList(myDefaultColumnStubs));<NEW_LINE>}<NEW_LINE>Collections.sort(myColumns, new Comparator<ColumnImpl>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(ColumnImpl left, ColumnImpl right) {<NEW_LINE>int test1 = (left.getStub().isVisible() ? -1 : 0) + (right.getStub().isVisible() ? 1 : 0);<NEW_LINE>if (test1 != 0) {<NEW_LINE>return test1;<NEW_LINE>}<NEW_LINE>if (!left.getStub().isVisible() && !right.getStub().isVisible() && left.getName() != null && right.getName() != null) {<NEW_LINE>// In fact, names can be null e.g. if resource key is missing<NEW_LINE>return left.getName().compareTo(right.getName());<NEW_LINE>}<NEW_LINE>if (left.getStub().getOrder() == right.getStub().getOrder()) {<NEW_LINE>return left.getStub().getID().compareTo(right.getStub().getID());<NEW_LINE>}<NEW_LINE>return left.getStub().getOrder() - right.getStub().getOrder();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>clearUiColumns();<NEW_LINE>for (ColumnImpl column : myColumns) {<NEW_LINE>if (column.getStub().isVisible()) {<NEW_LINE>insertColumnIntoUi(column);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getStub().setVisible(false); |
719,812 | // TODO revisit usage, eventually should be only reuse MavenProjectCache<NEW_LINE>@NonNull<NEW_LINE>public MavenProject loadMavenProject(MavenEmbedder embedder, List<String> activeProfiles, Properties properties) {<NEW_LINE>try {<NEW_LINE>MavenExecutionRequest req = embedder.createMavenExecutionRequest();<NEW_LINE>req.addActiveProfiles(activeProfiles);<NEW_LINE>req.setPom(projectFile);<NEW_LINE>req.setNoSnapshotUpdates(true);<NEW_LINE>req.setUpdateSnapshots(false);<NEW_LINE>// #238800 important to merge, not replace<NEW_LINE>if (properties != null) {<NEW_LINE>Properties uprops = req.getUserProperties();<NEW_LINE>uprops.putAll(properties);<NEW_LINE>req.setUserProperties(uprops);<NEW_LINE>}<NEW_LINE>// MEVENIDE-634 i'm wondering if this fixes the issue<NEW_LINE>req.setInteractiveMode(false);<NEW_LINE>req.setOffline(true);<NEW_LINE>// recursive == false is important to avoid checking all submodules for extensions<NEW_LINE>// that will not be used in current pom anyway..<NEW_LINE>// #135070<NEW_LINE>req.setRecursive(false);<NEW_LINE>MavenExecutionResult res = embedder.readProjectWithDependencies(req, true);<NEW_LINE>// #215159 clear the project building request, it references multiple Maven Models via the RepositorySession cache<NEW_LINE>// is not used in maven itself, most likely used by m2e only..<NEW_LINE>if (!res.hasExceptions()) {<NEW_LINE>res.getProject().setProjectBuildingRequest(null);<NEW_LINE>return res.getProject();<NEW_LINE>} else {<NEW_LINE>List<Throwable> exc = res.getExceptions();<NEW_LINE>for (Throwable ex : exc) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.log(Level.FINE, "Exception thrown while loading maven project at " + getProjectDirectory(), ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RuntimeException exc) {<NEW_LINE>// guard against exceptions that are not processed by the embedder<NEW_LINE>// #136184 NumberFormatException<NEW_LINE>// NOI18N<NEW_LINE>LOG.log(Level.INFO, <MASK><NEW_LINE>}<NEW_LINE>return MavenProjectCache.getFallbackProject(this.getPOMFile());<NEW_LINE>} | "Runtime exception thrown while loading maven project at " + getProjectDirectory(), exc); |
850,763 | public void PrintRegionData(int Label0, int Label1) {<NEW_LINE>if (Label0 < 0)<NEW_LINE>Label0 = 0;<NEW_LINE>if (Label1 > MaxLabel)<NEW_LINE>Label1 = MaxLabel;<NEW_LINE>if (Label1 < Label0)<NEW_LINE>return;<NEW_LINE>for (int Label = Label0; Label <= Label1; Label++) {<NEW_LINE>double[] Property = RegionData[Label];<NEW_LINE>int ThisLabel <MASK><NEW_LINE>int ThisParent = (int) Property[BLOBPARENT];<NEW_LINE>int ThisColor = (int) Property[BLOBCOLOR];<NEW_LINE>double ThisArea = Property[BLOBAREA];<NEW_LINE>double ThisPerimeter = Property[BLOBPERIMETER];<NEW_LINE>double ThisSumX = Property[BLOBSUMX];<NEW_LINE>double ThisSumY = Property[BLOBSUMY];<NEW_LINE>double ThisSumXX = Property[BLOBSUMXX];<NEW_LINE>double ThisSumYY = Property[BLOBSUMYY];<NEW_LINE>double ThisSumXY = Property[BLOBSUMXY];<NEW_LINE>int ThisMinX = (int) Property[BLOBMINX];<NEW_LINE>int ThisMaxX = (int) Property[BLOBMAXX];<NEW_LINE>int ThisMinY = (int) Property[BLOBMINY];<NEW_LINE>int ThisMaxY = (int) Property[BLOBMAXY];<NEW_LINE>String Str1 = " " + Label + ": L[" + ThisLabel + "] P[" + ThisParent + "] C[" + ThisColor + "]";<NEW_LINE>String Str2 = " AP[" + ThisArea + ", " + ThisPerimeter + "]";<NEW_LINE>String Str3 = " M1[" + ThisSumX + ", " + ThisSumY + "] M2[" + ThisSumXX + ", " + ThisSumYY + ", " + ThisSumXY + "]";<NEW_LINE>String Str4 = " MINMAX[" + ThisMinX + ", " + ThisMaxX + ", " + ThisMinY + ", " + ThisMaxY + "]";<NEW_LINE>String Str = Str1 + Str2 + Str3 + Str4;<NEW_LINE>System.out.println(Str);<NEW_LINE>}<NEW_LINE>System.out.println();<NEW_LINE>} | = (int) Property[BLOBLABEL]; |
933,645 | protected Object decode(Channel channel, SocketAddress remoteAddress, Object msg) throws Exception {<NEW_LINE>String sentence = (String) msg;<NEW_LINE>if (sentence.equals("AA55,HB")) {<NEW_LINE>if (channel != null) {<NEW_LINE>channel.writeAndFlush(new NetworkMessage("55AA,HB,OK\r\n", remoteAddress));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Parser parser = new Parser(PATTERN, (String) msg);<NEW_LINE>if (!parser.matches()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next());<NEW_LINE>if (deviceSession == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Position position = new Position(getProtocolName());<NEW_LINE>position.setDeviceId(deviceSession.getDeviceId());<NEW_LINE>position.setValid(true);<NEW_LINE>position.setTime(parser.nextDateTime());<NEW_LINE>position.setLatitude(parser.nextDouble());<NEW_LINE>position.setLongitude(parser.nextDouble());<NEW_LINE>position.setAltitude(parser.nextDouble(0));<NEW_LINE>position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble(0)));<NEW_LINE>position.setCourse(parser.nextDouble(0));<NEW_LINE>position.set(Position.KEY_INPUT, parser.nextBinInt());<NEW_LINE>position.set(Position.KEY_OUTPUT, parser.nextBinInt());<NEW_LINE>position.set(Position.KEY_BATTERY, parser.nextInt() * 0.001);<NEW_LINE>position.set(Position.PREFIX_ADC + 1, parser.nextInt() * 0.001);<NEW_LINE>position.set(Position.PREFIX_ADC + 2, <MASK><NEW_LINE>position.set(Position.KEY_DRIVER_UNIQUE_ID, parser.next());<NEW_LINE>return position;<NEW_LINE>} | parser.nextInt() * 0.001); |
1,652,357 | private NameEnvironmentAnswer findClassInternal(char[] typeName, String qualifiedPackageName, String qualifiedBinaryFileName, boolean asBinaryOnly) {<NEW_LINE>// most common case TODO(SHMOD): use module name from this.module?<NEW_LINE>if (!isPackage(qualifiedPackageName, null))<NEW_LINE>return null;<NEW_LINE>String fileName = new String(typeName);<NEW_LINE>boolean binaryExists = ((this.mode & BINARY) != 0) && doesFileExist(fileName + SUFFIX_STRING_class, qualifiedPackageName);<NEW_LINE>boolean sourceExists = ((this.mode & SOURCE) != 0) && <MASK><NEW_LINE>if (sourceExists && !asBinaryOnly) {<NEW_LINE>String fullSourcePath = this.path + qualifiedBinaryFileName.substring(0, qualifiedBinaryFileName.length() - 6) + SUFFIX_STRING_java;<NEW_LINE>CompilationUnit unit = new CompilationUnit(null, fullSourcePath, this.encoding, this.destinationPath);<NEW_LINE>unit.module = this.module == null ? null : this.module.name();<NEW_LINE>if (!binaryExists)<NEW_LINE>return new NameEnvironmentAnswer(unit, fetchAccessRestriction(qualifiedBinaryFileName));<NEW_LINE>String fullBinaryPath = this.path + qualifiedBinaryFileName;<NEW_LINE>long binaryModified = new File(fullBinaryPath).lastModified();<NEW_LINE>long sourceModified = new File(fullSourcePath).lastModified();<NEW_LINE>if (sourceModified > binaryModified)<NEW_LINE>return new NameEnvironmentAnswer(unit, fetchAccessRestriction(qualifiedBinaryFileName));<NEW_LINE>}<NEW_LINE>if (binaryExists) {<NEW_LINE>try {<NEW_LINE>ClassFileReader reader = ClassFileReader.read(this.path + qualifiedBinaryFileName);<NEW_LINE>// https://bugs.eclipse.org/bugs/show_bug.cgi?id=321115, package names are to be treated case sensitive.<NEW_LINE>String typeSearched = // $NON-NLS-1$<NEW_LINE>qualifiedPackageName.length() > 0 ? qualifiedPackageName.replace(File.separatorChar, '/') + "/" + fileName : fileName;<NEW_LINE>if (!CharOperation.equals(reader.getName(), typeSearched.toCharArray())) {<NEW_LINE>reader = null;<NEW_LINE>}<NEW_LINE>if (reader != null) {<NEW_LINE>char[] modName = reader.moduleName != null ? reader.moduleName : this.module != null ? this.module.name() : null;<NEW_LINE>return new NameEnvironmentAnswer(reader, fetchAccessRestriction(qualifiedBinaryFileName), modName);<NEW_LINE>}<NEW_LINE>} catch (IOException | ClassFormatException e) {<NEW_LINE>// treat as if file is missing<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | doesFileExist(fileName + SUFFIX_STRING_java, qualifiedPackageName); |
1,093,547 | public static ListDevicesResponse unmarshall(ListDevicesResponse listDevicesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listDevicesResponse.setRequestId(_ctx.stringValue("ListDevicesResponse.RequestId"));<NEW_LINE>listDevicesResponse.setErrorCode(_ctx.integerValue("ListDevicesResponse.ErrorCode"));<NEW_LINE>listDevicesResponse.setMessage<MASK><NEW_LINE>listDevicesResponse.setSuccess(_ctx.booleanValue("ListDevicesResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotal(_ctx.integerValue("ListDevicesResponse.Data.Total"));<NEW_LINE>data.setPageSize(_ctx.integerValue("ListDevicesResponse.Data.PageSize"));<NEW_LINE>data.setPageNumber(_ctx.integerValue("ListDevicesResponse.Data.PageNumber"));<NEW_LINE>List<Device> devices = new ArrayList<Device>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListDevicesResponse.Data.Devices.Length"); i++) {<NEW_LINE>Device device = new Device();<NEW_LINE>device.setActivationCode(_ctx.stringValue("ListDevicesResponse.Data.Devices[" + i + "].ActivationCode"));<NEW_LINE>device.setConferenceCode(_ctx.stringValue("ListDevicesResponse.Data.Devices[" + i + "].ConferenceCode"));<NEW_LINE>device.setConferenceName(_ctx.stringValue("ListDevicesResponse.Data.Devices[" + i + "].ConferenceName"));<NEW_LINE>device.setCreateTime(_ctx.stringValue("ListDevicesResponse.Data.Devices[" + i + "].CreateTime"));<NEW_LINE>device.setPictureUrl(_ctx.stringValue("ListDevicesResponse.Data.Devices[" + i + "].PictureUrl"));<NEW_LINE>device.setSN(_ctx.stringValue("ListDevicesResponse.Data.Devices[" + i + "].SN"));<NEW_LINE>device.setStatus(_ctx.stringValue("ListDevicesResponse.Data.Devices[" + i + "].Status"));<NEW_LINE>device.setCastScreenCode(_ctx.stringValue("ListDevicesResponse.Data.Devices[" + i + "].CastScreenCode"));<NEW_LINE>device.setStartUpPictureUrl(_ctx.stringValue("ListDevicesResponse.Data.Devices[" + i + "].StartUpPictureUrl"));<NEW_LINE>devices.add(device);<NEW_LINE>}<NEW_LINE>data.setDevices(devices);<NEW_LINE>listDevicesResponse.setData(data);<NEW_LINE>return listDevicesResponse;<NEW_LINE>} | (_ctx.stringValue("ListDevicesResponse.Message")); |
962,672 | public void propagate(InstanceState state) {<NEW_LINE>StateData oldData = (StateData) state.getData();<NEW_LINE>Value oldValue = oldData == null ? Value.NIL : oldData.curValue;<NEW_LINE>Value newValue = state.getPortValue(0);<NEW_LINE>boolean same = Objects.equals(oldValue, newValue);<NEW_LINE>if (!same) {<NEW_LINE>if (oldData == null) {<NEW_LINE>oldData = new StateData();<NEW_LINE>oldData.curValue = newValue;<NEW_LINE>state.setData(oldData);<NEW_LINE>} else {<NEW_LINE>oldData.curValue = newValue;<NEW_LINE>}<NEW_LINE>int oldWidth = oldValue == null ? 1 : oldValue.getBitWidth().getWidth();<NEW_LINE>int newWidth = newValue.getBitWidth().getWidth();<NEW_LINE>if (oldWidth != newWidth) {<NEW_LINE>ProbeAttributes attrs = (ProbeAttributes) state.getAttributeSet();<NEW_LINE>attrs.width = newValue.getBitWidth();<NEW_LINE>state<MASK><NEW_LINE>state.getInstance().computeLabelTextField(Instance.AVOID_LEFT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getInstance().recomputeBounds(); |
673,029 | static public void inner4(GrayF32 intensity, GrayS16 derivX, GrayS16 derivY, GrayF32 output) {<NEW_LINE>final int w = intensity.width;<NEW_LINE>final int h = intensity.height - 1;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(1,h,y->{<NEW_LINE>for (int y = 1; y < h; y++) {<NEW_LINE>int indexI = intensity.startIndex + y * intensity.stride + 1;<NEW_LINE>int indexX = derivX.startIndex <MASK><NEW_LINE>int indexY = derivY.startIndex + y * derivY.stride + 1;<NEW_LINE>int indexO = output.startIndex + y * output.stride + 1;<NEW_LINE>int end = indexI + w - 2;<NEW_LINE>for (; indexI < end; indexI++, indexX++, indexY++, indexO++) {<NEW_LINE>int dx, dy;<NEW_LINE>if (derivX.data[indexX] > 0)<NEW_LINE>dx = 1;<NEW_LINE>else<NEW_LINE>dx = -1;<NEW_LINE>if (derivY.data[indexY] > 0)<NEW_LINE>dy = 1;<NEW_LINE>else<NEW_LINE>dy = -1;<NEW_LINE>float middle = intensity.data[indexI];<NEW_LINE>// suppress the value if either of its neighboring values are more than or equal to it<NEW_LINE>if (intensity.data[indexI - dx - dy * intensity.stride] > middle || intensity.data[indexI + dx + dy * intensity.stride] > middle) {<NEW_LINE>output.data[indexO] = 0;<NEW_LINE>} else {<NEW_LINE>output.data[indexO] = middle;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>} | + y * derivX.stride + 1; |
505,303 | public Request<DisableVgwRoutePropagationRequest> marshall(DisableVgwRoutePropagationRequest disableVgwRoutePropagationRequest) {<NEW_LINE>if (disableVgwRoutePropagationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<DisableVgwRoutePropagationRequest> request = new DefaultRequest<MASK><NEW_LINE>request.addParameter("Action", "DisableVgwRoutePropagation");<NEW_LINE>request.addParameter("Version", "2016-11-15");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (disableVgwRoutePropagationRequest.getGatewayId() != null) {<NEW_LINE>request.addParameter("GatewayId", StringUtils.fromString(disableVgwRoutePropagationRequest.getGatewayId()));<NEW_LINE>}<NEW_LINE>if (disableVgwRoutePropagationRequest.getRouteTableId() != null) {<NEW_LINE>request.addParameter("RouteTableId", StringUtils.fromString(disableVgwRoutePropagationRequest.getRouteTableId()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | <DisableVgwRoutePropagationRequest>(disableVgwRoutePropagationRequest, "AmazonEC2"); |
387,827 | public Object compute(Object[] args, ExecutionContext ec) {<NEW_LINE>for (Object arg : args) {<NEW_LINE>if (FunctionUtils.isNull(arg)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// parse datetime<NEW_LINE>Object timeObj = args[0];<NEW_LINE>MysqlDateTime t = DataTypeUtil.toMySQLDatetimeByFlags(timeObj, <MASK><NEW_LINE>if (t == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// get week mode<NEW_LINE>int weekMode;<NEW_LINE>if (args.length == 1) {<NEW_LINE>weekMode = defaultWeekMode() > 0 ? defaultWeekMode() : 0;<NEW_LINE>} else {<NEW_LINE>weekMode = DataTypes.IntegerType.convertFrom(args[1]);<NEW_LINE>}<NEW_LINE>final int mode = MySQLTimeConverter.weekMode(weekMode);<NEW_LINE>// calc week<NEW_LINE>long[] ret = MySQLTimeConverter.datetimeToWeek(t, mode);<NEW_LINE>if (ret == null) {<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>return ret[0];<NEW_LINE>}<NEW_LINE>} | Types.TIMESTAMP, TimeParserFlags.FLAG_TIME_NO_ZERO_DATE); |
860,246 | public static List<GCList> searchBookmarkLists() {<NEW_LINE>final Parameters params = new Parameters();<NEW_LINE>params.add("skip", "0");<NEW_LINE>params.add("take", "100");<NEW_LINE>params.add("type", "bm");<NEW_LINE>final String page = GCLogin.getInstance().getRequestLogged("https://www.geocaching.com/api/proxy/web/v1/lists", params);<NEW_LINE>if (StringUtils.isBlank(page)) {<NEW_LINE>Log.e("GCParser.searchBookmarkLists: No data from server");<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final JsonNode json = JsonUtils.reader.readTree(page).get("data");<NEW_LINE>final List<GCList> list = new ArrayList<>();<NEW_LINE>for (Iterator<JsonNode> it = json.elements(); it.hasNext(); ) {<NEW_LINE>final JsonNode row = it.next();<NEW_LINE>final String name = row.get("name").asText();<NEW_LINE>final String guid = row.get("referenceCode").asText();<NEW_LINE>final int count = row.get("count").asInt();<NEW_LINE>Date date;<NEW_LINE>final String lastUpdateUtc = row.get("lastUpdateUtc").asText();<NEW_LINE>try {<NEW_LINE>date = DATE_JSON.parse(lastUpdateUtc);<NEW_LINE>} catch (ParseException e) {<NEW_LINE>// if parsing with fractions of seconds failed, try short form<NEW_LINE>date = DATE_JSON_SHORT.parse(lastUpdateUtc);<NEW_LINE>Log.d("parsing bookmark list: fallback needed for '" + lastUpdateUtc + "'");<NEW_LINE>}<NEW_LINE>final GCList pocketQuery = new GCList(guid, name, count, true, date.getTime(), -1, true);<NEW_LINE>list.add(pocketQuery);<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} catch (final Exception e) {<NEW_LINE><MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | Log.e("GCParser.searchBookmarkLists: error parsing html page", e); |
591,307 | private void invalidatePartitionCache(String databaseName, String tableName) {<NEW_LINE>HiveTableName hiveTableName = hiveTableName(databaseName, tableName);<NEW_LINE>partitionNamesCache.asMap().keySet().stream().filter(hiveTableNameKey -> hiveTableNameKey.getKey().equals(hiveTableName)).forEach(partitionNamesCache::invalidate);<NEW_LINE>partitionCache.asMap().keySet().stream().filter(partitionNameKey -> partitionNameKey.getKey().getHiveTableName().equals(hiveTableName)<MASK><NEW_LINE>partitionFilterCache.asMap().keySet().stream().filter(partitionFilterKey -> partitionFilterKey.getKey().getHiveTableName().equals(hiveTableName)).forEach(partitionFilterCache::invalidate);<NEW_LINE>partitionStatisticsCache.asMap().keySet().stream().filter(partitionFilterKey -> partitionFilterKey.getKey().getHiveTableName().equals(hiveTableName)).forEach(partitionStatisticsCache::invalidate);<NEW_LINE>} | ).forEach(partitionCache::invalidate); |
1,101,193 | public static void deserializeVector(ByteBuf buf, LongDoubleVector vector) {<NEW_LINE>int elemNum = buf.readInt();<NEW_LINE>StorageMethod method = getStorageMethod(vector);<NEW_LINE>SerializeArrangement arrangement = SerializeArrangement.valuesOf(buf.readInt());<NEW_LINE>if (arrangement == SerializeArrangement.KEY_VALUE) {<NEW_LINE>if (method == StorageMethod.SORTED) {<NEW_LINE>// If use sorted storage, we should get the array pair first<NEW_LINE>long[] indices = vector.getStorage().getIndices();<NEW_LINE>double[] values = vector.getStorage().getValues();<NEW_LINE>for (int i = 0; i < elemNum; i++) {<NEW_LINE>indices[i] = buf.readLong();<NEW_LINE>values[<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < elemNum; i++) {<NEW_LINE>vector.set(buf.readLong(), buf.readDouble());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (method == StorageMethod.SORTED) {<NEW_LINE>// If use sorted storage, we should get the array pair first<NEW_LINE>long[] indices = vector.getStorage().getIndices();<NEW_LINE>double[] values = vector.getStorage().getValues();<NEW_LINE>for (int i = 0; i < elemNum; i++) {<NEW_LINE>indices[i] = i;<NEW_LINE>values[i] = buf.readDouble();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < elemNum; i++) {<NEW_LINE>vector.set(i, buf.readDouble());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | i] = buf.readDouble(); |
412,850 | private String convertDescriptionList(DescriptionList node) {<NEW_LINE>logger.debug("convertDescriptionList");<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>appendTitle(node, sb);<NEW_LINE>String style = Optional.ofNullable(node.getStyle()).orElse("");<NEW_LINE>switch(style) {<NEW_LINE>case STYLE_HORIZONTAL:<NEW_LINE>sb.append(ATTRIBUTES_BEGIN).append(STYLE_HORIZONTAL).append(ATTRIBUTES_END).append(LINE_SEPARATOR);<NEW_LINE>node.getItems().forEach(item -> sb.append(convertDescriptionListEntry(item, node.getLevel(), false)));<NEW_LINE>break;<NEW_LINE>case STYLE_Q_AND_A:<NEW_LINE>sb.append(ATTRIBUTES_BEGIN).append(STYLE_Q_AND_A).append(ATTRIBUTES_END).append(LINE_SEPARATOR);<NEW_LINE>default:<NEW_LINE>node.getItems().forEach(item -> sb.append(convertDescriptionListEntry(item, node.<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>appendTrailingNewLine(sb);<NEW_LINE>return sb.toString();<NEW_LINE>} | getLevel(), true))); |
1,482,843 | public boolean markPresent(Map<Integer, Set<String>> paths, Instant lastScanned) {<NEW_LINE>if (!paths.isEmpty()) {<NEW_LINE>return paths.entrySet().parallelStream().map(e -> {<NEW_LINE>int batches = (e.getValue().<MASK><NEW_LINE>List<String> pList = new ArrayList<>(e.getValue());<NEW_LINE>return IntStream.rangeClosed(0, batches).parallel().map(b -> {<NEW_LINE>List<String> batch = pList.subList(b * 30000, Math.min(e.getValue().size(), b * 30000 + 30000));<NEW_LINE>return namedUpdate("update media_file set present=true, last_scanned = :lastScanned where path in (:paths) and folder_id=:folderId", ImmutableMap.of("lastScanned", lastScanned, "paths", batch, "folderId", e.getKey()));<NEW_LINE>}).sum() == e.getValue().size();<NEW_LINE>}).reduce(true, (a, b) -> a && b);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | size() - 1) / 30000; |
1,281,725 | public Suggestion<T> reduce(List<Suggestion<T>> toReduce) {<NEW_LINE>if (toReduce.size() == 1) {<NEW_LINE>return toReduce.get(0);<NEW_LINE>} else if (toReduce.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Suggestion<T> leader = toReduce.get(0);<NEW_LINE>List<T> entries = leader.entries;<NEW_LINE>final int size = entries.size();<NEW_LINE>Comparator<Option> sortComparator = sortComparator();<NEW_LINE>List<T> <MASK><NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>for (Suggestion<T> suggestion : toReduce) {<NEW_LINE>if (suggestion.entries.size() != size) {<NEW_LINE>throw new IllegalStateException("Can't merge suggest result, this might be caused by suggest calls " + "across multiple indices with different analysis chains. Suggest entries have different sizes actual [" + suggestion.entries.size() + "] expected [" + size + "]");<NEW_LINE>}<NEW_LINE>assert suggestion.name.equals(leader.name);<NEW_LINE>currentEntries.add(suggestion.entries.get(i));<NEW_LINE>}<NEW_LINE>T entry = (T) entries.get(i).reduce(currentEntries);<NEW_LINE>entry.sort(sortComparator);<NEW_LINE>entries.set(i, entry);<NEW_LINE>currentEntries.clear();<NEW_LINE>}<NEW_LINE>return leader;<NEW_LINE>} | currentEntries = new ArrayList<>(); |
1,168,383 | static Map<String, Object> parseFirebaseUser(FirebaseUser firebaseUser) {<NEW_LINE>if (firebaseUser == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Map<String, Object> output = new HashMap<>();<NEW_LINE>Map<String, Object> <MASK><NEW_LINE>output.put(Constants.DISPLAY_NAME, firebaseUser.getDisplayName());<NEW_LINE>output.put(Constants.EMAIL, firebaseUser.getEmail());<NEW_LINE>output.put(Constants.EMAIL_VERIFIED, firebaseUser.isEmailVerified());<NEW_LINE>output.put(Constants.IS_ANONYMOUS, firebaseUser.isAnonymous());<NEW_LINE>// TODO(Salakar): add an integration test to check for null, if possible<NEW_LINE>// See https://github.com/FirebaseExtended/flutterfire/issues/3643<NEW_LINE>final FirebaseUserMetadata userMetadata = firebaseUser.getMetadata();<NEW_LINE>if (userMetadata != null) {<NEW_LINE>metadata.put(Constants.CREATION_TIME, firebaseUser.getMetadata().getCreationTimestamp());<NEW_LINE>metadata.put(Constants.LAST_SIGN_IN_TIME, firebaseUser.getMetadata().getLastSignInTimestamp());<NEW_LINE>}<NEW_LINE>output.put(Constants.METADATA, metadata);<NEW_LINE>output.put(Constants.PHONE_NUMBER, firebaseUser.getPhoneNumber());<NEW_LINE>output.put(Constants.PHOTO_URL, parsePhotoUrl(firebaseUser.getPhotoUrl()));<NEW_LINE>output.put(Constants.PROVIDER_DATA, parseUserInfoList(firebaseUser.getProviderData()));<NEW_LINE>// native does not provide refresh tokens<NEW_LINE>output.put(Constants.REFRESH_TOKEN, "");<NEW_LINE>output.put(Constants.UID, firebaseUser.getUid());<NEW_LINE>output.put(Constants.TENANT_ID, firebaseUser.getTenantId());<NEW_LINE>return output;<NEW_LINE>} | metadata = new HashMap<>(); |
1,137,238 | private void writeModelAndElements(File file) throws IOException {<NEW_LINE>Writer writer = createOutputStreamWriter(file);<NEW_LINE>// Write BOM<NEW_LINE>writeBOM(writer);<NEW_LINE>// Write Header<NEW_LINE>String header = createHeader(MODEL_ELEMENTS_HEADER);<NEW_LINE>writer.write(header);<NEW_LINE>// CRLF<NEW_LINE>writer.write(CRLF);<NEW_LINE>// Write Model<NEW_LINE>String modelRow = createModelRow();<NEW_LINE>writer.write(modelRow);<NEW_LINE>// Write Elements<NEW_LINE>writeElementsInFolder(writer, fModel.getFolder(FolderType.STRATEGY));<NEW_LINE>writeElementsInFolder(writer, fModel.getFolder(FolderType.BUSINESS));<NEW_LINE>writeElementsInFolder(writer, fModel<MASK><NEW_LINE>writeElementsInFolder(writer, fModel.getFolder(FolderType.TECHNOLOGY));<NEW_LINE>writeElementsInFolder(writer, fModel.getFolder(FolderType.MOTIVATION));<NEW_LINE>writeElementsInFolder(writer, fModel.getFolder(FolderType.IMPLEMENTATION_MIGRATION));<NEW_LINE>writeElementsInFolder(writer, fModel.getFolder(FolderType.OTHER));<NEW_LINE>writer.close();<NEW_LINE>} | .getFolder(FolderType.APPLICATION)); |
792,560 | public HttpServiceResponse handle(HttpServiceRequest request) throws Exception {<NEW_LINE>HttpServiceResponse response = new HttpServiceResponse();<NEW_LINE>if (HttpServer.Method.PUT == request.getMethod()) {<NEW_LINE>bookieServer.getBookie().getLedgerStorage().forceGC();<NEW_LINE>String output = "Triggered GC on BookieServer: " + bookieServer.toString();<NEW_LINE>String jsonResponse = JsonUtil.toJson(output);<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>response.setBody(jsonResponse);<NEW_LINE>response.setCode(HttpServer.StatusCode.OK);<NEW_LINE>return response;<NEW_LINE>} else if (HttpServer.Method.GET == request.getMethod()) {<NEW_LINE>Boolean isInForceGC = bookieServer.getBookie().getLedgerStorage().isInForceGC();<NEW_LINE>Pair<String, String> output = Pair.of("is_in_force_gc", isInForceGC.toString());<NEW_LINE>String jsonResponse = JsonUtil.toJson(output);<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("output body:" + jsonResponse);<NEW_LINE>}<NEW_LINE>response.setBody(jsonResponse);<NEW_LINE>response.setCode(HttpServer.StatusCode.OK);<NEW_LINE>return response;<NEW_LINE>} else {<NEW_LINE>response.setCode(HttpServer.StatusCode.NOT_FOUND);<NEW_LINE>response.setBody("Not found method. Should be PUT to trigger GC, Or GET to get Force GC state.");<NEW_LINE>return response;<NEW_LINE>}<NEW_LINE>} | LOG.debug("output body:" + jsonResponse); |
1,509,724 | public Set<JwkDefinition> convert(InputStream jwkSetSource) {<NEW_LINE>Set<JwkDefinition> jwkDefinitions;<NEW_LINE>JsonParser parser = null;<NEW_LINE>try {<NEW_LINE>parser = this.factory.createParser(jwkSetSource);<NEW_LINE>if (parser.nextToken() != JsonToken.START_OBJECT) {<NEW_LINE>throw new JwkException("Invalid JWK Set Object.");<NEW_LINE>}<NEW_LINE>if (parser.nextToken() != JsonToken.FIELD_NAME) {<NEW_LINE>throw new JwkException("Invalid JWK Set Object.");<NEW_LINE>}<NEW_LINE>if (!parser.getCurrentName().equals(KEYS)) {<NEW_LINE>throw new JwkException("Invalid JWK Set Object. The JWK Set MUST have a " + KEYS + " attribute.");<NEW_LINE>}<NEW_LINE>if (parser.nextToken() != JsonToken.START_ARRAY) {<NEW_LINE>throw new JwkException("Invalid JWK Set Object. The JWK Set MUST have an array of JWK(s).");<NEW_LINE>}<NEW_LINE>jwkDefinitions <MASK><NEW_LINE>Map<String, String> attributes = new HashMap<String, String>();<NEW_LINE>while (parser.nextToken() == JsonToken.START_OBJECT) {<NEW_LINE>attributes.clear();<NEW_LINE>while (parser.nextToken() == JsonToken.FIELD_NAME) {<NEW_LINE>String attributeName = parser.getCurrentName();<NEW_LINE>// gh-1082 - skip arrays such as x5c as we can't deal with them yet<NEW_LINE>if (parser.nextToken() == JsonToken.START_ARRAY) {<NEW_LINE>while (parser.nextToken() != JsonToken.END_ARRAY) {<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>attributes.put(attributeName, parser.getValueAsString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// gh-1871 - only accept public key use (sig)<NEW_LINE>JwkDefinition.PublicKeyUse publicKeyUse = JwkDefinition.PublicKeyUse.fromValue(attributes.get(PUBLIC_KEY_USE));<NEW_LINE>if (!JwkDefinition.PublicKeyUse.SIG.equals(publicKeyUse)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>JwkDefinition jwkDefinition = null;<NEW_LINE>JwkDefinition.KeyType keyType = JwkDefinition.KeyType.fromValue(attributes.get(KEY_TYPE));<NEW_LINE>if (JwkDefinition.KeyType.RSA.equals(keyType)) {<NEW_LINE>jwkDefinition = this.createRsaJwkDefinition(attributes);<NEW_LINE>} else if (JwkDefinition.KeyType.EC.equals(keyType)) {<NEW_LINE>jwkDefinition = this.createEllipticCurveJwkDefinition(attributes);<NEW_LINE>}<NEW_LINE>if (jwkDefinition != null) {<NEW_LINE>if (!jwkDefinitions.add(jwkDefinition)) {<NEW_LINE>throw new JwkException("Duplicate JWK found in Set: " + jwkDefinition.getKeyId() + " (" + KEY_ID + ")");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new JwkException("An I/O error occurred while reading the JWK Set: " + ex.getMessage(), ex);<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>if (parser != null)<NEW_LINE>parser.close();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return jwkDefinitions;<NEW_LINE>} | = new LinkedHashSet<JwkDefinition>(); |
1,140,410 | public com.amazonaws.services.cloudsearchdomain.model.SearchException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.cloudsearchdomain.model.SearchException searchException = new com.amazonaws.services.cloudsearchdomain.model.SearchException(null);<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>} 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 searchException;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
1,527,545 | public com.amazonaws.services.datasync.model.InvalidRequestException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.datasync.model.InvalidRequestException invalidRequestException = new com.amazonaws.services.<MASK><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("errorCode", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>invalidRequestException.setErrorCode(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 invalidRequestException;<NEW_LINE>} | datasync.model.InvalidRequestException(null); |
1,516,988 | public static <S> TreeNode<S> lowestCommonAncestor(TreeNode<S> node1, TreeNode<S> node2) throws NodesNotInSameTreeException {<NEW_LINE>if (node1 == node2)<NEW_LINE>return node1;<NEW_LINE>else if (node1.depth < node2.depth)<NEW_LINE>return lowestCommonAncestor(node2, node1);<NEW_LINE>else if (node1.depth > node2.depth) {<NEW_LINE>int diff = node1.depth - node2.depth;<NEW_LINE>int jump = 0;<NEW_LINE>while (diff > 0) {<NEW_LINE>if (diff % 2 == 1)<NEW_LINE>node1 = node1.ancestors.get(jump);<NEW_LINE>jump++;<NEW_LINE>diff /= 2;<NEW_LINE>}<NEW_LINE>return lowestCommonAncestor(node1, node2);<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>int step = 0;<NEW_LINE>while (1 << (step + 1) <= node1.depth) step++;<NEW_LINE>while (step >= 0) {<NEW_LINE>if (step < node1.ancestors.size() && node1.ancestors.get(step) != node2.ancestors.get(step)) {<NEW_LINE>node1 = <MASK><NEW_LINE>node2 = node2.ancestors.get(step);<NEW_LINE>}<NEW_LINE>step--;<NEW_LINE>}<NEW_LINE>return node1.ancestors.get(0);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new NodesNotInSameTreeException();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | node1.ancestors.get(step); |
1,488,934 | public void updated(Provider<E> provider, E oldElement, E element) {<NEW_LINE>final <MASK><NEW_LINE>final K uid = element.getUID();<NEW_LINE>if (!uidOld.equals(uid)) {<NEW_LINE>logger.warn("Received update event for elements that UID differ (old: \"{}\", new: \"{}\"). Ignore event.", uidOld, uid);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final E existingElement;<NEW_LINE>elementWriteLock.lock();<NEW_LINE>try {<NEW_LINE>// The given "element" might not be the live instance but loaded from storage.<NEW_LINE>// Use the identifier to operate on the "real" element.<NEW_LINE>existingElement = identifierToElement.get(uid);<NEW_LINE>if (existingElement == null) {<NEW_LINE>logger.debug("Cannot update \"{}\" with key \"{}\" for provider \"{}\" because it does not exist!", element.getClass().getSimpleName(), uid, provider.getClass().getSimpleName());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>beforeUpdateElement(existingElement);<NEW_LINE>onUpdateElement(oldElement, element);<NEW_LINE>} catch (final RuntimeException ex) {<NEW_LINE>logger.warn("Cannot update \"{}\" with key \"{}\": {}", element.getClass().getSimpleName(), uid, ex.getMessage(), ex);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>identifierToElement.put(uid, element);<NEW_LINE>elementToProvider.remove(existingElement);<NEW_LINE>elementToProvider.put(element, provider);<NEW_LINE>final Collection<E> providerElements = providerToElements.get(provider);<NEW_LINE>providerElements.remove(existingElement);<NEW_LINE>providerElements.add(element);<NEW_LINE>elements.remove(existingElement);<NEW_LINE>elements.add(element);<NEW_LINE>} finally {<NEW_LINE>elementWriteLock.unlock();<NEW_LINE>}<NEW_LINE>notifyListenersAboutUpdatedElement(oldElement, element);<NEW_LINE>} | K uidOld = oldElement.getUID(); |
1,227,325 | /*<NEW_LINE>* @see<NEW_LINE>* com.sitewhere.connectors.FilteredOutboundConnector#start(com.sitewhere.spi.<NEW_LINE>* server.lifecycle.ILifecycleProgressMonitor)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void start(ILifecycleProgressMonitor monitor) throws SiteWhereException {<NEW_LINE>// Required for filters.<NEW_LINE>super.start(monitor);<NEW_LINE>if (getSolrConfiguration() == null) {<NEW_LINE>throw new SiteWhereException("No Solr configuration provided.");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// Create and start Solr connection.<NEW_LINE>this.solrConnection = new SolrConnection(getSolrConfiguration());<NEW_LINE>getSolrConnection().start(monitor);<NEW_LINE>getLogger().info("Attempting to ping Solr server to verify availability...");<NEW_LINE>SolrPingResponse response = getSolrConnection()<MASK><NEW_LINE>int pingTime = response.getQTime();<NEW_LINE>getLogger().info("Solr server location verified. Ping responded in " + pingTime + " ms.");<NEW_LINE>} catch (SolrServerException e) {<NEW_LINE>throw new SiteWhereException("Ping failed. Verify that Solr server is available.", e);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new SiteWhereException("Exception in ping. Verify that Solr server is available.", e);<NEW_LINE>}<NEW_LINE>getLogger().info("Solr event processor indexing events to server at: " + getSolrConfiguration().getSolrServerUrl());<NEW_LINE>executor.execute(new SolrDocumentQueueProcessor());<NEW_LINE>} | .getSolrClient().ping(); |
1,483,278 | private JMenu createSettingsMenu() {<NEW_LINE>JMenu settingsMenu = new JMenu();<NEW_LINE>settingsMenu.setName("settingsMenu");<NEW_LINE>settingsMenu.add(new JLabel("Device"));<NEW_LINE>deviceMenuItems = addRadioButtonMenuItems(settingsMenu, new String[] <MASK><NEW_LINE>settingsMenu.addSeparator();<NEW_LINE>settingsMenu.add(new JLabel("Plot Utility"));<NEW_LINE>if (fermiExists) {<NEW_LINE>addRadioButtonMenuItems(settingsMenu, new JRadioButtonMenuItem[] { fermiRadioButton, javaRadioButton, gnuplotRadioButton });<NEW_LINE>} else {<NEW_LINE>addRadioButtonMenuItems(settingsMenu, new JRadioButtonMenuItem[] { javaRadioButton, gnuplotRadioButton });<NEW_LINE>}<NEW_LINE>settingsMenu.addSeparator();<NEW_LINE>JMenu gnuplotTerminalMenu = new JMenu(getAction("selectGnuplotTerminal"));<NEW_LINE>getAction("selectGnuplotTerminal").setEnabled(false);<NEW_LINE>settingsMenu.add(gnuplotTerminalMenu);<NEW_LINE>gnuplotTerminalMenuItems = addRadioButtonMenuItems(gnuplotTerminalMenu, new String[] { "selectX11", "selectPSColor", "selectPSBW", "selectPNG", "selectEPS", "selectAQUA" });<NEW_LINE>return settingsMenu;<NEW_LINE>} | { "selectTerminalDevice", "selectPrinterDevice", "selectFileDevice" }); |
1,761,215 | private void createText(Composite container) {<NEW_LINE>StyledText text = new StyledText(container, SWT.MULTI | SWT.WRAP | SWT.READ_ONLY | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);<NEW_LINE>List<StyleRange> ranges = new ArrayList<>();<NEW_LINE>StringBuilder buffer = new StringBuilder();<NEW_LINE>if (newVersion.requiresNewJavaVersion()) {<NEW_LINE>StyleRange style = new StyleRange();<NEW_LINE>style.start = buffer.length();<NEW_LINE>style.length = Messages.MsgUpdateRequiresLatestJavaVersion.length();<NEW_LINE>style.foreground = Display.getDefault().getSystemColor(SWT.COLOR_RED);<NEW_LINE>style.fontStyle = SWT.BOLD;<NEW_LINE>ranges.add(style);<NEW_LINE>buffer.append(Messages.MsgUpdateRequiresLatestJavaVersion);<NEW_LINE>}<NEW_LINE>appendReleases(buffer, ranges);<NEW_LINE>text.<MASK><NEW_LINE>text.setStyleRanges(ranges.toArray(new StyleRange[0]));<NEW_LINE>GridDataFactory.fillDefaults().hint(convertHorizontalDLUsToPixels(400), convertVerticalDLUsToPixels(100)).applyTo(text);<NEW_LINE>} | setText(buffer.toString()); |
1,358,946 | private int forwardMedia(data.media.Media media, FlatBufferBuilder fbb) {<NEW_LINE>int uri = fbb.createString(media.uri);<NEW_LINE>int title = media.title != null ? fbb.<MASK><NEW_LINE>int format = fbb.createString(media.format);<NEW_LINE>int[] persons = new int[media.persons.size()];<NEW_LINE>for (int i = 0; i < media.persons.size(); i++) {<NEW_LINE>persons[i] = fbb.createString(media.persons.get(i));<NEW_LINE>}<NEW_LINE>int person = Media.createPersonsVector(fbb, persons);<NEW_LINE>byte player = forwardPlayer(media.player);<NEW_LINE>int copyright = media.copyright != null ? fbb.createString(media.copyright) : 0;<NEW_LINE>return Media.createMedia(fbb, uri, title, media.width, media.height, format, media.duration, media.size, media.bitrate, person, player, copyright);<NEW_LINE>} | createString(media.title) : 0; |
237,337 | private void createVerificationRunLine(@NonNull final InvoiceVerificationRunId runId, @NonNull final InvoiceVerificationRunResult runResult) {<NEW_LINE>final Tax invoiceTax = runResult.getInvoiceTax();<NEW_LINE>final Tax resultingTax = runResult.getResultingTax();<NEW_LINE>final boolean noTaxFound = resultingTax == null;<NEW_LINE>final TaxId resultingTaxId = noTaxFound ? taxDAO.retrieveNoTaxFoundId(Env.getCtx()) : resultingTax.getTaxId();<NEW_LINE>final boolean sameTax = invoiceTax.getTaxId().equals(resultingTaxId);<NEW_LINE>final boolean sameRate = !noTaxFound && invoiceTax.getRate().compareTo(<MASK><NEW_LINE>final boolean sameBoilerPlate = !noTaxFound && Objects.equals(invoiceTax.getBoilerPlateId(), resultingTax.getBoilerPlateId());<NEW_LINE>final I_C_Invoice_Verification_RunLine runLine = newInstance(I_C_Invoice_Verification_RunLine.class);<NEW_LINE>runLine.setC_Invoice_Verification_Run_ID(runId.getRepoId());<NEW_LINE>runLine.setC_Invoice_Verification_Set_ID(runId.getInvoiceVerificationSetId().getRepoId());<NEW_LINE>runLine.setC_Invoice_Verification_SetLine_ID(runResult.getSetLineId().getRepoId());<NEW_LINE>runLine.setAD_Org_ID(runResult.getOrgId().getRepoId());<NEW_LINE>runLine.setRun_Tax_ID(resultingTaxId.getRepoId());<NEW_LINE>runLine.setRun_Tax_Lookup_Log(runResult.getLog());<NEW_LINE>runLine.setIsTaxIdMatch(sameTax);<NEW_LINE>runLine.setIsTaxRateMatch(sameRate);<NEW_LINE>runLine.setIsTaxBoilerPlateMatch(sameBoilerPlate);<NEW_LINE>save(runLine);<NEW_LINE>} | resultingTax.getRate()) == 0; |
1,696,527 | private static Document createPatternXMLDoc(List<SsurgeonPattern> patterns) {<NEW_LINE>try {<NEW_LINE>DocumentBuilderFactory dbf = XMLUtils.safeDocumentBuilderFactory();<NEW_LINE>DocumentBuilder db = dbf.newDocumentBuilder();<NEW_LINE>Document domDoc = db.newDocument();<NEW_LINE>Element rootElt = domDoc.createElement(SsurgeonPattern.ELT_LIST_TAG);<NEW_LINE>domDoc.appendChild(rootElt);<NEW_LINE>int ordinal = 1;<NEW_LINE>for (SsurgeonPattern pattern : patterns) {<NEW_LINE>Element patElt = <MASK><NEW_LINE>patElt.setAttribute(SsurgeonPattern.ORDINAL_ATTR, String.valueOf(ordinal));<NEW_LINE>Element semgrexElt = domDoc.createElement(SsurgeonPattern.SEMGREX_ELEM_TAG);<NEW_LINE>semgrexElt.appendChild(domDoc.createTextNode(pattern.getSemgrexPattern().pattern()));<NEW_LINE>patElt.appendChild(semgrexElt);<NEW_LINE>Element uidElem = domDoc.createElement(SsurgeonPattern.UID_ELEM_TAG);<NEW_LINE>uidElem.appendChild(domDoc.createTextNode(pattern.getUID()));<NEW_LINE>patElt.appendChild(uidElem);<NEW_LINE>Element notesElem = domDoc.createElement(SsurgeonPattern.NOTES_ELEM_TAG);<NEW_LINE>notesElem.appendChild(domDoc.createTextNode(pattern.getNotes()));<NEW_LINE>patElt.appendChild(notesElem);<NEW_LINE>SemanticGraph semgrexGraph = pattern.getSemgrexGraph();<NEW_LINE>if (semgrexGraph != null) {<NEW_LINE>Element patNode = domDoc.createElement(SsurgeonPattern.SEMGREX_GRAPH_ELEM_TAG);<NEW_LINE>patNode.appendChild(domDoc.createTextNode(semgrexGraph.toCompactString()));<NEW_LINE>}<NEW_LINE>Element editList = domDoc.createElement(SsurgeonPattern.EDIT_LIST_ELEM_TAG);<NEW_LINE>patElt.appendChild(editList);<NEW_LINE>int editOrdinal = 1;<NEW_LINE>for (SsurgeonEdit edit : pattern.getEditScript()) {<NEW_LINE>Element editElem = domDoc.createElement(SsurgeonPattern.EDIT_ELEM_TAG);<NEW_LINE>editElem.setAttribute(SsurgeonPattern.ORDINAL_ATTR, String.valueOf(editOrdinal));<NEW_LINE>editElem.appendChild(domDoc.createTextNode(edit.toEditString()));<NEW_LINE>editList.appendChild(editElem);<NEW_LINE>editOrdinal++;<NEW_LINE>}<NEW_LINE>rootElt.appendChild(patElt);<NEW_LINE>ordinal++;<NEW_LINE>}<NEW_LINE>return domDoc;<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error(Ssurgeon.class.getName(), "createPatternXML");<NEW_LINE>log.error(e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | domDoc.createElement(SsurgeonPattern.SSURGEON_ELEM_TAG); |
1,845,560 | private void processSetting(Map<String, Object> map, String prefix, String setting, Object value) {<NEW_LINE>int <MASK><NEW_LINE>if (prefixLength == -1) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, Object> innerMap = (Map<String, Object>) map.get(prefix + setting);<NEW_LINE>if (innerMap != null) {<NEW_LINE>// It supposed to be a value, but we already have a map stored, need to convert this map to "." notation<NEW_LINE>for (Map.Entry<String, Object> entry : innerMap.entrySet()) {<NEW_LINE>map.put(prefix + setting + "." + entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>map.put(prefix + setting, value);<NEW_LINE>} else {<NEW_LINE>String key = setting.substring(0, prefixLength);<NEW_LINE>String rest = setting.substring(prefixLength + 1);<NEW_LINE>Object existingValue = map.get(prefix + key);<NEW_LINE>if (existingValue == null) {<NEW_LINE>Map<String, Object> newMap = new HashMap<>(2);<NEW_LINE>processSetting(newMap, "", rest, value);<NEW_LINE>map.put(prefix + key, newMap);<NEW_LINE>} else {<NEW_LINE>if (existingValue instanceof Map) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Map<String, Object> innerMap = (Map<String, Object>) existingValue;<NEW_LINE>processSetting(innerMap, "", rest, value);<NEW_LINE>map.put(prefix + key, innerMap);<NEW_LINE>} else {<NEW_LINE>// It supposed to be a map, but we already have a value stored, which is not a map<NEW_LINE>// fall back to "." notation<NEW_LINE>processSetting(map, prefix + key + ".", rest, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | prefixLength = setting.indexOf('.'); |
605,003 | final DeleteIdentityProviderResult executeDeleteIdentityProvider(DeleteIdentityProviderRequest deleteIdentityProviderRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteIdentityProviderRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteIdentityProviderRequest> request = null;<NEW_LINE>Response<DeleteIdentityProviderResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteIdentityProviderRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteIdentityProviderRequest));<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, "Cognito Identity Provider");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteIdentityProviderResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteIdentityProviderResultJsonUnmarshaller());<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.OPERATION_NAME, "DeleteIdentityProvider"); |
145,542 | public synchronized void treeExpanded(final TreeExpansionEvent event) {<NEW_LINE>final Node eventNode = Visualizer.findNode(event.<MASK><NEW_LINE>if (eventNode instanceof TableFilterNode) {<NEW_LINE>final TableFilterNode tableFilterNode = (TableFilterNode) eventNode;<NEW_LINE>final DataResultFilterNode dataResultFilterNode = tableFilterNode.getLookup().lookup(DataResultFilterNode.class);<NEW_LINE>if (dataResultFilterNode != null) {<NEW_LINE>final InstanceCountNode instanceCountNode = dataResultFilterNode.getLookup().lookup(InstanceCountNode.class);<NEW_LINE>if (instanceCountNode != null) {<NEW_LINE>instanceCountNode.createChildren();<NEW_LINE>}<NEW_LINE>final InstanceDataSourceNode instanceDataSourceNode = dataResultFilterNode.getLookup().lookup(InstanceDataSourceNode.class);<NEW_LINE>if (instanceDataSourceNode != null) {<NEW_LINE>instanceDataSourceNode.createChildren();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getPath().getLastPathComponent()); |
568,525 | final GetVpcLinksResult executeGetVpcLinks(GetVpcLinksRequest getVpcLinksRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getVpcLinksRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetVpcLinksRequest> request = null;<NEW_LINE>Response<GetVpcLinksResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetVpcLinksRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getVpcLinksRequest));<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(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ApiGatewayV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetVpcLinks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetVpcLinksResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetVpcLinksResultJsonUnmarshaller());<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.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
838,380 | private static Request prepareDeleteByQueryRequest(DeleteByQueryRequest deleteByQueryRequest, boolean waitForCompletion) throws IOException {<NEW_LINE>String endpoint = endpoint(deleteByQueryRequest.indices(), "_delete_by_query");<NEW_LINE>Request request = new Request(HttpPost.METHOD_NAME, endpoint);<NEW_LINE>Params params = new Params().withRouting(deleteByQueryRequest.getRouting()).withRefresh(deleteByQueryRequest.isRefresh()).withTimeout(deleteByQueryRequest.getTimeout()).withWaitForActiveShards(deleteByQueryRequest.getWaitForActiveShards()).withRequestsPerSecond(deleteByQueryRequest.getRequestsPerSecond()).withWaitForCompletion(waitForCompletion).withSlices(deleteByQueryRequest.getSlices());<NEW_LINE>if (SearchRequest.DEFAULT_INDICES_OPTIONS.equals(deleteByQueryRequest.indicesOptions()) == false) {<NEW_LINE>params = params.<MASK><NEW_LINE>}<NEW_LINE>if (deleteByQueryRequest.isAbortOnVersionConflict() == false) {<NEW_LINE>params.putParam("conflicts", "proceed");<NEW_LINE>}<NEW_LINE>if (deleteByQueryRequest.getBatchSize() != AbstractBulkByScrollRequest.DEFAULT_SCROLL_SIZE) {<NEW_LINE>params.putParam("scroll_size", Integer.toString(deleteByQueryRequest.getBatchSize()));<NEW_LINE>}<NEW_LINE>if (deleteByQueryRequest.getScrollTime() != AbstractBulkByScrollRequest.DEFAULT_SCROLL_TIMEOUT) {<NEW_LINE>params.putParam("scroll", deleteByQueryRequest.getScrollTime());<NEW_LINE>}<NEW_LINE>if (deleteByQueryRequest.getMaxDocs() > 0) {<NEW_LINE>params.putParam("max_docs", Integer.toString(deleteByQueryRequest.getMaxDocs()));<NEW_LINE>}<NEW_LINE>request.addParameters(params.asMap());<NEW_LINE>request.setEntity(createEntity(deleteByQueryRequest, REQUEST_BODY_CONTENT_TYPE));<NEW_LINE>return request;<NEW_LINE>} | withIndicesOptions(deleteByQueryRequest.indicesOptions()); |
748,620 | private Function<Signal<AccessToken>, Mono<? extends AccessToken>> processTokenRefreshResult(Sinks.One<AccessToken> sinksOne, OffsetDateTime now, Mono<AccessToken> fallback) {<NEW_LINE>return signal -> {<NEW_LINE>AccessToken accessToken = signal.get();<NEW_LINE>Throwable error = signal.getThrowable();<NEW_LINE>if (signal.isOnNext() && accessToken != null) {<NEW_LINE>// SUCCESS<NEW_LINE>logger.info(refreshLog<MASK><NEW_LINE>cache = accessToken;<NEW_LINE>sinksOne.tryEmitValue(accessToken);<NEW_LINE>nextTokenRefresh = OffsetDateTime.now().plus(REFRESH_DELAY);<NEW_LINE>return Mono.just(accessToken);<NEW_LINE>} else if (signal.isOnError() && error != null) {<NEW_LINE>// ERROR<NEW_LINE>logger.error(refreshLog(cache, now, "Failed to acquire a new access token"));<NEW_LINE>nextTokenRefresh = OffsetDateTime.now().plus(REFRESH_DELAY);<NEW_LINE>return fallback.switchIfEmpty(Mono.error(error));<NEW_LINE>} else {<NEW_LINE>// NO REFRESH<NEW_LINE>sinksOne.tryEmitEmpty();<NEW_LINE>return fallback;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | (cache, now, "Acquired a new access token")); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.