idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,712,095
protected Object createNode(JSContext context, JSBuiltin builtin, boolean construct, boolean newTarget, TemporalNow builtinEnum) {<NEW_LINE>switch(builtinEnum) {<NEW_LINE>case timeZone:<NEW_LINE>return TemporalNowTimeZoneNodeGen.create(context, builtin, args().fixedArgs(0).createArgumentNodes(context));<NEW_LINE>case instant:<NEW_LINE>return TemporalNowInstantNodeGen.create(context, builtin, args().fixedArgs(2).createArgumentNodes(context));<NEW_LINE>case plainDateTime:<NEW_LINE>return TemporalNowPlainDateTimeNodeGen.create(context, builtin, args().fixedArgs(2).createArgumentNodes(context));<NEW_LINE>case plainDateTimeISO:<NEW_LINE>return TemporalNowPlainDateTimeISONodeGen.create(context, builtin, args().fixedArgs(<MASK><NEW_LINE>case zonedDateTime:<NEW_LINE>return TemporalNowZonedDateTimeNodeGen.create(context, builtin, args().fixedArgs(2).createArgumentNodes(context));<NEW_LINE>case zonedDateTimeISO:<NEW_LINE>return TemporalNowZonedDateTimeISONodeGen.create(context, builtin, args().fixedArgs(1).createArgumentNodes(context));<NEW_LINE>case plainDate:<NEW_LINE>return TemporalNowPlainDateNodeGen.create(context, builtin, args().fixedArgs(2).createArgumentNodes(context));<NEW_LINE>case plainDateISO:<NEW_LINE>return TemporalNowPlainDateISONodeGen.create(context, builtin, args().fixedArgs(1).createArgumentNodes(context));<NEW_LINE>case plainTimeISO:<NEW_LINE>return TemporalNowPlainTimeISONodeGen.create(context, builtin, args().fixedArgs(1).createArgumentNodes(context));<NEW_LINE>default:<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}
1).createArgumentNodes(context));
429,705
void loadDotProject(EclipseProject project) throws ProjectImporterException {<NEW_LINE>// NOI18N<NEW_LINE>logger.finest("Loading .project for project: " + project.getDirectory().getAbsolutePath());<NEW_LINE>try {<NEW_LINE>Set<String> natures = new HashSet<String>();<NEW_LINE>List<Link> links <MASK><NEW_LINE>Set<Variable> variables = new HashSet<Variable>();<NEW_LINE>if (project.getWorkspace() != null) {<NEW_LINE>variables = project.getWorkspace().getResourcesVariables();<NEW_LINE>}<NEW_LINE>String projName = ProjectParser.parse(project.getProjectFile(), natures, links, variables);<NEW_LINE>project.setNatures(natures);<NEW_LINE>project.setName(projName);<NEW_LINE>project.setFacets(ProjectParser.readProjectFacets(project.getDirectory(), natures));<NEW_LINE>project.setLinks(links);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new ProjectImporterException(ex);<NEW_LINE>}<NEW_LINE>}
= new ArrayList<Link>();
1,283,084
private Mono<PagedResponse<FirewallPolicyInner>> listSinglePageAsync() {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)).<PagedResponse<FirewallPolicyInner>>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
1,258,271
public void deleteWorklogAndAutoAdjustRemainingEstimate(java.lang.String in0, java.lang.String in1) throws java.rmi.RemoteException, com.atlassian.jira.rpc.exception.RemotePermissionException, com.atlassian.jira.rpc.exception.RemoteValidationException, com.atlassian.jira.rpc.exception.RemoteException {<NEW_LINE>if (super.cachedEndpoint == null) {<NEW_LINE>throw new org.apache.axis.NoEndPointException();<NEW_LINE>}<NEW_LINE>org.apache.axis.client.Call _call = createCall();<NEW_LINE>_call.setOperation(_operations[79]);<NEW_LINE>_call.setUseSOAPAction(true);<NEW_LINE>_call.setSOAPActionURI("");<NEW_LINE>_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);<NEW_LINE>_call.setOperationName(new javax.xml.namespace<MASK><NEW_LINE>setRequestHeaders(_call);<NEW_LINE>setAttachments(_call);<NEW_LINE>try {<NEW_LINE>java.lang.Object _resp = _call.invoke(new java.lang.Object[] { in0, in1 });<NEW_LINE>if (_resp instanceof java.rmi.RemoteException) {<NEW_LINE>throw (java.rmi.RemoteException) _resp;<NEW_LINE>}<NEW_LINE>extractAttachments(_call);<NEW_LINE>} catch (org.apache.axis.AxisFault axisFaultException) {<NEW_LINE>if (axisFaultException.detail != null) {<NEW_LINE>if (axisFaultException.detail instanceof java.rmi.RemoteException) {<NEW_LINE>throw (java.rmi.RemoteException) axisFaultException.detail;<NEW_LINE>}<NEW_LINE>if (axisFaultException.detail instanceof com.atlassian.jira.rpc.exception.RemotePermissionException) {<NEW_LINE>throw (com.atlassian.jira.rpc.exception.RemotePermissionException) axisFaultException.detail;<NEW_LINE>}<NEW_LINE>if (axisFaultException.detail instanceof com.atlassian.jira.rpc.exception.RemoteValidationException) {<NEW_LINE>throw (com.atlassian.jira.rpc.exception.RemoteValidationException) axisFaultException.detail;<NEW_LINE>}<NEW_LINE>if (axisFaultException.detail instanceof com.atlassian.jira.rpc.exception.RemoteException) {<NEW_LINE>throw (com.atlassian.jira.rpc.exception.RemoteException) axisFaultException.detail;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw axisFaultException;<NEW_LINE>}<NEW_LINE>}
.QName("http://soap.rpc.jira.atlassian.com", "deleteWorklogAndAutoAdjustRemainingEstimate"));
1,144,361
final CreateVirtualServiceResult executeCreateVirtualService(CreateVirtualServiceRequest createVirtualServiceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createVirtualServiceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateVirtualServiceRequest> request = null;<NEW_LINE>Response<CreateVirtualServiceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateVirtualServiceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createVirtualServiceRequest));<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, "App Mesh");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateVirtualServiceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateVirtualServiceResultJsonUnmarshaller());<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, "CreateVirtualService");
978,625
public synchronized List<SingleAnalysis> analyze(Token token) {<NEW_LINE>SecondaryPos sPos = guessSecondaryPosType(token);<NEW_LINE>String word = token.getText();<NEW_LINE>// TODO: for now, for regular words and numbers etc, use the analyze method.<NEW_LINE>if (sPos == SecondaryPos.None) {<NEW_LINE>if (word.contains("?")) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>if (alphabet.containsDigit(word)) {<NEW_LINE>return tryNumeral(token);<NEW_LINE>} else {<NEW_LINE>return analyzeWord(word, word.contains(".") ? SecondaryPos.Abbreviation : SecondaryPos.ProperNoun);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (sPos == SecondaryPos.RomanNumeral) {<NEW_LINE>return getForRomanNumeral(token);<NEW_LINE>}<NEW_LINE>if (sPos == SecondaryPos.Date || sPos == SecondaryPos.Clock) {<NEW_LINE>return tryNumeral(token);<NEW_LINE>}<NEW_LINE>// TODO: consider returning analysis results without interfering with analyzer.<NEW_LINE>String normalized = nonLettersPattern.matcher(word).replaceAll("");<NEW_LINE>DictionaryItem item = new DictionaryItem(word, word, normalized, PrimaryPos.Noun, sPos);<NEW_LINE>if (sPos == SecondaryPos.HashTag || sPos == SecondaryPos.Email || sPos == SecondaryPos.Url || sPos == SecondaryPos.Mention) {<NEW_LINE>return analyzeWord(word, sPos);<NEW_LINE>}<NEW_LINE>boolean itemDoesNotExist <MASK><NEW_LINE>if (itemDoesNotExist) {<NEW_LINE>item.attributes.add(RootAttribute.Runtime);<NEW_LINE>analyzer.getStemTransitions().addDictionaryItem(item);<NEW_LINE>}<NEW_LINE>List<SingleAnalysis> results = analyzer.analyze(word);<NEW_LINE>if (itemDoesNotExist) {<NEW_LINE>analyzer.getStemTransitions().removeDictionaryItem(item);<NEW_LINE>}<NEW_LINE>return results;<NEW_LINE>}
= !lexicon.containsItem(item);
638,640
/* (non-Javadoc)<NEW_LINE>* @see com.ibm.ws.sib.msgstore.cache.links.LinkOwner#eventWatermarkBreached()<NEW_LINE>*/<NEW_LINE>public final void eventWatermarkBreached() throws SevereMessageStoreException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(this, tc, "eventWatermarkBreached");<NEW_LINE>ItemStream itemStream = (ItemStream) getItem();<NEW_LINE>if (null != itemStream) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(this, tc, "notifying eventWatermarkBreached: " + itemStream);<NEW_LINE>itemStream.eventWatermarkBreached();<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(this, tc, "notified eventWatermarkBreached: " + itemStream);<NEW_LINE>} else {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(this, tc, "no itemStream to notify");<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.<MASK><NEW_LINE>}
exit(this, tc, "eventWatermarkBreached");
370,714
final DeactivateEventSourceResult executeDeactivateEventSource(DeactivateEventSourceRequest deactivateEventSourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deactivateEventSourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeactivateEventSourceRequest> request = null;<NEW_LINE>Response<DeactivateEventSourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeactivateEventSourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deactivateEventSourceRequest));<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, "CloudWatch Events");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeactivateEventSource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeactivateEventSourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeactivateEventSourceResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
invoke(request, responseHandler, executionContext);
1,332,254
final DescribeClusterResult executeDescribeCluster(DescribeClusterRequest describeClusterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeClusterRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeClusterRequest> request = null;<NEW_LINE>Response<DescribeClusterResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeClusterRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeClusterRequest));<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, "Snowball");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeCluster");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeClusterResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new DescribeClusterResultJsonUnmarshaller());
724,579
void putObject(Object o) {<NEW_LINE>if (depth == 0) {<NEW_LINE>stack[0] = o;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Object container = stack[depth - 1];<NEW_LINE>if (container.getClass() == HashMap.class) {<NEW_LINE>if (keyPendingInsert != null) {<NEW_LINE>if (o instanceof ByteBuffer)<NEW_LINE>o <MASK><NEW_LINE>if (((HashMap<String, Object>) container).put(keyPendingInsert, o) != null)<NEW_LINE>throw new BDecodingException("duplicate key found in dictionary");<NEW_LINE>keyPendingInsert = null;<NEW_LINE>} else {<NEW_LINE>keyPendingInsert = buf2str((ByteBuffer) o);<NEW_LINE>}<NEW_LINE>} else if (container.getClass() == ArrayList.class) {<NEW_LINE>if (o instanceof ByteBuffer)<NEW_LINE>o = buf2ary((ByteBuffer) o);<NEW_LINE>((ArrayList<Object>) container).add(o);<NEW_LINE>} else {<NEW_LINE>throw new RuntimeException("this should not happen");<NEW_LINE>}<NEW_LINE>}
= buf2ary((ByteBuffer) o);
1,212,377
public PointInTimeRecovery unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>PointInTimeRecovery pointInTimeRecovery = new PointInTimeRecovery();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><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("status", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>pointInTimeRecovery.setStatus(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 pointInTimeRecovery;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,641,043
protected void visitConfigChildren(ClientConfig to, ClientConfig from) {<NEW_LINE>if (to != null) {<NEW_LINE>Stack<Object> objs = getObjects();<NEW_LINE>// if servers is configured, then override it instead of merge<NEW_LINE>if (!from.getServers().isEmpty()) {<NEW_LINE>to<MASK><NEW_LINE>to.getServers().addAll(from.getServers());<NEW_LINE>}<NEW_LINE>// only configured domain in client configure will be merged<NEW_LINE>for (Domain source : from.getDomains().values()) {<NEW_LINE>Domain target = to.findDomain(source.getId());<NEW_LINE>if (target == null) {<NEW_LINE>target = new Domain(source.getId());<NEW_LINE>to.addDomain(target);<NEW_LINE>}<NEW_LINE>if (to.getDomains().containsKey(source.getId())) {<NEW_LINE>objs.push(target);<NEW_LINE>source.accept(this);<NEW_LINE>objs.pop();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Property source : from.getProperties().values()) {<NEW_LINE>Property target = to.findProperty(source.getName());<NEW_LINE>if (target == null) {<NEW_LINE>target = new Property(source.getName());<NEW_LINE>to.addProperty(target);<NEW_LINE>}<NEW_LINE>objs.push(target);<NEW_LINE>source.accept(this);<NEW_LINE>objs.pop();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
.getServers().clear();
279,564
private void prepareFramebuffer(int width, int height) {<NEW_LINE>GlUtil.checkGlError("start");<NEW_LINE>int[] values = new int[1];<NEW_LINE>// Create a texture object and bind it. This will be the color buffer.<NEW_LINE>GLES20.glGenTextures(1, values, 0);<NEW_LINE>GlUtil.checkGlError("glGenTextures");<NEW_LINE>// expected > 0<NEW_LINE>mOffscreenTexture = values[0];<NEW_LINE>Log.i(TAG, "prepareFramebuffer mOffscreenTexture:" + mOffscreenTexture);<NEW_LINE>GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, mOffscreenTexture);<NEW_LINE>GlUtil.checkGlError("glBindTexture");<NEW_LINE>// Create texture storage.<NEW_LINE>GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);<NEW_LINE>GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);<NEW_LINE>GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);<NEW_LINE>GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);<NEW_LINE>GLES20.glTexParameterf(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);<NEW_LINE>GlUtil.checkGlError("glTexParameter");<NEW_LINE>// Create framebuffer object and bind it.<NEW_LINE>GLES20.glGenFramebuffers(1, values, 0);<NEW_LINE>GlUtil.checkGlError("glGenFramebuffers");<NEW_LINE>// expected > 0<NEW_LINE>mFramebuffer = values[0];<NEW_LINE>GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, mFramebuffer);<NEW_LINE>GlUtil.checkGlError("glBindFramebuffer " + mFramebuffer);<NEW_LINE>GLES20.glFramebufferTexture2D(GLES20.GL_FRAMEBUFFER, GLES20.GL_COLOR_ATTACHMENT0, GLES20.GL_TEXTURE_2D, mOffscreenTexture, 0);<NEW_LINE>// See if GLES is happy with all this.<NEW_LINE>int status = <MASK><NEW_LINE>if (status != GLES20.GL_FRAMEBUFFER_COMPLETE) {<NEW_LINE>throw new RuntimeException("Framebuffer not complete, status=" + status);<NEW_LINE>}<NEW_LINE>GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);<NEW_LINE>// Switch back to the default framebuffer.<NEW_LINE>GLES20.glBindFramebuffer(GLES20.GL_FRAMEBUFFER, 0);<NEW_LINE>GlUtil.checkGlError("glBindFramebuffer");<NEW_LINE>}
GLES20.glCheckFramebufferStatus(GLES20.GL_FRAMEBUFFER);
904,449
final UpdateDocumentDefaultVersionResult executeUpdateDocumentDefaultVersion(UpdateDocumentDefaultVersionRequest updateDocumentDefaultVersionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateDocumentDefaultVersionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateDocumentDefaultVersionRequest> request = null;<NEW_LINE>Response<UpdateDocumentDefaultVersionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateDocumentDefaultVersionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDocumentDefaultVersionRequest));<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, "SSM");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateDocumentDefaultVersionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDocumentDefaultVersionResultJsonUnmarshaller());<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, "UpdateDocumentDefaultVersion");
1,444,176
private void readProperties(ConversionContext context, MongoPersistentEntity<?> entity, PersistentPropertyAccessor<?> accessor, DocumentAccessor documentAccessor, MongoDbPropertyValueProvider valueProvider, SpELExpressionEvaluator evaluator, Predicate<MongoPersistentProperty> propertyFilter) {<NEW_LINE>DbRefResolverCallback callback = null;<NEW_LINE>for (MongoPersistentProperty prop : entity) {<NEW_LINE>if (!propertyFilter.test(prop)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ConversionContext propertyContext = context.forProperty(prop.getName());<NEW_LINE>MongoDbPropertyValueProvider <MASK><NEW_LINE>if (prop.isAssociation() && !entity.isConstructorArgument(prop)) {<NEW_LINE>if (callback == null) {<NEW_LINE>callback = getDbRefResolverCallback(propertyContext, documentAccessor, evaluator);<NEW_LINE>}<NEW_LINE>readAssociation(prop.getRequiredAssociation(), accessor, documentAccessor, dbRefProxyHandler, callback, propertyContext, evaluator);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (prop.isUnwrapped()) {<NEW_LINE>accessor.setProperty(prop, readUnwrapped(propertyContext, documentAccessor, prop, mappingContext.getRequiredPersistentEntity(prop)));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (!documentAccessor.hasValue(prop)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (prop.isAssociation()) {<NEW_LINE>if (callback == null) {<NEW_LINE>callback = getDbRefResolverCallback(propertyContext, documentAccessor, evaluator);<NEW_LINE>}<NEW_LINE>readAssociation(prop.getRequiredAssociation(), accessor, documentAccessor, dbRefProxyHandler, callback, propertyContext, evaluator);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>accessor.setProperty(prop, valueProviderToUse.getPropertyValue(prop));<NEW_LINE>}<NEW_LINE>}
valueProviderToUse = valueProvider.withContext(propertyContext);
32,232
public InteractionResultHolder<ItemStack> use(Level world, Player player, InteractionHand hand) {<NEW_LINE>ItemStack <MASK><NEW_LINE>CompoundTag nbt = item.getOrCreateTag();<NEW_LINE>boolean mainHand = hand == InteractionHand.MAIN_HAND;<NEW_LINE>// Shift -> Open GUI<NEW_LINE>if (player.isShiftKeyDown()) {<NEW_LINE>if (world.isClientSide) {<NEW_LINE>DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () -> {<NEW_LINE>openHandgunGUI(item, hand);<NEW_LINE>});<NEW_LINE>player.getCooldowns().addCooldown(item.getItem(), 10);<NEW_LINE>}<NEW_LINE>return new InteractionResultHolder<>(InteractionResult.SUCCESS, item);<NEW_LINE>}<NEW_LINE>if (ShootableGadgetItemMethods.shouldSwap(player, item, hand, this::isZapper))<NEW_LINE>return new InteractionResultHolder<>(InteractionResult.FAIL, item);<NEW_LINE>// Check if can be used<NEW_LINE>Component msg = validateUsage(item);<NEW_LINE>if (msg != null) {<NEW_LINE>AllSoundEvents.DENY.play(world, player, player.blockPosition());<NEW_LINE>player.displayClientMessage(msg.plainCopy().withStyle(ChatFormatting.RED), true);<NEW_LINE>return new InteractionResultHolder<>(InteractionResult.FAIL, item);<NEW_LINE>}<NEW_LINE>BlockState stateToUse = Blocks.AIR.defaultBlockState();<NEW_LINE>if (nbt.contains("BlockUsed"))<NEW_LINE>stateToUse = NbtUtils.readBlockState(nbt.getCompound("BlockUsed"));<NEW_LINE>stateToUse = BlockHelper.setZeroAge(stateToUse);<NEW_LINE>CompoundTag data = null;<NEW_LINE>if (AllBlockTags.SAFE_NBT.matches(stateToUse) && nbt.contains("BlockData", Tag.TAG_COMPOUND)) {<NEW_LINE>data = nbt.getCompound("BlockData");<NEW_LINE>}<NEW_LINE>// Raytrace - Find the target<NEW_LINE>Vec3 start = player.position().add(0, player.getEyeHeight(), 0);<NEW_LINE>Vec3 range = player.getLookAngle().scale(getZappingRange(item));<NEW_LINE>BlockHitResult raytrace = world.clip(new ClipContext(start, start.add(range), Block.OUTLINE, Fluid.NONE, player));<NEW_LINE>BlockPos pos = raytrace.getBlockPos();<NEW_LINE>BlockState stateReplaced = world.getBlockState(pos);<NEW_LINE>// No target<NEW_LINE>if (pos == null || stateReplaced.getBlock() == Blocks.AIR) {<NEW_LINE>ShootableGadgetItemMethods.applyCooldown(player, item, hand, this::isZapper, getCooldownDelay(item));<NEW_LINE>return new InteractionResultHolder<>(InteractionResult.SUCCESS, item);<NEW_LINE>}<NEW_LINE>// Find exact position of gun barrel for VFX<NEW_LINE>Vec3 barrelPos = ShootableGadgetItemMethods.getGunBarrelVec(player, mainHand, new Vec3(.35f, -0.1f, 1));<NEW_LINE>// Client side<NEW_LINE>if (world.isClientSide) {<NEW_LINE>CreateClient.ZAPPER_RENDER_HANDLER.dontAnimateItem(hand);<NEW_LINE>return new InteractionResultHolder<>(InteractionResult.SUCCESS, item);<NEW_LINE>}<NEW_LINE>// Server side<NEW_LINE>if (activate(world, player, item, stateToUse, raytrace, data)) {<NEW_LINE>ShootableGadgetItemMethods.applyCooldown(player, item, hand, this::isZapper, getCooldownDelay(item));<NEW_LINE>ShootableGadgetItemMethods.sendPackets(player, b -> new ZapperBeamPacket(barrelPos, raytrace.getLocation(), hand, b));<NEW_LINE>}<NEW_LINE>return new InteractionResultHolder<>(InteractionResult.SUCCESS, item);<NEW_LINE>}
item = player.getItemInHand(hand);
1,128,958
public Dumper dumpInner(Dumper d) {<NEW_LINE>MethodPrototype methodPrototype = getMethodPrototype();<NEW_LINE>List<Expression> args = getArgs();<NEW_LINE>if (methodPrototype.getName().equals(MiscConstants.INIT_METHOD)) {<NEW_LINE>d.print("super(");<NEW_LINE>} else {<NEW_LINE>// Let there now be a rant about how default methods on super classes allowed<NEW_LINE>// multiple inheritance to sneak in by the back door. Seriously, what?!<NEW_LINE>if (isOnInterface) {<NEW_LINE>d.dump(getFunction().getClassEntry().getTypeInstance()).separator(".");<NEW_LINE>}<NEW_LINE>if (this.typeName != null) {<NEW_LINE>d.dump(this.typeName).separator(".");<NEW_LINE>}<NEW_LINE>d.print("super").separator(".").methodName(methodPrototype.getFixedName(), methodPrototype, false<MASK><NEW_LINE>}<NEW_LINE>boolean first = true;<NEW_LINE>for (int x = 0; x < args.size(); ++x) {<NEW_LINE>if (methodPrototype.isHiddenArg(x))<NEW_LINE>continue;<NEW_LINE>Expression arg = args.get(x);<NEW_LINE>if (!first)<NEW_LINE>d.print(", ");<NEW_LINE>first = false;<NEW_LINE>methodPrototype.dumpAppropriatelyCastedArgumentString(arg, d);<NEW_LINE>}<NEW_LINE>d.separator(")");<NEW_LINE>return d;<NEW_LINE>}
, false).separator("(");
1,688,262
private static AtlasSymbolIo.SymbolData readLine(@NonNull String line, @Nullable AtlasSymbolIo.SymbolFilter filter) throws IOException {<NEW_LINE>// format is "<type> <class> <name> <value>"<NEW_LINE>// don't want to split on space as value could contain spaces.<NEW_LINE>int pos = line.indexOf(' ');<NEW_LINE>String typeName = line.substring(0, pos);<NEW_LINE>SymbolJavaType type = SymbolJavaType.getEnum(typeName);<NEW_LINE>int pos2 = line.indexOf(' ', pos + 1);<NEW_LINE>String className = line.substring(pos + 1, pos2);<NEW_LINE>if (filter != null && !filter.validate(className, typeName)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>ResourceType resourceType = ResourceType.getEnum(className);<NEW_LINE>if (resourceType == null) {<NEW_LINE>throw new IOException("Invalid resource type " + className);<NEW_LINE>}<NEW_LINE>int pos3 = line.indexOf(' ', pos2 + 1);<NEW_LINE>String name = line.<MASK><NEW_LINE>String value = line.substring(pos3 + 1);<NEW_LINE>return new SymbolData(resourceType, name, type, value);<NEW_LINE>}
substring(pos2 + 1, pos3);
870,520
private RelDataType sqlType(RelDataTypeFactory typeFactory, int dataType, int precision, int scale, String typeString) {<NEW_LINE>// Fall back to ANY if type is unknown<NEW_LINE>final SqlTypeName sqlTypeName = Util.first(SqlTypeName.getNameForJdbcType(dataType), SqlTypeName.ANY);<NEW_LINE>switch(sqlTypeName) {<NEW_LINE>case ARRAY:<NEW_LINE>RelDataType component = null;<NEW_LINE>if (typeString != null && typeString.endsWith(" ARRAY")) {<NEW_LINE>// E.g. hsqldb gives "INTEGER ARRAY", so we deduce the component type<NEW_LINE>// "INTEGER".<NEW_LINE>final String remaining = typeString.substring(0, typeString.length() - " ARRAY".length());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (component == null) {<NEW_LINE>component = typeFactory.createTypeWithNullability(typeFactory.createSqlType(SqlTypeName.ANY), true);<NEW_LINE>}<NEW_LINE>return typeFactory.createArrayType(component, -1);<NEW_LINE>}<NEW_LINE>if (precision >= 0 && scale >= 0 && sqlTypeName.allowsPrecScale(true, true)) {<NEW_LINE>return typeFactory.createSqlType(sqlTypeName, precision, scale);<NEW_LINE>} else if (precision >= 0 && sqlTypeName.allowsPrecNoScale()) {<NEW_LINE>return typeFactory.createSqlType(sqlTypeName, precision);<NEW_LINE>} else {<NEW_LINE>assert sqlTypeName.allowsNoPrecNoScale();<NEW_LINE>return typeFactory.createSqlType(sqlTypeName);<NEW_LINE>}<NEW_LINE>}
component = parseTypeString(typeFactory, remaining);
1,046,252
public void writeLongHex(long v) {<NEW_LINE>int pos = this.pos;<NEW_LINE>writeHexByte(buf, pos + 0, (byte) ((v >>> 56L) & 0xff));<NEW_LINE>writeHexByte(buf, pos + 2, (byte) ((v >>> 48L) & 0xff));<NEW_LINE>writeHexByte(buf, pos + 4, (byte) ((v >>> 40L) & 0xff));<NEW_LINE>writeHexByte(buf, pos + 6, (byte) ((v >>> 32L) & 0xff));<NEW_LINE>writeHexByte(buf, pos + 8, (byte) ((v >>> 24L) & 0xff));<NEW_LINE>writeHexByte(buf, pos + 10, (byte) ((v >>> 16L) & 0xff));<NEW_LINE>writeHexByte(buf, pos + 12, (byte) ((v ><MASK><NEW_LINE>writeHexByte(buf, pos + 14, (byte) (v & 0xff));<NEW_LINE>this.pos = pos + 16;<NEW_LINE>}
>> 8L) & 0xff));
669,257
private static int computeLanguageIndex(Class<?> languageClass, int offset) {<NEW_LINE>List<AbstractClassLoaderSupplier<MASK><NEW_LINE>int staticIndex;<NEW_LINE>if (EngineAccessor.HOST.isHostLanguage(languageClass)) {<NEW_LINE>staticIndex = PolyglotEngineImpl.HOST_LANGUAGE_INDEX;<NEW_LINE>} else {<NEW_LINE>Map<String, LanguageCache> classNames = CLASS_NAME_CACHE.get(loaders);<NEW_LINE>if (classNames == null) {<NEW_LINE>classNames = new HashMap<>();<NEW_LINE>Map<String, LanguageCache> idToLanguage = LanguageCache.loadLanguages(loaders);<NEW_LINE>for (LanguageCache cache : idToLanguage.values()) {<NEW_LINE>classNames.put(cache.getClassName(), cache);<NEW_LINE>}<NEW_LINE>Map<String, LanguageCache> finalClassNames = classNames;<NEW_LINE>classNames = CLASS_NAME_CACHE.computeIfAbsent(loaders, (k) -> Collections.unmodifiableMap(finalClassNames));<NEW_LINE>}<NEW_LINE>LanguageCache cache = classNames.get(languageClass.getName());<NEW_LINE>if (cache == null) {<NEW_LINE>return RESERVED_NULL;<NEW_LINE>}<NEW_LINE>staticIndex = cache.getStaticIndex();<NEW_LINE>assert staticIndex <= LanguageCache.getMaxStaticIndex() : "invalid sharing between class loaders";<NEW_LINE>}<NEW_LINE>return LANGUAGE_START + (staticIndex * LANGUAGE_ELEMENTS) + offset;<NEW_LINE>}
> loaders = EngineAccessor.locatorOrDefaultLoaders();
379,862
final AssociateHostedConnectionResult executeAssociateHostedConnection(AssociateHostedConnectionRequest associateHostedConnectionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(associateHostedConnectionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AssociateHostedConnectionRequest> request = null;<NEW_LINE>Response<AssociateHostedConnectionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AssociateHostedConnectionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(associateHostedConnectionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Direct Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AssociateHostedConnection");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AssociateHostedConnectionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AssociateHostedConnectionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,752,089
private RunEvent populateRun(Optional<ParentRunFacet> parentRunFacet, RunEventBuilder runEventBuilder, JobBuilder jobBuilder, List<Object> nodes) {<NEW_LINE>OpenLineage openLineage = openLineageContext.getOpenLineage();<NEW_LINE><MASK><NEW_LINE>parentRunFacet.ifPresent(runFacetsBuilder::parent);<NEW_LINE>OpenLineage.JobFacets jobFacets = buildFacets(nodes, jobFacetBuilders, openLineage.newJobFacetsBuilder().build());<NEW_LINE>List<InputDataset> inputDatasets = buildInputDatasets(nodes);<NEW_LINE>List<OutputDataset> outputDatasets = buildOutputDatasets(nodes);<NEW_LINE>openLineageContext.getQueryExecution().flatMap(qe -> unknownEntryFacetListener.build(qe.optimizedPlan())).ifPresent(facet -> runFacetsBuilder.put("spark_unknown", facet));<NEW_LINE>RunFacets runFacets = buildFacets(nodes, runFacetBuilders, runFacetsBuilder.build());<NEW_LINE>OpenLineage.RunBuilder runBuilder = openLineage.newRunBuilder().runId(openLineageContext.getRunUuid()).facets(runFacets);<NEW_LINE>return runEventBuilder.run(runBuilder.build()).job(jobBuilder.facets(jobFacets).build()).inputs(inputDatasets).outputs(outputDatasets).build();<NEW_LINE>}
RunFacetsBuilder runFacetsBuilder = openLineage.newRunFacetsBuilder();
1,047,856
public static <T> ExprVectorProcessor<T> concat(Expr.VectorInputBindingInspector inspector, List<Expr> inputs) {<NEW_LINE>final ExprVectorProcessor<String[]>[] inputProcessors = new ExprVectorProcessor[inputs.size()];<NEW_LINE>for (int i = 0; i < inputs.size(); i++) {<NEW_LINE>inputProcessors[i] = CastToTypeVectorProcessor.cast(inputs.get(i).buildVectorized(inspector), ExpressionType.STRING);<NEW_LINE>}<NEW_LINE>final ExprVectorProcessor processor = new StringOutMultiStringInVectorProcessor(inputProcessors, inspector.getMaxVectorSize()) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>void processIndex(String[][] in, int i) {<NEW_LINE>// Result of concatenation is null if any of the Values is null.<NEW_LINE>// e.g. 'select CONCAT(null, "abc") as c;' will return null as per Standard SQL spec.<NEW_LINE>String first = NullHandling.nullToEmptyIfNeeded(in[0][i]);<NEW_LINE>if (first == null) {<NEW_LINE>outValues[i] = null;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>for (int inputNumber = 1; inputNumber < in.length; inputNumber++) {<NEW_LINE>final String s = NullHandling.nullToEmptyIfNeeded(in[inputNumber][i]);<NEW_LINE>if (s == null) {<NEW_LINE>outValues[i] = null;<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>builder.append(s);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>outValues[i] = builder.toString();<NEW_LINE>}<NEW_LINE>};<NEW_LINE>return processor;<NEW_LINE>}
StringBuilder builder = new StringBuilder(first);
1,694,003
public DefaultLocalComponentMetadata copy(ComponentIdentifier componentIdentifier, Transformer<LocalComponentArtifactMetadata, LocalComponentArtifactMetadata> artifacts) {<NEW_LINE>DefaultLocalComponentMetadata copy = new DefaultLocalComponentMetadata(<MASK><NEW_LINE>for (DefaultLocalConfigurationMetadata configuration : allConfigurations.values()) {<NEW_LINE>copy.addConfiguration(configuration.getName(), configuration.description, configuration.extendsFrom, configuration.hierarchy, configuration.visible, configuration.transitive, configuration.attributes, configuration.canBeConsumed, configuration.consumptionDeprecation, configuration.canBeResolved, configuration.capabilities, Collections::emptyList);<NEW_LINE>}<NEW_LINE>// Artifacts<NEW_LINE>// Keep track of transformed artifacts as a given artifact may appear in multiple variants<NEW_LINE>Map<LocalComponentArtifactMetadata, LocalComponentArtifactMetadata> transformedArtifacts = new HashMap<>();<NEW_LINE>for (Map.Entry<String, LocalComponentArtifactMetadata> entry : allArtifacts.entries()) {<NEW_LINE>LocalComponentArtifactMetadata oldArtifact = entry.getValue();<NEW_LINE>LocalComponentArtifactMetadata newArtifact = copyArtifact(oldArtifact, artifacts, transformedArtifacts);<NEW_LINE>copy.allArtifacts.put(entry.getKey(), newArtifact);<NEW_LINE>}<NEW_LINE>// Variants<NEW_LINE>for (Map.Entry<String, DefaultVariantMetadata> entry : allVariants.entries()) {<NEW_LINE>DefaultVariantMetadata oldVariant = entry.getValue();<NEW_LINE>ImmutableList.Builder<LocalComponentArtifactMetadata> newArtifacts = new ImmutableList.Builder<>();<NEW_LINE>for (ComponentArtifactMetadata oldArtifact : oldVariant.getArtifacts()) {<NEW_LINE>newArtifacts.add(copyArtifact((LocalComponentArtifactMetadata) oldArtifact, artifacts, transformedArtifacts));<NEW_LINE>}<NEW_LINE>copy.allVariants.put(entry.getKey(), new DefaultVariantMetadata(oldVariant.getName(), oldVariant.getIdentifier(), oldVariant.asDescribable(), oldVariant.getAttributes(), newArtifacts.build(), oldVariant.getCapabilities()));<NEW_LINE>}<NEW_LINE>for (DefaultLocalConfigurationMetadata configuration : allConfigurations.values()) {<NEW_LINE>configuration.realizeDependencies();<NEW_LINE>DefaultLocalConfigurationMetadata configurationCopy = copy.allConfigurations.get(configuration.getName());<NEW_LINE>// Dependencies<NEW_LINE>configurationCopy.definedDependencies.addAll(configuration.definedDependencies);<NEW_LINE>configurationCopy.definedFiles.addAll(configuration.definedFiles);<NEW_LINE>// Exclude rules<NEW_LINE>configurationCopy.definedExcludes.addAll(configuration.definedExcludes);<NEW_LINE>}<NEW_LINE>return copy;<NEW_LINE>}
moduleVersionId, componentIdentifier, status, attributesSchema);
1,357,939
private static void createTF_RunState(Menu menu, Tag tag) {<NEW_LINE>final TagFeatureRunState tf_run_state = (TagFeatureRunState) tag;<NEW_LINE>int caps = tf_run_state.getRunStateCapabilities();<NEW_LINE>int[] op_set = { TagFeatureRunState.RSC_START, TagFeatureRunState.RSC_STOP, TagFeatureRunState.RSC_PAUSE, TagFeatureRunState.RSC_RESUME };<NEW_LINE>boolean[] can_ops_set = tf_run_state.getPerformableOperations(op_set);<NEW_LINE>if ((caps & TagFeatureRunState.RSC_START) != 0) {<NEW_LINE>final MenuItem itemOp = new MenuItem(menu, SWT.PUSH);<NEW_LINE>Messages.setLanguageText(itemOp, "MyTorrentsView.menu.queue");<NEW_LINE><MASK><NEW_LINE>itemOp.addListener(SWT.Selection, new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event event) {<NEW_LINE>tf_run_state.performOperation(TagFeatureRunState.RSC_START);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>itemOp.setEnabled(can_ops_set[0]);<NEW_LINE>}<NEW_LINE>if ((caps & TagFeatureRunState.RSC_STOP) != 0) {<NEW_LINE>final MenuItem itemOp = new MenuItem(menu, SWT.PUSH);<NEW_LINE>Messages.setLanguageText(itemOp, "MyTorrentsView.menu.stop");<NEW_LINE>Utils.setMenuItemImage(itemOp, "stop");<NEW_LINE>itemOp.addListener(SWT.Selection, new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event event) {<NEW_LINE>tf_run_state.performOperation(TagFeatureRunState.RSC_STOP);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>itemOp.setEnabled(can_ops_set[1]);<NEW_LINE>}<NEW_LINE>if ((caps & TagFeatureRunState.RSC_PAUSE) != 0) {<NEW_LINE>final MenuItem itemOp = new MenuItem(menu, SWT.PUSH);<NEW_LINE>Messages.setLanguageText(itemOp, "v3.MainWindow.button.pause");<NEW_LINE>Utils.setMenuItemImage(itemOp, "pause");<NEW_LINE>itemOp.addListener(SWT.Selection, new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event event) {<NEW_LINE>tf_run_state.performOperation(TagFeatureRunState.RSC_PAUSE);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>itemOp.setEnabled(can_ops_set[2]);<NEW_LINE>}<NEW_LINE>if ((caps & TagFeatureRunState.RSC_RESUME) != 0) {<NEW_LINE>final MenuItem itemOp = new MenuItem(menu, SWT.PUSH);<NEW_LINE>Messages.setLanguageText(itemOp, "v3.MainWindow.button.resume");<NEW_LINE>Utils.setMenuItemImage(itemOp, "start");<NEW_LINE>itemOp.addListener(SWT.Selection, new Listener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void handleEvent(Event event) {<NEW_LINE>tf_run_state.performOperation(TagFeatureRunState.RSC_RESUME);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>itemOp.setEnabled(can_ops_set[3]);<NEW_LINE>}<NEW_LINE>}
Utils.setMenuItemImage(itemOp, "start");
1,332,675
protected Query doToQuery(SearchExecutionContext context) throws IOException {<NEW_LINE>if (context.allowExpensiveQueries() == false) {<NEW_LINE>throw new ElasticsearchException("[joining] queries cannot be executed when '" + ALLOW_EXPENSIVE_QUERIES.getKey() + "' is set to false.");<NEW_LINE>}<NEW_LINE>Joiner joiner = Joiner.getJoiner(context);<NEW_LINE>if (joiner == null) {<NEW_LINE>if (ignoreUnmapped) {<NEW_LINE>return new MatchNoDocsQuery();<NEW_LINE>} else {<NEW_LINE>final String indexName = context.getIndexSettings().getIndex().getName();<NEW_LINE>throw new QueryShardException(context, "[" + NAME + "] no join field found for index [" + indexName + "]");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (joiner.childTypeExists(type) == false) {<NEW_LINE>if (ignoreUnmapped) {<NEW_LINE>return new MatchNoDocsQuery();<NEW_LINE>} else {<NEW_LINE>throw new QueryShardException(context, "[" + <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return // Need to take child type into account, otherwise a child doc of different type with the same id could match<NEW_LINE>new BooleanQuery.Builder().add(new TermQuery(new Term(joiner.parentJoinField(type), id)), BooleanClause.Occur.MUST).add(new TermQuery(new Term(joiner.getJoinField(), type)), BooleanClause.Occur.FILTER).build();<NEW_LINE>}
NAME + "] no relation found for child [" + type + "]");
1,671,596
void addClientStats(final HttpChannel httpChannel) {<NEW_LINE>if (clientStatsEnabled == false) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (httpChannel == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>httpChannelStats.putIfAbsent(httpChannel, new ClientStatsBuilder(System.identityHashCode(httpChannel), formatAddress(httpChannel.getRemoteAddress()), threadPool.absoluteTimeInMillis()));<NEW_LINE>httpChannel.addCloseListener(ActionListener.wrap(() -> {<NEW_LINE>try {<NEW_LINE>final ClientStatsBuilder disconnectedClientStats = httpChannelStats.remove(httpChannel);<NEW_LINE>if (disconnectedClientStats != null) {<NEW_LINE>addClosedChannelStats(disconnectedClientStats.build<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// the listener code above should never throw<NEW_LINE>assert false : e;<NEW_LINE>logger.warn("error removing HTTP channel listener", e);<NEW_LINE>}<NEW_LINE>}));<NEW_LINE>}
(threadPool.absoluteTimeInMillis()));
1,852,586
public static List<DaemonStopEvent> uniqueRecentDaemonStopEvents(final List<DaemonStopEvent> stopEvents) {<NEW_LINE>final Set<Long> uniqueStoppedPids = new HashSet<Long<MASK><NEW_LINE>final List<DaemonStopEvent> recentStopEvents = new ArrayList<DaemonStopEvent>(stopEvents.size());<NEW_LINE>final List<DaemonStopEvent> sortedEvents = CollectionUtils.sort(stopEvents, new Comparator<DaemonStopEvent>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(DaemonStopEvent event1, DaemonStopEvent event2) {<NEW_LINE>if (event1.getStatus() != null && event2.getStatus() == null) {<NEW_LINE>return -1;<NEW_LINE>} else if (event1.getStatus() == null && event2.getStatus() != null) {<NEW_LINE>return 1;<NEW_LINE>} else if (event1.getStatus() != null && event2.getStatus() != null) {<NEW_LINE>return event2.getStatus().compareTo(event1.getStatus());<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// User likely doesn't care about daemons that stopped a long time ago<NEW_LINE>for (DaemonStopEvent event : sortedEvents) {<NEW_LINE>Long pid = event.getPid();<NEW_LINE>if (event.occurredInLastHours(RECENTLY) && !uniqueStoppedPids.contains(pid)) {<NEW_LINE>// We can only determine if two DaemonStopEvent point at the same daemon if we know the PIDs<NEW_LINE>if (pid != null) {<NEW_LINE>uniqueStoppedPids.add(pid);<NEW_LINE>}<NEW_LINE>recentStopEvents.add(event);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return recentStopEvents;<NEW_LINE>}
>(stopEvents.size());
1,768,623
public void readExternal(Element element) throws InvalidDataException {<NEW_LINE>super.readExternal(element);<NEW_LINE>ConfigurationState state = XmlSerializer.deserialize(element, ConfigurationState.class);<NEW_LINE>myServerName = null;<NEW_LINE>myDeploymentSource = null;<NEW_LINE>if (state != null) {<NEW_LINE>myServerName = state.myServerName;<NEW_LINE>Element deploymentTag = state.myDeploymentTag;<NEW_LINE>if (deploymentTag != null) {<NEW_LINE>String typeId = deploymentTag.getAttributeValue(DEPLOYMENT_SOURCE_TYPE_ATTRIBUTE);<NEW_LINE>DeploymentSourceType<<MASK><NEW_LINE>if (type != null) {<NEW_LINE>myDeploymentSource = type.load(deploymentTag, getProject());<NEW_LINE>myDeploymentConfiguration = myDeploymentConfigurator.createDefaultConfiguration(myDeploymentSource);<NEW_LINE>ComponentSerializationUtil.loadComponentState(myDeploymentConfiguration.getSerializer(), deploymentTag.getChild(SETTINGS_ELEMENT));<NEW_LINE>} else {<NEW_LINE>LOG.warn("Cannot load deployment source for '" + getName() + "' run configuration: unknown deployment type '" + typeId + "'");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
?> type = findDeploymentSourceType(typeId);
1,076,978
private void printCryptoParams(Path path, FileSystem fs) {<NEW_LINE>byte[] noCryptoBytes = new NoFileEncrypter().getDecryptionParameters();<NEW_LINE>try (FSDataInputStream fsDis = fs.open(path)) {<NEW_LINE>long fileLength = fs.<MASK><NEW_LINE>fsDis.seek(fileLength - 16 - Utils.Version.size() - Long.BYTES);<NEW_LINE>long cryptoParamOffset = fsDis.readLong();<NEW_LINE>fsDis.seek(cryptoParamOffset);<NEW_LINE>byte[] cryptoParams = CryptoUtils.readParams(fsDis);<NEW_LINE>if (Arrays.equals(noCryptoBytes, cryptoParams)) {<NEW_LINE>System.out.println("No on disk encryption detected.");<NEW_LINE>} else {<NEW_LINE>System.out.println("Encrypted with Params: " + Key.toPrintableString(cryptoParams, 0, cryptoParams.length, cryptoParams.length));<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>log.error("Error reading crypto params", ioe);<NEW_LINE>}<NEW_LINE>}
getFileStatus(path).getLen();
193,592
protected void init() {<NEW_LINE>// Set the value separator<NEW_LINE>setValueSeparator();<NEW_LINE>// Set the field separator<NEW_LINE>setFieldSeparator();<NEW_LINE>// Set the authority separator<NEW_LINE>setAuthoritySeparator();<NEW_LINE>// Create the headings<NEW_LINE>headings = new ArrayList<>();<NEW_LINE>// Create the blank list of items<NEW_LINE>lines = new ArrayList<>();<NEW_LINE>// Initialise the counter<NEW_LINE>counter = 0;<NEW_LINE>// Set the metadata fields to ignore<NEW_LINE>ignore = new HashMap<>();<NEW_LINE>// Specify default values<NEW_LINE>String[] defaultValues = new String[] { "dc.date.accessioned", "dc.date.available", "dc.date.updated", "dc.description.provenance" };<NEW_LINE>String[] toIgnoreArray = DSpaceServicesFactory.getInstance().getConfigurationService().getArrayProperty("bulkedit.ignore-on-export", defaultValues);<NEW_LINE>for (String toIgnoreString : toIgnoreArray) {<NEW_LINE>if (!"".equals(toIgnoreString.trim())) {<NEW_LINE>ignore.put(toIgnoreString.trim(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
), toIgnoreString.trim());
1,115,756
private boolean executeWrites(List<Write> toExecute) {<NEW_LINE>log.debug("{}: Executing {} writes.", this.traceObjectId, toExecute.size());<NEW_LINE>for (int i = 0; i < toExecute.size(); i++) {<NEW_LINE>Write w = toExecute.get(i);<NEW_LINE>try {<NEW_LINE>// Record the beginning of a new attempt.<NEW_LINE><MASK><NEW_LINE>if (attemptCount > this.config.getMaxWriteAttempts()) {<NEW_LINE>// Retried too many times.<NEW_LINE>throw new RetriesExhaustedException(w.getFailureCause());<NEW_LINE>}<NEW_LINE>// Invoke the BookKeeper write.<NEW_LINE>w.getWriteLedger().ledger.appendAsync(w.getData().retain()).whenComplete((Long entryId, Throwable error) -> {<NEW_LINE>addCallback(entryId, error, w);<NEW_LINE>});<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>// Synchronous failure (or RetriesExhausted). Fail current write.<NEW_LINE>boolean isFinal = !isRetryable(ex);<NEW_LINE>w.fail(ex, isFinal);<NEW_LINE>// And fail all remaining writes as well.<NEW_LINE>for (int j = i + 1; j < toExecute.size(); j++) {<NEW_LINE>toExecute.get(j).fail(new DurableDataLogException("Previous write failed.", ex), isFinal);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Success.<NEW_LINE>return true;<NEW_LINE>}
int attemptCount = w.beginAttempt();
1,194,531
private Set<ClassDescriptor> computeKnownSupertypes(ClassDescriptor classDescriptor) throws ClassNotFoundException {<NEW_LINE>LinkedList<ClassVertex> workList = new LinkedList<>();<NEW_LINE>ClassVertex startVertex = resolveClassVertex(classDescriptor);<NEW_LINE>workList.addLast(startVertex);<NEW_LINE>Set<ClassDescriptor> result = new HashSet<>();<NEW_LINE>while (!workList.isEmpty()) {<NEW_LINE>ClassVertex current = workList.removeFirst();<NEW_LINE>if (result.contains(current.getClassDescriptor())) {<NEW_LINE>// Already added this class<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// Add class to the result<NEW_LINE>result.add(current.getClassDescriptor());<NEW_LINE>// Add all known subtype vertices to the work list<NEW_LINE>Iterator<InheritanceEdge> i = graph.outgoingEdgeIterator(current);<NEW_LINE>while (i.hasNext()) {<NEW_LINE>InheritanceEdge edge = i.next();<NEW_LINE>workList.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
addLast(edge.getTarget());
629,063
public <D> FileAppender<D> build() {<NEW_LINE>Preconditions.checkNotNull(schema, "Schema is required");<NEW_LINE>for (Map.Entry<String, String> entry : config.entrySet()) {<NEW_LINE>this.conf.set(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>// for compatibility<NEW_LINE>if (conf.get(VECTOR_ROW_BATCH_SIZE) != null && config.get(ORC_WRITE_BATCH_SIZE) == null) {<NEW_LINE>config.put(ORC_WRITE_BATCH_SIZE, conf.get(VECTOR_ROW_BATCH_SIZE));<NEW_LINE>}<NEW_LINE>// Map Iceberg properties to pass down to the ORC writer<NEW_LINE>Context context = createContextFunc.apply(config);<NEW_LINE>OrcConf.STRIPE_SIZE.setLong(conf, context.stripeSize());<NEW_LINE>OrcConf.BLOCK_SIZE.setLong(conf, context.blockSize());<NEW_LINE>OrcConf.COMPRESS.setString(conf, context.compressionKind().name());<NEW_LINE>OrcConf.COMPRESSION_STRATEGY.setString(conf, context.compressionStrategy().name());<NEW_LINE>OrcConf.<MASK><NEW_LINE>return new OrcFileAppender<>(schema, this.file, createWriterFunc, conf, metadata, context.vectorizedRowBatchSize(), metricsConfig);<NEW_LINE>}
OVERWRITE_OUTPUT_FILE.setBoolean(conf, overwrite);
1,310,705
private void markSpacesWithinParentheses(Node outerNode, int leftStart, int rightStart, FormatToken.Kind leftMark, FormatToken.Kind rightMark) {<NEW_LINE>FormatToken leftParen = tokenUtils.getNextToken(leftStart, JsTokenId.BRACKET_LEFT_PAREN, getFinish(outerNode));<NEW_LINE>if (leftParen != null) {<NEW_LINE>FormatToken mark = leftParen.next();<NEW_LINE>assert mark != null && mark.getKind() == FormatToken.Kind.AFTER_LEFT_PARENTHESIS : mark;<NEW_LINE>if (mark.getKind() == FormatToken.Kind.AFTER_LEFT_PARENTHESIS) {<NEW_LINE>tokenStream.removeToken(mark);<NEW_LINE>}<NEW_LINE>TokenUtils.appendToken(leftParen, FormatToken.forFormat(leftMark));<NEW_LINE>FormatToken rightParen = tokenUtils.getPreviousToken(rightStart, JsTokenId.BRACKET_RIGHT_PAREN, getStart(outerNode));<NEW_LINE>if (rightParen != null) {<NEW_LINE>FormatToken previous = rightParen.previous();<NEW_LINE>assert previous != null && previous.getKind() == FormatToken.Kind.BEFORE_RIGHT_PARENTHESIS : previous;<NEW_LINE>if (previous.getKind() == FormatToken.Kind.BEFORE_RIGHT_PARENTHESIS) {<NEW_LINE>tokenStream.removeToken(previous);<NEW_LINE>}<NEW_LINE>previous = rightParen.previous();<NEW_LINE>if (previous != null) {<NEW_LINE>TokenUtils.appendToken(previous<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, FormatToken.forFormat(rightMark));
1,376,316
public void userGet(final Response.Listener<User> responseListener, final Response.ErrorListener errorListener) {<NEW_LINE>Object postBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String path = <MASK><NEW_LINE>// query params<NEW_LINE>List<Pair> queryParams = new ArrayList<Pair>();<NEW_LINE>// header params<NEW_LINE>Map<String, String> headerParams = new HashMap<String, String>();<NEW_LINE>// form params<NEW_LINE>Map<String, String> formParams = new HashMap<String, String>();<NEW_LINE>String[] contentTypes = { "application/json", "application/x-www-form-urlencoded" };<NEW_LINE>String contentType = contentTypes.length > 0 ? contentTypes[0] : "application/json";<NEW_LINE>if (contentType.startsWith("multipart/form-data")) {<NEW_LINE>// file uploading<NEW_LINE>MultipartEntityBuilder localVarBuilder = MultipartEntityBuilder.create();<NEW_LINE>HttpEntity httpEntity = localVarBuilder.build();<NEW_LINE>postBody = httpEntity;<NEW_LINE>} else {<NEW_LINE>// normal form params<NEW_LINE>}<NEW_LINE>String[] authNames = new String[] { "apiExpires", "apiKey", "apiSignature" };<NEW_LINE>try {<NEW_LINE>apiInvoker.invokeAPI(basePath, path, "GET", queryParams, postBody, headerParams, formParams, contentType, authNames, new Response.Listener<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(String localVarResponse) {<NEW_LINE>try {<NEW_LINE>responseListener.onResponse((User) ApiInvoker.deserialize(localVarResponse, "", User.class));<NEW_LINE>} catch (ApiException exception) {<NEW_LINE>errorListener.onErrorResponse(new VolleyError(exception));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}, new Response.ErrorListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onErrorResponse(VolleyError error) {<NEW_LINE>errorListener.onErrorResponse(error);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (ApiException ex) {<NEW_LINE>errorListener.onErrorResponse(new VolleyError(ex));<NEW_LINE>}<NEW_LINE>}
"/user".replaceAll("\\{format\\}", "json");
1,013,563
final DeleteIntegrationResult executeDeleteIntegration(DeleteIntegrationRequest deleteIntegrationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteIntegrationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DeleteIntegrationRequest> request = null;<NEW_LINE>Response<DeleteIntegrationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteIntegrationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteIntegrationRequest));<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, "ApiGatewayV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteIntegration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteIntegrationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteIntegrationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,107,294
public void testFlowableRxInvoker_getIbmReceiveTimeout(Map<String, String> param, StringBuilder ret) {<NEW_LINE>long timeout = messageTimeout;<NEW_LINE>if (isZOS()) {<NEW_LINE>timeout = zTimeout;<NEW_LINE>}<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE><MASK><NEW_LINE>cb.property("com.ibm.ws.jaxrs.client.receive.timeout", TIMEOUT);<NEW_LINE>Client c = cb.build();<NEW_LINE>c.register(FlowableRxInvokerProvider.class);<NEW_LINE>WebTarget t = c.target("http://" + serverIP + ":" + serverPort + "/jaxrs21bookstore/JAXRS21bookstore2/" + SLEEP);<NEW_LINE>Builder builder = t.request();<NEW_LINE>Flowable<Response> flowable = builder.rx(FlowableRxInvoker.class).get(Response.class);<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>final Holder<Response> holder = new Holder<Response>();<NEW_LINE>final CountDownLatch countDownLatch = new CountDownLatch(1);<NEW_LINE>flowable.subscribe(v -> {<NEW_LINE>// OnNext<NEW_LINE>holder.value = v;<NEW_LINE>}, throwable -> {<NEW_LINE>if (throwable.getMessage().contains("SocketTimeoutException")) {<NEW_LINE>// OnError<NEW_LINE>ret.append("Timeout as expected");<NEW_LINE>} else {<NEW_LINE>ret.append("throwable");<NEW_LINE>throwable.printStackTrace();<NEW_LINE>}<NEW_LINE>countDownLatch.countDown();<NEW_LINE>}, // OnCompleted<NEW_LINE>() -> ret.append("OnCompleted"));<NEW_LINE>try {<NEW_LINE>if (!(countDownLatch.await(timeout, TimeUnit.SECONDS))) {<NEW_LINE>throw new RuntimeException("testFlowableRxInvoker_getIbmReceiveTimeout: Response took too long. Waited " + timeout);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>long elapsed = System.currentTimeMillis() - startTime;<NEW_LINE>System.out.println("testFlowableRxInvoker_getIbmReceiveTimeout with TIMEOUT " + TIMEOUT + " OnError elapsed time " + elapsed);<NEW_LINE>c.close();<NEW_LINE>}
ClientBuilder cb = ClientBuilder.newBuilder();
1,045,656
public void execute(SensorContext context) {<NEW_LINE>monitoring.startSensor(context, this);<NEW_LINE>this.context = context;<NEW_LINE>this.contextUtils = new ContextUtils(context);<NEW_LINE>environments = Arrays.asList(context.config()<MASK><NEW_LINE>globals = Arrays.asList(context.config().getStringArray(JavaScriptPlugin.GLOBALS));<NEW_LINE>try {<NEW_LINE>List<InputFile> inputFiles = getInputFiles();<NEW_LINE>if (inputFiles.isEmpty()) {<NEW_LINE>LOG.info("No input files found for analysis");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>eslintBridgeServer.startServerLazily(context);<NEW_LINE>analyzeFiles(inputFiles);<NEW_LINE>} catch (CancellationException e) {<NEW_LINE>// do not propagate the exception<NEW_LINE>LOG.info(e.toString());<NEW_LINE>} catch (ServerAlreadyFailedException e) {<NEW_LINE>LOG.debug("Skipping the start of eslint-bridge server " + "as it failed to start during the first analysis or it's not answering anymore");<NEW_LINE>LOG.debug("No rules will be executed");<NEW_LINE>} catch (NodeCommandException e) {<NEW_LINE>logErrorOrWarn(e.getMessage(), e);<NEW_LINE>analysisWarnings.addUnique("JavaScript/TypeScript/CSS rules were not executed. " + e.getMessage());<NEW_LINE>if (contextUtils.failFast()) {<NEW_LINE>throw new IllegalStateException("Analysis failed (\"sonar.internal.analysis.failFast\"=true)", e);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Failure during analysis, " + eslintBridgeServer.getCommandInfo(), e);<NEW_LINE>if (contextUtils.failFast()) {<NEW_LINE>throw new IllegalStateException("Analysis failed (\"sonar.internal.analysis.failFast\"=true)", e);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>monitoring.stopSensor();<NEW_LINE>}<NEW_LINE>}
.getStringArray(JavaScriptPlugin.ENVIRONMENTS));
698,626
public static void main(String[] args) throws IOException {<NEW_LINE>// set-up the client<NEW_LINE>AmazonS3 s3client = AmazonS3ClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(credentials)).withRegion(Regions.US_EAST_2).build();<NEW_LINE>AWSS3Service awsService = new AWSS3Service(s3client);<NEW_LINE>bucketName = "baeldung-bucket";<NEW_LINE>// creating a bucket<NEW_LINE>if (awsService.doesBucketExist(bucketName)) {<NEW_LINE>System.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>awsService.createBucket(bucketName);<NEW_LINE>// list all the buckets<NEW_LINE>for (Bucket s : awsService.listBuckets()) {<NEW_LINE>System.out.println(s.getName());<NEW_LINE>}<NEW_LINE>// deleting bucket<NEW_LINE>awsService.deleteBucket("baeldung-bucket-test2");<NEW_LINE>// uploading object<NEW_LINE>awsService.putObject(bucketName, "Document/hello.txt", new File("/Users/user/Document/hello.txt"));<NEW_LINE>// listing objects<NEW_LINE>ObjectListing objectListing = awsService.listObjects(bucketName);<NEW_LINE>for (S3ObjectSummary os : objectListing.getObjectSummaries()) {<NEW_LINE>System.out.println(os.getKey());<NEW_LINE>}<NEW_LINE>// downloading an object<NEW_LINE>S3Object s3object = awsService.getObject(bucketName, "Document/hello.txt");<NEW_LINE>S3ObjectInputStream inputStream = s3object.getObjectContent();<NEW_LINE>FileUtils.copyInputStreamToFile(inputStream, new File("/Users/user/Desktop/hello.txt"));<NEW_LINE>// copying an object<NEW_LINE>awsService.copyObject("baeldung-bucket", "picture/pic.png", "baeldung-bucket2", "Document/picture.png");<NEW_LINE>// deleting an object<NEW_LINE>awsService.deleteObject(bucketName, "Document/hello.txt");<NEW_LINE>// deleting multiple objects<NEW_LINE>String[] objkeyArr = { "Document/hello2.txt", "Document/picture.png" };<NEW_LINE>DeleteObjectsRequest delObjReq = new DeleteObjectsRequest("baeldung-bucket").withKeys(objkeyArr);<NEW_LINE>awsService.deleteObjects(delObjReq);<NEW_LINE>}
out.println("Bucket name is not available." + " Try again with a different Bucket name.");
987,814
public // public void pump(TiStream inputStream, KrollFunction handler, int maxChunkSize, boolean isAsync)<NEW_LINE>void pump(Object[] args) {<NEW_LINE>if (args.length != 3 && args.length != 4) {<NEW_LINE>throw new IllegalArgumentException("Invalid number of arguments");<NEW_LINE>}<NEW_LINE>// stream<NEW_LINE>if (!(args[0] instanceof TiStream)) {<NEW_LINE>throw new IllegalArgumentException("Invalid stream argument");<NEW_LINE>}<NEW_LINE>TiStream inputStream <MASK><NEW_LINE>// handler<NEW_LINE>if (!(args[1] instanceof KrollFunction)) {<NEW_LINE>throw new IllegalArgumentException("Invalid handler argument");<NEW_LINE>}<NEW_LINE>KrollFunction handler = (KrollFunction) args[1];<NEW_LINE>// max chunk size<NEW_LINE>if (!(args[2] instanceof Number)) {<NEW_LINE>throw new IllegalArgumentException("Invalid max chunk size argument");<NEW_LINE>}<NEW_LINE>int maxChunkSize = ((Number) args[2]).intValue();<NEW_LINE>// isAsync<NEW_LINE>boolean isAsync = false;<NEW_LINE>if (args.length == 4) {<NEW_LINE>if (!(args[3] instanceof Boolean)) {<NEW_LINE>throw new IllegalArgumentException("Invalid async flag argument");<NEW_LINE>}<NEW_LINE>isAsync = ((Boolean) args[3]).booleanValue();<NEW_LINE>}<NEW_LINE>if (!isAsync) {<NEW_LINE>// Spit out deprecation notice about sync call!<NEW_LINE>// And throw exception when on main thread!<NEW_LINE>// final String syncIsANoNo = "Synchronous invocation of pump will crash under the main thread. This will no longer be supported in SDK 8.0.0. final async boolean argument will be removed and calls will be assumed to be async.";<NEW_LINE>// if (TiApplication.isUIThread()) {<NEW_LINE>// throw new IllegalArgumentException(syncIsANoNo);<NEW_LINE>// } else {<NEW_LINE>// Log.w(TAG, syncIsANoNo);<NEW_LINE>// }<NEW_LINE>// FIXME: Use same thread/Runnable model as in TiStreamHelper when running sync on main thread?<NEW_LINE>pumpSync(inputStream, handler, maxChunkSize);<NEW_LINE>} else {<NEW_LINE>final TiStream finputStream = inputStream;<NEW_LINE>final KrollFunction fHandler = handler;<NEW_LINE>final int fmaxChunkSize = maxChunkSize;<NEW_LINE>new Thread(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>pumpSync(finputStream, fHandler, fmaxChunkSize);<NEW_LINE>}<NEW_LINE>}) {<NEW_LINE>}.start();<NEW_LINE>}<NEW_LINE>}
= (TiStream) args[0];
705,803
public final OrderByContext orderBy() throws RecognitionException {<NEW_LINE>OrderByContext _localctx = new <MASK><NEW_LINE>enterRule(_localctx, 44, RULE_orderBy);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(306);<NEW_LINE>match(ORDER_BY);<NEW_LINE>setState(307);<NEW_LINE>orderByExpr();<NEW_LINE>setState(312);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>while (_la == T__2) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(308);<NEW_LINE>match(T__2);<NEW_LINE>setState(309);<NEW_LINE>orderByExpr();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(314);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
OrderByContext(_ctx, getState());
1,481,070
final ListPermissionSetsResult executeListPermissionSets(ListPermissionSetsRequest listPermissionSetsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listPermissionSetsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListPermissionSetsRequest> request = null;<NEW_LINE>Response<ListPermissionSetsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new ListPermissionSetsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listPermissionSetsRequest));<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, "SSO Admin");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListPermissionSets");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListPermissionSetsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListPermissionSetsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
1,758,587
public void writeBinaryTo(DataOutput out) throws IOException {<NEW_LINE>// TODO to avoid duplicate code, replace this with writeBinaryTo(out, List<Integer>()) or some such<NEW_LINE>// Section BYTEFEATURES<NEW_LINE>out.writeInt(numByteFeatures);<NEW_LINE>for (int i = 0; i < numByteFeatures; i++) {<NEW_LINE>if (featureWeights != null) {<NEW_LINE>out.writeFloat(featureWeights[i]);<NEW_LINE>} else {<NEW_LINE>out.writeFloat(0);<NEW_LINE>}<NEW_LINE>out<MASK><NEW_LINE>int numValues = getNumberOfValues(i);<NEW_LINE>// an unsigned byte<NEW_LINE>byte numValuesEncoded = (byte) numValues;<NEW_LINE>out.writeByte(numValuesEncoded);<NEW_LINE>for (int b = 0; b < numValues; b++) {<NEW_LINE>String value = getFeatureValueAsString(i, b);<NEW_LINE>out.writeUTF(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Section SHORTFEATURES<NEW_LINE>out.writeInt(numShortFeatures);<NEW_LINE>for (int i = numByteFeatures; i < numByteFeatures + numShortFeatures; i++) {<NEW_LINE>if (featureWeights != null) {<NEW_LINE>out.writeFloat(featureWeights[i]);<NEW_LINE>} else {<NEW_LINE>out.writeFloat(0);<NEW_LINE>}<NEW_LINE>out.writeUTF(getFeatureName(i));<NEW_LINE>short numValues = (short) getNumberOfValues(i);<NEW_LINE>out.writeShort(numValues);<NEW_LINE>for (short b = 0; b < numValues; b++) {<NEW_LINE>String value = getFeatureValueAsString(i, b);<NEW_LINE>out.writeUTF(value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Section CONTINUOUSFEATURES<NEW_LINE>out.writeInt(numContinuousFeatures);<NEW_LINE>for (int i = numByteFeatures + numShortFeatures; i < numByteFeatures + numShortFeatures + numContinuousFeatures; i++) {<NEW_LINE>if (featureWeights != null) {<NEW_LINE>out.writeFloat(featureWeights[i]);<NEW_LINE>out.writeUTF(floatWeightFuncts[i - numByteFeatures - numShortFeatures]);<NEW_LINE>} else {<NEW_LINE>out.writeFloat(0);<NEW_LINE>out.writeUTF("");<NEW_LINE>}<NEW_LINE>out.writeUTF(getFeatureName(i));<NEW_LINE>}<NEW_LINE>}
.writeUTF(getFeatureName(i));
591,234
private static RubyNumeric f_addsub(ThreadContext context, RubyClass metaClass, RubyInteger anum, RubyInteger aden, RubyInteger bnum, RubyInteger bden, final boolean plus) {<NEW_LINE>RubyInteger newNum, newDen, g, a, b;<NEW_LINE>if (anum instanceof RubyFixnum && aden instanceof RubyFixnum && bnum instanceof RubyFixnum && bden instanceof RubyFixnum) {<NEW_LINE>long an = ((RubyFixnum) anum).getLongValue();<NEW_LINE>long ad = ((<MASK><NEW_LINE>long bn = ((RubyFixnum) bnum).getLongValue();<NEW_LINE>long bd = ((RubyFixnum) bden).getLongValue();<NEW_LINE>long ig = i_gcd(ad, bd);<NEW_LINE>g = RubyFixnum.newFixnum(context.runtime, ig);<NEW_LINE>a = f_imul(context, an, bd / ig);<NEW_LINE>b = f_imul(context, bn, ad / ig);<NEW_LINE>} else {<NEW_LINE>g = f_gcd(context, aden, bden);<NEW_LINE>a = f_mul(context, anum, f_idiv(context, bden, g));<NEW_LINE>b = f_mul(context, bnum, f_idiv(context, aden, g));<NEW_LINE>}<NEW_LINE>RubyInteger c = plus ? f_add(context, a, b) : f_sub(context, a, b);<NEW_LINE>b = f_idiv(context, aden, g);<NEW_LINE>g = f_gcd(context, c, g);<NEW_LINE>newNum = f_idiv(context, c, g);<NEW_LINE>a = f_idiv(context, bden, g);<NEW_LINE>newDen = f_mul(context, a, b);<NEW_LINE>return RubyRational.newRationalNoReduce(context, metaClass, newNum, newDen);<NEW_LINE>}
RubyFixnum) aden).getLongValue();
1,346,810
protected void emitForeignCallOp(ForeignCallLinkage linkage, Value targetAddress, Value result, Value[] arguments, Value[] temps, LIRFrameState info) {<NEW_LINE>SubstrateForeignCallLinkage callTarget = (SubstrateForeignCallLinkage) linkage;<NEW_LINE>SharedMethod targetMethod = (SharedMethod) callTarget.getMethod();<NEW_LINE>if (shouldEmitOnlyIndirectCalls()) {<NEW_LINE>RegisterValue targetRegister = AArch64.lr.asValue(FrameAccess.getWordStamp().getLIRKind(getLIRKindTool()));<NEW_LINE>emitMove(targetRegister, targetAddress);<NEW_LINE>append(new SubstrateAArch64IndirectCallOp(getRuntimeConfiguration(), targetMethod, result, arguments, temps, targetRegister, info, Value.ILLEGAL, StatusSupport.STATUS_ILLEGAL, getDestroysCallerSavedRegisters(<MASK><NEW_LINE>} else {<NEW_LINE>assert targetAddress == null;<NEW_LINE>append(new SubstrateAArch64DirectCallOp(getRuntimeConfiguration(), targetMethod, result, arguments, temps, info, Value.ILLEGAL, StatusSupport.STATUS_ILLEGAL, getDestroysCallerSavedRegisters(targetMethod), Value.ILLEGAL));<NEW_LINE>}<NEW_LINE>}
targetMethod), Value.ILLEGAL));
264,826
public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.<MASK><NEW_LINE>if (player != null) {<NEW_LINE>int power = 0;<NEW_LINE>TargetControlledCreaturePermanent target = new TargetControlledCreaturePermanent(1, 1, new FilterControlledCreaturePermanent("creature to sacrifice"), true);<NEW_LINE>if (target.canChoose(player.getId(), source, game)) {<NEW_LINE>while (!target.isChosen() && target.canChoose(player.getId(), source, game) && player.canRespond()) {<NEW_LINE>player.chooseTarget(Outcome.Sacrifice, target, source, game);<NEW_LINE>}<NEW_LINE>Permanent permanent = game.getPermanent(target.getFirstTarget());<NEW_LINE>if (permanent != null) {<NEW_LINE>power = permanent.getPower().getValue();<NEW_LINE>permanent.sacrifice(source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (power > 0) {<NEW_LINE>new DamageEverythingEffect(power, filter).apply(game, source);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
getPlayer(source.getControllerId());
1,027,417
private static void loadInitialClientDrivers() {<NEW_LINE>Set<String> driverList = Sets.newHashSet();<NEW_LINE>// add default zookeeper based driver<NEW_LINE>driverList.add(ZK_CLIENT_DRIVER_CLASS);<NEW_LINE>// load drivers from system property<NEW_LINE>String driversStr = System.getProperty(BK_METADATA_CLIENT_DRIVERS_PROPERTY);<NEW_LINE>if (null != driversStr) {<NEW_LINE>String[] driversArray = StringUtils.split(driversStr, ':');<NEW_LINE>Collections.addAll(driverList, driversArray);<NEW_LINE>}<NEW_LINE>// initialize the drivers<NEW_LINE>for (String driverClsName : driverList) {<NEW_LINE>try {<NEW_LINE>MetadataClientDriver driver = ReflectionUtils.newInstance(driverClsName, MetadataClientDriver.class);<NEW_LINE>MetadataClientDriverInfo driverInfo = new MetadataClientDriverInfo(driver.getClass());<NEW_LINE>clientDrivers.put(driver.getScheme(<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>log.warn("Failed to load metadata client driver {}", driverClsName, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
).toLowerCase(), driverInfo);
950,752
protected void paintChildren() {<NEW_LINE>Rectangle bounds = getBounds();<NEW_LINE>if (image == null || image.getWidth() < bounds.width || image.getHeight() < bounds.height) {<NEW_LINE>clearCache();<NEW_LINE>image = new BufferedImage(bounds.width, bounds.height, BufferedImage.TYPE_INT_ARGB);<NEW_LINE>imageGraphics = image.createGraphics();<NEW_LINE>}<NEW_LINE>Graphics2D previousGraphics = getScene().getGraphics();<NEW_LINE>imageGraphics.translate(-bounds<MASK><NEW_LINE>imageGraphics.setBackground(TRANSPARENT);<NEW_LINE>imageGraphics.clearRect(bounds.x, bounds.y, bounds.width, bounds.height);<NEW_LINE>getScene().setGraphics(imageGraphics);<NEW_LINE>super.paintChildren();<NEW_LINE>getScene().setGraphics(previousGraphics);<NEW_LINE>imageGraphics.translate(bounds.x, bounds.y);<NEW_LINE>getGraphics().drawImage(image, convolveOp, bounds.x, bounds.y);<NEW_LINE>}
.x, -bounds.y);
783,397
//<NEW_LINE>@Override<NEW_LINE>public void addTo(ClassSource_Aggregate rootClassSource) throws ClassSource_Exception {<NEW_LINE>ClassSource_Factory classSourceFactory = rootClassSource.getFactory();<NEW_LINE>Util_InternMap internMap = rootClassSource.getInternMap();<NEW_LINE>String useName = getName();<NEW_LINE>ScanPolicy usePolicy = getPolicy();<NEW_LINE>Util_RelativePath usePath = getPath();<NEW_LINE>if (usePath == null) {<NEW_LINE>throw new IllegalArgumentException("Class source specification [ " + useName + " ] [ " + usePolicy + " ] has neither a class loader nor a path");<NEW_LINE>}<NEW_LINE>String useEntryPrefix = getEntryPrefix();<NEW_LINE>Util_Factory utilFactory = classSourceFactory.getUtilFactory();<NEW_LINE>String dirPath = utilFactory.denormalize(usePath.n_getFullPath());<NEW_LINE>final File dir = new File(dirPath);<NEW_LINE>Boolean dirIsFile = AccessController.doPrivileged(new PrivilegedAction<Boolean>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Boolean run() {<NEW_LINE>return Boolean.valueOf(dir.exists() && dir.isFile());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ClassSource classSource;<NEW_LINE>if (dirIsFile.booleanValue()) {<NEW_LINE>classSource = classSourceFactory.createJarClassSource(internMap, useName, dirPath, useEntryPrefix);<NEW_LINE>// throws ClassSource_Exception<NEW_LINE>} else {<NEW_LINE>classSource = classSourceFactory.createDirectoryClassSource(<MASK><NEW_LINE>// throws ClassSource_Exception<NEW_LINE>}<NEW_LINE>rootClassSource.addClassSource(classSource, usePolicy);<NEW_LINE>}
internMap, useName, dirPath, useEntryPrefix);
271,242
public int blockingRead(final int startingPosition, @NonNull final byte[] output, final int offset, final int maxLength) throws IOException {<NEW_LINE>if (maxLength == 0) {<NEW_LINE>throw new RuntimeException("Attempted to read zero bytes");<NEW_LINE>}<NEW_LINE>synchronized (mLock) {<NEW_LINE>while (notReadyForRead(startingPosition)) {<NEW_LINE>try {<NEW_LINE>mLock.wait();<NEW_LINE>} catch (final InterruptedException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mFailed != null) {<NEW_LINE>throw mFailed;<NEW_LINE>}<NEW_LINE>if (mSize > startingPosition) {<NEW_LINE>final int bytesToRead = Math.min(maxLength, mSize - startingPosition);<NEW_LINE>System.arraycopy(mData, <MASK><NEW_LINE>return bytesToRead;<NEW_LINE>}<NEW_LINE>if (mComplete) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>throw new IOException("Internal error: ready conditions not true");<NEW_LINE>}<NEW_LINE>}
startingPosition, output, offset, bytesToRead);
439,659
public void handleRangeSplitRequest(final RangeSplitRequest request, final RequestProcessClosure<BaseRequest, BaseResponse<?>> closure) {<NEW_LINE>final RangeSplitResponse response = new RangeSplitResponse();<NEW_LINE><MASK><NEW_LINE>response.setRegionEpoch(getRegionEpoch());<NEW_LINE>try {<NEW_LINE>// do not need to check the region epoch<NEW_LINE>final Long newRegionId = KVParameterRequires.requireNonNull(request.getNewRegionId(), "rangeSplit.newRegionId");<NEW_LINE>this.regionEngine.getStoreEngine().applySplit(request.getRegionId(), newRegionId, new BaseKVStoreClosure() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(final Status status) {<NEW_LINE>if (status.isOk()) {<NEW_LINE>response.setValue((Boolean) getData());<NEW_LINE>} else {<NEW_LINE>setFailure(request, response, status, getError());<NEW_LINE>}<NEW_LINE>closure.sendResponse(response);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (final Throwable t) {<NEW_LINE>LOG.error("Failed to handle: {}, {}.", request, StackTraceUtil.stackTrace(t));<NEW_LINE>response.setError(Errors.forException(t));<NEW_LINE>closure.sendResponse(response);<NEW_LINE>}<NEW_LINE>}
response.setRegionId(getRegionId());
375,097
private void paintControl(Event e) {<NEW_LINE>Color oldForeground = e.gc.getForeground();<NEW_LINE>Color oldBackground = e.gc.getBackground();<NEW_LINE>Point size = getSize();<NEW_LINE>Rectangle r = new Rectangle(0, 0, size.y, size.y);<NEW_LINE>GC gc = e.gc;<NEW_LINE>gc.setBackground(getColor());<NEW_LINE>gc.fillRectangle(r.x, r.y, r.width, r.height);<NEW_LINE>gc.setForeground(getForeground());<NEW_LINE>gc.drawRectangle(r.x, r.y, r.width - <MASK><NEW_LINE>String text = series.getLabel();<NEW_LINE>e.gc.setForeground(getForeground());<NEW_LINE>e.gc.drawString(text, size.y + 2, 1, true);<NEW_LINE>if (!series.isVisible())<NEW_LINE>e.gc.drawLine(size.y + 2, size.y / 2 + 1, size.x - PADDING, size.y / 2 + 1);<NEW_LINE>e.gc.setForeground(oldForeground);<NEW_LINE>e.gc.setBackground(oldBackground);<NEW_LINE>}
1, r.height - 1);
412,290
public void run() {<NEW_LINE>if (MyDebug.LOG)<NEW_LINE>Log.d(TAG, "starting ImageSaver thread...");<NEW_LINE>while (true) {<NEW_LINE>try {<NEW_LINE>if (MyDebug.LOG)<NEW_LINE>Log.d(TAG, "ImageSaver thread reading from queue, size: " + queue.size());<NEW_LINE>// if empty, take() blocks until non-empty<NEW_LINE>Request request = queue.take();<NEW_LINE>// Only decrement n_images_to_save after we've actually saved the image! Otherwise<NEW_LINE>// waitUntilDone() will return<NEW_LINE>// even though we still have a last image to be saved.<NEW_LINE>if (MyDebug.LOG)<NEW_LINE>Log.d(TAG, "ImageSaver thread found new request from queue, size is now: " + queue.size());<NEW_LINE>boolean success;<NEW_LINE>if (request.type == Request.Type.RAW) {<NEW_LINE>if (MyDebug.LOG)<NEW_LINE><MASK><NEW_LINE>success = saveImageNowRaw(request.dngCreator, request.image, request.current_date);<NEW_LINE>} else if (request.type == Request.Type.JPEG) {<NEW_LINE>if (MyDebug.LOG)<NEW_LINE>Log.d(TAG, "request is jpeg");<NEW_LINE>success = saveImageNow(request);<NEW_LINE>} else if (request.type == Request.Type.DUMMY) {<NEW_LINE>if (MyDebug.LOG)<NEW_LINE>Log.d(TAG, "request is dummy");<NEW_LINE>success = true;<NEW_LINE>} else {<NEW_LINE>if (MyDebug.LOG)<NEW_LINE>Log.e(TAG, "request is unknown type!");<NEW_LINE>success = false;<NEW_LINE>}<NEW_LINE>if (MyDebug.LOG) {<NEW_LINE>if (success)<NEW_LINE>Log.d(TAG, "ImageSaver thread successfully saved image");<NEW_LINE>else<NEW_LINE>Log.e(TAG, "ImageSaver thread failed to save image");<NEW_LINE>}<NEW_LINE>synchronized (this) {<NEW_LINE>n_images_to_save--;<NEW_LINE>if (MyDebug.LOG)<NEW_LINE>Log.d(TAG, "ImageSaver thread processed new request from queue, images to save is now: " + n_images_to_save);<NEW_LINE>if (MyDebug.LOG && n_images_to_save < 0) {<NEW_LINE>Log.e(TAG, "images to save has become negative");<NEW_LINE>throw new RuntimeException();<NEW_LINE>}<NEW_LINE>notifyAll();<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>if (MyDebug.LOG)<NEW_LINE>Log.e(TAG, "interrupted while trying to read from ImageSaver queue");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
Log.d(TAG, "request is raw");
518,853
private String buildAfterImageSQL(TableMeta tableMeta, TableRecords beforeImage) throws SQLException {<NEW_LINE>Set<String> updateColumnsSet = new HashSet<>();<NEW_LINE>for (SQLRecognizer recognizer : sqlRecognizers) {<NEW_LINE>sqlRecognizer = recognizer;<NEW_LINE>SQLUpdateRecognizer sqlUpdateRecognizer = (SQLUpdateRecognizer) sqlRecognizer;<NEW_LINE>updateColumnsSet.addAll(sqlUpdateRecognizer.getUpdateColumns());<NEW_LINE>}<NEW_LINE>StringBuilder prefix = new StringBuilder("SELECT ");<NEW_LINE>String suffix = " FROM " + getFromTableInSQL() + " WHERE " + SqlGenerateUtils.buildWhereConditionByPKs(tableMeta.getPrimaryKeyOnlyName(), beforeImage.pkRows().size(), getDbType());<NEW_LINE>StringJoiner selectSQLJoiner = new StringJoiner(", ", prefix.toString(), suffix);<NEW_LINE>if (ONLY_CARE_UPDATE_COLUMNS) {<NEW_LINE>if (!containsPK(new ArrayList<>(updateColumnsSet))) {<NEW_LINE>selectSQLJoiner.add(getColumnNamesInSQL(tableMeta.getEscapePkNameList(getDbType())));<NEW_LINE>}<NEW_LINE>for (String updateCol : updateColumnsSet) {<NEW_LINE>selectSQLJoiner.add(updateCol);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (String columnName : tableMeta.getAllColumns().keySet()) {<NEW_LINE>selectSQLJoiner.add(ColumnUtils.addEscape<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return selectSQLJoiner.toString();<NEW_LINE>}
(columnName, getDbType()));
489,393
public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {<NEW_LINE>String KEY = "GetQueryStringConfigurator";<NEW_LINE>String[] VALUES = { "ReadOnlyValue1", "ReadOnlyValue2" };<NEW_LINE>Map<String, List<String>> map = request.getHeaders();<NEW_LINE>System.out.println("BEFORE KEYS" + Arrays.toString(map.keySet<MASK><NEW_LINE>System.out.println("BEFORE VALUES" + Arrays.toString(map.values().toArray()));<NEW_LINE>try {<NEW_LINE>map.put(KEY, Arrays.asList(VALUES));<NEW_LINE>} catch (Exception e) {<NEW_LINE>// e.printStackTrace();<NEW_LINE>}<NEW_LINE>map = request.getHeaders();<NEW_LINE>System.out.println("KEYS" + Arrays.toString(map.keySet().toArray()));<NEW_LINE>System.out.println("VALUES" + Arrays.toString(map.values().toArray()));<NEW_LINE>response.getHeaders().putAll(map);<NEW_LINE>System.out.println("AFTER KEYS" + Arrays.toString(map.keySet().toArray()));<NEW_LINE>System.out.println("AFTER VALUES" + Arrays.toString(map.values().toArray()));<NEW_LINE>}
().toArray()));
15,957
public void start() {<NEW_LINE>// TEST: SWIPEABLE CONTAINER ALSO SWIPES UNDERLYING CONTAINER AS WELL<NEW_LINE>Form hi = new Form("Welcome", new BorderLayout());<NEW_LINE>Container list = new Container(BoxLayout.y());<NEW_LINE>for (int i = 0; i < 20; i++) {<NEW_LINE>SwipeableContainer swip = new SwipeableContainer(null, new Label("SWIPE"), new Label("ListElement " + i + " + a lot of fill text to make the element span over several lines so the dragging of the underlying Swipeable is normally noticeable"));<NEW_LINE>list.add(swip);<NEW_LINE>}<NEW_LINE>list.setScrollableY(true);<NEW_LINE>Container cont = hi.getContentPane();<NEW_LINE>cont.<MASK><NEW_LINE>SwipeableContainer swip = new SwipeableContainer(null, new SpanLabel("SOUTHSWIPE"), new SpanLabel("SOUTH CONTAINER"));<NEW_LINE>cont.add(BorderLayout.SOUTH, swip);<NEW_LINE>hi.show();<NEW_LINE>}
add(BorderLayout.CENTER, list);
1,740,052
private void doRenderWearable(EntityRobot entity, TextureManager textureManager, ItemStack wearable) {<NEW_LINE>if (wearable.getItem() instanceof IRobotOverlayItem) {<NEW_LINE>((IRobotOverlayItem) wearable.getItem()).renderRobotOverlay(wearable, textureManager);<NEW_LINE>} else if (wearable.getItem() instanceof ItemArmor) {<NEW_LINE>GL11.glPushMatrix();<NEW_LINE>GL11.glScalef(1.0125F, 1.0125F, 1.0125F);<NEW_LINE>GL11.glTranslatef(0.0f, -0.25f, 0.0f);<NEW_LINE>GL11.glRotatef(180F, 0, 0, 1);<NEW_LINE>int color = wearable.getItem().getColorFromItemStack(wearable, 0);<NEW_LINE>if (color != 16777215) {<NEW_LINE><MASK><NEW_LINE>GL11.glColor3ub((byte) (color >> 16), (byte) ((color >> 8) & 255), (byte) (color & 255));<NEW_LINE>}<NEW_LINE>textureManager.bindTexture(armorRenderer.getArmorResource(entity, wearable, 0, null));<NEW_LINE>ModelBiped armorModel = ForgeHooksClient.getArmorModel(entity, wearable, 0, null);<NEW_LINE>if (armorModel != null) {<NEW_LINE>armorModel.render(entity, 0, 0, 0, -90f, 0, 1 / 16F);<NEW_LINE>if (color != 16777215) {<NEW_LINE>GL11.glPopAttrib();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>GL11.glRotatef(-90.0f, 0.0f, 1.0f, 0.0f);<NEW_LINE>helmetBox.render(1 / 16F);<NEW_LINE>if (color != 16777215) {<NEW_LINE>String armorTexture = ForgeHooksClient.getArmorTexture(entity, wearable, "", 0, "overlay");<NEW_LINE>if (!StringUtils.isNullOrEmpty(armorTexture)) {<NEW_LINE>this.bindTexture(new ResourceLocation(armorTexture));<NEW_LINE>helmetBox.render(1 / 16F);<NEW_LINE>}<NEW_LINE>GL11.glPopAttrib();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>GL11.glPopMatrix();<NEW_LINE>} else if (wearable.getItem() instanceof ItemSkull) {<NEW_LINE>doRenderSkull(wearable);<NEW_LINE>}<NEW_LINE>}
GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT);
1,428,765
private void sendCloseSecureChannelRequest(ChannelHandlerContext ctx, CloseSecureChannelRequest request) {<NEW_LINE>serializationQueue.encode((binaryEncoder, chunkEncoder) -> {<NEW_LINE>ByteBuf messageBuffer = BufferUtil.pooledBuffer();<NEW_LINE>try {<NEW_LINE>binaryEncoder.setBuffer(messageBuffer);<NEW_LINE>binaryEncoder.writeMessage(null, request);<NEW_LINE>checkMessageSize(messageBuffer);<NEW_LINE>EncodedMessage encodedMessage = chunkEncoder.encodeSymmetric(secureChannel, requestIdSequence.getAndIncrement(<MASK><NEW_LINE>CompositeByteBuf chunkComposite = BufferUtil.compositeBuffer();<NEW_LINE>for (ByteBuf chunk : encodedMessage.getMessageChunks()) {<NEW_LINE>chunkComposite.addComponent(chunk);<NEW_LINE>chunkComposite.writerIndex(chunkComposite.writerIndex() + chunk.readableBytes());<NEW_LINE>}<NEW_LINE>ctx.writeAndFlush(chunkComposite).addListener(future -> ctx.close());<NEW_LINE>secureChannel.setChannelId(0);<NEW_LINE>} catch (MessageEncodeException e) {<NEW_LINE>logger.error("Error encoding {}: {}", request, e.getMessage(), e);<NEW_LINE>handshakeFuture.completeExceptionally(e);<NEW_LINE>ctx.close();<NEW_LINE>} catch (UaSerializationException e) {<NEW_LINE>logger.error("Error serializing {}: {}", request, e.getMessage(), e);<NEW_LINE>handshakeFuture.completeExceptionally(e);<NEW_LINE>ctx.close();<NEW_LINE>} finally {<NEW_LINE>messageBuffer.release();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
), messageBuffer, MessageType.CloseSecureChannel);
500,976
public void run(@Nonnull final ProgressIndicator indicator) {<NEW_LINE>final int size = zipFile.size();<NEW_LINE>final int[] counter = new int[] { 0 };<NEW_LINE>class MyFilter implements FilenameFilter {<NEW_LINE><NEW_LINE>private final Set<File> myImportantDirs = ContainerUtil.newHashSet(outputDir, new File(outputDir, "resources"));<NEW_LINE><NEW_LINE>private final boolean myImportantOnly;<NEW_LINE><NEW_LINE>private MyFilter(boolean importantOnly) {<NEW_LINE>myImportantOnly = importantOnly;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean accept(@Nonnull File dir, @Nonnull String name) {<NEW_LINE>indicator.checkCanceled();<NEW_LINE>boolean result = myImportantOnly == myImportantDirs.contains(dir);<NEW_LINE>if (result) {<NEW_LINE>indicator.setFraction(((double) counter[0]) / size);<NEW_LINE>counter[0]++;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE>ZipUtil.extract(zipFile, outputDir, new MyFilter(true));<NEW_LINE>ZipUtil.extract(zipFile, <MASK><NEW_LINE>FileUtil.writeToFile(timestampFile, currentTimestamp);<NEW_LINE>} finally {<NEW_LINE>zipFile.close();<NEW_LINE>}<NEW_LINE>} catch (IOException ignore) {<NEW_LINE>}<NEW_LINE>}
outputDir, new MyFilter(false));
791,109
static long doGetLen(Path path) {<NEW_LINE>HttpURLConnection headerConnection = null;<NEW_LINE>try {<NEW_LINE>headerConnection = (HttpURLConnection) path.toUri().toURL().openConnection();<NEW_LINE>headerConnection.setConnectTimeout(5000);<NEW_LINE>headerConnection.setRequestMethod("HEAD");<NEW_LINE>headerConnection.connect();<NEW_LINE>long contentLength = headerConnection.getContentLengthLong();<NEW_LINE>String <MASK><NEW_LINE>boolean splittable = acceptRanges != null && acceptRanges.equalsIgnoreCase("bytes");<NEW_LINE>LOG.info("contentLength of {}, acceptRanges of {} to download {}", contentLength, acceptRanges, path);<NEW_LINE>if (contentLength < 0) {<NEW_LINE>throw new RuntimeException("The content length can't be determined.");<NEW_LINE>}<NEW_LINE>// If the http server does not accept ranges, then we quit the program.<NEW_LINE>// This is because 'accept ranges' is required to achieve robustness (through re-connection),<NEW_LINE>// and efficiency (through concurrent read).<NEW_LINE>if (!splittable) {<NEW_LINE>throw new RuntimeException("The http server does not support range reading.");<NEW_LINE>}<NEW_LINE>return contentLength;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Fail to connect to http server", e);<NEW_LINE>} finally {<NEW_LINE>if (headerConnection != null) {<NEW_LINE>headerConnection.disconnect();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
acceptRanges = headerConnection.getHeaderField("Accept-Ranges");
103,431
public static GetIndustryInfoLineageListResponse unmarshall(GetIndustryInfoLineageListResponse getIndustryInfoLineageListResponse, UnmarshallerContext context) {<NEW_LINE>getIndustryInfoLineageListResponse.setRequestId(context.stringValue("GetIndustryInfoLineageListResponse.RequestId"));<NEW_LINE>List<IndustryInfoListItem> industryInfoList = new ArrayList<IndustryInfoListItem>();<NEW_LINE>for (int i = 0; i < context.lengthValue("GetIndustryInfoLineageListResponse.IndustryInfoList.Length"); i++) {<NEW_LINE>IndustryInfoListItem industryInfoListItem = new IndustryInfoListItem();<NEW_LINE>industryInfoListItem.setId(context.stringValue("GetIndustryInfoLineageListResponse.IndustryInfoList[" + i + "].Id"));<NEW_LINE>industryInfoListItem.setCode(context.stringValue("GetIndustryInfoLineageListResponse.IndustryInfoList[" + i + "].Code"));<NEW_LINE>industryInfoListItem.setName(context.stringValue("GetIndustryInfoLineageListResponse.IndustryInfoList[" + i + "].Name"));<NEW_LINE>industryInfoListItem.setLevel(context.stringValue<MASK><NEW_LINE>industryInfoList.add(industryInfoListItem);<NEW_LINE>}<NEW_LINE>getIndustryInfoLineageListResponse.setIndustryInfoList(industryInfoList);<NEW_LINE>return getIndustryInfoLineageListResponse;<NEW_LINE>}
("GetIndustryInfoLineageListResponse.IndustryInfoList[" + i + "].Level"));
347,994
private Snap findByStopId(GHStationLocation station, int indexForErrorMessage) {<NEW_LINE>for (Map.Entry<String, GTFSFeed> entry : gtfsStorage.getGtfsFeeds().entrySet()) {<NEW_LINE>final Integer node = gtfsStorage.getStationNodes().get(new GtfsStorage.FeedIdWithStopId(entry.getKey<MASK><NEW_LINE>if (node != null) {<NEW_LINE>Stop stop = gtfsStorage.getGtfsFeeds().get(entry.getKey()).stops.get(station.stop_id);<NEW_LINE>final Snap stationSnap = new Snap(stop.stop_lat, stop.stop_lon);<NEW_LINE>stationSnap.setClosestNode(node);<NEW_LINE>return stationSnap;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw new PointNotFoundException("Cannot find station: " + station.stop_id, indexForErrorMessage);<NEW_LINE>}
(), station.stop_id));
658,675
private void prepareNotes(StringBounder stringBounder, Notes notes, ParticipantRange range) {<NEW_LINE>final NotesBoxes notesBoxes = new NotesBoxes(freeY2.getFreeY(range));<NEW_LINE>for (Note n : notes) {<NEW_LINE>final NoteBox noteBox = createNoteBox(stringBounder, n, range);<NEW_LINE>final ParticipantBox p1 = drawableSet.getLivingParticipantBox(n.getParticipant()).getParticipantBox();<NEW_LINE>final ParticipantBox p2 = n.getParticipant2() == null ? null : drawableSet.getLivingParticipantBox(n.getParticipant2()).getParticipantBox();<NEW_LINE>notesBoxes.add(noteBox, p1, p2);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>inGroupableStack.addElement(notesBoxes);<NEW_LINE>drawableSet.addEvent(notes, notesBoxes);<NEW_LINE>freeY2 = freeY2.add(notesBoxes.getPreferredHeight(stringBounder), range);<NEW_LINE>}
notesBoxes.ensureConstraints(stringBounder, constraintSet);
1,537,441
public <T> T clone(T object) {<NEW_LINE>if (object instanceof JsonNode) {<NEW_LINE>return (T) ((JsonNode) object).deepCopy();<NEW_LINE>}<NEW_LINE>if (object instanceof Collection) {<NEW_LINE>Object firstElement <MASK><NEW_LINE>if (firstElement != null && !(firstElement instanceof Serializable)) {<NEW_LINE>JavaType type = TypeFactory.defaultInstance().constructParametricType(object.getClass(), firstElement.getClass());<NEW_LINE>return objectMapperWrapper.fromBytes(objectMapperWrapper.toBytes(object), type);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (object instanceof Map) {<NEW_LINE>Map.Entry firstEntry = this.findFirstNonNullEntry((Map) object);<NEW_LINE>if (firstEntry != null) {<NEW_LINE>Object key = firstEntry.getKey();<NEW_LINE>Object value = firstEntry.getValue();<NEW_LINE>if (!(key instanceof Serializable) || !(value instanceof Serializable)) {<NEW_LINE>JavaType type = TypeFactory.defaultInstance().constructParametricType(object.getClass(), key.getClass(), value.getClass());<NEW_LINE>return (T) objectMapperWrapper.fromBytes(objectMapperWrapper.toBytes(object), type);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (object instanceof Serializable) {<NEW_LINE>try {<NEW_LINE>return (T) SerializationHelper.clone((Serializable) object);<NEW_LINE>} catch (SerializationException e) {<NEW_LINE>// it is possible that object itself implements java.io.Serializable, but underlying structure does not<NEW_LINE>// in this case we switch to the other JSON marshaling strategy which doesn't use the Java serialization<NEW_LINE>return jsonClone(object);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return jsonClone(object);<NEW_LINE>}<NEW_LINE>}
= findFirstNonNullElement((Collection) object);
1,537,363
public void onOpen(CoreSession coreSession, Callback callback) {<NEW_LINE>try {<NEW_LINE>customizer.customize(coreSession);<NEW_LINE>this.coreSession = coreSession;<NEW_LINE>session = new WebSocketSession(container, coreSession, this);<NEW_LINE>if (!session.isOpen())<NEW_LINE>throw new IllegalStateException("Session is not open");<NEW_LINE>frameHandle = InvokerUtils.bindTo(frameHandle, session);<NEW_LINE>openHandle = InvokerUtils.bindTo(openHandle, session);<NEW_LINE>closeHandle = InvokerUtils.bindTo(closeHandle, session);<NEW_LINE>errorHandle = InvokerUtils.bindTo(errorHandle, session);<NEW_LINE>textHandle = InvokerUtils.bindTo(textHandle, session);<NEW_LINE>binaryHandle = InvokerUtils.bindTo(binaryHandle, session);<NEW_LINE>pingHandle = InvokerUtils.bindTo(pingHandle, session);<NEW_LINE>pongHandle = InvokerUtils.bindTo(pongHandle, session);<NEW_LINE>Executor executor = container.getExecutor();<NEW_LINE>if (textHandle != null)<NEW_LINE>textSink = JettyWebSocketFrameHandlerFactory.createMessageSink(textHandle, textSinkClass, executor, session);<NEW_LINE>if (binaryHandle != null)<NEW_LINE>binarySink = JettyWebSocketFrameHandlerFactory.createMessageSink(binaryHandle, binarySinkClass, executor, session);<NEW_LINE>if (openHandle != null)<NEW_LINE>openHandle.invoke();<NEW_LINE>if (session.isOpen())<NEW_LINE>container.notifySessionListeners((listener) <MASK><NEW_LINE>callback.succeeded();<NEW_LINE>demand();<NEW_LINE>} catch (Throwable cause) {<NEW_LINE>callback.failed(new WebSocketException(endpointInstance.getClass().getSimpleName() + " OPEN method error: " + cause.getMessage(), cause));<NEW_LINE>}<NEW_LINE>}
-> listener.onWebSocketSessionOpened(session));
1,124,427
public void eventDispatched(AWTEvent event) {<NEW_LINE>if (!isShown()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MouseEvent mouseEvent = (MouseEvent) event;<NEW_LINE>if (mouseEvent.getClickCount() == 0 && !(event instanceof MouseWheelEvent)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final int id = mouseEvent.getID();<NEW_LINE>if (id != MouseEvent.MOUSE_PRESSED && id != MouseEvent.MOUSE_RELEASED && id != MouseEvent.MOUSE_CLICKED && id != MouseEvent.MOUSE_WHEEL) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Component sourceComponent = mouseEvent.getComponent();<NEW_LINE>final Point originalPoint = mouseEvent.getPoint();<NEW_LINE>final Editor editor = getEditor();<NEW_LINE>if (editor == null)<NEW_LINE>return;<NEW_LINE>Project project = editor.getProject();<NEW_LINE>LookupImpl activeLookup = project != null ? (LookupImpl) LookupManager.getInstance(project).getActiveLookup() : null;<NEW_LINE>if (activeLookup != null) {<NEW_LINE>final Point lookupPoint = SwingUtilities.convertPoint(sourceComponent, originalPoint, activeLookup.getComponent());<NEW_LINE>if (activeLookup.getComponent().getBounds().contains(lookupPoint)) {<NEW_LINE>// mouse click inside lookup<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>// hide popup on mouse position changed<NEW_LINE>activeLookup.hide();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// do not cancel editing if we click in editor popup<NEW_LINE>final List<JBPopup> popups = JBPopupFactory.<MASK><NEW_LINE>for (JBPopup popup : popups) {<NEW_LINE>if (SwingUtilities.isDescendingFrom(sourceComponent, popup.getContent())) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Point point = SwingUtilities.convertPoint(sourceComponent, originalPoint, myInplaceEditorComponent);<NEW_LINE>if (myInplaceEditorComponent.contains(point)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Component componentAtPoint = SwingUtilities.getDeepestComponentAt(sourceComponent, originalPoint.x, originalPoint.y);<NEW_LINE>for (Component comp = componentAtPoint; comp != null; comp = comp.getParent()) {<NEW_LINE>if (comp instanceof ComboPopup) {<NEW_LINE>if (id != MouseEvent.MOUSE_WHEEL) {<NEW_LINE>doPopupOKAction();<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cancelEditing();<NEW_LINE>}
getInstance().getChildPopups(myInplaceEditorComponent);
790,541
public StackTraceElement apply(Map<String, Object> frameInfo) {<NEW_LINE>if (frameInfo == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Optional<Number> maybeLineNumberInteger = Optional.empty();<NEW_LINE>final Object lineNumberObject = frameInfo.get(LINE_NUMBER);<NEW_LINE>if (lineNumberObject instanceof Number) {<NEW_LINE>maybeLineNumberInteger = Optional.of((Number) lineNumberObject);<NEW_LINE>} else if (lineNumberObject != null) {<NEW_LINE>// might be a Number as a String<NEW_LINE>maybeLineNumberInteger = Optional.ofNullable(Ints.tryParse(lineNumberObject.toString()));<NEW_LINE>}<NEW_LINE>// default -1 for unknown, see StackTraceElement constructor javadoc<NEW_LINE>final int lineNumber = maybeLineNumberInteger.orElse(-1).intValue();<NEW_LINE>// Gracefully handle remote servers that don't (or can't) send back<NEW_LINE>// complete stack trace info. At least some of this information should<NEW_LINE>// be included...<NEW_LINE>String className = frameInfo.containsKey(CLASS_NAME) ? toStringOrNull(frameInfo.get(CLASS_NAME)) : UNKNOWN_CLASS;<NEW_LINE>String methodName = frameInfo.containsKey(METHOD_NAME) ? toStringOrNull(frameInfo.get(METHOD_NAME)) : UNKNOWN_METHOD;<NEW_LINE>String fileName = frameInfo.containsKey(FILE_NAME) ? toStringOrNull(frameInfo.get(FILE_NAME)) : UNKNOWN_FILE;<NEW_LINE>return new StackTraceElement(<MASK><NEW_LINE>}
className, methodName, fileName, lineNumber);
477,235
protected void replayAddEvents(DebuggerModelListener listener, SpiTargetObject object, Set<SpiTargetObject> visited) {<NEW_LINE>if (!visited.add(object)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<String, ?> cbAttributes = object.getCallbackAttributes();<NEW_LINE>if (cbAttributes != null) {<NEW_LINE>for (Object val : cbAttributes.values()) {<NEW_LINE>if (!(val instanceof TargetObject)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>assert val instanceof SpiTargetObject;<NEW_LINE>replayAddEvents(listener, (SpiTargetObject) val, visited);<NEW_LINE>}<NEW_LINE>if (!cbAttributes.isEmpty()) {<NEW_LINE>replayed(listener, () -> listener.attributesChanged(object, List.of(), Map.copyOf(cbAttributes)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<String, ? extends TargetObject> cbElements = object.getCallbackElements();<NEW_LINE>if (cbElements != null) {<NEW_LINE>for (TargetObject elem : cbElements.values()) {<NEW_LINE>assert elem instanceof SpiTargetObject;<NEW_LINE>replayAddEvents(listener<MASK><NEW_LINE>}<NEW_LINE>if (!cbElements.isEmpty()) {<NEW_LINE>replayed(listener, () -> listener.elementsChanged(object, List.of(), Map.copyOf(cbElements)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, (SpiTargetObject) elem, visited);
177,787
private void rotateLocalSessionKeys() throws OtrException {<NEW_LINE>if (Debug.DEBUG_ENABLED)<NEW_LINE>Log.d(ImApp.LOG_TAG, "Rotating local keys.");<NEW_LINE>SessionKeys sess1 = getSessionKeysByIndex(SessionKeys.Previous, SessionKeys.Current);<NEW_LINE>if (sess1.getIsUsedReceivingMACKey()) {<NEW_LINE>if (Debug.DEBUG_ENABLED)<NEW_LINE>Log.d(ImApp.LOG_TAG, "Detected used Receiving MAC key. Adding to old MAC keys to reveal it.");<NEW_LINE>getOldMacKeys().add(sess1.getReceivingMACKey());<NEW_LINE>}<NEW_LINE>SessionKeys sess2 = getSessionKeysByIndex(SessionKeys.Previous, SessionKeys.Previous);<NEW_LINE>if (sess2.getIsUsedReceivingMACKey()) {<NEW_LINE>if (Debug.DEBUG_ENABLED)<NEW_LINE>Log.d(ImApp.LOG_TAG, "Detected used Receiving MAC key. Adding to old MAC keys to reveal it.");<NEW_LINE>getOldMacKeys().add(sess2.getReceivingMACKey());<NEW_LINE>}<NEW_LINE>SessionKeys sess3 = getSessionKeysByIndex(SessionKeys.Current, SessionKeys.Current);<NEW_LINE>sess1.setLocalPair(sess3.getLocalPair(<MASK><NEW_LINE>SessionKeys sess4 = getSessionKeysByIndex(SessionKeys.Current, SessionKeys.Previous);<NEW_LINE>sess2.setLocalPair(sess4.getLocalPair(), sess4.getLocalKeyID());<NEW_LINE>KeyPair newPair = new OtrCryptoEngineImpl().generateDHKeyPair();<NEW_LINE>sess3.setLocalPair(newPair, sess3.getLocalKeyID() + 1);<NEW_LINE>sess4.setLocalPair(newPair, sess4.getLocalKeyID() + 1);<NEW_LINE>}
), sess3.getLocalKeyID());
865,629
public static int compareSemanticVersions(String v1, String v2) throws IllegalArgumentException {<NEW_LINE>if (StringUtils.isAnyEmpty(v1, v2)) {<NEW_LINE>throw new IllegalArgumentException(String.format<MASK><NEW_LINE>}<NEW_LINE>if (!isSemanticVersion(v1)) {<NEW_LINE>throw new IllegalArgumentException(String.format("Invalid version format, %s. Semantic version should be specified in MAJOR.MINOR.PATCH format", v1));<NEW_LINE>}<NEW_LINE>if (!isSemanticVersion(v2)) {<NEW_LINE>throw new IllegalArgumentException(String.format("Invalid version format, %s. Semantic version should be specified in MAJOR.MINOR.PATCH format", v2));<NEW_LINE>}<NEW_LINE>String[] thisParts = v1.split("\\.");<NEW_LINE>String[] thatParts = v2.split("\\.");<NEW_LINE>int length = Math.max(thisParts.length, thatParts.length);<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>int thisPart = i < thisParts.length ? Integer.parseInt(thisParts[i]) : 0;<NEW_LINE>int thatPart = i < thatParts.length ? Integer.parseInt(thatParts[i]) : 0;<NEW_LINE>if (thisPart < thatPart)<NEW_LINE>return -1;<NEW_LINE>if (thisPart > thatPart)<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>return 0;<NEW_LINE>}
("Invalid version comparision with versions %s, %s", v1, v2));
1,676,112
private void fetchRequests(RequestRegistrationCallback<GetOperation> requestRegistrationCallback) {<NEW_LINE>Iterator<ReplicaId> replicaIterator = chunkOperationTracker.getReplicaIterator();<NEW_LINE>while (replicaIterator.hasNext()) {<NEW_LINE>ReplicaId replicaId = replicaIterator.next();<NEW_LINE>replicaIterator.remove();<NEW_LINE>String hostname = replicaId.getDataNodeId().getHostname();<NEW_LINE>Port port = RouterUtils.getPortToConnectTo(replicaId, routerConfig.routerEnableHttp2NetworkClient);<NEW_LINE>GetRequest getRequest = createGetRequest(chunkBlobId, getOperationFlag(), getGetOption());<NEW_LINE>RequestInfo request = new RequestInfo(hostname, port, <MASK><NEW_LINE>int correlationId = getRequest.getCorrelationId();<NEW_LINE>correlationIdToGetRequestInfo.put(correlationId, new GetRequestInfo(replicaId, time.milliseconds()));<NEW_LINE>correlationIdToGetChunk.put(correlationId, this);<NEW_LINE>requestRegistrationCallback.registerRequestToSend(GetBlobOperation.this, request);<NEW_LINE>if (RouterUtils.isRemoteReplica(routerConfig, replicaId)) {<NEW_LINE>logger.trace("Making request with correlationId {} to a remote replica {} in {} ", correlationId, replicaId.getDataNodeId(), replicaId.getDataNodeId().getDatacenterName());<NEW_LINE>routerMetrics.crossColoRequestCount.inc();<NEW_LINE>} else {<NEW_LINE>logger.trace("Making request with correlationId {} to a local replica {}", correlationId, replicaId.getDataNodeId());<NEW_LINE>}<NEW_LINE>routerMetrics.getDataNodeBasedMetrics(replicaId.getDataNodeId()).getRequestRate.mark();<NEW_LINE>routerMetrics.routerGetRequestRate.mark();<NEW_LINE>state = ChunkState.InProgress;<NEW_LINE>}<NEW_LINE>}
getRequest, replicaId, prepareQuotaCharger());
1,140,187
public final boolean reverseConversions(boolean executeInReverseOrder, Object[] row, NormalizedString[] headers, int[] indexesToWrite) {<NEW_LINE>boolean keepRow = true;<NEW_LINE>boolean[] convertedFlags = conversionsByType != null ? new <MASK><NEW_LINE>if (conversions != null) {<NEW_LINE>if (!conversionsInitialized) {<NEW_LINE>conversionsInitialized = true;<NEW_LINE>conversions.prepareExecution(true, headers != null ? NormalizedString.toArray(headers) : new String[row.length]);<NEW_LINE>this.fieldIndexes = indexesToWrite;<NEW_LINE>}<NEW_LINE>if (executeInReverseOrder) {<NEW_LINE>keepRow = validateAllValues(row);<NEW_LINE>}<NEW_LINE>final int last = fieldIndexes == null ? row.length : fieldIndexes.length;<NEW_LINE>for (int i = 0; i < last; i++) {<NEW_LINE>try {<NEW_LINE>if (fieldIndexes == null || fieldIndexes[i] == -1) {<NEW_LINE>row[i] = conversions.reverseConversions(executeInReverseOrder, i, row[i], convertedFlags);<NEW_LINE>} else {<NEW_LINE>int index = fieldIndexes[i];<NEW_LINE>row[index] = conversions.reverseConversions(executeInReverseOrder, index, row[index], convertedFlags);<NEW_LINE>}<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>keepRow = handleConversionError(ex, row, i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (keepRow && convertedFlags != null) {<NEW_LINE>keepRow = applyConversionsByType(true, row, convertedFlags);<NEW_LINE>}<NEW_LINE>if (executeInReverseOrder) {<NEW_LINE>return keepRow;<NEW_LINE>}<NEW_LINE>return keepRow && validateAllValues(row);<NEW_LINE>}
boolean[row.length] : null;
1,290,848
public JsonNode transformResponse(JsonNode response, MethodConfig methodConfig) {<NEW_LINE>if (response == null) {<NEW_LINE>throw new AppsmithPluginException(AppsmithPluginError.PLUGIN_ERROR, "Missing a valid response object.");<NEW_LINE>}<NEW_LINE>ArrayNode valueRanges = (ArrayNode) response.get("valueRanges");<NEW_LINE>ArrayNode headers = (ArrayNode) valueRanges.get(0).get("values");<NEW_LINE>ArrayNode values = (ArrayNode) valueRanges.get<MASK><NEW_LINE>if (headers == null || values == null || headers.isEmpty()) {<NEW_LINE>return this.objectMapper.createArrayNode();<NEW_LINE>}<NEW_LINE>int valueSize = 0;<NEW_LINE>for (int i = 0; i < values.size(); i++) {<NEW_LINE>valueSize = Math.max(valueSize, values.get(i).size());<NEW_LINE>}<NEW_LINE>final String valueRange = valueRanges.get(1).get("range").asText();<NEW_LINE>headers = (ArrayNode) headers.get(0);<NEW_LINE>Set<String> columnsSet = sanitizeHeaders(headers, valueSize);<NEW_LINE>final List<Map<String, String>> collectedCells = new LinkedList<>();<NEW_LINE>final String[] headerArray = columnsSet.toArray(new String[0]);<NEW_LINE>final Matcher matcher = findOffsetRowPattern.matcher(valueRange);<NEW_LINE>matcher.find();<NEW_LINE>final int rowOffset = Integer.parseInt(matcher.group(1));<NEW_LINE>final int tableHeaderIndex = Integer.parseInt(methodConfig.getTableHeaderIndex());<NEW_LINE>for (int i = 0; i < values.size(); i++) {<NEW_LINE>ArrayNode row = (ArrayNode) values.get(i);<NEW_LINE>RowObject rowObject = new RowObject(headerArray, objectMapper.convertValue(row, String[].class), rowOffset - tableHeaderIndex + i - 1);<NEW_LINE>collectedCells.add(rowObject.getValueMap());<NEW_LINE>}<NEW_LINE>ArrayNode preFilteringResponse = this.objectMapper.valueToTree(collectedCells);<NEW_LINE>if (isWhereConditionConfigured(methodConfig)) {<NEW_LINE>return filterDataService.filterData(preFilteringResponse, methodConfig.getWhereConditions(), getDataTypeConversionMap());<NEW_LINE>}<NEW_LINE>return preFilteringResponse;<NEW_LINE>}
(1).get("values");
1,704,804
public void marshall(PhoneNumberInformation phoneNumberInformation, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (phoneNumberInformation == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getPhoneNumberArn(), PHONENUMBERARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getPhoneNumber(), PHONENUMBER_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getStatus(), STATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getIsoCountryCode(), ISOCOUNTRYCODE_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getMessageType(), MESSAGETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getNumberCapabilities(), NUMBERCAPABILITIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getNumberType(), NUMBERTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getMonthlyLeasingPrice(), MONTHLYLEASINGPRICE_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getTwoWayEnabled(), TWOWAYENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getTwoWayChannelArn(), TWOWAYCHANNELARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getSelfManagedOptOutsEnabled(), SELFMANAGEDOPTOUTSENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getOptOutListName(), OPTOUTLISTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getDeletionProtectionEnabled(), DELETIONPROTECTIONENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getPoolId(), POOLID_BINDING);<NEW_LINE>protocolMarshaller.marshall(phoneNumberInformation.getCreatedTimestamp(), CREATEDTIMESTAMP_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
phoneNumberInformation.getPhoneNumberId(), PHONENUMBERID_BINDING);
478,390
protected void initialize(String role, Offer offer, TradeModel tradeModel, PrivateNotificationManager privateNotificationManager, boolean useDevPrivilegeKeys) {<NEW_LINE>boolean hasTraded = numTrades > 0;<NEW_LINE>Tuple5<Long, Long, String, String, String> peersAccount = getPeersAccountAge(tradeModel, offer);<NEW_LINE>Long accountAge = peersAccount.first;<NEW_LINE>Long signAge = peersAccount.second;<NEW_LINE>tooltipText = hasTraded ? Res.get("peerInfoIcon.tooltip.trade.traded", role, fullAddress, numTrades, getAccountAgeTooltip(accountAge)) : Res.get("peerInfoIcon.tooltip.trade.notTraded", role, fullAddress, getAccountAgeTooltip(accountAge));<NEW_LINE>createAvatar(getRingColor(offer<MASK><NEW_LINE>addMouseListener(numTrades, privateNotificationManager, tradeModel, offer, preferences, useDevPrivilegeKeys, isFiatCurrency, accountAge, signAge, peersAccount.third, peersAccount.fourth, peersAccount.fifth);<NEW_LINE>}
, tradeModel, accountAge, signAge));
635,989
public InstanceOfferingInventory createInstanceOffering(InstanceOfferingVO vo, APICreateInstanceOfferingMsg msg) {<NEW_LINE>return new SQLBatchWithReturn<VirtualRouterOfferingInventory>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected VirtualRouterOfferingInventory scripts() {<NEW_LINE>VirtualRouterOfferingVO rvo = new VirtualRouterOfferingVO(vo);<NEW_LINE>APICreateVirtualRouterOfferingMsg amsg = (APICreateVirtualRouterOfferingMsg) msg;<NEW_LINE>rvo.setManagementNetworkUuid(amsg.getManagementNetworkUuid());<NEW_LINE>rvo.setPublicNetworkUuid(amsg.getPublicNetworkUuid());<NEW_LINE>rvo.setZoneUuid(amsg.getZoneUuid());<NEW_LINE>rvo.setImageUuid(amsg.getImageUuid());<NEW_LINE>rvo.setAccountUuid(msg.getSession().getAccountUuid());<NEW_LINE>rvo.setDefault(amsg.isDefault() != null ? amsg.isDefault() : false);<NEW_LINE>persist(rvo);<NEW_LINE>reload(rvo);<NEW_LINE>DefaultVirtualRouterOfferingSelector selector = new DefaultVirtualRouterOfferingSelector();<NEW_LINE>selector.setOfferingUuid(rvo.getUuid());<NEW_LINE>selector.setZoneUuid(rvo.getZoneUuid());<NEW_LINE>selector.setPreferToBeDefault(amsg.isDefault());<NEW_LINE>selector.setCreated(true);<NEW_LINE>selector.selectDefaultOffering();<NEW_LINE>return VirtualRouterOfferingInventory<MASK><NEW_LINE>}<NEW_LINE>}.execute();<NEW_LINE>}
.valueOf(reload(rvo));
1,246,381
public WritableMap toJSObject(Device value) {<NEW_LINE>WritableMap result = Arguments.createMap();<NEW_LINE>result.putString(Metadata.ID, value.getId());<NEW_LINE>result.putString(Metadata.NAME, value.getName());<NEW_LINE>if (value.getRssi() != null) {<NEW_LINE>result.putInt(Metadata.RSSI, value.getRssi());<NEW_LINE>} else {<NEW_LINE>result.putNull(Metadata.RSSI);<NEW_LINE>}<NEW_LINE>if (value.getMtu() != null) {<NEW_LINE>result.putInt(Metadata.MTU, value.getMtu());<NEW_LINE>} else {<NEW_LINE>result.putNull(Metadata.MTU);<NEW_LINE>}<NEW_LINE>// Advertisement data is not set<NEW_LINE>result.putNull(Metadata.MANUFACTURER_DATA);<NEW_LINE>result.putNull(Metadata.SERVICE_DATA);<NEW_LINE><MASK><NEW_LINE>result.putNull(Metadata.LOCAL_NAME);<NEW_LINE>result.putNull(Metadata.TX_POWER_LEVEL);<NEW_LINE>result.putNull(Metadata.SOLICITED_SERVICE_UUIDS);<NEW_LINE>result.putNull(Metadata.IS_CONNECTABLE);<NEW_LINE>result.putNull(Metadata.OVERFLOW_SERVICE_UUIDS);<NEW_LINE>return result;<NEW_LINE>}
result.putNull(Metadata.SERVICE_UUIDS);
293,549
public Map<String, Object> obtainRequestToken(SocialLoginConfig config, String callbackUrl) {<NEW_LINE>String endpointUrl = config.getRequestTokenUrl();<NEW_LINE>try {<NEW_LINE>SocialUtil.validateEndpointWithQuery(endpointUrl);<NEW_LINE>} catch (SocialLoginException e) {<NEW_LINE>return createErrorResponse("TWITTER_BAD_REQUEST_TOKEN_URL", new Object[] { endpointUrl, TwitterLoginConfigImpl.KEY_requestTokenUrl, config.getUniqueId()<MASK><NEW_LINE>}<NEW_LINE>// Create the Authorization header string necessary to authenticate the request<NEW_LINE>String authzHeaderString = createAuthzHeaderForRequestTokenEndpoint(callbackUrl, endpointUrl);<NEW_LINE>if (tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "Authz header string: " + authzHeaderString);<NEW_LINE>}<NEW_LINE>return executeRequest(config, requestMethod, authzHeaderString, endpointUrl, TwitterConstants.TWITTER_ENDPOINT_REQUEST_TOKEN, null);<NEW_LINE>}
, e.getLocalizedMessage() });
1,851,596
private void updateButtons() {<NEW_LINE>LogicCircuitOperator operator = getSelectedOperator();<NEW_LINE>if (operator != null) {<NEW_LINE>int inputCount = operator.getArgumentCount();<NEW_LINE>int inputStart = 130 - (inputCount * 10 - 1);<NEW_LINE>if (inputCount < this.inputButtons.size()) {<NEW_LINE>Iterator<GuiButtonState<LogicCircuitRegister>> it = this.inputButtons.iterator();<NEW_LINE>int i = 0;<NEW_LINE>// Reposition buttons and remove excess<NEW_LINE>while (it.hasNext()) {<NEW_LINE><MASK><NEW_LINE>btn.x = leftPos + inputStart + 20 * i;<NEW_LINE>if (++i > inputCount) {<NEW_LINE>this.buttons.remove(btn);<NEW_LINE>this.children.remove(btn);<NEW_LINE>it.remove();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < inputCount; i++) {<NEW_LINE>if (// Reposition buttons<NEW_LINE>i < this.inputButtons.size())<NEW_LINE>this.inputButtons.get(i).x = leftPos + inputStart + 20 * i;<NEW_LINE>else<NEW_LINE>// Add new ones<NEW_LINE>this.inputButtons.add(this.addButton(new GuiButtonLogicCircuitRegister(leftPos + inputStart + 20 * i, topPos + 18, new TextComponent("Input " + (i + 1)), btn -> this.minecraft.tell(this::updateInstruction))));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
GuiButtonState btn = it.next();
438,602
public QueryNodeWithBindingSet optimize(final AST2BOpContext context, final QueryNodeWithBindingSet input) {<NEW_LINE>final IQueryNode queryNode = input.getQueryNode();<NEW_LINE>final IBindingSet[] bindingSets = input.getBindingSets();<NEW_LINE>if (!(queryNode instanceof QueryRoot))<NEW_LINE>return new QueryNodeWithBindingSet(queryNode, bindingSets);<NEW_LINE>final QueryRoot queryRoot = (QueryRoot) queryNode;<NEW_LINE>final StaticAnalysis sa = new StaticAnalysis(queryRoot, context);<NEW_LINE>final Set<IVariable<?>> exogenousVars = context.getSolutionSetStats().getUsedVars();<NEW_LINE>if (queryRoot.getNamedSubqueries() != null) {<NEW_LINE>for (NamedSubqueryRoot subqueryRoot : queryRoot.getNamedSubqueries()) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final GraphPatternGroup<IGroupMemberNode> whereClause = subqueryRoot.getWhereClause();<NEW_LINE>rewrite(sa, exogenousVars, subqueryRoot, whereClause);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final GraphPatternGroup<IGroupMemberNode> whereClause = queryRoot.getWhereClause();<NEW_LINE>if (whereClause == null) {<NEW_LINE>throw new RuntimeException("Missing where clause? : " + queryNode);<NEW_LINE>}<NEW_LINE>rewrite(<MASK><NEW_LINE>return new QueryNodeWithBindingSet(queryRoot, bindingSets);<NEW_LINE>}
sa, exogenousVars, queryRoot, whereClause);
1,799,033
private static Varnode expandVarnode(Varnode varnode, int sizeIncrease, VariableStorage curStorage, int newSize, DataType dataType, boolean alignStack, Function function) throws InvalidInputException {<NEW_LINE>Address addr = varnode.getAddress();<NEW_LINE>if (addr.isStackAddress()) {<NEW_LINE>return resizeStackVarnode(varnode, varnode.getSize() + sizeIncrease, curStorage, newSize, dataType, alignStack, function);<NEW_LINE>}<NEW_LINE>int size = varnode.getSize() + sizeIncrease;<NEW_LINE>boolean bigEndian = function.getProgram().getMemory().isBigEndian();<NEW_LINE>Register reg = function.<MASK><NEW_LINE>Address vnAddr = varnode.getAddress();<NEW_LINE>if (reg != null) {<NEW_LINE>// Register expansion<NEW_LINE>Register newReg = reg;<NEW_LINE>while ((newReg.getMinimumByteSize() < size)) {<NEW_LINE>newReg = newReg.getParentRegister();<NEW_LINE>if (newReg == null) {<NEW_LINE>throw new InvalidInputException("Storage can't be expanded to " + newSize + " bytes: " + curStorage.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>vnAddr = newReg.getAddress();<NEW_LINE>if (bigEndian) {<NEW_LINE>vnAddr = vnAddr.add(newReg.getMinimumByteSize() - size);<NEW_LINE>return new Varnode(vnAddr, size);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>boolean complexDt = (dataType instanceof Composite) || (dataType instanceof Array);<NEW_LINE>if (bigEndian && !complexDt) {<NEW_LINE>return new Varnode(vnAddr.subtract(sizeIncrease), size);<NEW_LINE>}<NEW_LINE>return new Varnode(vnAddr, size);<NEW_LINE>}
getProgram().getRegister(varnode);
1,405,862
public boolean isResponseAvailable(int timeout) throws IOException {<NEW_LINE>LOG.trace("enter HttpConnection.isResponseAvailable(int)");<NEW_LINE>if (!this.isOpen) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean result = false;<NEW_LINE>if (this.inputStream.available() > 0) {<NEW_LINE>result = true;<NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>this.socket.setSoTimeout(timeout);<NEW_LINE>inputStream.mark(1);<NEW_LINE>int byteRead = inputStream.read();<NEW_LINE>if (byteRead != -1) {<NEW_LINE>inputStream.reset();<NEW_LINE>LOG.debug("Input data available");<NEW_LINE>result = true;<NEW_LINE>} else {<NEW_LINE>LOG.debug("Input data not available");<NEW_LINE>}<NEW_LINE>} catch (InterruptedIOException e) {<NEW_LINE>if (!ExceptionUtil.isSocketTimeoutException(e)) {<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Input data not available after " + timeout + " ms");<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>socket.setSoTimeout(this.params.getSoTimeout());<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>LOG.<MASK><NEW_LINE>result = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
debug("An error ocurred while resetting soTimeout, we will assume that" + " no response is available.", ioe);
461,439
public void check(Configuration configuration) throws ConfigurationException {<NEW_LINE>for (ConfigurationField field : fields.values()) {<NEW_LINE>if (field.isOptional().equals(ConfigurationField.Optional.NOT_OPTIONAL)) {<NEW_LINE>final String type = field.getFieldType();<NEW_LINE>final String fieldName = field.getName();<NEW_LINE>log.debug("Checking for mandatory field \"{}\" of type {} in configuration", fieldName, type);<NEW_LINE>switch(type) {<NEW_LINE>case BooleanField.FIELD_TYPE:<NEW_LINE>if (!configuration.booleanIsSet(fieldName)) {<NEW_LINE>throw new ConfigurationException("Mandatory configuration field \"" + fieldName + "\" is missing or has the wrong data type");<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case NumberField.FIELD_TYPE:<NEW_LINE>if (!configuration.intIsSet(fieldName)) {<NEW_LINE>throw new ConfigurationException("Mandatory configuration field \"" + fieldName + "\" is missing or has the wrong data type");<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case ListField.FIELD_TYPE:<NEW_LINE>if (!configuration.listIsSet(fieldName)) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case TextField.FIELD_TYPE:<NEW_LINE>case DropdownField.FIELD_TYPE:<NEW_LINE>if (!configuration.stringIsSet(fieldName)) {<NEW_LINE>throw new ConfigurationException("Mandatory configuration field \"" + fieldName + "\" is missing or has the wrong data type");<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unknown field type " + type + " for configuration field \"" + fieldName + "\". This is a bug.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ConfigurationException("Mandatory configuration field \"" + fieldName + "\" is missing or has the wrong data type");
890,979
private static OperandTreeNode createNewOperand(final INaviModule module, final ICodeNodeProvider dataset) throws ParserException {<NEW_LINE>final int expressionId = dataset.getExpressionTreeId();<NEW_LINE>final int type = dataset.getExpressionTreeType();<NEW_LINE>final String value = getValue(dataset, type);<NEW_LINE>final <MASK><NEW_LINE>final String replacementString = dataset.getReplacement();<NEW_LINE>final IAddress functionAddress = dataset.getFunctionAddress();<NEW_LINE>final Integer typeId = dataset.getSubstitutionTypeId();<NEW_LINE>RawTypeSubstitution substitution = null;<NEW_LINE>if (typeId != null) {<NEW_LINE>substitution = new RawTypeSubstitution(dataset.getInstructionAddress(), dataset.getSubstitutionPosition(), expressionId, typeId, dataset.getSubstitutionPath(), dataset.getSubstitutionOffset());<NEW_LINE>}<NEW_LINE>final Integer instanceId = dataset.getTypeInstanceId() == null ? null : dataset.getTypeInstanceId();<NEW_LINE>final int operandPosition = dataset.getOperandPosition();<NEW_LINE>final IAddress address = dataset.getInstructionAddress();<NEW_LINE>// The function parse references moves the dataset around quite heavily therefore all direct<NEW_LINE>// access to the dataset must be done before.<NEW_LINE>final List<CReference> references = parseReferences(expressionId, dataset);<NEW_LINE>final INaviReplacement replacement = lookupReplacement(replacementString, module, functionAddress);<NEW_LINE>return new OperandTreeNode(expressionId, type, value, getParentId(parentId), replacement, references, substitution, instanceId, operandPosition, address);<NEW_LINE>}
Integer parentId = dataset.getParentId();
1,497,447
static void stats(List<String> paragraphs) {<NEW_LINE>int paragraphCounter = 0;<NEW_LINE>int sentenceCounter = 0;<NEW_LINE>int tokenCounter = 0;<NEW_LINE>int tokenNoPunctCounter = 0;<NEW_LINE>int tokenWordCounter = 0;<NEW_LINE>for (String paragraph : paragraphs) {<NEW_LINE>List<String> sentences = TurkishSentenceExtractor.DEFAULT.fromParagraph(paragraph);<NEW_LINE>sentenceCounter += sentences.size();<NEW_LINE>for (String sentence : sentences) {<NEW_LINE>List<Token> tokens = TurkishTokenizer.DEFAULT.tokenize(sentence);<NEW_LINE>for (Token token : tokens) {<NEW_LINE>if (token.getType() != Token.Type.Punctuation) {<NEW_LINE>tokenNoPunctCounter++;<NEW_LINE>}<NEW_LINE>if (token.getType() == Token.Type.PercentNumeral || token.getType() == Token.Type.Number || token.getType() == Token.Type.Punctuation || token.getType() == Token.Type.RomanNumeral || token.getType() == Token.Type.Email || token.getType() == Token.Type.HashTag || token.getType() == Token.Type.Emoticon || token.getType() == Token.Type.Time || token.getType() == Token.Type.Date || token.getType() == Token.Type.URL || token.getType() == Token.Type.UnknownWord || token.getType() == Token.Type.Unknown) {<NEW_LINE>tokenCounter++;<NEW_LINE>} else {<NEW_LINE>tokenCounter++;<NEW_LINE>tokenWordCounter++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>paragraphCounter++;<NEW_LINE>if (paragraphCounter % 1000 == 0) {<NEW_LINE>System.out.println(paragraphCounter + " of " + paragraphs.size());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println("sentenceCounter = " + sentenceCounter);<NEW_LINE>System.<MASK><NEW_LINE>System.out.println("tokenNoPunctCounter = " + tokenNoPunctCounter);<NEW_LINE>System.out.println("tokenWordCounter = " + tokenWordCounter);<NEW_LINE>}
out.println("tokenCounter = " + tokenCounter);
377,520
public static Object callMethodN(Object target, String methodN, Object[] params, Class<?>[] typeParams) throws Exception {<NEW_LINE>Method m = null;<NEW_LINE>m = findMethod(target.getClass(), methodN, typeParams);<NEW_LINE>if (m == null) {<NEW_LINE>debug("Can't find method " + methodN + " in " + target + " CLASS " + target.getClass());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Object o = <MASK><NEW_LINE>if (dbg > 0) {<NEW_LINE>// debug<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>sb.append("" + target.getClass().getName() + "." + methodN + "( ");<NEW_LINE>for (int i = 0; i < params.length; i++) {<NEW_LINE>if (i > 0)<NEW_LINE>sb.append(", ");<NEW_LINE>sb.append(params[i]);<NEW_LINE>}<NEW_LINE>sb.append(")");<NEW_LINE>debug(sb.toString());<NEW_LINE>}<NEW_LINE>return o;<NEW_LINE>}
m.invoke(target, params);
1,449,832
public <T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> TaskSchedule task(String id, Task13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> code, T1 arg1, T2 arg2, T3 arg3, T4 arg4, T5 arg5, T6 arg6, T7 arg7, T8 arg8, T9 arg9, T10 arg10, T11 arg11, T12 arg12, T13 arg13) {<NEW_LINE>checkTaskName(id);<NEW_LINE>TaskPackage taskPackage = TaskPackage.createPackage(id, code, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, <MASK><NEW_LINE>taskScheduleImpl.addTask(taskPackage);<NEW_LINE>return this;<NEW_LINE>}
arg10, arg11, arg12, arg13);
619,474
public void handleLineComment(int commentIndex) {<NEW_LINE>Token commentToken = this.tm.get(commentIndex);<NEW_LINE>boolean isOnFirstColumn = handleWhitespaceAround(commentIndex);<NEW_LINE>if (handleFormatOnOffTags(commentToken))<NEW_LINE>return;<NEW_LINE>if (isOnFirstColumn) {<NEW_LINE>if (this.options.comment_format_line_comment && !this.options.comment_format_line_comment_starting_on_first_column) {<NEW_LINE>this.lastLineComment = null;<NEW_LINE>commentToken.setIndent(0);<NEW_LINE>commentToken.setWrapPolicy(WrapPolicy.FORCE_FIRST_COLUMN);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (this.options.never_indent_line_comments_on_first_column) {<NEW_LINE>commentToken.setIndent(0);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>handleNLSTags(commentToken, commentIndex);<NEW_LINE>int positionInLine = this.tm.findSourcePositionInLine(commentToken.originalStart);<NEW_LINE>boolean isContinuation = commentIndex > 0 && this.tm.get(commentIndex - 1) == this.lastLineComment && (positionInLine >= this.lastLineCommentPosition - this.options.indentation_size + 1) && this.tm.countLineBreaksBetween(this.lastLineComment, commentToken) == 1;<NEW_LINE>boolean isHeader = this.tm.isInHeader(commentIndex);<NEW_LINE>boolean formattingEnabled = (this.options.comment_format_line_comment && !isHeader) || (this.options.comment_format_header && isHeader);<NEW_LINE>if (!formattingEnabled) {<NEW_LINE>preserveWhitespace(commentToken, commentIndex);<NEW_LINE>if (isContinuation) {<NEW_LINE>WrapPolicy policy = this.lastLineComment.getWrapPolicy();<NEW_LINE>if (policy == null) {<NEW_LINE>int lineStart = this.tm.getPositionInLine(this.tm.findFirstTokenInLine(commentIndex - 1));<NEW_LINE>int commentStart = this.tm.getPositionInLine(commentIndex - 1);<NEW_LINE>policy = new WrapPolicy(WrapMode.WHERE_NECESSARY, commentIndex - 1, commentStart - lineStart);<NEW_LINE>}<NEW_LINE>commentToken.setWrapPolicy(policy);<NEW_LINE>this.lastLineComment = commentToken;<NEW_LINE>} else if (commentToken.getLineBreaksBefore() == 0) {<NEW_LINE>this.lastLineComment = commentToken;<NEW_LINE>this.lastLineCommentPosition = positionInLine;<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<Token> structure = tokenizeLineComment(commentToken);<NEW_LINE>if (isContinuation) {<NEW_LINE>Token first = structure.get(0);<NEW_LINE>first.breakBefore();<NEW_LINE>first.setWrapPolicy(new WrapPolicy(WrapMode.WHERE_NECESSARY, commentIndex - 1, this.lastLineCommentPosition));<NEW_LINE>// merge previous and current line comment<NEW_LINE>Token previous = this.lastLineComment;<NEW_LINE>Token merged = new Token(previous, previous.originalStart, commentToken.originalEnd, previous.tokenType);<NEW_LINE>this.tm.remove(commentIndex - 1);<NEW_LINE>this.tm.insert(commentIndex - 1, merged);<NEW_LINE>this.tm.remove(commentIndex);<NEW_LINE>List<Token> lastStructure = this.lastLineComment.getInternalStructure();<NEW_LINE>lastStructure.addAll(structure);<NEW_LINE>merged.setInternalStructure(lastStructure);<NEW_LINE>this.lastLineComment = merged;<NEW_LINE>} else {<NEW_LINE>commentToken.setInternalStructure(structure);<NEW_LINE>handleCompilerTags(commentToken, commentIndex);<NEW_LINE>preserveWhitespace(commentToken, commentIndex);<NEW_LINE>this.lastLineComment = commentToken;<NEW_LINE>this.lastLineCommentPosition = positionInLine;<NEW_LINE>}<NEW_LINE>}
commentToken.setWrapPolicy(WrapPolicy.FORCE_FIRST_COLUMN);
100,587
public void applyCommits(ProcessorContext ctx) throws MemoryAccessException {<NEW_LINE>if (contextcommit.size() == 0)<NEW_LINE>return;<NEW_LINE>ContextCache contextCache = prototype.getContextCache();<NEW_LINE>ParserWalker walker = new ParserWalker(this);<NEW_LINE>walker.baseState();<NEW_LINE>for (int i = 0; i < contextcommit.size(); ++i) {<NEW_LINE>ContextSet set = contextcommit.get(i);<NEW_LINE>FixedHandle hand;<NEW_LINE>if (set.sym instanceof OperandSymbol) {<NEW_LINE>// value of OperandSymbol is already calculated, find right node<NEW_LINE>int ind = ((OperandSymbol) <MASK><NEW_LINE>hand = getFixedHandle(set.point.getSubState(ind));<NEW_LINE>} else {<NEW_LINE>hand = new FixedHandle();<NEW_LINE>set.sym.getFixedHandle(hand, walker);<NEW_LINE>}<NEW_LINE>// TODO: this is a hack. Addresses that are computed end up in the<NEW_LINE>// constant space and we must factor-in the wordsize.<NEW_LINE>long offset = hand.offset_offset;<NEW_LINE>AddressSpace curSpace = addr.getAddressSpace();<NEW_LINE>if (hand.space.getType() == AddressSpace.TYPE_CONSTANT) {<NEW_LINE>offset = offset * curSpace.getAddressableUnitSize();<NEW_LINE>}<NEW_LINE>Address address = curSpace.getAddress(offset);<NEW_LINE>contextCache.setContext(ctx, address, set.num, set.mask, set.value);<NEW_LINE>}<NEW_LINE>contextcommit.clear();<NEW_LINE>}
set.sym).getIndex();
732,698
protected void drawFiducial(Graphics2D gFrame, int cameraWidth, int cameraHeight, Location uppDefault, Location upp, Location fiducial) {<NEW_LINE>// Coordinates<NEW_LINE>double xc = (cameraWidth / 2.0) + fiducial.getX() / upp.getX();<NEW_LINE>double yc = (cameraHeight / 2.0) - fiducial.getY() / upp.getY();<NEW_LINE>double w <MASK><NEW_LINE>double h = 1.0 / upp.getY();<NEW_LINE>AffineTransform oldTx = gFrame.getTransform();<NEW_LINE>Point2D pt0 = new Point2D.Double(xc, yc);<NEW_LINE>Point2D pt1 = new Point2D.Double(xc + w, yc + h);<NEW_LINE>oldTx.transform(pt0, pt0);<NEW_LINE>oldTx.transform(pt1, pt1);<NEW_LINE>double dia = Math.sqrt(Math.pow(pt1.getX() - pt0.getX(), 2) + Math.pow(pt1.getY() - pt0.getY(), 2));<NEW_LINE>if (pt0.getX() + dia < 0 || pt1.getX() - dia > cameraWidth || pt0.getY() + dia < 0 || pt1.getY() - dia > cameraHeight) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AffineTransform tx = new AffineTransform(oldTx);<NEW_LINE>tx.translate(xc - w / 2, yc - h / 2);<NEW_LINE>if (upp == uppDefault) {<NEW_LINE>gFrame.setTransform(tx);<NEW_LINE>gFrame.setColor(Color.WHITE);<NEW_LINE>gFrame.fillOval(0, 0, (int) w, (int) h);<NEW_LINE>} else {<NEW_LINE>// Simulate focal blur<NEW_LINE>BufferedImage frame = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);<NEW_LINE>Graphics2D g = frame.createGraphics();<NEW_LINE>g.setTransform(tx);<NEW_LINE>// Clear with transparent background<NEW_LINE>g.setBackground(new Color(0, 0, 0, 0));<NEW_LINE>g.clearRect(-width / 2, -height / 2, width, height);<NEW_LINE>g.fillOval(0, 0, (int) w, (int) h);<NEW_LINE>blurObjectIntoView(gFrame, frame);<NEW_LINE>}<NEW_LINE>gFrame.setTransform(oldTx);<NEW_LINE>}
= 1.0 / upp.getX();
101,862
protected void removeImage() {<NEW_LINE>BoofSwingUtil.invokeNowOrLater(() -> {<NEW_LINE>int selected = imageListPanel.imageList.getSelectedIndex();<NEW_LINE>if (selected < 0)<NEW_LINE>return;<NEW_LINE>// If the image isn't "used" don't remove it<NEW_LINE>if (!imageListPanel.imageSuccess.get(selected))<NEW_LINE>return;<NEW_LINE>resultsInvalid = true;<NEW_LINE>// Mark it as not used in the UI<NEW_LINE>imageListPanel.imageSuccess.set(selected, false);<NEW_LINE>results.safe(() -> {<NEW_LINE>// Remove all points from this image, which will remove it from the active list<NEW_LINE>String image = results.imagePaths.get(selected);<NEW_LINE>results.getObservation(<MASK><NEW_LINE>// This image is no longer used for calibration<NEW_LINE>int usedIdx = results.usedImages.indexOf(selected);<NEW_LINE>if (usedIdx >= 0)<NEW_LINE>results.usedImages.remove(usedIdx);<NEW_LINE>});<NEW_LINE>// Visually show the changes<NEW_LINE>getCalibrationPanel().results = null;<NEW_LINE>configurePanel.bCompute.setEnabled(true);<NEW_LINE>getCalibrationPanel().repaint();<NEW_LINE>});<NEW_LINE>}
image).points.clear();
925,796
public static GetMediaDNAResultResponse unmarshall(GetMediaDNAResultResponse getMediaDNAResultResponse, UnmarshallerContext _ctx) {<NEW_LINE>getMediaDNAResultResponse.setRequestId(_ctx.stringValue("GetMediaDNAResultResponse.RequestId"));<NEW_LINE>DNAResult dNAResult = new DNAResult();<NEW_LINE>List<VideoDNAItem> videoDNA = new ArrayList<VideoDNAItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetMediaDNAResultResponse.DNAResult.VideoDNA.Length"); i++) {<NEW_LINE>VideoDNAItem videoDNAItem = new VideoDNAItem();<NEW_LINE>videoDNAItem.setPrimaryKey(_ctx.stringValue("GetMediaDNAResultResponse.DNAResult.VideoDNA[" + i + "].PrimaryKey"));<NEW_LINE>videoDNAItem.setSimilarity(_ctx.stringValue("GetMediaDNAResultResponse.DNAResult.VideoDNA[" + i + "].Similarity"));<NEW_LINE>List<DetailItem> detail = new ArrayList<DetailItem>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("GetMediaDNAResultResponse.DNAResult.VideoDNA[" + i + "].Detail.Length"); j++) {<NEW_LINE>DetailItem detailItem = new DetailItem();<NEW_LINE>Input input = new Input();<NEW_LINE>input.setStart(_ctx.stringValue("GetMediaDNAResultResponse.DNAResult.VideoDNA[" + i + "].Detail[" + j + "].Input.Start"));<NEW_LINE>input.setDuration(_ctx.stringValue("GetMediaDNAResultResponse.DNAResult.VideoDNA[" + i <MASK><NEW_LINE>detailItem.setInput(input);<NEW_LINE>Duplication duplication = new Duplication();<NEW_LINE>duplication.setStart(_ctx.stringValue("GetMediaDNAResultResponse.DNAResult.VideoDNA[" + i + "].Detail[" + j + "].Duplication.Start"));<NEW_LINE>duplication.setDuration(_ctx.stringValue("GetMediaDNAResultResponse.DNAResult.VideoDNA[" + i + "].Detail[" + j + "].Duplication.Duration"));<NEW_LINE>detailItem.setDuplication(duplication);<NEW_LINE>detail.add(detailItem);<NEW_LINE>}<NEW_LINE>videoDNAItem.setDetail(detail);<NEW_LINE>videoDNA.add(videoDNAItem);<NEW_LINE>}<NEW_LINE>dNAResult.setVideoDNA(videoDNA);<NEW_LINE>getMediaDNAResultResponse.setDNAResult(dNAResult);<NEW_LINE>return getMediaDNAResultResponse;<NEW_LINE>}
+ "].Detail[" + j + "].Input.Duration"));
463,823
private static void onCreate(@NonNull Context context, @NonNull NotificationManager notificationManager) {<NEW_LINE>NotificationChannelGroup messagesGroup = new NotificationChannelGroup(CATEGORY_MESSAGES, context.getResources().getString(R.string.NotificationChannel_group_chats));<NEW_LINE>notificationManager.createNotificationChannelGroup(messagesGroup);<NEW_LINE>NotificationChannel messages = new NotificationChannel(getMessagesChannel(context), context.getString(R.string.NotificationChannel_channel_messages), NotificationManager.IMPORTANCE_HIGH);<NEW_LINE>NotificationChannel calls = new NotificationChannel(CALLS, context.getString(R.string.NotificationChannel_calls), NotificationManager.IMPORTANCE_HIGH);<NEW_LINE>NotificationChannel failures = new NotificationChannel(FAILURES, context.getString(R.string.NotificationChannel_failures), NotificationManager.IMPORTANCE_HIGH);<NEW_LINE>NotificationChannel backups = new NotificationChannel(BACKUPS, context.getString(R.string.NotificationChannel_backups), NotificationManager.IMPORTANCE_LOW);<NEW_LINE>NotificationChannel lockedStatus = new NotificationChannel(LOCKED_STATUS, context.getString(R.string.NotificationChannel_locked_status), NotificationManager.IMPORTANCE_LOW);<NEW_LINE>NotificationChannel other = new NotificationChannel(OTHER, context.getString(R.string.NotificationChannel_other), NotificationManager.IMPORTANCE_LOW);<NEW_LINE>NotificationChannel voiceNotes = new NotificationChannel(VOICE_NOTES, context.getString(R.string.NotificationChannel_voice_notes), NotificationManager.IMPORTANCE_LOW);<NEW_LINE>NotificationChannel joinEvents = new NotificationChannel(JOIN_EVENTS, context.getString(R.string.NotificationChannel_contact_joined_signal), NotificationManager.IMPORTANCE_DEFAULT);<NEW_LINE>NotificationChannel background = new NotificationChannel(BACKGROUND, context.getString(R.string.NotificationChannel_background_connection), getDefaultBackgroundChannelImportance(notificationManager));<NEW_LINE>NotificationChannel callStatus = new NotificationChannel(CALL_STATUS, context.getString(R.string.NotificationChannel_call_status), NotificationManager.IMPORTANCE_LOW);<NEW_LINE>messages.setGroup(CATEGORY_MESSAGES);<NEW_LINE>setVibrationEnabled(messages, SignalStore.settings().isMessageVibrateEnabled());<NEW_LINE>messages.setSound(SignalStore.settings().<MASK><NEW_LINE>setLedPreference(messages, SignalStore.settings().getMessageLedColor());<NEW_LINE>calls.setShowBadge(false);<NEW_LINE>backups.setShowBadge(false);<NEW_LINE>lockedStatus.setShowBadge(false);<NEW_LINE>other.setShowBadge(false);<NEW_LINE>setVibrationEnabled(other, false);<NEW_LINE>voiceNotes.setShowBadge(false);<NEW_LINE>joinEvents.setShowBadge(false);<NEW_LINE>background.setShowBadge(false);<NEW_LINE>callStatus.setShowBadge(false);<NEW_LINE>notificationManager.createNotificationChannels(Arrays.asList(messages, calls, failures, backups, lockedStatus, other, voiceNotes, joinEvents, background, callStatus));<NEW_LINE>if (TextSecurePreferences.isUpdateApkEnabled(context)) {<NEW_LINE>NotificationChannel appUpdates = new NotificationChannel(APP_UPDATES, context.getString(R.string.NotificationChannel_app_updates), NotificationManager.IMPORTANCE_HIGH);<NEW_LINE>notificationManager.createNotificationChannel(appUpdates);<NEW_LINE>} else {<NEW_LINE>notificationManager.deleteNotificationChannel(APP_UPDATES);<NEW_LINE>}<NEW_LINE>}
getMessageNotificationSound(), getRingtoneAudioAttributes());
838,624
private boolean orchestrateDeleteVMSnapshot(Long vmSnapshotId) {<NEW_LINE>Account caller = getCaller();<NEW_LINE>VMSnapshotVO vmSnapshot = _vmSnapshotDao.findById(vmSnapshotId);<NEW_LINE>if (vmSnapshot == null) {<NEW_LINE>throw new InvalidParameterValueException("unable to find the vm snapshot with id " + vmSnapshotId);<NEW_LINE>}<NEW_LINE>_accountMgr.checkAccess(caller, null, true, vmSnapshot);<NEW_LINE>List<VMSnapshot.State> validStates = Arrays.asList(VMSnapshot.State.Ready, VMSnapshot.State.Expunging, VMSnapshot.State.Error, VMSnapshot.State.Allocated);<NEW_LINE>// check VM snapshot states, only allow to delete vm snapshots in ready, expunging, allocated and error state<NEW_LINE>if (!validStates.contains(vmSnapshot.getState())) {<NEW_LINE>throw new InvalidParameterValueException("Can't delete the vm snapshot " + vmSnapshotId + " due to it is not in " + validStates.toString() + "States");<NEW_LINE>}<NEW_LINE>// check if there are other active VM snapshot tasks<NEW_LINE>if (hasActiveVMSnapshotTasks(vmSnapshot.getVmId())) {<NEW_LINE>List<VMSnapshotVO> expungingSnapshots = _vmSnapshotDao.listByInstanceId(vmSnapshot.getVmId(), VMSnapshot.State.Expunging);<NEW_LINE>if (expungingSnapshots.size() > 0 && expungingSnapshots.get(0).getId() == vmSnapshot.getId())<NEW_LINE>s_logger.debug("Target VM snapshot already in expunging state, go on deleting it: " + vmSnapshot.getDisplayName());<NEW_LINE>else<NEW_LINE>throw new InvalidParameterValueException("There is other active vm snapshot tasks on the instance, please try again later");<NEW_LINE>}<NEW_LINE>annotationDao.removeByEntityType(AnnotationService.EntityType.VM_SNAPSHOT.name(), vmSnapshot.getUuid());<NEW_LINE>if (vmSnapshot.getState() == VMSnapshot.State.Allocated) {<NEW_LINE>return _vmSnapshotDao.<MASK><NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>VMSnapshotStrategy strategy = findVMSnapshotStrategy(vmSnapshot);<NEW_LINE>return strategy.deleteVMSnapshot(vmSnapshot);<NEW_LINE>} catch (Exception e) {<NEW_LINE>s_logger.debug("Failed to delete vm snapshot: " + vmSnapshotId, e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
remove(vmSnapshot.getId());
786,588
protected Result check() {<NEW_LINE>try {<NEW_LINE>DataStore dataStore = dataStoreFactory.createInternal();<NEW_LINE>Future<ResultSet> rs = dataStore.queryBuilder().select().column("cluster_name").column("schema_version").from("system", "local").build().execute();<NEW_LINE>Row row = rs.get().one();<NEW_LINE>String clusterName = row.getString("cluster_name");<NEW_LINE>UUID schemaVersion = row.getUuid("schema_version");<NEW_LINE>if (clusterName == null || clusterName.isEmpty()) {<NEW_LINE>return Result.unhealthy("Empty cluster name: " + clusterName);<NEW_LINE>}<NEW_LINE>if (schemaVersion == null) {<NEW_LINE>return Result.unhealthy("Null schema version");<NEW_LINE>}<NEW_LINE>return Result.healthy("DataStore is operational");<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("checkIsReady failed with {}", e.getMessage(), e);<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>}
Result.unhealthy("Unable to access DataStore: " + e);
1,265,738
public static void convertBundle(File bundleDir, String outputBundlePath) throws IOException {<NEW_LINE>Map<String, String> uuidToName = new HashMap<String, String>();<NEW_LINE>// Run SnippetConverter on snippets sub dir<NEW_LINE>File snippetsDir <MASK><NEW_LINE>SnippetConverter.convert(snippetsDir, outputBundlePath + File.separator + "snippets" + File.separator + "snippets.rb");<NEW_LINE>uuidToName.putAll(SnippetConverter.uuidNameMap(snippetsDir));<NEW_LINE>// Run Command Converter on Commands subdir<NEW_LINE>File commandsDir = new File(bundleDir, "Commands");<NEW_LINE>CommandConverter.convert(commandsDir, outputBundlePath + File.separator + "commands");<NEW_LINE>uuidToName.putAll(CommandConverter.uuidNameMap(commandsDir));<NEW_LINE>// Convert the Info.plist to a bundle.rb<NEW_LINE>String bundleRBPath = outputBundlePath + File.separator + "bundle.rb";<NEW_LINE>String contents = convertInfoPlist(new File(bundleDir, "Info.plist"), uuidToName);<NEW_LINE>writeToFile(contents, bundleRBPath);<NEW_LINE>// Copy tests dir<NEW_LINE>copyDir(bundleDir + "/Tests/", outputBundlePath + "/tests");<NEW_LINE>// Copy Support to our "lib"<NEW_LINE>copyDir(bundleDir + "/Support/", outputBundlePath + "/lib");<NEW_LINE>// Copy over common dirs that we don't handle...<NEW_LINE>copyDir(bundleDir + "/Preferences/", outputBundlePath + "/unsupported/preferences");<NEW_LINE>copyDir(bundleDir + "/Macros/", outputBundlePath + "/unsupported/macros");<NEW_LINE>copyDir(bundleDir + "/DragCommands/", outputBundlePath + "/unsupported/drag_commands");<NEW_LINE>copyDir(bundleDir + "/Templates/", outputBundlePath + "/unsupported/templates");<NEW_LINE>}
= new File(bundleDir, "Snippets");
663,429
private void walkJNICallInFrame(WalkState walkState) throws CorruptDataException {<NEW_LINE>J9SFJNICallInFramePointer callInFrame;<NEW_LINE>walkState.bp = walkState.arg0EA;<NEW_LINE>callInFrame = J9SFJNICallInFramePointer.cast(walkState.bp.subOffset(J9SFJNICallInFrame.SIZEOF).addOffset(UDATA.SIZEOF));<NEW_LINE>walkState.unwindSP = UDATAPointer.cast(callInFrame.subOffset(UDATA.cast(walkState.literals)));<NEW_LINE>walkState.frameFlags = callInFrame.specialFrameFlags();<NEW_LINE>printFrameType(walkState, "JNI call-in");<NEW_LINE>if ((walkState.flags & J9_STACKWALK_ITERATE_O_SLOTS) != 0) {<NEW_LINE>try {<NEW_LINE>if (!(walkState.walkSP.eq(walkState.unwindSP))) {<NEW_LINE>if (!walkState.pc.eq(walkState.walkThread.javaVM().callInReturnPC().add(3))) {<NEW_LINE>swPrintf(walkState, 0, "Error: PC should have been advanced in order to push return value, pc = {0}, cipc = {1} !!!", walkState.pc.getHexAddress(), walkState.walkThread.javaVM().<MASK><NEW_LINE>}<NEW_LINE>if (walkState.frameFlags.anyBitsIn(J9_SSF_RETURNS_OBJECT)) {<NEW_LINE>swPrintf(walkState, 4, "\tObject push (return value from call-in method)");<NEW_LINE>WALK_O_SLOT(walkState, PointerPointer.cast(walkState.walkSP));<NEW_LINE>} else {<NEW_LINE>swPrintf(walkState, 2, "\tCall-in return value (non-object) takes {0} slots at {1}", UDATA.cast(walkState.unwindSP).sub(UDATA.cast(walkState.walkSP)), walkState.walkSP.getHexAddress());<NEW_LINE>}<NEW_LINE>walkState.walkSP = walkState.unwindSP;<NEW_LINE>}<NEW_LINE>if (walkState.literals.notNull()) {<NEW_LINE>walkObjectPushes(walkState);<NEW_LINE>}<NEW_LINE>} catch (CorruptDataException ex) {<NEW_LINE>handleOSlotsCorruption(walkState, "StackWalker_29_V0", "walkJNICallInFrame", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (J9BuildFlags.interp_nativeSupport) {<NEW_LINE>walkState.walkedEntryLocalStorage = walkState.walkedEntryLocalStorage.oldEntryLocalStorage();<NEW_LINE>walkState.i2jState = walkState.walkedEntryLocalStorage.getAddress() != 0 ? J9I2JStatePointer.cast(walkState.walkedEntryLocalStorage.i2jStateEA()) : J9I2JStatePointer.cast(0);<NEW_LINE>swPrintf(walkState, 2, "\tNew ELS = {0}", walkState.walkedEntryLocalStorage.getHexAddress());<NEW_LINE>}<NEW_LINE>walkState.argCount = new UDATA(0);<NEW_LINE>}
callInReturnPC().getHexAddress());
1,820,144
public com.amazonaws.services.chimesdkmessaging.model.ThrottledClientException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.chimesdkmessaging.model.ThrottledClientException throttledClientException = new com.amazonaws.services.<MASK><NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Code", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>throttledClientException.setCode(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 throttledClientException;<NEW_LINE>}
chimesdkmessaging.model.ThrottledClientException(null);