idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
689,472
final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Backup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
747,809
public long readFixedInt64() throws IOException {<NEW_LINE>if (getCurrentRemaining() < ProtoWriter.FIXED64_SIZE) {<NEW_LINE>return (((readRawByte() & 0xffL)) | ((readRawByte() & 0xffL) << 8) | ((readRawByte() & 0xffL) << 16) | ((readRawByte() & 0xffL) << 24) | ((readRawByte() & 0xffL) << 32) | ((readRawByte() & 0xffL) << 40) | ((readRawByte() & 0xffL) << 48) | ((readRawByte(<MASK><NEW_LINE>}<NEW_LINE>final byte[] buffer = _currentSegment.getArray();<NEW_LINE>return (((buffer[_currentArrayOffset++] & 0xffL)) | ((buffer[_currentArrayOffset++] & 0xffL) << 8) | ((buffer[_currentArrayOffset++] & 0xffL) << 16) | ((buffer[_currentArrayOffset++] & 0xffL) << 24) | ((buffer[_currentArrayOffset++] & 0xffL) << 32) | ((buffer[_currentArrayOffset++] & 0xffL) << 40) | ((buffer[_currentArrayOffset++] & 0xffL) << 48) | ((buffer[_currentArrayOffset++] & 0xffL) << 56));<NEW_LINE>}
) & 0xffL) << 56));
1,776,688
private static byte[] serialiseEntity(ResteasyReactiveRequestContext context, Object entity) throws IOException {<NEW_LINE>ServerSerialisers serialisers = context.getDeployment().getSerialisers();<NEW_LINE>Class<?> entityClass = entity.getClass();<NEW_LINE>Type entityType = context.getGenericReturnType();<NEW_LINE><MASK><NEW_LINE>// FIXME: this should belong somewhere else as it's generic<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>MessageBodyWriter<Object>[] writers = (MessageBodyWriter<Object>[]) serialisers.findWriters(null, entityClass, mediaType, RuntimeType.SERVER).toArray(ServerSerialisers.NO_WRITER);<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>boolean wrote = false;<NEW_LINE>for (MessageBodyWriter<Object> writer : writers) {<NEW_LINE>// Spec(API) says we should use class/type/mediaType but doesn't talk about annotations<NEW_LINE>if (writer.isWriteable(entityClass, entityType, Serialisers.NO_ANNOTATION, mediaType)) {<NEW_LINE>// FIXME: spec doesn't really say what headers we should use here<NEW_LINE>writer.writeTo(entity, entityClass, entityType, Serialisers.NO_ANNOTATION, mediaType, Serialisers.EMPTY_MULTI_MAP, baos);<NEW_LINE>wrote = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!wrote) {<NEW_LINE>throw new IllegalStateException("Could not find MessageBodyWriter for " + entityClass + " / " + entityType + " as " + mediaType);<NEW_LINE>}<NEW_LINE>return baos.toByteArray();<NEW_LINE>}
MediaType mediaType = context.getResponseMediaType();
1,447,220
private Status openWriter(TFileBrokerService.Client client, TNetworkAddress address, String remoteFile, TBrokerFD fd) {<NEW_LINE>try {<NEW_LINE>TBrokerOpenWriterRequest req = new TBrokerOpenWriterRequest(TBrokerVersion.VERSION_ONE, remoteFile, TBrokerOpenMode.APPEND, clientId(), properties);<NEW_LINE>TBrokerOpenWriterResponse rep = client.openWriter(req);<NEW_LINE>TBrokerOperationStatus opst = rep.getOpStatus();<NEW_LINE>if (opst.getStatusCode() != TBrokerOperationStatusCode.OK) {<NEW_LINE>return new Status(ErrCode.COMMON_ERROR, "failed to open writer on broker " + BrokerUtil.printBroker(brokerName, address) + " for file: " + remoteFile + ". msg: " + opst.getMessage());<NEW_LINE>}<NEW_LINE>fd.setHigh(rep.getFd().getHigh());<NEW_LINE>fd.setLow(rep.getFd().getLow());<NEW_LINE>LOG.<MASK><NEW_LINE>} catch (TException e) {<NEW_LINE>return new Status(ErrCode.BAD_CONNECTION, "failed to open writer on broker " + BrokerUtil.printBroker(brokerName, address) + ", err: " + e.getMessage());<NEW_LINE>}<NEW_LINE>return Status.OK;<NEW_LINE>}
info("finished to open writer. fd: {}. directly upload to remote path {}.", fd, remoteFile);
95,842
final DescribeConnectorProfilesResult executeDescribeConnectorProfiles(DescribeConnectorProfilesRequest describeConnectorProfilesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeConnectorProfilesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeConnectorProfilesRequest> request = null;<NEW_LINE>Response<DescribeConnectorProfilesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeConnectorProfilesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeConnectorProfilesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Appflow");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeConnectorProfiles");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeConnectorProfilesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeConnectorProfilesResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.SIGNING_REGION, getSigningRegion());
891,831
private static void processOutputLimitedViewDefaultCodegen(ResultSetProcessorRowForAllForge forge, CodegenClassScope classScope, CodegenMethod method, CodegenInstanceAux instance) {<NEW_LINE>CodegenMethod getSelectListEventAddList = getSelectListEventsAddListCodegen(forge, classScope, instance);<NEW_LINE>CodegenMethod getSelectListEventAsArray = getSelectListEventsAsArrayCodegen(forge, classScope, instance);<NEW_LINE>ResultSetProcessorUtil.prefixCodegenNewOldEvents(method.getBlock(), forge.isSorting(), forge.isSelectRStream());<NEW_LINE>method.getBlock().declareVar(EventBean.EPTYPEARRAY, "eventsPerStream", newArrayByLength(EventBean.EPTYPE, constant(1)));<NEW_LINE>CodegenBlock forEach = method.getBlock().forEach(UniformPair.EPTYPE, "pair", REF_VIEWEVENTSLIST);<NEW_LINE>{<NEW_LINE>if (forge.isSelectRStream()) {<NEW_LINE>forEach.localMethod(getSelectListEventAddList, constantFalse(), REF_ISSYNTHESIZE, ref("oldEvents"));<NEW_LINE>if (forge.isSorting()) {<NEW_LINE>forEach.exprDotMethod(ref("oldEventsSortKey"), "add", exprDotMethod(MEMBER_ORDERBYPROCESSOR, "getSortKey", constantNull(), constantFalse(), MEMBER_EXPREVALCONTEXT));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>forEach.staticMethod(ResultSetProcessorUtil.class, METHOD_APPLYAGGVIEWRESULT, MEMBER_AGGREGATIONSVC, MEMBER_EXPREVALCONTEXT, cast(EventBean.EPTYPEARRAY, exprDotMethod(ref("pair"), "getFirst")), cast(EventBean.EPTYPEARRAY, exprDotMethod(ref("pair"), "getSecond")), ref("eventsPerStream"));<NEW_LINE>forEach.localMethod(getSelectListEventAddList, constantTrue()<MASK><NEW_LINE>if (forge.isSorting()) {<NEW_LINE>forEach.exprDotMethod(ref("newEventsSortKey"), "add", exprDotMethod(MEMBER_ORDERBYPROCESSOR, "getSortKey", constantNull(), constantTrue(), MEMBER_EXPREVALCONTEXT));<NEW_LINE>}<NEW_LINE>forEach.blockEnd();<NEW_LINE>}<NEW_LINE>CodegenBlock ifEmpty = method.getBlock().ifCondition(not(exprDotMethod(REF_VIEWEVENTSLIST, "isEmpty")));<NEW_LINE>ResultSetProcessorUtil.finalizeOutputMaySortMayRStreamCodegen(ifEmpty, ref("newEvents"), ref("newEventsSortKey"), ref("oldEvents"), ref("oldEventsSortKey"), forge.isSelectRStream(), forge.isSorting());<NEW_LINE>method.getBlock().declareVar(EventBean.EPTYPEARRAY, "newEventsArr", localMethod(getSelectListEventAsArray, constantTrue(), REF_ISSYNTHESIZE, constantFalse())).declareVar(EventBean.EPTYPEARRAY, "oldEventsArr", forge.isSelectRStream() ? localMethod(getSelectListEventAsArray, constantFalse(), REF_ISSYNTHESIZE, constantFalse()) : constantNull()).methodReturn(staticMethod(ResultSetProcessorUtil.class, METHOD_TOPAIRNULLIFALLNULL, ref("newEventsArr"), ref("oldEventsArr")));<NEW_LINE>}
, REF_ISSYNTHESIZE, ref("newEvents"));
1,369,399
public static void showYesNoPrompt(Context _context, String title, String message, OnClickListener onYesListener, OnClickListener onNoListener) {<NEW_LINE>try {<NEW_LINE>if (alertDialog != null && alertDialog.isShowing() && !isContextActivityThatIsFinishing(_context)) {<NEW_LINE>alertDialog.dismiss();<NEW_LINE>}<NEW_LINE>AlertDialog.Builder builder = new AlertDialog.Builder(_context);<NEW_LINE>builder.setTitle(title);<NEW_LINE>builder.setIcon(android.R.drawable.ic_dialog_info);<NEW_LINE>builder.setMessage(message);<NEW_LINE>builder.setCancelable(false);<NEW_LINE>builder.setPositiveButton(_context.getString(android.R.string.yes), onYesListener);<NEW_LINE>builder.setNegativeButton(_context.getString(android.R<MASK><NEW_LINE>if (!(alertDialog != null && alertDialog.isShowing()) && !isContextActivityThatIsFinishing(_context)) {<NEW_LINE>alertDialog = builder.create();<NEW_LINE>alertDialog.show();<NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
.string.no), onNoListener);
262,477
private void store(ConfigurationChanges diffs, String deviceDN, ImageWriterFactory factory) throws NamingException {<NEW_LINE>String imageWritersDN = CN_IMAGE_WRITER_FACTORY + deviceDN;<NEW_LINE>ConfigurationChanges.ModifiedObject ldapObj = ConfigurationChanges.addModifiedObject(diffs, imageWritersDN, ConfigurationChanges.ChangeType.C);<NEW_LINE>config.createSubcontext(imageWritersDN, LdapUtils.attrs("dcmImageWriterFactory", "cn", "Image Writer Factory"));<NEW_LINE>for (Entry<String, ImageWriterParam> entry : factory.getEntries()) {<NEW_LINE><MASK><NEW_LINE>ConfigurationChanges.ModifiedObject ldapObj1 = ConfigurationChanges.addModifiedObjectIfVerbose(diffs, imageWritersDN, ConfigurationChanges.ChangeType.C);<NEW_LINE>config.createSubcontext(dnOf(tsuid, imageWritersDN), storeTo(ldapObj1, tsuid, entry.getValue(), new BasicAttributes(true)));<NEW_LINE>}<NEW_LINE>}
String tsuid = entry.getKey();
1,212,775
public String updateWhitelistedSite(@PathVariable("id") Long id, @RequestBody String jsonString, ModelMap m, Principal p) {<NEW_LINE>JsonObject json;<NEW_LINE>WhitelistedSite whitelist = null;<NEW_LINE>try {<NEW_LINE>json = parser.parse(jsonString).getAsJsonObject();<NEW_LINE>whitelist = gson.fromJson(json, WhitelistedSite.class);<NEW_LINE>} catch (JsonParseException e) {<NEW_LINE>logger.error("updateWhitelistedSite failed due to JsonParseException", e);<NEW_LINE>m.put(HttpCodeView.CODE, HttpStatus.BAD_REQUEST);<NEW_LINE>m.put(JsonErrorView.ERROR_MESSAGE, "Could not update whitelisted site. The server encountered a JSON syntax exception. Contact a system administrator for assistance.");<NEW_LINE>return JsonErrorView.VIEWNAME;<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>logger.error("updateWhitelistedSite failed due to IllegalStateException", e);<NEW_LINE>m.put(HttpCodeView.CODE, HttpStatus.BAD_REQUEST);<NEW_LINE>m.put(JsonErrorView.ERROR_MESSAGE, "Could not update whitelisted site. The server encountered an IllegalStateException. Refresh and try again - if the problem persists, contact a system administrator for assistance.");<NEW_LINE>return JsonErrorView.VIEWNAME;<NEW_LINE>}<NEW_LINE>WhitelistedSite oldWhitelist = whitelistService.getById(id);<NEW_LINE>if (oldWhitelist == null) {<NEW_LINE>logger.error("updateWhitelistedSite failed; whitelist with id " + id + " could not be found.");<NEW_LINE>m.put(HttpCodeView.CODE, HttpStatus.NOT_FOUND);<NEW_LINE>m.put(JsonErrorView.ERROR_MESSAGE, "Could not update whitelisted site. The requested whitelisted site with id " + id + "could not be found.");<NEW_LINE>return JsonErrorView.VIEWNAME;<NEW_LINE>} else {<NEW_LINE>WhitelistedSite newWhitelist = whitelistService.update(oldWhitelist, whitelist);<NEW_LINE>m.<MASK><NEW_LINE>return JsonEntityView.VIEWNAME;<NEW_LINE>}<NEW_LINE>}
put(JsonEntityView.ENTITY, newWhitelist);
1,816,418
void visitCase(String methodName) {<NEW_LINE>MethodNode methodNode = methods.get(methodName);<NEW_LINE>String name = methodNode.name;<NEW_LINE>boolean isStatic = (methodNode.<MASK><NEW_LINE>String newDesc = computeOverrideMethodDesc(methodNode.desc, isStatic);<NEW_LINE>if (TRACING_ENABLED) {<NEW_LINE>trace(mv, "M: " + name + " P:" + newDesc);<NEW_LINE>}<NEW_LINE>Type[] args = Type.getArgumentTypes(newDesc);<NEW_LINE>int argc = 0;<NEW_LINE>for (Type t : args) {<NEW_LINE>mv.visitVarInsn(Opcodes.ALOAD, 2);<NEW_LINE>mv.push(argc);<NEW_LINE>mv.visitInsn(Opcodes.AALOAD);<NEW_LINE>ByteCodeUtils.unbox(mv, t);<NEW_LINE>argc++;<NEW_LINE>}<NEW_LINE>mv.visitMethodInsn(Opcodes.INVOKESTATIC, visitedClassName + OVERRIDE_SUFFIX, isStatic ? computeOverrideMethodName(name, methodNode.desc) : name, newDesc, false);<NEW_LINE>Type ret = Type.getReturnType(methodNode.desc);<NEW_LINE>if (ret.getSort() == Type.VOID) {<NEW_LINE>mv.visitInsn(Opcodes.ACONST_NULL);<NEW_LINE>} else {<NEW_LINE>mv.box(ret);<NEW_LINE>}<NEW_LINE>mv.visitInsn(Opcodes.ARETURN);<NEW_LINE>}
access & Opcodes.ACC_STATIC) != 0;
9,911
private void receiveSessionAccept(final RtpContentMap contentMap) {<NEW_LINE>this.responderRtpContentMap = contentMap;<NEW_LINE>this.storePeerDtlsSetup(contentMap.getDtlsSetup());<NEW_LINE>final SessionDescription sessionDescription;<NEW_LINE>try {<NEW_LINE>sessionDescription = SessionDescription.of(contentMap);<NEW_LINE>} catch (final IllegalArgumentException | NullPointerException e) {<NEW_LINE>Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": unable convert offer from session-accept to SDP", e);<NEW_LINE>webRTCWrapper.close();<NEW_LINE>sendSessionTerminate(Reason.FAILED_APPLICATION, e.getMessage());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final org.webrtc.SessionDescription answer = new org.webrtc.SessionDescription(org.webrtc.SessionDescription.Type.ANSWER, sessionDescription.toString());<NEW_LINE>try {<NEW_LINE>this.webRTCWrapper.setRemoteDescription(answer).get();<NEW_LINE>} catch (final Exception e) {<NEW_LINE>Log.d(Config.LOGTAG, id.account.getJid().asBareJid() + ": unable to set remote description after receiving session-accept"<MASK><NEW_LINE>webRTCWrapper.close();<NEW_LINE>sendSessionTerminate(Reason.FAILED_APPLICATION, Throwables.getRootCause(e).getMessage());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>processCandidates(contentMap.contents.entrySet());<NEW_LINE>}
, Throwables.getRootCause(e));
1,672,501
private void initNativeSupport() {<NEW_LINE>if (!Settings.isMac()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>log(lvl, "initNativeSupport: starting");<NEW_LINE>if (System.getProperty("sikulix.asapp") != null) {<NEW_LINE>Settings.isMacApp = true;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (runTime.isJava9()) {<NEW_LINE>log(lvl, "initNativeSupport: Java 9: trying with java.awt.Desktop");<NEW_LINE>Class sysclass = URLClassLoader.class;<NEW_LINE>Class clazzMacSupport = sysclass.forName("org.sikuli.idesupport.IDEMacSupport");<NEW_LINE>Method macSupport = clazzMacSupport.getDeclaredMethod("support", SikuliIDE.class);<NEW_LINE>macSupport.invoke(null, sikulixIDE);<NEW_LINE>showAbout = showPrefs = showQuit = false;<NEW_LINE>} else {<NEW_LINE>Class sysclass = URLClassLoader.class;<NEW_LINE>Class comAppleEawtApplication = sysclass.forName("com.apple.eawt.Application");<NEW_LINE>Method mGetApplication = comAppleEawtApplication.getDeclaredMethod("getApplication", null);<NEW_LINE>Object instApplication = <MASK><NEW_LINE>Class clAboutHandler = sysclass.forName("com.apple.eawt.AboutHandler");<NEW_LINE>Class clPreferencesHandler = sysclass.forName("com.apple.eawt.PreferencesHandler");<NEW_LINE>Class clQuitHandler = sysclass.forName("com.apple.eawt.QuitHandler");<NEW_LINE>Class clOpenHandler = sysclass.forName("com.apple.eawt.OpenFilesHandler");<NEW_LINE>Object appHandler = Proxy.newProxyInstance(comAppleEawtApplication.getClassLoader(), new Class[] { clAboutHandler, clPreferencesHandler, clQuitHandler, clOpenHandler }, this);<NEW_LINE>Method m = comAppleEawtApplication.getMethod("setAboutHandler", new Class[] { clAboutHandler });<NEW_LINE>m.invoke(instApplication, new Object[] { appHandler });<NEW_LINE>showAbout = false;<NEW_LINE>m = comAppleEawtApplication.getMethod("setPreferencesHandler", new Class[] { clPreferencesHandler });<NEW_LINE>m.invoke(instApplication, new Object[] { appHandler });<NEW_LINE>showPrefs = false;<NEW_LINE>m = comAppleEawtApplication.getMethod("setQuitHandler", new Class[] { clQuitHandler });<NEW_LINE>m.invoke(instApplication, new Object[] { appHandler });<NEW_LINE>showQuit = false;<NEW_LINE>m = comAppleEawtApplication.getMethod("setOpenFileHandler", new Class[] { clOpenHandler });<NEW_LINE>m.invoke(instApplication, new Object[] { appHandler });<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>String em = String.format("initNativeSupport: Mac: error:\n%s", ex.getMessage());<NEW_LINE>log(-1, em);<NEW_LINE>Sikulix.popError(em, "IDE has problems ...");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>log(lvl, "initNativeSupport: success");<NEW_LINE>}
mGetApplication.invoke(null, null);
925,726
private void remeasure() {<NEW_LINE>if (items == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>maxTextHeight = textSize;<NEW_LINE>halfCircumference = (int) (maxTextHeight * <MASK><NEW_LINE>measuredHeight = (int) ((halfCircumference * 2) / Math.PI);<NEW_LINE>radius = (int) (halfCircumference / Math.PI);<NEW_LINE>firstLineY = (int) ((measuredHeight - lineSpacingMultiplier * maxTextHeight) / 2.0F);<NEW_LINE>secondLineY = (int) ((measuredHeight + lineSpacingMultiplier * maxTextHeight) / 2.0F);<NEW_LINE>if (initPosition == -1) {<NEW_LINE>if (isLoop) {<NEW_LINE>initPosition = (items.size() + 1) / 2;<NEW_LINE>} else {<NEW_LINE>initPosition = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>preCurrentIndex = initPosition;<NEW_LINE>}
lineSpacingMultiplier * (itemsVisible - 1));
534,941
// Publish a post to a WordPress site via the WordPress.com REST API<NEW_LINE>public static void publishPost(Context context, String url, String title, String content, String status, Callback callback) {<NEW_LINE>if (!hasWPToken(context)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String wpToken = PrefUtils.<MASK><NEW_LINE>OkHttpClient client = new OkHttpClient().newBuilder().readTimeout(30, TimeUnit.SECONDS).build();<NEW_LINE>RequestBody requestBody = new MultipartBody.Builder().setType(MultipartBody.FORM).addFormDataPart("title", title).addFormDataPart("content", content).addFormDataPart("status", status).build();<NEW_LINE>Request request = new Request.Builder().url(WP_API_URL + String.format(Locale.ENGLISH, "sites/%s/posts/new", url)).header("Authorization", String.format(Locale.ENGLISH, "BEARER %s", wpToken)).post(requestBody).build();<NEW_LINE>client.newCall(request).enqueue(callback);<NEW_LINE>}
getStringPref(context, PrefUtils.PREF_WP_TOKEN);
450,339
private StateChange startupWait() {<NEW_LINE>StartStateListener listener = prepareStartMonitoring(true);<NEW_LINE>if (listener == null) {<NEW_LINE>return new StateChange(this, TaskState.FAILED, TaskEvent.ILLEGAL_STATE, "RestartTask.startupWait.listenerError", instanceName);<NEW_LINE>}<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>try {<NEW_LINE>synchronized (listener) {<NEW_LINE>while (!listener.isWakeUp() && (System.currentTimeMillis() - start < START_TIMEOUT)) {<NEW_LINE>listener.wait(System.currentTimeMillis() - start);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>LOGGER.log(Level.INFO, NbBundle.getMessage(RestartTask.class, "RestartTask.startupWait.interruptedException", new String[] { instance.getName(), ie.getLocalizedMessage() }));<NEW_LINE>} finally {<NEW_LINE>PayaraStatus.removeListener(instance, listener);<NEW_LINE>}<NEW_LINE>if (PayaraState.isOnline(instance)) {<NEW_LINE>return new StateChange(this, TaskState.COMPLETED, <MASK><NEW_LINE>} else {<NEW_LINE>return new StateChange(this, TaskState.FAILED, TaskEvent.ILLEGAL_STATE, "RestartTask.startupWait.failed", instanceName);<NEW_LINE>}<NEW_LINE>}
TaskEvent.CMD_COMPLETED, "RestartTask.startupWait.completed", instanceName);
856,820
private void init() {<NEW_LINE>this.typePublic = new ConcurrentHashMap<String, String>();<NEW_LINE>this.typeUri = new ConcurrentHashMap<String, String>();<NEW_LINE>Map<String, NamespaceDefinition> namespaceDefinitionRegistry = new HashMap<String, NamespaceDefinition>();<NEW_LINE>ResourceLoader classLoader = loaderCache.getResourceLoader(project, null);<NEW_LINE>schemaMappings = getSchemaMappings(classLoader);<NEW_LINE>if (schemaMappings != null) {<NEW_LINE>for (String key : schemaMappings.keySet()) {<NEW_LINE>String <MASK><NEW_LINE>// add the resolved path to the list of uris<NEW_LINE>String resolvedPath = resolveXsdPathOnClasspath(path, classLoader);<NEW_LINE>if (resolvedPath != null) {<NEW_LINE>typeUri.put(key, resolvedPath);<NEW_LINE>// collect base information to later extract the default uri<NEW_LINE>String namespaceUri = getTargetNamespace(resolvedPath);<NEW_LINE>if (namespaceDefinitionRegistry.containsKey(namespaceUri)) {<NEW_LINE>namespaceDefinitionRegistry.get(namespaceUri).addSchemaLocation(key);<NEW_LINE>namespaceDefinitionRegistry.get(namespaceUri).addUri(path);<NEW_LINE>} else {<NEW_LINE>NamespaceDefinition namespaceDefinition = new NamespaceDefinition(null);<NEW_LINE>namespaceDefinition.addSchemaLocation(key);<NEW_LINE>namespaceDefinition.setNamespaceUri(namespaceUri);<NEW_LINE>namespaceDefinition.addUri(path);<NEW_LINE>namespaceDefinitionRegistry.put(namespaceUri, namespaceDefinition);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add catalog entry to namespace uri<NEW_LINE>for (NamespaceDefinition definition : namespaceDefinitionRegistry.values()) {<NEW_LINE>String namespaceKey = definition.getNamespaceUri();<NEW_LINE>String defaultUri = definition.getDefaultUri();<NEW_LINE>String resolvedPath = resolveXsdPathOnClasspath(defaultUri, classLoader);<NEW_LINE>if (resolvedPath != null) {<NEW_LINE>typePublic.put(namespaceKey, resolvedPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
path = schemaMappings.get(key);
426,556
private void parsePrimitiveTypeClause(IoTDBSqlParser.OldTypeClauseContext ctx, Map<TSDataType, IFill> fillTypes) {<NEW_LINE>TSDataType dataType = parseType(ctx.dataType.getText());<NEW_LINE>if (dataType == TSDataType.VECTOR) {<NEW_LINE>throw new SQLParserException(String.format("type %s cannot use fill function", dataType));<NEW_LINE>}<NEW_LINE>if (ctx.linearClause() != null && (dataType == TSDataType.TEXT || dataType == TSDataType.BOOLEAN)) {<NEW_LINE>throw new SQLParserException(String.format("type %s cannot use %s fill function", dataType, ctx.linearClause().LINEAR<MASK><NEW_LINE>}<NEW_LINE>int defaultFillInterval = IoTDBDescriptor.getInstance().getConfig().getDefaultFillInterval();<NEW_LINE>if (ctx.linearClause() != null) {<NEW_LINE>// linear<NEW_LINE>if (ctx.linearClause().DURATION_LITERAL(0) != null) {<NEW_LINE>String beforeRangeStr = ctx.linearClause().DURATION_LITERAL(0).getText();<NEW_LINE>String afterRangeStr = ctx.linearClause().DURATION_LITERAL(1).getText();<NEW_LINE>LinearFill fill = new LinearFill(beforeRangeStr, afterRangeStr);<NEW_LINE>fillTypes.put(dataType, fill);<NEW_LINE>} else {<NEW_LINE>fillTypes.put(dataType, new LinearFill(defaultFillInterval, defaultFillInterval));<NEW_LINE>}<NEW_LINE>} else if (ctx.previousClause() != null) {<NEW_LINE>// previous<NEW_LINE>if (ctx.previousClause().DURATION_LITERAL() != null) {<NEW_LINE>String beforeStr = ctx.previousClause().DURATION_LITERAL().getText();<NEW_LINE>fillTypes.put(dataType, new PreviousFill(beforeStr));<NEW_LINE>} else {<NEW_LINE>fillTypes.put(dataType, new PreviousFill(defaultFillInterval));<NEW_LINE>}<NEW_LINE>} else if (ctx.specificValueClause() != null) {<NEW_LINE>// value<NEW_LINE>if (ctx.specificValueClause().constant() != null) {<NEW_LINE>fillTypes.put(dataType, new ValueFill(ctx.specificValueClause().constant().getText(), dataType));<NEW_LINE>} else {<NEW_LINE>throw new SQLParserException("fill value cannot be null");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// previous until last<NEW_LINE>if (ctx.previousUntilLastClause().DURATION_LITERAL() != null) {<NEW_LINE>String preRangeStr = ctx.previousUntilLastClause().DURATION_LITERAL().getText();<NEW_LINE>fillTypes.put(dataType, new PreviousFill(preRangeStr, true));<NEW_LINE>} else {<NEW_LINE>fillTypes.put(dataType, new PreviousFill(defaultFillInterval, true));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().getText()));
15,549
private static boolean isPregMatchInverted(@NotNull FunctionReference reference) {<NEW_LINE>boolean result = false;<NEW_LINE>final PsiElement parent = reference.getParent();<NEW_LINE>if (ExpressionSemanticUtil.isUsedAsLogicalOperand(reference)) {<NEW_LINE>if (parent instanceof UnaryExpression) {<NEW_LINE>result = OpenapiTypesUtil.is(((UnaryExpression) parent).<MASK><NEW_LINE>}<NEW_LINE>} else if (parent instanceof BinaryExpression) {<NEW_LINE>// inverted: < 1, == 0, === 0, != 1, !== 1<NEW_LINE>// not inverted: > 0, == 1, === 1, != 0, !== 0<NEW_LINE>final BinaryExpression binary = (BinaryExpression) parent;<NEW_LINE>final IElementType operator = binary.getOperationType();<NEW_LINE>if (operator == PhpTokenTypes.opLESS || OpenapiTypesUtil.tsCOMPARE_EQUALITY_OPS.contains(operator)) {<NEW_LINE>final PsiElement second = OpenapiElementsUtil.getSecondOperand(binary, reference);<NEW_LINE>if (OpenapiTypesUtil.isNumber(second)) {<NEW_LINE>final String number = second.getText();<NEW_LINE>result = operator == PhpTokenTypes.opLESS && number.equals("1") || operator == PhpTokenTypes.opEQUAL && number.equals("0") || operator == PhpTokenTypes.opIDENTICAL && number.equals("0") || operator == PhpTokenTypes.opNOT_EQUAL && number.equals("1") || operator == PhpTokenTypes.opNOT_IDENTICAL && number.equals("1");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
getOperation(), PhpTokenTypes.opNOT);
1,521,377
public StreamObserver<T> clientStream(StreamObserver<T> responseObserver, Class<T> grpcMessageType) {<NEW_LINE>ServerCallStreamObserver<T> serverCallStreamObserver <MASK><NEW_LINE>serverCallStreamObserver.disableAutoInboundFlowControl();<NEW_LINE>FunctionInvocationWrapper function = this.resolveFunction(null);<NEW_LINE>AtomicBoolean wasReady = new AtomicBoolean(false);<NEW_LINE>serverCallStreamObserver.setOnReadyHandler(() -> {<NEW_LINE>if (serverCallStreamObserver.isReady() && !wasReady.get()) {<NEW_LINE>wasReady.set(true);<NEW_LINE>logger.info("gRPC Server receiving stream is ready.");<NEW_LINE>serverCallStreamObserver.request(1);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (!function.isInputTypePublisher()) {<NEW_LINE>throw new UnsupportedOperationException("The client streaming is " + "not supported for functions that accept non-Publisher: " + function);<NEW_LINE>} else if (function.isOutputTypePublisher()) {<NEW_LINE>throw new UnsupportedOperationException("The client streaming is " + "not supported for functions that return Publisher: " + function);<NEW_LINE>} else {<NEW_LINE>Many<Message<byte[]>> inputStream = Sinks.many().unicast().onBackpressureBuffer();<NEW_LINE>Flux<Message<byte[]>> inputStreamFlux = inputStream.asFlux();<NEW_LINE>LinkedBlockingQueue<Message<byte[]>> resultRef = new LinkedBlockingQueue<>(1);<NEW_LINE>this.executor.execute(() -> {<NEW_LINE>Message<byte[]> replyMessage = (Message<byte[]>) function.apply(inputStreamFlux);<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Function invocation reply: " + replyMessage);<NEW_LINE>}<NEW_LINE>resultRef.offer(replyMessage);<NEW_LINE>});<NEW_LINE>return new StreamObserver<T>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onNext(T inputMessage) {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("gRPC Server receiving: " + inputMessage);<NEW_LINE>}<NEW_LINE>inputStream.tryEmitNext(toSpringMessage(inputMessage));<NEW_LINE>serverCallStreamObserver.request(1);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(Throwable t) {<NEW_LINE>t.printStackTrace();<NEW_LINE>responseObserver.onError(Status.UNKNOWN.withDescription("Error handling request").withCause(t).asRuntimeException());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCompleted() {<NEW_LINE>logger.info("gRPC Server has finished receiving data.");<NEW_LINE>inputStream.tryEmitComplete();<NEW_LINE>try {<NEW_LINE>responseObserver.onNext(toGrpcMessage(resultRef.poll(Integer.MAX_VALUE, TimeUnit.MILLISECONDS), grpcMessageType));<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>} finally {<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>}
= (ServerCallStreamObserver<T>) responseObserver;
136,843
public void mergeCounters(TopologyMetric tpMetric, MetaType metaType, String meta, Map<Integer, MetricSnapshot> data) {<NEW_LINE>MetricInfo <MASK><NEW_LINE>Map<Integer, MetricSnapshot> existing = metricInfo.get_metrics().get(meta);<NEW_LINE>if (existing == null) {<NEW_LINE>metricInfo.put_to_metrics(meta, data);<NEW_LINE>} else {<NEW_LINE>for (Map.Entry<Integer, MetricSnapshot> dataEntry : data.entrySet()) {<NEW_LINE>Integer win = dataEntry.getKey();<NEW_LINE>MetricSnapshot snapshot = dataEntry.getValue();<NEW_LINE>MetricSnapshot old = existing.get(win);<NEW_LINE>if (old == null) {<NEW_LINE>existing.put(win, snapshot);<NEW_LINE>} else {<NEW_LINE>old.set_ts(snapshot.get_ts());<NEW_LINE>old.set_longValue(old.get_longValue() + snapshot.get_longValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
metricInfo = getMetricInfoByType(tpMetric, metaType);
1,424,842
private Properties processFile() {<NEW_LINE>Properties properties = new Properties();<NEW_LINE>String extension = FilenameUtils.getExtension(configFile);<NEW_LINE>if (!extension.equalsIgnoreCase("properties")) {<NEW_LINE>LOG.info("Ignoring, as file extension is not correct for: {}", configFile);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>URL url = classLoader.loadResource(configFile);<NEW_LINE>if (url == null) {<NEW_LINE>LOG.info("Failed to find {} via {}.", configFile, getClass().getName());<NEW_LINE>} else {<NEW_LINE>LOG.info("Using URL [{}] for Dozer settings", url);<NEW_LINE>try (InputStream inputStream = url.openStream()) {<NEW_LINE>properties.load(inputStream);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOG.error("Failed to load: {} because: {}", configFile, ex.getMessage());<NEW_LINE>LOG.debug("Exception: ", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return properties;<NEW_LINE>}
LOG.info("Trying to find Dozer configuration file: {}", configFile);
1,776,275
private void implementSetBearerAuth(List<ExecutableElement> methods) {<NEW_LINE>JMethod setBearerMethod = codeModelHelper.implementMethod(this, methods, "setBearerAuth", TypeKind.VOID.toString(), true, STRING);<NEW_LINE>if (setBearerMethod != null) {<NEW_LINE>JVar tokenParamVar = setBearerMethod.params().get(0);<NEW_LINE>IJExpression tokenExpr = lit("Bearer ").plus(tokenParamVar);<NEW_LINE>AbstractJClass authClass = getJClass(HTTP_AUTHENTICATION);<NEW_LINE>JDefinedClass anonymousHttpAuthClass = getCodeModel().anonymousClass(authClass);<NEW_LINE>JMethod getHeaderValueMethod = anonymousHttpAuthClass.method(JMod.PUBLIC, String.class, "getHeaderValue");<NEW_LINE><MASK><NEW_LINE>JBlock getHeaderValueMethodBody = getHeaderValueMethod.body();<NEW_LINE>getHeaderValueMethodBody._return(tokenExpr);<NEW_LINE>JBlock setBearerBody = setBearerMethod.body();<NEW_LINE>setBearerBody.assign(_this().ref(getAuthenticationField()), _new(anonymousHttpAuthClass));<NEW_LINE>}<NEW_LINE>}
getHeaderValueMethod.annotate(Override.class);
845,698
public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>MageObject mageObject = game.getPermanentEntering(source.getSourceId());<NEW_LINE>if (mageObject == null) {<NEW_LINE>mageObject = game.getObject(source);<NEW_LINE>}<NEW_LINE>if (controller != null && mageObject != null) {<NEW_LINE>ChoiceImpl choices = new ChoiceBasicLandType();<NEW_LINE>if (controller.choose(Outcome.Neutral, choices, game)) {<NEW_LINE>game.informPlayers(mageObject.getName() + ": Chosen basic land type is " + choices.getChoice());<NEW_LINE>game.getState().setValue(mageObject.getId().toString() + <MASK><NEW_LINE>if (mageObject instanceof Permanent) {<NEW_LINE>((Permanent) mageObject).addInfo("chosen color", CardUtil.addToolTipMarkTags("Chosen basic land type: " + choices.getChoice()), game);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
VALUE_KEY, choices.getChoice());
718,057
private static SmartPointerElementInfo createAnchorInfo(@Nonnull PsiElement element, @Nonnull PsiFile containingFile) {<NEW_LINE>if (element instanceof StubBasedPsiElement && containingFile instanceof PsiFileImpl) {<NEW_LINE>IStubFileElementType stubType = ((<MASK><NEW_LINE>if (stubType != null && stubType.shouldBuildStubFor(containingFile.getViewProvider().getVirtualFile())) {<NEW_LINE>StubBasedPsiElement stubPsi = (StubBasedPsiElement) element;<NEW_LINE>int stubId = PsiAnchor.calcStubIndex(stubPsi);<NEW_LINE>if (stubId != -1) {<NEW_LINE>return new AnchorElementInfo(element, (PsiFileImpl) containingFile, stubId, stubPsi.getElementType());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Pair<Identikit.ByAnchor, PsiElement> pair = Identikit.withAnchor(element, LanguageUtil.getRootLanguage(containingFile));<NEW_LINE>if (pair != null) {<NEW_LINE>return new AnchorElementInfo(pair.second, containingFile, pair.first);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
PsiFileImpl) containingFile).getElementTypeForStubBuilder();
132,647
public boolean save() throws IOException {<NEW_LINE>// make sure the user didn't hide the sketch folder<NEW_LINE>ensureExistence();<NEW_LINE>if (isReadOnly()) {<NEW_LINE>Base.showMessage(tr("Sketch is read-only"), tr("Some files are marked \"read-only\", so you'll\n" + "need to re-save this sketch to another location."));<NEW_LINE>return saveAs();<NEW_LINE>}<NEW_LINE>// rename .pde files to .ino<NEW_LINE>List<SketchFile> oldFiles = new ArrayList<>();<NEW_LINE>for (SketchFile file : sketch.getFiles()) {<NEW_LINE>if (file.isExtension(Sketch.OLD_SKETCH_EXTENSIONS))<NEW_LINE>oldFiles.add(file);<NEW_LINE>}<NEW_LINE>if (oldFiles.size() > 0) {<NEW_LINE>if (PreferencesData.get("editor.update_extension") == null) {<NEW_LINE>Object[] options = { tr("OK"), tr("Cancel") };<NEW_LINE>int result = JOptionPane.showOptionDialog(editor, tr("In Arduino 1.0, the default file extension has changed\n" + "from .pde to .ino. New sketches (including those created\n" + "by \"Save-As\") will use the new extension. The extension\n" + "of existing sketches will be updated on save, but you can\n" + "disable this in the Preferences dialog.\n" + "\n" + "Save sketch and update its extension?"), tr(".pde -> .ino"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);<NEW_LINE>// save cancelled<NEW_LINE>if (result != JOptionPane.OK_OPTION)<NEW_LINE>return false;<NEW_LINE>PreferencesData.setBoolean("editor.update_extension", true);<NEW_LINE>}<NEW_LINE>if (PreferencesData.getBoolean("editor.update_extension")) {<NEW_LINE>// Do rename of all .pde files to new .ino extension<NEW_LINE>for (SketchFile file : oldFiles) {<NEW_LINE>File newName = FileUtils.replaceExtension(file.getFile(), Sketch.DEFAULT_SKETCH_EXTENSION);<NEW_LINE>file.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sketch.save();<NEW_LINE>return true;<NEW_LINE>}
renameTo(newName.getName());
393,193
public String generateCapacityConfig() {<NEW_LINE>JsonArray brokerList = new JsonArray();<NEW_LINE>if (storage instanceof JbodStorage) {<NEW_LINE>// A capacity configuration for a cluster with a JBOD configuration<NEW_LINE>// requires a distinct broker capacity entry for every broker because the<NEW_LINE>// Kafka volume paths are not homogeneous across brokers and include<NEW_LINE>// the broker pod index in their names.<NEW_LINE>for (int idx = 0; idx < replicas; idx++) {<NEW_LINE>JsonObject diskConfig = new JsonObject().put("DISK", generateJbodDiskCapacity(storage, idx));<NEW_LINE>JsonObject brokerEntry = generateBrokerCapacity(idx, diskConfig, "Capacity for Broker " + idx);<NEW_LINE>brokerList.add(brokerEntry);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// A capacity configuration for a cluster without a JBOD configuration<NEW_LINE>// can rely on a generic broker entry for all brokers<NEW_LINE>JsonObject diskConfig = new JsonObject().put("DISK"<MASK><NEW_LINE>JsonObject defaultBrokerCapacity = generateBrokerCapacity(DEFAULT_BROKER_ID, diskConfig, DEFAULT_BROKER_DOC);<NEW_LINE>brokerList.add(defaultBrokerCapacity);<NEW_LINE>}<NEW_LINE>JsonObject config = new JsonObject();<NEW_LINE>config.put("brokerCapacities", brokerList);<NEW_LINE>return config.encodePrettily();<NEW_LINE>}
, String.valueOf(diskMiB));
933,785
private ApiResponse processInitSessionRequest(ApiRequest apiRequest) throws ApiException {<NEW_LINE>ApiResponse response = new ApiResponse();<NEW_LINE>// create session<NEW_LINE>Session session = sessionManager.createSession();<NEW_LINE>if (session != null) {<NEW_LINE>// Result Distributor<NEW_LINE>SharingResultDistributorImpl resultDistributor = new SharingResultDistributorImpl(session);<NEW_LINE>// create consumer<NEW_LINE>ResultConsumer resultConsumer = new ResultConsumerImpl();<NEW_LINE>resultDistributor.addConsumer(resultConsumer);<NEW_LINE>session.setResultDistributor(resultDistributor);<NEW_LINE>resultDistributor.appendResult(new MessageModel("Welcome to arthas!"));<NEW_LINE>// welcome message<NEW_LINE>WelcomeModel welcomeModel = new WelcomeModel();<NEW_LINE>welcomeModel.setVersion(ArthasBanner.version());<NEW_LINE>welcomeModel.setWiki(ArthasBanner.wiki());<NEW_LINE>welcomeModel.setTutorials(ArthasBanner.tutorials());<NEW_LINE>welcomeModel.<MASK><NEW_LINE>welcomeModel.setPid(PidUtils.currentPid());<NEW_LINE>welcomeModel.setTime(DateUtils.getCurrentDate());<NEW_LINE>resultDistributor.appendResult(welcomeModel);<NEW_LINE>// allow input<NEW_LINE>updateSessionInputStatus(session, InputStatus.ALLOW_INPUT);<NEW_LINE>response.setSessionId(session.getSessionId()).setConsumerId(resultConsumer.getConsumerId()).setState(ApiState.SUCCEEDED);<NEW_LINE>} else {<NEW_LINE>throw new ApiException("create api session failed");<NEW_LINE>}<NEW_LINE>return response;<NEW_LINE>}
setMainClass(PidUtils.mainClass());
1,038,001
public void writeToStream(@NonNull OutputStream outputStream, @Nullable IProgress progress) throws IOException {<NEW_LINE>JSONObject json = new JSONObject();<NEW_LINE>List<OsmandPreference<?>> prefs = new ArrayList<>(settings.getRegisteredPreferences().values());<NEW_LINE>for (OsmandPreference<?> pref : prefs) {<NEW_LINE>try {<NEW_LINE>writePreferenceToJson(pref, json);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>SettingsHelper.LOG.error("Failed to write preference: " + pref.getId(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (json.length() > 0) {<NEW_LINE>try {<NEW_LINE>int bytesDivisor = 1024;<NEW_LINE>byte[] bytes = json.toString(2).getBytes("UTF-8");<NEW_LINE>if (progress != null) {<NEW_LINE>progress.startWork(bytes.length / bytesDivisor);<NEW_LINE>}<NEW_LINE>Algorithms.streamCopy(new ByteArrayInputStream(bytes), outputStream, progress, bytesDivisor);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>SettingsHelper.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (progress != null) {<NEW_LINE>progress.finishTask();<NEW_LINE>}<NEW_LINE>}
LOG.error("Failed to write json to stream", e);
329,194
private void saveState() {<NEW_LINE>if (length < 0)<NEW_LINE>return;<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>sb.append(this.length + "\n");<NEW_LINE>sb.append(downloaded + "\n");<NEW_LINE>sb.append(chunks.size() + "\n");<NEW_LINE>for (int i = 0; i < chunks.size(); i++) {<NEW_LINE>Segment <MASK><NEW_LINE>sb.append(seg.getId() + "\n");<NEW_LINE>sb.append(seg.getLength() + "\n");<NEW_LINE>sb.append(seg.getStartOffset() + "\n");<NEW_LINE>sb.append(seg.getDownloaded() + "\n");<NEW_LINE>}<NEW_LINE>if (!StringUtils.isNullOrEmptyOrBlank(lastModified)) {<NEW_LINE>sb.append(this.lastModified + "\n");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>File tmp = new File(folder, System.currentTimeMillis() + ".tmp");<NEW_LINE>File out = new File(folder, "state.txt");<NEW_LINE>FileOutputStream fs = new FileOutputStream(tmp);<NEW_LINE>fs.write(sb.toString().getBytes());<NEW_LINE>fs.close();<NEW_LINE>out.delete();<NEW_LINE>tmp.renameTo(out);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.log(e);<NEW_LINE>}<NEW_LINE>}
seg = chunks.get(i);
76,978
private void writeMapDotProperty(final Expression receiver, final String propertyName, final boolean safe) {<NEW_LINE>// load receiver<NEW_LINE>receiver.visit(controller.getAcg());<NEW_LINE>MethodVisitor mv = controller.getMethodVisitor();<NEW_LINE>Label exit = new Label();<NEW_LINE>if (safe) {<NEW_LINE>Label doGet = new Label();<NEW_LINE><MASK><NEW_LINE>controller.getOperandStack().remove(1);<NEW_LINE>mv.visitInsn(ACONST_NULL);<NEW_LINE>mv.visitJumpInsn(GOTO, exit);<NEW_LINE>mv.visitLabel(doGet);<NEW_LINE>receiver.visit(controller.getAcg());<NEW_LINE>}<NEW_LINE>// load property name<NEW_LINE>mv.visitLdcInsn(propertyName);<NEW_LINE>mv.visitMethodInsn(INVOKEINTERFACE, "java/util/Map", "get", "(Ljava/lang/Object;)Ljava/lang/Object;", true);<NEW_LINE>if (safe) {<NEW_LINE>mv.visitLabel(exit);<NEW_LINE>}<NEW_LINE>controller.getOperandStack().replace(OBJECT_TYPE);<NEW_LINE>}
mv.visitJumpInsn(IFNONNULL, doGet);
1,575,028
private Response saveEdits(FitNesseContext context, Request request, WikiPage page, long ticketId) {<NEW_LINE>String savedContent = request.getInput(EditResponder.CONTENT_INPUT_NAME);<NEW_LINE>String helpText = request.getInput(EditResponder.HELP_TEXT);<NEW_LINE>String suites = request.getInput(EditResponder.SUITES);<NEW_LINE>String user = request.getAuthorizationUsername();<NEW_LINE>PageData data = page.getData();<NEW_LINE>Response response = new SimpleResponse();<NEW_LINE>setData(data, savedContent, helpText, suites, user);<NEW_LINE>SaveRecorder.pageSaved(page, ticketId);<NEW_LINE>VersionInfo commitRecord = page.commit(data);<NEW_LINE>if (commitRecord != null) {<NEW_LINE>response.addHeader(<MASK><NEW_LINE>}<NEW_LINE>context.recentChanges.updateRecentChanges(page);<NEW_LINE>if (request.hasInput("redirect"))<NEW_LINE>response.redirect("", request.getInput("redirect"));<NEW_LINE>else<NEW_LINE>response.redirect(context.contextRoot, request.getResource());<NEW_LINE>return response;<NEW_LINE>}
"Current-Version", commitRecord.getName());
526,465
public void processNewResult(Object result) {<NEW_LINE>Database db = ResultUtil.findDatabase(result);<NEW_LINE>SetDBIDs positiveids = DBIDUtil.ensureSet(DatabaseUtil.getObjectsByLabelMatch(db, positiveClassName));<NEW_LINE>if (positiveids.size() == 0) {<NEW_LINE>LOG.warning("Cannot evaluate outlier results - no objects matched the given pattern.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean nonefound = true;<NEW_LINE>List<OutlierResult> oresults = OutlierResult.getOutlierResults(result);<NEW_LINE>List<OrderingResult> <MASK><NEW_LINE>// Outlier results are the main use case.<NEW_LINE>for (OutlierResult o : oresults) {<NEW_LINE>//<NEW_LINE>//<NEW_LINE>evaluate(EvaluationResult.findOrCreate(o, EvaluationResult.RANKING), o.getScores().size(), positiveids.size(), () -> new OutlierScoreAdapter(positiveids, o));<NEW_LINE>// Process them only once.<NEW_LINE>orderings.remove(o.getOrdering());<NEW_LINE>nonefound = false;<NEW_LINE>}<NEW_LINE>// FIXME: find appropriate place to add the derived result<NEW_LINE>// otherwise apply an ordering to the database IDs.<NEW_LINE>for (OrderingResult or : orderings) {<NEW_LINE>DBIDs sorted = or.order(or.getDBIDs());<NEW_LINE>int size = or.getDBIDs().size();<NEW_LINE>if (sorted.size() != size) {<NEW_LINE>throw new IllegalStateException("Iterable result doesn't match database size - incomplete ordering?");<NEW_LINE>}<NEW_LINE>//<NEW_LINE>//<NEW_LINE>evaluate(EvaluationResult.findOrCreate(or, EvaluationResult.RANKING), size, positiveids.size(), () -> new SimpleAdapter(positiveids, sorted.iter(), sorted.size()));<NEW_LINE>nonefound = false;<NEW_LINE>}<NEW_LINE>if (nonefound) {<NEW_LINE>// LOG.warning("No results found to process with ROC curve analyzer. Got<NEW_LINE>// "+iterables.size()+" iterables, "+orderings.size()+" orderings.");<NEW_LINE>}<NEW_LINE>}
orderings = ResultUtil.getOrderingResults(result);
1,406,571
private Mono<PagedResponse<ContainerAppInner>> listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null));<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));
649,487
public static Map<String, RexNode> permutePredicateOnFullColumn(Mapping fullColumnMapping, Map<String, RexNode> predicates) {<NEW_LINE>final Mapping inverted = fullColumnMapping.inverse();<NEW_LINE>final List<Integer> <MASK><NEW_LINE>for (IntPair intPair : inverted) {<NEW_LINE>sourceList.add(intPair.source);<NEW_LINE>}<NEW_LINE>final RexPermuteInputsShuttle permute = RexPermuteInputsShuttle.of(inverted);<NEW_LINE>final ImmutableBitSet inputSet = ImmutableBitSet.of(sourceList);<NEW_LINE>Map<String, RexNode> result = new HashMap<>();<NEW_LINE>for (Entry<String, RexNode> entry : predicates.entrySet()) {<NEW_LINE>final RexNode rexNode = entry.getValue();<NEW_LINE>if (inputSet.contains(InputFinder.bits(rexNode))) {<NEW_LINE>RexNode call = rexNode.accept(permute);<NEW_LINE>result.put(call.toString(), call);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
sourceList = new ArrayList<>();
1,246,236
public Collection<VirtualFile> selectFilesToProcess(final List<VirtualFile> files, final String title, @Nullable final String prompt, final String singleFileTitle, final String singleFilePromptTemplate, final VcsShowConfirmationOption confirmationOption) {<NEW_LINE>if (files == null || files.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (files.size() == 1 && singleFilePromptTemplate != null) {<NEW_LINE>String filePrompt = MessageFormat.format(singleFilePromptTemplate, files.get(0).getPresentableUrl());<NEW_LINE>if (ConfirmationDialog.requestForConfirmation(confirmationOption, myProject, filePrompt, singleFileTitle, Messages.getQuestionIcon())) {<NEW_LINE>return files;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SelectFilesDialog dlg = SelectFilesDialog.init(myProject, files, prompt, confirmationOption, true, true, false);<NEW_LINE>dlg.setTitle(title);<NEW_LINE>if (!confirmationOption.isPersistent()) {<NEW_LINE>dlg.setDoNotAskOption(null);<NEW_LINE>}<NEW_LINE>if (dlg.showAndGet()) {<NEW_LINE>final Collection<VirtualFile> selection = dlg.getSelectedFiles();<NEW_LINE>// return items in the same order as they were passed to us<NEW_LINE>final List<VirtualFile> <MASK><NEW_LINE>for (VirtualFile file : files) {<NEW_LINE>if (selection.contains(file)) {<NEW_LINE>result.add(file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
result = new ArrayList<>();
543,367
// restoreEntity<NEW_LINE>@Override<NEW_LINE>public EntityDetail restoreEntity(String userId, String deletedEntityGUID) throws InvalidParameterException, RepositoryErrorException, EntityNotKnownException, EntityNotDeletedException, UserNotAuthorizedException {<NEW_LINE>final String methodName = "restoreEntity";<NEW_LINE>final String parameterName = "deletedEntityGUID";<NEW_LINE>super.manageInstanceParameterValidation(userId, deletedEntityGUID, parameterName, methodName);<NEW_LINE>EntityDetail entity;<NEW_LINE>try {<NEW_LINE>entity = graphStore.getEntityDetailFromStore(deletedEntityGUID);<NEW_LINE>repositoryValidator.validateEntityFromStore(<MASK><NEW_LINE>repositoryValidator.validateEntityIsDeleted(repositoryName, entity, methodName);<NEW_LINE>} catch (EntityProxyOnlyException e) {<NEW_LINE>log.warn("{} entity wth GUID {} only a proxy", methodName, deletedEntityGUID);<NEW_LINE>throw new EntityNotKnownException(OMRSErrorCode.ENTITY_NOT_KNOWN.getMessageDefinition(deletedEntityGUID, methodName, repositoryName), this.getClass().getName(), methodName, e);<NEW_LINE>}<NEW_LINE>EntityDetail restoredEntity = new EntityDetail(entity);<NEW_LINE>restoredEntity.setStatus(entity.getStatusOnDelete());<NEW_LINE>restoredEntity.setStatusOnDelete(null);<NEW_LINE>restoredEntity = repositoryHelper.incrementVersion(userId, entity, restoredEntity);<NEW_LINE>graphStore.updateEntityInStore(restoredEntity);<NEW_LINE>return restoredEntity;<NEW_LINE>}
repositoryName, deletedEntityGUID, entity, methodName);
1,545,739
private List<String> people(Business business, Wi wi) throws Exception {<NEW_LINE>List<Unit> os = business.unit().pick(wi.getUnitList());<NEW_LINE>List<String> unitIds = new ArrayList<>();<NEW_LINE>for (Unit o : os) {<NEW_LINE>unitIds.<MASK><NEW_LINE>unitIds.addAll(business.unit().listSubNested(o.getId()));<NEW_LINE>}<NEW_LINE>unitIds = ListTools.trim(unitIds, true, true);<NEW_LINE>EntityManager em = business.entityManagerContainer().get(Identity.class);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<String> cq = cb.createQuery(String.class);<NEW_LINE>Root<Identity> root = cq.from(Identity.class);<NEW_LINE>Predicate p = root.get(Identity_.unit).in(unitIds);<NEW_LINE>List<String> list = em.createQuery(cq.select(root.get(Identity_.person)).where(p)).getResultList().stream().distinct().collect(Collectors.toList());<NEW_LINE>return list;<NEW_LINE>}
add(o.getId());
1,328,610
public boolean onPrepareOptionsMenu(Menu menu) {<NEW_LINE>super.onPrepareOptionsMenu(menu);<NEW_LINE>boolean enableUploadAgain = false;<NEW_LINE>boolean enableTryAgain = false;<NEW_LINE>boolean enableDeleteAll = false;<NEW_LINE>final LibraryTree tree = getCurrentTree();<NEW_LINE>if (tree instanceof SyncLabelTree) {<NEW_LINE>final String label = ((SyncLabelTree) tree).Label;<NEW_LINE>if (Book.SYNC_DELETED_LABEL.equals(label)) {<NEW_LINE>enableUploadAgain = true;<NEW_LINE>enableDeleteAll = true;<NEW_LINE>} else if (Book.SYNC_FAILURE_LABEL.equals(label)) {<NEW_LINE>enableTryAgain = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final MenuItem rescanItem = menu.findItem(OptionsItemId.Rescan);<NEW_LINE>myCollection.bindToService(this, new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>rescanItem.setEnabled(myCollection.status().IsComplete);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>rescanItem.setVisible(tree == myRootTree);<NEW_LINE>menu.findItem(OptionsItemId.UploadAgain).setVisible(enableUploadAgain);<NEW_LINE>menu.findItem(OptionsItemId.TryAgain).setVisible(enableTryAgain);<NEW_LINE>menu.findItem(OptionsItemId<MASK><NEW_LINE>return true;<NEW_LINE>}
.DeleteAll).setVisible(enableDeleteAll);
1,042,903
private void initializeSoot() {<NEW_LINE>logger.info("Initializing Soot...");<NEW_LINE>final String androidJar = config.getAnalysisFileConfig().getAndroidPlatformDir();<NEW_LINE>final String apkFileLocation = config.getAnalysisFileConfig().getTargetAPKFile();<NEW_LINE>// Clean up any old Soot instance we may have<NEW_LINE>G.reset();<NEW_LINE>Options.v().set_no_bodies_for_excluded(true);<NEW_LINE>Options.v().set_allow_phantom_refs(true);<NEW_LINE>if (config.getWriteOutputFiles())<NEW_LINE>Options.v().set_output_format(Options.output_format_jimple);<NEW_LINE>else<NEW_LINE>Options.v().set_output_format(Options.output_format_none);<NEW_LINE>Options.v().set_whole_program(true);<NEW_LINE>Options.v().set_process_dir(Collections.singletonList(apkFileLocation));<NEW_LINE>if (forceAndroidJar)<NEW_LINE>Options.v().set_force_android_jar(androidJar);<NEW_LINE>else<NEW_LINE>Options.v().set_android_jars(androidJar);<NEW_LINE>Options.v().set_src_prec(Options.src_prec_apk_class_jimple);<NEW_LINE>Options.v().set_keep_offset(false);<NEW_LINE>Options.v().set_keep_line_number(config.getEnableLineNumbers());<NEW_LINE>Options.v().set_throw_analysis(Options.throw_analysis_dalvik);<NEW_LINE>Options.v().set_process_multiple_dex(config.getMergeDexFiles());<NEW_LINE>Options.v().set_ignore_resolution_errors(true);<NEW_LINE>// Set soot phase option if original names should be used<NEW_LINE>if (config.getEnableOriginalNames())<NEW_LINE>Options.v().setPhaseOption("jb", "use-original-names:true");<NEW_LINE>// Set the Soot configuration options. Note that this will needs to be<NEW_LINE>// done before we compute the classpath.<NEW_LINE>if (sootConfig != null)<NEW_LINE>sootConfig.setSootOptions(Options.v(), config);<NEW_LINE>Options.v().set_soot_classpath(getClasspath());<NEW_LINE>Main<MASK><NEW_LINE>configureCallgraph();<NEW_LINE>// Load whatever we need<NEW_LINE>logger.info("Loading dex files...");<NEW_LINE>Scene.v().loadNecessaryClasses();<NEW_LINE>// Make sure that we have valid Jimple bodies<NEW_LINE>PackManager.v().getPack("wjpp").apply();<NEW_LINE>// Patch the callgraph to support additional edges. We do this now,<NEW_LINE>// because during callback discovery, the context-insensitive callgraph<NEW_LINE>// algorithm would flood us with invalid edges.<NEW_LINE>LibraryClassPatcher patcher = getLibraryClassPatcher();<NEW_LINE>patcher.patchLibraries();<NEW_LINE>}
.v().autoSetOptions();
204,753
public void run() {<NEW_LINE>action.finish();<NEW_LINE>LocalHistory.getInstance().putSystemLabel(myProject, (myLocalHistoryActionName == null) ? myOperationName : myLocalHistoryActionName, -1);<NEW_LINE>final VcsDirtyScopeManager manager = project.getComponent(VcsDirtyScopeManager.class);<NEW_LINE>VcsGuess vcsGuess = new VcsGuess(myProject);<NEW_LINE>for (Change change : changesToRefresh) {<NEW_LINE>final ContentRevision beforeRevision = change.getBeforeRevision();<NEW_LINE>final <MASK><NEW_LINE>if ((!change.isIsReplaced()) && beforeRevision != null && Comparing.equal(beforeRevision, afterRevision)) {<NEW_LINE>manager.fileDirty(beforeRevision.getFile());<NEW_LINE>} else {<NEW_LINE>markDirty(manager, vcsGuess, beforeRevision);<NEW_LINE>markDirty(manager, vcsGuess, afterRevision);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>myAfterRefresh.run();<NEW_LINE>}
ContentRevision afterRevision = change.getAfterRevision();
707,104
public void explain(int p, ExplanationForSignedClause explanation) {<NEW_LINE>IntVar pivot = explanation.readVar(p);<NEW_LINE>IntIterableRangeSet set;<NEW_LINE>int i = 0;<NEW_LINE>while (i < mvars.length) {<NEW_LINE>IntVar v = mvars[i];<NEW_LINE>if (explanation.getFront().getValueOrDefault(v, -1) == -1) {<NEW_LINE>// see javadoc for motivation of these two lines<NEW_LINE>explanation.getImplicationGraph().findPredecessor(explanation.getFront(), v, p);<NEW_LINE>}<NEW_LINE>set = explanation.empty();<NEW_LINE>do {<NEW_LINE>set.addBetween(bounds[i << 1], bounds[(i << 1) + 1]);<NEW_LINE>i++;<NEW_LINE>} while (i < mvars.length && mvars[i - <MASK><NEW_LINE>if (v == pivot) {<NEW_LINE>v.intersectLit(set, explanation);<NEW_LINE>} else {<NEW_LINE>v.unionLit(set, explanation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
1] == mvars[i]);
1,464,377
private void emitBeginBlockForSwitchStatements(Block dom, Block beginBlockNode) {<NEW_LINE>final IntegerSwitchNode switchNode = <MASK><NEW_LINE>asm.indent();<NEW_LINE>Node beginNode = beginBlockNode.getBeginNode();<NEW_LINE>switches.add(beginBlockNode);<NEW_LINE>NodeIterable<Node> successors = switchNode.successors();<NEW_LINE>int defaultSuccessorIndex = switchNode.defaultSuccessorIndex();<NEW_LINE>Iterator<Node> iterator = successors.iterator();<NEW_LINE>int caseIndex = -1;<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>Node n = iterator.next();<NEW_LINE>caseIndex++;<NEW_LINE>if (n.equals(beginNode)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add all cases that go to the same block<NEW_LINE>ArrayList<Integer> commonCases = new ArrayList<>();<NEW_LINE>for (int i = 0; i <= defaultSuccessorIndex; i++) {<NEW_LINE>if (caseIndex == switchNode.keySuccessorIndex(i)) {<NEW_LINE>commonCases.add(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (defaultSuccessorIndex == caseIndex) {<NEW_LINE>asm.emit(OCLAssemblerConstants.DEFAULT_CASE + OCLAssemblerConstants.COLON);<NEW_LINE>} else {<NEW_LINE>for (Integer idx : commonCases) {<NEW_LINE>asm.emit(OCLAssemblerConstants.CASE + " ");<NEW_LINE>JavaConstant keyAt = switchNode.keyAt(idx);<NEW_LINE>asm.emit(keyAt.toValueString());<NEW_LINE>asm.emit(OCLAssemblerConstants.COLON);<NEW_LINE>asm.emitLine("");<NEW_LINE>asm.indent();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(IntegerSwitchNode) dom.getEndNode();
739,077
public Action onFragment(final DirectBuffer buffer, final int offset, final int length, final Header header) {<NEW_LINE>Action action = Action.CONTINUE;<NEW_LINE>final byte flags = header.flags();<NEW_LINE>if ((flags & UNFRAGMENTED) == UNFRAGMENTED) {<NEW_LINE>action = onMessage(buffer, offset, length, header);<NEW_LINE>} else {<NEW_LINE>if ((flags & BEGIN_FRAG_FLAG) == BEGIN_FRAG_FLAG) {<NEW_LINE>builder.reset().append(buffer, offset, length);<NEW_LINE>} else {<NEW_LINE>final int limit = builder.limit();<NEW_LINE>if (limit > 0) {<NEW_LINE>builder.<MASK><NEW_LINE>if ((flags & END_FRAG_FLAG) == END_FRAG_FLAG) {<NEW_LINE>action = onMessage(builder.buffer(), 0, builder.limit(), header);<NEW_LINE>if (Action.ABORT == action) {<NEW_LINE>builder.limit(limit);<NEW_LINE>} else {<NEW_LINE>builder.reset();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return action;<NEW_LINE>}
append(buffer, offset, length);
1,406,013
public <T extends ImmutableSortedListOfRanges> T createIntersectionSingleRange(T o) {<NEW_LINE>assert size() == 1 && !o.isEmpty();<NEW_LINE>if (getMin() <= o.getMin() && getMax() >= o.getMax()) {<NEW_LINE>return o;<NEW_LINE>}<NEW_LINE>int iLo = 0;<NEW_LINE>int iHi = o.size() - 1;<NEW_LINE>while (iLo < o.size() && o.getHi(iLo) < getMin()) {<NEW_LINE>iLo++;<NEW_LINE>}<NEW_LINE>while (iHi >= 0 && o.getLo(iHi) > getMax()) {<NEW_LINE>iHi--;<NEW_LINE>}<NEW_LINE>if (iHi < iLo) {<NEW_LINE>return (T) createEmpty();<NEW_LINE>}<NEW_LINE>int[] intersection = Arrays.copyOfRange(((CodePointSet) o).ranges, iLo * 2, <MASK><NEW_LINE>intersection[0] = Math.max(intersection[0], getMin());<NEW_LINE>intersection[intersection.length - 1] = Math.min(intersection[intersection.length - 1], getMax());<NEW_LINE>return (T) create(intersection);<NEW_LINE>}
(iHi + 1) * 2);
731,907
protected void toStringWithIndentation(StringBuilder result, int level) {<NEW_LINE>// Spaces and tabs are dropped by IntelliJ logcat integration, so rely on __ instead.<NEW_LINE>StringBuilder indentation = new StringBuilder();<NEW_LINE>for (int i = 0; i < level; ++i) {<NEW_LINE>indentation.append("__");<NEW_LINE>}<NEW_LINE>result.append(indentation.toString());<NEW_LINE>result.append("id:").append(getId());<NEW_LINE>result.append(" className:").append(getViewClass()).append(" ");<NEW_LINE>// result.append(mFlexNodeStyle.toString());<NEW_LINE>result.append(resultToString());<NEW_LINE>if (getChildCount() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>result.append(", children: [\n");<NEW_LINE>for (int i = 0; i < getChildCount(); i++) {<NEW_LINE>getChildAt(i).<MASK><NEW_LINE>result.append("\n");<NEW_LINE>}<NEW_LINE>result.append(indentation).append("]");<NEW_LINE>}
toStringWithIndentation(result, level + 1);
1,478,321
public BillingDetails unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>BillingDetails billingDetails = new BillingDetails();<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("billedMemoryUsedInMB", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>billingDetails.setBilledMemoryUsedInMB(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("billedDurationInMilliseconds", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>billingDetails.setBilledDurationInMilliseconds(context.getUnmarshaller(Long.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return billingDetails;<NEW_LINE>}
class).unmarshall(context));
1,656,404
public boolean apply(Game game, Ability source) {<NEW_LINE>Permanent permanent = (Permanent) game.getLastKnownInformation(targetPointer.getFirst(game<MASK><NEW_LINE>if (permanent == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Player owner = game.getPlayer(permanent.getOwnerId());<NEW_LINE>MageObject sourceObject = game.getObject(source);<NEW_LINE>if (owner == null || sourceObject == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (owner.getLibrary().hasCards()) {<NEW_LINE>Card card = owner.getLibrary().getFromTop(game);<NEW_LINE>if (card != null) {<NEW_LINE>Cards cards = new CardsImpl(card);<NEW_LINE>owner.revealCards(sourceObject.getIdName(), cards, game);<NEW_LINE>if (new FilterPermanentCard().match(card, game)) {<NEW_LINE>owner.moveCards(card, Zone.BATTLEFIELD, source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
, source), Zone.BATTLEFIELD);
125,272
private static void createReprInDocument(XTextDocument doc, String refMarkName, XTextCursor position, boolean insertSpaceAfter, boolean withoutBrackets) throws CreationException {<NEW_LINE>// The cursor we received: we push it before us.<NEW_LINE>position.collapseToEnd();<NEW_LINE>XTextCursor cursor = safeInsertSpacesBetweenReferenceMarks(position.getEnd(), 2);<NEW_LINE>// cursors before the first and after the last space<NEW_LINE>XTextCursor cursorBefore = cursor.getText().createTextCursorByRange(cursor.getStart());<NEW_LINE>XTextCursor cursorAfter = cursor.getText().createTextCursorByRange(cursor.getEnd());<NEW_LINE>cursor.collapseToStart();<NEW_LINE>cursor.goRight<MASK><NEW_LINE>// now we are between two spaces<NEW_LINE>final String left = NamedRangeReferenceMark.REFERENCE_MARK_LEFT_BRACKET;<NEW_LINE>final String right = NamedRangeReferenceMark.REFERENCE_MARK_RIGHT_BRACKET;<NEW_LINE>String bracketedContent = (withoutBrackets ? "" : left + right);<NEW_LINE>cursor.getText().insertString(cursor, bracketedContent, true);<NEW_LINE>UnoReferenceMark.create(doc, refMarkName, cursor, true);<NEW_LINE>// eat the first inserted space<NEW_LINE>cursorBefore.goRight((short) 1, true);<NEW_LINE>cursorBefore.setString("");<NEW_LINE>if (!insertSpaceAfter) {<NEW_LINE>// eat the second inserted space<NEW_LINE>cursorAfter.goLeft((short) 1, true);<NEW_LINE>cursorAfter.setString("");<NEW_LINE>}<NEW_LINE>}
((short) 1, false);
544,413
private static ObjectArrayEventType makeTransientOATypeInternal(String enumMethod, Map<String, Object> boxedPropertyTypes, String eventTypeNameUUid, StatementRawInfo statementRawInfo, StatementCompileTimeServices services) {<NEW_LINE>String eventTypeName = services.getEventTypeNameGeneratorStatement().getAnonymousTypeNameEnumMethod(enumMethod, eventTypeNameUUid);<NEW_LINE>EventTypeMetadata metadata = new EventTypeMetadata(eventTypeName, statementRawInfo.getModuleName(), EventTypeTypeClass.ENUMDERIVED, EventTypeApplicationType.OBJECTARR, NameAccessModifier.TRANSIENT, EventTypeBusModifier.NONBUS, false, EventTypeIdPair.unassigned());<NEW_LINE>ObjectArrayEventType oatype = BaseNestableEventUtil.makeOATypeCompileTime(metadata, boxedPropertyTypes, null, null, null, null, services.getBeanEventTypeFactoryPrivate(), services.getEventTypeCompileTimeResolver());<NEW_LINE>services.<MASK><NEW_LINE>return oatype;<NEW_LINE>}
getEventTypeCompileTimeRegistry().newType(oatype);
1,374,609
public void correctMetadataForList(String listId) {<NEW_LINE>StoreObject <MASK><NEW_LINE>if (list == GtasksListService.LIST_NOT_FOUND_OBJECT)<NEW_LINE>return;<NEW_LINE>updateParentSiblingMapsFor(list);<NEW_LINE>final AtomicLong order = new AtomicLong(0);<NEW_LINE>final AtomicInteger previousIndent = new AtomicInteger(-1);<NEW_LINE>gtasksMetadataService.iterateThroughList(list, new OrderedListIterator() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void processTask(long taskId, Metadata metadata) {<NEW_LINE>metadata.setValue(GtasksMetadata.ORDER, order.getAndAdd(1));<NEW_LINE>int indent = metadata.getValue(GtasksMetadata.INDENT);<NEW_LINE>if (indent > previousIndent.get() + 1)<NEW_LINE>indent = previousIndent.get() + 1;<NEW_LINE>metadata.setValue(GtasksMetadata.INDENT, indent);<NEW_LINE>Long parent = parents.get(taskId);<NEW_LINE>if (parent == null || parent < 0)<NEW_LINE>parent = Task.NO_ID;<NEW_LINE>metadata.setValue(GtasksMetadata.PARENT_TASK, parent);<NEW_LINE>PluginServices.getMetadataService().save(metadata);<NEW_LINE>previousIndent.set(indent);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
list = gtasksListService.getList(listId);
758,574
private int convertFromOneside(int value, @Nonnull Side side, boolean approximate, int index) {<NEW_LINE>if (index < 0) {<NEW_LINE>return convert(getFragments(side, true), value, approximate);<NEW_LINE>}<NEW_LINE>CorrectedChange change = myChanges.get(index);<NEW_LINE>int shift = change.newLength - change.oldLength;<NEW_LINE>if (value < change.startOneside) {<NEW_LINE>// So' -> Sm', So' -> Su'<NEW_LINE>// So' == So; Sm' == Sm; Su' == Su<NEW_LINE>// value = So'<NEW_LINE>return convertFromOneside(value, side, approximate, index - 1);<NEW_LINE>}<NEW_LINE>if (value >= change.startOneside + change.newLength) {<NEW_LINE>// Eo' -> Em', Eo' -> Eu'<NEW_LINE>// Eo' == Eo + shift; Em' == Em + shift; Eu' == Eu<NEW_LINE>// value = Eo'<NEW_LINE>int converted = convertFromOneside(value - shift, side, approximate, index - 1);<NEW_LINE>return append(converted, side == change.side ? shift : 0);<NEW_LINE>}<NEW_LINE>if (side != change.side) {<NEW_LINE>// Mo' -> Mu'<NEW_LINE>if (!approximate)<NEW_LINE>return -1;<NEW_LINE>// we can't convert Mo' into Mo. And thus get valid Mu/Mu'.<NEW_LINE>// return: Au'<NEW_LINE>return convertFromOneside(change.startOneside, <MASK><NEW_LINE>} else {<NEW_LINE>// Mo' -> Mm'<NEW_LINE>// Ao == Ao'; Am == Am'; Mo' - Ao' == Mm' - Am'<NEW_LINE>// value = Mo'<NEW_LINE>int convertedStart = convertFromOneside(change.startOneside, side, approximate, index - 1);<NEW_LINE>return append(convertedStart, value - change.startOneside);<NEW_LINE>}<NEW_LINE>}
side, approximate, index - 1);
1,269,080
public GetVoiceConnectorTerminationHealthResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetVoiceConnectorTerminationHealthResult getVoiceConnectorTerminationHealthResult = new GetVoiceConnectorTerminationHealthResult();<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 getVoiceConnectorTerminationHealthResult;<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("TerminationHealth", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getVoiceConnectorTerminationHealthResult.setTerminationHealth(TerminationHealthJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return getVoiceConnectorTerminationHealthResult;<NEW_LINE>}
().unmarshall(context));
1,846,814
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>* @see<NEW_LINE>* com.aptana.ide.core.io.auth.IAuthenticationPrompt#promptPassword(com.aptana.ide.core.io.auth.IAuthenticationManager<NEW_LINE>* , java.lang.String, java.lang.String, java.lang.String, java.lang.String)<NEW_LINE>*/<NEW_LINE>public boolean promptPassword(final IAuthenticationManager authManager, final String authId, final String login, final String title, final String message) {<NEW_LINE>final boolean[] result <MASK><NEW_LINE>if (PlatformUI.isWorkbenchRunning()) {<NEW_LINE>PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>PasswordPromptDialog dlg = new PasswordPromptDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), title, message);<NEW_LINE>dlg.setLogin(login);<NEW_LINE>dlg.setPassword(authManager.getPassword(authId));<NEW_LINE>dlg.setSavePassword(authManager.hasPersistent(authId));<NEW_LINE>if (dlg.open() == Window.OK) {<NEW_LINE>authManager.setPassword(authId, dlg.getPassword(), dlg.getSavePassword());<NEW_LINE>result[0] = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return result[0];<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
= new boolean[] { false };
1,470,300
private void pushBalaToCustomRepo(Path balaFilePath) {<NEW_LINE>ProjectEnvironmentBuilder defaultBuilder = ProjectEnvironmentBuilder.getDefaultBuilder();<NEW_LINE>defaultBuilder.addCompilationCacheFactory(TempDirCompilationCache::from);<NEW_LINE>BalaProject balaProject = BalaProject.loadProject(defaultBuilder, balaFilePath);<NEW_LINE>Path repoPath = RepoUtils.createAndGetHomeReposPath().resolve(ProjectConstants.REPOSITORIES_DIR).resolve(ProjectConstants.LOCAL_REPOSITORY_NAME);<NEW_LINE>String org = balaProject.currentPackage().packageOrg().value();<NEW_LINE>String packageName = balaProject.currentPackage().packageName().value();<NEW_LINE>String version = balaProject.currentPackage().packageVersion().toString();<NEW_LINE><MASK><NEW_LINE>String ballerinaShortVersion = RepoUtils.getBallerinaShortVersion();<NEW_LINE>Path balaDestPath = repoPath.resolve(ProjectConstants.BALA_DIR_NAME).resolve(org).resolve(packageName).resolve(version).resolve(platform);<NEW_LINE>Path balaCachesPath = repoPath.resolve(ProjectConstants.CACHES_DIR_NAME + "-" + ballerinaShortVersion).resolve(org).resolve(packageName).resolve(version);<NEW_LINE>try {<NEW_LINE>if (Files.exists(balaDestPath)) {<NEW_LINE>ProjectUtils.deleteDirectory(balaDestPath);<NEW_LINE>}<NEW_LINE>if (Files.exists(balaCachesPath)) {<NEW_LINE>ProjectUtils.deleteDirectory(balaCachesPath);<NEW_LINE>}<NEW_LINE>ProjectUtils.extractBala(balaFilePath, balaDestPath);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new ProjectException("error while pushing bala file '" + balaFilePath + "' to '" + ProjectConstants.LOCAL_REPOSITORY_NAME + "' repository. " + e.getMessage());<NEW_LINE>}<NEW_LINE>Path relativePathToBalaFile;<NEW_LINE>if (this.balaPath != null) {<NEW_LINE>relativePathToBalaFile = balaFilePath;<NEW_LINE>} else {<NEW_LINE>relativePathToBalaFile = userDir.relativize(balaFilePath);<NEW_LINE>}<NEW_LINE>outStream.println("Successfully pushed " + relativePathToBalaFile + " to '" + repositoryName + "' repository.");<NEW_LINE>}
String platform = balaProject.platform();
753,346
public void run(RegressionEnvironment env) {<NEW_LINE>RegressionPath path = new RegressionPath();<NEW_LINE>String expression = "@public create expression cc { (a,v1,b,v2,c) -> a.p00 || v1 || b.p00 || v2 || c.p00}";<NEW_LINE><MASK><NEW_LINE>String epl = "@name('s0') select cc(e2, 'x', e3, 'y', e1) as c0 from \n" + "SupportBean_S0(id=1)#lastevent as e1, SupportBean_S0(id=2)#lastevent as e2, SupportBean_S0(id=3)#lastevent as e3;\n" + "@name('s1') select cc(e2, 'x', e3, 'y', e1) as c0 from \n" + "SupportBean_S0(id=1)#lastevent as e3, SupportBean_S0(id=2)#lastevent as e2, SupportBean_S0(id=3)#lastevent as e1;\n" + "@name('s2') select cc(e1, 'x', e2, 'y', e3) as c0 from \n" + "SupportBean_S0(id=1)#lastevent as e3, SupportBean_S0(id=2)#lastevent as e2, SupportBean_S0(id=3)#lastevent as e1;\n";<NEW_LINE>env.compileDeploy(epl, path).addListener("s0").addListener("s1").addListener("s2");<NEW_LINE>assertTypeExpected(env, String.class);<NEW_LINE>env.sendEventBean(new SupportBean_S0(1, "A"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(3, "C"));<NEW_LINE>env.sendEventBean(new SupportBean_S0(2, "B"));<NEW_LINE>env.assertEqualsNew("s0", "c0", "BxCyA");<NEW_LINE>env.assertEqualsNew("s1", "c0", "BxAyC");<NEW_LINE>env.assertEqualsNew("s2", "c0", "CxByA");<NEW_LINE>env.undeployAll();<NEW_LINE>}
env.compileDeploy(expression, path);
1,309,571
public void process(GrayU8 input) {<NEW_LINE>// input = im_0<NEW_LINE>removedWatersheds = false;<NEW_LINE>output.reshape(input.width + 2, input.height + 2);<NEW_LINE>distance.reshape(input.width + 2, input.height + 2);<NEW_LINE>ImageMiscOps.fill(output, INIT);<NEW_LINE><MASK><NEW_LINE>fifo.reset();<NEW_LINE>// sort pixels<NEW_LINE>sortPixels(input);<NEW_LINE>currentLabel = 0;<NEW_LINE>for (int i = 0; i < histogram.length; i++) {<NEW_LINE>DogArray_I32 level = histogram[i];<NEW_LINE>if (level.size == 0)<NEW_LINE>continue;<NEW_LINE>// Go through each pixel at this level and mark them according to their neighbors<NEW_LINE>for (int j = 0; j < level.size; j++) {<NEW_LINE>int index = level.data[j];<NEW_LINE>output.data[index] = MASK;<NEW_LINE>// see if its neighbors has been labeled, if so set its distance and add to queue<NEW_LINE>assignNewToNeighbors(index);<NEW_LINE>}<NEW_LINE>currentDistance = 1;<NEW_LINE>fifo.add(MARKER_PIXEL);<NEW_LINE>while (true) {<NEW_LINE>int p = fifo.popHead();<NEW_LINE>// end of a cycle. Exit the loop if it is done or increase the distance and continue processing<NEW_LINE>if (p == MARKER_PIXEL) {<NEW_LINE>if (fifo.isEmpty())<NEW_LINE>break;<NEW_LINE>else {<NEW_LINE>fifo.add(MARKER_PIXEL);<NEW_LINE>currentDistance++;<NEW_LINE>p = fifo.popHead();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// look at its neighbors and see if they have been labeled or belong to a watershed<NEW_LINE>// and update its distance<NEW_LINE>checkNeighborsAssign(p);<NEW_LINE>}<NEW_LINE>// see if new minima have been discovered<NEW_LINE>for (int j = 0; j < level.size; j++) {<NEW_LINE>int index = level.get(j);<NEW_LINE>// distance associated with p is reset to 0<NEW_LINE>distance.data[index] = 0;<NEW_LINE>if (output.data[index] == MASK) {<NEW_LINE>currentLabel++;<NEW_LINE>fifo.add(index);<NEW_LINE>output.data[index] = currentLabel;<NEW_LINE>// grow the new region into the surrounding connected pixels<NEW_LINE>while (!fifo.isEmpty()) {<NEW_LINE>checkNeighborsMasks(fifo.popHead());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ImageMiscOps.fill(distance, 0);
1,709,877
private void updateIfNeeded(@NonNull final Project project, @NonNull final AntBuildExtender extender) {<NEW_LINE>// NOI18N<NEW_LINE><MASK><NEW_LINE>// NOI18N<NEW_LINE>Parameters.notNull("extender", extender);<NEW_LINE>if (extender.getExtension(J2SEDeployProperties.getCurrentExtensionName()) != null) {<NEW_LINE>// Already has a current version of extension<NEW_LINE>if (LOG.isLoggable(Level.FINE)) {<NEW_LINE>// NOI18N<NEW_LINE>LOG.// NOI18N<NEW_LINE>log(// NOI18N<NEW_LINE>Level.FINE, "The project {0} ({1}) already has a current version ({2}) of JWS extension.", new Object[] { ProjectUtils.getInformation(project).getDisplayName(), FileUtil.getFileDisplayName(project.getProjectDirectory()), J2SEDeployProperties.getCurrentExtensionName() });<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>reenter.set(Boolean.TRUE);<NEW_LINE>try {<NEW_LINE>boolean needsUpdate = false;<NEW_LINE>for (String oldExt : J2SEDeployProperties.getOldExtensionNames()) {<NEW_LINE>final AntBuildExtender.Extension extension = extender.getExtension(oldExt);<NEW_LINE>if (extension != null) {<NEW_LINE>extender.removeExtension(oldExt);<NEW_LINE>needsUpdate = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (needsUpdate) {<NEW_LINE>try {<NEW_LINE>// There was an old extension which needs to be updated<NEW_LINE>J2SEDeployProperties.updateJ2SEDeployExtension(project);<NEW_LINE>ProjectManager.getDefault().saveProject(project);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>reenter.remove();<NEW_LINE>}<NEW_LINE>}
Parameters.notNull("project", project);
711,294
public void testisUserInRoleLDAPISWar2() throws Exception {<NEW_LINE>Log.info(logClass, getCurrentTestName(), "-----Entering " + getCurrentTestName());<NEW_LINE>String queryString = EJB_WAR2_PATH + SIMPLE_SERVLET2 + "?testInstance=ejb03&testMethod=manager";<NEW_LINE>Log.info(logClass, getCurrentTestName(), "-------------Executing BasicAuthCreds");<NEW_LINE>String response = executeGetRequestBasicAuthCreds(httpclient, urlBase + queryString, LocalLdapServer.USER1, LocalLdapServer.PASSWORD, HttpServletResponse.SC_OK);<NEW_LINE>Log.info(<MASK><NEW_LINE>Log.info(logClass, getCurrentTestName(), "-------------Verifying Response");<NEW_LINE>verifyEjbUserResponse(response, Constants.getEJBBeanResponse + Constants.ejb03Bean, Constants.getEjbBeanMethodName + Constants.ejbBeanMethodManager, Constants.getEjbCallerPrincipal + LocalLdapServer.USER1);<NEW_LINE>Log.info(logClass, getCurrentTestName(), "-------------End of Verification of Response");<NEW_LINE>Log.info(logClass, getCurrentTestName(), "-----Exiting " + getCurrentTestName());<NEW_LINE>}
logClass, getCurrentTestName(), "-------------End of Response");
429,218
public void marshall(ReplicationConfigurationTemplate replicationConfigurationTemplate, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (replicationConfigurationTemplate == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getAssociateDefaultSecurityGroup(), ASSOCIATEDEFAULTSECURITYGROUP_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getBandwidthThrottling(), BANDWIDTHTHROTTLING_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getCreatePublicIP(), CREATEPUBLICIP_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getDataPlaneRouting(), DATAPLANEROUTING_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getDefaultLargeStagingDiskType(), DEFAULTLARGESTAGINGDISKTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getEbsEncryption(), EBSENCRYPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getEbsEncryptionKeyArn(), EBSENCRYPTIONKEYARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getPitPolicy(), PITPOLICY_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getReplicationConfigurationTemplateID(), REPLICATIONCONFIGURATIONTEMPLATEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getReplicationServerInstanceType(), REPLICATIONSERVERINSTANCETYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getReplicationServersSecurityGroupsIDs(), REPLICATIONSERVERSSECURITYGROUPSIDS_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getStagingAreaSubnetId(), STAGINGAREASUBNETID_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getStagingAreaTags(), STAGINGAREATAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(replicationConfigurationTemplate.getUseDedicatedReplicationServer(), USEDEDICATEDREPLICATIONSERVER_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
replicationConfigurationTemplate.getArn(), ARN_BINDING);
511,667
public void downloadFileViaToken1(String token, String range, Boolean genericMimetype, Boolean inline) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'token' is set<NEW_LINE>if (token == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'token' when calling downloadFileViaToken1");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/v4/downloads/{token}".replaceAll("\\{" + "token" + "\\}", apiClient.escapeString(token.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "generic_mimetype", genericMimetype));<NEW_LINE>localVarQueryParams.addAll(apiClient.parameterToPairs("", "inline", inline));<NEW_LINE>if (range != null)<NEW_LINE>localVarHeaderParams.put("Range", apiClient.parameterToString(range));<NEW_LINE>final String[] localVarAccepts = { "application/octet-stream" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] <MASK><NEW_LINE>apiClient.invokeAPI(localVarPath, "HEAD", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>}
localVarAuthNames = new String[] {};
104,048
public static ErrorMessage sendErrorMessage(ChannelHandlerContext ctx, Throwable cause) throws Exception {<NEW_LINE>String message = cause.getMessage();<NEW_LINE>long statusCode = StatusCodes.Bad_UnexpectedError;<NEW_LINE>if (cause instanceof UaException) {<NEW_LINE>UaException ex = (UaException) cause;<NEW_LINE>message = ex.getMessage();<NEW_LINE>statusCode = ex.getStatusCode().getValue();<NEW_LINE>} else {<NEW_LINE>Throwable innerCause = cause.getCause();<NEW_LINE>if (innerCause instanceof UaException) {<NEW_LINE>UaException ex = (UaException) innerCause;<NEW_LINE>message = ex.getMessage();<NEW_LINE>statusCode = ex.getStatusCode().getValue();<NEW_LINE>} else if (innerCause instanceof UaRuntimeException) {<NEW_LINE>UaRuntimeException ex = (UaRuntimeException) innerCause;<NEW_LINE>message = ex.getMessage();<NEW_LINE>statusCode = ex.getStatusCode().getValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ErrorMessage error <MASK><NEW_LINE>ByteBuf messageBuffer = TcpMessageEncoder.encode(error);<NEW_LINE>ctx.writeAndFlush(messageBuffer).addListener(future -> ctx.close());<NEW_LINE>return error;<NEW_LINE>}
= new ErrorMessage(statusCode, message);
385,689
final CreateContextResult executeCreateContext(CreateContextRequest createContextRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createContextRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateContextRequest> request = null;<NEW_LINE>Response<CreateContextResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new CreateContextRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createContextRequest));<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, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateContext");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateContextResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateContextResultJsonUnmarshaller());<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,311,489
public File purgeSegment() throws Exception {<NEW_LINE>SegmentMetadataImpl segmentMetadata = new SegmentMetadataImpl(_indexDir);<NEW_LINE>String segmentName = segmentMetadata.getName();<NEW_LINE>LOGGER.info("Start purging table: {}, segment: {}", _tableConfig.getTableName(), segmentName);<NEW_LINE>try (PurgeRecordReader purgeRecordReader = new PurgeRecordReader()) {<NEW_LINE>// Make a first pass through the data to see if records need to be purged or modified<NEW_LINE>while (purgeRecordReader.hasNext()) {<NEW_LINE>purgeRecordReader.next();<NEW_LINE>}<NEW_LINE>if (_numRecordsModified == 0 && _numRecordsPurged == 0) {<NEW_LINE>// Returns null if no records to be modified or purged<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SegmentGeneratorConfig config = new SegmentGeneratorConfig(_tableConfig, segmentMetadata.getSchema());<NEW_LINE>config.setOutDir(_workingDir.getPath());<NEW_LINE>config.setSegmentName(segmentName);<NEW_LINE>// Keep index creation time the same as original segment because both segments use the same raw data.<NEW_LINE>// This way, for REFRESH case, when new segment gets pushed to controller, we can use index creation time to<NEW_LINE>// identify if the new pushed segment has newer data than the existing one.<NEW_LINE>config.setCreationTime(String.valueOf(segmentMetadata.getIndexCreationTime()));<NEW_LINE>// The time column type info is not stored in the segment metadata.<NEW_LINE>// Keep segment start/end time to properly handle time column type other than EPOCH (e.g.SIMPLE_FORMAT).<NEW_LINE>if (segmentMetadata.getTimeInterval() != null) {<NEW_LINE>config.setTimeColumnName(_tableConfig.<MASK><NEW_LINE>config.setStartTime(Long.toString(segmentMetadata.getStartTime()));<NEW_LINE>config.setEndTime(Long.toString(segmentMetadata.getEndTime()));<NEW_LINE>config.setSegmentTimeUnit(segmentMetadata.getTimeUnit());<NEW_LINE>}<NEW_LINE>SegmentIndexCreationDriverImpl driver = new SegmentIndexCreationDriverImpl();<NEW_LINE>purgeRecordReader.rewind();<NEW_LINE>driver.init(config, purgeRecordReader);<NEW_LINE>driver.build();<NEW_LINE>}<NEW_LINE>LOGGER.info("Finish purging table: {}, segment: {}, purged {} records, modified {} records", _tableConfig.getTableName(), segmentName, _numRecordsPurged, _numRecordsModified);<NEW_LINE>return new File(_workingDir, segmentName);<NEW_LINE>}
getValidationConfig().getTimeColumnName());
1,337,353
public void visitCastExpression(CastExpression castExpression) {<NEW_LINE>ClassNode type = castExpression.getType();<NEW_LINE>Expression subExpression = castExpression.getExpression();<NEW_LINE>subExpression.visit(this);<NEW_LINE>if (ClassHelper.OBJECT_TYPE.equals(type))<NEW_LINE>return;<NEW_LINE>if (castExpression.isCoerce()) {<NEW_LINE>controller.getOperandStack().doAsType(type);<NEW_LINE>} else {<NEW_LINE>if (ExpressionUtils.isNullConstant(subExpression) && !ClassHelper.isPrimitiveType(type)) {<NEW_LINE>controller.getOperandStack().replace(type);<NEW_LINE>} else {<NEW_LINE>ClassNode subExprType = controller.getTypeChooser().resolveType(subExpression, controller.getClassNode());<NEW_LINE>if (castExpression.isStrict() || (!ClassHelper.isPrimitiveType(type) && WideningCategories.implementsInterfaceOrSubclassOf(subExprType, type))) {<NEW_LINE>BytecodeHelper.doCast(<MASK><NEW_LINE>controller.getOperandStack().replace(type);<NEW_LINE>} else {<NEW_LINE>controller.getOperandStack().doGroovyCast(type);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
controller.getMethodVisitor(), type);
896,305
public boolean render(@Nonnull ItemStack stack, int xPosition, int yPosition, boolean alwaysShow) {<NEW_LINE>IEnergyStorage energyItem = <MASK><NEW_LINE>if (energyItem != null) {<NEW_LINE>int maxEnergy = energyItem.getMaxEnergyStored();<NEW_LINE>if (maxEnergy > 0) {<NEW_LINE>int energy = energyItem.getEnergyStored();<NEW_LINE>if (alwaysShow || shouldShowBar(maxEnergy, energy)) {<NEW_LINE>double level = (double) energy / (double) maxEnergy;<NEW_LINE>boolean up = stack.getItem().showDurabilityBar(stack);<NEW_LINE>boolean top = stack.getCount() != 1;<NEW_LINE>render(level, xPosition, yPosition, top ? 12 : up ? 2 : 0, true);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (HIDE_VANILLA_RENDERBUG && stack.getItem().showDurabilityBar(stack)) {<NEW_LINE>overpaintVanillaRenderBug(xPosition, yPosition);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
PowerHandlerUtil.getCapability(stack, null);
53,832
private void processNextRegistrationMutation() throws InterruptedException {<NEW_LINE>RegisterMutation mutation = null;<NEW_LINE>try {<NEW_LINE>// Blocking<NEW_LINE>mutation = this.registrationQueue.take();<NEW_LINE>final <MASK><NEW_LINE>// Check if agent is still connected by the time this mutation is taken from the queue to<NEW_LINE>// be processed.<NEW_LINE>final boolean agentIsConnected = this.connectedAgentsSet.contains(mutation.getJobId());<NEW_LINE>if (agentIsConnected) {<NEW_LINE>// Register or re-register agent connection<NEW_LINE>if (mutation.isRefresh()) {<NEW_LINE>refreshAgentConnection(jobId);<NEW_LINE>} else {<NEW_LINE>registerAgentConnection(jobId);<NEW_LINE>}<NEW_LINE>// Schedule a future refresh for this agent connection<NEW_LINE>this.taskScheduler.schedule(() -> this.registrationQueue.add(RegisterMutation.refresh(jobId)), Instant.now().plus(this.properties.getRefreshInterval()));<NEW_LINE>} else {<NEW_LINE>// Unregister agent connection<NEW_LINE>unregisterAgentConnection(jobId);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>log.warn("Registration task interrupted", e);<NEW_LINE>if (mutation != null) {<NEW_LINE>// Re-enqueue mutation that was in-progress when interrupted<NEW_LINE>this.registrationQueue.add(mutation);<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
String jobId = mutation.getJobId();
1,220,329
public String signString(String stringToSign, String accessKeySecret) {<NEW_LINE>try {<NEW_LINE>Signature rsaSign = Signature.getInstance(ALGORITHM_NAME);<NEW_LINE>KeyFactory kf = KeyFactory.getInstance("RSA");<NEW_LINE>byte[] keySpec = DatatypeConverter.parseBase64Binary(checkRSASecret(accessKeySecret));<NEW_LINE>PrivateKey privateKey = kf.generatePrivate(new PKCS8EncodedKeySpec(keySpec));<NEW_LINE>rsaSign.initSign(privateKey);<NEW_LINE>rsaSign.update(stringToSign.getBytes(ENCODING));<NEW_LINE>byte[] sign = rsaSign.sign();<NEW_LINE>return hexEncode(sign);<NEW_LINE>} catch (NoSuchAlgorithmException e) {<NEW_LINE>throw new <MASK><NEW_LINE>} catch (InvalidKeySpecException e) {<NEW_LINE>throw new IllegalArgumentException(e.toString());<NEW_LINE>} catch (InvalidKeyException e) {<NEW_LINE>throw new IllegalArgumentException(e.toString());<NEW_LINE>} catch (SignatureException e) {<NEW_LINE>throw new IllegalArgumentException(e.toString());<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw new IllegalArgumentException(e.toString());<NEW_LINE>}<NEW_LINE>}
IllegalArgumentException(e.toString());
1,226,785
public void updateControllerConnections(OFBsnControllerConnectionsReply controllerCxnsReply) {<NEW_LINE>// Instantiate clean map, can't use a builder here since we need to call temp.get()<NEW_LINE>Map<URI, Map<OFAuxId, OFBsnControllerConnection>> temp = new ConcurrentHashMap<>();<NEW_LINE>List<OFBsnControllerConnection> controllerCxnUpdates = controllerCxnsReply.getConnections();<NEW_LINE>for (OFBsnControllerConnection update : controllerCxnUpdates) {<NEW_LINE>URI uri = URI.create(update.getUri());<NEW_LINE>Map<OFAuxId, OFBsnControllerConnection> cxns = temp.get(uri);<NEW_LINE>// Add to nested map<NEW_LINE>if (cxns != null) {<NEW_LINE>cxns.put(update.getAuxiliaryId(), update);<NEW_LINE>} else {<NEW_LINE>cxns = new ConcurrentHashMap<>();<NEW_LINE>cxns.put(<MASK><NEW_LINE>temp.put(uri, cxns);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.controllerConnections = ImmutableMap.<URI, Map<OFAuxId, OFBsnControllerConnection>>copyOf(temp);<NEW_LINE>}
update.getAuxiliaryId(), update);
450,320
private void initialize() {<NEW_LINE>ITileCache cache = new SharedTileCache(getContext());<NEW_LINE>cache.setCacheSize(512 * (1 << 10));<NEW_LINE>OSciMap4TileSource tileSource = new OSciMap4TileSource();<NEW_LINE>tileSource.setCache(cache);<NEW_LINE>VectorTileLayer baseLayer = map().setBaseMap(tileSource);<NEW_LINE>Layers layers = map().layers();<NEW_LINE>layers.add(drawables = <MASK><NEW_LINE>layers.add(labels = new LabelLayer(map(), baseLayer));<NEW_LINE>layers.add(buildings = new BuildingLayer(map(), baseLayer));<NEW_LINE>layers.add(items = new ItemizedLayer<MarkerItem>(map(), new MarkerSymbol(new AndroidBitmap(BitmapFactory.decodeResource(getContext().getResources(), R.drawable.nop)), 0.5F, 1)));<NEW_LINE>map().setTheme(MicrogThemes.DEFAULT);<NEW_LINE>}
new ClearableVectorLayer(map()));
1,590,880
public void randomDisplayTick(@Nonnull IBlockState bs, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull Random rand) {<NEW_LINE>T te = getTileEntity(world, pos);<NEW_LINE>if (PersonalConfig.machineParticlesEnabled.get() && te != null && te.isActive()) {<NEW_LINE>EnumFacing front = te.getFacing();<NEW_LINE>for (int i = 0; i < 2; i++) {<NEW_LINE>double px = pos.getX() + 0.5 <MASK><NEW_LINE>double pz = pos.getZ() + 0.5 + front.getFrontOffsetZ() * 0.6;<NEW_LINE>double v = 0.05;<NEW_LINE>double vx = 0;<NEW_LINE>double vz = 0;<NEW_LINE>if (front == EnumFacing.NORTH || front == EnumFacing.SOUTH) {<NEW_LINE>px += world.rand.nextFloat() * 0.9 - 0.45;<NEW_LINE>vz += front == EnumFacing.NORTH ? -v : v;<NEW_LINE>} else {<NEW_LINE>pz += world.rand.nextFloat() * 0.9 - 0.45;<NEW_LINE>vx += front == EnumFacing.WEST ? -v : v;<NEW_LINE>}<NEW_LINE>if (rand.nextInt(20) == 0) {<NEW_LINE>world.spawnParticle(EnumParticleTypes.LAVA, px, pos.getY() + 0.1, pz, 0, 0, 0);<NEW_LINE>}<NEW_LINE>world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, px, pos.getY() + 0.1, pz, vx, 0, vz);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
+ front.getFrontOffsetX() * 0.6;
1,630,345
public QuickConnectConfig unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>QuickConnectConfig quickConnectConfig = new QuickConnectConfig();<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("QuickConnectType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>quickConnectConfig.setQuickConnectType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("UserConfig", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>quickConnectConfig.setUserConfig(UserQuickConnectConfigJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("QueueConfig", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>quickConnectConfig.setQueueConfig(QueueQuickConnectConfigJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("PhoneConfig", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>quickConnectConfig.setPhoneConfig(PhoneNumberQuickConnectConfigJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return quickConnectConfig;<NEW_LINE>}
().unmarshall(context));
1,349,841
private Optional<EventStreamInfo> createEventStreamInfo(Model model, OperationShape operation, StructureShape structure, MemberShape member) {<NEW_LINE>Shape eventStreamTarget = model.expectShape(member.getTarget());<NEW_LINE>// Compute the events of the event stream.<NEW_LINE>Map<String, StructureShape> events = new HashMap<>();<NEW_LINE>if (eventStreamTarget.asUnionShape().isPresent()) {<NEW_LINE>for (MemberShape unionMember : eventStreamTarget.asUnionShape().get().getAllMembers().values()) {<NEW_LINE>model.getShape(unionMember.getTarget()).flatMap(Shape::asStructureShape).ifPresent(struct -> {<NEW_LINE>events.put(unionMember.getMemberName(), struct);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} else if (eventStreamTarget.asStructureShape().isPresent()) {<NEW_LINE>events.put(member.getMemberName(), eventStreamTarget.asStructureShape().get());<NEW_LINE>} else {<NEW_LINE>// If the event target is an invalid type, then we can't create the indexed result.<NEW_LINE>LOGGER.severe(() -> String.format("Skipping event stream info for %s because the %s member target %s is not a structure or union", operation.getId(), member.getMemberName(), member.getTarget()));<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>Map<String, MemberShape> initialMembers = new HashMap<>();<NEW_LINE>Map<String, Shape> initialTargets = new HashMap<>();<NEW_LINE>for (MemberShape structureMember : structure.getAllMembers().values()) {<NEW_LINE>if (!structureMember.getMemberName().equals(member.getMemberName())) {<NEW_LINE>model.getShape(structureMember.getTarget()).ifPresent(shapeTarget -> {<NEW_LINE>initialMembers.put(structureMember.getMemberName(), structureMember);<NEW_LINE>initialTargets.put(<MASK><NEW_LINE>});<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return Optional.of(new EventStreamInfo(operation, eventStreamTarget.expectTrait(StreamingTrait.class), structure, member, eventStreamTarget, initialMembers, initialTargets, events));<NEW_LINE>}
structureMember.getMemberName(), shapeTarget);
1,808,705
public final void consume(String text) {<NEW_LINE>if ("".equals(text)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Some token producers treat "-1" as one token even though the sign is<NEW_LINE>// actually separate.<NEW_LINE>// This is not a problem with parsed code, but is often a problem with<NEW_LINE>// optimized parse trees and other programmatically generated AST nodes.<NEW_LINE>// To avoid problems downstream, such as conflating "x - -1" with "x--1",<NEW_LINE>// we split numeric tokens with a sign into two tokens.<NEW_LINE>if (text.length() >= 2) {<NEW_LINE>char <MASK><NEW_LINE>if (c0 == '-' || c0 == '+') {<NEW_LINE>char c1 = text.charAt(1);<NEW_LINE>if ('0' <= c1 && c1 <= '9') {<NEW_LINE>pending.add(c0 == '-' ? "-" : "+");<NEW_LINE>pending.add(text.substring(1));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pending.add(text);<NEW_LINE>}
c0 = text.charAt(0);
1,683,259
// Returns true if a segment of multipathA intersects point_b.<NEW_LINE>static boolean linearPathIntersectsPoint_(MultiPath multipathA, Point2D ptB, double tolerance) {<NEW_LINE>Point2D closest = new Point2D();<NEW_LINE>double toleranceSq = tolerance * tolerance;<NEW_LINE>SegmentIteratorImpl segIterA = ((MultiPathImpl) multipathA._getImpl()).querySegmentIterator();<NEW_LINE>GeometryAccelerators accel = ((MultiPathImpl) multipathA._getImpl())._getAccelerators();<NEW_LINE>if (accel != null) {<NEW_LINE>QuadTreeImpl quadTreeA = accel.getQuadTree();<NEW_LINE>if (quadTreeA != null) {<NEW_LINE>Envelope2D env_b = new Envelope2D();<NEW_LINE>env_b.setCoords(ptB);<NEW_LINE>QuadTreeImpl.QuadTreeIteratorImpl qt_iter = quadTreeA.getIterator(env_b, tolerance);<NEW_LINE>for (int e = qt_iter.next(); e != -1; e = qt_iter.next()) {<NEW_LINE>segIterA.resetToVertex(quadTreeA.getElement(e));<NEW_LINE>if (segIterA.hasNextSegment()) {<NEW_LINE>Segment segmentA = segIterA.nextSegment();<NEW_LINE>double t = segmentA.getClosestCoordinate(ptB, false);<NEW_LINE>segmentA.getCoord2D(t, closest);<NEW_LINE>if (Point2D.sqrDistance(ptB, closest) <= toleranceSq) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Envelope2D env_a = new Envelope2D();<NEW_LINE>while (segIterA.nextPath()) {<NEW_LINE>while (segIterA.hasNextSegment()) {<NEW_LINE><MASK><NEW_LINE>segmentA.queryEnvelope2D(env_a);<NEW_LINE>env_a.inflate(tolerance, tolerance);<NEW_LINE>if (!env_a.contains(ptB)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>double t = segmentA.getClosestCoordinate(ptB, false);<NEW_LINE>segmentA.getCoord2D(t, closest);<NEW_LINE>if (Point2D.sqrDistance(ptB, closest) <= toleranceSq) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
Segment segmentA = segIterA.nextSegment();
1,694,075
public SnowconeDeviceConfiguration unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SnowconeDeviceConfiguration snowconeDeviceConfiguration = new SnowconeDeviceConfiguration();<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("WirelessConnection", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>snowconeDeviceConfiguration.setWirelessConnection(WirelessConnectionJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return snowconeDeviceConfiguration;<NEW_LINE>}
().unmarshall(context));
707,775
public static void moveCaretToNextWord(@Nonnull Editor editor, boolean isWithSelection, boolean camel) {<NEW_LINE>Document document = editor.getDocument();<NEW_LINE>SelectionModel selectionModel = editor.getSelectionModel();<NEW_LINE>int selectionStart = selectionModel.getLeadSelectionOffset();<NEW_LINE><MASK><NEW_LINE>LogicalPosition blockSelectionStart = caretModel.getLogicalPosition();<NEW_LINE>int offset = caretModel.getOffset();<NEW_LINE>if (offset == document.getTextLength()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int newOffset;<NEW_LINE>FoldRegion currentFoldRegion = editor.getFoldingModel().getCollapsedRegionAtOffset(offset);<NEW_LINE>if (currentFoldRegion != null) {<NEW_LINE>newOffset = currentFoldRegion.getEndOffset();<NEW_LINE>} else {<NEW_LINE>newOffset = offset + 1;<NEW_LINE>int lineNumber = caretModel.getLogicalPosition().line;<NEW_LINE>if (lineNumber >= document.getLineCount())<NEW_LINE>return;<NEW_LINE>int maxOffset = document.getLineEndOffset(lineNumber);<NEW_LINE>if (newOffset > maxOffset) {<NEW_LINE>if (lineNumber + 1 >= document.getLineCount()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>maxOffset = document.getLineEndOffset(lineNumber + 1);<NEW_LINE>}<NEW_LINE>for (; newOffset < maxOffset; newOffset++) {<NEW_LINE>if (isWordOrLexemeStart(editor, newOffset, camel)) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>FoldRegion foldRegion = editor.getFoldingModel().getCollapsedRegionAtOffset(newOffset);<NEW_LINE>if (foldRegion != null) {<NEW_LINE>newOffset = foldRegion.getStartOffset();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (editor instanceof DesktopEditorImpl) {<NEW_LINE>int boundaryOffset = ((DesktopEditorImpl) editor).findNearestDirectionBoundary(offset, true);<NEW_LINE>if (boundaryOffset >= 0) {<NEW_LINE>newOffset = Math.min(boundaryOffset, newOffset);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>caretModel.moveToOffset(newOffset);<NEW_LINE>EditorModificationUtil.scrollToCaret(editor);<NEW_LINE>setupSelection(editor, isWithSelection, selectionStart, blockSelectionStart);<NEW_LINE>}
CaretModel caretModel = editor.getCaretModel();
1,709,434
public ProfilingPoint create(Lookup.Provider project) {<NEW_LINE>if (project == null) {<NEW_LINE>// project not defined, will be detected from most active Editor or Main Project will be used<NEW_LINE>project = Utils.getCurrentProject();<NEW_LINE>}<NEW_LINE>CodeProfilingPoint.Location[] selectionLocations = Utils.getCurrentSelectionLocations();<NEW_LINE>if (selectionLocations.length != 2) {<NEW_LINE>CodeProfilingPoint.Location location = Utils.getCurrentLocation(CodeProfilingPoint.Location.OFFSET_START);<NEW_LINE>if (location.equals(CodeProfilingPoint.Location.EMPTY)) {<NEW_LINE>// NOI18N<NEW_LINE>String filename = "";<NEW_LINE>// NOI18N<NEW_LINE>String name = Utils.getUniqueName(getType(), "", project);<NEW_LINE>return new StopwatchProfilingPoint(name, location, null, project, this);<NEW_LINE>} else {<NEW_LINE>File file = FileUtil.normalizeFile(new File(location.getFile()));<NEW_LINE>String filename = FileUtil.toFileObject(file).getName();<NEW_LINE>String name = // NOI18N<NEW_LINE>Utils.// NOI18N<NEW_LINE>getUniqueName(// NOI18N<NEW_LINE>getType(), // NOI18N<NEW_LINE>Bundle.StopwatchProfilingPointFactory_PpDefaultName("", filename, location.getLine()), project);<NEW_LINE>return new StopwatchProfilingPoint(name, location, null, project, this);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>CodeProfilingPoint.Location startLocation = selectionLocations[0];<NEW_LINE>CodeProfilingPoint.Location endLocation = selectionLocations[1];<NEW_LINE>File file = FileUtil.normalizeFile(new File<MASK><NEW_LINE>String filename = FileUtil.toFileObject(file).getName();<NEW_LINE>String name = // NOI18N<NEW_LINE>Utils.// NOI18N<NEW_LINE>getUniqueName(// NOI18N<NEW_LINE>getType(), // NOI18N<NEW_LINE>Bundle.StopwatchProfilingPointFactory_PpDefaultName("", filename, startLocation.getLine()), project);<NEW_LINE>return new StopwatchProfilingPoint(name, startLocation, endLocation, project, this);<NEW_LINE>}<NEW_LINE>}
(startLocation.getFile()));
1,198,320
public boolean generateVMSetupCommand(Long ssAHostId) {<NEW_LINE>HostVO ssAHost = _hostDao.findById(ssAHostId);<NEW_LINE>if (ssAHost.getType() != Host.Type.SecondaryStorageVM) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>String ssvmName = ssAHost.getName();<NEW_LINE>SecondaryStorageVmVO secStorageVm = _secStorageVmDao.findByInstanceName(ssvmName);<NEW_LINE>if (secStorageVm == null) {<NEW_LINE>s_logger.warn(String.format("Secondary storage VM [%s] does not exist.", ssvmName));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>SecStorageVMSetupCommand setupCmd = new SecStorageVMSetupCommand();<NEW_LINE>if (_allowedInternalSites != null) {<NEW_LINE>List<String> allowedCidrs = new ArrayList<>();<NEW_LINE>String[] cidrs = _allowedInternalSites.split(",");<NEW_LINE>for (String cidr : cidrs) {<NEW_LINE>if (NetUtils.isValidIp4Cidr(cidr) || NetUtils.isValidIp4(cidr) || !cidr.startsWith("0.0.0.0")) {<NEW_LINE>allowedCidrs.add(cidr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setupCmd.setAllowedInternalSites(allowedCidrs.toArray(new String[allowedCidrs.size()]));<NEW_LINE>}<NEW_LINE>String copyPasswd = _configDao.getValue("secstorage.copy.password");<NEW_LINE>setupCmd.setCopyPassword(copyPasswd);<NEW_LINE>setupCmd.setCopyUserName(TemplateConstants.DEFAULT_HTTP_AUTH_USER);<NEW_LINE>Answer answer = <MASK><NEW_LINE>if (answer != null && answer.getResult()) {<NEW_LINE>if (s_logger.isDebugEnabled()) {<NEW_LINE>s_logger.debug(String.format("Successfully set HTTP auth into secondary storage VM [%s].", ssvmName));<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>if (s_logger.isDebugEnabled()) {<NEW_LINE>s_logger.debug(String.format("Failed to set HTTP auth into secondary storage VM [%s] due to [%s].", ssvmName, answer == null ? "answer null" : answer.getDetails()));<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
_agentMgr.easySend(ssAHostId, setupCmd);
1,433,217
void loadNameFromL5DataRow(Cursor nameCursor) {<NEW_LINE>this.fname = nameCursor.getString(ContactsApiLevel5.DATA_COLUMN_NAME_FIRST);<NEW_LINE>this.lname = nameCursor.getString(ContactsApiLevel5.DATA_COLUMN_NAME_LAST);<NEW_LINE>this.pname = nameCursor.getString(ContactsApiLevel5.DATA_COLUMN_NAME_PREFIX);<NEW_LINE>this.mname = <MASK><NEW_LINE>this.sname = nameCursor.getString(ContactsApiLevel5.DATA_COLUMN_NAME_SUFFIX);<NEW_LINE>this.fphonetic = nameCursor.getString(ContactsApiLevel5.DATA_COLUMN_DATA9);<NEW_LINE>this.mphonetic = nameCursor.getString(ContactsApiLevel5.DATA_COLUMN_DATA8);<NEW_LINE>this.lphonetic = nameCursor.getString(ContactsApiLevel5.DATA_COLUMN_DATA7);<NEW_LINE>}
nameCursor.getString(ContactsApiLevel5.DATA_COLUMN_NAME_MIDDLE);
237,742
public static CompletionStage<?> send(ResteasyReactiveRequestContext context, List<PublisherResponseHandler.StreamingResponseCustomizer> customizers, Object entity, String prefix) {<NEW_LINE>ServerHttpResponse response = context.serverResponse();<NEW_LINE>if (response.closed()) {<NEW_LINE>// FIXME: check spec<NEW_LINE>return CompletableFuture.completedFuture(null);<NEW_LINE>}<NEW_LINE>byte[] data;<NEW_LINE>try {<NEW_LINE>data = serialiseEntity(context, entity);<NEW_LINE>} catch (Exception e) {<NEW_LINE>CompletableFuture<?> ret = new CompletableFuture<>();<NEW_LINE>ret.completeExceptionally(e);<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>setHeaders(context, response, customizers);<NEW_LINE>if (prefix != null) {<NEW_LINE>byte[] prefixBytes = prefix.getBytes(StandardCharsets.US_ASCII);<NEW_LINE>byte[] prefixedData = new byte[prefixBytes.length + data.length];<NEW_LINE>System.arraycopy(prefixBytes, 0, prefixedData, 0, prefixBytes.length);<NEW_LINE>System.arraycopy(data, 0, prefixedData, <MASK><NEW_LINE>data = prefixedData;<NEW_LINE>}<NEW_LINE>return response.write(data);<NEW_LINE>}
prefixBytes.length, data.length);
356,349
public void serialize(OutputStream baos) throws IOException {<NEW_LINE>Deque<Pair<String, TemplateNode>> stack = new ArrayDeque<>();<NEW_LINE>Set<String> alignedPrefix = new HashSet<>();<NEW_LINE>ReadWriteIOUtils.write(getName(), baos);<NEW_LINE>ReadWriteIOUtils.write(isShareTime(), baos);<NEW_LINE>if (isShareTime()) {<NEW_LINE>alignedPrefix.add("");<NEW_LINE>}<NEW_LINE>for (TemplateNode child : children.values()) {<NEW_LINE>stack.push(new Pair<>("", child));<NEW_LINE>}<NEW_LINE>while (stack.size() != 0) {<NEW_LINE>Pair<String, TemplateNode> cur = stack.pop();<NEW_LINE>String prefix = cur.left;<NEW_LINE>TemplateNode curNode = cur.right;<NEW_LINE>StringBuilder fullPath = new StringBuilder(prefix);<NEW_LINE>if (!curNode.isMeasurement()) {<NEW_LINE>if (!"".equals(prefix)) {<NEW_LINE>fullPath.append(TsFileConstant.PATH_SEPARATOR);<NEW_LINE>}<NEW_LINE>fullPath.append(curNode.getName());<NEW_LINE>if (curNode.isShareTime()) {<NEW_LINE>alignedPrefix.add(fullPath.toString());<NEW_LINE>}<NEW_LINE>for (TemplateNode child : curNode.getChildren().values()) {<NEW_LINE>stack.push(new Pair<>(fullPath.toString(), child));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// For each measurement, serialized as: prefixPath, isAlgined, [MeasurementNode]<NEW_LINE>ReadWriteIOUtils.write(prefix, baos);<NEW_LINE>if (alignedPrefix.contains(prefix)) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>ReadWriteIOUtils.write(false, baos);<NEW_LINE>}<NEW_LINE>curNode.serialize(baos);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ReadWriteIOUtils.write(true, baos);
530,415
public Optional<DocOutBoundRecipient> provideMailRecipient(@NonNull final DocOutboundLogMailRecipientRequest request) {<NEW_LINE>if (request.getRecordRef() == null) {<NEW_LINE>Loggables.addLog("provideMailRecipient - docOutboundLogRecord has no AD_Table_ID/Record_ID => return 'no recipient'; request={}", request);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final Mailbox mailbox = findMailboxOrNull(request);<NEW_LINE>if (mailbox == null) {<NEW_LINE>Loggables.addLog("provideMailRecipient - return 'no recipient'; mailbox={}", mailbox);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>// check if the column for the user is specified<NEW_LINE>final String userToColumnName = mailbox.getUserToColumnName();<NEW_LINE>if (!Check.isEmpty(userToColumnName, true)) {<NEW_LINE>final IADTableDAO adTableDAO = Services.get(IADTableDAO.class);<NEW_LINE>final String tableName = request.getRecordRef().getTableName();<NEW_LINE>final boolean existsColumn = tableName != null && adTableDAO.hasColumnName(tableName, userToColumnName);<NEW_LINE>Loggables.addLog("provideMailRecipient - Mail config has userToColumnName={}; column exists: {}; mailbox={}", userToColumnName, existsColumn, mailbox);<NEW_LINE>if (existsColumn) {<NEW_LINE>final IContextAware context = PlainContextAware.newWithThreadInheritedTrx();<NEW_LINE>final Object referencedModel = request.getRecordRef().getModel(context);<NEW_LINE>// load the column content<NEW_LINE>final Integer userRepoId = getValueOrNull(referencedModel, userToColumnName);<NEW_LINE>if (userRepoId == null || userRepoId < 0) {<NEW_LINE>Loggables.addLog("provideMailRecipient - Record model has {}={} => return 'no recipient'", userToColumnName, userRepoId);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>if (userRepoId == 0) {<NEW_LINE>Loggables.addLog("provideMailRecipient - Record model has {}={} (system-user) => return 'no recipient'", userToColumnName, userRepoId);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final DocOutBoundRecipientId docOutBoundRecipientId = DocOutBoundRecipientId.ofRepoId(userRepoId);<NEW_LINE>final DocOutBoundRecipient user = docOutBoundRecipientRepository.getById(docOutBoundRecipientId);<NEW_LINE>if (Check.isEmpty(user.getEmailAddress(), true)) {<NEW_LINE>Loggables.addLog("provideMailRecipient - user-id {} has no/empty emailAddress => return 'no recipient'; user={}", <MASK><NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>return Optional.of(user);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Loggables.addLog("provideMailRecipient - return 'no recipient'; mailbox={}", mailbox);<NEW_LINE>return Optional.empty();<NEW_LINE>}
user.getId(), user);
677,310
private MultiAppStructues createMultiAppStructure(String numberofApps) {<NEW_LINE>// create input data<NEW_LINE>AppStructure reqPOJO1 = createAppData("myApp1", "Famous myApp1", true, AppStructure.SecurityType.NO_SECURITY, AppStructure.GenreType.GAME, createPriceList(Price.PurchaseType.BLUEPOINTS, 200, null, 100), "ABC", "abc@comp");<NEW_LINE>AppStructure reqPOJO2 = createAppData("myApp2", "Famous myApp2", false, AppStructure.SecurityType.BASIC, AppStructure.GenreType.NEWS, createPriceList(Price.PurchaseType.CREDITCARD, 400, null, 100), "ABC", "abc@comp");<NEW_LINE>AppStructure reqPOJO3 = createAppData("myApp3", "Famous myApp3", true, AppStructure.SecurityType.TOKEN_JWT, AppStructure.GenreType.SOCIAL, createPriceList(Price.PurchaseType.PAYAPL, 2000, null, 100), "ABC", "abc@comp");<NEW_LINE>AppStructure reqPOJO4 = createAppData("myApp4", "Famous myApp4", false, AppStructure.SecurityType.TOKEN_OAUTH2, AppStructure.GenreType.GAME, createPriceList(Price.PurchaseType.PAYAPL, 20000, Price.PurchaseType.CREDITCARD, 3000), "ABC", "abc@comp");<NEW_LINE>MultiAppStructues multiApp = new MultiAppStructues();<NEW_LINE>multiApp.setStructureList(Arrays.asList(reqPOJO1<MASK><NEW_LINE>return multiApp;<NEW_LINE>}
, reqPOJO2, reqPOJO3, reqPOJO4));
1,817,908
public static // | char<NEW_LINE>boolean Literal(PsiBuilder b, int l) {<NEW_LINE>if (!recursion_guard_(b, l, "Literal"))<NEW_LINE>return false;<NEW_LINE>boolean r;<NEW_LINE>Marker m = enter_section_(b, l, _COLLAPSE_, LITERAL, "<literal>");<NEW_LINE>r = consumeTokenSmart(b, INT);<NEW_LINE>if (!r)<NEW_LINE>r = consumeTokenSmart(b, FLOAT);<NEW_LINE>if (!r)<NEW_LINE>r = consumeTokenSmart(b, FLOATI);<NEW_LINE>if (!r)<NEW_LINE>r = consumeTokenSmart(b, DECIMALI);<NEW_LINE>if (!r)<NEW_LINE><MASK><NEW_LINE>if (!r)<NEW_LINE>r = consumeTokenSmart(b, OCT);<NEW_LINE>if (!r)<NEW_LINE>r = StringLiteral(b, l + 1);<NEW_LINE>if (!r)<NEW_LINE>r = consumeTokenSmart(b, CHAR);<NEW_LINE>exit_section_(b, l, m, r, false, null);<NEW_LINE>return r;<NEW_LINE>}
r = consumeTokenSmart(b, HEX);
1,656,566
public Destination unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>Destination destination = new Destination();<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>destination.setStatus(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("FileSystemId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>destination.setFileSystemId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Region", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>destination.setRegion(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("LastReplicatedTimestamp", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>destination.setLastReplicatedTimestamp(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").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 destination;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
196,420
public void doWith(Method method) throws IllegalArgumentException, IllegalAccessException {<NEW_LINE>Method bridgedMethod = findBridgedMethod(method);<NEW_LINE>if (!isVisibilityBridgeMethodPair(method, bridgedMethod)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (method.getAnnotation(Bean.class) != null) {<NEW_LINE>// DO NOT inject to Java-config class's @Bean method<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Class<? extends Annotation> annotationType : getAnnotationTypes()) {<NEW_LINE>AnnotationAttributes attributes = getAnnotationAttributes(bridgedMethod, annotationType, getEnvironment(), true, true);<NEW_LINE>if (attributes != null && method.equals(ClassUtils.getMostSpecificMethod(method, beanClass))) {<NEW_LINE>if (Modifier.isStatic(method.getModifiers())) {<NEW_LINE>throw new IllegalStateException("When using @" + annotationType.<MASK><NEW_LINE>}<NEW_LINE>if (method.getParameterTypes().length != 1) {<NEW_LINE>throw new IllegalStateException("When using @" + annotationType.getName() + " to inject interface proxy, the method must have only one parameter: " + method);<NEW_LINE>}<NEW_LINE>PropertyDescriptor pd = BeanUtils.findPropertyForMethod(bridgedMethod, beanClass);<NEW_LINE>elements.add(new AnnotatedMethodElement(method, pd, attributes));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getName() + " to inject interface proxy, it is not supported on static methods: " + method);
182,918
public Dialog onCreateDialog(final Bundle savedInstanceState) {<NEW_LINE>Activity activity = getActivity();<NEW_LINE>Bundle arguments = getArguments();<NEW_LINE>final AlertDialog dialog = createDialog();<NEW_LINE>dialog.setButton(BUTTON_NEGATIVE, activity.getString(R.string.cancel), this);<NEW_LINE>LayoutInflater inflater = activity.getLayoutInflater();<NEW_LINE>ListView view = (ListView) inflater.inflate(R.layout.dialog_list_view, null);<NEW_LINE>view.setOnItemClickListener(new OnItemClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onItemClick(AdapterView<?> parent, View view, int position, long id) {<NEW_LINE>onClick(dialog, position);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>ArrayList<MASK><NEW_LINE>int selected = arguments.getInt(ARG_SELECTED_CHOICE);<NEW_LINE>RefListAdapter adapter = new RefListAdapter(inflater, choices.toArray(new Reference[choices.size()]), selected);<NEW_LINE>view.setAdapter(adapter);<NEW_LINE>if (selected >= 0)<NEW_LINE>view.setSelection(selected);<NEW_LINE>dialog.setView(view);<NEW_LINE>return dialog;<NEW_LINE>}
<Reference> choices = getChoices();
1,784,272
public List<ViewManager> createViewManagers(ReactApplicationContext reactApplicationContext) {<NEW_LINE>List<ViewManager> managers = new ArrayList<>();<NEW_LINE>// components<NEW_LINE>managers.add(new RCTMGLMapViewManager(reactApplicationContext));<NEW_LINE>managers.add(new RCTMGLAndroidTextureMapViewManager(reactApplicationContext));<NEW_LINE>managers.add(new RCTMGLLightManager());<NEW_LINE>managers.add(new RCTMGLPointAnnotationManager(reactApplicationContext));<NEW_LINE>managers.add(new RCTMGLCalloutManager());<NEW_LINE>// sources<NEW_LINE>managers.add(new RCTMGLVectorSourceManager(reactApplicationContext));<NEW_LINE>managers.add(new RCTMGLShapeSourceManager(reactApplicationContext));<NEW_LINE>managers.add(new RCTMGLRasterSourceManager());<NEW_LINE>managers.add(new RCTMGLImageSourceManager());<NEW_LINE>// layers<NEW_LINE>managers.add(new RCTMGLFillLayerManager());<NEW_LINE>managers.add(new RCTMGLFillExtrusionLayerManager());<NEW_LINE>managers.add(new RCTMGLLineLayerManager());<NEW_LINE>managers<MASK><NEW_LINE>managers.add(new RCTMGLSymbolLayerManager());<NEW_LINE>managers.add(new RCTMGLRasterLayerManager());<NEW_LINE>managers.add(new RCTMGLBackgroundLayerManager());<NEW_LINE>return managers;<NEW_LINE>}
.add(new RCTMGLCircleLayerManager());
1,307,452
protected void populateChannel(final Channel channel, final Element eChannel) {<NEW_LINE>super.populateChannel(channel, eChannel);<NEW_LINE>final String channelUri = channel.getUri();<NEW_LINE>if (channelUri != null) {<NEW_LINE>eChannel.setAttribute("about", channelUri, getRDFNamespace());<NEW_LINE>}<NEW_LINE>final List<Item> items = channel.getItems();<NEW_LINE>if (!items.isEmpty()) {<NEW_LINE>final Element eItems = new Element("items", getFeedNamespace());<NEW_LINE>final Element eSeq = new Element("Seq", getRDFNamespace());<NEW_LINE>for (final Item item : items) {<NEW_LINE>final Element lis = new Element("li", getRDFNamespace());<NEW_LINE>final <MASK><NEW_LINE>if (uri != null) {<NEW_LINE>lis.setAttribute("resource", uri, getRDFNamespace());<NEW_LINE>}<NEW_LINE>eSeq.addContent(lis);<NEW_LINE>}<NEW_LINE>eItems.addContent(eSeq);<NEW_LINE>eChannel.addContent(eItems);<NEW_LINE>}<NEW_LINE>}
String uri = item.getUri();
1,294,890
private static CompilationRequestResult compileMethod(HotSpotGraalCompiler compiler, CompilationRequest request) {<NEW_LINE>long offset = compiler.getGraalRuntime().getVMConfig().jniEnvironmentOffset;<NEW_LINE>long javaThreadAddr = HotSpotJVMCIRuntime.runtime().getCurrentJavaThread();<NEW_LINE>JNI.JNIEnv env = (JNI.JNIEnv) WordFactory.unsigned(javaThreadAddr).add<MASK><NEW_LINE>// This scope is required to allow Graal compilations of host methods to call methods<NEW_LINE>// on the TruffleCompilerRuntime. This is, for example, required to find out about<NEW_LINE>// Truffle-specific method annotations.<NEW_LINE>try {<NEW_LINE>try (JNIMethodScope scope = LibGraalUtil.openScope("<called from VM>", env)) {<NEW_LINE>return compiler.compileMethod(request, true, compiler.getGraalRuntime().getOptions());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>Heap.getHeap().doReferenceHandling();<NEW_LINE>}<NEW_LINE>}
(WordFactory.unsigned(offset));
1,763,462
private void applyLayoutInternal() {<NEW_LINE>hasPendingLayoutRequest = false;<NEW_LINE>if ((this.getNodes().size() == 0)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int layoutStyle = 0;<NEW_LINE>if ((nodeStyle & ZestStyles.NODES_NO_LAYOUT_RESIZE) > 0) {<NEW_LINE>layoutStyle = LayoutStyles.NO_LAYOUT_NODE_RESIZING;<NEW_LINE>}<NEW_LINE>if (layoutAlgorithm == null) {<NEW_LINE>layoutAlgorithm = new TreeLayoutAlgorithm(layoutStyle);<NEW_LINE>}<NEW_LINE>layoutAlgorithm.setStyle(layoutAlgorithm.getStyle() | layoutStyle);<NEW_LINE>// calculate the size for the layout algorithm<NEW_LINE>Dimension d = this.getViewport().getSize();<NEW_LINE>d.width = d.width - 10;<NEW_LINE>d<MASK><NEW_LINE>if (this.preferredSize.width >= 0) {<NEW_LINE>d.width = preferredSize.width;<NEW_LINE>}<NEW_LINE>if (this.preferredSize.height >= 0) {<NEW_LINE>d.height = preferredSize.height;<NEW_LINE>}<NEW_LINE>if (d.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LayoutRelationship[] connectionsToLayout = getConnectionsToLayout(nodes);<NEW_LINE>LayoutEntity[] nodesToLayout = getNodesToLayout(getNodes());<NEW_LINE>try {<NEW_LINE>if ((nodeStyle & ZestStyles.NODES_NO_LAYOUT_ANIMATION) == 0 && animationEnabled) {<NEW_LINE>Animation.markBegin();<NEW_LINE>}<NEW_LINE>layoutAlgorithm.applyLayout(nodesToLayout, connectionsToLayout, 0, 0, d.width, d.height, false, false);<NEW_LINE>if ((nodeStyle & ZestStyles.NODES_NO_LAYOUT_ANIMATION) == 0 && animationEnabled) {<NEW_LINE>Animation.run(animationTime);<NEW_LINE>}<NEW_LINE>getLightweightSystem().getUpdateManager().performUpdate();<NEW_LINE>} catch (InvalidLayoutConfiguration e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>}
.height = d.height - 10;
1,612,600
ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, JsonElement jsonElement) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Portal o = emc.find(id, Portal.class);<NEW_LINE>if (null == o) {<NEW_LINE>throw new PortalNotExistedException(id);<NEW_LINE>}<NEW_LINE>if (!effectivePerson.isSecurityManager() && !business.editable(effectivePerson, o)) {<NEW_LINE>throw new PortalInsufficientPermissionException(effectivePerson.getDistinguishedName(), o.getName(), o.getId());<NEW_LINE>}<NEW_LINE>Wi wi = this.convertToWrapIn(jsonElement, Wi.class);<NEW_LINE>emc.beginTransaction(Portal.class);<NEW_LINE>Wi.copier.copy(wi, o);<NEW_LINE>o.setLastUpdatePerson(effectivePerson.getDistinguishedName());<NEW_LINE>o.setLastUpdateTime(new Date());<NEW_LINE>emc.check(o, CheckPersistType.all);<NEW_LINE>emc.commit();<NEW_LINE><MASK><NEW_LINE>Wo wo = new Wo();<NEW_LINE>wo.setId(o.getId());<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>}
CacheManager.notify(Portal.class);
1,648,989
public void markResults(String[] result_ids, boolean[] reads) {<NEW_LINE>ByteArrayHashMap rid_map = new ByteArrayHashMap();<NEW_LINE>for (int i = 0; i < result_ids.length; i++) {<NEW_LINE>rid_map.put(Base32.decode(result_ids[i]), Boolean.valueOf(reads[i]));<NEW_LINE>}<NEW_LINE>boolean changed = false;<NEW_LINE>List newly_unread = new ArrayList();<NEW_LINE>synchronized (this) {<NEW_LINE>LinkedHashMap<String, SubscriptionResultImpl> results_map = manager.loadResults(subs);<NEW_LINE>SubscriptionResultImpl[] results = results_map.values().toArray(new SubscriptionResultImpl<MASK><NEW_LINE>for (int i = 0; i < results.length; i++) {<NEW_LINE>SubscriptionResultImpl result = results[i];<NEW_LINE>if (result.isDeleted()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Boolean b_read = (Boolean) rid_map.get(result.getKey1());<NEW_LINE>if (b_read != null) {<NEW_LINE>boolean read = b_read.booleanValue();<NEW_LINE>if (result.getRead() != read) {<NEW_LINE>changed = true;<NEW_LINE>result.setReadInternal(read);<NEW_LINE>if (!read) {<NEW_LINE>newly_unread.add(result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (changed) {<NEW_LINE>updateReadUnread(results);<NEW_LINE>manager.saveResults(subs, results);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (changed) {<NEW_LINE>saveConfig(SubscriptionListener.CR_RESULTS);<NEW_LINE>}<NEW_LINE>if (isAutoDownload()) {<NEW_LINE>for (int i = 0; i < newly_unread.size(); i++) {<NEW_LINE>manager.getScheduler().download(subs, (SubscriptionResult) newly_unread.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
[results_map.size()]);
475,902
private static String formatAsNewReassignmentJson(String topic, scala.collection.Map<Object, Seq<Object>> partitionsToReassign) {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>builder.append("{\"version\":1,\"partitions\":[\n");<NEW_LINE>for (int partition = 0; partition < partitionsToReassign.size(); partition++) {<NEW_LINE>builder.append(" {\"topic\":\"").append(topic).append("\",\"partition\":").append<MASK><NEW_LINE>Seq<Object> replicas = partitionsToReassign.apply(partition);<NEW_LINE>for (int replicaIndex = 0; replicaIndex < replicas.size(); replicaIndex++) {<NEW_LINE>Object replica = replicas.apply(replicaIndex);<NEW_LINE>builder.append(replica).append(",");<NEW_LINE>}<NEW_LINE>builder.setLength(builder.length() - 1);<NEW_LINE>builder.append("]},\n");<NEW_LINE>}<NEW_LINE>builder.setLength(builder.length() - 2);<NEW_LINE>builder.append("]}");<NEW_LINE>return builder.toString();<NEW_LINE>}
(partition).append(",\"replicas\":[");
1,235,896
public void updateTotalBytesReadByRemoteReplica(PartitionId partitionId, String hostName, String replicaPath, long totalBytesRead) throws StoreException {<NEW_LINE>RemoteReplicaInfo remoteReplicaInfo = <MASK><NEW_LINE>if (remoteReplicaInfo != null) {<NEW_LINE>ReplicaId localReplica = remoteReplicaInfo.getLocalReplicaId();<NEW_LINE>remoteReplicaInfo.setTotalBytesReadFromLocalStore(totalBytesRead);<NEW_LINE>// update replication lag in ReplicaSyncUpManager<NEW_LINE>if (replicaSyncUpManager != null) {<NEW_LINE>Store localStore = storeManager.getStore(partitionId);<NEW_LINE>if (localStore.getCurrentState() == ReplicaState.INACTIVE) {<NEW_LINE>// if local store is in INACTIVE state, that means deactivation process is initiated and in progress on this<NEW_LINE>// replica. We update SyncUpManager by peer's lag from last PUT offset in local store.<NEW_LINE>// it's ok if deactivation has completed and concurrent metadata request attempts to update lag of same replica<NEW_LINE>// again. The reason is, SyncUpManager has a lock to ensure only one request will call onDeactivationComplete()<NEW_LINE>// method. The local replica should have been removed when another request acquires the lock.<NEW_LINE>replicaSyncUpManager.updateReplicaLagAndCheckSyncStatus(localReplica, remoteReplicaInfo.getReplicaId(), localStore.getEndPositionOfLastPut() - totalBytesRead, ReplicaState.INACTIVE);<NEW_LINE>} else if (localStore.getCurrentState() == ReplicaState.OFFLINE && localStore.isDecommissionInProgress()) {<NEW_LINE>// if local store is in OFFLINE state, we need more info to determine if replica is really in Inactive-To-Offline<NEW_LINE>// transition. So we check if decommission file is present. If present, we update SyncUpManager by peer's lag<NEW_LINE>// from end offset in local store.<NEW_LINE>replicaSyncUpManager.updateReplicaLagAndCheckSyncStatus(localReplica, remoteReplicaInfo.getReplicaId(), localStore.getSizeInBytes() - totalBytesRead, ReplicaState.OFFLINE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getRemoteReplicaInfo(partitionId, hostName, replicaPath);
1,339,616
private void generateSendMailMethod(FileObject fileObject, final String className, String sessionVariableName, String sessionGetter) throws IOException {<NEW_LINE>List<MethodModel.Variable> parameters = Arrays.asList(new MethodModel.Variable[] { MethodModel.Variable.create("java.lang.String", "email"), MethodModel.Variable.create("java.lang.String", "subject"), MethodModel.Variable.create("java.lang.String", "body") });<NEW_LINE>List<String> exceptions = Arrays.asList(new String[] { javax.naming.NamingException.class.getName(), "javax.mail.MessagingException" });<NEW_LINE>final MethodModel methodModel = MethodModel.create(_RetoucheUtil.uniqueMemberName(fileObject, className, "sendMail", "mailResource"), "void", getSendCode(sessionVariableName, sessionGetter), parameters, exceptions, Collections.singleton(Modifier.PRIVATE));<NEW_LINE>JavaSource javaSource = JavaSource.forFileObject(fileObject);<NEW_LINE>javaSource.runModificationTask(new Task<WorkingCopy>() {<NEW_LINE><NEW_LINE>public void run(WorkingCopy workingCopy) throws IOException {<NEW_LINE>workingCopy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);<NEW_LINE>TypeElement typeElement = workingCopy.<MASK><NEW_LINE>MethodTree methodTree = MethodModelSupport.createMethodTree(workingCopy, methodModel);<NEW_LINE>methodTree = (MethodTree) GeneratorUtilities.get(workingCopy).importFQNs(methodTree);<NEW_LINE>ClassTree classTree = workingCopy.getTrees().getTree(typeElement);<NEW_LINE>ClassTree newClassTree = workingCopy.getTreeMaker().addClassMember(classTree, methodTree);<NEW_LINE>workingCopy.rewrite(classTree, newClassTree);<NEW_LINE>}<NEW_LINE>}).commit();<NEW_LINE>}
getElements().getTypeElement(className);
1,493,205
public static DescribeInstancesResponse unmarshall(DescribeInstancesResponse describeInstancesResponse, UnmarshallerContext context) {<NEW_LINE>describeInstancesResponse.setRequestId(context.stringValue("DescribeInstancesResponse.RequestId"));<NEW_LINE>describeInstancesResponse.setPageSize(context.integerValue("DescribeInstancesResponse.PageSize"));<NEW_LINE>describeInstancesResponse.setCurrentPage(context.integerValue("DescribeInstancesResponse.CurrentPage"));<NEW_LINE>describeInstancesResponse.setTotalCount(context.integerValue("DescribeInstancesResponse.TotalCount"));<NEW_LINE>List<Instance> items = new ArrayList<Instance>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeInstancesResponse.Items.Length"); i++) {<NEW_LINE>Instance instance = new Instance();<NEW_LINE>instance.setId(context.longValue("DescribeInstancesResponse.Items[" + i + "].Id"));<NEW_LINE>instance.setName(context.stringValue("DescribeInstancesResponse.Items[" + i + "].Name"));<NEW_LINE>instance.setOwner(context.stringValue<MASK><NEW_LINE>instance.setCreationTime(context.longValue("DescribeInstancesResponse.Items[" + i + "].CreationTime"));<NEW_LINE>instance.setProductId(context.stringValue("DescribeInstancesResponse.Items[" + i + "].ProductId"));<NEW_LINE>instance.setProductCode(context.stringValue("DescribeInstancesResponse.Items[" + i + "].ProductCode"));<NEW_LINE>instance.setProtection(context.booleanValue("DescribeInstancesResponse.Items[" + i + "].Protection"));<NEW_LINE>instance.setLabelsec(context.integerValue("DescribeInstancesResponse.Items[" + i + "].Labelsec"));<NEW_LINE>instance.setOdpsRiskLevelName(context.stringValue("DescribeInstancesResponse.Items[" + i + "].OdpsRiskLevelName"));<NEW_LINE>instance.setSensitive(context.booleanValue("DescribeInstancesResponse.Items[" + i + "].Sensitive"));<NEW_LINE>instance.setRiskLevelId(context.longValue("DescribeInstancesResponse.Items[" + i + "].RiskLevelId"));<NEW_LINE>instance.setRiskLevelName(context.stringValue("DescribeInstancesResponse.Items[" + i + "].RiskLevelName"));<NEW_LINE>instance.setRuleName(context.stringValue("DescribeInstancesResponse.Items[" + i + "].RuleName"));<NEW_LINE>instance.setDepartName(context.stringValue("DescribeInstancesResponse.Items[" + i + "].DepartName"));<NEW_LINE>instance.setTotalCount(context.integerValue("DescribeInstancesResponse.Items[" + i + "].TotalCount"));<NEW_LINE>instance.setSensitiveCount(context.integerValue("DescribeInstancesResponse.Items[" + i + "].SensitiveCount"));<NEW_LINE>instance.setAcl(context.stringValue("DescribeInstancesResponse.Items[" + i + "].Acl"));<NEW_LINE>items.add(instance);<NEW_LINE>}<NEW_LINE>describeInstancesResponse.setItems(items);<NEW_LINE>return describeInstancesResponse;<NEW_LINE>}
("DescribeInstancesResponse.Items[" + i + "].Owner"));
243,787
public static Map<String, String> loadConfigurationFromInputStream(InputStream inputStream) {<NEW_LINE>Map<String, String> config = new HashMap<>();<NEW_LINE>try {<NEW_LINE>// System.in.available() : returns an estimate of the number of bytes that can be read (or skipped over) from this input stream<NEW_LINE>// Used to check if there is any data in the stream<NEW_LINE>if (inputStream != null && inputStream.available() > 0) {<NEW_LINE>BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));<NEW_LINE>LOG.debug("Attempting to load configuration from standard input");<NEW_LINE><MASK><NEW_LINE>if (bufferedReader.ready() && firstCharacter != -1) {<NEW_LINE>// Prepend the first character to the rest of the string<NEW_LINE>// This is a char, represented as an int, so we cast to a char<NEW_LINE>// which is implicitly converted to an string<NEW_LINE>String configurationString = (char) firstCharacter + FileCopyUtils.copyToString(bufferedReader);<NEW_LINE>Map<String, String> configurationFromStandardInput = loadConfigurationFromString(configurationString);<NEW_LINE>if (configurationFromStandardInput.isEmpty()) {<NEW_LINE>LOG.debug("Empty configuration provided from standard input");<NEW_LINE>} else {<NEW_LINE>LOG.info("Loaded configuration from standard input");<NEW_LINE>config.putAll(configurationFromStandardInput);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOG.debug("Could not load configuration from standard input");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.debug("Could not load configuration from standard input " + e.getMessage());<NEW_LINE>}<NEW_LINE>return config;<NEW_LINE>}
int firstCharacter = bufferedReader.read();
708,049
public void close() {<NEW_LINE>// This is just for show; JCImageFactory closes the input stream during construction.<NEW_LINE><MASK><NEW_LINE>while (it.hasNext()) {<NEW_LINE>Object o = it.next();<NEW_LINE>if (o instanceof JavaCoreResourceReleaser) {<NEW_LINE>try {<NEW_LINE>((JavaCoreResourceReleaser) o).releaseResources();<NEW_LINE>} catch (IOException e) {<NEW_LINE>Logger.getLogger(com.ibm.dtfj.image.ImageFactory.DTFJ_LOGGER_NAME).log(Level.WARNING, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if the Image Source has been set, then see if an extracted file needs to be deleted<NEW_LINE>if ((imageSource != null) && (imageSource.getExtractedTo() != null)) {<NEW_LINE>// attempt to delete the file<NEW_LINE>imageSource.getExtractedTo().delete();<NEW_LINE>}<NEW_LINE>}
Iterator it = _closables.iterator();
1,692,005
public void encode() {<NEW_LINE>this.reset();<NEW_LINE>this.putEntityUniqueId(this.entityUniqueId);<NEW_LINE>this.putEntityRuntimeId(this.entityRuntimeId);<NEW_LINE><MASK><NEW_LINE>this.putVector3f(this.x, this.y, this.z);<NEW_LINE>this.putLFloat(this.yaw);<NEW_LINE>this.putLFloat(this.pitch);<NEW_LINE>this.putVarInt(this.seed);<NEW_LINE>this.putVarInt(this.dimension);<NEW_LINE>this.putVarInt(this.generator);<NEW_LINE>this.putVarInt(this.worldGamemode);<NEW_LINE>this.putVarInt(this.difficulty);<NEW_LINE>this.putBlockVector3(this.spawnX, this.spawnY, this.spawnZ);<NEW_LINE>this.putBoolean(this.hasAchievementsDisabled);<NEW_LINE>this.putVarInt(this.dayCycleStopTime);<NEW_LINE>this.putBoolean(this.eduMode);<NEW_LINE>this.putLFloat(this.rainLevel);<NEW_LINE>this.putLFloat(this.lightningLevel);<NEW_LINE>this.putBoolean(this.multiplayerGame);<NEW_LINE>this.putBoolean(this.broadcastToLAN);<NEW_LINE>this.putBoolean(this.broadcastToXboxLive);<NEW_LINE>this.putBoolean(this.commandsEnabled);<NEW_LINE>this.putBoolean(this.isTexturePacksRequired);<NEW_LINE>this.putGameRules(gameRules);<NEW_LINE>this.putBoolean(this.bonusChest);<NEW_LINE>this.putBoolean(this.trustPlayers);<NEW_LINE>this.putVarInt(this.permissionLevel);<NEW_LINE>this.putVarInt(this.gamePublish);<NEW_LINE>this.putLInt(this.serverChunkTickRange);<NEW_LINE>this.putString(this.levelId);<NEW_LINE>this.putString(this.worldName);<NEW_LINE>this.putString(this.premiumWorldTemplateId);<NEW_LINE>this.putBoolean(this.unknown);<NEW_LINE>this.putLLong(this.currentTick);<NEW_LINE>this.putVarInt(this.enchantmentSeed);<NEW_LINE>}
this.putVarInt(this.playerGamemode);