idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,642,062 | public void compute() {<NEW_LINE>currentContext.setPhase(TraverserContext.Phase.ENTER);<NEW_LINE>currentContext.setVar(List.class, myZippers);<NEW_LINE>TraversalControl traversalControl = visitor.enter(currentContext);<NEW_LINE>assertNotNull(traversalControl, () -> "result of enter must not be null");<NEW_LINE>assertTrue(QUIT != traversalControl, () -> "can't return QUIT for parallel traversing");<NEW_LINE>if (traversalControl == ABORT) {<NEW_LINE>this.children = Collections.emptyList();<NEW_LINE>tryComplete();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>assertTrue(traversalControl == CONTINUE);<NEW_LINE>this.children = pushAll(currentContext);<NEW_LINE>if (children.size() == 0) {<NEW_LINE>tryComplete();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>setPendingCount(<MASK><NEW_LINE>for (int i = 1; i < children.size(); i++) {<NEW_LINE>new EnterAction(this, children.get(i), visitor).fork();<NEW_LINE>}<NEW_LINE>new EnterAction(this, children.get(0), visitor).compute();<NEW_LINE>} | children.size() - 1); |
1,003,126 | private void serializeTimer(MetaData.Builder metaData, Timer metric) {<NEW_LINE>final Snapshot snapshot = metric.getSnapshot();<NEW_LINE>writeValue(metaData, COUNT, (double) metric.getCount());<NEW_LINE>writeDuration(metaData, MAX, (double) snapshot.getMax());<NEW_LINE>writeDuration(metaData, MEAN, snapshot.getMean());<NEW_LINE>writeDuration(metaData, MIN, (double) snapshot.getMin());<NEW_LINE>writeDuration(metaData, STDDEV, snapshot.getStdDev());<NEW_LINE>writeDuration(metaData, P50, snapshot.getMedian());<NEW_LINE>writeDuration(metaData, P75, snapshot.get75thPercentile());<NEW_LINE>writeDuration(metaData, P95, snapshot.get95thPercentile());<NEW_LINE>writeDuration(metaData, P98, snapshot.get98thPercentile());<NEW_LINE>writeDuration(metaData, <MASK><NEW_LINE>writeDuration(metaData, P999, snapshot.get999thPercentile());<NEW_LINE>writeRate(metaData, M1_RATE, metric.getOneMinuteRate());<NEW_LINE>writeRate(metaData, M5_RATE, metric.getFiveMinuteRate());<NEW_LINE>writeRate(metaData, M15_RATE, metric.getFifteenMinuteRate());<NEW_LINE>writeRate(metaData, MEAN_RATE, metric.getMeanRate());<NEW_LINE>} | P99, snapshot.get99thPercentile()); |
22,475 | public void run() {<NEW_LINE>try {<NEW_LINE>for (final File file : files) {<NEW_LINE>final <MASK><NEW_LINE>System.out.println("Opening..." + file.getAbsolutePath());<NEW_LINE>// check if file exists<NEW_LINE>if (!file.exists()) {<NEW_LINE>BytecodeViewer.showMessage("The file " + file.getAbsolutePath() + " could not be found.");<NEW_LINE>Settings.removeRecentFile(file);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>// check if file is directory<NEW_LINE>if (file.isDirectory()) {<NEW_LINE>Import.DIRECTORY.getImporter().open(file);<NEW_LINE>} else // everything else import as a resource<NEW_LINE>if (!importKnownFile(file))<NEW_LINE>Import.FILE.getImporter().open(file);<NEW_LINE>}<NEW_LINE>} catch (final Exception e) {<NEW_LINE>BytecodeViewer.handleException(e);<NEW_LINE>} finally {<NEW_LINE>BytecodeViewer.updateBusyStatus(false);<NEW_LINE>}<NEW_LINE>} | String fn = file.getName(); |
1,367,386 | public IAcsClient instance() {<NEW_LINE>if (client != null)<NEW_LINE>return client;<NEW_LINE>String accessKeyId = (String) systemConfigService.selectAllConfig().get("sms_access_key_id");<NEW_LINE>String secret = (String) systemConfigService.selectAllConfig().get("sms_secret");<NEW_LINE>signName = (String) systemConfigService.selectAllConfig().get("sms_sign_name");<NEW_LINE>templateCode = (String) systemConfigService.selectAllConfig().get("sms_template_code");<NEW_LINE>regionId = (String) systemConfigService.<MASK><NEW_LINE>if (StringUtils.isEmpty(accessKeyId) || StringUtils.isEmpty(secret) || StringUtils.isEmpty(signName) || StringUtils.isEmpty(templateCode) || StringUtils.isEmpty(regionId)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>DefaultProfile profile = DefaultProfile.getProfile(regionId, accessKeyId, secret);<NEW_LINE>IAcsClient client = new DefaultAcsClient(profile);<NEW_LINE>this.client = client;<NEW_LINE>return client;<NEW_LINE>} | selectAllConfig().get("sms_region_id"); |
776,997 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String id, String path0, String path1, String path2, String path3, String path4, String path5, String path6) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>Wo wo = new Wo();<NEW_LINE>String executorSeed = null;<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Work work = emc.fetch(id, Work.class, ListTools.toList(Work.job_FIELDNAME));<NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(id, Work.class);<NEW_LINE>}<NEW_LINE>executorSeed = work.getJob();<NEW_LINE>}<NEW_LINE>Callable<String> callable = new Callable<String>() {<NEW_LINE><NEW_LINE>public String call() throws Exception {<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Work work = emc.find(id, Work.class);<NEW_LINE>if (null == work) {<NEW_LINE>throw new ExceptionEntityNotExist(id, Work.class);<NEW_LINE>}<NEW_LINE>wo.setId(work.getId());<NEW_LINE>deleteData(business, work, path0, path1, path2, path3, path4, path5, path6);<NEW_LINE>}<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>};<NEW_LINE>ProcessPlatformExecutorFactory.get(executorSeed).submit(callable).<MASK><NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>} | get(300, TimeUnit.SECONDS); |
540,798 | private BlockAppearance createAppearance(BlockShape shape, Map<BlockPart, BlockTile> tiles, Rotation rot) {<NEW_LINE>Map<BlockPart, BlockMeshPart> meshParts = Maps.newEnumMap(BlockPart.class);<NEW_LINE>Map<BlockPart, Vector2f> textureAtlasPositions = Maps.newEnumMap(BlockPart.class);<NEW_LINE>for (BlockPart part : BlockPart.values()) {<NEW_LINE>// TODO: Need to be more sensible with the texture atlas.<NEW_LINE>// Because things like block particles read from a part that may not exist, we're being fairly lenient<NEW_LINE>Vector2f atlasPos;<NEW_LINE>int frameCount;<NEW_LINE>BlockTile tile = tiles.get(part);<NEW_LINE>if (tile == null) {<NEW_LINE>atlasPos = new Vector2f();<NEW_LINE>frameCount = 1;<NEW_LINE>} else {<NEW_LINE>atlasPos = worldAtlas.getTexCoords(tile, shape.getMeshPart(part) != null);<NEW_LINE>frameCount = tile.getLength();<NEW_LINE>}<NEW_LINE>BlockPart <MASK><NEW_LINE>textureAtlasPositions.put(targetPart, atlasPos);<NEW_LINE>if (shape.getMeshPart(part) != null) {<NEW_LINE>meshParts.put(targetPart, shape.getMeshPart(part).rotate(rot.orientation().get(new Quaternionf())).mapTexCoords(atlasPos, worldAtlas.getRelativeTileSize(), frameCount));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new BlockAppearance(meshParts, textureAtlasPositions);<NEW_LINE>} | targetPart = part.rotate(rot); |
1,484,308 | protected Object createNode(JSContext context, JSBuiltin builtin, boolean construct, boolean newTarget, NumberPrototype builtinEnum) {<NEW_LINE>switch(builtinEnum) {<NEW_LINE>case toExponential:<NEW_LINE>return JSNumberToExponentialNodeGen.create(context, builtin, args().withThis().fixedArgs(<MASK><NEW_LINE>case toFixed:<NEW_LINE>return JSNumberToFixedNodeGen.create(context, builtin, args().withThis().fixedArgs(1).createArgumentNodes(context));<NEW_LINE>case toLocaleString:<NEW_LINE>if (context.isOptionIntl402()) {<NEW_LINE>return JSNumberToLocaleStringIntlNodeGen.create(context, builtin, args().withThis().fixedArgs(2).createArgumentNodes(context));<NEW_LINE>} else {<NEW_LINE>return JSNumberToLocaleStringNodeGen.create(context, builtin, args().withThis().createArgumentNodes(context));<NEW_LINE>}<NEW_LINE>case toPrecision:<NEW_LINE>return JSNumberToPrecisionNodeGen.create(context, builtin, args().withThis().fixedArgs(1).createArgumentNodes(context));<NEW_LINE>case toString:<NEW_LINE>return JSNumberToStringNodeGen.create(context, builtin, args().withThis().fixedArgs(1).createArgumentNodes(context));<NEW_LINE>case valueOf:<NEW_LINE>return JSNumberValueOfNodeGen.create(context, builtin, args().withThis().createArgumentNodes(context));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | 1).createArgumentNodes(context)); |
1,598,344 | GeneratedTestClass build() {<NEW_LINE>// picks a matching class meta data<NEW_LINE>ClassMetaData classMetaData = this.metaData.stream().filter(Acceptor::accept).findFirst().orElseThrow((<MASK><NEW_LINE>// package com.example<NEW_LINE>classMetaData.setupLineEnding().setupLabelPrefix().packageDefinition();<NEW_LINE>// \n<NEW_LINE>this.blockBuilder.addEmptyLine();<NEW_LINE>// import ... \n<NEW_LINE>visitSeparated(this.imports);<NEW_LINE>// import static ... \n<NEW_LINE>visitSeparated(this.staticImports);<NEW_LINE>// @Test ... \n<NEW_LINE>visitWithNoEnding(this.annotations);<NEW_LINE>// @formatter:off<NEW_LINE>// public<NEW_LINE>// class<NEW_LINE>this.blockBuilder.append(classMetaData::modifier).addAtTheEndIfEndsWithAChar(" ").append(// Foo<NEW_LINE>"class").appendWithSpace(// Spec<NEW_LINE>classMetaData::className).append(// extends Parent<NEW_LINE>classMetaData::suffix).appendWithSpace(classMetaData::parentClass);<NEW_LINE>// public class FooSpec extends Parent<NEW_LINE>// @formatter:on<NEW_LINE>this.classBodyBuilder.build();<NEW_LINE>return new GeneratedTestClass(this.blockBuilder);<NEW_LINE>} | ) -> new IllegalStateException("There is no matching class meta data")); |
1,202,722 | private static boolean validateArtifacts(ActionCache.Entry entry, Action action, NestedSet<Artifact> actionInputs, MetadataHandler metadataHandler, boolean checkOutput, @Nullable CachedOutputMetadata cachedOutputMetadata) {<NEW_LINE>Map<String, FileArtifactValue> mdMap = new HashMap<>();<NEW_LINE>if (checkOutput) {<NEW_LINE>for (Artifact artifact : action.getOutputs()) {<NEW_LINE>FileArtifactValue metadata = getCachedMetadata(cachedOutputMetadata, artifact);<NEW_LINE>if (metadata == null) {<NEW_LINE>metadata = getMetadataMaybe(metadataHandler, artifact);<NEW_LINE>}<NEW_LINE>mdMap.put(artifact.getExecPathString(), metadata);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Artifact artifact : actionInputs.toList()) {<NEW_LINE>mdMap.put(artifact.getExecPathString(), getMetadataMaybe(metadataHandler, artifact));<NEW_LINE>}<NEW_LINE>return !Arrays.equals(MetadataDigestUtils.fromMetadata(mdMap<MASK><NEW_LINE>} | ), entry.getFileDigest()); |
944,544 | protected void readBinaryChildren(ClassFile classFile, HashMap newElements, IBinaryType typeInfo) {<NEW_LINE>ArrayList childrenHandles = new ArrayList();<NEW_LINE>BinaryType type = (BinaryType) classFile.getType();<NEW_LINE>ArrayList typeParameterHandles = new ArrayList();<NEW_LINE>if (typeInfo != null) {<NEW_LINE>// may not be a valid class file<NEW_LINE>generateAnnotationsInfos(type, typeInfo.getAnnotations(), typeInfo.getTagBits(), newElements);<NEW_LINE>generateTypeParameterInfos(type, typeInfo.getGenericSignature(), newElements, typeParameterHandles);<NEW_LINE>generateFieldInfos(type, typeInfo, newElements, childrenHandles);<NEW_LINE>generateRecordComponentInfos(type, typeInfo, newElements, childrenHandles);<NEW_LINE>generateMethodInfos(type, <MASK><NEW_LINE>// Note inner class are separate openables that are not opened here: no need to pass in newElements<NEW_LINE>generateInnerClassHandles(type, typeInfo, childrenHandles);<NEW_LINE>}<NEW_LINE>this.binaryChildren = new JavaElement[childrenHandles.size()];<NEW_LINE>childrenHandles.toArray(this.binaryChildren);<NEW_LINE>int typeParameterHandleSize = typeParameterHandles.size();<NEW_LINE>if (typeParameterHandleSize == 0) {<NEW_LINE>this.typeParameters = TypeParameter.NO_TYPE_PARAMETERS;<NEW_LINE>} else {<NEW_LINE>this.typeParameters = new ITypeParameter[typeParameterHandleSize];<NEW_LINE>typeParameterHandles.toArray(this.typeParameters);<NEW_LINE>}<NEW_LINE>} | typeInfo, newElements, childrenHandles, typeParameterHandles); |
699,832 | public void authorizeWillPublish(@NotNull final ChannelHandlerContext ctx, @NotNull final CONNECT connect) {<NEW_LINE>final String clientId = ctx.channel().attr(ChannelAttributes.CLIENT_CONNECTION).get().getClientId();<NEW_LINE>if (clientId == null || !ctx.channel().isActive()) {<NEW_LINE>// no more processing needed, client is already disconnected<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!authorizers.areAuthorizersAvailable() || connect.getWillPublish() == null) {<NEW_LINE>ctx.pipeline().fireUserEventTriggered(new AuthorizeWillResultEvent(connect, new PublishAuthorizerResult(null, null, false)));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Map<String, AuthorizerProvider> providerMap = authorizers.getAuthorizerProviderMap();<NEW_LINE>if (providerMap.isEmpty()) {<NEW_LINE>ctx.pipeline().fireUserEventTriggered(new AuthorizeWillResultEvent(connect, new PublishAuthorizerResult(null, null, false)));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final ClientAuthorizers clientAuthorizers = getClientAuthorizers(ctx);<NEW_LINE>final AuthorizerProviderInput authorizerProviderInput = new AuthorizerProviderInputImpl(ctx.channel(), serverInformation, clientId);<NEW_LINE>final PublishAuthorizerInputImpl input = new PublishAuthorizerInputImpl(connect.getWillPublish(), <MASK><NEW_LINE>final PublishAuthorizerOutputImpl output = new PublishAuthorizerOutputImpl(asyncer);<NEW_LINE>final SettableFuture<PublishAuthorizerOutputImpl> publishProcessedFuture = executePublishAuthorizer(clientId, providerMap, clientAuthorizers, authorizerProviderInput, input, output, ctx);<NEW_LINE>Futures.addCallback(publishProcessedFuture, new WillPublishAuthorizationProcessedTask(connect, ctx), MoreExecutors.directExecutor());<NEW_LINE>} | ctx.channel(), clientId); |
578,068 | private void moveData(int src, int dst, int len) {<NEW_LINE>if (DEBUG_TRACE) {<NEW_LINE>debugLog("moveData: " + src + "-" + src + len + " -> " + dst + "-" + dst + len);<NEW_LINE>if (DEBUG_DUMP) {<NEW_LINE>debugLog(debugPrint(values));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.arraycopy(values, src, values, dst, len);<NEW_LINE>// Write null into array slots which are not used anymore<NEW_LINE>// This is necessary to allow GC to reclaim non used objects.<NEW_LINE>int start;<NEW_LINE>int end;<NEW_LINE>if (src <= dst) {<NEW_LINE>start = src;<NEW_LINE>end = (dst < src + <MASK><NEW_LINE>} else {<NEW_LINE>start = (src > dst + len) ? src : dst + len;<NEW_LINE>end = src + len;<NEW_LINE>}<NEW_LINE>// Inline of Arrays.fill<NEW_LINE>assert (end - start <= len);<NEW_LINE>for (int i = start; i < end; i++) {<NEW_LINE>values[i] = null;<NEW_LINE>}<NEW_LINE>if (DEBUG_TRACE) {<NEW_LINE>if (DEBUG_DUMP) {<NEW_LINE>debugLog(debugPrint(values));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | len) ? dst : src + len; |
359,667 | static public MPrintFormat createFromTable(Properties ctx, int AD_Table_ID, int AD_PrintFormat_ID) {<NEW_LINE>int AD_Client_ID = Env.getAD_Client_ID(ctx);<NEW_LINE>s_log.info("AD_Table_ID=" + AD_Table_ID + " - AD_Client_ID=" + AD_Client_ID);<NEW_LINE>MPrintFormat pf = new MPrintFormat(ctx, AD_PrintFormat_ID, null);<NEW_LINE>pf.setAD_Table_ID(AD_Table_ID);<NEW_LINE>// Get Info<NEW_LINE>// 1<NEW_LINE>String // 1<NEW_LINE>sql = // 2- Count<NEW_LINE>"SELECT TableName," + // 2<NEW_LINE>" (SELECT COUNT(*) FROM AD_PrintFormat x WHERE x.AD_Table_ID=t.AD_Table_ID AND x.AD_Client_ID=c.AD_Client_ID) AS Count," + // 3 - Print color<NEW_LINE>" COALESCE (cpc.AD_PrintColor_ID, pc.AD_PrintColor_ID) AS AD_PrintColor_ID," + // 3<NEW_LINE>// 4 - Print Font<NEW_LINE>" COALESCE(" + " (select cpf.AD_PrintFont_ID from AD_PrintFont cpf where cpf.IsActive='Y' and cpf.IsDefault='Y' and (cpf.AD_Client_ID=0 or cpf.AD_Client_ID=c.AD_Client_ID) order by cpf.AD_Client_ID desc limit 1)" + " , pf.AD_PrintFont_ID" + // 5 - Print paper<NEW_LINE>") AS AD_PrintFont_ID, " + // 5<NEW_LINE>" COALESCE (cpp.AD_PrintPaper_ID, pp.AD_PrintPaper_ID) AS AD_PrintPaper_ID " + //<NEW_LINE>" FROM AD_Table t, AD_Client c" + " LEFT OUTER JOIN AD_PrintColor cpc ON (cpc.AD_Client_ID=c.AD_Client_ID AND cpc.IsDefault='Y')" + " LEFT OUTER JOIN AD_PrintPaper cpp ON (cpp.AD_Client_ID=c.AD_Client_ID AND cpp.IsDefault='Y')," + // #1/2<NEW_LINE>" AD_PrintColor pc, AD_PrintFont pf, AD_PrintPaper pp " + " WHERE t.AD_Table_ID=? AND c.AD_Client_ID=?" + " AND pc.IsDefault='Y' AND pf.IsDefault='Y' AND pp.IsDefault='Y'";<NEW_LINE>boolean error = true;<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE>pstmt.setInt(1, AD_Table_ID);<NEW_LINE>pstmt.setInt(2, AD_Client_ID);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next()) {<NEW_LINE>// Name<NEW_LINE>String <MASK><NEW_LINE>String ColumnName = TableName + "_ID";<NEW_LINE>String s = ColumnName;<NEW_LINE>if (!ColumnName.equals("T_Report_ID")) {<NEW_LINE>s = Msg.translate(ctx, ColumnName);<NEW_LINE>if (// not found<NEW_LINE>ColumnName.equals(s))<NEW_LINE>s = Msg.translate(ctx, TableName);<NEW_LINE>}<NEW_LINE>int count = rs.getInt(2);<NEW_LINE>if (count > 0)<NEW_LINE>s += "_" + (count + 1);<NEW_LINE>pf.setName(s);<NEW_LINE>//<NEW_LINE>pf.setAD_PrintColor_ID(rs.getInt(3));<NEW_LINE>pf.setAD_PrintFont_ID(rs.getInt(4));<NEW_LINE>pf.setAD_PrintPaper_ID(rs.getInt(5));<NEW_LINE>//<NEW_LINE>error = false;<NEW_LINE>} else<NEW_LINE>s_log.error("No info found " + AD_Table_ID);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>// s_log.error(sql, e);<NEW_LINE>throw new DBException(sql, e);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>if (error)<NEW_LINE>return null;<NEW_LINE>// Save & complete<NEW_LINE>if (!pf.save())<NEW_LINE>return null;<NEW_LINE>// pf.dump();<NEW_LINE>pf.setItems(createItems(ctx, pf));<NEW_LINE>//<NEW_LINE>return pf;<NEW_LINE>} | TableName = rs.getString(1); |
1,622,821 | protected void onBindDialogView(View view) {<NEW_LINE>value = settings.getAuthMethod();<NEW_LINE>credentialsSelection = view.findViewById(R.id.credentialSelection);<NEW_LINE>ArrayAdapter<String> adapter = new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_single_choice, entries);<NEW_LINE>credentialsSelection.setAdapter(adapter);<NEW_LINE>int index = entryValues.indexOf(value);<NEW_LINE>credentialsSelection.setSelection(index);<NEW_LINE>credentialsSelection.setItemChecked(index, true);<NEW_LINE>credentialsSelection.setOnItemClickListener(this);<NEW_LINE>credentialsLayout = view.findViewById(R.id.credentialsLayout);<NEW_LINE>passwordLayout = view.findViewById(R.id.passwordLayout);<NEW_LINE>passwordInput = view.findViewById(R.id.passwordEdit);<NEW_LINE>passwordConfirm = view.findViewById(R.id.passwordConfirm);<NEW_LINE>if (settings.getBlockAccessibility()) {<NEW_LINE>passwordLayout.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);<NEW_LINE>passwordConfirm.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);<NEW_LINE>}<NEW_LINE>if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && settings.getBlockAutofill()) {<NEW_LINE><MASK><NEW_LINE>passwordConfirm.setImportantForAutofill(View.IMPORTANT_FOR_AUTOFILL_NO);<NEW_LINE>}<NEW_LINE>tooShortWarning = view.findViewById(R.id.tooShortWarning);<NEW_LINE>passwordInput.addTextChangedListener(this);<NEW_LINE>passwordConfirm.addTextChangedListener(this);<NEW_LINE>passwordConfirm.setOnEditorActionListener(this);<NEW_LINE>btnCancel = view.findViewById(R.id.btnCancel);<NEW_LINE>btnSave = view.findViewById(R.id.btnSave);<NEW_LINE>btnCancel.setOnClickListener(this);<NEW_LINE>btnSave.setOnClickListener(this);<NEW_LINE>progressBar = view.findViewById(R.id.saveProgress);<NEW_LINE>updateLayout();<NEW_LINE>super.onBindDialogView(view);<NEW_LINE>} | passwordLayout.setImportantForAutofill(View.IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS); |
291,884 | List<String> findNearestNodesTo(String original, String target, List<String> targetedNodes, List<String> topoSortNodes, int k) {<NEW_LINE>int idx = topoSortNodes.indexOf(target);<NEW_LINE>Counter<String> <MASK><NEW_LINE>for (int i = 0; i < targetedNodes.size(); i++) {<NEW_LINE>int currIdx = topoSortNodes.indexOf(targetedNodes.get(i));<NEW_LINE>int diff = Math.abs(currIdx - idx);<NEW_LINE>// note we want the top k ranked by the least<NEW_LINE>rankByDistance.incrementCount(targetedNodes.get(i), -diff);<NEW_LINE>}<NEW_LINE>int currIdx = topoSortNodes.indexOf(original);<NEW_LINE>int diff = Math.abs(currIdx - idx);<NEW_LINE>// note we want the top k ranked by the least<NEW_LINE>rankByDistance.incrementCount(original, -diff);<NEW_LINE>rankByDistance.keepTopNElements(k);<NEW_LINE>return rankByDistance.keySetSorted();<NEW_LINE>} | rankByDistance = new Counter<>(); |
983,551 | private Mono<PagedResponse<P2SVpnGatewayInner>> listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2018-11-01";<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(), resourceGroupName, apiVersion, accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null));<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); |
211,695 | private Mono<Response<Void>> runTriggeredWebJobSlotWithResponseAsync(String resourceGroupName, String name, String webJobName, String slot, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (name == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter name is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (webJobName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter webJobName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (slot == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter slot is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.runTriggeredWebJobSlot(this.client.getEndpoint(), resourceGroupName, name, webJobName, slot, this.client.getSubscriptionId(), this.client.getApiVersion(), context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
655,821 | public PhysicalDbInstance select(Boolean master, boolean isForUpdate, boolean write) throws IOException {<NEW_LINE>if (rwSplitMode == RW_SPLIT_OFF && (master != null && !master)) {<NEW_LINE>LOGGER.warn("force slave,but the dbGroup[{}] doesn't contains active slave dbInstance", groupName);<NEW_LINE>throw new IOException("force slave,but the dbGroup[" + groupName + "] doesn't contain active slave dbInstance");<NEW_LINE>}<NEW_LINE>if (rwSplitMode == RW_SPLIT_OFF || allSourceMap.size() == 1 || (master != null && master) || isForUpdate) {<NEW_LINE>if (writeDbInstance.isAlive()) {<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug("select write {}", writeDbInstance);<NEW_LINE>}<NEW_LINE>if (write) {<NEW_LINE>writeDbInstance.incrementWriteCount();<NEW_LINE>} else {<NEW_LINE>writeDbInstance.incrementReadCount();<NEW_LINE>}<NEW_LINE>return writeDbInstance;<NEW_LINE>} else {<NEW_LINE>reportError(writeDbInstance);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<PhysicalDbInstance> instances = getRWDbInstances(master == null);<NEW_LINE>if (instances.size() == 0) {<NEW_LINE>throw new IOException("the dbGroup[" + groupName + "] doesn't contain active dbInstance.");<NEW_LINE>}<NEW_LINE>PhysicalDbInstance <MASK><NEW_LINE>selectInstance.incrementReadCount();<NEW_LINE>if (selectInstance.isAlive()) {<NEW_LINE>if (LOGGER.isDebugEnabled()) {<NEW_LINE>LOGGER.debug("select {}", selectInstance);<NEW_LINE>}<NEW_LINE>return selectInstance;<NEW_LINE>} else {<NEW_LINE>reportError(selectInstance);<NEW_LINE>return selectInstance;<NEW_LINE>}<NEW_LINE>} | selectInstance = loadBalancer.select(instances); |
328,540 | protected void rawResponseHandler(String response) {<NEW_LINE>Optional<Integer> axes = getAxisCount(response);<NEW_LINE>if (axes.isPresent()) {<NEW_LINE>logger.info("Axis Count: " + axes.get());<NEW_LINE>this.capabilities.removeCapability(X_AXIS);<NEW_LINE>this.capabilities.removeCapability(Y_AXIS);<NEW_LINE>this.capabilities.removeCapability(Z_AXIS);<NEW_LINE>this.capabilities.removeCapability(A_AXIS);<NEW_LINE>this.capabilities.removeCapability(B_AXIS);<NEW_LINE>this.capabilities.removeCapability(C_AXIS);<NEW_LINE>switch(axes.get()) {<NEW_LINE>case 6:<NEW_LINE>this.capabilities.addCapability(C_AXIS);<NEW_LINE>case 5:<NEW_LINE><MASK><NEW_LINE>case 4:<NEW_LINE>this.capabilities.addCapability(A_AXIS);<NEW_LINE>case 3:<NEW_LINE>this.capabilities.addCapability(Z_AXIS);<NEW_LINE>case 2:<NEW_LINE>this.capabilities.addCapability(Y_AXIS);<NEW_LINE>case 1:<NEW_LINE>this.capabilities.addCapability(X_AXIS);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>super.rawResponseHandler(response);<NEW_LINE>} | this.capabilities.addCapability(B_AXIS); |
250,636 | private void handleContentCrashIntent(@NonNull final Intent intent) {<NEW_LINE>Log.e(LOGTAG, "Got content crashed intent");<NEW_LINE>final String dumpFile = intent.getStringExtra(GeckoRuntime.EXTRA_MINIDUMP_PATH);<NEW_LINE>final String extraFile = intent.getStringExtra(GeckoRuntime.EXTRA_EXTRAS_PATH);<NEW_LINE>Log.d(LOGTAG, "Dump File: " + dumpFile);<NEW_LINE>Log.d(LOGTAG, "Extras File: " + extraFile);<NEW_LINE>Log.d(LOGTAG, "Fatal: " + intent.getBooleanExtra<MASK><NEW_LINE>boolean isCrashReportingEnabled = SettingsStore.getInstance(this).isCrashReportingEnabled();<NEW_LINE>if (isCrashReportingEnabled) {<NEW_LINE>SystemUtils.postCrashFiles(this, dumpFile, extraFile);<NEW_LINE>} else {<NEW_LINE>if (mCrashDialog == null) {<NEW_LINE>mCrashDialog = new CrashDialogWidget(this, dumpFile, extraFile);<NEW_LINE>}<NEW_LINE>mCrashDialog.show(UIWidget.REQUEST_FOCUS);<NEW_LINE>}<NEW_LINE>} | (GeckoRuntime.EXTRA_CRASH_FATAL, false)); |
784,951 | private void deAllocate() {<NEW_LINE>if (getC_Order_ID() != 0) {<NEW_LINE>setC_Order_ID(0);<NEW_LINE>}<NEW_LINE>// if (getC_Invoice_ID() == 0)<NEW_LINE>// return;<NEW_LINE>// De-Allocate all<NEW_LINE>final MAllocationHdr[] allocations = MAllocationHdr.getOfPayment(getCtx(), getC_Payment_ID(), get_TrxName());<NEW_LINE>for (MAllocationHdr allocation : allocations) {<NEW_LINE>final DocStatus allocDocStatus = DocStatus.ofCode(allocation.getDocStatus());<NEW_LINE>// 07570: Skip allocations which were already Reversed or Voided<NEW_LINE>if (allocDocStatus.isReversedOrVoided()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>allocation.set_TrxName(get_TrxName());<NEW_LINE>allocation.setDocAction(IDocument.ACTION_Reverse_Correct);<NEW_LINE>if (!allocation.processIt(IDocument.ACTION_Reverse_Correct)) {<NEW_LINE>throw new AdempiereException(allocation.getProcessMsg());<NEW_LINE>}<NEW_LINE>allocation.saveEx();<NEW_LINE>}<NEW_LINE>// Unlink (in case allocation did not get it)<NEW_LINE>if (getC_Invoice_ID() != 0) {<NEW_LINE>// Invoice<NEW_LINE>String sql = "UPDATE C_Invoice " + "SET C_Payment_ID = NULL " + "WHERE C_Invoice_ID=" + getC_Invoice_ID<MASK><NEW_LINE>int no = DB.executeUpdate(sql, get_TrxName());<NEW_LINE>if (no != 0) {<NEW_LINE>CacheMgt.get().reset(I_C_Invoice.Table_Name, getC_Invoice_ID());<NEW_LINE>log.debug("Unlink Invoice #" + no);<NEW_LINE>}<NEW_LINE>// Order<NEW_LINE>sql = "UPDATE C_Order o " + "SET C_Payment_ID = NULL " + "WHERE EXISTS (SELECT * FROM C_Invoice i " + "WHERE o.C_Order_ID=i.C_Order_ID AND i.C_Invoice_ID=" + getC_Invoice_ID() + ")" + " AND C_Payment_ID=" + getC_Payment_ID();<NEW_LINE>no = DB.executeUpdate(sql, get_TrxName());<NEW_LINE>if (no != 0) {<NEW_LINE>log.debug("Unlink Order #" + no);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setC_Invoice_ID(0);<NEW_LINE>setIsAllocated(false);<NEW_LINE>} | () + " AND C_Payment_ID=" + getC_Payment_ID(); |
104,920 | public void rightMouse(MouseEvent e) {<NEW_LINE>System.out.println("popup");<NEW_LINE>JPopupMenu menu = new JPopupMenu();<NEW_LINE>menu.add("Selected");<NEW_LINE>for (String wId : overWidgets) {<NEW_LINE>if (wId == "root") {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>JMenu sub = new JMenu(wId);<NEW_LINE>menu.add(sub);<NEW_LINE>sub.add(new AbstractAction("centerVertically") {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>inspector.main.addConstraint(wId, "centerVertically: 'parent'");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>sub.add(new AbstractAction("centerHorizontally") {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void actionPerformed(ActionEvent e) {<NEW_LINE>inspector.<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>menu.show(e.getComponent(), e.getX(), e.getY());<NEW_LINE>} | main.addConstraint(wId, "centerHorizontally: 'parent'"); |
934,272 | public boolean test() {<NEW_LINE>final Request request = prepareRequest(client, 12);<NEW_LINE>try {<NEW_LINE>request.addMessageObserver(new EndpointContextTracer() {<NEW_LINE><NEW_LINE>private final AtomicBoolean ready = new AtomicBoolean();<NEW_LINE><NEW_LINE>private final AtomicInteger counter = new AtomicInteger();<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onReadyToSend() {<NEW_LINE>if (ready.compareAndSet(false, true)) {<NEW_LINE>LOGGER.info("Request:{}{}", StringUtil.lineSeparator(), Utils.prettyPrint(request));<NEW_LINE>}<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onConnecting() {<NEW_LINE>LOGGER.info(">>> CONNECTING <<<");<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onDtlsRetransmission(int flight) {<NEW_LINE>LOGGER.info(">>> DTLS retransmission, flight {}", flight);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRetransmission() {<NEW_LINE>int count = counter.incrementAndGet();<NEW_LINE>LOGGER.info("Request: {} retransmissions{}{}", count, StringUtil.lineSeparator(), Utils.prettyPrint(request));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void onContextChanged(EndpointContext endpointContext) {<NEW_LINE>LOGGER.info("{}", Utils.prettyPrint(endpointContext));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onAcknowledgement() {<NEW_LINE>LOGGER.info(">>> ACK <<<");<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onTimeout() {<NEW_LINE>LOGGER.info(">>> TIMEOUT <<<");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>CoapResponse response = null;<NEW_LINE>;<NEW_LINE>if (request.isObserve()) {<NEW_LINE>clientObserveRelation = client.observeAndWait(new TestHandler(request));<NEW_LINE>response = clientObserveRelation.getCurrent();<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (response != null) {<NEW_LINE>addToStatistic(response);<NEW_LINE>if (response.isSuccess()) {<NEW_LINE>if (LOGGER.isInfoEnabled()) {<NEW_LINE>LOGGER.info("Received response:{}{}", StringUtil.lineSeparator(), Utils.prettyPrint(response));<NEW_LINE>}<NEW_LINE>clientCounter.incrementAndGet();<NEW_LINE>checkReady(true, true);<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>LOGGER.warn("Received error response: {} - {}", response.getCode(), response.getResponseText());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOGGER.warn("Received no response!");<NEW_LINE>}<NEW_LINE>} catch (Exception ex) {<NEW_LINE>LOGGER.warn("Test failed!", ex);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | response = client.advanced(request); |
997,729 | public GlassFish newGlassFish(GlassFishProperties glassfishProperties) throws GlassFishException {<NEW_LINE>System.setProperty("com.sun.aas.installRoot", System.getProperty("com.sun.aas.instanceRoot"));<NEW_LINE>System.setProperty("com.sun.aas.installRootURI", System.getProperty("com.sun.aas.instanceRootURI"));<NEW_LINE>glassfishProperties.setProperty("com.sun.aas.installRoot", System.getProperty("com.sun.aas.instanceRoot"));<NEW_LINE>glassfishProperties.setProperty("com.sun.aas.installRootURI", System.getProperty("com.sun.aas.instanceRootURI"));<NEW_LINE>StartupContext context = new StartupContext(glassfishProperties.getProperties());<NEW_LINE>ClassLoader tccl = Thread.currentThread().getContextClassLoader();<NEW_LINE>if (tccl instanceof OpenURLClassLoader) {<NEW_LINE>// Only our runtime classloaders list individual runtime jars.<NEW_LINE>SingleHK2Factory.initialize(tccl);<NEW_LINE>} else {<NEW_LINE>// Otherwise we assume we're in rootdir classloader and runtime jars are listed in boot jar's Class-Path<NEW_LINE>// manifest attribute<NEW_LINE>initializeWithJarManifest(tccl);<NEW_LINE>}<NEW_LINE>ModulesRegistry registry = AbstractFactory.getInstance().createModulesRegistry();<NEW_LINE>ServiceLocator habitat = registry.newServiceLocator();<NEW_LINE>DynamicConfigurationService dcs = habitat.getService(DynamicConfigurationService.class);<NEW_LINE><MASK><NEW_LINE>config.addActiveDescriptor(BuilderHelper.createConstantDescriptor(context));<NEW_LINE>config.commit();<NEW_LINE>registry.populateServiceLocator("default", habitat, Arrays.asList(new PayaraMicroInhabitantsParser(), new EmbeddedInhabitantsParser(), new DuplicatePostProcessor()));<NEW_LINE>registry.populateConfig(habitat);<NEW_LINE>ModuleStartup kernel = habitat.getService(ModuleStartup.class);<NEW_LINE>gf = new MicroGlassFish(kernel, habitat, glassfishProperties.getProperties());<NEW_LINE>return gf;<NEW_LINE>} | DynamicConfiguration config = dcs.createDynamicConfiguration(); |
1,407,924 | public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('var') create constant variable string MYVAR = '.*abc.*';\n" + "@name('s0') select * from SupportBean(theString regexp MYVAR);\n" + "" + "@name('ctx') create context MyContext start SupportBean_S0 as s0;\n" + "@name('s1') context MyContext select * from SupportBean(theString regexp context.s0.p00);\n" + "" + "@name('s2') select * from pattern[s0=SupportBean_S0 -> every SupportBean(theString regexp s0.p00)];\n" + "" + "@name('s3') select * from SupportBean(theString regexp '.*' || 'abc' || '.*');\n";<NEW_LINE>env.compileDeploy(epl);<NEW_LINE>EPDeployment deployment = env.deployment().getDeployment(env.deploymentId("s0"));<NEW_LINE>Set<String> statementNames = new LinkedHashSet<>();<NEW_LINE>for (EPStatement stmt : deployment.getStatements()) {<NEW_LINE>if (stmt.getName().startsWith("s")) {<NEW_LINE>stmt.addListener(env.listenerNew());<NEW_LINE>statementNames.add(stmt.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>env.milestone(0);<NEW_LINE>env.sendEventBean(new SupportBean_S0(1, ".*abc.*"));<NEW_LINE>sendSBAssert(env, "xabsx", statementNames, false);<NEW_LINE>sendSBAssert(env, "xabcx", statementNames, true);<NEW_LINE>if (hasFilterIndexPlanAdvanced(env)) {<NEW_LINE>Map<String, FilterItem> filters = SupportFilterServiceHelper.getFilterSvcAllStmtForTypeSingleFilter(env.runtime(), "SupportBean");<NEW_LINE>FilterItem s0 = filters.get("s0");<NEW_LINE>for (String name : statementNames) {<NEW_LINE>FilterItem sn = filters.get(name);<NEW_LINE>assertEquals(FilterOperator.REBOOL, sn.getOp());<NEW_LINE>assertNotNull(s0.getOptionalValue());<NEW_LINE>assertNotNull(s0.getIndex());<NEW_LINE>assertSame(s0.getIndex(), sn.getIndex());<NEW_LINE>assertSame(s0.getOptionalValue(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>env.undeployAll();<NEW_LINE>} | ), sn.getOptionalValue()); |
17,283 | // The actual uncaught exceptions handing logic<NEW_LINE>private void handleException(Thread thread, Throwable exception) {<NEW_LINE>// We would fail fast when errors occur to avoid unexpected bad situations<NEW_LINE>if (exception instanceof Error) {<NEW_LINE>try {<NEW_LINE>LOG.log(Level.SEVERE, "Error caught in thread: " + thread.getName() + " with thread id: " + thread.getId() + ". Process halting...", exception);<NEW_LINE>} finally {<NEW_LINE>// If an OOM happens, it is likely that logging above will<NEW_LINE>// cause another OOM.<NEW_LINE>Runtime.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>LOG.log(Level.SEVERE, String.format("Exception caught in thread: %s with id: %d", thread.getName(), thread.getId()), exception);<NEW_LINE>// CountDownLatch to notify ForceExitTask whether exit is done<NEW_LINE>final CountDownLatch exited = new CountDownLatch(1);<NEW_LINE>final ExecutorService exitExecutor = Executors.newSingleThreadExecutor();<NEW_LINE>exitExecutor.execute(new ForceExitTask(exited, systemConfig.getInstanceForceExitTimeout()));<NEW_LINE>// Clean up<NEW_LINE>if (thread.getName().equals(ThreadNames.THREAD_EXECUTOR_NAME)) {<NEW_LINE>// Run the ExecutorExitTask here since the thread throw exceptions<NEW_LINE>// and this Task would never be invoked on exit in future<NEW_LINE>new ExecutorExitTask().run();<NEW_LINE>// And exit the GatewayLooper<NEW_LINE>gatewayLooper.exitLoop();<NEW_LINE>} else {<NEW_LINE>// If the exceptions happen in other threads<NEW_LINE>// We would just invoke GatewayExitTask<NEW_LINE>new GatewayExitTask().run();<NEW_LINE>}<NEW_LINE>// This notifies the ForceExitTask that the task is finished so that<NEW_LINE>// it is not halted forcibly.<NEW_LINE>exited.countDown();<NEW_LINE>} | getRuntime().halt(1); |
153,881 | private int writeResultSet(ResultSet rs) throws SQLException {<NEW_LINE>try {<NEW_LINE>int rows = 0;<NEW_LINE>ResultSetMetaData meta = rs.getMetaData();<NEW_LINE>int columnCount = meta.getColumnCount();<NEW_LINE>String[] row = new String[columnCount];<NEW_LINE>for (int i = 0; i < columnCount; i++) {<NEW_LINE>row[i] = meta.getColumnLabel(i + 1);<NEW_LINE>}<NEW_LINE>if (writeColumnHeader) {<NEW_LINE>writeRow(row);<NEW_LINE>}<NEW_LINE>while (rs.next()) {<NEW_LINE>for (int i = 0; i < columnCount; i++) {<NEW_LINE>row[i] = rs.getString(i + 1);<NEW_LINE>}<NEW_LINE>writeRow(row);<NEW_LINE>rows++;<NEW_LINE>}<NEW_LINE>output.close();<NEW_LINE>return rows;<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw <MASK><NEW_LINE>} finally {<NEW_LINE>close();<NEW_LINE>JdbcUtils.closeSilently(rs);<NEW_LINE>}<NEW_LINE>} | DbException.convertIOException(e, null); |
1,035,992 | protected boolean createCloudStackSecret(String[] keys) {<NEW_LINE>File pkFile = getManagementServerSshPublicKeyFile();<NEW_LINE>Pair<String, Integer> publicIpSshPort = getKubernetesClusterServerIpSshPort(null);<NEW_LINE>List<MASK><NEW_LINE>publicIpAddress = publicIpSshPort.first();<NEW_LINE>sshPort = publicIpSshPort.second();<NEW_LINE>try {<NEW_LINE>final String command = String.format("sudo %s/%s -u '%s' -k '%s' -s '%s'", scriptPath, deploySecretsScriptFilename, ApiServiceConfiguration.ApiServletPath.value(), keys[0], keys[1]);<NEW_LINE>Pair<Boolean, String> result = SshHelper.sshExecute(publicIpAddress, sshPort, getControlNodeLoginUser(), pkFile, null, command, 10000, 10000, 60000);<NEW_LINE>return result.first();<NEW_LINE>} catch (Exception e) {<NEW_LINE>String msg = String.format("Failed to add cloudstack-secret to Kubernetes cluster: %s", kubernetesCluster.getName());<NEW_LINE>LOGGER.warn(msg, e);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | <KubernetesClusterVmMapVO> vmMapVOList = getKubernetesClusterVMMaps(); |
343,202 | protected void doIterationPaths(SparkDl4jMultiLayer network, SparkComputationGraph graph, JavaRDD<String> split, int splitNum, int numSplits, int dataSetObjectNumExamples, DataSetLoader dsLoader, MultiDataSetLoader mdsLoader) {<NEW_LINE>log.info("Starting training of split {} of {}. workerMiniBatchSize={}, averagingFreq={}, Configured for {} workers", splitNum, numSplits, batchSizePerWorker, averagingFrequency, numWorkers);<NEW_LINE>if (collectTrainingStats)<NEW_LINE>stats.logMapPartitionsStart();<NEW_LINE>JavaRDD<String> splitData = split;<NEW_LINE>if (collectTrainingStats)<NEW_LINE>stats.logRepartitionStart();<NEW_LINE>splitData = SparkUtils.repartition(splitData, repartition, repartitionStrategy, numObjectsEachWorker(dataSetObjectNumExamples), numWorkers);<NEW_LINE>int nPartitions = splitData.partitions().size();<NEW_LINE>if (collectTrainingStats && repartition != Repartition.Never)<NEW_LINE>stats.logRepartitionEnd();<NEW_LINE>JavaSparkContext sc = (network != null ? network.getSparkContext() : graph.getSparkContext());<NEW_LINE>FlatMapFunction<Iterator<String>, ParameterAveragingTrainingResult> function;<NEW_LINE>if (network != null) {<NEW_LINE>if (dsLoader != null) {<NEW_LINE>function = new ExecuteWorkerPathFlatMap<>(getWorkerInstance(network), dsLoader, BroadcastHadoopConfigHolder.get(sc));<NEW_LINE>} else {<NEW_LINE>function = new ExecuteWorkerPathMDSFlatMap<>(getWorkerInstance(network), mdsLoader<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (dsLoader != null) {<NEW_LINE>function = new ExecuteWorkerPathFlatMap<>(getWorkerInstance(graph), dsLoader, BroadcastHadoopConfigHolder.get(sc));<NEW_LINE>} else {<NEW_LINE>function = new ExecuteWorkerPathMDSFlatMap<>(getWorkerInstance(graph), mdsLoader, BroadcastHadoopConfigHolder.get(sc));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JavaRDD<ParameterAveragingTrainingResult> result = splitData.mapPartitions(function);<NEW_LINE>processResults(network, graph, result, splitNum, numSplits);<NEW_LINE>if (collectTrainingStats)<NEW_LINE>stats.logMapPartitionsEnd(nPartitions);<NEW_LINE>} | , BroadcastHadoopConfigHolder.get(sc)); |
324,251 | public JavaScriptNode enterForNode(ForNode forNode) {<NEW_LINE>// if init is destructuring, wait with transformation<NEW_LINE>JavaScriptNode init = forNode.getInit() != null && !forNode.isForInOrOf() ? tagStatement(transform(forNode.getInit()), forNode.getInit()) : factory.createEmpty();<NEW_LINE>JavaScriptNode test = forNode.getTest() != null && forNode.getTest().getExpression() != null ? tagStatement(transform(forNode.getTest()), forNode.getTest()) : factory.createConstantBoolean(true);<NEW_LINE>JavaScriptNode modify = forNode.getModify() != null ? tagStatement(transform(forNode.getModify()), forNode.getModify()) : factory.createEmpty();<NEW_LINE>try (JumpTargetCloseable<ContinueTarget> target = currentFunction().pushContinueTarget(null)) {<NEW_LINE>JavaScriptNode result;<NEW_LINE>if (forNode.isForOf()) {<NEW_LINE>result = desugarForOf(forNode, modify, target);<NEW_LINE>} else if (forNode.isForIn()) {<NEW_LINE>result = desugarForIn(forNode, modify, target);<NEW_LINE>} else if (forNode.isForAwaitOf()) {<NEW_LINE>result = <MASK><NEW_LINE>} else {<NEW_LINE>JavaScriptNode body = transform(forNode.getBody());<NEW_LINE>JavaScriptNode wrappedBody = wrapClearCompletionValue(target.wrapContinueTargetNode(body));<NEW_LINE>result = target.wrapBreakTargetNode(desugarFor(forNode, init, test, modify, wrappedBody));<NEW_LINE>}<NEW_LINE>return wrapClearAndGetCompletionValue(result);<NEW_LINE>}<NEW_LINE>} | desugarForAwaitOf(forNode, modify, target); |
1,451,228 | public Collection<HmDevice> parse(Object[] message) throws IOException {<NEW_LINE>message = (Object[]) message[0];<NEW_LINE>Map<String, HmDevice> devices = new HashMap<>();<NEW_LINE>for (int i = 0; i < message.length; i++) {<NEW_LINE>Map<String, ?> data = (Map<String, ?>) message[i];<NEW_LINE>if (MiscUtils.isDevice(toString(data.get("ADDRESS")), true)) {<NEW_LINE>String address = getSanitizedAddress(data.get("ADDRESS"));<NEW_LINE>String type = MiscUtils.validateCharacters(toString(data.get("TYPE")), "Device type", "-");<NEW_LINE>String id = toString(data.get("ID"));<NEW_LINE>String firmware = toString(data.get("FIRMWARE"));<NEW_LINE>HmDevice device = new HmDevice(address, hmInterface, type, config.getGatewayInfo().getId(), id, firmware);<NEW_LINE>device.addChannel(new HmChannel(type, CONFIGURATION_CHANNEL_NUMBER));<NEW_LINE>devices.put(address, device);<NEW_LINE>} else {<NEW_LINE>// channel<NEW_LINE>String deviceAddress = getSanitizedAddress(data.get("PARENT"));<NEW_LINE>HmDevice device = devices.get(deviceAddress);<NEW_LINE>String type = toString(data.get("TYPE"));<NEW_LINE>Integer number = toInteger(data.get("INDEX"));<NEW_LINE>device.addChannel(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return devices.values();<NEW_LINE>} | new HmChannel(type, number)); |
8,953 | private static void fillDocumentsTableArrays() {<NEW_LINE>if (documentsTableID == null) {<NEW_LINE>String sql = "SELECT t.AD_Table_ID, t.TableName " + "FROM AD_Table t, AD_Column c " <MASK><NEW_LINE>ArrayList<Integer> tableIDs = new ArrayList<Integer>();<NEW_LINE>ArrayList<String> tableNames = new ArrayList<String>();<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = DB.prepareStatement(sql, null);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>tableIDs.add(rs.getInt(1));<NEW_LINE>tableNames.add(rs.getString(2));<NEW_LINE>}<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new DBException(e, sql);<NEW_LINE>} finally {<NEW_LINE>DB.close(rs, pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>// Convert to array<NEW_LINE>documentsTableID = new int[tableIDs.size()];<NEW_LINE>documentsTableName = new String[tableIDs.size()];<NEW_LINE>for (int i = 0; i < documentsTableID.length; i++) {<NEW_LINE>documentsTableID[i] = tableIDs.get(i);<NEW_LINE>documentsTableName[i] = tableNames.get(i);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | + "WHERE t.AD_Table_ID=c.AD_Table_ID AND " + "c.ColumnName='Posted' AND " + "IsView='N' " + "ORDER BY t.AD_Table_ID"; |
1,407,349 | private void process(PackageDoc packageDoc) {<NEW_LINE>beginln("package");<NEW_LINE>emitIdentity(packageDoc.name(<MASK><NEW_LINE>emitLocation(packageDoc);<NEW_LINE>emitDescription(null, packageDoc, packageDoc.firstSentenceTags(), packageDoc.inlineTags());<NEW_LINE>emitOutOfLineTags(packageDoc.tags());<NEW_LINE>// Top-level classes<NEW_LINE>//<NEW_LINE>ClassDoc[] cda = packageDoc.allClasses();<NEW_LINE>for (int i = 0; i < cda.length; i++) {<NEW_LINE>ClassDoc cd = cda[i];<NEW_LINE>// Make sure we have source.<NEW_LINE>//<NEW_LINE>SourcePosition p = cd.position();<NEW_LINE>if (p == null || p.line() == 0) {<NEW_LINE>// Skip this since it isn't ours (otherwise we would have source).<NEW_LINE>//<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (cd.containingClass() == null) {<NEW_LINE>process(cd, cda[i]);<NEW_LINE>} else {<NEW_LINE>// Not a top-level class.<NEW_LINE>//<NEW_LINE>cd = cda[i];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>endln();<NEW_LINE>} | ), packageDoc.name()); |
841,586 | protected void saveContext(SecurityContext context) {<NEW_LINE>if (isTransient(context)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Authentication authentication = context.getAuthentication();<NEW_LINE>if (isTransient(authentication)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>HttpSession httpSession = this.request.getSession(false);<NEW_LINE><MASK><NEW_LINE>// See SEC-776<NEW_LINE>if (authentication == null || HttpSessionSecurityContextRepository.this.trustResolver.isAnonymous(authentication)) {<NEW_LINE>if (httpSession != null && this.authBeforeExecution != null) {<NEW_LINE>// SEC-1587 A non-anonymous context may still be in the session<NEW_LINE>// SEC-1735 remove if the contextBeforeExecution was not anonymous<NEW_LINE>httpSession.removeAttribute(springSecurityContextKey);<NEW_LINE>this.isSaveContextInvoked = true;<NEW_LINE>}<NEW_LINE>if (this.logger.isDebugEnabled()) {<NEW_LINE>if (authentication == null) {<NEW_LINE>this.logger.debug("Did not store empty SecurityContext");<NEW_LINE>} else {<NEW_LINE>this.logger.debug("Did not store anonymous SecurityContext");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>httpSession = (httpSession != null) ? httpSession : createNewSessionIfAllowed(context);<NEW_LINE>// If HttpSession exists, store current SecurityContext but only if it has<NEW_LINE>// actually changed in this thread (see SEC-37, SEC-1307, SEC-1528)<NEW_LINE>if (httpSession != null) {<NEW_LINE>// We may have a new session, so check also whether the context attribute<NEW_LINE>// is set SEC-1561<NEW_LINE>if (contextChanged(context) || httpSession.getAttribute(springSecurityContextKey) == null) {<NEW_LINE>httpSession.setAttribute(springSecurityContextKey, context);<NEW_LINE>this.isSaveContextInvoked = true;<NEW_LINE>if (this.logger.isDebugEnabled()) {<NEW_LINE>this.logger.debug(LogMessage.format("Stored %s to HttpSession [%s]", context, httpSession));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | String springSecurityContextKey = HttpSessionSecurityContextRepository.this.springSecurityContextKey; |
1,239,356 | final UpdateStageResult executeUpdateStage(UpdateStageRequest updateStageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateStageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateStageRequest> request = null;<NEW_LINE>Response<UpdateStageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateStageRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "GameSparks");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateStage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateStageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateStageResultJsonUnmarshaller());<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>} | (super.beforeMarshalling(updateStageRequest)); |
49,667 | private AbstractObjectReader buildUnion(UnionVector vector, VectorAccessor unionAccessor, VectorDescrip descrip) {<NEW_LINE>final MetadataProvider provider = descrip.childProvider();<NEW_LINE>final AbstractObjectReader[] variants = new AbstractObjectReader[<MASK><NEW_LINE>int i = 0;<NEW_LINE>for (final MinorType type : vector.getField().getType().getSubTypeList()) {<NEW_LINE>// This call will create the vector if it does not yet exist.<NEW_LINE>// Will throw an exception for unsupported types.<NEW_LINE>// so call this only if the MajorType reports that the type<NEW_LINE>// already exists.<NEW_LINE>final ValueVector memberVector = vector.getMember(type);<NEW_LINE>final VectorDescrip memberDescrip = new VectorDescrip(provider, i++, memberVector.getField());<NEW_LINE>variants[type.ordinal()] = buildVectorReader(memberVector, memberDescrip);<NEW_LINE>}<NEW_LINE>return UnionReaderImpl.build(descrip.metadata, unionAccessor, variants);<NEW_LINE>} | MinorType.values().length]; |
1,570,143 | private void checkStyleConflicts(ValueType type, Protoclass protoclass) {<NEW_LINE>if (protoclass.features().singleton() && !protoclass.constitution().generics().isEmpty()) {<NEW_LINE>protoclass.report().annotationNamed(ImmutableMirror.simpleName()).warning(About.INCOMPAT, "'singleton' feature contains potentially unsafe cast with generics %s." + " Can be safe if immutable covariant conversion is possible", type.generics().def());<NEW_LINE>}<NEW_LINE>if (protoclass.features().intern() && !protoclass.constitution().generics().isEmpty()) {<NEW_LINE>protoclass.report().annotationNamed(ImmutableMirror.simpleName()).warning(About.INCOMPAT, "'intern' feature is automatically turned off when a type have generic parameters");<NEW_LINE>}<NEW_LINE>if (protoclass.features().prehash()) {<NEW_LINE>if (protoclass.styles().style().privateNoargConstructor()) {<NEW_LINE>protoclass.report().annotationNamed(ImmutableMirror.simpleName()).<MASK><NEW_LINE>}<NEW_LINE>if (type.simpleSerializableWithoutCopy()) {<NEW_LINE>protoclass.report().annotationNamed(ImmutableMirror.simpleName()).warning(About.INCOMPAT, "'prehash' feature is automatically disabled when type is Serializable and copy constructor is off");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (type.style().strictBuilder() && !type.style().toBuilder().isEmpty()) {<NEW_LINE>protoclass.report().annotationNamed(ImmutableMirror.simpleName()).warning(About.INCOMPAT, "'toBuilder' style is incompartible with `strictBuilder` enabled and is automatically disabled");<NEW_LINE>}<NEW_LINE>if (type.isUseConstructor() && protoclass.constitution().factoryOf().isNew()) {<NEW_LINE>if (type.isUseValidation()) {<NEW_LINE>protoclass.report().annotationNamed(ImmutableMirror.simpleName()).error("Interning, singleton and validation will not work correctly with 'new' constructor configured in style");<NEW_LINE>} else if (type.constitution.isImplementationHidden() && (type.kind().isEnclosing() || type.kind().isNested())) {<NEW_LINE>protoclass.report().annotationNamed(ImmutableMirror.simpleName()).error("Enclosing with hidden implementation do not mix with 'new' constructor configured in style");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | warning(About.INCOMPAT, "'prehash' feature is automatically disabled when 'privateNoargConstructor' style is turned on"); |
936,561 | public Message decode(@Nonnull RawMessage rawMessage) {<NEW_LINE>final String s = new String(rawMessage.getPayload(), StandardCharsets.UTF_8);<NEW_LINE>final Matcher matcher = SYSLOG_PREFIX.matcher(s);<NEW_LINE>if (matcher.find()) {<NEW_LINE>final String priString = matcher.group("pri");<NEW_LINE>final Integer pri = Ints.tryParse(priString);<NEW_LINE>final Map<String, Object> syslogFields = new HashMap<>();<NEW_LINE>if (pri != null) {<NEW_LINE>final int facility = SyslogUtils.facilityFromPriority(pri);<NEW_LINE>syslogFields.put("level", SyslogUtils.levelFromPriority(pri));<NEW_LINE>syslogFields.put("facility", SyslogUtils.facilityToString(facility));<NEW_LINE>}<NEW_LINE>final String <MASK><NEW_LINE>final Message message = decodeCEF(rawMessage, msg);<NEW_LINE>message.addFields(syslogFields);<NEW_LINE>return message;<NEW_LINE>} else {<NEW_LINE>return decodeCEF(rawMessage, s);<NEW_LINE>}<NEW_LINE>} | msg = matcher.group("msg"); |
30,722 | public void rollbackAndCloseActiveTrx(final String trxName) {<NEW_LINE>final ITrxManager trxManager = getTrxManager();<NEW_LINE>if (trxManager.isNull(trxName)) {<NEW_LINE>throw new IllegalArgumentException("Only not null transactions are allowed: " + trxName);<NEW_LINE>}<NEW_LINE>final ITrx <MASK><NEW_LINE>if (trxManager.isNull(trx)) {<NEW_LINE>// shall not happen because getTrx is already throwning an exception<NEW_LINE>throw new IllegalArgumentException("No transaction was found for: " + trxName);<NEW_LINE>}<NEW_LINE>boolean rollbackOk = false;<NEW_LINE>try {<NEW_LINE>rollbackOk = trx.rollback(true);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new RuntimeException("Could not rollback '" + trx + "' because: " + e.getLocalizedMessage(), e);<NEW_LINE>}<NEW_LINE>if (!rollbackOk) {<NEW_LINE>throw new RuntimeException("Could not rollback '" + trx + "' for unknown reason");<NEW_LINE>}<NEW_LINE>} | trx = trxManager.getTrx(trxName); |
70,096 | public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') select distinct intOne from SupportEventWithManyArray#keepall;\n" + "@name('s1') select distinct intOne, intTwo from SupportEventWithManyArray#keepall;\n";<NEW_LINE>env.compileDeploy(epl);<NEW_LINE>sendManyArray(env, new int[] { 1, 2 }, new int[] { 3, 4 });<NEW_LINE>sendManyArray(env, new int[] { 3, 4 }, new int[] { 1, 2 });<NEW_LINE>sendManyArray(env, new int[] { 1, 2 }, new int[] { 3, 5 });<NEW_LINE>sendManyArray(env, new int[] { 3, 4 }, new int[] { 1, 2 });<NEW_LINE>sendManyArray(env, new int[] { 1, 2 }, new int[] { 3, 4 });<NEW_LINE>env.assertPropsPerRowIterator("s0", "intOne".split(","), new Object[][] { { new int[] { 1, 2 } }, { new int[] <MASK><NEW_LINE>env.assertPropsPerRowIterator("s1", "intOne,intTwo".split(","), new Object[][] { { new int[] { 1, 2 }, new int[] { 3, 4 } }, { new int[] { 3, 4 }, new int[] { 1, 2 } }, { new int[] { 1, 2 }, new int[] { 3, 5 } } });<NEW_LINE>env.undeployAll();<NEW_LINE>} | { 3, 4 } } }); |
334,174 | // Baksmali<NEW_LINE>@Override<NEW_LINE>public void open(TaskMonitor monitor) throws IOException, CryptoException, CancelledException {<NEW_LINE>monitor.setMessage("Converting DEX to SMALI...");<NEW_LINE><MASK><NEW_LINE>boolean isFixRegisters = false;<NEW_LINE>boolean isNoParameterRegisters = false;<NEW_LINE>boolean isUseLocalsDirective = false;<NEW_LINE>boolean isUseSequentialLabels = false;<NEW_LINE>boolean isOutputDebugInfo = true;<NEW_LINE>boolean isAddCodeOffsets = false;<NEW_LINE>// TODO DexConstants.isODEX( provider );<NEW_LINE>boolean isDeOdex = false;<NEW_LINE>boolean isVerify = false;<NEW_LINE>boolean isIgnoreErrors = false;<NEW_LINE>int registerInfo = 0;<NEW_LINE>// TODO<NEW_LINE>boolean isNoAccessorComments = false;<NEW_LINE>// TODO<NEW_LINE>String inlineTable = null;<NEW_LINE>boolean isCheckPackagePrivateAccess = false;<NEW_LINE>final String baseTempPath = System.getProperty("java.io.tmpdir");<NEW_LINE>int rand = new Random().nextInt() & 0xffff;<NEW_LINE>File tempOutputDirectory = new File(baseTempPath + File.separator + "ghidra_file_system_" + rand);<NEW_LINE>String bootClassPath = "core.jar:ext.jar:framework.jar:android.policy.jar:services.jar";<NEW_LINE>StringBuffer extraBootClassPathEntries = new StringBuffer();<NEW_LINE>List<String> bootClassPathDirs = new ArrayList<>();<NEW_LINE>bootClassPathDirs.add(".");<NEW_LINE>// TODO bootClassPathDirs.add( "~/Android/smali/required-libs/" );<NEW_LINE>DexFile dexFile = new DexFile(dexFileFile, !isFixRegisters, false);<NEW_LINE>String[] bootClassPathDirsArray = new String[bootClassPathDirs.size()];<NEW_LINE>for (int i = 0; i < bootClassPathDirsArray.length; i++) {<NEW_LINE>bootClassPathDirsArray[i] = bootClassPathDirs.get(i);<NEW_LINE>}<NEW_LINE>baksmali.disassembleDexFile(dexFileFile.getPath(), dexFile, isDeOdex, tempOutputDirectory.getPath(), bootClassPathDirsArray, bootClassPath, extraBootClassPathEntries.toString(), isNoParameterRegisters, isUseLocalsDirective, isUseSequentialLabels, isOutputDebugInfo, isAddCodeOffsets, isNoAccessorComments, registerInfo, isVerify, isIgnoreErrors, inlineTable, isCheckPackagePrivateAccess);<NEW_LINE>getFileListing(tempOutputDirectory, root, monitor);<NEW_LINE>} | File dexFileFile = provider.getFile(); |
971,100 | private void drawCompassCircle(Canvas canvas, RotatedTileBox tileBox, int circleNumber, QuadPoint center, RenderingLineAttributes attrs) {<NEW_LINE>if (!tileBox.isZoomAnimated()) {<NEW_LINE>float radiusLength = radius * circleNumber;<NEW_LINE>float innerRadiusLength = radiusLength - attrs.paint.getStrokeWidth() / 2;<NEW_LINE>updateArcShader(radiusLength, center);<NEW_LINE>updateCompassPaths(center, innerRadiusLength, radiusLength);<NEW_LINE>drawCardinalDirections(canvas, center, radiusLength, tileBox, attrs);<NEW_LINE>redLinesPaint.setStrokeWidth(<MASK><NEW_LINE>blueLinesPaint.setStrokeWidth(attrs.paint.getStrokeWidth());<NEW_LINE>canvas.drawPath(compass, attrs.shadowPaint);<NEW_LINE>canvas.drawPath(compass, attrs.paint);<NEW_LINE>canvas.drawPath(redCompassLines, redLinesPaint);<NEW_LINE>canvas.rotate(cachedHeading, center.x, center.y);<NEW_LINE>canvas.drawPath(arrowArc, blueLinesPaint);<NEW_LINE>canvas.rotate(-cachedHeading, center.x, center.y);<NEW_LINE>canvas.drawPath(arrow, attrs.shadowPaint);<NEW_LINE>canvas.drawPath(arrow, triangleNorthPaint);<NEW_LINE>canvas.rotate(cachedHeading, center.x, center.y);<NEW_LINE>canvas.drawPath(arrow, attrs.shadowPaint);<NEW_LINE>canvas.drawPath(arrow, triangleHeadingPaint);<NEW_LINE>canvas.rotate(-cachedHeading, center.x, center.y);<NEW_LINE>String distance = cacheDistances.get(circleNumber - 1);<NEW_LINE>String heading = OsmAndFormatter.getFormattedAzimuth(cachedHeading, AngularConstants.DEGREES360) + " " + getCardinalDirectionForDegrees(cachedHeading);<NEW_LINE>float[] textCoords = calculateTextCoords(distance, heading, radiusLength + AndroidUtils.dpToPx(app, 16), center, attrs);<NEW_LINE>canvas.rotate(-tileBox.getRotate(), center.x, center.y);<NEW_LINE>setAttrsPaintsTypeface(attrs, Typeface.DEFAULT_BOLD);<NEW_LINE>canvas.drawText(heading, textCoords[0], textCoords[1], attrs.paint3);<NEW_LINE>canvas.drawText(heading, textCoords[0], textCoords[1], attrs.paint2);<NEW_LINE>setAttrsPaintsTypeface(attrs, null);<NEW_LINE>canvas.drawText(distance, textCoords[2], textCoords[3], attrs.paint3);<NEW_LINE>canvas.drawText(distance, textCoords[2], textCoords[3], attrs.paint2);<NEW_LINE>canvas.rotate(tileBox.getRotate(), center.x, center.y);<NEW_LINE>}<NEW_LINE>} | attrs.paint.getStrokeWidth()); |
299,658 | private PropertyEditor createPropertyEditor(Class editorClass, Class propertyType, FormProperty property) throws InstantiationException, IllegalAccessException {<NEW_LINE>PropertyEditor ed = null;<NEW_LINE>if (editorClass.equals(RADConnectionPropertyEditor.class)) {<NEW_LINE>ed = new RADConnectionPropertyEditor(propertyType);<NEW_LINE>} else if (editorClass.equals(ComponentChooserEditor.class)) {<NEW_LINE>ed = new ComponentChooserEditor(new Class[] { propertyType });<NEW_LINE>} else if (editorClass.equals(EnumEditor.class)) {<NEW_LINE>if (property instanceof RADProperty) {<NEW_LINE>RADProperty prop = (RADProperty) property;<NEW_LINE>ed = prop.createEnumEditor(prop.getPropertyDescriptor());<NEW_LINE>}<NEW_LINE>if (ed == null) {<NEW_LINE>ed = RADProperty.createDefaultEnumEditor(propertyType);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ed = (PropertyEditor) editorClass.newInstance();<NEW_LINE>}<NEW_LINE>if (property != null)<NEW_LINE>property.getPropertyContext(<MASK><NEW_LINE>else if (ed instanceof FormAwareEditor)<NEW_LINE>((FormAwareEditor) ed).setContext(formModel, null);<NEW_LINE>return ed;<NEW_LINE>} | ).initPropertyEditor(ed, property); |
732,746 | private static void registerEdgesPlugins(InvocationPlugins plugins) {<NEW_LINE>Registration r = new Registration(plugins, Edges.class);<NEW_LINE>for (Class<?> c : new Class<?>[] { Node.class, NodeList.class }) {<NEW_LINE>r.register(new InvocationPlugin("get" + c.getSimpleName() + "Unsafe", Node.class, long.class) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode node, ValueNode offset) {<NEW_LINE>Stamp stamp = b.getInvokeReturnStamp(b.getAssumptions()).getTrustedStamp();<NEW_LINE>RawLoadNode value = b.add(new RawLoadNode(stamp, node, offset, LocationIdentity.any(), JavaKind.Object));<NEW_LINE>b.addPush(JavaKind.Object, value);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>r.register(new InvocationPlugin("put" + c.getSimpleName() + "Unsafe", Node.class, long.class, c) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode node, ValueNode offset, ValueNode value) {<NEW_LINE>b.add(new RawStoreNode(node, offset, value, JavaKind.Object<MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | , LocationIdentity.any())); |
1,585,922 | public void open(NodeInputSplit split) throws IOException {<NEW_LINE>ResourcesUtils.parseGpuInfo(getRuntimeContext(), mlConfig);<NEW_LINE>mlContext = new MLContext(mode, mlConfig, role.name(), split.getSplitNumber(), mlConfig.getEnvPath(), ColumnInfos.dummy().getNameToTypeMap());<NEW_LINE>if (role.getClass().equals(AMRole.class)) {<NEW_LINE>serverFuture = new FutureTask<>(new AppMasterServer(mlContext), null);<NEW_LINE>} else {<NEW_LINE>PythonFileUtil.preparePythonFilesForExec(getRuntimeContext(), mlContext);<NEW_LINE>serverFuture = new FutureTask<>(new NodeServer(mlContext, role.name()), null);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Thread t = new Thread(serverFuture);<NEW_LINE>t.setDaemon(true);<NEW_LINE>t.setName("NodeServer_" + mlContext.getIdentity());<NEW_LINE>t.start();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOG.error("Fail to start node service.", e);<NEW_LINE>throw new IOException(e.getMessage());<NEW_LINE>}<NEW_LINE>LOG.info("start: {}", mlContext.getIdentity());<NEW_LINE>// we have no data to write<NEW_LINE>mlContext.getOutputQueue().markFinished();<NEW_LINE>// exec hook open func<NEW_LINE>try {<NEW_LINE>List<String<MASK><NEW_LINE>hookManager = new FlinkOpHookManager(hookList);<NEW_LINE>hookManager.open();<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new IOException(e);<NEW_LINE>}<NEW_LINE>this.dataExchange = new DataExchange<>(mlContext);<NEW_LINE>} | > hookList = mlContext.getHookClassNames(); |
622,555 | public Object calculate(Context ctx) {<NEW_LINE>if (param == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("push" + mm.getMessage("function.missingParam"));<NEW_LINE>} else if (param.isLeaf()) {<NEW_LINE>Object obj = param.getLeafExpression().calculate(ctx);<NEW_LINE>if (!(obj instanceof Channel)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("push" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>Push push = new Push(this, (Channel) obj);<NEW_LINE>if (cs != null) {<NEW_LINE>push.setCurrentCell(cs.getCurrent());<NEW_LINE>}<NEW_LINE>return operable.addOperation(push, ctx);<NEW_LINE>} else {<NEW_LINE>for (int i = 0, size = param.getSubSize(); i < size; ++i) {<NEW_LINE>IParam sub = param.getSub(i);<NEW_LINE>if (sub == null) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("push" + mm.getMessage("function.invalidParam"));<NEW_LINE>}<NEW_LINE>Object obj = sub.getLeafExpression().calculate(ctx);<NEW_LINE>if (!(obj instanceof Channel)) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>throw new RQException("push" + mm.getMessage("function.paramTypeError"));<NEW_LINE>}<NEW_LINE>Push push = new Push(this, (Channel) obj);<NEW_LINE>if (cs != null) {<NEW_LINE>push.<MASK><NEW_LINE>}<NEW_LINE>operable.addOperation(push, ctx);<NEW_LINE>}<NEW_LINE>return operable;<NEW_LINE>}<NEW_LINE>} | setCurrentCell(cs.getCurrent()); |
1,789,202 | public void test1XSFEnvEntry_Long_InvalidValue() throws Exception {<NEW_LINE>try {<NEW_LINE>// The test case looks for a environment variable named "envLongInvalid".<NEW_LINE>Long tempLong = fejb1.getLongEnvVar("envLongBlankValue");<NEW_LINE>fail("Get environment invalid long object should have failed, instead got " + tempLong);<NEW_LINE>} catch (NamingException ne) {<NEW_LINE>assertNotNull("Caught expected " + ne.getClass().getName(), ne);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// The test case looks for a environment variable named "envLongInvalid".<NEW_LINE>Long tempLong = fejb1.getLongEnvVar("envLongInvalid");<NEW_LINE>fail("Get environment invalid long object should have failed, instead got " + tempLong);<NEW_LINE>} catch (NamingException ne) {<NEW_LINE>assertNotNull("Caught expected " + ne.getClass().getName(), ne);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>// The test case looks for a environment variable named "envLongInvalid".<NEW_LINE>Long <MASK><NEW_LINE>fail("Get environment invalid long object should have failed, instead got " + tempLong);<NEW_LINE>} catch (NamingException ne) {<NEW_LINE>assertNotNull("Caught expected " + ne.getClass().getName(), ne);<NEW_LINE>}<NEW_LINE>} | tempLong = fejb1.getLongEnvVar("envLongGT64bit"); |
282,822 | private HttpResponse addSecretStore(String tenantName, String name, HttpRequest request) {<NEW_LINE>if (controller.tenants().require(TenantName.from(tenantName)).type() != Tenant.Type.cloud)<NEW_LINE>throw new IllegalArgumentException("Tenant '" + tenantName + "' is not a cloud tenant");<NEW_LINE>var data = toSlime(request.getData()).get();<NEW_LINE>var awsId = mandatory("awsId", data).asString();<NEW_LINE>var externalId = mandatory("externalId", data).asString();<NEW_LINE>var role = mandatory("role", data).asString();<NEW_LINE>var tenant = controller.tenants().require(TenantName.from(tenantName), CloudTenant.class);<NEW_LINE>var tenantSecretStore = new TenantSecretStore(name, awsId, role);<NEW_LINE>if (!tenantSecretStore.isValid()) {<NEW_LINE>return ErrorResponse.badRequest("Secret store " + tenantSecretStore + " is invalid");<NEW_LINE>}<NEW_LINE>if (tenant.tenantSecretStores().contains(tenantSecretStore)) {<NEW_LINE>return ErrorResponse.badRequest("Secret store " + tenantSecretStore + " is already configured");<NEW_LINE>}<NEW_LINE>controller.serviceRegistry().roleService().createTenantPolicy(TenantName.from(tenantName), name, awsId, role);<NEW_LINE>controller.serviceRegistry().tenantSecretService().addSecretStore(tenant.name(), tenantSecretStore, externalId);<NEW_LINE>// Store changes<NEW_LINE>controller.tenants().lockOrThrow(tenant.name(), LockedTenant.Cloud.class, lockedTenant -> {<NEW_LINE>lockedTenant = lockedTenant.withSecretStore(tenantSecretStore);<NEW_LINE>controller.<MASK><NEW_LINE>});<NEW_LINE>tenant = controller.tenants().require(TenantName.from(tenantName), CloudTenant.class);<NEW_LINE>var slime = new Slime();<NEW_LINE>toSlime(slime.setObject(), tenant.tenantSecretStores());<NEW_LINE>return new SlimeJsonResponse(slime);<NEW_LINE>} | tenants().store(lockedTenant); |
1,015,250 | public void deleteById(String id) {<NEW_LINE>String vaultName = Utils.getValueFromIdByName(id, "backupVaults");<NEW_LINE>if (vaultName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id)));<NEW_LINE>}<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String backupPolicyName = <MASK><NEW_LINE>if (backupPolicyName == null) {<NEW_LINE>throw logger.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id)));<NEW_LINE>}<NEW_LINE>this.deleteWithResponse(vaultName, resourceGroupName, backupPolicyName, Context.NONE);<NEW_LINE>} | Utils.getValueFromIdByName(id, "backupPolicies"); |
676,703 | public static DescribeGatewayBucketCachesResponse unmarshall(DescribeGatewayBucketCachesResponse describeGatewayBucketCachesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeGatewayBucketCachesResponse.setRequestId(_ctx.stringValue("DescribeGatewayBucketCachesResponse.RequestId"));<NEW_LINE>describeGatewayBucketCachesResponse.setTotalCount(_ctx.integerValue("DescribeGatewayBucketCachesResponse.TotalCount"));<NEW_LINE>describeGatewayBucketCachesResponse.setMessage<MASK><NEW_LINE>describeGatewayBucketCachesResponse.setPageSize(_ctx.integerValue("DescribeGatewayBucketCachesResponse.PageSize"));<NEW_LINE>describeGatewayBucketCachesResponse.setPageNumber(_ctx.integerValue("DescribeGatewayBucketCachesResponse.PageNumber"));<NEW_LINE>describeGatewayBucketCachesResponse.setCode(_ctx.stringValue("DescribeGatewayBucketCachesResponse.Code"));<NEW_LINE>describeGatewayBucketCachesResponse.setSuccess(_ctx.booleanValue("DescribeGatewayBucketCachesResponse.Success"));<NEW_LINE>List<BucketCache> bucketCaches = new ArrayList<BucketCache>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeGatewayBucketCachesResponse.BucketCaches.Length"); i++) {<NEW_LINE>BucketCache bucketCache = new BucketCache();<NEW_LINE>bucketCache.setVpcId(_ctx.stringValue("DescribeGatewayBucketCachesResponse.BucketCaches[" + i + "].VpcId"));<NEW_LINE>bucketCache.setType(_ctx.stringValue("DescribeGatewayBucketCachesResponse.BucketCaches[" + i + "].Type"));<NEW_LINE>bucketCache.setMountPoint(_ctx.stringValue("DescribeGatewayBucketCachesResponse.BucketCaches[" + i + "].MountPoint"));<NEW_LINE>bucketCache.setGatewayId(_ctx.stringValue("DescribeGatewayBucketCachesResponse.BucketCaches[" + i + "].GatewayId"));<NEW_LINE>bucketCache.setCacheMode(_ctx.stringValue("DescribeGatewayBucketCachesResponse.BucketCaches[" + i + "].CacheMode"));<NEW_LINE>bucketCache.setBizProtocol(_ctx.stringValue("DescribeGatewayBucketCachesResponse.BucketCaches[" + i + "].Protocol"));<NEW_LINE>bucketCache.setGatewayName(_ctx.stringValue("DescribeGatewayBucketCachesResponse.BucketCaches[" + i + "].GatewayName"));<NEW_LINE>bucketCache.setCacheStats(_ctx.stringValue("DescribeGatewayBucketCachesResponse.BucketCaches[" + i + "].CacheStats"));<NEW_LINE>bucketCache.setShareName(_ctx.stringValue("DescribeGatewayBucketCachesResponse.BucketCaches[" + i + "].ShareName"));<NEW_LINE>bucketCache.setRegionId(_ctx.stringValue("DescribeGatewayBucketCachesResponse.BucketCaches[" + i + "].RegionId"));<NEW_LINE>bucketCache.setVpcCidr(_ctx.stringValue("DescribeGatewayBucketCachesResponse.BucketCaches[" + i + "].VpcCidr"));<NEW_LINE>bucketCache.setBucketName(_ctx.stringValue("DescribeGatewayBucketCachesResponse.BucketCaches[" + i + "].BucketName"));<NEW_LINE>bucketCache.setCategory(_ctx.stringValue("DescribeGatewayBucketCachesResponse.BucketCaches[" + i + "].Category"));<NEW_LINE>bucketCache.setLocation(_ctx.stringValue("DescribeGatewayBucketCachesResponse.BucketCaches[" + i + "].Location"));<NEW_LINE>bucketCaches.add(bucketCache);<NEW_LINE>}<NEW_LINE>describeGatewayBucketCachesResponse.setBucketCaches(bucketCaches);<NEW_LINE>return describeGatewayBucketCachesResponse;<NEW_LINE>} | (_ctx.stringValue("DescribeGatewayBucketCachesResponse.Message")); |
1,552,936 | final ListUsersResult executeListUsers(ListUsersRequest listUsersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listUsersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListUsersRequest> request = null;<NEW_LINE>Response<ListUsersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListUsersRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListUsers");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListUsersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListUsersResultJsonUnmarshaller());<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>} | (super.beforeMarshalling(listUsersRequest)); |
817,069 | protected STARTUPINFOEX prepareStartupInfo() {<NEW_LINE>STARTUPINFOEX si = new STARTUPINFOEX();<NEW_LINE>si.StartupInfo.cb = new DWORD(si.size());<NEW_LINE>si.StartupInfo.hStdOutput = new HANDLE();<NEW_LINE>si.StartupInfo.hStdError = new HANDLE();<NEW_LINE>si.StartupInfo.hStdInput = new HANDLE();<NEW_LINE>si<MASK><NEW_LINE>// Discover the size required for the thread attrs list and allocate<NEW_LINE>UINTByReference bytesRequired = new UINTByReference();<NEW_LINE>// NB. This will "fail." See Remarks on MSDN.<NEW_LINE>ConsoleApiNative.INSTANCE.InitializeProcThreadAttributeList(null, ConPty.DW_ONE, ConPty.DW_ZERO, bytesRequired);<NEW_LINE>// NB. Memory frees itself in .finalize()<NEW_LINE>si.lpAttributeList = new Memory(bytesRequired.getValue().intValue());<NEW_LINE>// Initialize it<NEW_LINE>if (!ConsoleApiNative.INSTANCE.InitializeProcThreadAttributeList(si.lpAttributeList, ConPty.DW_ONE, ConPty.DW_ZERO, bytesRequired).booleanValue()) {<NEW_LINE>throw new LastErrorException(Kernel32.INSTANCE.GetLastError());<NEW_LINE>}<NEW_LINE>// Set the pseudoconsole information into the list<NEW_LINE>if (!ConsoleApiNative.INSTANCE.UpdateProcThreadAttribute(si.lpAttributeList, ConPty.DW_ZERO, ConPty.PROC_THREAD_ATTRIBUTE_PSEUDOCONSOLE, new PVOID(pseudoConsoleHandle.getNative().getPointer()), new DWORD(Native.POINTER_SIZE), null, null).booleanValue()) {<NEW_LINE>throw new LastErrorException(Kernel32.INSTANCE.GetLastError());<NEW_LINE>}<NEW_LINE>return si;<NEW_LINE>} | .StartupInfo.dwFlags = WinBase.STARTF_USESTDHANDLES; |
1,092,708 | public void performCredentialsUpdate(Account account, Context context) {<NEW_LINE>try {<NEW_LINE>// / step 1 - invalidate credentials of current account<NEW_LINE>OwnCloudAccount ocAccount <MASK><NEW_LINE>OwnCloudClient client = OwnCloudClientManagerFactory.getDefaultSingleton().removeClientFor(ocAccount);<NEW_LINE>if (client != null) {<NEW_LINE>OwnCloudCredentials credentials = client.getCredentials();<NEW_LINE>if (credentials != null) {<NEW_LINE>AccountManager accountManager = AccountManager.get(context);<NEW_LINE>if (credentials.authTokenExpires()) {<NEW_LINE>accountManager.invalidateAuthToken(account.type, credentials.getAuthToken());<NEW_LINE>} else {<NEW_LINE>accountManager.clearPassword(account);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// / step 2 - request credentials to user<NEW_LINE>Intent updateAccountCredentials = new Intent(context, AuthenticatorActivity.class);<NEW_LINE>updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACCOUNT, account);<NEW_LINE>updateAccountCredentials.putExtra(AuthenticatorActivity.EXTRA_ACTION, AuthenticatorActivity.ACTION_UPDATE_EXPIRED_TOKEN);<NEW_LINE>updateAccountCredentials.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);<NEW_LINE>startActivityForResult(updateAccountCredentials, REQUEST_CODE__UPDATE_CREDENTIALS);<NEW_LINE>} catch (com.owncloud.android.lib.common.accounts.AccountUtils.AccountNotFoundException e) {<NEW_LINE>DisplayUtils.showSnackMessage(this, R.string.auth_account_does_not_exist);<NEW_LINE>}<NEW_LINE>} | = new OwnCloudAccount(account, context); |
1,640,680 | public void store(Item item, String alias) {<NEW_LINE>// Don't log undefined/uninitialised data<NEW_LINE>if (item.getState() instanceof UnDefType) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// If we've not initialised the bundle, then return<NEW_LINE>if (initialized == false) {<NEW_LINE>logger.warn("MongoDB not initialized");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Connect to mongodb server if we're not already connected<NEW_LINE>if (!isConnected()) {<NEW_LINE>connectToDatabase();<NEW_LINE>}<NEW_LINE>// If we still didn't manage to connect, then return!<NEW_LINE>if (!isConnected()) {<NEW_LINE>logger.warn("mongodb: No connection to database. Cannot persist item '{}'! Will retry connecting to database next time.", item);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String realName = item.getName();<NEW_LINE>String name = (alias != null) ? alias : realName;<NEW_LINE>Object value = this.convertValue(item.getState());<NEW_LINE>DBObject obj = new BasicDBObject();<NEW_LINE>obj.put(FIELD_ID, new ObjectId());<NEW_LINE>obj.put(FIELD_ITEM, name);<NEW_LINE>obj.put(FIELD_REALNAME, realName);<NEW_LINE>obj.put(FIELD_TIMESTAMP, new Date());<NEW_LINE><MASK><NEW_LINE>this.mongoCollection.save(obj);<NEW_LINE>logger.debug("MongoDB save {}={}", name, value);<NEW_LINE>} | obj.put(FIELD_VALUE, value); |
1,127,662 | private static void generateInstrumentedProcessView(ResultSetProcessorFactoryForge forge, CodegenClassScope classScope, CodegenMethod method, CodegenInstanceAux instance) {<NEW_LINE>if (!classScope.isInstrumented()) {<NEW_LINE>forge.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CodegenMethod instrumented = method.makeChild(UniformPair.EPTYPE, forge.getClass(), classScope).addParam(EventBean.EPTYPEARRAY, NAME_NEWDATA).addParam(EventBean.EPTYPEARRAY, NAME_OLDDATA).addParam(EPTypePremade.BOOLEANPRIMITIVE.getEPType(), NAME_ISSYNTHESIZE);<NEW_LINE>forge.processViewResultCodegen(classScope, instrumented, instance);<NEW_LINE>method.getBlock().apply(InstrumentationCode.instblock(classScope, "q" + forge.getInstrumentedQName())).declareVar(UniformPair.EPTYPE, "pair", localMethod(instrumented, REF_NEWDATA, REF_OLDDATA, REF_ISSYNTHESIZE)).apply(InstrumentationCode.instblock(classScope, "a" + forge.getInstrumentedQName(), ref("pair"))).methodReturn(ref("pair"));<NEW_LINE>} | processViewResultCodegen(classScope, method, instance); |
1,683,353 | private AndroidCompletedTransfer extractAndroidCompletedTransfer(Cursor cursor) {<NEW_LINE>long id = Integer.parseInt(cursor.getString(0));<NEW_LINE>String filename = decrypt(cursor.getString(1));<NEW_LINE>String type = decrypt(cursor.getString(2));<NEW_LINE>int <MASK><NEW_LINE>String state = decrypt(cursor.getString(3));<NEW_LINE>int stateInt = Integer.parseInt(state);<NEW_LINE>String size = decrypt(cursor.getString(4));<NEW_LINE>String nodeHandle = decrypt(cursor.getString(5));<NEW_LINE>String path = decrypt(cursor.getString(6));<NEW_LINE>boolean offline = Boolean.parseBoolean(decrypt(cursor.getString(7)));<NEW_LINE>long timeStamp = Long.parseLong(decrypt(cursor.getString(8)));<NEW_LINE>String error = decrypt(cursor.getString(9));<NEW_LINE>String originalPath = decrypt(cursor.getString(10));<NEW_LINE>long parentHandle = Long.parseLong(decrypt(cursor.getString(11)));<NEW_LINE>return new AndroidCompletedTransfer(id, filename, typeInt, stateInt, size, nodeHandle, path, offline, timeStamp, error, originalPath, parentHandle);<NEW_LINE>} | typeInt = Integer.parseInt(type); |
1,687,075 | public DoubleColumnStatisticsData unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DoubleColumnStatisticsData doubleColumnStatisticsData = new DoubleColumnStatisticsData();<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("MinimumValue", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>doubleColumnStatisticsData.setMinimumValue(context.getUnmarshaller(Double.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("MaximumValue", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>doubleColumnStatisticsData.setMaximumValue(context.getUnmarshaller(Double.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NumberOfNulls", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>doubleColumnStatisticsData.setNumberOfNulls(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NumberOfDistinctValues", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>doubleColumnStatisticsData.setNumberOfDistinctValues(context.getUnmarshaller(Long.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 doubleColumnStatisticsData;<NEW_LINE>} | class).unmarshall(context)); |
1,518,010 | public static QueryTrademarkPriceResponse unmarshall(QueryTrademarkPriceResponse queryTrademarkPriceResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryTrademarkPriceResponse.setRequestId(_ctx.stringValue("QueryTrademarkPriceResponse.RequestId"));<NEW_LINE>queryTrademarkPriceResponse.setDiscountPrice(_ctx.floatValue("QueryTrademarkPriceResponse.DiscountPrice"));<NEW_LINE>queryTrademarkPriceResponse.setOriginalPrice(_ctx.floatValue("QueryTrademarkPriceResponse.OriginalPrice"));<NEW_LINE>queryTrademarkPriceResponse.setTradePrice(_ctx.floatValue("QueryTrademarkPriceResponse.TradePrice"));<NEW_LINE>queryTrademarkPriceResponse.setCurrency(_ctx.stringValue("QueryTrademarkPriceResponse.Currency"));<NEW_LINE>List<PricesItem> prices = new ArrayList<PricesItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryTrademarkPriceResponse.Prices.Length"); i++) {<NEW_LINE>PricesItem pricesItem = new PricesItem();<NEW_LINE>pricesItem.setClassificationCode(_ctx.stringValue<MASK><NEW_LINE>pricesItem.setDiscountPrice(_ctx.floatValue("QueryTrademarkPriceResponse.Prices[" + i + "].DiscountPrice"));<NEW_LINE>pricesItem.setOriginalPrice(_ctx.floatValue("QueryTrademarkPriceResponse.Prices[" + i + "].OriginalPrice"));<NEW_LINE>pricesItem.setTradePrice(_ctx.floatValue("QueryTrademarkPriceResponse.Prices[" + i + "].TradePrice"));<NEW_LINE>pricesItem.setCurrency(_ctx.stringValue("QueryTrademarkPriceResponse.Prices[" + i + "].Currency"));<NEW_LINE>prices.add(pricesItem);<NEW_LINE>}<NEW_LINE>queryTrademarkPriceResponse.setPrices(prices);<NEW_LINE>return queryTrademarkPriceResponse;<NEW_LINE>} | ("QueryTrademarkPriceResponse.Prices[" + i + "].ClassificationCode")); |
942,082 | public Packet nextFrame() throws IOException {<NEW_LINE>try {<NEW_LINE>Future<DashMP4DemuxerTrack> curFrag = fragments.get(curFragNo);<NEW_LINE>MP4Packet nextFrame = null;<NEW_LINE>if (curFrag != null) {<NEW_LINE>nextFrame = getCurFrag(curFrag).nextFrame();<NEW_LINE>if (nextFrame == null) {<NEW_LINE>getCurFrag(curFrag).close();<NEW_LINE>fragments.put(curFragNo, null);<NEW_LINE>curFragNo++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (nextFrame != null) {<NEW_LINE>++globalFrame;<NEW_LINE>return setPts(nextFrame);<NEW_LINE>}<NEW_LINE>curFrag = fragments.get(curFragNo);<NEW_LINE>if (curFrag == null) {<NEW_LINE>for (int i = curFragNo; i < curFragNo + INIT_SIZE<MASK><NEW_LINE>curFrag = fragments.get(curFragNo);<NEW_LINE>}<NEW_LINE>if (curFrag == null)<NEW_LINE>return null;<NEW_LINE>++globalFrame;<NEW_LINE>return setPts(getCurFrag(curFrag).nextFrame());<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>throw new RuntimeException("Execution problem", e);<NEW_LINE>}<NEW_LINE>} | ; i++) scheduleFragment(curFragNo); |
203,898 | protected void processClassLevelAnnotations(ConstPool constantPool, ClassPool pool, Object object) throws NotFoundException {<NEW_LINE>if (AnnotationsAttribute.class.isAssignableFrom(object.getClass())) {<NEW_LINE>AnnotationsAttribute attr = (AnnotationsAttribute) object;<NEW_LINE>Annotation[] items = attr.getAnnotations();<NEW_LINE>List<Annotation> newItems = new ArrayList<Annotation>();<NEW_LINE>ArrayMemberValue namedQueryArray = new ArrayMemberValue(constantPool);<NEW_LINE>ArrayMemberValue nativeQueryArray = new ArrayMemberValue(constantPool);<NEW_LINE>for (Annotation annotation : items) {<NEW_LINE>String typeName = annotation.getTypeName();<NEW_LINE>if (typeName.equals(NamedQueries.class.getName())) {<NEW_LINE>namedQueryArray = (ArrayMemberValue) annotation.getMemberValue("value");<NEW_LINE>} else if (typeName.equals(NamedNativeQueries.class.getName())) {<NEW_LINE>nativeQueryArray = (ArrayMemberValue) annotation.getMemberValue("value");<NEW_LINE>} else {<NEW_LINE>newItems.add(annotation);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!namedQueries.isEmpty()) {<NEW_LINE>prepareNamedQueries(constantPool, pool, namedQueryArray);<NEW_LINE>Annotation namedQueriesAnnotation = new Annotation(NamedQueries.class.getName(), constantPool);<NEW_LINE><MASK><NEW_LINE>newItems.add(namedQueriesAnnotation);<NEW_LINE>}<NEW_LINE>if (!nativeQueries.isEmpty()) {<NEW_LINE>prepareNativeQueries(constantPool, pool, nativeQueryArray);<NEW_LINE>Annotation nativeQueriesAnnotation = new Annotation(NamedQueries.class.getName(), constantPool);<NEW_LINE>nativeQueriesAnnotation.addMemberValue("value", nativeQueryArray);<NEW_LINE>newItems.add(nativeQueriesAnnotation);<NEW_LINE>}<NEW_LINE>attr.setAnnotations(newItems.toArray(new Annotation[newItems.size()]));<NEW_LINE>}<NEW_LINE>} | namedQueriesAnnotation.addMemberValue("value", namedQueryArray); |
114,851 | public static AnAction[] createActionOrGroup(@Nonnull String text, @Nonnull BaseLibrariesConfigurable librariesConfigurable, @Nonnull final Project project) {<NEW_LINE>final List<LibraryType<?>> extensions = LibraryType.EP_NAME.getExtensionList();<NEW_LINE>List<LibraryType<?>> suitableTypes = new ArrayList<>();<NEW_LINE>if (librariesConfigurable instanceof ProjectLibrariesConfigurable) {<NEW_LINE>for (LibraryType<?> extension : extensions) {<NEW_LINE>if (!LibraryEditingUtil.getSuitableModules(project, extension.getKind(), null).isEmpty()) {<NEW_LINE>suitableTypes.add(extension);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>suitableTypes.addAll(extensions);<NEW_LINE>}<NEW_LINE>if (suitableTypes.isEmpty()) {<NEW_LINE>return new AnAction[] { new CreateNewLibraryAction(text, AllIcons.Nodes.PpLib, null, librariesConfigurable, project) };<NEW_LINE>}<NEW_LINE>List<AnAction> <MASK><NEW_LINE>actions.add(new CreateNewLibraryAction(IdeBundle.message("create.default.library.type.action.name"), AllIcons.Nodes.PpLib, null, librariesConfigurable, project));<NEW_LINE>for (LibraryType<?> type : suitableTypes) {<NEW_LINE>final String actionName = type.getCreateActionName();<NEW_LINE>if (actionName != null) {<NEW_LINE>actions.add(new CreateNewLibraryAction(actionName, type.getIcon(), type, librariesConfigurable, project));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return actions.toArray(new AnAction[actions.size()]);<NEW_LINE>} | actions = new ArrayList<>(); |
131,200 | protected void run(StructuredGraph graph) {<NEW_LINE>EconomicMap<LoopBeginNode, EconomicSet<LocationIdentity>> modifiedInLoops = null;<NEW_LINE>if (graph.hasLoops()) {<NEW_LINE>modifiedInLoops = EconomicMap.create(Equivalence.IDENTITY);<NEW_LINE>ControlFlowGraph cfg = ControlFlowGraph.compute(graph, true, true, false, false);<NEW_LINE>for (Loop<?> l : cfg.getLoops()) {<NEW_LINE>HIRLoop loop = (HIRLoop) l;<NEW_LINE>processLoop(loop, modifiedInLoops);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>EconomicSetNodeEventListener listener = new EconomicSetNodeEventListener(EnumSet<MASK><NEW_LINE>try (Graph.NodeEventScope nes = graph.trackNodeEvents(listener)) {<NEW_LINE>ReentrantNodeIterator.apply(new TornadoFloatingReadReplacement.FloatingReadClosure(modifiedInLoops, createFloatingReads, createMemoryMapNodes), graph.start(), new TornadoFloatingReadReplacement.MemoryMapImpl(graph.start()));<NEW_LINE>}<NEW_LINE>for (Node n : removeExternallyUsedNodes(listener.getNodes())) {<NEW_LINE>if (n.isAlive() && n instanceof FloatingNode) {<NEW_LINE>n.replaceAtUsages(null);<NEW_LINE>GraphUtil.killWithUnusedFloatingInputs(n);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (createFloatingReads) {<NEW_LINE>graph.setAfterStage(StructuredGraph.StageFlag.FLOATING_READS);<NEW_LINE>}<NEW_LINE>} | .of(NODE_ADDED, ZERO_USAGES)); |
1,780,550 | public User createUser(final UserCreateDto userCreateDto) {<NEW_LINE>log.info("Create new user with userCreateDto: {}", userCreateDto);<NEW_LINE>val isMailServerEnabled = Boolean.valueOf(env.getProperty("spring.mail.enable"));<NEW_LINE>validateUserCreateDto(userCreateDto);<NEW_LINE>val isAccountEnabled = isNotTrue(isMailServerEnabled);<NEW_LINE>val user = User.builder().email(userCreateDto.getEmail().toLowerCase()).firstName(userCreateDto.getFirstName()).lastName(userCreateDto.getLastName()).password(encoder.encode(userCreateDto.getPassword())).guid(UUID.randomUUID().toString()).accountNonExpired(true).accountNonLocked(true).credentialsNonExpired(true).enabled(isAccountEnabled).allowStatistics(userCreateDto.isAllowStatistics()).<MASK><NEW_LINE>if (isMailServerEnabled) {<NEW_LINE>user.setRegistrationToken(generateRegistrationToken());<NEW_LINE>sendRegistrationTokenToUser(user);<NEW_LINE>}<NEW_LINE>return userRepository.save(user);<NEW_LINE>} | globalRole(USER).build(); |
1,042,769 | // /////////////////////////////////////////////////////////////////////////////////////////<NEW_LINE>// PROTO BUFFER<NEW_LINE>// /////////////////////////////////////////////////////////////////////////////////////////<NEW_LINE>@Override<NEW_LINE>public protobuf.ProcessModel toProtoMessage() {<NEW_LINE>protobuf.ProcessModel.Builder builder = protobuf.ProcessModel.newBuilder().setTradingPeer((protobuf.TradingPeer) tradingPeer.toProtoMessage()).setOfferId(offerId).setAccountId(accountId).setPubKeyRing(pubKeyRing.toProtoMessage()).setChangeOutputValue(changeOutputValue).setUseSavingsWallet(useSavingsWallet).setFundsNeededForTradeAsLong(fundsNeededForTradeAsLong).setPaymentStartedMessageState(paymentStartedMessageStateProperty.get().name()).setBuyerPayoutAmountFromMediation(buyerPayoutAmountFromMediation).setSellerPayoutAmountFromMediation(sellerPayoutAmountFromMediation);<NEW_LINE>Optional.ofNullable(takeOfferFeeTxId).ifPresent(builder::setTakeOfferFeeTxId);<NEW_LINE>Optional.ofNullable(payoutTxSignature).ifPresent(e -> builder.setPayoutTxSignature(ByteString.copyFrom(payoutTxSignature)));<NEW_LINE>Optional.ofNullable(preparedDepositTx).ifPresent(e -> builder.setPreparedDepositTx(ByteString.copyFrom(preparedDepositTx)));<NEW_LINE>Optional.ofNullable(rawTransactionInputs).ifPresent(e -> builder.addAllRawTransactionInputs(ProtoUtil.collectionToProto(rawTransactionInputs, protobuf.RawTransactionInput.class)));<NEW_LINE>Optional.ofNullable(changeOutputAddress).ifPresent(builder::setChangeOutputAddress);<NEW_LINE>Optional.ofNullable(myMultiSigPubKey).ifPresent(e -> builder.setMyMultiSigPubKey(<MASK><NEW_LINE>Optional.ofNullable(tempTradingPeerNodeAddress).ifPresent(e -> builder.setTempTradingPeerNodeAddress(tempTradingPeerNodeAddress.toProtoMessage()));<NEW_LINE>Optional.ofNullable(mediatedPayoutTxSignature).ifPresent(e -> builder.setMediatedPayoutTxSignature(ByteString.copyFrom(e)));<NEW_LINE>return builder.build();<NEW_LINE>} | ByteString.copyFrom(myMultiSigPubKey))); |
969,770 | public final ComboViewer bindCalendarCombo(Composite editArea, String label, String property) {<NEW_LINE>Label l = new Label(editArea, SWT.NONE);<NEW_LINE>l.setText(label);<NEW_LINE>ComboViewer combo = new ComboViewer(editArea, SWT.READ_ONLY);<NEW_LINE>combo.setContentProvider(ArrayContentProvider.getInstance());<NEW_LINE>combo.setLabelProvider(new LabelProvider());<NEW_LINE>TradeCalendar emptyOption = TradeCalendarManager.createInheritDefaultOption();<NEW_LINE>List<TradeCalendar> calendar = new ArrayList<>();<NEW_LINE>calendar.add(emptyOption);<NEW_LINE>calendar.addAll(TradeCalendarManager.getAvailableCalendar().sorted().collect(Collectors.toList()));<NEW_LINE>combo.setInput(calendar);<NEW_LINE>GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.FILL).applyTo(combo.getControl());<NEW_LINE>UpdateValueStrategy<TradeCalendar, String> targetToModel = new UpdateValueStrategy<>();<NEW_LINE>targetToModel.setConverter(new CalendarToStringConverter());<NEW_LINE>UpdateValueStrategy<String, TradeCalendar> <MASK><NEW_LINE>modelToTarget.setConverter(new StringToCalendarConverter(emptyOption));<NEW_LINE>IObservableValue<TradeCalendar> targetObservable = ViewerProperties.singleSelection(TradeCalendar.class).observe(combo);<NEW_LINE>IObservableValue<String> observable = BeanProperties.value(property, String.class).observe(model);<NEW_LINE>context.bindValue(targetObservable, observable, targetToModel, modelToTarget);<NEW_LINE>return combo;<NEW_LINE>} | modelToTarget = new UpdateValueStrategy<>(); |
942,309 | public HealthCheckResponse call() {<NEW_LINE>long diskFreeInBytes;<NEW_LINE>long totalInBytes;<NEW_LINE>try {<NEW_LINE>diskFreeInBytes = fileStore.getUsableSpace();<NEW_LINE>totalInBytes = fileStore.getTotalSpace();<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new HealthCheckException("Failed to obtain disk space data", e);<NEW_LINE>}<NEW_LINE>long usedInBytes = totalInBytes - diskFreeInBytes;<NEW_LINE>long threshold = (long) ((thresholdPercent / 100) * totalInBytes);<NEW_LINE>// Formatter ensures that returned delimiter will be always the same<NEW_LINE>Formatter formatter <MASK><NEW_LINE>return HealthCheckResponse.named("diskSpace").status(threshold >= usedInBytes).withData("percentFree", formatter.format("%.2f%%", 100 * ((double) diskFreeInBytes / totalInBytes)).toString()).withData("free", DiskSpaceHealthCheck.format(diskFreeInBytes)).withData("freeBytes", diskFreeInBytes).withData("total", DiskSpaceHealthCheck.format(totalInBytes)).withData("totalBytes", totalInBytes).build();<NEW_LINE>} | = new Formatter(Locale.US); |
236,438 | protected void createTupleDescs(Analyzer analyzer) {<NEW_LINE>// Create the intermediate tuple desc first, so that the tuple ids are increasing<NEW_LINE>// from bottom to top in the plan tree.<NEW_LINE>intermediateTupleDesc = createTupleDesc(analyzer, false);<NEW_LINE>if (requiresIntermediateTuple(aggregateExprs, groupingExprs.size() == 0)) {<NEW_LINE>outputTupleDesc = createTupleDesc(analyzer, true);<NEW_LINE>// save the output and intermediate slots info into global desc table<NEW_LINE>// after creaing the plan, we can call materializeIntermediateSlots method<NEW_LINE>// to set the materialized info to intermediate slots based on output slots.<NEW_LINE>ArrayList<SlotDescriptor> outputSlots = outputTupleDesc.getSlots();<NEW_LINE>ArrayList<SlotDescriptor<MASK><NEW_LINE>HashMap<SlotDescriptor, SlotDescriptor> mapping = new HashMap<>();<NEW_LINE>for (int i = 0; i < outputSlots.size(); ++i) {<NEW_LINE>mapping.put(outputSlots.get(i), intermediateSlots.get(i));<NEW_LINE>}<NEW_LINE>analyzer.getDescTbl().addSlotMappingInfo(mapping);<NEW_LINE>} else {<NEW_LINE>outputTupleDesc = intermediateTupleDesc;<NEW_LINE>}<NEW_LINE>} | > intermediateSlots = intermediateTupleDesc.getSlots(); |
1,674,353 | final SyncResourceResult executeSyncResource(SyncResourceRequest syncResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(syncResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SyncResourceRequest> request = null;<NEW_LINE>Response<SyncResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SyncResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(syncResourceRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Service Catalog AppRegistry");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SyncResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SyncResourceResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SyncResourceResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden()); |
822,492 | public TableConstructorExpressionNode transform(TableConstructorExpressionNode tableConstructorExpressionNode) {<NEW_LINE>Token tableKeyword = formatToken(tableConstructorExpressionNode.tableKeyword(), 1, 0);<NEW_LINE>KeySpecifierNode keySpecifier = formatNode(tableConstructorExpressionNode.keySpecifier().orElse<MASK><NEW_LINE>SeparatedNodeList<Node> rows = tableConstructorExpressionNode.rows();<NEW_LINE>int rowTrailingWS = 0, rowTrailingNL = 0;<NEW_LINE>if (rows.size() > 1) {<NEW_LINE>rowTrailingNL++;<NEW_LINE>} else {<NEW_LINE>rowTrailingWS++;<NEW_LINE>}<NEW_LINE>indent();<NEW_LINE>Token openBracket = formatToken(tableConstructorExpressionNode.openBracket(), 0, rowTrailingNL);<NEW_LINE>indent();<NEW_LINE>SeparatedNodeList<Node> mappingConstructors = formatSeparatedNodeList(tableConstructorExpressionNode.rows(), 0, 0, rowTrailingWS, rowTrailingNL, 0, rowTrailingNL);<NEW_LINE>unindent();<NEW_LINE>Token closeBracket = formatToken(tableConstructorExpressionNode.closeBracket(), env.trailingWS, env.trailingNL);<NEW_LINE>unindent();<NEW_LINE>return tableConstructorExpressionNode.modify().withTableKeyword(tableKeyword).withKeySpecifier(keySpecifier).withOpenBracket(openBracket).withRows(mappingConstructors).withCloseBracket(closeBracket).apply();<NEW_LINE>} | (null), 1, 0); |
1,129,982 | public void installBatchSpanProcessorForOtlp(OtlpExporterConfig.OtlpExporterRuntimeConfig runtimeConfig, LaunchMode launchMode) {<NEW_LINE>if (launchMode == LaunchMode.DEVELOPMENT && !runtimeConfig.endpoint.isPresent()) {<NEW_LINE>// Default the endpoint for development only<NEW_LINE>runtimeConfig.endpoint = Optional.of("http://localhost:4317");<NEW_LINE>}<NEW_LINE>// Only create the OtlpGrpcSpanExporter if an endpoint was set in runtime config<NEW_LINE>if (runtimeConfig.endpoint.isPresent() && runtimeConfig.endpoint.get().trim().length() > 0) {<NEW_LINE>try {<NEW_LINE>OtlpGrpcSpanExporterBuilder otlpGrpcSpanExporterBuilder = OtlpGrpcSpanExporter.builder().setEndpoint(runtimeConfig.endpoint.get()).setTimeout(runtimeConfig.exportTimeout);<NEW_LINE>if (runtimeConfig.headers.isPresent()) {<NEW_LINE>Map<String, String> headers = OpenTelemetryUtil.convertKeyValueListToMap(runtimeConfig.headers.get());<NEW_LINE>headers.forEach(otlpGrpcSpanExporterBuilder::addHeader);<NEW_LINE>}<NEW_LINE>runtimeConfig.compression.ifPresent(otlpGrpcSpanExporterBuilder::setCompression);<NEW_LINE><MASK><NEW_LINE>// Create BatchSpanProcessor for OTLP and install into LateBoundBatchSpanProcessor<NEW_LINE>LateBoundBatchSpanProcessor delayedProcessor = CDI.current().select(LateBoundBatchSpanProcessor.class, Any.Literal.INSTANCE).get();<NEW_LINE>delayedProcessor.setBatchSpanProcessorDelegate(BatchSpanProcessor.builder(otlpSpanExporter).build());<NEW_LINE>} catch (IllegalArgumentException iae) {<NEW_LINE>throw new IllegalStateException("Unable to install OTLP Exporter", iae);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | OtlpGrpcSpanExporter otlpSpanExporter = otlpGrpcSpanExporterBuilder.build(); |
1,665,121 | private void executeMultiResultSet(PlanNode node) {<NEW_LINE>ManagerHandlerBuilder builder = new ManagerHandlerBuilder(node, this);<NEW_LINE>try {<NEW_LINE>builder.build();<NEW_LINE>} catch (SQLSyntaxErrorException e) {<NEW_LINE>LOGGER.info(<MASK><NEW_LINE>managerService.writeErrMessage(ErrorCode.ER_YES, "optimizer build error");<NEW_LINE>} catch (NoSuchElementException e) {<NEW_LINE>LOGGER.info(managerService + " execute plan is : " + node, e);<NEW_LINE>managerService.writeErrMessage(ErrorCode.ER_NO_VALID_CONNECTION, "no valid connection");<NEW_LINE>} catch (MySQLOutPutException e) {<NEW_LINE>LOGGER.info(managerService + " execute plan is : " + node, e);<NEW_LINE>managerService.writeErrMessage(e.getSqlState(), e.getMessage(), e.getErrorCode());<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.info(managerService + " execute plan is : " + node, e);<NEW_LINE>managerService.writeErrMessage(ErrorCode.ER_HANDLE_DATA, e.toString());<NEW_LINE>}<NEW_LINE>} | managerService + " execute plan is : " + node, e); |
1,182,117 | public static void main(String[] args) {<NEW_LINE>String fileName = UtilIO.pathExample("background/street_intersection.mp4");<NEW_LINE>// String fileName = UtilIO.pathExample("background/rubixfire.mp4"); // dynamic background<NEW_LINE>// String fileName = UtilIO.pathExample("background/horse_jitter.mp4"); // degraded performance because of jitter<NEW_LINE>// String fileName = UtilIO.pathExample("tracking/chipmunk.mjpeg"); // Camera moves. Stationary will fail here<NEW_LINE>// Comment/Uncomment to switch input image type<NEW_LINE>ImageType imageType = ImageType.single(GrayF32.class);<NEW_LINE>// ImageType imageType = ImageType.il(3, InterleavedF32.class);<NEW_LINE>// ImageType imageType = ImageType.il(3, InterleavedU8.class);<NEW_LINE>// ConfigBackgroundGmm configGmm = new ConfigBackgroundGmm();<NEW_LINE>// Comment/Uncomment to switch algorithms<NEW_LINE>BackgroundModelStationary background = FactoryBackgroundModel.stationaryBasic(new ConfigBackgroundBasic<MASK><NEW_LINE>// FactoryBackgroundModel.stationaryGmm(configGmm, imageType);<NEW_LINE>MediaManager media = DefaultMediaManager.INSTANCE;<NEW_LINE>SimpleImageSequence video = media.openVideo(fileName, background.getImageType());<NEW_LINE>// media.openCamera(null,640,480,background.getImageType());<NEW_LINE>// Declare storage for segmented image. 1 = moving foreground and 0 = background<NEW_LINE>GrayU8 segmented = new GrayU8(video.getWidth(), video.getHeight());<NEW_LINE>var visualized = new BufferedImage(segmented.width, segmented.height, BufferedImage.TYPE_INT_RGB);<NEW_LINE>var gui = new ImageGridPanel(1, 2);<NEW_LINE>gui.setImages(visualized, visualized);<NEW_LINE>ShowImages.showWindow(gui, "Static Scene: Background Segmentation", true);<NEW_LINE>double fps = 0;<NEW_LINE>// smoothing factor for FPS<NEW_LINE>double alpha = 0.01;<NEW_LINE>while (video.hasNext()) {<NEW_LINE>ImageBase input = video.next();<NEW_LINE>long before = System.nanoTime();<NEW_LINE>background.updateBackground(input, segmented);<NEW_LINE>long after = System.nanoTime();<NEW_LINE>fps = (1.0 - alpha) * fps + alpha * (1.0 / ((after - before) / 1e9));<NEW_LINE>VisualizeBinaryData.renderBinary(segmented, false, visualized);<NEW_LINE>gui.setImage(0, 0, (BufferedImage) video.getGuiImage());<NEW_LINE>gui.setImage(0, 1, visualized);<NEW_LINE>gui.repaint();<NEW_LINE>System.out.println("FPS = " + fps);<NEW_LINE>BoofMiscOps.sleep(5);<NEW_LINE>}<NEW_LINE>System.out.println("done!");<NEW_LINE>} | (35, 0.005f), imageType); |
770,666 | protected void initComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {<NEW_LINE><MASK><NEW_LINE>if (element instanceof GroupingElement) {<NEW_LINE>setFont(getFont().deriveFont(Font.BOLD));<NEW_LINE>}<NEW_LINE>String prefix = calcPrefix(element);<NEW_LINE>if (element != null) {<NEW_LINE>String[] text = element.getText();<NEW_LINE>if (text == null) {<NEW_LINE>text = ArrayUtil.EMPTY_STRING_ARRAY;<NEW_LINE>}<NEW_LINE>if (text.length > 0 && text[0] == null) {<NEW_LINE>text[0] = "";<NEW_LINE>}<NEW_LINE>setText(text, prefix);<NEW_LINE>}<NEW_LINE>consulo.ui.image.Image icon = null;<NEW_LINE>if (element instanceof GroupingElement) {<NEW_LINE>final GroupingElement groupingElement = (GroupingElement) element;<NEW_LINE>icon = groupingElement.getFile() != null ? groupingElement.getFile().getFileType().getIcon() : AllIcons.FileTypes.Text;<NEW_LINE>} else if (element instanceof SimpleMessageElement || element instanceof NavigatableMessageElement) {<NEW_LINE>ErrorTreeElementKind kind = element.getKind();<NEW_LINE>if (ErrorTreeElementKind.ERROR.equals(kind)) {<NEW_LINE>icon = AllIcons.General.Error;<NEW_LINE>} else if (ErrorTreeElementKind.WARNING.equals(kind) || ErrorTreeElementKind.NOTE.equals(kind)) {<NEW_LINE>icon = AllIcons.General.Warning;<NEW_LINE>} else if (ErrorTreeElementKind.INFO.equals(kind)) {<NEW_LINE>icon = AllIcons.General.Information;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setIcon(TargetAWT.to(icon));<NEW_LINE>} | final ErrorTreeElement element = getElement(value); |
1,356,863 | static void testGrams(Path root, Path test, String labelTarget, String name) throws IOException {<NEW_LINE>Path modelPath = root.resolve(name + ".model");<NEW_LINE>Path predictions = root.resolve(name + ".predictions");<NEW_LINE>FastTextClassifier <MASK><NEW_LINE>try (PrintWriter pw = new PrintWriter(predictions.toFile(), "utf-8")) {<NEW_LINE>List<String> all = Files.readAllLines(test);<NEW_LINE>for (String s : all) {<NEW_LINE>List<String> tokens = Splitter.on(" ").splitToList(s);<NEW_LINE>List<String> rest = tokens.subList(1, tokens.size());<NEW_LINE>List<String> grams = getGrams(rest, 7);<NEW_LINE>List<Hit> hits = new ArrayList<>();<NEW_LINE>for (String gram : grams) {<NEW_LINE>List<ScoredItem<String>> res = classifier.predict(gram, 2);<NEW_LINE>for (ScoredItem<String> re : res) {<NEW_LINE>float p = (float) Math.exp(re.score);<NEW_LINE>if (re.item.equals(labelTarget) && p > 0.45) {<NEW_LINE>hits.add(new Hit(gram, re));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>pw.println(s);<NEW_LINE>for (Hit hit : hits) {<NEW_LINE>pw.println(hit);<NEW_LINE>}<NEW_LINE>pw.println("-----------------------");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | classifier = FastTextClassifier.load(modelPath); |
906,494 | public void processUnknownTypeProperty(CodegenModel model, CodegenProperty property) {<NEW_LINE>Map<String, Object> vendorExtensions = property.getVendorExtensions();<NEW_LINE>Map<String, Object> mysqlSchema = new HashMap<>();<NEW_LINE>Map<String, Object> columnDefinition = new HashMap<>();<NEW_LINE>String baseName = property.getBaseName();<NEW_LINE>String colName = this.toColumnName(baseName);<NEW_LINE><MASK><NEW_LINE>String description = property.getDescription();<NEW_LINE>String defaultValue = property.getDefaultValue();<NEW_LINE>if (vendorExtensions.containsKey(VENDOR_EXTENSION_MYSQL_SCHEMA)) {<NEW_LINE>// user already specified schema values<NEW_LINE>LOGGER.info("Found vendor extension in '{}' property, autogeneration skipped", baseName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (this.getIdentifierNamingConvention().equals("snake_case") && !baseName.equals(colName)) {<NEW_LINE>// add original name in column comment<NEW_LINE>String commentExtra = "Original param name - " + baseName + ".";<NEW_LINE>description = (description == null || description.isEmpty()) ? commentExtra : description + ". " + commentExtra;<NEW_LINE>}<NEW_LINE>vendorExtensions.put(VENDOR_EXTENSION_MYSQL_SCHEMA, mysqlSchema);<NEW_LINE>mysqlSchema.put("columnDefinition", columnDefinition);<NEW_LINE>columnDefinition.put("colName", colName);<NEW_LINE>columnDefinition.put("colDataType", "TEXT");<NEW_LINE>if (Boolean.TRUE.equals(required)) {<NEW_LINE>columnDefinition.put("colNotNull", true);<NEW_LINE>} else {<NEW_LINE>columnDefinition.put("colNotNull", false);<NEW_LINE>try {<NEW_LINE>columnDefinition.put("colDefault", toCodegenMysqlDataTypeDefault(defaultValue, (String) columnDefinition.get("colDataType")));<NEW_LINE>} catch (RuntimeException exception) {<NEW_LINE>LOGGER.warn("Property '{}' of model '{}' mapped to MySQL data type which doesn't support default value", baseName, model.getName());<NEW_LINE>columnDefinition.put("colDefault", null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (description != null) {<NEW_LINE>columnDefinition.put("colComment", description);<NEW_LINE>}<NEW_LINE>} | Boolean required = property.getRequired(); |
212,869 | private boolean showCategoryEditNotification(Context context, Media media, boolean result) {<NEW_LINE>String message;<NEW_LINE>String title = context.getString(R.string.category_edit_helper_show_edit_title);<NEW_LINE>if (result) {<NEW_LINE>title += ": " + context.getString(R.string.category_edit_helper_show_edit_title_success);<NEW_LINE>StringBuilder categoriesInMessage = new StringBuilder();<NEW_LINE>List<String> mediaCategoryList = media.getCategories();<NEW_LINE>for (String category : mediaCategoryList) {<NEW_LINE>categoriesInMessage.append(category);<NEW_LINE>if (category.equals(mediaCategoryList.get(mediaCategoryList.size() - 1))) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>categoriesInMessage.append(",");<NEW_LINE>}<NEW_LINE>message = context.getResources().getQuantityString(R.plurals.category_edit_helper_show_edit_message_if, mediaCategoryList.size(), categoriesInMessage.toString());<NEW_LINE>} else {<NEW_LINE>title += ": " + context.<MASK><NEW_LINE>message = context.getString(R.string.category_edit_helper_edit_message_else);<NEW_LINE>}<NEW_LINE>String urlForFile = BuildConfig.COMMONS_URL + "/wiki/" + media.getFilename();<NEW_LINE>Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(urlForFile));<NEW_LINE>notificationHelper.showNotification(context, title, message, NOTIFICATION_EDIT_CATEGORY, browserIntent);<NEW_LINE>return result;<NEW_LINE>} | getString(R.string.category_edit_helper_show_edit_title); |
674,240 | private void createRecorder() {<NEW_LINE>@SuppressWarnings("rawtypes")<NEW_LINE>Class recorderClass = loadClientClass("simianarmy.client.recorder.class");<NEW_LINE>if (recorderClass != null && recorderClass.equals(RDSRecorder.class)) {<NEW_LINE>String dbDriver = configuration().getStr("simianarmy.recorder.db.driver");<NEW_LINE>String dbUser = configuration().getStr("simianarmy.recorder.db.user");<NEW_LINE>String dbPass = configuration().getStr("simianarmy.recorder.db.pass");<NEW_LINE>String dbUrl = configuration().getStr("simianarmy.recorder.db.url");<NEW_LINE>String dbTable = configuration().getStr("simianarmy.recorder.db.table");<NEW_LINE>RDSRecorder rdsRecorder = new RDSRecorder(dbDriver, dbUser, dbPass, dbUrl, dbTable, client.region());<NEW_LINE>rdsRecorder.init();<NEW_LINE>setRecorder(rdsRecorder);<NEW_LINE>} else if (recorderClass == null || recorderClass.equals(SimpleDBRecorder.class)) {<NEW_LINE>String domain = config.getStrOrElse("simianarmy.recorder.sdb.domain", "SIMIAN_ARMY");<NEW_LINE>if (client != null) {<NEW_LINE>SimpleDBRecorder simpleDbRecorder = new SimpleDBRecorder(client, domain);<NEW_LINE>simpleDbRecorder.init();<NEW_LINE>setRecorder(simpleDbRecorder);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>setRecorder(<MASK><NEW_LINE>}<NEW_LINE>} | (MonkeyRecorder) factory(recorderClass)); |
1,175,908 | public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException {<NEW_LINE>Tr.entry(tc, "checkClientTrusted", new Object[] { chain, authType, engine });<NEW_LINE>try {<NEW_LINE>for (int i = 0; i < tm.length; i++) {<NEW_LINE>if (tm[i] != null && tm[i] instanceof X509TrustManager) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, "Delegating to X509TrustManager: " + tm[i].getClass().getName());<NEW_LINE>((X509ExtendedTrustManager) tm[i]).checkClientTrusted(chain, authType, engine);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (CertificateException e) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>Tr.debug(tc, <MASK><NEW_LINE>processClientTrustError(chain, authType, e);<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>Tr.exit(tc, "checkClientTrusted");<NEW_LINE>} | "Certificate Exception from configured trustmanager occurred: " + e.getMessage()); |
1,548,371 | private void initComponents() {<NEW_LINE>java.awt.GridBagConstraints gridBagConstraints;<NEW_LINE>jLabel1 = new javax.swing.JLabel();<NEW_LINE>jScrollPane1 = new javax.swing.JScrollPane();<NEW_LINE>jMainClassList = new javax.swing.JList();<NEW_LINE>setLayout(new java.awt.GridBagLayout());<NEW_LINE>setPreferredSize(new java.awt.Dimension(380, 300));<NEW_LINE>getAccessibleContext().setAccessibleDescription(Bundle.AD_MainClassChooser());<NEW_LINE>jLabel1.setLabelFor(jMainClassList);<NEW_LINE>Mnemonics.setLocalizedText(jLabel1, Bundle.CTL_AvaialableMainClasses());<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 0;<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(12, 12, 2, 12);<NEW_LINE>add(jLabel1, gridBagConstraints);<NEW_LINE>jScrollPane1.setMinimumSize(new java.awt.Dimension(100, 200));<NEW_LINE>jScrollPane1.setViewportView(jMainClassList);<NEW_LINE>jMainClassList.getAccessibleContext().setAccessibleDescription(Bundle.AD_jMainClassList());<NEW_LINE>gridBagConstraints = new java.awt.GridBagConstraints();<NEW_LINE>gridBagConstraints.gridx = 0;<NEW_LINE>gridBagConstraints.gridy = 1;<NEW_LINE>gridBagConstraints.gridwidth = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.gridheight = java.awt.GridBagConstraints.REMAINDER;<NEW_LINE>gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;<NEW_LINE>gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;<NEW_LINE>gridBagConstraints.weightx = 1.0;<NEW_LINE>gridBagConstraints.weighty = 1.0;<NEW_LINE>gridBagConstraints.insets = new java.awt.Insets(<MASK><NEW_LINE>add(jScrollPane1, gridBagConstraints);<NEW_LINE>} | 0, 12, 0, 12); |
175,210 | protected void consumeCaseLabel() {<NEW_LINE>// // SwitchLabel ::= 'case' ConstantExpression ':'<NEW_LINE>// this.expressionLengthPtr--;<NEW_LINE>// Expression expression = this.expressionStack[this.expressionPtr--];<NEW_LINE>// CaseStatement caseStatement = new CaseStatement(expression, expression.sourceEnd, this.intStack[this.intPtr--]);<NEW_LINE>// // Look for $fall-through$ tag in leading comment for case statement<NEW_LINE>// if (hasLeadingTagComment(FALL_THROUGH_TAG, caseStatement.sourceStart)) {<NEW_LINE>// caseStatement.bits |= ASTNode.DocumentedFallthrough;<NEW_LINE>// }<NEW_LINE>// pushOnAstStack(caseStatement);<NEW_LINE>Expression[] constantExpressions = null;<NEW_LINE>int length = 0;<NEW_LINE>if ((length = this.expressionLengthStack[this.expressionLengthPtr--]) != 0) {<NEW_LINE>this.expressionPtr -= length;<NEW_LINE>System.arraycopy(this.expressionStack, this.expressionPtr + 1, constantExpressions = new Expression[length], 0, length);<NEW_LINE>} else {<NEW_LINE>// TODO : ERROR<NEW_LINE>}<NEW_LINE>CaseStatement caseStatement = new CaseStatement(constantExpressions[0], constantExpressions[length - 1].sourceEnd, this.<MASK><NEW_LINE>if (constantExpressions.length > 1) {<NEW_LINE>if (!this.parsingJava14Plus) {<NEW_LINE>problemReporter().multiConstantCaseLabelsNotSupported(caseStatement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>caseStatement.constantExpressions = constantExpressions;<NEW_LINE>// Look for $fall-through$ tag in leading comment for case statement<NEW_LINE>if (hasLeadingTagComment(FALL_THROUGH_TAG, caseStatement.sourceStart)) {<NEW_LINE>caseStatement.bits |= ASTNode.DocumentedFallthrough;<NEW_LINE>}<NEW_LINE>this.casePtr--;<NEW_LINE>this.scanner.caseStartPosition = this.casePtr >= 0 ? this.caseStack[this.casePtr] : -1;<NEW_LINE>pushOnAstStack(caseStatement);<NEW_LINE>} | intStack[this.intPtr--]); |
26,484 | private List<NonTerminalNode> convertImports(List<NonTerminalNode> declarationList) {<NEW_LINE>return declarationList.stream().map(nonTerminalNode -> {<NEW_LINE>if (nonTerminalNode.kind() != SyntaxKind.IMPORT_DECLARATION) {<NEW_LINE>return nonTerminalNode;<NEW_LINE>}<NEW_LINE>ImportDeclarationNode importDeclarationNode = (ImportDeclarationNode) nonTerminalNode;<NEW_LINE>if (importDeclarationNode.orgName().isPresent() && (context.getPackageOrg().isEmpty() || !context.getPackageOrg().get().equals(importDeclarationNode.orgName().get().orgName().text()))) {<NEW_LINE>return nonTerminalNode;<NEW_LINE>}<NEW_LINE>if (context.getPackageName().isEmpty() || !context.getPackageName().get().equals(importDeclarationNode.moduleName().get(0).text())) {<NEW_LINE>return nonTerminalNode;<NEW_LINE>}<NEW_LINE>ImportDeclarationNode.ImportDeclarationNodeModifier modifier = importDeclarationNode.modify();<NEW_LINE>// Replaces original org name with the evaluation org name.<NEW_LINE>if (importDeclarationNode.orgName().isPresent()) {<NEW_LINE>IdentifierToken orgToken = NodeFactory.createIdentifierToken(EVALUATION_PACKAGE_ORG);<NEW_LINE>ImportOrgNameNode newOrgName = NodeFactory.createImportOrgNameNode(orgToken, importDeclarationNode.orgName().get().slashToken());<NEW_LINE>modifier.withOrgName(newOrgName);<NEW_LINE>}<NEW_LINE>// Replaces original package name with the evaluation package name.<NEW_LINE>List<Node> moduleParts = importDeclarationNode.moduleName().stream().collect(Collectors.toList());<NEW_LINE>IdentifierToken packageToken = NodeFactory.createIdentifierToken(EVALUATION_PACKAGE_NAME);<NEW_LINE>moduleParts.remove(0);<NEW_LINE>moduleParts.add(0, packageToken);<NEW_LINE>IdentifierToken moduleNameSeparatorToken = NodeFactory.createIdentifierToken(MODULE_NAME_SEPARATOR);<NEW_LINE>for (int i = 0, size = moduleParts.size(); i < size - 1; i++) {<NEW_LINE>moduleParts.add(2 * i + 1, moduleNameSeparatorToken);<NEW_LINE>}<NEW_LINE>SeparatedNodeList<IdentifierToken> <MASK><NEW_LINE>modifier = modifier.withModuleName(newModuleName);<NEW_LINE>return modifier.apply();<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>} | newModuleName = NodeFactory.createSeparatedNodeList(moduleParts); |
1,259,631 | protected Object createFieldReference(Object receiver) throws InvalidInputException {<NEW_LINE>try {<NEW_LINE>MemberRef fieldRef = this.ast.newMemberRef();<NEW_LINE>SimpleName fieldName = new SimpleName(this.ast);<NEW_LINE>fieldName.internalSetIdentifier(new String(this.identifierStack[0]));<NEW_LINE>fieldRef.setName(fieldName);<NEW_LINE>int start = (int) (this.identifierPositionStack[0] >>> 32);<NEW_LINE>int end = (int) this.identifierPositionStack[0];<NEW_LINE>fieldName.setSourceRange(<MASK><NEW_LINE>if (receiver == null) {<NEW_LINE>start = this.memberStart;<NEW_LINE>fieldRef.setSourceRange(start, end - start + 1);<NEW_LINE>} else {<NEW_LINE>Name typeRef = (Name) receiver;<NEW_LINE>fieldRef.setQualifier(typeRef);<NEW_LINE>start = typeRef.getStartPosition();<NEW_LINE>end = fieldName.getStartPosition() + fieldName.getLength() - 1;<NEW_LINE>fieldRef.setSourceRange(start, end - start + 1);<NEW_LINE>}<NEW_LINE>return fieldRef;<NEW_LINE>} catch (ClassCastException ex) {<NEW_LINE>throw new InvalidInputException();<NEW_LINE>}<NEW_LINE>} | start, end - start + 1); |
1,311,550 | final PutAlternateContactResult executePutAlternateContact(PutAlternateContactRequest putAlternateContactRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putAlternateContactRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutAlternateContactRequest> request = null;<NEW_LINE>Response<PutAlternateContactResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new PutAlternateContactRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putAlternateContactRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Account");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutAlternateContact");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutAlternateContactResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutAlternateContactResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
1,020,617 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {<NEW_LINE>if (FlipperUtils.shouldEnableFlipper(context)) {<NEW_LINE>final FlipperClient client = AndroidFlipperClient.getInstance(context);<NEW_LINE>client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));<NEW_LINE>client<MASK><NEW_LINE>client.addPlugin(new DatabasesFlipperPlugin(context));<NEW_LINE>client.addPlugin(new SharedPreferencesFlipperPlugin(context));<NEW_LINE>client.addPlugin(CrashReporterPlugin.getInstance());<NEW_LINE>NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();<NEW_LINE>NetworkingModule.setCustomClientBuilder(new NetworkingModule.CustomClientBuilder() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void apply(OkHttpClient.Builder builder) {<NEW_LINE>// FIXME: had to disable for RN 0.66 upgrade<NEW_LINE>// builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>client.addPlugin(networkFlipperPlugin);<NEW_LINE>client.start();<NEW_LINE>// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized<NEW_LINE>// Hence we run if after all native modules have been initialized<NEW_LINE>ReactContext reactContext = reactInstanceManager.getCurrentReactContext();<NEW_LINE>if (reactContext == null) {<NEW_LINE>reactInstanceManager.addReactInstanceEventListener(new ReactInstanceManager.ReactInstanceEventListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onReactContextInitialized(ReactContext reactContext) {<NEW_LINE>// FIXME: had to disable for RN 0.66 upgrade<NEW_LINE>// reactInstanceManager.removeReactInstanceEventListener(this);<NEW_LINE>reactContext.runOnNativeModulesQueueThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>client.addPlugin(new FrescoFlipperPlugin());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} else {<NEW_LINE>client.addPlugin(new FrescoFlipperPlugin());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .addPlugin(new ReactFlipperPlugin()); |
503,597 | private static boolean compareSequence(String schemaName, String seqName, SequenceBean sequenceBean) {<NEW_LINE>SystemTableRecord existingSequenceRecord;<NEW_LINE>SequencesAccessor sequencesAccessor = new SequencesAccessor();<NEW_LINE>try (Connection metaDbConn = MetaDbUtil.getConnection()) {<NEW_LINE>sequencesAccessor.setConnection(metaDbConn);<NEW_LINE>existingSequenceRecord = sequencesAccessor.query(schemaName, seqName);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_GMS_GET_CONNECTION, <MASK><NEW_LINE>} finally {<NEW_LINE>sequencesAccessor.setConnection(null);<NEW_LINE>}<NEW_LINE>if (existingSequenceRecord == null || sequenceBean == null) {<NEW_LINE>throw new TddlRuntimeException(ErrorCode.ERR_DDL_JOB_UNEXPECTED, "invalid sequence record or input");<NEW_LINE>}<NEW_LINE>handleDefaultSequenceParams(sequenceBean);<NEW_LINE>if (existingSequenceRecord instanceof SequenceRecord) {<NEW_LINE>SequenceRecord sequenceRecord = (SequenceRecord) existingSequenceRecord;<NEW_LINE>return sequenceRecord.unitCount == sequenceBean.getUnitCount() && sequenceRecord.unitIndex == sequenceBean.getUnitIndex() && sequenceRecord.innerStep == sequenceBean.getInnerStep();<NEW_LINE>} else if (existingSequenceRecord instanceof SequenceOptRecord) {<NEW_LINE>SequenceOptRecord sequenceOptRecord = (SequenceOptRecord) existingSequenceRecord;<NEW_LINE>return sequenceOptRecord.incrementBy == sequenceBean.getIncrement() && sequenceOptRecord.startWith == sequenceBean.getStart() && sequenceOptRecord.maxValue == sequenceBean.getMaxValue() && sequenceOptRecord.cycle == (sequenceBean.getCycle() ? 1 : 0);<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>} | e, e.getMessage()); |
1,335,155 | private ControlNack createControlNackMessage(int priority, Reliability reliability, SIBUuid12 stream) throws SIResourceException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "createControlNackMessage");<NEW_LINE>ControlNack nackMsg;<NEW_LINE>// Create new AckMessage and send it<NEW_LINE>try {<NEW_LINE>nackMsg = _cmf.createNewControlNack();<NEW_LINE>} catch (MessageCreateFailedException e) {<NEW_LINE>// FFDC<NEW_LINE>FFDCFilter.processException(<MASK><NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {<NEW_LINE>SibTr.exception(tc, e);<NEW_LINE>SibTr.exit(tc, "createControlNackMessage", e);<NEW_LINE>}<NEW_LINE>SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PubSubOutputHandler", "1:1216:1.164.1.5", e });<NEW_LINE>throw new SIResourceException(nls.getFormattedMessage("INTERNAL_MESSAGING_ERROR_CWSIP0002", new Object[] { "com.ibm.ws.sib.processor.impl.PubSubOutputHandler", "1:1224:1.164.1.5", e }, null), e);<NEW_LINE>}<NEW_LINE>// As we are using the Guaranteed Header - set all the attributes as<NEW_LINE>// well as the ones we want.<NEW_LINE>SIMPUtils.setGuaranteedDeliveryProperties(nackMsg, _messageProcessor.getMessagingEngineUuid(), null, stream, null, _destinationHandler.getUuid(), ProtocolType.PUBSUBINPUT, GDConfig.PROTOCOL_VERSION);<NEW_LINE>nackMsg.setPriority(priority);<NEW_LINE>nackMsg.setReliability(reliability);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "createControlNackMessage");<NEW_LINE>return nackMsg;<NEW_LINE>} | e, "com.ibm.ws.sib.processor.impl.PubSubOutputHandler.createControlNackMessage", "1:1204:1.164.1.5", this); |
183,984 | public JettyServletWebServerFactory jettyServletWebServerFactory(@Value("${server.port:8080}") final String port, @Value("${jetty.threadPool.maxThreads:200}") final String maxThreads, @Value("${jetty.threadPool.minThreads:8}") final String minThreads, @Value("${jetty.threadPool.idleTimeout:60000}") final String idleTimeout) {<NEW_LINE>final JettyServletWebServerFactory factory = new JettyServletWebServerFactory(Integer.valueOf(port));<NEW_LINE>factory.addServerCustomizers((JettyServerCustomizer) server -> {<NEW_LINE>final QueuedThreadPool threadPool = server.getBean(QueuedThreadPool.class);<NEW_LINE>threadPool.setMaxThreads(Integer.valueOf(maxThreads));<NEW_LINE>threadPool.setMinThreads(Integer.valueOf(minThreads));<NEW_LINE>threadPool.setIdleTimeout(Integer.valueOf(idleTimeout));<NEW_LINE>final GzipHandler gzipHandler = new GzipHandler();<NEW_LINE>gzipHandler.addIncludedMethods(<MASK><NEW_LINE>gzipHandler.setHandler(server.getHandler());<NEW_LINE>gzipHandler.setSyncFlush(true);<NEW_LINE>server.setHandler(gzipHandler);<NEW_LINE>});<NEW_LINE>return factory;<NEW_LINE>} | HttpMethod.POST.asString()); |
1,246,069 | public ApiResponse<ModelApiResponse> uploadFileWithHttpInfo(Long petId, String additionalMetadata, File _file) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'petId' is set<NEW_LINE>if (petId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/pet/{petId}/uploadImage".replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>if (additionalMetadata != null)<NEW_LINE>localVarFormParams.put("additionalMetadata", additionalMetadata);<NEW_LINE>if (_file != null)<NEW_LINE>localVarFormParams.put("file", _file);<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "multipart/form-data" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "petstore_auth" };<NEW_LINE>GenericType<ModelApiResponse> localVarReturnType = new GenericType<ModelApiResponse>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI("PetApi.uploadFile", localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, <MASK><NEW_LINE>} | localVarContentType, localVarAuthNames, localVarReturnType, false); |
1,835,500 | public Connection run() throws Exception {<NEW_LINE>boolean buildConnection = cri.ivShardingKey != null || cri.ivSuperShardingKey != null;<NEW_LINE>if (!buildConnection && dataSourceOrDriver instanceof XADataSource) {<NEW_LINE>// TODO this code path is very suspect, and so we are not continuing it for connection builder path.<NEW_LINE>// Why convert what was requested to be a DataSource to XADataSource?<NEW_LINE>// And then it also leaks the XAConnection. It is not tracked, so it never gets closed!<NEW_LINE>return user == null ? ((XADataSource) dataSourceOrDriver).getXAConnection().getConnection() : ((XADataSource) dataSourceOrDriver).getXAConnection(<MASK><NEW_LINE>} else {<NEW_LINE>if (buildConnection) {<NEW_LINE>return jdbcRuntime.buildConnection((DataSource) dataSourceOrDriver, user, pwd, cri);<NEW_LINE>} else if (user == null) {<NEW_LINE>return helper.getConnectionFromDatasource((DataSource) dataSourceOrDriver, useKerb, gssCredential);<NEW_LINE>} else {<NEW_LINE>return ((DataSource) dataSourceOrDriver).getConnection(user, pwd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | user, pwd).getConnection(); |
1,160,426 | public static byte[] compress(byte[] content, int modificationCount) throws IOException {<NEW_LINE>byte[] compressedData = null;<NEW_LINE>switch(ourVersion) {<NEW_LINE>// case V1_SNAPPY: {<NEW_LINE>// UnsyncByteArrayOutputStream compressStream = new UnsyncByteArrayOutputStream(content.length);<NEW_LINE>// try (SnappyOutputStream snappyOutputStream = new SnappyOutputStream(compressStream)) {<NEW_LINE>// snappyOutputStream.write(content);<NEW_LINE>// }<NEW_LINE>// compressedData = compressStream.toByteArray();<NEW_LINE>// break;<NEW_LINE>// }<NEW_LINE>case V2_LZ4J:<NEW_LINE>{<NEW_LINE>UnsyncByteArrayOutputStream compressStream = new UnsyncByteArrayOutputStream(content.length);<NEW_LINE>try (LZ4BlockOutputStream lz4BlockOutputStream = new LZ4BlockOutputStream(compressStream)) {<NEW_LINE>lz4BlockOutputStream.write(content);<NEW_LINE>}<NEW_LINE>compressedData = compressStream.toByteArray();<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new UnsupportedOperationException("Unknown version " + ourVersion);<NEW_LINE>}<NEW_LINE>UnsyncByteArrayOutputStream outStream = new UnsyncByteArrayOutputStream(compressedData.length + 3);<NEW_LINE>try (DataOutputStream outputStream = new DataOutputStream(outStream)) {<NEW_LINE>outputStream.write(ourVersion);<NEW_LINE>outputStream.writeInt(modificationCount);<NEW_LINE><MASK><NEW_LINE>outputStream.write(compressedData);<NEW_LINE>}<NEW_LINE>return outStream.toByteArray();<NEW_LINE>} | outputStream.writeShort(compressedData.length); |
769,246 | private void validate(APIGetPortForwardingAttachableVmNicsMsg msg) {<NEW_LINE>SimpleQuery<PortForwardingRuleVO> q = dbf.createQuery(PortForwardingRuleVO.class);<NEW_LINE>q.select(PortForwardingRuleVO_.state, PortForwardingRuleVO_.vmNicUuid);<NEW_LINE>q.add(PortForwardingRuleVO_.uuid, Op.<MASK><NEW_LINE>Tuple t = q.findTuple();<NEW_LINE>PortForwardingRuleState state = t.get(0, PortForwardingRuleState.class);<NEW_LINE>if (state != PortForwardingRuleState.Enabled) {<NEW_LINE>throw new ApiMessageInterceptionException(operr("Port forwarding rule[uuid:%s] is not in state of Enabled, current state is %s", msg.getRuleUuid(), state));<NEW_LINE>}<NEW_LINE>String vmNicUuid = t.get(1, String.class);<NEW_LINE>if (vmNicUuid != null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} | EQ, msg.getRuleUuid()); |
556,695 | protected byte[] serializeRecords(List<IndexedRecord> records) throws IOException {<NEW_LINE>HFileContext context = new HFileContextBuilder().withBlockSize(DEFAULT_BLOCK_SIZE).withCompression(compressionAlgorithm.get()).withCellComparator(new HoodieHBaseKVComparator()).build();<NEW_LINE>Configuration conf = new Configuration();<NEW_LINE>CacheConfig cacheConfig = new CacheConfig(conf);<NEW_LINE>ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>FSDataOutputStream ostream = new FSDataOutputStream(baos, null);<NEW_LINE>// Use simple incrementing counter as a key<NEW_LINE>boolean useIntegerKey = !getRecordKey(records.get(0)).isPresent();<NEW_LINE>// This is set here to avoid re-computing this in the loop<NEW_LINE>int keyWidth = useIntegerKey ? (int) Math.ceil(Math.log(records.size())) + 1 : -1;<NEW_LINE>// Serialize records into bytes<NEW_LINE>Map<String, byte[]> sortedRecordsMap = new TreeMap<>();<NEW_LINE>Iterator<IndexedRecord> itr = records.iterator();<NEW_LINE>int id = 0;<NEW_LINE>while (itr.hasNext()) {<NEW_LINE><MASK><NEW_LINE>String recordKey;<NEW_LINE>if (useIntegerKey) {<NEW_LINE>recordKey = String.format("%" + keyWidth + "s", id++);<NEW_LINE>} else {<NEW_LINE>recordKey = getRecordKey(record).get();<NEW_LINE>}<NEW_LINE>final byte[] recordBytes = serializeRecord(record);<NEW_LINE>ValidationUtils.checkState(!sortedRecordsMap.containsKey(recordKey), "Writing multiple records with same key not supported for " + this.getClass().getName());<NEW_LINE>sortedRecordsMap.put(recordKey, recordBytes);<NEW_LINE>}<NEW_LINE>HFile.Writer writer = HFile.getWriterFactory(conf, cacheConfig).withOutputStream(ostream).withFileContext(context).create();<NEW_LINE>// Write the records<NEW_LINE>sortedRecordsMap.forEach((recordKey, recordBytes) -> {<NEW_LINE>try {<NEW_LINE>KeyValue kv = new KeyValue(recordKey.getBytes(), null, null, recordBytes);<NEW_LINE>writer.append(kv);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new HoodieIOException("IOException serializing records", e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>writer.appendFileInfo(HoodieHFileReader.SCHEMA_KEY.getBytes(), getSchema().toString().getBytes());<NEW_LINE>writer.close();<NEW_LINE>ostream.flush();<NEW_LINE>ostream.close();<NEW_LINE>return baos.toByteArray();<NEW_LINE>} | IndexedRecord record = itr.next(); |
1,241,633 | private SpawnResult runSpawn(Spawn originalSpawn, SandboxedSpawn sandbox, SpawnExecutionContext context) throws IOException, ForbiddenActionInputException, InterruptedException {<NEW_LINE>try {<NEW_LINE>try (SilentCloseable c = Profiler.instance().profile("sandbox.createFileSystem")) {<NEW_LINE>sandbox.createFileSystem();<NEW_LINE>}<NEW_LINE>FileOutErr outErr = context.getFileOutErr();<NEW_LINE>try (SilentCloseable c = Profiler.instance().profile("context.prefetchInputs")) {<NEW_LINE>context.prefetchInputsAndWait();<NEW_LINE>}<NEW_LINE>SpawnResult result;<NEW_LINE>try (SilentCloseable c = Profiler.instance().profile("subprocess.run")) {<NEW_LINE>result = run(originalSpawn, sandbox, <MASK><NEW_LINE>}<NEW_LINE>try (SilentCloseable c = Profiler.instance().profile("sandbox.verifyPostCondition")) {<NEW_LINE>verifyPostCondition(originalSpawn, sandbox, context);<NEW_LINE>}<NEW_LINE>context.lockOutputFiles(result.exitCode(), result.failureDetail() != null ? result.failureDetail().getMessage() : "", outErr);<NEW_LINE>try (SilentCloseable c = Profiler.instance().profile("sandbox.copyOutputs")) {<NEW_LINE>// We copy the outputs even when the command failed.<NEW_LINE>sandbox.copyOutputs(execRoot);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new IOException("Could not move output artifacts from sandboxed execution", e);<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} finally {<NEW_LINE>if (!sandboxOptions.sandboxDebug) {<NEW_LINE>try (SilentCloseable c = Profiler.instance().profile("sandbox.delete")) {<NEW_LINE>sandbox.delete();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | context.getTimeout(), outErr); |
1,438,794 | public static ListTagResourcesResponse unmarshall(ListTagResourcesResponse listTagResourcesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listTagResourcesResponse.setRequestId(_ctx.stringValue("ListTagResourcesResponse.RequestId"));<NEW_LINE>listTagResourcesResponse.setNextToken(_ctx.stringValue("ListTagResourcesResponse.NextToken"));<NEW_LINE>List<TagResourcesItem> tagResources <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListTagResourcesResponse.TagResources.Length"); i++) {<NEW_LINE>TagResourcesItem tagResourcesItem = new TagResourcesItem();<NEW_LINE>tagResourcesItem.setTagKey(_ctx.stringValue("ListTagResourcesResponse.TagResources[" + i + "].TagKey"));<NEW_LINE>tagResourcesItem.setTagValue(_ctx.stringValue("ListTagResourcesResponse.TagResources[" + i + "].TagValue"));<NEW_LINE>tagResourcesItem.setResourceType(_ctx.stringValue("ListTagResourcesResponse.TagResources[" + i + "].ResourceType"));<NEW_LINE>tagResourcesItem.setResourceId(_ctx.stringValue("ListTagResourcesResponse.TagResources[" + i + "].ResourceId"));<NEW_LINE>tagResources.add(tagResourcesItem);<NEW_LINE>}<NEW_LINE>listTagResourcesResponse.setTagResources(tagResources);<NEW_LINE>return listTagResourcesResponse;<NEW_LINE>} | = new ArrayList<TagResourcesItem>(); |
631,376 | private Row[] generateRows(List<Object[]> batchCache, int size) {<NEW_LINE>Row[] rows = new Row[size];<NEW_LINE>Map<String, Object[]> inNameToObjs = new HashMap<>(inRowFieldNames.length);<NEW_LINE>for (int i = 0; i < inRowFieldNames.length; i++) {<NEW_LINE>inNameToObjs.put(inRowFieldNames[i], extractCols(batchCache, i, size));<NEW_LINE>}<NEW_LINE>List<Tensor<?>> toClose = new ArrayList<>(inputTensorNameSet.<MASK><NEW_LINE>try {<NEW_LINE>final Session.Runner runner = model.session().runner();<NEW_LINE>for (int i = 0; i < inRowFieldNames.length; i++) {<NEW_LINE>if (inputTensorNameSet.contains(inRowFieldNames[i])) {<NEW_LINE>// this field is an input tensor<NEW_LINE>TensorInfo inputInfo = modelSig.getInputsMap().get(inRowFieldNames[i]);<NEW_LINE>Tensor<?> tensor = TFTensorConversion.toTensor(inNameToObjs.get(inRowFieldNames[i]), inputInfo);<NEW_LINE>toClose.add(tensor);<NEW_LINE>runner.feed(inputInfo.getName(), tensor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String outputTensorName : outputTensorNames) {<NEW_LINE>TensorInfo outputInfo = modelSig.getOutputsMap().get(outputTensorName);<NEW_LINE>runner.fetch(outputInfo.getName());<NEW_LINE>}<NEW_LINE>List<Tensor<?>> outTensors = runner.run();<NEW_LINE>toClose.addAll(outTensors);<NEW_LINE>Map<String, Tensor<?>> outNameToTensor = new HashMap<>();<NEW_LINE>for (int i = 0; i < outputTensorNames.length; i++) {<NEW_LINE>outNameToTensor.put(outputTensorNames[i], outTensors.get(i));<NEW_LINE>}<NEW_LINE>for (int i = 0; i < outputFieldNames.length; i++) {<NEW_LINE>Object[] cols;<NEW_LINE>if (outNameToTensor.containsKey(outputFieldNames[i])) {<NEW_LINE>cols = TFTensorConversion.fromTensor(outNameToTensor.get(outputFieldNames[i]));<NEW_LINE>} else {<NEW_LINE>cols = inNameToObjs.get(outputFieldNames[i]);<NEW_LINE>}<NEW_LINE>for (int j = 0; j < rows.length; j++) {<NEW_LINE>if (rows[j] == null) {<NEW_LINE>rows[j] = new Row(outputFieldNames.length);<NEW_LINE>}<NEW_LINE>rows[j].setField(i, cols[j]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>for (Tensor<?> tensor : toClose) {<NEW_LINE>tensor.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return rows;<NEW_LINE>} | size() + outputTensorNames.length); |
1,275,782 | private List<Attribute> processAssertion(Assertion assertion, boolean requireSignature, Collection<String> allowedSamlRequestIds) {<NEW_LINE>if (logger.isTraceEnabled()) {<NEW_LINE>logger.trace("(Possibly decrypted) Assertion: {}", SamlUtils.getXmlContent(assertion, true));<NEW_LINE>logger.trace<MASK><NEW_LINE>}<NEW_LINE>// Do not further process unsigned Assertions<NEW_LINE>if (assertion.isSigned()) {<NEW_LINE>validateSignature(assertion.getSignature());<NEW_LINE>} else if (requireSignature) {<NEW_LINE>throw samlException("Assertion [{}] is not signed, but a signature is required", assertion.getElementQName());<NEW_LINE>}<NEW_LINE>checkConditions(assertion.getConditions());<NEW_LINE>checkIssuer(assertion.getIssuer(), assertion);<NEW_LINE>checkSubject(assertion.getSubject(), assertion, allowedSamlRequestIds);<NEW_LINE>checkAuthnStatement(assertion.getAuthnStatements());<NEW_LINE>List<Attribute> attributes = new ArrayList<>();<NEW_LINE>for (AttributeStatement statement : assertion.getAttributeStatements()) {<NEW_LINE>logger.trace("SAML AttributeStatement has [{}] attributes and [{}] encrypted attributes", statement.getAttributes().size(), statement.getEncryptedAttributes().size());<NEW_LINE>attributes.addAll(statement.getAttributes());<NEW_LINE>for (EncryptedAttribute enc : statement.getEncryptedAttributes()) {<NEW_LINE>final Attribute attribute = decrypt(enc);<NEW_LINE>if (attribute != null) {<NEW_LINE>logger.trace("Successfully decrypted attribute: {}" + SamlUtils.getXmlContent(attribute, true));<NEW_LINE>attributes.add(attribute);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>warnOnSpecialAttributeNames(assertion, attributes);<NEW_LINE>return attributes;<NEW_LINE>} | (SamlUtils.describeSamlObject(assertion)); |
643,245 | public static Writable convert(final Object columnValue, final int columnType) {<NEW_LINE>if (columnValue == null)<NEW_LINE>return new NullWritable();<NEW_LINE>switch(columnType) {<NEW_LINE>case Types.BOOLEAN:<NEW_LINE>return new BooleanWritable((boolean) columnValue);<NEW_LINE>case Types.DATE:<NEW_LINE>case Types.TIME:<NEW_LINE>case Types.TIMESTAMP:<NEW_LINE>case Types.CHAR:<NEW_LINE>case Types.LONGVARCHAR:<NEW_LINE>case Types.LONGNVARCHAR:<NEW_LINE>case Types.NCHAR:<NEW_LINE>case Types.NVARCHAR:<NEW_LINE>case Types.VARCHAR:<NEW_LINE>return new Text(columnValue.toString());<NEW_LINE>case Types.FLOAT:<NEW_LINE>return new FloatWritable((float) columnValue);<NEW_LINE>case Types.REAL:<NEW_LINE>return columnValue instanceof Float ? new FloatWritable((float) columnValue) : new DoubleWritable((double) columnValue);<NEW_LINE>case Types.DECIMAL:<NEW_LINE>case Types.NUMERIC:<NEW_LINE>// !\ This may overflow<NEW_LINE>return new DoubleWritable(((BigDecimal) columnValue).doubleValue());<NEW_LINE>case Types.DOUBLE:<NEW_LINE>return new DoubleWritable((double) columnValue);<NEW_LINE>case Types.INTEGER:<NEW_LINE>case Types.SMALLINT:<NEW_LINE>case Types.TINYINT:<NEW_LINE>return <MASK><NEW_LINE>case Types.BIT:<NEW_LINE>return new BooleanWritable((boolean) columnValue);<NEW_LINE>case Types.BIGINT:<NEW_LINE>return new LongWritable((long) columnValue);<NEW_LINE>default:<NEW_LINE>throw new IllegalArgumentException("Column type unknown");<NEW_LINE>}<NEW_LINE>} | new IntWritable((int) columnValue); |
1,815,817 | public double g(double[] w, double[] g) {<NEW_LINE>double f = IntStream.range(0, partitions).parallel().mapToDouble(r -> {<NEW_LINE>double[] gradient = gradients[r];<NEW_LINE>Arrays.fill(gradient, 0.0);<NEW_LINE>int begin = r * partitionSize;<NEW_LINE>int end = (r + 1) * partitionSize;<NEW_LINE>if (end > x.size())<NEW_LINE>end = x.size();<NEW_LINE>return IntStream.range(begin, end).sequential().mapToDouble(i -> {<NEW_LINE>SparseArray xi = x.get(i);<NEW_LINE>double wx = dot(xi, w);<NEW_LINE>double err = y[i] - MathEx.sigmoid(wx);<NEW_LINE>for (SparseArray.Entry e : xi) {<NEW_LINE>gradient[e.i] -= err * e.x;<NEW_LINE>}<NEW_LINE>gradient[p] -= err;<NEW_LINE>return MathEx.log1pe(wx) - y[i] * wx;<NEW_LINE>}).sum();<NEW_LINE>}).sum();<NEW_LINE>Arrays.fill(g, 0.0);<NEW_LINE>for (double[] gradient : gradients) {<NEW_LINE>for (int i = 0; i < g.length; i++) {<NEW_LINE>g<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (lambda > 0.0) {<NEW_LINE>double wnorm = 0.0;<NEW_LINE>for (int i = 0; i < p; i++) {<NEW_LINE>wnorm += w[i] * w[i];<NEW_LINE>g[i] += lambda * w[i];<NEW_LINE>}<NEW_LINE>f += 0.5 * lambda * wnorm;<NEW_LINE>}<NEW_LINE>return f;<NEW_LINE>} | [i] += gradient[i]; |
1,434,465 | private void preserveExistingLineBreaks() {<NEW_LINE>// normally n empty lines = n+1 line breaks, but not at the file start and end<NEW_LINE>Token first = this.tm.get(0);<NEW_LINE>int startingBreaks = first.getLineBreaksBefore();<NEW_LINE>first.clearLineBreaksBefore();<NEW_LINE>first.putLineBreaksBefore(startingBreaks - 1);<NEW_LINE>this.tm.traverse(0, new TokenTraverser() {<NEW_LINE><NEW_LINE>boolean join_wrapped_lines = WrapPreparator.this.options.join_wrapped_lines;<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected boolean token(Token token, int index) {<NEW_LINE>int lineBreaks = getLineBreaksToPreserve(getPrevious(), token);<NEW_LINE>if (lineBreaks > 1 || (!this.join_wrapped_lines && token.isWrappable()) || index == 0)<NEW_LINE>token.putLineBreaksBefore(lineBreaks);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Token last = this.tm.get(this.tm.size() - 1);<NEW_LINE>last.clearLineBreaksAfter();<NEW_LINE>int <MASK><NEW_LINE>if (endingBreaks > 0) {<NEW_LINE>last.putLineBreaksAfter(endingBreaks);<NEW_LINE>} else if ((this.kind & (CodeFormatter.K_COMPILATION_UNIT | CodeFormatter.K_MODULE_INFO)) != 0 && this.options.insert_new_line_at_end_of_file_if_missing) {<NEW_LINE>last.breakAfter();<NEW_LINE>}<NEW_LINE>} | endingBreaks = getLineBreaksToPreserve(last, null); |
1,805,008 | void emailSpec11Reports(LocalDate date, SoyTemplateInfo soyTemplateInfo, String subject, ImmutableSet<RegistrarThreatMatches> registrarThreatMatchesSet) {<NEW_LINE>ImmutableMap.Builder<RegistrarThreatMatches, Throwable> failedMatchesBuilder = ImmutableMap.builder();<NEW_LINE>for (RegistrarThreatMatches registrarThreatMatches : registrarThreatMatchesSet) {<NEW_LINE>RegistrarThreatMatches filteredMatches = filterOutNonPublishedMatches(registrarThreatMatches);<NEW_LINE>if (!filteredMatches.threatMatches().isEmpty()) {<NEW_LINE>try {<NEW_LINE>// Handle exceptions individually per registrar so that one failed email doesn't prevent<NEW_LINE>// the rest from being sent.<NEW_LINE>emailRegistrar(date, soyTemplateInfo, subject, filteredMatches);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>failedMatchesBuilder.put(registrarThreatMatches, getRootCause(e));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ImmutableMap<RegistrarThreatMatches, Throwable<MASK><NEW_LINE>if (!failedMatches.isEmpty()) {<NEW_LINE>ImmutableList<Map.Entry<RegistrarThreatMatches, Throwable>> failedMatchesList = failedMatches.entrySet().asList();<NEW_LINE>// Send an alert email and throw a RuntimeException with the first failure as the cause,<NEW_LINE>// but log the rest so that we have that information.<NEW_LINE>Throwable firstThrowable = failedMatchesList.get(0).getValue();<NEW_LINE>sendAlertEmail(String.format("Spec11 Emailing Failure %s", date), String.format("Emailing Spec11 reports failed due to %s", firstThrowable.getMessage()));<NEW_LINE>for (int i = 1; i < failedMatches.size(); i++) {<NEW_LINE>logger.atSevere().withCause(failedMatchesList.get(i).getValue()).log("Additional exception thrown when sending email to registrar %s, in addition to the" + " re-thrown exception.", failedMatchesList.get(i).getKey().clientId());<NEW_LINE>}<NEW_LINE>throw new RuntimeException("Emailing Spec11 reports failed, first exception:", firstThrowable);<NEW_LINE>}<NEW_LINE>sendAlertEmail(String.format("Spec11 Pipeline Success %s", date), "Spec11 reporting completed successfully.");<NEW_LINE>} | > failedMatches = failedMatchesBuilder.build(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.