idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
51,805
public CodegenModel fromModel(String name, Schema model) {<NEW_LINE>CodegenModel cm = super.fromModel(name, model);<NEW_LINE>// TODO Check enum model handling<NEW_LINE>if (cm.interfaces == null) {<NEW_LINE>cm.interfaces = new ArrayList<String>();<NEW_LINE>}<NEW_LINE>Boolean hasDefaultValues = false;<NEW_LINE>// for (de)serializing properties renamed for Apex (e.g. reserved words)<NEW_LINE>List<Map<String, String>> propertyMappings = new ArrayList<>();<NEW_LINE>for (CodegenProperty p : cm.allVars) {<NEW_LINE>hasDefaultValues |= p.defaultValue != null;<NEW_LINE>if (!p.baseName.equals(p.name)) {<NEW_LINE>Map<String, String> mapping = new HashMap<>();<NEW_LINE>mapping.put("externalName", p.baseName);<NEW_LINE>mapping.put("internalName", p.name);<NEW_LINE>propertyMappings.add(mapping);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cm.vendorExtensions.put("x-has-property-mappings"<MASK><NEW_LINE>cm.vendorExtensions.put("x-has-default-values", hasDefaultValues);<NEW_LINE>cm.vendorExtensions.put("x-property-mappings", propertyMappings);<NEW_LINE>if (!propertyMappings.isEmpty()) {<NEW_LINE>cm.interfaces.add("OAS.MappedProperties");<NEW_LINE>}<NEW_LINE>return cm;<NEW_LINE>}
, !propertyMappings.isEmpty());
233,579
private Map<String, String> _createSymbolMap() {<NEW_LINE>Map<String, String> result = new HashMap<String, String>();<NEW_LINE>for (ULocale locale = rb.getULocale(); locale != null; locale = locale.getFallback()) {<NEW_LINE>ICUResourceBundle bundle = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_CURR_BASE_NAME, locale);<NEW_LINE>ICUResourceBundle curr = bundle.findTopLevel("Currencies");<NEW_LINE>if (curr == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < curr.getSize(); ++i) {<NEW_LINE>ICUResourceBundle item = curr.at(i);<NEW_LINE>String isoCode = item.getKey();<NEW_LINE>if (!result.containsKey(isoCode)) {<NEW_LINE>// put the code itself<NEW_LINE><MASK><NEW_LINE>// 0 == symbol element<NEW_LINE>String symbol = item.getString(0);<NEW_LINE>result.put(symbol, isoCode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Collections.unmodifiableMap(result);<NEW_LINE>}
result.put(isoCode, isoCode);
66,713
public Boolean update(ClusterRequest request, String operator) {<NEW_LINE>LOGGER.debug("begin to update inlong cluster: {}", request);<NEW_LINE>Preconditions.checkNotNull(request, "inlong cluster info cannot be empty");<NEW_LINE>Integer id = request.getId();<NEW_LINE>Preconditions.checkNotNull(id, "inlong cluster id cannot be empty");<NEW_LINE>// check whether the cluster already exists<NEW_LINE>String clusterTag = request.getClusterTags();<NEW_LINE>String name = request.getName();<NEW_LINE>String type = request.getType();<NEW_LINE>List<InlongClusterEntity> exist = clusterMapper.selectByKey(clusterTag, name, type);<NEW_LINE>if (CollectionUtils.isNotEmpty(exist) && !Objects.equals(id, exist.get(0).getId())) {<NEW_LINE>String errMsg = String.format("inlong cluster already exist for cluster tag=%s name=%s type=%s", clusterTag, name, type);<NEW_LINE>LOGGER.error(errMsg);<NEW_LINE>throw new BusinessException(errMsg);<NEW_LINE>}<NEW_LINE>InlongClusterEntity entity = clusterMapper.selectById(id);<NEW_LINE>if (entity == null) {<NEW_LINE>LOGGER.error("inlong cluster not found by id={}", id);<NEW_LINE>throw new BusinessException(ErrorCodeEnum.CLUSTER_NOT_FOUND);<NEW_LINE>}<NEW_LINE>if (!Objects.equals(entity.getVersion(), request.getVersion())) {<NEW_LINE>LOGGER.error("cluster has already updated with name={}, type={}, curVersion={}", request.getName(), request.getType(<MASK><NEW_LINE>throw new BusinessException(ErrorCodeEnum.CONFIG_EXPIRED);<NEW_LINE>}<NEW_LINE>UserEntity userEntity = userMapper.selectByName(operator);<NEW_LINE>boolean isInCharge = Preconditions.inSeparatedString(operator, entity.getInCharges(), InlongConstants.COMMA);<NEW_LINE>Preconditions.checkTrue(isInCharge || userEntity.getAccountType().equals(UserTypeEnum.ADMIN.getCode()), "Current user does not have permission to update cluster info");<NEW_LINE>InlongClusterOperator instance = clusterOperatorFactory.getInstance(request.getType());<NEW_LINE>instance.updateOpt(request, operator);<NEW_LINE>LOGGER.info("success to update inlong cluster: {} by {}", request, operator);<NEW_LINE>return true;<NEW_LINE>}
), request.getVersion());
607,342
private StatusDescriptionPair evaluateResourceStatus(String resourceName) {<NEW_LINE>IdealState idealState = getResourceIdealState(resourceName);<NEW_LINE>// If the resource has been removed or disabled, ignore it<NEW_LINE>if (idealState == null || !idealState.isEnabled()) {<NEW_LINE>return new StatusDescriptionPair(Status.GOOD, STATUS_DESCRIPTION_NONE);<NEW_LINE>}<NEW_LINE>T helixState = getState(resourceName);<NEW_LINE>if (helixState == null) {<NEW_LINE>return new StatusDescriptionPair(Status.STARTING, STATUS_DESCRIPTION_NO_HELIX_STATE);<NEW_LINE>}<NEW_LINE>// Check that all partitions that are supposed to be in any state other than OFFLINE have the same status in the<NEW_LINE>// external view or went to ERROR state (which means that we tried to load the segments/resources but failed for<NEW_LINE>// some reason)<NEW_LINE>Map<String, String> partitionStateMap = getPartitionStateMap(helixState);<NEW_LINE>for (String partitionName : idealState.getPartitionSet()) {<NEW_LINE>String idealStateStatus = idealState.getInstanceStateMap(partitionName).get(_instanceName);<NEW_LINE>// Skip this partition if it is not assigned to this instance or if the instance should be offline<NEW_LINE>if (idealStateStatus == null || "OFFLINE".equals(idealStateStatus)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// If the instance state is not ERROR and is not the same as what's expected from the ideal state, then it<NEW_LINE>// hasn't finished starting up<NEW_LINE>String currentStateStatus = partitionStateMap.get(partitionName);<NEW_LINE>if (!idealStateStatus.equals(currentStateStatus)) {<NEW_LINE>if ("ERROR".equals(currentStateStatus)) {<NEW_LINE>LOGGER.error(String.format<MASK><NEW_LINE>} else {<NEW_LINE>HelixProperty.Stat stat = helixState.getStat();<NEW_LINE>String description = String.format("partition=%s, expected=%s, found=%s, creationTime=%d, modifiedTime=%d, version=%d", partitionName, idealStateStatus, currentStateStatus, stat != null ? stat.getCreationTime() : -1, stat != null ? stat.getModifiedTime() : -1, stat != null ? stat.getVersion() : -1);<NEW_LINE>return new StatusDescriptionPair(Status.STARTING, description);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new StatusDescriptionPair(Status.GOOD, STATUS_DESCRIPTION_NONE);<NEW_LINE>}
("Resource: %s, partition: %s is in ERROR state", resourceName, partitionName));
1,590,598
final DetachInstancesResult executeDetachInstances(DetachInstancesRequest detachInstancesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(detachInstancesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DetachInstancesRequest> request = null;<NEW_LINE>Response<DetachInstancesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DetachInstancesRequestMarshaller().marshall(super.beforeMarshalling(detachInstancesRequest));<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, "Auto Scaling");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DetachInstances");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DetachInstancesResult> responseHandler = new StaxResponseHandler<DetachInstancesResult>(new DetachInstancesResultStaxUnmarshaller());<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());
1,050,222
public static ClientMessage encodeRequest(java.lang.String name, java.util.UUID txnId, long threadId, com.hazelcast.internal.serialization.Data predicate) {<NEW_LINE><MASK><NEW_LINE>clientMessage.setRetryable(false);<NEW_LINE>clientMessage.setOperationName("TransactionalMap.ValuesWithPredicate");<NEW_LINE>ClientMessage.Frame initialFrame = new ClientMessage.Frame(new byte[REQUEST_INITIAL_FRAME_SIZE], UNFRAGMENTED_MESSAGE);<NEW_LINE>encodeInt(initialFrame.content, TYPE_FIELD_OFFSET, REQUEST_MESSAGE_TYPE);<NEW_LINE>encodeInt(initialFrame.content, PARTITION_ID_FIELD_OFFSET, -1);<NEW_LINE>encodeUUID(initialFrame.content, REQUEST_TXN_ID_FIELD_OFFSET, txnId);<NEW_LINE>encodeLong(initialFrame.content, REQUEST_THREAD_ID_FIELD_OFFSET, threadId);<NEW_LINE>clientMessage.add(initialFrame);<NEW_LINE>StringCodec.encode(clientMessage, name);<NEW_LINE>DataCodec.encode(clientMessage, predicate);<NEW_LINE>return clientMessage;<NEW_LINE>}
ClientMessage clientMessage = ClientMessage.createForEncode();
1,770,656
/*<NEW_LINE>* Checks in a client.<NEW_LINE>*/<NEW_LINE>@FFDCIgnore(value = { InterruptedException.class })<NEW_LINE>public void checkinClient(Client client) {<NEW_LINE>boolean done = false;<NEW_LINE>// If no more space. Return. Shouldn't be checking more than we have. Shouldn't happen besides unit test anyways.<NEW_LINE>if (clients.remainingCapacity() == 0) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE>Tr.event(tc, "Checking in more clients than there should be.");<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>while (!done) {<NEW_LINE>try {<NEW_LINE>// check if this client was already checked-in.<NEW_LINE>if (!clients.contains(client)) {<NEW_LINE>clients.putFirst(client);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {<NEW_LINE>int clientHash = (client != null) ? client.hashCode() : 0;<NEW_LINE>Tr.event(tc, "post-checkin - (" + clientHash + ") " + (numClients - clients.remainingCapacity()<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>done = true;<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())<NEW_LINE>Tr.event(tc, "InterruptedException during checkin - will retry");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
) + " of " + numClients + " clients available.");
812,751
// DO NOT MODIFY THIS CODE, GENERATED AUTOMATICALLY<NEW_LINE>public static com.sun.jdi.ThreadReference thread(com.sun.jdi.event.ClassPrepareEvent a) throws org.netbeans.modules.debugger.jpda.jdi.InternalExceptionWrapper, org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallStart("com.sun.jdi.event.ClassPrepareEvent", "thread", "JDI CALL: com.sun.jdi.event.ClassPrepareEvent({0}).thread()", new Object[] { a });<NEW_LINE>}<NEW_LINE>Object retValue = null;<NEW_LINE>try {<NEW_LINE>com.sun.jdi.ThreadReference ret;<NEW_LINE>ret = a.thread();<NEW_LINE>retValue = ret;<NEW_LINE>return ret;<NEW_LINE>} catch (com.sun.jdi.InternalException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.report(ex);<NEW_LINE>throw new org.netbeans.modules.debugger.<MASK><NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException ex) {<NEW_LINE>retValue = ex;<NEW_LINE>if (a instanceof com.sun.jdi.Mirror) {<NEW_LINE>com.sun.jdi.VirtualMachine vm = ((com.sun.jdi.Mirror) a).virtualMachine();<NEW_LINE>try {<NEW_LINE>vm.dispose();<NEW_LINE>} catch (com.sun.jdi.VMDisconnectedException vmdex) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper(ex);<NEW_LINE>} catch (Error err) {<NEW_LINE>retValue = err;<NEW_LINE>throw err;<NEW_LINE>} catch (RuntimeException rex) {<NEW_LINE>retValue = rex;<NEW_LINE>throw rex;<NEW_LINE>} finally {<NEW_LINE>if (org.netbeans.modules.debugger.jpda.JDIExceptionReporter.isLoggable()) {<NEW_LINE>org.netbeans.modules.debugger.jpda.JDIExceptionReporter.logCallEnd("com.sun.jdi.event.ClassPrepareEvent", "thread", retValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
jpda.jdi.InternalExceptionWrapper(ex);
1,490,532
protected void verifyProcessInstanceStartUser(TaskRepresentation taskRepresentation, TaskInfo task) {<NEW_LINE>if (task.getProcessInstanceId() != null) {<NEW_LINE>HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(task.getProcessInstanceId()).singleResult();<NEW_LINE>if (historicProcessInstance != null && StringUtils.isNotEmpty(historicProcessInstance.getStartUserId())) {<NEW_LINE>taskRepresentation.setProcessInstanceStartUserId(historicProcessInstance.getStartUserId());<NEW_LINE>BpmnModel bpmnModel = repositoryService.getBpmnModel(task.getProcessDefinitionId());<NEW_LINE>FlowElement flowElement = bpmnModel.getFlowElement(task.getTaskDefinitionKey());<NEW_LINE>if (flowElement instanceof UserTask) {<NEW_LINE>UserTask userTask = (UserTask) flowElement;<NEW_LINE>List<ExtensionElement> extensionElements = userTask.<MASK><NEW_LINE>if (CollectionUtils.isNotEmpty(extensionElements)) {<NEW_LINE>String value = extensionElements.get(0).getElementText();<NEW_LINE>if (StringUtils.isNotEmpty(value)) {<NEW_LINE>taskRepresentation.setInitiatorCanCompleteTask(Boolean.valueOf(value));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getExtensionElements().get("initiator-can-complete");
721,320
public CloseableIterator<Element> iterator() {<NEW_LINE>Stream<Element> elements = Streams.toStream(getElements.getInput()).flatMap(elementId -> GetElementsUtil.getRelevantElements(mapImpl, elementId, getElements.getView(), getElements.getDirectedType(), getElements.getIncludeIncomingOutGoing(), getElements.getSeedMatching()).stream()).distinct();<NEW_LINE>elements = elements.flatMap(e -> Streams.toStream(mapImpl.getElements(e)));<NEW_LINE>if (this.supportsVisibility) {<NEW_LINE>elements = GetElementsUtil.applyVisibilityFilter(elements, schema, user);<NEW_LINE>}<NEW_LINE>elements = elements.map(element -> mapImpl.cloneElement(element, schema));<NEW_LINE>elements = GetElementsUtil.applyView(elements, schema, getElements.getView());<NEW_LINE>elements = elements.map(element -> {<NEW_LINE>ViewUtil.removeProperties(getElements.getView(), element);<NEW_LINE>return element;<NEW_LINE>});<NEW_LINE>return new WrappedCloseableIterator<<MASK><NEW_LINE>}
>(elements.iterator());
1,072,849
public static Object[] fromTensor(Tensor<?> tensor) {<NEW_LINE>Preconditions.checkArgument(tensor.shape().numDimensions() == 1, "Can only convert tensors with shape long[]");<NEW_LINE>final int size = (int) tensor.shape().size(0);<NEW_LINE>Object[] res = new Object[size];<NEW_LINE>if (TInt32.DTYPE.equals(tensor.dataType())) {<NEW_LINE>int[] data = StdArrays.array1dCopyOf((IntNdArray) tensor.data());<NEW_LINE>for (int i = 0; i < size; i += 1) {<NEW_LINE>res[i] = data[i];<NEW_LINE>}<NEW_LINE>} else if (TFloat32.DTYPE.equals(tensor.dataType())) {<NEW_LINE>float[] data = StdArrays.array1dCopyOf((FloatNdArray) tensor.data());<NEW_LINE>for (int i = 0; i < size; i += 1) {<NEW_LINE>res[i] = data[i];<NEW_LINE>}<NEW_LINE>} else if (TInt64.DTYPE.equals(tensor.dataType())) {<NEW_LINE>long[] data = StdArrays.array1dCopyOf((LongNdArray) tensor.data());<NEW_LINE>for (int i = 0; i < size; i += 1) {<NEW_LINE>res<MASK><NEW_LINE>}<NEW_LINE>} else if (TFloat64.DTYPE.equals(tensor.dataType())) {<NEW_LINE>double[] data = StdArrays.array1dCopyOf((DoubleNdArray) tensor.data());<NEW_LINE>for (int i = 0; i < size; i += 1) {<NEW_LINE>res[i] = data[i];<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException("Type can't be converted from tensor: " + tensor.dataType().name());<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}
[i] = data[i];
393,204
public static void showMarker(IMarker marker, String viewId, IWorkbenchPart source) {<NEW_LINE>IWorkbenchPage page = PlatformUI.getWorkbench()<MASK><NEW_LINE>IViewPart view = page.findView(viewId);<NEW_LINE>if (!page.isPartVisible(view)) {<NEW_LINE>try {<NEW_LINE>view = page.showView(viewId);<NEW_LINE>} catch (PartInitException e) {<NEW_LINE>FindbugsPlugin.getDefault().logException(e, "Could not open view: " + viewId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (view instanceof IMarkerSelectionHandler) {<NEW_LINE>IMarkerSelectionHandler handler = (IMarkerSelectionHandler) view;<NEW_LINE>handler.markerSelected(source, marker);<NEW_LINE>} else if (DETAILS_VIEW_ID.equals(viewId) && view instanceof ISelectionListener) {<NEW_LINE>ISelectionListener listener = (ISelectionListener) view;<NEW_LINE>listener.selectionChanged(source, new StructuredSelection(marker));<NEW_LINE>}<NEW_LINE>}
.getActiveWorkbenchWindow().getActivePage();
720,971
private void checkAggregation(Map<VariableReferenceExpression, Aggregation> aggregations) {<NEW_LINE>for (Map.Entry<VariableReferenceExpression, Aggregation> entry : aggregations.entrySet()) {<NEW_LINE>VariableReferenceExpression variable = entry.getKey();<NEW_LINE>Aggregation aggregation = entry.getValue();<NEW_LINE>FunctionMetadata functionMetadata = metadata.getFunctionAndTypeManager().getFunctionMetadata(aggregation.getFunctionHandle());<NEW_LINE>verifyTypeSignature(variable, functionMetadata.getReturnType());<NEW_LINE>verifyTypeSignature(variable, aggregation.getCall().getType().getTypeSignature());<NEW_LINE>int argumentSize = aggregation.getArguments().size();<NEW_LINE>int expectedArgumentSize = functionMetadata.getArgumentTypes().size();<NEW_LINE>checkArgument(argumentSize == expectedArgumentSize, "Number of arguments is different from function signature: expected %s but got %s", expectedArgumentSize, argumentSize);<NEW_LINE>List<TypeSignature> argumentTypes = aggregation.getArguments().stream().map(argument -> isExpression(argument) ? UNKNOWN.getTypeSignature() : argument.getType().getTypeSignature()<MASK><NEW_LINE>for (int i = 0; i < functionMetadata.getArgumentTypes().size(); i++) {<NEW_LINE>TypeSignature expected = functionMetadata.getArgumentTypes().get(i);<NEW_LINE>TypeSignature actual = argumentTypes.get(i);<NEW_LINE>FunctionAndTypeManager typeManager = metadata.getFunctionAndTypeManager();<NEW_LINE>if (!actual.equals(UNKNOWN.getTypeSignature()) && !typeManager.isTypeOnlyCoercion(typeManager.getType(actual), typeManager.getType(expected))) {<NEW_LINE>checkArgument(expected.equals(actual), "Expected input types are %s but getting %s", functionMetadata.getArgumentTypes(), argumentTypes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).collect(toImmutableList());
394,883
public static void run(Process process) {<NEW_LINE>try {<NEW_LINE>LOG.info("Starting {}.", process);<NEW_LINE>LOG.info("Alluxio version: {}-{}", RuntimeConstants.VERSION, ProjectConstants.REVISION);<NEW_LINE>LOG.info("Java version: {}", System.getProperty("java.version"));<NEW_LINE>process.start();<NEW_LINE>LOG.info("Stopping {}.", process);<NEW_LINE>System.exit(0);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>LOG.error("Uncaught exception while running {}, stopping it and exiting. " + "Exception \"{}\", Root Cause \"{}\"", process, t, Throwables<MASK><NEW_LINE>try {<NEW_LINE>process.stop();<NEW_LINE>} catch (Throwable t2) {<NEW_LINE>// continue to exit<NEW_LINE>LOG.error("Uncaught exception while stopping {}, simply exiting. " + "Exception \"{}\", Root Cause \"{}\"", process, t2, Throwables.getRootCause(t2), t2);<NEW_LINE>}<NEW_LINE>System.exit(-1);<NEW_LINE>}<NEW_LINE>}
.getRootCause(t), t);
1,562,431
protected void finishPage(final IProgressMonitor monitor) throws CoreException, InterruptedException {<NEW_LINE>PageOne pageOne = (PageOne) getPage(PageOne.PAGE_NAME);<NEW_LINE>PageTwo pageTwo = (PageTwo) getPage(PageTwo.PAGE_NAME);<NEW_LINE>GroovyTypeBuilder builder = new GroovyTypeBuilder();<NEW_LINE>builder.setPackageFragmentRoot(pageOne.getPackageFragmentRoot());<NEW_LINE>builder.setPackageFragment(pageOne.getPackageFragment());<NEW_LINE>builder.setEnclosingType(pageOne.getEnclosingType());<NEW_LINE>builder.setAddComments(pageTwo.isAddComments());<NEW_LINE>builder.setTypeFlags(pageTwo.getModifiers());<NEW_LINE>builder.setTypeKind(pageTwo.getTypeKind());<NEW_LINE>builder.setTypeName(pageOne.getTypeName());<NEW_LINE>builder.setSuper(pageTwo.getSuperClass());<NEW_LINE>builder.setFaces(pageTwo.getInterfaces());<NEW_LINE>SelectionButtonDialogFieldGroup stubs = (SelectionButtonDialogFieldGroup) pageTwo.getActiveControl().getData("StubControls");<NEW_LINE>if (stubs != null) {<NEW_LINE>IDialogSettings dialogSettings = getDialogSettings();<NEW_LINE>if (dialogSettings != null) {<NEW_LINE>final String sectionName = "NewClassWizardPage";<NEW_LINE>IDialogSettings sectionSettings = dialogSettings.getSection(sectionName);<NEW_LINE>if (sectionSettings == null)<NEW_LINE>sectionSettings = dialogSettings.addNewSection(sectionName);<NEW_LINE>sectionSettings.put("create_constructor", stubs.isSelected(0));<NEW_LINE>sectionSettings.put("create_unimplemented", stubs.isSelected(1));<NEW_LINE>// main method checkbox is not persistent as per https://bugs.eclipse.org/388342<NEW_LINE>}<NEW_LINE>builder.setStubs(stubs.isSelected(0), stubs.isSelected(1), stubs.isSelected(2));<NEW_LINE>}<NEW_LINE>fCreatedType = builder.<MASK><NEW_LINE>}
build(monitor, this::finishType);
58,309
private static BiFunction<Query, Version, Result> phraseQuery() {<NEW_LINE>return (query, version) -> {<NEW_LINE>Term[] terms = ((PhraseQuery) query).getTerms();<NEW_LINE>if (terms.length == 0) {<NEW_LINE>return new Result(true, <MASK><NEW_LINE>}<NEW_LINE>if (version.onOrAfter(Version.V_6_1_0)) {<NEW_LINE>Set<QueryExtraction> extractions = Arrays.stream(terms).map(QueryExtraction::new).collect(toSet());<NEW_LINE>return new Result(false, extractions, extractions.size());<NEW_LINE>} else {<NEW_LINE>// the longest term is likely to be the rarest,<NEW_LINE>// so from a performance perspective it makes sense to extract that<NEW_LINE>Term longestTerm = terms[0];<NEW_LINE>for (Term term : terms) {<NEW_LINE>if (longestTerm.bytes().length < term.bytes().length) {<NEW_LINE>longestTerm = term;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new Result(false, Collections.singleton(new QueryExtraction(longestTerm)), 1);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
Collections.emptySet(), 0);
456,941
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_animation_diff_utils);<NEW_LINE>findViewById(R.id.add).setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>addItems();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>findViewById(R.id.remove).setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>removeItems();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>findViewById(R.id.update).setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>updateItems();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>findViewById(R.id.move).setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>moveItems();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);<NEW_LINE>ItemAdapterDelegate itemAdapterDelegate = new ItemAdapterDelegate(getLayoutInflater());<NEW_LINE>AdapterDelegatesManager<List<Item>> adapterDelegatesManager = new AdapterDelegatesManager<>();<NEW_LINE>adapterDelegatesManager.addDelegate(itemAdapterDelegate);<NEW_LINE>adapter = new ListDelegationAdapter<<MASK><NEW_LINE>recyclerView.setLayoutManager(new LinearLayoutManager(this));<NEW_LINE>recyclerView.setAdapter(adapter);<NEW_LINE>adapter.setItems(itemProvider.getCurrentList());<NEW_LINE>adapter.notifyDataSetChanged();<NEW_LINE>}
List<Item>>(adapterDelegatesManager);
1,476,093
private void handle(RequestHeader requestHeader, ByteBuf in, ChannelHandlerContext ctx) {<NEW_LINE>ResponseData responseData = null;<NEW_LINE>ResponseHeader responseHeader;<NEW_LINE>ServerState state = runningContext.getState();<NEW_LINE>// LOG.info("Request header = " + requestHeader);<NEW_LINE>if (state == ServerState.BUSY) {<NEW_LINE>responseHeader = new ResponseHeader(requestHeader.seqId, requestHeader.methodId, ServerState.BUSY, ResponseType.SERVER_IS_BUSY, "server is busy now, retry later");<NEW_LINE>} else {<NEW_LINE>// Idle, handle the request<NEW_LINE>// Parse head success<NEW_LINE>Handler handler = methodIdToHandler.get(requestHeader.methodId);<NEW_LINE>// Handle request<NEW_LINE>if (handler != null) {<NEW_LINE>try {<NEW_LINE>ByteBufSerdeUtils.deserializeBoolean(in);<NEW_LINE>RequestData request = handler.parseRequest(in);<NEW_LINE>requestSize.addAndGet(request.requestSize);<NEW_LINE>responseData = handler.handle(requestHeader, request);<NEW_LINE>requestSize.addAndGet(responseData.bufferLen());<NEW_LINE>responseHeader = new ResponseHeader(requestHeader.seqId, requestHeader.methodId, state, ResponseType.SUCCESS);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>// Handle error, generate response<NEW_LINE>responseHeader = new ResponseHeader(requestHeader.seqId, requestHeader.methodId, state, ResponseType.SERVER_HANDLE_FAILED, StringUtils.stringifyException(e));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>responseHeader = new ResponseHeader(requestHeader.seqId, requestHeader.methodId, state, ResponseType.UNSUPPORT_REQUEST);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Release the input buffer<NEW_LINE>ByteBufUtils.releaseBuf(in);<NEW_LINE>// Create response<NEW_LINE>Response response = new Response(responseHeader, responseData);<NEW_LINE>// LOG.info("Response header = " + responseHeader);<NEW_LINE>// Serialize the response<NEW_LINE>// 2. Serialize the response<NEW_LINE>ByteBuf out = ByteBufUtils.serializeResponse(response, context.isUseDirectBuffer());<NEW_LINE>// Send the serialized response<NEW_LINE>if (out != null) {<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>runningContext.after(requestHeader.clientId, requestHeader.seqId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}
sendResult(requestHeader, ctx, out);
83,802
public static Shape createDiagonalCross(float l, float t) {<NEW_LINE><MASK><NEW_LINE>p0.moveTo(-l - t, -l + t);<NEW_LINE>p0.lineTo(-l + t, -l - t);<NEW_LINE>p0.lineTo(0.0f, -t * SQRT2);<NEW_LINE>p0.lineTo(l - t, -l - t);<NEW_LINE>p0.lineTo(l + t, -l + t);<NEW_LINE>p0.lineTo(t * SQRT2, 0.0f);<NEW_LINE>p0.lineTo(l + t, l - t);<NEW_LINE>p0.lineTo(l - t, l + t);<NEW_LINE>p0.lineTo(0.0f, t * SQRT2);<NEW_LINE>p0.lineTo(-l + t, l + t);<NEW_LINE>p0.lineTo(-l - t, l - t);<NEW_LINE>p0.lineTo(-t * SQRT2, 0.0f);<NEW_LINE>p0.closePath();<NEW_LINE>return p0;<NEW_LINE>}
final GeneralPath p0 = new GeneralPath();
259,114
private void printOpenJPAConfiguration(final Object config, final PrintWriter out, final String indent) {<NEW_LINE>out.<MASK><NEW_LINE>if (config == null || indent == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (config != null) {<NEW_LINE>// ClassLoader<NEW_LINE>out.println(indent + " ._appCL = " + reflectObjValue(config, "_appCL"));<NEW_LINE>// Dump all config options exposed by getter methods<NEW_LINE>final List<Method> getMethods = getMethodsWithPrefix(config.getClass(), "get");<NEW_LINE>int nullValCount = 0;<NEW_LINE>for (Method m : getMethods) {<NEW_LINE>try {<NEW_LINE>final Object val = reflectMethodCall(config, m);<NEW_LINE>if (val == null) {<NEW_LINE>nullValCount++;<NEW_LINE>} else {<NEW_LINE>out.print(indent + " ." + m.getName().substring(3) + " = ");<NEW_LINE>out.println(poa(val, indent + " ", true));<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>out.println(indent + " . problem calling " + m.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.println(indent + " # of get methods = " + getMethods.size());<NEW_LINE>// 500+ average null values which we don't need to see<NEW_LINE>out.println(indent + " # of null properties = " + nullValCount);<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>}<NEW_LINE>}
println(indent + "OpenJPA Configuration = " + config);
151,974
protected void drawGuiContainerForegroundLayer(PoseStack transform, int mouseX, int mouseY, float partialTick) {<NEW_LINE>this.font.draw(transform, new TranslatableComponent(Lib.GUI_CONFIG + "redstone_color_sending").getString(), guiLeft, guiTop, DyeColor.WHITE.getTextColor());<NEW_LINE>this.font.draw(transform, new TranslatableComponent(Lib.GUI_CONFIG + "redstone_color_receiving").getString(), guiLeft + 116, guiTop, DyeColor.WHITE.getTextColor());<NEW_LINE>ArrayList<Component> tooltip = new ArrayList<>();<NEW_LINE>for (int i = 0; i < colorButtonsSend.length; i++) if (colorButtonsSend[i].isHovered() || colorButtonsReceive[i].isHovered()) {<NEW_LINE>tooltip.add(new TranslatableComponent<MASK><NEW_LINE>tooltip.add(TextUtils.applyFormat(new TranslatableComponent("color.minecraft." + DyeColor.byId(i).getName()), ChatFormatting.GRAY));<NEW_LINE>}<NEW_LINE>if (!tooltip.isEmpty())<NEW_LINE>GuiUtils.drawHoveringText(transform, tooltip, mouseX, mouseY, width, height, -1, font);<NEW_LINE>}
(Lib.GUI_CONFIG + "redstone_color"));
641,875
public void onInputSizeChanged(final int width, final int height) {<NEW_LINE>super.onInputSizeChanged(width, height);<NEW_LINE>int size = filters.size();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>filters.get(i<MASK><NEW_LINE>}<NEW_LINE>if (frameBuffers != null && (frameWidth != width || frameHeight != height || frameBuffers.length != size - 1)) {<NEW_LINE>destroyFramebuffers();<NEW_LINE>frameWidth = width;<NEW_LINE>frameHeight = height;<NEW_LINE>}<NEW_LINE>if (frameBuffers == null) {<NEW_LINE>frameBuffers = new int[size - 1];<NEW_LINE>frameBufferTextures = new int[size - 1];<NEW_LINE>for (int i = 0; i < size - 1; i++) {<NEW_LINE>GLES20.glGenFramebuffers(1, frameBuffers, i);<NEW_LINE>GLES20.glGenTextures(1, frameBufferTextures, i);<NEW_LINE>GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, frameBufferTextures[i]);<NEW_LINE>GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);<NEW_LINE>GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);<NEW_LINE>GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);<NEW_LINE>GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);<NEW_LINE>GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);<NEW_LINE>GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, frameBuffers[i]);<NEW_LINE>GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, frameBufferTextures[i], 0);<NEW_LINE>GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);<NEW_LINE>GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).onInputSizeChanged(width, height);
1,512,991
void enableLionFS() {<NEW_LINE>try {<NEW_LINE>String version = System.getProperty("os.version");<NEW_LINE>int firstDot = version.indexOf('.');<NEW_LINE>int lastDot = version.lastIndexOf('.');<NEW_LINE>if (lastDot > firstDot && lastDot >= 0) {<NEW_LINE>version = version.substring(0, version.indexOf('.', firstDot + 1));<NEW_LINE>}<NEW_LINE>double <MASK><NEW_LINE>if (v < 10.7)<NEW_LINE>throw new Exception("Operating system version is " + v);<NEW_LINE>Class fsuClass = Class.forName("com.apple.eawt.FullScreenUtilities");<NEW_LINE>Class[] argClasses = new Class[] { Window.class, Boolean.TYPE };<NEW_LINE>Method setWindowCanFullScreen = fsuClass.getMethod("setWindowCanFullScreen", argClasses);<NEW_LINE>setWindowCanFullScreen.invoke(fsuClass, this, true);<NEW_LINE>canDoLionFS = true;<NEW_LINE>} catch (Exception e) {<NEW_LINE>vlog.debug("Could not enable OS X 10.7+ full-screen mode: " + e.getMessage());<NEW_LINE>}<NEW_LINE>}
v = Double.parseDouble(version);
1,380,584
public boolean onPreferenceChange(Preference preference, Object newValue) {<NEW_LINE>if (MyDebug.LOG)<NEW_LINE>Log.d(TAG, "clicked raw: " + newValue);<NEW_LINE>if (newValue.equals("preference_raw_yes")) {<NEW_LINE>// we check done_raw_info every time, so that this works if the user selects RAW<NEW_LINE>// again without leaving and returning to Settings<NEW_LINE>boolean done_raw_info = sharedPreferences.contains(PreferenceKeys.getRawInfoPreferenceKey());<NEW_LINE>if (!done_raw_info) {<NEW_LINE>AlertDialog.Builder alertDialog = new AlertDialog.Builder(MyPreferenceFragment.this.getActivity());<NEW_LINE>alertDialog.setTitle(R.string.preference_raw);<NEW_LINE>alertDialog.setMessage(R.string.raw_info);<NEW_LINE>alertDialog.setPositiveButton(android.R.string.ok, null);<NEW_LINE>alertDialog.setNegativeButton(R.string.dont_show_again, new OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(DialogInterface dialog, int which) {<NEW_LINE>if (MyDebug.LOG)<NEW_LINE>Log.d(TAG, "user clicked dont_show_again for raw info dialog");<NEW_LINE>SharedPreferences.<MASK><NEW_LINE>editor.putBoolean(PreferenceKeys.getRawInfoPreferenceKey(), true);<NEW_LINE>editor.apply();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>alertDialog.show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
Editor editor = sharedPreferences.edit();
1,737,489
public DoubleArray findRoot(Function<DoubleArray, DoubleArray> function, Function<DoubleArray, DoubleMatrix> jacobianFunction, DoubleArray startPosition) {<NEW_LINE>DataBundle data = new DataBundle();<NEW_LINE>DoubleArray <MASK><NEW_LINE>data.setX(startPosition);<NEW_LINE>data.setY(y);<NEW_LINE>data.setG0(_algebra.getInnerProduct(y, y));<NEW_LINE>DoubleMatrix estimate = _initializationFunction.getInitializedMatrix(jacobianFunction, startPosition);<NEW_LINE>if (!getNextPosition(function, estimate, data)) {<NEW_LINE>if (isConverged(data)) {<NEW_LINE>// this can happen if the starting position is the root<NEW_LINE>return data.getX();<NEW_LINE>}<NEW_LINE>throw new MathException("Cannot work with this starting position. Please choose another point");<NEW_LINE>}<NEW_LINE>int count = 0;<NEW_LINE>int jacReconCount = 1;<NEW_LINE>while (!isConverged(data)) {<NEW_LINE>// Want to reset the Jacobian every so often even if backtracking is working<NEW_LINE>if ((jacReconCount) % FULL_RECALC_FREQ == 0) {<NEW_LINE>estimate = _initializationFunction.getInitializedMatrix(jacobianFunction, data.getX());<NEW_LINE>jacReconCount = 1;<NEW_LINE>} else {<NEW_LINE>estimate = _updateFunction.getUpdatedMatrix(jacobianFunction, data.getX(), data.getDeltaX(), data.getDeltaY(), estimate);<NEW_LINE>jacReconCount++;<NEW_LINE>}<NEW_LINE>// if backtracking fails, could be that Jacobian estimate has drifted too far<NEW_LINE>if (!getNextPosition(function, estimate, data)) {<NEW_LINE>estimate = _initializationFunction.getInitializedMatrix(jacobianFunction, data.getX());<NEW_LINE>jacReconCount = 1;<NEW_LINE>if (!getNextPosition(function, estimate, data)) {<NEW_LINE>if (isConverged(data)) {<NEW_LINE>// non-standard exit. Cannot find an improvement from this position,<NEW_LINE>// so provided we are close enough to the root, exit.<NEW_LINE>return data.getX();<NEW_LINE>}<NEW_LINE>String msg = "Failed to converge in backtracking, even after a Jacobian recalculation." + getErrorMessage(data, jacobianFunction);<NEW_LINE>log.info(msg);<NEW_LINE>throw new MathException(msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>count++;<NEW_LINE>if (count > _maxSteps) {<NEW_LINE>throw new MathException("Failed to converge - maximum iterations of " + _maxSteps + " reached." + getErrorMessage(data, jacobianFunction));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return data.getX();<NEW_LINE>}
y = checkInputsAndApplyFunction(function, startPosition);
255,307
public ActionResult<Wo> call() throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Work work = emc.find(workId, Work.class);<NEW_LINE>emc.beginTransaction(DocumentVersion.class);<NEW_LINE>DocumentVersion documentVersion = new DocumentVersion();<NEW_LINE>documentVersion.setActivity(work.getActivity());<NEW_LINE>documentVersion.setActivityAlias(work.getActivityAlias());<NEW_LINE>documentVersion.setActivityDescription(work.getActivityDescription());<NEW_LINE>documentVersion.setActivityName(work.getActivityName());<NEW_LINE>documentVersion.setActivityToken(work.getActivityToken());<NEW_LINE>documentVersion.setActivityType(work.getActivityType());<NEW_LINE>documentVersion.<MASK><NEW_LINE>documentVersion.setData(wi.getData());<NEW_LINE>documentVersion.setPerson(wi.getPerson());<NEW_LINE>documentVersion.setCompleted(false);<NEW_LINE>documentVersion.setJob(work.getJob());<NEW_LINE>documentVersion.setApplication(work.getApplication());<NEW_LINE>documentVersion.setProcess(work.getProcess());<NEW_LINE>emc.persist(documentVersion, CheckPersistType.all);<NEW_LINE>emc.commit();<NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(documentVersion.getId());<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
setCategory(wi.getCategory());
1,326,938
public void run(MessageReply reply) {<NEW_LINE>if (reply.isSuccess()) {<NEW_LINE>NfsPrimaryStorageAgentResponse rsp = ((KVMHostAsyncHttpCallReply) reply).toResponse(NfsPrimaryStorageAgentResponse.class);<NEW_LINE>if (rsp.isSuccess()) {<NEW_LINE>nfsFactory.updateNfsHostStatus(psInv.getUuid(), huuid, PrimaryStorageHostStatus.Connected);<NEW_LINE>} else {<NEW_LINE>ErrorCode err = operr("failed to ping nfs primary storage[uuid:%s] from host[uuid:%s],because %s. " + "disconnect this host-ps connection", psInv.getUuid(), huuid, reply.isSuccess() ? rsp.getError() : reply.getError());<NEW_LINE>errs.add(err);<NEW_LINE>nfsFactory.updateNfsHostStatus(psInv.getUuid(), huuid, PrimaryStorageHostStatus.Disconnected, () -> sendWarnning(huuid, psInv));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>errs.<MASK><NEW_LINE>}<NEW_LINE>compl.done();<NEW_LINE>}
add(reply.getError());
1,815,613
public Void visitNewClass(NewClassTree tree, Void p) {<NEW_LINE>defaultAction(tree);<NEW_LINE>if (tree.getEnclosingExpression() != null) {<NEW_LINE>tree.getEnclosingExpression(<MASK><NEW_LINE>}<NEW_LINE>tree.getIdentifier().accept(this, p);<NEW_LINE>for (Tree typeArgument : tree.getTypeArguments()) {<NEW_LINE>typeArgument.accept(this, p);<NEW_LINE>}<NEW_LINE>for (Tree arg : tree.getTypeArguments()) {<NEW_LINE>arg.accept(this, p);<NEW_LINE>}<NEW_LINE>if (tree.getClassBody() == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Anonymous class bodies require special handling. There isn't a corresponding JavaParser<NEW_LINE>// node, and synthetic constructors must be skipped.<NEW_LINE>ClassTree body = tree.getClassBody();<NEW_LINE>scan(body.getModifiers(), p);<NEW_LINE>scan(body.getTypeParameters(), p);<NEW_LINE>scan(body.getImplementsClause(), p);<NEW_LINE>for (Tree member : body.getMembers()) {<NEW_LINE>// Constructors cannot be declared in an anonymous class, so don't add them.<NEW_LINE>if (member.getKind() == Tree.Kind.METHOD) {<NEW_LINE>MethodTree methodTree = (MethodTree) member;<NEW_LINE>if (methodTree.getName().contentEquals("<init>")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>member.accept(this, p);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
).accept(this, p);
837,322
public static GetAppApiByPageResponse unmarshall(GetAppApiByPageResponse getAppApiByPageResponse, UnmarshallerContext _ctx) {<NEW_LINE>getAppApiByPageResponse.setRequestId(_ctx.stringValue("GetAppApiByPageResponse.RequestId"));<NEW_LINE>getAppApiByPageResponse.setCode(_ctx.integerValue("GetAppApiByPageResponse.Code"));<NEW_LINE>getAppApiByPageResponse.setMessage(_ctx.stringValue("GetAppApiByPageResponse.Message"));<NEW_LINE>getAppApiByPageResponse.setSuccess(_ctx.booleanValue("GetAppApiByPageResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageSize<MASK><NEW_LINE>data.setTotal(_ctx.stringValue("GetAppApiByPageResponse.Data.Total"));<NEW_LINE>data.setPage(_ctx.integerValue("GetAppApiByPageResponse.Data.Page"));<NEW_LINE>List<Map<Object, Object>> items = _ctx.listMapValue("GetAppApiByPageResponse.Data.Items");<NEW_LINE>data.setItems(items);<NEW_LINE>getAppApiByPageResponse.setData(data);<NEW_LINE>return getAppApiByPageResponse;<NEW_LINE>}
(_ctx.integerValue("GetAppApiByPageResponse.Data.PageSize"));
674,388
public static GetUserInstanceResponse unmarshall(GetUserInstanceResponse getUserInstanceResponse, UnmarshallerContext context) {<NEW_LINE>getUserInstanceResponse.setRequestId(context.stringValue("GetUserInstanceResponse.RequestId"));<NEW_LINE>getUserInstanceResponse.setCode(context.integerValue("GetUserInstanceResponse.Code"));<NEW_LINE>getUserInstanceResponse.setMessage(context.stringValue("GetUserInstanceResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotal(context.integerValue("GetUserInstanceResponse.Data.Total"));<NEW_LINE>List<Instance> detail = new ArrayList<Instance>();<NEW_LINE>for (int i = 0; i < context.lengthValue("GetUserInstanceResponse.Data.Detail.Length"); i++) {<NEW_LINE>Instance instance = new Instance();<NEW_LINE>instance.setProject(context.stringValue("GetUserInstanceResponse.Data.Detail[" + i + "].Project"));<NEW_LINE>instance.setInstanceId(context.stringValue("GetUserInstanceResponse.Data.Detail[" + i + "].InstanceId"));<NEW_LINE>instance.setStatus(context.stringValue("GetUserInstanceResponse.Data.Detail[" + i + "].Status"));<NEW_LINE>instance.setUserAccount(context.stringValue("GetUserInstanceResponse.Data.Detail[" + i + "].UserAccount"));<NEW_LINE>instance.setNickName(context.stringValue("GetUserInstanceResponse.Data.Detail[" + i + "].NickName"));<NEW_LINE>instance.setCluster(context.stringValue("GetUserInstanceResponse.Data.Detail[" + i + "].Cluster"));<NEW_LINE>instance.setRunTime(context.stringValue("GetUserInstanceResponse.Data.Detail[" + i + "].RunTime"));<NEW_LINE>instance.setCpuUsed(context.longValue("GetUserInstanceResponse.Data.Detail[" + i + "].CpuUsed"));<NEW_LINE>instance.setCpuRequest(context.longValue("GetUserInstanceResponse.Data.Detail[" + i + "].CpuRequest"));<NEW_LINE>instance.setCpuUsedTotal(context.longValue("GetUserInstanceResponse.Data.Detail[" + i + "].CpuUsedTotal"));<NEW_LINE>instance.setCpuUsedRatioMax(context.floatValue("GetUserInstanceResponse.Data.Detail[" + i + "].CpuUsedRatioMax"));<NEW_LINE>instance.setCpuUsedRatioMin(context.floatValue("GetUserInstanceResponse.Data.Detail[" + i + "].CpuUsedRatioMin"));<NEW_LINE>instance.setMemUsed(context.longValue("GetUserInstanceResponse.Data.Detail[" + i + "].MemUsed"));<NEW_LINE>instance.setMemRequest(context.longValue("GetUserInstanceResponse.Data.Detail[" + i + "].MemRequest"));<NEW_LINE>instance.setMemUsedTotal(context.longValue("GetUserInstanceResponse.Data.Detail[" + i + "].MemUsedTotal"));<NEW_LINE>instance.setMemUsedRatioMax(context.floatValue("GetUserInstanceResponse.Data.Detail[" + i + "].MemUsedRatioMax"));<NEW_LINE>instance.setMemUsedRatioMin(context.floatValue("GetUserInstanceResponse.Data.Detail[" + i + "].MemUsedRatioMin"));<NEW_LINE>instance.setTaskType(context.stringValue("GetUserInstanceResponse.Data.Detail[" + i + "].TaskType"));<NEW_LINE>instance.setSkynetId(context.stringValue("GetUserInstanceResponse.Data.Detail[" + i + "].SkynetId"));<NEW_LINE>instance.setQuotaName(context.stringValue<MASK><NEW_LINE>instance.setQuotaId(context.integerValue("GetUserInstanceResponse.Data.Detail[" + i + "].QuotaId"));<NEW_LINE>detail.add(instance);<NEW_LINE>}<NEW_LINE>data.setDetail(detail);<NEW_LINE>getUserInstanceResponse.setData(data);<NEW_LINE>return getUserInstanceResponse;<NEW_LINE>}
("GetUserInstanceResponse.Data.Detail[" + i + "].QuotaName"));
1,603,106
public ByteBuffer asByteBuffer() {<NEW_LINE>int spsPpsSize = 0;<NEW_LINE>for (ByteBuffer bytes : avcC.getSequenceParameterSets()) {<NEW_LINE>spsPpsSize += len + bytes.limit();<NEW_LINE>}<NEW_LINE>for (ByteBuffer bytes : avcC.getSequenceParameterSetExts()) {<NEW_LINE>spsPpsSize += len + bytes.limit();<NEW_LINE>}<NEW_LINE>for (ByteBuffer bytes : avcC.getPictureParameterSets()) {<NEW_LINE>spsPpsSize += len + bytes.limit();<NEW_LINE>}<NEW_LINE>ByteBuffer data = ByteBuffer.allocate(l2i(orignalSample.getSize()) + spsPpsSize);<NEW_LINE>for (ByteBuffer bytes : avcC.getSequenceParameterSets()) {<NEW_LINE>IsoTypeWriterVariable.write(bytes.<MASK><NEW_LINE>data.put(bytes);<NEW_LINE>}<NEW_LINE>for (ByteBuffer bytes : avcC.getSequenceParameterSetExts()) {<NEW_LINE>IsoTypeWriterVariable.write(bytes.limit(), data, len);<NEW_LINE>data.put(bytes);<NEW_LINE>}<NEW_LINE>for (ByteBuffer bytes : avcC.getPictureParameterSets()) {<NEW_LINE>IsoTypeWriterVariable.write(bytes.limit(), data, len);<NEW_LINE>data.put(bytes);<NEW_LINE>}<NEW_LINE>data.put(orignalSample.asByteBuffer());<NEW_LINE>return (ByteBuffer) ((Buffer) data).rewind();<NEW_LINE>}
limit(), data, len);
1,432,520
public ListBackendEnvironmentsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListBackendEnvironmentsResult listBackendEnvironmentsResult = new ListBackendEnvironmentsResult();<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 listBackendEnvironmentsResult;<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("backendEnvironments", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listBackendEnvironmentsResult.setBackendEnvironments(new ListUnmarshaller<BackendEnvironment>(BackendEnvironmentJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listBackendEnvironmentsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return listBackendEnvironmentsResult;<NEW_LINE>}
)).unmarshall(context));
637,423
public static void init() {<NEW_LINE>BlockManager blockManager = MinecraftServer.getBlockManager();<NEW_LINE>blockManager.registerBlockPlacementRule(new RedstonePlacementRule());<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.BONE_BLOCK));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.HAY_BLOCK));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.OAK_LOG));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.SPRUCE_LOG));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.BIRCH_LOG));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.JUNGLE_LOG));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.ACACIA_LOG));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.DARK_OAK_LOG));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.CRIMSON_STEM));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.WARPED_STEM));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.STRIPPED_OAK_LOG));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.STRIPPED_SPRUCE_LOG));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.STRIPPED_BIRCH_LOG));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.STRIPPED_JUNGLE_LOG));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.STRIPPED_ACACIA_LOG));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.STRIPPED_DARK_OAK_LOG));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.STRIPPED_CRIMSON_STEM));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.STRIPPED_WARPED_STEM));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.PURPUR_PILLAR));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.QUARTZ_PILLAR));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.OAK_WOOD));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.SPRUCE_WOOD));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.BIRCH_WOOD));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.JUNGLE_WOOD));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.ACACIA_WOOD));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.DARK_OAK_WOOD));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.CRIMSON_STEM));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.WARPED_STEM));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.STRIPPED_OAK_WOOD));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.STRIPPED_SPRUCE_WOOD));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.STRIPPED_BIRCH_WOOD));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.STRIPPED_JUNGLE_WOOD));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.STRIPPED_ACACIA_WOOD));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.STRIPPED_DARK_OAK_WOOD));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.STRIPPED_CRIMSON_STEM));<NEW_LINE>blockManager.registerBlockPlacementRule(new AxisPlacementRule(Block.STRIPPED_WARPED_STEM));<NEW_LINE>blockManager.registerBlockPlacementRule(new WallPlacementRule(Block.COBBLESTONE_WALL));<NEW_LINE>blockManager.registerBlockPlacementRule(<MASK><NEW_LINE>}
new WallPlacementRule(Block.MOSSY_COBBLESTONE_WALL));
281,764
private void appendRandomLong(StringBuilder buffer, CodegenOperation op, CodegenVariable var) {<NEW_LINE>if (!appendRandomEnum(buffer, op, var)) {<NEW_LINE>// NOTE: use BigDecimal to hold long values, to avoid numeric overflow.<NEW_LINE>BigDecimal min = new BigDecimal(var == null || var.minimum == null ? Long.MIN_VALUE : Long.parseLong(var.minimum));<NEW_LINE>BigDecimal max = new BigDecimal(var == null || var.maximum == null ? Long.MAX_VALUE : Long.parseLong(var.maximum));<NEW_LINE>BigDecimal exclusiveMin = new BigDecimal(var != null && <MASK><NEW_LINE>BigDecimal inclusiveMax = new BigDecimal(var == null || !var.exclusiveMaximum ? 1 : 0);<NEW_LINE>long randomLong = min.add(exclusiveMin).add(max.add(inclusiveMax).subtract(min).subtract(exclusiveMin).multiply(BigDecimal.valueOf(Math.random()))).longValue();<NEW_LINE>if (loadTestDataFromFile) {<NEW_LINE>if (var != null) {<NEW_LINE>var.addTestData(randomLong);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>buffer.append(randomLong).append('L');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
var.exclusiveMinimum ? 1 : 0);
733,142
protected Control createDialogArea(Composite parent) {<NEW_LINE>Composite parentComposite = (Composite) super.createDialogArea(parent);<NEW_LINE>Composite composite = new Composite(parentComposite, SWT.NULL);<NEW_LINE>GridLayout layout = new GridLayout();<NEW_LINE>layout.marginHeight = 10;<NEW_LINE>layout.marginWidth = 10;<NEW_LINE>layout.numColumns = 2;<NEW_LINE>layout.makeColumnsEqualWidth = false;<NEW_LINE>composite.setLayout(layout);<NEW_LINE>composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());<NEW_LINE>extensionsList = new TreeViewer(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);<NEW_LINE>stylers = new Stylers(extensionsList.getTree().getFont());<NEW_LINE>extensionsList.getTree().addDisposeListener(e -> stylers.dispose());<NEW_LINE>extensionsList.setLabelProvider(new ExtensionLabelProvider());<NEW_LINE>extensionsList.setContentProvider(EXTENSIONS_CONTENT_PROVIDER_INSTANCE);<NEW_LINE>extensionsList.getTree().setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());<NEW_LINE>extensionsList.addSelectionChangedListener(selectionEvent -> selectionChanged());<NEW_LINE>Composite actionsComposite = new Composite(composite, SWT.NULL);<NEW_LINE>actionsComposite.setLayout(GridLayoutFactory.fillDefaults().create());<NEW_LINE>actionsComposite.setLayoutData(GridDataFactory.fillDefaults().create());<NEW_LINE>installButton = new Button(actionsComposite, SWT.PUSH);<NEW_LINE>installButton.setText("Install");<NEW_LINE>installButton.setLayoutData(GridDataFactory.fillDefaults().create());<NEW_LINE>installButton.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>if (selected != null) {<NEW_LINE>selected.install();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>uninstallButton = new Button(actionsComposite, SWT.PUSH);<NEW_LINE>uninstallButton.setText("Uninstall");<NEW_LINE>uninstallButton.setLayoutData(GridDataFactory.<MASK><NEW_LINE>uninstallButton.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>if (selected != null) {<NEW_LINE>selected.uninstall();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>GridData gridData = GridDataFactory.copyData((GridData) actionsComposite.getLayoutData());<NEW_LINE>gridData.widthHint = actionsComposite.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;<NEW_LINE>actionsComposite.setLayoutData(gridData);<NEW_LINE>updateButtons();<NEW_LINE>setTitle("Spring Boot CLI Extensions");<NEW_LINE>if (install instanceof ZippedBootInstall) {<NEW_LINE>setMessage("Read-only list of extensions installed automatically", IMessageProvider.INFORMATION);<NEW_LINE>} else {<NEW_LINE>setMessage("Manage extensions for Spring Boot CLI installations");<NEW_LINE>}<NEW_LINE>loadExtensions();<NEW_LINE>return parentComposite;<NEW_LINE>}
fillDefaults().create());
1,016,750
private void handleCode(CloseCode closeCode) {<NEW_LINE>if (closeCode == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mostRecentCloseCode = closeCode;<NEW_LINE>if (closeCode == CloseCode.DISALLOWED_INTENTS) {<NEW_LINE>Set<GatewayIntent> intents = DiscordSRV.api.getIntents();<NEW_LINE>boolean presences = intents.contains(GatewayIntent.GUILD_PRESENCES);<NEW_LINE>// make DiscordSRV go red in /plugins<NEW_LINE>DiscordSRV.getPlugin().disablePlugin();<NEW_LINE>DiscordSRV.getPlugin().getLogger().severe("==============================================================");<NEW_LINE>DiscordSRV.getPlugin().<MASK><NEW_LINE>DiscordSRV.getPlugin().getLogger().severe(" *** PLEASE FOLLOW THE INSTRUCTIONS BELOW TO GET DiscordSRV TO WORK *** ");<NEW_LINE>DiscordSRV.getPlugin().getLogger().severe(" ");<NEW_LINE>DiscordSRV.getPlugin().getLogger().severe(" Your DiscordSRV bot is missing one or more of the following intents: " + (presences ? "Guild Presences, " : "") + "Server Members Intent, Message Content Intent!");<NEW_LINE>DiscordSRV.getPlugin().getLogger().severe(" DiscordSRV " + (presences && !DiscordSRV.config().getBooleanElse("EnablePresenceInformation", false) ? "and its API hooks require these intents" : "requires " + (presences ? "these intents" : "this intent")) + " to function. Instructions:");<NEW_LINE>DiscordSRV.getPlugin().getLogger().severe(" 1. Go to https://discord.com/developers/applications");<NEW_LINE>DiscordSRV.getPlugin().getLogger().severe(" 2. Click on the DiscordSRV bot");<NEW_LINE>DiscordSRV.getPlugin().getLogger().severe(" 3. Click on \"Bot\" on the left");<NEW_LINE>DiscordSRV.getPlugin().getLogger().severe(" 4. Enable the " + (presences ? "\"PRESENCE INTENT\", " : "") + "\"SERVER MEMBERS INTENT\" and \"MESSAGE CONTENT INTENT\"");<NEW_LINE>DiscordSRV.getPlugin().getLogger().severe(" 5. Restart your server");<NEW_LINE>DiscordSRV.getPlugin().getLogger().severe(" ");<NEW_LINE>DiscordSRV.getPlugin().getLogger().severe("==============================================================");<NEW_LINE>} else if (!closeCode.isReconnect()) {<NEW_LINE>// make DiscordSRV go red in /plugins<NEW_LINE>DiscordSRV.getPlugin().disablePlugin();<NEW_LINE>printDisconnectMessage(false, closeCode == CloseCode.AUTHENTICATION_FAILED ? "The bot token is invalid" : closeCode.getMeaning());<NEW_LINE>}<NEW_LINE>}
getLogger().severe(" ");
823,061
final UpdateDestinationResult executeUpdateDestination(UpdateDestinationRequest updateDestinationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateDestinationRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateDestinationRequest> request = null;<NEW_LINE>Response<UpdateDestinationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateDestinationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDestinationRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IoT Wireless");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateDestination");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateDestinationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDestinationResultJsonUnmarshaller());<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 awsRequestMetrics = executionContext.getAwsRequestMetrics();
853,922
public static ImmutableMap<String, String> applySuggestedFixesToCode(Iterable<SuggestedFix> fixes, Map<String, String> filenameToCodeMap) {<NEW_LINE>ReplacementMap map = new ReplacementMap();<NEW_LINE>for (SuggestedFix fix : fixes) {<NEW_LINE>map.putIfNoOverlap(fix);<NEW_LINE>}<NEW_LINE>ImmutableMap.Builder<String, String> newCodeMap = ImmutableMap.builder();<NEW_LINE>for (Map.Entry<String, Set<CodeReplacement>> entry : map.entrySet()) {<NEW_LINE>String filename = entry.getKey();<NEW_LINE>if (!filenameToCodeMap.containsKey(filename)) {<NEW_LINE>throw new IllegalArgumentException("filenameToCodeMap missing code for file: " + filename);<NEW_LINE>}<NEW_LINE>Set<CodeReplacement> replacements = entry.getValue();<NEW_LINE>String newCode = applyCodeReplacements(replacements<MASK><NEW_LINE>newCodeMap.put(filename, newCode);<NEW_LINE>}<NEW_LINE>return newCodeMap.buildOrThrow();<NEW_LINE>}
, filenameToCodeMap.get(filename));
353,226
public TransactionValidationResult isValid(Transaction tx, Block executionBlock, @Nullable AccountState state) {<NEW_LINE>BigInteger blockGasLimit = BigIntegers.fromUnsignedByteArray(executionBlock.getGasLimit());<NEW_LINE>Coin minimumGasPrice = executionBlock.getMinimumGasPrice();<NEW_LINE>long bestBlockNumber = executionBlock.getNumber();<NEW_LINE>long basicTxCost = tx.transactionCost(constants, activationConfig.forBlock(bestBlockNumber));<NEW_LINE>if (state == null && basicTxCost != 0) {<NEW_LINE>logger.trace("[tx={}, sender={}] account doesn't exist", tx.getHash(), tx.getSender());<NEW_LINE>return TransactionValidationResult.withError("the sender account doesn't exist");<NEW_LINE>}<NEW_LINE>for (TxValidatorStep step : validatorSteps) {<NEW_LINE>TransactionValidationResult validationResult = step.validate(tx, state, blockGasLimit, minimumGasPrice, bestBlockNumber, basicTxCost == 0);<NEW_LINE>if (!validationResult.transactionIsValid()) {<NEW_LINE>logger.info("[tx={}] validation failed with error: {}", tx.getHash(<MASK><NEW_LINE>return validationResult;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return TransactionValidationResult.ok();<NEW_LINE>}
), validationResult.getErrorMessage());
1,851,687
private void prepareKeyBlob() throws IOException {<NEW_LINE>try {<NEW_LINE>Point ecPoint = Point.createPoint(msg.getComputations().getClientPublicKeyX().getValue(), msg.getComputations().getClientPublicKeyY().getValue(<MASK><NEW_LINE>SubjectPublicKeyInfo ephemeralKey = SubjectPublicKeyInfo.getInstance(GOSTUtils.generatePublicKey(chooser.getSelectedGostCurve(), ecPoint).getEncoded());<NEW_LINE>Gost2814789EncryptedKey encryptedKey = new Gost2814789EncryptedKey(msg.getComputations().getEncryptedKey().getValue(), getMaskKey(), msg.getComputations().getMacKey().getValue());<NEW_LINE>ASN1ObjectIdentifier paramSet = new ASN1ObjectIdentifier(msg.getComputations().getEncryptionParamSet().getValue());<NEW_LINE>GostR3410TransportParameters params = new GostR3410TransportParameters(paramSet, ephemeralKey, msg.getComputations().getUkm().getValue());<NEW_LINE>GostR3410KeyTransport transport = new GostR3410KeyTransport(encryptedKey, params);<NEW_LINE>DERSequence proxyKeyBlobs = (DERSequence) DERSequence.getInstance(getProxyKeyBlobs());<NEW_LINE>TLSGostKeyTransportBlob blob = new TLSGostKeyTransportBlob(transport, proxyKeyBlobs);<NEW_LINE>msg.setKeyTransportBlob(blob.getEncoded());<NEW_LINE>LOGGER.debug("GOST key blob: " + ASN1Dump.dumpAsString(blob, true));<NEW_LINE>} catch (Exception e) {<NEW_LINE>msg.setKeyTransportBlob(new byte[0]);<NEW_LINE>LOGGER.warn("Could not compute correct GOST key blob: using byte[0]");<NEW_LINE>}<NEW_LINE>}
), chooser.getSelectedGostCurve());
1,413,466
public List<SrvRecord> resolveSrv(String host) throws Exception {<NEW_LINE>if (logger.isLoggable(Level.FINER)) {<NEW_LINE>logger.log(Level.FINER, "About to query SRV records for {0}", new Object[] { host });<NEW_LINE>}<NEW_LINE>List<String> rawSrvRecords = recordFetcher.getAllRecords("SRV", "dns:///" + host);<NEW_LINE>if (logger.isLoggable(Level.FINER)) {<NEW_LINE>logger.log(Level.FINER, "Found {0} SRV records", new Object[] { rawSrvRecords.size() });<NEW_LINE>}<NEW_LINE>List<SrvRecord> srvRecords = new ArrayList<>(rawSrvRecords.size());<NEW_LINE>Exception first = null;<NEW_LINE>Level level = Level.WARNING;<NEW_LINE>for (String rawSrv : rawSrvRecords) {<NEW_LINE>try {<NEW_LINE>String[] parts = <MASK><NEW_LINE>Verify.verify(parts.length == 4, "Bad SRV Record: %s", rawSrv);<NEW_LINE>// SRV requires the host name to be absolute<NEW_LINE>if (!parts[3].endsWith(".")) {<NEW_LINE>throw new RuntimeException("Returned SRV host does not end in period: " + parts[3]);<NEW_LINE>}<NEW_LINE>srvRecords.add(new SrvRecord(parts[3], Integer.parseInt(parts[2])));<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>logger.log(level, "Failed to construct SRV record " + rawSrv, e);<NEW_LINE>if (first == null) {<NEW_LINE>first = e;<NEW_LINE>level = Level.FINE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (srvRecords.isEmpty() && first != null) {<NEW_LINE>throw first;<NEW_LINE>}<NEW_LINE>return Collections.unmodifiableList(srvRecords);<NEW_LINE>}
whitespace.split(rawSrv, 5);
786,156
private void handle(APIRecoverDataVolumeMsg msg) {<NEW_LINE>thdf.chainSubmit(new ChainTask(msg) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getSyncSignature() {<NEW_LINE>return syncThreadId;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(SyncTaskChain chain) {<NEW_LINE>refreshVO();<NEW_LINE>final APIRecoverDataVolumeEvent evt = new APIRecoverDataVolumeEvent(msg.getId());<NEW_LINE>recoverVolume(new Completion(msg, chain) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success() {<NEW_LINE>evt.setInventory(getSelfInventory());<NEW_LINE>bus.publish(evt);<NEW_LINE>chain.next();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>evt.setInventory(getSelfInventory());<NEW_LINE>evt.setError(errorCode);<NEW_LINE>bus.publish(evt);<NEW_LINE>chain.next();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getName() {<NEW_LINE>return msg<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.getClass().getName();
188,078
final ListInvitationsResult executeListInvitations(ListInvitationsRequest listInvitationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listInvitationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListInvitationsRequest> request = null;<NEW_LINE>Response<ListInvitationsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListInvitationsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listInvitationsRequest));<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, "GuardDuty");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListInvitations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListInvitationsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><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>}
false), new ListInvitationsResultJsonUnmarshaller());
779,005
public Map<JobId, List<Job>> jobsToRun() {<NEW_LINE>Map<InstanceName, Change> changes = new LinkedHashMap<>();<NEW_LINE>for (InstanceName instance : application.deploymentSpec().instanceNames()) changes.put(instance, application.require<MASK><NEW_LINE>Map<JobId, List<Job>> jobs = jobsToRun(changes);<NEW_LINE>// Add test jobs for any outstanding change.<NEW_LINE>Map<InstanceName, Change> outstandingChanges = new LinkedHashMap<>();<NEW_LINE>for (InstanceName instance : application.deploymentSpec().instanceNames()) {<NEW_LINE>Change outstanding = outstandingChange(instance);<NEW_LINE>if (outstanding.hasTargets())<NEW_LINE>outstandingChanges.put(instance, outstanding.onTopOf(application.require(instance).change()));<NEW_LINE>}<NEW_LINE>var testJobs = jobsToRun(outstandingChanges, true).entrySet().stream().filter(entry -> !entry.getKey().type().isProduction());<NEW_LINE>return Stream.concat(jobs.entrySet().stream(), testJobs).collect(collectingAndThen(toMap(Map.Entry::getKey, Map.Entry::getValue, DeploymentStatus::union, LinkedHashMap::new), Collections::unmodifiableMap));<NEW_LINE>}
(instance).change());
599,884
// ===========================================================<NEW_LINE>// Methods from SuperClass/Interfaces<NEW_LINE>// ===========================================================<NEW_LINE>@Override<NEW_LINE>public void draw(Canvas c, Projection projection) {<NEW_LINE>final double zoomLevel = projection.getZoomLevel();<NEW_LINE>if (zoomLevel < minZoom) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Rect rect = projection.getIntrinsicScreenRect();<NEW_LINE>int _screenWidth = rect.width();<NEW_LINE>int _screenHeight = rect.height();<NEW_LINE>boolean screenSizeChanged = _screenHeight != screenHeight || _screenWidth != screenWidth;<NEW_LINE>screenHeight = _screenHeight;<NEW_LINE>screenWidth = _screenWidth;<NEW_LINE>final IGeoPoint center = projection.fromPixels(screenWidth / 2, screenHeight / 2, null);<NEW_LINE>if (zoomLevel != lastZoomLevel || center.getLatitude() != lastLatitude || screenSizeChanged) {<NEW_LINE>lastZoomLevel = zoomLevel;<NEW_LINE>lastLatitude = center.getLatitude();<NEW_LINE>rebuildBarPath(projection);<NEW_LINE>}<NEW_LINE>int offsetX = xOffset;<NEW_LINE>int offsetY = yOffset;<NEW_LINE>if (alignBottom)<NEW_LINE>offsetY *= -1;<NEW_LINE>if (alignRight)<NEW_LINE>offsetX *= -1;<NEW_LINE>if (centred && latitudeBar)<NEW_LINE>offsetX += -latitudeBarRect.width() / 2;<NEW_LINE>if (centred && longitudeBar)<NEW_LINE>offsetY += -longitudeBarRect.height() / 2;<NEW_LINE>projection.save(c, false, true);<NEW_LINE>c.translate(offsetX, offsetY);<NEW_LINE>if (latitudeBar && bgPaint != null)<NEW_LINE>c.drawRect(latitudeBarRect, bgPaint);<NEW_LINE>if (longitudeBar && bgPaint != null) {<NEW_LINE>// Don't draw on top of latitude background...<NEW_LINE>int offsetTop = latitudeBar <MASK><NEW_LINE>c.drawRect(longitudeBarRect.left, longitudeBarRect.top + offsetTop, longitudeBarRect.right, longitudeBarRect.bottom, bgPaint);<NEW_LINE>}<NEW_LINE>c.drawPath(barPath, barPaint);<NEW_LINE>if (latitudeBar) {<NEW_LINE>drawLatitudeText(c, projection);<NEW_LINE>}<NEW_LINE>if (longitudeBar) {<NEW_LINE>drawLongitudeText(c, projection);<NEW_LINE>}<NEW_LINE>projection.restore(c, true);<NEW_LINE>}
? latitudeBarRect.height() : 0;
1,778,944
public final PairList<String, Shape> describeOutput() {<NEW_LINE>if (outputDescriptions == null) {<NEW_LINE>outputDescriptions = new PairList<>();<NEW_LINE>Map<String, TensorInfo> outputsMap = servingDefault.getOutputsMap();<NEW_LINE>List<String> keys = new ArrayList<>(outputsMap.keySet());<NEW_LINE>Collections.sort(keys);<NEW_LINE>List<TF_Operation> outputOpHandlesList = new ArrayList<>();<NEW_LINE>List<Integer> outputOpIndicesList = new ArrayList<>();<NEW_LINE>for (String key : keys) {<NEW_LINE>TensorInfo tensorInfo = outputsMap.get(key);<NEW_LINE>TensorShapeProto shapeProto = tensorInfo.getTensorShape();<NEW_LINE>// does not support string tensors<NEW_LINE>if (tensorInfo.getDtype() == org.tensorflow.proto.framework.DataType.DT_STRING) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>outputDescriptions.add(key, new Shape(shapeProto.getDimList().stream().mapToLong(TensorShapeProto.Dim::<MASK><NEW_LINE>Pair<TF_Operation, Integer> pair = JavacppUtils.getGraphOperationByName(graphHandle, tensorInfo.getName());<NEW_LINE>outputOpHandlesList.add(pair.getKey());<NEW_LINE>outputOpIndicesList.add(pair.getValue());<NEW_LINE>}<NEW_LINE>outputOpHandles = outputOpHandlesList.toArray(new TF_Operation[0]);<NEW_LINE>outputOpIndices = outputOpIndicesList.stream().mapToInt(i -> i).toArray();<NEW_LINE>}<NEW_LINE>return outputDescriptions;<NEW_LINE>}
getSize).toArray()));
1,579,899
private void layoutHorizontal(int left, int top, int right, int bottom) {<NEW_LINE><MASK><NEW_LINE>int paddingRight = this.getPaddingRight();<NEW_LINE>int paddingTop = this.getPaddingTop();<NEW_LINE>int paddingBottom = this.getPaddingBottom();<NEW_LINE>int childTop = paddingTop;<NEW_LINE>int childLeft = 0;<NEW_LINE>int childBottom = bottom - top - paddingBottom;<NEW_LINE>int gravity = LayoutBase.getGravity(this);<NEW_LINE>final int horizontalGravity = Gravity.getAbsoluteGravity(gravity, this.getLayoutDirection()) & Gravity.HORIZONTAL_GRAVITY_MASK;<NEW_LINE>switch(horizontalGravity) {<NEW_LINE>case Gravity.CENTER_HORIZONTAL:<NEW_LINE>childLeft = (right - left - this._totalLength) / 2 + paddingLeft;<NEW_LINE>break;<NEW_LINE>case Gravity.RIGHT:<NEW_LINE>childLeft = right - left - this._totalLength + paddingLeft;<NEW_LINE>break;<NEW_LINE>case Gravity.LEFT:<NEW_LINE>case Gravity.FILL_HORIZONTAL:<NEW_LINE>default:<NEW_LINE>childLeft = paddingLeft;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>for (int i = 0, count = this.getChildCount(); i < count; i++) {<NEW_LINE>View child = this.getChildAt(i);<NEW_LINE>if (child.getVisibility() == View.GONE) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int childWidth = CommonLayoutParams.getDesiredWidth(child);<NEW_LINE>CommonLayoutParams.layoutChild(child, childLeft, childTop, childLeft + childWidth, childBottom);<NEW_LINE>childLeft += childWidth;<NEW_LINE>}<NEW_LINE>}
int paddingLeft = this.getPaddingLeft();
1,192,483
private void registerFeignClient(BeanDefinitionRegistry registry, AnnotationMetadata annotationMetadata, Map<String, Object> attributes) {<NEW_LINE>String className = annotationMetadata.getClassName();<NEW_LINE>Class clazz = <MASK><NEW_LINE>ConfigurableBeanFactory beanFactory = registry instanceof ConfigurableBeanFactory ? (ConfigurableBeanFactory) registry : null;<NEW_LINE>String contextId = getContextId(beanFactory, attributes);<NEW_LINE>String name = getName(attributes);<NEW_LINE>FeignClientFactoryBean factoryBean = new FeignClientFactoryBean();<NEW_LINE>factoryBean.setBeanFactory(beanFactory);<NEW_LINE>factoryBean.setName(name);<NEW_LINE>factoryBean.setContextId(contextId);<NEW_LINE>factoryBean.setType(clazz);<NEW_LINE>factoryBean.setRefreshableClient(isClientRefreshEnabled());<NEW_LINE>BeanDefinitionBuilder definition = BeanDefinitionBuilder.genericBeanDefinition(clazz, () -> {<NEW_LINE>factoryBean.setUrl(getUrl(beanFactory, attributes));<NEW_LINE>factoryBean.setPath(getPath(beanFactory, attributes));<NEW_LINE>factoryBean.setDecode404(Boolean.parseBoolean(String.valueOf(attributes.get("decode404"))));<NEW_LINE>Object fallback = attributes.get("fallback");<NEW_LINE>if (fallback != null) {<NEW_LINE>factoryBean.setFallback(fallback instanceof Class ? (Class<?>) fallback : ClassUtils.resolveClassName(fallback.toString(), null));<NEW_LINE>}<NEW_LINE>Object fallbackFactory = attributes.get("fallbackFactory");<NEW_LINE>if (fallbackFactory != null) {<NEW_LINE>factoryBean.setFallbackFactory(fallbackFactory instanceof Class ? (Class<?>) fallbackFactory : ClassUtils.resolveClassName(fallbackFactory.toString(), null));<NEW_LINE>}<NEW_LINE>return factoryBean.getObject();<NEW_LINE>});<NEW_LINE>definition.setAutowireMode(AbstractBeanDefinition.AUTOWIRE_BY_TYPE);<NEW_LINE>definition.setLazyInit(true);<NEW_LINE>validate(attributes);<NEW_LINE>AbstractBeanDefinition beanDefinition = definition.getBeanDefinition();<NEW_LINE>beanDefinition.setAttribute(FactoryBean.OBJECT_TYPE_ATTRIBUTE, className);<NEW_LINE>beanDefinition.setAttribute("feignClientsRegistrarFactoryBean", factoryBean);<NEW_LINE>// has a default, won't be null<NEW_LINE>boolean primary = (Boolean) attributes.get("primary");<NEW_LINE>beanDefinition.setPrimary(primary);<NEW_LINE>String[] qualifiers = getQualifiers(attributes);<NEW_LINE>if (ObjectUtils.isEmpty(qualifiers)) {<NEW_LINE>qualifiers = new String[] { contextId + "FeignClient" };<NEW_LINE>}<NEW_LINE>BeanDefinitionHolder holder = new BeanDefinitionHolder(beanDefinition, className, qualifiers);<NEW_LINE>BeanDefinitionReaderUtils.registerBeanDefinition(holder, registry);<NEW_LINE>registerOptionsBeanDefinition(registry, contextId);<NEW_LINE>}
ClassUtils.resolveClassName(className, null);
527,933
private Notifications readNotifications(Element parent, Element fallbackParent) {<NEW_LINE>Element notificationsElement = XML.getChild(parent, notificationsTag);<NEW_LINE>if (notificationsElement == null)<NEW_LINE>notificationsElement = XML.getChild(fallbackParent, notificationsTag);<NEW_LINE>if (notificationsElement == null)<NEW_LINE>return Notifications.none();<NEW_LINE>When defaultWhen = stringAttribute("when", notificationsElement).map(When::fromValue).orElse(When.failingCommit);<NEW_LINE>Map<When, List<String>> emailAddresses = new HashMap<>();<NEW_LINE>Map<When, List<Role>> emailRoles = new HashMap<>();<NEW_LINE>for (When when : When.values()) {<NEW_LINE>emailAddresses.put(when, new ArrayList<>());<NEW_LINE>emailRoles.put(when, new ArrayList<>());<NEW_LINE>}<NEW_LINE>for (Element emailElement : XML.getChildren(notificationsElement, "email")) {<NEW_LINE>Optional<String> addressAttribute = stringAttribute("address", emailElement);<NEW_LINE>Optional<Role> roleAttribute = stringAttribute("role", emailElement).map(Role::fromValue);<NEW_LINE>When when = stringAttribute("when", emailElement).map(When<MASK><NEW_LINE>if (addressAttribute.isPresent() == roleAttribute.isPresent())<NEW_LINE>illegal("Exactly one of 'role' and 'address' must be present in 'email' elements.");<NEW_LINE>addressAttribute.ifPresent(address -> emailAddresses.get(when).add(address));<NEW_LINE>roleAttribute.ifPresent(role -> emailRoles.get(when).add(role));<NEW_LINE>}<NEW_LINE>return Notifications.of(emailAddresses, emailRoles);<NEW_LINE>}
::fromValue).orElse(defaultWhen);
1,324,845
private void findLookupProperties() {<NEW_LINE>List<Property> candidates = new ArrayList();<NEW_LINE>for (// leave out properties that are either not used for comparisons,<NEW_LINE>Property prop : // leave out properties that are either not used for comparisons,<NEW_LINE>properties.values()) // or which have lookup turned off explicitly<NEW_LINE>if (!prop.isIdProperty() && !prop.isIgnoreProperty() && prop.getLookupBehaviour() != Property.Lookup.FALSE && prop.getHighProbability() != 0.0)<NEW_LINE>candidates.add(prop);<NEW_LINE>// sort them, lowest high prob to highest high prob<NEW_LINE>Collections.sort<MASK><NEW_LINE>// run over and find all those needed to get above the threshold<NEW_LINE>int last = -1;<NEW_LINE>double prob = 0.5;<NEW_LINE>for (int ix = 0; ix < candidates.size(); ix++) {<NEW_LINE>Property prop = candidates.get(ix);<NEW_LINE>prob = Utils.computeBayes(prob, prop.getHighProbability());<NEW_LINE>if (prob >= threshold) {<NEW_LINE>last = ix;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (last == -1)<NEW_LINE>lookups = new ArrayList();<NEW_LINE>else<NEW_LINE>lookups = new ArrayList(candidates.subList(0, last + 1));<NEW_LINE>// need to also add TRUE and REQUIRED<NEW_LINE>for (Property p : proplist) {<NEW_LINE>if (p.getLookupBehaviour() != Property.Lookup.TRUE && p.getLookupBehaviour() != Property.Lookup.REQUIRED)<NEW_LINE>continue;<NEW_LINE>if (lookups.contains(p))<NEW_LINE>continue;<NEW_LINE>lookups.add(p);<NEW_LINE>}<NEW_LINE>}
(candidates, new HighComparator());
1,349,620
public void sendStream(final int iCode, final String iReason, final String iContentType, InputStream iContent, long iSize, final String iFileName, Map<String, String> additionalHeaders) throws IOException {<NEW_LINE>writeStatus(iCode, iReason);<NEW_LINE>writeHeaders(iContentType);<NEW_LINE>writeLine("Content-Transfer-Encoding: binary");<NEW_LINE>if (iFileName != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (additionalHeaders != null) {<NEW_LINE>for (Map.Entry<String, String> entry : additionalHeaders.entrySet()) {<NEW_LINE>writeLine(String.format("%s: %s", entry.getKey(), entry.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (iSize < 0) {<NEW_LINE>// SIZE UNKNOWN: USE A MEMORY BUFFER<NEW_LINE>final ByteArrayOutputStream o = new ByteArrayOutputStream();<NEW_LINE>if (iContent != null) {<NEW_LINE>int b;<NEW_LINE>while ((b = iContent.read()) > -1) {<NEW_LINE>o.write(b);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>byte[] content = o.toByteArray();<NEW_LINE>iContent = new ByteArrayInputStream(content);<NEW_LINE>iSize = content.length;<NEW_LINE>}<NEW_LINE>writeLine(OHttpUtils.HEADER_CONTENT_LENGTH + (iSize));<NEW_LINE>writeLine(null);<NEW_LINE>if (iContent != null) {<NEW_LINE>int b;<NEW_LINE>while ((b = iContent.read()) > -1) {<NEW_LINE>getOut().write(b);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>flush();<NEW_LINE>}
writeLine("Content-Disposition: attachment; filename=\"" + iFileName + "\"");
388,235
public boolean put(String aliasName, String dataStream, Boolean isWriteDataStream, String filter) {<NEW_LINE>previousIndicesLookup = null;<NEW_LINE>Map<String, DataStream> existingDataStream = Optional.ofNullable((DataStreamMetadata) this.customs.get(DataStreamMetadata.TYPE)).map(dsmd -> new HashMap<>(dsmd.dataStreams())).orElse(new HashMap<>());<NEW_LINE>Map<String, DataStreamAlias> dataStreamAliases = Optional.ofNullable((DataStreamMetadata) this.customs.get(DataStreamMetadata.TYPE)).map(dsmd -> new HashMap<>(dsmd.getDataStreamAliases())).orElse(new HashMap<>());<NEW_LINE>if (existingDataStream.containsKey(dataStream) == false) {<NEW_LINE>throw new IllegalArgumentException("alias [" + <MASK><NEW_LINE>}<NEW_LINE>Map<String, Object> filterAsMap;<NEW_LINE>if (filter != null) {<NEW_LINE>filterAsMap = XContentHelper.convertToMap(XContentFactory.xContent(filter), filter, true);<NEW_LINE>} else {<NEW_LINE>filterAsMap = null;<NEW_LINE>}<NEW_LINE>DataStreamAlias alias = dataStreamAliases.get(aliasName);<NEW_LINE>if (alias == null) {<NEW_LINE>String writeDataStream = isWriteDataStream != null && isWriteDataStream ? dataStream : null;<NEW_LINE>alias = new DataStreamAlias(aliasName, List.of(dataStream), writeDataStream, filterAsMap);<NEW_LINE>} else {<NEW_LINE>DataStreamAlias copy = alias.update(dataStream, isWriteDataStream, filterAsMap);<NEW_LINE>if (copy == alias) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>alias = copy;<NEW_LINE>}<NEW_LINE>dataStreamAliases.put(aliasName, alias);<NEW_LINE>this.customs.put(DataStreamMetadata.TYPE, new DataStreamMetadata(existingDataStream, dataStreamAliases));<NEW_LINE>return true;<NEW_LINE>}
aliasName + "] refers to a non existing data stream [" + dataStream + "]");
276,289
protected static Date safeToDate(Object obj) {<NEW_LINE>if (obj == null) {<NEW_LINE>return null;<NEW_LINE>} else if (obj instanceof Date) {<NEW_LINE>return (Date) obj;<NEW_LINE>} else if (obj instanceof ZonedDateTime) {<NEW_LINE>ZonedDateTime zonedDateTime = ((ZonedDateTime) obj);<NEW_LINE>return Timestamp.<MASK><NEW_LINE>} else if (obj instanceof OffsetDateTime) {<NEW_LINE>ZonedDateTime zonedDateTime = ((OffsetDateTime) obj).atZoneSameInstant(ZoneOffset.systemDefault());<NEW_LINE>return Timestamp.from(zonedDateTime.toInstant());<NEW_LINE>} else if (obj instanceof OffsetTime) {<NEW_LINE>ZonedDateTime zonedDateTime = ((OffsetTime) obj).atDate(LocalDate.ofEpochDay(0)).atZoneSameInstant(ZoneOffset.UTC);<NEW_LINE>return Timestamp.from(zonedDateTime.toInstant());<NEW_LINE>} else if (obj instanceof LocalDateTime) {<NEW_LINE>return Timestamp.valueOf((LocalDateTime) obj);<NEW_LINE>} else if (obj instanceof LocalDate) {<NEW_LINE>LocalDateTime dateTime = LocalDateTime.of((LocalDate) obj, LocalTime.of(0, 0, 0, 0));<NEW_LINE>return Timestamp.valueOf(dateTime);<NEW_LINE>} else if (obj instanceof Number) {<NEW_LINE>return new Date(((Number) obj).longValue());<NEW_LINE>} else {<NEW_LINE>throw new ClassCastException(obj.getClass() + " Type cannot be converted to Date");<NEW_LINE>}<NEW_LINE>}
from(zonedDateTime.toInstant());
1,314,285
public boolean execute(Object object) throws ContractExeException {<NEW_LINE>TransactionResultCapsule ret = (TransactionResultCapsule) object;<NEW_LINE>if (Objects.isNull(ret)) {<NEW_LINE>throw new RuntimeException(ActuatorConstant.TX_RESULT_NULL);<NEW_LINE>}<NEW_LINE>long fee = calcFee();<NEW_LINE>AccountStore accountStore = chainBaseManager.getAccountStore();<NEW_LINE>DynamicPropertiesStore dynamicStore = chainBaseManager.getDynamicPropertiesStore();<NEW_LINE>AssetIssueStore assetIssueStore = chainBaseManager.getAssetIssueStore();<NEW_LINE>AssetIssueV2Store assetIssueV2Store = chainBaseManager.getAssetIssueV2Store();<NEW_LINE>try {<NEW_LINE>final ParticipateAssetIssueContract participateAssetIssueContract = any.unpack(ParticipateAssetIssueContract.class);<NEW_LINE>long cost = participateAssetIssueContract.getAmount();<NEW_LINE>// subtract from owner address<NEW_LINE>byte[] ownerAddress = participateAssetIssueContract.getOwnerAddress().toByteArray();<NEW_LINE>AccountCapsule ownerAccount = accountStore.get(ownerAddress);<NEW_LINE>long balance = Math.subtractExact(ownerAccount.getBalance(), cost);<NEW_LINE>balance = Math.subtractExact(balance, fee);<NEW_LINE>ownerAccount.setBalance(balance);<NEW_LINE>byte[] key = participateAssetIssueContract.getAssetName().toByteArray();<NEW_LINE>// calculate the exchange amount<NEW_LINE>AssetIssueCapsule assetIssueCapsule;<NEW_LINE>assetIssueCapsule = Commons.getAssetIssueStoreFinal(dynamicStore, assetIssueStore, assetIssueV2Store).get(key);<NEW_LINE>long exchangeAmount = Math.multiplyExact(cost, assetIssueCapsule.getNum());<NEW_LINE>exchangeAmount = Math.floorDiv(exchangeAmount, assetIssueCapsule.getTrxNum());<NEW_LINE>ownerAccount.addAssetAmountV2(key, exchangeAmount, dynamicStore, assetIssueStore);<NEW_LINE>// add to to_address<NEW_LINE>byte[] toAddress = participateAssetIssueContract.getToAddress().toByteArray();<NEW_LINE>AccountCapsule toAccount = accountStore.get(toAddress);<NEW_LINE>toAccount.setBalance(Math.addExact(toAccount.getBalance(), cost));<NEW_LINE>if (!toAccount.reduceAssetAmountV2(key, exchangeAmount, dynamicStore, assetIssueStore)) {<NEW_LINE>throw new ContractExeException("reduceAssetAmount failed !");<NEW_LINE>}<NEW_LINE>// write to db<NEW_LINE><MASK><NEW_LINE>accountStore.put(toAddress, toAccount);<NEW_LINE>ret.setStatus(fee, Protocol.Transaction.Result.code.SUCESS);<NEW_LINE>} catch (InvalidProtocolBufferException | ArithmeticException e) {<NEW_LINE>logger.debug(e.getMessage(), e);<NEW_LINE>ret.setStatus(fee, code.FAILED);<NEW_LINE>throw new ContractExeException(e.getMessage());<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
accountStore.put(ownerAddress, ownerAccount);
1,304,792
final ModifyWorkspaceAccessPropertiesResult executeModifyWorkspaceAccessProperties(ModifyWorkspaceAccessPropertiesRequest modifyWorkspaceAccessPropertiesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyWorkspaceAccessPropertiesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyWorkspaceAccessPropertiesRequest> request = null;<NEW_LINE>Response<ModifyWorkspaceAccessPropertiesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyWorkspaceAccessPropertiesRequestProtocolMarshaller(protocolFactory).marshall<MASK><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, "WorkSpaces");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyWorkspaceAccessProperties");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ModifyWorkspaceAccessPropertiesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ModifyWorkspaceAccessPropertiesResultJsonUnmarshaller());<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>}
(super.beforeMarshalling(modifyWorkspaceAccessPropertiesRequest));
154,390
public static void _main(String[] args) throws Exception {<NEW_LINE>String sesameURL, repoID;<NEW_LINE>if (args != null && args.length == 2) {<NEW_LINE>sesameURL = args[0];<NEW_LINE>repoID = args[1];<NEW_LINE>} else {<NEW_LINE>sesameURL = DemoSesameServer.sesameURL;<NEW_LINE>repoID = DemoSesameServer.repoID;<NEW_LINE>}<NEW_LINE>Repository repo = new HTTPRepository(sesameURL, repoID);<NEW_LINE>repo.initialize();<NEW_LINE>RepositoryConnection cxn = repo.getConnection();<NEW_LINE>cxn.setAutoCommit(false);<NEW_LINE>try {<NEW_LINE>// load some statements built up programmatically<NEW_LINE>URI mike = new <MASK><NEW_LINE>URI bryan = new URIImpl(BD.NAMESPACE + "Bryan");<NEW_LINE>URI loves = new URIImpl(BD.NAMESPACE + "loves");<NEW_LINE>URI rdf = new URIImpl(BD.NAMESPACE + "RDF");<NEW_LINE>Graph graph = new GraphImpl();<NEW_LINE>graph.add(mike, loves, rdf);<NEW_LINE>graph.add(bryan, loves, rdf);<NEW_LINE>cxn.add(graph);<NEW_LINE>cxn.commit();<NEW_LINE>} finally {<NEW_LINE>cxn.close();<NEW_LINE>}<NEW_LINE>{<NEW_LINE>// show the entire contents of the repository<NEW_LINE>SparqlBuilder sparql = new SparqlBuilder();<NEW_LINE>sparql.addTriplePattern("?s", "?p", "?o");<NEW_LINE>GraphQuery query = cxn.prepareGraphQuery(QueryLanguage.SPARQL, sparql.toString());<NEW_LINE>GraphQueryResult result = query.evaluate();<NEW_LINE>while (result.hasNext()) {<NEW_LINE>Statement stmt = result.next();<NEW_LINE>System.err.println(stmt);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
URIImpl(BD.NAMESPACE + "Mike");
1,128,786
private void addZipArtifact(PrintWriter writer, String connectorPath, ZipArtifact zip) {<NEW_LINE>checkUrlIsPresent(zip);<NEW_LINE>String artifactHash = Util.hashStub(zip.getUrl());<NEW_LINE><MASK><NEW_LINE>String archivePath = connectorPath + "/" + artifactHash + ".zip";<NEW_LINE>Cmd run = downloadArtifact(artifactDir, archivePath, zip);<NEW_LINE>if (zip.getSha512sum() != null && !zip.getSha512sum().isEmpty()) {<NEW_LINE>// Checksum exists => we need to check it<NEW_LINE>String shaFile = archivePath + ".sha512";<NEW_LINE>run.andRun("echo", zip.getSha512sum() + " " + archivePath).redirectTo(shaFile).andRun("sha512sum", "--check", shaFile).andRun("rm", "-f", shaFile);<NEW_LINE>}<NEW_LINE>run.andRun("unzip", archivePath, "-d", artifactDir).andRun("find", artifactDir, "-type", "l").pipeTo("xargs", "rm", "-f").andRun("rm", "-vf", archivePath);<NEW_LINE>writer.append("RUN ").println(run);<NEW_LINE>writer.println();<NEW_LINE>}
String artifactDir = connectorPath + "/" + artifactHash;
1,155,952
public boolean onOptionsItemSelected(MenuItem item) {<NEW_LINE>// Handle action bar item clicks here. The action bar will<NEW_LINE>// automatically handle clicks on the Home/Up button, so long<NEW_LINE>// as you specify a parent activity in AndroidManifest.xml.<NEW_LINE><MASK><NEW_LINE>// turn into switch<NEW_LINE>if (id == R.id.action_license) {<NEW_LINE>AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(this);<NEW_LINE>// set title<NEW_LINE>alertDialogBuilder.setTitle("License");<NEW_LINE>// set dialog message<NEW_LINE>alertDialogBuilder.setMessage("This App is part of the Security Shepherd Project. The Security Shepherd project is" + " free software: you can redistribute it and/or modify it under the terms of" + " the GNU General Public License as published by the Free Software Foundation," + " either version 3 of the License, or (at your option) any later version. The" + " Security Shepherd project is distributed in the hope that it will be useful," + " but WITHOUT ANY WARRANTY; without even the implied warranty of" + " MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General" + " Public License for more details. You should have received a copy of the GNU" + " General Public License along with the Security Shepherd project. If not, see" + " http://www.gnu.org/licenses.").setCancelable(false).setPositiveButton("OK", new DialogInterface.OnClickListener() {<NEW_LINE><NEW_LINE>public void onClick(DialogInterface dialog, int id) {<NEW_LINE>// if this button is clicked, close<NEW_LINE>// current activity<NEW_LINE>dialog.cancel();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// create alert dialog<NEW_LINE>AlertDialog alertDialog = alertDialogBuilder.create();<NEW_LINE>// show it<NEW_LINE>alertDialog.show();<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (id == R.id.action_exit) {<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>return super.onOptionsItemSelected(item);<NEW_LINE>}
int id = item.getItemId();
1,719,501
public void process(Element element, EComponentHolder holder) {<NEW_LINE>ExecutableElement executableElement = (ExecutableElement) element;<NEW_LINE>WakeLock annotation = executableElement.getAnnotation(WakeLock.class);<NEW_LINE>String tag = extractTag(executableElement);<NEW_LINE>Level level = annotation.level();<NEW_LINE>Flag[] flags = annotation.flags();<NEW_LINE>JMethod method = codeModelHelper.overrideAnnotatedMethod(executableElement, holder);<NEW_LINE>JBlock previousMethodBody = codeModelHelper.removeBody(method);<NEW_LINE>JBlock methodBody = method.body();<NEW_LINE>IJExpression levelAndFlags = getClasses().POWER_MANAGER.staticRef(level.name());<NEW_LINE>if (flags.length > 0) {<NEW_LINE>for (Flag flag : flags) {<NEW_LINE>levelAndFlags = levelAndFlags.bor(getClasses().POWER_MANAGER.staticRef(flag.name()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JInvocation newWakeLock = holder.getPowerManagerRef().invoke("newWakeLock").arg(levelAndFlags).arg(JExpr.lit(tag));<NEW_LINE>JVar wakeLock = methodBody.decl(getClasses().WAKE_LOCK, "wakeLock", JExpr._null());<NEW_LINE>JTryBlock tryBlock = methodBody._try();<NEW_LINE>tryBlock.body(<MASK><NEW_LINE>tryBlock.body().add(wakeLock.invoke("acquire"));<NEW_LINE>tryBlock.body().add(previousMethodBody);<NEW_LINE>JBlock finallyBlock = tryBlock._finally();<NEW_LINE>JConditional ifStatement = finallyBlock._if(wakeLock.ne(JExpr._null()));<NEW_LINE>ifStatement._then().add(wakeLock.invoke("release"));<NEW_LINE>}
).assign(wakeLock, newWakeLock);
1,276,278
private void dynamicRefreshPool(String threadPoolId, ExecutorProperties properties) {<NEW_LINE>ExecutorProperties beforeProperties = GlobalCoreThreadPoolManage.getProperties(properties.getThreadPoolId());<NEW_LINE>ThreadPoolExecutor executor = GlobalThreadPoolManage.getExecutorService(threadPoolId).getExecutor();<NEW_LINE>if (!Objects.equals(beforeProperties.getCorePoolSize(), properties.getCorePoolSize())) {<NEW_LINE>executor.setCorePoolSize(properties.getCorePoolSize());<NEW_LINE>}<NEW_LINE>if (!Objects.equals(beforeProperties.getMaximumPoolSize(), properties.getMaximumPoolSize())) {<NEW_LINE>executor.<MASK><NEW_LINE>}<NEW_LINE>if (!Objects.equals(beforeProperties.getAllowCoreThreadTimeOut(), properties.getAllowCoreThreadTimeOut())) {<NEW_LINE>executor.allowCoreThreadTimeOut(properties.getAllowCoreThreadTimeOut());<NEW_LINE>}<NEW_LINE>if (!Objects.equals(beforeProperties.getExecuteTimeOut(), properties.getExecuteTimeOut())) {<NEW_LINE>if (executor instanceof AbstractDynamicExecutorSupport) {<NEW_LINE>((DynamicThreadPoolExecutor) executor).setExecuteTimeOut(properties.getExecuteTimeOut());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!Objects.equals(beforeProperties.getRejectedHandler(), properties.getRejectedHandler())) {<NEW_LINE>RejectedExecutionHandler rejectedExecutionHandler = RejectedTypeEnum.createPolicy(properties.getRejectedHandler());<NEW_LINE>if (executor instanceof AbstractDynamicExecutorSupport) {<NEW_LINE>DynamicThreadPoolExecutor dynamicExecutor = (DynamicThreadPoolExecutor) executor;<NEW_LINE>dynamicExecutor.setRedundancyHandler(rejectedExecutionHandler);<NEW_LINE>AtomicLong rejectCount = dynamicExecutor.getRejectCount();<NEW_LINE>rejectedExecutionHandler = RejectedProxyUtil.createProxy(rejectedExecutionHandler, threadPoolId, rejectCount);<NEW_LINE>}<NEW_LINE>executor.setRejectedExecutionHandler(rejectedExecutionHandler);<NEW_LINE>}<NEW_LINE>if (!Objects.equals(beforeProperties.getKeepAliveTime(), properties.getKeepAliveTime())) {<NEW_LINE>executor.setKeepAliveTime(properties.getKeepAliveTime(), TimeUnit.SECONDS);<NEW_LINE>}<NEW_LINE>if (!Objects.equals(beforeProperties.getQueueCapacity(), properties.getQueueCapacity()) && Objects.equals(QueueTypeEnum.RESIZABLE_LINKED_BLOCKING_QUEUE.name, executor.getQueue().getClass().getSimpleName())) {<NEW_LINE>if (executor.getQueue() instanceof ResizableCapacityLinkedBlockIngQueue) {<NEW_LINE>ResizableCapacityLinkedBlockIngQueue queue = (ResizableCapacityLinkedBlockIngQueue) executor.getQueue();<NEW_LINE>queue.setCapacity(properties.getQueueCapacity());<NEW_LINE>} else {<NEW_LINE>log.warn("The queue length cannot be modified. Queue type mismatch. Current queue type :: {}", executor.getQueue().getClass().getSimpleName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setMaximumPoolSize(properties.getMaximumPoolSize());
867,502
public static QueryRelationListResponse unmarshall(QueryRelationListResponse queryRelationListResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryRelationListResponse.setRequestId(_ctx.stringValue("QueryRelationListResponse.RequestId"));<NEW_LINE>queryRelationListResponse.setCode(_ctx.stringValue("QueryRelationListResponse.Code"));<NEW_LINE>queryRelationListResponse.setMessage(_ctx.stringValue("QueryRelationListResponse.Message"));<NEW_LINE>queryRelationListResponse.setSuccess(_ctx.booleanValue("QueryRelationListResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setPageNum(_ctx.integerValue("QueryRelationListResponse.Data.PageNum"));<NEW_LINE>data.setPageSize(_ctx.integerValue("QueryRelationListResponse.Data.PageSize"));<NEW_LINE>data.setTotalCount(_ctx.integerValue("QueryRelationListResponse.Data.TotalCount"));<NEW_LINE>List<FinancialRelationInfoListItem> financialRelationInfoList = new ArrayList<FinancialRelationInfoListItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryRelationListResponse.Data.FinancialRelationInfoList.Length"); i++) {<NEW_LINE>FinancialRelationInfoListItem financialRelationInfoListItem = new FinancialRelationInfoListItem();<NEW_LINE>financialRelationInfoListItem.setEndTime(_ctx.stringValue("QueryRelationListResponse.Data.FinancialRelationInfoList[" + i + "].EndTime"));<NEW_LINE>financialRelationInfoListItem.setRelationType(_ctx.stringValue("QueryRelationListResponse.Data.FinancialRelationInfoList[" + i + "].RelationType"));<NEW_LINE>financialRelationInfoListItem.setAccountNickName(_ctx.stringValue<MASK><NEW_LINE>financialRelationInfoListItem.setStartTime(_ctx.stringValue("QueryRelationListResponse.Data.FinancialRelationInfoList[" + i + "].StartTime"));<NEW_LINE>financialRelationInfoListItem.setState(_ctx.stringValue("QueryRelationListResponse.Data.FinancialRelationInfoList[" + i + "].State"));<NEW_LINE>financialRelationInfoListItem.setAccountId(_ctx.longValue("QueryRelationListResponse.Data.FinancialRelationInfoList[" + i + "].AccountId"));<NEW_LINE>financialRelationInfoListItem.setSetupTime(_ctx.stringValue("QueryRelationListResponse.Data.FinancialRelationInfoList[" + i + "].SetupTime"));<NEW_LINE>financialRelationInfoListItem.setAccountType(_ctx.stringValue("QueryRelationListResponse.Data.FinancialRelationInfoList[" + i + "].AccountType"));<NEW_LINE>financialRelationInfoListItem.setAccountName(_ctx.stringValue("QueryRelationListResponse.Data.FinancialRelationInfoList[" + i + "].AccountName"));<NEW_LINE>financialRelationInfoListItem.setRelationId(_ctx.longValue("QueryRelationListResponse.Data.FinancialRelationInfoList[" + i + "].RelationId"));<NEW_LINE>financialRelationInfoList.add(financialRelationInfoListItem);<NEW_LINE>}<NEW_LINE>data.setFinancialRelationInfoList(financialRelationInfoList);<NEW_LINE>queryRelationListResponse.setData(data);<NEW_LINE>return queryRelationListResponse;<NEW_LINE>}
("QueryRelationListResponse.Data.FinancialRelationInfoList[" + i + "].AccountNickName"));
1,504,396
private void updateFrontier(Flowfield path, long nsToRun) {<NEW_LINE>long start = Time.nanos();<NEW_LINE>while (path.frontier.size > 0 && (nsToRun < 0 || Time.timeSinceNanos(start) <= nsToRun)) {<NEW_LINE>Tile tile = world.tile(path.frontier.removeLast());<NEW_LINE>// something went horribly wrong, bail<NEW_LINE>if (tile == null || path.weights == null)<NEW_LINE>return;<NEW_LINE>int cost = path.weights[tile.x][tile.y];<NEW_LINE>// pathfinding overflowed for some reason, time to bail. the next block update will handle this, hopefully<NEW_LINE>if (path.frontier.size >= world.width() * world.height()) {<NEW_LINE>path.frontier.clear();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (cost != impassable) {<NEW_LINE>for (Point2 point : Geometry.d4) {<NEW_LINE>int dx = tile.x + point.x, dy = tile.y + point.y;<NEW_LINE>if (dx < 0 || dy < 0 || dx >= tiles.length || dy >= tiles[0].length)<NEW_LINE>continue;<NEW_LINE>int otherCost = path.cost.getCost(path.team, tiles[dx][dy]);<NEW_LINE>if ((path.weights[dx][dy] > cost + otherCost || path.searches[dx][dy] < path.search) && otherCost != impassable) {<NEW_LINE>path.frontier.addFirst(Point2.pack(dx, dy));<NEW_LINE>path.weights[dx<MASK><NEW_LINE>path.searches[dx][dy] = (short) path.search;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
][dy] = cost + otherCost;
210,623
public J visitIdentifier(J.Identifier ident, ExecutionContext ctx) {<NEW_LINE>// if the ident's type is equal to the type we're looking for, and the classname of the type we're looking for is equal to the ident's string representation<NEW_LINE>// Then transform it, otherwise leave it alone<NEW_LINE>J.Identifier i = visitAndCast(ident, ctx, super::visitIdentifier);<NEW_LINE>if (TypeUtils.isOfClassType(i.getType(), oldFullyQualifiedTypeName)) {<NEW_LINE>String className = originalType.getClassName();<NEW_LINE>JavaType.FullyQualified iType = TypeUtils.asFullyQualified(i.getType());<NEW_LINE>if (iType != null && iType.getOwningClass() != null) {<NEW_LINE>className = originalType.getFullyQualifiedName().substring(iType.getOwningClass().getFullyQualifiedName().length() + 1);<NEW_LINE>}<NEW_LINE>if (i.getSimpleName().equals(className)) {<NEW_LINE>if (targetType instanceof JavaType.FullyQualified) {<NEW_LINE>if (((JavaType.FullyQualified) targetType).getOwningClass() != null) {<NEW_LINE>return updateOuterClassTypes(TypeTree.build(((JavaType.FullyQualified) targetType).getClassName()).withType(null).withPrefix<MASK><NEW_LINE>} else {<NEW_LINE>i = i.withSimpleName(((JavaType.FullyQualified) targetType).getClassName());<NEW_LINE>}<NEW_LINE>} else if (targetType instanceof JavaType.Primitive) {<NEW_LINE>i = i.withSimpleName(((JavaType.Primitive) targetType).getKeyword());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return i.withType(updateType(i.getType()));<NEW_LINE>}
(i.getPrefix()));
141,278
public boolean onShutdown(long timeout, TimeUnit unit) {<NEW_LINE>ILogger logger = <MASK><NEW_LINE>Map<RaftGroupId, InternalCompletableFuture<Object>> futures = shutdown();<NEW_LINE>long remainingTimeNanos = unit.toNanos(timeout);<NEW_LINE>boolean successful = true;<NEW_LINE>while (remainingTimeNanos > 0 && futures.size() > 0) {<NEW_LINE>Iterator<Entry<RaftGroupId, InternalCompletableFuture<Object>>> it = futures.entrySet().iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Entry<RaftGroupId, InternalCompletableFuture<Object>> entry = it.next();<NEW_LINE>RaftGroupId groupId = entry.getKey();<NEW_LINE>InternalCompletableFuture<Object> f = entry.getValue();<NEW_LINE>if (f.isDone()) {<NEW_LINE>it.remove();<NEW_LINE>try {<NEW_LINE>f.get();<NEW_LINE>logger.fine("Session closed for " + groupId);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warning("Close session failed for " + groupId, e);<NEW_LINE>successful = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Thread.sleep(SHUTDOWN_TASK_PERIOD_IN_MILLIS);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>remainingTimeNanos -= MILLISECONDS.toNanos(SHUTDOWN_TASK_PERIOD_IN_MILLIS);<NEW_LINE>}<NEW_LINE>return successful && futures.isEmpty();<NEW_LINE>}
nodeEngine.getLogger(getClass());
676,462
public void findAndAllowAccess(long secretId, long groupId, AuditLog auditLog, String user, Map<String, String> extraInfo) {<NEW_LINE>dslContext.transaction(configuration -> {<NEW_LINE>GroupDAO groupDAO = groupDAOFactory.using(configuration);<NEW_LINE>SecretSeriesDAO secretSeriesDAO = secretSeriesDAOFactory.using(configuration);<NEW_LINE>Optional<Group> group = groupDAO.getGroupById(groupId);<NEW_LINE>if (!group.isPresent()) {<NEW_LINE>logger.info("Failure to allow access groupId {}, secretId {}: groupId not found.", groupId, secretId);<NEW_LINE>throw new IllegalStateException(format("GroupId %d doesn't exist.", groupId));<NEW_LINE>}<NEW_LINE>Optional<SecretSeries> secret = secretSeriesDAO.getSecretSeriesById(secretId);<NEW_LINE>if (!secret.isPresent()) {<NEW_LINE>logger.info("Failure to allow access groupId {}, secretId {}: secretId not found.", groupId, secretId);<NEW_LINE>throw new IllegalStateException(format("SecretId %d doesn't exist.", secretId));<NEW_LINE>}<NEW_LINE>allowAccess(configuration, secretId, groupId);<NEW_LINE>extraInfo.put("group", group.get().getName());<NEW_LINE>extraInfo.put("secret added", secret.get().name());<NEW_LINE>auditLog.recordEvent(new Event(Instant.now(), EventTag.CHANGEACL_GROUP_SECRET, user, group.get()<MASK><NEW_LINE>});<NEW_LINE>}
.getName(), extraInfo));
866,661
final StopKeyPhrasesDetectionJobResult executeStopKeyPhrasesDetectionJob(StopKeyPhrasesDetectionJobRequest stopKeyPhrasesDetectionJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(stopKeyPhrasesDetectionJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StopKeyPhrasesDetectionJobRequest> request = null;<NEW_LINE>Response<StopKeyPhrasesDetectionJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StopKeyPhrasesDetectionJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopKeyPhrasesDetectionJobRequest));<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, "Comprehend");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopKeyPhrasesDetectionJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StopKeyPhrasesDetectionJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StopKeyPhrasesDetectionJobResultJsonUnmarshaller());<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,479,855
void deserialize(TaskMonitor monitor) throws IOException, CancelledException {<NEW_LINE>// Calculate the number of pages that the FreePageMap occupies on disk.<NEW_LINE>// 3 = log2(bitsperbyte)<NEW_LINE>int log2BitsPerPage = msf.getLog2PageSize() + 3;<NEW_LINE>long freePageMapNumPages = AbstractMsf.floorDivisionWithLog2Divisor(msf.getNumPages(), log2BitsPerPage);<NEW_LINE>// Get the First page number of the FreePageMap on disk.<NEW_LINE>int nextPageNumber = msf.getCurrentFreePageMapFirstPageNumber();<NEW_LINE>// Read the FreePageMap, which is dispersed across the file (see note below).<NEW_LINE>MsfFileReader fileReader = msf.fileReader;<NEW_LINE><MASK><NEW_LINE>while (freePageMapNumPages > 0) {<NEW_LINE>monitor.checkCanceled();<NEW_LINE>byte[] bytes = new byte[pageSize];<NEW_LINE>fileReader.read(nextPageNumber, 0, pageSize, bytes, 0);<NEW_LINE>addMap(bytes, monitor);<NEW_LINE>freePageMapNumPages--;<NEW_LINE>// This is correct. Each page of the FreePageMap700 is located at pageSize number<NEW_LINE>// of pages away from the last page. So if the first page of the FreePageMap700<NEW_LINE>// is page 1, and if the pageSize is 4096, then the next page used as part of<NEW_LINE>// the FreePageMap700 is page 4097. FreePageMap200 is different in that its data<NEW_LINE>// resides sequentially on disk.<NEW_LINE>nextPageNumber += pageSize;<NEW_LINE>}<NEW_LINE>}
int pageSize = msf.getPageSize();
1,573,862
public ExpungeVmMsg call(Tuple t) {<NEW_LINE>String uuid = t.get(0, String.class);<NEW_LINE>Timestamp date = t.<MASK><NEW_LINE>long end = date.getTime() + TimeUnit.SECONDS.toMillis(VmGlobalConfig.VM_EXPUNGE_PERIOD.value(Long.class));<NEW_LINE>if (current.getTime() >= end) {<NEW_LINE>VmInstanceDeletionPolicy deletionPolicy = deletionPolicyMgr.getDeletionPolicy(uuid);<NEW_LINE>if (deletionPolicy == VmInstanceDeletionPolicy.Never) {<NEW_LINE>logger.debug(String.format("[VM Expunging Task]: the deletion policy of the vm[uuid:%s] is Never, don't expunge it", uuid));<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>ExpungeVmMsg msg = new ExpungeVmMsg();<NEW_LINE>msg.setVmInstanceUuid(uuid);<NEW_LINE>bus.makeTargetServiceIdByResourceUuid(msg, VmInstanceConstant.SERVICE_ID, uuid);<NEW_LINE>return msg;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
get(1, Timestamp.class);
1,647,343
public void migrate(Schema schema, DatabaseSession databaseSession) {<NEW_LINE>EClass pluginBundleVersionClass = <MASK><NEW_LINE>EEnum pluginBundleType = schema.createEEnum("store", "PluginBundleType");<NEW_LINE>schema.createEEnumLiteral(pluginBundleType, "MAVEN");<NEW_LINE>schema.createEEnumLiteral(pluginBundleType, "GITHUB");<NEW_LINE>schema.createEEnumLiteral(pluginBundleType, "LOCAL");<NEW_LINE>EEnum pluginType = schema.createEEnum("store", "PluginType");<NEW_LINE>schema.createEEnumLiteral(pluginType, "SERIALIZER");<NEW_LINE>schema.createEEnumLiteral(pluginType, "DESERIALIZER");<NEW_LINE>schema.createEEnumLiteral(pluginType, "RENDER_ENGINE");<NEW_LINE>schema.createEEnumLiteral(pluginType, "QUERY_ENGINE");<NEW_LINE>schema.createEEnumLiteral(pluginType, "OBJECT_IDM");<NEW_LINE>schema.createEEnumLiteral(pluginType, "WEB_MODULE");<NEW_LINE>schema.createEEnumLiteral(pluginType, "MODEL_MERGER");<NEW_LINE>schema.createEEnumLiteral(pluginType, "MODEL_COMPARE");<NEW_LINE>schema.createEEnumLiteral(pluginType, "MODEL_CHECKER");<NEW_LINE>schema.createEEnumLiteral(pluginType, "STILL_IMAGE_RENDER");<NEW_LINE>schema.createEEnumLiteral(pluginType, "SERVICE");<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "version", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "type", pluginBundleType);<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "description", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "mismatch", EcorePackage.eINSTANCE.getEBoolean());<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "repository", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "groupId", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "artifactId", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "icon", EcorePackage.eINSTANCE.getEByteArray());<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "organization", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginBundleVersionClass, "name", EcorePackage.eINSTANCE.getEString());<NEW_LINE>EClass pluginBundle = schema.createEClass("store", "PluginBundle");<NEW_LINE>schema.createEAttribute(pluginBundle, "organization", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginBundle, "name", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEReference(pluginBundle, "latestVersion", pluginBundleVersionClass, Multiplicity.SINGLE).getEAnnotations().add(createEmbedsReferenceAnnotation());<NEW_LINE>schema.createEReference(pluginBundle, "availableVersions", pluginBundleVersionClass, Multiplicity.MANY).getEAnnotations().add(createEmbedsReferenceAnnotation());<NEW_LINE>schema.createEReference(pluginBundle, "installedVersion", pluginBundleVersionClass, Multiplicity.SINGLE).getEAnnotations().add(createEmbedsReferenceAnnotation());<NEW_LINE>EClass pluginInformation = schema.createEClass("store", "PluginInformation");<NEW_LINE>schema.createEAttribute(pluginInformation, "name", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginInformation, "type", pluginType);<NEW_LINE>schema.createEAttribute(pluginInformation, "description", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginInformation, "enabled", EcorePackage.eINSTANCE.getEBoolean());<NEW_LINE>schema.createEAttribute(pluginInformation, "identifier", EcorePackage.eINSTANCE.getEString());<NEW_LINE>schema.createEAttribute(pluginInformation, "installForAllUsers", EcorePackage.eINSTANCE.getEBoolean());<NEW_LINE>schema.createEAttribute(pluginInformation, "installForNewUsers", EcorePackage.eINSTANCE.getEBoolean());<NEW_LINE>EClass pluginDescriptor = schema.getEClass("store", "PluginDescriptor");<NEW_LINE>schema.createEAttribute(pluginDescriptor, "installForNewUsers", EcorePackage.eINSTANCE.getEBoolean());<NEW_LINE>EClass serverSettingsClass = schema.getEClass("store", "ServerSettings");<NEW_LINE>schema.createEAttribute(serverSettingsClass, "pluginStrictVersionChecking", EcorePackage.eINSTANCE.getEBoolean());<NEW_LINE>schema.createEReference(pluginDescriptor, "pluginBundleVersion", pluginBundleVersionClass, Multiplicity.SINGLE);<NEW_LINE>}
schema.createEClass("store", "PluginBundleVersion");
269,843
Converter<JWT, Mono<JWTClaimsSet>> processor() {<NEW_LINE>Assert.state(JWSAlgorithm.Family.RSA.contains(this.jwsAlgorithm), () -> "The provided key is of type RSA; however the signature algorithm is of some other type: " + this.jwsAlgorithm + ". Please indicate one of RS256, RS384, or RS512.");<NEW_LINE>JWSKeySelector<SecurityContext> jwsKeySelector = new SingleKeyJWSKeySelector<>(<MASK><NEW_LINE>DefaultJWTProcessor<SecurityContext> jwtProcessor = new DefaultJWTProcessor<>();<NEW_LINE>jwtProcessor.setJWSKeySelector(jwsKeySelector);<NEW_LINE>// Spring Security validates the claim set independent from Nimbus<NEW_LINE>jwtProcessor.setJWTClaimsSetVerifier((claims, context) -> {<NEW_LINE>});<NEW_LINE>this.jwtProcessorCustomizer.accept(jwtProcessor);<NEW_LINE>return (jwt) -> Mono.just(createClaimsSet(jwtProcessor, jwt, null));<NEW_LINE>}
this.jwsAlgorithm, this.key);
1,669,596
public static void main(String[] args) {<NEW_LINE>Exercise3.EdgeWeightedDigraphAdjacencyMatrix edgeWeightedDigraph = new Exercise3().new EdgeWeightedDigraphAdjacencyMatrix(8);<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(4, 5, 0.35));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(5, 4, 0.35));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(4, 7, 0.37));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(5, 7, 0.28));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(7, 5, 0.28));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(5, 1, 0.32));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(0, 4, 0.38));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(0, 2, 0.26));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(7, 3, 0.39));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(1, 3, 0.29));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge<MASK><NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(6, 2, 0.40));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(3, 6, 0.52));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(6, 0, 0.58));<NEW_LINE>edgeWeightedDigraph.addEdge(new DirectedEdge(6, 4, 0.93));<NEW_LINE>DijkstraSPDenseGraph dijkstraSPDenseGraph = new Exercise26_SingleSourceShortestPathsInDenseGraphs().new DijkstraSPDenseGraph(edgeWeightedDigraph, 0);<NEW_LINE>StdOut.println("Shortest-paths-tree\n");<NEW_LINE>StdOut.printf("%13s %10s\n", "edgeTo[]", "distTo[]");<NEW_LINE>for (int vertex = 0; vertex < edgeWeightedDigraph.vertices(); vertex++) {<NEW_LINE>StdOut.printf("%d %11s %9.2f\n", vertex, dijkstraSPDenseGraph.edgeTo(vertex), dijkstraSPDenseGraph.distTo(vertex));<NEW_LINE>}<NEW_LINE>StdOut.print("\nPath from 0 to 6: ");<NEW_LINE>for (DirectedEdge edge : dijkstraSPDenseGraph.pathTo(6)) {<NEW_LINE>StdOut.print(edge.from() + "->" + edge.to() + " ");<NEW_LINE>}<NEW_LINE>StdOut.println("\nExpected: 0->2 2->7 7->3 3->6");<NEW_LINE>}
(2, 7, 0.34));
1,202,783
private Instance apply(InstanceEvent event, boolean isNewEvent) {<NEW_LINE>Assert.notNull(event, "'event' must not be null");<NEW_LINE>Assert.isTrue(this.id.equals(event.getInstance()), "'event' must refer the same instance");<NEW_LINE>Assert.isTrue(event.getVersion() >= this.nextVersion(), () -> "Event " + event.getVersion() + " must be greater or equal to " + this.nextVersion());<NEW_LINE>List<InstanceEvent> unsavedEvents = appendToEvents(event, isNewEvent);<NEW_LINE>if (event instanceof InstanceRegisteredEvent) {<NEW_LINE>Registration registration = ((InstanceRegisteredEvent) event).getRegistration();<NEW_LINE>return new Instance(this.id, event.getVersion(), registration, true, StatusInfo.ofUnknown(), event.getTimestamp(), Info.empty(), Endpoints.empty(), updateBuildVersion(registration.getMetadata()), updateTags(registration.getMetadata()), unsavedEvents);<NEW_LINE>} else if (event instanceof InstanceRegistrationUpdatedEvent) {<NEW_LINE>Registration registration = ((InstanceRegistrationUpdatedEvent) event).getRegistration();<NEW_LINE>return new Instance(this.id, event.getVersion(), registration, this.registered, this.statusInfo, this.statusTimestamp, this.info, this.endpoints, updateBuildVersion(registration.getMetadata(), this.info.getValues()), updateTags(registration.getMetadata(), this.info<MASK><NEW_LINE>} else if (event instanceof InstanceStatusChangedEvent) {<NEW_LINE>StatusInfo statusInfo = ((InstanceStatusChangedEvent) event).getStatusInfo();<NEW_LINE>return new Instance(this.id, event.getVersion(), this.registration, this.registered, statusInfo, event.getTimestamp(), this.info, this.endpoints, this.buildVersion, this.tags, unsavedEvents);<NEW_LINE>} else if (event instanceof InstanceEndpointsDetectedEvent) {<NEW_LINE>Endpoints endpoints = ((InstanceEndpointsDetectedEvent) event).getEndpoints();<NEW_LINE>return new Instance(this.id, event.getVersion(), this.registration, this.registered, this.statusInfo, this.statusTimestamp, this.info, endpoints, this.buildVersion, this.tags, unsavedEvents);<NEW_LINE>} else if (event instanceof InstanceInfoChangedEvent) {<NEW_LINE>Info info = ((InstanceInfoChangedEvent) event).getInfo();<NEW_LINE>Map<String, ?> metaData = (this.registration != null) ? this.registration.getMetadata() : emptyMap();<NEW_LINE>return new Instance(this.id, event.getVersion(), this.registration, this.registered, this.statusInfo, this.statusTimestamp, info, this.endpoints, updateBuildVersion(metaData, info.getValues()), updateTags(metaData, info.getValues()), unsavedEvents);<NEW_LINE>} else if (event instanceof InstanceDeregisteredEvent) {<NEW_LINE>return new Instance(this.id, event.getVersion(), this.registration, false, StatusInfo.ofUnknown(), event.getTimestamp(), Info.empty(), Endpoints.empty(), null, Tags.empty(), unsavedEvents);<NEW_LINE>}<NEW_LINE>return this;<NEW_LINE>}
.getValues()), unsavedEvents);
177,946
private boolean checkPassStep(Game game, HumanPlayer controllingPlayer) {<NEW_LINE>try {<NEW_LINE>if (playerId.equals(game.getActivePlayerId())) {<NEW_LINE>return !controllingPlayer.getUserData().getUserSkipPrioritySteps().getYourTurn().isPhaseStepSet(game.<MASK><NEW_LINE>} else {<NEW_LINE>return !controllingPlayer.getUserData().getUserSkipPrioritySteps().getOpponentTurn().isPhaseStepSet(game.getStep().getType());<NEW_LINE>}<NEW_LINE>} catch (NullPointerException ex) {<NEW_LINE>if (controllingPlayer.getUserData() != null) {<NEW_LINE>if (controllingPlayer.getUserData().getUserSkipPrioritySteps() != null) {<NEW_LINE>if (game.getStep() != null) {<NEW_LINE>if (game.getStep().getType() == null) {<NEW_LINE>logger.error("game.getStep().getType() == null");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.error("game.getStep() == null");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.error("UserData.getUserSkipPrioritySteps == null");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.error("UserData == null");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getStep().getType());
1,852,126
public static void vertical(GrayU8 input, GrayI8 output, int offset, int length, @Nullable GrowArray<DogArray_I32> workspaces) {<NEW_LINE>workspaces = BoofMiscOps.checkDeclare(workspaces, DogArray_I32::new);<NEW_LINE>// CONCURRENT_REMOVE_LINE<NEW_LINE>final DogArray_I32 work = workspaces.grow();<NEW_LINE>final <MASK><NEW_LINE>final int offsetEnd = length - offset - 1;<NEW_LINE>final int divisor = length;<NEW_LINE>final int halfDivisor = divisor / 2;<NEW_LINE>// To reduce cache misses it is processed along rows instead of going down columns, which is<NEW_LINE>// more natural for a vertical convolution. For parallel processes this requires building<NEW_LINE>// a book keeping array for each thread.<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopBlocks(offset, output.height - offsetEnd, length, workspaces, (work, y0,y1)->{<NEW_LINE>final int y0 = offset, y1 = output.height - offsetEnd;<NEW_LINE>int[] totals = BoofMiscOps.checkDeclare(work, input.width, false);<NEW_LINE>for (int x = 0; x < input.width; x++) {<NEW_LINE>int indexIn = input.startIndex + (y0 - offset) * input.stride + x;<NEW_LINE>int indexOut = output.startIndex + output.stride * y0 + x;<NEW_LINE>int total = 0;<NEW_LINE>int indexEnd = indexIn + input.stride * length;<NEW_LINE>for (; indexIn < indexEnd; indexIn += input.stride) {<NEW_LINE>total += input.data[indexIn] & 0xFF;<NEW_LINE>}<NEW_LINE>totals[x] = total;<NEW_LINE>output.data[indexOut] = (byte) ((total + halfDivisor) / divisor);<NEW_LINE>}<NEW_LINE>// change the order it is processed in to reduce cache misses<NEW_LINE>for (int y = y0 + 1; y < y1; y++) {<NEW_LINE>int indexIn = input.startIndex + (y + offsetEnd) * input.stride;<NEW_LINE>int indexOut = output.startIndex + y * output.stride;<NEW_LINE>for (int x = 0; x < input.width; x++, indexIn++, indexOut++) {<NEW_LINE>int total = totals[x] - (input.data[indexIn - backStep] & 0xFF);<NEW_LINE>totals[x] = total += input.data[indexIn] & 0xFF;<NEW_LINE>output.data[indexOut] = (byte) ((total + halfDivisor) / divisor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_INLINE });<NEW_LINE>}
int backStep = length * input.stride;
9,610
public void html(WordprocessingMLPackage wmlPackage, javax.xml.transform.Result result, HTMLSettings htmlSettings) throws Exception {<NEW_LINE>ByteArrayOutputStream outStream = new ByteArrayOutputStream(DEFAULT_OUTPUT_SIZE);<NEW_LINE>if ((xslt != null) && (htmlSettings.getCustomXsltTemplates() == null)) {<NEW_LINE>htmlSettings.setCustomXsltTemplates(xslt);<NEW_LINE>}<NEW_LINE>if ((wmlPackage != null) && (htmlSettings.getOpcPackage() == null)) {<NEW_LINE>htmlSettings.setOpcPackage(wmlPackage);<NEW_LINE>}<NEW_LINE>Docx4J.toHTML(<MASK><NEW_LINE>// Resolution of doctype eg<NEW_LINE>// <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><NEW_LINE>// may be extremely slow, so instead of<NEW_LINE>// transformer.transform(new StreamSource(new ByteArrayInputStream(bytes)), result);<NEW_LINE>// use<NEW_LINE>// as opposed to XmlUtils.getNewDocumentBuilder()<NEW_LINE>DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();<NEW_LINE>dbFactory.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);<NEW_LINE>dbFactory.setFeature("http://xml.org/sax/features/external-parameter-entities", false);<NEW_LINE>dbFactory.setFeature("http://xml.org/sax/features/external-general-entities", false);<NEW_LINE>DocumentBuilder db = dbFactory.newDocumentBuilder();<NEW_LINE>// that feature is enough; alternatively, the below also works. Use both for good measure.<NEW_LINE>db.setEntityResolver(new EntityResolver() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {<NEW_LINE>// Returns a valid dummy source<NEW_LINE>return new InputSource(new StringReader(""));<NEW_LINE>// returning null here is no good; it seems to cause:<NEW_LINE>// XMLEntityManager.reset(XMLComponentManager)<NEW_LINE>// XIncludeAwareParserConfiguration(XML11Configuration).resetCommon()<NEW_LINE>// with the result that this entity resolver is not used!<NEW_LINE>}<NEW_LINE>});<NEW_LINE>org.w3c.dom.Document doc = null;<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>byte[] bytes = outStream.toByteArray();<NEW_LINE>log.debug(new String(bytes));<NEW_LINE>doc = db.parse(new ByteArrayInputStream(bytes));<NEW_LINE>} else {<NEW_LINE>doc = db.parse(new ByteArrayInputStream(outStream.toByteArray()));<NEW_LINE>}<NEW_LINE>XmlSerializerUtil.serialize(new DOMSource(doc.getDocumentElement()), result, false, false);<NEW_LINE>}
htmlSettings, outStream, Docx4J.FLAG_EXPORT_PREFER_XSL);
1,457,642
private Map<PhysicalPlan, PartitionGroup> splitAndRoutePlan(InsertRowsOfOneDevicePlan plan) throws MetadataException {<NEW_LINE>Map<PhysicalPlan, PartitionGroup> result = new HashMap<>();<NEW_LINE>Map<PartitionGroup, List<InsertRowPlan>> <MASK><NEW_LINE>Map<PartitionGroup, List<Integer>> groupPlanIndexMap = new HashMap<>();<NEW_LINE>PartialPath storageGroup = SchemaProcessor().getBelongedStorageGroup(plan.getDevicePath());<NEW_LINE>for (int i = 0; i < plan.getRowPlans().length; i++) {<NEW_LINE>InsertRowPlan p = plan.getRowPlans()[i];<NEW_LINE>PartitionGroup group = partitionTable.route(storageGroup.getFullPath(), p.getTime());<NEW_LINE>List<InsertRowPlan> groupedPlans = groupPlanMap.computeIfAbsent(group, k -> new ArrayList<>());<NEW_LINE>List<Integer> groupedPlanIndex = groupPlanIndexMap.computeIfAbsent(group, k -> new ArrayList<>());<NEW_LINE>groupedPlans.add(p);<NEW_LINE>groupedPlanIndex.add(plan.getRowPlanIndexList()[i]);<NEW_LINE>}<NEW_LINE>for (Entry<PartitionGroup, List<InsertRowPlan>> entry : groupPlanMap.entrySet()) {<NEW_LINE>PhysicalPlan reducedPlan = new InsertRowsOfOneDevicePlan(plan.getDevicePath(), entry.getValue().toArray(new InsertRowPlan[0]), groupPlanIndexMap.get(entry.getKey()).stream().mapToInt(i -> i).toArray());<NEW_LINE>result.put(reducedPlan, entry.getKey());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
groupPlanMap = new HashMap<>();
544,747
public boolean shouldInterceptTouchEvent(MotionEvent ev, boolean moving, float diffX, float diffY) {<NEW_LINE>if (!mScrolled && mSlop < Math.abs(diffX) && Math.abs(diffY) < Math.abs(diffX)) {<NEW_LINE>// Horizontal scroll is maybe handled by ViewPager<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Scrollable scrollable = getCurrentScrollable();<NEW_LINE>if (scrollable == null) {<NEW_LINE>mScrolled = false;<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// If interceptionLayout can move, it should intercept.<NEW_LINE>// And once it begins to move, horizontal scroll shouldn't work any longer.<NEW_LINE>View toolbarView = getActivity().findViewById(R.id.toolbar);<NEW_LINE>int toolbarHeight = toolbarView.getHeight();<NEW_LINE>int translationY = (<MASK><NEW_LINE>boolean scrollingUp = 0 < diffY;<NEW_LINE>boolean scrollingDown = diffY < 0;<NEW_LINE>if (scrollingUp) {<NEW_LINE>if (translationY < 0) {<NEW_LINE>mScrolled = true;<NEW_LINE>mLastScrollState = ScrollState.UP;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} else if (scrollingDown) {<NEW_LINE>if (-toolbarHeight < translationY) {<NEW_LINE>mScrolled = true;<NEW_LINE>mLastScrollState = ScrollState.DOWN;<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mScrolled = false;<NEW_LINE>return false;<NEW_LINE>}
int) ViewHelper.getTranslationY(mInterceptionLayout);
1,171,024
private void pushByConstant(DismantleBytecode dbc, Constant c) {<NEW_LINE>if (c instanceof ConstantClass) {<NEW_LINE>push(new Item("Ljava/lang/Class;", ((ConstantClass) c).getConstantValue(dbc.getConstantPool())));<NEW_LINE>} else if (c instanceof ConstantInteger) {<NEW_LINE>push(new Item("I", Integer.valueOf(((ConstantInteger) c<MASK><NEW_LINE>} else if (c instanceof ConstantString) {<NEW_LINE>int s = ((ConstantString) c).getStringIndex();<NEW_LINE>push(new Item("Ljava/lang/String;", getStringFromIndex(dbc, s)));<NEW_LINE>} else if (c instanceof ConstantFloat) {<NEW_LINE>push(new Item("F", Float.valueOf(((ConstantFloat) c).getBytes())));<NEW_LINE>} else if (c instanceof ConstantDouble) {<NEW_LINE>push(new Item("D", Double.valueOf(((ConstantDouble) c).getBytes())));<NEW_LINE>} else if (c instanceof ConstantLong) {<NEW_LINE>push(new Item("J", Long.valueOf(((ConstantLong) c).getBytes())));<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException("StaticConstant type not expected");<NEW_LINE>}<NEW_LINE>}
).getBytes())));
549,458
public void run() {<NEW_LINE>try {<NEW_LINE>pref.clear();<NEW_LINE>} catch (BackingStoreException bsE) {<NEW_LINE>// NOI18N<NEW_LINE>ERR.log(Level.INFO, Utils.getBundleString("Err_StoreSettings"), bsE);<NEW_LINE>}<NEW_LINE>pref.putInt(PaletteController.ATTR_ICON_SIZE, _getIconSize(model));<NEW_LINE>pref.putBoolean(PaletteController.ATTR_SHOW_ITEM_NAMES, _getShowItemNames(model));<NEW_LINE>for (Category category : model.getCategories()) {<NEW_LINE>pref.putBoolean(category.getName() + '-' + PaletteController.ATTR_IS_VISIBLE, _isVisible(category));<NEW_LINE>pref.putBoolean(category.getName() + '-' + PaletteController.ATTR_IS_EXPANDED, _isExpanded(category));<NEW_LINE>for (Item item : category.getItems()) {<NEW_LINE>pref.putBoolean(category.getName() + '-' + item.getName() + '-' + PaletteController<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.ATTR_IS_VISIBLE, _isVisible(item));
1,775,063
protected void learnConnection(final FreeformConnection connection) {<NEW_LINE>// multiply the current and previous gradient, and take the<NEW_LINE>// sign. We want to see if the gradient has changed its sign.<NEW_LINE>final int change = EncogMath.sign(connection.getTempTraining(FreeformResilientPropagation.TEMP_GRADIENT) * connection.getTempTraining(FreeformResilientPropagation.TEMP_LAST_GRADIENT));<NEW_LINE>double weightChange = 0;<NEW_LINE>// if the gradient has retained its sign, then we increase the<NEW_LINE>// delta so that it will converge faster<NEW_LINE>if (change > 0) {<NEW_LINE>double delta = connection.getTempTraining(FreeformResilientPropagation.TEMP_UPDATE) * RPROPConst.POSITIVE_ETA;<NEW_LINE>delta = Math.min(delta, this.maxStep);<NEW_LINE>weightChange = EncogMath.sign(connection.getTempTraining(FreeformResilientPropagation.TEMP_GRADIENT)) * delta;<NEW_LINE>connection.setTempTraining(FreeformResilientPropagation.TEMP_UPDATE, delta);<NEW_LINE>connection.setTempTraining(FreeformResilientPropagation.TEMP_LAST_GRADIENT, connection.getTempTraining(FreeformResilientPropagation.TEMP_GRADIENT));<NEW_LINE>} else if (change < 0) {<NEW_LINE>// if change<0, then the sign has changed, and the last<NEW_LINE>// delta was too big<NEW_LINE>double delta = connection.getTempTraining(FreeformResilientPropagation.TEMP_UPDATE) * RPROPConst.NEGATIVE_ETA;<NEW_LINE>delta = Math.max(delta, RPROPConst.DELTA_MIN);<NEW_LINE>connection.setTempTraining(FreeformResilientPropagation.TEMP_UPDATE, delta);<NEW_LINE>weightChange = -connection.getTempTraining(FreeformResilientPropagation.TEMP_LAST_WEIGHT_DELTA);<NEW_LINE>// set the previous gradient to zero so that there will be no<NEW_LINE>// adjustment the next iteration<NEW_LINE>connection.setTempTraining(FreeformResilientPropagation.TEMP_LAST_GRADIENT, 0);<NEW_LINE>} else if (change == 0) {<NEW_LINE>// if change==0 then there is no change to the delta<NEW_LINE>final double delta = <MASK><NEW_LINE>weightChange = EncogMath.sign(connection.getTempTraining(FreeformResilientPropagation.TEMP_GRADIENT)) * delta;<NEW_LINE>connection.setTempTraining(FreeformResilientPropagation.TEMP_LAST_GRADIENT, connection.getTempTraining(FreeformResilientPropagation.TEMP_GRADIENT));<NEW_LINE>}<NEW_LINE>// apply the weight change, if any<NEW_LINE>connection.addWeight(weightChange);<NEW_LINE>connection.setTempTraining(FreeformResilientPropagation.TEMP_LAST_WEIGHT_DELTA, weightChange);<NEW_LINE>}
connection.getTempTraining(FreeformResilientPropagation.TEMP_UPDATE);
1,537,442
protected Object manageSerializedCollections(final Object self, final String fieldName, Object value) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {<NEW_LINE>if (value instanceof Collection<?>) {<NEW_LINE>if (value instanceof List) {<NEW_LINE>List<Object> docList = doc.field(fieldName, OType.EMBEDDEDLIST);<NEW_LINE>if (docList == null) {<NEW_LINE>docList <MASK><NEW_LINE>setDocFieldValue(fieldName, docList, OType.EMBEDDEDLIST);<NEW_LINE>}<NEW_LINE>value = new OObjectCustomSerializerList(OObjectEntitySerializer.getSerializedType(OObjectEntitySerializer.getField(fieldName, self.getClass())), doc, docList, (List<?>) value);<NEW_LINE>} else if (value instanceof Set) {<NEW_LINE>Set<Object> docSet = doc.field(fieldName, OType.EMBEDDEDSET);<NEW_LINE>if (docSet == null) {<NEW_LINE>docSet = new HashSet<Object>();<NEW_LINE>setDocFieldValue(fieldName, docSet, OType.EMBEDDEDSET);<NEW_LINE>}<NEW_LINE>value = new OObjectCustomSerializerSet(OObjectEntitySerializer.getSerializedType(OObjectEntitySerializer.getField(fieldName, self.getClass())), doc, docSet, (Set<?>) value);<NEW_LINE>}<NEW_LINE>} else if (value instanceof Map<?, ?>) {<NEW_LINE>Map<Object, Object> docMap = doc.field(fieldName, OType.EMBEDDEDMAP);<NEW_LINE>if (docMap == null) {<NEW_LINE>docMap = new HashMap<Object, Object>();<NEW_LINE>setDocFieldValue(fieldName, docMap, OType.EMBEDDEDMAP);<NEW_LINE>}<NEW_LINE>value = new OObjectCustomSerializerMap(OObjectEntitySerializer.getSerializedType(OObjectEntitySerializer.getField(fieldName, self.getClass())), doc, docMap, (Map<Object, Object>) value);<NEW_LINE>} else if (value.getClass().isArray()) {<NEW_LINE>value = manageArraySave(fieldName, (Object[]) value);<NEW_LINE>}<NEW_LINE>OObjectEntitySerializer.setFieldValue(OObjectEntitySerializer.getField(fieldName, self.getClass()), self, value);<NEW_LINE>return value;<NEW_LINE>}
= new ArrayList<Object>();
1,186,945
final GetContactAttributesResult executeGetContactAttributes(GetContactAttributesRequest getContactAttributesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getContactAttributesRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetContactAttributesRequest> request = null;<NEW_LINE>Response<GetContactAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetContactAttributesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getContactAttributesRequest));<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, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetContactAttributes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetContactAttributesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetContactAttributesResultJsonUnmarshaller());<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 awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,654,017
public void onDeath(@Nonnull DamageSource damageSource) {<NEW_LINE>super.onDeath(damageSource);<NEW_LINE>if (!world.isRemote && damageSource.getTrueSource() instanceof EntityPlayer) {<NEW_LINE>SlimeConf nextConf = SlimeConf.getConfForSize(getSlimeSize()).bigger();<NEW_LINE>if (nextConf != null && world.rand.nextFloat() <= nextConf.getChance()) {<NEW_LINE>EntityDireSlime spawn = new EntityDireSlime(world);<NEW_LINE>spawn.setSlimeSize(nextConf.size, true);<NEW_LINE>spawn.setLocationAndAngles(posX, <MASK><NEW_LINE>spawn.onInitialSpawn(world.getDifficultyForLocation(new BlockPos(this)), null);<NEW_LINE>if (SpawnUtil.isSpaceAvailableForSpawn(world, spawn, false)) {<NEW_LINE>world.spawnEntity(spawn);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
posY, posZ, rotationYaw, 0);
1,487,181
public static void assignProfilesToUser(Connection con, Long userId, List<String> allProfilesNmList, List<String> assignedProfilesNmList) throws SQLException {<NEW_LINE>for (String profileNm : allProfilesNmList) {<NEW_LINE>if (StringUtils.isNotEmpty(profileNm)) {<NEW_LINE>Long profileId = null;<NEW_LINE>PreparedStatement stmt = con.prepareStatement("select id from profiles p where lower(p.nm) like ?");<NEW_LINE>stmt.setString(1, profileNm.toLowerCase());<NEW_LINE>ResultSet rs = stmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>profileId = rs.getLong("id");<NEW_LINE>}<NEW_LINE>DBUtils.closeRs(rs);<NEW_LINE>DBUtils.closeStmt(stmt);<NEW_LINE>if (profileId != null) {<NEW_LINE>stmt = con.prepareStatement("delete from user_map where profile_id=?");<NEW_LINE>stmt.setLong(1, profileId);<NEW_LINE>stmt.execute();<NEW_LINE>DBUtils.closeStmt(stmt);<NEW_LINE>if (assignedProfilesNmList.contains(profileNm)) {<NEW_LINE>stmt = con.prepareStatement("insert into user_map (profile_id, user_id) values (?,?)");<NEW_LINE>stmt.setLong(1, profileId);<NEW_LINE><MASK><NEW_LINE>stmt.execute();<NEW_LINE>DBUtils.closeStmt(stmt);<NEW_LINE>}<NEW_LINE>// delete all unassigned keys by profile<NEW_LINE>PublicKeyDB.deleteUnassignedKeysByProfile(con, profileId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
stmt.setLong(2, userId);
1,490,176
public boolean visit(ClassInstanceCreation node) {<NEW_LINE>if (!hasChildrenChanges(node)) {<NEW_LINE>return doVisitUnchangedChildren(node);<NEW_LINE>}<NEW_LINE>int pos = rewriteOptionalQualifier(node, ClassInstanceCreation.EXPRESSION_PROPERTY, node.getStartPosition());<NEW_LINE>if (node.getAST().apiLevel() == JLS2_INTERNAL) {<NEW_LINE>pos = rewriteRequiredNode(node, INTERNAL_CIC_NAME_PROPERTY);<NEW_LINE>} else {<NEW_LINE>if (isChanged(node, ClassInstanceCreation.TYPE_ARGUMENTS_PROPERTY)) {<NEW_LINE>try {<NEW_LINE>// after 'new'<NEW_LINE>pos = getScanner().getTokenEndOffset(TerminalTokens.TokenNamenew, pos);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>rewriteOptionalTypeParameters(node, ClassInstanceCreation.TYPE_ARGUMENTS_PROPERTY, pos, " ", true, true);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>handleException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>voidVisit(node, ClassInstanceCreation.TYPE_ARGUMENTS_PROPERTY);<NEW_LINE>}<NEW_LINE>pos = rewriteRequiredNode(node, ClassInstanceCreation.TYPE_PROPERTY);<NEW_LINE>}<NEW_LINE>if (isChanged(node, ClassInstanceCreation.ARGUMENTS_PROPERTY)) {<NEW_LINE>try {<NEW_LINE>int startpos = getScanner().getTokenEndOffset(TerminalTokens.TokenNameLPAREN, pos);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>rewriteNodeList(node, ClassInstanceCreation.ARGUMENTS_PROPERTY, <MASK><NEW_LINE>} catch (CoreException e) {<NEW_LINE>handleException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>voidVisit(node, ClassInstanceCreation.ARGUMENTS_PROPERTY);<NEW_LINE>}<NEW_LINE>int kind = getChangeKind(node, ClassInstanceCreation.ANONYMOUS_CLASS_DECLARATION_PROPERTY);<NEW_LINE>if (kind == RewriteEvent.REMOVED) {<NEW_LINE>try {<NEW_LINE>pos = getScanner().getPreviousTokenEndOffset(TerminalTokens.TokenNameLBRACE, pos);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>handleException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// insert pos<NEW_LINE>pos = node.getStartPosition() + node.getLength();<NEW_LINE>}<NEW_LINE>rewriteNode(node, ClassInstanceCreation.ANONYMOUS_CLASS_DECLARATION_PROPERTY, pos, ASTRewriteFormatter.SPACE);<NEW_LINE>return false;<NEW_LINE>}
startpos, Util.EMPTY_STRING, ", ");
1,800,018
final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(tagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TagResourceRequest> request = null;<NEW_LINE>Response<TagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));<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, "drs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<TagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());<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());
873,243
public GeoShapeWithDocValuesFieldMapper build(MapperBuilderContext context) {<NEW_LINE>if (multiFieldsBuilder.hasMultiFields()) {<NEW_LINE>DEPRECATION_LOGGER.warn(DeprecationCategory.MAPPINGS, "geo_shape_multifields", "Adding multifields to [geo_shape] mappers has no effect and will be forbidden in future");<NEW_LINE>}<NEW_LINE>GeometryParser geometryParser = new GeometryParser(orientation.get().value().getAsBoolean(), coerce.get().value(), ignoreZValue.get().value());<NEW_LINE>GeoShapeParser parser = new GeoShapeParser(geometryParser, orientation.<MASK><NEW_LINE>GeoShapeWithDocValuesFieldType ft = new GeoShapeWithDocValuesFieldType(context.buildFullName(name), indexed.get(), hasDocValues.get(), orientation.get().value(), parser, geoFormatterFactory, meta.get());<NEW_LINE>return new GeoShapeWithDocValuesFieldMapper(name, ft, multiFieldsBuilder.build(this, context), copyTo.build(), new GeoShapeIndexer(orientation.get().value(), ft.name()), parser, this);<NEW_LINE>}
get().value());
594,829
protected void service(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {<NEW_LINE>String dispatch = (String) (req.getAttribute("dispatch"));<NEW_LINE>LOG.info("AsyncForwardServlet : Entering. dispatch = " + dispatch);<NEW_LINE><MASK><NEW_LINE>if (dispatch == null || dispatch.isEmpty()) {<NEW_LINE>LOG.info("CDIAsyncServlet : About to forward the request.");<NEW_LINE>pw.println("CDIAsyncServlet : About to forward the request.");<NEW_LINE>req.setAttribute("dispatch", DISP1);<NEW_LINE>RequestDispatcher disp = req.getRequestDispatcher("/CDIAsyncServlet");<NEW_LINE>disp.forward(req, res);<NEW_LINE>} else if (dispatch.equals(DISP1)) {<NEW_LINE>// start async<NEW_LINE>LOG.info("CDIAsyncServlet : About to start async do dispacth");<NEW_LINE>pw.println("CDIAsyncServlet : About to start async do dispacth");<NEW_LINE>AsyncContext ac = req.startAsync(req, res);<NEW_LINE>AsyncListener acl = ac.createListener(CDIAsyncListener.class);<NEW_LINE>ac.addListener(acl, req, res);<NEW_LINE>req.setAttribute("dispatch", DISP2);<NEW_LINE>ac.dispatch();<NEW_LINE>} else if (dispatch.equals(DISP2)) {<NEW_LINE>LOG.info("CDIAsyncServlet : in disptch about to start async and complete");<NEW_LINE>pw.println("CDIAsyncServlet : in disptch about to start async and complete");<NEW_LINE>AsyncContext ac = req.startAsync(req, res);<NEW_LINE>ac.complete();<NEW_LINE>}<NEW_LINE>}
PrintWriter pw = res.getWriter();
1,070,155
public Size apply(MethodVisitor methodVisitor, Context implementationContext, MethodDescription instrumentedMethod) {<NEW_LINE>if (instrumentedMethod.isStatic()) {<NEW_LINE>throw new IllegalStateException("toString method must not be static: " + instrumentedMethod);<NEW_LINE>} else if (!instrumentedMethod.getReturnType().asErasure().isAssignableFrom(String.class)) {<NEW_LINE>throw new IllegalStateException("toString method does not return String-compatible type: " + instrumentedMethod);<NEW_LINE>}<NEW_LINE>List<StackManipulation> stackManipulations = new ArrayList<StackManipulation>(Math.max(0, fieldDescriptions.size() * 7 - 2) + 10);<NEW_LINE>stackManipulations.add(TypeCreation.of(TypeDescription.ForLoadedType.of(StringBuilder.class)));<NEW_LINE>stackManipulations.add(Duplication.SINGLE);<NEW_LINE>stackManipulations.add(new TextConstant(prefix));<NEW_LINE>stackManipulations.add(MethodInvocation.invoke(STRING_BUILDER_CONSTRUCTOR));<NEW_LINE>stackManipulations.add(new TextConstant(start));<NEW_LINE><MASK><NEW_LINE>boolean first = true;<NEW_LINE>for (FieldDescription.InDefinedShape fieldDescription : fieldDescriptions) {<NEW_LINE>if (first) {<NEW_LINE>first = false;<NEW_LINE>} else {<NEW_LINE>stackManipulations.add(new TextConstant(separator));<NEW_LINE>stackManipulations.add(ValueConsumer.STRING);<NEW_LINE>}<NEW_LINE>stackManipulations.add(new TextConstant(fieldDescription.getName() + definer));<NEW_LINE>stackManipulations.add(ValueConsumer.STRING);<NEW_LINE>stackManipulations.add(MethodVariableAccess.loadThis());<NEW_LINE>stackManipulations.add(FieldAccess.forField(fieldDescription).read());<NEW_LINE>stackManipulations.add(ValueConsumer.of(fieldDescription.getType().asErasure()));<NEW_LINE>}<NEW_LINE>stackManipulations.add(new TextConstant(end));<NEW_LINE>stackManipulations.add(ValueConsumer.STRING);<NEW_LINE>stackManipulations.add(MethodInvocation.invoke(TO_STRING));<NEW_LINE>stackManipulations.add(MethodReturn.REFERENCE);<NEW_LINE>return new Size(new StackManipulation.Compound(stackManipulations).apply(methodVisitor, implementationContext).getMaximalSize(), instrumentedMethod.getStackSize());<NEW_LINE>}
stackManipulations.add(ValueConsumer.STRING);
120,465
public GHPoint intermediatePoint(double f, double lat1, double lon1, double lat2, double lon2) {<NEW_LINE>double lat1radians = Math.toRadians(lat1);<NEW_LINE>double lon1radians = Math.toRadians(lon1);<NEW_LINE>double lat2radians = Math.toRadians(lat2);<NEW_LINE>double lon2radians = Math.toRadians(lon2);<NEW_LINE>// This formula is taken from: (http://www.movable-type.co.uk/scripts/latlong.html -> https://github.com/chrisveness/geodesy MIT)<NEW_LINE>double deltaLat = lat2radians - lat1radians;<NEW_LINE>double deltaLon = lon2radians - lon1radians;<NEW_LINE>double cosLat1 = cos(lat1radians);<NEW_LINE>double cosLat2 = cos(lat2radians);<NEW_LINE>double sinHalfDeltaLat = sin(deltaLat / 2);<NEW_LINE>double sinHalfDeltaLon = sin(deltaLon / 2);<NEW_LINE>double a = sinHalfDeltaLat * sinHalfDeltaLat + cosLat1 * cosLat2 * sinHalfDeltaLon * sinHalfDeltaLon;<NEW_LINE>double angularDistance = 2 * Math.atan2(Math.sqrt(a), Math<MASK><NEW_LINE>double sinDistance = sin(angularDistance);<NEW_LINE>if (angularDistance == 0)<NEW_LINE>return new GHPoint(lat1, lon1);<NEW_LINE>double A = Math.sin((1 - f) * angularDistance) / sinDistance;<NEW_LINE>double B = Math.sin(f * angularDistance) / sinDistance;<NEW_LINE>double x = A * cosLat1 * cos(lon1radians) + B * cosLat2 * cos(lon2radians);<NEW_LINE>double y = A * cosLat1 * sin(lon1radians) + B * cosLat2 * sin(lon2radians);<NEW_LINE>double z = A * sin(lat1radians) + B * sin(lat2radians);<NEW_LINE>double midLat = Math.toDegrees(Math.atan2(z, Math.sqrt(x * x + y * y)));<NEW_LINE>double midLon = Math.toDegrees(Math.atan2(y, x));<NEW_LINE>return new GHPoint(midLat, midLon);<NEW_LINE>}
.sqrt(1 - a));
1,297,037
// -------------------------------------------------------------------------<NEW_LINE>@Override<NEW_LINE>public CurrencyParameterSensitivities parameterSensitivity(FxForwardSensitivity pointSensitivity) {<NEW_LINE>// use the specified base currency to determine the desired currency pair<NEW_LINE>// then derive sensitivity from discount factors based off desired currency pair, not that of the index<NEW_LINE>CurrencyPair currencyPair = pointSensitivity.getCurrencyPair();<NEW_LINE>Currency refBaseCurrency = pointSensitivity.getReferenceCurrency();<NEW_LINE>Currency refCounterCurrency = pointSensitivity.getReferenceCounterCurrency();<NEW_LINE>Currency sensitivityCurrency = pointSensitivity.getCurrency();<NEW_LINE>LocalDate referenceDate = pointSensitivity.getReferenceDate();<NEW_LINE>boolean inverse = refBaseCurrency.equals(currencyPair.getCounter());<NEW_LINE>DiscountFactors discountFactorsRefBase = (inverse ? counterCurrencyDiscountFactors : baseCurrencyDiscountFactors);<NEW_LINE>DiscountFactors discountFactorsRefCounter = (inverse ? baseCurrencyDiscountFactors : counterCurrencyDiscountFactors);<NEW_LINE>double dfCcyBaseAtMaturity = discountFactorsRefBase.discountFactor(referenceDate);<NEW_LINE>double dfCcyCounterAtMaturityInv = 1d / discountFactorsRefCounter.discountFactor(referenceDate);<NEW_LINE>double fxRate = fxRateProvider.fxRate(refBaseCurrency, refCounterCurrency);<NEW_LINE>ZeroRateSensitivity dfCcyBaseAtMaturitySensitivity = discountFactorsRefBase.zeroRatePointSensitivity(referenceDate, sensitivityCurrency).multipliedBy(fxRate * dfCcyCounterAtMaturityInv * pointSensitivity.getSensitivity());<NEW_LINE>ZeroRateSensitivity dfCcyCounterAtMaturitySensitivity = discountFactorsRefCounter.zeroRatePointSensitivity(referenceDate, sensitivityCurrency).multipliedBy(-fxRate * dfCcyBaseAtMaturity * dfCcyCounterAtMaturityInv * <MASK><NEW_LINE>return discountFactorsRefBase.parameterSensitivity(dfCcyBaseAtMaturitySensitivity).combinedWith(discountFactorsRefCounter.parameterSensitivity(dfCcyCounterAtMaturitySensitivity));<NEW_LINE>}
dfCcyCounterAtMaturityInv * pointSensitivity.getSensitivity());
1,324,065
protected void eventNotificationsCompleted(PvmExecutionImpl execution) {<NEW_LINE>PvmActivity activity = execution.getActivity();<NEW_LINE>if (execution.isScope() && (executesNonScopeActivity(execution) || isAsyncBeforeActivity(execution)) && !CompensationBehavior.executesNonScopeCompensationHandler(execution)) {<NEW_LINE>execution.removeAllTasks();<NEW_LINE>// case this is a scope execution and the activity is not a scope<NEW_LINE>execution.leaveActivityInstance();<NEW_LINE>execution.setActivity(getFlowScopeActivity(activity));<NEW_LINE>execution.performOperation(DELETE_CASCADE_FIRE_ACTIVITY_END);<NEW_LINE>} else {<NEW_LINE>if (execution.isScope()) {<NEW_LINE>if (execution instanceof ExecutionEntity && !execution.isProcessInstanceExecution() && execution.isCanceled()) {<NEW_LINE>// execution was canceled and output mapping for activity is marked as skippable<NEW_LINE>execution.setSkipIoMappings(execution.isSkipIoMappings() || execution.getProcessEngine().getProcessEngineConfiguration().isSkipOutputMappingOnCanceledActivities());<NEW_LINE>}<NEW_LINE>execution.destroy();<NEW_LINE>}<NEW_LINE>// remove this execution and its concurrent parent (if exists)<NEW_LINE>execution.remove();<NEW_LINE>boolean continueRemoval = !execution.isDeleteRoot();<NEW_LINE>if (continueRemoval) {<NEW_LINE>PvmExecutionImpl propagatingExecution = execution.getParent();<NEW_LINE>if (propagatingExecution != null && !propagatingExecution.isScope() && !propagatingExecution.hasChildren()) {<NEW_LINE>propagatingExecution.remove();<NEW_LINE>continueRemoval = !propagatingExecution.isDeleteRoot();<NEW_LINE>propagatingExecution = propagatingExecution.getParent();<NEW_LINE>}<NEW_LINE>if (continueRemoval) {<NEW_LINE>if (propagatingExecution != null) {<NEW_LINE>// continue deletion with the next scope execution<NEW_LINE>// set activity on parent in case the parent is an inactive scope execution and activity has been set to 'null'.<NEW_LINE>if (propagatingExecution.getActivity() == null && activity != null && activity.getFlowScope() != null) {<NEW_LINE>propagatingExecution<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.setActivity(getFlowScopeActivity(activity));
1,310,487
private void changeKeyAuthentication() {<NEW_LINE>boolean enabled = keyAuthButton.getSelection();<NEW_LINE>if (enabled) {<NEW_LINE>FileDialog dlg;<NEW_LINE>String ssh_home = SecureUtils.getSSH_HOME();<NEW_LINE>while (true) {<NEW_LINE>dlg = new FileDialog(getShell(), SWT.OPEN);<NEW_LINE>dlg.setText(Messages.CommonFTPConnectionPointPropertyDialog_SpecifyPrivateKey);<NEW_LINE>if (ssh_home != null && ssh_home.length() != 0) {<NEW_LINE>File dir = new File(ssh_home);<NEW_LINE>if (dir.exists() && dir.isDirectory()) {<NEW_LINE>dlg.setFilterPath(ssh_home);<NEW_LINE>for (String key : SecureUtils.getPrivateKeys()) {<NEW_LINE>if (new File(dir, key).exists()) {<NEW_LINE>dlg.setFileName(key);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String keyFilePath = dlg.open();<NEW_LINE>if (keyFilePath == null) {<NEW_LINE>keyAuthButton.setSelection(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>boolean passphraseProtected = SecureUtils.isKeyPassphraseProtected(new File(keyFilePath));<NEW_LINE>makeVisible(passwordLabel, passphraseProtected);<NEW_LINE>makeVisible(passwordText, passphraseProtected);<NEW_LINE>makeVisible(savePasswordButton, passphraseProtected);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>UIUtils.showErrorMessage(Messages.<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>keyPathLabel.setText(keyFilePath);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>// $NON-NLS-1$<NEW_LINE>passwordText.setText("");<NEW_LINE>} else {<NEW_LINE>keyPathLabel.setText(Messages.CommonFTPConnectionPointPropertyDialog_NoPrivateKeySelected);<NEW_LINE>makeVisible(passwordLabel, true);<NEW_LINE>makeVisible(passwordText, true);<NEW_LINE>makeVisible(savePasswordButton, true);<NEW_LINE>}<NEW_LINE>updateLayout();<NEW_LINE>passwordLabel.setText(StringUtil.makeFormLabel(enabled ? Messages.CommonFTPConnectionPointPropertyDialog_Passphrase : Messages.CommonFTPConnectionPointPropertyDialog_Password));<NEW_LINE>savePasswordButton.setSelection(false);<NEW_LINE>}
CommonFTPConnectionPointPropertyDialog_ERR_PrivateKey, e.getLocalizedMessage());
748,346
public void onPrepareOptionsMenu(@NonNull Menu menu) {<NEW_LINE>super.onPrepareOptionsMenu(menu);<NEW_LINE>menu.findItem(R.id.menu_favorite).setVisible(false);<NEW_LINE>menu.findItem(R.id<MASK><NEW_LINE>menu.findItem(R.id.menu_preview).setVisible(false);<NEW_LINE>menu.findItem(R.id.menu_cancel).setVisible(false);<NEW_LINE>menu.findItem(R.id.menu_delete).setVisible(false);<NEW_LINE>menu.findItem(R.id.menu_share).setVisible(false);<NEW_LINE>menu.findItem(R.id.menu_move).setVisible(false);<NEW_LINE>menu.findItem(R.id.menu_category).setVisible(false);<NEW_LINE>menu.findItem(R.id.menu_title).setVisible(false);<NEW_LINE>if (menu.findItem(MENU_ID_PIN) != null)<NEW_LINE>menu.findItem(MENU_ID_PIN).setVisible(false);<NEW_LINE>}
.menu_edit).setVisible(false);
255,472
static AoFaceData weightedMean(AoFaceData in0, float w0, AoFaceData in1, float w1, AoFaceData out) {<NEW_LINE>out.a0 = in0.a0 * w0 + in1.a0 * w1;<NEW_LINE>out.a1 = in0.a1 * w0 + in1.a1 * w1;<NEW_LINE>out.a2 = in0.a2 * w0 + in1.a2 * w1;<NEW_LINE>out.a3 = in0.a3 <MASK><NEW_LINE>out.b0 = (int) (in0.b0 * w0 + in1.b0 * w1);<NEW_LINE>out.b1 = (int) (in0.b1 * w0 + in1.b1 * w1);<NEW_LINE>out.b2 = (int) (in0.b2 * w0 + in1.b2 * w1);<NEW_LINE>out.b3 = (int) (in0.b3 * w0 + in1.b3 * w1);<NEW_LINE>out.s0 = (int) (in0.s0 * w0 + in1.s0 * w1);<NEW_LINE>out.s1 = (int) (in0.s1 * w0 + in1.s1 * w1);<NEW_LINE>out.s2 = (int) (in0.s2 * w0 + in1.s2 * w1);<NEW_LINE>out.s3 = (int) (in0.s3 * w0 + in1.s3 * w1);<NEW_LINE>return out;<NEW_LINE>}
* w0 + in1.a3 * w1;
594,440
void positionPathAttributes(FloatRect start, FloatRect end, float x, float y, String[] attribute, float[] value) {<NEW_LINE>float startCenterX = start.centerX();<NEW_LINE>float startCenterY = start.centerY();<NEW_LINE>float endCenterX = end.centerX();<NEW_LINE><MASK><NEW_LINE>float pathVectorX = endCenterX - startCenterX;<NEW_LINE>float pathVectorY = endCenterY - startCenterY;<NEW_LINE>float distance = (float) Math.hypot(pathVectorX, pathVectorY);<NEW_LINE>if (distance < 0.0001) {<NEW_LINE>System.out.println("distance ~ 0");<NEW_LINE>value[0] = 0;<NEW_LINE>value[1] = 0;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>float dx = pathVectorX / distance;<NEW_LINE>float dy = pathVectorY / distance;<NEW_LINE>float perpendicular = (dx * (y - startCenterY) - (x - startCenterX) * dy) / distance;<NEW_LINE>float dist = (dx * (x - startCenterX) + dy * (y - startCenterY)) / distance;<NEW_LINE>if (attribute[0] != null) {<NEW_LINE>if (PositionType.S_PERCENT_X.equals(attribute[0])) {<NEW_LINE>value[0] = dist;<NEW_LINE>value[1] = perpendicular;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>attribute[0] = PositionType.S_PERCENT_X;<NEW_LINE>attribute[1] = PositionType.S_PERCENT_Y;<NEW_LINE>value[0] = dist;<NEW_LINE>value[1] = perpendicular;<NEW_LINE>}<NEW_LINE>}
float endCenterY = end.centerY();
1,187,716
public static String serializeToJson(Histogram histogram) {<NEW_LINE>if (histogram == null) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>String type = StatisticUtils.encodeDataType(histogram.dataType);<NEW_LINE>JSONObject histogramJson = new JSONObject();<NEW_LINE>histogramJson.put("type", type);<NEW_LINE>histogramJson.put("maxBucketSize", histogram.maxBucketSize);<NEW_LINE>histogramJson.<MASK><NEW_LINE>JSONArray bucketsJsonArray = new JSONArray();<NEW_LINE>histogramJson.put("buckets", bucketsJsonArray);<NEW_LINE>for (Bucket bucket : histogram.buckets) {<NEW_LINE>JSONObject bucketJson = new JSONObject();<NEW_LINE>bucketJson.put("count", bucket.count);<NEW_LINE>bucketJson.put("ndv", bucket.ndv);<NEW_LINE>bucketJson.put("preSum", bucket.preSum);<NEW_LINE>if (type.equalsIgnoreCase("String") || type.equalsIgnoreCase("Timestamp") || type.equalsIgnoreCase("Time") || type.equalsIgnoreCase("Date")) {<NEW_LINE>bucketJson.put("upper", bucket.upper.toString());<NEW_LINE>bucketJson.put("lower", bucket.lower.toString());<NEW_LINE>} else {<NEW_LINE>bucketJson.put("upper", bucket.upper);<NEW_LINE>bucketJson.put("lower", bucket.lower);<NEW_LINE>}<NEW_LINE>bucketsJsonArray.add(bucketJson);<NEW_LINE>}<NEW_LINE>return histogramJson.toJSONString();<NEW_LINE>}
put("sampleRate", histogram.sampleRate);
1,644,466
public Pair<Expression, Concrete.Expression> visitClass(Concrete.ClassDefinition def, Definition params) {<NEW_LINE>ClassDefinition coreDef;<NEW_LINE>if (params instanceof ClassDefinition)<NEW_LINE>coreDef = (ClassDefinition) params;<NEW_LINE>else<NEW_LINE>return null;<NEW_LINE>var desugared = def.getStage().ordinal() >= Concrete.Stage.DESUGARIZED.ordinal();<NEW_LINE>for (Concrete.ClassElement concreteRaw : def.getElements()) if (concreteRaw instanceof Concrete.ClassField) {<NEW_LINE>var concrete = (Concrete.ClassField) concreteRaw;<NEW_LINE>TCFieldReferable referable = concrete.getData();<NEW_LINE>Optional<Expression> field = coreDef.getFields().stream().filter(classField -> classField.getReferable() == referable).map(ClassField::getResultType).findFirst();<NEW_LINE>if (field.isEmpty())<NEW_LINE>continue;<NEW_LINE>Expression fieldExpr = field.get();<NEW_LINE>var parameters = concrete.getParameters();<NEW_LINE>if (desugared && !parameters.isEmpty()) {<NEW_LINE>// Clone the list and remove the first "this" parameter if already desugared<NEW_LINE>parameters = parameters.subList(1, parameters.size());<NEW_LINE>}<NEW_LINE>var accept = !parameters.isEmpty() && fieldExpr instanceof PiExpression ? visitor.visitPiImpl(parameters, concrete.getResultType(), (PiExpression) fieldExpr) : concrete.getResultType().accept(visitor, fieldExpr);<NEW_LINE>if (accept != null)<NEW_LINE>return accept;<NEW_LINE>} else if (concreteRaw instanceof Concrete.ClassFieldImpl) {<NEW_LINE>var concrete = (Concrete.ClassFieldImpl) concreteRaw;<NEW_LINE><MASK><NEW_LINE>Optional<AbsExpression> field = coreDef.getFields().stream().filter(o -> o.getReferable() == implementedField).findFirst().map(coreDef::getImplementation);<NEW_LINE>if (field.isEmpty())<NEW_LINE>continue;<NEW_LINE>// The binding is `this` I believe<NEW_LINE>var accept = concrete.implementation == null ? null : concrete.implementation.accept(visitor, field.get().getExpression());<NEW_LINE>if (accept != null)<NEW_LINE>return accept;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
Referable implementedField = concrete.getImplementedField();
1,424,754
final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<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, "Migration Hub Refactor Spaces");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<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 awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,817,281
public MultiNormalizerMinMaxScaler restore(@NonNull InputStream stream) throws IOException {<NEW_LINE>DataInputStream dis = new DataInputStream(stream);<NEW_LINE>boolean fitLabels = dis.readBoolean();<NEW_LINE>int numInputs = dis.readInt();<NEW_LINE>int numOutputs = dis.readInt();<NEW_LINE>double targetMin = dis.readDouble();<NEW_LINE>double targetMax = dis.readDouble();<NEW_LINE>MultiNormalizerMinMaxScaler result = new MultiNormalizerMinMaxScaler(targetMin, targetMax);<NEW_LINE>result.fitLabel(fitLabels);<NEW_LINE>List<MinMaxStats> featureStats = new ArrayList<>();<NEW_LINE>for (int i = 0; i < numInputs; i++) {<NEW_LINE>featureStats.add(new MinMaxStats(Nd4j.read(dis), Nd4j.read(dis)));<NEW_LINE>}<NEW_LINE>result.setFeatureStats(featureStats);<NEW_LINE>if (fitLabels) {<NEW_LINE>List<MinMaxStats> <MASK><NEW_LINE>for (int i = 0; i < numOutputs; i++) {<NEW_LINE>labelStats.add(new MinMaxStats(Nd4j.read(dis), Nd4j.read(dis)));<NEW_LINE>}<NEW_LINE>result.setLabelStats(labelStats);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
labelStats = new ArrayList<>();