idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,075,772
public Result search(Query query, Execution execution) {<NEW_LINE>query.trace("CacheControlSearcher: Running version $Revision$", false, 6);<NEW_LINE>Result result = execution.search(query);<NEW_LINE>query = result.getQuery();<NEW_LINE>if (result.getHeaders(true) == null) {<NEW_LINE>query.trace("CacheControlSearcher: No HTTP header map available - skipping searcher.", false, 5);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>// If you specify no-cache, no further cache control headers make sense<NEW_LINE>if (query.properties().getBoolean(cachecontrolNocache, false) || query.getNoCache()) {<NEW_LINE>result.getHeaders(true).put(CACHE_CONTROL_HEADER, "no-cache");<NEW_LINE>query.trace("CacheControlSearcher: Added no-cache header", false, 4);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>// Handle max-age header<NEW_LINE>int maxage = query.properties()<MASK><NEW_LINE>if (maxage > 0) {<NEW_LINE>result.getHeaders(true).put(CACHE_CONTROL_HEADER, "max-age=" + maxage);<NEW_LINE>query.trace("CacheControlSearcher: Set max-age header to " + maxage, false, 4);<NEW_LINE>}<NEW_LINE>// Handle stale-while-revalidate header<NEW_LINE>int staleage = query.properties().getInteger(cachecontrolStaleage, -1);<NEW_LINE>if (staleage > 0) {<NEW_LINE>result.getHeaders(true).put(CACHE_CONTROL_HEADER, "stale-while-revalidate=" + staleage);<NEW_LINE>query.trace("CacheControlSearcher: Set stale-while-revalidate header to " + staleage, false, 4);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
.getInteger(cachecontrolMaxage, -1);
502,599
public final QueryExpressionContext queryExpression() throws RecognitionException {<NEW_LINE>QueryExpressionContext _localctx = new QueryExpressionContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 222, RULE_queryExpression);<NEW_LINE>try {<NEW_LINE>setState(3420);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(getInterpreter().adaptivePredict(_input, 482, _ctx)) {<NEW_LINE>case 1:<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(3412);<NEW_LINE>match(LR_BRACKET);<NEW_LINE>setState(3413);<NEW_LINE>querySpecification();<NEW_LINE>setState(3414);<NEW_LINE>match(RR_BRACKET);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>enterOuterAlt(_localctx, 2);<NEW_LINE>{<NEW_LINE>setState(3416);<NEW_LINE>match(LR_BRACKET);<NEW_LINE>setState(3417);<NEW_LINE>queryExpression();<NEW_LINE>setState(3418);<NEW_LINE>match(RR_BRACKET);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE><MASK><NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
_errHandler.reportError(this, re);
1,855,074
private int addPartitionSpecInternal(PartitionSpec spec) {<NEW_LINE>int newSpecId = reuseOrCreateNewSpecId(spec);<NEW_LINE>if (specsById.containsKey(newSpecId)) {<NEW_LINE>this.lastAddedSpecId = newSpecId;<NEW_LINE>return newSpecId;<NEW_LINE>}<NEW_LINE>Schema schema = schemasById.get(currentSchemaId);<NEW_LINE>PartitionSpec.checkCompatibility(spec, schema);<NEW_LINE>ValidationException.check(formatVersion > 1 || PartitionSpec.hasSequentialIds(spec), "Spec does not use sequential IDs that are required in v1: %s", spec);<NEW_LINE>PartitionSpec newSpec = freshSpec(newSpecId, schema, spec);<NEW_LINE>this.lastAssignedPartitionId = Math.max(lastAssignedPartitionId, newSpec.lastAssignedFieldId());<NEW_LINE>specs.add(newSpec);<NEW_LINE>specsById.put(newSpecId, newSpec);<NEW_LINE>changes.add(<MASK><NEW_LINE>this.lastAddedSpecId = newSpecId;<NEW_LINE>return newSpecId;<NEW_LINE>}
new MetadataUpdate.AddPartitionSpec(newSpec));
1,364,099
private void updateSelection() {<NEW_LINE>dataSourcesTableModel.clearTable();<NEW_LINE>if (casesTable.getSelectedRow() >= 0 && casesTable.getSelectedRow() < casesTable.getRowCount()) {<NEW_LINE>CaseDataSourcesWrapper caseWrapper = casesTableModel.getEamCase(casesTable.convertRowIndexToModel(casesTable.getSelectedRow()));<NEW_LINE>orgValueLabel.setText(caseWrapper.getOrganizationName());<NEW_LINE>caseNumberValueLabel.setText(caseWrapper.getCaseNumber());<NEW_LINE>examinerNameValueLabel.setText(caseWrapper.getExaminerName());<NEW_LINE>examinerPhoneValueLabel.setText(caseWrapper.getExaminerPhone());<NEW_LINE>examinerEmailValueLabel.setText(caseWrapper.getExaminerEmail());<NEW_LINE>notesTextArea.<MASK><NEW_LINE>dataSourcesTableModel.addDataSources(caseWrapper.getDataSources());<NEW_LINE>} else {<NEW_LINE>orgValueLabel.setText("");<NEW_LINE>caseNumberValueLabel.setText("");<NEW_LINE>examinerNameValueLabel.setText("");<NEW_LINE>examinerPhoneValueLabel.setText("");<NEW_LINE>examinerEmailValueLabel.setText("");<NEW_LINE>notesTextArea.setText("");<NEW_LINE>}<NEW_LINE>}
setText(caseWrapper.getNotes());
351,476
public Notification buildSummaryIPC(String groupKey) {<NEW_LINE>Intent intent = new Intent(context, ManagerActivity.class);<NEW_LINE>intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);<NEW_LINE>intent.setAction(ACTION_IPC);<NEW_LINE>PendingIntent pendingIntent = PendingIntent.getActivity(context, 1, intent, PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE);<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {<NEW_LINE>NotificationChannel channel = new NotificationChannel(notificationChannelIdSummary, notificationChannelNameSummary, NotificationManager.IMPORTANCE_HIGH);<NEW_LINE>channel.setShowBadge(true);<NEW_LINE>if (notificationManager == null) {<NEW_LINE>notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);<NEW_LINE>}<NEW_LINE>notificationManager.createNotificationChannel(channel);<NEW_LINE>NotificationCompat.Builder notificationBuilderO = new NotificationCompat.Builder(context, notificationChannelIdSummary);<NEW_LINE>notificationBuilderO.setSmallIcon(R.drawable.ic_stat_notify).setShowWhen(true).setGroup(groupKey).setGroupSummary(true).setAutoCancel(true).setContentIntent(pendingIntent).setColor(ContextCompat.getColor(context, R.color.red_600_red_300));<NEW_LINE>return notificationBuilderO.build();<NEW_LINE>} else {<NEW_LINE>NotificationCompat.Builder builder = new NotificationCompat.Builder(context);<NEW_LINE>builder.setSmallIcon(R.drawable.ic_stat_notify).setColor(ContextCompat.getColor(context, R.color.red_600_red_300)).setShowWhen(true).setGroup(groupKey).setGroupSummary(true).setAutoCancel<MASK><NEW_LINE>return builder.build();<NEW_LINE>}<NEW_LINE>}
(true).setContentIntent(pendingIntent);
1,116,757
void signLogoutResponse(SAMLObject logoutResponse, Credential signingCredential) throws SamlException {<NEW_LINE>SsoConfig samlConfig = ssoService.getConfig();<NEW_LINE>if (logoutResponse instanceof SignableSAMLObject && signingCredential != null) {<NEW_LINE>SignableSAMLObject signableMessage = (SignableSAMLObject) logoutResponse;<NEW_LINE>XMLObjectBuilderFactory builderFactory = XMLObjectProviderRegistrySupport.getBuilderFactory();<NEW_LINE>XMLObjectBuilder<Signature> signatureBuilder = (XMLObjectBuilder<Signature>) builderFactory.getBuilder(Signature.DEFAULT_ELEMENT_NAME);<NEW_LINE>Signature signature = signatureBuilder.buildObject(Signature.DEFAULT_ELEMENT_NAME);<NEW_LINE>// SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA256);// SignatureConstants.ALGO_ID_SIGNATURE_RSA_SHA1); //<NEW_LINE>signature.<MASK><NEW_LINE>signature.setCanonicalizationAlgorithm(SignatureConstants.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);<NEW_LINE>signature.setSigningCredential(signingCredential);<NEW_LINE>signableMessage.setSignature(signature);<NEW_LINE>final ClassLoader originalClassLoader = Thread.currentThread().getContextClassLoader();<NEW_LINE>try {<NEW_LINE>// Marshaller marshaller = Configuration.getMarshallerFactory().getMarshaller(signableMessage);<NEW_LINE>// v3<NEW_LINE>Marshaller marshaller = XMLObjectProviderRegistrySupport.getMarshallerFactory().getMarshaller(signableMessage);<NEW_LINE>if (marshaller == null) {<NEW_LINE>throw new // "CWWKS5063E: The Web Service Request failed due to the authentication is not successful.",<NEW_LINE>SamlException(// "CWWKS5063E: The Web Service Request failed due to the authentication is not successful.",<NEW_LINE>"SAML20_AUTHENTICATION_FAIL", null, new Object[] {});<NEW_LINE>}<NEW_LINE>marshaller.marshall(signableMessage);<NEW_LINE>Thread.currentThread().setContextClassLoader(SignerProvider.class.getClassLoader());<NEW_LINE>Signer.signObject(signature);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Let SamlException handles opensaml Exception<NEW_LINE>throw new SamlException(e, true);<NEW_LINE>} finally {<NEW_LINE>Thread.currentThread().setContextClassLoader(originalClassLoader);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
setSignatureAlgorithm(samlConfig.getSignatureMethodAlgorithm());
693,059
public void configure(ResourceInfo resourceInfo, FeatureContext configuration) {<NEW_LINE>final <MASK><NEW_LINE>try {<NEW_LINE>// DenyAll on the method take precedence over RolesAllowed and PermitAll<NEW_LINE>if (am.isAnnotationPresent(DenyAll.class)) {<NEW_LINE>configuration.register(new RolesAllowedRequestFilter());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// RolesAllowed on the method takes precedence over PermitAll<NEW_LINE>Optional<Annotation> ra = Arrays.stream(am.getAnnotations()).filter(a -> a.annotationType().getName().equals(RolesAllowed.class.getName())).findFirst();<NEW_LINE>if (ra.isPresent()) {<NEW_LINE>configuration.register(new RolesAllowedRequestFilter(((RolesAllowed) ra.get()).value()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// PermitAll takes precedence over RolesAllowed on the class<NEW_LINE>if (am.isAnnotationPresent(PermitAll.class)) {<NEW_LINE>// Do nothing.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// DenyAll can't be attached to classes<NEW_LINE>// RolesAllowed on the class takes precedence over PermitAll<NEW_LINE>ra = Arrays.stream(resourceInfo.getResourceClass().getAnnotations()).filter(a -> a.annotationType().getName().equals(RolesAllowed.class.getName())).findFirst();<NEW_LINE>if (ra.isPresent()) {<NEW_LINE>configuration.register(new RolesAllowedRequestFilter(((RolesAllowed) ra.get()).value()));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Error while configuring the roles", e);<NEW_LINE>}<NEW_LINE>}
Method am = resourceInfo.getResourceMethod();
1,508,331
public Boolean visitApp(AppExpression expr1, Expression expr2, Expression type) {<NEW_LINE>List<Expression> args1 = new ArrayList<>();<NEW_LINE>List<Expression> args2 = new ArrayList<>();<NEW_LINE>Expression fun1 = expr1.getArguments(args1);<NEW_LINE>Expression fun2 = expr2.getArguments(args2);<NEW_LINE>InferenceVariable var1 = fun1.getInferenceVariable();<NEW_LINE>InferenceVariable var2 = fun2.getInferenceVariable();<NEW_LINE>if (var1 != null || var2 != null) {<NEW_LINE>if (myNormalCompare && !myOnlySolveVars && myEquations.addEquation(expr1, substitute(expr2), type, myCMP, var1 != null ? var1.getSourceNode() : var2.getSourceNode(), var1, var2)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (args1.size() != args2.size()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!compare(fun1, fun2, null, false)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (args1.isEmpty()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>myCMP = CMP.EQ;<NEW_LINE>Expression type1 = fun1.getType();<NEW_LINE>List<SingleDependentLink> params = Collections.emptyList();<NEW_LINE>if (type1 != null) {<NEW_LINE>params = new ArrayList<>();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>for (int i = 0; i < args1.size(); i++) {<NEW_LINE>if (!compare(args1.get(i), args2.get(i), i < params.size() ? params.get(i).getTypeExpr() : null, true)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
type1.getPiParameters(params, false);
1,398,898
private static void movePivotToStartOfSlice(double[] array, int from, int to) {<NEW_LINE>int mid = (from + to) >>> 1;<NEW_LINE>// We want to make a swap such that either array[to] <= array[from] <= array[mid], or<NEW_LINE>// array[mid] <= array[from] <= array[to]. We know that from < to, so we know mid < to<NEW_LINE>// (although it's possible that mid == from, if to == from + 1). Note that the postcondition<NEW_LINE>// would be impossible to fulfil if mid == to unless we also have array[from] == array[to].<NEW_LINE>boolean toLessThanMid = (array[to] < array[mid]);<NEW_LINE>boolean midLessThanFrom = (array[mid] < array[from]);<NEW_LINE>boolean toLessThanFrom = (array[to] < array[from]);<NEW_LINE>if (toLessThanMid == midLessThanFrom) {<NEW_LINE>// Either array[to] < array[mid] < array[from] or array[from] <= array[mid] <= array[to].<NEW_LINE><MASK><NEW_LINE>} else if (toLessThanMid != toLessThanFrom) {<NEW_LINE>// Either array[from] <= array[to] < array[mid] or array[mid] <= array[to] < array[from].<NEW_LINE>swap(array, from, to);<NEW_LINE>}<NEW_LINE>// The postcondition now holds. So the median, our chosen pivot, is at from.<NEW_LINE>}
swap(array, mid, from);
370,651
public static BodyDTO createDTO(Body<?> body) {<NEW_LINE>BodyDTO result = null;<NEW_LINE>if (body instanceof BinaryBody) {<NEW_LINE>BinaryBody binaryBody = (BinaryBody) body;<NEW_LINE>result = new BinaryBodyDTO(binaryBody, binaryBody.getNot());<NEW_LINE>} else if (body instanceof JsonBody) {<NEW_LINE>JsonBody jsonBody = (JsonBody) body;<NEW_LINE>result = new JsonBodyDTO(jsonBody, jsonBody.getNot());<NEW_LINE>} else if (body instanceof JsonSchemaBody) {<NEW_LINE>JsonSchemaBody jsonSchemaBody = (JsonSchemaBody) body;<NEW_LINE>result = new JsonSchemaBodyDTO(jsonSchemaBody, jsonSchemaBody.getNot());<NEW_LINE>} else if (body instanceof JsonPathBody) {<NEW_LINE>JsonPathBody jsonPathBody = (JsonPathBody) body;<NEW_LINE>result = new JsonPathBodyDTO(jsonPathBody, jsonPathBody.getNot());<NEW_LINE>} else if (body instanceof ParameterBody) {<NEW_LINE>ParameterBody parameterBody = (ParameterBody) body;<NEW_LINE>result = new ParameterBodyDTO(parameterBody, parameterBody.getNot());<NEW_LINE>} else if (body instanceof RegexBody) {<NEW_LINE>RegexBody regexBody = (RegexBody) body;<NEW_LINE>result = new RegexBodyDTO(regexBody, regexBody.getNot());<NEW_LINE>} else if (body instanceof StringBody) {<NEW_LINE>StringBody stringBody = (StringBody) body;<NEW_LINE>result = new StringBodyDTO(stringBody, stringBody.getNot());<NEW_LINE>} else if (body instanceof XmlBody) {<NEW_LINE>XmlBody xmlBody = (XmlBody) body;<NEW_LINE>result = new XmlBodyDTO(<MASK><NEW_LINE>} else if (body instanceof XmlSchemaBody) {<NEW_LINE>XmlSchemaBody xmlSchemaBody = (XmlSchemaBody) body;<NEW_LINE>result = new XmlSchemaBodyDTO(xmlSchemaBody, xmlSchemaBody.getNot());<NEW_LINE>} else if (body instanceof XPathBody) {<NEW_LINE>XPathBody xPathBody = (XPathBody) body;<NEW_LINE>result = new XPathBodyDTO(xPathBody, xPathBody.getNot());<NEW_LINE>}<NEW_LINE>if (result != null) {<NEW_LINE>result.withOptional(body.getOptional());<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
xmlBody, xmlBody.getNot());
1,195,503
public void registerFactories() {<NEW_LINE>//<NEW_LINE>// Register payment action handlers.<NEW_LINE>final IESRImportBL esrImportBL = Services.get(IESRImportBL.class);<NEW_LINE>esrImportBL.registerActionHandler(X_ESR_ImportLine.ESR_PAYMENT_ACTION_Write_Off_Amount, new WriteoffESRActionHandler());<NEW_LINE>esrImportBL.registerActionHandler(X_ESR_ImportLine.ESR_PAYMENT_ACTION_Keep_For_Dunning, new DunningESRActionHandler());<NEW_LINE>esrImportBL.registerActionHandler(X_ESR_ImportLine.ESR_PAYMENT_ACTION_Money_Was_Transfered_Back_to_Partner, new MoneyTransferedBackESRActionHandler());<NEW_LINE>esrImportBL.registerActionHandler(X_ESR_ImportLine.ESR_PAYMENT_ACTION_Allocate_Payment_With_Next_Invoice, new WithNextInvoiceESRActionHandler());<NEW_LINE>esrImportBL.registerActionHandler(X_ESR_ImportLine.ESR_PAYMENT_ACTION_Allocate_Payment_With_Current_Invoice, new WithCurrenttInvoiceESRActionHandler());<NEW_LINE>esrImportBL.registerActionHandler(X_ESR_ImportLine.ESR_PAYMENT_ACTION_Unable_To_Assign_Income, new UnableToAssignESRActionHandler());<NEW_LINE>esrImportBL.registerActionHandler(X_ESR_ImportLine.ESR_PAYMENT_ACTION_Discount, new DiscountESRActionHandler());<NEW_LINE>esrImportBL.registerActionHandler(X_ESR_ImportLine.ESR_PAYMENT_ACTION_Duplicate_Payment, new DuplicatePaymentESRActionHandler());<NEW_LINE>//<NEW_LINE>// Register ESR Payment Parsers<NEW_LINE>final IPaymentStringParserFactory paymentStringParserFactory = Services.get(IPaymentStringParserFactory.class);<NEW_LINE>paymentStringParserFactory.registerParser(PaymentParserType.ESRRegular.getType(), ESRRegularLineParser.instance);<NEW_LINE>paymentStringParserFactory.registerParser(PaymentParserType.ESRCreaLogix.getType(), ESRCreaLogixStringParser.instance);<NEW_LINE>paymentStringParserFactory.registerParser(PaymentParserType.QRCode.getType<MASK><NEW_LINE>//<NEW_LINE>// Payment batch provider for Bank Statement matching<NEW_LINE>Services.get(IPaymentBatchFactory.class).addPaymentBatchProvider(new ESRPaymentBatchProvider());<NEW_LINE>//<NEW_LINE>// Bank statement listener<NEW_LINE>Services.get(IBankStatementListenerService.class).addListener(new ESRBankStatementListener(esrImportBL));<NEW_LINE>//<NEW_LINE>// ESR match listener<NEW_LINE>// 08741<NEW_LINE>Services.get(IESRLineHandlersService.class).registerESRLineListener(new DefaultESRLineHandler());<NEW_LINE>}
(), new QRCodeStringParser());
915,441
public void findHydratedProjectsByUser(FindHydratedProjectsByUser request, StreamObserver<AdvancedQueryProjectsResponse> responseObserver) {<NEW_LINE>try {<NEW_LINE>String errorMessage = null;<NEW_LINE>if (request.getEmail().isEmpty() && request.getVertaId().isEmpty()) {<NEW_LINE>errorMessage = "Email OR vertaId not found in the FindHydratedPublicProjects request";<NEW_LINE>}<NEW_LINE>CollaboratorUser hostCollaboratorBase = null;<NEW_LINE><MASK><NEW_LINE>if (!userEmail.isEmpty() && ModelDBUtils.isValidEmail(userEmail)) {<NEW_LINE>var hostUserInfo = authService.getUserInfo(userEmail, CommonConstants.UserIdentifier.EMAIL_ID);<NEW_LINE>hostCollaboratorBase = new CollaboratorUser(authService, hostUserInfo);<NEW_LINE>} else if (!userEmail.isEmpty()) {<NEW_LINE>errorMessage = "Invalid email found in the FindHydratedPublicProjects request";<NEW_LINE>} else if (!request.getVertaId().isEmpty()) {<NEW_LINE>var hostUserInfo = authService.getUserInfo(request.getVertaId(), CommonConstants.UserIdentifier.VERTA_ID);<NEW_LINE>hostCollaboratorBase = new CollaboratorUser(authService, hostUserInfo);<NEW_LINE>}<NEW_LINE>if (errorMessage != null) {<NEW_LINE>throw new InvalidArgumentException(errorMessage);<NEW_LINE>}<NEW_LINE>var findProjects = request.toBuilder().getFindProjects();<NEW_LINE>CollaboratorUserInfo.Builder builder = CollaboratorUserInfo.newBuilder();<NEW_LINE>hostCollaboratorBase.addToResponse(builder);<NEW_LINE>findProjects = findProjects.toBuilder().setWorkspaceName(builder.getCollaboratorUserInfo().getVertaInfo().getUsername()).build();<NEW_LINE>responseObserver.onNext(createQueryProjectsResponse(findProjects));<NEW_LINE>responseObserver.onCompleted();<NEW_LINE>} catch (Exception e) {<NEW_LINE>CommonUtils.observeError(responseObserver, e, AdvancedQueryProjectsResponse.getDefaultInstance());<NEW_LINE>}<NEW_LINE>}
String userEmail = request.getEmail();
459,599
public String searchFor(final String deviceAddress) {<NEW_LINE>final String firstBytes = deviceAddress.substring(0, 15);<NEW_LINE>// assuming that the device address is correct<NEW_LINE>final String lastByte = deviceAddress.substring(15);<NEW_LINE>final String lastByteIncremented = String.format(Locale.US, "%02X", (Integer.valueOf(lastByte, 16) + ADDRESS_DIFF) & 0xFF);<NEW_LINE>mDeviceAddress = deviceAddress;<NEW_LINE>mDeviceAddressIncremented = firstBytes + lastByteIncremented;<NEW_LINE>mBootloaderAddress = null;<NEW_LINE>mFound = false;<NEW_LINE>// Add timeout<NEW_LINE>new Thread(() -> {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>} catch (final InterruptedException e) {<NEW_LINE>// do nothing<NEW_LINE>}<NEW_LINE>if (mFound)<NEW_LINE>return;<NEW_LINE>mBootloaderAddress = null;<NEW_LINE>mFound = true;<NEW_LINE>// Notify the waiting thread<NEW_LINE>synchronized (mLock) {<NEW_LINE>mLock.notifyAll();<NEW_LINE>}<NEW_LINE>}, "Scanner timer").start();<NEW_LINE>final BluetoothAdapter adapter = BluetoothAdapter.getDefaultAdapter();<NEW_LINE>if (adapter == null || adapter.getState() != BluetoothAdapter.STATE_ON)<NEW_LINE>return null;<NEW_LINE>adapter.startLeScan(this);<NEW_LINE>try {<NEW_LINE>synchronized (mLock) {<NEW_LINE>while (!mFound) mLock.wait();<NEW_LINE>}<NEW_LINE>} catch (final InterruptedException e) {<NEW_LINE>// do nothing<NEW_LINE>}<NEW_LINE>adapter.stopLeScan(this);<NEW_LINE>return mBootloaderAddress;<NEW_LINE>}
Thread.sleep(BootloaderScanner.TIMEOUT);
292,731
public void release(INDArray array) {<NEW_LINE>Preconditions.checkState(released.containsKey(array), "Attempting to release an array that was not allocated by" + <MASK><NEW_LINE>if (released.get(array)) {<NEW_LINE>// Already released<NEW_LINE>InferenceSession is = sd.getSessions().get(Thread.currentThread().getId());<NEW_LINE>AbstractDependencyTracker<INDArray, InferenceSession.Dep> arrayUseTracker = is.getArrayUseTracker();<NEW_LINE>DependencyList<INDArray, InferenceSession.Dep> dl = arrayUseTracker.getDependencies(array);<NEW_LINE>System.out.println(dl);<NEW_LINE>if (dl.getDependencies() != null) {<NEW_LINE>for (InferenceSession.Dep d : dl.getDependencies()) {<NEW_LINE>System.out.println(d + ": " + arrayUseTracker.isSatisfied(d));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dl.getOrDependencies() != null) {<NEW_LINE>for (Pair<InferenceSession.Dep, InferenceSession.Dep> p : dl.getOrDependencies()) {<NEW_LINE>System.out.println(p + " - (" + arrayUseTracker.isSatisfied(p.getFirst()) + "," + arrayUseTracker.isSatisfied(p.getSecond()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Preconditions.checkState(!released.get(array), "Attempting to release an array that was already deallocated by" + " an earlier release call to this memory manager: id=%s", array.getId());<NEW_LINE>log.trace("Released array: id = {}", array.getId());<NEW_LINE>released.put(array, true);<NEW_LINE>}
" this memory manager: id=%s", array.getId());
628,611
private String modify(String exp) throws InvalidExpressionException {<NEW_LINE>// Normalize digit equivalents, fraction sign, decimal separators and minus sign<NEW_LINE>char[] chars = exp.toCharArray();<NEW_LINE>for (int i = 0; i < chars.length; i++) {<NEW_LINE>int value = Character.getNumericValue(chars[i]);<NEW_LINE>if (value >= 0 && value < 10) {<NEW_LINE>chars[i] = Character.toChars<MASK><NEW_LINE>}<NEW_LINE>if (chars[i] == Chars.FRACTION) {<NEW_LINE>chars[i] = '/';<NEW_LINE>}<NEW_LINE>if (chars[i] == DECIMAL_SEPARATOR || chars[i] == ',') {<NEW_LINE>chars[i] = '.';<NEW_LINE>}<NEW_LINE>if (chars[i] == MINUS_SIGN) {<NEW_LINE>chars[i] = '-';<NEW_LINE>}<NEW_LINE>}<NEW_LINE>exp = String.copyValueOf(chars);<NEW_LINE>// Replace fraction equivalents "1 3/4" with "(1+3/4)"<NEW_LINE>exp = exp.replaceAll("(?<![\\d.])(\\d+)\\s+(\\d+)\\s*/\\s*(\\d+)(?![\\d.])", "($1+$2/$3)");<NEW_LINE>// Disallow spaces between numbers - default is to remove spaces!<NEW_LINE>if (exp.matches(".*[0-9.]\\s+[0-9.].*")) {<NEW_LINE>throw new InvalidExpressionException("Expression contains excess space: " + exp);<NEW_LINE>}<NEW_LINE>return exp;<NEW_LINE>}
(48 + value)[0];
566,335
public CombinedStatistics runReport() throws IOException {<NEW_LINE>if (!this.data.getVerbosity().showMinionOutput()) {<NEW_LINE>LOG.info("Verbose logging is disabled. If you encounter a problem, please enable it before reporting an issue.");<NEW_LINE>}<NEW_LINE>Log.setVerbose(this.data.getVerbosity());<NEW_LINE>final Runtime runtime = Runtime.getRuntime();<NEW_LINE>LOG.fine("Running report with " + this.data);<NEW_LINE>LOG.fine("System class path is " + System.getProperty("java.class.path"));<NEW_LINE>LOG.fine("Maximum available memory is " + (runtime.maxMemory<MASK><NEW_LINE>final long t0 = System.currentTimeMillis();<NEW_LINE>verifyBuildSuitableForMutationTesting();<NEW_LINE>checkExcludedRunners();<NEW_LINE>final EngineArguments args = EngineArguments.arguments().withExcludedMethods(this.data.getExcludedMethods()).withMutators(this.data.getMutators());<NEW_LINE>final MutationEngine engine = this.strategies.factory().createEngine(args);<NEW_LINE>List<MutationAnalysisUnit> preScanMutations = findMutations(engine, args);<NEW_LINE>LOG.info("Created " + preScanMutations.size() + " mutation test units in pre scan");<NEW_LINE>// throw error if configured to do so<NEW_LINE>checkMutationsFound(preScanMutations);<NEW_LINE>if (preScanMutations.isEmpty()) {<NEW_LINE>LOG.info("Skipping coverage and analysis as no mutations found");<NEW_LINE>return emptyStatistics();<NEW_LINE>}<NEW_LINE>return runAnalysis(runtime, t0, args, engine);<NEW_LINE>}
() / MB) + " mb");
1,103,206
public UpdateConnectivityInfoResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>UpdateConnectivityInfoResult updateConnectivityInfoResult = new UpdateConnectivityInfoResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return updateConnectivityInfoResult;<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("Version", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateConnectivityInfoResult.setVersion(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Message", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>updateConnectivityInfoResult.setMessage(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return updateConnectivityInfoResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
115,517
private static StringBuilder appendValues(String tableKey, List<SQLExpr> values, StringBuilder sb, int autoIncrement, int idxGlobal, int colSize, FrontendService service) throws SQLNonTransientException {<NEW_LINE>// check the value number & the column number is all right<NEW_LINE>int size = values.size();<NEW_LINE>int checkSize = colSize - (idxGlobal < 0 ? 0 : 1);<NEW_LINE>int lowerlimit = colSize - (autoIncrement < 0 ? 0 : 1) - (idxGlobal < 0 ? 0 : 1);<NEW_LINE>if (checkSize < size && idxGlobal >= 0) {<NEW_LINE>String msg = "In insert Syntax, you can't set value for Global check column!";<NEW_LINE>LOGGER.info(msg);<NEW_LINE>throw new SQLNonTransientException(msg);<NEW_LINE>} else if (size < lowerlimit) {<NEW_LINE>String msg = "Column count doesn't match value count";<NEW_LINE>LOGGER.info(msg);<NEW_LINE>throw new SQLNonTransientException(msg);<NEW_LINE>}<NEW_LINE>sb.append("(");<NEW_LINE>int iValue = 0;<NEW_LINE>// put the value number into string buffer<NEW_LINE>for (int i = 0; i < colSize; i++) {<NEW_LINE>if (i == idxGlobal) {<NEW_LINE>sb.append(new <MASK><NEW_LINE>} else if (i == autoIncrement) {<NEW_LINE>if (checkSize > size) {<NEW_LINE>long id = SequenceManager.getHandler().nextId(tableKey, service);<NEW_LINE>sb.append(id);<NEW_LINE>} else {<NEW_LINE>String value = SQLUtils.toMySqlString(values.get(iValue++));<NEW_LINE>sb.append(value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String value = SQLUtils.toMySqlString(values.get(iValue++));<NEW_LINE>sb.append(value);<NEW_LINE>}<NEW_LINE>if (i < colSize - 1) {<NEW_LINE>sb.append(",");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sb.append(")");<NEW_LINE>}
Date().getTime());
503,883
public <T extends JpaObject> List<T> fetchAll(Class<T> clz, List<String> attributes) throws Exception {<NEW_LINE>List<T> list = new ArrayList<>();<NEW_LINE>List<String> fields = ListTools.trim(attributes, true, true, JpaObject.id_FIELDNAME);<NEW_LINE>EntityManager em = this.get(clz);<NEW_LINE>CriteriaBuilder cb = em.getCriteriaBuilder();<NEW_LINE>CriteriaQuery<Tuple> cq = cb.createQuery(Tuple.class);<NEW_LINE>Root<T> root = cq.from(clz);<NEW_LINE>List<Selection<?>> selections = new ArrayList<>();<NEW_LINE>for (String str : fields) {<NEW_LINE>selections.add(root.get(str));<NEW_LINE>}<NEW_LINE>for (Tuple o : em.createQuery(cq.multiselect(selections)).getResultList()) {<NEW_LINE><MASK><NEW_LINE>for (int i = 0; i < fields.size(); i++) {<NEW_LINE>PropertyUtils.setProperty(t, attributes.get(i), o.get(selections.get(i)));<NEW_LINE>}<NEW_LINE>list.add(t);<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>}
T t = clz.newInstance();
65,613
public static void main(final String[] args) {<NEW_LINE>final int count = 1000000;<NEW_LINE>final P test = new P();<NEW_LINE>Random r = new Random(0);<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>test.<MASK><NEW_LINE>}<NEW_LINE>r = new Random(0);<NEW_LINE>for (int i = 0; i < count; i++) {<NEW_LINE>test.add(r.nextInt());<NEW_LINE>}<NEW_LINE>final long t0 = System.currentTimeMillis();<NEW_LINE>sort(test);<NEW_LINE>final long t1 = System.currentTimeMillis();<NEW_LINE>System.out.println("sort = " + (t1 - t0) + "ms");<NEW_LINE>// uniq(test);<NEW_LINE>final long t2 = System.currentTimeMillis();<NEW_LINE>System.out.println("uniq = " + (t2 - t1) + "ms");<NEW_LINE>System.out.println("result: " + test.size());<NEW_LINE>}
add(r.nextInt());
1,263,602
public void execute() throws MojoExecutionException, MojoFailureException {<NEW_LINE>if (skip) {<NEW_LINE>getLog().info("Skipping execution of RunMojo MOJO.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>getLog().info("Running JavaFX Application");<NEW_LINE>List<String> command = new ArrayList<>();<NEW_LINE>command.add(getEnvironmentRelativeExecutablePath() + "java");<NEW_LINE>// might be useful for having a custom javassist or debugger integrated in this command<NEW_LINE>Optional.ofNullable(runJavaParameter).ifPresent(parameter -> {<NEW_LINE>if (!parameter.trim().isEmpty()) {<NEW_LINE>command.add(parameter);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>command.add("-jar");<NEW_LINE>command.add(jfxMainAppJarName);<NEW_LINE>// it is possible to have jfx:run pass additional parameters<NEW_LINE>// fixes https://github.com/javafx-maven-plugin/javafx-maven-plugin/issues/176<NEW_LINE>Optional.ofNullable(runAppParameter).ifPresent(parameter -> {<NEW_LINE>if (!parameter.trim().isEmpty()) {<NEW_LINE>command.add(parameter);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>ProcessBuilder pb = new ProcessBuilder().inheritIO().directory(jfxAppOutputDir).command(command);<NEW_LINE>if (verbose) {<NEW_LINE>getLog().info("Running command: " + String.join(" ", command));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>p.waitFor();<NEW_LINE>if (p.exitValue() != 0) {<NEW_LINE>throw new MojoExecutionException("There was an exception while executing JavaFX Application. Please check build-log.");<NEW_LINE>}<NEW_LINE>} catch (IOException | InterruptedException ex) {<NEW_LINE>throw new MojoExecutionException("There was an exception while executing JavaFX Application.", ex);<NEW_LINE>}<NEW_LINE>}
Process p = pb.start();
884,692
private Map<NakadiCursor, KafkaCursor> convertToKafkaCursors(final List<NakadiCursor> cursors) throws ServiceTemporarilyUnavailableException, InvalidCursorException {<NEW_LINE>final List<Timeline> timelines = cursors.stream().map(NakadiCursor::getTimeline).distinct().collect(toList());<NEW_LINE>final List<PartitionStatistics> statistics = loadTopicStatistics(timelines);<NEW_LINE>final Map<NakadiCursor, KafkaCursor> result = new HashMap<>();<NEW_LINE>for (final NakadiCursor position : cursors) {<NEW_LINE>validateCursorForNulls(position);<NEW_LINE>final Optional<PartitionStatistics> partition = statistics.stream().filter(t -> Objects.equals(t.getPartition(), position.getPartition())).filter(t -> Objects.equals(t.getTimeline().getTopic(), position.getTopic())).findAny();<NEW_LINE>if (!partition.isPresent()) {<NEW_LINE>throw new InvalidCursorException(PARTITION_NOT_FOUND, position);<NEW_LINE>}<NEW_LINE>final KafkaCursor toCheck = position.asKafkaCursor();<NEW_LINE>// Checking oldest position<NEW_LINE>final KafkaCursor oldestCursor = KafkaCursor.fromNakadiCursor(partition.<MASK><NEW_LINE>if (toCheck.compareTo(oldestCursor) < 0) {<NEW_LINE>throw new InvalidCursorException(UNAVAILABLE, position);<NEW_LINE>}<NEW_LINE>// checking newest position<NEW_LINE>final KafkaCursor newestPosition = KafkaCursor.fromNakadiCursor(partition.get().getLast());<NEW_LINE>if (toCheck.compareTo(newestPosition) > 0) {<NEW_LINE>throw new InvalidCursorException(UNAVAILABLE, position);<NEW_LINE>} else {<NEW_LINE>result.put(position, toCheck);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
get().getBeforeFirst());
1,192,036
public TraversalControl visitArgument(Argument argument, TraverserContext<Node> context) {<NEW_LINE>QueryTraversalContext fieldCtx = <MASK><NEW_LINE>Field field = (Field) fieldCtx.getSelectionSetContainer();<NEW_LINE>QueryVisitorFieldEnvironment fieldEnv = fieldCtx.getEnvironment();<NEW_LINE>GraphQLFieldsContainer fieldsContainer = fieldEnv.getFieldsContainer();<NEW_LINE>GraphQLFieldDefinition fieldDefinition = Introspection.getFieldDef(schema, fieldsContainer, field.getName());<NEW_LINE>GraphQLArgument graphQLArgument = fieldDefinition.getArgument(argument.getName());<NEW_LINE>String argumentName = graphQLArgument.getName();<NEW_LINE>Object argumentValue = fieldEnv.getArguments().getOrDefault(argumentName, null);<NEW_LINE>QueryVisitorFieldArgumentEnvironment environment = new QueryVisitorFieldArgumentEnvironmentImpl(fieldDefinition, argument, graphQLArgument, argumentValue, variables, fieldEnv, context, schema);<NEW_LINE>QueryVisitorFieldArgumentInputValue inputValue = QueryVisitorFieldArgumentInputValueImpl.incompleteArgumentInputValue(graphQLArgument);<NEW_LINE>context.setVar(QueryVisitorFieldArgumentEnvironment.class, environment);<NEW_LINE>context.setVar(QueryVisitorFieldArgumentInputValue.class, inputValue);<NEW_LINE>if (context.getPhase() == LEAVE) {<NEW_LINE>return postOrderCallback.visitArgument(environment);<NEW_LINE>}<NEW_LINE>return preOrderCallback.visitArgument(environment);<NEW_LINE>}
context.getVarFromParents(QueryTraversalContext.class);
1,667,493
public DescribeIdentityProviderConfigurationResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DescribeIdentityProviderConfigurationResult describeIdentityProviderConfigurationResult = new DescribeIdentityProviderConfigurationResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return describeIdentityProviderConfigurationResult;<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("IdentityProviderType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeIdentityProviderConfigurationResult.setIdentityProviderType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("ServiceProviderSamlMetadata", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeIdentityProviderConfigurationResult.setServiceProviderSamlMetadata(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("IdentityProviderSamlMetadata", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>describeIdentityProviderConfigurationResult.setIdentityProviderSamlMetadata(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return describeIdentityProviderConfigurationResult;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
1,448,087
public static DescribeAgentInstallStatusResponse unmarshall(DescribeAgentInstallStatusResponse describeAgentInstallStatusResponse, UnmarshallerContext context) {<NEW_LINE>describeAgentInstallStatusResponse.setRequestId<MASK><NEW_LINE>List<AegisClientInvokeStatusResponse> aegisClientInvokeStatusResponseList = new ArrayList<AegisClientInvokeStatusResponse>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeAgentInstallStatusResponse.AegisClientInvokeStatusResponseList.Length"); i++) {<NEW_LINE>AegisClientInvokeStatusResponse aegisClientInvokeStatusResponse = new AegisClientInvokeStatusResponse();<NEW_LINE>aegisClientInvokeStatusResponse.setUuid(context.stringValue("DescribeAgentInstallStatusResponse.AegisClientInvokeStatusResponseList[" + i + "].Uuid"));<NEW_LINE>aegisClientInvokeStatusResponse.setMessage(context.stringValue("DescribeAgentInstallStatusResponse.AegisClientInvokeStatusResponseList[" + i + "].Message"));<NEW_LINE>aegisClientInvokeStatusResponse.setResult(context.integerValue("DescribeAgentInstallStatusResponse.AegisClientInvokeStatusResponseList[" + i + "].Result"));<NEW_LINE>aegisClientInvokeStatusResponseList.add(aegisClientInvokeStatusResponse);<NEW_LINE>}<NEW_LINE>describeAgentInstallStatusResponse.setAegisClientInvokeStatusResponseList(aegisClientInvokeStatusResponseList);<NEW_LINE>return describeAgentInstallStatusResponse;<NEW_LINE>}
(context.stringValue("DescribeAgentInstallStatusResponse.RequestId"));
330,595
private final Field<?> parseFieldJSONObjectConstructorIf() {<NEW_LINE>boolean jsonb = false;<NEW_LINE>if (parseFunctionNameIf("JSON_OBJECT", "JSON_BUILD_OBJECT") || (jsonb = parseFunctionNameIf("JSONB_BUILD_OBJECT"))) {<NEW_LINE>parse('(');<NEW_LINE>if (parseIf(')'))<NEW_LINE>return jsonb ? jsonbObject() : jsonObject();<NEW_LINE>List<JSONEntry<?>> result;<NEW_LINE>JSONOnNull onNull = parseJSONNullTypeIf();<NEW_LINE>DataType<?> returning = parseJSONReturningIf();<NEW_LINE>if (onNull == null && returning == null) {<NEW_LINE>result = parseList(',', c -> parseJSONEntry());<NEW_LINE>onNull = parseJSONNullTypeIf();<NEW_LINE>returning = parseJSONReturningIf();<NEW_LINE>} else<NEW_LINE>result = new ArrayList<>();<NEW_LINE>parse(')');<NEW_LINE>JSONObjectNullStep<?> s1 = jsonb ? jsonbObject(result) : jsonObject(result);<NEW_LINE>JSONObjectReturningStep<?> s2 = onNull == NULL_ON_NULL ? s1.nullOnNull() : onNull == ABSENT_ON_NULL ? s1.absentOnNull() : s1;<NEW_LINE>return returning == null ? <MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
s2 : s2.returning(returning);
276,289
protected static Date safeToDate(Object obj) {<NEW_LINE>if (obj == null) {<NEW_LINE>return null;<NEW_LINE>} else if (obj instanceof Date) {<NEW_LINE>return (Date) obj;<NEW_LINE>} else if (obj instanceof ZonedDateTime) {<NEW_LINE>ZonedDateTime zonedDateTime = ((ZonedDateTime) obj);<NEW_LINE>return Timestamp.from(zonedDateTime.toInstant());<NEW_LINE>} else if (obj instanceof OffsetDateTime) {<NEW_LINE>ZonedDateTime zonedDateTime = ((OffsetDateTime) obj).<MASK><NEW_LINE>return Timestamp.from(zonedDateTime.toInstant());<NEW_LINE>} else if (obj instanceof OffsetTime) {<NEW_LINE>ZonedDateTime zonedDateTime = ((OffsetTime) obj).atDate(LocalDate.ofEpochDay(0)).atZoneSameInstant(ZoneOffset.UTC);<NEW_LINE>return Timestamp.from(zonedDateTime.toInstant());<NEW_LINE>} else if (obj instanceof LocalDateTime) {<NEW_LINE>return Timestamp.valueOf((LocalDateTime) obj);<NEW_LINE>} else if (obj instanceof LocalDate) {<NEW_LINE>LocalDateTime dateTime = LocalDateTime.of((LocalDate) obj, LocalTime.of(0, 0, 0, 0));<NEW_LINE>return Timestamp.valueOf(dateTime);<NEW_LINE>} else if (obj instanceof Number) {<NEW_LINE>return new Date(((Number) obj).longValue());<NEW_LINE>} else {<NEW_LINE>throw new ClassCastException(obj.getClass() + " Type cannot be converted to Date");<NEW_LINE>}<NEW_LINE>}
atZoneSameInstant(ZoneOffset.systemDefault());
567,414
public int compare(PathObject o1, PathObject o2) {<NEW_LINE>PathAnnotationObject p1 = (PathAnnotationObject) o1;<NEW_LINE>PathAnnotationObject p2 = (PathAnnotationObject) o2;<NEW_LINE>int comp = 0;<NEW_LINE>if (p1.hasROI()) {<NEW_LINE>if (p2.hasROI()) {<NEW_LINE>comp = Double.compare(p1.getROI().getCentroidY(), p2.<MASK><NEW_LINE>if (comp == 0)<NEW_LINE>comp = Double.compare(p1.getROI().getCentroidX(), p2.getROI().getCentroidX());<NEW_LINE>if (comp == 0)<NEW_LINE>comp = p1.getROI().toString().compareTo(p2.getROI().toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (comp == 0)<NEW_LINE>return Integer.compare(o1.hashCode(), o2.hashCode());<NEW_LINE>else<NEW_LINE>return comp;<NEW_LINE>}
getROI().getCentroidY());
443,657
public void handle(AnnotationValues<AllArgsConstructor> annotation, JCAnnotation ast, JavacNode annotationNode) {<NEW_LINE>handleFlagUsage(annotationNode, ConfigurationKeys.ALL_ARGS_CONSTRUCTOR_FLAG_USAGE, "@AllArgsConstructor", ConfigurationKeys.ANY_CONSTRUCTOR_FLAG_USAGE, "any @xArgsConstructor");<NEW_LINE>deleteAnnotationIfNeccessary(annotationNode, AllArgsConstructor.class);<NEW_LINE>deleteImportFromCompilationUnit(annotationNode, "lombok.AccessLevel");<NEW_LINE>JavacNode typeNode = annotationNode.up();<NEW_LINE>if (!checkLegality(typeNode, annotationNode, NAME))<NEW_LINE>return;<NEW_LINE>List<JCAnnotation> onConstructor = unboxAndRemoveAnnotationParameter(ast, "onConstructor", "@AllArgsConstructor(onConstructor", annotationNode);<NEW_LINE>AllArgsConstructor ann = annotation.getInstance();<NEW_LINE>AccessLevel level = ann.access();<NEW_LINE>if (level == AccessLevel.NONE)<NEW_LINE>return;<NEW_LINE><MASK><NEW_LINE>if (annotation.isExplicit("suppressConstructorProperties")) {<NEW_LINE>annotationNode.addError("This deprecated feature is no longer supported. Remove it; you can create a lombok.config file with 'lombok.anyConstructor.suppressConstructorProperties = true'.");<NEW_LINE>}<NEW_LINE>handleConstructor.generateConstructor(typeNode, level, onConstructor, findAllFields(typeNode), false, staticName, SkipIfConstructorExists.NO, annotationNode);<NEW_LINE>}
String staticName = ann.staticName();
441,651
public void writeTo(StreamOutput out) throws IOException {<NEW_LINE>super.writeTo(out);<NEW_LINE>indices.writeTo(out);<NEW_LINE>if (out.getVersion().before(LegacyESVersion.V_7_7_0)) {<NEW_LINE>out.writeBoolean(Metric.OS.containedIn(requestedMetrics));<NEW_LINE>out.writeBoolean(Metric.PROCESS.containedIn(requestedMetrics));<NEW_LINE>out.writeBoolean(Metric.JVM.containedIn(requestedMetrics));<NEW_LINE>out.writeBoolean(Metric.THREAD_POOL.containedIn(requestedMetrics));<NEW_LINE>out.writeBoolean(Metric.FS.containedIn(requestedMetrics));<NEW_LINE>out.writeBoolean(Metric.TRANSPORT.containedIn(requestedMetrics));<NEW_LINE>out.writeBoolean(Metric<MASK><NEW_LINE>out.writeBoolean(Metric.BREAKER.containedIn(requestedMetrics));<NEW_LINE>out.writeBoolean(Metric.SCRIPT.containedIn(requestedMetrics));<NEW_LINE>out.writeBoolean(Metric.DISCOVERY.containedIn(requestedMetrics));<NEW_LINE>out.writeBoolean(Metric.INGEST.containedIn(requestedMetrics));<NEW_LINE>out.writeBoolean(Metric.ADAPTIVE_SELECTION.containedIn(requestedMetrics));<NEW_LINE>} else {<NEW_LINE>out.writeStringArray(requestedMetrics.toArray(new String[0]));<NEW_LINE>}<NEW_LINE>}
.HTTP.containedIn(requestedMetrics));
591,281
private Map<String, float[]> deprecatedGetFeatureMap() {<NEW_LINE>status = Common.initSession(flParameter.getTrainModelPath());<NEW_LINE>if (status == FLClientStatus.FAILED) {<NEW_LINE>retCode = ResponseCode.RequestError;<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>Map<String, float[]> map = new HashMap<String, float[]>();<NEW_LINE>if (flParameter.getFlName().equals(ALBERT)) {<NEW_LINE>LOGGER.info(Common.addTag("[updateModel] serialize feature map for " + flParameter.getFlName()));<NEW_LINE>AlTrainBert alTrainBert = AlTrainBert.getInstance();<NEW_LINE>map = SessionUtil.convertTensorToFeatures(SessionUtil.getFeatures<MASK><NEW_LINE>if (map.isEmpty()) {<NEW_LINE>LOGGER.severe(Common.addTag("[updateModel] the return map is empty in <SessionUtil" + ".convertTensorToFeatures>"));<NEW_LINE>status = FLClientStatus.FAILED;<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>} else if (flParameter.getFlName().equals(LENET)) {<NEW_LINE>LOGGER.info(Common.addTag("[updateModel] serialize feature map for " + flParameter.getFlName()));<NEW_LINE>TrainLenet trainLenet = TrainLenet.getInstance();<NEW_LINE>map = SessionUtil.convertTensorToFeatures(SessionUtil.getFeatures(trainLenet.getTrainSession()));<NEW_LINE>if (map.isEmpty()) {<NEW_LINE>LOGGER.severe(Common.addTag("[updateModel] the return map is empty in <SessionUtil" + ".convertTensorToFeatures>"));<NEW_LINE>status = FLClientStatus.FAILED;<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOGGER.severe(Common.addTag("[updateModel] the flName is not valid"));<NEW_LINE>status = FLClientStatus.FAILED;<NEW_LINE>throw new IllegalArgumentException();<NEW_LINE>}<NEW_LINE>Common.freeSession();<NEW_LINE>return map;<NEW_LINE>}
(alTrainBert.getTrainSession()));
1,094,987
public com.amazonaws.services.config.model.ResourceNotFoundException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.config.model.ResourceNotFoundException resourceNotFoundException = new com.amazonaws.services.config.model.ResourceNotFoundException(null);<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>} 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 resourceNotFoundException;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
1,355,517
protected RepositoryModel createRepository(UserModel user, String repository, String action) {<NEW_LINE>boolean isPush = !StringUtils.isEmpty(action) && GIT_RECEIVE_PACK.equals(action);<NEW_LINE>if (GIT_LFS.equals(action)) {<NEW_LINE>// Repository must already exist for any filestore actions<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (isPush) {<NEW_LINE>if (user.canCreate(repository)) {<NEW_LINE>// user is pushing to a new repository<NEW_LINE>// validate name<NEW_LINE>if (repository.startsWith("../")) {<NEW_LINE>logger.error(MessageFormat.format("Illegal relative path in repository name! {0}", repository));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (repository.contains("/../")) {<NEW_LINE>logger.error(MessageFormat.format("Illegal relative path in repository name! {0}", repository));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// confirm valid characters in repository name<NEW_LINE>Character c = StringUtils.findInvalidCharacter(repository);<NEW_LINE>if (c != null) {<NEW_LINE>logger.error(MessageFormat.format<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// create repository<NEW_LINE>RepositoryModel model = new RepositoryModel();<NEW_LINE>model.name = repository;<NEW_LINE>model.addOwner(user.username);<NEW_LINE>model.projectPath = StringUtils.getFirstPathElement(repository);<NEW_LINE>if (model.isUsersPersonalRepository(user.username)) {<NEW_LINE>// personal repository, default to private for user<NEW_LINE>model.authorizationControl = AuthorizationControl.NAMED;<NEW_LINE>model.accessRestriction = AccessRestrictionType.VIEW;<NEW_LINE>} else {<NEW_LINE>// common repository, user default server settings<NEW_LINE>model.authorizationControl = AuthorizationControl.fromName(settings.getString(Keys.git.defaultAuthorizationControl, ""));<NEW_LINE>model.accessRestriction = AccessRestrictionType.fromName(settings.getString(Keys.git.defaultAccessRestriction, "PUSH"));<NEW_LINE>}<NEW_LINE>// create the repository<NEW_LINE>try {<NEW_LINE>repositoryManager.updateRepositoryModel(model.name, model, true);<NEW_LINE>logger.info(MessageFormat.format("{0} created {1} ON-PUSH", user.username, model.name));<NEW_LINE>return repositoryManager.getRepositoryModel(model.name);<NEW_LINE>} catch (GitBlitException e) {<NEW_LINE>logger.error(MessageFormat.format("{0} failed to create repository {1} ON-PUSH!", user.username, model.name), e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.warn(MessageFormat.format("{0} is not permitted to create repository {1} ON-PUSH!", user.username, repository));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// repository could not be created or action was not a push<NEW_LINE>return null;<NEW_LINE>}
("Invalid character '{0}' in repository name {1}!", c, repository));
675,520
private void foldElement(Element element) {<NEW_LINE>if (element != null && element.getChildNodes().getLength() > MAX_SHOW_ITEMS) {<NEW_LINE>for (int i = MAX_SHOW_ITEMS; i < element.getChildNodes().getLength(); i++) {<NEW_LINE>if (element.getChildNodes().item(i) instanceof Element) {<NEW_LINE>((Element) element.getChildNodes().item(i)).setAttribute("hidden", "true");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Element span = document.createElement("span");<NEW_LINE><MASK><NEW_LINE>span.setAttribute("onClick", FOLDER_ONCLICK);<NEW_LINE>span.setTextContent("...");<NEW_LINE>Element folder = null;<NEW_LINE>if (element.getTagName().equals("table")) {<NEW_LINE>folder = document.createElement("tr");<NEW_LINE>Element td = document.createElement("td");<NEW_LINE>td.setAttribute("colspan", "100%");<NEW_LINE>folder.appendChild(td);<NEW_LINE>td.appendChild(span);<NEW_LINE>} else if (element.getTagName().equals("ul")) {<NEW_LINE>folder = document.createElement("li");<NEW_LINE>Element parent = document.createElement("span");<NEW_LINE>parent.appendChild(span);<NEW_LINE>folder.appendChild(parent);<NEW_LINE>}<NEW_LINE>if (folder != null) {<NEW_LINE>element.insertBefore(folder, element.getChildNodes().item(MAX_SHOW_ITEMS));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < element.getChildNodes().getLength(); i++) {<NEW_LINE>if (element.getChildNodes().item(i) instanceof Element) {<NEW_LINE>foldElement((Element) element.getChildNodes().item(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
span.setAttribute("style", FOLDER_STYLE);
1,796,511
public static DescribeVmBackupPlansResponse unmarshall(DescribeVmBackupPlansResponse describeVmBackupPlansResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeVmBackupPlansResponse.setRequestId(_ctx.stringValue("DescribeVmBackupPlansResponse.RequestId"));<NEW_LINE>describeVmBackupPlansResponse.setSuccess(_ctx.booleanValue("DescribeVmBackupPlansResponse.Success"));<NEW_LINE>describeVmBackupPlansResponse.setCode(_ctx.stringValue("DescribeVmBackupPlansResponse.Code"));<NEW_LINE>describeVmBackupPlansResponse.setMessage(_ctx.stringValue("DescribeVmBackupPlansResponse.Message"));<NEW_LINE>describeVmBackupPlansResponse.setTotalCount(_ctx.integerValue("DescribeVmBackupPlansResponse.TotalCount"));<NEW_LINE>describeVmBackupPlansResponse.setPageNumber(_ctx.integerValue("DescribeVmBackupPlansResponse.PageNumber"));<NEW_LINE>describeVmBackupPlansResponse.setPageSize(_ctx.integerValue("DescribeVmBackupPlansResponse.PageSize"));<NEW_LINE>List<Plan> plans = new ArrayList<Plan>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeVmBackupPlansResponse.Plans.Length"); i++) {<NEW_LINE>Plan plan = new Plan();<NEW_LINE>plan.setPlanId(_ctx.stringValue("DescribeVmBackupPlansResponse.Plans[" + i + "].PlanId"));<NEW_LINE>plan.setPlanName(_ctx.stringValue("DescribeVmBackupPlansResponse.Plans[" + i + "].PlanName"));<NEW_LINE>plan.setPlanStatus(_ctx.stringValue("DescribeVmBackupPlansResponse.Plans[" + i + "].PlanStatus"));<NEW_LINE>plan.setServerType(_ctx.stringValue("DescribeVmBackupPlansResponse.Plans[" + i + "].ServerType"));<NEW_LINE>plan.setRetention(_ctx.longValue("DescribeVmBackupPlansResponse.Plans[" + i + "].Retention"));<NEW_LINE>plan.setFullSchedule(_ctx.stringValue("DescribeVmBackupPlansResponse.Plans[" + i + "].FullSchedule"));<NEW_LINE>plan.setIncSchedule(_ctx.stringValue("DescribeVmBackupPlansResponse.Plans[" + i + "].IncSchedule"));<NEW_LINE>plan.setDiffSchedule(_ctx.stringValue("DescribeVmBackupPlansResponse.Plans[" + i + "].DiffSchedule"));<NEW_LINE>plan.setUpdatedTime(_ctx.longValue("DescribeVmBackupPlansResponse.Plans[" + i + "].UpdatedTime"));<NEW_LINE>plan.setCreatedTime(_ctx.longValue<MASK><NEW_LINE>List<VmInfo> vmInfos = new ArrayList<VmInfo>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeVmBackupPlansResponse.Plans[" + i + "].VmInfos.Length"); j++) {<NEW_LINE>VmInfo vmInfo = new VmInfo();<NEW_LINE>vmInfo.setVmId(_ctx.stringValue("DescribeVmBackupPlansResponse.Plans[" + i + "].VmInfos[" + j + "].VmId"));<NEW_LINE>vmInfo.setVmName(_ctx.stringValue("DescribeVmBackupPlansResponse.Plans[" + i + "].VmInfos[" + j + "].VmName"));<NEW_LINE>vmInfo.setExtra(_ctx.stringValue("DescribeVmBackupPlansResponse.Plans[" + i + "].VmInfos[" + j + "].Extra"));<NEW_LINE>vmInfo.setHypervisorId(_ctx.stringValue("DescribeVmBackupPlansResponse.Plans[" + i + "].VmInfos[" + j + "].HypervisorId"));<NEW_LINE>vmInfo.setVmInfo(_ctx.stringValue("DescribeVmBackupPlansResponse.Plans[" + i + "].VmInfos[" + j + "].VmInfo"));<NEW_LINE>vmInfo.setClientId(_ctx.stringValue("DescribeVmBackupPlansResponse.Plans[" + i + "].VmInfos[" + j + "].ClientId"));<NEW_LINE>vmInfo.setForceSilentSnapshot(_ctx.booleanValue("DescribeVmBackupPlansResponse.Plans[" + i + "].VmInfos[" + j + "].ForceSilentSnapshot"));<NEW_LINE>vmInfo.setHypervisorType(_ctx.stringValue("DescribeVmBackupPlansResponse.Plans[" + i + "].VmInfos[" + j + "].HypervisorType"));<NEW_LINE>vmInfo.setUseHotAdd(_ctx.booleanValue("DescribeVmBackupPlansResponse.Plans[" + i + "].VmInfos[" + j + "].UseHotAdd"));<NEW_LINE>vmInfos.add(vmInfo);<NEW_LINE>}<NEW_LINE>plan.setVmInfos(vmInfos);<NEW_LINE>plans.add(plan);<NEW_LINE>}<NEW_LINE>describeVmBackupPlansResponse.setPlans(plans);<NEW_LINE>return describeVmBackupPlansResponse;<NEW_LINE>}
("DescribeVmBackupPlansResponse.Plans[" + i + "].CreatedTime"));
796,277
private static ORecordHook.RESULT executeFunction(final ODocument iDocument, final OFunction func, ODatabaseDocumentInternal database) {<NEW_LINE>if (func == null)<NEW_LINE>return ORecordHook.RESULT.RECORD_NOT_CHANGED;<NEW_LINE>final OScriptManager scriptManager = database.getSharedContext().getOrientDB().getScriptManager();<NEW_LINE>final OPartitionedObjectPool.PoolEntry<ScriptEngine> entry = scriptManager.acquireDatabaseEngine(database.getName(), func.getLanguage());<NEW_LINE>final ScriptEngine scriptEngine = entry.object;<NEW_LINE>try {<NEW_LINE>final Bindings binding = scriptEngine.getBindings(ScriptContext.ENGINE_SCOPE);<NEW_LINE>scriptManager.bind(scriptEngine, binding, (ODatabaseDocumentInternal) database, null, null);<NEW_LINE>binding.put("doc", iDocument);<NEW_LINE>String result = null;<NEW_LINE>try {<NEW_LINE>if (func.getLanguage() == null)<NEW_LINE>throw new OConfigurationException("Database function '" + <MASK><NEW_LINE>final String funcStr = scriptManager.getFunctionDefinition(func);<NEW_LINE>if (funcStr != null) {<NEW_LINE>try {<NEW_LINE>scriptEngine.eval(funcStr);<NEW_LINE>} catch (ScriptException e) {<NEW_LINE>scriptManager.throwErrorMessage(e, funcStr);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (scriptEngine instanceof Invocable) {<NEW_LINE>final Invocable invocableEngine = (Invocable) scriptEngine;<NEW_LINE>Object[] empty = OCommonConst.EMPTY_OBJECT_ARRAY;<NEW_LINE>result = (String) invocableEngine.invokeFunction(func.getName(), empty);<NEW_LINE>}<NEW_LINE>} catch (ScriptException e) {<NEW_LINE>throw OException.wrapException(new OCommandScriptException("Error on execution of the script", func.getName(), e.getColumnNumber()), e);<NEW_LINE>} catch (NoSuchMethodException e) {<NEW_LINE>throw OException.wrapException(new OCommandScriptException("Error on execution of the script", func.getName(), 0), e);<NEW_LINE>} catch (OCommandScriptException e) {<NEW_LINE>// PASS THROUGH<NEW_LINE>throw e;<NEW_LINE>} finally {<NEW_LINE>scriptManager.unbind(scriptEngine, binding, null, null);<NEW_LINE>}<NEW_LINE>if (result == null) {<NEW_LINE>return ORecordHook.RESULT.RECORD_NOT_CHANGED;<NEW_LINE>}<NEW_LINE>return ORecordHook.RESULT.valueOf(result);<NEW_LINE>} finally {<NEW_LINE>scriptManager.releaseDatabaseEngine(func.getLanguage(), database.getName(), entry);<NEW_LINE>}<NEW_LINE>}
func.getName() + "' has no language");
932,060
protected void doParse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder) {<NEW_LINE>CoreNamespaceUtils.autoregisterBeansForNamespace(parserContext, element);<NEW_LINE>String dataSource = element.getAttribute("data-source");<NEW_LINE>String jdbcOperations = element.getAttribute("jdbc-operations");<NEW_LINE>String transactionManager = element.getAttribute("transaction-manager");<NEW_LINE>String isolationLevelForCreate = element.getAttribute("isolation-level-for-create");<NEW_LINE>String tablePrefix = element.getAttribute("table-prefix");<NEW_LINE>String maxVarCharLength = element.getAttribute("max-varchar-length");<NEW_LINE>String lobHandler = element.getAttribute("lob-handler");<NEW_LINE>String serializer = element.getAttribute("serializer");<NEW_LINE>RuntimeBeanReference ds = new RuntimeBeanReference(dataSource);<NEW_LINE>builder.addPropertyValue("dataSource", ds);<NEW_LINE>RuntimeBeanReference tx = new RuntimeBeanReference(transactionManager);<NEW_LINE>builder.addPropertyValue("transactionManager", tx);<NEW_LINE>if (StringUtils.hasText(jdbcOperations)) {<NEW_LINE>builder.addPropertyReference("jdbcOperations", jdbcOperations);<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(isolationLevelForCreate)) {<NEW_LINE>builder.addPropertyValue("isolationLevelForCreate", DefaultTransactionDefinition.PREFIX_ISOLATION + isolationLevelForCreate);<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(tablePrefix)) {<NEW_LINE>builder.addPropertyValue("tablePrefix", tablePrefix);<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(lobHandler)) {<NEW_LINE>builder.addPropertyReference("lobHandler", lobHandler);<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(maxVarCharLength)) {<NEW_LINE>builder.addPropertyValue("maxVarCharLength", maxVarCharLength);<NEW_LINE>}<NEW_LINE>if (StringUtils.hasText(serializer)) {<NEW_LINE>builder.addPropertyReference("serializer", serializer);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>}
builder.setRole(BeanDefinition.ROLE_SUPPORT);
776,116
private void writeAttributes(final ITreeWriter writer, final NodeModel node, final NodeStyleModel style, final boolean forceFormatting) {<NEW_LINE>final Color color = forceFormatting ? nsc.getColor(node, StyleOption.FOR_UNSELECTED_NODE) : style.getColor();<NEW_LINE>if (color != null) {<NEW_LINE>ColorUtils.addColorAttributes(writer, "COLOR", "ALPHA", color);<NEW_LINE>}<NEW_LINE>final Color backgroundColor = forceFormatting ? nsc.getBackgroundColor(node, StyleOption.FOR_UNSELECTED_NODE) : style.getBackgroundColor();<NEW_LINE>if (backgroundColor != null) {<NEW_LINE>ColorUtils.addColorAttributes(writer, "BACKGROUND_COLOR", "BACKGROUND_ALPHA", backgroundColor);<NEW_LINE>}<NEW_LINE>final NodeGeometryModel shapeConfiguration = forceFormatting ? nsc.getShapeConfiguration(node, StyleOption.FOR_UNSELECTED_NODE) : style.getShapeConfiguration();<NEW_LINE>final NodeStyleShape shape = shapeConfiguration.getShape();<NEW_LINE>if (shape != null) {<NEW_LINE>writer.addAttribute("STYLE", shape.toString());<NEW_LINE>}<NEW_LINE>final Quantity<LengthUnit> shapeHorizontalMargin = shapeConfiguration.getHorizontalMargin();<NEW_LINE>if (!shapeHorizontalMargin.equals(NodeGeometryModel.DEFAULT_MARGIN)) {<NEW_LINE>BackwardCompatibleQuantityWriter.forWriter(writer).writeQuantity("SHAPE_HORIZONTAL_MARGIN", shapeHorizontalMargin);<NEW_LINE>}<NEW_LINE>final Quantity<LengthUnit> shapeVerticalMargin = shapeConfiguration.getVerticalMargin();<NEW_LINE>if (!shapeVerticalMargin.equals(NodeGeometryModel.DEFAULT_MARGIN)) {<NEW_LINE>BackwardCompatibleQuantityWriter.forWriter(writer).writeQuantity("SHAPE_VERTICAL_MARGIN", shapeVerticalMargin);<NEW_LINE>}<NEW_LINE>final boolean uniformShape = shapeConfiguration.isUniform();<NEW_LINE>if (uniformShape) {<NEW_LINE>writer.addAttribute("UNIFORM_SHAPE", "true");<NEW_LINE>}<NEW_LINE>final Boolean numbered = forceFormatting ? Boolean.valueOf(nsc.getNodeNumbering(node)) : style.getNodeNumbering();<NEW_LINE>if (numbered != null) {<NEW_LINE>writer.addAttribute("NUMBERED"<MASK><NEW_LINE>}<NEW_LINE>final String format = forceFormatting ? nsc.getNodeFormat(node) : style.getNodeFormat();<NEW_LINE>if (format != null) {<NEW_LINE>writer.addAttribute("FORMAT", format);<NEW_LINE>}<NEW_LINE>final HorizontalTextAlignment textAlignment = forceFormatting ? nsc.getHorizontalTextAlignment(node, StyleOption.FOR_UNSELECTED_NODE) : style.getHorizontalTextAlignment();<NEW_LINE>if (textAlignment != null) {<NEW_LINE>writer.addAttribute("TEXT_ALIGN", textAlignment.toString());<NEW_LINE>}<NEW_LINE>}
, Boolean.toString(numbered));
570,252
public boolean isValid() {<NEW_LINE>if (!isListenerSelected()) {<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>wizard.// NOI18N<NEW_LINE>putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, org.openide.util.NbBundle.getMessage(ListenerPanel.class, "MSG_noListenerSelected"));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Project project = Templates.getProject(wizard);<NEW_LINE>Sources sources = ProjectUtils.getSources(project);<NEW_LINE>SourceGroup[] groups = sources.getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);<NEW_LINE>ClassPath cp = null;<NEW_LINE>String resource = null;<NEW_LINE>if (groups != null && groups.length != 0) {<NEW_LINE>cp = ClassPath.getClassPath(groups[0].<MASK><NEW_LINE>if (isContextListener()) {<NEW_LINE>resource = SERVLET_CONTEXT_LISTENER;<NEW_LINE>} else if (isContextAttrListener()) {<NEW_LINE>resource = SERVLET_CONTEXT_ATTRIBUTE_LISTENER;<NEW_LINE>} else if (isSessionListener()) {<NEW_LINE>resource = HTTP_SESSION_LISTENER;<NEW_LINE>} else if (isSessionAttrListener()) {<NEW_LINE>resource = HTTP_SESSION_ATTRIBUTE_LISTENER;<NEW_LINE>} else if (isRequestListener()) {<NEW_LINE>resource = SERVLET_REQUEST_LISTENER;<NEW_LINE>} else if (isRequestAttrListener()) {<NEW_LINE>resource = SERVLET_REQUEST_ATTRIBUTE_LISTENER;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (cp != null && resource != null && cp.findResource(resource.replace('.', '/') + ".class") == null) {<NEW_LINE>// NOI18N<NEW_LINE>wizard.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, org.openide.util.NbBundle.getMessage(ListenerPanel.class, "MSG_noResourceInClassPath", resource));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>WebModule module = WebModule.getWebModule(project.getProjectDirectory());<NEW_LINE>if (createElementInDD() && (module == null || module.getWebInf() == null)) {<NEW_LINE>// NOI18N<NEW_LINE>wizard.putProperty(WizardDescriptor.PROP_WARNING_MESSAGE, org.openide.util.NbBundle.getMessage(ListenerPanel.class, "MSG_noWebInfDirectory", resource));<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>wizard.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, "");<NEW_LINE>// NOI18N<NEW_LINE>wizard.putProperty(WizardDescriptor.PROP_WARNING_MESSAGE, "");<NEW_LINE>return true;<NEW_LINE>}
getRootFolder(), ClassPath.COMPILE);
361,376
private Object tryHandleReference0(Object o, ReferenceType type) throws ReflectiveOperationException {<NEW_LINE>if (o instanceof RedissonReference) {<NEW_LINE>return fromReference((RedissonReference) o, type);<NEW_LINE>} else if (o instanceof ScoredEntry && ((ScoredEntry) o).getValue() instanceof RedissonReference) {<NEW_LINE>ScoredEntry<?> se = (ScoredEntry<?>) o;<NEW_LINE>return new ScoredEntry(se.getScore(), fromReference((RedissonReference) se.getValue(), type));<NEW_LINE>} else if (o instanceof Map.Entry) {<NEW_LINE>Map.Entry old = (Map.Entry) o;<NEW_LINE>Object key = tryHandleReference0(old.getKey(), type);<NEW_LINE>Object value = tryHandleReference0(<MASK><NEW_LINE>if (value != old.getValue() || key != old.getKey()) {<NEW_LINE>return new AbstractMap.SimpleEntry(key, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return o;<NEW_LINE>}
old.getValue(), type);
1,516,548
static public IHAWriteMessage processNextBuffer(final RandomAccessFile raf, final IReopenChannel<FileChannel> reopener, final StoreTypeEnum storeType, final ByteBuffer clientBuffer) throws IOException {<NEW_LINE>final FileChannel channel = raf.getChannel();<NEW_LINE>final ObjectInputStream objinstr = new ObjectInputStream(new RAFInputStream(raf));<NEW_LINE>final IHAWriteMessage msg;<NEW_LINE>try {<NEW_LINE>msg = (IHAWriteMessage) objinstr.readObject();<NEW_LINE>} catch (ClassNotFoundException e) {<NEW_LINE>throw new IllegalStateException(e);<NEW_LINE>}<NEW_LINE>switch(storeType) {<NEW_LINE>case WORM:<NEW_LINE>case RW:<NEW_LINE>{<NEW_LINE>if (msg.getSize() > clientBuffer.capacity()) {<NEW_LINE>throw new IllegalStateException("Client buffer is not large enough for logged buffer");<NEW_LINE>}<NEW_LINE>// Now setup client buffer to receive from the channel<NEW_LINE>final int nbytes = msg.getSize();<NEW_LINE>clientBuffer.position(0);<NEW_LINE>clientBuffer.limit(nbytes);<NEW_LINE>// Current position on channel.<NEW_LINE>final long pos = channel.position();<NEW_LINE>// allow null clientBuffer for IHAWriteMessage only<NEW_LINE>if (clientBuffer != null) {<NEW_LINE>// Robustly read of write cache block at that position into the<NEW_LINE>// caller's buffer. (pos=limit=nbytes)<NEW_LINE>FileChannelUtility.<MASK><NEW_LINE>// limit=pos; pos=0;<NEW_LINE>// ready for reading<NEW_LINE>clientBuffer.flip();<NEW_LINE>final int chksum = new ChecksumUtility().checksum(clientBuffer.duplicate());<NEW_LINE>if (chksum != msg.getChk())<NEW_LINE>throw new ChecksumError("Expected=" + msg.getChk() + ", actual=" + chksum);<NEW_LINE>if (clientBuffer.remaining() != nbytes)<NEW_LINE>throw new AssertionError();<NEW_LINE>}<NEW_LINE>// Advance the file channel beyond the block we just read.<NEW_LINE>channel.position(pos + msg.getSize());<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException();<NEW_LINE>}<NEW_LINE>return msg;<NEW_LINE>}
readAll(reopener, clientBuffer, pos);
234,260
public void convolveDerivOrder() {<NEW_LINE>T blur = GeneralizedImageOps.createSingleBand(imageType, width, height);<NEW_LINE>T blurDeriv = GeneralizedImageOps.<MASK><NEW_LINE>T deriv = GeneralizedImageOps.createSingleBand(imageType, width, height);<NEW_LINE>T derivBlur = GeneralizedImageOps.createSingleBand(imageType, width, height);<NEW_LINE>BlurStorageFilter<T> funcBlur = FactoryBlurFilter.gaussian(ImageType.single(imageType), sigma, radius);<NEW_LINE>ImageGradient<T, T> funcDeriv = FactoryDerivative.three(imageType, imageType);<NEW_LINE>funcBlur.process(input, blur);<NEW_LINE>funcDeriv.process(blur, blurDeriv, derivY);<NEW_LINE>funcDeriv.process(input, deriv, derivY);<NEW_LINE>funcBlur.process(deriv, derivBlur);<NEW_LINE>printIntensity("Blur->Deriv", blurDeriv);<NEW_LINE>printIntensity("Deriv->Blur", blurDeriv);<NEW_LINE>}
createSingleBand(imageType, width, height);
1,744,831
public void listIncidentsForDetectionConfig() {<NEW_LINE>// BEGIN: com.azure.ai.metricsadvisor.MetricsAdvisorAsyncClient.listIncidentsForDetectionConfig#String-OffsetDateTime-OffsetDateTime<NEW_LINE>final String detectionConfigurationId = "c0f2539f-b804-4ab9-a70f-0da0c89c76d8";<NEW_LINE>final OffsetDateTime <MASK><NEW_LINE>final OffsetDateTime endTime = OffsetDateTime.parse("2020-09-09T12:00:00Z");<NEW_LINE>PagedFlux<AnomalyIncident> incidentsFlux = metricsAdvisorAsyncClient.listIncidentsForDetectionConfig(detectionConfigurationId, startTime, endTime);<NEW_LINE>incidentsFlux.subscribe(incident -> {<NEW_LINE>System.out.printf("Data Feed Metric Id: %s%n", incident.getMetricId());<NEW_LINE>System.out.printf("Detection Configuration Id: %s%n", incident.getDetectionConfigurationId());<NEW_LINE>System.out.printf("Anomaly Incident Id: %s%n", incident.getId());<NEW_LINE>System.out.printf("Anomaly Incident Start Time: %s%n", incident.getStartTime());<NEW_LINE>System.out.printf("Anomaly Incident AnomalySeverity: %s%n", incident.getSeverity());<NEW_LINE>System.out.printf("Anomaly Incident Status: %s%n", incident.getStatus());<NEW_LINE>System.out.printf("Root DataFeedDimension Key: %s%n", incident.getRootDimensionKey().asMap());<NEW_LINE>});<NEW_LINE>// END: com.azure.ai.metricsadvisor.MetricsAdvisorAsyncClient.listIncidentsForDetectionConfig#String-OffsetDateTime-OffsetDateTime<NEW_LINE>}
startTime = OffsetDateTime.parse("2020-09-09T00:00:00Z");
506,160
private String dumpJavaColonCompEnvMap() {<NEW_LINE>StringBuffer buffer = new StringBuffer("");<NEW_LINE>buffer.append("EJBContext.lookup data structure contents:\n");<NEW_LINE>buffer.append(" Contains **" + ivJavaColonCompEnvMap.size() + "** bindings.\n");<NEW_LINE>if (!ivJavaColonCompEnvMap.isEmpty()) {<NEW_LINE>Set<Map.Entry<String, InjectionBinding<?>>> entries = ivJavaColonCompEnvMap.entrySet();<NEW_LINE>Iterator<Map.Entry<String, InjectionBinding<?>>> entryIterator = entries.iterator();<NEW_LINE>int count = 0;<NEW_LINE>while (entryIterator.hasNext()) {<NEW_LINE>Map.Entry<String, InjectionBinding<?>> oneEntry = entryIterator.next();<NEW_LINE>buffer.append(" Entry " + count + "\n");<NEW_LINE>buffer.append(" Key: **" + oneEntry.getKey() + "**\n");<NEW_LINE>buffer.append(" Value: **" + <MASK><NEW_LINE>buffer.append("\n");<NEW_LINE>count++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return buffer.toString();<NEW_LINE>}
oneEntry.getValue() + "**\n");
1,765,258
private void initJs(Project p, Map<String, String> testStubsParams) throws IOException {<NEW_LINE>Map<String, String> map = new HashMap<String, String>();<NEW_LINE>map.put(RESTCLIENT_STABS_VAR, NbBundle.getMessage(ClientStubsGenerator.class, TTL_RestClient_Stubs));<NEW_LINE>map.put(README_VAR, NbBundle.getMessage(ClientStubsGenerator.class, MSG_Readme));<NEW_LINE>map.put(TESTPAGE_VAR, NbBundle.getMessage(ClientStubsGenerator.class, MSG_TestPage));<NEW_LINE>map.put(README_CONTENT_VAR, NbBundle.getMessage(ClientStubsGenerator.class, MSG_JS_Readme_Content));<NEW_LINE>testStubsParams.putAll(map);<NEW_LINE>FileObject fo = createDataObjectFromTemplate(JS_TESTSTUBS_TEMPLATE, rjsDir, <MASK><NEW_LINE>createDataObjectFromTemplate(JS_STUBSUPPORT_TEMPLATE, rjsDir, JS_SUPPORT, JS, false);<NEW_LINE>fo = createDataObjectFromTemplate(JS_README_TEMPLATE, rjsDir, JS_README, HTML, false, map);<NEW_LINE>fo = createDataObjectFromTemplate(PROXY_TEMPLATE, rjsDir, PROXY, TXT, false);<NEW_LINE>File cssDir = new File(FileUtil.toFile(rjsDir), "css");<NEW_LINE>cssDir.mkdirs();<NEW_LINE>copySupportFiles(cssDir);<NEW_LINE>}
JS_TESTSTUBS, HTML, false, testStubsParams);
1,599,430
public void createView(Contact contact, Channel channel, final AlMessageViewEvents listener) {<NEW_LINE>removeAllViews();<NEW_LINE>this.listener = listener;<NEW_LINE>LayoutInflater inflater = (LayoutInflater) getContext().getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);<NEW_LINE>View view = inflater.inflate(R.layout.al_message_sender_view, null);<NEW_LINE>LinearLayout mainEditTextLayout = view.findViewById(R.id.main_edit_text_linear_layout);<NEW_LINE>messageEditText = mainEditTextLayout.findViewById(R.id.conversation_message);<NEW_LINE>attachmentButton = mainEditTextLayout.<MASK><NEW_LINE>emoticonsButton = mainEditTextLayout.findViewById(R.id.emoticons_btn);<NEW_LINE>emoticonsButton.setVisibility(GONE);<NEW_LINE>messageEditText.setHint("Write a message...");<NEW_LINE>FrameLayout actionButtonLayout = view.findViewById(R.id.actionButtonLayout);<NEW_LINE>sendMessageButton = actionButtonLayout.findViewById(R.id.conversation_send);<NEW_LINE>audioRecordButton = actionButtonLayout.findViewById(R.id.record_button);<NEW_LINE>audioRecordButton.setVisibility(GONE);<NEW_LINE>sendMessageButton.setVisibility(VISIBLE);<NEW_LINE>((LinearLayout) view).removeAllViews();<NEW_LINE>publishTypingStatus(messageEditText, contact, channel);<NEW_LINE>attachListeners();<NEW_LINE>addView(mainEditTextLayout);<NEW_LINE>addView(actionButtonLayout);<NEW_LINE>}
findViewById(R.id.attach_button);
1,242,107
// GEN-LAST:event_removeClasspathActionPerformed<NEW_LINE>private void addClasspathActionPerformed(java.awt.event.ActionEvent evt) {<NEW_LINE>// GEN-FIRST:event_addClasspathActionPerformed<NEW_LINE>FileChooser chooser = new FileChooser(this.projectFolder, null);<NEW_LINE>FileUtil.preventFileChooserSymlinkTraversal(chooser, null);<NEW_LINE>chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);<NEW_LINE>chooser.setMultiSelectionEnabled(true);<NEW_LINE>if (lastChosenFile != null) {<NEW_LINE>chooser.setSelectedFile(lastChosenFile);<NEW_LINE>} else {<NEW_LINE>if (projectFolder != null) {<NEW_LINE>File[<MASK><NEW_LINE>if (files != null && files.length > 0) {<NEW_LINE>chooser.setSelectedFile(files[0]);<NEW_LINE>} else {<NEW_LINE>chooser.setSelectedFile(projectFolder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>chooser.setDialogTitle(NbBundle.getMessage(WebClasspathPanel.class, "LBL_Browse_Classpath"));<NEW_LINE>// #77911: prevent adding a non-folder element on the classpath:<NEW_LINE>// NOI18N<NEW_LINE>FileFilter fileFilter = new SimpleFileFilter(NbBundle.getMessage(WebClasspathPanel.class, "LBL_ZipJarFolderFilter"));<NEW_LINE>chooser.setFileFilter(fileFilter);<NEW_LINE>chooser.setAcceptAllFileFilterUsed(false);<NEW_LINE>if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(this)) {<NEW_LINE>String[] filePaths = null;<NEW_LINE>try {<NEW_LINE>filePaths = chooser.getSelectedPaths();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>for (String filePath : filePaths) {<NEW_LINE>listModel.addElement(filePath);<NEW_LINE>}<NEW_LINE>lastChosenFile = chooser.getCurrentDirectory();<NEW_LINE>updateButtons();<NEW_LINE>}<NEW_LINE>}
] files = projectFolder.listFiles();
1,788,555
static ImmutableSortedMap<String, String> mergeBuildSettings(ImmutableMap<String, String> configSettings, ImmutableMap<String, String> cxxPlatformBuildSettings, ImmutableMap<String, String> overrideBuildSettings, ImmutableMap<String, String> buckXcodeBuildSettings, ImmutableMap<String, String> appendBuildSettings) {<NEW_LINE>HashMap<String, String> combinedOverrideConfigs = new HashMap<>(overrideBuildSettings);<NEW_LINE>// If the build setting does not exist in configSettings, add it to combinedOverrideConfigs<NEW_LINE>// with the value from platform settings.<NEW_LINE>for (Map.Entry<String, String> entry : cxxPlatformBuildSettings.entrySet()) {<NEW_LINE>String setting = entry.getKey();<NEW_LINE>String existingSetting = configSettings.get(setting);<NEW_LINE>if (existingSetting == null) {<NEW_LINE>combinedOverrideConfigs.put(setting, entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// If the build setting does not exist in configSettings, add it to combinedOverrideConfigs<NEW_LINE>// with the value from buck Xcode settings.<NEW_LINE>for (Map.Entry<String, String> entry : buckXcodeBuildSettings.entrySet()) {<NEW_LINE>String setting = entry.getKey();<NEW_LINE>String existingSetting = configSettings.get(setting);<NEW_LINE>if (existingSetting == null) {<NEW_LINE>combinedOverrideConfigs.put(setting, entry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// For all append settings, if the build setting already exists in the configSettings, use it,<NEW_LINE>// then follow with the append setting. Otherwise set inherited and follow with the append<NEW_LINE>// setting.<NEW_LINE>for (Map.Entry<String, String> entry : appendBuildSettings.entrySet()) {<NEW_LINE>String setting = entry.getKey();<NEW_LINE>String existingSetting = configSettings.get(setting);<NEW_LINE>String settingPrefix = existingSetting == null ? "$(inherited)" : existingSetting;<NEW_LINE>combinedOverrideConfigs.put(setting, settingPrefix + <MASK><NEW_LINE>}<NEW_LINE>// Merge<NEW_LINE>ImmutableSortedMap<String, String> mergedSettings = MoreMaps.mergeSorted(configSettings, combinedOverrideConfigs);<NEW_LINE>return mergedSettings;<NEW_LINE>}
" " + entry.getValue());
973,908
//<NEW_LINE>// Gutter painting<NEW_LINE>//<NEW_LINE>@Override<NEW_LINE>public void paint(Editor editor, Graphics g, Rectangle r) {<NEW_LINE>ColorValue gutterColor = getGutterColor(myRange, editor);<NEW_LINE>ColorValue borderColor = getGutterBorderColor(editor);<NEW_LINE>Rectangle area = getMarkerArea(editor, r, myRange.getLine1(), myRange.getLine2());<NEW_LINE>final int x = area.x;<NEW_LINE>final int endX = area.x + area.width;<NEW_LINE>final int y = area.y;<NEW_LINE>final int endY = area.y + area.height;<NEW_LINE>if (myRange.getInnerRanges() == null) {<NEW_LINE>// Mode.DEFAULT<NEW_LINE>if (y != endY) {<NEW_LINE>paintRect(g, gutterColor, borderColor, x, y, endX, endY);<NEW_LINE>} else {<NEW_LINE>paintTriangle(g, gutterColor, borderColor, x, endX, y);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Mode.SMART<NEW_LINE>if (y == endY) {<NEW_LINE>paintTriangle(g, gutterColor, borderColor, x, endX, y);<NEW_LINE>} else {<NEW_LINE>List<Range.InnerRange<MASK><NEW_LINE>for (Range.InnerRange innerRange : innerRanges) {<NEW_LINE>if (innerRange.getType() == Range.DELETED)<NEW_LINE>continue;<NEW_LINE>int start = lineToY(editor, innerRange.getLine1());<NEW_LINE>int end = lineToY(editor, innerRange.getLine2());<NEW_LINE>paintRect(g, getGutterColor(innerRange, editor), null, x, start, endX, end);<NEW_LINE>}<NEW_LINE>paintRect(g, null, borderColor, x, y, endX, endY);<NEW_LINE>for (Range.InnerRange innerRange : innerRanges) {<NEW_LINE>if (innerRange.getType() != Range.DELETED)<NEW_LINE>continue;<NEW_LINE>int start = lineToY(editor, innerRange.getLine1());<NEW_LINE>paintTriangle(g, getGutterColor(innerRange, editor), borderColor, x, endX, start);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
> innerRanges = myRange.getInnerRanges();
1,498,450
public static GetSqlConcurrencyControlRulesHistoryResponse unmarshall(GetSqlConcurrencyControlRulesHistoryResponse getSqlConcurrencyControlRulesHistoryResponse, UnmarshallerContext _ctx) {<NEW_LINE>getSqlConcurrencyControlRulesHistoryResponse.setRequestId(_ctx.stringValue("GetSqlConcurrencyControlRulesHistoryResponse.RequestId"));<NEW_LINE>getSqlConcurrencyControlRulesHistoryResponse.setCode(_ctx.stringValue("GetSqlConcurrencyControlRulesHistoryResponse.Code"));<NEW_LINE>getSqlConcurrencyControlRulesHistoryResponse.setMessage(_ctx.stringValue("GetSqlConcurrencyControlRulesHistoryResponse.Message"));<NEW_LINE>getSqlConcurrencyControlRulesHistoryResponse.setSuccess(_ctx.stringValue("GetSqlConcurrencyControlRulesHistoryResponse.Success"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotal(_ctx.longValue("GetSqlConcurrencyControlRulesHistoryResponse.Data.Total"));<NEW_LINE>List<Rules> list = new ArrayList<Rules>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("GetSqlConcurrencyControlRulesHistoryResponse.Data.List.Length"); i++) {<NEW_LINE>Rules rules = new Rules();<NEW_LINE>rules.setItemId(_ctx.longValue("GetSqlConcurrencyControlRulesHistoryResponse.Data.List[" + i + "].ItemId"));<NEW_LINE>rules.setSqlType(_ctx.stringValue("GetSqlConcurrencyControlRulesHistoryResponse.Data.List[" + i + "].SqlType"));<NEW_LINE>rules.setInstanceId(_ctx.stringValue("GetSqlConcurrencyControlRulesHistoryResponse.Data.List[" + i + "].InstanceId"));<NEW_LINE>rules.setSqlKeywords(_ctx.stringValue("GetSqlConcurrencyControlRulesHistoryResponse.Data.List[" + i + "].SqlKeywords"));<NEW_LINE>rules.setStartTime(_ctx.longValue<MASK><NEW_LINE>rules.setKeywordsHash(_ctx.stringValue("GetSqlConcurrencyControlRulesHistoryResponse.Data.List[" + i + "].KeywordsHash"));<NEW_LINE>rules.setConcurrencyControlTime(_ctx.longValue("GetSqlConcurrencyControlRulesHistoryResponse.Data.List[" + i + "].ConcurrencyControlTime"));<NEW_LINE>rules.setUserId(_ctx.stringValue("GetSqlConcurrencyControlRulesHistoryResponse.Data.List[" + i + "].UserId"));<NEW_LINE>rules.setMaxConcurrency(_ctx.longValue("GetSqlConcurrencyControlRulesHistoryResponse.Data.List[" + i + "].MaxConcurrency"));<NEW_LINE>rules.setStatus(_ctx.stringValue("GetSqlConcurrencyControlRulesHistoryResponse.Data.List[" + i + "].Status"));<NEW_LINE>list.add(rules);<NEW_LINE>}<NEW_LINE>data.setList(list);<NEW_LINE>getSqlConcurrencyControlRulesHistoryResponse.setData(data);<NEW_LINE>return getSqlConcurrencyControlRulesHistoryResponse;<NEW_LINE>}
("GetSqlConcurrencyControlRulesHistoryResponse.Data.List[" + i + "].StartTime"));
250,720
public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = new String[] { "symbol", "price", "sumVol" };<NEW_LINE>String stmtText = "@name('s0') select symbol, price, sum(volume) as sumVol " + "from SupportMarketDataBean#length(5) " + "group by symbol";<NEW_LINE>env.compileDeploy(stmtText).addListener("s0");<NEW_LINE>env.assertIterator("s0", it -> assertFalse<MASK><NEW_LINE>sendEvent(env, "SYM", -1, 100);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "SYM", -1d, 100L } });<NEW_LINE>sendEvent(env, "TAC", -2, 12);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "SYM", -1d, 100L }, { "TAC", -2d, 12L } });<NEW_LINE>env.milestone(0);<NEW_LINE>sendEvent(env, "TAC", -3, 13);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "SYM", -1d, 100L }, { "TAC", -2d, 25L }, { "TAC", -3d, 25L } });<NEW_LINE>env.milestone(1);<NEW_LINE>sendEvent(env, "SYM", -4, 1);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "SYM", -1d, 101L }, { "TAC", -2d, 25L }, { "TAC", -3d, 25L }, { "SYM", -4d, 101L } });<NEW_LINE>sendEvent(env, "OCC", -5, 99);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "SYM", -1d, 101L }, { "TAC", -2d, 25L }, { "TAC", -3d, 25L }, { "SYM", -4d, 101L }, { "OCC", -5d, 99L } });<NEW_LINE>sendEvent(env, "TAC", -6, 2);<NEW_LINE>env.assertPropsPerRowIterator("s0", fields, new Object[][] { { "TAC", -2d, 27L }, { "TAC", -3d, 27L }, { "SYM", -4d, 1L }, { "OCC", -5d, 99L }, { "TAC", -6d, 27L } });<NEW_LINE>env.undeployAll();<NEW_LINE>}
(it.hasNext()));
304,301
public ProfilerController newController(final String pid, final ScenarioSettings settings) {<NEW_LINE>List<ProfilerController> controllers = delegates.stream().map((Profiler prof) -> prof.newController(pid, settingsFor(prof, settings))).<MASK><NEW_LINE>return new ProfilerController() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void startSession() throws IOException, InterruptedException {<NEW_LINE>for (ProfilerController controller : controllers) {<NEW_LINE>controller.startSession();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void startRecording() throws IOException, InterruptedException {<NEW_LINE>for (ProfilerController controller : controllers) {<NEW_LINE>controller.startRecording();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void stopRecording(String pid) throws IOException, InterruptedException {<NEW_LINE>for (ProfilerController controller : controllers) {<NEW_LINE>controller.stopRecording(pid);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void stopSession() throws IOException, InterruptedException {<NEW_LINE>for (ProfilerController controller : controllers) {<NEW_LINE>controller.stopSession();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
collect(Collectors.toList());
202,493
public static void main(String[] args) {<NEW_LINE>Scanner sc = new Scanner(System.in);<NEW_LINE><MASK><NEW_LINE>while (TC-- > 0) {<NEW_LINE>// these two values are not used<NEW_LINE>int xsize = sc.nextInt(), ysize = sc.nextInt();<NEW_LINE>int[] x = new int[11], y = new int[11];<NEW_LINE>x[0] = sc.nextInt();<NEW_LINE>y[0] = sc.nextInt();<NEW_LINE>n = sc.nextInt();<NEW_LINE>for (i = 1; i <= n; ++i) {<NEW_LINE>// karel's position is at index 0<NEW_LINE>x[i] = sc.nextInt();<NEW_LINE>y[i] = sc.nextInt();<NEW_LINE>}<NEW_LINE>for (// build distance table<NEW_LINE>// build distance table<NEW_LINE>i = 0; // build distance table<NEW_LINE>i <= n; ++i) for (// Manhattan distance<NEW_LINE>j = i; // Manhattan distance<NEW_LINE>j <= n; // Manhattan distance<NEW_LINE>++j) dist[i][j] = dist[j][i] = Math.abs(x[i] - x[j]) + Math.abs(y[i] - y[j]);<NEW_LINE>for (i = 0; i < 11; ++i) for (j = 0; j < (1 << 11); ++j) memo[i][j] = -1;<NEW_LINE>// DP-TSP<NEW_LINE>System.out.printf("%d\n", dp(0, 1));<NEW_LINE>// System.out.printf("The shortest path has length %d\n", dp(0, 1)); // DP-TSP<NEW_LINE>}<NEW_LINE>}
int TC = sc.nextInt();
304,810
// Show table statement.<NEW_LINE>private void handleShowTable() throws AnalysisException {<NEW_LINE>ShowTableStmt showTableStmt = (ShowTableStmt) stmt;<NEW_LINE>List<List<String>> rows = Lists.newArrayList();<NEW_LINE>// TODO(gaoxin): Whether to support "show tables from `ctl.db`" syntax in show statement?<NEW_LINE>String catalogName = ctx.getDefaultCatalog();<NEW_LINE>DatabaseIf<TableIf> db = ctx.getCurrentCatalog().getDbOrAnalysisException(showTableStmt.getDb());<NEW_LINE>PatternMatcher matcher = null;<NEW_LINE>if (showTableStmt.getPattern() != null) {<NEW_LINE>matcher = PatternMatcher.createMysqlPattern(showTableStmt.getPattern(), CaseSensibility.TABLE.getCaseSensibility());<NEW_LINE>}<NEW_LINE>for (TableIf tbl : db.getTables()) {<NEW_LINE>if (matcher != null && !matcher.match(tbl.getName())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// check tbl privs<NEW_LINE>if (!Env.getCurrentEnv().getAuth().checkTblPriv(ConnectContext.get(), catalogName, db.getFullName(), tbl.getName(), PrivPredicate.SHOW)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (showTableStmt.isVerbose()) {<NEW_LINE>String storageFormat = "NONE";<NEW_LINE>if (tbl instanceof OlapTable) {<NEW_LINE>storageFormat = ((OlapTable) tbl).getStorageFormat().toString();<NEW_LINE>}<NEW_LINE>rows.add(Lists.newArrayList(tbl.getName(), tbl.getMysqlType(), storageFormat));<NEW_LINE>} else {<NEW_LINE>rows.add(Lists.newArrayList<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// sort by table name<NEW_LINE>rows.sort((x, y) -> {<NEW_LINE>return x.get(0).compareTo(y.get(0));<NEW_LINE>});<NEW_LINE>resultSet = new ShowResultSet(showTableStmt.getMetaData(), rows);<NEW_LINE>}
(tbl.getName()));
174,318
protected boolean addNELAT(JCas jcas, Focus focus, Collection<NamedEntity> NEs) throws AnalysisEngineProcessException {<NEW_LINE>boolean ne_found = false;<NEW_LINE>for (NamedEntity ne : NEs) {<NEW_LINE>ne_found = true;<NEW_LINE>long synset = OpenNlpNamedEntities.neValueToSynset(ne.getValue());<NEW_LINE>POS pos = null;<NEW_LINE>if (focus != null) {<NEW_LINE>pos = focus.getToken().getPos();<NEW_LINE>} else {<NEW_LINE>for (Token t : JCasUtil.selectCovered(Token.class, ne)) pos = t.getPos();<NEW_LINE>assert (pos != null);<NEW_LINE>}<NEW_LINE>addLAT(new NELAT(jcas), ne.getBegin(), ne.getEnd(), ne, ne.getValue(<MASK><NEW_LINE>logger.debug(".. LAT {}/{} by NE {}", ne.getValue(), synset, ne.getCoveredText());<NEW_LINE>addLATFeature(jcas, AF.LATNE);<NEW_LINE>}<NEW_LINE>return ne_found;<NEW_LINE>}
), pos, synset, 0.0);
1,589,208
final ForgotPasswordResult executeForgotPassword(ForgotPasswordRequest forgotPasswordRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(forgotPasswordRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ForgotPasswordRequest> request = null;<NEW_LINE>Response<ForgotPasswordResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ForgotPasswordRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(forgotPasswordRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Cognito Identity Provider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ForgotPassword");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ForgotPasswordResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ForgotPasswordResultJsonUnmarshaller());<NEW_LINE>response = anonymousInvoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,159,509
public long handle(Emulator<?> emulator) {<NEW_LINE>RegisterContext context = emulator.getContext();<NEW_LINE>UnidbgPointer object = context.getPointerArg(1);<NEW_LINE>UnidbgPointer clazz = context.getPointerArg(2);<NEW_LINE>UnidbgPointer jmethodID = context.getPointerArg(3);<NEW_LINE>UnidbgPointer jvalue = context.getPointerArg(4);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("CallNonvirtualBooleanMethodA object=" + object + ", clazz=" + clazz + ", jmethodID=" + jmethodID + ", jvalue=" + jvalue);<NEW_LINE>}<NEW_LINE>DvmObject<?> dvmObject = getObject(object.toIntPeer());<NEW_LINE>DvmClass dvmClass = classMap.get(clazz.toIntPeer());<NEW_LINE>DvmMethod dvmMethod = dvmClass == null ? null : dvmClass.getMethod(jmethodID.toIntPeer());<NEW_LINE>if (dvmMethod == null) {<NEW_LINE>throw new BackendException();<NEW_LINE>} else {<NEW_LINE>VaList vaList = new JValueList(DalvikVM64.this, jvalue, dvmMethod);<NEW_LINE>if (dvmMethod.isConstructor()) {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>boolean ret = <MASK><NEW_LINE>if (verbose) {<NEW_LINE>System.out.printf("JNIEnv->CallNonvirtualBooleanMethodA(%s, %s(%s) => %s) was called from %s%n", dvmObject, dvmMethod.methodName, vaList.formatArgs(), ret, context.getLRPointer());<NEW_LINE>}<NEW_LINE>return ret ? JNI_TRUE : JNI_FALSE;<NEW_LINE>}<NEW_LINE>}
dvmMethod.callBooleanMethodA(dvmObject, vaList);
141,150
public static void fillHeaders(Metadata metadata, HttpHeadersBuilder builder) {<NEW_LINE>if (InternalMetadata.headerCount(metadata) == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final byte[][] serializedMetadata = InternalMetadata.serialize(metadata);<NEW_LINE>assert serializedMetadata.length % 2 == 0;<NEW_LINE>for (int i = 0; i < serializedMetadata.length; i += 2) {<NEW_LINE>final AsciiString name = new AsciiString<MASK><NEW_LINE>if (STRIPPED_HEADERS.contains(name)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final byte[] valueBytes = serializedMetadata[i + 1];<NEW_LINE>final String value;<NEW_LINE>if (isBinary(name)) {<NEW_LINE>value = BASE64_ENCODING_OMIT_PADDING.encode(valueBytes);<NEW_LINE>} else if (isGrpcAscii(valueBytes)) {<NEW_LINE>value = new String(valueBytes, StandardCharsets.US_ASCII);<NEW_LINE>} else {<NEW_LINE>logger.warn("Metadata name=" + name + ", value=" + Arrays.toString(valueBytes) + " contains invalid ASCII characters, skipping.");<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>builder.add(name, value);<NEW_LINE>}<NEW_LINE>}
(serializedMetadata[i], false);
1,425,250
public void processMessage(final WebSocketMessage webSocketData) {<NEW_LINE>setDoTransactionNotifications(true);<NEW_LINE>final Map<String, Object> nodeData = webSocketData.getNodeData();<NEW_LINE>final String parentId = (String) nodeData.get("parentId");<NEW_LINE>final String refId = (String) nodeData.get("refId");<NEW_LINE>final String pageId = webSocketData.getPageId();<NEW_LINE>if (pageId != null) {<NEW_LINE>// check for parent ID before creating any nodes<NEW_LINE>if (parentId == null) {<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(422).message("Cannot add node without parentId").build(), true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check if parent node with given ID exists<NEW_LINE>final DOMNode parentNode = getDOMNode(parentId);<NEW_LINE>if (parentNode == null) {<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(404).message("Parent node not found"<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check for ref ID before creating any nodes<NEW_LINE>if (refId == null) {<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(422).message("Cannot add node without refId").build(), true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// check if ref node with given ID exists<NEW_LINE>final DOMNode refNode = getDOMNode(refId);<NEW_LINE>if (refNode == null) {<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(404).message("Reference node not found").build(), true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Document document = getPage(pageId);<NEW_LINE>if (document != null) {<NEW_LINE>String tagName = (String) nodeData.get("tagName");<NEW_LINE>DOMNode newNode = null;<NEW_LINE>try {<NEW_LINE>if (tagName != null && !tagName.isEmpty()) {<NEW_LINE>newNode = (DOMNode) document.createElement(tagName);<NEW_LINE>} else {<NEW_LINE>newNode = (DOMNode) document.createTextNode("");<NEW_LINE>}<NEW_LINE>// append new node to parent<NEW_LINE>if (newNode != null) {<NEW_LINE>parentNode.replaceChild(newNode, refNode);<NEW_LINE>}<NEW_LINE>} catch (DOMException dex) {<NEW_LINE>// send DOM exception<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(422).message(dex.getMessage()).build(), true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(404).message("Page not found").build(), true);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>getWebSocket().send(MessageBuilder.status().code(422).message("Cannot create node without pageId").build(), true);<NEW_LINE>}<NEW_LINE>}
).build(), true);
470,735
public DataSourcesDef defineDatasources() {<NEW_LINE>if (m_def == null) {<NEW_LINE>TypedConfig<String> dataSourceConfig = TypedConfig.get("datasources.xml", new CustomParser());<NEW_LINE>String appId = Foundation<MASK><NEW_LINE>String envType = Foundation.server().getEnvFamily().getName();<NEW_LINE>if (!StringUtil.isEmpty(dataSourceConfig.current())) {<NEW_LINE>String content = dataSourceConfig.current();<NEW_LINE>m_logger.info(String.format("Found datasources.xml from QConfig(env=%s, app.id=%s)!", envType, appId));<NEW_LINE>try {<NEW_LINE>m_def = DefaultSaxParser.parse(content);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IllegalStateException(String.format("Error when parsing datasources.xml from QConfig(env=%s, app.id=%s)!", envType, appId), e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>m_logger.warn(String.format("Can't get datasources.xml from QConfig(env=%s, app.id=%s)!", envType, appId));<NEW_LINE>m_def = new DataSourcesDef();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return m_def;<NEW_LINE>}
.app().getAppId();
591,234
private static RubyNumeric f_addsub(ThreadContext context, RubyClass metaClass, RubyInteger anum, RubyInteger aden, RubyInteger bnum, RubyInteger bden, final boolean plus) {<NEW_LINE>RubyInteger newNum, newDen, g, a, b;<NEW_LINE>if (anum instanceof RubyFixnum && aden instanceof RubyFixnum && bnum instanceof RubyFixnum && bden instanceof RubyFixnum) {<NEW_LINE>long an = ((RubyFixnum) anum).getLongValue();<NEW_LINE>long ad = ((RubyFixnum) aden).getLongValue();<NEW_LINE>long bn = ((RubyFixnum) bnum).getLongValue();<NEW_LINE>long bd = ((RubyFixnum) bden).getLongValue();<NEW_LINE>long ig = i_gcd(ad, bd);<NEW_LINE>g = RubyFixnum.newFixnum(context.runtime, ig);<NEW_LINE>a = f_imul(context, an, bd / ig);<NEW_LINE>b = f_imul(context, bn, ad / ig);<NEW_LINE>} else {<NEW_LINE>g = f_gcd(context, aden, bden);<NEW_LINE>a = f_mul(context, anum, f_idiv<MASK><NEW_LINE>b = f_mul(context, bnum, f_idiv(context, aden, g));<NEW_LINE>}<NEW_LINE>RubyInteger c = plus ? f_add(context, a, b) : f_sub(context, a, b);<NEW_LINE>b = f_idiv(context, aden, g);<NEW_LINE>g = f_gcd(context, c, g);<NEW_LINE>newNum = f_idiv(context, c, g);<NEW_LINE>a = f_idiv(context, bden, g);<NEW_LINE>newDen = f_mul(context, a, b);<NEW_LINE>return RubyRational.newRationalNoReduce(context, metaClass, newNum, newDen);<NEW_LINE>}
(context, bden, g));
348,405
public static MusicBrainzReleasesResult findMBID(final Connection connection, final CoverArtArchiveTagInfo tagInfo) {<NEW_LINE>boolean trace = LOGGER.isTraceEnabled();<NEW_LINE>MusicBrainzReleasesResult result;<NEW_LINE>try {<NEW_LINE>String query = "SELECT MBID, MODIFIED FROM " + TABLE_NAME + constructTagWhere(tagInfo, false) + " LIMIT 1";<NEW_LINE>if (trace) {<NEW_LINE>LOGGER.trace("Searching for release MBID with \"{}\"", query);<NEW_LINE>}<NEW_LINE>try (Statement statement = connection.createStatement();<NEW_LINE>ResultSet resultSet = statement.executeQuery(query)) {<NEW_LINE>if (resultSet.next()) {<NEW_LINE>result = new MusicBrainzReleasesResult(true, resultSet.getTimestamp("MODIFIED"), resultSet.getString("MBID"));<NEW_LINE>} else {<NEW_LINE>result = new MusicBrainzReleasesResult(false, null, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>LOGGER.error(LOG_ERROR_WHILE_IN_FOR, DATABASE_NAME, "looking up Music Brainz ID", TABLE_NAME, <MASK><NEW_LINE>LOGGER.trace("", e);<NEW_LINE>result = new MusicBrainzReleasesResult();<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
tagInfo, e.getMessage());
544,481
final DescribePatchPropertiesResult executeDescribePatchProperties(DescribePatchPropertiesRequest describePatchPropertiesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describePatchPropertiesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribePatchPropertiesRequest> request = null;<NEW_LINE>Response<DescribePatchPropertiesResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DescribePatchPropertiesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describePatchPropertiesRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribePatchProperties");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribePatchPropertiesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribePatchPropertiesResultJsonUnmarshaller());<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,361,349
public void run(RegressionEnvironment env) {<NEW_LINE>List<SupportBean_ST0> list = new ArrayList<SupportBean_ST0>();<NEW_LINE>for (int i = 0; i < 10000; i++) {<NEW_LINE>list.add(new SupportBean_ST0("E1", 1000));<NEW_LINE>}<NEW_LINE>SupportBean_ST0 minEvent = new SupportBean_ST0("E2", 5);<NEW_LINE>list.add(minEvent);<NEW_LINE>SupportBean_ST0_Container theEvent = new SupportBean_ST0_Container(list);<NEW_LINE>// the "contained.min" inner lambda only depends on values within "contained" (a stream's value)<NEW_LINE>// and not on the particular "x".<NEW_LINE>String eplFragment = "@name('s0') select contained.where(x => x.p00 = contained.min(y => y.p00)) as val from SupportBean_ST0_Container";<NEW_LINE>env.compileDeploy(eplFragment).addListener("s0");<NEW_LINE>long start = System.currentTimeMillis();<NEW_LINE>env.sendEventBean(theEvent);<NEW_LINE>long delta = System.currentTimeMillis() - start;<NEW_LINE>assertTrue("delta=" + delta, delta < 100);<NEW_LINE>env.assertEventNew("s0", event -> {<NEW_LINE>Collection<SupportBean_ST0> result = (Collection<SupportBean_ST0<MASK><NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(new Object[] { minEvent }, result.toArray());<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>}
>) event.get("val");
216,299
private Mono<PagedResponse<PolicyAssignmentInner>> listForResourceNextSinglePageAsync(String nextLink) {<NEW_LINE>if (nextLink == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));<NEW_LINE>}<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>final String accept = "application/json, text/json";<NEW_LINE>return FluxUtil.withContext(context -> service.listForResourceNext(nextLink, this.client.getEndpoint(), accept, context)).<PagedResponse<PolicyAssignmentInner>>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)).contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext(<MASK><NEW_LINE>}
)).readOnly()));
877,605
public final void complete() {<NEW_LINE>NumberFormat nfMegabyte = NumberFormat.getInstance();<NEW_LINE>NumberFormat nfCounts = NumberFormat.getInstance();<NEW_LINE>nfCounts.setGroupingUsed(true);<NEW_LINE>nfMegabyte.setMaximumFractionDigits(2);<NEW_LINE>LOGGER.info("completing read...");<NEW_LINE>this.tileBasedGeoObjectStore.complete();<NEW_LINE>LOGGER.info("start writing file...");<NEW_LINE>try {<NEW_LINE>if (this.configuration.getOutputFile().exists()) {<NEW_LINE>LOGGER.info("overwriting file " + this.configuration.getOutputFile().getAbsolutePath());<NEW_LINE>this.configuration.getOutputFile().delete();<NEW_LINE>}<NEW_LINE>MapFileWriter.writeFile(<MASK><NEW_LINE>} catch (IOException e) {<NEW_LINE>LOGGER.log(Level.SEVERE, "error while writing file", e);<NEW_LINE>}<NEW_LINE>LOGGER.info("finished...");<NEW_LINE>LOGGER.fine("total processed nodes: " + nfCounts.format(this.tileBasedGeoObjectStore.getNodesNumber()));<NEW_LINE>LOGGER.fine("total processed ways: " + nfCounts.format(this.tileBasedGeoObjectStore.getWaysNumber()));<NEW_LINE>LOGGER.fine("total processed relations: " + nfCounts.format(this.tileBasedGeoObjectStore.getRelationsNumber()));<NEW_LINE>LOGGER.info("estimated memory consumption: " + nfMegabyte.format(+((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / Math.pow(1024, 2))) + "MB");<NEW_LINE>}
this.configuration, this.tileBasedGeoObjectStore);
611,462
public boolean submit(DownloadType downloadType, String uuid, List<DownloadViewExecuteParam> params) {<NEW_LINE>ShareFactor shareFactor = ShareAuthAspect.SHARE_FACTOR_THREAD_LOCAL.get();<NEW_LINE>try {<NEW_LINE>List<WidgetContext> widgetList = getWidgetContexts(downloadType, shareFactor.getEntityId(), shareFactor.getUser(), params);<NEW_LINE>ShareDownloadRecord record = new ShareDownloadRecord();<NEW_LINE>record.setUuid(uuid);<NEW_LINE>record.setName(getDownloadFileName(downloadType, shareFactor.getEntityId()));<NEW_LINE>record.setStatus(DownloadTaskStatus.PROCESSING.getStatus());<NEW_LINE>record<MASK><NEW_LINE>shareDownloadRecordMapper.insertSelective(record);<NEW_LINE>MsgWrapper wrapper = new MsgWrapper(record, ActionEnum.SHAREDOWNLOAD, uuid);<NEW_LINE>WorkBookContext workBookContext = WorkBookContext.WorkBookContextBuilder.newBuilder().withWrapper(wrapper).withWidgets(widgetList).withUser(shareFactor.getUser()).withResultLimit(resultLimit).withTaskKey("ShareDownload_" + uuid).build();<NEW_LINE>ExecutorUtils.submitWorkbookTask(workBookContext, null);<NEW_LINE>log.info("Share download task submit:{}", wrapper);<NEW_LINE>return true;<NEW_LINE>} catch (UnAuthorizedException | ServerException e) {<NEW_LINE>throw e;<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("Submit download task error", e);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
.setCreateTime(new Date());
219,941
protected GoVisitor buildGoVisitor(@NotNull ProblemsHolder holder, @NotNull LocalInspectionToolSession session) {<NEW_LINE>return new GoVisitor() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitConstDeclaration(@NotNull GoConstDeclaration o) {<NEW_LINE>if (o.getParent() instanceof GoFile) {<NEW_LINE>for (GoConstSpec spec : o.getConstSpecList()) {<NEW_LINE>boolean first = true;<NEW_LINE>for (GoConstDefinition constDefinition : spec.getConstDefinitionList()) {<NEW_LINE>if (!first && constDefinition.isPublic()) {<NEW_LINE>String errorText = "Exported const <code>#ref</code> should have its own declaration #loc";<NEW_LINE>holder.registerProblem(constDefinition, errorText, ProblemHighlightType<MASK><NEW_LINE>}<NEW_LINE>first = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void visitVarDeclaration(@NotNull GoVarDeclaration o) {<NEW_LINE>if (o.getParent() instanceof GoFile) {<NEW_LINE>for (GoVarSpec spec : o.getVarSpecList()) {<NEW_LINE>boolean first = true;<NEW_LINE>for (GoVarDefinition varDefinition : spec.getVarDefinitionList()) {<NEW_LINE>if (!first && varDefinition.isPublic()) {<NEW_LINE>String errorText = "Exported variable <code>#ref</code> should have its own declaration #loc";<NEW_LINE>holder.registerProblem(varDefinition, errorText, ProblemHighlightType.WEAK_WARNING, new ExtractVarDefinitionFix());<NEW_LINE>}<NEW_LINE>first = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
.WEAK_WARNING, new ExtractConstantDefinitionFix());
1,569,453
public static void main(String... ignored) throws IOException, InterruptedException {<NEW_LINE>String basePath = TMP + "/1-source";<NEW_LINE>ChronicleTools.deleteOnExit(basePath);<NEW_LINE>Chronicle chronicle = new IndexedChronicle(basePath);<NEW_LINE>InProcessChronicleSource source = new InProcessChronicleSource(chronicle, PORT);<NEW_LINE>source.busyWaitTimeNS(2 * 1000 * 1000);<NEW_LINE>EventsWriter writer = new EventsWriter(source);<NEW_LINE>Update update = new Update();<NEW_LINE><MASK><NEW_LINE>Thread.sleep(1000);<NEW_LINE>System.out.println("Warming up.");<NEW_LINE>for (int i = -WARMUP; i <= MESSAGES; i += RATE) {<NEW_LINE>if (i == 0)<NEW_LINE>System.out.println("Sending messages.");<NEW_LINE>Thread.sleep(1);<NEW_LINE>for (int j = 0; j < RATE; j++) {<NEW_LINE>update.resetLevels("EUR/USD");<NEW_LINE>update.acquireLevel().init(1.3256, 1e6, 1.3257, 2e6);<NEW_LINE>update.acquireLevel().init(1.3255, 2e6, 1.3258, 4e6);<NEW_LINE>update.acquireLevel().init(1.3254, 3e6, 1.3259, 6e6);<NEW_LINE>update.acquireLevel().init(1.3253, 4e6, 1.3260, 8e6);<NEW_LINE>update.acquireLevel().init(1.3252, 5e6, 1.3261, 10e6);<NEW_LINE>writer.onMarketData(null, update);<NEW_LINE>pause(10 * 1000);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.println("Messages written");<NEW_LINE>Thread.sleep(1000);<NEW_LINE>source.close();<NEW_LINE>}
System.out.println("Allowing connection.");
873,483
public Set<Shape> compute(Model model) {<NEW_LINE>Walker shapeWalker = new Walker(NeighborProviderIndex.of(model).getProvider());<NEW_LINE>// Find all shapes connected to any service shape.<NEW_LINE>Set<Shape> <MASK><NEW_LINE>for (Shape service : model.getServiceShapes()) {<NEW_LINE>connected.addAll(shapeWalker.walkShapes(service));<NEW_LINE>}<NEW_LINE>// Don't remove shapes that are traits or connected to traits.<NEW_LINE>for (Shape trait : model.getShapesWithTrait(TraitDefinition.class)) {<NEW_LINE>connected.addAll(shapeWalker.walkShapes(trait));<NEW_LINE>}<NEW_LINE>// Any shape that wasn't identified as connected to a service is considered unreferenced.<NEW_LINE>Set<Shape> result = new HashSet<>();<NEW_LINE>for (Shape shape : model.toSet()) {<NEW_LINE>if (!shape.isMemberShape() && !connected.contains(shape) && !Prelude.isPreludeShape(shape) && keepFilter.test(shape)) {<NEW_LINE>result.add(shape);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
connected = new HashSet<>();
894,429
public void handle(PrimaryStorageInventory inv, GetVolumeRootImageUuidFromPrimaryStorageMsg msg, final ReturnValueCompletion<GetVolumeRootImageUuidFromPrimaryStorageReply> completion) {<NEW_LINE>GetVolumeBaseImagePathCmd cmd = new GetVolumeBaseImagePathCmd();<NEW_LINE>cmd.volumeUuid = msg.getVolume().getUuid();<NEW_LINE>cmd.volumeInstallDir = NfsPrimaryStorageKvmHelper.makeVolumeInstallDir(inv, msg.getVolume());<NEW_LINE>cmd.imageCacheDir = NfsPrimaryStorageKvmHelper.getCachedImageDir(inv);<NEW_LINE>final HostInventory host = nfsFactory.getConnectedHostForOperation(inv).get(0);<NEW_LINE>new KvmCommandSender(host.getUuid()).send(cmd, GET_VOLUME_BASE_IMAGE_PATH, new KvmCommandFailureChecker() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public ErrorCode getError(KvmResponseWrapper wrapper) {<NEW_LINE>GetVolumeBaseImagePathRsp rsp = wrapper.getResponse(GetVolumeBaseImagePathRsp.class);<NEW_LINE>if (rsp.isSuccess() && StringUtils.isEmpty(rsp.path)) {<NEW_LINE>return operr("cannot get root image of volume[uuid:%s], may be it create from iso", msg.getVolume().getUuid());<NEW_LINE>}<NEW_LINE>return rsp.isSuccess() ? null : operr(<MASK><NEW_LINE>}<NEW_LINE>}, new ReturnValueCompletion<KvmResponseWrapper>(completion) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(KvmResponseWrapper w) {<NEW_LINE>GetVolumeBaseImagePathRsp rsp = w.getResponse(GetVolumeBaseImagePathRsp.class);<NEW_LINE>File f = new File(rsp.path);<NEW_LINE>String rootImageUuid = f.getName().split("\\.")[0];<NEW_LINE>GetVolumeRootImageUuidFromPrimaryStorageReply reply = new GetVolumeRootImageUuidFromPrimaryStorageReply();<NEW_LINE>reply.setImageUuid(rootImageUuid);<NEW_LINE>completion.success(reply);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>completion.fail(errorCode);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
"operation error, because:%s", rsp.getError());
1,271,484
private void generateQuantizedVertices(DatabaseSession databaseSession, Revision revision, float[] quantizationMatrix, float multiplierToMm) {<NEW_LINE>PackageMetaData packageMetaData = getBimServer().getMetaDataManager().getPackageMetaData(revision.getProject().getSchema());<NEW_LINE>Query query = new Query(packageMetaData);<NEW_LINE>QueryPart queryPart = query.createQueryPart();<NEW_LINE>queryPart.addType(GeometryPackage.eINSTANCE.getGeometryData(), false);<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>geometryDataInclude.addType(GeometryPackage.eINSTANCE.getGeometryData(), false);<NEW_LINE>geometryDataInclude.addFieldDirect("vertices");<NEW_LINE>QueryObjectProvider objectProvider = new QueryObjectProvider(getDatabaseSession(), getBimServer(), query, Collections.singleton(revision.getOid()), packageMetaData);<NEW_LINE>HashMapVirtualObject next = objectProvider.next();<NEW_LINE>while (next != null) {<NEW_LINE>HashMapVirtualObject verticesBuffer = (HashMapVirtualObject) next.get("vertices");<NEW_LINE>ByteBuffer verticesData = ByteBuffer.wrap((byte[]) verticesBuffer.get("data"));<NEW_LINE>verticesData.order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>FloatBuffer vertices = verticesData.asFloatBuffer();<NEW_LINE>ByteBuffer verticesQuantized = quantizeVertices(vertices.array(), quantizationMatrix, multiplierToMm);<NEW_LINE>Buffer buffer = getDatabaseSession().create(Buffer.class);<NEW_LINE>buffer.setData(verticesQuantized.array());<NEW_LINE>next.setReference(GeometryPackage.eINSTANCE.getGeometryData_VerticesQuantized(), buffer.getOid(), -1);<NEW_LINE>next.saveOverwrite();<NEW_LINE>next = objectProvider.next();<NEW_LINE>System.out.println("Generating quantized vertices");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error("", e);<NEW_LINE>}<NEW_LINE>}
Include geometryDataInclude = queryPart.createInclude();
82,737
final GetArtifactUrlResult executeGetArtifactUrl(GetArtifactUrlRequest getArtifactUrlRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getArtifactUrlRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetArtifactUrlRequest> request = null;<NEW_LINE>Response<GetArtifactUrlResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetArtifactUrlRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getArtifactUrlRequest));<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, "Amplify");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetArtifactUrl");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetArtifactUrlResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetArtifactUrlResultJsonUnmarshaller());<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);
157,698
public TonyApplicationData fetchData(AnalyticJob job) throws Exception {<NEW_LINE>_LOGGER.debug("Fetching data for job " + job.getAppId());<NEW_LINE>long finishTime = job.getFinishTime();<NEW_LINE>Date date = new Date(finishTime);<NEW_LINE>// TODO: We are deriving yyyy/MM/dd from the RM's application finish time, but the TonY Portal actually creates the<NEW_LINE>// yyyy/MM/dd directory based off the end time embedded in the jhist file name. This end time is taken before the<NEW_LINE>// application finishes and thus is slightly before the RM's application finish time. So it's possible that the<NEW_LINE>// yyyy/MM/dd derived from the RM's application finish time is a day later and we may not find the history files.<NEW_LINE>// In case we don't find the history files in yyyy/MM/dd, we should check the previous day as well.<NEW_LINE>String yearMonthDay = <MASK><NEW_LINE>Path jobDir = new Path(_finishedDir, yearMonthDay + Path.SEPARATOR + job.getAppId());<NEW_LINE>if (!_fs.exists(jobDir)) {<NEW_LINE>// check intermediate dir<NEW_LINE>jobDir = new Path(_intermediateDir, job.getAppId());<NEW_LINE>}<NEW_LINE>_LOGGER.debug("Job directory for " + job.getAppId() + ": " + jobDir);<NEW_LINE>// parse config<NEW_LINE>Path confFile = new Path(jobDir, Constants.TONY_FINAL_XML);<NEW_LINE>if (!_fs.exists(confFile)) {<NEW_LINE>// for backward compatibility, see https://github.com/linkedin/TonY/issues/271<NEW_LINE>confFile = new Path(jobDir, "config.xml");<NEW_LINE>}<NEW_LINE>Configuration conf = new Configuration(false);<NEW_LINE>if (_fs.exists(confFile)) {<NEW_LINE>conf.addResource(_fs.open(confFile));<NEW_LINE>}<NEW_LINE>// Parse events. For a list of event types, see<NEW_LINE>// https://github.com/linkedin/TonY/blob/master/tony-core/src/main/avro/EventType.avsc.<NEW_LINE>// We get the task start time from the TASK_STARTED event and the finish time and metrics from the TASK_FINISHED<NEW_LINE>// event.<NEW_LINE>List<Event> events = ParserUtils.parseEvents(_fs, jobDir);<NEW_LINE>return new TonyApplicationData(job.getAppId(), job.getAppType(), conf, events);<NEW_LINE>}
ParserUtils.getYearMonthDayDirectory(date, _zoneId);
874,249
private BeanDefinition parseJupiterClient(Element element, ParserContext parserContext) {<NEW_LINE>RootBeanDefinition def = new RootBeanDefinition();<NEW_LINE>def.setBeanClass(beanClass);<NEW_LINE>addProperty(def, element, "appName", false);<NEW_LINE>addProperty(def, element, "registryType", false);<NEW_LINE>addPropertyReference(def, element, "connector", false);<NEW_LINE>List<Pair<JOption<Object>, String>> childOptions = Lists.newArrayList();<NEW_LINE>NodeList childNodes = element.getChildNodes();<NEW_LINE>for (int i = 0; i < childNodes.getLength(); i++) {<NEW_LINE>Node item = childNodes.item(i);<NEW_LINE>if (item instanceof Element) {<NEW_LINE>String localName = item.getLocalName();<NEW_LINE>if ("property".equals(localName)) {<NEW_LINE>addProperty(def, (<MASK><NEW_LINE>addProperty(def, (Element) item, "providerServerAddresses", false);<NEW_LINE>addPropertyReferenceArray(def, (Element) item, ConsumerInterceptor.class.getName(), "globalConsumerInterceptors", false);<NEW_LINE>} else if ("netOptions".equals(localName)) {<NEW_LINE>NodeList configList = item.getChildNodes();<NEW_LINE>for (int j = 0; j < configList.getLength(); j++) {<NEW_LINE>Node configItem = configList.item(j);<NEW_LINE>if (configItem instanceof Element) {<NEW_LINE>parseNetOption(configItem, null, childOptions);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!childOptions.isEmpty()) {<NEW_LINE>def.getPropertyValues().addPropertyValue("childNetOptions", childOptions);<NEW_LINE>}<NEW_LINE>return registerBean(def, element, parserContext);<NEW_LINE>}
Element) item, "registryServerAddresses", false);
485,492
public void writeTo(StreamOutput out) throws IOException {<NEW_LINE>super.writeTo(out);<NEW_LINE>out.writeByte(searchType.id());<NEW_LINE>out.writeStringArray(indices);<NEW_LINE>out.writeOptionalString(routing);<NEW_LINE>out.writeOptionalString(preference);<NEW_LINE>out.writeOptionalWriteable(scroll);<NEW_LINE>out.writeOptionalWriteable(source);<NEW_LINE>if (out.getVersion().before(Version.V_8_0_0)) {<NEW_LINE>// types not supported so send an empty array to previous versions<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>indicesOptions.writeIndicesOptions(out);<NEW_LINE>out.writeOptionalBoolean(requestCache);<NEW_LINE>out.writeVInt(batchedReduceSize);<NEW_LINE>out.writeVInt(maxConcurrentShardRequests);<NEW_LINE>out.writeOptionalVInt(preFilterShardSize);<NEW_LINE>out.writeOptionalBoolean(allowPartialSearchResults);<NEW_LINE>out.writeOptionalString(localClusterAlias);<NEW_LINE>if (localClusterAlias != null) {<NEW_LINE>out.writeVLong(absoluteStartMillis);<NEW_LINE>out.writeBoolean(finalReduce);<NEW_LINE>}<NEW_LINE>out.writeBoolean(ccsMinimizeRoundtrips);<NEW_LINE>if (out.getVersion().onOrAfter(Version.V_7_12_0)) {<NEW_LINE>out.writeBoolean(minCompatibleShardNode != null);<NEW_LINE>if (minCompatibleShardNode != null) {<NEW_LINE>Version.writeVersion(minCompatibleShardNode, out);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Version waitForCheckpointsVersion = Version.V_7_16_0;<NEW_LINE>if (out.getVersion().onOrAfter(waitForCheckpointsVersion)) {<NEW_LINE>out.writeMap(waitForCheckpoints, StreamOutput::writeString, StreamOutput::writeLongArray);<NEW_LINE>out.writeTimeValue(waitForCheckpointsTimeout);<NEW_LINE>} else if (waitForCheckpoints.isEmpty() == false) {<NEW_LINE>throw new IllegalArgumentException("Remote node version [" + out.getVersion() + " incompatible with " + "wait_for_checkpoints. All nodes must be version [" + waitForCheckpointsVersion + "] or greater.");<NEW_LINE>}<NEW_LINE>}
out.writeStringArray(Strings.EMPTY_ARRAY);
1,537,037
public void read(org.apache.thrift.protocol.TProtocol prot, grayUpgrade_args struct) throws org.apache.thrift.TException {<NEW_LINE>TTupleProtocol iprot = (TTupleProtocol) prot;<NEW_LINE>BitSet incoming = iprot.readBitSet(4);<NEW_LINE>if (incoming.get(0)) {<NEW_LINE>struct.topologyName = iprot.readString();<NEW_LINE>struct.set_topologyName_isSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(1)) {<NEW_LINE>struct.component = iprot.readString();<NEW_LINE>struct.set_component_isSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(2)) {<NEW_LINE>{<NEW_LINE>org.apache.thrift.protocol.TList _list317 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());<NEW_LINE>struct.workers = new ArrayList<String>(_list317.size);<NEW_LINE>String _elem318;<NEW_LINE>for (int _i319 = 0; _i319 < _list317.size; ++_i319) {<NEW_LINE>_elem318 = iprot.readString();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>struct.set_workers_isSet(true);<NEW_LINE>}<NEW_LINE>if (incoming.get(3)) {<NEW_LINE>struct.workerNum = iprot.readI32();<NEW_LINE>struct.set_workerNum_isSet(true);<NEW_LINE>}<NEW_LINE>}
struct.workers.add(_elem318);
1,031,859
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_with_toolbar_progress_and_container);<NEW_LINE>toolbar = ToolbarHelper.setUpDefaultToolbar(this, null, R.drawable.ic_clear_white_24dp);<NEW_LINE>toolbar.inflateMenu(R.menu.toolbar_add_contact);<NEW_LINE>toolbar.setOnMenuItemClickListener(new Toolbar.OnMenuItemClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean onMenuItemClick(MenuItem item) {<NEW_LINE>return onOptionsItemSelected(item);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>progressBar = <MASK><NEW_LINE>barPainter = new BarPainter(this, toolbar);<NEW_LINE>barPainter.setDefaultColor();<NEW_LINE>Intent intent = getIntent();<NEW_LINE>if (savedInstanceState == null) {<NEW_LINE>getFragmentManager().beginTransaction().add(R.id.fragment_container, ContactAddFragment.newInstance(getAccount(intent), getUser(intent))).commit();<NEW_LINE>}<NEW_LINE>}
findViewById(R.id.toolbarProgress);
807,461
final GetLoggerDefinitionResult executeGetLoggerDefinition(GetLoggerDefinitionRequest getLoggerDefinitionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getLoggerDefinitionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetLoggerDefinitionRequest> request = null;<NEW_LINE>Response<GetLoggerDefinitionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetLoggerDefinitionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getLoggerDefinitionRequest));<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, "Greengrass");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetLoggerDefinition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetLoggerDefinitionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetLoggerDefinitionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,092,555
private void updateImage(BufferedImage image, boolean force) {<NEW_LINE>int width = image.getWidth();<NEW_LINE>int height = image.getHeight();<NEW_LINE>Graphics2D g = image.createGraphics();<NEW_LINE>myImageHeight = 0;<NEW_LINE>int min = myMin + myGap;<NEW_LINE>int max = height / myArraySize;<NEW_LINE>if (max < min) {<NEW_LINE>max = height / min;<NEW_LINE>int currentIndex = 0;<NEW_LINE>SingleValue currentValue = new SingleValue();<NEW_LINE>for (int index = 0; index < myArraySize; index++) {<NEW_LINE>Value value = myArray[index];<NEW_LINE>int i = index * max / myArraySize;<NEW_LINE>if (i > currentIndex) {<NEW_LINE>currentValue.paint(g, 0, myImageHeight, width, min, force);<NEW_LINE>myImageHeight += min;<NEW_LINE>currentIndex = i;<NEW_LINE>currentValue.myStripe = value == null ? null : value.get();<NEW_LINE>currentValue.myModified = value != null && value.myModified;<NEW_LINE>} else if (value != null) {<NEW_LINE><MASK><NEW_LINE>if (stripe != null && stripe.compareTo(currentValue.myStripe) < 0) {<NEW_LINE>currentValue.myStripe = stripe;<NEW_LINE>}<NEW_LINE>if (value.myModified) {<NEW_LINE>currentValue.myModified = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (value != null) {<NEW_LINE>value.myModified = false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>currentValue.paint(g, 0, myImageHeight, width, min, force);<NEW_LINE>myImageHeight += min;<NEW_LINE>} else {<NEW_LINE>if (max > myMax) {<NEW_LINE>max = Math.max(myMax, min);<NEW_LINE>}<NEW_LINE>for (int index = 0; index < myArraySize; index++) {<NEW_LINE>Value value = myArray[index];<NEW_LINE>if (value != null) {<NEW_LINE>value.paint(g, 0, myImageHeight, width, max, force);<NEW_LINE>value.myModified = false;<NEW_LINE>}<NEW_LINE>myImageHeight += max;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>g.dispose();<NEW_LINE>}
ErrorStripe stripe = value.get();
94,217
public void loadComponent() {<NEW_LINE>super.loadComponent();<NEW_LINE>LookupPickerField lookupPickerField = (LookupPickerField) resultComponent;<NEW_LINE>String metaClass = element.attributeValue("metaClass");<NEW_LINE>if (!StringUtils.isEmpty(metaClass)) {<NEW_LINE>lookupPickerField.setMetaClass(getMetadata().getClass(metaClass));<NEW_LINE>}<NEW_LINE>loadActions(lookupPickerField, element);<NEW_LINE>if (lookupPickerField.getActions().isEmpty()) {<NEW_LINE>GuiActionSupport guiActionSupport = getGuiActionSupport();<NEW_LINE>boolean <MASK><NEW_LINE>if (!actionsByMetaAnnotations) {<NEW_LINE>if (isLegacyFrame()) {<NEW_LINE>lookupPickerField.addLookupAction();<NEW_LINE>lookupPickerField.addClearAction();<NEW_LINE>} else {<NEW_LINE>Actions actions = getActions();<NEW_LINE>lookupPickerField.addAction(actions.create(LookupAction.ID));<NEW_LINE>lookupPickerField.addAction(actions.create(ClearAction.ID));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String refreshOptionsOnLookupClose = element.attributeValue("refreshOptionsOnLookupClose");<NEW_LINE>if (refreshOptionsOnLookupClose != null) {<NEW_LINE>lookupPickerField.setRefreshOptionsOnLookupClose(Boolean.parseBoolean(refreshOptionsOnLookupClose));<NEW_LINE>}<NEW_LINE>}
actionsByMetaAnnotations = guiActionSupport.createActionsByMetaAnnotations(lookupPickerField);
1,539,780
void handlePath(Path path, Consumer<Path> consumer) {<NEW_LINE>if (!inputsCache.containsKey(path)) {<NEW_LINE>ImmutableList.Builder<Path> builder = ImmutableList.builder();<NEW_LINE>if (isInRepo(path)) {<NEW_LINE>try {<NEW_LINE>if (Files.isSymbolicLink(path)) {<NEW_LINE>handlePath(path.getParent().resolve(Files.readSymbolicLink(path)), builder::add);<NEW_LINE>} else if (Files.isDirectory(path)) {<NEW_LINE>try (Stream<Path> list = Files.list(path)) {<NEW_LINE>list.forEach(child -> handlePath(child, consumer));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>builder.add(path);<NEW_LINE>}<NEW_LINE>inputsCache.put(path, builder.build());<NEW_LINE>}<NEW_LINE>inputsCache.get(path<MASK><NEW_LINE>}
).forEach(consumer::accept);
336,796
private static List<Chainable> handleClassPrefixedNonProp(StatementSpecMapContext mapContext, List<Chainable> chain) {<NEW_LINE>int indexOfLastProp = getClassIndexOfLastProp(chain);<NEW_LINE>if (indexOfLastProp == -1 || indexOfLastProp == chain.size() - 1) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>int depth = indexOfLastProp;<NEW_LINE>int depthFound = -1;<NEW_LINE>while (depth > 0) {<NEW_LINE>String classNameCandidate = buildClassName(chain, depth);<NEW_LINE>try {<NEW_LINE>mapContext.getClasspathImportService().resolveClass(classNameCandidate, false, mapContext.getClassProvidedClasspathExtension());<NEW_LINE>depthFound = depth;<NEW_LINE>break;<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>// expected, handled later when expression validation takes place<NEW_LINE>}<NEW_LINE>depth--;<NEW_LINE>}<NEW_LINE>if (depthFound == -1) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (depth == indexOfLastProp) {<NEW_LINE>String classNameCandidate = buildClassName(chain, depth);<NEW_LINE>return buildSubchainWClassname(classNameCandidate, depth + 1, chain);<NEW_LINE>}<NEW_LINE>// include the next identifier, i.e. ENUM or CONSTANT etc.<NEW_LINE>String classNameCandidate = <MASK><NEW_LINE>return buildSubchainWClassname(classNameCandidate, depth + 2, chain);<NEW_LINE>}
buildClassName(chain, depth + 1);
1,635,957
public void testConfigWebServiceInWebXml_NoServletMapping() throws Exception {<NEW_LINE>setWebXml("noServletMapping/web.xml");<NEW_LINE>server.startServer();<NEW_LINE>// Pause for application to start successfully<NEW_LINE>server.waitForStringInLog("CWWKZ0001I.*converter");<NEW_LINE>URL url = new URL("http://" + server.getHostname() + ":" + server.getHttpDefaultPort() + "/converter/ConverterSvcName?wsdl");<NEW_LINE>Log.info(c, "testConfigWebServiceInWebXml_NoServletMapping", <MASK><NEW_LINE>HttpURLConnection con = HttpUtils.getHttpConnection(url, HttpURLConnection.HTTP_OK, CONN_TIMEOUT);<NEW_LINE>BufferedReader br = HttpUtils.getConnectionStream(con);<NEW_LINE>String line = br.readLine();<NEW_LINE>// If there is output then the Application automatically installed correctly<NEW_LINE>assertNotNull("The output is null", line);<NEW_LINE>assertTrue("The output did not contain the automatically installed message", line.contains("xml version="));<NEW_LINE>}
"Calling converter Application with URL=" + url.toString());
1,092,891
public static void process_sub(GrayU8 orig, GrayS16 derivX, GrayS16 derivY) {<NEW_LINE>final byte[] data = orig.data;<NEW_LINE>final short[] imgX = derivX.data;<NEW_LINE>final short[] imgY = derivY.data;<NEW_LINE>final int width = orig.getWidth();<NEW_LINE>final int height = orig.getHeight() - 1;<NEW_LINE>final int strideSrc = orig.getStride();<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopFor(1,height,y->{<NEW_LINE>for (int y = 1; y < height; y++) {<NEW_LINE>int indexSrc = orig.startIndex + orig.stride * y + 1;<NEW_LINE>final <MASK><NEW_LINE>int indexX = derivX.startIndex + derivX.stride * y + 1;<NEW_LINE>int indexY = derivY.startIndex + derivY.stride * y + 1;<NEW_LINE>for (; indexSrc < endX; indexSrc++) {<NEW_LINE>int v = (data[indexSrc + strideSrc + 1] & 0xFF) - (data[indexSrc - strideSrc - 1] & 0xFF);<NEW_LINE>int w = (data[indexSrc + strideSrc - 1] & 0xFF) - (data[indexSrc - strideSrc + 1] & 0xFF);<NEW_LINE>imgY[indexY++] = (short) (((data[indexSrc + strideSrc] & 0xFF) - (data[indexSrc - strideSrc] & 0xFF)) * 2 + v + w);<NEW_LINE>imgX[indexX++] = (short) (((data[indexSrc + 1] & 0xFF) - (data[indexSrc - 1] & 0xFF)) * 2 + v - w);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_ABOVE });<NEW_LINE>}
int endX = indexSrc + width - 2;
912,709
final DeleteStudioLifecycleConfigResult executeDeleteStudioLifecycleConfig(DeleteStudioLifecycleConfigRequest deleteStudioLifecycleConfigRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteStudioLifecycleConfigRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteStudioLifecycleConfigRequest> request = null;<NEW_LINE>Response<DeleteStudioLifecycleConfigResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteStudioLifecycleConfigRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteStudioLifecycleConfigRequest));<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, "DeleteStudioLifecycleConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteStudioLifecycleConfigResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteStudioLifecycleConfigResultJsonUnmarshaller());<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);
336,367
public ByteBuf encodeRequest(Request request) throws Exception {<NEW_LINE>DubboHeader header = new DubboHeader();<NEW_LINE>byte flag = (byte) (FLAG_REQUEST | getContentTypeId());<NEW_LINE>if (!request.isOneWay()) {<NEW_LINE>flag |= FLAG_TWOWAY;<NEW_LINE>}<NEW_LINE>if (request.isHeartbeat()) {<NEW_LINE>flag |= FLAG_EVENT;<NEW_LINE>}<NEW_LINE>header.setFlag(flag);<NEW_LINE>header.setCorrelationId(request.getCorrelationId());<NEW_LINE>byte[] bodyBytes = null;<NEW_LINE>if (request.isHeartbeat()) {<NEW_LINE>bodyBytes = DubboPacket.encodeHeartbeatBody();<NEW_LINE>} else {<NEW_LINE>DubboRequestBody requestBody = new DubboRequestBody();<NEW_LINE>requestBody.setPath(request.getServiceName());<NEW_LINE>requestBody.setVersion(request.getSubscribeInfo().getVersion());<NEW_LINE>requestBody.setMethodName(request.getMethodName());<NEW_LINE>requestBody.setParameterTypes(request.getTargetMethod().getParameterTypes());<NEW_LINE>requestBody.setArguments(request.getArgs());<NEW_LINE>Map<String, String> kvAttachments = new HashMap<String, String>();<NEW_LINE>kvAttachments.put("group", request.getSubscribeInfo().getGroup());<NEW_LINE>if (request.getKvAttachment() != null) {<NEW_LINE>for (Map.Entry<String, Object> entry : request.getKvAttachment().entrySet()) {<NEW_LINE>kvAttachments.put(entry.getKey(), (<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>requestBody.setAttachments(kvAttachments);<NEW_LINE>bodyBytes = requestBody.encodeRequestBody();<NEW_LINE>}<NEW_LINE>header.setBodyLength(bodyBytes.length);<NEW_LINE>return Unpooled.wrappedBuffer(header.encode(), Unpooled.wrappedBuffer(bodyBytes));<NEW_LINE>}
String) entry.getValue());
767,717
protected double recompute(DBIDRef id, int mnum, double known, int snum, double sknown) {<NEW_LINE>double mindist = mnum >= 0 ? known : Double<MASK><NEW_LINE>int minIndex = mnum, minIndex2 = -1;<NEW_LINE>for (int i = 0; miter.seek(i).valid(); i++) {<NEW_LINE>if (i == mnum) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final double dist = i == snum ? sknown : distQ.distance(id, miter);<NEW_LINE>if (DBIDUtil.equal(id, miter) || dist < mindist) {<NEW_LINE>minIndex2 = minIndex;<NEW_LINE>mindist2 = mindist;<NEW_LINE>minIndex = i;<NEW_LINE>mindist = dist;<NEW_LINE>} else if (dist < mindist2) {<NEW_LINE>minIndex2 = i;<NEW_LINE>mindist2 = dist;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (minIndex < 0) {<NEW_LINE>throw new AbortException("Too many infinite distances. Cannot assign objects.");<NEW_LINE>}<NEW_LINE>assignment.putInt(id, minIndex);<NEW_LINE>nearest.putDouble(id, mindist);<NEW_LINE>secondid.putInt(id, minIndex2);<NEW_LINE>second.putDouble(id, mindist2);<NEW_LINE>return mindist;<NEW_LINE>}
.POSITIVE_INFINITY, mindist2 = Double.POSITIVE_INFINITY;
1,678,513
final ReadPresetResult executeReadPreset(ReadPresetRequest readPresetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(readPresetRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ReadPresetRequest> request = null;<NEW_LINE>Response<ReadPresetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ReadPresetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(readPresetRequest));<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, "Elastic Transcoder");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ReadPreset");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ReadPresetResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
false), new ReadPresetResultJsonUnmarshaller());
888,006
private IBuffer mapSource(SourceMapper mapper) throws JavaModelException {<NEW_LINE>char[] contents = <MASK><NEW_LINE>if (contents != null) {<NEW_LINE>// create buffer<NEW_LINE>IBuffer buffer = BufferManager.createBuffer(this);<NEW_LINE>if (buffer == null)<NEW_LINE>return null;<NEW_LINE>BufferManager bufManager = getBufferManager();<NEW_LINE>bufManager.addBuffer(buffer);<NEW_LINE>// set the buffer source<NEW_LINE>if (buffer.getCharacters() == null) {<NEW_LINE>buffer.setContents(contents);<NEW_LINE>}<NEW_LINE>// listen to buffer changes<NEW_LINE>buffer.addBufferChangedListener(this);<NEW_LINE>// do the source mapping<NEW_LINE>mapper.mapSource((NamedMember) getModule(), contents, null);<NEW_LINE>return buffer;<NEW_LINE>} else {<NEW_LINE>// create buffer<NEW_LINE>IBuffer buffer = BufferManager.createNullBuffer(this);<NEW_LINE>if (buffer == null)<NEW_LINE>return null;<NEW_LINE>BufferManager bufManager = getBufferManager();<NEW_LINE>bufManager.addBuffer(buffer);<NEW_LINE>// listen to buffer changes<NEW_LINE>buffer.addBufferChangedListener(this);<NEW_LINE>return buffer;<NEW_LINE>}<NEW_LINE>}
mapper.findSource(getModule());
321,777
private void populateDialog() throws CryptoException {<NEW_LINE>KeyInfo keyInfo = KeyPairUtil.getKeyInfo(privateKey);<NEW_LINE>jtfAlgorithm.setText(keyInfo.getAlgorithm());<NEW_LINE><MASK><NEW_LINE>if (keyLength != null) {<NEW_LINE>jtfKeySize.setText(MessageFormat.format(res.getString("DViewPrivateKey.jtfKeySize.text"), "" + keyLength));<NEW_LINE>} else {<NEW_LINE>jtfKeySize.setText(MessageFormat.format(res.getString("DViewPrivateKey.jtfKeySize.text"), "?"));<NEW_LINE>}<NEW_LINE>jtfFormat.setText(privateKey.getFormat());<NEW_LINE>jtaEncoded.setText(new BigInteger(1, privateKey.getEncoded()).toString(16).toUpperCase());<NEW_LINE>jtaEncoded.setCaretPosition(0);<NEW_LINE>if ((privateKey instanceof RSAPrivateKey) || (privateKey instanceof DSAPrivateKey)) {<NEW_LINE>jbFields.setEnabled(true);<NEW_LINE>} else {<NEW_LINE>jbFields.setEnabled(false);<NEW_LINE>}<NEW_LINE>}
Integer keyLength = keyInfo.getSize();
1,537,895
public JComponent buttonPanel(String title, JButton... buttons) {<NEW_LINE>var label = new JLabel(title, SwingConstants.CENTER);<NEW_LINE>var font = label.getFont();<NEW_LINE>label.setFont(new Font(font.getName(), Font.PLAIN, 6 * font.getSize() / 3));<NEW_LINE>var buttonPanel = new JPanel();<NEW_LINE>buttonPanel.setBackground(Color.WHITE);<NEW_LINE>buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.Y_AXIS));<NEW_LINE>for (int i = 0; i < buttons.length; i++) {<NEW_LINE>buttonPanel.add(buttons[i]);<NEW_LINE>if (i != buttons.length - 1)<NEW_LINE>buttonPanel.add(Box.createRigidArea(new Dimension(0, 10)));<NEW_LINE>}<NEW_LINE>var scrollPane = new JScrollPane(buttonPanel);<NEW_LINE>scrollPane.<MASK><NEW_LINE>scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);<NEW_LINE>scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);<NEW_LINE>SpringLayout layout = new SpringLayout();<NEW_LINE>var panel = new JPanel(layout);<NEW_LINE>panel.setBackground(Color.WHITE);<NEW_LINE>panel.add(label);<NEW_LINE>panel.add(scrollPane);<NEW_LINE>panel.setPreferredSize(new Dimension(240, 325));<NEW_LINE>panel.setMaximumSize(panel.getPreferredSize());<NEW_LINE>layout.putConstraint(SpringLayout.WEST, label, 0, SpringLayout.WEST, panel);<NEW_LINE>layout.putConstraint(SpringLayout.EAST, label, 0, SpringLayout.EAST, panel);<NEW_LINE>layout.putConstraint(SpringLayout.NORTH, label, 0, SpringLayout.NORTH, panel);<NEW_LINE>layout.putConstraint(SpringLayout.WEST, scrollPane, 0, SpringLayout.WEST, panel);<NEW_LINE>layout.putConstraint(SpringLayout.EAST, scrollPane, 0, SpringLayout.EAST, panel);<NEW_LINE>layout.putConstraint(SpringLayout.NORTH, scrollPane, 0, SpringLayout.SOUTH, label);<NEW_LINE>layout.putConstraint(SpringLayout.SOUTH, scrollPane, 0, SpringLayout.SOUTH, panel);<NEW_LINE>return panel;<NEW_LINE>}
setBorder(BorderFactory.createEmptyBorder());
680,908
public JComponent config() {<NEW_LINE>// Apply the orientation for the locale<NEW_LINE>ComponentOrientation orientation = ComponentOrientation.getOrientation(PMS.getLocale());<NEW_LINE>String colSpec = FormLayoutUtil.getColSpec(COL_SPEC, orientation);<NEW_LINE>FormLayout layout = new FormLayout(colSpec, ROW_SPEC);<NEW_LINE>PanelBuilder builder = new PanelBuilder(layout);<NEW_LINE><MASK><NEW_LINE>builder.opaque(false);<NEW_LINE>CellConstraints cc = new CellConstraints();<NEW_LINE>JComponent cmp = builder.addSeparator(Messages.getString("NetworkTab.5"), FormLayoutUtil.flip(cc.xyw(2, 1, 1), colSpec, orientation));<NEW_LINE>cmp = (JComponent) cmp.getComponent(0);<NEW_LINE>cmp.setFont(cmp.getFont().deriveFont(Font.BOLD));<NEW_LINE>tsmuxerforcefps = new JCheckBox(Messages.getString("TsMuxeRVideo.2"), configuration.isTsmuxerForceFps());<NEW_LINE>tsmuxerforcefps.setContentAreaFilled(false);<NEW_LINE>tsmuxerforcefps.addItemListener(new ItemListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void itemStateChanged(ItemEvent e) {<NEW_LINE>configuration.setTsmuxerForceFps(e.getStateChange() == ItemEvent.SELECTED);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder.add(GuiUtil.getPreferredSizeComponent(tsmuxerforcefps), FormLayoutUtil.flip(cc.xy(2, 3), colSpec, orientation));<NEW_LINE>muxallaudiotracks = new JCheckBox(Messages.getString("TsMuxeRVideo.19"), configuration.isMuxAllAudioTracks());<NEW_LINE>muxallaudiotracks.setContentAreaFilled(false);<NEW_LINE>muxallaudiotracks.addItemListener(new ItemListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void itemStateChanged(ItemEvent e) {<NEW_LINE>configuration.setMuxAllAudioTracks(e.getStateChange() == ItemEvent.SELECTED);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>builder.add(GuiUtil.getPreferredSizeComponent(muxallaudiotracks), FormLayoutUtil.flip(cc.xy(2, 5), colSpec, orientation));<NEW_LINE>JPanel panel = builder.getPanel();<NEW_LINE>// Apply the orientation to the panel and all components in it<NEW_LINE>panel.applyComponentOrientation(orientation);<NEW_LINE>return panel;<NEW_LINE>}
builder.border(Borders.EMPTY);
49,841
public static LedgerMetadataBuilder from(LedgerMetadata other) {<NEW_LINE>LedgerMetadataBuilder builder = new LedgerMetadataBuilder();<NEW_LINE>builder.ledgerId = other.getLedgerId();<NEW_LINE>builder<MASK><NEW_LINE>builder.ensembleSize = other.getEnsembleSize();<NEW_LINE>builder.writeQuorumSize = other.getWriteQuorumSize();<NEW_LINE>builder.ackQuorumSize = other.getAckQuorumSize();<NEW_LINE>builder.state = other.getState();<NEW_LINE>if (builder.state == State.CLOSED) {<NEW_LINE>builder.lastEntryId = Optional.of(other.getLastEntryId());<NEW_LINE>builder.length = Optional.of(other.getLength());<NEW_LINE>}<NEW_LINE>builder.ensembles.putAll(other.getAllEnsembles());<NEW_LINE>if (other.hasPassword()) {<NEW_LINE>builder.password = Optional.of(other.getPassword());<NEW_LINE>builder.digestType = Optional.of(other.getDigestType());<NEW_LINE>}<NEW_LINE>builder.ctime = other.getCtime();<NEW_LINE>builder.storeCtime = LedgerMetadataUtils.shouldStoreCtime(other);<NEW_LINE>builder.customMetadata = ImmutableMap.copyOf(other.getCustomMetadata());<NEW_LINE>return builder;<NEW_LINE>}
.metadataFormatVersion = other.getMetadataFormatVersion();
1,060,700
private void addElementsByPattern(@Nonnull String pattern, @Nonnull final Set<Object> elements, @Nonnull final ProgressIndicator indicator, boolean everywhere) {<NEW_LINE><MASK><NEW_LINE>myProvider.filterElements(ChooseByNameBase.this, pattern, everywhere, indicator, o -> {<NEW_LINE>if (indicator.isCanceled())<NEW_LINE>return false;<NEW_LINE>if (o == null) {<NEW_LINE>LOG.error("Null returned from " + myProvider + " with " + myModel + " in " + ChooseByNameBase.this);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>elements.add(o);<NEW_LINE>if (isOverflow(elements)) {<NEW_LINE>elements.add(EXTRA_ELEM);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>});<NEW_LINE>if (myAlwaysHasMore) {<NEW_LINE>elements.add(EXTRA_ELEM);<NEW_LINE>}<NEW_LINE>if (ContributorsBasedGotoByModel.LOG.isDebugEnabled()) {<NEW_LINE>long end = System.currentTimeMillis();<NEW_LINE>ContributorsBasedGotoByModel.LOG.debug("addElementsByPattern(" + pattern + "): " + (end - start) + "ms; " + elements.size() + " elements");<NEW_LINE>}<NEW_LINE>}
long start = System.currentTimeMillis();
702,973
public SearchGameSessionsResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SearchGameSessionsResult searchGameSessionsResult = new SearchGameSessionsResult();<NEW_LINE><MASK><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 searchGameSessionsResult;<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("GameSessions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>searchGameSessionsResult.setGameSessions(new ListUnmarshaller<GameSession>(GameSessionJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>searchGameSessionsResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return searchGameSessionsResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
452,153
public IpRangeInventory createIpRange(IpRangeInventory ipr, APICreateMessage msg) {<NEW_LINE>NormalIpRangeVO vo = new SQLBatchWithReturn<NormalIpRangeVO>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected NormalIpRangeVO scripts() {<NEW_LINE>NormalIpRangeVO vo = new NormalIpRangeVO();<NEW_LINE>vo.setUuid(ipr.getUuid() == null ? Platform.getUuid() : ipr.getUuid());<NEW_LINE>vo.setDescription(ipr.getDescription());<NEW_LINE>vo.setEndIp(ipr.getEndIp());<NEW_LINE>vo.setGateway(ipr.getGateway());<NEW_LINE>vo.setL3NetworkUuid(ipr.getL3NetworkUuid());<NEW_LINE>vo.setName(ipr.getName());<NEW_LINE>vo.setNetmask(ipr.getNetmask());<NEW_LINE>vo.setStartIp(ipr.getStartIp());<NEW_LINE>vo.setNetworkCidr(ipr.getNetworkCidr());<NEW_LINE>vo.setAccountUuid(msg.getSession().getAccountUuid());<NEW_LINE>vo.setIpVersion(ipr.getIpVersion());<NEW_LINE>vo.setAddressMode(ipr.getAddressMode());<NEW_LINE>vo.setPrefixLen(ipr.getPrefixLen());<NEW_LINE>dbf.getEntityManager().persist(vo);<NEW_LINE>dbf.getEntityManager().flush();<NEW_LINE>dbf.getEntityManager().refresh(vo);<NEW_LINE>return vo;<NEW_LINE>}<NEW_LINE>}.execute();<NEW_LINE>IpRangeHelper.updateL3NetworkIpversion(ipr);<NEW_LINE>final IpRangeInventory <MASK><NEW_LINE>CollectionUtils.safeForEach(pluginRgty.getExtensionList(AfterAddIpRangeExtensionPoint.class), new ForEachFunction<AfterAddIpRangeExtensionPoint>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(AfterAddIpRangeExtensionPoint ext) {<NEW_LINE>ext.afterAddIpRange(finalIpr, msg.getSystemTags());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return finalIpr;<NEW_LINE>}
finalIpr = NormalIpRangeInventory.valueOf1(vo);
633,250
/*<NEW_LINE>*<NEW_LINE>* Recursively finds in-clauses and reformats them for the parser<NEW_LINE>*<NEW_LINE>* */<NEW_LINE>private String alignINClause(String in) {<NEW_LINE>String paramIn = in;<NEW_LINE>final int indexLowerIn = paramIn.indexOf(IN_LOWER);<NEW_LINE>final int indexLowerInWithParentheses = paramIn.indexOf(IN_LOWER_P);<NEW_LINE>final int indexUpperIn = paramIn.indexOf(IN_UPPER);<NEW_LINE>final int indexUpperInWithParentheses = paramIn.indexOf(IN_UPPER_P);<NEW_LINE>// find first occurrence of in clause.<NEW_LINE>final int indexIn = findMinIfNot(indexUpperInWithParentheses, findMinIfNot(indexUpperIn, findMinIfNot(indexLowerIn, indexLowerInWithParentheses, NO_INDEX), NO_INDEX), NO_INDEX);<NEW_LINE>if (indexIn > NO_INDEX && (indexIn == indexLowerInWithParentheses || indexIn == indexUpperInWithParentheses)) {<NEW_LINE>// 3 is the size of param in ending with a parentheses.<NEW_LINE>// add SPLIT_EXPRESSION<NEW_LINE>paramIn = paramIn.substring(0, indexIn + 3) + SPLIT_EXPRESSION + paramIn.substring(indexIn + 3);<NEW_LINE>}<NEW_LINE>String sql = paramIn;<NEW_LINE>if (indexIn != NO_INDEX) {<NEW_LINE>final int indexOpen = <MASK><NEW_LINE>final int indexClose = paramIn.indexOf(')', indexOpen);<NEW_LINE>String sub = paramIn.substring(indexOpen, indexClose + 1);<NEW_LINE>sub = sub.replaceAll(" ", "");<NEW_LINE>sql = paramIn.substring(0, indexOpen) + sub + alignINClause(paramIn.substring(indexClose + 1));<NEW_LINE>}<NEW_LINE>return sql;<NEW_LINE>}
paramIn.indexOf('(', indexIn);
960,888
private InternalImageProcessorResult process(Renderable renderer) throws JRException {<NEW_LINE>if (renderer instanceof ResourceRenderer) {<NEW_LINE>renderer = imageRenderersCache.getLoadedRenderer((ResourceRenderer) renderer);<NEW_LINE>}<NEW_LINE>// check dimension first, to avoid caching renderers that might not be used eventually, due to their dimension errors<NEW_LINE>Dimension2D dimension = null;<NEW_LINE>if (needDimension) {<NEW_LINE>DimensionRenderable <MASK><NEW_LINE>dimension = dimensionRenderer == null ? null : dimensionRenderer.getDimension(jasperReportsContext);<NEW_LINE>}<NEW_LINE>ExifOrientationEnum exifOrientation = ExifOrientationEnum.NORMAL;<NEW_LINE>String imagePath = null;<NEW_LINE>// if (image.isLazy()) //FIXMEDOCX learn how to link images<NEW_LINE>// {<NEW_LINE>//<NEW_LINE>// }<NEW_LINE>// else<NEW_LINE>// {<NEW_LINE>if (// we do not cache imagePath for non-data renderers because they render width different width/height each time<NEW_LINE>renderer instanceof DataRenderable && rendererToImagePathMap.containsKey(renderer.getId())) {<NEW_LINE>Pair<String, ExifOrientationEnum> imagePair = rendererToImagePathMap.get(renderer.getId());<NEW_LINE>imagePath = imagePair.first();<NEW_LINE>exifOrientation = imagePair.second();<NEW_LINE>} else {<NEW_LINE>JRPrintElementIndex imageIndex = getElementIndex(cell);<NEW_LINE>DataRenderable imageRenderer = getRendererUtil().getImageDataRenderable(imageRenderersCache, renderer, new Dimension(availableImageWidth, availableImageHeight), ModeEnum.OPAQUE == imageElement.getModeValue() ? imageElement.getBackcolor() : null);<NEW_LINE>byte[] imageData = imageRenderer.getData(jasperReportsContext);<NEW_LINE>exifOrientation = ImageUtil.getExifOrientation(imageData);<NEW_LINE>String fileExtension = JRTypeSniffer.getImageTypeValue(imageData).getFileExtension();<NEW_LINE>String imageName = IMAGE_NAME_PREFIX + imageIndex.toString() + (fileExtension == null ? "" : ("." + fileExtension));<NEW_LINE>// FIXMEDOCX optimize with a different implementation of entry<NEW_LINE>// FIXMEDOCX optimize with a different implementation of entry<NEW_LINE>docxZip.addEntry(new FileBufferedZipEntry("word/media/" + imageName, imageData));<NEW_LINE>relsHelper.exportImage(imageName);<NEW_LINE>imagePath = imageName;<NEW_LINE>// imagePath = "Pictures/" + imageName;<NEW_LINE>if (imageRenderer == renderer) {<NEW_LINE>// cache imagePath only for true ImageRenderable instances because the wrapping ones render with different width/height each time<NEW_LINE>rendererToImagePathMap.put(renderer.getId(), new Pair<>(imagePath, exifOrientation));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// }<NEW_LINE>return new InternalImageProcessorResult(imagePath, dimension, exifOrientation);<NEW_LINE>}
dimensionRenderer = imageRenderersCache.getDimensionRenderable(renderer);
562,385
private void handleSegmentReferredToCountAndRententionFlags(SegmentHeader segmentHeader) throws IOException, JBIG2Exception {<NEW_LINE>short referedToSegmentCountAndRetentionFlags = reader.readByte();<NEW_LINE>// 224<NEW_LINE>int referredToSegmentCount = (referedToSegmentCountAndRetentionFlags & 224) >> 5;<NEW_LINE>// =<NEW_LINE>// 11100000<NEW_LINE>short[] retentionFlags;<NEW_LINE>// 31 =<NEW_LINE>short firstByte = <MASK><NEW_LINE>// 00011111<NEW_LINE>if (referredToSegmentCount <= 4) {<NEW_LINE>// short form<NEW_LINE>retentionFlags = new short[1];<NEW_LINE>retentionFlags[0] = firstByte;<NEW_LINE>} else if (referredToSegmentCount == 7) {<NEW_LINE>// long form<NEW_LINE>short[] longFormCountAndFlags = new short[4];<NEW_LINE>longFormCountAndFlags[0] = firstByte;<NEW_LINE>for (// add the next 3 bytes to the array<NEW_LINE>int i = 1; // add the next 3 bytes to the array<NEW_LINE>i < 4; // add the next 3 bytes to the array<NEW_LINE>i++) longFormCountAndFlags[i] = reader.readByte();<NEW_LINE>referredToSegmentCount = BinaryOperation.getInt32(longFormCountAndFlags);<NEW_LINE>int noOfBytesInField = (int) Math.ceil(4 + ((referredToSegmentCount + 1) / 8d));<NEW_LINE>// System.out.println("noOfBytesInField = " + noOfBytesInField);<NEW_LINE>int noOfRententionFlagBytes = noOfBytesInField - 4;<NEW_LINE>retentionFlags = new short[noOfRententionFlagBytes];<NEW_LINE>reader.readByte(retentionFlags);<NEW_LINE>} else {<NEW_LINE>// error<NEW_LINE>throw new JBIG2Exception("Error, 3 bit Segment count field = " + referredToSegmentCount);<NEW_LINE>}<NEW_LINE>segmentHeader.setReferredToSegmentCount(referredToSegmentCount);<NEW_LINE>if (JBIG2StreamDecoder.debug)<NEW_LINE>System.out.println("referredToSegmentCount = " + referredToSegmentCount);<NEW_LINE>segmentHeader.setRententionFlags(retentionFlags);<NEW_LINE>if (JBIG2StreamDecoder.debug)<NEW_LINE>System.out.print("retentionFlags = ");<NEW_LINE>if (JBIG2StreamDecoder.debug) {<NEW_LINE>for (short retentionFlag : retentionFlags) System.out.print(retentionFlag + " ");<NEW_LINE>System.out.println("");<NEW_LINE>}<NEW_LINE>}
(short) (referedToSegmentCountAndRetentionFlags & 31);