idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
282,813 | public BaseDataSourceParamDTO createDatasourceParamDTO(String connectionJson) {<NEW_LINE>OracleConnectionParam connectionParams = (OracleConnectionParam) createConnectionParams(connectionJson);<NEW_LINE>OracleDataSourceParamDTO oracleDatasourceParamDTO = new OracleDataSourceParamDTO();<NEW_LINE>oracleDatasourceParamDTO.setDatabase(connectionParams.getDatabase());<NEW_LINE>oracleDatasourceParamDTO.<MASK><NEW_LINE>oracleDatasourceParamDTO.setOther(parseOther(connectionParams.getOther()));<NEW_LINE>String hostSeperator = Constants.DOUBLE_SLASH;<NEW_LINE>if (DbConnectType.ORACLE_SID.equals(connectionParams.connectType)) {<NEW_LINE>hostSeperator = Constants.AT_SIGN;<NEW_LINE>}<NEW_LINE>String[] hostPort = connectionParams.getAddress().split(hostSeperator);<NEW_LINE>String[] hostPortArray = hostPort[hostPort.length - 1].split(Constants.COMMA);<NEW_LINE>oracleDatasourceParamDTO.setPort(Integer.parseInt(hostPortArray[0].split(Constants.COLON)[1]));<NEW_LINE>oracleDatasourceParamDTO.setHost(hostPortArray[0].split(Constants.COLON)[0]);<NEW_LINE>return oracleDatasourceParamDTO;<NEW_LINE>} | setUserName(connectionParams.getUser()); |
344,980 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.getPlayer(source.getControllerId());<NEW_LINE>if (controller != null) {<NEW_LINE>Set<Card> cardsToExile = new HashSet<>(this.getTargetPointer().getTargets(game, source).size());<NEW_LINE>for (UUID targetId : this.getTargetPointer().getTargets(game, source)) {<NEW_LINE>Card card = controller.getGraveyard().get(targetId, game);<NEW_LINE>if (card != null) {<NEW_LINE>cardsToExile.add(card);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>controller.moveCardsToExile(cardsToExile, source, game, true, null, "");<NEW_LINE>for (Card card : cardsToExile) {<NEW_LINE>if (game.getState().getZone(card.getId()) == Zone.EXILED) {<NEW_LINE>// create token and modify all attributes permanently (without game usage)<NEW_LINE>EmptyToken token = new EmptyToken();<NEW_LINE>CardUtil.copyTo(token).from(card, game);<NEW_LINE>token.removePTCDA();<NEW_LINE>token.getPower().modifyBaseValue(4);<NEW_LINE>token.<MASK><NEW_LINE>token.getColor().setColor(ObjectColor.BLACK);<NEW_LINE>token.removeAllCreatureTypes();<NEW_LINE>token.addSubType(SubType.ZOMBIE);<NEW_LINE>token.putOntoBattlefield(1, game, source, source.getControllerId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | getToughness().modifyBaseValue(4); |
145,832 | public void run() {<NEW_LINE>File[] folders;<NEW_LINE>synchronized (foldersToCheck) {<NEW_LINE>folders = foldersToCheck.toArray(new File<MASK><NEW_LINE>foldersToCheck.clear();<NEW_LINE>loggingTask = null;<NEW_LINE>}<NEW_LINE>for (File f : folders) {<NEW_LINE>if (!checkFolderLogged(f, false)) {<NEW_LINE>// if other task has not processed the root yet<NEW_LINE>VersioningSystem vs = VersioningSupport.getOwner(f);<NEW_LINE>if (vs != null) {<NEW_LINE>File root = vs.getTopmostManagedAncestor(f);<NEW_LINE>if (root != null) {<NEW_LINE>// remember the root<NEW_LINE>checkFolderLogged(root, true);<NEW_LINE>FileObject rootFO = FileUtil.toFileObject(root);<NEW_LINE>if (rootFO != null) {<NEW_LINE>String url = VersioningQuery.getRemoteLocation(rootFO.toURI());<NEW_LINE>if (url != null) {<NEW_LINE>Object name = vs.getProperty(VersioningSystem.PROP_DISPLAY_NAME);<NEW_LINE>if (!(name instanceof String)) {<NEW_LINE>name = vs.getClass().getSimpleName();<NEW_LINE>}<NEW_LINE>logVCSKenaiUsage(name.toString(), url);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | [foldersToCheck.size()]); |
1,109,122 | protected void paint(GC gc) {<NEW_LINE>Rectangle clipping = gc.getClipping();<NEW_LINE>if (clipping.width == 0 || clipping.height == 0)<NEW_LINE>return;<NEW_LINE>Rectangle clientArea = getScreenRectInVirtualSpace();<NEW_LINE>// Beginning coordinates<NEW_LINE>int xOffset = clientArea.x;<NEW_LINE>int yOffset = clientArea.y;<NEW_LINE>int colFirst = virtualXToCell(xOffset + clipping.x);<NEW_LINE>if (colFirst > getCols())<NEW_LINE>colFirst = getCols();<NEW_LINE>else if (colFirst < 0) {<NEW_LINE>colFirst = 0;<NEW_LINE>}<NEW_LINE>int rowFirst = virtualYToCell(yOffset + clipping.y);<NEW_LINE>// End coordinates<NEW_LINE>int colLast = virtualXToCell(xOffset + clipping.x + clipping.width + fCellWidth);<NEW_LINE>if (colLast > getCols())<NEW_LINE>colLast = getCols();<NEW_LINE>int rowLast = virtualYToCell(yOffset + clipping.y + clipping.height + fCellHeight);<NEW_LINE>if (rowLast > getRows())<NEW_LINE>rowLast = getRows();<NEW_LINE>// System.out.println(rowFirst+"->"+rowLast+" "+System.currentTimeMillis());<NEW_LINE>// draw the cells<NEW_LINE>for (int row = rowFirst; row <= rowLast; row++) {<NEW_LINE><MASK><NEW_LINE>int cy = row * fCellHeight - yOffset;<NEW_LINE>drawLine(gc, row, cx, cy, colFirst, colLast);<NEW_LINE>}<NEW_LINE>paintUnoccupiedSpace(gc, clipping);<NEW_LINE>} | int cx = colFirst * fCellWidth - xOffset; |
877,308 | private void addNuggets() {<NEW_LINE>addToTag(MekanismTags.Items.NUGGETS_BRONZE, MekanismItems.BRONZE_NUGGET);<NEW_LINE>addToTag(MekanismTags.Items.NUGGETS_REFINED_GLOWSTONE, MekanismItems.REFINED_GLOWSTONE_NUGGET);<NEW_LINE>addToTag(MekanismTags.Items.NUGGETS_REFINED_OBSIDIAN, MekanismItems.REFINED_OBSIDIAN_NUGGET);<NEW_LINE>addToTag(MekanismTags.<MASK><NEW_LINE>getItemBuilder(Tags.Items.NUGGETS).add(MekanismTags.Items.NUGGETS_BRONZE, MekanismTags.Items.NUGGETS_REFINED_GLOWSTONE, MekanismTags.Items.NUGGETS_REFINED_OBSIDIAN, MekanismTags.Items.NUGGETS_STEEL);<NEW_LINE>} | Items.NUGGETS_STEEL, MekanismItems.STEEL_NUGGET); |
1,733,198 | public CloudWatchLogsLogDeliveryDescription unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CloudWatchLogsLogDeliveryDescription cloudWatchLogsLogDeliveryDescription = new CloudWatchLogsLogDeliveryDescription();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("enabled", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>cloudWatchLogsLogDeliveryDescription.setEnabled(context.getUnmarshaller(Boolean.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("logGroup", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>cloudWatchLogsLogDeliveryDescription.setLogGroup(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 cloudWatchLogsLogDeliveryDescription;<NEW_LINE>} | class).unmarshall(context)); |
1,089,585 | private static List<PresenterProviderMethod> collectPresenterProviders(TypeElement presentersContainer) {<NEW_LINE>List<PresenterProviderMethod> providers = new ArrayList<>();<NEW_LINE>for (Element element : presentersContainer.getEnclosedElements()) {<NEW_LINE>if (element.getKind() != ElementKind.METHOD) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final ExecutableElement providerMethod = (ExecutableElement) element;<NEW_LINE>final AnnotationMirror annotation = Util.getAnnotation(element, PROVIDE_PRESENTER_ANNOTATION);<NEW_LINE>if (annotation == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>final String name = providerMethod.getSimpleName().toString();<NEW_LINE>final DeclaredType kind = ((<MASK><NEW_LINE>String type = Util.getAnnotationValueAsString(annotation, "type");<NEW_LINE>String tag = Util.getAnnotationValueAsString(annotation, "tag");<NEW_LINE>String presenterId = Util.getAnnotationValueAsString(annotation, "presenterId");<NEW_LINE>providers.add(new PresenterProviderMethod(kind, name, type, tag, presenterId));<NEW_LINE>}<NEW_LINE>return providers;<NEW_LINE>} | DeclaredType) providerMethod.getReturnType()); |
694,965 | public void processOpts() {<NEW_LINE>super.processOpts();<NEW_LINE>tsModelPackage = modelPackage.replaceAll("\\.", "/");<NEW_LINE>String tsApiPackage = apiPackage.replaceAll("\\.", "/");<NEW_LINE>String modelRelativeToRoot = getRelativeToRoot(tsModelPackage);<NEW_LINE>String apiRelativeToRoot = getRelativeToRoot(tsApiPackage);<NEW_LINE>additionalProperties.put("tsModelPackage", tsModelPackage);<NEW_LINE>additionalProperties.put("tsApiPackage", tsApiPackage);<NEW_LINE>additionalProperties.put("apiRelativeToRoot", apiRelativeToRoot);<NEW_LINE>additionalProperties.put("modelRelativeToRoot", modelRelativeToRoot);<NEW_LINE>supportingFiles.add(new SupportingFile("index.mustache", "", "index.ts"));<NEW_LINE>supportingFiles.add(new SupportingFile("baseApi.mustache", "", "base.ts"));<NEW_LINE>supportingFiles.add(new SupportingFile("common.mustache", "", "common.ts"));<NEW_LINE>supportingFiles.add(new SupportingFile("api.mustache", "", "api.ts"));<NEW_LINE>supportingFiles.add(new SupportingFile("configuration.mustache", "", "configuration.ts"));<NEW_LINE>supportingFiles.add(new SupportingFile("git_push.sh.mustache", "", "git_push.sh"));<NEW_LINE>supportingFiles.add(new SupportingFile<MASK><NEW_LINE>supportingFiles.add(new SupportingFile("npmignore", "", ".npmignore"));<NEW_LINE>if (additionalProperties.containsKey(SEPARATE_MODELS_AND_API)) {<NEW_LINE>boolean separateModelsAndApi = Boolean.parseBoolean(additionalProperties.get(SEPARATE_MODELS_AND_API).toString());<NEW_LINE>if (separateModelsAndApi) {<NEW_LINE>if (StringUtils.isAnyBlank(modelPackage, apiPackage)) {<NEW_LINE>throw new RuntimeException("apiPackage and modelPackage must be defined");<NEW_LINE>}<NEW_LINE>modelTemplateFiles.put("model.mustache", ".ts");<NEW_LINE>apiTemplateFiles.put("apiInner.mustache", ".ts");<NEW_LINE>supportingFiles.add(new SupportingFile("modelIndex.mustache", tsModelPackage, "index.ts"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (additionalProperties.containsKey(STRING_ENUMS)) {<NEW_LINE>this.stringEnums = Boolean.parseBoolean(additionalProperties.get(STRING_ENUMS).toString());<NEW_LINE>additionalProperties.put("stringEnums", this.stringEnums);<NEW_LINE>}<NEW_LINE>if (additionalProperties.containsKey(NPM_NAME)) {<NEW_LINE>addNpmPackageGeneration();<NEW_LINE>}<NEW_LINE>} | ("gitignore", "", ".gitignore")); |
209,632 | final UpdateIncidentRecordResult executeUpdateIncidentRecord(UpdateIncidentRecordRequest updateIncidentRecordRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateIncidentRecordRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateIncidentRecordRequest> request = null;<NEW_LINE>Response<UpdateIncidentRecordResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new UpdateIncidentRecordRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateIncidentRecordRequest));<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 Incidents");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateIncidentRecord");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateIncidentRecordResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateIncidentRecordResultJsonUnmarshaller());<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); |
917,797 | public void commandLine(String query_input) {<NEW_LINE>// while (true) {<NEW_LINE>// query user for question, quit if user types in "exit"<NEW_LINE>// MsgPrinter.printQuestionPrompt();<NEW_LINE>// String question = readLine().trim();<NEW_LINE>String question = query_input.trim();<NEW_LINE>if (question.equalsIgnoreCase("exit"))<NEW_LINE>System.exit(0);<NEW_LINE>// determine question type and extract question string<NEW_LINE>String type;<NEW_LINE>if (question.matches("(?i)" + FACTOID + ":.*+")) {<NEW_LINE>// factoid question<NEW_LINE>type = FACTOID;<NEW_LINE>question = question.split(":", 2)[1].trim();<NEW_LINE>} else if (question.matches("(?i)" + LIST + ":.*+")) {<NEW_LINE>// list question<NEW_LINE>type = LIST;<NEW_LINE>question = question.split(":", 2)[1].trim();<NEW_LINE>} else {<NEW_LINE>// question type unspecified<NEW_LINE>// default type<NEW_LINE>type = FACTOID;<NEW_LINE>}<NEW_LINE>// ask question<NEW_LINE>Result[] results = new Result[0];<NEW_LINE>if (type.equals(FACTOID)) {<NEW_LINE>Logger.logFactoidStart(question);<NEW_LINE>results = askFactoid(question, FACTOID_MAX_ANSWERS, FACTOID_ABS_THRESH);<NEW_LINE>Logger.logResults(results);<NEW_LINE>Logger.logFactoidEnd();<NEW_LINE>} else if (type.equals(LIST)) {<NEW_LINE>Logger.logListStart(question);<NEW_LINE><MASK><NEW_LINE>Logger.logResults(results);<NEW_LINE>Logger.logListEnd();<NEW_LINE>}<NEW_LINE>// print answers<NEW_LINE>MsgPrinter.printAnswers(results);<NEW_LINE>// }<NEW_LINE>} | results = askList(question, LIST_REL_THRESH); |
924,089 | private Pair<List<TableColumnDesc>, List<StmtClassForgeableFactory>> validateExpressions(List<CreateTableColumn> columns, StatementCompileTimeServices services) throws ExprValidationException {<NEW_LINE>Set<String> columnNames = new HashSet<>();<NEW_LINE>List<TableColumnDesc> descriptors = new ArrayList<>();<NEW_LINE>int positionInDeclaration = 0;<NEW_LINE>List<StmtClassForgeableFactory> additionalForgeables = new ArrayList<>(2);<NEW_LINE>for (CreateTableColumn column : columns) {<NEW_LINE>String msgprefix = "For column '" + column.getColumnName() + "'";<NEW_LINE>// check duplicate name<NEW_LINE>if (columnNames.contains(column.getColumnName())) {<NEW_LINE>throw new ExprValidationException("Column '" + column.getColumnName() + "' is listed more than once");<NEW_LINE>}<NEW_LINE>columnNames.add(column.getColumnName());<NEW_LINE>// determine presence of type annotation<NEW_LINE>EventType optionalEventType = validateExpressionGetEventType(msgprefix, <MASK><NEW_LINE>// aggregation node<NEW_LINE>TableColumnDesc descriptor;<NEW_LINE>if (column.getOptExpression() != null) {<NEW_LINE>Pair<ExprAggregateNode, List<StmtClassForgeableFactory>> pair = validateAggregationExpr(column.getOptExpression(), optionalEventType, services);<NEW_LINE>descriptor = new TableColumnDescAgg(positionInDeclaration, column.getColumnName(), pair.getFirst(), optionalEventType);<NEW_LINE>additionalForgeables.addAll(pair.getSecond());<NEW_LINE>} else {<NEW_LINE>Object unresolvedType = EventTypeUtility.buildType(new ColumnDesc(column.getColumnName(), column.getOptType().toEPL()), services.getClasspathImportServiceCompileTime(), services.getClassProvidedClasspathExtension());<NEW_LINE>descriptor = new TableColumnDescTyped(positionInDeclaration, column.getColumnName(), unresolvedType, column.getPrimaryKey() == null ? false : column.getPrimaryKey());<NEW_LINE>}<NEW_LINE>descriptors.add(descriptor);<NEW_LINE>positionInDeclaration++;<NEW_LINE>}<NEW_LINE>return new Pair<>(descriptors, additionalForgeables);<NEW_LINE>} | column.getAnnotations(), services); |
1,302,641 | public static String parseText(final Properties ctx, final String text, final boolean isEmbeded, final BoilerPlateContext context, final String trxName) {<NEW_LINE>if (text == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>String textFixed = text;<NEW_LINE>if (isEmbeded) {<NEW_LINE>textFixed = textFixed.replace("<html>", "").replace("</html>", "").replace("<head>", "").replace("</head>", "").replace("<body>", "").replace("</body>", "").trim();<NEW_LINE>}<NEW_LINE>final Matcher m = NameTagPattern.matcher(textFixed);<NEW_LINE>final StringBuffer sb = new StringBuffer();<NEW_LINE>while (m.find()) {<NEW_LINE>final String<MASK><NEW_LINE>final String refName = functions[0];<NEW_LINE>functions[0] = null;<NEW_LINE>final MADBoilerPlateVar var = MADBoilerPlateVar.get(ctx, refName);<NEW_LINE>String replacement;<NEW_LINE>if (context != null && context.containsKey(refName)) {<NEW_LINE>final Object attrValue = context.get(refName);<NEW_LINE>replacement = attrValue == null ? "" : attrValue.toString();<NEW_LINE>} else if (var != null) {<NEW_LINE>try {<NEW_LINE>replacement = var.evaluate(context);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>log.warn(e.getLocalizedMessage(), e);<NEW_LINE>replacement = m.group();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final MADBoilerPlate ref = getByName(ctx, refName, trxName);<NEW_LINE>if (ref == null) {<NEW_LINE>throw new AdempiereException("@NotFound@ @AD_BoilerPlate_ID@ (@Name@:" + refName + ")");<NEW_LINE>}<NEW_LINE>replacement = ref.getTextSnippetParsed(true, context);<NEW_LINE>}<NEW_LINE>if (replacement == null) {<NEW_LINE>replacement = "";<NEW_LINE>}<NEW_LINE>replacement = applyTagFunctions(replacement, functions);<NEW_LINE>m.appendReplacement(sb, replacement);<NEW_LINE>}<NEW_LINE>m.appendTail(sb);<NEW_LINE>return sb.toString();<NEW_LINE>} | [] functions = getTagNameAndFunctions(m); |
273,884 | private static void createArgs(String[] keys, int level, ArgumentSeries as, MapArgBenchmark mab, List mapList) {<NEW_LINE>if (level < keys.length) {<NEW_LINE>String key = keys[level];<NEW_LINE>Iterator vals = as.getValues(key);<NEW_LINE>while (vals.hasNext()) {<NEW_LINE>List localMapList = new ArrayList(11);<NEW_LINE>Object next = vals.next();<NEW_LINE>if (next instanceof Interval) {<NEW_LINE>Interval interval = (Interval) next;<NEW_LINE>int i = interval.getStart();<NEW_LINE><MASK><NEW_LINE>for (; i < interval.getEnd(); i += interval.getStep()) {<NEW_LINE>createArgsAndPut(keys, level + 1, as, mab, localMapList2, key, new Integer(i));<NEW_LINE>localMapList.addAll(localMapList2);<NEW_LINE>localMapList2.clear();<NEW_LINE>}<NEW_LINE>if (i >= interval.getEnd()) {<NEW_LINE>createArgsAndPut(keys, level + 1, as, mab, localMapList2, key, new Integer(interval.getEnd()));<NEW_LINE>localMapList.addAll(localMapList2);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>createArgsAndPut(keys, level + 1, as, mab, localMapList, key, next);<NEW_LINE>}<NEW_LINE>mapList.addAll(localMapList);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>mapList.add(mab.createDefaultMap());<NEW_LINE>}<NEW_LINE>} | List localMapList2 = new ArrayList(11); |
1,520 | private MediaSource.Factory createMediaSourceFactory() {<NEW_LINE>ImaServerSideAdInsertionMediaSource.AdsLoader.Builder serverSideAdLoaderBuilder = new ImaServerSideAdInsertionMediaSource.AdsLoader.Builder(/* context= */<NEW_LINE>this, playerView);<NEW_LINE>if (serverSideAdsLoaderState != null) {<NEW_LINE>serverSideAdLoaderBuilder.setAdsLoaderState(serverSideAdsLoaderState);<NEW_LINE>}<NEW_LINE>serverSideAdsLoader = serverSideAdLoaderBuilder.build();<NEW_LINE>ImaServerSideAdInsertionMediaSource.Factory imaServerSideAdInsertionMediaSourceFactory = new ImaServerSideAdInsertionMediaSource.Factory(<MASK><NEW_LINE>return new DefaultMediaSourceFactory(dataSourceFactory).setAdsLoaderProvider(this::getClientSideAdsLoader).setAdViewProvider(playerView).setServerSideAdInsertionMediaSourceFactory(imaServerSideAdInsertionMediaSourceFactory);<NEW_LINE>} | serverSideAdsLoader, new DefaultMediaSourceFactory(dataSourceFactory)); |
1,651,210 | public static void writeAppRule() throws Throwable {<NEW_LINE>String serverAddr = System.getProperty("nacos.address", "localhost");<NEW_LINE>String dataId = "governance-conditionrouter-consumer.condition-router";<NEW_LINE>String group = "dubbo";<NEW_LINE>Properties properties = new Properties();<NEW_LINE>properties.put(PropertyKeyConst.SERVER_ADDR, serverAddr);<NEW_LINE>properties.put("username", System.getProperty("username", "nacos"));<NEW_LINE>properties.put("password", System.getProperty("password", "nacos"));<NEW_LINE>ConfigService configService = NacosFactory.createConfigService(properties);<NEW_LINE>try (InputStream is = NacosUtils.class.getClassLoader().getResourceAsStream("dubbo-routers-condition.yml")) {<NEW_LINE>String <MASK><NEW_LINE>if (configService.publishConfig(dataId, group, content)) {<NEW_LINE>System.out.println("write " + dataId + ":" + group + " successfully.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | content = IOUtils.toString(is); |
1,521,613 | private int copyMetadataAndSetIndexed(int columnIndex, int indexValueBlockSize) {<NEW_LINE>try {<NEW_LINE>int index = openMetaSwapFile(ff, ddlMem, path, rootLen, configuration.getMaxSwapFileCount());<NEW_LINE>int columnCount = metaMem.getInt(META_OFFSET_COUNT);<NEW_LINE>ddlMem.putInt(columnCount);<NEW_LINE>ddlMem.putInt(metaMem.getInt(META_OFFSET_PARTITION_BY));<NEW_LINE>ddlMem.putInt(metaMem.getInt(META_OFFSET_TIMESTAMP_INDEX));<NEW_LINE>copyVersionAndLagValues();<NEW_LINE>ddlMem.jumpTo(META_OFFSET_COLUMN_TYPES);<NEW_LINE>for (int i = 0; i < columnCount; i++) {<NEW_LINE>if (i != columnIndex) {<NEW_LINE>writeColumnEntry(i, false);<NEW_LINE>} else {<NEW_LINE>ddlMem.putInt(getColumnType(metaMem, i));<NEW_LINE>long flags = META_FLAG_BIT_INDEXED;<NEW_LINE>if (isSequential(metaMem, i)) {<NEW_LINE>flags |= META_FLAG_BIT_SEQUENTIAL;<NEW_LINE>}<NEW_LINE>ddlMem.putLong(flags);<NEW_LINE>ddlMem.putInt(indexValueBlockSize);<NEW_LINE>ddlMem.putLong<MASK><NEW_LINE>ddlMem.skip(8);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long nameOffset = getColumnNameOffset(columnCount);<NEW_LINE>for (int i = 0; i < columnCount; i++) {<NEW_LINE>CharSequence columnName = metaMem.getStr(nameOffset);<NEW_LINE>ddlMem.putStr(columnName);<NEW_LINE>nameOffset += Vm.getStorageLength(columnName);<NEW_LINE>}<NEW_LINE>return index;<NEW_LINE>} finally {<NEW_LINE>ddlMem.close();<NEW_LINE>}<NEW_LINE>} | (getColumnHash(metaMem, i)); |
1,459,619 | private static Map<TypeAlias, NativeType> buildTypeMap() {<NEW_LINE>Map<TypeAlias, NativeType> m = new EnumMap<TypeAlias, NativeType>(TypeAlias.class);<NEW_LINE>m.put(TypeAlias.int8_t, NativeType.SCHAR);<NEW_LINE>m.put(TypeAlias.u_int8_t, NativeType.UCHAR);<NEW_LINE>m.put(TypeAlias.int16_t, NativeType.SSHORT);<NEW_LINE>m.put(TypeAlias.u_int16_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.int32_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.u_int32_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.int64_t, NativeType.SLONGLONG);<NEW_LINE>m.put(TypeAlias.u_int64_t, NativeType.ULONGLONG);<NEW_LINE>m.put(<MASK><NEW_LINE>m.put(TypeAlias.uintptr_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.caddr_t, NativeType.ADDRESS);<NEW_LINE>m.put(TypeAlias.dev_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.blkcnt_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.blksize_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.gid_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.in_addr_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.in_port_t, NativeType.USHORT);<NEW_LINE>m.put(TypeAlias.ino_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.ino64_t, NativeType.ULONGLONG);<NEW_LINE>m.put(TypeAlias.key_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.mode_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.nlink_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.id_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.pid_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.off_t, NativeType.SLONGLONG);<NEW_LINE>m.put(TypeAlias.swblk_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.uid_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.clock_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.size_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.ssize_t, NativeType.SLONG);<NEW_LINE>m.put(TypeAlias.time_t, NativeType.SINT);<NEW_LINE>m.put(TypeAlias.fsblkcnt_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.fsfilcnt_t, NativeType.ULONG);<NEW_LINE>m.put(TypeAlias.sa_family_t, NativeType.UCHAR);<NEW_LINE>m.put(TypeAlias.socklen_t, NativeType.UINT);<NEW_LINE>m.put(TypeAlias.rlim_t, NativeType.ULONGLONG);<NEW_LINE>return m;<NEW_LINE>} | TypeAlias.intptr_t, NativeType.SLONG); |
1,216,685 | private MSPData parse(String source) {<NEW_LINE>Scanner sc = new Scanner(source);<NEW_LINE>mspdata = new MSPData();<NEW_LINE>mspdata.numberOfMeetings = sc.nextInt();<NEW_LINE>sc.nextLine();<NEW_LINE>mspdata.numberOfAgents = sc.nextInt();<NEW_LINE>sc.nextLine();<NEW_LINE>mspdata.numberOfMeetingPerAgent = sc.nextInt();<NEW_LINE>sc.nextLine();<NEW_LINE>mspdata.minDisTimeBetweenMeetings = sc.nextInt();<NEW_LINE>sc.nextLine();<NEW_LINE>mspdata<MASK><NEW_LINE>sc.nextLine();<NEW_LINE>mspdata.domainSize = sc.nextInt();<NEW_LINE>sc.nextLine();<NEW_LINE>mspdata.agentMeetings = new int[mspdata.numberOfAgents][mspdata.numberOfMeetingPerAgent];<NEW_LINE>for (int i = 0; i < mspdata.numberOfAgents; i++) {<NEW_LINE>Arrays.fill(mspdata.agentMeetings[i], -1);<NEW_LINE>int j = 0;<NEW_LINE>while (j < mspdata.numberOfMeetingPerAgent) {<NEW_LINE>mspdata.agentMeetings[i][j++] = sc.nextInt();<NEW_LINE>}<NEW_LINE>sc.nextLine();<NEW_LINE>}<NEW_LINE>mspdata.betweenMeetingsDistance = new int[mspdata.numberOfMeetings][mspdata.numberOfMeetings];<NEW_LINE>for (int i = 0; i < mspdata.numberOfMeetings; i++) {<NEW_LINE>for (int j = 0; j < mspdata.numberOfMeetings; j++) {<NEW_LINE>mspdata.betweenMeetingsDistance[i][j] = sc.nextInt();<NEW_LINE>}<NEW_LINE>sc.nextLine();<NEW_LINE>}<NEW_LINE>sc.close();<NEW_LINE>return mspdata;<NEW_LINE>} | .maxDisTimeBetweenMeetings = sc.nextInt(); |
1,620,627 | public static void main(String[] args) throws Exception {<NEW_LINE>String country = "", configfile = ""<MASK><NEW_LINE>if (args.length == 4) {<NEW_LINE>country = args[0];<NEW_LINE>configfile = args[1];<NEW_LINE>runtimeDataDir = args[2];<NEW_LINE>licensePlate = args[3];<NEW_LINE>} else {<NEW_LINE>System.err.println("Program requires 4 arguments: Country, Config File, runtime_data dir, and license plate image");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>Alpr alpr = new Alpr(country, configfile, runtimeDataDir);<NEW_LINE>alpr.setTopN(10);<NEW_LINE>alpr.setDefaultRegion("wa");<NEW_LINE>// Read an image into a byte array and send it to OpenALPR<NEW_LINE>Path path = Paths.get(licensePlate);<NEW_LINE>byte[] imagedata = Files.readAllBytes(path);<NEW_LINE>AlprResults results = alpr.recognize(imagedata);<NEW_LINE>System.out.println("OpenALPR Version: " + alpr.getVersion());<NEW_LINE>System.out.println("Image Size: " + results.getImgWidth() + "x" + results.getImgHeight());<NEW_LINE>System.out.println("Processing Time: " + results.getTotalProcessingTimeMs() + " ms");<NEW_LINE>System.out.println("Found " + results.getPlates().size() + " results");<NEW_LINE>System.out.format(" %-15s%-8s\n", "Plate Number", "Confidence");<NEW_LINE>for (AlprPlateResult result : results.getPlates()) {<NEW_LINE>for (AlprPlate plate : result.getTopNPlates()) {<NEW_LINE>if (plate.isMatchesTemplate())<NEW_LINE>System.out.print(" * ");<NEW_LINE>else<NEW_LINE>System.out.print(" - ");<NEW_LINE>System.out.format("%-15s%-8f\n", plate.getCharacters(), plate.getOverallConfidence());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Make sure to call this to release memory<NEW_LINE>alpr.unload();<NEW_LINE>} | , runtimeDataDir = "", licensePlate = ""; |
527,262 | public static void main(String[] args) {<NEW_LINE>System.out.println(JPA_ACLI_EYECATCHER + "Hello BasicJPAMethodInjAppClient");<NEW_LINE>System.out.<MASK><NEW_LINE>System.out.println(JPA_ACLI_EYECATCHER + "emfDD = " + emfDD);<NEW_LINE>if (emfAno == null) {<NEW_LINE>System.out.println(JPA_ACLI_FAIL_EYECATCHER + "emfAno is null.");<NEW_LINE>}<NEW_LINE>if (emfDD == null) {<NEW_LINE>System.out.println(JPA_ACLI_FAIL_EYECATCHER + "emfDD is null.");<NEW_LINE>}<NEW_LINE>if (emfAnoDDMerge == null) {<NEW_LINE>System.out.println(JPA_ACLI_FAIL_EYECATCHER + "emfDD_noRefName is null.");<NEW_LINE>}<NEW_LINE>testAnnotationInjectedEMF();<NEW_LINE>testDeploymentDescriptorInjectedEMF();<NEW_LINE>testAnnotationDeploymentDescriptorMergeInjectedMF();<NEW_LINE>System.out.println(JPA_ACLI_EYECATCHER + "BasicJPAMethodInjAppClient exiting.");<NEW_LINE>} | println(JPA_ACLI_EYECATCHER + "emfAno = " + emfAno); |
832,601 | private boolean gracefulStop(String baseUrl) {<NEW_LINE>try {<NEW_LINE>if (DoYUtil.isBlank(baseUrl)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>SimpleRestClient restClient = new SimpleRestClient();<NEW_LINE>String tail = "rest/stop";<NEW_LINE>String masterKey = config.getString(DrillOnYarnConfig.HTTP_REST_KEY);<NEW_LINE>if (!DoYUtil.isBlank(masterKey)) {<NEW_LINE>tail += "?key=" + masterKey;<NEW_LINE>}<NEW_LINE>if (opts.verbose) {<NEW_LINE>System.out.println("Stopping with POST " + baseUrl + "/" + tail);<NEW_LINE>}<NEW_LINE>String result = restClient.send(baseUrl, tail, true);<NEW_LINE>if (result.contains("\"ok\"")) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>System.err.println("Failed to stop the application master. Response = " + result);<NEW_LINE>return false;<NEW_LINE>} catch (ClientException e) {<NEW_LINE>System.err.println(e.getMessage());<NEW_LINE><MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | System.out.println("Resorting to forced kill"); |
387,452 | public void testAnnotationJavamailSessionCreated() throws Throwable {<NEW_LINE>if (jm2 != null) {<NEW_LINE>Properties props = jm2.getProperties();<NEW_LINE>System.out.println("JavamailFATServlet.testAnnotationJavamailSessionCreated properties : " + props.toString());<NEW_LINE>// Validate we got the session we expected<NEW_LINE>String <MASK><NEW_LINE>if (!("jm2test").equals(userValue)) {<NEW_LINE>throw new Exception("Did not find the user for mail session jm2 defined as an annotation");<NEW_LINE>}<NEW_LINE>String fromValue = jm2.getProperty("mail.from");<NEW_LINE>if (!("jm2From").equals(fromValue)) {<NEW_LINE>throw new Exception("Did not find the from value for mail session jm2 defined as an annotation");<NEW_LINE>}<NEW_LINE>String descValue = jm2.getProperty("description");<NEW_LINE>if (!("jm2Desc").equals(descValue)) {<NEW_LINE>throw new Exception("Did not find the description for mail session jm2 defined as an annotation");<NEW_LINE>}<NEW_LINE>String spValue = jm2.getProperty("mail.store.protocol");<NEW_LINE>if (!("jm2StoreProtocol").equals(spValue)) {<NEW_LINE>throw new Exception("Did not find the store.protocol for mail session jm2 defined as an annotation");<NEW_LINE>}<NEW_LINE>String tpValue = jm2.getProperty("mail.transport.protocol");<NEW_LINE>if (!("jm2TransportProtocol").equals(tpValue)) {<NEW_LINE>throw new Exception("Did not find the transport.protocol for mail session jm2 defined as an annotation");<NEW_LINE>}<NEW_LINE>// Vaidate the property "test" returns the value added with the annotation<NEW_LINE>String testValue = jm2.getProperty("test");<NEW_LINE>if (testValue == null || !testValue.equals("jm2Def_MailSession")) {<NEW_LINE>throw new Exception("Did not find the test property for mail session mergeMS defined as an annotation, instead found: " + testValue);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>throw new Exception("Annotated jm2 MailSession was null");<NEW_LINE>} | userValue = jm2.getProperty("mail.user"); |
35,045 | private BetaDistributionShape fitBeta(final List<int[]> altAndRefCounts) {<NEW_LINE>final int totalAltCount = altAndRefCounts.stream().mapToInt(pair -> pair[0]).sum();<NEW_LINE>final int totalRefCount = altAndRefCounts.stream().mapToInt(pair -> pair[1]).sum();<NEW_LINE>final int min = <MASK><NEW_LINE>// keeping the ratio of alpha and beta equal to the ratio of baseAlpha and baseBeta gives the empirical mean<NEW_LINE>final double baseAlpha = (totalAltCount + 1.0) / (min + 1);<NEW_LINE>final double baseBeta = (totalRefCount + 1.0) / (min + 1);<NEW_LINE>final DoubleUnaryOperator logLikelihood = s -> {<NEW_LINE>final double alpha = baseAlpha * s;<NEW_LINE>final double beta = baseBeta * s;<NEW_LINE>return altAndRefCounts.stream().mapToDouble(pair -> {<NEW_LINE>final int n = pair[0] + pair[1];<NEW_LINE>final int k = pair[0];<NEW_LINE>return new BetaBinomialDistribution(null, alpha, beta, n).logProbability(k);<NEW_LINE>}).sum();<NEW_LINE>};<NEW_LINE>final double scale = OptimizationUtils.max(logLikelihood, 0.01, 100, 1, 0.01, 0.1, 100).getPoint();<NEW_LINE>return new BetaDistributionShape(baseAlpha * scale, baseBeta * scale);<NEW_LINE>} | Math.min(totalAltCount, totalRefCount); |
840,836 | public void testSearchBase() throws Exception {<NEW_LINE>// check for valid user and group<NEW_LINE>String returnUser = servlet.checkPassword(USER_DN, "password");<NEW_LINE>assertNotNull("Should find user on checkPassword using " + USER_DN, returnUser);<NEW_LINE>assertTrue("Expected '" + USER_DN + "' to be valid user.", servlet.isValidUser(USER_DN));<NEW_LINE>List<String> groups = servlet.getGroupsForUser(USER_DN);<NEW_LINE>assertFalse("Should have found groups", groups.isEmpty());<NEW_LINE>assertTrue("Group should include " + GROUP + " returned " + groups, groups.contains(GROUP_DN));<NEW_LINE>returnUser = servlet.getUniqueUserId(USER);<NEW_LINE>assertNotNull("Should find user " + USER, returnUser);<NEW_LINE>assertEquals("Wrong unique ID returned for " + USER, USER_DN, returnUser);<NEW_LINE>// check that the bad user is excluded<NEW_LINE>returnUser = servlet.checkPassword(BAD_USER_DN, "password");<NEW_LINE>assertNull(BAD_USER + " should not be able to login", returnUser);<NEW_LINE>assertFalse(BAD_USER + " should not be a valid user"<MASK><NEW_LINE>try {<NEW_LINE>returnUser = servlet.getUniqueUserId(BAD_USER);<NEW_LINE>fail("Should not find user " + BAD_USER);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// expected<NEW_LINE>}<NEW_LINE>} | , servlet.isValidUser(BAD_USER_DN)); |
683,790 | protected void initializePluginFromInstance(final Plugin plugin, String plugin_id, String plugin_config_key) throws PluginException {<NEW_LINE>try {<NEW_LINE>final PluginInterfaceImpl plugin_interface = new PluginInterfaceImpl(plugin, this, plugin.getClass(), plugin.getClass().getClassLoader(), null, plugin_config_key, plugin.getInitialProperties(<MASK><NEW_LINE>UtilitiesImpl.callWithPluginThreadContext(plugin_interface, new UtilitiesImpl.runnableWithException<PluginException>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() throws PluginException {<NEW_LINE>fireCreated(plugin_interface);<NEW_LINE>plugin.initialize(plugin_interface);<NEW_LINE>if (!(plugin instanceof FailedPlugin)) {<NEW_LINE>plugin_interface.getPluginStateImpl().setOperational(true, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>synchronized (s_plugin_interfaces) {<NEW_LINE>s_plugins.add(plugin);<NEW_LINE>s_plugin_interfaces.add(plugin_interface);<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.printStackTrace(e);<NEW_LINE>String msg = "Error loading internal plugin '" + plugin.getClass().getName() + "'";<NEW_LINE>Logger.log(new LogAlert(LogAlert.UNREPEATABLE, msg, e));<NEW_LINE>System.out.println(msg + " : " + e);<NEW_LINE>throw (new PluginException(msg, e));<NEW_LINE>}<NEW_LINE>} | ), "", plugin_id, null); |
666,274 | public Command<MetaServerConsoleService.PreviousPrimaryDcMessage> buildPrevPrimaryDcCommand(final String cluster, final String shard, final String prevPrimaryDc) {<NEW_LINE>return new AbstractCommand<MetaServerConsoleService.PreviousPrimaryDcMessage>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String getName() {<NEW_LINE>return "PrimaryDcChange-PrevPrimary";<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void doExecute() throws Exception {<NEW_LINE>MetaServerConsoleService.PreviousPrimaryDcMessage result = null;<NEW_LINE>try {<NEW_LINE>result = metaServerConsoleServiceManagerWrapper.get(prevPrimaryDc).makeMasterReadOnly(cluster, shard, true);<NEW_LINE><MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>getLogger().error("[PrimaryDcChange][PrevPrimaryDc][Failed]{}-{}", cluster, shard, e);<NEW_LINE>future().setFailure(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void doReset() {<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | future().setSuccess(result); |
150,500 | // fast hack for making the spellchecking embedding aware, should be fixed properly<NEW_LINE>// performance: the current approach is wrong since a new token sequence is obtained<NEW_LINE>// and positioned for each search offset!<NEW_LINE>@Override<NEW_LINE>protected int[] findNextSpellSpan() throws BadLocationException {<NEW_LINE>if (ts == null || !ts.isValid() || hidden) {<NEW_LINE>return new int[] { -1, -1 };<NEW_LINE>}<NEW_LINE>ts.move(nextSearchOffset);<NEW_LINE>while (ts.moveNext()) {<NEW_LINE>TokenId id = ts<MASK><NEW_LINE>if (id == HTMLTokenId.SGML_COMMENT || id == HTMLTokenId.BLOCK_COMMENT || id == HTMLTokenId.TEXT) {<NEW_LINE>return new int[] { ts.offset(), ts.offset() + ts.token().length() };<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// we are out of the token sequence, try another one<NEW_LINE>if (tss.hasNext()) {<NEW_LINE>ts = tss.next();<NEW_LINE>return findNextSpellSpan();<NEW_LINE>}<NEW_LINE>return new int[] { -1, -1 };<NEW_LINE>} | .token().id(); |
596,000 | PaymentWebhookResult internalProcessWebhook(Transaction transaction, PaymentContext paymentContext) {<NEW_LINE>int retryCount = Integer.parseInt(transaction.getMetadata().getOrDefault(RETRY_COUNT, "0"));<NEW_LINE>var configuration = <MASK><NEW_LINE>var paymentStatus = retrievePaymentStatus(configuration, transaction.getPaymentId(), transaction.getReservationId(), retryCount);<NEW_LINE>if (paymentStatus.isEmpty()) {<NEW_LINE>LOGGER.debug("Invalidating transaction with ID {}", transaction.getId());<NEW_LINE>transactionRepository.invalidateById(transaction.getId());<NEW_LINE>ticketReservationRepository.updateValidity(transaction.getReservationId(), DateUtils.addMinutes(new Date(), configuration.get(RESERVATION_TIMEOUT).getValueAsIntOrDefault(25)));<NEW_LINE>return PaymentWebhookResult.cancelled();<NEW_LINE>}<NEW_LINE>if (paymentStatus.isSuccessful()) {<NEW_LINE>transactionRepository.update(transaction.getId(), paymentStatus.transactionId, paymentStatus.captureId, paymentStatus.timestamp, transaction.getPlatformFee(), transaction.getGatewayFee(), Transaction.Status.COMPLETE, transaction.getMetadata());<NEW_LINE>return PaymentWebhookResult.successful(new SaferpayToken(paymentStatus.captureId));<NEW_LINE>} else if (paymentStatus.isInitialized()) {<NEW_LINE>return PaymentWebhookResult.processStarted(new SaferpayToken(transaction.getPaymentId()));<NEW_LINE>}<NEW_LINE>return PaymentWebhookResult.pending();<NEW_LINE>} | loadConfiguration(paymentContext.getPurchaseContext()); |
1,586,903 | public void connect(InetSocketAddress address, int timeoutMillis) throws IOException {<NEW_LINE>try {<NEW_LINE>if (!clientMode) {<NEW_LINE>throw new IllegalStateException("Can't call connect on a Channel that isn't in clientMode");<NEW_LINE>}<NEW_LINE>checkNotNull(address, "address");<NEW_LINE>checkNotNegative(timeoutMillis, "timeoutMillis can't be negative");<NEW_LINE>// since the connect method is blocking, we need to configure blocking.<NEW_LINE>socketChannel.configureBlocking(true);<NEW_LINE>if (timeoutMillis > 0) {<NEW_LINE>socketChannel.socket().connect(address, timeoutMillis);<NEW_LINE>} else {<NEW_LINE>socketChannel.connect(address);<NEW_LINE>}<NEW_LINE>if (logger.isFinestEnabled()) {<NEW_LINE>logger.finest("Successfully connected to: " + address + <MASK><NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>IOUtil.closeResource(this);<NEW_LINE>throw e;<NEW_LINE>} catch (IOException e) {<NEW_LINE>IOUtil.closeResource(this);<NEW_LINE>IOException newEx = new IOException(e.getMessage() + " to address " + address);<NEW_LINE>newEx.setStackTrace(e.getStackTrace());<NEW_LINE>throw newEx;<NEW_LINE>}<NEW_LINE>} | " using socket " + socketChannel.socket()); |
1,678,699 | private void printDistributions(StringBuilder output, PlanNodeStats stats) {<NEW_LINE>Map<String, Double> inputAverages = stats.getOperatorInputPositionsAverages();<NEW_LINE>Map<String, Double> inputStdDevs = stats.getOperatorInputPositionsStdDevs();<NEW_LINE>Map<String, String> translatedOperatorTypes = <MASK><NEW_LINE>for (String operator : translatedOperatorTypes.keySet()) {<NEW_LINE>String translatedOperatorType = translatedOperatorTypes.get(operator);<NEW_LINE>double inputAverage = inputAverages.get(operator);<NEW_LINE>output.append(translatedOperatorType);<NEW_LINE>output.append(format(Locale.US, "Input avg.: %s rows, Input std.dev.: %s%%\n", formatDouble(inputAverage), formatDouble(100.0d * inputStdDevs.get(operator) / inputAverage)));<NEW_LINE>}<NEW_LINE>} | translateOperatorTypes(stats.getOperatorTypes()); |
1,794,816 | public RestoreSummary unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>RestoreSummary restoreSummary = new RestoreSummary();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("SourceBackupArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>restoreSummary.setSourceBackupArn(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("SourceTableArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>restoreSummary.setSourceTableArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RestoreDateTime", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>restoreSummary.setRestoreDateTime(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RestoreInProgress", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>restoreSummary.setRestoreInProgress(context.getUnmarshaller(Boolean.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 restoreSummary;<NEW_LINE>} | class).unmarshall(context)); |
1,524,406 | final DescribeDBEngineVersionsResult executeDescribeDBEngineVersions(DescribeDBEngineVersionsRequest describeDBEngineVersionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeDBEngineVersionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeDBEngineVersionsRequest> request = null;<NEW_LINE>Response<DescribeDBEngineVersionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeDBEngineVersionsRequestMarshaller().marshall(super.beforeMarshalling(describeDBEngineVersionsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "RDS");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDBEngineVersions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<DescribeDBEngineVersionsResult> responseHandler = new StaxResponseHandler<<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>} | DescribeDBEngineVersionsResult>(new DescribeDBEngineVersionsResultStaxUnmarshaller()); |
766,893 | public JavaIndexerPlugin create(final URL root, final FileObject cacheFolder) {<NEW_LINE>try {<NEW_LINE>File whiteListDir = roots2whiteListDirs.get(root);<NEW_LINE>if (whiteListDir == null) {<NEW_LINE>// First time<NEW_LINE>final FileObject whiteListFolder = FileUtil.createFolder(cacheFolder, WHITE_LIST_INDEX);<NEW_LINE>whiteListDir = FileUtil.toFile(whiteListFolder);<NEW_LINE>if (whiteListDir == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final FileObject <MASK><NEW_LINE>if (rootFo == null) {<NEW_LINE>delete(whiteListDir);<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>final WhiteListQuery.WhiteList wl = WhiteListQuery.getWhiteList(rootFo);<NEW_LINE>if (wl == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return new WhiteListIndexerPlugin(root, wl, whiteListDir);<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>Exceptions.printStackTrace(ioe);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | rootFo = URLMapper.findFileObject(root); |
1,032,813 | public void chooseIdpWarVersion(TestServer idpServer) throws Exception {<NEW_LINE>String thisMethod = "chooseIdpWarVersion";<NEW_LINE>LibertyServer theServer = idpServer.getServer();<NEW_LINE>// copy the appropriate version of the idp.war file<NEW_LINE>if (System.getProperty("java.specification.version").matches("1\\.[789]")) {<NEW_LINE>Log.info(thisClass, thisMethod, "################## Copying the 3.1.1 version of Shibbolet ##################h");<NEW_LINE>LibertyFileManager.copyFileIntoLiberty(theServer.getMachine(), theServer.getServerRoot() + "/test-apps", "idp.war", <MASK><NEW_LINE>} else {<NEW_LINE>Log.info(thisClass, thisMethod, "################## Copying the 4.1.0 version of Shibboleth ##################");<NEW_LINE>LibertyFileManager.copyFileIntoLiberty(theServer.getMachine(), theServer.getServerRoot() + "/test-apps", "idp.war", theServer.getServerRoot() + "/test-apps/idp-war-4.1.0.war");<NEW_LINE>}<NEW_LINE>} | theServer.getServerRoot() + "/test-apps/idp-war-3.3.1.war"); |
605,709 | public void associateConnection(Object connection) throws ResourceException {<NEW_LINE>logFine("In associateConnection");<NEW_LINE>checkIfValid();<NEW_LINE>if (connection == null) {<NEW_LINE>String i18nMsg = localStrings.getString("jdbc.conn_handle_null");<NEW_LINE>throw new ResourceException(i18nMsg);<NEW_LINE>}<NEW_LINE>ConnectionHolder ch = (ConnectionHolder) connection;<NEW_LINE>com.sun.gjc.spi.ManagedConnectionImpl mc = ch.getManagedConnection();<NEW_LINE>isClean = false;<NEW_LINE><MASK><NEW_LINE>ch.setActive(true);<NEW_LINE>incrementCount();<NEW_LINE>// associate the MC to the supplied logical connection similar to associating the logical connection<NEW_LINE>// with this MC and actual-connection.<NEW_LINE>myLogicalConnection = ch;<NEW_LINE>// mc will be null in case we are lazily associating<NEW_LINE>if (mc != null) {<NEW_LINE>mc.decrementCount();<NEW_LINE>}<NEW_LINE>} | ch.associateConnection(actualConnection, this); |
954,265 | private void addContact(SourceUIContact contact) {<NEW_LINE>SourceContact sourceContact = (SourceContact) contact.getDescriptor();<NEW_LINE>List<ContactDetail> details = sourceContact.getContactDetails(OperationSetPersistentPresence.class);<NEW_LINE>int detailsCount = details.size();<NEW_LINE>if (detailsCount > 1) {<NEW_LINE>JMenuItem addContactMenu = TreeContactList.createAddContactMenu((<MASK><NEW_LINE>JPopupMenu popupMenu = ((JMenu) addContactMenu).getPopupMenu();<NEW_LINE>// Add a title label.<NEW_LINE>JLabel infoLabel = new JLabel();<NEW_LINE>infoLabel.setText("<html><b>" + GuiActivator.getResources().getI18NString("service.gui.ADD_CONTACT") + "</b></html>");<NEW_LINE>popupMenu.insert(infoLabel, 0);<NEW_LINE>popupMenu.insert(new Separator(), 1);<NEW_LINE>popupMenu.setFocusable(true);<NEW_LINE>popupMenu.setInvoker(treeContactList);<NEW_LINE>Point location = new Point(addContactButton.getX(), addContactButton.getY() + addContactButton.getHeight());<NEW_LINE>SwingUtilities.convertPointToScreen(location, treeContactList);<NEW_LINE>location.y = location.y + treeContactList.getPathBounds(treeContactList.getSelectionPath()).y;<NEW_LINE>popupMenu.setLocation(location.x + 8, location.y - 8);<NEW_LINE>popupMenu.setVisible(true);<NEW_LINE>} else if (details.size() == 1) {<NEW_LINE>TreeContactList.showAddContactDialog(details.get(0), sourceContact.getDisplayName());<NEW_LINE>}<NEW_LINE>} | SourceContact) contact.getDescriptor()); |
978,205 | // if not empty - reuses most recently deleted node from freelist; otherwise allocates a new node<NEW_LINE>protected long allocateBlock(long parent, long recordRowId) {<NEW_LINE>if (freeList.size() > 0) {<NEW_LINE>long freeNode = freeList.get(freeList.size() - 1);<NEW_LINE>freeList.removeIndex(freeList.size() - 1);<NEW_LINE>setParent(freeNode, parent);<NEW_LINE>valueChain.putLong<MASK><NEW_LINE>return freeNode;<NEW_LINE>} else {<NEW_LINE>long newNode = super.allocateBlock();<NEW_LINE>setParent(newNode, parent);<NEW_LINE>long chainOffset;<NEW_LINE>if (chainFreeList.size() > 0) {<NEW_LINE>chainOffset = chainFreeList.get(chainFreeList.size() - 1);<NEW_LINE>chainFreeList.removeIndex(chainFreeList.size() - 1);<NEW_LINE>valueChain.putLong(chainOffset, recordRowId);<NEW_LINE>valueChain.putLong(chainOffset + 8, CHAIN_END);<NEW_LINE>} else {<NEW_LINE>chainOffset = appendValue(recordRowId, CHAIN_END);<NEW_LINE>}<NEW_LINE>setRef(newNode, chainOffset);<NEW_LINE>return newNode;<NEW_LINE>}<NEW_LINE>} | (refOf(freeNode), recordRowId); |
1,309,010 | public void processRows(List<Pair<Row, Collector<Row>>> rowCollectors) {<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>int currentBatchSize = rowCollectors.size();<NEW_LINE>List<List<?>> valueLists = new ArrayList<>();<NEW_LINE>for (int tfInputColId : tfInputColIds) {<NEW_LINE>List<Object> values = new ArrayList<>();<NEW_LINE>for (Pair<Row, Collector<Row>> rowCollector : rowCollectors) {<NEW_LINE>Row tfInput = rowCollector.getLeft();<NEW_LINE>values.add(tfInput.getField(tfInputColId));<NEW_LINE>}<NEW_LINE>valueLists.add(values);<NEW_LINE>}<NEW_LINE>List<List<?>> outputs = predictor.predictRows(valueLists, currentBatchSize);<NEW_LINE>Row[] predictions = IntStream.range(0, currentBatchSize).mapToObj(i -> new Row(tfOutputCols.length)).toArray(Row[]::new);<NEW_LINE>for (int k = 0; k < outputs.size(); k += 1) {<NEW_LINE>List<?> values = outputs.get(k);<NEW_LINE>for (int i = 0; i < currentBatchSize; i += 1) {<NEW_LINE>predictions[i].setField(k, values.get(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < currentBatchSize; i += 1) {<NEW_LINE>Pair<Row, Collector<Row>> rowCollector = rowCollectors.get(i);<NEW_LINE>Row output = outputColsHelper.getResultRow(rowCollector.getLeft(), predictions[i]);<NEW_LINE>rowCollector.<MASK><NEW_LINE>}<NEW_LINE>LOG.info("{} items cost {} ms.", currentBatchSize, System.currentTimeMillis() - startTime);<NEW_LINE>if (AlinkGlobalConfiguration.isPrintProcessInfo()) {<NEW_LINE>System.out.printf("%s items cost %s ms.%n", currentBatchSize, System.currentTimeMillis() - startTime);<NEW_LINE>}<NEW_LINE>} | getRight().collect(output); |
652,987 | public void run(String arg) {<NEW_LINE>ImagePlus imp = IJ.getImage();<NEW_LINE>if (imp == null)<NEW_LINE>return;<NEW_LINE>Roi roi = imp.getRoi();<NEW_LINE>if (roi == null) {<NEW_LINE>IJ.showMessage("No Roi found!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>var gui = QuPathGUI.getInstance();<NEW_LINE>var viewer = gui == null ? null : gui.getViewer();<NEW_LINE>var imageData = viewer == null ? null : viewer.getImageData();<NEW_LINE>if (gui == null) {<NEW_LINE>IJ.showMessage("No active image found in QuPath!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>var server = imageData.getServer();<NEW_LINE>double downsample = IJTools.estimateDownsampleFactor(imp, server);<NEW_LINE>var cal = imp.getCalibration();<NEW_LINE>// We always use the current viewer plane for ROIs<NEW_LINE>// This could be changed in the future<NEW_LINE>var plane = viewer.getImagePlane();<NEW_LINE>if (server.nZSlices() * server.nTimepoints() > 1) {<NEW_LINE>if (imp.getNSlices() == server.nZSlices() && imp.getNFrames() == server.nTimepoints()) {<NEW_LINE>plane = ImagePlane.getPlane(imp.getZ() - 1, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>var pathObject = IJTools.convertToAnnotation(roi, cal.xOrigin, cal.yOrigin, downsample, plane);<NEW_LINE>// PathObject pathObject = IJTools.convertToAnnotation(imp, server, roi, downsample, viewer.getImagePlane());<NEW_LINE>if (pathObject == null) {<NEW_LINE>IJ.error("Sorry, I couldn't convert " + roi + " to a valid QuPath object");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Platform.runLater(() -> {<NEW_LINE>imageData.getHierarchy().addPathObject(pathObject);<NEW_LINE>imageData.getHierarchy().getSelectionModel().setSelectedObject(pathObject);<NEW_LINE>viewer.setZPosition(pathObject.getROI().getZ());<NEW_LINE>viewer.setTPosition(pathObject.getROI().getT());<NEW_LINE>});<NEW_LINE>} | imp.getT() - 1); |
1,220,075 | final DisassociateRepositoryResult executeDisassociateRepository(DisassociateRepositoryRequest disassociateRepositoryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateRepositoryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateRepositoryRequest> request = null;<NEW_LINE>Response<DisassociateRepositoryResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateRepositoryRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateRepositoryRequest));<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, "CodeGuru Reviewer");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateRepository");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateRepositoryResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateRepositoryResultJsonUnmarshaller());<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); |
896,812 | public Object evaluate(DeferredObject[] arg0) throws HiveException {<NEW_LINE>Map hiveMap = mapInspector.getMap(arg0[0].get());<NEW_LINE>List keyValues = inspectList(keyListInspector.getList(arg0[1].get()));<NEW_LINE>// / Convert all the keys to standard keys<NEW_LINE>Map stdKeys = stdKeys(hiveMap);<NEW_LINE>Map retVal = (Map) retValInspector.create();<NEW_LINE>for (Object keyObj : keyValues) {<NEW_LINE>if (stdKeys.containsKey(keyObj)) {<NEW_LINE>Object hiveKey = stdKeys.get(keyObj);<NEW_LINE>Object hiveVal = hiveMap.get(hiveKey);<NEW_LINE>Object keyStd = ObjectInspectorUtils.copyToStandardObject(hiveKey, mapInspector.getMapKeyObjectInspector());<NEW_LINE>Object valStd = ObjectInspectorUtils.copyToStandardObject(<MASK><NEW_LINE>retVal.put(keyStd, valStd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return retVal;<NEW_LINE>} | hiveVal, mapInspector.getMapValueObjectInspector()); |
283,133 | public void onClick(DialogInterface dialog, int which) {<NEW_LINE>LinkedHashSet<String> accepted = new LinkedHashSet<String>();<NEW_LINE>for (int i = 0; i < selected.length; i++) {<NEW_LINE>if (selected[i]) {<NEW_LINE>accepted.add(array[i]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (subCategories.size() == accepted.size()) {<NEW_LINE>filter.selectSubTypesToAccept(poiCategory, null);<NEW_LINE>} else if (accepted.size() == 0) {<NEW_LINE>filter.setTypeToAccept(poiCategory, false);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>helper.editPoiFilter(filter);<NEW_LINE>ListView lv = EditPOIFilterActivity.this.getListView();<NEW_LINE>AmenityAdapter la = (AmenityAdapter) EditPOIFilterActivity.this.getListAdapter();<NEW_LINE>la.notifyDataSetChanged();<NEW_LINE>lv.setSelectionFromTop(index, top);<NEW_LINE>} | filter.selectSubTypesToAccept(poiCategory, accepted); |
911,422 | public RubyString inspect(ThreadContext context) {<NEW_LINE>int off = this.off;<NEW_LINE>int s = (dt.getHourOfDay() * 60 + dt.getMinuteOfHour()) * 60 + dt.getSecondOfMinute() - off;<NEW_LINE>long ns = (dt.getMillisOfSecond() * 1_000_000) + (subMillisNum * 1_000_000) / subMillisDen;<NEW_LINE>// e.g. #<Date: 2018-01-15 ((2458134j,0s,0n),+0s,2299161j)><NEW_LINE>ByteList str = new ByteList(54);<NEW_LINE>str.append('#').append('<');<NEW_LINE>str.append(((RubyString) getMetaClass().to_s()).getByteList());<NEW_LINE>str.append(':').append(' ');<NEW_LINE>// to_s<NEW_LINE>str.append(to_s(context).getByteList());<NEW_LINE>str.append(' ').append('(').append('(');<NEW_LINE>str.append(ConvertBytes.longToByteList(getJulianDayNumber(), 10));<NEW_LINE>str.append('j').append(',');<NEW_LINE>str.append(ConvertBytes.longToByteList(s, 10));<NEW_LINE>str.append<MASK><NEW_LINE>str.append(ConvertBytes.longToByteList(ns, 10));<NEW_LINE>str.append('n').append(')');<NEW_LINE>str.append(',');<NEW_LINE>if (off >= 0)<NEW_LINE>str.append('+');<NEW_LINE>str.append(ConvertBytes.longToByteList(off, 10));<NEW_LINE>str.append('s').append(',');<NEW_LINE>if (start == GREGORIAN) {<NEW_LINE>str.append('-').append('I').append('n').append('f');<NEW_LINE>} else if (start == JULIAN) {<NEW_LINE>str.append('I').append('n').append('f');<NEW_LINE>} else {<NEW_LINE>str.append(ConvertBytes.longToByteList(start, 10));<NEW_LINE>}<NEW_LINE>str.append('j').append(')').append('>');<NEW_LINE>return RubyString.newUsAsciiStringNoCopy(context.runtime, str);<NEW_LINE>} | ('s').append(','); |
1,059,209 | // getCM_ChatID<NEW_LINE>@Override<NEW_LINE>public void dataStatusChanged(final DataStatusEvent e) {<NEW_LINE>log.debug("dataStatusChanged: {} - {}", this, e);<NEW_LINE>final int oldCurrentRow = e.getCurrentRow();<NEW_LINE>// save it<NEW_LINE>m_DataStatusEvent = e;<NEW_LINE>// when sorted set current row to 0<NEW_LINE>final <MASK><NEW_LINE>if (msg != null && msg.equals("Sorted")) {<NEW_LINE>setCurrentRow(0, true);<NEW_LINE>}<NEW_LINE>// set current row<NEW_LINE>// setCurrentRow clear it, need to save again<NEW_LINE>m_DataStatusEvent = e;<NEW_LINE>m_DataStatusEvent.setCurrentRow(m_currentRow);<NEW_LINE>// Same row - update value<NEW_LINE>if (oldCurrentRow == m_currentRow) {<NEW_LINE>final GridField field = m_mTable.getField(e.getChangedColumn());<NEW_LINE>if (field != null) {<NEW_LINE>final Object value = m_mTable.getValueAt(m_currentRow, e.getChangedColumn());<NEW_LINE>field.setValue(value, m_mTable.isInserting());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Redistribute Info with current row info<NEW_LINE>fireDataStatusChanged(m_DataStatusEvent);<NEW_LINE>}<NEW_LINE>// reset<NEW_LINE>m_lastDataStatusEventTime = System.currentTimeMillis();<NEW_LINE>m_lastDataStatusEvent = m_DataStatusEvent;<NEW_LINE>m_DataStatusEvent = null;<NEW_LINE>// log.debug("dataStatusChanged #" + m_vo.TabNo + "- fini", e.toString());<NEW_LINE>} | String msg = m_DataStatusEvent.getAD_Message(); |
87,080 | // -------------------------------------------------------------------------<NEW_LINE>// XXX Other queries for identites and sequences<NEW_LINE>// -------------------------------------------------------------------------<NEW_LINE>@Override<NEW_LINE>public BigInteger lastID() {<NEW_LINE>switch(family()) {<NEW_LINE>case DERBY:<NEW_LINE>return fetchValue(field("identity_val_local()", BigInteger.class));<NEW_LINE>case H2:<NEW_LINE>case HSQLDB:<NEW_LINE>return fetchValue(field<MASK><NEW_LINE>case CUBRID:<NEW_LINE>case MARIADB:<NEW_LINE>case MYSQL:<NEW_LINE>return fetchValue(field("last_insert_id()", BigInteger.class));<NEW_LINE>case SQLITE:<NEW_LINE>return fetchValue(field("last_insert_rowid()", BigInteger.class));<NEW_LINE>case POSTGRES:<NEW_LINE>case YUGABYTEDB:<NEW_LINE>return fetchValue(field("lastval()", BigInteger.class));<NEW_LINE>default:<NEW_LINE>throw new SQLDialectNotSupportedException("identity functionality not supported by " + configuration().dialect());<NEW_LINE>}<NEW_LINE>} | ("identity()", BigInteger.class)); |
815,554 | void writeExternal(@Nonnull Element element) {<NEW_LINE>if (myInfos.isEmpty() && myRangeMarkers.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Info info : myInfos) {<NEW_LINE>Element e = new Element(ELEMENT_TAG);<NEW_LINE>e.setAttribute(SIGNATURE_ATT, info.signature);<NEW_LINE>if (info.expanded) {<NEW_LINE>e.setAttribute(EXPANDED_ATT<MASK><NEW_LINE>}<NEW_LINE>element.addContent(e);<NEW_LINE>}<NEW_LINE>String date = null;<NEW_LINE>for (RangeMarker marker : myRangeMarkers) {<NEW_LINE>FoldingInfo fi = marker.getUserData(FOLDING_INFO_KEY);<NEW_LINE>boolean state = fi != null && fi.expanded;<NEW_LINE>Element e = new Element(MARKER_TAG);<NEW_LINE>if (date == null) {<NEW_LINE>date = getTimeStamp();<NEW_LINE>}<NEW_LINE>if (date.isEmpty()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>e.setAttribute(DATE_ATT, date);<NEW_LINE>e.setAttribute(EXPANDED_ATT, Boolean.toString(state));<NEW_LINE>String signature = marker.getStartOffset() + ":" + marker.getEndOffset();<NEW_LINE>e.setAttribute(SIGNATURE_ATT, signature);<NEW_LINE>String placeHolderText = fi == null ? DEFAULT_PLACEHOLDER : fi.placeHolder;<NEW_LINE>e.setAttribute(PLACEHOLDER_ATT, XmlStringUtil.escapeIllegalXmlChars(placeHolderText));<NEW_LINE>element.addContent(e);<NEW_LINE>}<NEW_LINE>} | , Boolean.toString(true)); |
1,136,972 | public void marshall(Component component, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (component == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(component.getBindingProperties(), BINDINGPROPERTIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(component.getChildren(), CHILDREN_BINDING);<NEW_LINE>protocolMarshaller.marshall(component.getCollectionProperties(), COLLECTIONPROPERTIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(component.getComponentType(), COMPONENTTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(component.getCreatedAt(), CREATEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(component.getEnvironmentName(), ENVIRONMENTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(component.getEvents(), EVENTS_BINDING);<NEW_LINE>protocolMarshaller.marshall(component.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(component.getModifiedAt(), MODIFIEDAT_BINDING);<NEW_LINE>protocolMarshaller.marshall(component.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(component.getOverrides(), OVERRIDES_BINDING);<NEW_LINE>protocolMarshaller.marshall(component.getProperties(), PROPERTIES_BINDING);<NEW_LINE>protocolMarshaller.marshall(component.getSchemaVersion(), SCHEMAVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(component.getSourceId(), SOURCEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(component.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(component.getVariants(), VARIANTS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | component.getAppId(), APPID_BINDING); |
561,531 | // @formatter:on<NEW_LINE>@Redirect(method = "performCommand", at = @At(value = "INVOKE", target = "Lnet/minecraft/commands/Commands;performCommand(Lnet/minecraft/commands/CommandSourceStack;Ljava/lang/String;)I"))<NEW_LINE>private int arclight$serverCommand(Commands commands, CommandSourceStack sender, String command) {<NEW_LINE>Joiner joiner = Joiner.on(" ");<NEW_LINE>if (command.startsWith("/")) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>ServerCommandEvent event = new ServerCommandEvent(((CommandSourceBridge) sender).bridge$getBukkitSender(), command);<NEW_LINE>Bukkit.getPluginManager().callEvent(event);<NEW_LINE>if (event.isCancelled()) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>command = event.getCommand();<NEW_LINE>String[] args = command.split(" ");<NEW_LINE>String cmd = args[0];<NEW_LINE>if (cmd.startsWith("minecraft:"))<NEW_LINE>cmd = cmd.substring("minecraft:".length());<NEW_LINE>if (cmd.startsWith("bukkit:"))<NEW_LINE>cmd = cmd.substring("bukkit:".length());<NEW_LINE>if (cmd.equalsIgnoreCase("stop") || cmd.equalsIgnoreCase("kick") || cmd.equalsIgnoreCase("op") || cmd.equalsIgnoreCase("deop") || cmd.equalsIgnoreCase("ban") || cmd.equalsIgnoreCase("ban-ip") || cmd.equalsIgnoreCase("pardon") || cmd.equalsIgnoreCase("pardon-ip") || cmd.equalsIgnoreCase("reload")) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>if (((CraftServer) Bukkit.getServer()).getCommandBlockOverride(args[0])) {<NEW_LINE>args[0] = "minecraft:" + args[0];<NEW_LINE>}<NEW_LINE>return commands.performCommand(sender, joiner.join(args));<NEW_LINE>} | command = command.substring(1); |
465,881 | // Test the code path where untimed invokeAll is interrupted while it is running a task on the current thread<NEW_LINE>// after the other tasks have been successfully submitted. Once interrupted, invokeAll must immediately cancel all of<NEW_LINE>// its tasks which have not already completed and return.<NEW_LINE>@Test<NEW_LINE>public void testInvokeAllInterruptedWhileRunningTaskAfterOtherTasksSubmitted() throws Exception {<NEW_LINE>PolicyExecutor executor = provider.create("testInvokeAllInterruptedWhileRunningTaskAfterOtherTasksSubmitted").maxConcurrency(2);<NEW_LINE>CountDownLatch beginLatch = new CountDownLatch(2);<NEW_LINE>CountDownLatch blocker = new CountDownLatch(1);<NEW_LINE>long taskDurationNS = TimeUnit.MINUTES.toNanos(5);<NEW_LINE>Collection<CountDownTask> tasks = new LinkedHashSet<CountDownTask>();<NEW_LINE>tasks.add(new CountDownTask(beginLatch, blocker, taskDurationNS));<NEW_LINE>tasks.add(new CountDownTask(beginLatch, blocker, taskDurationNS));<NEW_LINE>// interrupt current thread upon seeing that both tasks have started<NEW_LINE>Future<?> interrupterFuture = testThreads.submit(new InterrupterTask(Thread.currentThread(), beginLatch, 5, TimeUnit.MINUTES));<NEW_LINE>long start = System.nanoTime();<NEW_LINE>try {<NEW_LINE>List<Future<Boolean>> futures = executor.invokeAll(tasks);<NEW_LINE>fail("invokeAll should have been interrupted. Instead: " + futures);<NEW_LINE>} catch (InterruptedException x) {<NEW_LINE>// pass<NEW_LINE>}<NEW_LINE>// confirm that invokeAll completed in a timely manner after interrupt<NEW_LINE>long duration <MASK><NEW_LINE>assertTrue(Long.toString(duration), duration < taskDurationNS);<NEW_LINE>interrupterFuture.get(TIMEOUT_NS, TimeUnit.NANOSECONDS);<NEW_LINE>List<Runnable> canceledFromQueue = executor.shutdownNow();<NEW_LINE>assertEquals(0, canceledFromQueue.size());<NEW_LINE>} | = System.nanoTime() - start; |
1,203,271 | public static void main(String[] args) throws ParseException, IOException {<NEW_LINE>Options options = new Options();<NEW_LINE>options.addOption(Option.builder("c").longOpt("command").hasArg().argName("COMMAND").desc("supported COMMAND: ingest / commit").build());<NEW_LINE>options.addOption(Option.builder("d").longOpt("dir").hasArg().argName("HDFS_PATH").desc("data directory of HDFS. e.g., hdfs://1.2.3.4:9000/build_output").build());<NEW_LINE>options.addOption(Option.builder("h").longOpt("help").desc("print this message").build());<NEW_LINE>CommandLineParser parser = new DefaultParser();<NEW_LINE>CommandLine commandLine = <MASK><NEW_LINE>String command = commandLine.getOptionValue("command");<NEW_LINE>String dir = commandLine.getOptionValue("dir");<NEW_LINE>if (commandLine.hasOption("help") || command == null) {<NEW_LINE>printHelp(options);<NEW_LINE>} else if (command.equalsIgnoreCase("ingest")) {<NEW_LINE>new IngestDataCommand(dir).run();<NEW_LINE>} else if (command.equalsIgnoreCase("commit")) {<NEW_LINE>new CommitDataCommand(dir).run();<NEW_LINE>} else {<NEW_LINE>printHelp(options);<NEW_LINE>}<NEW_LINE>} | parser.parse(options, args); |
29,682 | private void processLineEntry(final JsonToken token, final JsonLocation location, final JsonStreamContext context) {<NEW_LINE>if (!rootProcessed) {<NEW_LINE>NodeRange nodeRange = new NodeRange(location.getLineNr());<NEW_LINE>lines.put(jsonPointer, nodeRange);<NEW_LINE>rootProcessed = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (context.inRoot()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (token == JsonToken.END_ARRAY || token == JsonToken.END_OBJECT) {<NEW_LINE>lines.get(jsonPointer).endLine = location.getLineNr();<NEW_LINE>jsonPointer = JsonPointer.forPath(context.getParent(), false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (token == JsonToken.FIELD_NAME) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JsonStreamContext parentContext = context.getParent();<NEW_LINE>int lineNumber = location.getLineNr();<NEW_LINE>if (token == JsonToken.START_ARRAY || token == JsonToken.START_OBJECT) {<NEW_LINE>jsonPointer = JsonPointer.forPath(parentContext, false);<NEW_LINE>lineNumber = lineNumber <= 1 ? lineNumber : lineNumber - yamlLineNumberCorrection;<NEW_LINE>lines.put(<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final JsonPointer entryPointer = JsonPointer.forPath(context, false);<NEW_LINE>lines.put(entryPointer, new NodeRange(lineNumber, lineNumber));<NEW_LINE>} | jsonPointer, new NodeRange(lineNumber)); |
1,445,845 | public final BetweenAndStep16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> notBetween(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9, T10 t10, T11 t11, T12 t12, T13 t13, T14 t14, T15 t15, T16 t16) {<NEW_LINE>return notBetween(row(Tools.field(t1, (DataType) dataType(0)), Tools.field(t2, (DataType) dataType(1)), Tools.field(t3, (DataType) dataType(2)), Tools.field(t4, (DataType) dataType(3)), Tools.field(t5, (DataType) dataType(4)), Tools.field(t6, (DataType) dataType(5)), Tools.field(t7, (DataType) dataType(6)), Tools.field(t8, (DataType) dataType(7)), Tools.field(t9, (DataType) dataType(8)), Tools.field(t10, (DataType) dataType(9)), Tools.field(t11, (DataType) dataType(10)), Tools.field(t12, (DataType) dataType(11)), Tools.field(t13, (DataType) dataType(12)), Tools.field(t14, (DataType) dataType(13)), Tools.field(t15, (DataType) dataType(14)), Tools.field(t16, (DataType<MASK><NEW_LINE>} | ) dataType(15)))); |
692,481 | private static void unzipEntryToDir(@Nullable ProgressIndicator progress, @Nonnull final ZipEntry zipEntry, @Nonnull final File extractToDir, ZipInputStream stream, @Nullable NullableFunction<String, String> pathConvertor, @Nullable ContentProcessor contentProcessor) throws IOException {<NEW_LINE>String relativeExtractPath = createRelativeExtractPath(zipEntry);<NEW_LINE>if (pathConvertor != null) {<NEW_LINE>relativeExtractPath = pathConvertor.fun(relativeExtractPath);<NEW_LINE>if (relativeExtractPath == null) {<NEW_LINE>// should be skipped<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>File child = new File(extractToDir, relativeExtractPath);<NEW_LINE>File dir = zipEntry.isDirectory() ? child : child.getParentFile();<NEW_LINE>if (!dir.exists() && !dir.mkdirs()) {<NEW_LINE>throw new IOException("Unable to create dir: '" + dir + "'!");<NEW_LINE>}<NEW_LINE>if (zipEntry.isDirectory()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (progress != null) {<NEW_LINE>progress.<MASK><NEW_LINE>}<NEW_LINE>FileOutputStream fileOutputStream = null;<NEW_LINE>try {<NEW_LINE>if (contentProcessor == null) {<NEW_LINE>fileOutputStream = new FileOutputStream(child);<NEW_LINE>FileUtil.copy(stream, fileOutputStream);<NEW_LINE>} else {<NEW_LINE>byte[] content = contentProcessor.processContent(FileUtil.loadBytes(stream), child);<NEW_LINE>if (content != null) {<NEW_LINE>fileOutputStream = new FileOutputStream(child);<NEW_LINE>fileOutputStream.write(content);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (fileOutputStream != null) {<NEW_LINE>fileOutputStream.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.info("Extract: " + relativeExtractPath);<NEW_LINE>} | setText("Extracting " + relativeExtractPath + " ..."); |
1,752,254 | public static void main(String[] args) {<NEW_LINE>BinaryTree bt = new BinaryTree();<NEW_LINE>Node head = null;<NEW_LINE>head = bt.addNode(10, head);<NEW_LINE>head = bt.addNode(15, head);<NEW_LINE>head = bt.addNode(5, head);<NEW_LINE>head = bt.addNode(7, head);<NEW_LINE>head = <MASK><NEW_LINE>head = bt.addNode(20, head);<NEW_LINE>head = bt.addNode(-1, head);<NEW_LINE>head = bt.addNode(21, head);<NEW_LINE>head = bt.addNode(-6, head);<NEW_LINE>CousinNodes cn = new CousinNodes();<NEW_LINE>System.out.println(cn.areCousins(head, 10, 19));<NEW_LINE>System.out.println(cn.areCousins(head, 19, 7));<NEW_LINE>System.out.println(cn.areCousins(head, 19, -1));<NEW_LINE>System.out.println(cn.areCousins(head, 19, -6));<NEW_LINE>System.out.println(cn.areCousins(head, -1, 7));<NEW_LINE>System.out.println(cn.areCousins(head, 7, -1));<NEW_LINE>} | bt.addNode(19, head); |
1,067,332 | public AssociatePhoneNumbersWithVoiceConnectorGroupResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AssociatePhoneNumbersWithVoiceConnectorGroupResult associatePhoneNumbersWithVoiceConnectorGroupResult = new AssociatePhoneNumbersWithVoiceConnectorGroupResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return associatePhoneNumbersWithVoiceConnectorGroupResult;<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("PhoneNumberErrors", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>associatePhoneNumbersWithVoiceConnectorGroupResult.setPhoneNumberErrors(new ListUnmarshaller<PhoneNumberError>(PhoneNumberErrorJsonUnmarshaller.getInstance(<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return associatePhoneNumbersWithVoiceConnectorGroupResult;<NEW_LINE>} | )).unmarshall(context)); |
1,503,831 | private void saveWorkflowTask(final WorkflowProcessor processor) throws DotDataException {<NEW_LINE>WorkflowTask task = processor.getTask();<NEW_LINE>if (null == task) {<NEW_LINE>task = new WorkflowTask();<NEW_LINE>}<NEW_LINE>final Role role = roleAPI.getUserRole(processor.getUser());<NEW_LINE>if (task.isNew()) {<NEW_LINE>DotPreconditions.isTrue(UtilMethods.isSet(processor.getContentlet()) && UtilMethods.isSet(processor.getContentlet().getIdentifier()), () -> getWorkflowContentNeedsBeSaveMessage(processor.getUser()), DotWorkflowException.class);<NEW_LINE>task.setCreatedBy(role.getId());<NEW_LINE>task.setWebasset(processor.getContentlet().getIdentifier());<NEW_LINE>task.setLanguageId(processor.getContentlet().getLanguageId());<NEW_LINE>if (processor.getWorkflowMessage() != null) {<NEW_LINE>task.setDescription(processor.getWorkflowMessage());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>task.setTitle(processor.getContentlet().getTitle());<NEW_LINE>task.setModDate(new Date());<NEW_LINE>if (processor.getNextAssign() != null) {<NEW_LINE>task.setAssignedTo(processor.getNextAssign().getId());<NEW_LINE>}<NEW_LINE>task.setStatus(processor.getNextStep().getId());<NEW_LINE>saveWorkflowTaskWithoutIndexing(task, processor);<NEW_LINE>if (null == processor.getTask()) {<NEW_LINE>// when the content is new there might be the case than an action is waiting for the task in some commit listener<NEW_LINE>processor.setTask(task);<NEW_LINE>}<NEW_LINE>if (processor.getWorkflowMessage() != null) {<NEW_LINE>WorkflowComment comment = new WorkflowComment();<NEW_LINE>comment.setComment(processor.getWorkflowMessage());<NEW_LINE>comment.setWorkflowtaskId(task.getId());<NEW_LINE>comment<MASK><NEW_LINE>comment.setPostedBy(processor.getUser().getUserId());<NEW_LINE>saveComment(comment);<NEW_LINE>}<NEW_LINE>} | .setCreationDate(new Date()); |
1,524,053 | public boolean sameSearchResult(SearchResult r1, SearchResult r2) {<NEW_LINE>boolean isSameType = r1.objectType == r2.objectType;<NEW_LINE>if (isSameType) {<NEW_LINE>ObjectType type = r1.objectType;<NEW_LINE>if (type == ObjectType.INDEX_ITEM || type == ObjectType.GPX_TRACK) {<NEW_LINE>return Algorithms.objectEquals(r1.localeName, r2.localeName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (r1.location != null && r2.location != null && !ObjectType.isTopVisible(r1.objectType) && !ObjectType.isTopVisible(r2.objectType)) {<NEW_LINE>if (isSameType) {<NEW_LINE>if (r1.objectType == ObjectType.STREET) {<NEW_LINE>Street st1 = (Street) r1.object;<NEW_LINE>Street st2 = (Street) r2.object;<NEW_LINE>return st1.getLocation().equals(st2.getLocation());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Amenity a1 = null;<NEW_LINE>if (r1.object instanceof Amenity) {<NEW_LINE>a1 = (Amenity) r1.object;<NEW_LINE>}<NEW_LINE>Amenity a2 = null;<NEW_LINE>if (r2.object instanceof Amenity) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (r1.localeName.equals(r2.localeName)) {<NEW_LINE>double similarityRadius = 30;<NEW_LINE>if (a1 != null && a2 != null) {<NEW_LINE>// here 2 points are amenity<NEW_LINE>String type1 = a1.getType().getKeyName();<NEW_LINE>String type2 = a2.getType().getKeyName();<NEW_LINE>String subType1 = a1.getSubType();<NEW_LINE>String subType2 = a2.getSubType();<NEW_LINE>boolean isEqualId = a1.getId().longValue() == a2.getId().longValue();<NEW_LINE>if (isEqualId && (FILTER_DUPLICATE_POI_SUBTYPE.contains(subType1) || FILTER_DUPLICATE_POI_SUBTYPE.contains(subType2))) {<NEW_LINE>return true;<NEW_LINE>} else if (!type1.equals(type2)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (type1.equals("natural")) {<NEW_LINE>similarityRadius = 50000;<NEW_LINE>} else if (subType1.equals(subType2)) {<NEW_LINE>if (subType1.contains("cn_ref") || subType1.contains("wn_ref") || (subType1.startsWith("route_hiking_") && subType1.endsWith("n_poi"))) {<NEW_LINE>similarityRadius = 50000;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (ObjectType.isAddress(r1.objectType) && ObjectType.isAddress(r2.objectType)) {<NEW_LINE>similarityRadius = 100;<NEW_LINE>}<NEW_LINE>return MapUtils.getDistance(r1.location, r2.location) < similarityRadius;<NEW_LINE>}<NEW_LINE>} else if (r1.object != null && r2.object != null) {<NEW_LINE>return r1.object == r2.object;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | a2 = (Amenity) r2.object; |
1,512,914 | public static CompLongLongVector mergeSparseLongCompVector(LongIndexGetParam param, List<PartitionGetResult> partResults) {<NEW_LINE>Map<PartitionKey, PartitionGetResult> partKeyToResultMap = mapPartKeyToResult(partResults);<NEW_LINE>List<PartitionKey> partKeys = getSortedPartKeys(param.matrixId, param.getRowId());<NEW_LINE>MatrixMeta meta = PSAgentContext.get().getMatrixMetaManager().getMatrixMeta(param.matrixId);<NEW_LINE>long dim = meta.getColNum();<NEW_LINE>long subDim = meta.getBlockColNum();<NEW_LINE>int size = partKeys.size();<NEW_LINE>LongLongVector[] splitVecs = new LongLongVector[size];<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>if (param.getPartKeyToIndexesMap().containsKey(partKeys.get(i))) {<NEW_LINE>long[] values = ((IndexPartGetLongResult) partKeyToResultMap.get(partKeys.get(i))).getValues();<NEW_LINE>long[] indices = param.getPartKeyToIndexesMap().get(partKeys.get(i));<NEW_LINE>transformIndices(indices, partKeys.get(i));<NEW_LINE>splitVecs[i] = VFactory.sparseLongKeyLongVector(subDim, indices, values);<NEW_LINE>} else {<NEW_LINE>splitVecs[i] = <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>CompLongLongVector vector = VFactory.compLongLongVector(dim, splitVecs, subDim);<NEW_LINE>vector.setMatrixId(param.getMatrixId());<NEW_LINE>vector.setRowId(param.getRowId());<NEW_LINE>return vector;<NEW_LINE>} | VFactory.sparseLongKeyLongVector(subDim, 0); |
857,428 | private byte[] packFlags() {<NEW_LINE>byte[] bytes = new byte[2];<NEW_LINE>bytes[0] = BufferTools.setBit(bytes[0], PRESERVE_TAG_BIT, preserveTag);<NEW_LINE>bytes[0] = BufferTools.setBit(bytes[0], PRESERVE_FILE_BIT, preserveFile);<NEW_LINE>bytes[0] = BufferTools.setBit(bytes[0], READ_ONLY_BIT, readOnly);<NEW_LINE>bytes[1] = BufferTools.setBit(bytes[1], GROUP_BIT, group);<NEW_LINE>bytes[1] = BufferTools.setBit(bytes<MASK><NEW_LINE>bytes[1] = BufferTools.setBit(bytes[1], ENCRYPTION_BIT, encryption);<NEW_LINE>bytes[1] = BufferTools.setBit(bytes[1], UNSYNCHRONISATION_BIT, unsynchronisation);<NEW_LINE>bytes[1] = BufferTools.setBit(bytes[1], DATA_LENGTH_INDICATOR_BIT, dataLengthIndicator);<NEW_LINE>return bytes;<NEW_LINE>} | [1], COMPRESSION_BIT, compression); |
1,538,146 | private void justifyResult(List<GeocodingResult> res, final ResultMatcher<GeocodingResult> result) {<NEW_LINE>List<GeocodingResult> complete = new ArrayList<>();<NEW_LINE>double minBuildingDistance = 0;<NEW_LINE>if (res != null) {<NEW_LINE>List<BinaryMapIndexReader> readers = new ArrayList<>();<NEW_LINE>GeocodingUtilities utilities = new GeocodingUtilities();<NEW_LINE>for (GeocodingResult r : res) {<NEW_LINE>BinaryMapIndexReader foundRepo = null;<NEW_LINE>List<BinaryMapReaderResource> rts = usedReaders;<NEW_LINE>for (BinaryMapReaderResource rt : rts) {<NEW_LINE>if (rt.isClosed()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>BinaryMapIndexReader reader = rt.getReader(BinaryMapReaderResourceType.STREET_LOOKUP);<NEW_LINE>if (reader != null) {<NEW_LINE>for (RouteRegion rb : reader.getRoutingIndexes()) {<NEW_LINE>if (r.regionFP == rb.getFilePointer() && r.regionLen == rb.getLength()) {<NEW_LINE>foundRepo = reader;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result.isCancelled()) {<NEW_LINE>break;<NEW_LINE>} else if (foundRepo != null) {<NEW_LINE>readers.add(foundRepo);<NEW_LINE>List<GeocodingResult> justified = null;<NEW_LINE>try {<NEW_LINE>justified = utilities.justifyReverseGeocodingSearch(r, foundRepo, minBuildingDistance, result);<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("Exception happened during reverse geocoding", e);<NEW_LINE>}<NEW_LINE>if (justified != null && !justified.isEmpty()) {<NEW_LINE>double md = justified.get(0).getDistance();<NEW_LINE>if (minBuildingDistance == 0) {<NEW_LINE>minBuildingDistance = md;<NEW_LINE>} else {<NEW_LINE>minBuildingDistance = Math.min(md, minBuildingDistance);<NEW_LINE>}<NEW_LINE>complete.addAll(justified);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>complete.add(r);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>utilities.filterDuplicateRegionResults(complete);<NEW_LINE>try {<NEW_LINE>utilities.sortGeocodingResults(readers, complete);<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("Exception happened during sorting for reverse geocoding", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (result.isCancelled()) {<NEW_LINE>app.runInUIThread(() -> result.publish(null));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final GeocodingResult rts = complete.size() > 0 ? complete.get<MASK><NEW_LINE>app.runInUIThread(() -> result.publish(rts));<NEW_LINE>} | (0) : new GeocodingResult(); |
27,922 | private void notifyProcessors(List<BLangAnnotationAttachment> attachments, BiConsumer<CompilerPlugin, List<AnnotationAttachmentNode>> notifier) {<NEW_LINE>Map<CompilerPlugin, List<AnnotationAttachmentNode>> attachmentMap = new HashMap<>();<NEW_LINE>for (BLangAnnotationAttachment attachment : attachments) {<NEW_LINE>DefinitionID aID = new DefinitionID(attachment.annotationSymbol.pkgID.getName().value, attachment.annotationName.value);<NEW_LINE>if (!processorMap.containsKey(aID)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (CompilerPlugin proc : processorMap.get(aID)) {<NEW_LINE>List<AnnotationAttachmentNode> attachmentNodes = attachmentMap.computeIfAbsent(proc, k <MASK><NEW_LINE>attachmentNodes.add(attachment);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (CompilerPlugin processor : attachmentMap.keySet()) {<NEW_LINE>if (failedPlugins.contains(processor)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>List<AnnotationAttachmentNode> list = attachmentMap.get(processor);<NEW_LINE>try {<NEW_LINE>notifier.accept(processor, Collections.unmodifiableList(list));<NEW_LINE>} catch (Throwable e) {<NEW_LINE>dlog.warning(list.get(0).getPosition(), DiagnosticWarningCode.COMPILER_PLUGIN_ERROR);<NEW_LINE>printErrorLog(e);<NEW_LINE>failedPlugins.add(processor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | -> new ArrayList<>()); |
1,140,933 | Command<K, V, String> migrate(String host, int port, int db, long timeout, MigrateArgs<K> migrateArgs) {<NEW_LINE>LettuceAssert.notNull(host, "Host " + MUST_NOT_BE_NULL);<NEW_LINE>LettuceAssert.notEmpty(host, "Host " + MUST_NOT_BE_EMPTY);<NEW_LINE>LettuceAssert.notNull(migrateArgs, "migrateArgs " + MUST_NOT_BE_NULL);<NEW_LINE>CommandArgs<K, V> args = new CommandArgs<>(codec);<NEW_LINE>args.add<MASK><NEW_LINE>if (migrateArgs.keys.size() == 1) {<NEW_LINE>args.addKey(migrateArgs.keys.get(0));<NEW_LINE>} else {<NEW_LINE>args.add("");<NEW_LINE>}<NEW_LINE>args.add(db).add(timeout);<NEW_LINE>migrateArgs.build(args);<NEW_LINE>return createCommand(MIGRATE, new StatusOutput<>(codec), args);<NEW_LINE>} | (host).add(port); |
1,783,794 | static String parseFieldsInGeneralPurpose(String rawInformation) throws NotFoundException {<NEW_LINE>if (rawInformation.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Processing 2-digit AIs<NEW_LINE>if (rawInformation.length() < 2) {<NEW_LINE>throw NotFoundException.getNotFoundInstance();<NEW_LINE>}<NEW_LINE>DataLength twoDigitDataLength = TWO_DIGIT_DATA_LENGTH.get(rawInformation.substring(0, 2));<NEW_LINE>if (twoDigitDataLength != null) {<NEW_LINE>if (twoDigitDataLength.variable) {<NEW_LINE>return processVariableAI(2, twoDigitDataLength.length, rawInformation);<NEW_LINE>}<NEW_LINE>return processFixedAI(2, twoDigitDataLength.length, rawInformation);<NEW_LINE>}<NEW_LINE>if (rawInformation.length() < 3) {<NEW_LINE>throw NotFoundException.getNotFoundInstance();<NEW_LINE>}<NEW_LINE>String firstThreeDigits = rawInformation.substring(0, 3);<NEW_LINE>DataLength threeDigitDataLength = THREE_DIGIT_DATA_LENGTH.get(firstThreeDigits);<NEW_LINE>if (threeDigitDataLength != null) {<NEW_LINE>if (threeDigitDataLength.variable) {<NEW_LINE>return processVariableAI(3, threeDigitDataLength.length, rawInformation);<NEW_LINE>}<NEW_LINE>return processFixedAI(3, threeDigitDataLength.length, rawInformation);<NEW_LINE>}<NEW_LINE>if (rawInformation.length() < 4) {<NEW_LINE>throw NotFoundException.getNotFoundInstance();<NEW_LINE>}<NEW_LINE>DataLength threeDigitPlusDigitDataLength = THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH.get(firstThreeDigits);<NEW_LINE>if (threeDigitPlusDigitDataLength != null) {<NEW_LINE>if (threeDigitPlusDigitDataLength.variable) {<NEW_LINE>return processVariableAI(4, threeDigitPlusDigitDataLength.length, rawInformation);<NEW_LINE>}<NEW_LINE>return processFixedAI(4, threeDigitPlusDigitDataLength.length, rawInformation);<NEW_LINE>}<NEW_LINE>DataLength firstFourDigitLength = FOUR_DIGIT_DATA_LENGTH.get(rawInformation<MASK><NEW_LINE>if (firstFourDigitLength != null) {<NEW_LINE>if (firstFourDigitLength.variable) {<NEW_LINE>return processVariableAI(4, firstFourDigitLength.length, rawInformation);<NEW_LINE>}<NEW_LINE>return processFixedAI(4, firstFourDigitLength.length, rawInformation);<NEW_LINE>}<NEW_LINE>throw NotFoundException.getNotFoundInstance();<NEW_LINE>} | .substring(0, 4)); |
58,131 | public GeneratorEntity compile() {<NEW_LINE>GeneratorEntity entity = new GeneratorEntity(getCompiler().getContext());<NEW_LINE>entity.setReturnReference(statement.isReturnReference());<NEW_LINE>entity.setInternalName(compiler.getModule().getInternalName() + "_generator" + statement.getGeneratorId());<NEW_LINE>entity.setId(statement.getGeneratorId());<NEW_LINE>entity.setTrace(statement.toTraceInfo(compiler.getContext()));<NEW_LINE>ClassStmtToken classStmtToken = new <MASK><NEW_LINE>classStmtToken.setNamespace(NamespaceStmtToken.getDefault());<NEW_LINE>classStmtToken.setName(NameToken.valueOf(entity.getInternalName()));<NEW_LINE>classStmtToken.setExtend(ExtendsStmtToken.valueOf(Generator.class.getSimpleName()));<NEW_LINE>MethodStmtToken methodToken = new MethodStmtToken(statement);<NEW_LINE>methodToken.setClazz(classStmtToken);<NEW_LINE>methodToken.setGenerator(false);<NEW_LINE>methodToken.setReturnReference(statement.isReturnReference());<NEW_LINE>if (statement.isReturnReference()) {<NEW_LINE>methodToken.setDynamicLocal(true);<NEW_LINE>}<NEW_LINE>methodToken.setModifier(Modifier.PROTECTED);<NEW_LINE>methodToken.setName(NameToken.valueOf("_run"));<NEW_LINE>methodToken.setUses(statement.getArguments());<NEW_LINE>methodToken.setArguments(Collections.<ArgumentStmtToken>emptyList());<NEW_LINE>classStmtToken.setMethods(Arrays.asList(methodToken));<NEW_LINE>ClassStmtCompiler classStmtCompiler = new ClassStmtCompiler(this.compiler, classStmtToken);<NEW_LINE>classStmtCompiler.setSystem(true);<NEW_LINE>classStmtCompiler.setInterfaceCheck(false);<NEW_LINE>classStmtCompiler.setGeneratorEntity(entity);<NEW_LINE>classStmtCompiler.setFunctionName(statement.getFulledName());<NEW_LINE>ClassEntity clazzEntity = classStmtCompiler.compile();<NEW_LINE>entity.getMethods().putAll(clazzEntity.getMethods());<NEW_LINE>if (clazzEntity.getParent() != null)<NEW_LINE>entity.setParent(clazzEntity.getParent());<NEW_LINE>entity.setData(clazzEntity.getData());<NEW_LINE>entity.setType(ClassEntity.Type.GENERATOR);<NEW_LINE>entity.doneDeclare();<NEW_LINE>return entity;<NEW_LINE>} | ClassStmtToken(statement.getMeta()); |
600,743 | public String sendGetRequest(String url) throws ApiException {<NEW_LINE>Request request = httpClient.newRequest(address + url);<NEW_LINE>request.timeout(3, TimeUnit.SECONDS);<NEW_LINE>request.method(HttpMethod.GET);<NEW_LINE>request.header(HttpHeader.ACCEPT_ENCODING, "gzip");<NEW_LINE>logger.trace("Sending WLED GET:{}", url);<NEW_LINE>String errorReason = "";<NEW_LINE>try {<NEW_LINE>ContentResponse contentResponse = request.send();<NEW_LINE>if (contentResponse.getStatus() == 200) {<NEW_LINE>return contentResponse.getContentAsString();<NEW_LINE>} else {<NEW_LINE>errorReason = String.format("WLED request failed with %d: %s", contentResponse.getStatus(), contentResponse.getReason());<NEW_LINE>}<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>errorReason = "TimeoutException: WLED was not reachable on your network";<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>errorReason = String.format("ExecutionException: %s", e.getMessage());<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>errorReason = String.format(<MASK><NEW_LINE>}<NEW_LINE>throw new ApiException(errorReason);<NEW_LINE>} | "InterruptedException: %s", e.getMessage()); |
907,714 | public void handleAcceptedLogin() {<NEW_LINE>ServerPlayer entity = ((PlayerListBridge) this.server.getPlayerList()).bridge$canPlayerLogin(this.connection.getRemoteAddress(), this.gameProfile, (ServerLoginPacketListenerImpl) (Object) this);<NEW_LINE>if (entity == null) {<NEW_LINE>// this.disconnect(itextcomponent);<NEW_LINE>} else {<NEW_LINE>this.state = ServerLoginPacketListenerImpl.State.ACCEPTED;<NEW_LINE>if (this.server.getCompressionThreshold() >= 0 && !this.connection.isMemoryConnection()) {<NEW_LINE>this.connection.send(new ClientboundLoginCompressionPacket(this.server.getCompressionThreshold()), (p_210149_1_) -> {<NEW_LINE>this.connection.setupCompression(this.server.getCompressionThreshold(), true);<NEW_LINE>});<NEW_LINE>}<NEW_LINE>this.connection.send(new ClientboundGameProfilePacket(this.gameProfile));<NEW_LINE>ServerPlayer serverplayerentity = this.server.getPlayerList().getPlayer(<MASK><NEW_LINE>try {<NEW_LINE>if (serverplayerentity != null) {<NEW_LINE>this.state = ServerLoginPacketListenerImpl.State.DELAY_ACCEPT;<NEW_LINE>this.delayedAcceptPlayer = entity;<NEW_LINE>} else {<NEW_LINE>this.server.getPlayerList().placeNewPlayer(this.connection, entity);<NEW_LINE>}<NEW_LINE>} catch (Exception exception) {<NEW_LINE>TranslatableComponent chatmessage = new TranslatableComponent("multiplayer.disconnect.invalid_player_data");<NEW_LINE>this.connection.send(new ClientboundDisconnectPacket(chatmessage));<NEW_LINE>this.connection.disconnect(chatmessage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | this.gameProfile.getId()); |
1,511,026 | static StoredConfigKey readConfigKeyFromRequest(final PwmRequest pwmRequest) throws PwmUnrecoverableException {<NEW_LINE>final String keyStringParam = pwmRequest.readParameterAsString(ConfigEditorServlet.REQ_PARAM_KEY);<NEW_LINE>if (keyStringParam.startsWith(ConfigEditorServlet.REQ_PARAM_LOCALE_BUNDLE)) {<NEW_LINE>try {<NEW_LINE>final StringTokenizer st <MASK><NEW_LINE>st.nextToken();<NEW_LINE>final PwmLocaleBundle pwmLocaleBundle = PwmLocaleBundle.forKey(st.nextToken()).orElseThrow(() -> new IllegalArgumentException("invalid StoredConfigKey locale key"));<NEW_LINE>final String keyName = st.nextToken();<NEW_LINE>final DomainID domainID = DomainStateReader.forRequest(pwmRequest).getDomainIDForLocaleBundle();<NEW_LINE>return StoredConfigKey.forLocaleBundle(pwmLocaleBundle, keyName, domainID);<NEW_LINE>} catch (final NoSuchElementException e) {<NEW_LINE>throw new IllegalArgumentException("invalid StoredConfigKey locale key format");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final PwmSetting setting = PwmSetting.forKey(keyStringParam).orElseThrow(() -> new IllegalStateException("invalid StoredConfigKey setting key"));<NEW_LINE>final DomainID domainID = DomainStateReader.forRequest(pwmRequest).getDomainID(setting);<NEW_LINE>final String profileID = setting.getCategory().hasProfiles() ? pwmRequest.readParameterAsString(ConfigEditorServlet.REQ_PARAM_PROFILE) : null;<NEW_LINE>return StoredConfigKey.forSetting(setting, profileID, domainID);<NEW_LINE>} | = new StringTokenizer(keyStringParam, "-"); |
1,435,153 | // The tested deployment exceptions cause FFDC so we have to allow for this.<NEW_LINE>@AllowedFFDC<NEW_LINE>public void launchHealthTck() throws Exception {<NEW_LINE>String protocol = "http";<NEW_LINE>String host = server.getHostname();<NEW_LINE>String port = Integer.toString(server.getPort(PortType.WC_defaulthost));<NEW_LINE>Map<String, String> additionalProps = new HashMap<>();<NEW_LINE>additionalProps.put("test.url", protocol + "://" + host + ":" + port);<NEW_LINE>MvnUtils.runTCKMvnCmd(server, "com.ibm.ws.microprofile.health.1.0_fat_tck", this.getClass() + ":launchHealthTck", additionalProps);<NEW_LINE>Map<String, String> resultInfo = MvnUtils.getResultInfo(server);<NEW_LINE><MASK><NEW_LINE>resultInfo.put("feature_name", "Health");<NEW_LINE>resultInfo.put("feature_version", "1.0");<NEW_LINE>MvnUtils.preparePublicationFile(resultInfo);<NEW_LINE>} | resultInfo.put("results_type", "MicroProfile"); |
1,198,629 | protected void initSubreportFiller(DatasetExpressionEvaluator evaluator) throws JRException {<NEW_LINE>JasperReport jasperReport = getReport();<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Fill " + filler.fillerId + ": creating subreport filler for " + jasperReport.getName());<NEW_LINE>}<NEW_LINE>SectionTypeEnum subreportSectionType = jasperReport.getSectionType();<NEW_LINE>if (subreportSectionType != null && subreportSectionType != SectionTypeEnum.BAND) {<NEW_LINE>throw new JRRuntimeException(EXCEPTION_MESSAGE_KEY_UNSUPPORTED_SECTION_TYPE, new Object[] { subreportSectionType });<NEW_LINE>}<NEW_LINE>subFillerParent = createFillerParent(evaluator);<NEW_LINE>switch(jasperReport.getPrintOrderValue()) {<NEW_LINE>case HORIZONTAL:<NEW_LINE>{<NEW_LINE>subreportFiller = new JRHorizontalFiller(filler.getJasperReportsContext(), jasperReportSource, subFillerParent);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case VERTICAL:<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>subreportFiller = new JRVerticalFiller(filler.getJasperReportsContext(), jasperReportSource, subFillerParent);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>subreportFiller.setReorderBandElements(isReorderBandElements());<NEW_LINE>runner = getRunnerFactory().createSubreportRunner(this, subreportFiller);<NEW_LINE>subFillerParent.setSubreportRunner(runner);<NEW_LINE><MASK><NEW_LINE>subreportFiller.mainDataset.setCacheSkipped(!cacheIncluded);<NEW_LINE>} | subreportFiller.mainDataset.setFillPosition(datasetPosition); |
831,872 | private View createView() {<NEW_LINE>LinearLayout linearLayout = new LinearLayout(container.$context());<NEW_LINE>linearLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT));<NEW_LINE>linearLayout.setId(1);<NEW_LINE>linearLayout.setOrientation(LinearLayout.HORIZONTAL);<NEW_LINE>linearLayout.setPadding(15, 15, 15, 15);<NEW_LINE>TextView textView1 = new <MASK><NEW_LINE>textView1.setPadding(10, 10, 10, 10);<NEW_LINE>textView1.setGravity(Gravity.LEFT);<NEW_LINE>textView1.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1f));<NEW_LINE>textView1.setId(2);<NEW_LINE>TextView textView2 = new TextView(container.$context());<NEW_LINE>textView2.setPadding(10, 10, 10, 10);<NEW_LINE>textView2.setGravity(Gravity.RIGHT);<NEW_LINE>textView2.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT, 1f));<NEW_LINE>textView2.setId(3);<NEW_LINE>linearLayout.addView(textView1);<NEW_LINE>linearLayout.addView(textView2);<NEW_LINE>return linearLayout;<NEW_LINE>} | TextView(container.$context()); |
756,304 | private JustifiedSecStatus verifySignature(SRRset rrset, RRSIGRecord sigrec, RRset keyRrset, Instant date) {<NEW_LINE>if (!rrset.getName().subdomain(keyRrset.getName())) {<NEW_LINE>log.debug("Signer name is off-tree");<NEW_LINE>return new JustifiedSecStatus(SecurityStatus.BOGUS, ExtendedErrorCodeOption.DNSSEC_BOGUS, R.get("dnskey.key_offtree", keyRrset.getName(), rrset.getName()));<NEW_LINE>}<NEW_LINE>List<DNSKEYRecord> keys = this.findKey(keyRrset, sigrec);<NEW_LINE>if (keys.isEmpty()) {<NEW_LINE>log.trace("Could not find appropriate key");<NEW_LINE>return new JustifiedSecStatus(SecurityStatus.BOGUS, ExtendedErrorCodeOption.DNSKEY_MISSING, R.get("dnskey.no_key", sigrec.getSigner()));<NEW_LINE>}<NEW_LINE>for (DNSKEYRecord key : keys) {<NEW_LINE>try {<NEW_LINE>DNSSEC.verify(rrset, sigrec, key, date);<NEW_LINE>ValUtils.setCanonicalNsecOwner(rrset, sigrec);<NEW_LINE>return new JustifiedSecStatus(SecurityStatus.SECURE, -1, null);<NEW_LINE>} catch (KeyMismatchException kme) {<NEW_LINE>return new JustifiedSecStatus(SecurityStatus.BOGUS, ExtendedErrorCodeOption.DNSSEC_BOGUS<MASK><NEW_LINE>} catch (SignatureExpiredException e) {<NEW_LINE>return new JustifiedSecStatus(SecurityStatus.BOGUS, ExtendedErrorCodeOption.SIGNATURE_EXPIRED, R.get("dnskey.expired"));<NEW_LINE>} catch (SignatureNotYetValidException e) {<NEW_LINE>return new JustifiedSecStatus(SecurityStatus.BOGUS, ExtendedErrorCodeOption.SIGNATURE_NOT_YET_VALID, R.get("dnskey.not_yet_valid"));<NEW_LINE>} catch (DNSSECException e) {<NEW_LINE>log.error("Failed to validate RRset {}/{}", rrset.getName(), Type.string(rrset.getType()), e);<NEW_LINE>return new JustifiedSecStatus(SecurityStatus.BOGUS, ExtendedErrorCodeOption.DNSSEC_BOGUS, R.get("dnskey.invalid"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new JustifiedSecStatus(SecurityStatus.UNCHECKED, -1, null);<NEW_LINE>} | , R.get("dnskey.no_match")); |
569,797 | private static boolean _cutteeStartCutterEndEvent(int eventIndex, EditShape editShape, ArrayList<CutEvent> cutEvents, int ipartCuttee, int ivertexCuttee, int ipartCutter, int ivertexCutter, int ifirstVertexCuttee) {<NEW_LINE>Segment segmentCuttee;<NEW_LINE>Segment segmentCutter;<NEW_LINE>Line lineCuttee = new Line();<NEW_LINE>Line lineCutter = new Line();<NEW_LINE>double[] scalarsCuttee = new double[2];<NEW_LINE>double[] scalarsCutter = new double[2];<NEW_LINE>CutEvent cutEvent;<NEW_LINE>segmentCuttee = editShape.getSegment(ivertexCuttee);<NEW_LINE>if (segmentCuttee == null) {<NEW_LINE>editShape.queryLineConnector(ivertexCuttee, lineCuttee);<NEW_LINE>segmentCuttee = lineCuttee;<NEW_LINE>}<NEW_LINE>segmentCutter = editShape.getSegment(ivertexCutter);<NEW_LINE>if (segmentCutter == null) {<NEW_LINE><MASK><NEW_LINE>segmentCutter = lineCutter;<NEW_LINE>}<NEW_LINE>int count = segmentCuttee.intersect(segmentCutter, null, scalarsCuttee, scalarsCutter, 0.0);<NEW_LINE>// _ASSERT(count > 0);<NEW_LINE>int icutEvent;<NEW_LINE>if (count == 2) {<NEW_LINE>cutEvent = new CutEvent(ivertexCuttee, ipartCuttee, scalarsCuttee[0], scalarsCuttee[1], count, ivertexCutter, ipartCutter, scalarsCutter[0], scalarsCutter[1]);<NEW_LINE>cutEvents.add(cutEvent);<NEW_LINE>icutEvent = editShape.getUserIndex(ivertexCuttee, eventIndex);<NEW_LINE>if (icutEvent < 0)<NEW_LINE>editShape.setUserIndex(ivertexCuttee, eventIndex, cutEvents.size() - 1);<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>boolean bCutEvent = false;<NEW_LINE>if (ivertexCuttee == ifirstVertexCuttee) {<NEW_LINE>cutEvent = new CutEvent(ivertexCuttee, ipartCuttee, scalarsCuttee[0], NumberUtils.NaN(), count, ivertexCutter, ipartCutter, scalarsCutter[0], NumberUtils.NaN());<NEW_LINE>cutEvents.add(cutEvent);<NEW_LINE>icutEvent = editShape.getUserIndex(ivertexCuttee, eventIndex);<NEW_LINE>if (icutEvent < 0)<NEW_LINE>editShape.setUserIndex(ivertexCuttee, eventIndex, cutEvents.size() - 1);<NEW_LINE>bCutEvent = true;<NEW_LINE>}<NEW_LINE>return bCutEvent;<NEW_LINE>}<NEW_LINE>} | editShape.queryLineConnector(ivertexCutter, lineCutter); |
434,831 | public static CheckDeviceResponse unmarshall(CheckDeviceResponse checkDeviceResponse, UnmarshallerContext _ctx) {<NEW_LINE>checkDeviceResponse.setRequestId<MASK><NEW_LINE>checkDeviceResponse.setStatus(_ctx.booleanValue("CheckDeviceResponse.Status"));<NEW_LINE>checkDeviceResponse.setMsg(_ctx.stringValue("CheckDeviceResponse.Msg"));<NEW_LINE>checkDeviceResponse.setErrorCode(_ctx.stringValue("CheckDeviceResponse.ErrorCode"));<NEW_LINE>List<PlanDto> plans = new ArrayList<PlanDto>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("CheckDeviceResponse.Plans.Length"); i++) {<NEW_LINE>PlanDto planDto = new PlanDto();<NEW_LINE>planDto.setEndTime(_ctx.stringValue("CheckDeviceResponse.Plans[" + i + "].EndTime"));<NEW_LINE>planDto.setStartTime(_ctx.stringValue("CheckDeviceResponse.Plans[" + i + "].StartTime"));<NEW_LINE>planDto.setName(_ctx.stringValue("CheckDeviceResponse.Plans[" + i + "].Name"));<NEW_LINE>planDto.setId(_ctx.longValue("CheckDeviceResponse.Plans[" + i + "].Id"));<NEW_LINE>plans.add(planDto);<NEW_LINE>}<NEW_LINE>checkDeviceResponse.setPlans(plans);<NEW_LINE>return checkDeviceResponse;<NEW_LINE>} | (_ctx.stringValue("CheckDeviceResponse.RequestId")); |
155,095 | private void visitPrimaryExpression(ASTPrimaryExpression node, Object data, Set<String> sqlMapFields) throws JaxenException {<NEW_LINE>List<Node> astNames = node.findChildNodesWithXPath(PRIMARY_METHOD_NAME_XPATH);<NEW_LINE>for (Node astName : astNames) {<NEW_LINE>String methodName = astName.getImage();<NEW_LINE>// method name not match<NEW_LINE>if (!(StringUtils.isNotEmpty(methodName) && methodName.contains(IBATIS_QUERY_FOR_LIST_METHOD_NAME))) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String methodInvokeName = methodName.substring(0, methodName.indexOf(IBATIS_QUERY_FOR_LIST_METHOD_NAME));<NEW_LINE>// the method caller is empty<NEW_LINE>if (StringUtils.isEmpty(methodInvokeName)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// the method caller not matches SqlMapClient<NEW_LINE>if (!sqlMapFields.contains(methodInvokeName)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// method parameters not match<NEW_LINE>List<Node> <MASK><NEW_LINE>if (literals == null || (literals.size() != LITERALS_SIZE)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>boolean firstMethodArgumentString = "java.lang.String".equals(((ASTLiteral) (literals.get(0))).getType().getName());<NEW_LINE>boolean secondMethodArgumentInt = "int".equals(((ASTLiteral) (literals.get(1))).getType().getName());<NEW_LINE>boolean thirdMethodArgumentInt = "int".equals(((ASTLiteral) (literals.get(2))).getType().getName());<NEW_LINE>// if the parameter name and method name all matching, that is a violation of the rules<NEW_LINE>if (firstMethodArgumentString && secondMethodArgumentInt && thirdMethodArgumentInt) {<NEW_LINE>ViolationUtils.addViolationWithPrecisePosition(this, node, data, I18nResources.getMessage("java.naming.IbatisMethodQueryForListRule.violation.msg"));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | literals = node.findChildNodesWithXPath(PRIMARY_METHOD_ARGUMENT_XPATH); |
677,800 | @Consumes(MediaType.TEXT_PLAIN)<NEW_LINE>@Produces(MediaType.TEXT_PLAIN)<NEW_LINE>@Blocking<NEW_LINE>public String sendByteArrayWithPojo(@RestQuery @DefaultValue("true") Boolean withPojo) {<NEW_LINE>FileWithPojo data = new FileWithPojo();<NEW_LINE>data.file = HELLO_WORLD.getBytes(UTF_8);<NEW_LINE>data.setFileName(GREETING_TXT);<NEW_LINE>if (withPojo) {<NEW_LINE>Pojo pojo = new Pojo();<NEW_LINE>pojo.setName("some-name");<NEW_LINE>pojo.setValue("some-value");<NEW_LINE>data.setPojo(pojo);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return client.sendFileWithPojo(data);<NEW_LINE>} catch (WebApplicationException e) {<NEW_LINE>String responseAsString = e.getResponse(<MASK><NEW_LINE>return String.format("Error: %s statusCode %s", responseAsString, e.getResponse().getStatus());<NEW_LINE>}<NEW_LINE>} | ).readEntity(String.class); |
1,654,832 | private RevolutPaymentExport toRevolutExportRequest(@NonNull final I_C_PaySelectionLine line) {<NEW_LINE>final RevolutPaymentExport.RevolutPaymentExportBuilder revolutPaymentExportBuilder = RevolutPaymentExport.builder();<NEW_LINE>final I_C_Invoice invoice = invoiceDAO.getByIdInTrx(InvoiceId.ofRepoId(line.getC_Invoice_ID()));<NEW_LINE>final BPartnerId bPartnerId = BPartnerId.ofRepoId(invoice.getC_BPartner_ID());<NEW_LINE>final I_C_BPartner bPartner = bpartnerBL.getById(bPartnerId);<NEW_LINE>revolutPaymentExportBuilder.name(bPartner.getName());<NEW_LINE>revolutPaymentExportBuilder.recipientType(bPartner.isCompany() ? RecipientType.COMPANY : RecipientType.INDIVIDUAL);<NEW_LINE>final BPartnerLocationId bPartnerLocationId = BPartnerLocationId.ofRepoId(bPartnerId, invoice.getC_BPartner_Location_ID());<NEW_LINE>final I_C_BPartner_Location bPartnerLocation = Optional.ofNullable(bpartnerDAO.getBPartnerLocationByIdInTrx(bPartnerLocationId)).orElseThrow(() -> new AdempiereException("No bPartnerLocation found for bPartnerLocationId").appendParametersToMessage().setParameter("bPartnerLocationId", bPartnerLocationId));<NEW_LINE>final I_C_Location location = locationDAO.getById(LocationId.ofRepoId(bPartnerLocation.getC_Location_ID()));<NEW_LINE>attachLocation(revolutPaymentExportBuilder, location);<NEW_LINE>final BankAccountId bankAccountId = BankAccountId.ofRepoIdOrNull((line.getC_BP_BankAccount_ID()));<NEW_LINE>if (bankAccountId == null) {<NEW_LINE>throw new AdempiereException("Bank account missing from paySelectionLine").appendParametersToMessage().setParameter("paySelectionLineId", line.getC_PaySelectionLine_ID());<NEW_LINE>}<NEW_LINE>final BankAccount bpBankAccount = Optional.ofNullable(bpBankAccountDAO.getById(bankAccountId)).orElseThrow(() -> new AdempiereException("No bankAccount found for id").appendParametersToMessage()<MASK><NEW_LINE>if (bpBankAccount.getBankId() != null) {<NEW_LINE>final Bank bank = bankRepository.getById(bpBankAccount.getBankId());<NEW_LINE>if (bank.getLocationId() != null) {<NEW_LINE>final CountryId countryId = locationDAO.getCountryIdByLocationId(bank.getLocationId());<NEW_LINE>revolutPaymentExportBuilder.recipientBankCountryId(countryId);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final CurrencyCode currencyCode = currencyDAO.getCurrencyCodeById(bpBankAccount.getCurrencyId());<NEW_LINE>final Amount amount = Amount.of(line.getPayAmt(), currencyCode);<NEW_LINE>final TableRecordReference recordRef = TableRecordReference.of(I_C_PaySelectionLine.Table_Name, line.getC_PaySelection_ID());<NEW_LINE>return revolutPaymentExportBuilder.recordReference(recordRef).orgId(OrgId.ofRepoId(line.getAD_Org_ID())).amount(amount).paymentReference(line.getReference()).accountNo(bpBankAccount.getAccountNo()).routingNo(bpBankAccount.getRoutingNo()).IBAN(bpBankAccount.getIBAN()).BIC(bpBankAccount.getRoutingNo()).build();<NEW_LINE>} | .setParameter("bankAccountId", bankAccountId)); |
575,348 | protected static void saveIntrinsics(JComponent owner, File directory, Object calibration) {<NEW_LINE>boolean mono = calibration instanceof CameraModel;<NEW_LINE>var chooser = new JFileChooser();<NEW_LINE>chooser.addChoosableFileFilter(new FileNameExtensionFilter<MASK><NEW_LINE>chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);<NEW_LINE>chooser.setSelectedFile(new File(directory, mono ? INTRINSICS : "stereo.yaml"));<NEW_LINE>int returnVal = chooser.showSaveDialog(owner);<NEW_LINE>if (returnVal != JFileChooser.APPROVE_OPTION) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (mono) {<NEW_LINE>CalibrationIO.save((CameraModel) calibration, chooser.getSelectedFile());<NEW_LINE>} else {<NEW_LINE>CalibrationIO.save((StereoParameters) calibration, chooser.getSelectedFile());<NEW_LINE>}<NEW_LINE>} catch (RuntimeException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>BoofSwingUtil.warningDialog(owner, e);<NEW_LINE>}<NEW_LINE>} | ("yaml", "yaml", "yml")); |
1,386,492 | private static FeatureManager findFeatureManagerInClassLoader(ClassLoader classLoader) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("No cached FeatureManager for class loader: " + classLoader);<NEW_LINE>}<NEW_LINE>// build a sorted list of all SPI implementations<NEW_LINE>Iterator<FeatureManagerProvider> providerIterator = ServiceLoader.load(FeatureManagerProvider.class).iterator();<NEW_LINE>List<FeatureManagerProvider> providerList = new ArrayList<>();<NEW_LINE>while (providerIterator.hasNext()) {<NEW_LINE>providerList.<MASK><NEW_LINE>}<NEW_LINE>providerList.sort(new Weighted.WeightedComparator());<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Found " + providerList.size() + " FeatureManagerProvider implementations...");<NEW_LINE>}<NEW_LINE>FeatureManager featureManager = null;<NEW_LINE>// try providers one by one to find a FeatureManager<NEW_LINE>for (FeatureManagerProvider provider : providerList) {<NEW_LINE>// call the SPI<NEW_LINE>featureManager = provider.getFeatureManager();<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>if (featureManager != null) {<NEW_LINE>log.debug("Provider " + provider.getClass().getName() + " returned FeatureManager: " + featureManager.getName());<NEW_LINE>} else {<NEW_LINE>log.debug("No FeatureManager provided by " + provider.getClass().getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// accept the first FeatureManager found<NEW_LINE>if (featureManager != null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return featureManager;<NEW_LINE>} | add(providerIterator.next()); |
1,032,284 | public void trigger(CommandContext commandContext, PlanItemInstanceEntity planItemInstanceEntity) {<NEW_LINE>EventInstance eventInstance = (EventInstance) planItemInstanceEntity.getTransientVariable(EventConstants.EVENT_INSTANCE);<NEW_LINE>if (eventInstance != null) {<NEW_LINE>handleEventInstance(planItemInstanceEntity, eventInstance);<NEW_LINE>}<NEW_LINE>RepetitionRule repetitionRule = ExpressionUtil.getRepetitionRule(planItemInstanceEntity);<NEW_LINE>if (repetitionRule != null && ExpressionUtil.evaluateRepetitionRule(commandContext, planItemInstanceEntity, planItemInstanceEntity.getStagePlanItemInstanceEntity())) {<NEW_LINE>PlanItemInstanceEntity eventPlanItemInstanceEntity = PlanItemInstanceUtil.copyAndInsertPlanItemInstance(commandContext, planItemInstanceEntity, false, false);<NEW_LINE><MASK><NEW_LINE>CmmnEngineAgenda agenda = CommandContextUtil.getAgenda(commandContext);<NEW_LINE>agenda.planCreatePlanItemInstanceWithoutEvaluationOperation(eventPlanItemInstanceEntity);<NEW_LINE>agenda.planOccurPlanItemInstanceOperation(eventPlanItemInstanceEntity);<NEW_LINE>CommandContextUtil.getCmmnEngineConfiguration(commandContext).getListenerNotificationHelper().executeLifecycleListeners(commandContext, planItemInstanceEntity, null, PlanItemInstanceState.AVAILABLE);<NEW_LINE>} else {<NEW_LINE>CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext);<NEW_LINE>EventSubscriptionService eventSubscriptionService = cmmnEngineConfiguration.getEventSubscriptionServiceConfiguration().getEventSubscriptionService();<NEW_LINE>String eventDefinitionKey = resolveEventDefinitionKey(planItemInstanceEntity);<NEW_LINE>List<EventSubscriptionEntity> eventSubscriptions = eventSubscriptionService.findEventSubscriptionsBySubScopeId(planItemInstanceEntity.getId());<NEW_LINE>for (EventSubscriptionEntity eventSubscription : eventSubscriptions) {<NEW_LINE>if (Objects.equals(eventDefinitionKey, eventSubscription.getEventType())) {<NEW_LINE>eventSubscriptionService.deleteEventSubscription(eventSubscription);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CommandContextUtil.getAgenda(commandContext).planOccurPlanItemInstanceOperation(planItemInstanceEntity);<NEW_LINE>}<NEW_LINE>} | eventPlanItemInstanceEntity.setState(PlanItemInstanceState.AVAILABLE); |
799,729 | public void onNext(T t) {<NEW_LINE>if (!gate) {<NEW_LINE>gate = true;<NEW_LINE>if (wip == 0 && WIP.compareAndSet(this, 0, 1)) {<NEW_LINE>actual.onNext(t);<NEW_LINE>if (WIP.decrementAndGet(this) != 0) {<NEW_LINE>handleTermination();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Publisher<U> p;<NEW_LINE>try {<NEW_LINE>p = Objects.requireNonNull(throttler.apply(t), "The throttler returned a null publisher");<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Operators.terminate(S, this);<NEW_LINE>error(Operators.onOperatorError(null, e, t, ctx));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SampleFirstOther<U> other <MASK><NEW_LINE>if (Operators.replace(OTHER, this, other)) {<NEW_LINE>p.subscribe(other);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>Operators.onDiscard(t, ctx);<NEW_LINE>}<NEW_LINE>} | = new SampleFirstOther<>(this); |
1,133,820 | public static void peekChatAsync(final String net, final String key, final Runnable done) {<NEW_LINE>boolean async = false;<NEW_LINE>try {<NEW_LINE>if (isBetaChatAvailable()) {<NEW_LINE>if (net != AENetworkClassifier.AT_PUBLIC && !isBetaChatAnonAvailable()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (peek_dispatcher.getQueueSize() > 200) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>peek_dispatcher.dispatch(new AERunnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void runSupport() {<NEW_LINE>try {<NEW_LINE>Map<String, Object> peek_data = <MASK><NEW_LINE>if (peek_data != null) {<NEW_LINE>Number message_count = (Number) peek_data.get("m");<NEW_LINE>Number node_count = (Number) peek_data.get("n");<NEW_LINE>if (message_count != null && node_count != null) {<NEW_LINE>if (message_count.intValue() > 0) {<NEW_LINE>BuddyPluginBeta.ChatInstance chat = BuddyPluginUtils.getChat(net, key);<NEW_LINE>if (chat != null) {<NEW_LINE>chat.setAutoNotify(true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>done.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>async = true;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>if (!async) {<NEW_LINE>done.run();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | BuddyPluginUtils.peekChat(net, key); |
1,826,045 | public boolean isKnownPackage(String qualifiedPackageName) {<NEW_LINE>if (this.knownPackageNames == null) {<NEW_LINE>LinkedHashSet<String> names = new LinkedHashSet<>(this.typeLocators.size());<NEW_LINE>Set<Entry<String, String>> keyTable = this.typeLocators.entrySet();<NEW_LINE>for (Entry<String, String> entry : keyTable) {<NEW_LINE>// is a type name of the form p1/p2/A<NEW_LINE>String packageName = entry.getKey();<NEW_LINE>int last = packageName.lastIndexOf('/');<NEW_LINE>packageName = last == -1 ? null : packageName.substring(0, last);<NEW_LINE>while (packageName != null && !names.contains(packageName)) {<NEW_LINE>names.add(packageName);<NEW_LINE>last = packageName.lastIndexOf('/');<NEW_LINE>packageName = last == -1 ? null : packageName.substring(0, last);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.knownPackageNames = new String[names.size()];<NEW_LINE>names.toArray(this.knownPackageNames);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>int result = Arrays.binarySearch(this.knownPackageNames, qualifiedPackageName);<NEW_LINE>return result >= 0;<NEW_LINE>} | Arrays.sort(this.knownPackageNames); |
1,317,073 | public final ChangeReplicationFilterContext changeReplicationFilter() throws RecognitionException {<NEW_LINE>ChangeReplicationFilterContext _localctx = new ChangeReplicationFilterContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 288, RULE_changeReplicationFilter);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(3822);<NEW_LINE>match(CHANGE);<NEW_LINE>setState(3823);<NEW_LINE>match(REPLICATION);<NEW_LINE>setState(3824);<NEW_LINE>match(FILTER);<NEW_LINE>setState(3825);<NEW_LINE>replicationFilter();<NEW_LINE>setState(3830);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>while (_la == COMMA) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(3826);<NEW_LINE>match(COMMA);<NEW_LINE>setState(3827);<NEW_LINE>replicationFilter();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(3832);<NEW_LINE>_errHandler.sync(this);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | _la = _input.LA(1); |
1,030,292 | public void planarToUVInterleaved(Pointer frame, int pitch) {<NEW_LINE>if (pitch == 0) {<NEW_LINE>pitch = this.width;<NEW_LINE>}<NEW_LINE>Pointer puv = frame.getPointer((long) pitch * this.height);<NEW_LINE>if (pitch == this.width) {<NEW_LINE>memcpy(this.quad, puv, ((long) this.width * this.height / 4) * this.byteDepth);<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < this.height / 2; i++) {<NEW_LINE>memcpy(this.quad.getPointer(((long) this.width / 2 * i) * this.byteDepth), puv.getPointer(((long) pitch / 2 * i) * this.byteDepth), (long) this.width / 2 * this.byteDepth);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Pointer pv = puv.getPointer(((long) (pitch / 2) * (height / <MASK><NEW_LINE>for (int y = 0; y < this.height / 2; y++) {<NEW_LINE>for (int x = 0; x < this.width / 2; x++) {<NEW_LINE>memcpy(pv.getPointer(((long) y * pitch + x * 2) * this.byteDepth), this.quad.getPointer(((long) y * this.width / 2 + x) * this.byteDepth), this.byteDepth);<NEW_LINE>memcpy(pv.getPointer(((long) y * pitch + x * 2 + 1) * this.byteDepth), this.quad.getPointer(((long) y * pitch / 2 + x) * this.byteDepth), this.byteDepth);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | 2) * this.byteDepth)); |
939,563 | protected void evaluateDecisionTable(DmnDecisionTableImpl decisionTable, VariableContext variableContext, DmnDecisionTableEvaluationEventImpl evaluationResult) {<NEW_LINE>int inputSize = decisionTable.getInputs().size();<NEW_LINE>List<DmnDecisionTableRuleImpl> matchingRules = new ArrayList<DmnDecisionTableRuleImpl>(decisionTable.getRules());<NEW_LINE>for (int inputIdx = 0; inputIdx < inputSize; inputIdx++) {<NEW_LINE>// evaluate input<NEW_LINE>DmnDecisionTableInputImpl input = decisionTable.getInputs().get(inputIdx);<NEW_LINE>DmnEvaluatedInput <MASK><NEW_LINE>evaluationResult.getInputs().add(evaluatedInput);<NEW_LINE>// compose local variable context out of global variable context enhanced with the value of the current input.<NEW_LINE>VariableContext localVariableContext = getLocalVariableContext(input, evaluatedInput, variableContext);<NEW_LINE>// filter rules applicable with this input<NEW_LINE>matchingRules = evaluateInputForAvailableRules(inputIdx, input, matchingRules, localVariableContext);<NEW_LINE>}<NEW_LINE>setEvaluationOutput(decisionTable, matchingRules, variableContext, evaluationResult);<NEW_LINE>} | evaluatedInput = evaluateInput(input, variableContext); |
1,746,452 | public void parameterChanged(String parameterName) {<NEW_LINE>boolean <MASK><NEW_LINE>if (doRateGraphs) {<NEW_LINE>if (imgRec == null || imgRec.isDisposed()) {<NEW_LINE>imgRec = new Image(display, 100, 20);<NEW_LINE>GC gc = new GC(imgRec);<NEW_LINE>gc.setBackground(statusDown.getBackground());<NEW_LINE>gc.fillRectangle(0, 0, 100, 20);<NEW_LINE>gc.dispose();<NEW_LINE>statusDown.setBackgroundImage(imgRec);<NEW_LINE>}<NEW_LINE>if (imgSent == null || imgSent.isDisposed()) {<NEW_LINE>imgSent = new Image(display, 100, 20);<NEW_LINE>GC gc = new GC(imgSent);<NEW_LINE>gc.setBackground(statusUp.getBackground());<NEW_LINE>gc.fillRectangle(0, 0, 100, 20);<NEW_LINE>gc.dispose();<NEW_LINE>statusUp.setBackgroundImage(imgSent);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>statusUp.setBackgroundImage(null);<NEW_LINE>statusDown.setBackgroundImage(null);<NEW_LINE>Utils.disposeSWTObjects(imgRec, imgSent);<NEW_LINE>imgRec = imgSent = null;<NEW_LINE>}<NEW_LINE>} | doRateGraphs = COConfigurationManager.getBooleanParameter("status.rategraphs"); |
463,381 | public // hbase_rest("http://example. com:8000/table/scanner/","POST/GET/PUT/DELETE","UTF-8","xml or json","Accept: text/xml","Content-Type: text/xml")<NEW_LINE>Object calculate(Context ctx) {<NEW_LINE>m_ctx = ctx;<NEW_LINE>IParam param = this.param;<NEW_LINE>try {<NEW_LINE>if (param.getType() == ';') {<NEW_LINE>ArrayList<Expression> list1 = new ArrayList<Expression>();<NEW_LINE>ArrayList<Expression> list2 = new ArrayList<Expression>();<NEW_LINE>param.getSub(0).getAllLeafExpression(list1);<NEW_LINE>param.getSub(1).getAllLeafExpression(list2);<NEW_LINE>IParam param0 = param.getSub(0);<NEW_LINE>IParam param00 = param0.getSub(0);<NEW_LINE>if (param00.isLeaf()) {<NEW_LINE>url = param00.getLeafExpression().calculate(ctx).toString();<NEW_LINE>} else {<NEW_LINE>url = param00.getSub(0).getLeafExpression().calculate(ctx).toString();<NEW_LINE>charset = param00.getSub(1).getLeafExpression().calculate(ctx).toString();<NEW_LINE>}<NEW_LINE>method = param0.getSub(1).getLeafExpression().calculate(ctx).toString();<NEW_LINE>if (param0.getSubSize() > 2)<NEW_LINE>content = param0.getSub(2).getLeafExpression().calculate(ctx).toString();<NEW_LINE>IParam param1 = param.getSub(1);<NEW_LINE>if (param1.isLeaf()) {<NEW_LINE>headers.add(param1.getLeafExpression().calculate(ctx).toString());<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < param1.getSubSize(); i++) headers.add(param1.getSub(i).getLeafExpression().calculate(ctx).toString());<NEW_LINE>}<NEW_LINE>} else if (param.getType() == ',') {<NEW_LINE>IParam param00 = param.getSub(0);<NEW_LINE>if (param00.isLeaf()) {<NEW_LINE>url = param00.getLeafExpression().calculate(ctx).toString();<NEW_LINE>} else {<NEW_LINE>url = param00.getSub(0).getLeafExpression().calculate(ctx).toString();<NEW_LINE>charset = param00.getSub(1).getLeafExpression().calculate(ctx).toString();<NEW_LINE>}<NEW_LINE>method = param.getSub(1).getLeafExpression().calculate(ctx).toString();<NEW_LINE>if (param.getSubSize() > 2)<NEW_LINE>content = param.getSub(2).getLeafExpression().calculate(ctx).toString();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("influx rest param error" + mm.getMessage(Integer.toString(<MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>return downLoadFromUrl(url, charset, method, content, headers);<NEW_LINE>} catch (IOException e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | param.getSubSize()))); |
1,082,779 | public void onPushPromiseRead(ChannelHandlerContext ctx, int streamId, int promisedStreamId, Http2Headers headers, int padding) throws Http2Exception {<NEW_LINE>// A push promise should not be allowed to add headers to an existing stream<NEW_LINE>Http2Stream promisedStream = connection.stream(promisedStreamId);<NEW_LINE>if (headers.status() == null) {<NEW_LINE>// A PUSH_PROMISE frame has no Http response status.<NEW_LINE>// https://tools.ietf.org/html/rfc7540#section-8.2.1<NEW_LINE>// Server push is semantically equivalent to a server responding to a<NEW_LINE>// request; however, in this case, that request is also sent by the<NEW_LINE>// server, as a PUSH_PROMISE frame.<NEW_LINE>headers.status(OK.codeAsText());<NEW_LINE>}<NEW_LINE>FullHttpMessage msg = processHeadersBegin(ctx, promisedStream, headers, false, false, false);<NEW_LINE>if (msg == null) {<NEW_LINE>throw <MASK><NEW_LINE>}<NEW_LINE>msg.headers().setInt(HttpConversionUtil.ExtensionHeaderNames.STREAM_PROMISE_ID.text(), streamId);<NEW_LINE>msg.headers().setShort(HttpConversionUtil.ExtensionHeaderNames.STREAM_WEIGHT.text(), Http2CodecUtil.DEFAULT_PRIORITY_WEIGHT);<NEW_LINE>processHeadersEnd(ctx, promisedStream, msg, false);<NEW_LINE>} | connectionError(PROTOCOL_ERROR, "Push Promise Frame received for pre-existing stream id %d", promisedStreamId); |
1,516,236 | public void removeEdges(EdgeLabel edgeLabel) {<NEW_LINE>if (this.hasUpdate()) {<NEW_LINE>throw new HugeException("There are still changes to commit");<NEW_LINE>}<NEW_LINE>boolean autoCommit = this.autoCommit();<NEW_LINE>this.autoCommit(false);<NEW_LINE>// Commit data already in tx firstly<NEW_LINE>this.commit();<NEW_LINE>try {<NEW_LINE>if (this.store().features().supportsDeleteEdgeByLabel()) {<NEW_LINE>// TODO: Need to change to writeQuery!<NEW_LINE>this.doRemove(this.serializer.writeId(HugeType.EDGE_OUT, edgeLabel.id()));<NEW_LINE>this.doRemove(this.serializer.writeId(HugeType.EDGE_IN<MASK><NEW_LINE>} else {<NEW_LINE>this.traverseEdgesByLabel(edgeLabel, edge -> {<NEW_LINE>this.removeEdge((HugeEdge) edge);<NEW_LINE>this.commitIfGtSize(COMMIT_BATCH);<NEW_LINE>}, true);<NEW_LINE>}<NEW_LINE>this.commit();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Failed to remove edges", e);<NEW_LINE>throw new HugeException("Failed to remove edges", e);<NEW_LINE>} finally {<NEW_LINE>this.autoCommit(autoCommit);<NEW_LINE>}<NEW_LINE>} | , edgeLabel.id())); |
1,780,134 | protected void onSizeChanged(int w, int h, int oldw, int oldh) {<NEW_LINE>hasSize = true;<NEW_LINE>if (waitingDocumentConfigurator != null) {<NEW_LINE>waitingDocumentConfigurator.load();<NEW_LINE>}<NEW_LINE>if (isInEditMode() || state != State.SHOWN) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// calculates the position of the point which in the center of view relative to big strip<NEW_LINE>float <MASK><NEW_LINE>float centerPointInStripYOffset = -currentYOffset + oldh * 0.5f;<NEW_LINE>float relativeCenterPointInStripXOffset;<NEW_LINE>float relativeCenterPointInStripYOffset;<NEW_LINE>if (swipeVertical) {<NEW_LINE>relativeCenterPointInStripXOffset = centerPointInStripXOffset / pdfFile.getMaxPageWidth();<NEW_LINE>relativeCenterPointInStripYOffset = centerPointInStripYOffset / pdfFile.getDocLen(zoom);<NEW_LINE>} else {<NEW_LINE>relativeCenterPointInStripXOffset = centerPointInStripXOffset / pdfFile.getDocLen(zoom);<NEW_LINE>relativeCenterPointInStripYOffset = centerPointInStripYOffset / pdfFile.getMaxPageHeight();<NEW_LINE>}<NEW_LINE>animationManager.stopAll();<NEW_LINE>pdfFile.recalculatePageSizes(new Size(w, h));<NEW_LINE>if (swipeVertical) {<NEW_LINE>currentXOffset = -relativeCenterPointInStripXOffset * pdfFile.getMaxPageWidth() + w * 0.5f;<NEW_LINE>currentYOffset = -relativeCenterPointInStripYOffset * pdfFile.getDocLen(zoom) + h * 0.5f;<NEW_LINE>} else {<NEW_LINE>currentXOffset = -relativeCenterPointInStripXOffset * pdfFile.getDocLen(zoom) + w * 0.5f;<NEW_LINE>currentYOffset = -relativeCenterPointInStripYOffset * pdfFile.getMaxPageHeight() + h * 0.5f;<NEW_LINE>}<NEW_LINE>moveTo(currentXOffset, currentYOffset);<NEW_LINE>loadPageByOffset();<NEW_LINE>} | centerPointInStripXOffset = -currentXOffset + oldw * 0.5f; |
1,093,559 | public void encode(FriendlyByteBuf buffer) {<NEW_LINE>buffer.writeBoolean(isUpdate);<NEW_LINE>if (isUpdate) {<NEW_LINE>buffer.writeUUID(playerUUID);<NEW_LINE>buffer.writeUtf(playerUsername);<NEW_LINE>BasePacketHandler.writeOptional(buffer, securityData, (buf, data) -> data.write(buf));<NEW_LINE>} else {<NEW_LINE>List<SecurityFrequency> frequencies = new ArrayList<>(FrequencyType.SECURITY.getManager(null).getFrequencies());<NEW_LINE>// In theory no owner should be null but handle the case anyway just in case<NEW_LINE>frequencies.removeIf(frequency -> <MASK><NEW_LINE>buffer.writeCollection(frequencies, (buf, frequency) -> {<NEW_LINE>UUID owner = frequency.getOwner();<NEW_LINE>// We remove all null cases above<NEW_LINE>buf.writeUUID(owner);<NEW_LINE>new SecurityData(frequency).write(buf);<NEW_LINE>buf.writeUtf(MekanismUtils.getLastKnownUsername(owner));<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | frequency.getOwner() == null); |
170,441 | public static DescribeDcdnIpaServiceResponse unmarshall(DescribeDcdnIpaServiceResponse describeDcdnIpaServiceResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeDcdnIpaServiceResponse.setRequestId(_ctx.stringValue("DescribeDcdnIpaServiceResponse.RequestId"));<NEW_LINE>describeDcdnIpaServiceResponse.setInstanceId<MASK><NEW_LINE>describeDcdnIpaServiceResponse.setInternetChargeType(_ctx.stringValue("DescribeDcdnIpaServiceResponse.InternetChargeType"));<NEW_LINE>describeDcdnIpaServiceResponse.setOpeningTime(_ctx.stringValue("DescribeDcdnIpaServiceResponse.OpeningTime"));<NEW_LINE>describeDcdnIpaServiceResponse.setChangingChargeType(_ctx.stringValue("DescribeDcdnIpaServiceResponse.ChangingChargeType"));<NEW_LINE>describeDcdnIpaServiceResponse.setChangingAffectTime(_ctx.stringValue("DescribeDcdnIpaServiceResponse.ChangingAffectTime"));<NEW_LINE>List<LockReason> operationLocks = new ArrayList<LockReason>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeDcdnIpaServiceResponse.OperationLocks.Length"); i++) {<NEW_LINE>LockReason lockReason = new LockReason();<NEW_LINE>lockReason.setLockReason(_ctx.stringValue("DescribeDcdnIpaServiceResponse.OperationLocks[" + i + "].LockReason"));<NEW_LINE>operationLocks.add(lockReason);<NEW_LINE>}<NEW_LINE>describeDcdnIpaServiceResponse.setOperationLocks(operationLocks);<NEW_LINE>return describeDcdnIpaServiceResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeDcdnIpaServiceResponse.InstanceId")); |
228,254 | private static InetSocketAddress createInetSocketAddress(String address) throws UnknownHostException {<NEW_LINE>final char firstChar = address.charAt(0);<NEW_LINE>if (firstChar == '_' || (firstChar == 'u' && "unknown".equals(address))) {<NEW_LINE>// To early return when the address is not an IP address.<NEW_LINE>// - an obfuscated identifier which must start with '_'<NEW_LINE>// - https://datatracker.ietf.org/doc/html/rfc7239#section-6.3<NEW_LINE>// - the "unknown" identifier<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// Remote quotes. e.g. "[2001:db8:cafe::17]:4711" => [2001:db8:cafe::17]:4711<NEW_LINE>final String addr = firstChar == '"' ? QUOTED_STRING_TRIMMER.trimFrom(address) : address;<NEW_LINE>try {<NEW_LINE>final HostAndPort hostAndPort = HostAndPort.fromString(addr);<NEW_LINE>final byte[] addressBytes = NetUtil.createByteArrayFromIpAddressString(hostAndPort.getHost());<NEW_LINE>if (addressBytes == null) {<NEW_LINE><MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return new InetSocketAddress(InetAddress.getByAddress(addressBytes), hostAndPort.getPortOrDefault(0));<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>logger.debug("Failed to parse an address: {}", address, e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | logger.debug("Failed to parse an address: {}", address); |
1,169,027 | public void onResponse(final JSONObject response) {<NEW_LINE>List<Note> notes;<NEW_LINE>if (response == null) {<NEW_LINE>// Not sure this could ever happen, but make sure we're catching all response types<NEW_LINE>AppLog.w(AppLog.T.NOTIFS, "Success, but did not receive any notes");<NEW_LINE>EventBus.getDefault().post(new NotificationEvents.NotificationsRefreshCompleted(new ArrayList<MASK><NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>notes = NotificationsActions.parseNotes(response);<NEW_LINE>// if we have a note id, we were started from NotificationsDetailActivity.<NEW_LINE>// That means we need to re-set the *read* flag on this note.<NEW_LINE>if (mIsStartedByTappingOnNotification && mNoteId != null) {<NEW_LINE>setNoteRead(mNoteId, notes);<NEW_LINE>}<NEW_LINE>NotificationsTable.saveNotes(notes, true);<NEW_LINE>EventBus.getDefault().post(new NotificationEvents.NotificationsRefreshCompleted(notes));<NEW_LINE>} catch (JSONException e) {<NEW_LINE>AppLog.e(AppLog.T.NOTIFS, "Success, but can't parse the response", e);<NEW_LINE>EventBus.getDefault().post(new NotificationEvents.NotificationsRefreshError());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>completed();<NEW_LINE>} | <Note>(0))); |
1,779,520 | protected Document createDefaultModel() {<NEW_LINE>return new PlainDocument() {<NEW_LINE><NEW_LINE>public void insertString(int offs, String str, AttributeSet a) throws BadLocationException {<NEW_LINE>final String text = this.getText(0, offs) + str;<NEW_LINE>List oldSuggestions = suggestions;<NEW_LINE>suggestions = recentResourceNamesModel.getResourceNamesStartingWith(text);<NEW_LINE>String appendString = "";<NEW_LINE>if (!suggestions.isEmpty()) {<NEW_LINE>final String suggestion = (String) suggestions.get(0);<NEW_LINE>appendString = suggestion.substring(text.length());<NEW_LINE>}<NEW_LINE>super.insertString(offs, str + appendString, a);<NEW_LINE>setCaretPosition(offs);<NEW_LINE>setSelectionStart(text.length());<NEW_LINE>setSelectionEnd(getLength());<NEW_LINE>if (!oldSuggestions.equals(suggestions)) {<NEW_LINE>comboBoxModel.fireContentsChanged();<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>public void remove(int offs, int len) throws BadLocationException {<NEW_LINE><MASK><NEW_LINE>final List oldSuggestions = suggestions;<NEW_LINE>suggestions = recentResourceNamesModel.getResourceNamesStartingWith(AutoCompletionTextField.this.getText());<NEW_LINE>if (!oldSuggestions.equals(suggestions)) {<NEW_LINE>comboBoxModel.fireContentsChanged();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>} | super.remove(offs, len); |
943,851 | final AddRegionResult executeAddRegion(AddRegionRequest addRegionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(addRegionRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<AddRegionRequest> request = null;<NEW_LINE>Response<AddRegionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new AddRegionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(addRegionRequest));<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, "Directory Service");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "AddRegion");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<AddRegionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new AddRegionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
780,480 | private void parseDependenciesFromJson(Node node) {<NEW_LINE>NodeMapper mapper = new NodeMapper();<NEW_LINE>ObjectNode root = node.expectObjectNode();<NEW_LINE>root.warnIfAdditionalProperties(TOP_LEVEL_PROPERTIES);<NEW_LINE>// Must define a version.<NEW_LINE>root.expectStringMember(VERSION).expectOneOf("1.0");<NEW_LINE>// Must define a list of dependencies, each an ObjectNode.<NEW_LINE>for (ObjectNode value : root.expectArrayMember(DEPENDENCIES).getElementsAs(ObjectNode.class)) {<NEW_LINE>value.warnIfAdditionalProperties(ALLOWED_SYMBOL_PROPERTIES);<NEW_LINE>SymbolDependency.<MASK><NEW_LINE>builder.packageName(value.expectStringMember(PACKAGE_NAME).getValue());<NEW_LINE>builder.version(value.expectStringMember(VERSION).getValue());<NEW_LINE>value.getStringMember(DEPENDENCY_TYPE).ifPresent(v -> builder.dependencyType(v.getValue()));<NEW_LINE>value.getObjectMember(PROPERTIES).ifPresent(properties -> {<NEW_LINE>for (Map.Entry<String, Node> entry : properties.getStringMap().entrySet()) {<NEW_LINE>Object nodeAsJavaValue = mapper.deserialize(entry.getValue(), Object.class);<NEW_LINE>builder.putProperty(entry.getKey(), nodeAsJavaValue);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>addDependency(builder.build());<NEW_LINE>}<NEW_LINE>} | Builder builder = SymbolDependency.builder(); |
142,481 | public Operand buildHash(HashNode hashNode) {<NEW_LINE>List<KeyValuePair<Operand, Operand>> args = new ArrayList<>();<NEW_LINE>boolean hasAssignments = hashNode.containsVariableAssignment();<NEW_LINE>Variable hash = null;<NEW_LINE>for (KeyValuePair<Node, Node> pair : hashNode.getPairs()) {<NEW_LINE>Node key = pair.getKey();<NEW_LINE>Operand keyOperand;<NEW_LINE>if (key == null) {<NEW_LINE>// Splat kwarg [e.g. {**splat1, a: 1, **splat2)]<NEW_LINE>if (hash == null) {<NEW_LINE>// No hash yet. Define so order is preserved.<NEW_LINE>hash = copyAndReturnValue(new Hash(args, hashNode.isLiteral()));<NEW_LINE>// Used args but we may find more after the splat so we reset<NEW_LINE>args = new ArrayList<>();<NEW_LINE>} else if (!args.isEmpty()) {<NEW_LINE>addInstr(new RuntimeHelperCall(hash, MERGE_KWARGS, new Operand[] { hash, new Hash(args) }));<NEW_LINE>args = new ArrayList<>();<NEW_LINE>}<NEW_LINE>Operand splat = buildWithOrder(pair.getValue(), hasAssignments);<NEW_LINE>addInstr(new RuntimeHelperCall(hash, MERGE_KWARGS, new Operand[] { hash, splat }));<NEW_LINE>continue;<NEW_LINE>} else {<NEW_LINE>keyOperand = buildWithOrder(key, hasAssignments);<NEW_LINE>}<NEW_LINE>args.add(new KeyValuePair<>(keyOperand, buildWithOrder(pair.getValue(), hasAssignments)));<NEW_LINE>}<NEW_LINE>if (hash == null) {<NEW_LINE>// non-**arg ordinary hash<NEW_LINE>hash = copyAndReturnValue(new Hash(args, hashNode.isLiteral()));<NEW_LINE>} else if (!args.isEmpty()) {<NEW_LINE>// ordinary hash values encountered after a **arg<NEW_LINE>addInstr(new RuntimeHelperCall(hash, MERGE_KWARGS, new Operand[] { hash, <MASK><NEW_LINE>}<NEW_LINE>return hash;<NEW_LINE>} | new Hash(args) })); |
1,633,064 | private static // should be specified in radians, not degrees.<NEW_LINE>Point2D rotatePoint(Point2D fp, Point2D pt, double angle) {<NEW_LINE>double fpx = fp.getX();<NEW_LINE>double fpy = fp.getY();<NEW_LINE>double ptx = pt.getX();<NEW_LINE>double pty = pt.getY();<NEW_LINE>// Compute the vector <x, y> from the fixed point<NEW_LINE>// to the point of rotation.<NEW_LINE>double x = ptx - fpx;<NEW_LINE>double y = pty - fpy;<NEW_LINE>// Apply the clockwise rotation matrix to the vector <x, y><NEW_LINE>// | cos(theta) sin(theta) ||x| | xcos(theta) + ysin(theta) |<NEW_LINE>// | -sin(theta) cos(theta) ||y| = | -xsin(theta) + ycos(theta) |<NEW_LINE>double xRotated = x * cos(angle) + y * sin(angle);<NEW_LINE>double yRotated = y * cos(angle) - x * sin(angle);<NEW_LINE>// The rotation matrix rotated the vector about the origin, so we<NEW_LINE>// need to offset it by the point (fpx, fpy) to get the right answer<NEW_LINE>return new Point2D.Double(<MASK><NEW_LINE>} | fpx + xRotated, fpy + yRotated); |
1,720,477 | final GetMethodResponseResult executeGetMethodResponse(GetMethodResponseRequest getMethodResponseRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getMethodResponseRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetMethodResponseRequest> request = null;<NEW_LINE>Response<GetMethodResponseResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetMethodResponseRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getMethodResponseRequest));<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, "API Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetMethodResponse");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetMethodResponseResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetMethodResponseResultJsonUnmarshaller());<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); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.