idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,563,337 | public MessageReaction createMessageReaction(MessageChannel chan, long id, DataObject obj) {<NEW_LINE>DataObject emoji = obj.getObject("emoji");<NEW_LINE>final Long emojiID = emoji.isNull("id") ? null : emoji.getLong("id");<NEW_LINE>final String name = emoji.getString("name", "");<NEW_LINE>final boolean <MASK><NEW_LINE>final int count = obj.getInt("count", -1);<NEW_LINE>final boolean me = obj.getBoolean("me");<NEW_LINE>final MessageReaction.ReactionEmote reactionEmote;<NEW_LINE>if (emojiID != null) {<NEW_LINE>Emote emote = getJDA().getEmoteById(emojiID);<NEW_LINE>// creates fake emoji because no guild has this emoji id<NEW_LINE>if (emote == null)<NEW_LINE>emote = new EmoteImpl(emojiID, getJDA()).setAnimated(animated).setName(name);<NEW_LINE>reactionEmote = MessageReaction.ReactionEmote.fromCustom(emote);<NEW_LINE>} else {<NEW_LINE>reactionEmote = MessageReaction.ReactionEmote.fromUnicode(name, getJDA());<NEW_LINE>}<NEW_LINE>return new MessageReaction(chan, reactionEmote, id, me, count);<NEW_LINE>} | animated = emoji.getBoolean("animated"); |
850,503 | static public View createToggle(LayoutInflater layoutInflater, OsmandApplication ctx, @LayoutRes int layoutId, LinearLayout layout, ApplicationMode mode, boolean useMapTheme) {<NEW_LINE>int metricsX = (int) ctx.getResources().getDimension(R.dimen.route_info_modes_height);<NEW_LINE>int metricsY = (int) ctx.getResources().getDimension(R.dimen.route_info_modes_height);<NEW_LINE>View tb = layoutInflater.inflate(layoutId, null);<NEW_LINE>ImageView iv = (ImageView) tb.findViewById(R.id.app_mode_icon);<NEW_LINE>iv.setImageDrawable(ctx.getUIUtilities().getPaintedIcon(mode.getIconRes(), mode.getProfileColor(isNightMode<MASK><NEW_LINE>iv.setContentDescription(mode.toHumanString());<NEW_LINE>LayoutParams lp = new LinearLayout.LayoutParams(metricsX, metricsY);<NEW_LINE>layout.addView(tb, lp);<NEW_LINE>return tb;<NEW_LINE>} | (ctx, useMapTheme)))); |
1,143,070 | protected CommandExecutionResult executeNow(AbstractEntityDiagram diagram, BlocLines lines) throws NoSuchColorException {<NEW_LINE>lines = lines.trimSmart(1);<NEW_LINE>final RegexResult line0 = getStartingPattern().matcher(lines.getFirst().getTrimmed().getString());<NEW_LINE>final String symbol = StringUtils.goUpperCase(line0.get("TYPE", 0));<NEW_LINE>final LeafType type;<NEW_LINE>USymbol usymbol;<NEW_LINE>if (symbol.equalsIgnoreCase("usecase")) {<NEW_LINE>type = LeafType.USECASE;<NEW_LINE>usymbol = null;<NEW_LINE>} else {<NEW_LINE>usymbol = USymbols.fromString(symbol, diagram.getSkinParam().actorStyle(), diagram.getSkinParam().componentStyle(), diagram.getSkinParam().packageStyle());<NEW_LINE>if (usymbol == null) {<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>type = LeafType.DESCRIPTION;<NEW_LINE>}<NEW_LINE>final String idShort = line0.get("CODE", 0);<NEW_LINE>final List<String> lineLast = StringUtils.getSplit(MyPattern.cmpile(getPatternEnd()), lines.getLast().getTrimmed().getString());<NEW_LINE>lines = lines.subExtract(1, 1);<NEW_LINE>Display display = lines.toDisplay();<NEW_LINE>final String descStart = line0.get("DESC", 0);<NEW_LINE>if (StringUtils.isNotEmpty(descStart)) {<NEW_LINE>display = display.addFirst(descStart);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(lineLast.get(0))) {<NEW_LINE>display = display.add(lineLast.get(0));<NEW_LINE>}<NEW_LINE>final String stereotype = line0.get("STEREO", 0);<NEW_LINE>final Ident ident = diagram.buildLeafIdent(idShort);<NEW_LINE>final Code code = diagram.V1972() ? ident : diagram.buildCode(idShort);<NEW_LINE>if (CommandCreateElementFull.existsWithBadType3(diagram, code, ident, type, usymbol)) {<NEW_LINE>return CommandExecutionResult.error("This element (" + <MASK><NEW_LINE>}<NEW_LINE>final ILeaf result = diagram.createLeaf(ident, code, display, type, usymbol);<NEW_LINE>if (result == null) {<NEW_LINE>return CommandExecutionResult.error("This element (" + code.getName() + ") is already defined");<NEW_LINE>}<NEW_LINE>result.setUSymbol(usymbol);<NEW_LINE>if (stereotype != null) {<NEW_LINE>result.setStereotype(Stereotype.build(stereotype, diagram.getSkinParam().getCircledCharacterRadius(), diagram.getSkinParam().getFont(null, false, FontParam.CIRCLED_CHARACTER), diagram.getSkinParam().getIHtmlColorSet()));<NEW_LINE>}<NEW_LINE>final String urlString = line0.get("URL", 0);<NEW_LINE>if (urlString != null) {<NEW_LINE>final UrlBuilder urlBuilder = new UrlBuilder(diagram.getSkinParam().getValue("topurl"), UrlMode.STRICT);<NEW_LINE>final Url url = urlBuilder.getUrl(urlString);<NEW_LINE>result.addUrl(url);<NEW_LINE>}<NEW_LINE>// final HColor backColor =<NEW_LINE>// diagram.getSkinParam().getIHtmlColorSet().getColorIfValid(line0.get("COLOR",<NEW_LINE>// 0));<NEW_LINE>final Colors colors = color().getColor(diagram.getSkinParam().getThemeStyle(), line0, diagram.getSkinParam().getIHtmlColorSet());<NEW_LINE>result.setColors(colors);<NEW_LINE>// result.setSpecificColorTOBEREMOVED(ColorType.BACK, backColor);<NEW_LINE>return CommandExecutionResult.ok();<NEW_LINE>} | code.getName() + ") is already defined"); |
990,403 | public Node operate(final AtomicValue mOperand1, final AtomicValue mOperand2) throws SirixXPathException {<NEW_LINE>final Type returnType = getReturnType(mOperand1.getTypeKey(), mOperand2.getTypeKey());<NEW_LINE>final int typeKey = asXdmNodeReadTrx().keyForName(returnType.getStringRepr());<NEW_LINE>final byte[] value;<NEW_LINE>switch(returnType) {<NEW_LINE>case DOUBLE:<NEW_LINE>case FLOAT:<NEW_LINE>case DECIMAL:<NEW_LINE>final double dOp1 = Double.parseDouble(new String(mOperand1.getRawValue()));<NEW_LINE>final double dOp2 = Double.parseDouble(new String(mOperand2.getRawValue()));<NEW_LINE>value = TypedValue.getBytes(dOp1 % dOp2);<NEW_LINE>break;<NEW_LINE>case INTEGER:<NEW_LINE>try {<NEW_LINE>final int iOp1 = (int) Double.parseDouble(new String(mOperand1.getRawValue()));<NEW_LINE>final int iOp2 = (int) Double.parseDouble(new String(mOperand2.getRawValue()));<NEW_LINE>value = TypedValue.getBytes(iOp1 % iOp2);<NEW_LINE>} catch (final ArithmeticException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new XPathError(ErrorType.XPTY0004);<NEW_LINE>}<NEW_LINE>return new AtomicValue(value, typeKey);<NEW_LINE>} | throw new XPathError(ErrorType.FOAR0001); |
410,540 | private void addConstructor(AnnotationTypeDeclaration node, Map<ExecutableElement, VariableElement> fieldElements) {<NEW_LINE>TypeElement type = node.getTypeElement();<NEW_LINE>String typeName = nameTable.getFullName(type);<NEW_LINE>FunctionDeclaration constructorDecl = new FunctionDeclaration("create_" + typeName, type.asType());<NEW_LINE>Block constructorBody = new Block();<NEW_LINE>constructorDecl.setBody(constructorBody);<NEW_LINE>List<Statement> stmts = constructorBody.getStatements();<NEW_LINE>stmts.add(new NativeStatement(UnicodeUtils.format("%s *self = AUTORELEASE([[%s alloc] init]);", typeName, typeName)));<NEW_LINE>for (ExecutableElement memberElement : ElementUtil.getSortedAnnotationMembers(type)) {<NEW_LINE>TypeMirror memberType = memberElement.getReturnType();<NEW_LINE>String <MASK><NEW_LINE>String fieldName = nameTable.getVariableShortName(fieldElements.get(memberElement));<NEW_LINE>VariableElement param = GeneratedVariableElement.newParameter(propName, memberType, null);<NEW_LINE>constructorDecl.addParameter(new SingleVariableDeclaration(param));<NEW_LINE>String paramName = nameTable.getVariableShortName(param);<NEW_LINE>String rhs = TypeUtil.isReferenceType(memberType) ? "RETAIN_(" + paramName + ")" : paramName;<NEW_LINE>stmts.add(new NativeStatement("self->" + fieldName + " = " + rhs + ";"));<NEW_LINE>}<NEW_LINE>stmts.add(new NativeStatement("return self;"));<NEW_LINE>node.addBodyDeclaration(constructorDecl);<NEW_LINE>} | propName = NameTable.getAnnotationPropertyName(memberElement); |
1,233,007 | public static ToIntFunction<Object> specilizeyyyydd(int num, SimpleColumnInfo column1) {<NEW_LINE>ToIntFunction<Object> dbFunction;<NEW_LINE>switch(column1.getType()) {<NEW_LINE>case NUMBER:<NEW_LINE>dbFunction = o -> yyyydd(num, column1.normalizeValue(o));<NEW_LINE>break;<NEW_LINE>case STRING:<NEW_LINE>dbFunction = o -> yyyydd(num, column1.normalizeValue(o));<NEW_LINE>break;<NEW_LINE>case BLOB:<NEW_LINE>dbFunction = o -> yyyydd(num, column1.normalizeValue(o));<NEW_LINE>break;<NEW_LINE>case TIME:<NEW_LINE>dbFunction = o -> yyyydd(num, column1.normalizeValue(o));<NEW_LINE>break;<NEW_LINE>case DATE:<NEW_LINE>dbFunction = o -> yyyydd(num, column1.normalizeValue(o));<NEW_LINE>break;<NEW_LINE>case TIMESTAMP:<NEW_LINE>dbFunction = o -> yyyydd(num<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unexpected value: " + column1.getType());<NEW_LINE>}<NEW_LINE>return dbFunction;<NEW_LINE>} | , column1.normalizeValue(o)); |
636,142 | private List<ResourceInventory> filterNoAccessResources(Set<String> resourceUuids, String accountUuid) {<NEW_LINE>if (resourceUuids.isEmpty()) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>return new SQLBatchWithReturn<List<ResourceInventory>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected List<ResourceInventory> scripts() {<NEW_LINE>if (accountUuid.equals(AccountConstant.INITIAL_SYSTEM_ADMIN_UUID)) {<NEW_LINE>Query q = databaseFacade.getEntityManager().createNativeQuery("select uuid, resourceName, SUBSTRING_INDEX(concreteResourceType,\".\",-1) from ResourceVO where uuid in (:uuids)");<NEW_LINE>q.setParameter("uuids", resourceUuids);<NEW_LINE>List<Object[]> objs = q.getResultList();<NEW_LINE>List<ResourceVO> vos = objs.stream().map(ResourceVO::new).collect(Collectors.toList());<NEW_LINE>return ResourceInventory.valueOf(vos);<NEW_LINE>}<NEW_LINE>Query q = databaseFacade.getEntityManager().createNativeQuery("select r.uuid, r.resourceName, SUBSTRING_INDEX(r.concreteResourceType,\".\",-1) from ResourceVO r " + "left join AccountResourceRefVO ar on r.uuid=ar.resourceUuid " + "where ar.accountUuid is Null and r.uuid in :uuids " + "or r.uuid in (select ref.resourceUuid from AccountResourceRefVO ref where" + " (ref.ownerAccountUuid = :accountUuid " + " or ref.resourceUuid in" + " (select sh.resourceUuid from SharedResourceVO sh where (sh.receiverAccountUuid = :accountUuid or sh.toPublic = 1))) " + "and ref.resourceUuid in (:uuids))");<NEW_LINE>q.setParameter("uuids", resourceUuids);<NEW_LINE>q.setParameter("accountUuid", accountUuid);<NEW_LINE>List<Object[]> objs = q.getResultList();<NEW_LINE>List<ResourceVO> vos = objs.stream().map(ResourceVO::new).<MASK><NEW_LINE>return ResourceInventory.valueOf(vos);<NEW_LINE>}<NEW_LINE>}.execute();<NEW_LINE>} | collect(Collectors.toList()); |
760,113 | public PredictorExecutionDetails unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>PredictorExecutionDetails predictorExecutionDetails = new PredictorExecutionDetails();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return 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("PredictorExecutions", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>predictorExecutionDetails.setPredictorExecutions(new ListUnmarshaller<PredictorExecution>(PredictorExecutionJsonUnmarshaller.getInstance()).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 predictorExecutionDetails;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
399,141 | public boolean isWriteTypeInfo(Object object, Class fieldClass, long features) {<NEW_LINE>if (object == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (objectClass == fieldClass) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>features |= context.features;<NEW_LINE>if ((features & Feature.WriteClassName.mask) == 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if ((features & Feature.NotWriteHashMapArrayListClassName.mask) != 0) {<NEW_LINE>if (objectClass == HashMap.class) {<NEW_LINE>if (fieldClass == null || fieldClass == Object.class || fieldClass == Map.class || fieldClass == AbstractMap.class) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} else if (objectClass == ArrayList.class) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (features & Feature.NotWriteRootClassName.mask) == 0 || object != this.rootObject;<NEW_LINE>} | Class objectClass = object.getClass(); |
606,008 | protected SootMethod generateRedirectMethodForBindService(SootClass serviceConnection, SootClass destComp) {<NEW_LINE>ServiceEntryPointInfo entryPointInfo = (ServiceEntryPointInfo) componentToEntryPoint.get(destComp);<NEW_LINE>if (entryPointInfo == null) {<NEW_LINE>logger.warn(<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SootMethod targetDummyMain = entryPointInfo.getEntryPoint();<NEW_LINE>if (targetDummyMain == null) {<NEW_LINE>logger.warn("Destination component {} has no dummy main method", destComp.getName());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>String newSM_name = "redirector" + num++;<NEW_LINE>List<Type> newSM_parameters = new ArrayList<>();<NEW_LINE>newSM_parameters.add(serviceConnection.getType());<NEW_LINE>newSM_parameters.add(INTENT_TYPE);<NEW_LINE>SootMethod newSM = Scene.v().makeSootMethod(newSM_name, newSM_parameters, VoidType.v(), Modifier.STATIC | Modifier.PUBLIC);<NEW_LINE>newSM.addTag(SimulatedCodeElementTag.TAG);<NEW_LINE>dummyMainClass.addMethod(newSM);<NEW_LINE>JimpleBody b = Jimple.v().newBody(newSM);<NEW_LINE>newSM.setActiveBody(b);<NEW_LINE>LocalGenerator lg = Scene.v().createLocalGenerator(b);<NEW_LINE>Local originActivityParameterLocal = lg.generateLocal(serviceConnection.getType());<NEW_LINE>b.getUnits().add(Jimple.v().newIdentityStmt(originActivityParameterLocal, Jimple.v().newParameterRef(serviceConnection.getType(), 0)));<NEW_LINE>Local intentParameterLocal = lg.generateLocal(INTENT_TYPE);<NEW_LINE>b.getUnits().add(Jimple.v().newIdentityStmt(intentParameterLocal, Jimple.v().newParameterRef(INTENT_TYPE, 1)));<NEW_LINE>// call dummy main method<NEW_LINE>Local componentLocal = lg.generateLocal(destComp.getType());<NEW_LINE>{<NEW_LINE>b.getUnits().add(Jimple.v().newAssignStmt(componentLocal, Jimple.v().newStaticInvokeExpr(targetDummyMain.makeRef(), Collections.singletonList(intentParameterLocal))));<NEW_LINE>}<NEW_LINE>// get IBinder<NEW_LINE>Local ibinderLocal = lg.generateLocal(IBINDER_TYPE);<NEW_LINE>b.getUnits().add(Jimple.v().newAssignStmt(ibinderLocal, Jimple.v().newInstanceFieldRef(componentLocal, entryPointInfo.getBinderField().makeRef())));<NEW_LINE>// anonymous inner class problem, cannot get correct stmt<NEW_LINE>List<Type> paramTypes = new ArrayList<Type>();<NEW_LINE>paramTypes.add(RefType.v("android.content.ComponentName"));<NEW_LINE>paramTypes.add(RefType.v("android.os.IBinder"));<NEW_LINE>SootMethod method = serviceConnection.getMethod("onServiceConnected", paramTypes);<NEW_LINE>Local iLocal1 = lg.generateLocal(RefType.v("android.content.ComponentName"));<NEW_LINE>b.getUnits().add(Jimple.v().newAssignStmt(iLocal1, NullConstant.v()));<NEW_LINE>List<Value> args = new ArrayList<>();<NEW_LINE>args.add(iLocal1);<NEW_LINE>args.add(ibinderLocal);<NEW_LINE>SootClass sc = Scene.v().getSootClass(originActivityParameterLocal.getType().toString());<NEW_LINE>InvokeExpr invoke;<NEW_LINE>if (sc.isInterface()) {<NEW_LINE>invoke = Jimple.v().newInterfaceInvokeExpr(originActivityParameterLocal, method.makeRef(), args);<NEW_LINE>} else {<NEW_LINE>invoke = Jimple.v().newVirtualInvokeExpr(originActivityParameterLocal, method.makeRef(), args);<NEW_LINE>}<NEW_LINE>b.getUnits().add(Jimple.v().newInvokeStmt(invoke));<NEW_LINE>b.getUnits().add(Jimple.v().newReturnVoidStmt());<NEW_LINE>return newSM;<NEW_LINE>} | "Destination component {} has no dummy main method", destComp.getName()); |
838,554 | public Spec process(StringCharReader reader, String contextPath) {<NEW_LINE>SpecCentered.Alignment alignment = SpecCentered.Alignment.ALL;<NEW_LINE>SpecCentered.Location location = null;<NEW_LINE>String word = reader.readWord();<NEW_LINE>if (word.isEmpty()) {<NEW_LINE>throw new SyntaxException("Missing location and alignment");<NEW_LINE>}<NEW_LINE>if (SpecCentered.Location.isValid(word)) {<NEW_LINE>location = SpecCentered.Location.fromString(word);<NEW_LINE>} else {<NEW_LINE>alignment = <MASK><NEW_LINE>String locationWord = reader.readWord();<NEW_LINE>if (locationWord.isEmpty()) {<NEW_LINE>throw new SyntaxException("Missing location (on, inside)");<NEW_LINE>}<NEW_LINE>location = SpecCentered.Location.fromString(locationWord);<NEW_LINE>}<NEW_LINE>String object = reader.readWord();<NEW_LINE>if (object.isEmpty()) {<NEW_LINE>throw new SyntaxException("Missing object name");<NEW_LINE>}<NEW_LINE>int errorRate = 2;<NEW_LINE>if (reader.hasMore()) {<NEW_LINE>errorRate = Expectations.errorRate().read(reader);<NEW_LINE>}<NEW_LINE>return new SpecCentered(object, alignment, location).withErrorRate(errorRate);<NEW_LINE>} | SpecCentered.Alignment.fromString(word); |
1,661,896 | public static ListTagsResponse unmarshall(ListTagsResponse listTagsResponse, UnmarshallerContext context) {<NEW_LINE>listTagsResponse.setRequestId(context.stringValue("ListTagsResponse.RequestId"));<NEW_LINE>listTagsResponse.setCode(context.stringValue("ListTagsResponse.Code"));<NEW_LINE>listTagsResponse.setMessage(context.stringValue("ListTagsResponse.Message"));<NEW_LINE>listTagsResponse.setAction(context.stringValue("ListTagsResponse.Action"));<NEW_LINE>List<Tag> tags = new ArrayList<Tag>();<NEW_LINE>for (int i = 0; i < context.lengthValue("ListTagsResponse.Tags.Length"); i++) {<NEW_LINE>Tag tag = new Tag();<NEW_LINE>tag.setId(context.longValue("ListTagsResponse.Tags[" + i + "].Id"));<NEW_LINE>tag.setIdStr(context.stringValue("ListTagsResponse.Tags[" + i + "].IdStr"));<NEW_LINE>tag.setName(context.stringValue("ListTagsResponse.Tags[" + i + "].Name"));<NEW_LINE>tag.setIsSubTag(context.booleanValue("ListTagsResponse.Tags[" + i + "].IsSubTag"));<NEW_LINE>tag.setParentTag(context.stringValue("ListTagsResponse.Tags[" + i + "].ParentTag"));<NEW_LINE>Cover cover = new Cover();<NEW_LINE>cover.setId(context.longValue("ListTagsResponse.Tags[" + i + "].Cover.Id"));<NEW_LINE>cover.setIdStr(context.stringValue("ListTagsResponse.Tags[" + i + "].Cover.IdStr"));<NEW_LINE>cover.setTitle(context.stringValue("ListTagsResponse.Tags[" + i + "].Cover.Title"));<NEW_LINE>cover.setFileId(context.stringValue("ListTagsResponse.Tags[" + i + "].Cover.FileId"));<NEW_LINE>cover.setState(context.stringValue("ListTagsResponse.Tags[" + i + "].Cover.State"));<NEW_LINE>cover.setMd5(context.stringValue("ListTagsResponse.Tags[" + i + "].Cover.Md5"));<NEW_LINE>cover.setIsVideo(context.booleanValue("ListTagsResponse.Tags[" + i + "].Cover.IsVideo"));<NEW_LINE>cover.setRemark(context.stringValue("ListTagsResponse.Tags[" + i + "].Cover.Remark"));<NEW_LINE>cover.setWidth(context.longValue("ListTagsResponse.Tags[" + i + "].Cover.Width"));<NEW_LINE>cover.setHeight(context.longValue("ListTagsResponse.Tags[" + i + "].Cover.Height"));<NEW_LINE>cover.setCtime(context.longValue<MASK><NEW_LINE>cover.setMtime(context.longValue("ListTagsResponse.Tags[" + i + "].Cover.Mtime"));<NEW_LINE>tag.setCover(cover);<NEW_LINE>tags.add(tag);<NEW_LINE>}<NEW_LINE>listTagsResponse.setTags(tags);<NEW_LINE>return listTagsResponse;<NEW_LINE>} | ("ListTagsResponse.Tags[" + i + "].Cover.Ctime")); |
1,004,413 | protected boolean canPlace(BlockPlaceContext context, BlockState state) {<NEW_LINE>net.minecraft.world.entity.player.Player playerentity = context.getPlayer();<NEW_LINE>CollisionContext iselectioncontext = playerentity == null ? CollisionContext.empty(<MASK><NEW_LINE>boolean original = (!this.mustSurvive() || state.canSurvive(context.getLevel(), context.getClickedPos())) && context.getLevel().isUnobstructed(state, context.getClickedPos(), iselectioncontext);<NEW_LINE>Player player = (context.getPlayer() instanceof ServerPlayerEntityBridge) ? ((ServerPlayerEntityBridge) context.getPlayer()).bridge$getBukkitEntity() : null;<NEW_LINE>BlockCanBuildEvent event = new BlockCanBuildEvent(CraftBlock.at(context.getLevel(), context.getClickedPos()), player, CraftBlockData.fromData(state), original);<NEW_LINE>if (DistValidate.isValid(context))<NEW_LINE>Bukkit.getPluginManager().callEvent(event);<NEW_LINE>return event.isBuildable();<NEW_LINE>} | ) : CollisionContext.of(playerentity); |
682,658 | private BodyType createBodyType(@NonNull final XmlBody body) {<NEW_LINE>final BodyType bodyType = jaxbRequestObjectFactory.createBodyType();<NEW_LINE>bodyType.setPlace(body.getPlace());<NEW_LINE>bodyType.setRole(body.getRole());<NEW_LINE>bodyType.setRoleTitle(body.getRoleTitle());<NEW_LINE>bodyType.setProlog(createPrologType(body.getProlog()));<NEW_LINE>bodyType.setRemark(body.getRemark());<NEW_LINE>createTiersTypes(bodyType, body.getTiers(), body.getBalance());<NEW_LINE>createEsrType(bodyType, body.getEsr(), body.<MASK><NEW_LINE>createLawTypes(bodyType, body.getLaw());<NEW_LINE>bodyType.setTreatment(createTreatmentType(body.getTreatment()));<NEW_LINE>bodyType.setServices(createServicesType(body.getServices()));<NEW_LINE>bodyType.setDocuments(createDocumentsType(body.getDocuments()));<NEW_LINE>return bodyType;<NEW_LINE>} | getTiers().getBiller()); |
708,417 | public static String computeDefinitionName(String ref, Set<String> reserved) {<NEW_LINE>final String[] refParts = ref.split("#/");<NEW_LINE>if (refParts.length > 2) {<NEW_LINE>throw new RuntimeException("Invalid ref format: " + ref);<NEW_LINE>}<NEW_LINE>final String file = refParts[0];<NEW_LINE>final String definitionPath = refParts.length == 2 ? refParts[1] : null;<NEW_LINE>String plausibleName;<NEW_LINE>if (definitionPath != null) {<NEW_LINE>// the name will come from the last element of the definition path<NEW_LINE>final String[] <MASK><NEW_LINE>plausibleName = jsonPathElements[jsonPathElements.length - 1];<NEW_LINE>} else {<NEW_LINE>// no definition path, so we must come up with a name from the file<NEW_LINE>final String[] filePathElements = file.split("/");<NEW_LINE>plausibleName = filePathElements[filePathElements.length - 1];<NEW_LINE>final String[] split = plausibleName.split("\\.");<NEW_LINE>plausibleName = split[0];<NEW_LINE>}<NEW_LINE>String tryName = plausibleName;<NEW_LINE>for (int i = 2; reserved.contains(tryName); i++) {<NEW_LINE>tryName = plausibleName + "_" + i;<NEW_LINE>}<NEW_LINE>return tryName;<NEW_LINE>} | jsonPathElements = definitionPath.split("/"); |
1,504,724 | public okhttp3.Call readNamespacedRoleBindingCall(String name, String namespace, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames <MASK><NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | = new String[] { "BearerToken" }; |
347,780 | protected void performAction(Node[] activatedNodes) {<NEW_LINE>final GrailsPlatform runtime = GrailsPlatform.getDefault();<NEW_LINE>if (!runtime.isConfigured()) {<NEW_LINE>ConfigurationSupport.showConfigurationWarning(runtime);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DataObject dataObject = activatedNodes[0].getLookup().lookup(DataObject.class);<NEW_LINE>GrailsProject prj = (GrailsProject) FileOwnerQuery.getOwner(dataObject.getFolder().getPrimaryFile());<NEW_LINE>FileObject domainDir = prj.getProjectDirectory().getFileObject(DOMAIN_DIR);<NEW_LINE>if (domainDir == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String relativePath = FileUtil.getRelativePath(domainDir, dataObject.getPrimaryFile());<NEW_LINE>if (relativePath == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// replace slashes and cut off the extension<NEW_LINE>// NOI18N<NEW_LINE>StringBuilder builder = new StringBuilder(relativePath.replace('/', '.'));<NEW_LINE>builder.setLength(builder.length() - dataObject.getPrimaryFile().<MASK><NEW_LINE>builder.append(dataObject.getPrimaryFile().getName());<NEW_LINE>ProjectInformation inf = prj.getLookup().lookup(ProjectInformation.class);<NEW_LINE>// NOI18N<NEW_LINE>String displayName = inf.getDisplayName() + " (" + command + ")";<NEW_LINE>Callable<Process> callable = // NOI18N<NEW_LINE>ExecutionSupport.getInstance().// NOI18N<NEW_LINE>createSimpleCommand(// NOI18N<NEW_LINE>command, // NOI18N<NEW_LINE>GrailsProjectConfig.forProject(prj), builder.toString());<NEW_LINE>ExecutionDescriptor descriptor = prj.getCommandSupport().getDescriptor(command);<NEW_LINE>ExecutionService service = ExecutionService.newService(callable, descriptor, displayName);<NEW_LINE>service.run();<NEW_LINE>} | getNameExt().length()); |
365,711 | public void marshall(RuleGroup ruleGroup, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (ruleGroup == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(ruleGroup.getName(), NAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroup.getId(), ID_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroup.getCapacity(), CAPACITY_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroup.getARN(), ARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroup.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroup.getRules(), RULES_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroup.getVisibilityConfig(), VISIBILITYCONFIG_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroup.getLabelNamespace(), LABELNAMESPACE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(ruleGroup.getAvailableLabels(), AVAILABLELABELS_BINDING);<NEW_LINE>protocolMarshaller.marshall(ruleGroup.getConsumedLabels(), CONSUMEDLABELS_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | ruleGroup.getCustomResponseBodies(), CUSTOMRESPONSEBODIES_BINDING); |
167,510 | public void drawInfo(@Nonnull Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {<NEW_LINE>FontRenderer fr = minecraft.fontRenderer;<NEW_LINE>String txt = Lang.GUI_ZOMBGEN_OUTPUT.get("");<NEW_LINE>int <MASK><NEW_LINE>fr.drawStringWithShadow(txt, 89 - sw / 2 - xOff, 0 - yOff, ColorUtil.getRGB(Color.WHITE));<NEW_LINE>txt = "-";<NEW_LINE>sw = fr.getStringWidth(txt);<NEW_LINE>fr.drawStringWithShadow("-", 89 - sw / 2 - xOff, 10 - yOff, ColorUtil.getRGB(Color.WHITE));<NEW_LINE>txt = LangFluid.tMB(ZombieGenConfig.ticksPerBucketOfFuel.get() / 1000);<NEW_LINE>sw = fr.getStringWidth(txt);<NEW_LINE>fr.drawStringWithShadow(txt, recipeWidth / 2 - sw / 2, 4 + 57 + fr.FONT_HEIGHT / 2, ColorUtil.getRGB(Color.WHITE));<NEW_LINE>GlStateManager.color(1, 1, 1, 1);<NEW_LINE>} | sw = fr.getStringWidth(txt); |
640,815 | public Object postProcessBeforeInitialization(final Object bean, final String beanName) throws BeansException {<NEW_LINE>Class<?> clazz = bean.getClass();<NEW_LINE>if (isProxyBean(bean)) {<NEW_LINE>clazz = AopUtils.getTargetClass(bean);<NEW_LINE>}<NEW_LINE>Field[] fields = clazz.getDeclaredFields();<NEW_LINE>for (Field field : fields) {<NEW_LINE>try {<NEW_LINE>if (annotationField.check(field)) {<NEW_LINE>if (!field.isAccessible()) {<NEW_LINE>field.setAccessible(true);<NEW_LINE>}<NEW_LINE>Object ref = field.get(bean);<NEW_LINE>Class<?> refClass = field.getType();<NEW_LINE>Method[] methods = refClass.getMethods();<NEW_LINE>boolean anyMatch = Stream.of(methods).anyMatch(method -> Objects.nonNull(method.getAnnotation(Hmily.class)));<NEW_LINE>if (anyMatch) {<NEW_LINE>SingletonHolder.INST.register(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new BeanInitializationException("Failed to init spring bean at filed " + field.getName() + " in class " + bean.getClass().getName(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return bean;<NEW_LINE>} | field.getType(), ref); |
452,771 | // convert java.io.files into relative paths under the root container.<NEW_LINE>private Set<String> convertAbsToRelative(Collection<File> files) {<NEW_LINE>Set<String> result = new HashSet<String>();<NEW_LINE>for (File f : files) {<NEW_LINE>// assumption here that f is a dir, and path will end in File.seperator<NEW_LINE>String <MASK><NEW_LINE>if (fAbsPath.startsWith(rootAbsolutePath)) {<NEW_LINE>// canonicalPath(f);<NEW_LINE>String absPath = fAbsPath;<NEW_LINE>absPath = absPath.substring(rootAbsolutePath.length());<NEW_LINE>if ("\\".equals(File.separator)) {<NEW_LINE>absPath = absPath.replace('\\', '/');<NEW_LINE>}<NEW_LINE>// handle / case. (path will have been the same, so the substring created emptystring)<NEW_LINE>if (absPath.length() == 0) {<NEW_LINE>absPath = "/";<NEW_LINE>}<NEW_LINE>result.add(absPath);<NEW_LINE>} else<NEW_LINE>throw new IllegalStateException(fAbsPath + " " + rootAbsolutePath);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | fAbsPath = PathUtils.fixPathString(f); |
484,255 | protected void installStrings(JFileChooser fc) {<NEW_LINE>super.installStrings(fc);<NEW_LINE>Locale l = fc.getLocale();<NEW_LINE>lookInLabelMnemonic = UIManager.getInt("FileChooser.lookInLabelMnemonic");<NEW_LINE>lookInLabelText = UIManager.getString("FileChooser.lookInLabelText", l);<NEW_LINE>saveInLabelText = UIManager.getString("FileChooser.saveInLabelText", l);<NEW_LINE>fileNameLabelMnemonic = UIManager.getInt("FileChooser.fileNameLabelMnemonic");<NEW_LINE>fileNameLabelText = UIManager.getString("FileChooser.fileNameLabelText", l);<NEW_LINE>filesOfTypeLabelMnemonic = UIManager.getInt("FileChooser.filesOfTypeLabelMnemonic");<NEW_LINE>filesOfTypeLabelText = UIManager.getString("FileChooser.filesOfTypeLabelText", l);<NEW_LINE>upFolderToolTipText = UIManager.getString("FileChooser.upFolderToolTipText", l);<NEW_LINE>if (null == upFolderToolTipText)<NEW_LINE>// NOI18N<NEW_LINE>upFolderToolTipText = NbBundle.getMessage(DirectoryChooserUI.class, "TLTP_UpFolder");<NEW_LINE>upFolderAccessibleName = UIManager.getString("FileChooser.upFolderAccessibleName", l);<NEW_LINE>if (null == upFolderAccessibleName)<NEW_LINE>// NOI18N<NEW_LINE>upFolderAccessibleName = NbBundle.getMessage(DirectoryChooserUI.class, "ACN_UpFolder");<NEW_LINE>newFolderToolTipText = UIManager.getString("FileChooser.newFolderToolTipText", l);<NEW_LINE>if (null == newFolderToolTipText)<NEW_LINE>// NOI18N<NEW_LINE>newFolderToolTipText = NbBundle.<MASK><NEW_LINE>// NOI18N<NEW_LINE>newFolderAccessibleName = NbBundle.getMessage(DirectoryChooserUI.class, "ACN_NewFolder");<NEW_LINE>homeFolderTooltipText = UIManager.getString("FileChooser.homeFolderToolTipText", l);<NEW_LINE>if (null == homeFolderTooltipText)<NEW_LINE>// NOI18N<NEW_LINE>homeFolderTooltipText = NbBundle.getMessage(DirectoryChooserUI.class, "TLTP_HomeFolder");<NEW_LINE>// NOI18N<NEW_LINE>homeFolderAccessibleName = NbBundle.getMessage(DirectoryChooserUI.class, "ACN_HomeFolder");<NEW_LINE>} | getMessage(DirectoryChooserUI.class, "TLTP_NewFolder"); |
1,166,583 | private void saveStates(@Nonnull final File dir) {<NEW_LINE>final Element storeElement = new Element(StorageData.COMPONENT);<NEW_LINE>for (final String componentName : copiedStorageData.getComponentNames()) {<NEW_LINE>copiedStorageData.processComponent(componentName, (fileName, state) -> {<NEW_LINE>if (!dirtyFileNames.contains(fileName)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Element element = copiedStorageData.stateToElement(fileName, state);<NEW_LINE>if (storage.myPathMacroSubstitutor != null) {<NEW_LINE>storage.myPathMacroSubstitutor.collapsePaths(element);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>storeElement.<MASK><NEW_LINE>storeElement.addContent(element);<NEW_LINE>File childFile = new File(dir, fileName);<NEW_LINE>FileUtil.createParentDirs(childFile);<NEW_LINE>byte[] byteOut = StorageUtil.writeToBytes(storeElement, "\n");<NEW_LINE>StorageUtil.writeFile(childFile, byteOut, null);<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.error(e);<NEW_LINE>} finally {<NEW_LINE>element.detach();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | setAttribute(StorageData.NAME, componentName); |
1,395,955 | public DemotionResult demote(User user, ContextSet context, Predicate<String> previousGroupPermissionChecker, @Nullable Sender sender, boolean removeFromFirst) {<NEW_LINE>if (getSize() <= 1) {<NEW_LINE>throw new IllegalStateException("Track contains one or fewer groups, unable to demote");<NEW_LINE>}<NEW_LINE>// find all groups that are inherited by the user in the exact contexts given and applicable to this track<NEW_LINE>List<InheritanceNode> nodes = user.normalData().inheritanceNodesInContext(context).stream().filter(Node::getValue).filter(node -> containsGroup(node.getGroupName())).distinct().collect(Collectors.toList());<NEW_LINE>if (nodes.isEmpty()) {<NEW_LINE>return DemotionResults.notOnTrack();<NEW_LINE>}<NEW_LINE>if (nodes.size() != 1) {<NEW_LINE>return DemotionResults.ambiguousCall();<NEW_LINE>}<NEW_LINE>InheritanceNode oldNode = nodes.get(0);<NEW_LINE>String old = oldNode.getGroupName();<NEW_LINE>String previous = getPrevious(old);<NEW_LINE>if (!previousGroupPermissionChecker.test(oldNode.getGroupName())) {<NEW_LINE>return DemotionResults.undefinedFailure();<NEW_LINE>}<NEW_LINE>if (previous == null) {<NEW_LINE>if (!removeFromFirst) {<NEW_LINE>return DemotionResults.removedFromFirst(null);<NEW_LINE>}<NEW_LINE>user.unsetNode(DataType.NORMAL, oldNode);<NEW_LINE>this.plugin.getEventDispatcher().dispatchUserDemote(user, this, old, null, sender);<NEW_LINE>return DemotionResults.removedFromFirst(old);<NEW_LINE>}<NEW_LINE>Group previousGroup = this.plugin.getGroupManager().getIfLoaded(previous);<NEW_LINE>if (previousGroup == null) {<NEW_LINE>return DemotionResults.malformedTrack(previous);<NEW_LINE>}<NEW_LINE>user.unsetNode(DataType.NORMAL, oldNode);<NEW_LINE>user.setNode(DataType.NORMAL, oldNode.toBuilder().group(previousGroup.getName()).build(), true);<NEW_LINE>if (context.isEmpty() && user.getPrimaryGroup().getStoredValue().orElse(GroupManager.DEFAULT_GROUP_NAME).equalsIgnoreCase(old)) {<NEW_LINE>user.getPrimaryGroup().setStoredValue(previousGroup.getName());<NEW_LINE>}<NEW_LINE>this.plugin.getEventDispatcher().dispatchUserDemote(user, this, old, <MASK><NEW_LINE>return DemotionResults.success(old, previousGroup.getName());<NEW_LINE>} | previousGroup.getName(), sender); |
232,407 | public HistoricTaskInstanceEntity recordTaskInfoChange(TaskEntity taskEntity, Date changeTime, AbstractEngineConfiguration engineConfiguration) {<NEW_LINE>HistoricTaskInstanceEntity historicTaskInstance = getHistoricTaskInstanceEntityManager().findById(taskEntity.getId());<NEW_LINE>if (historicTaskInstance != null) {<NEW_LINE>historicTaskInstance.setName(taskEntity.getName());<NEW_LINE>historicTaskInstance.setDescription(taskEntity.getDescription());<NEW_LINE>historicTaskInstance.<MASK><NEW_LINE>historicTaskInstance.setPriority(taskEntity.getPriority());<NEW_LINE>historicTaskInstance.setCategory(taskEntity.getCategory());<NEW_LINE>historicTaskInstance.setFormKey(taskEntity.getFormKey());<NEW_LINE>historicTaskInstance.setParentTaskId(taskEntity.getParentTaskId());<NEW_LINE>historicTaskInstance.setTaskDefinitionKey(taskEntity.getTaskDefinitionKey());<NEW_LINE>historicTaskInstance.setProcessDefinitionId(taskEntity.getProcessDefinitionId());<NEW_LINE>historicTaskInstance.setClaimTime(taskEntity.getClaimTime());<NEW_LINE>historicTaskInstance.setLastUpdateTime(changeTime);<NEW_LINE>if (!Objects.equals(historicTaskInstance.getAssignee(), taskEntity.getAssignee())) {<NEW_LINE>historicTaskInstance.setAssignee(taskEntity.getAssignee());<NEW_LINE>createHistoricIdentityLink(historicTaskInstance.getId(), IdentityLinkType.ASSIGNEE, historicTaskInstance.getAssignee(), engineConfiguration);<NEW_LINE>}<NEW_LINE>if (!Objects.equals(historicTaskInstance.getOwner(), taskEntity.getOwner())) {<NEW_LINE>historicTaskInstance.setOwner(taskEntity.getOwner());<NEW_LINE>createHistoricIdentityLink(historicTaskInstance.getId(), IdentityLinkType.OWNER, historicTaskInstance.getOwner(), engineConfiguration);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return historicTaskInstance;<NEW_LINE>} | setDueDate(taskEntity.getDueDate()); |
485,081 | public static int borderInverseUpper(WlBorderCoef<?> desc, BorderIndex1D border, int dataLength) {<NEW_LINE>WlCoef inner = desc.getInnerCoefficients();<NEW_LINE>int borderSize = borderForwardUpper(inner, dataLength);<NEW_LINE>borderSize += borderSize % 2;<NEW_LINE>WlCoef uu = borderSize > 0 ? inner : null;<NEW_LINE>WlCoef ul = uu;<NEW_LINE>WlCoef ll = inner;<NEW_LINE>int indexUL = 1998;<NEW_LINE>if (desc.getUpperLength() > 0) {<NEW_LINE>uu = desc.getBorderCoefficients(-2);<NEW_LINE>indexUL = 2000 - desc.getUpperLength() * 2;<NEW_LINE>ul = <MASK><NEW_LINE>}<NEW_LINE>if (desc.getLowerLength() > 0) {<NEW_LINE>ll = desc.getBorderCoefficients(0);<NEW_LINE>}<NEW_LINE>border.setLength(2000);<NEW_LINE>borderSize = checkInverseUpper(uu, 2000 - borderSize, border, borderSize);<NEW_LINE>borderSize = checkInverseUpper(ul, indexUL, border, borderSize);<NEW_LINE>borderSize = checkInverseUpper(ll, 0, border, borderSize);<NEW_LINE>return borderSize;<NEW_LINE>} | desc.getBorderCoefficients(2000 - indexUL); |
1,043,488 | public CreateProjectResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateProjectResult createProjectResult = new CreateProjectResult();<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 createProjectResult;<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("projectId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createProjectResult.setProjectId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("projectArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createProjectResult.setProjectArn(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return createProjectResult;<NEW_LINE>} | class).unmarshall(context)); |
125,945 | public PCollection<Long> expand(PCollection<T> input) {<NEW_LINE>TypeDescriptor<T> type = input.getCoder().getEncodedTypeDescriptor();<NEW_LINE>if (HLL_IMPLEMENTED_TYPES.contains(type)) {<NEW_LINE>HllCount.Init.Builder<T> builder = builderForType(type);<NEW_LINE>return input.apply(builder.globally()).apply(HllCount.Extract.globally());<NEW_LINE>}<NEW_LINE>// Boiler plate to avoid [argument.type.incompatible] NonNull vs Nullable<NEW_LINE>Contextful<Fn<T, Long>> mapping = getMapping();<NEW_LINE>if (mapping != null) {<NEW_LINE>return input.apply(MapElements.into(TypeDescriptors.longs()).via(mapping)).apply(HllCount.Init.forLongs().globally()).apply(HllCount.Extract.globally());<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException(String.format("%s supports Integer," + " Long, String and byte[] objects directly. For other types you must provide a Mapping function.", this.getClass<MASK><NEW_LINE>} | ().getCanonicalName())); |
1,298,466 | void assembleMessageParameters() {<NEW_LINE>mAid = SecureUtils.<MASK><NEW_LINE>final ByteBuffer paramsBuffer;<NEW_LINE>LOG.info("State: " + (mState ? "ON" : "OFF"));<NEW_LINE>if (mTransitionSteps == null || mTransitionResolution == null || mDelay == null) {<NEW_LINE>paramsBuffer = ByteBuffer.allocate(GENERIC_ON_OFF_SET_PARAMS_LENGTH).order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>paramsBuffer.put((byte) (mState ? 0x01 : 0x00));<NEW_LINE>paramsBuffer.put((byte) tId);<NEW_LINE>} else {<NEW_LINE>LOG.info("Transition steps: " + mTransitionSteps);<NEW_LINE>LOG.info("Transition step resolution: " + mTransitionResolution);<NEW_LINE>paramsBuffer = ByteBuffer.allocate(GENERIC_ON_OFF_SET_TRANSITION_PARAMS_LENGTH).order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>paramsBuffer.put((byte) (mState ? 0x01 : 0x00));<NEW_LINE>paramsBuffer.put((byte) tId);<NEW_LINE>paramsBuffer.put((byte) (mTransitionResolution << 6 | mTransitionSteps));<NEW_LINE>final int delay = mDelay;<NEW_LINE>paramsBuffer.put((byte) delay);<NEW_LINE>}<NEW_LINE>mParameters = paramsBuffer.array();<NEW_LINE>} | calculateK4(mAppKey.getKey()); |
387,444 | private void applyStrategy(int region, @Nonnull String seq, @Nonnull StringBuilder builder) {<NEW_LINE>if (strategy == SanitizationStrategy.REMOVE) {<NEW_LINE>if (codeLanguage.matcher(seq).matches())<NEW_LINE>builder.append(seq.substring(seq.indexOf("\n") + 1));<NEW_LINE>else<NEW_LINE>builder.append(seq);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String token = tokens.get(region);<NEW_LINE>if (token == null)<NEW_LINE>throw new IllegalStateException("Found illegal region for strategy ESCAPE '" + region + "' with no known format token!");<NEW_LINE>if (region == UNDERLINE)<NEW_LINE>// UNDERLINE needs special handling because the client thinks its ITALICS_U if you only escape once<NEW_LINE>token = "_\\_";<NEW_LINE>else if (region == BOLD)<NEW_LINE>// BOLD needs special handling because the client thinks its ITALICS_A if you only escape once<NEW_LINE>token = "*\\*";<NEW_LINE>else if (region == (BOLD | ITALICS_A))<NEW_LINE>// BOLD | ITALICS_A needs special handling because the client thinks its BOLD if you only escape once<NEW_LINE>token = "*\\*\\*";<NEW_LINE>builder.append("\\").append(token).append(seq).append<MASK><NEW_LINE>} | ("\\").append(token); |
260,458 | protected Object readItem(Element tr, Set<String> selected, DesignContext context) {<NEW_LINE><MASK><NEW_LINE>if (visibleColumns.size() != cells.size()) {<NEW_LINE>throw new DesignException("Wrong number of columns in a Table row. Expected " + visibleColumns.size() + ", was " + cells.size() + ".");<NEW_LINE>}<NEW_LINE>Object[] data = new String[cells.size()];<NEW_LINE>for (int c = 0; c < cells.size(); ++c) {<NEW_LINE>data[c] = DesignFormatter.decodeFromTextNode(cells.get(c).html());<NEW_LINE>}<NEW_LINE>Object itemId = addItem(data, tr.hasAttr("item-id") ? tr.attr("item-id") : null);<NEW_LINE>if (itemId == null) {<NEW_LINE>throw new DesignException("Failed to add a Table row: " + data);<NEW_LINE>}<NEW_LINE>return itemId;<NEW_LINE>} | Elements cells = tr.children(); |
249,371 | public void onMapReady(@NonNull MapboxMap map) {<NEW_LINE>mapboxMap = map;<NEW_LINE>map.setStyle(Style.LIGHT, new Style.OnStyleLoaded() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStyleLoaded(@NonNull Style style) {<NEW_LINE>// Disable any type of fading transition when icons collide on the map. This enhances the visual<NEW_LINE>// look of the data clustering together and breaking apart.<NEW_LINE>style.setTransition(new TransitionOptions(0, 0, false));<NEW_LINE>mapboxMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(12.099<MASK><NEW_LINE>addClusteredGeoJsonSource(style);<NEW_LINE>style.addImage("cross-icon-id", BitmapUtils.getBitmapFromDrawable(getResources().getDrawable(R.drawable.ic_cross)), true);<NEW_LINE>Toast.makeText(CircleLayerClusteringActivity.this, R.string.zoom_map_in_and_out_instruction, Toast.LENGTH_SHORT).show();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | , -79.045), 3)); |
1,291,694 | public void marshall(AwsApiGatewayV2StageDetails awsApiGatewayV2StageDetails, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (awsApiGatewayV2StageDetails == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(awsApiGatewayV2StageDetails.getClientCertificateId(), CLIENTCERTIFICATEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsApiGatewayV2StageDetails.getCreatedDate(), CREATEDDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsApiGatewayV2StageDetails.getDescription(), DESCRIPTION_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsApiGatewayV2StageDetails.getDefaultRouteSettings(), DEFAULTROUTESETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsApiGatewayV2StageDetails.getDeploymentId(), DEPLOYMENTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsApiGatewayV2StageDetails.getLastUpdatedDate(), LASTUPDATEDDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(awsApiGatewayV2StageDetails.getStageName(), STAGENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsApiGatewayV2StageDetails.getStageVariables(), STAGEVARIABLES_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsApiGatewayV2StageDetails.getAccessLogSettings(), ACCESSLOGSETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsApiGatewayV2StageDetails.getAutoDeploy(), AUTODEPLOY_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsApiGatewayV2StageDetails.getLastDeploymentStatusMessage(), LASTDEPLOYMENTSTATUSMESSAGE_BINDING);<NEW_LINE>protocolMarshaller.marshall(awsApiGatewayV2StageDetails.getApiGatewayManaged(), APIGATEWAYMANAGED_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | awsApiGatewayV2StageDetails.getRouteSettings(), ROUTESETTINGS_BINDING); |
811,912 | public void onEntityCollision(Level world, Entity entity) {<NEW_LINE>if (!world.isClientSide && entity != null && entity.isAlive()) {<NEW_LINE>SawmillTileEntity master = master();<NEW_LINE>if (master == null)<NEW_LINE>return;<NEW_LINE>if (new BlockPos(0, 1, 1).equals(posInMultiblock) && entity instanceof ItemEntity) {<NEW_LINE>ItemEntity itemEntity = (ItemEntity) entity;<NEW_LINE>ItemStack stack = itemEntity.getItem();<NEW_LINE>if (stack.isEmpty())<NEW_LINE>return;<NEW_LINE>stack = stack.copy();<NEW_LINE>master.insertItemToProcess(stack, false);<NEW_LINE>if (stack.getCount() <= 0)<NEW_LINE>entity.remove();<NEW_LINE>else<NEW_LINE>itemEntity.setItem(stack);<NEW_LINE>} else if (entity instanceof LivingEntity && !master.sawblade.isEmpty() && CACHED_SAWBLADE_AABB.apply(master).intersects(entity.getBoundingBox())) {<NEW_LINE>if (entity instanceof Player && ((Player) entity).abilities.invulnerable)<NEW_LINE>return;<NEW_LINE>int consumed = master.energyStorage.extractEnergy(80, true);<NEW_LINE>if (consumed > 0) {<NEW_LINE>master.energyStorage.extractEnergy(consumed, false);<NEW_LINE>entity.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | hurt(IEDamageSources.sawmill, 7); |
1,339,294 | public void marshall(Artwork artwork, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (artwork == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(artwork.getInputKey(), INPUTKEY_BINDING);<NEW_LINE>protocolMarshaller.marshall(artwork.getMaxWidth(), MAXWIDTH_BINDING);<NEW_LINE>protocolMarshaller.marshall(artwork.getMaxHeight(), MAXHEIGHT_BINDING);<NEW_LINE>protocolMarshaller.marshall(artwork.getSizingPolicy(), SIZINGPOLICY_BINDING);<NEW_LINE>protocolMarshaller.marshall(artwork.getPaddingPolicy(), PADDINGPOLICY_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(artwork.getEncryption(), ENCRYPTION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | artwork.getAlbumArtFormat(), ALBUMARTFORMAT_BINDING); |
1,539,494 | public Map<String, String> runDiagnosticsCommand(final RunDiagnosticsCmd cmd) {<NEW_LINE>final Long vmId = cmd.getId();<NEW_LINE>final String cmdType = cmd.getType().getValue();<NEW_LINE>final String ipAddress = cmd.getAddress();<NEW_LINE>final String optionalArguments = cmd.getOptionalArguments();<NEW_LINE>final VMInstanceVO vmInstance = instanceDao.findByIdTypes(vmId, VirtualMachine.Type.ConsoleProxy, VirtualMachine.Type.DomainRouter, VirtualMachine.Type.SecondaryStorageVm);<NEW_LINE>if (vmInstance == null) {<NEW_LINE>throw new InvalidParameterValueException("Unable to find a system vm with id " + vmId);<NEW_LINE>}<NEW_LINE>final Long hostId = vmInstance.getHostId();<NEW_LINE>if (hostId == null) {<NEW_LINE>throw new CloudRuntimeException("Unable to find host for virtual machine instance: " + vmInstance.getInstanceName());<NEW_LINE>}<NEW_LINE>final String shellCmd = prepareShellCmd(cmdType, ipAddress, optionalArguments);<NEW_LINE>if (StringUtils.isEmpty(shellCmd)) {<NEW_LINE>throw new IllegalArgumentException("Optional parameters contain unwanted characters: " + optionalArguments);<NEW_LINE>}<NEW_LINE>final Hypervisor.HypervisorType hypervisorType = vmInstance.getHypervisorType();<NEW_LINE>final DiagnosticsCommand command = new DiagnosticsCommand(shellCmd, vmManager.getExecuteInSequence(hypervisorType));<NEW_LINE>final Map<String, String> accessDetails = networkManager.getSystemVMAccessDetails(vmInstance);<NEW_LINE>if (StringUtils.isEmpty(accessDetails.get(NetworkElementCommand.ROUTER_IP))) {<NEW_LINE>throw new CloudRuntimeException("Unable to set system vm ControlIP for system vm with ID: " + vmId);<NEW_LINE>}<NEW_LINE>command.setAccessDetail(accessDetails);<NEW_LINE>Map<String, String> detailsMap;<NEW_LINE>Answer answer = agentManager.easySend(hostId, command);<NEW_LINE>if (answer != null) {<NEW_LINE>detailsMap = ((DiagnosticsAnswer) answer).getExecutionDetails();<NEW_LINE>return detailsMap;<NEW_LINE>} else {<NEW_LINE>throw new CloudRuntimeException("Failed to execute diagnostics command for system vm: " + vmInstance + <MASK><NEW_LINE>}<NEW_LINE>} | ", on remote host: " + vmInstance.getHostName()); |
1,401,312 | public static DescribeContactsResponse unmarshall(DescribeContactsResponse describeContactsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeContactsResponse.setRequestId(_ctx.stringValue("DescribeContactsResponse.RequestId"));<NEW_LINE>describeContactsResponse.setSuccess(_ctx.booleanValue("DescribeContactsResponse.Success"));<NEW_LINE>describeContactsResponse.setCode(_ctx.stringValue("DescribeContactsResponse.Code"));<NEW_LINE>describeContactsResponse.setMessage(_ctx.stringValue("DescribeContactsResponse.Message"));<NEW_LINE>describeContactsResponse.setTotalCount(_ctx.integerValue("DescribeContactsResponse.TotalCount"));<NEW_LINE>describeContactsResponse.setPageSize(_ctx.integerValue("DescribeContactsResponse.PageSize"));<NEW_LINE>describeContactsResponse.setPageNumber(_ctx.integerValue("DescribeContactsResponse.PageNumber"));<NEW_LINE>List<Contact> contacts <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeContactsResponse.Contacts.Length"); i++) {<NEW_LINE>Contact contact = new Contact();<NEW_LINE>contact.setContactId(_ctx.stringValue("DescribeContactsResponse.Contacts[" + i + "].ContactId"));<NEW_LINE>contact.setName(_ctx.stringValue("DescribeContactsResponse.Contacts[" + i + "].Name"));<NEW_LINE>contact.setEmail(_ctx.stringValue("DescribeContactsResponse.Contacts[" + i + "].Email"));<NEW_LINE>contact.setMobile(_ctx.stringValue("DescribeContactsResponse.Contacts[" + i + "].Mobile"));<NEW_LINE>contact.setDescription(_ctx.stringValue("DescribeContactsResponse.Contacts[" + i + "].Description"));<NEW_LINE>contacts.add(contact);<NEW_LINE>}<NEW_LINE>describeContactsResponse.setContacts(contacts);<NEW_LINE>return describeContactsResponse;<NEW_LINE>} | = new ArrayList<Contact>(); |
1,316,974 | public void configure(ConfigurableProvider provider) {<NEW_LINE>provider.addAlgorithm("MessageDigest.SHA3-224", PREFIX + "$Digest224");<NEW_LINE>provider.addAlgorithm("MessageDigest.SHA3-256", PREFIX + "$Digest256");<NEW_LINE>provider.addAlgorithm("MessageDigest.SHA3-384", PREFIX + "$Digest384");<NEW_LINE>provider.addAlgorithm("MessageDigest.SHA3-512", PREFIX + "$Digest512");<NEW_LINE>provider.addAlgorithm("MessageDigest", NISTObjectIdentifiers.id_sha3_224, PREFIX + "$Digest224");<NEW_LINE>provider.addAlgorithm("MessageDigest", NISTObjectIdentifiers.id_sha3_256, PREFIX + "$Digest256");<NEW_LINE>provider.addAlgorithm("MessageDigest", NISTObjectIdentifiers.id_sha3_384, PREFIX + "$Digest384");<NEW_LINE>provider.addAlgorithm("MessageDigest", NISTObjectIdentifiers.id_sha3_512, PREFIX + "$Digest512");<NEW_LINE>provider.addAlgorithm("MessageDigest.SHAKE256-512", PREFIX + "$DigestShake256_512");<NEW_LINE>provider.addAlgorithm("MessageDigest.SHAKE128-256", PREFIX + "$DigestShake128_256");<NEW_LINE>provider.addAlgorithm("MessageDigest", NISTObjectIdentifiers.id_shake256, PREFIX + "$DigestShake256_512");<NEW_LINE>provider.addAlgorithm("MessageDigest", NISTObjectIdentifiers.id_shake128, PREFIX + "$DigestShake128_256");<NEW_LINE>provider.addAlgorithm("Alg.Alias.MessageDigest.SHAKE256", "SHAKE256-512");<NEW_LINE>provider.addAlgorithm("Alg.Alias.MessageDigest.SHAKE128", "SHAKE128-256");<NEW_LINE>addHMACAlgorithm(provider, "SHA3-224", PREFIX + "$HashMac224", PREFIX + "$KeyGenerator224");<NEW_LINE>addHMACAlias(provider, "SHA3-224", NISTObjectIdentifiers.id_hmacWithSHA3_224);<NEW_LINE>addHMACAlgorithm(provider, "SHA3-256", PREFIX + "$HashMac256", PREFIX + "$KeyGenerator256");<NEW_LINE>addHMACAlias(provider, "SHA3-256", NISTObjectIdentifiers.id_hmacWithSHA3_256);<NEW_LINE>addHMACAlgorithm(provider, "SHA3-384", PREFIX + "$HashMac384", PREFIX + "$KeyGenerator384");<NEW_LINE>addHMACAlias(provider, "SHA3-384", NISTObjectIdentifiers.id_hmacWithSHA3_384);<NEW_LINE>addHMACAlgorithm(provider, "SHA3-512", PREFIX + "$HashMac512", PREFIX + "$KeyGenerator512");<NEW_LINE>addHMACAlias(provider, "SHA3-512", NISTObjectIdentifiers.id_hmacWithSHA3_512);<NEW_LINE>addKMACAlgorithm(provider, "128", PREFIX + "$KMac128", PREFIX + "$KeyGenerator256");<NEW_LINE>addKMACAlgorithm(provider, "256", PREFIX + "$KMac256", PREFIX + "$KeyGenerator512");<NEW_LINE>provider.addAlgorithm("MessageDigest.TUPLEHASH256-512", PREFIX + "$DigestTupleHash256_512");<NEW_LINE>provider.addAlgorithm("MessageDigest.TUPLEHASH128-256", PREFIX + "$DigestTupleHash128_256");<NEW_LINE><MASK><NEW_LINE>provider.addAlgorithm("Alg.Alias.MessageDigest.TUPLEHASH128", "TUPLEHASH128-256");<NEW_LINE>provider.addAlgorithm("MessageDigest.PARALLELHASH256-512", PREFIX + "$DigestParallelHash256_512");<NEW_LINE>provider.addAlgorithm("MessageDigest.PARALLELHASH128-256", PREFIX + "$DigestParallelHash128_256");<NEW_LINE>provider.addAlgorithm("Alg.Alias.MessageDigest.PARALLELHASH256", "PARALLELHASH256-512");<NEW_LINE>provider.addAlgorithm("Alg.Alias.MessageDigest.PARALLELHASH128", "PARALLELHASH128-256");<NEW_LINE>} | provider.addAlgorithm("Alg.Alias.MessageDigest.TUPLEHASH256", "TUPLEHASH256-512"); |
801,754 | void mergeXML(AdministeredObject aod) throws InjectionConfigurationException {<NEW_LINE>final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.entry(tc, "mergeXML: name=" + getJndiName() + ", binding=" + ", " + aod);<NEW_LINE>String nameValue = aod.getName();<NEW_LINE>if (nameValue != null) {<NEW_LINE>name = mergeXMLValue(<MASK><NEW_LINE>XMLName = true;<NEW_LINE>}<NEW_LINE>String descriptionValue = aod.getName();<NEW_LINE>if (descriptionValue != null) {<NEW_LINE>description = mergeXMLValue(description, descriptionValue, "description", KEY_NAME);<NEW_LINE>XMLDescription = true;<NEW_LINE>}<NEW_LINE>String resourceAdapterValue = aod.getResourceAdapter();<NEW_LINE>if (resourceAdapterValue != null) {<NEW_LINE>resourceAdapter = mergeXMLValue(resourceAdapter, resourceAdapterValue, "resource-adapter", KEY_RESOURCE_ADAPTER);<NEW_LINE>XMLResourceAdapter = true;<NEW_LINE>}<NEW_LINE>String classNameValue = aod.getClassNameValue();<NEW_LINE>if (classNameValue != null) {<NEW_LINE>className = mergeXMLValue(className, classNameValue, "class-name", KEY_CLASS_NAME);<NEW_LINE>XMLclassName = true;<NEW_LINE>}<NEW_LINE>String interfaceNameValue = aod.getInterfaceNameValue();<NEW_LINE>if (interfaceNameValue != null) {<NEW_LINE>interfaceName = mergeXMLValue(interfaceName, interfaceNameValue, "interface-name", KEY_INTERFACE_NAME);<NEW_LINE>XMLInterfaceName = true;<NEW_LINE>}<NEW_LINE>List<Property> aodProps = aod.getProperties();<NEW_LINE>mergeXMLProperties(aodProps);<NEW_LINE>if (isTraceOn && tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "mergeXML");<NEW_LINE>} | name, nameValue, "name", KEY_NAME); |
1,128,118 | private void computeCollectionChildren(@NotNull InstanceRef instanceRef, int offset, @NotNull final XCompositeNode node) {<NEW_LINE>final int count = Math.min(instanceRef.getLength() - offset, XCompositeNode.MAX_CHILDREN_TO_SHOW);<NEW_LINE>myDebugProcess.getVmServiceWrapper().getCollectionObject(myIsolateId, myInstanceRef.getId(), offset, count, new GetObjectConsumer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void received(Obj instance) {<NEW_LINE>if (isListKind(instanceRef.getKind())) {<NEW_LINE>addListChildren(offset, node, (Instance) instance);<NEW_LINE>} else if (instanceRef.getKind() == InstanceKind.Map) {<NEW_LINE>addMapChildren(offset, node, ((Instance) instance).getAssociations());<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (offset + count < instanceRef.getLength()) {<NEW_LINE>node.tooManyChildren(instanceRef.getLength() - offset - count, () -> computeCollectionChildren(instanceRef, offset + count, node));<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void received(Sentinel sentinel) {<NEW_LINE>node.setErrorMessage(sentinel.getValueAsString());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(RPCError error) {<NEW_LINE>node.setErrorMessage(error.getMessage());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | assert false : instanceRef.getKind(); |
1,278,745 | protected void readBitmap() {<NEW_LINE>// (sub)image position & size<NEW_LINE>currentFrame.ix = readShort();<NEW_LINE>currentFrame.iy = readShort();<NEW_LINE>currentFrame.iw = readShort();<NEW_LINE>currentFrame.ih = readShort();<NEW_LINE>int packed = read();<NEW_LINE>// 1 - local color table flag interlace<NEW_LINE>lctFlag = (packed & 0x80) != 0;<NEW_LINE>lctSize = (int) Math.pow(2, (packed & 0x07) + 1);<NEW_LINE>// 3 - sort flag<NEW_LINE>// 4-5 - reserved lctSize = 2 << (packed & 7); // 6-8 - local color<NEW_LINE>// table size<NEW_LINE>currentFrame.interlace <MASK><NEW_LINE>if (lctFlag) {<NEW_LINE>// read table<NEW_LINE>currentFrame.lct = readColorTable(lctSize);<NEW_LINE>} else {<NEW_LINE>// No local color table<NEW_LINE>currentFrame.lct = null;<NEW_LINE>}<NEW_LINE>// Save this as the decoding position pointer<NEW_LINE>currentFrame.bufferFrameStart = rawData.position();<NEW_LINE>// false decode pixel data to advance buffer<NEW_LINE>decodeBitmapData(null, mainPixels);<NEW_LINE>skip();<NEW_LINE>if (err()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>frameCount++;<NEW_LINE>// add image to frame<NEW_LINE>frames.add(currentFrame);<NEW_LINE>} | = (packed & 0x40) != 0; |
252,728 | public boolean filterCheck(DiskManagerFileInfo ds, String filter, boolean regex) {<NEW_LINE>if (hide_dnd_files) {<NEW_LINE>if (ds.isSkipped()) {<NEW_LINE>return (false);<NEW_LINE>} else if (ds instanceof FilesViewNodeInner) {<NEW_LINE>// see if all kids skipped<NEW_LINE>if (((FilesViewNodeInner) ds).getSkippedState() == 0) {<NEW_LINE>return (false);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>TOTorrentFile tf = ds.getTorrentFile();<NEW_LINE>if (tf != null && tf.isPadFile()) {<NEW_LINE>return (false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (filter == null || filter.length() == 0) {<NEW_LINE>return (true);<NEW_LINE>}<NEW_LINE>if (!tv.hasFilterControl()) {<NEW_LINE>// view has no visible filter control so ignore any current filter as the<NEW_LINE>// user's going to get confused...<NEW_LINE>return (true);<NEW_LINE>}<NEW_LINE>if (tree_view && ds instanceof FilesViewNodeInner) {<NEW_LINE>// don't filter intermediate tree nodes<NEW_LINE>return (true);<NEW_LINE>}<NEW_LINE>boolean filterOnPath = filter.startsWith("p:");<NEW_LINE>if (filterOnPath) {<NEW_LINE>filter = filter.substring(2);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>File file = ds.getFile(true);<NEW_LINE>String name;<NEW_LINE>if (filterOnPath) {<NEW_LINE>name = file.getAbsolutePath();<NEW_LINE>} else {<NEW_LINE>if (filter.startsWith(File.separator)) {<NEW_LINE>filter = filter.substring(1);<NEW_LINE>if (filter.isEmpty()) {<NEW_LINE>return (true);<NEW_LINE>}<NEW_LINE>name = file.getAbsolutePath();<NEW_LINE>} else {<NEW_LINE>name = file.getName();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String s = regex ? filter : RegExUtil.splitAndQuote(filter, "\\s*[|;]\\s*");<NEW_LINE>boolean match_result = true;<NEW_LINE>if (regex && s.startsWith("!")) {<NEW_LINE>s = s.substring(1);<NEW_LINE>match_result = false;<NEW_LINE>}<NEW_LINE>Pattern pattern = RegExUtil.getCachedPattern("fv:search", s, Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE);<NEW_LINE>return (pattern.matcher(name<MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} | ).find() == match_result); |
1,155,085 | public void caseATableswitchStatement(ATableswitchStatement node) {<NEW_LINE>inATableswitchStatement(node);<NEW_LINE>if (node.getSemicolon() != null) {<NEW_LINE>node.getSemicolon().apply(this);<NEW_LINE>}<NEW_LINE>if (node.getRBrace() != null) {<NEW_LINE>node.getRBrace().apply(this);<NEW_LINE>}<NEW_LINE>{<NEW_LINE>List<PCaseStmt> copy = new ArrayList<PCaseStmt>(node.getCaseStmt());<NEW_LINE>Collections.reverse(copy);<NEW_LINE>for (PCaseStmt e : copy) {<NEW_LINE>e.apply(this);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (node.getLBrace() != null) {<NEW_LINE>node.getLBrace().apply(this);<NEW_LINE>}<NEW_LINE>if (node.getRParen() != null) {<NEW_LINE>node.<MASK><NEW_LINE>}<NEW_LINE>if (node.getImmediate() != null) {<NEW_LINE>node.getImmediate().apply(this);<NEW_LINE>}<NEW_LINE>if (node.getLParen() != null) {<NEW_LINE>node.getLParen().apply(this);<NEW_LINE>}<NEW_LINE>if (node.getTableswitch() != null) {<NEW_LINE>node.getTableswitch().apply(this);<NEW_LINE>}<NEW_LINE>outATableswitchStatement(node);<NEW_LINE>} | getRParen().apply(this); |
864,812 | public void run() {<NEW_LINE>if (window != null) {<NEW_LINE>FileDialog dialog = new FileDialog(window.getShell(), SWT.OPEN);<NEW_LINE>dialog.setFilterNames(new String<MASK><NEW_LINE>dialog.setFilterExtensions(new String[] { "*.zip" });<NEW_LINE>String importFileName = dialog.open();<NEW_LINE>if (StringUtil.isEmpty(importFileName)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String workspaceRootName = Platform.getInstanceLocation().getURL().getFile();<NEW_LINE>String importWorkingDirName = workspaceRootName + "/import-working";<NEW_LINE>ClientFileUtil.deleteDirectory(new File(importWorkingDirName));<NEW_LINE>FileUtil.mkdirs(importWorkingDirName);<NEW_LINE>try {<NEW_LINE>ZipUtil.decompress(importFileName, importWorkingDirName);<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>throwable.printStackTrace();<NEW_LINE>}<NEW_LINE>String message = "Import completed.\nRestarting...";<NEW_LINE>MessageDialog.openInformation(window.getShell(), "Info", message);<NEW_LINE>ExUtil.exec(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>PlatformUI.getWorkbench().restart();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | [] { "scouter export zip files", "zip Files (*.zip)" }); |
411,078 | public ListenableFuture<Void> write(Slice slice) {<NEW_LINE>checkState(directUploadFuture == null, "Direct upload already started");<NEW_LINE>if (closed) {<NEW_LINE>// Ignore writes after writer is closed<NEW_LINE>return immediateVoidFuture();<NEW_LINE>}<NEW_LINE>// Skip multipart upload if there would only be one part<NEW_LINE>if (slice.length() < partSize && multiPartUploadIdFuture == null) {<NEW_LINE>PutObjectRequest.Builder putObjectRequestBuilder = PutObjectRequest.builder().bucket(bucketName).key<MASK><NEW_LINE>configureEncryption(secretKey, putObjectRequestBuilder);<NEW_LINE>directUploadFuture = transformFuture(toListenableFuture(s3AsyncClient.putObject(putObjectRequestBuilder.build(), ByteBufferAsyncRequestBody.fromByteBuffer(slice.toByteBuffer()))));<NEW_LINE>return directUploadFuture;<NEW_LINE>}<NEW_LINE>if (multiPartUploadIdFuture == null) {<NEW_LINE>multiPartUploadIdFuture = Futures.transform(createMultipartUpload(), CreateMultipartUploadResponse::uploadId, directExecutor());<NEW_LINE>}<NEW_LINE>int partNum = ++currentPartNumber;<NEW_LINE>ListenableFuture<CompletedPart> uploadFuture = Futures.transformAsync(multiPartUploadIdFuture, uploadId -> uploadPart(uploadId, slice, partNum), directExecutor());<NEW_LINE>multiPartUploadFutures.add(uploadFuture);<NEW_LINE>return transformFuture(uploadFuture);<NEW_LINE>} | (key).storageClass(storageClass); |
939,123 | @ApiOperation(value = "Create an experiment", response = Experiment.class)<NEW_LINE>@Timed<NEW_LINE>public Response postExperiment(@ApiParam(required = true) final NewExperiment newExperiment, @QueryParam("createNewApplication") @DefaultValue("false") final boolean createNewApplication, @HeaderParam(AUTHORIZATION) @ApiParam(value = EXAMPLE_AUTHORIZATION_HEADER, required = true) final String authorizationHeader) {<NEW_LINE>try {<NEW_LINE>if (newExperiment.getApplicationName() == null || isBlank(newExperiment.getApplicationName().toString())) {<NEW_LINE>throw new IllegalArgumentException("Experiment application name cannot be null or an empty string");<NEW_LINE>}<NEW_LINE>Username userName = authorization.getUser(authorizationHeader);<NEW_LINE>if (!createNewApplication) {<NEW_LINE>authorization.checkUserPermissions(userName, newExperiment.getApplicationName(), CREATE);<NEW_LINE>}<NEW_LINE>// Avoid causing breaking change in API request body, derive creatorID from auth headers<NEW_LINE>String creatorID = (userName != null) ? userName.getUsername() : null;<NEW_LINE>newExperiment.setCreatorID(creatorID);<NEW_LINE>// TODO - Should validate experiment before hand rather than catching errors later<NEW_LINE>try {<NEW_LINE>experiments.createExperiment(newExperiment, authorization.getUserInfo(userName));<NEW_LINE>} catch (RepositoryException e) {<NEW_LINE>throw new RepositoryException(<MASK><NEW_LINE>}<NEW_LINE>Experiment experiment = experiments.getExperiment(newExperiment.getID());<NEW_LINE>if (createNewApplication) {<NEW_LINE>UserRole userRole = newInstance(experiment.getApplicationName(), ADMIN).withUserID(userName).build();<NEW_LINE>authorization.setUserRole(userRole, null);<NEW_LINE>}<NEW_LINE>return httpHeader.headers(CREATED).entity(experiment).build();<NEW_LINE>} catch (Exception exception) {<NEW_LINE>LOGGER.error("postExperiment failed for newExperiment={}, createNewApplication={} with error:", newExperiment, createNewApplication, exception);<NEW_LINE>throw exception;<NEW_LINE>}<NEW_LINE>} | "Could not create experiment " + newExperiment + " because " + e); |
567,029 | protected void writeCaseServiceTaskAdditionalAttributes(BaseElement element, BpmnModel model, XMLStreamWriter xtw) throws Exception {<NEW_LINE>CaseServiceTask caseServiceTask = (CaseServiceTask) element;<NEW_LINE>writeQualifiedAttribute(ATTRIBUTE_TYPE, ServiceTask.CASE_TASK, xtw);<NEW_LINE>if (StringUtils.isNotEmpty(caseServiceTask.getSkipExpression())) {<NEW_LINE>writeQualifiedAttribute(ATTRIBUTE_TASK_SERVICE_SKIP_EXPRESSION, caseServiceTask.getSkipExpression(), xtw);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(caseServiceTask.getCaseDefinitionKey())) {<NEW_LINE>writeQualifiedAttribute(ATTRIBUTE_CASE_TASK_CASE_DEFINITION_KEY, caseServiceTask.getCaseDefinitionKey(), xtw);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(caseServiceTask.getCaseInstanceName())) {<NEW_LINE>writeQualifiedAttribute(ATTRIBUTE_CASE_TASK_CASE_INSTANCE_NAME, caseServiceTask.getCaseInstanceName(), xtw);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(caseServiceTask.getBusinessKey())) {<NEW_LINE>writeQualifiedAttribute(ATTRIBUTE_BUSINESS_KEY, <MASK><NEW_LINE>}<NEW_LINE>if (caseServiceTask.isInheritBusinessKey()) {<NEW_LINE>writeQualifiedAttribute(ATTRIBUTE_INHERIT_BUSINESS_KEY, "true", xtw);<NEW_LINE>}<NEW_LINE>if (caseServiceTask.isSameDeployment()) {<NEW_LINE>writeQualifiedAttribute(ATTRIBUTE_SAME_DEPLOYMENT, "true", xtw);<NEW_LINE>}<NEW_LINE>if (caseServiceTask.isFallbackToDefaultTenant()) {<NEW_LINE>writeQualifiedAttribute(ATTRIBUTE_FALLBACK_TO_DEFAULT_TENANT, "true", xtw);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(caseServiceTask.getCaseInstanceIdVariableName())) {<NEW_LINE>writeQualifiedAttribute(ATTRIBUTE_ID_VARIABLE_NAME, caseServiceTask.getCaseInstanceIdVariableName(), xtw);<NEW_LINE>}<NEW_LINE>} | caseServiceTask.getBusinessKey(), xtw); |
1,063,248 | private void publishError(BoltResponseMessageWriter messageWriter, Neo4jError error) {<NEW_LINE>try {<NEW_LINE>if (error.isFatal()) {<NEW_LINE>messageWriter.write(new FatalFailureMessage(error.status(), error.message()));<NEW_LINE>} else {<NEW_LINE>messageWriter.write(new FailureMessage(error.status()<MASK><NEW_LINE>}<NEW_LINE>} catch (PackOutputClosedException e) {<NEW_LINE>// Can't write error to the client, because the connection is closed.<NEW_LINE>// Very likely our error is related to the connection being closed.<NEW_LINE>// If the error is that the transaction was terminated, then the error is a side-effect of<NEW_LINE>// us cleaning up stuff that was running when the client disconnected. Log a warning without<NEW_LINE>// stack trace to highlight clients are disconnecting while stuff is running:<NEW_LINE>if (CLIENT_MID_OP_DISCONNECT_ERRORS.contains(error.status())) {<NEW_LINE>log.warn("Client %s disconnected while query was running. Session has been cleaned up. " + "This can be caused by temporary network problems, but if you see this often, " + "ensure your applications are properly waiting for operations to complete before exiting.", e.clientAddress());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// If the error isn't that the tx was terminated, log it to the console for debugging. It's likely<NEW_LINE>// there are other "ok" errors that we can whitelist into the conditional above over time.<NEW_LINE>log.warn("Unable to send error back to the client. " + e.getMessage(), error.cause());<NEW_LINE>} catch (Throwable t) {<NEW_LINE>// some unexpected error happened while writing exception back to the client<NEW_LINE>// log it together with the original error being suppressed<NEW_LINE>t.addSuppressed(error.cause());<NEW_LINE>log.error("Unable to send error back to the client", t);<NEW_LINE>}<NEW_LINE>} | , error.message())); |
944,475 | private Mono<PagedResponse<IntegrationServiceEnvironmentInner>> listByResourceGroupSinglePageAsync(String resourceGroup, Integer top, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroup == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroup is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroup, this.client.getApiVersion(), top, accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue()<MASK><NEW_LINE>} | .nextLink(), null)); |
247,771 | public static boolean intersectSegmentCircle(Vector2 start, Vector2 end, Circle circle, MinimumTranslationVector mtv) {<NEW_LINE>v2a.set(end).sub(start);<NEW_LINE>v2b.set(circle.x - start.x, circle.y - start.y);<NEW_LINE>float len = v2a.len();<NEW_LINE>float u = v2b.<MASK><NEW_LINE>if (u <= 0) {<NEW_LINE>v2c.set(start);<NEW_LINE>} else if (u >= len) {<NEW_LINE>v2c.set(end);<NEW_LINE>} else {<NEW_LINE>// remember v2a is already normalized<NEW_LINE>v2d.set(v2a.scl(u));<NEW_LINE>v2c.set(v2d).add(start);<NEW_LINE>}<NEW_LINE>v2a.set(v2c.x - circle.x, v2c.y - circle.y);<NEW_LINE>if (mtv != null) {<NEW_LINE>// Handle special case of segment containing circle center<NEW_LINE>if (v2a.equals(Vector2.Zero)) {<NEW_LINE>v2d.set(end.y - start.y, start.x - end.x);<NEW_LINE>mtv.normal.set(v2d).nor();<NEW_LINE>mtv.depth = circle.radius;<NEW_LINE>} else {<NEW_LINE>mtv.normal.set(v2a).nor();<NEW_LINE>mtv.depth = circle.radius - v2a.len();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return v2a.len2() <= circle.radius * circle.radius;<NEW_LINE>} | dot(v2a.nor()); |
1,040,893 | private static synchronized void addToTrustStore(String url, X509Certificate cert) throws GeneralSecurityException, IOException {<NEW_LINE>FileObject root = FileUtil.getConfigRoot();<NEW_LINE>FileObject ts = root.getFileObject(TRUST_STORE_PATH);<NEW_LINE>char[] password = Keyring.read(TRUST_PASSWORD_KEY);<NEW_LINE>if (password == null) {<NEW_LINE>password = new BigInteger(130, RANDOM).<MASK><NEW_LINE>Keyring.save(TRUST_PASSWORD_KEY, password, null);<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>KeyStore keystore = KeyStore.getInstance("JKS");<NEW_LINE>InputStream is = (ts == null) ? null : new BufferedInputStream(ts.getInputStream());<NEW_LINE>try {<NEW_LINE>keystore.load(is, password);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOGGER.log(Level.INFO, null, ex);<NEW_LINE>// start from scratch<NEW_LINE>keystore.load(null, null);<NEW_LINE>} finally {<NEW_LINE>if (is != null) {<NEW_LINE>is.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>keystore.setCertificateEntry(url, cert);<NEW_LINE>if (ts == null) {<NEW_LINE>ts = FileUtil.createData(root, TRUST_STORE_PATH);<NEW_LINE>}<NEW_LINE>OutputStream out = new BufferedOutputStream(ts.getOutputStream());<NEW_LINE>try {<NEW_LINE>keystore.store(out, password);<NEW_LINE>} finally {<NEW_LINE>out.close();<NEW_LINE>}<NEW_LINE>} | toString(32).toCharArray(); |
971,688 | private static void queryByIterator() throws IoTDBConnectionException, StatementExecutionException {<NEW_LINE>try (SessionDataSet dataSet = session.executeQueryStatement("select * from root.sg1.d1")) {<NEW_LINE>DataIterator iterator = dataSet.iterator();<NEW_LINE>System.out.println(dataSet.getColumnNames());<NEW_LINE>// default is 10000<NEW_LINE>dataSet.setFetchSize(1024);<NEW_LINE>while (iterator.next()) {<NEW_LINE>StringBuilder builder = new StringBuilder();<NEW_LINE>// get time<NEW_LINE>builder.append(iterator.getLong(1)).append(",");<NEW_LINE>// get second column<NEW_LINE>if (!iterator.isNull(2)) {<NEW_LINE>builder.append(iterator.getLong(2)).append(",");<NEW_LINE>} else {<NEW_LINE>builder.append("null").append(",");<NEW_LINE>}<NEW_LINE>// get third column<NEW_LINE>if (!iterator.isNull(ROOT_SG1_D1_S2)) {<NEW_LINE>builder.append(iterator.getLong(<MASK><NEW_LINE>} else {<NEW_LINE>builder.append("null").append(",");<NEW_LINE>}<NEW_LINE>// get forth column<NEW_LINE>if (!iterator.isNull(4)) {<NEW_LINE>builder.append(iterator.getLong(4)).append(",");<NEW_LINE>} else {<NEW_LINE>builder.append("null").append(",");<NEW_LINE>}<NEW_LINE>// get fifth column<NEW_LINE>if (!iterator.isNull(ROOT_SG1_D1_S4)) {<NEW_LINE>builder.append(iterator.getObject(ROOT_SG1_D1_S4));<NEW_LINE>} else {<NEW_LINE>builder.append("null");<NEW_LINE>}<NEW_LINE>System.out.println(builder);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ROOT_SG1_D1_S2)).append(","); |
1,352,085 | private static void distributePrimitives(@Nonnull Map<SearchRequestCollector, Processor<? super PsiReference>> collectors, @Nonnull Set<RequestWithProcessor> locals, @Nonnull MultiMap<Set<IdIndexEntry>, RequestWithProcessor> globals, @Nonnull List<Computable<Boolean>> customs, @Nonnull Map<RequestWithProcessor, Processor<PsiElement>> localProcessors, @Nonnull ProgressIndicator progress) {<NEW_LINE>for (final Map.Entry<SearchRequestCollector, Processor<? super PsiReference>> entry : collectors.entrySet()) {<NEW_LINE>final Processor<? super PsiReference<MASK><NEW_LINE>SearchRequestCollector collector = entry.getKey();<NEW_LINE>for (final PsiSearchRequest primitive : collector.takeSearchRequests()) {<NEW_LINE>final SearchScope scope = primitive.searchScope;<NEW_LINE>if (scope instanceof LocalSearchScope) {<NEW_LINE>registerRequest(locals, primitive, processor);<NEW_LINE>} else {<NEW_LINE>Set<IdIndexEntry> key = new HashSet<>(getWordEntries(primitive.word, primitive.caseSensitive));<NEW_LINE>registerRequest(globals.getModifiable(key), primitive, processor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (final Processor<Processor<? super PsiReference>> customAction : collector.takeCustomSearchActions()) {<NEW_LINE>customs.add(() -> customAction.process(processor));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Map.Entry<Set<IdIndexEntry>, Collection<RequestWithProcessor>> entry : globals.entrySet()) {<NEW_LINE>for (RequestWithProcessor singleRequest : entry.getValue()) {<NEW_LINE>PsiSearchRequest primitive = singleRequest.request;<NEW_LINE>StringSearcher searcher = new StringSearcher(primitive.word, primitive.caseSensitive, true, false);<NEW_LINE>BulkOccurrenceProcessor adapted = adaptProcessor(primitive, singleRequest.refProcessor);<NEW_LINE>Processor<PsiElement> localProcessor = localProcessor(adapted, progress, searcher);<NEW_LINE>assert !localProcessors.containsKey(singleRequest) || localProcessors.get(singleRequest) == localProcessor;<NEW_LINE>localProcessors.put(singleRequest, localProcessor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > processor = entry.getValue(); |
464,834 | private static // relation.<NEW_LINE>boolean relate(Envelope envelope_a, Envelope envelope_b, SpatialReference sr, int relation, ProgressTracker progress_tracker) {<NEW_LINE>if (envelope_a.isEmpty() || envelope_b.isEmpty()) {<NEW_LINE>if (relation == Relation.disjoint)<NEW_LINE>// Always true<NEW_LINE>return true;<NEW_LINE>// Always false<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Envelope2D env_a = new Envelope2D(), env_b = new Envelope2D(), env_merged = new Envelope2D();<NEW_LINE>envelope_a.queryEnvelope2D(env_a);<NEW_LINE>envelope_b.queryEnvelope2D(env_b);<NEW_LINE>env_merged.setCoords(env_a);<NEW_LINE>env_merged.merge(env_b);<NEW_LINE>double tolerance = InternalUtils.calculateToleranceFromGeometry(sr, env_merged, false);<NEW_LINE>switch(relation) {<NEW_LINE>case Relation.disjoint:<NEW_LINE>return envelopeDisjointEnvelope_(env_a, env_b, tolerance, progress_tracker);<NEW_LINE>case Relation.within:<NEW_LINE>return envelopeContainsEnvelope_(env_b, env_a, tolerance, progress_tracker);<NEW_LINE>case Relation.contains:<NEW_LINE>return envelopeContainsEnvelope_(env_a, env_b, tolerance, progress_tracker);<NEW_LINE>case Relation.equals:<NEW_LINE>return envelopeEqualsEnvelope_(env_a, env_b, tolerance, progress_tracker);<NEW_LINE>case Relation.touches:<NEW_LINE>return envelopeTouchesEnvelope_(<MASK><NEW_LINE>case Relation.overlaps:<NEW_LINE>return envelopeOverlapsEnvelope_(env_a, env_b, tolerance, progress_tracker);<NEW_LINE>case Relation.crosses:<NEW_LINE>return envelopeCrossesEnvelope_(env_a, env_b, tolerance, progress_tracker);<NEW_LINE>default:<NEW_LINE>// warning fix<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | env_a, env_b, tolerance, progress_tracker); |
1,494,380 | private static List<CompletionItem> createConfigurationsCompletion(Project p) {<NEW_LINE>Collection<ProjectConfiguration> configurations = getConfigurations(p);<NEW_LINE><MASK><NEW_LINE>if (size <= 1) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>List<CompletionItem> completionItems = new ArrayList<>(size - 1);<NEW_LINE>boolean skipFirst = true;<NEW_LINE>for (ProjectConfiguration c : configurations) {<NEW_LINE>if (skipFirst) {<NEW_LINE>skipFirst = false;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String configDisplayName = c.getDisplayName();<NEW_LINE>String launchName = Bundle.LBL_LaunchJavaConfig(configDisplayName);<NEW_LINE>// NOI18N<NEW_LINE>CompletionItem ci = new CompletionItem("Java 8+: " + launchName);<NEW_LINE>StringWriter sw = new StringWriter();<NEW_LINE>try (JsonWriter w = new JsonWriter(sw)) {<NEW_LINE>// NOI18N<NEW_LINE>w.setIndent("\t");<NEW_LINE>w.beginObject();<NEW_LINE>// NOI18N<NEW_LINE>w.name("name").value(launchName);<NEW_LINE>// NOI18N<NEW_LINE>w.name("type").value(CONFIG_TYPE);<NEW_LINE>// NOI18N<NEW_LINE>w.name("request").value("launch");<NEW_LINE>// NOI18N<NEW_LINE>w.name("mainClass").value("${file}");<NEW_LINE>// NOI18N<NEW_LINE>w.name("launchConfiguration").value(configDisplayName);<NEW_LINE>w.endObject();<NEW_LINE>w.flush();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>}<NEW_LINE>ci.setInsertText(sw.toString());<NEW_LINE>ci.setDocumentation(Bundle.LBL_LaunchJavaConfig_desc(configDisplayName));<NEW_LINE>completionItems.add(ci);<NEW_LINE>}<NEW_LINE>return completionItems;<NEW_LINE>} | int size = configurations.size(); |
314,686 | public void validateFormalIdentifier(String identifier) {<NEW_LINE>char first = identifier.charAt(0);<NEW_LINE>if (Character.isUpperCase(first)) {<NEW_LINE>compile_error("formal argument cannot be a constant");<NEW_LINE>}<NEW_LINE>switch(first) {<NEW_LINE>case '@':<NEW_LINE>if (identifier.charAt(1) == '@') {<NEW_LINE>compile_error("formal argument cannot be a class variable");<NEW_LINE>} else {<NEW_LINE>compile_error("formal argument cannot be an instance variable");<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case '$':<NEW_LINE>compile_error("formal argument cannot be a global variable");<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>// This mechanism feels a tad dicey but at this point we are dealing with a valid<NEW_LINE>// method name at least so we should not need to check the entire string...<NEW_LINE>char last = identifier.charAt(<MASK><NEW_LINE>if (last == '=' || last == '?' || last == '!') {<NEW_LINE>compile_error("formal argument must be local variable");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | identifier.length() - 1); |
448,477 | public static void deduceCollations(List<RelCollation> outputCollations, final int sourceCount, List<RexLocalRef> refs, List<RelCollation> inputCollations) {<NEW_LINE>int[] targets = new int[sourceCount];<NEW_LINE>Arrays.fill(targets, -1);<NEW_LINE>for (int i = 0; i < refs.size(); i++) {<NEW_LINE>final RexLocalRef ref = refs.get(i);<NEW_LINE>final int source = ref.getIndex();<NEW_LINE>if ((source < sourceCount) && (targets[source] == -1)) {<NEW_LINE>targets[source] = i;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>loop: for (RelCollation collation : inputCollations) {<NEW_LINE>final List<RelFieldCollation> fieldCollations = new ArrayList<>(0);<NEW_LINE>for (RelFieldCollation fieldCollation : collation.getFieldCollations()) {<NEW_LINE>final <MASK><NEW_LINE>final int target = targets[source];<NEW_LINE>if (target < 0) {<NEW_LINE>continue loop;<NEW_LINE>}<NEW_LINE>fieldCollations.add(fieldCollation.withFieldIndex(target));<NEW_LINE>}<NEW_LINE>// Success -- all of the source fields of this key are mapped<NEW_LINE>// to the output.<NEW_LINE>outputCollations.add(RelCollations.of(fieldCollations));<NEW_LINE>}<NEW_LINE>outputCollations.sort(Ordering.natural());<NEW_LINE>} | int source = fieldCollation.getFieldIndex(); |
1,649,779 | public void serialize(ByteBuf buf) {<NEW_LINE>super.serialize(buf);<NEW_LINE>IntDoubleVectorStorage storage = split.getStorage();<NEW_LINE>if (storage instanceof IntDoubleSparseVectorStorage) {<NEW_LINE>buf.writeInt(storage.size());<NEW_LINE>ObjectIterator<Int2DoubleMap.Entry> iter = storage.entryIterator();<NEW_LINE>Int2DoubleMap.Entry entry;<NEW_LINE>while (iter.hasNext()) {<NEW_LINE>entry = iter.next();<NEW_LINE>buf.writeInt(entry.getIntKey());<NEW_LINE>buf.writeDouble(entry.getDoubleValue());<NEW_LINE>}<NEW_LINE>} else if (storage instanceof IntDoubleSortedVectorStorage) {<NEW_LINE>buf.writeInt(storage.size());<NEW_LINE>int[<MASK><NEW_LINE>double[] values = storage.getValues();<NEW_LINE>for (int i = 0; i < indices.length; i++) {<NEW_LINE>buf.writeInt(indices[i]);<NEW_LINE>buf.writeDouble(values[i]);<NEW_LINE>}<NEW_LINE>} else if (storage instanceof IntDoubleDenseVectorStorage) {<NEW_LINE>double[] values = storage.getValues();<NEW_LINE>int writeSize = values.length < maxItemNum ? values.length : maxItemNum;<NEW_LINE>buf.writeInt(writeSize);<NEW_LINE>for (int i = 0; i < writeSize; i++) {<NEW_LINE>buf.writeDouble(values[i]);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException("unsupport split for storage " + storage.getClass().getName());<NEW_LINE>}<NEW_LINE>} | ] indices = storage.getIndices(); |
79,490 | private void sortTail() {<NEW_LINE>// size > limit here<NEW_LINE>T[] d = data;<NEW_LINE>int l = limit, s = size;<NEW_LINE>Comparator<? super T> cmp = comparator;<NEW_LINE>Arrays.sort(d, l, s, cmp);<NEW_LINE>if (cmp.compare(d[s - 1], d[0]) < 0) {<NEW_LINE>// Common case: descending sequence<NEW_LINE>// Assume size - limit <= limit here<NEW_LINE>System.arraycopy(d, 0, d, s - l, 2 * l - s);<NEW_LINE>System.arraycopy(d, l, d, 0, s - l);<NEW_LINE>} else {<NEW_LINE>// Merge presorted 0..limit-1 and limit..size-1<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>T[] buf = (T[]) new Object[l];<NEW_LINE>int i = 0, j = l, k = 0;<NEW_LINE>// d[l-1] is guaranteed to be the worst element, thus no need to<NEW_LINE>// check it<NEW_LINE>while (i < l - 1 && k < l && j < s) {<NEW_LINE>if (cmp.compare(d[i], d[j]) <= 0) {<NEW_LINE>buf[k++] = d[i++];<NEW_LINE>} else {<NEW_LINE>buf[k++] = d[j++];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (k < l) {<NEW_LINE>System.arraycopy(d, i < l - 1 ? i : j, <MASK><NEW_LINE>}<NEW_LINE>System.arraycopy(buf, 0, d, 0, k);<NEW_LINE>}<NEW_LINE>size = l;<NEW_LINE>} | d, k, l - k); |
889,093 | private int insertFromValues(String sql, Insert insert, String index, int maxRequestsPerBulk) throws SQLException {<NEW_LINE>Heading heading = new Heading();<NEW_LINE>QueryState state = new BasicQueryState(sql, heading, this.props);<NEW_LINE>List<Object> values = updateParser.parse(insert, state);<NEW_LINE>if (state.hasException())<NEW_LINE>throw state.getException();<NEW_LINE>if (heading.hasLabel("_index") || heading.hasLabel("_type"))<NEW_LINE>throw new SQLException("Not possible to set _index and _type fields");<NEW_LINE>String[] indexAndType = this.getIndexAndType(insert.getTarget().toString(), sql, "into\\s+", "\\s+values", index);<NEW_LINE>index = indexAndType[0];<NEW_LINE>String type = indexAndType[1];<NEW_LINE>if (values.size() % heading.getColumnCount() != 0)<NEW_LINE>throw new SQLException("Number of columns does not match number of values for one of the inserts");<NEW_LINE>List<IndexRequestBuilder> indexReqs = new ArrayList<IndexRequestBuilder>();<NEW_LINE>int indexCount = 0;<NEW_LINE>int valueIdx = 0;<NEW_LINE>while (valueIdx < values.size()) {<NEW_LINE>HashMap<String, Object> fieldValues = new HashMap<String, Object>();<NEW_LINE>String id = null;<NEW_LINE>for (Column col : heading.columns()) {<NEW_LINE>Object value = values.get(valueIdx);<NEW_LINE>valueIdx++;<NEW_LINE>if (col.getColumn().equals("_id")) {<NEW_LINE>id = value.toString();<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (col.getColumn().indexOf('.') == -1) {<NEW_LINE>fieldValues.put(col.getColumn(), value);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// create nested object<NEW_LINE>Map<String, Object> map = fieldValues;<NEW_LINE>String[] objectDef = col.getColumn().split("\\.");<NEW_LINE>for (int k = 0; k < objectDef.length; k++) {<NEW_LINE>String key = objectDef[k];<NEW_LINE>if (k == objectDef.length - 1)<NEW_LINE><MASK><NEW_LINE>else {<NEW_LINE>if (!map.containsKey(key))<NEW_LINE>map.put(key, new HashMap<String, Object>());<NEW_LINE>map = (Map<String, Object>) map.get(key);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// create index request<NEW_LINE>IndexRequestBuilder indexReq = client.prepareIndex().setIndex(index).setType(type);<NEW_LINE>if (id != null)<NEW_LINE>indexReq.setId(id);<NEW_LINE>indexReq.setSource(fieldValues);<NEW_LINE>indexReqs.add(indexReq);<NEW_LINE>if (indexReqs.size() >= maxRequestsPerBulk) {<NEW_LINE>indexCount += this.execute(indexReqs, maxRequestsPerBulk);<NEW_LINE>indexReqs.clear();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (indexReqs.size() > 0)<NEW_LINE>indexCount += this.execute(indexReqs, maxRequestsPerBulk);<NEW_LINE>return indexCount;<NEW_LINE>} | map.put(key, value); |
1,192,363 | public void testLocalMethodwithRemoteExAndSub() throws Exception {<NEW_LINE>SLRemoteExLocal remoteExLocal = lookupSLRemoteExBeanLocal();<NEW_LINE>// verify method with throws exception may be called without an exception<NEW_LINE>remoteExLocal.testMethodwithRemoteExAndSub("none");<NEW_LINE>try {<NEW_LINE>remoteExLocal.testMethodwithRemoteExAndSub("RemoteException");<NEW_LINE>fail("Expected RemoteException was not thrown");<NEW_LINE>} catch (EJBException ex) {<NEW_LINE>Throwable rootex = ex.getCause();<NEW_LINE>assertTrue("Exception is not RemoteException : " + rootex.getClass().getName(), rootex.getClass() == RemoteException.class);<NEW_LINE>assertEquals("Wrong Exception message received", "RemoteException", rootex.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>remoteExLocal.testMethodwithRemoteExAndSub("SLRemoteException");<NEW_LINE>fail("Expected SLRemoteException was not thrown");<NEW_LINE>} catch (EJBException ex) {<NEW_LINE>Throwable rootex = ex.getCause();<NEW_LINE>assertTrue("Exception is not SLRemoteException : " + rootex.getClass().getName(), rootex.getClass() == SLRemoteException.class);<NEW_LINE>assertEquals("Wrong Exception message received", "SLRemoteException", rootex.getMessage());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>remoteExLocal.testMethodwithRemoteExAndSub("RuntimeException");<NEW_LINE>fail("Expected RuntimeException was not thrown");<NEW_LINE>} catch (EJBException ex) {<NEW_LINE>// (UnknownLocalException ex) {<NEW_LINE>Throwable rootex = ex.getCause();<NEW_LINE>assertTrue("Exception is not RuntimeException : " + rootex.getClass().getName(), rootex.getClass() == RuntimeException.class);<NEW_LINE>assertEquals("Wrong Exception message received", <MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>remoteExLocal.testMethodwithRemoteExAndSub("IllegalStateException");<NEW_LINE>fail("Expected IllegalStateException was not thrown");<NEW_LINE>} catch (EJBException ex) {<NEW_LINE>// (UnknownLocalException ex) {<NEW_LINE>Throwable rootex = ex.getCause();<NEW_LINE>assertTrue("Exception is not IllegalStateException : " + rootex.getClass().getName(), rootex.getClass() == IllegalStateException.class);<NEW_LINE>assertEquals("Wrong Exception message received", "IllegalStateException", rootex.getMessage());<NEW_LINE>}<NEW_LINE>} | "RuntimeException", rootex.getMessage()); |
119,204 | private BeamRelNode convertToBeamRelInternal(String sql, QueryParameters queryParams) {<NEW_LINE>RelRoot root = plannerImpl.rel(sql, queryParams);<NEW_LINE>RelTraitSet desiredTraits = root.rel.getTraitSet().replace(BeamLogicalConvention.INSTANCE).replace(root.collation).simplify();<NEW_LINE>// beam physical plan<NEW_LINE>root.rel.getCluster().setMetadataProvider(ChainedRelMetadataProvider.of(org.apache.beam.vendor.calcite.v1_28_0.com.google.common.collect.ImmutableList.of(NonCumulativeCostImpl.SOURCE, RelMdNodeStats.SOURCE, root.rel.getCluster().getMetadataProvider())));<NEW_LINE>root.rel.getCluster().setMetadataQuerySupplier(BeamRelMetadataQuery::instance);<NEW_LINE>RelMetadataQuery.THREAD_PROVIDERS.set(JaninoRelMetadataProvider.of(root.rel.getCluster().getMetadataProvider()));<NEW_LINE>root.rel.getCluster().invalidateMetadataQuery();<NEW_LINE>try {<NEW_LINE>BeamRelNode beamRelNode = (BeamRelNode) plannerImpl.transform(<MASK><NEW_LINE>LOG.info("BEAMPlan>\n" + RelOptUtil.toString(beamRelNode));<NEW_LINE>return beamRelNode;<NEW_LINE>} catch (RelOptPlanner.CannotPlanException e) {<NEW_LINE>throw new SqlConversionException("Failed to produce plan for query " + sql, e);<NEW_LINE>}<NEW_LINE>} | 0, desiredTraits, root.rel); |
940,316 | public void updateGui() {<NEW_LINE>// Note: There is a reason for why we have to update the toolbar<NEW_LINE>// from the outside. The toolbar can not update itself because<NEW_LINE>// the toolbar state depends on the state of the TID box in the<NEW_LINE>// debug panel.<NEW_LINE>final IDebugger debugger = m_debugger.getCurrentSelectedDebugger();<NEW_LINE>final TargetProcessThread activeThread = debugger == null ? null : debugger.getProcessManager().getActiveThread();<NEW_LINE>final boolean connected = (debugger != null) && debugger.isConnected();<NEW_LINE>final boolean suspended = connected && (activeThread != null);<NEW_LINE>m_startAction.setEnabled(!connected);<NEW_LINE>final boolean haltBeforeCommunicating = (debugger != null) && connected && (debugger.getProcessManager().getTargetInformation() != null) && debugger.getProcessManager().getTargetInformation().getDebuggerOptions().mustHaltBeforeCommunicating();<NEW_LINE>m_detachAction.setEnabled(connected <MASK><NEW_LINE>m_terminateAction.setEnabled(connected);<NEW_LINE>m_stepIntoAction.setEnabled(connected && suspended);<NEW_LINE>m_stepIntoAction.setEnabled(connected && suspended);<NEW_LINE>m_stepOverAction.setEnabled(connected && suspended);<NEW_LINE>m_stepBlockAction.setEnabled(connected && suspended);<NEW_LINE>m_stepEndAction.setEnabled(connected && suspended);<NEW_LINE>m_resumeAction.setEnabled(connected && suspended);<NEW_LINE>m_haltAction.setEnabled(connected && !suspended);<NEW_LINE>final boolean tracing = (debugger != null) && m_debugger.getTraceLogger(debugger).hasEchoBreakpoints();<NEW_LINE>m_startTraceAction.setEnabled(connected && (!haltBeforeCommunicating || suspended));<NEW_LINE>m_stopTraceAction.setEnabled(connected && tracing && (!haltBeforeCommunicating || suspended));<NEW_LINE>} | && (!haltBeforeCommunicating || suspended)); |
726,109 | public static GregorianCalendar unpackDate(byte[] timestamp) {<NEW_LINE>final int minute = ByteUtils.<MASK><NEW_LINE>final int year = ByteUtils.getBitsFromBuffer(timestamp, 16, 7) + 2000;<NEW_LINE>final int month = ByteUtils.getBitsFromBuffer(timestamp, 23, 4);<NEW_LINE>final int day = ByteUtils.getBitsFromBuffer(timestamp, 27, 5);<NEW_LINE>// Log.i(TAG, "unpackDate: " + minute + " minutes, " + year + '-' + month + '-' + day);<NEW_LINE>if (minute > 1440) {<NEW_LINE>throw new AssertionError("Minute > 1440");<NEW_LINE>}<NEW_LINE>if (minute < 0) {<NEW_LINE>throw new AssertionError("Minute < 0");<NEW_LINE>}<NEW_LINE>if (day > 31) {<NEW_LINE>throw new AssertionError("Day > 31");<NEW_LINE>}<NEW_LINE>if (month > 12) {<NEW_LINE>throw new AssertionError("Month > 12");<NEW_LINE>}<NEW_LINE>GregorianCalendar d = new GregorianCalendar(year, month - 1, day);<NEW_LINE>d.add(Calendar.MINUTE, minute);<NEW_LINE>return d;<NEW_LINE>} | getBitsFromBuffer(timestamp, 5, 11); |
191,430 | public void updateMetadata(String catalog, String table) throws TException {<NEW_LINE>HEAVYDBLOGGER.debug("Received invalidation from server for " + catalog + " : " + table);<NEW_LINE>long timer = System.currentTimeMillis();<NEW_LINE>callCount++;<NEW_LINE>HeavyDBParser parser;<NEW_LINE>try {<NEW_LINE>parser = (HeavyDBParser) parserPool.borrowObject();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>String msg = "Could not get Parse Item from pool: " + ex.getMessage();<NEW_LINE>HEAVYDBLOGGER.error(msg, ex);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CURRENT_PARSER.set(parser);<NEW_LINE>try {<NEW_LINE>parser.updateMetaData(catalog, table);<NEW_LINE>} finally {<NEW_LINE>CURRENT_PARSER.set(null);<NEW_LINE>try {<NEW_LINE>// put parser object back in pool for others to use<NEW_LINE>HEAVYDBLOGGER.debug("Returning object to pool");<NEW_LINE>parserPool.returnObject(parser);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>String msg = "Could not return parse object: " + ex.getMessage();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | HEAVYDBLOGGER.error(msg, ex); |
341,487 | public void updateAnimation() {<NEW_LINE>if (current == null) {<NEW_LINE>copyFrom(Minecraft.getMinecraft().getTextureMapBlocks().getMissingSprite());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Profiler p = Minecraft.getMinecraft().mcProfiler;<NEW_LINE>// MAPPING: func_194340_a: Profiler.startSection<NEW_LINE>p.<MASK><NEW_LINE>if (needsSwapping) {<NEW_LINE>p.startSection("copy");<NEW_LINE>current.copyFrom(this);<NEW_LINE>p.endSection();<NEW_LINE>}<NEW_LINE>if (current.hasAnimationMetadata() && BCLibConfig.enableAnimatedSprites) {<NEW_LINE>p.startSection("update");<NEW_LINE>p.startSection(getIconName());<NEW_LINE>current.updateAnimation();<NEW_LINE>p.endSection();<NEW_LINE>p.endSection();<NEW_LINE>} else if (needsSwapping) {<NEW_LINE>p.startSection("swap");<NEW_LINE>TextureUtil.uploadTextureMipmap(current.getFrameTextureData(0), current.getIconWidth(), current.getIconHeight(), current.getOriginX(), current.getOriginY(), false, false);<NEW_LINE>p.endSection();<NEW_LINE>}<NEW_LINE>needsSwapping = false;<NEW_LINE>p.endSection();<NEW_LINE>} | func_194340_a(getClass()::getSimpleName); |
1,633,000 | protected void grabVideo() {<NEW_LINE>int iplDepth = IPL_DEPTH_8U;<NEW_LINE>org.bytedeco.libfreenect2.Frame rgb = frames.get(org.bytedeco.libfreenect2.Frame.Color);<NEW_LINE>int channels = <MASK><NEW_LINE>int deviceWidth = (int) rgb.width();<NEW_LINE>int deviceHeight = (int) rgb.height();<NEW_LINE>BytePointer rawVideoImageData = rgb.data();<NEW_LINE>if (rawVideoImage == null) {<NEW_LINE>rawVideoImage = IplImage.createHeader(deviceWidth, deviceHeight, iplDepth, channels);<NEW_LINE>}<NEW_LINE>cvSetData(rawVideoImage, rawVideoImageData, deviceWidth * channels * iplDepth / 8);<NEW_LINE>if (videoImageRGBA == null) {<NEW_LINE>videoImageRGBA = rawVideoImage.clone();<NEW_LINE>}<NEW_LINE>cvCvtColor(rawVideoImage, videoImageRGBA, COLOR_BGRA2RGBA);<NEW_LINE>} | (int) rgb.bytes_per_pixel(); |
1,361,375 | private static void runAssertionSimple(RegressionEnvironment env, String epl) {<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>String deploymentId = env.deploymentId("s0");<NEW_LINE>sendEvent(env, null, "E1", 10);<NEW_LINE>assertTotal(env, null, 10);<NEW_LINE>env.milestone(0);<NEW_LINE>env.stageService().getStage("P1");<NEW_LINE>stageIt(env, "P1", deploymentId);<NEW_LINE>env.milestone(1);<NEW_LINE>assertNull(env.deployment().getDeployment(deploymentId));<NEW_LINE>assertNotNull(env.stageService().getExistingStage("P1").getDeploymentService().getDeployment(deploymentId));<NEW_LINE>assertEqualsAnyOrder(new String[] { deploymentId }, env.stageService().getExistingStage("P1").getDeploymentService().getDeployments());<NEW_LINE>sendEvent(env, null, "E3", 21);<NEW_LINE>sendEvent(env, "P1", "E4", 22);<NEW_LINE>assertTotal(env, "P1", 10 + 22);<NEW_LINE>env.milestone(2);<NEW_LINE>unstageIt(env, "P1", deploymentId);<NEW_LINE>env.milestone(3);<NEW_LINE>assertNotNull(env.deployment().getDeployment(deploymentId));<NEW_LINE>assertNull(env.stageService().getExistingStage("P1").getDeploymentService().getDeployment(deploymentId));<NEW_LINE>sendEvent(env, null, "E5", 31);<NEW_LINE>sendEvent(env, "P1", "E6", 32);<NEW_LINE>assertTotal(env, null, 10 + 22 + 31);<NEW_LINE>env.assertThat(() -> {<NEW_LINE>SupportListener listener = env.listener("s0");<NEW_LINE>env.undeployAll();<NEW_LINE>sendEvent(<MASK><NEW_LINE>assertFalse(listener.getAndClearIsInvoked());<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>} | env, null, "end", 99); |
763,044 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>if (BuildConfig.DEBUG) {<NEW_LINE>StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build());<NEW_LINE>StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder().detectLeakedSqlLiteObjects().detectLeakedClosableObjects().penaltyLog().<MASK><NEW_LINE>}<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>Log.d(TAG, "onCreate");<NEW_LINE>setContentView(R.layout.activity_chooser);<NEW_LINE>// Set up ListView and Adapter<NEW_LINE>ListView listView = findViewById(R.id.test_activity_list_view);<NEW_LINE>MyArrayAdapter adapter = new MyArrayAdapter(this, android.R.layout.simple_list_item_2, CLASSES);<NEW_LINE>adapter.setDescriptionIds(DESCRIPTION_IDS);<NEW_LINE>listView.setAdapter(adapter);<NEW_LINE>listView.setOnItemClickListener(this);<NEW_LINE>if (!allPermissionsGranted()) {<NEW_LINE>getRuntimePermissions();<NEW_LINE>}<NEW_LINE>} | penaltyDeath().build()); |
338,191 | public void put(ThreadContext context, StructLayout.Storage cache, Member m, AbstractMemory ptr, IRubyObject value) {<NEW_LINE>DynamicMethod conversionMethod;<NEW_LINE>if (value instanceof Pointer) {<NEW_LINE>ptr.getMemoryIO().putMemoryIO(m.offset, ((Pointer) value).getMemoryIO());<NEW_LINE>} else if (value instanceof Struct) {<NEW_LINE>MemoryIO mem = ((Struct) value).getMemoryIO();<NEW_LINE>if (!mem.isDirect()) {<NEW_LINE>throw context.runtime.newArgumentError("Struct memory not backed by a native pointer");<NEW_LINE>}<NEW_LINE>ptr.getMemoryIO().putMemoryIO(m.offset, mem);<NEW_LINE>} else if (value instanceof RubyInteger) {<NEW_LINE>ptr.getMemoryIO().putAddress(m.offset, Util.int64Value(value));<NEW_LINE>} else if (value.isNil()) {<NEW_LINE>ptr.getMemoryIO().putAddress(m.offset, 0L);<NEW_LINE>} else if (!(conversionMethod = value.getMetaClass().searchMethod("to_ptr")).isUndefined()) {<NEW_LINE>IRubyObject addr = conversionMethod.call(context, value, value.getMetaClass(), "to_ptr");<NEW_LINE>if (addr instanceof Pointer) {<NEW_LINE>ptr.getMemoryIO().putMemoryIO(m.offset, ((Pointer) addr).getMemoryIO());<NEW_LINE>} else {<NEW_LINE>throw context.runtime.newArgumentError("Invalid pointer value");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw <MASK><NEW_LINE>}<NEW_LINE>cache.putReference(m, value);<NEW_LINE>} | context.runtime.newArgumentError("Invalid pointer value"); |
526,945 | public static <T, M extends Classifier<T>> ClassificationValidation<M> of(T[] x, int[] y, T[] testx, int[] testy, BiFunction<T[], int[], M> trainer) {<NEW_LINE>long start = System.nanoTime();<NEW_LINE>M model = trainer.apply(x, y);<NEW_LINE>double fitTime = (System.nanoTime() - start) / 1E6;<NEW_LINE>start = System.nanoTime();<NEW_LINE>if (model.soft()) {<NEW_LINE>int k = model.numClasses();<NEW_LINE>double[][] posteriori = new double[testx.length][k];<NEW_LINE>int[] prediction = model.predict(testx, posteriori);<NEW_LINE>double scoreTime = (System.nanoTime() - start) / 1E6;<NEW_LINE>return new ClassificationValidation<>(model, fitTime, <MASK><NEW_LINE>} else {<NEW_LINE>int[] prediction = model.predict(testx);<NEW_LINE>double scoreTime = (System.nanoTime() - start) / 1E6;<NEW_LINE>return new ClassificationValidation<>(model, fitTime, scoreTime, testy, prediction);<NEW_LINE>}<NEW_LINE>} | scoreTime, testy, prediction, posteriori); |
1,674,099 | private InitiateAuthRequest initiateCustomAuthRequest(final Map<String, String> clientMetadata, final AuthenticationDetails authenticationDetails, final AuthenticationHelper authenticationHelper) {<NEW_LINE>final InitiateAuthRequest authRequest = new InitiateAuthRequest();<NEW_LINE>authRequest.setAuthFlow(CognitoServiceConstants.AUTH_TYPE_INIT_CUSTOM_AUTH);<NEW_LINE>authRequest.setClientId(clientId);<NEW_LINE>authRequest.setClientMetadata(clientMetadata);<NEW_LINE>Map<String, String> authenticationParameters = authenticationDetails.getAuthenticationParameters();<NEW_LINE>if (clientSecret != null && authenticationParameters.get(CognitoServiceConstants.AUTH_PARAM_SECRET_HASH) == null) {<NEW_LINE>secretHash = CognitoSecretHash.getSecretHash(authenticationDetails.getUserId(), clientId, clientSecret);<NEW_LINE>authenticationParameters.put(CognitoServiceConstants.AUTH_PARAM_SECRET_HASH, secretHash);<NEW_LINE>}<NEW_LINE>if (CognitoServiceConstants.AUTH_PARAM_SRP_A.equals(authenticationDetails.getCustomChallenge())) {<NEW_LINE>authenticationParameters.put(CognitoServiceConstants.AUTH_PARAM_SRP_A, authenticationHelper.getA().toString(16));<NEW_LINE>}<NEW_LINE>authRequest.setAuthParameters(authenticationDetails.getAuthenticationParameters());<NEW_LINE>if (authenticationDetails.getValidationData() != null && authenticationDetails.getValidationData().size() > 0) {<NEW_LINE>final Map<String, String> userValidationData = new <MASK><NEW_LINE>for (final AttributeType attribute : authenticationDetails.getValidationData()) {<NEW_LINE>userValidationData.put(attribute.getName(), attribute.getValue());<NEW_LINE>}<NEW_LINE>authRequest.setClientMetadata(userValidationData);<NEW_LINE>}<NEW_LINE>authRequest.setUserContextData(getUserContextData());<NEW_LINE>return authRequest;<NEW_LINE>} | HashMap<String, String>(); |
688,749 | private Collection<TextEdge> calculateExtendedEdges(Integer numOfLines, Map<Integer, List<TextChunk>> currDirectedEdges, Integer left, Integer right, Integer mid, Integer minDistToMid) {<NEW_LINE>Set<TextEdge> extendedEdges = new HashSet<>();<NEW_LINE>Iterator<Map.Entry<Integer, List<TextChunk>>> edgeIterator = currDirectedEdges.entrySet().iterator();<NEW_LINE>while (edgeIterator.hasNext()) {<NEW_LINE>Map.Entry<Integer, List<TextChunk><MASK><NEW_LINE>Integer key = entry.getKey();<NEW_LINE>// if mid and minDistToMid are set, we calculate if the distance to mid is actually above,<NEW_LINE>// otherwise we ignore it<NEW_LINE>boolean hasMinDistToMid = mid == null || minDistToMid == null || Math.abs(key - mid) > minDistToMid;<NEW_LINE>if (key > left && key < right && hasMinDistToMid) {<NEW_LINE>edgeIterator.remove();<NEW_LINE>List<TextChunk> edgeChunks = entry.getValue();<NEW_LINE>if (edgeChunks.size() >= REQUIRED_TEXT_LINES_FOR_EDGE) {<NEW_LINE>TextEdge edge = getEdgeFromChunks(numOfLines, key, edgeChunks);<NEW_LINE>extendedEdges.add(edge);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return extendedEdges;<NEW_LINE>} | > entry = edgeIterator.next(); |
1,001,407 | final GetIdentityPoolConfigurationResult executeGetIdentityPoolConfiguration(GetIdentityPoolConfigurationRequest getIdentityPoolConfigurationRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getIdentityPoolConfigurationRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetIdentityPoolConfigurationRequest> request = null;<NEW_LINE>Response<GetIdentityPoolConfigurationResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetIdentityPoolConfigurationRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getIdentityPoolConfigurationRequest));<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.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetIdentityPoolConfiguration");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetIdentityPoolConfigurationResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetIdentityPoolConfigurationResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.SERVICE_ID, "Cognito Sync"); |
1,132,584 | public okhttp3.Call connectPatchNamespacedServiceProxyCall(String name, String namespace, String path, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/api/v1/namespaces/{namespace}/services/{name}/proxy".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())).replaceAll("\\{" + "namespace" + "\\}", localVarApiClient.escapeString<MASK><NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (path != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("path", path));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "*/*" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "PATCH", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | (namespace.toString())); |
825,473 | // HLS only supports a small subset of the defined file types.<NEW_LINE>@SuppressLint("SwitchIntDef")<NEW_LINE>@Nullable<NEW_LINE>private Extractor createExtractorByFileType(@FileTypes.Type int fileType, Format format, @Nullable List<Format> muxedCaptionFormats, TimestampAdjuster timestampAdjuster) {<NEW_LINE>switch(fileType) {<NEW_LINE>case FileTypes.WEBVTT:<NEW_LINE>return new WebvttExtractor(format.language, timestampAdjuster);<NEW_LINE>case FileTypes.ADTS:<NEW_LINE>return new AdtsExtractor();<NEW_LINE>case FileTypes.AC3:<NEW_LINE>return new Ac3Extractor();<NEW_LINE>case FileTypes.AC4:<NEW_LINE>return new Ac4Extractor();<NEW_LINE>case FileTypes.MP3:<NEW_LINE>return new Mp3Extractor(/* flags= */<NEW_LINE>0, /* forcedFirstSampleTimestampUs= */<NEW_LINE>0);<NEW_LINE>case FileTypes.MP4:<NEW_LINE>return <MASK><NEW_LINE>case FileTypes.TS:<NEW_LINE>return createTsExtractor(payloadReaderFactoryFlags, exposeCea608WhenMissingDeclarations, format, muxedCaptionFormats, timestampAdjuster);<NEW_LINE>default:<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | createFragmentedMp4Extractor(timestampAdjuster, format, muxedCaptionFormats); |
787,549 | private void addToMap(Map<FileSystem, Set<FileObject>> map, FileObject fo, boolean removeFromCache) {<NEW_LINE>if (fo == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FileSystem fs;<NEW_LINE>try {<NEW_LINE>fs = fo.getFileSystem();<NEW_LINE>} catch (FileStateInvalidException e) {<NEW_LINE>// ignore files in invalid filesystems<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>synchronized (map) {<NEW_LINE>Set<FileObject> <MASK><NEW_LINE>if (set == null) {<NEW_LINE>set = new HashSet<FileObject>();<NEW_LINE>map.put(fs, set);<NEW_LINE>}<NEW_LINE>set.add(fo);<NEW_LINE>if (removeFromCache) {<NEW_LINE>if (LOG.isLoggable(Level.FINER)) {<NEW_LINE>// TODO: remove after fix<NEW_LINE>// NOI18N<NEW_LINE>LOG.log(Level.FINER, "addToMap(): removing from cache {0}", new Object[] { fo });<NEW_LINE>}<NEW_LINE>labelCache.removeAllFor(fo);<NEW_LINE>iconCache.removeAllFor(fo);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | set = map.get(fs); |
569,289 | public static void connectTextBasedFilter(TreeViewer viewer, LiveExpression<Filter<String>> searchBoxModel, LabelProvider labels, ITreeContentProvider treeContent) {<NEW_LINE>TreeAwareViewerFilter viewerFilter = new TreeAwareViewerFilter(viewer, Filters.acceptAll(), labels, treeContent);<NEW_LINE>Disposable disposable = searchBoxModel.onChange(UIValueListener.from((e, filter) -> {<NEW_LINE>viewerFilter.setFilter(searchBoxModel.getValue());<NEW_LINE>viewer.refresh(true);<NEW_LINE>}));<NEW_LINE>// TODO: what if there are existing filters?<NEW_LINE>viewer.setFilters(viewerFilter);<NEW_LINE>viewer.getControl().addDisposeListener(de -> {<NEW_LINE>disposable.dispose();<NEW_LINE>});<NEW_LINE>Stylers stylers = new Stylers(viewer.getTree().getFont());<NEW_LINE>viewer.getControl().addDisposeListener(de -> {<NEW_LINE>disposable.dispose();<NEW_LINE>stylers.dispose();<NEW_LINE>});<NEW_LINE>ILabelProvider baseLabels = (ILabelProvider) viewer.getLabelProvider();<NEW_LINE>// Can't add bolding support without this! Ensure label provider is set before calling this method<NEW_LINE>Assert.isNotNull(baseLabels);<NEW_LINE>viewer.setLabelProvider(boldMatchedElements(stylers, baseLabels, <MASK><NEW_LINE>} | Filters.delegatingTo(searchBoxModel))); |
654,689 | private JCMethodDecl generateBuilderMethod(SuperBuilderJob job) {<NEW_LINE>JavacTreeMaker maker = job.getTreeMaker();<NEW_LINE>JCExpression call = maker.NewClass(null, List.<JCExpression>nil(), namePlusTypeParamsToTypeReference(maker, job.parentType, job.toName(job.builderImplClassName), false, job.typeParams), List.<JCExpression>nil(), null);<NEW_LINE>JCStatement <MASK><NEW_LINE>JCBlock body = maker.Block(0, List.<JCStatement>of(statement));<NEW_LINE>int modifiers = Flags.PUBLIC;<NEW_LINE>modifiers |= Flags.STATIC;<NEW_LINE>// Add any type params of the annotated class to the return type.<NEW_LINE>ListBuffer<JCExpression> typeParameterNames = new ListBuffer<JCExpression>();<NEW_LINE>typeParameterNames.appendList(typeParameterNames(maker, job.typeParams));<NEW_LINE>// Now add the <?, ?>.<NEW_LINE>JCWildcard wildcard = maker.Wildcard(maker.TypeBoundKind(BoundKind.UNBOUND), null);<NEW_LINE>typeParameterNames.append(wildcard);<NEW_LINE>typeParameterNames.append(wildcard);<NEW_LINE>// And return type annotations.<NEW_LINE>List<JCAnnotation> annsOnParamType = List.nil();<NEW_LINE>if (job.checkerFramework.generateUnique())<NEW_LINE>annsOnParamType = List.of(maker.Annotation(genTypeRef(job.parentType, CheckerFrameworkVersion.NAME__UNIQUE), List.<JCExpression>nil()));<NEW_LINE>JCTypeApply returnType = maker.TypeApply(namePlusTypeParamsToTypeReference(maker, job.parentType, job.toName(job.builderAbstractClassName), false, List.<JCTypeParameter>nil(), annsOnParamType), typeParameterNames.toList());<NEW_LINE>List<JCAnnotation> annsOnMethod = job.checkerFramework.generateSideEffectFree() ? List.of(maker.Annotation(genTypeRef(job.parentType, CheckerFrameworkVersion.NAME__SIDE_EFFECT_FREE), List.<JCExpression>nil())) : List.<JCAnnotation>nil();<NEW_LINE>JCMethodDecl methodDef = maker.MethodDef(maker.Modifiers(modifiers, annsOnMethod), job.toName(job.builderMethodName), returnType, copyTypeParams(job.sourceNode, job.typeParams), List.<JCVariableDecl>nil(), List.<JCExpression>nil(), body, null);<NEW_LINE>createRelevantNonNullAnnotation(job.parentType, methodDef);<NEW_LINE>return methodDef;<NEW_LINE>} | statement = maker.Return(call); |
842,817 | public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {<NEW_LINE>super.onViewCreated(view, savedInstanceState);<NEW_LINE>mDelegate = new OsmAuthFragmentDelegate(this) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void loginOsm() {<NEW_LINE>((BaseMwmFragmentActivity) getActivity()).replaceFragment(OsmAuthFragment.class, null, null);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>mDelegate.onViewCreated(view, savedInstanceState);<NEW_LINE>getToolbarController().setTitle(R.string.login);<NEW_LINE>mEtLogin = (EditText) view.findViewById(R.id.osm_username);<NEW_LINE>mEtPassword = (EditText) view.findViewById(R.id.osm_password);<NEW_LINE>mTvLogin = (TextView) view.findViewById(R.id.login);<NEW_LINE>mTvLogin.setOnClickListener(this);<NEW_LINE>mTvLostPassword = view.<MASK><NEW_LINE>mTvLostPassword.setOnClickListener(this);<NEW_LINE>mProgress = (ProgressBar) view.findViewById(R.id.osm_login_progress);<NEW_LINE>mProgress.getIndeterminateDrawable().setColorFilter(new LightingColorFilter(0xFF000000, 0xFFFFFF));<NEW_LINE>UiUtils.hide(mProgress);<NEW_LINE>} | findViewById(R.id.lost_password); |
1,570,217 | public void search(Vec query, int numNeighbors, List<Integer> neighbors, List<Double> distances) {<NEW_LINE>neighbors.clear();<NEW_LINE>distances.clear();<NEW_LINE>BoundedSortedList<IndexDistPair> knn = new BoundedSortedList<>(numNeighbors);<NEW_LINE>List<Double> <MASK><NEW_LINE>// Find the best representative r_q<NEW_LINE>double tmp;<NEW_LINE>double bestDist = Double.POSITIVE_INFINITY;<NEW_LINE>int bestRep = 0;<NEW_LINE>for (int i = 0; i < R.size(); i++) if ((tmp = dm.dist(R.get(i), query, qi, allVecs, distCache)) < bestDist) {<NEW_LINE>bestRep = i;<NEW_LINE>bestDist = tmp;<NEW_LINE>}<NEW_LINE>knn.add(new IndexDistPair(R.get(bestRep), bestDist));<NEW_LINE>for (int v : ownedVecs.get(bestRep)) knn.add(new IndexDistPair(v, dm.dist(v, query, qi, allVecs, distCache)));<NEW_LINE>for (IndexDistPair v : knn) {<NEW_LINE>neighbors.add(v.getIndex());<NEW_LINE>distances.add(v.getDist());<NEW_LINE>}<NEW_LINE>} | qi = dm.getQueryInfo(query); |
36,847 | protected DdlJob buildDdlJob(BaseDdlOperation logicalDdlPlan, ExecutionContext executionContext) {<NEW_LINE>LogicalAlterTableSetTableGroup logicalAlterTableSetTableGroup = (LogicalAlterTableSetTableGroup) logicalDdlPlan;<NEW_LINE>logicalAlterTableSetTableGroup.preparedData();<NEW_LINE><MASK><NEW_LINE>final SchemaManager schemaManager = executionContext.getSchemaManager();<NEW_LINE>PartitionInfo sourcePartitionInfo = schemaManager.getTable(logicalAlterTableSetTableGroup.getTableName()).getPartitionInfo();<NEW_LINE>AlterTableSetTableGroupBuilder builder = new AlterTableSetTableGroupBuilder(logicalAlterTableSetTableGroup.relDdl, preparedData, executionContext).build();<NEW_LINE>PhysicalPlanData physicalPlanData;<NEW_LINE>if (!builder.isOnlyChangeSchemaMeta()) {<NEW_LINE>builder.getPhysicalPlans().forEach(o -> o.setPartitionInfo(sourcePartitionInfo));<NEW_LINE>physicalPlanData = builder.genPhysicalPlanData();<NEW_LINE>} else {<NEW_LINE>physicalPlanData = null;<NEW_LINE>}<NEW_LINE>return new AlterTableSetTableGroupJobFactory(logicalAlterTableSetTableGroup.relDdl, preparedData, physicalPlanData, builder.getSourceTableTopology(), builder.getTargetTableTopology(), builder.getNewPartitionRecords(), executionContext).create();<NEW_LINE>} | AlterTableSetTableGroupPreparedData preparedData = logicalAlterTableSetTableGroup.getPreparedData(); |
221,817 | protected void configurePipeline(ChannelHandlerContext ctx, String protocol) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(format(ctx.channel(), "Negotiated application-level protocol [" + protocol + "]"));<NEW_LINE>}<NEW_LINE>ChannelPipeline p = ctx.pipeline();<NEW_LINE>if (ApplicationProtocolNames.HTTP_2.equals(protocol)) {<NEW_LINE>configureH2Pipeline(p, accessLogEnabled, accessLog, compressPredicate, cookieDecoder, cookieEncoder, formDecoderProvider, forwardedHeaderHandler, http2Settings, listener, mapHandle, metricsRecorder, minCompressionSize, opsFactory, uriTagValue, decoder.validateHeaders());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (ApplicationProtocolNames.HTTP_1_1.equals(protocol)) {<NEW_LINE>configureHttp11Pipeline(p, accessLogEnabled, accessLog, compressPredicate, cookieDecoder, cookieEncoder, decoder, formDecoderProvider, forwardedHeaderHandler, idleTimeout, listener, mapHandle, maxKeepAliveRequests, metricsRecorder, minCompressionSize, uriTagValue);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} | throw new IllegalStateException("unknown protocol: " + protocol); |
353,888 | public static int[] values(int[] v, int t) {<NEW_LINE>ArgChecker.notNull(v, "v");<NEW_LINE>ArgChecker.isTrue((t > <MASK><NEW_LINE>ArgChecker.isTrue((t < v.length), "Invalid number of differences requested, 't' is greater than the number of " + "elements in 'v'. The given 't' was: {} and 'v' contains {} elements", t, v.length);<NEW_LINE>int[] tmp;<NEW_LINE>if (t == 0) {<NEW_LINE>// no differencing done<NEW_LINE>tmp = new int[v.length];<NEW_LINE>System.arraycopy(v, 0, tmp, 0, v.length);<NEW_LINE>} else {<NEW_LINE>tmp = values(v);<NEW_LINE>for (int i = 0; i < t - 1; i++) {<NEW_LINE>tmp = values(tmp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return tmp;<NEW_LINE>} | -1), "Invalid number of differences requested, t must be positive or 0, but was {}", t); |
1,573,251 | public void introspect(PrintWriter writer) {<NEW_LINE>// Grab the Thread MXBean<NEW_LINE>ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean();<NEW_LINE>// Dump count information<NEW_LINE>writer.println("Thread counts:");<NEW_LINE>writer.println("--------------");<NEW_LINE>writer.println(INDENT + "current active: " + threadMXBean.getThreadCount());<NEW_LINE>writer.println(INDENT + " active daemon: " + threadMXBean.getDaemonThreadCount());<NEW_LINE>writer.println(INDENT + " peak active: " + threadMXBean.getPeakThreadCount());<NEW_LINE>writer.println(INDENT + <MASK><NEW_LINE>writer.println();<NEW_LINE>// Get the lock monitor support flags<NEW_LINE>boolean lockedMonitorsSupported = threadMXBean.isObjectMonitorUsageSupported();<NEW_LINE>boolean lockedSynchronizersSupported = threadMXBean.isSynchronizerUsageSupported();<NEW_LINE>if (lockedMonitorsSupported && lockedSynchronizersSupported) {<NEW_LINE>introspectDeadlockedThreads(threadMXBean, writer);<NEW_LINE>} else if (lockedMonitorsSupported) {<NEW_LINE>introspectMonitorDeadlockedThreads(threadMXBean, writer);<NEW_LINE>}<NEW_LINE>writer.println();<NEW_LINE>writer.println("All thread information:");<NEW_LINE>writer.println("-----------------------");<NEW_LINE>dumpThreadInfos(threadMXBean.dumpAllThreads(lockedMonitorsSupported, lockedSynchronizersSupported), writer);<NEW_LINE>} | " total started: " + threadMXBean.getTotalStartedThreadCount()); |
365,042 | public String sendCommand(String command, boolean blocking) {<NEW_LINE>// TODO REFACTOR so that we use the same code in sendCommand and wait<NEW_LINE>logger.log(Level.INFO, "Sending Python command: " + command);<NEW_LINE>String returnCommand = null;<NEW_LINE>try {<NEW_LINE>writer.write(command);<NEW_LINE>writer.flush();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new Py4JNetworkException("Error while sending a command: " + command, e, Py4JNetworkException.ErrorTime.ERROR_ON_SEND);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>while (true) {<NEW_LINE>if (blocking) {<NEW_LINE>returnCommand = this.readBlockingResponse(this.reader);<NEW_LINE>} else {<NEW_LINE>returnCommand = this.readNonBlockingResponse(this.socket, this.reader);<NEW_LINE>}<NEW_LINE>if (returnCommand == null || returnCommand.trim().equals("")) {<NEW_LINE>// TODO LOG AND DO SOMETHING INTELLIGENT<NEW_LINE>throw new Py4JException("Received empty command");<NEW_LINE>} else if (Protocol.isReturnMessage(returnCommand)) {<NEW_LINE>returnCommand = returnCommand.substring(1);<NEW_LINE>logger.log(Level.INFO, "Returning CB command: " + returnCommand);<NEW_LINE>return returnCommand;<NEW_LINE>} else {<NEW_LINE>Command commandObj = commands.get(returnCommand);<NEW_LINE>if (commandObj != null) {<NEW_LINE>commandObj.execute(returnCommand, reader, writer);<NEW_LINE>} else {<NEW_LINE>logger.log(Level.WARNING, "Unknown command " + returnCommand);<NEW_LINE>// TODO SEND BACK AN ERROR?<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// This will make sure that the connection is shut down and not given back to the connections deque.<NEW_LINE>throw new Py4JNetworkException("Error while sending a command: " + command, <MASK><NEW_LINE>}<NEW_LINE>} | e, Py4JNetworkException.ErrorTime.ERROR_ON_RECEIVE); |
689,762 | public static ListListenersByIpResponse unmarshall(ListListenersByIpResponse listListenersByIpResponse, UnmarshallerContext _ctx) {<NEW_LINE>listListenersByIpResponse.setRequestId(_ctx.stringValue("ListListenersByIpResponse.RequestId"));<NEW_LINE>listListenersByIpResponse.setHttpCode(_ctx.stringValue("ListListenersByIpResponse.HttpCode"));<NEW_LINE>listListenersByIpResponse.setTotalCount<MASK><NEW_LINE>listListenersByIpResponse.setMessage(_ctx.stringValue("ListListenersByIpResponse.Message"));<NEW_LINE>listListenersByIpResponse.setPageSize(_ctx.integerValue("ListListenersByIpResponse.PageSize"));<NEW_LINE>listListenersByIpResponse.setPageNumber(_ctx.integerValue("ListListenersByIpResponse.PageNumber"));<NEW_LINE>listListenersByIpResponse.setErrorCode(_ctx.stringValue("ListListenersByIpResponse.ErrorCode"));<NEW_LINE>listListenersByIpResponse.setSuccess(_ctx.booleanValue("ListListenersByIpResponse.Success"));<NEW_LINE>List<Listener> listeners = new ArrayList<Listener>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListListenersByIpResponse.Listeners.Length"); i++) {<NEW_LINE>Listener listener = new Listener();<NEW_LINE>listener.setMd5(_ctx.stringValue("ListListenersByIpResponse.Listeners[" + i + "].Md5"));<NEW_LINE>listener.setDataId(_ctx.stringValue("ListListenersByIpResponse.Listeners[" + i + "].DataId"));<NEW_LINE>listener.setGroup(_ctx.stringValue("ListListenersByIpResponse.Listeners[" + i + "].Group"));<NEW_LINE>listeners.add(listener);<NEW_LINE>}<NEW_LINE>listListenersByIpResponse.setListeners(listeners);<NEW_LINE>return listListenersByIpResponse;<NEW_LINE>} | (_ctx.integerValue("ListListenersByIpResponse.TotalCount")); |
1,428,419 | public void print() {<NEW_LINE>log.info(m_info.toString());<NEW_LINE>if (m_layout == null)<NEW_LINE>layout();<NEW_LINE>// Paper Attributes: media-printable-area, orientation-requested, media<NEW_LINE>PrintRequestAttributeSet prats = m_layout.getPaper().getPrintRequestAttributeSet();<NEW_LINE>// add: copies, job-name, priority<NEW_LINE>if (m_info.isDocumentCopy() || m_info.getCopies() < 1)<NEW_LINE>prats.add(new Copies(1));<NEW_LINE>else<NEW_LINE>prats.add(new Copies<MASK><NEW_LINE>Locale locale = Language.getLoginLanguage().getLocale();<NEW_LINE>prats.add(new JobName(m_printFormat.getName(), locale));<NEW_LINE>JobPriority priority = PrintUtil.getJobPriority(m_layout.getNumberOfPages(), m_info.getCopies(), true);<NEW_LINE>// check for directly set priority<NEW_LINE>if (m_priority > 0 && m_priority <= 100)<NEW_LINE>priority = new JobPriority(m_priority);<NEW_LINE>prats.add(priority);<NEW_LINE>try {<NEW_LINE>// PrinterJob<NEW_LINE>PrinterJob job = getPrinterJob(m_info.getPrinterName());<NEW_LINE>// job.getPrintService().addPrintServiceAttributeListener(this);<NEW_LINE>// no copy<NEW_LINE>job.setPageable(m_layout.getPageable(false));<NEW_LINE>// Dialog<NEW_LINE>try {<NEW_LINE>if (m_info.isWithDialog() && !job.printDialog(prats))<NEW_LINE>return;<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.WARNING, "Operating System Print Issue, check & try again", e);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// submit<NEW_LINE>boolean printCopy = m_info.isDocumentCopy() && m_info.getCopies() > 1;<NEW_LINE>ArchiveEngine.get().archive(m_layout, m_info);<NEW_LINE>PrintUtil.print(job, prats, false, !m_info.isAsync() || printCopy);<NEW_LINE>// Document: Print Copies<NEW_LINE>if (printCopy) {<NEW_LINE>log.info("Copy " + (m_info.getCopies() - 1));<NEW_LINE>prats.add(new Copies(m_info.getCopies() - 1));<NEW_LINE>job = getPrinterJob(m_info.getPrinterName());<NEW_LINE>// job.getPrintService().addPrintServiceAttributeListener(this);<NEW_LINE>// Copy<NEW_LINE>job.setPageable(m_layout.getPageable(true));<NEW_LINE>PrintUtil.print(job, prats, false, false);<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.log(Level.SEVERE, "", e);<NEW_LINE>}<NEW_LINE>} | (m_info.getCopies())); |
1,689,119 | private PgpSignEncryptResult encryptBackupData(@NonNull BackupKeyringParcel backupInput, @NonNull CryptoInputParcel cryptoInput, @Nullable OutputStream outputStream, Uri plainUri, long exportedDataSize) throws FileNotFoundException {<NEW_LINE>PgpSignEncryptOperation signEncryptOperation = new PgpSignEncryptOperation(mContext, mKeyRepository, mProgressable, mCancelled);<NEW_LINE>PgpSignEncryptData.Builder builder = PgpSignEncryptData.builder();<NEW_LINE>Passphrase passphrase = cryptoInput.getPassphrase();<NEW_LINE>builder.setSymmetricPassphrase(passphrase);<NEW_LINE>builder.setEnableAsciiArmorOutput(backupInput.getEnableAsciiArmorOutput());<NEW_LINE>boolean isNumeric9x4Passphrase = passphrase != null && Numeric9x4PassphraseUtil.isNumeric9x4Passphrase(passphrase);<NEW_LINE>if (isNumeric9x4Passphrase) {<NEW_LINE>builder.setPassphraseFormat("numeric9x4");<NEW_LINE>char[] passphraseChars = passphrase.getCharArray();<NEW_LINE>builder.setPassphraseBegin("" + passphraseChars[0] + passphraseChars[1]);<NEW_LINE>}<NEW_LINE>PgpSignEncryptData pgpSignEncryptData = builder.build();<NEW_LINE>InputStream inStream = mContext.getContentResolver().openInputStream(plainUri);<NEW_LINE>String filename;<NEW_LINE>long[] masterKeyIds = backupInput.getMasterKeyIds();<NEW_LINE>if (masterKeyIds != null && masterKeyIds.length == 1) {<NEW_LINE>filename = Constants.FILE_BACKUP_PREFIX + KeyFormattingUtils.convertKeyIdToHex(masterKeyIds[0]);<NEW_LINE>} else {<NEW_LINE>filename = Constants.FILE_BACKUP_PREFIX + new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()).format(new Date());<NEW_LINE>}<NEW_LINE>filename += backupInput.getExportSecret() ? Constants.FILE_EXTENSION_BACKUP_SECRET : Constants.FILE_EXTENSION_BACKUP_PUBLIC;<NEW_LINE>InputData inputData = new InputData(inStream, exportedDataSize, filename);<NEW_LINE>OutputStream outStream;<NEW_LINE>if (backupInput.getOutputUri() == null) {<NEW_LINE>if (outputStream == null) {<NEW_LINE>throw new IllegalArgumentException("If output uri is not set, outputStream must not be null!");<NEW_LINE>}<NEW_LINE>outStream = outputStream;<NEW_LINE>} else {<NEW_LINE>if (outputStream != null) {<NEW_LINE>throw new IllegalArgumentException("If output uri is set, outputStream must null!");<NEW_LINE>}<NEW_LINE>outStream = mContext.getContentResolver().<MASK><NEW_LINE>}<NEW_LINE>return signEncryptOperation.execute(pgpSignEncryptData, CryptoInputParcel.createCryptoInputParcel(), inputData, outStream);<NEW_LINE>} | openOutputStream(backupInput.getOutputUri()); |
1,456,056 | public void readFrom(MiniDump dump, Builder builder, Object addressSpace, IAbstractAddressSpace memory, boolean is64Bit) throws IOException {<NEW_LINE>// get the thread ID of the failing thread<NEW_LINE>long tid = -1;<NEW_LINE>if (null != dump._j9rasReader) {<NEW_LINE>try {<NEW_LINE>tid = dump._j9rasReader.getThreadID();<NEW_LINE>} catch (UnsupportedOperationException uoe) {<NEW_LINE>// do nothing<NEW_LINE>} catch (MemoryAccessException mae) {<NEW_LINE>// do nothing<NEW_LINE>} catch (CorruptCoreException cce) {<NEW_LINE>// do nothing<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dump.coreSeek(getLocation());<NEW_LINE>int numberOfThreads = dump.coreReadInt();<NEW_LINE>List threads = new ArrayList();<NEW_LINE>for (int i = 0; i < numberOfThreads; i++) {<NEW_LINE>dump.coreSeek(getLocation() + 4 + i * 48);<NEW_LINE>int threadId = dump.coreReadInt();<NEW_LINE>// Ignore suspendCount<NEW_LINE>dump.coreReadInt();<NEW_LINE>int priorityClass = dump.coreReadInt();<NEW_LINE>int priority = dump.coreReadInt();<NEW_LINE>// Ignore teb<NEW_LINE>dump.coreReadLong();<NEW_LINE><MASK><NEW_LINE>long stackSize = 0xFFFFFFFFL & dump.coreReadInt();<NEW_LINE>long stackRva = 0xFFFFFFFFL & dump.coreReadInt();<NEW_LINE>long contextDataSize = 0xFFFFFFFFL & dump.coreReadInt();<NEW_LINE>long contextRva = 0xFFFFFFFFL & dump.coreReadInt();<NEW_LINE>Properties properties = new Properties();<NEW_LINE>properties.setProperty("priorityClass", String.valueOf(priorityClass));<NEW_LINE>properties.setProperty("priority", String.valueOf(priority));<NEW_LINE>List registers = readRegisters(dump, builder, contextRva, contextDataSize);<NEW_LINE>long stackEnd = stackStart + stackSize;<NEW_LINE>Object section = builder.buildStackSection(addressSpace, stackStart, stackEnd);<NEW_LINE>List frames = readStackFrames(dump, builder, addressSpace, stackStart, stackEnd, stackRva, registers, memory, is64Bit);<NEW_LINE>// TODO: find the signal number!<NEW_LINE>int signalNumber = 0;<NEW_LINE>Object thread = builder.buildThread(String.valueOf(threadId), registers.iterator(), Collections.singletonList(section).iterator(), frames.iterator(), properties, signalNumber);<NEW_LINE>threads.add(thread);<NEW_LINE>if (-1 != tid && tid == threadId) {<NEW_LINE>dump._failingThread = thread;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dump.addThreads(threads);<NEW_LINE>// for (int i=0;i<numberOfThreads;i++) {<NEW_LINE>// GenericThread gt = new GenericThread(("0x"+ Integer.toHexString(minidumpThreads[i].threadId)),<NEW_LINE>// minidumpThreads[i].stackStartOfMemoryRange,<NEW_LINE>// minidumpThreads[i].stackDataSize,<NEW_LINE>// minidumpThreads[i].stackRva);<NEW_LINE>// Register ebpReg = gt.getNamedRegister("ebp");<NEW_LINE>// Register espReg = gt.getNamedRegister("esp");<NEW_LINE>// analyseStack(gt,ebpReg,espReg);<NEW_LINE>// }<NEW_LINE>} | long stackStart = dump.coreReadLong(); |
196,416 | public AudioOnlyHlsSettings unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AudioOnlyHlsSettings audioOnlyHlsSettings = new AudioOnlyHlsSettings();<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("audioGroupId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>audioOnlyHlsSettings.setAudioGroupId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("audioOnlyImage", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>audioOnlyHlsSettings.setAudioOnlyImage(InputLocationJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("audioTrackType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>audioOnlyHlsSettings.setAudioTrackType(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("segmentType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>audioOnlyHlsSettings.setSegmentType(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 audioOnlyHlsSettings;<NEW_LINE>} | class).unmarshall(context)); |
293,054 | public IterationScopeNode createIterationScope(FrameDescriptor frameDescriptor, JSFrameSlot blockScopeSlot) {<NEW_LINE>int numberOfSlots = frameDescriptor.getNumberOfSlots();<NEW_LINE>assert numberOfSlots > ScopeFrameNode.PARENT_SCOPE_SLOT_INDEX && ScopeFrameNode.PARENT_SCOPE_IDENTIFIER.equals(frameDescriptor.getSlotName(ScopeFrameNode.PARENT_SCOPE_SLOT_INDEX));<NEW_LINE>int numberOfSlotsToCopy = numberOfSlots - 1;<NEW_LINE>JSReadFrameSlotNode[] reads = new JSReadFrameSlotNode[numberOfSlotsToCopy];<NEW_LINE>JSWriteFrameSlotNode[] writes = new JSWriteFrameSlotNode[numberOfSlotsToCopy];<NEW_LINE>int slotIndex = 0;<NEW_LINE>for (int i = 0; i < numberOfSlots; i++) {<NEW_LINE>if (i == ScopeFrameNode.PARENT_SCOPE_SLOT_INDEX) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>JSFrameSlot slot = JSFrameSlot.fromIndexedFrameSlot(frameDescriptor, i);<NEW_LINE>reads[slotIndex] = JSReadFrameSlotNode.create(slot, false);<NEW_LINE>writes[slotIndex] = JSWriteFrameSlotNode.create(slot, null, false);<NEW_LINE>slotIndex++;<NEW_LINE>}<NEW_LINE>assert slotIndex == numberOfSlotsToCopy;<NEW_LINE>return IterationScopeNode.create(frameDescriptor, reads, <MASK><NEW_LINE>} | writes, blockScopeSlot.getIndex()); |
1,153,664 | public void execute() {<NEW_LINE>if (!enableArtemisPlugin) {<NEW_LINE>getLog().info("Plugin disabled via 'enableArtemisPlugin' set to false.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (context != null && !context.hasDelta(sourceDirectory))<NEW_LINE>return;<NEW_LINE>log.info("");<NEW_LINE>log.info("CONFIGURATION");<NEW_LINE>log.info(WeaverLog.LINE.replaceAll("\n", ""));<NEW_LINE>log.info(WeaverLog.format("enablePooledWeaving", enablePooledWeaving));<NEW_LINE>log.info(WeaverLog.format("generateLinkMutators", generateLinkMutators));<NEW_LINE>log.info(WeaverLog.format("optimizeEntitySystems", optimizeEntitySystems));<NEW_LINE>log.info(WeaverLog.LINE.replaceAll("\n", ""));<NEW_LINE>Weaver.enablePooledWeaving(enablePooledWeaving);<NEW_LINE>Weaver.generateLinkMutators(generateLinkMutators);<NEW_LINE>Weaver.optimizeEntitySystems(optimizeEntitySystems);<NEW_LINE><MASK><NEW_LINE>WeaverLog weaverLog = weaver.execute();<NEW_LINE>for (String s : weaverLog.getFormattedLog().split("\n")) {<NEW_LINE>log.info(s);<NEW_LINE>}<NEW_LINE>} | Weaver weaver = new Weaver(outputDirectory); |
1,169,880 | /*<NEW_LINE>* put - insert and/or updates a session as appropriate<NEW_LINE>*/<NEW_LINE>public Object put(Object key, Object value) {<NEW_LINE>if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {<NEW_LINE>LoggingUtil.SESSION_LOGGER_WAS.entering(methodClassName, methodNames[PUT], "key = " + key);<NEW_LINE>}<NEW_LINE>String id = (String) key;<NEW_LINE>BackedSession backedSess = (BackedSession) value;<NEW_LINE>// in the unlikely case the session is created and invalidated on the same http request<NEW_LINE>if (!backedSess.isValid()) {<NEW_LINE>if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {<NEW_LINE>LoggingUtil.SESSION_LOGGER_WAS.exiting(methodClassName<MASK><NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// needToInsert is set to false when successfully persisted. Will stay true if insertSession fails because db is down.<NEW_LINE>if (backedSess.needToInsert) {<NEW_LINE>insertSession(backedSess);<NEW_LINE>if (backedSess.isNew()) {<NEW_LINE>if (!backedSess.removingSessionFromCache) {<NEW_LINE>// if ((!backedSess.removingSessionFromCache) && (!backedSess.duplicateIdDetected)) { // since duplicate keys can't be detected in lWAS, backedSess.duplicateIdDetected is always true<NEW_LINE>BackedSession thrownOutSess = (BackedSession) superPut(id, backedSess);<NEW_LINE>if (thrownOutSess != null)<NEW_LINE>this.passivateSession(thrownOutSess);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>updateSession(backedSess);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>updateSession(backedSess);<NEW_LINE>}<NEW_LINE>if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {<NEW_LINE>LoggingUtil.SESSION_LOGGER_WAS.exiting(methodClassName, methodNames[PUT]);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | , methodNames[PUT], "Session is not valid. Returning null"); |
652,001 | public void run() {<NEW_LINE>resetState();<NEW_LINE>isRunning.set(true);<NEW_LINE>while (isRunning.get()) {<NEW_LINE>// (re)connect<NEW_LINE>if (socketCh == null) {<NEW_LINE>try {<NEW_LINE>InetAddress addr = InetAddress.getByName(host);<NEW_LINE>socketCh = SocketChannel.open(new InetSocketAddress(addr, port));<NEW_LINE>socketCh.configureBlocking(false);<NEW_LINE>selector = Selector.open();<NEW_LINE>id = FanoutConstants.getLocalSocketId(socketCh.socket());<NEW_LINE>socketCh.register(selector, SelectionKey.OP_READ);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error(MessageFormat.format("failed to open client connection to {0}:{1,number,0}", host, port), e);<NEW_LINE>try {<NEW_LINE>Thread.sleep(reconnectTimeout);<NEW_LINE>} catch (InterruptedException x) {<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// read/write<NEW_LINE>try {<NEW_LINE>selector.select(clientTimeout);<NEW_LINE>Iterator<SelectionKey> i = selector.selectedKeys().iterator();<NEW_LINE>while (i.hasNext()) {<NEW_LINE>SelectionKey key = i.next();<NEW_LINE>i.remove();<NEW_LINE>if (key.isReadable()) {<NEW_LINE>// read message<NEW_LINE>String content = read();<NEW_LINE>String[] lines = content.split("\n");<NEW_LINE>for (String reply : lines) {<NEW_LINE>logger.trace(MessageFormat.format("fanout client {0} received: {1}", id, reply));<NEW_LINE>if (!processReply(reply)) {<NEW_LINE>logger.error(MessageFormat.format("fanout client {0} received unknown message", id));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (key.isWritable()) {<NEW_LINE>// resubscribe<NEW_LINE>if (resubscribe) {<NEW_LINE>resubscribe = false;<NEW_LINE>logger.info(MessageFormat.format("fanout client {0} re-subscribing to {1} channels", id<MASK><NEW_LINE>for (String subscription : subscriptions) {<NEW_LINE>write("subscribe " + subscription);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>socketCh.register(selector, SelectionKey.OP_READ);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.error(MessageFormat.format("fanout client {0} error: {1}", id, e.getMessage()));<NEW_LINE>closeChannel();<NEW_LINE>if (!isAutomaticReconnect.get()) {<NEW_LINE>isRunning.set(false);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>closeChannel();<NEW_LINE>resetState();<NEW_LINE>} | , subscriptions.size())); |
631,063 | public ValidationErrors validate(SetNullableStatement setNullableStatement, Database database, SqlGeneratorChain sqlGeneratorChain) {<NEW_LINE>ValidationErrors validationErrors = new ValidationErrors();<NEW_LINE>validationErrors.checkRequiredField(<MASK><NEW_LINE>if (setNullableStatement.isNullable()) {<NEW_LINE>if (database instanceof OracleDatabase) {<NEW_LINE>if (setNullableStatement.getConstraintName() == null && setNullableStatement.getColumnName() == null) {<NEW_LINE>validationErrors.addError("Oracle requires either constraintName or columnName to be set");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>validationErrors.checkRequiredField("columnName", setNullableStatement.getColumnName());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>validationErrors.checkRequiredField("columnName", setNullableStatement.getColumnName());<NEW_LINE>}<NEW_LINE>if ((database instanceof MSSQLDatabase) || (database instanceof MySQLDatabase) || (database instanceof InformixDatabase)) {<NEW_LINE>validationErrors.checkRequiredField("columnDataType", setNullableStatement.getColumnDataType());<NEW_LINE>}<NEW_LINE>return validationErrors;<NEW_LINE>} | "tableName", setNullableStatement.getTableName()); |
90,755 | private Formula compileStatementFormula(ControlFlowNode node, List<ControlFlowNode> cutoffNodes, List<String> quantifiedMetavars) {<NEW_LINE>quantifiedMetavars = shallowCopy(quantifiedMetavars);<NEW_LINE>if (SmPLJavaDSL.isStatementLevelDots(node.getStatement())) {<NEW_LINE>return compileStatementLevelDotsFormula(node, cutoffNodes, quantifiedMetavars);<NEW_LINE>} else {<NEW_LINE>CtElement statement = node.getStatement();<NEW_LINE>Formula formula;<NEW_LINE>if (SmPLJavaDSL.isExpressionMatchWrapper(statement)) {<NEW_LINE>statement = SmPLJavaDSL.getWrappedElement(statement);<NEW_LINE>formula <MASK><NEW_LINE>} else {<NEW_LINE>formula = new Statement(statement, metavars);<NEW_LINE>}<NEW_LINE>int line = statement.getPosition().getLine();<NEW_LINE>ArrayList<Operation> ops = new ArrayList<>();<NEW_LINE>if (operations.containsKey(line)) {<NEW_LINE>ops.addAll(operations.get(line));<NEW_LINE>}<NEW_LINE>if (ops.size() > 0) {<NEW_LINE>formula = new And(formula, new ExistsVar("_v", new SetEnv("_v", ops)));<NEW_LINE>}<NEW_LINE>// Mark first occurences of metavars as quantified before compiling inner formula<NEW_LINE>List<String> newMetavars = getUnquantifiedMetavarsUsedIn(statement, quantifiedMetavars);<NEW_LINE>quantifiedMetavars.addAll(newMetavars);<NEW_LINE>Formula innerFormula = compileFormulaInner(node.next().get(0), cutoffNodes, quantifiedMetavars);<NEW_LINE>if (innerFormula != null) {<NEW_LINE>formula = new And(formula, connectTail(innerFormula));<NEW_LINE>}<NEW_LINE>// Actually quantify the new metavars<NEW_LINE>Collections.reverse(newMetavars);<NEW_LINE>for (String varname : newMetavars) {<NEW_LINE>formula = new ExistsVar(varname, formula);<NEW_LINE>}<NEW_LINE>return formula;<NEW_LINE>}<NEW_LINE>} | = new Expression(statement, metavars); |
1,671,985 | private List<String> computeFileNamesForMissingBuckets(ConnectorSession session, HiveStorageFormat storageFormat, Path targetPath, int bucketCount, boolean transactionalCreateTable, PartitionUpdate partitionUpdate) {<NEW_LINE>if (partitionUpdate.getFileNames().size() == bucketCount) {<NEW_LINE>// fast path for common case<NEW_LINE>return ImmutableList.of();<NEW_LINE>}<NEW_LINE>HdfsContext hdfsContext = new HdfsContext(session);<NEW_LINE>JobConf conf = toJobConf(hdfsEnvironment.getConfiguration(hdfsContext, targetPath));<NEW_LINE>configureCompression(conf, getCompressionCodec(session));<NEW_LINE>String fileExtension = HiveWriterFactory.getFileExtension(conf, fromHiveStorageFormat(storageFormat));<NEW_LINE>Set<String> fileNames = ImmutableSet.copyOf(partitionUpdate.getFileNames());<NEW_LINE>Set<Integer> bucketsWithFiles = fileNames.stream().map(HiveWriterFactory::getBucketFromFileName).collect(toImmutableSet());<NEW_LINE>ImmutableList.Builder<String> missingFileNamesBuilder = ImmutableList.builder();<NEW_LINE>for (int i = 0; i < bucketCount; i++) {<NEW_LINE>if (bucketsWithFiles.contains(i)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>String fileName;<NEW_LINE>if (transactionalCreateTable) {<NEW_LINE>fileName = computeTransactionalBucketedFilename(i) + fileExtension;<NEW_LINE>} else {<NEW_LINE>fileName = computeNonTransactionalBucketedFilename(session.getQueryId(), i) + fileExtension;<NEW_LINE>}<NEW_LINE>missingFileNamesBuilder.add(fileName);<NEW_LINE>}<NEW_LINE>List<String<MASK><NEW_LINE>verify(fileNames.size() + missingFileNames.size() == bucketCount);<NEW_LINE>return missingFileNames;<NEW_LINE>} | > missingFileNames = missingFileNamesBuilder.build(); |
1,669,971 | public Object clone() throws CloneNotSupportedException {<NEW_LINE>DefaultIntervalXYDataset clone = (DefaultIntervalXYDataset) super.clone();<NEW_LINE>clone.seriesKeys = new ArrayList<>(this.seriesKeys);<NEW_LINE>clone.seriesList = new ArrayList<>(this.seriesList.size());<NEW_LINE>for (int i = 0; i < this.seriesList.size(); i++) {<NEW_LINE>double[][] data = (double[][]) this.seriesList.get(i);<NEW_LINE>double[] x = data[0];<NEW_LINE>double[] xStart = data[1];<NEW_LINE>double[] xEnd = data[2];<NEW_LINE>double[] y = data[3];<NEW_LINE>double[] yStart = data[4];<NEW_LINE>double[] yEnd = data[5];<NEW_LINE>double[] xx = new double[x.length];<NEW_LINE>double[] xxStart <MASK><NEW_LINE>double[] xxEnd = new double[xEnd.length];<NEW_LINE>double[] yy = new double[y.length];<NEW_LINE>double[] yyStart = new double[yStart.length];<NEW_LINE>double[] yyEnd = new double[yEnd.length];<NEW_LINE>System.arraycopy(x, 0, xx, 0, x.length);<NEW_LINE>System.arraycopy(xStart, 0, xxStart, 0, xStart.length);<NEW_LINE>System.arraycopy(xEnd, 0, xxEnd, 0, xEnd.length);<NEW_LINE>System.arraycopy(y, 0, yy, 0, y.length);<NEW_LINE>System.arraycopy(yStart, 0, yyStart, 0, yStart.length);<NEW_LINE>System.arraycopy(yEnd, 0, yyEnd, 0, yEnd.length);<NEW_LINE>clone.seriesList.add(i, new double[][] { xx, xxStart, xxEnd, yy, yyStart, yyEnd });<NEW_LINE>}<NEW_LINE>return clone;<NEW_LINE>} | = new double[xStart.length]; |
1,464,419 | private void commonDestroyed(DoDestroyEvent event, EntityRef entity, Block block) {<NEW_LINE>entity.send(new CreateBlockDropsEvent(event.getInstigator(), event.getDirectCause(), event.getDamageType()));<NEW_LINE>BlockDamageModifierComponent blockDamageModifierComponent = event.getDamageType().getComponent(BlockDamageModifierComponent.class);<NEW_LINE>// TODO: Configurable via block definition<NEW_LINE>if (blockDamageModifierComponent == null || !blockDamageModifierComponent.skipPerBlockEffects) {<NEW_LINE>// dust particle effect<NEW_LINE>if (entity.hasComponent(LocationComponent.class) && block.isDebrisOnDestroy()) {<NEW_LINE>// TODO: particle system stuff should be split out better - this is effectively a stealth dependency on<NEW_LINE>// 'CoreAssets' from the engine<NEW_LINE>EntityBuilder <MASK><NEW_LINE>if (dustBuilder.hasComponent(LocationComponent.class)) {<NEW_LINE>dustBuilder.getComponent(LocationComponent.class).setWorldPosition(entity.getComponent(LocationComponent.class).getWorldPosition(new Vector3f()));<NEW_LINE>dustBuilder.build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// sound to play for destroyed block<NEW_LINE>BlockSounds sounds = block.getSounds();<NEW_LINE>if (!sounds.getDestroySounds().isEmpty()) {<NEW_LINE>StaticSound sound = random.nextItem(sounds.getDestroySounds());<NEW_LINE>entity.send(new PlaySoundEvent(sound, 0.6f));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | dustBuilder = entityManager.newBuilder("CoreAssets:dustEffect"); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.