idx
int32 46
1.86M
| input
stringlengths 321
6.6k
| target
stringlengths 9
1.24k
|
|---|---|---|
724,411
|
private Object readMark1(int b) throws IOException {<NEW_LINE>switch(b) {<NEW_LINE>case ObjectWriter.INT16:<NEW_LINE>return ObjectCache.getInteger(readUInt16());<NEW_LINE>// return new Integer(readUInt16());<NEW_LINE>case ObjectWriter.INT32:<NEW_LINE>return new Integer(readInt32());<NEW_LINE>case ObjectWriter.FLOAT16:<NEW_LINE>int n = readUInt16();<NEW_LINE>switch(n >>> 14) {<NEW_LINE>case 0:<NEW_LINE>return new Double(n & 0x3FFF);<NEW_LINE>case 1:<NEW_LINE>return new Double((n & 0x3FFF) / 100.0);<NEW_LINE>case 2:<NEW_LINE>return new Double(<MASK><NEW_LINE>default:<NEW_LINE>return new Double((n & 0x3FFF) * 100);<NEW_LINE>}<NEW_LINE>case ObjectWriter.FLOAT32:<NEW_LINE>n = readInt32();<NEW_LINE>switch(n >>> 30) {<NEW_LINE>case 0:<NEW_LINE>return new Double(n & 0x3FFFFFFF);<NEW_LINE>case 1:<NEW_LINE>return new Double((n & 0x3FFFFFFF) / 100.0);<NEW_LINE>case 2:<NEW_LINE>return new Double((n & 0x3FFFFFFF) / 10000.0);<NEW_LINE>default:<NEW_LINE>return new Double((n & 0x3FFFFFFF) * 100);<NEW_LINE>}<NEW_LINE>case ObjectWriter.FLOAT64:<NEW_LINE>return new Double(Double.longBitsToDouble(readLong64()));<NEW_LINE>case ObjectWriter.LONG16:<NEW_LINE>return new Long(readUInt16());<NEW_LINE>case ObjectWriter.LONG32:<NEW_LINE>return new Long(readInt32());<NEW_LINE>default:<NEW_LINE>return new Long(readLong64());<NEW_LINE>}<NEW_LINE>}
|
(n & 0x3FFF) / 10000.0);
|
1,790,065
|
private boolean isValid(Schema schema, IndexingConfig indexingConfig) {<NEW_LINE>// 1. Make sure that the sorted column is not a multi-value field.<NEW_LINE>List<String<MASK><NEW_LINE>boolean isValid = true;<NEW_LINE>if (CollectionUtils.isNotEmpty(sortedColumns)) {<NEW_LINE>final String sortedColumn = sortedColumns.get(0);<NEW_LINE>if (sortedColumns.size() > 1) {<NEW_LINE>_logger.warn("More than one sorted column configured. Using {}", sortedColumn);<NEW_LINE>}<NEW_LINE>FieldSpec fieldSpec = schema.getFieldSpecFor(sortedColumn);<NEW_LINE>if (!fieldSpec.isSingleValueField()) {<NEW_LINE>_logger.error("Cannot configure multi-valued column {} as sorted column", sortedColumn);<NEW_LINE>isValid = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// 2. We want to get the schema errors, if any, even if isValid is false;<NEW_LINE>try {<NEW_LINE>SchemaUtils.validate(schema);<NEW_LINE>} catch (Exception e) {<NEW_LINE>_logger.error("Caught exception while validating schema: {}", schema.getSchemaName(), e);<NEW_LINE>isValid = false;<NEW_LINE>}<NEW_LINE>return isValid;<NEW_LINE>}
|
> sortedColumns = indexingConfig.getSortedColumn();
|
899,703
|
public boolean checkTargetVersion(TargetVersion targetVersion) {<NEW_LINE>Config tlsConfig = getTlsConfig();<NEW_LINE>tlsConfig.setFiltersKeepUserSettings(false);<NEW_LINE>WorkflowConfigurationFactory factory = new WorkflowConfigurationFactory(tlsConfig);<NEW_LINE>WorkflowTrace workflowTrace = factory.createTlsEntryWorkflowTrace(tlsConfig.getDefaultClientConnection());<NEW_LINE>workflowTrace.addTlsAction(new SendAction(new ClientHelloMessage(tlsConfig)));<NEW_LINE>List<ProtocolMessage> messageList = new LinkedList<>();<NEW_LINE>messageList.add(new ServerHelloMessage(tlsConfig));<NEW_LINE>messageList.<MASK><NEW_LINE>messageList.add(new ServerHelloDoneMessage(tlsConfig));<NEW_LINE>workflowTrace.addTlsAction(new ReceiveAction(messageList));<NEW_LINE>ChangeCipherSpecMessage changeCipherSpecMessage = new ChangeCipherSpecMessage(tlsConfig);<NEW_LINE>workflowTrace.addTlsAction(new SendAction(changeCipherSpecMessage));<NEW_LINE>byte[] emptyMasterSecret = new byte[0];<NEW_LINE>workflowTrace.addTlsAction(new ChangeMasterSecretAction(emptyMasterSecret));<NEW_LINE>workflowTrace.addTlsAction(new ActivateEncryptionAction());<NEW_LINE>workflowTrace.addTlsAction(new EarlyCcsAction(targetVersion == TargetVersion.OPENSSL_1_0_0));<NEW_LINE>if (targetVersion != TargetVersion.OPENSSL_1_0_0) {<NEW_LINE>workflowTrace.addTlsAction(new ChangeMasterSecretAction(emptyMasterSecret));<NEW_LINE>}<NEW_LINE>workflowTrace.addTlsAction(new SendAction(new FinishedMessage(tlsConfig)));<NEW_LINE>messageList = new LinkedList<>();<NEW_LINE>messageList.add(new ChangeCipherSpecMessage(tlsConfig));<NEW_LINE>messageList.add(new FinishedMessage(tlsConfig));<NEW_LINE>workflowTrace.addTlsAction(new ReceiveAction(messageList));<NEW_LINE>State state = new State(tlsConfig, workflowTrace);<NEW_LINE>WorkflowExecutor workflowExecutor = WorkflowExecutorFactory.createWorkflowExecutor(tlsConfig.getWorkflowExecutorType(), state);<NEW_LINE>workflowExecutor.executeWorkflow();<NEW_LINE>if (WorkflowTraceUtil.didReceiveMessage(ProtocolMessageType.ALERT, workflowTrace)) {<NEW_LINE>CONSOLE.info("Not vulnerable (definitely), Alert message found");<NEW_LINE>return false;<NEW_LINE>} else if (WorkflowTraceUtil.didReceiveMessage(HandshakeMessageType.FINISHED, workflowTrace)) {<NEW_LINE>CONSOLE.warn("Vulnerable (definitely), Finished message found");<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>CONSOLE.info("Not vulnerable (probably), No Finished message found, yet also no alert");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
|
add(new CertificateMessage(tlsConfig));
|
342,015
|
public ResponseEntity<Void> updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws RestClientException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'petId' is set<NEW_LINE>if (petId == null) {<NEW_LINE>throw new HttpClientErrorException(HttpStatus.BAD_REQUEST, "Missing the required parameter 'petId' when calling updatePetWithForm");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>final Map<String, Object> uriVariables = new HashMap<String, Object>();<NEW_LINE>uriVariables.put("petId", petId);<NEW_LINE>final MultiValueMap<String, String> localVarQueryParams = new LinkedMultiValueMap<String, String>();<NEW_LINE><MASK><NEW_LINE>final MultiValueMap<String, String> localVarCookieParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final MultiValueMap<String, Object> localVarFormParams = new LinkedMultiValueMap<String, Object>();<NEW_LINE>if (name != null)<NEW_LINE>localVarFormParams.add("name", name);<NEW_LINE>if (status != null)<NEW_LINE>localVarFormParams.add("status", status);<NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final List<MediaType> localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "application/x-www-form-urlencoded" };<NEW_LINE>final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "petstore_auth" };<NEW_LINE>ParameterizedTypeReference<Void> localReturnType = new ParameterizedTypeReference<Void>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI("/pet/{petId}", HttpMethod.POST, uriVariables, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);<NEW_LINE>}
|
final HttpHeaders localVarHeaderParams = new HttpHeaders();
|
832,068
|
void migrateValueAcrossLists(AWTEvent event) {<NEW_LINE>Object source = event.getSource();<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>List<ListElement> selObjects = (source == bAdd || source == noList) ? noList.getSelectedValuesList<MASK><NEW_LINE>for (ListElement itemSelected : selObjects) {<NEW_LINE>if (itemSelected == null || !itemSelected.isUpdateable())<NEW_LINE>continue;<NEW_LINE>//<NEW_LINE>if (source == bAdd || source == noList) {<NEW_LINE>noModel.removeElement(itemSelected);<NEW_LINE>yesModel.addElement(itemSelected);<NEW_LINE>yesList.setSelectedValue(itemSelected, true);<NEW_LINE>} else {<NEW_LINE>yesModel.removeElement(itemSelected);<NEW_LINE>noModel.addElement(itemSelected);<NEW_LINE>noList.setSelectedValue(itemSelected, true);<NEW_LINE>}<NEW_LINE>// Enable explicit Save<NEW_LINE>setIsChanged(true);<NEW_LINE>}<NEW_LINE>}
|
() : yesList.getSelectedValuesList();
|
541,952
|
final GetEbsDefaultKmsKeyIdResult executeGetEbsDefaultKmsKeyId(GetEbsDefaultKmsKeyIdRequest getEbsDefaultKmsKeyIdRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getEbsDefaultKmsKeyIdRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetEbsDefaultKmsKeyIdRequest> request = null;<NEW_LINE>Response<GetEbsDefaultKmsKeyIdResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetEbsDefaultKmsKeyIdRequestMarshaller().marshall(super.beforeMarshalling(getEbsDefaultKmsKeyIdRequest));<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, "EC2");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetEbsDefaultKmsKeyIdResult> responseHandler = new StaxResponseHandler<GetEbsDefaultKmsKeyIdResult>(new GetEbsDefaultKmsKeyIdResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
|
addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetEbsDefaultKmsKeyId");
|
768,748
|
private void validate(APIAttachSecurityGroupToL3NetworkMsg msg) {<NEW_LINE>SimpleQuery<SecurityGroupL3NetworkRefVO> q = dbf.createQuery(SecurityGroupL3NetworkRefVO.class);<NEW_LINE>q.add(SecurityGroupL3NetworkRefVO_.l3NetworkUuid, Op.EQ, msg.getL3NetworkUuid());<NEW_LINE>q.add(SecurityGroupL3NetworkRefVO_.securityGroupUuid, Op.<MASK><NEW_LINE>if (q.isExists()) {<NEW_LINE>throw new ApiMessageInterceptionException(operr("security group[uuid:%s] has attached to l3Network[uuid:%s], can't attach again", msg.getSecurityGroupUuid(), msg.getL3NetworkUuid()));<NEW_LINE>}<NEW_LINE>SimpleQuery<NetworkServiceL3NetworkRefVO> nq = dbf.createQuery(NetworkServiceL3NetworkRefVO.class);<NEW_LINE>nq.add(NetworkServiceL3NetworkRefVO_.l3NetworkUuid, Op.EQ, msg.getL3NetworkUuid());<NEW_LINE>nq.add(NetworkServiceL3NetworkRefVO_.networkServiceType, Op.EQ, SecurityGroupConstant.SECURITY_GROUP_NETWORK_SERVICE_TYPE);<NEW_LINE>if (!nq.isExists()) {<NEW_LINE>throw new ApiMessageInterceptionException(argerr("the L3 network[uuid:%s] doesn't have the network service type[%s] enabled", msg.getL3NetworkUuid(), SecurityGroupConstant.SECURITY_GROUP_NETWORK_SERVICE_TYPE));<NEW_LINE>}<NEW_LINE>}
|
EQ, msg.getSecurityGroupUuid());
|
905,210
|
public SubmitTaskStateChangeResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SubmitTaskStateChangeResult submitTaskStateChangeResult = new SubmitTaskStateChangeResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return submitTaskStateChangeResult;<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("acknowledgment", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>submitTaskStateChangeResult.setAcknowledgment(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 submitTaskStateChangeResult;<NEW_LINE>}
|
String currentParentElement = context.getCurrentParentElement();
|
328,091
|
private void handleClientCoreMessage_FirstLoad(Message msg) {<NEW_LINE>switch(msg.arg1) {<NEW_LINE>case FIRST_LOAD_NO_DATA:<NEW_LINE>{<NEW_LINE>if (wasInterceptInvoked.get()) {<NEW_LINE>SonicUtils.log(TAG, Log.INFO, "session(" + sId + ") handleClientCoreMessage_FirstLoad:FIRST_LOAD_NO_DATA.");<NEW_LINE>setResult(SONIC_RESULT_CODE_FIRST_LOAD, SONIC_RESULT_CODE_FIRST_LOAD, true);<NEW_LINE>} else {<NEW_LINE>SonicUtils.log(TAG, Log.ERROR, "session(" + sId + ") handleClientCoreMessage_FirstLoad:url was not invoked.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case FIRST_LOAD_WITH_DATA:<NEW_LINE>{<NEW_LINE>if (wasLoadUrlInvoked.compareAndSet(false, true)) {<NEW_LINE>SonicUtils.log(TAG, Log.<MASK><NEW_LINE>sessionClient.loadDataWithBaseUrlAndHeader(srcUrl, (String) msg.obj, "text/html", getCharsetFromHeaders(), srcUrl, getHeaders());<NEW_LINE>setResult(SONIC_RESULT_CODE_FIRST_LOAD, SONIC_RESULT_CODE_HIT_CACHE, false);<NEW_LINE>} else {<NEW_LINE>SonicUtils.log(TAG, Log.INFO, "session(" + sId + ") FIRST_LOAD_WITH_DATA load url was invoked.");<NEW_LINE>setResult(SONIC_RESULT_CODE_FIRST_LOAD, SONIC_RESULT_CODE_FIRST_LOAD, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
|
INFO, "session(" + sId + ") handleClientCoreMessage_FirstLoad:oh yeah, first load hit 304.");
|
621,798
|
static CommunityMatchExpr toCommunityMatchExpr(IpCommunityListStandard ipCommunityListStandard) {<NEW_LINE>Set<Community> whitelist = new HashSet<>();<NEW_LINE>Set<Community> <MASK><NEW_LINE>// TODO: support set comm-list delete semantics for line with more than one community<NEW_LINE>for (IpCommunityListStandardLine line : ipCommunityListStandard.getLines()) {<NEW_LINE>if (line.getCommunities().size() != 1) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Community community = Iterables.getOnlyElement(line.getCommunities());<NEW_LINE>if (line.getAction() == LineAction.PERMIT) {<NEW_LINE>if (!blacklist.contains(community)) {<NEW_LINE>whitelist.add(community);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// DENY<NEW_LINE>if (!whitelist.contains(community)) {<NEW_LINE>blacklist.add(community);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new CommunityIn(new LiteralCommunitySet(CommunitySet.of(whitelist)));<NEW_LINE>}
|
blacklist = new HashSet<>();
|
304,971
|
private void searchEquivalentRefs(Set<ScalarOperator> memo, Set<ScalarOperator> search, Set<ScalarOperator> result) {<NEW_LINE>Set<ScalarOperator> tempResult = Sets.newLinkedHashSet();<NEW_LINE>for (ScalarOperator operator : search) {<NEW_LINE>if (memo.contains(operator)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Derive columnRef = columnRef, like {a = b, b = c} => {a = c}<NEW_LINE>if (isColumnRefOperator(operator)) {<NEW_LINE>ColumnRefOperator ref = (ColumnRefOperator) operator;<NEW_LINE>tempResult.addAll(columnRefEquivalenceMap.getOrDefault(ref, Collections.emptySet()));<NEW_LINE>continue;<NEW_LINE>} else if (operator.isConstant()) {<NEW_LINE>tempResult.add(operator);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Derive columnRef = function(columnRef), like {a = abs(b), b = sin(c), c = 1} => {a = abs(sin(1))}<NEW_LINE>// The Derive process is too expensive, so the number of right columnRef must less or equal 1<NEW_LINE>ColumnRefOperator ref = Utils.extractColumnRef(operator).get(0);<NEW_LINE>Set<ScalarOperator> childSearch = Sets.newLinkedHashSet();<NEW_LINE>childSearch.add(ref);<NEW_LINE>Set<ScalarOperator> childResult = Sets.newLinkedHashSet();<NEW_LINE>searchEquivalentRefs(memo, childSearch, childResult);<NEW_LINE>for (ScalarOperator so : childResult) {<NEW_LINE>Map<ColumnRefOperator, ScalarOperator> rewriteMap = new HashMap<>();<NEW_LINE>rewriteMap.put(ref, so);<NEW_LINE>ReplaceColumnRefRewriter rewriter = new ReplaceColumnRefRewriter(rewriteMap);<NEW_LINE>// will modify the operator, must use clone<NEW_LINE>ScalarOperator r = operator.clone(<MASK><NEW_LINE>tempResult.add(r);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (tempResult.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>result.addAll(tempResult);<NEW_LINE>memo.addAll(search);<NEW_LINE>search.clear();<NEW_LINE>search.addAll(tempResult);<NEW_LINE>searchEquivalentRefs(memo, search, result);<NEW_LINE>}
|
).accept(rewriter, null);
|
1,618,907
|
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>response.getWriter().write("This is a public servlet \n");<NEW_LINE>String webName = null;<NEW_LINE>if (request.getUserPrincipal() != null) {<NEW_LINE>webName = request.getUserPrincipal().getName();<NEW_LINE>}<NEW_LINE>response.getWriter().<MASK><NEW_LINE>boolean webHasRole = request.isUserInRole("architect");<NEW_LINE>response.getWriter().write("before web user has role \"architect\": " + webHasRole + "\n");<NEW_LINE>// By *not* setting the "doLogin" request attribute the request.authenticate call<NEW_LINE>// would do nothing. request.authenticate is a mandatory authentication, so doing<NEW_LINE>// nothing is not allowed. But one or more initial failures should not prevent<NEW_LINE>// a later successful authentication.<NEW_LINE>if (request.getParameter("failFirst") != null) {<NEW_LINE>try {<NEW_LINE>request.authenticate(response);<NEW_LINE>} catch (IOException | ServletException e) {<NEW_LINE>// GlassFish returns false when either authentication is in progress or authentication<NEW_LINE>// failed (or was not done at all), but JBoss throws an exception.<NEW_LINE>// TODO: Get clarification what is actually expected, likely exception is most correct.<NEW_LINE>// Then test for the correct return value.<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if ("2".equals(request.getParameter("failFirst"))) {<NEW_LINE>try {<NEW_LINE>request.authenticate(response);<NEW_LINE>} catch (IOException | ServletException e) {<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Programmatically trigger the authentication chain<NEW_LINE>request.setAttribute("doLogin", true);<NEW_LINE>boolean authenticateOutcome = request.authenticate(response);<NEW_LINE>if (request.getUserPrincipal() != null) {<NEW_LINE>webName = request.getUserPrincipal().getName();<NEW_LINE>}<NEW_LINE>response.getWriter().write("request.authenticate outcome: " + authenticateOutcome + "\n");<NEW_LINE>response.getWriter().write("after web username: " + webName + "\n");<NEW_LINE>webHasRole = request.isUserInRole("architect");<NEW_LINE>response.getWriter().write("after web user has role \"architect\": " + webHasRole + "\n");<NEW_LINE>}
|
write("before web username: " + webName + "\n");
|
757,573
|
private static // }<NEW_LINE>void addColor(String tokenType, SimpleAttributeSet sas, Map<String, AttributeSet> colorsMap, Map<String, AttributeSet> defaultsMap) {<NEW_LINE>if (sas == null)<NEW_LINE>sas = new SimpleAttributeSet();<NEW_LINE>else<NEW_LINE>sas = new SimpleAttributeSet(sas);<NEW_LINE>String colorName = (String) sas.getAttribute(StyleConstants.NameAttribute);<NEW_LINE>if (colorName == null)<NEW_LINE>colorName = tokenType;<NEW_LINE>sas.<MASK><NEW_LINE>sas.addAttribute(EditorStyleConstants.DisplayName, colorName);<NEW_LINE>if (!sas.isDefined(EditorStyleConstants.Default)) {<NEW_LINE>String def = colorName;<NEW_LINE>int i = def.lastIndexOf('_');<NEW_LINE>if (i > 0)<NEW_LINE>def = def.substring(i + 1);<NEW_LINE>if (defaultsMap.containsKey(def))<NEW_LINE>sas.addAttribute(EditorStyleConstants.Default, def);<NEW_LINE>}<NEW_LINE>colorsMap.put(colorName, sas);<NEW_LINE>}
|
addAttribute(StyleConstants.NameAttribute, colorName);
|
1,788,290
|
public void read(org.apache.thrift.protocol.TProtocol prot, setNamespaceProperty_result struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet incoming = iprot.readBitSet(3);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>struct.sec = new org.apache.accumulo.core.clientImpl.thrift.ThriftSecurityException();<NEW_LINE>struct.sec.read(iprot);<NEW_LINE>struct.setSecIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.tope = new org.apache.accumulo.core.clientImpl.thrift.ThriftTableOperationException();<NEW_LINE>struct.tope.read(iprot);<NEW_LINE>struct.setTopeIsSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(2)) {<NEW_LINE>struct.tnase = new org.apache.accumulo.core<MASK><NEW_LINE>struct.tnase.read(iprot);<NEW_LINE>struct.setTnaseIsSet(true);<NEW_LINE>}<NEW_LINE>}
|
.clientImpl.thrift.ThriftNotActiveServiceException();
|
1,399,575
|
public EurekaHttpResponse<InstanceInfo> sendHeartBeat(String appName, String id, InstanceInfo info, InstanceStatus overriddenStatus) {<NEW_LINE>String urlPath <MASK><NEW_LINE>Response response = null;<NEW_LINE>try {<NEW_LINE>WebTarget webResource = jerseyClient.target(serviceUrl).path(urlPath).queryParam("status", info.getStatus().toString()).queryParam("lastDirtyTimestamp", info.getLastDirtyTimestamp().toString());<NEW_LINE>if (overriddenStatus != null) {<NEW_LINE>webResource = webResource.queryParam("overriddenstatus", overriddenStatus.name());<NEW_LINE>}<NEW_LINE>Builder requestBuilder = webResource.request();<NEW_LINE>addExtraProperties(requestBuilder);<NEW_LINE>addExtraHeaders(requestBuilder);<NEW_LINE>requestBuilder.accept(MediaType.APPLICATION_JSON_TYPE);<NEW_LINE>// Jersey2 refuses to handle PUT with no body<NEW_LINE>response = requestBuilder.put(Entity.entity("{}", MediaType.APPLICATION_JSON_TYPE));<NEW_LINE>EurekaHttpResponseBuilder<InstanceInfo> eurekaResponseBuilder = anEurekaHttpResponse(response.getStatus(), InstanceInfo.class).headers(headersOf(response));<NEW_LINE>if (response.hasEntity()) {<NEW_LINE>eurekaResponseBuilder.entity(response.readEntity(InstanceInfo.class));<NEW_LINE>}<NEW_LINE>return eurekaResponseBuilder.build();<NEW_LINE>} finally {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Jersey2 HTTP PUT {}/{}; statusCode={}", serviceUrl, urlPath, response == null ? "N/A" : response.getStatus());<NEW_LINE>}<NEW_LINE>if (response != null) {<NEW_LINE>response.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
= "apps/" + appName + '/' + id;
|
1,702,244
|
public void startUp(FloodlightModuleContext context) throws FloodlightModuleException {<NEW_LINE>logger.info("LDHAWorker is starting...");<NEW_LINE>try {<NEW_LINE>HAController.syncService.registerStore("LDUpdates", Scope.GLOBAL);<NEW_LINE>HAController.storeLD = HAController.syncService.getStoreClient("LDUpdates", String.class, String.class);<NEW_LINE>HAController.storeLD.addStoreListener(this);<NEW_LINE>} catch (SyncException e) {<NEW_LINE>throw new FloodlightModuleException("Error while setting up sync service", e);<NEW_LINE>}<NEW_LINE>HAController.ldhaworker = new LDHAWorker(HAController.storeLD, controllerID);<NEW_LINE>linkserv.addListener(HAController.ldhaworker);<NEW_LINE>haworker.registerService("LDHAWorker", HAController.ldhaworker);<NEW_LINE>logger.info("TopoHAWorker is starting...");<NEW_LINE>try {<NEW_LINE>HAController.syncService.registerStore("TopoUpdates", Scope.GLOBAL);<NEW_LINE>HAController.storeTopo = HAController.syncService.getStoreClient("TopoUpdates", String.class, String.class);<NEW_LINE>HAController.storeTopo.addStoreListener(this);<NEW_LINE>} catch (SyncException e) {<NEW_LINE>throw new FloodlightModuleException("Error while setting up sync service", e);<NEW_LINE>}<NEW_LINE>HAController.topohaworker = new TopoHAWorker(HAController.storeTopo, controllerID);<NEW_LINE>toposerv.addListener(HAController.topohaworker);<NEW_LINE>haworker.registerService("TopoHAWorker", HAController.topohaworker);<NEW_LINE>ScheduledExecutorService sesController = Executors.newScheduledThreadPool(10);<NEW_LINE>ael = new AsyncElection(config.get("serverPort"), config.get("nodeid"), haworker);<NEW_LINE>ael.setElectionPriorities(<MASK><NEW_LINE>cLogic = new ControllerLogic(ael, config.get("nodeid"));<NEW_LINE>try {<NEW_LINE>sesController.scheduleAtFixedRate(ael, 0, 60000, TimeUnit.MICROSECONDS);<NEW_LINE>sesController.scheduleAtFixedRate(cLogic, 20000, 25000, TimeUnit.MICROSECONDS);<NEW_LINE>} catch (Exception e) {<NEW_LINE>sesController.shutdownNow();<NEW_LINE>logger.info("[Election] Was interrrupted! " + e.toString());<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>logger.info("HAController is starting...");<NEW_LINE>return;<NEW_LINE>}
|
(ArrayList<Integer>) priorities);
|
166,391
|
public static void main(String[] args) {<NEW_LINE>Scanner sc = new Scanner(System.in);<NEW_LINE>int caseNo = 0;<NEW_LINE>while (sc.hasNext()) {<NEW_LINE>int a = sc.nextInt();<NEW_LINE>String ch = sc.next();<NEW_LINE>int b = sc.nextInt();<NEW_LINE>// the range of answer<NEW_LINE>double lo = 0.0, hi = 400.0<MASK><NEW_LINE>for (int i = 0; i < 40; ++i) {<NEW_LINE>// bisection method on L<NEW_LINE>L = (lo + hi) / 2.0;<NEW_LINE>// derive W from L and a:b<NEW_LINE>W = (double) b / a * L;<NEW_LINE>// reference value<NEW_LINE>double expected_arc = (400 - 2.0 * L) / 2.0;<NEW_LINE>// Apply Trigonometry here<NEW_LINE>double CM = 0.5 * L, MX = 0.5 * W;<NEW_LINE>double r = Math.sqrt(CM * CM + MX * MX);<NEW_LINE>double angle = 2.0 * Math.atan(MX / CM) * 180.0 / Math.PI;<NEW_LINE>double this_arc = angle / 360.0 * Math.PI * (2.0 * r);<NEW_LINE>if (this_arc > expected_arc)<NEW_LINE>hi = L;<NEW_LINE>else<NEW_LINE>lo = L;<NEW_LINE>}<NEW_LINE>System.out.printf("Case %d: %.12f %.12f\n", ++caseNo, L, W);<NEW_LINE>}<NEW_LINE>}
|
, L = 0, W = 0;
|
1,473,139
|
public static double ceilPowerOfTwo(double x) {<NEW_LINE>checkArgument(x > 0.0, "Input must be positive. Provided value: %s", x);<NEW_LINE>checkArgument(Double.isFinite<MASK><NEW_LINE>checkArgument(!Double.isNaN(x), "Input must be a number. Provided value: NaN");<NEW_LINE>// The following bit masks are based on the bit layout of double values in Java, which according<NEW_LINE>// to the IEEE standard is defined as "1*s 11*e 52*m" where "s" is the sign bit, "e" are the<NEW_LINE>// exponent bits and "m" are the mantissa bits.<NEW_LINE>final long exponentMask = 0x7ff0000000000000L;<NEW_LINE>final long mantissaMask = 0x000fffffffffffffL;<NEW_LINE>long bits = Double.doubleToLongBits(x);<NEW_LINE>long mantissaBits = bits & mantissaMask;<NEW_LINE>// Since x is a finite positive number, x is a power of 2 if and only if it has a mantissa of 0.<NEW_LINE>if (mantissaBits == 0x0000000000000000L) {<NEW_LINE>return x;<NEW_LINE>}<NEW_LINE>long exponentBits = bits & exponentMask;<NEW_LINE>long maxExponentBits = Double.doubleToLongBits(Double.MAX_VALUE) & exponentMask;<NEW_LINE>checkArgument(exponentBits < maxExponentBits, "Input must not be greater than 2^1023. Provided value: %s", x);<NEW_LINE>// Increase the exponent bits by 1 to get the next power of 2. Note that this requires to add<NEW_LINE>// 0x0010000000000000L to the exponent bits in order to skip the mantissa.<NEW_LINE>return Double.longBitsToDouble(exponentBits + 0x0010000000000000L);<NEW_LINE>}
|
(x), "Input must be finite. Provided value: %s", x);
|
1,292,060
|
public OSSAsyncTask<CompleteMultipartUploadResult> completeMultipartUpload(CompleteMultipartUploadRequest request, final OSSCompletedCallback<CompleteMultipartUploadRequest, CompleteMultipartUploadResult> completedCallback) {<NEW_LINE>RequestMessage requestMessage = new RequestMessage();<NEW_LINE>requestMessage.setIsAuthorizationRequired(request.isAuthorizationRequired());<NEW_LINE>requestMessage.setEndpoint(endpoint);<NEW_LINE>requestMessage.setMethod(HttpMethod.POST);<NEW_LINE>requestMessage.setBucketName(request.getBucketName());<NEW_LINE>requestMessage.setObjectKey(request.getObjectKey());<NEW_LINE>requestMessage.setStringBody(OSSUtils.buildXMLFromPartEtagList(request.getPartETags()));<NEW_LINE>requestMessage.getParameters().put(RequestParameters.UPLOAD_ID, request.getUploadId());<NEW_LINE>if (request.getCallbackParam() != null) {<NEW_LINE>requestMessage.getHeaders().put("x-oss-callback", OSSUtils.populateMapToBase64JsonString(request.getCallbackParam()));<NEW_LINE>}<NEW_LINE>if (request.getCallbackVars() != null) {<NEW_LINE>requestMessage.getHeaders().put("x-oss-callback-var", OSSUtils.populateMapToBase64JsonString(request.getCallbackVars()));<NEW_LINE>}<NEW_LINE>OSSUtils.populateRequestMetadata(requestMessage.getHeaders(), request.getMetadata());<NEW_LINE>canonicalizeRequestMessage(requestMessage, request);<NEW_LINE>ExecutionContext<CompleteMultipartUploadRequest, CompleteMultipartUploadResult> executionContext = new ExecutionContext(getInnerClient(), request, applicationContext);<NEW_LINE>if (completedCallback != null) {<NEW_LINE>executionContext.setCompletedCallback(new OSSCompletedCallback<CompleteMultipartUploadRequest, CompleteMultipartUploadResult>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(CompleteMultipartUploadRequest request, CompleteMultipartUploadResult result) {<NEW_LINE>if (result.getServerCRC() != null) {<NEW_LINE>long crc64 = calcObjectCRCFromParts(request.getPartETags());<NEW_LINE>result.setClientCRC(crc64);<NEW_LINE>}<NEW_LINE>checkCRC64(request, result, completedCallback);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(CompleteMultipartUploadRequest request, ClientException clientException, ServiceException serviceException) {<NEW_LINE>completedCallback.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>ResponseParser<CompleteMultipartUploadResult> parser = new ResponseParsers.CompleteMultipartUploadResponseParser();<NEW_LINE>Callable<CompleteMultipartUploadResult> callable = new OSSRequestTask<CompleteMultipartUploadResult>(requestMessage, parser, executionContext, maxRetryCount);<NEW_LINE>return OSSAsyncTask.wrapRequestTask(executorService.submit(callable), executionContext);<NEW_LINE>}
|
onFailure(request, clientException, serviceException);
|
575,228
|
protected static JPanel createStandardLegendPanel(final String methodDefinedText, final String methodNotDefinedLegallyText, final String methodShouldBeDefined) {<NEW_LINE>final JPanel panel = new JPanel(new GridBagLayout());<NEW_LINE>final GridBagConstraints gc = new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(3, 5, 0, 5), 0, 0);<NEW_LINE>JLabel label = new JBLabel(methodDefinedText, AllIcons.Hierarchy.MethodDefined, SwingConstants.LEFT);<NEW_LINE>label.setUI(new MultiLineLabelUI());<NEW_LINE>label.setIconTextGap(10);<NEW_LINE>panel.add(label, gc);<NEW_LINE>gc.gridy++;<NEW_LINE>label = new JBLabel(methodNotDefinedLegallyText, AllIcons.Hierarchy.MethodNotDefined, SwingConstants.LEFT);<NEW_LINE>label.setUI(new MultiLineLabelUI());<NEW_LINE>label.setIconTextGap(10);<NEW_LINE>panel.add(label, gc);<NEW_LINE>gc.gridy++;<NEW_LINE>label = new JBLabel(methodShouldBeDefined, AllIcons.Hierarchy.ShouldDefineMethod, SwingConstants.LEFT);<NEW_LINE>label.setUI(new MultiLineLabelUI());<NEW_LINE>label.setIconTextGap(10);<NEW_LINE><MASK><NEW_LINE>return panel;<NEW_LINE>}
|
panel.add(label, gc);
|
1,108,227
|
public void marshall(AwsEc2SecurityGroupDetails awsEc2SecurityGroupDetails, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (awsEc2SecurityGroupDetails == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(awsEc2SecurityGroupDetails.getGroupName(), GROUPNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEc2SecurityGroupDetails.getGroupId(), GROUPID_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEc2SecurityGroupDetails.getOwnerId(), OWNERID_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(awsEc2SecurityGroupDetails.getIpPermissions(), IPPERMISSIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsEc2SecurityGroupDetails.getIpPermissionsEgress(), IPPERMISSIONSEGRESS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
awsEc2SecurityGroupDetails.getVpcId(), VPCID_BINDING);
|
621,907
|
public synchronized void truncateUnpartitionedTable(ConnectorSession session, String databaseName, String tableName) {<NEW_LINE>checkReadable();<NEW_LINE>Optional<Table> table = getTable(new MetastoreContext(session.getIdentity(), session.getQueryId(), session.getClientInfo(), session.getSource(), getMetastoreHeaders(session), isUserDefinedTypeEncodingEnabled(session), columnConverterProvider), databaseName, tableName);<NEW_LINE>SchemaTableName schemaTableName = new SchemaTableName(databaseName, tableName);<NEW_LINE>if (!table.isPresent()) {<NEW_LINE>throw new TableNotFoundException(schemaTableName);<NEW_LINE>}<NEW_LINE>if (!table.get().getTableType().equals(MANAGED_TABLE) && !table.get().getTableType().equals(MATERIALIZED_VIEW)) {<NEW_LINE>throw new PrestoException(NOT_SUPPORTED, "Cannot delete from non-managed Hive table");<NEW_LINE>}<NEW_LINE>if (!table.get().getPartitionColumns().isEmpty()) {<NEW_LINE>throw new IllegalArgumentException("Table is partitioned");<NEW_LINE>}<NEW_LINE>Path path = new Path(table.get().getStorage().getLocation());<NEW_LINE>HdfsContext context = new HdfsContext(session, databaseName, tableName, table.get().getStorage().getLocation(), false);<NEW_LINE>setExclusive((delegate, hdfsEnvironment) -> {<NEW_LINE>RecursiveDeleteResult recursiveDeleteResult = recursiveDeleteFiles(hdfsEnvironment, context, path, ImmutableSet.of(""), false);<NEW_LINE>if (!recursiveDeleteResult.getNotDeletedEligibleItems().isEmpty()) {<NEW_LINE>throw new PrestoException(HIVE_FILESYSTEM_ERROR, format("Error deleting from unpartitioned table %s. These items can not be deleted: %s", schemaTableName<MASK><NEW_LINE>}<NEW_LINE>return EMPTY_HIVE_COMMIT_HANDLE;<NEW_LINE>});<NEW_LINE>}
|
, recursiveDeleteResult.getNotDeletedEligibleItems()));
|
1,441,286
|
private void checkIncludesExistence(File scriptDir) throws IOException {<NEW_LINE>File incFolder = new File(scriptDir, "inc");<NEW_LINE>if (!incFolder.exists()) {<NEW_LINE>if (!incFolder.mkdirs()) {<NEW_LINE>throw new IOException("Can't create inc folder '" + <MASK><NEW_LINE>}<NEW_LINE>for (String fileName : GISBrowserViewerConstants.INC_FILES) {<NEW_LINE>InputStream fis = GISViewerActivator.getDefault().getResourceStream(GISBrowserViewerConstants.WEB_INC_PATH + fileName);<NEW_LINE>if (fis != null) {<NEW_LINE>try (FileOutputStream fos = new FileOutputStream(new File(incFolder, fileName))) {<NEW_LINE>try {<NEW_LINE>IOUtils.copyStream(fis, fos);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.warn("Error copying inc file " + fileName, e);<NEW_LINE>} finally {<NEW_LINE>ContentUtils.close(fis);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
incFolder.getAbsolutePath() + "'");
|
846,798
|
private Long countExpiredTaskTaskCompleted(Business business, DateRange dateRange, String applicationId, String processId, String activityId, List<String> units, String person) throws Exception {<NEW_LINE>EntityManager em = business.entityManagerContainer().get(TaskCompleted.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Long> cq = cb.createQuery(Long.class);<NEW_LINE>Root<TaskCompleted> root = <MASK><NEW_LINE>Predicate p = cb.between(root.get(TaskCompleted_.expireTime), dateRange.getStart(), dateRange.getEnd());<NEW_LINE>p = cb.and(p, cb.equal(root.get(TaskCompleted_.expired), true));<NEW_LINE>if (!StringUtils.equals(applicationId, StandardJaxrsAction.EMPTY_SYMBOL)) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(TaskCompleted_.application), applicationId));<NEW_LINE>}<NEW_LINE>if (!StringUtils.equals(processId, StandardJaxrsAction.EMPTY_SYMBOL)) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(TaskCompleted_.process), processId));<NEW_LINE>}<NEW_LINE>if (!StringUtils.equals(activityId, StandardJaxrsAction.EMPTY_SYMBOL)) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(TaskCompleted_.activity), activityId));<NEW_LINE>}<NEW_LINE>if (ListTools.isNotEmpty(units)) {<NEW_LINE>p = cb.and(p, root.get(TaskCompleted_.unit).in(units));<NEW_LINE>}<NEW_LINE>if (!StringUtils.equals(person, StandardJaxrsAction.EMPTY_SYMBOL)) {<NEW_LINE>p = cb.and(p, cb.equal(root.get(TaskCompleted_.person), person));<NEW_LINE>}<NEW_LINE>cq.select(cb.count(root)).where(p);<NEW_LINE>return em.createQuery(cq).getSingleResult();<NEW_LINE>}
|
cq.from(TaskCompleted.class);
|
1,248,295
|
public void onError(java.lang.Exception e) {<NEW_LINE>byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;<NEW_LINE><MASK><NEW_LINE>invalidateConditionalUpdate_result result = new invalidateConditionalUpdate_result();<NEW_LINE>if (e instanceof org.apache.thrift.transport.TTransportException) {<NEW_LINE>_LOGGER.error("TTransportException inside handler", e);<NEW_LINE>fb.close();<NEW_LINE>return;<NEW_LINE>} else if (e instanceof org.apache.thrift.TApplicationException) {<NEW_LINE>_LOGGER.error("TApplicationException inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = (org.apache.thrift.TApplicationException) e;<NEW_LINE>} else {<NEW_LINE>_LOGGER.error("Exception inside handler", e);<NEW_LINE>msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;<NEW_LINE>msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>fcall.sendResponse(fb, msg, msgType, seqid);<NEW_LINE>} catch (java.lang.Exception ex) {<NEW_LINE>_LOGGER.error("Exception writing to internal frame buffer", ex);<NEW_LINE>fb.close();<NEW_LINE>}<NEW_LINE>}
|
org.apache.thrift.TSerializable msg;
|
25,078
|
private static LayoutReport checkLayoutForPage(Page page, Browser browser, PageSpec pageSpec, SectionFilter sectionFilter, ValidationListener validationListener) throws IOException {<NEW_LINE>CombinedValidationListener listener = new CombinedValidationListener();<NEW_LINE>listener.add(validationListener);<NEW_LINE>LayoutReport layoutReport = new LayoutReport();<NEW_LINE>layoutReport.setIncludedTags(sectionFilter.getIncludedTags());<NEW_LINE>layoutReport.setExcludedTags(sectionFilter.getExcludedTags());<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>if (screenshot != null) {<NEW_LINE>layoutReport.setScreenshot(layoutReport.registerFile("screenshot.png", screenshot));<NEW_LINE>screenshot.deleteOnExit();<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOG.error("Error during setting screenshot.", ex);<NEW_LINE>}<NEW_LINE>listener.add(new LayoutReportListener(layoutReport));<NEW_LINE>SectionValidation sectionValidation = new SectionValidation(pageSpec.getSections(), new PageValidation(browser, page, pageSpec, listener, sectionFilter), listener);<NEW_LINE>List<ValidationResult> results = sectionValidation.check();<NEW_LINE>List<ValidationResult> allValidationErrorResults = new LinkedList<>();<NEW_LINE>for (ValidationResult result : results) {<NEW_LINE>if (result.getError() != null) {<NEW_LINE>allValidationErrorResults.add(result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>layoutReport.setValidationErrorResults(allValidationErrorResults);<NEW_LINE>return layoutReport;<NEW_LINE>}
|
File screenshot = page.getScreenshotFile();
|
912,861
|
public Response<Void> deleteByIdWithResponse(String id, Context context) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String accountName = Utils.getValueFromIdByName(id, "mediaServices");<NEW_LINE>if (accountName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'mediaServices'.", id)));<NEW_LINE>}<NEW_LINE>String streamingLocatorName = Utils.getValueFromIdByName(id, "streamingLocators");<NEW_LINE>if (streamingLocatorName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.<MASK><NEW_LINE>}<NEW_LINE>return this.deleteWithResponse(resourceGroupName, accountName, streamingLocatorName, context);<NEW_LINE>}
|
format("The resource ID '%s' is not valid. Missing path segment 'streamingLocators'.", id)));
|
1,741,059
|
public void onMediaPermissionRequest(GeckoSession aSession, String aUri, MediaSource[] aVideo, MediaSource[] aAudio, final MediaCallback aMediaCallback) {<NEW_LINE>Log.<MASK><NEW_LINE>final MediaSource video = aVideo != null ? aVideo[0] : null;<NEW_LINE>final MediaSource audio = aAudio != null ? aAudio[0] : null;<NEW_LINE>PermissionWidget.PermissionType type;<NEW_LINE>if (video != null && audio != null) {<NEW_LINE>type = PermissionWidget.PermissionType.CameraAndMicrophone;<NEW_LINE>} else if (video != null) {<NEW_LINE>type = PermissionWidget.PermissionType.Camera;<NEW_LINE>} else if (audio != null) {<NEW_LINE>type = PermissionWidget.PermissionType.Microphone;<NEW_LINE>} else {<NEW_LINE>aMediaCallback.reject();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>GeckoSession.PermissionDelegate.Callback callback = new GeckoSession.PermissionDelegate.Callback() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void grant() {<NEW_LINE>aMediaCallback.grant(video, audio);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void reject() {<NEW_LINE>aMediaCallback.reject();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>// Temporary fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1621380<NEW_LINE>if ((type == PermissionWidget.PermissionType.Camera || type == PermissionWidget.PermissionType.CameraAndMicrophone)) {<NEW_LINE>callback.reject();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>handlePermission(aUri, type, callback);<NEW_LINE>}
|
d(LOGTAG, "onMediaPermissionRequest: " + aUri);
|
1,375,483
|
public LineageVertex abstractVertex(Vertex originalVertex) {<NEW_LINE>String nodeType = originalVertex.label();<NEW_LINE>String nodeID = getNodeID(originalVertex);<NEW_LINE>LineageVertex lineageVertex = new LineageVertex(nodeID, nodeType);<NEW_LINE>lineageVertex.setId(originalVertex.id());<NEW_LINE>if (originalVertex.property(PROPERTY_KEY_DISPLAY_NAME).isPresent()) {<NEW_LINE>String displayName = originalVertex.property(PROPERTY_KEY_DISPLAY_NAME).value().toString();<NEW_LINE>lineageVertex.setDisplayName(displayName);<NEW_LINE>} else if (originalVertex.property(PROPERTY_KEY_INSTANCEPROP_DISPLAY_NAME).isPresent()) {<NEW_LINE>// Displayname key is stored inconsistently in the graphDB.<NEW_LINE>String displayName = originalVertex.property(PROPERTY_KEY_INSTANCEPROP_DISPLAY_NAME).value().toString();<NEW_LINE>lineageVertex.setDisplayName(displayName);<NEW_LINE>} else if (originalVertex.property(PROPERTY_KEY_LABEL).isPresent()) {<NEW_LINE>// if no display props exist use the label. every vertex should have it<NEW_LINE>String displayName = originalVertex.property(PROPERTY_KEY_LABEL).value().toString();<NEW_LINE>lineageVertex.setDisplayName(displayName);<NEW_LINE>} else {<NEW_LINE>// if all else fails<NEW_LINE>lineageVertex.setDisplayName("undefined");<NEW_LINE>}<NEW_LINE>if (originalVertex.property(PROPERTY_KEY_ENTITY_GUID).isPresent()) {<NEW_LINE>String guid = originalVertex.property(PROPERTY_KEY_ENTITY_GUID).value().toString();<NEW_LINE>lineageVertex.setGuid(guid);<NEW_LINE>}<NEW_LINE>if (originalVertex.property(PROPERTY_NAME_INSTANCEPROP_QUALIFIED_NAME).isPresent()) {<NEW_LINE>String qualifiedName = originalVertex.property(PROPERTY_NAME_INSTANCEPROP_QUALIFIED_NAME)<MASK><NEW_LINE>lineageVertex.setQualifiedName(qualifiedName);<NEW_LINE>}<NEW_LINE>if (NODE_LABEL_SUB_PROCESS.equals(nodeType) && originalVertex.property((PROPERTY_KEY_PROCESS_GUID)).isPresent()) {<NEW_LINE>lineageVertex.setGuid(originalVertex.property((PROPERTY_KEY_PROCESS_GUID)).value().toString());<NEW_LINE>lineageVertex.setNodeID(originalVertex.property((PROPERTY_KEY_PROCESS_GUID)).value().toString());<NEW_LINE>}<NEW_LINE>Map<String, String> properties = retrieveProperties(originalVertex);<NEW_LINE>lineageVertex.setProperties(properties);<NEW_LINE>return lineageVertex;<NEW_LINE>}
|
.value().toString();
|
977,476
|
public void fireStarted(ApplicationInfo info) throws StateChangeException {<NEW_LINE>if (info != null && info.getConfigHelper() == null) {<NEW_LINE>Iterator<ServiceAndServiceReferencePair<ApplicationStateListener>> iterator = listeners.getServicesWithReferences();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>ServiceAndServiceReferencePair<ApplicationStateListener> pair = iterator.next();<NEW_LINE>ServiceReference<ApplicationStateListener> ref = pair.getServiceReference();<NEW_LINE>if (ref.getProperty("includeAppsWithoutConfig") != null) {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>listener.applicationStarted(info);<NEW_LINE>} catch (StateChangeException t) {<NEW_LINE>throw t;<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new StateChangeException(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (ApplicationStateListener listener : listeners.services()) {<NEW_LINE>try {<NEW_LINE>listener.applicationStarted(info);<NEW_LINE>} catch (StateChangeException t) {<NEW_LINE>throw t;<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new StateChangeException(t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
ApplicationStateListener listener = pair.getService();
|
1,560,967
|
public Future<Void> rollingRestart(Function<Pod, List<String>> podNeedsRestart) {<NEW_LINE>this.podNeedsRestart = podNeedsRestart;<NEW_LINE>Promise<Void> result = Promise.promise();<NEW_LINE>singleExecutor.submit(() -> {<NEW_LINE>List<PodRef> pods = new ArrayList<>(podList.size());<NEW_LINE>for (int podIndex = 0; podIndex < podList.size(); podIndex++) {<NEW_LINE>// Order the podNames unready first otherwise repeated reconciliations might each restart a pod<NEW_LINE>// only for it not to become ready and thus drive the cluster to a worse state.<NEW_LINE>pods.add(podOperations.isReady(namespace, podList.get(podIndex)) ? pods.size() : 0, new PodRef(podList.get(podIndex), idOfPod(podList.get(podIndex))));<NEW_LINE>}<NEW_LINE>LOGGER.<MASK><NEW_LINE>List<Future> futures = new ArrayList<>(podList.size());<NEW_LINE>for (PodRef podRef : pods) {<NEW_LINE>futures.add(schedule(podRef, 0, TimeUnit.MILLISECONDS));<NEW_LINE>}<NEW_LINE>CompositeFuture.join(futures).onComplete(ar -> {<NEW_LINE>singleExecutor.shutdown();<NEW_LINE>try {<NEW_LINE>if (allClient != null) {<NEW_LINE>allClient.close(Duration.ofSeconds(30));<NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>LOGGER.debugCr(reconciliation, "Exception closing admin client", e);<NEW_LINE>}<NEW_LINE>vertx.runOnContext(ignored -> result.handle(ar.map((Void) null)));<NEW_LINE>});<NEW_LINE>});<NEW_LINE>return result.future();<NEW_LINE>}
|
debugCr(reconciliation, "Initial order for rolling restart {}", pods);
|
1,387,495
|
private void submitCompactionJob(CompactionPlan plan, Compactable.Files files, Compactable compactable, Consumer<Compactable> completionCallback) {<NEW_LINE>// log error if tablet is metadata and compaction is external<NEW_LINE>var execIds = plan.getJobs().stream().map(cj -> (CompactionExecutorIdImpl) cj.getExecutor());<NEW_LINE>if (compactable.getExtent().isMeta() && execIds.anyMatch(ceid -> ceid.isExternalId())) {<NEW_LINE>log.error("Compacting metadata tablets on external compactors is not supported, please change " + "config for compaction service ({}) and/or table ASAP. {} is not compacting, " + "ignoring plan {}", myId, compactable.getExtent(), plan);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Set<CompactionJob> jobs = new HashSet<>(plan.getJobs());<NEW_LINE>Collection<SubmittedJob> submitted = submittedJobs.getOrDefault(compactable.getExtent(<MASK><NEW_LINE>if (!submitted.isEmpty()) {<NEW_LINE>submitted.removeIf(sj -> {<NEW_LINE>// to avoid race conditions, only read status once and use local var for the two compares<NEW_LINE>var status = sj.getStatus();<NEW_LINE>return status != Status.QUEUED && status != Status.RUNNING;<NEW_LINE>});<NEW_LINE>}<NEW_LINE>if (reconcile(jobs, submitted)) {<NEW_LINE>for (CompactionJob job : jobs) {<NEW_LINE>CompactionExecutor executor = executors.get(job.getExecutor());<NEW_LINE>var submittedJob = executor.submit(myId, job, compactable, completionCallback);<NEW_LINE>// its important that the collection created in computeIfAbsent supports concurrency<NEW_LINE>submittedJobs.computeIfAbsent(compactable.getExtent(), k -> new ConcurrentLinkedQueue<>()).add(submittedJob);<NEW_LINE>}<NEW_LINE>if (!jobs.isEmpty()) {<NEW_LINE>log.trace("Submitted compaction plan {} id:{} files:{} plan:{}", compactable.getExtent(), myId, files, plan);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.trace("Did not submit compaction plan {} id:{} files:{} plan:{}", compactable.getExtent(), myId, files, plan);<NEW_LINE>}<NEW_LINE>}
|
), List.of());
|
1,423,868
|
static Native<?, ?> of(ProcedureVertex<?, ?> from, ProcedureVertex<?, ?> to, PlannerEdge.Native.Directional<?, ?> edge) {<NEW_LINE>boolean isForward = edge.direction().isForward();<NEW_LINE>if (edge.isIsa()) {<NEW_LINE>int orderNumber = edge.orderNumber();<NEW_LINE>boolean isTransitive = edge.asIsa().isTransitive();<NEW_LINE>if (isForward)<NEW_LINE>return new Isa.Forward(from.asThing(), to.asType(), orderNumber, isTransitive);<NEW_LINE>else<NEW_LINE>return new Isa.Backward(from.asType(), to.asThing(), orderNumber, isTransitive);<NEW_LINE>} else if (edge.isType()) {<NEW_LINE>return Native.Type.of(from.asType(), to.asType(), edge.asType());<NEW_LINE>} else if (edge.isThing()) {<NEW_LINE>return Native.Thing.of(from.asThing(), to.asThing(<MASK><NEW_LINE>} else {<NEW_LINE>throw TypeDBException.of(UNRECOGNISED_VALUE);<NEW_LINE>}<NEW_LINE>}
|
), edge.asThing());
|
33,325
|
private void writeCheckpoint(long nextSequenceNumber) {<NEW_LINE>LOG.info("{}: Writing checkpoint [sequence number {}].", mMaster.getName(), nextSequenceNumber);<NEW_LINE>try {<NEW_LINE>UfsJournalCheckpointWriter journalWriter = mJournal.getCheckpointWriter(nextSequenceNumber);<NEW_LINE>try {<NEW_LINE>synchronized (mCheckpointingLock) {<NEW_LINE>if (mShutdownInitiated) {<NEW_LINE>// This checkpoint thread is signaled to shutdown, so any checkpoint in progress must be<NEW_LINE>// canceled/invalidated.<NEW_LINE>journalWriter.cancel();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>mCheckpointing = true;<NEW_LINE>}<NEW_LINE>mMaster.writeToCheckpoint(journalWriter);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>if (ExceptionUtils.containsInterruptedException(t)) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>} else {<NEW_LINE>LOG.error("{}: Failed to create checkpoint", mMaster.getName(), t);<NEW_LINE>}<NEW_LINE>journalWriter.cancel();<NEW_LINE>LOG.info("{}: Cancelled checkpoint [sequence number {}].", mMaster.getName(), nextSequenceNumber);<NEW_LINE>return;<NEW_LINE>} finally {<NEW_LINE>synchronized (mCheckpointingLock) {<NEW_LINE>mCheckpointing = false;<NEW_LINE>}<NEW_LINE>// If shutdown has been initiated, we assume that the interrupt was just intended to break<NEW_LINE>// out of writeToCheckpoint early. We complete an orderly shutdown instead of stopping the<NEW_LINE>// thread early.<NEW_LINE>if (Thread.interrupted() && !mShutdownInitiated) {<NEW_LINE>LOG.warn("{}: Checkpoint was interrupted but shutdown has not be initiated", mMaster.getName());<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>journalWriter.close();<NEW_LINE>}<NEW_LINE>LOG.info("{}: Finished checkpoint [sequence number {}].", <MASK><NEW_LINE>mNextSequenceNumberToCheckpoint = nextSequenceNumber;<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error("{}: Failed to checkpoint.", mMaster.getName(), e);<NEW_LINE>}<NEW_LINE>}
|
mMaster.getName(), nextSequenceNumber);
|
1,504,288
|
private ConfigurationDocument createConfigFile(StringToStringMap values) {<NEW_LINE>ConfigurationDocument configDocument = ConfigurationDocument.Factory.newInstance();<NEW_LINE>ConfigurationType config = configDocument.addNewConfiguration();<NEW_LINE>JavaToWsdlType java2Wsdl = config.addNewJavaWsdl();<NEW_LINE>ServiceType service = java2Wsdl.addNewService();<NEW_LINE>service.setEndpoint(values.get(ENDPOINT));<NEW_LINE>service.setStyle(Style.Enum.forString(values.get(STYLE)));<NEW_LINE>service.setParameterStyle(ParameterStyle.Enum.forString(values.get(PARAMETER_STYLE)));<NEW_LINE>service.setName(values.get(SERVICE_NAME));<NEW_LINE>MappingType mapping = java2Wsdl.addNewMapping();<NEW_LINE>mapping.setFile(values.get(MAPPING));<NEW_LINE>NamespacesType namespaces = java2Wsdl.addNewNamespaces();<NEW_LINE>namespaces.setTargetNamespace(values.get(TARGET_NAMESPACE));<NEW_LINE>namespaces.setTypeNamespace<MASK><NEW_LINE>WsxmlType webservices = java2Wsdl.addNewWebservices();<NEW_LINE>if (values.get(EJB_LINK) != null && values.get(EJB_LINK).length() > 0) {<NEW_LINE>webservices.setEjbLink(values.get(EJB_LINK));<NEW_LINE>}<NEW_LINE>if (values.get(SERVLET_LINK) != null && values.get(SERVLET_LINK).length() > 0) {<NEW_LINE>webservices.setServletLink(values.get(SERVLET_LINK));<NEW_LINE>}<NEW_LINE>return configDocument;<NEW_LINE>}
|
(values.get(TYPES_NAMESPACE));
|
1,263,984
|
private boolean incrementRGBColor(RTextArea textArea) {<NEW_LINE>try {<NEW_LINE>int caretPosition = textArea.getCaretPosition();<NEW_LINE>int[] result = findColorAt(textArea, caretPosition);<NEW_LINE>if (result == null)<NEW_LINE>return false;<NEW_LINE>int start = result[0];<NEW_LINE>int len = result[1];<NEW_LINE>// find start of color part that should be changed (red, green, blue or alpha)<NEW_LINE>int start2;<NEW_LINE>int hexDigitCount = (len == 4 || len == 5) ? 1 : 2;<NEW_LINE>if (hexDigitCount == 1) {<NEW_LINE>// #RGB or #RGBA<NEW_LINE>start2 = caretPosition - 1;<NEW_LINE>} else {<NEW_LINE>// #RRGGBB or #RRGGBBAA<NEW_LINE>int offset = caretPosition - (start + 1);<NEW_LINE>offset += (offset % 2);<NEW_LINE>start2 = start + 1 + offset - 2;<NEW_LINE>}<NEW_LINE>start2 = Math.<MASK><NEW_LINE>// parse number<NEW_LINE>String str = textArea.getText(start2, hexDigitCount);<NEW_LINE>int number = Integer.parseInt(str, 16);<NEW_LINE>// increment/decrement number<NEW_LINE>if (increment)<NEW_LINE>number++;<NEW_LINE>else<NEW_LINE>number--;<NEW_LINE>// wrap numbers if less than zero or too large<NEW_LINE>int maxNumber = (hexDigitCount == 1) ? 15 : 255;<NEW_LINE>if (number < 0)<NEW_LINE>number = maxNumber;<NEW_LINE>else if (number > maxNumber)<NEW_LINE>number = 0;<NEW_LINE>// update editor<NEW_LINE>String newStr = String.format(hexDigitCount == 1 ? "%1x" : "%02x", number);<NEW_LINE>textArea.replaceRange(newStr, start2, start2 + hexDigitCount);<NEW_LINE>return true;<NEW_LINE>} catch (BadLocationException | IndexOutOfBoundsException | NumberFormatException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
|
max(start2, start + 1);
|
1,053,721
|
public ExternallyReferencedCandidate createInvoiceCandidate(@NonNull final NewManualInvoiceCandidate newIC) {<NEW_LINE>final ExternallyReferencedCandidateBuilder candidate = ExternallyReferencedCandidate.createBuilder(newIC);<NEW_LINE>final ICountryDAO countryDAO = Services.get(ICountryDAO.class);<NEW_LINE>final BPartnerComposite bpartnerComp = bPartnerCompositeRepository.getById(newIC.getBillPartnerInfo().getBpartnerId());<NEW_LINE>final BPartnerLocation location = bpartnerComp.extractLocation(newIC.getBillPartnerInfo().getBpartnerLocationId()).get();<NEW_LINE>final CountryId countryId = countryDAO.getCountryIdByCountryCode(location.getCountryCode());<NEW_LINE>final IPricingBL pricingBL = Services.get(IPricingBL.class);<NEW_LINE>final IEditablePricingContext pricingContext = pricingBL.createInitialContext(newIC.getOrgId(), newIC.getProductId(), newIC.getBillPartnerInfo().getBpartnerId(), newIC.getQtyOrdered().getStockQty(), newIC.getSoTrx()).setCountryId(countryId).setPriceDate(newIC.getDateOrdered()).setFailIfNotCalculated();<NEW_LINE>final IPricingResult pricingResult = pricingBL.calculatePrice(pricingContext);<NEW_LINE>candidate.pricingSystemId(pricingResult.getPricingSystemId());<NEW_LINE>candidate.priceListVersionId(pricingResult.getPriceListVersionId());<NEW_LINE>final ProductPrice priceEntered = ProductPrice.builder().money(Money.of(pricingResult.getPriceStd(), pricingResult.getCurrencyId())).productId(pricingResult.getProductId()).uomId(pricingResult.<MASK><NEW_LINE>candidate.priceEntered(priceEntered);<NEW_LINE>candidate.discount(pricingResult.getDiscount());<NEW_LINE>final BigDecimal priceActualBD = pricingResult.getDiscount().subtractFromBase(pricingResult.getPriceStd(), pricingResult.getPrecision().toInt());<NEW_LINE>final ProductPrice priceActual = ProductPrice.builder().money(Money.of(priceActualBD, pricingResult.getCurrencyId())).productId(pricingResult.getProductId()).uomId(pricingResult.getPriceUomId()).build();<NEW_LINE>candidate.priceActual(priceActual);<NEW_LINE>final ZoneId timeZone = orgDAO.getTimeZone(newIC.getOrgId());<NEW_LINE>final TaxId taxId = // shipDate<NEW_LINE>Services.get(ITaxBL.class).// shipDate<NEW_LINE>getTaxNotNull(// shipDate<NEW_LINE>newIC, // shipDate<NEW_LINE>pricingResult.getTaxCategoryId(), // shipDate<NEW_LINE>newIC.getProductId().getRepoId(), // ship location id<NEW_LINE>TimeUtil.asTimestamp(newIC.getDateOrdered(), timeZone), // ship location id<NEW_LINE>newIC.getOrgId(), // ship location id<NEW_LINE>newIC.getSoTrx().isSales() ? orgDAO.getOrgWarehouseId(newIC.getOrgId()) : orgDAO.getOrgPOWarehouseId(newIC.getOrgId()), newIC.getBillPartnerInfo().toBPartnerLocationAndCaptureId(), newIC.getSoTrx());<NEW_LINE>candidate.taxId(taxId);<NEW_LINE>final BPartner bpartner = bpartnerComp.getBpartner();<NEW_LINE>final InvoiceRule partnerInvoiceRule = newIC.getSoTrx().isSales() ? bpartner.getCustomerInvoiceRule() : bpartner.getVendorInvoiceRule();<NEW_LINE>final InvoiceRule invoiceRule = coalesce(partnerInvoiceRule, InvoiceRule.Immediate);<NEW_LINE>candidate.invoiceRule(invoiceRule);<NEW_LINE>return candidate.build();<NEW_LINE>}
|
getPriceUomId()).build();
|
94,562
|
public static DescribeSqlFlashbakTaskResponse unmarshall(DescribeSqlFlashbakTaskResponse describeSqlFlashbakTaskResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeSqlFlashbakTaskResponse.setRequestId(_ctx.stringValue("DescribeSqlFlashbakTaskResponse.RequestId"));<NEW_LINE>describeSqlFlashbakTaskResponse.setSuccess(_ctx.booleanValue("DescribeSqlFlashbakTaskResponse.Success"));<NEW_LINE>List<SqlFlashbackTask> sqlFlashbackTasks = new ArrayList<SqlFlashbackTask>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks.Length"); i++) {<NEW_LINE>SqlFlashbackTask sqlFlashbackTask = new SqlFlashbackTask();<NEW_LINE>sqlFlashbackTask.setId(_ctx.longValue("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks[" + i + "].Id"));<NEW_LINE>sqlFlashbackTask.setGmtCreate(_ctx.longValue("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks[" + i + "].GmtCreate"));<NEW_LINE>sqlFlashbackTask.setGmtModified(_ctx.longValue("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks[" + i + "].GmtModified"));<NEW_LINE>sqlFlashbackTask.setInstId(_ctx.stringValue("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks[" + i + "].InstId"));<NEW_LINE>sqlFlashbackTask.setDbName(_ctx.stringValue("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks[" + i + "].DbName"));<NEW_LINE>sqlFlashbackTask.setSearchStartTime(_ctx.longValue("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks[" + i + "].SearchStartTime"));<NEW_LINE>sqlFlashbackTask.setSearchEndTime(_ctx.longValue<MASK><NEW_LINE>sqlFlashbackTask.setTableName(_ctx.stringValue("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks[" + i + "].TableName"));<NEW_LINE>sqlFlashbackTask.setTraceId(_ctx.stringValue("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks[" + i + "].TraceId"));<NEW_LINE>sqlFlashbackTask.setSqlType(_ctx.stringValue("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks[" + i + "].SqlType"));<NEW_LINE>sqlFlashbackTask.setSqlPk(_ctx.stringValue("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks[" + i + "].SqlPk"));<NEW_LINE>sqlFlashbackTask.setRecallType(_ctx.integerValue("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks[" + i + "].RecallType"));<NEW_LINE>sqlFlashbackTask.setRecallStatus(_ctx.integerValue("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks[" + i + "].RecallStatus"));<NEW_LINE>sqlFlashbackTask.setRecallProgress(_ctx.integerValue("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks[" + i + "].RecallProgress"));<NEW_LINE>sqlFlashbackTask.setRecallRestoreType(_ctx.integerValue("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks[" + i + "].RecallRestoreType"));<NEW_LINE>sqlFlashbackTask.setDownloadUrl(_ctx.stringValue("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks[" + i + "].DownloadUrl"));<NEW_LINE>sqlFlashbackTask.setExpireTime(_ctx.longValue("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks[" + i + "].ExpireTime"));<NEW_LINE>sqlFlashbackTask.setSqlCounter(_ctx.longValue("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks[" + i + "].SqlCounter"));<NEW_LINE>sqlFlashbackTasks.add(sqlFlashbackTask);<NEW_LINE>}<NEW_LINE>describeSqlFlashbakTaskResponse.setSqlFlashbackTasks(sqlFlashbackTasks);<NEW_LINE>return describeSqlFlashbakTaskResponse;<NEW_LINE>}
|
("DescribeSqlFlashbakTaskResponse.SqlFlashbackTasks[" + i + "].SearchEndTime"));
|
177,650
|
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see com.aptana.ide.core.ftp.BaseFTPConnectionFileManager#readFile(org.eclipse.core.runtime.IPath,<NEW_LINE>* org.eclipse.core.runtime.IProgressMonitor)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>protected InputStream readFile(IPath path, IProgressMonitor monitor) throws CoreException, FileNotFoundException {<NEW_LINE>monitor.beginTask(Messages.FTPConnectionFileManager_initiating_download, 4);<NEW_LINE>FTPClient downloadFtpClient = <MASK><NEW_LINE>try {<NEW_LINE>initAndAuthFTPClient(downloadFtpClient, monitor);<NEW_LINE>Policy.checkCanceled(monitor);<NEW_LINE>setMessageLogger(downloadFtpClient, messageLogWriter);<NEW_LINE>downloadFtpClient.setType(IFTPConstants.TRANSFER_TYPE_ASCII.equals(transferType) ? FTPTransferType.ASCII : FTPTransferType.BINARY);<NEW_LINE>try {<NEW_LINE>downloadFtpClient.chdir(path.removeLastSegments(1).toPortableString());<NEW_LINE>} catch (FTPException e) {<NEW_LINE>throwFileNotFound(e, path.removeLastSegments(1));<NEW_LINE>}<NEW_LINE>monitor.worked(1);<NEW_LINE>Policy.checkCanceled(monitor);<NEW_LINE>try {<NEW_LINE>return new FTPFileDownloadInputStream(pool, downloadFtpClient, new FTPInputStream(downloadFtpClient, path.lastSegment()));<NEW_LINE>} catch (FTPException e) {<NEW_LINE>throwFileNotFound(e, path);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>setMessageLogger(downloadFtpClient, null);<NEW_LINE>pool.checkIn(downloadFtpClient);<NEW_LINE>if (e instanceof OperationCanceledException) {<NEW_LINE>throw (OperationCanceledException) e;<NEW_LINE>} else if (e instanceof FileNotFoundException) {<NEW_LINE>throw (FileNotFoundException) e;<NEW_LINE>}<NEW_LINE>throw new CoreException(new Status(Status.ERROR, FTPPlugin.PLUGIN_ID, Messages.FTPConnectionFileManager_opening_file_read_failed, e));<NEW_LINE>} finally {<NEW_LINE>monitor.done();<NEW_LINE>}<NEW_LINE>}
|
(FTPClient) pool.checkOut();
|
662,423
|
public static Memory fgets(Environment env, TraceInfo trace, Memory stream, Memory length) {<NEW_LINE>if (stream.instanceOf(Stream.CLASS_NAME)) {<NEW_LINE>InputStream in = Stream.getInputStream(env, stream);<NEW_LINE>if (in != null) {<NEW_LINE>int read;<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>try {<NEW_LINE>while ((read = in.read()) != -1) {<NEW_LINE>if (length.isNotNull() && sb.length() >= length.toInteger()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (read == '\n' || read == '\r') {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>sb.append((char) read);<NEW_LINE>}<NEW_LINE>return StringMemory.<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>env.warning(trace, "fgets(): " + e.getMessage());<NEW_LINE>return Memory.FALSE;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>env.warning(trace, "fgets(): unable to get from a non-stream");<NEW_LINE>return Memory.FALSE;<NEW_LINE>}
|
valueOf(sb.toString());
|
1,175,657
|
private Optional<Boolean> currentSyncStatus(final ChainHead localChain, final Optional<ChainHeadEstimate> syncTargetChain, final Optional<ChainHeadEstimate> bestPeerChain) {<NEW_LINE>final Optional<Boolean> inSyncWithSyncTarget = syncTargetChain.map(remote -> isInSync(localChain, remote));<NEW_LINE>final Optional<Boolean> inSyncWithBestPeer = bestPeerChain.map(remote <MASK><NEW_LINE>// If we're out of sync with either peer, we're out of sync<NEW_LINE>if (inSyncWithSyncTarget.isPresent() && !inSyncWithSyncTarget.get()) {<NEW_LINE>return Optional.of(false);<NEW_LINE>}<NEW_LINE>if (inSyncWithBestPeer.isPresent() && !inSyncWithBestPeer.get()) {<NEW_LINE>return Optional.of(false);<NEW_LINE>}<NEW_LINE>// Otherwise, if either peer is in sync, we're in sync<NEW_LINE>return inSyncWithSyncTarget.or(() -> inSyncWithBestPeer);<NEW_LINE>}
|
-> isInSync(localChain, remote));
|
611,081
|
private void drawLastBite(MatrixStack matrixStack, int regionX, int regionZ) {<NEW_LINE>Matrix4f matrix = matrixStack.peek().getPositionMatrix();<NEW_LINE>BufferBuilder bufferBuilder = Tessellator.getInstance().getBuffer();<NEW_LINE>RenderSystem.setShader(GameRenderer::getPositionShader);<NEW_LINE>if (lastSoundPos != null) {<NEW_LINE>matrixStack.push();<NEW_LINE>matrixStack.translate(lastSoundPos.x - regionX, lastSoundPos.<MASK><NEW_LINE>float[] colorF = ddColor.getColorF();<NEW_LINE>RenderSystem.setShaderColor(colorF[0], colorF[1], colorF[2], 0.5F);<NEW_LINE>bufferBuilder.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION);<NEW_LINE>bufferBuilder.vertex(matrix, (float) -0.125, 0, (float) -0.125).next();<NEW_LINE>bufferBuilder.vertex(matrix, (float) 0.125, 0, (float) 0.125).next();<NEW_LINE>bufferBuilder.vertex(matrix, (float) 0.125, 0, (float) -0.125).next();<NEW_LINE>bufferBuilder.vertex(matrix, (float) -0.125, 0, (float) 0.125).next();<NEW_LINE>bufferBuilder.end();<NEW_LINE>BufferRenderer.draw(bufferBuilder);<NEW_LINE>matrixStack.pop();<NEW_LINE>}<NEW_LINE>}
|
y, lastSoundPos.z - regionZ);
|
1,495,660
|
private void queryServerNow() {<NEW_LINE>Long offsetResult = null;<NEW_LINE>for (int i = 0; i < MAX_QUERY_RETRIES; i++) {<NEW_LINE>try {<NEW_LINE>NTPUDPClient client = new NTPUDPClient();<NEW_LINE>// Timeout if a response takes longer than 10 seconds<NEW_LINE>client.setDefaultTimeout(DEFAULT_NTP_TIMEOUT_MS);<NEW_LINE>client.open();<NEW_LINE>InetAddress address = InetAddress.getByName(ntpServer);<NEW_LINE>TimeInfo info = client.getTime(address);<NEW_LINE>info.computeDetails();<NEW_LINE>Long offset = info.getOffset();<NEW_LINE>if (offset == null) {<NEW_LINE>throw new Exception("Could not calculate time offset (offset is null)");<NEW_LINE>} else {<NEW_LINE>offsetResult = offset;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Error querying NTP server, attempt {} of {}", (i <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (offsetResult == null) {<NEW_LINE>log.error("Could not successfully query NTP server after " + MAX_QUERY_RETRIES + " tries");<NEW_LINE>throw new RuntimeException("Could not successfully query NTP server after " + MAX_QUERY_RETRIES + " tries");<NEW_LINE>}<NEW_LINE>lastOffsetGetTimeSystemMS = System.currentTimeMillis();<NEW_LINE>lastOffsetMilliseconds = offsetResult;<NEW_LINE>log.debug("Updated local time offset based on NTP server result. Offset = {}", lastOffsetMilliseconds);<NEW_LINE>}
|
+ 1), MAX_QUERY_RETRIES, e);
|
197,720
|
public static void logicAnd(GrayU8 inputA, GrayU8 inputB, GrayU8 output) {<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(0, inputA.height, y -> {<NEW_LINE>for (int y = 0; y < inputA.height; y++) {<NEW_LINE>int indexA = inputA.startIndex + y * inputA.stride;<NEW_LINE>int indexB = inputB.startIndex + y * inputB.stride;<NEW_LINE>int indexOut = output.startIndex + y * output.stride;<NEW_LINE>int end = indexA + inputA.width;<NEW_LINE>for (; indexA < end; indexA++, indexB++, indexOut++) {<NEW_LINE>int valA = inputA.data[indexA];<NEW_LINE>output.data[indexOut] = valA == 1 && valA == inputB.data[indexB] ? (<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
|
byte) 1 : (byte) 0;
|
1,166,983
|
protected void registerStatesAndModels() {<NEW_LINE>registerFluidBlockStates(MekanismFluids.FLUIDS.getAllFluids());<NEW_LINE>ResourceLocation basicCube = modLoc("block/basic_cube");<NEW_LINE>for (Map.Entry<IResource, BlockRegistryObject<?, ?>> entry : MekanismBlocks.PROCESSED_RESOURCE_BLOCKS.entrySet()) {<NEW_LINE>String registrySuffix = entry.getKey().getRegistrySuffix();<NEW_LINE>ResourceLocation texture = modLoc("block/block_" + registrySuffix);<NEW_LINE>ModelFile file;<NEW_LINE>if (models().textureExists(texture)) {<NEW_LINE>// If we have an override we can just use a basic cube that has no color tints in it<NEW_LINE>file = models().withExistingParent("block/storage/" + registrySuffix, basicCube).texture("all", texture);<NEW_LINE>} else {<NEW_LINE>// If the texture does not exist fallback to the default texture and use a colorable base model<NEW_LINE>file = models().withExistingParent("block/storage/" + registrySuffix, modLoc("block/colored_cube")).texture("all", modLoc("block/resource_block"));<NEW_LINE>}<NEW_LINE>simpleBlock(entry.getValue().getBlock(), file);<NEW_LINE>models().withExistingParent("item/block_" + registrySuffix, modLoc("block/storage/" + registrySuffix));<NEW_LINE>}<NEW_LINE>for (Map.Entry<OreType, OreBlockType> entry : MekanismBlocks.ORES.entrySet()) {<NEW_LINE>String registrySuffix = entry.getKey().getResource().getRegistrySuffix();<NEW_LINE>OreBlockType oreBlockType = entry.getValue();<NEW_LINE>addOreBlock(basicCube, oreBlockType.stone(), "block/ore/" + registrySuffix);<NEW_LINE>addOreBlock(basicCube, oreBlockType.deepslate(), "block/deepslate_ore/" + registrySuffix);<NEW_LINE>}<NEW_LINE>BlockModelBuilder barrelModel = models().cubeBottomTop(MekanismBlocks.PERSONAL_BARREL.getName(), Mekanism.rl("block/personal_barrel/side"), Mekanism.rl("block/personal_barrel/bottom"), Mekanism.rl("block/personal_barrel/top"));<NEW_LINE>BlockModelBuilder openBarrel = models().getBuilder(MekanismBlocks.PERSONAL_BARREL.getName() + "_open").parent(barrelModel).texture("top"<MASK><NEW_LINE>directionalBlock(MekanismBlocks.PERSONAL_BARREL.getBlock(), state -> state.getValue(BlockStateProperties.OPEN) ? openBarrel : barrelModel);<NEW_LINE>models().withExistingParent("item/" + MekanismBlocks.PERSONAL_BARREL.getName(), modLoc("block/" + MekanismBlocks.PERSONAL_BARREL.getName()));<NEW_LINE>}
|
, Mekanism.rl("block/personal_barrel/top_open"));
|
1,659,318
|
public ManualSyncSubmissionResult resetConnection(final UUID connectionId) {<NEW_LINE>log.info("reset sync request");<NEW_LINE>final boolean workflowReachable = isWorkflowReachable(getConnectionManagerName(connectionId));<NEW_LINE>if (!workflowReachable) {<NEW_LINE>log.error("Can't reset a non-reachable workflow");<NEW_LINE>return new ManualSyncSubmissionResult(Optional.of("No scheduler workflow is reachable for: " + connectionId<MASK><NEW_LINE>}<NEW_LINE>final ConnectionManagerWorkflow connectionManagerWorkflow = getExistingWorkflow(ConnectionManagerWorkflow.class, getConnectionManagerName(connectionId));<NEW_LINE>final long oldJobId = connectionManagerWorkflow.getJobInformation().getJobId();<NEW_LINE>connectionManagerWorkflow.resetConnection();<NEW_LINE>do {<NEW_LINE>try {<NEW_LINE>Thread.sleep(DELAY_BETWEEN_QUERY_MS);<NEW_LINE>} catch (final InterruptedException e) {<NEW_LINE>return new ManualSyncSubmissionResult(Optional.of("Didn't manage to reset a sync for: " + connectionId), Optional.empty());<NEW_LINE>}<NEW_LINE>} while (connectionManagerWorkflow.getJobInformation().getJobId() == oldJobId);<NEW_LINE>log.info("end of reset submission");<NEW_LINE>final long jobId = connectionManagerWorkflow.getJobInformation().getJobId();<NEW_LINE>return new ManualSyncSubmissionResult(Optional.empty(), Optional.of(jobId));<NEW_LINE>}
|
), Optional.empty());
|
1,045,289
|
static void bitRotateCCW(final int[] src, int srcPos, @SuppressWarnings("SameParameterValue") int srcStep, final byte[] dst, int dstPos, int dstStep) {<NEW_LINE>int idx = srcPos;<NEW_LINE>int lonyb;<NEW_LINE>int hinyb;<NEW_LINE>long lo = 0;<NEW_LINE>long hi = 0;<NEW_LINE>for (int i = 7; i >= 0; i--) {<NEW_LINE>lonyb = src[idx] & 0xF;<NEW_LINE>hinyb = (src[idx] >> 4) & 0xF;<NEW_LINE>lo |= RTABLE[i][lonyb];<NEW_LINE>hi |= RTABLE[i][hinyb];<NEW_LINE>idx += srcStep;<NEW_LINE>}<NEW_LINE>idx = dstPos;<NEW_LINE>dst[idx] = (byte) (lo & 0xFF);<NEW_LINE>idx += dstStep;<NEW_LINE>dst[idx] = (byte) ((lo >> 8) & 0xFF);<NEW_LINE>idx += dstStep;<NEW_LINE>dst[idx] = (byte) ((<MASK><NEW_LINE>idx += dstStep;<NEW_LINE>dst[idx] = (byte) ((lo >> 24) & 0xFF);<NEW_LINE>idx += dstStep;<NEW_LINE>dst[idx] = (byte) (hi & 0xFF);<NEW_LINE>idx += dstStep;<NEW_LINE>dst[idx] = (byte) ((hi >> 8) & 0xFF);<NEW_LINE>idx += dstStep;<NEW_LINE>dst[idx] = (byte) ((hi >> 16) & 0xFF);<NEW_LINE>idx += dstStep;<NEW_LINE>dst[idx] = (byte) ((hi >> 24) & 0xFF);<NEW_LINE>}
|
lo >> 16) & 0xFF);
|
57,882
|
public static DescribeBackupsResponse unmarshall(DescribeBackupsResponse describeBackupsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeBackupsResponse.setRequestId(_ctx.stringValue("DescribeBackupsResponse.RequestId"));<NEW_LINE>describeBackupsResponse.setTotalCount(_ctx.stringValue("DescribeBackupsResponse.TotalCount"));<NEW_LINE>describeBackupsResponse.setPageNumber(_ctx.stringValue("DescribeBackupsResponse.PageNumber"));<NEW_LINE>describeBackupsResponse.setPageSize(_ctx.stringValue("DescribeBackupsResponse.PageSize"));<NEW_LINE>List<Backup> items = new ArrayList<Backup>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeBackupsResponse.Items.Length"); i++) {<NEW_LINE>Backup backup = new Backup();<NEW_LINE>backup.setBackupId(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupId"));<NEW_LINE>backup.setDBInstanceId(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].DBInstanceId"));<NEW_LINE>backup.setBackupStartTime(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupStartTime"));<NEW_LINE>backup.setBackupEndTime(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupEndTime"));<NEW_LINE>backup.setBackupType(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupType"));<NEW_LINE>backup.setBackupSize(_ctx.integerValue("DescribeBackupsResponse.Items[" + i + "].BackupSize"));<NEW_LINE>backup.setBackupStatus(_ctx.stringValue("DescribeBackupsResponse.Items[" + i + "].BackupStatus"));<NEW_LINE>backup.setBackupMethod(_ctx.stringValue<MASK><NEW_LINE>items.add(backup);<NEW_LINE>}<NEW_LINE>describeBackupsResponse.setItems(items);<NEW_LINE>return describeBackupsResponse;<NEW_LINE>}
|
("DescribeBackupsResponse.Items[" + i + "].BackupMethod"));
|
299,790
|
public List<ScanningResult> importResults(String fileName, AbstractFeederGUI feeder) throws IOException {<NEW_LINE>List<ScanningResult> results = new ArrayList<>();<NEW_LINE>BufferedReader reader = null;<NEW_LINE>try {<NEW_LINE>reader = new BufferedReader(new FileReader(fileName));<NEW_LINE>String startIP = null;<NEW_LINE>String endIP = null;<NEW_LINE>String lastLoadedIP = null;<NEW_LINE>List<String> columns = emptyList();<NEW_LINE>int ipIndex = 0, pingIndex = 1, portsIndex = 3;<NEW_LINE>String[] lookingFor = { Labels.getLabel("exporter.txt.scanned"), Labels<MASK><NEW_LINE>int lookingForIndex = 0;<NEW_LINE>String line;<NEW_LINE>while ((line = reader.readLine()) != null) {<NEW_LINE>String[] sp;<NEW_LINE>if (lookingForIndex < lookingFor.length) {<NEW_LINE>sp = line.split("\\s");<NEW_LINE>if (lookingFor[lookingForIndex].equals(sp[0])) {<NEW_LINE>if (lookingForIndex == 0) {<NEW_LINE>startIP = sp[1];<NEW_LINE>endIP = sp[3];<NEW_LINE>lookingForIndex++;<NEW_LINE>} else if (lookingForIndex == 1) {<NEW_LINE>sp = line.split("\\s{2,}");<NEW_LINE>columns = asList(sp);<NEW_LINE>pingIndex = columns.indexOf(Labels.getLabel(PingFetcher.ID));<NEW_LINE>portsIndex = columns.indexOf(Labels.getLabel(PortsFetcher.ID));<NEW_LINE>lookingForIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>sp = line.split("\\s{2,}");<NEW_LINE>if (sp.length < columns.size())<NEW_LINE>continue;<NEW_LINE>InetAddress addr = InetAddress.getByName(sp[ipIndex]);<NEW_LINE>lastLoadedIP = sp[ipIndex];<NEW_LINE>ScanningResult r = new ScanningResult(addr, sp.length);<NEW_LINE>if (portsIndex > 0 && sp[portsIndex].matches("\\d.*"))<NEW_LINE>r.setType(WITH_PORTS);<NEW_LINE>else if (pingIndex > 0 && sp[pingIndex].matches("\\d.*"))<NEW_LINE>r.setType(ALIVE);<NEW_LINE>else<NEW_LINE>r.setType(DEAD);<NEW_LINE>r.setValues(sp);<NEW_LINE>results.add(r);<NEW_LINE>}<NEW_LINE>if (lastLoadedIP != null && !lastLoadedIP.equals(endIP)) {<NEW_LINE>InetAddress nextStartIP = increment(InetAddress.getByName(lastLoadedIP));<NEW_LINE>startIP = nextStartIP.getHostAddress();<NEW_LINE>}<NEW_LINE>feeder.unserialize(startIP, endIP);<NEW_LINE>return results;<NEW_LINE>} finally {<NEW_LINE>closeQuietly(reader);<NEW_LINE>}<NEW_LINE>}
|
.getLabel(IPFetcher.ID) };
|
1,834,290
|
public DescribeBatchPredictionsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeBatchPredictionsResult describeBatchPredictionsResult = new DescribeBatchPredictionsResult();<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 describeBatchPredictionsResult;<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("Results", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeBatchPredictionsResult.setResults(new ListUnmarshaller<BatchPrediction>(BatchPredictionJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeBatchPredictionsResult.setNextToken(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeBatchPredictionsResult;<NEW_LINE>}
|
class).unmarshall(context));
|
1,297,359
|
private static Map<TypeAlias, jnr.ffi.NativeType> buildTypeMap() {<NEW_LINE>Map<TypeAlias, jnr.ffi.NativeType> m = new EnumMap<TypeAlias, jnr.ffi.NativeType>(TypeAlias.class);<NEW_LINE>m.put(TypeAlias.int8_t, NativeType.SCHAR);<NEW_LINE>m.put(TypeAlias.u_int8_t, NativeType.UCHAR);<NEW_LINE>m.put(TypeAlias.int16_t, NativeType.SSHORT);<NEW_LINE>m.put(TypeAlias.u_int16_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.int32_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.u_int32_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.int64_t, NativeType.SLONGLONG);<NEW_LINE>m.put(TypeAlias.u_int64_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.intptr_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.uintptr_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.caddr_t, NativeType.ADDRESS);<NEW_LINE>m.put(TypeAlias.dev_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.blkcnt_t, NativeType.SLONGLONG);<NEW_LINE>m.put(TypeAlias.blksize_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.gid_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.in_addr_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.in_port_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.ino_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.ino64_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.key_t, NativeType.SLONGLONG);<NEW_LINE>m.put(TypeAlias.mode_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.nlink_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.id_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.pid_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.off_t, NativeType.SLONGLONG);<NEW_LINE>m.put(TypeAlias.swblk_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.uid_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.clock_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.size_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.ssize_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.time_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.fsblkcnt_t, NativeType.ULONG);<NEW_LINE>m.put(<MASK><NEW_LINE>m.put(TypeAlias.sa_family_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.socklen_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.rlim_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.cc_t, NativeType.UCHAR);<NEW_LINE>m.put(TypeAlias.speed_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.tcflag_t, NativeType.UINT);<NEW_LINE>return m;<NEW_LINE>}
|
TypeAlias.fsfilcnt_t, NativeType.ULONG);
|
1,595,043
|
public static LogicalSchema buildSchema(final LogicalSchema inputSchema, final List<FunctionCall> tableFunctions, final FunctionRegistry functionRegistry) {<NEW_LINE>final LogicalSchema.Builder schemaBuilder = LogicalSchema.builder();<NEW_LINE>final List<Column> cols = inputSchema.value();<NEW_LINE>// We copy all the original columns to the output schema<NEW_LINE>schemaBuilder.keyColumns(inputSchema.key());<NEW_LINE>for (final Column col : cols) {<NEW_LINE>schemaBuilder.valueColumn(col);<NEW_LINE>}<NEW_LINE>final ExpressionTypeManager expressionTypeManager = new ExpressionTypeManager(inputSchema, functionRegistry);<NEW_LINE>// And add new columns representing the exploded values at the end<NEW_LINE>for (int i = 0; i < tableFunctions.size(); i++) {<NEW_LINE>final FunctionCall functionCall = tableFunctions.get(i);<NEW_LINE>final ColumnName colName = ColumnNames.synthesisedSchemaColumn(i);<NEW_LINE>final SqlType fieldType = expressionTypeManager.getExpressionSqlType(functionCall);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return schemaBuilder.build();<NEW_LINE>}
|
schemaBuilder.valueColumn(colName, fieldType);
|
1,738,121
|
private File unpackedJar(String resolvedVersion, String stubsGroup, String stubsModule, String classifier) {<NEW_LINE>try {<NEW_LINE>log.info("Resolved version is [" + resolvedVersion + "]");<NEW_LINE>if (!StringUtils.hasText(resolvedVersion)) {<NEW_LINE>log.warn("Stub for group [" + stubsGroup + "] module [" + stubsModule + "] and classifier [" + classifier + "] not found in " + this.remoteRepos);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Artifact artifact = new DefaultArtifact(stubsGroup, stubsModule, classifier, ARTIFACT_EXTENSION, resolvedVersion);<NEW_LINE>ArtifactRequest request = new ArtifactRequest(artifact, this.remoteRepos, null);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Resolving artifact [" + <MASK><NEW_LINE>}<NEW_LINE>ArtifactResult result = this.repositorySystem.resolveArtifact(this.session, request);<NEW_LINE>log.info("Resolved artifact [" + artifact + "] to " + result.getArtifact().getFile());<NEW_LINE>File temporaryFile = unpackStubJarToATemporaryFolder(result.getArtifact().getFile().toURI());<NEW_LINE>log.info("Unpacked file to [" + temporaryFile + "]");<NEW_LINE>return temporaryFile;<NEW_LINE>} catch (IllegalStateException ise) {<NEW_LINE>throw ise;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IllegalStateException("Exception occurred while trying to download a stub for group [" + stubsGroup + "] module [" + stubsModule + "] and classifier [" + classifier + "] in " + this.remoteRepos, e);<NEW_LINE>}<NEW_LINE>}
|
artifact + "] using remote repositories " + this.remoteRepos);
|
975,658
|
private ValidationResult validate(GoPluginDescriptor descriptor, Map<String, List<String>> extensionsInfoFromPlugin) {<NEW_LINE>ValidationResult validationResult = new ValidationResult(descriptor.id());<NEW_LINE>final Set<String> gocdSupportedExtensions = extensionsRegistry.allRegisteredExtensions();<NEW_LINE>final Set<String> difference = SetUtils.difference(extensionsInfoFromPlugin.keySet(), gocdSupportedExtensions).toSet();<NEW_LINE>if (difference.size() > 0) {<NEW_LINE>validationResult.addError(format<MASK><NEW_LINE>return validationResult;<NEW_LINE>}<NEW_LINE>for (String extensionType : extensionsInfoFromPlugin.keySet()) {<NEW_LINE>final List<Double> gocdSupportedExtensionVersions = extensionsRegistry.gocdSupportedExtensionVersions(extensionType).stream().map(Double::parseDouble).collect(toList());<NEW_LINE>final List<String> requiredExtensionVersionsByPlugin = extensionsInfoFromPlugin.get(extensionType);<NEW_LINE>validateExtensionVersions(validationResult, extensionType, gocdSupportedExtensionVersions, requiredExtensionVersionsByPlugin);<NEW_LINE>}<NEW_LINE>return validationResult;<NEW_LINE>}
|
(UNSUPPORTED_EXTENSION_ERROR_MESSAGE, difference, gocdSupportedExtensions));
|
307,759
|
private void loadBatchVariables() {<NEW_LINE>MBPartner businessPartner = (MBPartner) getC_BPartner();<NEW_LINE>List<MHRAttendanceRecord> attendanceList = getLines(false);<NEW_LINE>if (!isLeave()) {<NEW_LINE>this.firstAttendance = attendanceList.stream().findFirst().get();<NEW_LINE>this.lastAttendance = attendanceList.get(attendanceList.size() - 1);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>setHR_Employee_ID(employee.getHR_Employee_ID());<NEW_LINE>String employeePayrollValue = null;<NEW_LINE>if (employee.getHR_Payroll_ID() != 0) {<NEW_LINE>MHRPayroll employeePayroll = MHRPayroll.getById(getCtx(), employee.getHR_Payroll_ID(), get_TrxName());<NEW_LINE>employeePayrollValue = employeePayroll.getValue();<NEW_LINE>}<NEW_LINE>workShift = MHRWorkShift.getById(getCtx(), getHR_WorkShift_ID());<NEW_LINE>//<NEW_LINE>scriptCtx.put("_HR_FirstAttendanceRecord", firstAttendance);<NEW_LINE>scriptCtx.put("_HR_LastAttendanceRecord", lastAttendance);<NEW_LINE>if (firstAttendance != null) {<NEW_LINE>scriptCtx.put("_FirstAttendanceTime", firstAttendance.getAttendanceTime());<NEW_LINE>}<NEW_LINE>if (lastAttendance != null) {<NEW_LINE>scriptCtx.put("_LastAttendanceTime", lastAttendance.getAttendanceTime());<NEW_LINE>}<NEW_LINE>scriptCtx.put("_DateStart", employee.getStartDate());<NEW_LINE>scriptCtx.put("_DateEnd", employee.getEndDate());<NEW_LINE>scriptCtx.put("_C_BPartner_ID", businessPartner.getC_BPartner_ID());<NEW_LINE>scriptCtx.put("_HR_Employee_ID", employee.getHR_Employee_ID());<NEW_LINE>scriptCtx.put("_C_BPartner", businessPartner);<NEW_LINE>scriptCtx.put("_HR_Employee", employee);<NEW_LINE>scriptCtx.put("_HR_Employee_Payroll_Value", employeePayrollValue);<NEW_LINE>// Document<NEW_LINE>scriptCtx.put("_DateDoc", getDateDoc());<NEW_LINE>scriptCtx.put("_HR_AttendanceBatch_ID", getHR_AttendanceBatch_ID());<NEW_LINE>scriptCtx.<MASK><NEW_LINE>scriptCtx.put("_HR_ShiftSchedule_ID", getHR_ShiftSchedule_ID());<NEW_LINE>scriptCtx.put("process", this);<NEW_LINE>scriptCtx.put("_HR_WorkShift", workShift);<NEW_LINE>scriptCtx.put("_ShiftFromTime", workShift.getShiftFromTime());<NEW_LINE>scriptCtx.put("_ShiftToTime", workShift.getShiftToTime());<NEW_LINE>scriptCtx.put("_BreakStartTime", workShift.getBreakStartTime());<NEW_LINE>scriptCtx.put("_BreakEndTime", workShift.getBreakEndTime());<NEW_LINE>BigDecimal breakHoursNo = workShift.getBreakHoursNo();<NEW_LINE>BigDecimal hoursNo = workShift.getNoOfHours();<NEW_LINE>if (breakHoursNo == null) {<NEW_LINE>breakHoursNo = Env.ZERO;<NEW_LINE>}<NEW_LINE>if (hoursNo == null) {<NEW_LINE>hoursNo = Env.ZERO;<NEW_LINE>}<NEW_LINE>scriptCtx.put("_BreakHoursNo", breakHoursNo.doubleValue());<NEW_LINE>scriptCtx.put("_NoOfHours", hoursNo.doubleValue());<NEW_LINE>scriptCtx.put("_ExpectedShiftFromTime", TimeUtil.getDayTime(getDateDoc(), workShift.getShiftFromTime()));<NEW_LINE>scriptCtx.put("_ExpectedShiftToTime", TimeUtil.getDayTime(getDateDoc(), workShift.getShiftToTime()));<NEW_LINE>}
|
put("_HR_WorkShift_ID", getHR_WorkShift_ID());
|
810,200
|
private LiveBean parseBean(String id, String contextId, JSONObject beansJSON) {<NEW_LINE>String type = beansJSON.optString("type");<NEW_LINE>String <MASK><NEW_LINE>String resource = beansJSON.optString("resource");<NEW_LINE>JSONArray aliasesJSON = beansJSON.optJSONArray("aliases");<NEW_LINE>String[] aliases;<NEW_LINE>if (aliasesJSON == null) {<NEW_LINE>aliases = NO_STRINGS;<NEW_LINE>} else {<NEW_LINE>aliases = new String[aliasesJSON.length()];<NEW_LINE>for (int i = 0; i < aliasesJSON.length(); i++) {<NEW_LINE>aliases[i] = aliasesJSON.optString(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JSONArray dependenciesJSON = beansJSON.optJSONArray("dependencies");<NEW_LINE>String[] dependencies;<NEW_LINE>if (dependenciesJSON == null) {<NEW_LINE>dependencies = NO_STRINGS;<NEW_LINE>} else {<NEW_LINE>dependencies = new String[dependenciesJSON.length()];<NEW_LINE>for (int i = 0; i < dependenciesJSON.length(); i++) {<NEW_LINE>dependencies[i] = dependenciesJSON.optString(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new LiveBean(id, aliases, scope, type, resource, dependencies);<NEW_LINE>}
|
scope = beansJSON.optString("scope");
|
563,852
|
protected void renderBg(PoseStack matrices, float partialTicks, int mouseX, int mouseY) {<NEW_LINE>RenderUtils.setup(BACKGROUND_IMAGE);<NEW_LINE>this.border.draw(matrices);<NEW_LINE>BACKGROUND.drawScaled(matrices, this.leftPos + 4, this.topPos + 4, this.imageWidth - 8, this.imageHeight - 8);<NEW_LINE>float y = 5 + this.topPos;<NEW_LINE>float x = 5 + this.leftPos;<NEW_LINE>int color = 0xfff0f0f0;<NEW_LINE>// info ? in the top right corner<NEW_LINE>if (this.hasTooltips()) {<NEW_LINE>this.font.draw(matrices, "?", guiRight() - this.border.w - this.font.width("?") / 2f, this.topPos + 5, 0xff5f5f5f);<NEW_LINE>}<NEW_LINE>// draw caption<NEW_LINE>int scaledFontHeight = this.getScaledFontHeight();<NEW_LINE>if (this.hasCaption()) {<NEW_LINE>int x2 = this.imageWidth / 2;<NEW_LINE>x2 -= this.font.<MASK><NEW_LINE>this.font.drawShadow(matrices, this.caption.getVisualOrderText(), (float) this.leftPos + x2, y, color);<NEW_LINE>y += scaledFontHeight + 3;<NEW_LINE>}<NEW_LINE>if (this.text == null || this.text.size() == 0) {<NEW_LINE>// no text to draw<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>float textHeight = font.lineHeight + 0.5f;<NEW_LINE>float lowerBound = (this.topPos + this.imageHeight - 5) / this.textScale;<NEW_LINE>matrices.pushPose();<NEW_LINE>matrices.scale(this.textScale, this.textScale, 1.0f);<NEW_LINE>// RenderSystem.scalef(this.textScale, this.textScale, 1.0f);<NEW_LINE>x /= this.textScale;<NEW_LINE>y /= this.textScale;<NEW_LINE>// render shown lines<NEW_LINE>ListIterator<FormattedCharSequence> iter = this.getTotalLines().listIterator(this.slider.getValue());<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>if (y + textHeight - 0.5f > lowerBound) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>FormattedCharSequence line = iter.next();<NEW_LINE>this.font.drawShadow(matrices, line, x, y, color);<NEW_LINE>y += textHeight;<NEW_LINE>}<NEW_LINE>matrices.popPose();<NEW_LINE>// RenderSystem.scalef(1f / textScale, 1f / textScale, 1.0f);<NEW_LINE>// RenderSystem.setShaderTexture(0, BACKGROUND_IMAGE);<NEW_LINE>RenderUtils.setup(BACKGROUND_IMAGE);<NEW_LINE>this.slider.update(mouseX, mouseY);<NEW_LINE>this.slider.draw(matrices);<NEW_LINE>}
|
width(this.caption) / 2;
|
1,226,267
|
private MenuManager createViewTabsMenu() {<NEW_LINE>MenuManager manager = new MenuManager("&Tabs");<NEW_LINE>for (MainTab.Type type : MainTab.Type.values()) {<NEW_LINE>Action action = type.createAction(shown -> {<NEW_LINE>models.analytics.postInteraction(type.view, shown ? <MASK><NEW_LINE>if (shown) {<NEW_LINE>TabInfo tabInfo = new MainTab(type, parent -> {<NEW_LINE>Tab tab = type.factory.create(parent, models, widgets);<NEW_LINE>tab.reinitialize();<NEW_LINE>return tab.getControl();<NEW_LINE>});<NEW_LINE>if (type.top) {<NEW_LINE>tabs.addTabToFirstFolder(tabInfo);<NEW_LINE>} else {<NEW_LINE>tabs.addTabToLargestFolder(tabInfo);<NEW_LINE>}<NEW_LINE>tabs.showTab(type);<NEW_LINE>hiddenTabs.remove(type);<NEW_LINE>} else {<NEW_LINE>tabs.disposeTab(type);<NEW_LINE>hiddenTabs.add(type);<NEW_LINE>}<NEW_LINE>models.settings.writeTabs().clearHidden().addAllHidden(hiddenTabs.stream().map(MainTab.Type::name).collect(toList()));<NEW_LINE>});<NEW_LINE>action.setChecked(!hiddenTabs.contains(type));<NEW_LINE>manager.add(action);<NEW_LINE>}<NEW_LINE>return manager;<NEW_LINE>}
|
ClientAction.Enable : ClientAction.Disable);
|
1,142,765
|
private void doGetCompletions(final String token, final List<String> assocData, final List<Integer> dataType, final List<Integer> numCommas, final String functionCallString, final String chainObjectName, final JsArrayString chainAdditionalArgs, final JsArrayString chainExcludeArgs, final boolean chainExcludeArgsFromObject, final String filePath, final String documentId, final String line, final boolean isConsole, final ServerRequestCallback<Completions> requestCallback) {<NEW_LINE>int optionsStartOffset;<NEW_LINE>if (rnwContext_ != null && (optionsStartOffset = rnwContext_.getRnwOptionsStart(token, token.length())) >= 0) {<NEW_LINE>doGetSweaveCompletions(token, optionsStartOffset, token.length(), requestCallback);<NEW_LINE>} else {<NEW_LINE>server_.getCompletions(token, assocData, dataType, numCommas, functionCallString, chainObjectName, chainAdditionalArgs, chainExcludeArgs, chainExcludeArgsFromObject, filePath, <MASK><NEW_LINE>}<NEW_LINE>}
|
documentId, line, isConsole, requestCallback);
|
338,751
|
private ListMultimap<FreightCostId, FreightCostShipper> retrieveShippers(@NonNull final Collection<FreightCostId> freightCostIds) {<NEW_LINE>if (freightCostIds.isEmpty()) {<NEW_LINE>return ImmutableListMultimap.of();<NEW_LINE>}<NEW_LINE>final List<I_M_FreightCostShipper> shipperRecords = queryBL.createQueryBuilderOutOfTrx(I_M_FreightCostShipper.class).addOnlyActiveRecordsFilter().addInArrayFilter(I_M_FreightCostShipper.COLUMNNAME_M_FreightCost_ID, freightCostIds).create().list();<NEW_LINE>final ImmutableSet<FreightCostShipperId> fcShipperIds = shipperRecords.stream().map(record -> FreightCostShipperId.ofRepoId(record.getM_FreightCostShipper_ID())).collect(ImmutableSet.toImmutableSet());<NEW_LINE>final ImmutableListMultimap<FreightCostShipperId, FreightCostBreak> breaks = retrieveBreaks(fcShipperIds);<NEW_LINE>if (Check.isEmpty(breaks)) {<NEW_LINE>final IMsgBL msgBL = <MASK><NEW_LINE>final ITranslatableString translatableMsgText = msgBL.getTranslatableMsgText(MSG_NO_FREIGHT_COST_DETAIL);<NEW_LINE>throw new AdempiereException(translatableMsgText);<NEW_LINE>}<NEW_LINE>final ListMultimap<FreightCostId, FreightCostShipper> result = ArrayListMultimap.create();<NEW_LINE>for (final I_M_FreightCostShipper shipperRecord : shipperRecords) {<NEW_LINE>final FreightCostId freightCostId = FreightCostId.ofRepoId(shipperRecord.getM_FreightCost_ID());<NEW_LINE>final FreightCostShipperId fcShipperId = FreightCostShipperId.ofRepoId(shipperRecord.getM_FreightCostShipper_ID());<NEW_LINE>final FreightCostShipper shipper = toFreightCostShipper(shipperRecord, breaks.get(fcShipperId));<NEW_LINE>result.put(freightCostId, shipper);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
|
Services.get(IMsgBL.class);
|
1,749,987
|
public Void call() throws Exception {<NEW_LINE>Random random = new Random();<NEW_LINE>int recordsPerPage = format.getRecordsPerPage();<NEW_LINE>int recordSize = format.getRecordSize();<NEW_LINE>try (PageCursor cursor = pagedFile.io(0, PF_SHARED_WRITE_LOCK, CursorContext.NULL)) {<NEW_LINE>while (!condition.fulfilled()) {<NEW_LINE>int recordId = random.nextInt(maxRecords);<NEW_LINE>int pageId = recordId / recordsPerPage;<NEW_LINE>int recordOffset = (recordId % recordsPerPage) * recordSize;<NEW_LINE>locks.lock(recordId);<NEW_LINE>try {<NEW_LINE>assertTrue(cursor.next(pageId), "I must be able to access pages");<NEW_LINE>cursor.setOffset(recordOffset);<NEW_LINE>long newValue = format.incrementCounter(cursor, threadId);<NEW_LINE>countSum++;<NEW_LINE>assertFalse(cursor.shouldRetry(), "Write lock, so never a need to retry");<NEW_LINE>assertThat(newValue).describedAs<MASK><NEW_LINE>} finally {<NEW_LINE>locks.unlock(recordId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
|
("Record-local count must be less than or equal to thread-local count sum").isLessThanOrEqualTo(countSum);
|
1,749,260
|
private Configuration toVendorIndependentConfiguration() {<NEW_LINE>_c = new Configuration(getHostname(), ConfigurationFormat.CUMULUS_NCLU);<NEW_LINE>_c.setDeviceModel(DeviceModel.CUMULUS_UNSPECIFIED);<NEW_LINE>_c.setDefaultCrossZoneAction(LineAction.PERMIT);<NEW_LINE>_c.setDefaultInboundAction(LineAction.PERMIT);<NEW_LINE>_c.setExportBgpFromBgpRib(true);<NEW_LINE>convertPhysicalInterfaces();<NEW_LINE>convertSubinterfaces();<NEW_LINE>convertVlanInterfaces();<NEW_LINE>convertLoopback();<NEW_LINE>convertBondInterfaces();<NEW_LINE>convertVrfLoopbackInterfaces();<NEW_LINE>convertVrfs();<NEW_LINE>convertDefaultVrf();<NEW_LINE>convertIpAsPathAccessLists(_c, _ipAsPathAccessLists);<NEW_LINE>convertIpPrefixLists(_c, _ipPrefixLists);<NEW_LINE>convertIpCommunityLists(_c, _ipCommunityLists);<NEW_LINE>convertRouteMaps(_c, this, _routeMaps, _w);<NEW_LINE>convertDnsServers(_c, _ipv4Nameservers);<NEW_LINE>convertClags(_c, this, _w);<NEW_LINE>// Compute explicit VNI -> VRF mappings for L3 VNIs:<NEW_LINE>Map<Integer, String> vniToVrf = _vrfs.values().stream().filter(vrf -> vrf.getVni() != null).collect(ImmutableMap.toImmutableMap(Vrf::getVni, Vrf::getName));<NEW_LINE>convertVxlans(_c, this, vniToVrf, _loopback.getClagVxlanAnycastIp(), _loopback.getVxlanLocalTunnelip(), _w);<NEW_LINE>convertOspfProcess(_c, this, _w);<NEW_LINE><MASK><NEW_LINE>initVendorFamily();<NEW_LINE>markStructures();<NEW_LINE>warnDuplicateClagIds();<NEW_LINE>return _c;<NEW_LINE>}
|
convertBgpProcess(_c, this, _w);
|
1,496,806
|
private static WritableMap[] createPointersArray(TouchEvent event) {<NEW_LINE>MotionEvent motionEvent = event.getMotionEvent();<NEW_LINE>WritableMap[] touches = new WritableMap[motionEvent.getPointerCount()];<NEW_LINE>// Calculate the coordinates for the target view.<NEW_LINE>// The MotionEvent contains the X,Y of the touch in the coordinate space of the root view<NEW_LINE>// The TouchEvent contains the X,Y of the touch in the coordinate space of the target view<NEW_LINE>// Subtracting them allows us to get the coordinates of the target view's top left corner<NEW_LINE>// We then use this when computing the view specific touches below<NEW_LINE>// Since only one view is actually handling even multiple touches, the values are all relative<NEW_LINE>// to this one target view.<NEW_LINE>float targetViewCoordinateX = motionEvent.getX<MASK><NEW_LINE>float targetViewCoordinateY = motionEvent.getY() - event.getViewY();<NEW_LINE>for (int index = 0; index < motionEvent.getPointerCount(); index++) {<NEW_LINE>WritableMap touch = Arguments.createMap();<NEW_LINE>// pageX,Y values are relative to the RootReactView<NEW_LINE>// the motionEvent already contains coordinates in that view<NEW_LINE>touch.putDouble(PAGE_X_KEY, PixelUtil.toDIPFromPixel(motionEvent.getX(index)));<NEW_LINE>touch.putDouble(PAGE_Y_KEY, PixelUtil.toDIPFromPixel(motionEvent.getY(index)));<NEW_LINE>// locationX,Y values are relative to the target view<NEW_LINE>// To compute the values for the view, we subtract that views location from the event X,Y<NEW_LINE>float locationX = motionEvent.getX(index) - targetViewCoordinateX;<NEW_LINE>float locationY = motionEvent.getY(index) - targetViewCoordinateY;<NEW_LINE>touch.putDouble(LOCATION_X_KEY, PixelUtil.toDIPFromPixel(locationX));<NEW_LINE>touch.putDouble(LOCATION_Y_KEY, PixelUtil.toDIPFromPixel(locationY));<NEW_LINE>touch.putInt(TARGET_SURFACE_KEY, event.getSurfaceId());<NEW_LINE>touch.putInt(TARGET_KEY, event.getViewTag());<NEW_LINE>touch.putDouble(TIMESTAMP_KEY, event.getTimestampMs());<NEW_LINE>touch.putDouble(POINTER_IDENTIFIER_KEY, motionEvent.getPointerId(index));<NEW_LINE>touches[index] = touch;<NEW_LINE>}<NEW_LINE>return touches;<NEW_LINE>}
|
() - event.getViewX();
|
187,172
|
public void configure(Object... keyValues) {<NEW_LINE>Object key = keyValues[0];<NEW_LINE>Object value = keyValues[1];<NEW_LINE>if (key.equals(Hits.AUTH_PROP)) {<NEW_LINE>if (!(value instanceof String)) {<NEW_LINE>throw new IllegalArgumentException("auth requires a String as its argument");<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} else if (key.equals(Hits.HUB_PROP)) {<NEW_LINE>if (!(value instanceof String)) {<NEW_LINE>throw new IllegalArgumentException("hub requires a String as its argument");<NEW_LINE>}<NEW_LINE>this.hubProp = (String) value;<NEW_LINE>} else if (key.equals(Hits.TIMES)) {<NEW_LINE>if (!(value instanceof Integer)) {<NEW_LINE>throw new IllegalArgumentException("times requires an Integer as its argument");<NEW_LINE>}<NEW_LINE>this.maxIterations = (int) value;<NEW_LINE>} else if (key.equals(Hits.EDGES)) {<NEW_LINE>if (!(value instanceof String)) {<NEW_LINE>throw new IllegalArgumentException("edges requires an String as its argument");<NEW_LINE>}<NEW_LINE>this.edgeLabels = Lists.newArrayList((String) value);<NEW_LINE>} else {<NEW_LINE>this.parameters.set(this, keyValues);<NEW_LINE>}<NEW_LINE>}
|
this.authProp = (String) value;
|
1,173,928
|
private static void expandDataFileRules(Path file) throws IOException {<NEW_LINE>boolean modified = false;<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>try (InputStream stream = Files.newInputStream(file);<NEW_LINE>InputStreamReader reader = new InputStreamReader(stream, StandardCharsets.UTF_8);<NEW_LINE>BufferedReader bufferedReader = new BufferedReader(reader)) {<NEW_LINE>String line;<NEW_LINE>boolean verbatim = false;<NEW_LINE>int lineNum = 0;<NEW_LINE>while (null != (line = bufferedReader.readLine())) {<NEW_LINE>++lineNum;<NEW_LINE>if (VERBATIM_RULE_LINE_PATTERN.matcher(line).matches()) {<NEW_LINE>verbatim = true;<NEW_LINE>builder.append(line).append("\n");<NEW_LINE>} else {<NEW_LINE>Matcher ruleMatcher = RULE_LINE_PATTERN.matcher(line);<NEW_LINE>if (ruleMatcher.matches()) {<NEW_LINE>verbatim = false;<NEW_LINE>builder.append(line).append("\n");<NEW_LINE>try {<NEW_LINE>String leftHandSide = ruleMatcher.<MASK><NEW_LINE>String rightHandSide = ruleMatcher.group(2).trim();<NEW_LINE>expandSingleRule(builder, leftHandSide, rightHandSide);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>System.err.println("ERROR in " + file.getFileName() + " line #" + lineNum + ":");<NEW_LINE>e.printStackTrace(System.err);<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>modified = true;<NEW_LINE>} else {<NEW_LINE>if (BLANK_OR_COMMENT_LINE_PATTERN.matcher(line).matches()) {<NEW_LINE>builder.append(line).append("\n");<NEW_LINE>} else {<NEW_LINE>if (verbatim) {<NEW_LINE>builder.append(line).append("\n");<NEW_LINE>} else {<NEW_LINE>modified = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (modified) {<NEW_LINE>System.err.println("Expanding rules in and overwriting " + file.getFileName());<NEW_LINE>Files.writeString(file, builder.toString(), StandardCharsets.UTF_8);<NEW_LINE>}<NEW_LINE>}
|
group(1).trim();
|
1,406,730
|
public // a special symbol which is a place holder for the bitrange operator<NEW_LINE>void defineBitrange(Location location, String name, VarnodeSymbol sym, int bitoffset, int numb) {<NEW_LINE>entry("defineBitrange", location, name, sym, bitoffset, numb);<NEW_LINE>String namecopy = name;<NEW_LINE>// Number of bits<NEW_LINE>int size = 8 * sym.getSize();<NEW_LINE>if (numb == 0) {<NEW_LINE>reportError(location, "Size of bitrange is zero for '" + namecopy + "'");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ((bitoffset >= size) || ((bitoffset + numb) > size)) {<NEW_LINE>reportError(location, "Bad bitrange for '" + namecopy + "'");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if ((bitoffset % 8 == 0) && (numb % 8 == 0)) {<NEW_LINE>// This can be reduced to an ordinary varnode definition<NEW_LINE>AddrSpace newspace = sym.getFixedVarnode().space;<NEW_LINE>long newoffset = sym.getFixedVarnode().offset;<NEW_LINE>int newsize = numb / 8;<NEW_LINE>if (isBigEndian()) {<NEW_LINE>newoffset += (size - bitoffset - numb) / 8;<NEW_LINE>} else {<NEW_LINE>newoffset += bitoffset / 8;<NEW_LINE>}<NEW_LINE>addSymbol(new VarnodeSymbol(location, namecopy, newspace, newoffset, newsize));<NEW_LINE>} else {<NEW_LINE>if (size > 64) {<NEW_LINE>reportError(location, "'" + sym.getName() + "': " + "Illegal bitrange on varnode larger than 64 bits");<NEW_LINE>}<NEW_LINE>// Otherwise define the special symbol<NEW_LINE>addSymbol(new BitrangeSymbol(location, namecopy<MASK><NEW_LINE>}<NEW_LINE>}
|
, sym, bitoffset, numb));
|
1,709,892
|
public void drawTransform(Transform xf) {<NEW_LINE>GL2 gl = panel.getGL().getGL2();<NEW_LINE>getWorldToScreenToOut(xf.p, temp);<NEW_LINE>temp2.setZero();<NEW_LINE>float k_axisScale = 0.4f;<NEW_LINE>gl.glBegin(GL2.GL_LINES);<NEW_LINE>gl.glColor3f(1, 0, 0);<NEW_LINE>temp2.x = xf.p.x + k_axisScale * xf.q.c;<NEW_LINE>temp2.y = xf.p.y + k_axisScale * xf.q.s;<NEW_LINE>getWorldToScreenToOut(temp2, temp2);<NEW_LINE>gl.glVertex2f(temp.x, temp.y);<NEW_LINE>gl.glVertex2f(temp2.x, temp2.y);<NEW_LINE>gl.glColor3f(0, 1, 0);<NEW_LINE>temp2.x = xf.p.x + -k_axisScale * xf.q.s;<NEW_LINE>temp2.y = xf.p.y + k_axisScale * xf.q.c;<NEW_LINE>getWorldToScreenToOut(temp2, temp2);<NEW_LINE>gl.glVertex2f(temp.x, temp.y);<NEW_LINE>gl.glVertex2f(<MASK><NEW_LINE>gl.glEnd();<NEW_LINE>}
|
temp2.x, temp2.y);
|
1,016,677
|
public void remove(Component component) {<NEW_LINE>JComponent composition = DesktopComponentsHelper.getComposition(component);<NEW_LINE>if (wrappers.containsKey(component)) {<NEW_LINE>impl.remove(wrappers.get(component).getFirst());<NEW_LINE>wrappers.remove(component);<NEW_LINE>} else {<NEW_LINE>impl.remove(composition);<NEW_LINE>}<NEW_LINE>if (captions.containsKey(component)) {<NEW_LINE>impl.remove(captions.get(component));<NEW_LINE>captions.remove(component);<NEW_LINE>}<NEW_LINE>if (component.getId() != null) {<NEW_LINE>componentByIds.remove(component.getId());<NEW_LINE>}<NEW_LINE>ownComponents.remove(component);<NEW_LINE><MASK><NEW_LINE>if (expandedComponent == component) {<NEW_LINE>expandedComponent = null;<NEW_LINE>}<NEW_LINE>if (component instanceof DesktopAbstractComponent && !isEnabledWithParent()) {<NEW_LINE>((DesktopAbstractComponent) component).setParentEnabled(true);<NEW_LINE>}<NEW_LINE>component.setParent(null);<NEW_LINE>requestContainerUpdate();<NEW_LINE>requestRepaint();<NEW_LINE>}
|
DesktopContainerHelper.assignContainer(component, null);
|
1,501,255
|
private void computeBlock() {<NEW_LINE>// Prepare message schedule.<NEW_LINE>for (int t = 16; t < blockBuffer.length; t++) {<NEW_LINE>blockBuffer[t] = enforceOverflow(sigma1(blockBuffer[t - 2]) + blockBuffer[t - 7] + sigma0(blockBuffer[t - 15]) + blockBuffer[t - 16]);<NEW_LINE>}<NEW_LINE>// Init working variables with hash value from previously round.<NEW_LINE>int a = hash[0];<NEW_LINE>int b = hash[1];<NEW_LINE>int c = hash[2];<NEW_LINE>int d = hash[3];<NEW_LINE>int e = hash[4];<NEW_LINE>int f = hash[5];<NEW_LINE>int g = hash[6];<NEW_LINE>int h = hash[7];<NEW_LINE>for (int t = 0; t < 64; t++) {<NEW_LINE>int t1 = h + sum1(e) + ch(e, f, g) + K[t] + blockBuffer[t];<NEW_LINE>int t2 = sum0(a) + maj(a, b, c);<NEW_LINE>h = g;<NEW_LINE>g = f;<NEW_LINE>f = e;<NEW_LINE>e = enforceOverflow(d + t1);<NEW_LINE>d = c;<NEW_LINE>c = b;<NEW_LINE>b = a;<NEW_LINE>a = enforceOverflow(t1 + t2);<NEW_LINE>}<NEW_LINE>// Compute intermediate hash.<NEW_LINE>hash[0] = enforceOverflow(a + hash[0]);<NEW_LINE>hash[1] = enforceOverflow(b + hash[1]);<NEW_LINE>hash[2] = enforceOverflow(c + hash[2]);<NEW_LINE>hash[3] = enforceOverflow(d + hash[3]);<NEW_LINE>hash[4] = enforceOverflow(e + hash[4]);<NEW_LINE>hash[5] = enforceOverflow<MASK><NEW_LINE>hash[6] = enforceOverflow(g + hash[6]);<NEW_LINE>hash[7] = enforceOverflow(h + hash[7]);<NEW_LINE>blockOff = 0;<NEW_LINE>}
|
(f + hash[5]);
|
1,229,092
|
public void updateStream(String streamName, String releaseName, PackageIdentifier packageIdentifier, Map<String, String> updateProperties, boolean force, List<String> appNames) {<NEW_LINE>StreamDefinition streamDefinition = this.streamDefinitionRepository.findById(streamName).orElseThrow(() -> new NoSuchStreamDefinitionException(streamName));<NEW_LINE>String updateYaml = convertPropertiesToSkipperYaml(streamDefinition, updateProperties);<NEW_LINE>Release release = this.skipperStreamDeployer.upgradeStream(releaseName, packageIdentifier, updateYaml, force, appNames);<NEW_LINE>if (release != null) {<NEW_LINE>updateStreamDefinitionFromReleaseManifest(streamName, release.getManifest().getData());<NEW_LINE>final String sanatizedUpdateYaml = convertPropertiesToSkipperYaml(streamDefinition, this<MASK><NEW_LINE>final Map<String, Object> auditedData = new HashMap<>(3);<NEW_LINE>auditedData.put("releaseName", releaseName);<NEW_LINE>auditedData.put("packageIdentifier", packageIdentifier);<NEW_LINE>auditedData.put("updateYaml", sanatizedUpdateYaml);<NEW_LINE>this.auditRecordService.populateAndSaveAuditRecordUsingMapData(AuditOperationType.STREAM, AuditActionType.UPDATE, streamName, auditedData, release.getPlatformName());<NEW_LINE>} else {<NEW_LINE>logger.error("Missing release after Stream Update!");<NEW_LINE>}<NEW_LINE>}
|
.auditServiceUtils.sanitizeProperties(updateProperties));
|
470,457
|
public void dumpRaw(byte[] packet, Timestamp timestamp) throws NotOpenException {<NEW_LINE>if (packet == null || timestamp == null) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("packet: ").append(packet).append(" timestamp: ").append(timestamp);<NEW_LINE>throw new NullPointerException(sb.toString());<NEW_LINE>}<NEW_LINE>if (!open) {<NEW_LINE>throw new NotOpenException();<NEW_LINE>}<NEW_LINE>pcap_pkthdr header = new pcap_pkthdr();<NEW_LINE>header.len = header.caplen = packet.length;<NEW_LINE>header.ts = new timeval();<NEW_LINE>header.ts.tv_sec = new NativeLong(timestamp.getTime() / 1000L);<NEW_LINE>switch(timestampPrecision) {<NEW_LINE>case MICRO:<NEW_LINE>header.ts.tv_usec = new NativeLong(timestamp.getNanos() / 1000L);<NEW_LINE>break;<NEW_LINE>case NANO:<NEW_LINE>header.ts.tv_usec = new NativeLong(timestamp.getNanos());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new AssertionError("Never get here.");<NEW_LINE>}<NEW_LINE>if (!dumperLock.readLock().tryLock()) {<NEW_LINE>throw new NotOpenException();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (!open) {<NEW_LINE>throw new NotOpenException();<NEW_LINE>}<NEW_LINE>NativeMappings.<MASK><NEW_LINE>} finally {<NEW_LINE>dumperLock.readLock().unlock();<NEW_LINE>}<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Dumped a packet: " + ByteArrays.toHexString(packet, " "));<NEW_LINE>}<NEW_LINE>}
|
pcap_dump(dumper, header, packet);
|
232,430
|
private int addRemoveLanguageTranslations(@NonNull final String adLanguage, final boolean add) {<NEW_LINE>final List<String> trlTableNames = retrieveTrlTableNames();<NEW_LINE>int retNo = 0;<NEW_LINE>final List<String> errorTables = new ArrayList<>();<NEW_LINE>final List<Throwable> errorCauses = new ArrayList<>();<NEW_LINE>for (final String trlTableName : trlTableNames) {<NEW_LINE>try {<NEW_LINE>if (add) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>retNo += deleteTableTranslations(trlTableName, adLanguage);<NEW_LINE>}<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>// collect error<NEW_LINE>errorTables.add(trlTableName + "(" + adLanguage + ")");<NEW_LINE>errorCauses.add(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If we got some errors, build and throw an exception<NEW_LINE>if (!errorTables.isEmpty()) {<NEW_LINE>final AdempiereException ex = new AdempiereException((add ? "Adding" : "Removing") + " missing translations failed for following tables: " + errorTables);<NEW_LINE>for (final Throwable cause : errorCauses) {<NEW_LINE>ex.addSuppressed(cause);<NEW_LINE>}<NEW_LINE>throw ex;<NEW_LINE>}<NEW_LINE>return retNo;<NEW_LINE>}
|
retNo += addTableTranslations(trlTableName, adLanguage);
|
292,248
|
public void decrypt(Record record) throws CryptoException {<NEW_LINE>if (record.getComputations() == null) {<NEW_LINE>LOGGER.warn("Record computations are not prepared.");<NEW_LINE>record.prepareComputations();<NEW_LINE>}<NEW_LINE>LOGGER.debug("Decrypting Record");<NEW_LINE>RecordCryptoComputations computations = record.getComputations();<NEW_LINE>computations.setMacKey(getKeySet().getReadMacSecret(context.getChooser().getConnectionEndType()));<NEW_LINE>computations.setCipherKey(getKeySet().getReadKey(context.getChooser().getConnectionEndType()));<NEW_LINE>byte[] cipherText = record.getProtocolMessageBytes().getValue();<NEW_LINE>computations.setCiphertext(cipherText);<NEW_LINE>byte[] plainData = decryptCipher.decrypt(cipherText);<NEW_LINE>computations.setPlainRecordBytes(plainData);<NEW_LINE>plainData = computations.getPlainRecordBytes().getValue();<NEW_LINE>DecryptionParser parser = new DecryptionParser(0, plainData);<NEW_LINE>byte[] cleanBytes = parser.parseByteArrayField(plainData.<MASK><NEW_LINE>record.setCleanProtocolMessageBytes(cleanBytes);<NEW_LINE>record.getComputations().setAuthenticatedNonMetaData(cleanBytes);<NEW_LINE>record.getComputations().setAuthenticatedMetaData(collectAdditionalAuthenticatedData(record, version));<NEW_LINE>byte[] hmac = parser.parseByteArrayField(readMac.getMacLength());<NEW_LINE>record.getComputations().setMac(hmac);<NEW_LINE>byte[] calculatedHmac = calculateMac(ArrayConverter.concatenate(record.getComputations().getAuthenticatedMetaData().getValue(), record.getComputations().getAuthenticatedNonMetaData().getValue()), context.getTalkingConnectionEndType());<NEW_LINE>record.getComputations().setMacValid(Arrays.equals(hmac, calculatedHmac));<NEW_LINE>}
|
length - readMac.getMacLength());
|
965,504
|
final DescribeInstallationMediaResult executeDescribeInstallationMedia(DescribeInstallationMediaRequest describeInstallationMediaRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeInstallationMediaRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeInstallationMediaRequest> request = null;<NEW_LINE>Response<DescribeInstallationMediaResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeInstallationMediaRequestMarshaller().marshall(super.beforeMarshalling(describeInstallationMediaRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "RDS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeInstallationMedia");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeInstallationMediaResult> responseHandler = new StaxResponseHandler<DescribeInstallationMediaResult>(new DescribeInstallationMediaResultStaxUnmarshaller());<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.endEvent(Field.RequestMarshallTime);
|
1,451,938
|
public static Optional<String> readUserNetworkAddress(final HttpServletRequest request, final AppConfig config) {<NEW_LINE>final List<String> candidateAddresses = new ArrayList<>();<NEW_LINE>final boolean useXForwardedFor = config != null && config.readSettingAsBoolean(PwmSetting.USE_X_FORWARDED_FOR_HEADER);<NEW_LINE>if (useXForwardedFor) {<NEW_LINE>final String xForwardedForValue = request.getHeader(HttpHeader.XForwardedFor.getHttpName());<NEW_LINE>if (StringUtil.notEmpty(xForwardedForValue)) {<NEW_LINE>Collections.addAll(candidateAddresses<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>final String sourceIP = request.getRemoteAddr();<NEW_LINE>if (StringUtil.notEmpty(sourceIP)) {<NEW_LINE>candidateAddresses.add(sourceIP);<NEW_LINE>}<NEW_LINE>for (final String candidateAddress : candidateAddresses) {<NEW_LINE>final String trimAddr = candidateAddress.trim();<NEW_LINE>if (InetAddressValidator.getInstance().isValid(trimAddr)) {<NEW_LINE>return Optional.of(trimAddr);<NEW_LINE>} else {<NEW_LINE>LOGGER.warn(() -> "discarding bogus source network address '" + trimAddr + "'");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>}
|
, xForwardedForValue.split(","));
|
1,736,559
|
private CalculatorPlusListeners createStandardLocal(final VehicleRoutingProblem vrp, RouteAndActivityStateGetter statesManager) {<NEW_LINE>if (constraintManager == null)<NEW_LINE>throw new IllegalStateException("constraint-manager is null");<NEW_LINE>ActivityInsertionCostsCalculator actInsertionCalc;<NEW_LINE>ConfigureLocalActivityInsertionCalculator configLocal = null;<NEW_LINE>if (activityInsertionCostCalculator == null && addDefaultCostCalc) {<NEW_LINE>actInsertionCalc = new LocalActivityInsertionCostsCalculator(vrp.getTransportCosts(), vrp.getActivityCosts(), statesManager);<NEW_LINE>configLocal = new ConfigureLocalActivityInsertionCalculator(vrp, (LocalActivityInsertionCostsCalculator) actInsertionCalc);<NEW_LINE>} else if (activityInsertionCostCalculator == null && !addDefaultCostCalc) {<NEW_LINE>actInsertionCalc = new ActivityInsertionCostsCalculator() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public double getCosts(JobInsertionContext iContext, TourActivity prevAct, TourActivity nextAct, TourActivity newAct, double depTimeAtPrevAct) {<NEW_LINE>return 0.;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} else {<NEW_LINE>actInsertionCalc = activityInsertionCostCalculator;<NEW_LINE>}<NEW_LINE>JobActivityFactory activityFactory = new JobActivityFactory() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public List<AbstractActivity> createActivities(Job job) {<NEW_LINE>return vrp.copyAndGetActivities(job);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>JobInsertionCostsCalculator shipmentInsertion = shipmentCalculatorFactory.create(vrp, actInsertionCalc, activityFactory, constraintManager);<NEW_LINE>JobInsertionCostsCalculator serviceInsertion = serviceCalculatorFactory.create(vrp, actInsertionCalc, activityFactory, constraintManager);<NEW_LINE>JobInsertionCostsCalculator breakInsertion = breakCalculatorFactory.create(vrp, actInsertionCalc, activityFactory, constraintManager);<NEW_LINE>JobCalculatorSwitcher switcher = new JobCalculatorSwitcher();<NEW_LINE>switcher.put(Shipment.class, shipmentInsertion);<NEW_LINE>switcher.put(Service.class, serviceInsertion);<NEW_LINE>switcher.put(Pickup.class, serviceInsertion);<NEW_LINE>switcher.put(Delivery.class, serviceInsertion);<NEW_LINE>switcher.<MASK><NEW_LINE>CalculatorPlusListeners calculatorPlusListeners = new CalculatorPlusListeners(switcher);<NEW_LINE>if (configLocal != null) {<NEW_LINE>calculatorPlusListeners.insertionListener.add(configLocal);<NEW_LINE>}<NEW_LINE>return calculatorPlusListeners;<NEW_LINE>}
|
put(Break.class, breakInsertion);
|
1,612,803
|
public void testCallerIdentityPropagationFailureForDifferentRealm() throws Exception {<NEW_LINE>String testName = "testCallerIdentityPropagationFailureForDifferentRealm";<NEW_LINE>Log.info(c, testName, "Executing " + testName);<NEW_LINE>runInJCAFATServlet("fvtweb", servletName, testName);<NEW_LINE>assertNotNull("Expected Message J2CA0668E not found."<MASK><NEW_LINE>assertNotNull("Expected Message J2CA0670E not found.", server.waitForStringInLog(INVALID_USER_NAME_IN_PRINCIPAL_J2CA0670));<NEW_LINE>assertNotNull("Expected Message J2CA0671E not found.", server.waitForStringInLog(SECURITY_CONTEXT_NOT_ASSOCIATED_J2CA0671));<NEW_LINE>assertNotNull("Expected Message J2CA0672E not found.", server.waitForStringInLog(ERROR_HANDLING_CALLBACK_J2CA0672));<NEW_LINE>}
|
, server.waitForStringInLog(CUSTOM_CREDENTIALS_MISSING_J2CA0668));
|
1,051,944
|
public static Registry create(MetricsSettings metricsSettings) {<NEW_LINE>BaseRegistry result = new BaseRegistry(metricsSettings);<NEW_LINE>if (!metricsSettings.baseMetricsSettings().isEnabled()) {<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>MemoryMXBean memoryBean = ManagementFactory.getMemoryMXBean();<NEW_LINE>// load all base metrics<NEW_LINE>register(result, MEMORY_USED_HEAP, memoryBean.getHeapMemoryUsage(), MemoryUsage::getUsed);<NEW_LINE>register(result, MEMORY_COMMITTED_HEAP, memoryBean.getHeapMemoryUsage(), MemoryUsage::getCommitted);<NEW_LINE>register(result, MEMORY_MAX_HEAP, memoryBean.getHeapMemoryUsage(), MemoryUsage::getMax);<NEW_LINE>RuntimeMXBean runtimeBean = ManagementFactory.getRuntimeMXBean();<NEW_LINE>register(result, JVM_UPTIME, runtimeBean, RuntimeMXBean::getUptime);<NEW_LINE>ThreadMXBean threadBean = ManagementFactory.getThreadMXBean();<NEW_LINE>register(result, THREAD_COUNT, threadBean, ThreadMXBean::getThreadCount);<NEW_LINE>register(result, THREAD_DAEMON_COUNT, threadBean, ThreadMXBean::getDaemonThreadCount);<NEW_LINE>register(result, THREAD_MAX_COUNT, threadBean, ThreadMXBean::getPeakThreadCount);<NEW_LINE>ClassLoadingMXBean clBean = ManagementFactory.getClassLoadingMXBean();<NEW_LINE>register(result, CL_LOADED_COUNT, clBean, ClassLoadingMXBean::getLoadedClassCount);<NEW_LINE>register(result, CL_LOADED_TOTAL<MASK><NEW_LINE>register(result, CL_UNLOADED_COUNT, (SimpleCounter) clBean::getUnloadedClassCount);<NEW_LINE>OperatingSystemMXBean osBean = ManagementFactory.getOperatingSystemMXBean();<NEW_LINE>register(result, OS_AVAILABLE_CPU, osBean, OperatingSystemMXBean::getAvailableProcessors);<NEW_LINE>register(result, OS_LOAD_AVERAGE, osBean, OperatingSystemMXBean::getSystemLoadAverage);<NEW_LINE>List<GarbageCollectorMXBean> gcBeans = ManagementFactory.getGarbageCollectorMXBeans();<NEW_LINE>for (GarbageCollectorMXBean gcBean : gcBeans) {<NEW_LINE>String poolName = gcBean.getName();<NEW_LINE>register(result, gcCountMeta(), (SimpleCounter) gcBean::getCollectionCount, new Tag("name", poolName));<NEW_LINE>register(result, gcTimeMeta(), gcBean, GarbageCollectorMXBean::getCollectionTime, new Tag("name", poolName));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
|
, (SimpleCounter) clBean::getTotalLoadedClassCount);
|
325,522
|
private // the shared allocation optimization.<NEW_LINE>void addArcInitialization(EnumDeclaration node) {<NEW_LINE>List<Statement> stmts = node.getClassInitStatements().subList(0, 0);<NEW_LINE>int i = 0;<NEW_LINE>for (EnumConstantDeclaration constant : node.getEnumConstants()) {<NEW_LINE>VariableElement varElement = constant.getVariableElement();<NEW_LINE>ClassInstanceCreation creation = new ClassInstanceCreation(constant.getExecutablePair());<NEW_LINE>TreeUtil.copyList(constant.getArguments(), creation.getArguments());<NEW_LINE>String stringLiteralName = options.stripEnumConstants() ? ENUM_NAME_STRIPPED : ElementUtil.getName(varElement);<NEW_LINE>creation.addArgument(<MASK><NEW_LINE>creation.addArgument(new NumberLiteral(i++, typeUtil));<NEW_LINE>creation.setHasRetainedResult(true);<NEW_LINE>stmts.add(new ExpressionStatement(new Assignment(new SimpleName(varElement), creation)));<NEW_LINE>}<NEW_LINE>}
|
new StringLiteral(stringLiteralName, typeUtil));
|
127,092
|
private static List<ProductWithAvailabilityInfo> createProductWithAvailabilityInfos(@NonNull final LookupValue productLookupValue, @NonNull final ImmutableList<Group> availabilityInfoGroups, final boolean displayAvailabilityInfoOnlyIfPositive) {<NEW_LINE>final Set<ProductWithAvailabilityInfo> <MASK><NEW_LINE>ProductWithAvailabilityInfo productWithAvailabilityInfo_ALL = null;<NEW_LINE>ProductWithAvailabilityInfo productWithAvailabilityInfo_OTHERS = null;<NEW_LINE>for (final Group availabilityInfoGroup : availabilityInfoGroups) {<NEW_LINE>final ProductWithAvailabilityInfo productWithAvailabilityInfo = ProductWithAvailabilityInfo.builder().productId(productLookupValue.getIdAs(ProductId::ofRepoId)).productDisplayName(productLookupValue.getDisplayNameTrl()).qty(availabilityInfoGroup.getQty()).attributesType(availabilityInfoGroup.getType()).attributes(availabilityInfoGroup.getAttributes()).build();<NEW_LINE>result.add(productWithAvailabilityInfo);<NEW_LINE>if (productWithAvailabilityInfo.getAttributesType() == Group.Type.ALL_STORAGE_KEYS) {<NEW_LINE>productWithAvailabilityInfo_ALL = productWithAvailabilityInfo;<NEW_LINE>} else if (productWithAvailabilityInfo.getAttributesType() == Group.Type.OTHER_STORAGE_KEYS) {<NEW_LINE>productWithAvailabilityInfo_OTHERS = productWithAvailabilityInfo;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// If OTHERS has the same Qty as ALL, remove OTHERS because it's pointless<NEW_LINE>if (productWithAvailabilityInfo_ALL != null && productWithAvailabilityInfo_OTHERS != null && Objects.equals(productWithAvailabilityInfo_OTHERS.getQty(), productWithAvailabilityInfo_ALL.getQty())) {<NEW_LINE>result.remove(productWithAvailabilityInfo_OTHERS);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Remove non-positive quantities if asked<NEW_LINE>if (displayAvailabilityInfoOnlyIfPositive) {<NEW_LINE>result.removeIf(productWithAvailabilityInfo -> productWithAvailabilityInfo.getQty().signum() <= 0);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Make sure we have at least one entry for each product<NEW_LINE>if (result.isEmpty()) {<NEW_LINE>result.add(ProductWithAvailabilityInfo.builder().productId(productLookupValue.getIdAs(ProductId::ofRepoId)).productDisplayName(productLookupValue.getDisplayNameTrl()).qty(null).build());<NEW_LINE>}<NEW_LINE>return ImmutableList.copyOf(result);<NEW_LINE>}
|
result = new LinkedHashSet<>();
|
82,083
|
public void marshall(InstanceFleet instanceFleet, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (instanceFleet == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(instanceFleet.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(instanceFleet.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(instanceFleet.getInstanceFleetType(), INSTANCEFLEETTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(instanceFleet.getTargetOnDemandCapacity(), TARGETONDEMANDCAPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(instanceFleet.getTargetSpotCapacity(), TARGETSPOTCAPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(instanceFleet.getProvisionedOnDemandCapacity(), PROVISIONEDONDEMANDCAPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(instanceFleet.getProvisionedSpotCapacity(), PROVISIONEDSPOTCAPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(instanceFleet.getInstanceTypeSpecifications(), INSTANCETYPESPECIFICATIONS_BINDING);<NEW_LINE>protocolMarshaller.marshall(instanceFleet.getLaunchSpecifications(), LAUNCHSPECIFICATIONS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
|
instanceFleet.getName(), NAME_BINDING);
|
304,651
|
public static String generateObjectString(Object[] values) {<NEW_LINE>String[] line = new String[values.length];<NEW_LINE>for (int i = 0; i < values.length; i++) {<NEW_LINE>Object value = values[i];<NEW_LINE>if (value instanceof DBDCollection) {<NEW_LINE>value = ((DBDCollection) value).getRawValue();<NEW_LINE>}<NEW_LINE>if (value instanceof Object[]) {<NEW_LINE>String arrayPostgreStyle = Arrays.deepToString((Object[]) value).replace("[", "{").replace("]", "}").replace(" ", "");<NEW_LINE>// Strings are not quoted<NEW_LINE>line[i] = arrayPostgreStyle;<NEW_LINE>} else if (value instanceof JDBCComposite) {<NEW_LINE>line[i] = generateObjectString(((JDBCComposite) value).getValues());<NEW_LINE>} else if (value != null) {<NEW_LINE>// Values are simply skipped if they're NULL.<NEW_LINE>// https://www.postgresql.org/docs/current/rowtypes.html#id-1.5.7.24.6<NEW_LINE>line[i] = value.toString();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>StringWriter out = new StringWriter();<NEW_LINE>final CSVWriter writer = new CSVWriter(out);<NEW_LINE>writer.writeNext(line);<NEW_LINE>try {<NEW_LINE>writer.flush();<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.warn(e);<NEW_LINE>}<NEW_LINE>return "(" + out.toString<MASK><NEW_LINE>}
|
().trim() + ")";
|
1,169,868
|
public Query rewrite(IndexReader reader) throws IOException {<NEW_LINE>Query rewritten = super.rewrite(reader);<NEW_LINE>if (rewritten != this) {<NEW_LINE>return rewritten;<NEW_LINE>}<NEW_LINE>if (termArrays.isEmpty()) {<NEW_LINE>return new MatchNoDocsQuery();<NEW_LINE>}<NEW_LINE>MultiPhraseQuery.Builder query = new MultiPhraseQuery.Builder();<NEW_LINE>query.setSlop(slop);<NEW_LINE>int sizeMinus1 = termArrays.size() - 1;<NEW_LINE>for (int i = 0; i < sizeMinus1; i++) {<NEW_LINE>query.add(termArrays.get(i), positions.get(i));<NEW_LINE>}<NEW_LINE>Term[] <MASK><NEW_LINE>int position = positions.get(sizeMinus1);<NEW_LINE>ObjectHashSet<Term> terms = new ObjectHashSet<>();<NEW_LINE>for (Term term : suffixTerms) {<NEW_LINE>getPrefixTerms(terms, term, reader);<NEW_LINE>if (terms.size() > maxExpansions) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (terms.isEmpty()) {<NEW_LINE>if (sizeMinus1 == 0) {<NEW_LINE>// no prefix and the phrase query is empty<NEW_LINE>return Queries.newMatchNoDocsQuery("No terms supplied for " + MultiPhrasePrefixQuery.class.getName());<NEW_LINE>}<NEW_LINE>// Hack so that the Unified Highlighter can still extract the original terms from this query<NEW_LINE>// after rewriting, even though it would normally become a MatchNoDocsQuery against an empty<NEW_LINE>// index<NEW_LINE>return new BooleanQuery.Builder().add(query.build(), BooleanClause.Occur.MUST).add(new NoRewriteMatchNoDocsQuery("No terms supplied for " + MultiPhrasePrefixQuery.class.getName()), BooleanClause.Occur.MUST).build();<NEW_LINE>}<NEW_LINE>query.add(terms.toArray(Term.class), position);<NEW_LINE>return query.build();<NEW_LINE>}
|
suffixTerms = termArrays.get(sizeMinus1);
|
478,632
|
final DescribeExportResult executeDescribeExport(DescribeExportRequest describeExportRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeExportRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeExportRequest> request = null;<NEW_LINE>Response<DescribeExportResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeExportRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeExportRequest));<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, "DynamoDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeExport");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeExportResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeExportResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
|
endClientExecution(awsRequestMetrics, request, response);
|
1,706,112
|
private static PointCollection createShipPoints() {<NEW_LINE>PointCollection points = new PointCollection(SpatialReference.create(32126));<NEW_LINE>points.add(new Point(2330611.130549, 202360.002957, 0.000000));<NEW_LINE>points.add(new Point(2330583.834672, 202525.984012, 0.000000));<NEW_LINE>points.add(new Point(2330574.164902, 202691.488009, 0.000000));<NEW_LINE>points.add(new Point(2330689.292623, 203170.045888, 0.000000));<NEW_LINE>points.add(new Point(2330696.773344, 203317.495798, 0.000000));<NEW_LINE>points.add(new Point(2330691.419723, 203380.917080, 0.000000));<NEW_LINE>points.add(new Point(2330435.065296, 203816.662457, 0.000000));<NEW_LINE>points.add(new Point(2330369.500800, 204329.861789, 0.000000));<NEW_LINE>points.add(new Point(2330400.929891, 204712.129673, 0.000000));<NEW_LINE>points.add(new Point(2330484.300447, 204927.797132, 0.000000));<NEW_LINE>points.add(new Point(2330514.469919, 205000.792463, 0.000000));<NEW_LINE>points.add(new Point(2330638.099138, 205271.601116, 0.000000));<NEW_LINE>points.add(new Point(2330725.315888, 205631.231308, 0.000000));<NEW_LINE>points.add(new Point<MASK><NEW_LINE>points.add(new Point(2330680.644719, 206660.240923, 0.000000));<NEW_LINE>points.add(new Point(2330386.957926, 207340.947204, 0.000000));<NEW_LINE>points.add(new Point(2330485.861737, 207742.298501, 0.000000));<NEW_LINE>return points;<NEW_LINE>}
|
(2330755.640702, 206433.354860, 0.000000));
|
9,931
|
private boolean onlyWhitespacesBetween(final int endOffset, final int dot) {<NEW_LINE>// autoexpand a fold that was JUST CREATED, if there's no non-whitespace (not lexical, but actual) in between the<NEW_LINE>// fold end and the caret:<NEW_LINE>final String[] cnt = new String[1];<NEW_LINE>final Document doc = component.getDocument();<NEW_LINE>doc.render(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>int dl = doc.getLength();<NEW_LINE>int from = Math.min(dl, Math.min(endOffset, dot));<NEW_LINE>int to = Math.min(dl, Math.max(endOffset, dot));<NEW_LINE>try {<NEW_LINE>cnt[0] = doc.<MASK><NEW_LINE>} catch (BadLocationException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return (cnt[0] == null || cnt[0].trim().isEmpty());<NEW_LINE>}
|
getText(from, to - from);
|
1,421,963
|
static ZipFileData read(InputStream in, ZipFileData file) throws IOException {<NEW_LINE>if (file == null) {<NEW_LINE>throw new NullPointerException();<NEW_LINE>}<NEW_LINE>byte[] fixedSizeData = new byte[FIXED_DATA_SIZE];<NEW_LINE>if (ZipUtil.readFully(in, fixedSizeData) != FIXED_DATA_SIZE) {<NEW_LINE>throw new ZipException("Unexpected end of file while reading End of Central Directory Record.");<NEW_LINE>}<NEW_LINE>if (!ZipUtil.arrayStartsWith(fixedSizeData, ZipUtil.intToLittleEndian(SIGNATURE))) {<NEW_LINE>throw new ZipException(String.format("Malformed End of Central Directory Record; does not start with %08x", SIGNATURE));<NEW_LINE>}<NEW_LINE>byte[] comment = new byte[ZipUtil.getUnsignedShort(fixedSizeData, COMMENT_LENGTH_OFFSET)];<NEW_LINE>if (comment.length > 0 && ZipUtil.readFully(in, comment) != comment.length) {<NEW_LINE>throw new ZipException("Unexpected end of file while reading End of Central Directory Record.");<NEW_LINE>}<NEW_LINE>short diskNumber = ZipUtil.get16(fixedSizeData, DISK_NUMBER_OFFSET);<NEW_LINE>short centralDirectoryDisk = ZipUtil.get16(fixedSizeData, CD_DISK_OFFSET);<NEW_LINE>short entriesOnDisk = ZipUtil.get16(fixedSizeData, DISK_ENTRIES_OFFSET);<NEW_LINE>short totalEntries = ZipUtil.get16(fixedSizeData, TOTAL_ENTRIES_OFFSET);<NEW_LINE>int centralDirectorySize = <MASK><NEW_LINE>int centralDirectoryOffset = ZipUtil.get32(fixedSizeData, CD_OFFSET_OFFSET);<NEW_LINE>if (diskNumber == -1 || centralDirectoryDisk == -1 || entriesOnDisk == -1 || totalEntries == -1 || centralDirectorySize == -1 || centralDirectoryOffset == -1) {<NEW_LINE>file.setMaybeZip64(true);<NEW_LINE>}<NEW_LINE>file.setComment(comment);<NEW_LINE>file.setCentralDirectorySize(ZipUtil.getUnsignedInt(fixedSizeData, CD_SIZE_OFFSET));<NEW_LINE>file.setCentralDirectoryOffset(ZipUtil.getUnsignedInt(fixedSizeData, CD_OFFSET_OFFSET));<NEW_LINE>file.setExpectedEntries(ZipUtil.getUnsignedShort(fixedSizeData, TOTAL_ENTRIES_OFFSET));<NEW_LINE>return file;<NEW_LINE>}
|
ZipUtil.get32(fixedSizeData, CD_SIZE_OFFSET);
|
1,823,336
|
protected ScalaJavaJointCompileSpec createSpec() {<NEW_LINE>validateConfiguration();<NEW_LINE>DefaultScalaJavaJointCompileSpec spec = new DefaultScalaJavaJointCompileSpecFactory(compileOptions, getToolchain()).create();<NEW_LINE>spec.setSourceFiles(getSource().getFiles());<NEW_LINE>spec.setDestinationDir(getDestinationDirectory().getAsFile().get());<NEW_LINE>spec.setWorkingDir(getProjectLayout().getProjectDirectory().getAsFile());<NEW_LINE>spec.setTempDir(getTemporaryDir());<NEW_LINE>spec.setCompileClasspath(ImmutableList.copyOf(getClasspath()));<NEW_LINE>configureCompatibilityOptions(spec);<NEW_LINE><MASK><NEW_LINE>spec.setScalaCompileOptions(new MinimalScalaCompileOptions(scalaCompileOptions));<NEW_LINE>spec.setAnnotationProcessorPath(compileOptions.getAnnotationProcessorPath() == null ? ImmutableList.of() : ImmutableList.copyOf(compileOptions.getAnnotationProcessorPath()));<NEW_LINE>spec.setBuildStartTimestamp(getServices().get(BuildStartedTime.class).getStartTime());<NEW_LINE>configureExecutable(spec.getCompileOptions().getForkOptions());<NEW_LINE>return spec;<NEW_LINE>}
|
spec.setCompileOptions(getOptions());
|
3,942
|
public void add(LatLon latLon, String title, String originObjectName, String categoryName, int categoryColor, boolean autoFill) {<NEW_LINE>MapActivity mapActivity = getMapActivity();<NEW_LINE>if (latLon == null || mapActivity == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>isNew = true;<NEW_LINE>if (categoryName != null && !categoryName.isEmpty()) {<NEW_LINE>FavoriteGroup category = mapActivity.getMyApplication().getFavoritesHelper().getGroup(categoryName);<NEW_LINE>if (category == null) {<NEW_LINE>mapActivity.getMyApplication().getFavoritesHelper().addEmptyCategory(categoryName, categoryColor);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>categoryName = "";<NEW_LINE>}<NEW_LINE>favorite = new FavouritePoint(latLon.getLatitude(), latLon.<MASK><NEW_LINE>favorite.setDescription("");<NEW_LINE>favorite.setAddress("");<NEW_LINE>favorite.setOriginObjectName(originObjectName);<NEW_LINE>FavoritePointEditorFragment.showAutoFillInstance(mapActivity, autoFill);<NEW_LINE>}
|
getLongitude(), title, categoryName);
|
1,050,597
|
private <T> Collection<T> retrieveRecordsExecutor(@NonNull final String sql, @Singular final List<Object> sqlParams, @NonNull final Supplier<Collection<T>> collectionFactory, @NonNull final ResultSetRowLoader<T> rowLoader) {<NEW_LINE>final Connection conn = database.getConnection();<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = conn.prepareStatement(sql);<NEW_LINE>setParameters(pstmt, sqlParams);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>final Collection<T> result = collectionFactory.get();<NEW_LINE>while (rs.next()) {<NEW_LINE>final T row = rowLoader.loadRow(rs);<NEW_LINE>result.add(row);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} catch (final SQLException e) {<NEW_LINE>throw new RuntimeException("Error while executing '" + sql + "' on " + database, e);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
|
close(rs, pstmt, conn);
|
81,903
|
public void run() {<NEW_LINE>log.info("Setting up runtime instance.");<NEW_LINE>Configuration config = new Configuration();<NEW_LINE>config.getCompiler().addPlugInVirtualDataWindow("sample", "samplevdw", <MASK><NEW_LINE>config.getCommon().addEventType(SampleTriggerEvent.class);<NEW_LINE>config.getCommon().addEventType(SampleJoinEvent.class);<NEW_LINE>config.getCommon().addEventType(SampleMergeEvent.class);<NEW_LINE>EPRuntime runtime = EPRuntimeProvider.getRuntime("LargeExternalDataExample", config);<NEW_LINE>// First: Create an event type for rows of the external data - here the example use a Map-based event and any of the other types (POJO, XML) can be used as well.<NEW_LINE>// Populate event property names and types.<NEW_LINE>// Note: the type must match the data returned by virtual data window indexes.<NEW_LINE>compileDeploy("create schema SampleEvent as (key1 string, key2 string, value1 int, value2 double)", runtime);<NEW_LINE>log.info("Creating named window with virtual.");<NEW_LINE>// Create Named Window holding SampleEvent instances<NEW_LINE>compileDeploy("create window MySampleWindow.sample:samplevdw() as SampleEvent", runtime);<NEW_LINE>// Example subquery<NEW_LINE>log.info("Running subquery example.");<NEW_LINE>runSubquerySample(runtime);<NEW_LINE>// Example joins<NEW_LINE>log.info("Running join example.");<NEW_LINE>runJoinSample(runtime);<NEW_LINE>// Sample FAF<NEW_LINE>log.info("Running fire-and-forget query example.");<NEW_LINE>runSampleFireAndForgetQuery(runtime);<NEW_LINE>// Sample On-Merge<NEW_LINE>log.info("Running on-merge example.");<NEW_LINE>runSampleOnMerge(runtime);<NEW_LINE>// Cleanup<NEW_LINE>log.info("Destroying runtime instance, sample completed successfully.");<NEW_LINE>runtime.destroy();<NEW_LINE>}
|
SampleVirtualDataWindowForge.class.getName());
|
1,360,513
|
private JPanel createCommandBarPanel() {<NEW_LINE>YBoxPanel panel = new YBoxPanel();<NEW_LINE>panel.setBorder(BorderFactory.createTitledBorder(Translator.get("preview")));<NEW_LINE>panel.add(Box.createRigidArea(new Dimension(0, 5)));<NEW_LINE>YBoxPanel listsPanel = new YBoxPanel();<NEW_LINE>listsPanel.add(commandBarButtonsList);<NEW_LINE>listsPanel.add(commandBarAlternateButtonsList);<NEW_LINE>JScrollPane scrollPane = new JScrollPane(listsPanel, JScrollPane.VERTICAL_SCROLLBAR_NEVER, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);<NEW_LINE>scrollPane.setBorder(null);<NEW_LINE>panel.add(scrollPane);<NEW_LINE>panel.add(Box.createRigidArea(new Dimension(0, 5)));<NEW_LINE>panel.add(new JLabel("(" + Translator.get("command_bar_dialog.help") + ")"));<NEW_LINE>panel.add(Box.createRigidArea(new Dimension(0, 5)));<NEW_LINE>JPanel modifierPanel = new JPanel(<MASK><NEW_LINE>modifierField = new RecordingKeyStrokeTextField(MODIFIER_FIELD_MAX_LENGTH, CommandBarAttributes.getModifier()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void setText(String t) {<NEW_LINE>super.setText(t);<NEW_LINE>componentChanged();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void keyPressed(KeyEvent e) {<NEW_LINE>int pressedKeyCode = e.getKeyCode();<NEW_LINE>// Accept modifier keys only<NEW_LINE>if (pressedKeyCode == KeyEvent.VK_CONTROL || pressedKeyCode == KeyEvent.VK_ALT || pressedKeyCode == KeyEvent.VK_META || pressedKeyCode == KeyEvent.VK_SHIFT)<NEW_LINE>super.keyPressed(e);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>modifierPanel.add(new JLabel(Translator.get("command_bar_customize_dialog.modifier")));<NEW_LINE>modifierPanel.add(modifierField);<NEW_LINE>panel.add(modifierPanel);<NEW_LINE>return panel;<NEW_LINE>}
|
new FlowLayout(FlowLayout.LEFT));
|
1,264,009
|
private void init() {<NEW_LINE>this.setupConnection();<NEW_LINE>// Create index if it does not already exist<NEW_LINE>IndicesExistsResponse response = client.admin().indices().exists(new IndicesExistsRequest(indexName)).actionGet();<NEW_LINE>boolean forceCreate = false;<NEW_LINE>if (response.isExists() && !this.overwrite) {<NEW_LINE>client.admin().indices().prepareDelete(this.indexName).execute().actionGet();<NEW_LINE>forceCreate = true;<NEW_LINE>}<NEW_LINE>if (!response.isExists() || forceCreate) {<NEW_LINE>CreateIndexResponse create = client.admin().indices().prepareCreate(indexName).execute().actionGet();<NEW_LINE>try {<NEW_LINE>Thread.sleep(200);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>throw new RuntimeException("Interrupted while waiting for index to settle in", e);<NEW_LINE>}<NEW_LINE>if (!create.isAcknowledged()) {<NEW_LINE>throw new IllegalArgumentException("Could not create index: " + indexName);<NEW_LINE>}<NEW_LINE>// create mapping<NEW_LINE>// XContentBuilder builder = null;<NEW_LINE>// try {<NEW_LINE>// builder =<NEW_LINE>// XContentFactory.jsonBuilder().startObject().startObject(this.indexType).startObject("properties");<NEW_LINE>// for (Property p : config.getProperties()) {<NEW_LINE>// if (!p.isIdProperty()) {<NEW_LINE>// // TODO: experiment similarity OKAPY BM25 for short<NEW_LINE>// // fields<NEW_LINE>// //<NEW_LINE>// (http://info.elasticsearch.com/rs/elasticsearch/images/What's%20new%20in%200.90%205-3-12.pdf)<NEW_LINE>// builder.startObject(p.getName()).field("type",<NEW_LINE>// "string").field("store", "yes").field("index", "analyzed")<NEW_LINE>// .endObject();<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// builder.endObject().endObject().endObject();<NEW_LINE>// } catch (IOException e) {<NEW_LINE>// e.printStackTrace();<NEW_LINE>// }<NEW_LINE>// PutMappingResponse pmrb =<NEW_LINE>// client.admin().indices().preparePutMapping(this.indexName).setType(this.indexType).setSource(builder)<NEW_LINE>// .execute().actionGet();<NEW_LINE>}<NEW_LINE>// find id property<NEW_LINE>Collection<Property> identityProperties <MASK><NEW_LINE>if (identityProperties == null || identityProperties.size() != 1) {<NEW_LINE>throw new java.lang.IllegalStateException("Unable to handle entities without single id");<NEW_LINE>}<NEW_LINE>this.idProperty = Iterables.get(identityProperties, 0);<NEW_LINE>// disable index refresh interval to improve indexing performance<NEW_LINE>// this is enabled back in commit()<NEW_LINE>ImmutableSettings.Builder indexSettings = ImmutableSettings.settingsBuilder();<NEW_LINE>indexSettings.put("refresh_interval", -1);<NEW_LINE>this.client.admin().indices().prepareUpdateSettings(this.indexName).setSettings(indexSettings).execute().actionGet();<NEW_LINE>this.bulkRequest = this.client.prepareBulk();<NEW_LINE>}
|
= this.config.getIdentityProperties();
|
839,303
|
public PointSensitivityBuilder presentValueSensitivityRatesStickyModel(ResolvedSwaption swaption, RatesProvider ratesProvider, SabrSwaptionVolatilities swaptionVolatilities) {<NEW_LINE>validate(swaption, ratesProvider, swaptionVolatilities);<NEW_LINE>ZonedDateTime expiryDateTime = swaption.getExpiry();<NEW_LINE>double <MASK><NEW_LINE>ResolvedSwap underlying = swaption.getUnderlying();<NEW_LINE>ResolvedSwapLeg fixedLeg = fixedLeg(underlying);<NEW_LINE>if (expiry < 0d) {<NEW_LINE>// Option has expired already<NEW_LINE>return PointSensitivityBuilder.none();<NEW_LINE>}<NEW_LINE>double forward = forwardRate(swaption, ratesProvider);<NEW_LINE>ValueDerivatives annuityDerivative = getSwapPricer().getLegPricer().annuityCashDerivative(fixedLeg, forward);<NEW_LINE>double annuityCash = annuityDerivative.getValue();<NEW_LINE>double annuityCashDr = annuityDerivative.getDerivative(0);<NEW_LINE>LocalDate settlementDate = ((CashSwaptionSettlement) swaption.getSwaptionSettlement()).getSettlementDate();<NEW_LINE>double discountSettle = ratesProvider.discountFactor(fixedLeg.getCurrency(), settlementDate);<NEW_LINE>double strike = calculateStrike(fixedLeg);<NEW_LINE>double tenor = swaptionVolatilities.tenor(fixedLeg.getStartDate(), fixedLeg.getEndDate());<NEW_LINE>double shift = swaptionVolatilities.shift(expiry, tenor);<NEW_LINE>ValueDerivatives volatilityAdj = swaptionVolatilities.volatilityAdjoint(expiry, tenor, strike, forward);<NEW_LINE>boolean isCall = fixedLeg.getPayReceive().isPay();<NEW_LINE>double shiftedForward = forward + shift;<NEW_LINE>double shiftedStrike = strike + shift;<NEW_LINE>double price = BlackFormulaRepository.price(shiftedForward, shiftedStrike, expiry, volatilityAdj.getValue(), isCall);<NEW_LINE>double delta = BlackFormulaRepository.delta(shiftedForward, shiftedStrike, expiry, volatilityAdj.getValue(), isCall);<NEW_LINE>double vega = BlackFormulaRepository.vega(shiftedForward, shiftedStrike, expiry, volatilityAdj.getValue());<NEW_LINE>PointSensitivityBuilder forwardSensi = getSwapPricer().parRateSensitivity(underlying, ratesProvider);<NEW_LINE>PointSensitivityBuilder discountSettleSensi = ratesProvider.discountFactors(fixedLeg.getCurrency()).zeroRatePointSensitivity(settlementDate);<NEW_LINE>double sign = swaption.getLongShort().sign();<NEW_LINE>return forwardSensi.multipliedBy(sign * discountSettle * (annuityCash * (delta + vega * volatilityAdj.getDerivative(0)) + annuityCashDr * price)).combinedWith(discountSettleSensi.multipliedBy(sign * annuityCash * price));<NEW_LINE>}
|
expiry = swaptionVolatilities.relativeTime(expiryDateTime);
|
607,269
|
protected short gf_sq(short input) {<NEW_LINE>int[] B = { 0x55555555, 0x33333333, 0x0F0F0F0F, 0x00FF00FF };<NEW_LINE>int x = input;<NEW_LINE>int t;<NEW_LINE>x = (x | (x << 8)) & B[3];<NEW_LINE>x = (x | (x << <MASK><NEW_LINE>x = (x | (x << 2)) & B[1];<NEW_LINE>x = (x | (x << 1)) & B[0];<NEW_LINE>t = x & 0x7FC000;<NEW_LINE>x ^= t >> 9;<NEW_LINE>x ^= t >> 12;<NEW_LINE>t = x & 0x3000;<NEW_LINE>x ^= t >> 9;<NEW_LINE>x ^= t >> 12;<NEW_LINE>return (short) (x & ((1 << GFBITS) - 1));<NEW_LINE>}
|
4)) & B[2];
|
166,613
|
public AnalysisResultLocation unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AnalysisResultLocation analysisResultLocation = new AnalysisResultLocation();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("path", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>analysisResultLocation.setPath(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return analysisResultLocation;<NEW_LINE>}
|
class).unmarshall(context));
|
226,803
|
public void run() {<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>try {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>param.put("objHash", objHash);<NEW_LINE>param.put("fName", fName);<NEW_LINE>param.put("time", time);<NEW_LINE>MapPack out = (MapPack) tcp.getSingle(RequestCmd.OBJECT_CALL_MUTEX_PROFILE, param);<NEW_LINE>if (out != null) {<NEW_LINE>if (!CastUtil.cboolean((BooleanValue) out.get("success"))) {<NEW_LINE>ConsoleProxy.infoSafe<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// ExUtil.exec(window.getShell().getDisplay(), new Runnable(){<NEW_LINE>// public void run() {<NEW_LINE>// try{<NEW_LINE>// Action act = new HeapDumpListAction(window, "Dumps", objName, objHash, Images.heap, serverId);<NEW_LINE>// act.run();<NEW_LINE>// }catch(Exception e){<NEW_LINE>// e.printStackTrace();<NEW_LINE>// }<NEW_LINE>// }<NEW_LINE>// });<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>}
|
(out.getText("msg"));
|
24,467
|
protected static FastMethod make(Constructor<?> constructor) {<NEW_LINE>Class<?> klass = constructor.getDeclaringClass();<NEW_LINE>String descriptor = Type.getConstructorDescriptor(constructor) + constructor.getDeclaringClass().getClassLoader();<NEW_LINE>;<NEW_LINE>String key = Lang.md5(descriptor);<NEW_LINE>String className = ReflectTool.class.getPackage().getName() + "." + Lang.md5(klass.getName()) + "$FC$" + key;<NEW_LINE>FastMethod fm = (<MASK><NEW_LINE>if (fm != null)<NEW_LINE>return fm;<NEW_LINE>try {<NEW_LINE>fm = (FastMethod) klass.getClassLoader().loadClass(className).newInstance();<NEW_LINE>cache.put(key, fm);<NEW_LINE>return fm;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>byte[] buf = _make(klass, constructor.getModifiers(), constructor.getParameterTypes(), _Method(constructor), null, className, descriptor);<NEW_LINE>Class<?> t = DefaultClassDefiner.defaultOne().define(className, buf, klass.getClassLoader());<NEW_LINE>fm = (FastMethod) t.newInstance();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>if (log.isTraceEnabled())<NEW_LINE>log.trace("Fail to create FastMethod for " + constructor, e);<NEW_LINE>fm = new FallbackFastMethod(constructor);<NEW_LINE>}<NEW_LINE>cache.put(className, fm);<NEW_LINE>return fm;<NEW_LINE>}
|
FastMethod) cache.get(className);
|
511,980
|
/*<NEW_LINE>* Resolve @param tags while method scope<NEW_LINE>*/<NEW_LINE>private void resolveParamTags(MethodScope scope, boolean reportMissing, boolean considerParamRefAsUsage) {<NEW_LINE>AbstractMethodDeclaration methodDecl = scope.referenceMethod();<NEW_LINE>int paramTagsSize = this.paramReferences == null ? 0 : this.paramReferences.length;<NEW_LINE>// If no referenced method (field initializer for example) then report a problem for each param tag<NEW_LINE>if (methodDecl == null) {<NEW_LINE>for (int i = 0; i < paramTagsSize; i++) {<NEW_LINE>JavadocSingleNameReference param = this.paramReferences[i];<NEW_LINE>scope.problemReporter().javadocUnexpectedTag(param.tagSourceStart, param.tagSourceEnd);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// If no param tags then report a problem for each method argument<NEW_LINE>int argumentsSize = methodDecl.arguments == null ? 0 : methodDecl.arguments.length;<NEW_LINE>if (paramTagsSize == 0) {<NEW_LINE>if (reportMissing) {<NEW_LINE>for (int i = 0; i < argumentsSize; i++) {<NEW_LINE>Argument arg = methodDecl.arguments[i];<NEW_LINE>scope.problemReporter().javadocMissingParamTag(arg.name, arg.sourceStart, arg.sourceEnd, methodDecl.binding.modifiers);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LocalVariableBinding[] bindings = new LocalVariableBinding[paramTagsSize];<NEW_LINE>int maxBindings = 0;<NEW_LINE>// Scan all @param tags<NEW_LINE>for (int i = 0; i < paramTagsSize; i++) {<NEW_LINE>JavadocSingleNameReference param = this.paramReferences[i];<NEW_LINE>param.<MASK><NEW_LINE>if (param.binding != null && param.binding.isValidBinding()) {<NEW_LINE>// Verify duplicated tags<NEW_LINE>boolean found = false;<NEW_LINE>for (int j = 0; j < maxBindings && !found; j++) {<NEW_LINE>if (bindings[j] == param.binding) {<NEW_LINE>scope.problemReporter().javadocDuplicatedParamTag(param.token, param.sourceStart, param.sourceEnd, methodDecl.binding.modifiers);<NEW_LINE>found = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!found) {<NEW_LINE>bindings[maxBindings++] = (LocalVariableBinding) param.binding;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Look for undocumented arguments<NEW_LINE>if (reportMissing) {<NEW_LINE>for (int i = 0; i < argumentsSize; i++) {<NEW_LINE>Argument arg = methodDecl.arguments[i];<NEW_LINE>boolean found = false;<NEW_LINE>for (int j = 0; j < maxBindings && !found; j++) {<NEW_LINE>LocalVariableBinding binding = bindings[j];<NEW_LINE>if (arg.binding == binding) {<NEW_LINE>found = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!found) {<NEW_LINE>scope.problemReporter().javadocMissingParamTag(arg.name, arg.sourceStart, arg.sourceEnd, methodDecl.binding.modifiers);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
|
resolve(scope, true, considerParamRefAsUsage);
|
1,310,981
|
public ItemStack injectItem(@Nonnull ItemStack stack, boolean doAdd, EnumFacing from, EnumDyeColor colour, double speed) {<NEW_LINE>if (pipe.getHolder().getPipeWorld().isRemote) {<NEW_LINE>throw new IllegalStateException("Cannot inject items on the client side!");<NEW_LINE>}<NEW_LINE>if (!canInjectItems(from)) {<NEW_LINE>return stack;<NEW_LINE>}<NEW_LINE>if (speed < 0.01) {<NEW_LINE>speed = 0.01;<NEW_LINE>}<NEW_LINE>// Try insert<NEW_LINE>PipeEventItem.TryInsert tryInsert = new PipeEventItem.TryInsert(pipe.getHolder(), this, colour, from, stack);<NEW_LINE>pipe.getHolder().fireEvent(tryInsert);<NEW_LINE>if (tryInsert.isCanceled() || tryInsert.accepted <= 0) {<NEW_LINE>return stack;<NEW_LINE>}<NEW_LINE>ItemStack toSplit = stack.copy();<NEW_LINE>ItemStack toInsert = toSplit.splitStack(tryInsert.accepted);<NEW_LINE>if (doAdd) {<NEW_LINE>insertItemEvents(<MASK><NEW_LINE>}<NEW_LINE>if (toSplit.isEmpty()) {<NEW_LINE>toSplit = StackUtil.EMPTY;<NEW_LINE>}<NEW_LINE>return toSplit;<NEW_LINE>}
|
toInsert, colour, speed, from);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.