idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,106,293 | public static Collection<ErrorDescription> run(final HintContext hintContext) {<NEW_LINE>final List<ErrorDescription> problems = new ArrayList<>();<NEW_LINE>final EJBProblemContext ctx = HintsUtils.getOrCacheContext(hintContext);<NEW_LINE>if (ctx != null && ctx.getEjb() instanceof Session) {<NEW_LINE>TypeMirror parentType = ctx<MASK><NEW_LINE>final String parentClassName = JavaUtils.extractClassNameFromType(parentType);<NEW_LINE>if (parentClassName != null) {<NEW_LINE>try {<NEW_LINE>ctx.getEjbModule().getMetadataModel().runReadAction(new MetadataModelAction<EjbJarMetadata, Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void run(EjbJarMetadata metadata) throws Exception {<NEW_LINE>Ejb parentEJB = metadata.findByEjbClass(parentClassName);<NEW_LINE>if (parentEJB instanceof Session) {<NEW_LINE>ErrorDescription err = HintsUtils.createProblem(ctx.getClazz(), hintContext.getInfo(), Bundle.SBSuperClassNotSB_err());<NEW_LINE>problems.add(err);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (MetadataModelException ex) {<NEW_LINE>LOG.log(Level.WARNING, ex.getMessage(), ex);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>LOG.log(Level.WARNING, ex.getMessage(), ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return problems;<NEW_LINE>} | .getClazz().getSuperclass(); |
26,428 | private Section buildRealmProperties(OsAccountRealm realm) {<NEW_LINE>Section section = new Section(Bundle.OsAccountDataPanel_realm_title());<NEW_LINE>SectionData data = new SectionData();<NEW_LINE>String realmName = realm.getRealmNames().isEmpty() ? Bundle.OsAccountDataPanel_realm_unknown() : realm.getRealmNames().get(0);<NEW_LINE>data.addData(Bundle.OsAccountDataPanel_realm_name(), realmName);<NEW_LINE>Optional<String<MASK><NEW_LINE>data.addData(Bundle.OsAccountDataPanel_realm_address(), optional.isPresent() ? optional.get() : "");<NEW_LINE>data.addData(Bundle.OsAccountDataPanel_realm_scope(), realm.getScope().getName());<NEW_LINE>data.addData(Bundle.OsAccountDataPanel_realm_confidence(), realm.getScopeConfidence().getName());<NEW_LINE>section.addSectionData(data);<NEW_LINE>return section;<NEW_LINE>} | > optional = realm.getRealmAddr(); |
1,586,681 | public okhttp3.Call readNamespaceCall(String name, String pretty, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/api/v1/namespaces/{name}".replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString()));<NEW_LINE>List<Pair> localVarQueryParams <MASK><NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>if (pretty != null) {<NEW_LINE>localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty));<NEW_LINE>}<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "BearerToken" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>} | = new ArrayList<Pair>(); |
35,941 | private Mono<Response<Flux<ByteBuffer>>> stopWithResponseAsync(String resourceGroupName, String workspaceName, String integrationRuntimeName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (workspaceName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (integrationRuntimeName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter integrationRuntimeName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>final String apiVersion = "2021-06-01-preview";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.stop(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, <MASK><NEW_LINE>} | workspaceName, integrationRuntimeName, accept, context); |
375,811 | public void start(Stage primaryStage) throws Exception {<NEW_LINE>try {<NEW_LINE>// FXMLLoader loader = new FXMLLoader(getClass().getResource("/MainWindow.fxml"));<NEW_LINE>// loader.setControllerFactory(this::getController);<NEW_LINE>StackPane root = new MainWindowFxml(this);<NEW_LINE>FxmlUtil.setPrimaryStage(primaryStage);<NEW_LINE>mainScene = new Scene(root);<NEW_LINE>hotkeys.registerGlobalHotkeys(mainScene);<NEW_LINE>primaryStage.setScene(mainScene);<NEW_LINE>Rectangle2D bounds = Screen.getPrimary().getVisualBounds();<NEW_LINE>primaryStage.setWidth(Math.min(1000, bounds.getWidth()));<NEW_LINE>primaryStage.setHeight(Math.min(800<MASK><NEW_LINE>setIcon(primaryStage);<NEW_LINE>// org.fxmisc.cssfx.CSSFX.start(primaryStage);<NEW_LINE>primaryStage.show();<NEW_LINE>primaryStage.setTitle("Milkman");<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | , bounds.getHeight())); |
678,734 | public int countForTargetType(String assetGroup, String parentType, Map<String, String> termsFilter, String applicationFilter, String environmentFilter, int from, int size) throws Exception {<NEW_LINE>int count = 0;<NEW_LINE>String targetType = "vulninfo";<NEW_LINE>Map<String, Object> mustFilterMap = new LinkedHashMap<>();<NEW_LINE>mustFilterMap.put("latest", "true");<NEW_LINE>Map<String, Object> parentBool = new HashMap<>();<NEW_LINE>List<Map<String, Object>> mustList = new ArrayList<>();<NEW_LINE>Map<String, Object> matchMap = new HashMap<>();<NEW_LINE>Map<String, String> match = new HashMap<>();<NEW_LINE>Map<String, Object> mustTermsFilter = new HashMap<>();<NEW_LINE>for (Map.Entry<String, String> entry : termsFilter.entrySet()) {<NEW_LINE>List<String> severities = Arrays.asList(entry.getValue().split(","));<NEW_LINE>mustTermsFilter.put(entry.getKey(), severities);<NEW_LINE>}<NEW_LINE>match.put(Constants.LATEST, Constants.TRUE);<NEW_LINE>matchMap.put(Constants.MATCH, match);<NEW_LINE>mustList.add(matchMap);<NEW_LINE>if (applicationFilter != null) {<NEW_LINE>Map<String, String> applicationFilterMap = new HashMap<String, String>();<NEW_LINE>Map<String, Object> applicationFilterMap1 = new HashMap<String, Object>();<NEW_LINE>applicationFilterMap.put("tags.Application.keyword", applicationFilter);<NEW_LINE>applicationFilterMap1.put("match", applicationFilterMap);<NEW_LINE>mustList.add(applicationFilterMap1);<NEW_LINE>}<NEW_LINE>if (environmentFilter != null) {<NEW_LINE>Map<String, String> environmentFilterMap = new HashMap<String, String>();<NEW_LINE>Map<String, Object> environmentFilterMap1 = new HashMap<String, Object>();<NEW_LINE>environmentFilterMap.put("tags.Environment.keyword", environmentFilter);<NEW_LINE>environmentFilterMap1.put("match", environmentFilterMap);<NEW_LINE>mustList.add(environmentFilterMap1);<NEW_LINE>}<NEW_LINE>parentBool.put("must", mustList);<NEW_LINE>Map<String, Object> queryMap = new HashMap<>();<NEW_LINE>queryMap.put("bool", parentBool);<NEW_LINE>Map<String, Object> parentEntryMap = new LinkedHashMap<>();<NEW_LINE><MASK><NEW_LINE>parentEntryMap.put("query", queryMap);<NEW_LINE>mustFilterMap.put("has_parent", parentEntryMap);<NEW_LINE>count = vulnerabilityRepository.vulnerabilityAssetsCount(assetGroup, targetType, mustFilterMap, from, size, mustTermsFilter);<NEW_LINE>logger.info("vulnerability asset count {} " + count);<NEW_LINE>return count;<NEW_LINE>} | parentEntryMap.put("parent_type", parentType); |
775,575 | public void run(RegressionEnvironment env) {<NEW_LINE>tryString(env, "theString in ('a', 'b', 'c')", new String[] { "0", "a", "b", "c", "d", null }, new Boolean[] { false, true, true, true, false, null });<NEW_LINE>tryString(env, "theString in ('a')", new String[] { "0", "a", "b", "c", "d", null }, new Boolean[] { false, true, false, false, false, null });<NEW_LINE>tryString(env, "theString in ('a', 'b')", new String[] { "0", "b", "a", "c", "d", null }, new Boolean[] { false, true, true, false, false, null });<NEW_LINE>tryString(env, "theString in ('a', null)", new String[] { "0", "b", "a", "c", "d", null }, new Boolean[] { null, null, true, null, null, null });<NEW_LINE>tryString(env, "theString in (null)", new String[] { "0", null, "b" }, new Boolean[] <MASK><NEW_LINE>tryString(env, "theString not in ('a', 'b', 'c')", new String[] { "0", "a", "b", "c", "d", null }, new Boolean[] { true, false, false, false, true, null });<NEW_LINE>tryString(env, "theString not in (null)", new String[] { "0", null, "b" }, new Boolean[] { null, null, null });<NEW_LINE>} | { null, null, null }); |
817,608 | private List<String> createPointer(String pointer) {<NEW_LINE>if (pointer.charAt(0) == '#') {<NEW_LINE>try {<NEW_LINE>pointer = URLDecoder.decode(pointer, "UTF_8");<NEW_LINE>} catch (UnsupportedEncodingException e) {<NEW_LINE>throw new JSONException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (pointer.isEmpty() || pointer.charAt(0) != '/') {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>String[] parts = pointer.substring(1).split("/");<NEW_LINE>ArrayList<String> res = new ArrayList<>(parts.length);<NEW_LINE>for (int i = 0, l = parts.length; i < l; ++i) {<NEW_LINE>while (parts[i].contains("~1")) {<NEW_LINE>parts[i] = parts[i].replace("~1", "/");<NEW_LINE>}<NEW_LINE>while (parts[i].contains("~0")) {<NEW_LINE>parts[i] = parts[i].replace("~0", "~");<NEW_LINE>}<NEW_LINE>res.add(parts[i]);<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>} | throw new JSONException("Invalid JSON pointer: " + pointer); |
86,832 | public void init(Analyzer analyzer) throws UserException {<NEW_LINE>super.init(analyzer);<NEW_LINE>this.analyzer = analyzer;<NEW_LINE>if (desc.getTable() != null) {<NEW_LINE>BrokerTable brokerTable = <MASK><NEW_LINE>try {<NEW_LINE>fileGroups = Lists.newArrayList(new BrokerFileGroup(brokerTable));<NEW_LINE>} catch (AnalysisException e) {<NEW_LINE>throw new UserException(e.getMessage());<NEW_LINE>}<NEW_LINE>brokerDesc = new BrokerDesc(brokerTable.getBrokerName(), brokerTable.getBrokerProperties());<NEW_LINE>targetTable = brokerTable;<NEW_LINE>}<NEW_LINE>// Get all broker file status<NEW_LINE>assignBackends();<NEW_LINE>getFileStatusAndCalcInstance();<NEW_LINE>paramCreateContexts = Lists.newArrayList();<NEW_LINE>for (BrokerFileGroup fileGroup : fileGroups) {<NEW_LINE>ParamCreateContext context = new ParamCreateContext();<NEW_LINE>context.fileGroup = fileGroup;<NEW_LINE>context.timezone = analyzer.getTimezone();<NEW_LINE>// csv/json/parquet load is controlled by Config::enable_vectorized_file_load<NEW_LINE>// if Config::enable_vectorized_file_load is set true,<NEW_LINE>// vectorized load will been enabled<NEW_LINE>TFileFormatType format = formatType(context.fileGroup.getFileFormat(), "");<NEW_LINE>initParams(context);<NEW_LINE>paramCreateContexts.add(context);<NEW_LINE>}<NEW_LINE>} | (BrokerTable) desc.getTable(); |
1,793,081 | public com.amazonaws.services.polly.model.InvalidSampleRateException unmarshallFromContext(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>com.amazonaws.services.polly.model.InvalidSampleRateException invalidSampleRateException = new com.amazonaws.services.polly.model.InvalidSampleRateException(null);<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return invalidSampleRateException;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,580,115 | private void loadNode108() {<NEW_LINE>UaMethodNode node = new UaMethodNode(this.context, Identifiers.ServerConfiguration_CertificateGroups_DefaultUserTokenGroup_TrustList_GetPosition, new QualifiedName(0, "GetPosition"), new LocalizedText("en", "GetPosition"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultUserTokenGroup_TrustList_GetPosition, Identifiers.HasProperty, Identifiers.ServerConfiguration_CertificateGroups_DefaultUserTokenGroup_TrustList_GetPosition_InputArguments.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultUserTokenGroup_TrustList_GetPosition, Identifiers.HasProperty, Identifiers.ServerConfiguration_CertificateGroups_DefaultUserTokenGroup_TrustList_GetPosition_OutputArguments.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ServerConfiguration_CertificateGroups_DefaultUserTokenGroup_TrustList_GetPosition, Identifiers.HasComponent, Identifiers.ServerConfiguration_CertificateGroups_DefaultUserTokenGroup_TrustList.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | (0), true, true); |
1,344,170 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.activity_main);<NEW_LINE>// get a reference to the scene view<NEW_LINE>mSceneView = findViewById(R.id.sceneView);<NEW_LINE>// create a scene with an imagery basemap<NEW_LINE>ArcGISScene scene = new ArcGISScene(Basemap.Type.IMAGERY);<NEW_LINE>// add the SceneView to the stack pane<NEW_LINE>mSceneView.setScene(scene);<NEW_LINE>// add a camera and initial camera position<NEW_LINE>Point point = new Point(83.9, 28.4, 1000, SpatialReferences.getWgs84());<NEW_LINE>Camera camera = new Camera(point, 1000, 0, 50, 0);<NEW_LINE>mSceneView.setViewpointCamera(camera);<NEW_LINE>// create a graphics overlay<NEW_LINE>GraphicsOverlay graphicsOverlay = new GraphicsOverlay();<NEW_LINE>graphicsOverlay.getSceneProperties().setSurfacePlacement(LayerSceneProperties.SurfacePlacement.RELATIVE);<NEW_LINE>mSceneView.<MASK><NEW_LINE>// add renderer using rotation expressions<NEW_LINE>SimpleRenderer renderer = new SimpleRenderer();<NEW_LINE>renderer.getSceneProperties().setHeadingExpression('[' + HEADING_EXPRESSION + ']');<NEW_LINE>renderer.getSceneProperties().setPitchExpression('[' + PITCH_EXPRESSION + ']');<NEW_LINE>graphicsOverlay.setRenderer(renderer);<NEW_LINE>// create a red cone graphic<NEW_LINE>// in this sample we've set the anchor position to center. By default, the anchor position is BOTTOM<NEW_LINE>SimpleMarkerSceneSymbol coneSymbol = SimpleMarkerSceneSymbol.createCone(Color.RED, 100, 100, SceneSymbol.AnchorPosition.CENTER);<NEW_LINE>// correct symbol's default pitch<NEW_LINE>coneSymbol.setPitch(-PITCH_OFFSET);<NEW_LINE>Graphic cone = new Graphic(new Point(83.9, 28.41, 200, SpatialReferences.getWgs84()), coneSymbol);<NEW_LINE>graphicsOverlay.getGraphics().add(cone);<NEW_LINE>// bind attribute based on values in seek bars<NEW_LINE>SeekBar headingSeekBar = findViewById(R.id.headingSeekBar);<NEW_LINE>cone.getAttributes().put(HEADING_EXPRESSION, headingSeekBar.getProgress());<NEW_LINE>headingSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {<NEW_LINE>cone.getAttributes().put(HEADING_EXPRESSION, progress);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStartTrackingTouch(SeekBar seekBar) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStopTrackingTouch(SeekBar seekBar) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>SeekBar pitchSeekBar = findViewById(R.id.pitchSeekBar);<NEW_LINE>cone.getAttributes().put(PITCH_EXPRESSION, pitchSeekBar.getProgress() - PITCH_OFFSET);<NEW_LINE>pitchSeekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {<NEW_LINE>cone.getAttributes().put(PITCH_EXPRESSION, progress - PITCH_OFFSET);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStartTrackingTouch(SeekBar seekBar) {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onStopTrackingTouch(SeekBar seekBar) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | getGraphicsOverlays().add(graphicsOverlay); |
1,040,820 | public AsyncResult<Void> executeTaskAsync(UIAccess uiAccess, DataContext context, RunConfiguration configuration, ExecutionEnvironment env, RunConfigurableBeforeRunTask task) {<NEW_LINE>RunnerAndConfigurationSettings settings = task.getSettings();<NEW_LINE>if (settings == null) {<NEW_LINE>return AsyncResult.rejected();<NEW_LINE>}<NEW_LINE>final <MASK><NEW_LINE>String executorId = executor.getId();<NEW_LINE>final ProgramRunner runner = ProgramRunnerUtil.getRunner(executorId, settings);<NEW_LINE>if (runner == null)<NEW_LINE>return AsyncResult.rejected();<NEW_LINE>final ExecutionEnvironment environment = new ExecutionEnvironment(executor, runner, settings, myProject);<NEW_LINE>environment.setExecutionId(env.getExecutionId());<NEW_LINE>if (!ExecutionTargetManager.canRun(settings, env.getExecutionTarget())) {<NEW_LINE>return AsyncResult.rejected();<NEW_LINE>}<NEW_LINE>if (!runner.canRun(executorId, environment.getRunProfile())) {<NEW_LINE>return AsyncResult.rejected();<NEW_LINE>} else {<NEW_LINE>AsyncResult<Void> result = AsyncResult.undefined();<NEW_LINE>uiAccess.give(() -> {<NEW_LINE>try {<NEW_LINE>runner.execute(environment, descriptor -> {<NEW_LINE>ProcessHandler processHandler = descriptor != null ? descriptor.getProcessHandler() : null;<NEW_LINE>if (processHandler != null) {<NEW_LINE>processHandler.addProcessListener(new ProcessAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void processTerminated(ProcessEvent event) {<NEW_LINE>if (event.getExitCode() == 0) {<NEW_LINE>result.setDone();<NEW_LINE>} else {<NEW_LINE>result.setRejected();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (ExecutionException e) {<NEW_LINE>result.setRejected();<NEW_LINE>LOG.error(e);<NEW_LINE>}<NEW_LINE>}).doWhenRejectedWithThrowable(result::rejectWithThrowable);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | Executor executor = DefaultRunExecutor.getRunExecutorInstance(); |
240,288 | private void loadNode742() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.ProgramStateMachineType_Running_StateNumber, new QualifiedName(0, "StateNumber"), new LocalizedText("en", "StateNumber"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.UInt32, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_Running_StateNumber, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_Running_StateNumber, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_Running_StateNumber, Identifiers.HasProperty, Identifiers.ProgramStateMachineType_Running.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<UInt32 xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\">2</UInt32>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).<MASK><NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | setInput(new StringReader(xml)); |
1,498,233 | public NodeOutputPort unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>NodeOutputPort nodeOutputPort = new NodeOutputPort();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return 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("Description", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>nodeOutputPort.setDescription(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>nodeOutputPort.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Type", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>nodeOutputPort.setType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return nodeOutputPort;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
294,677 | public void doReportStat(SofaTracerSpan sofaTracerSpan) {<NEW_LINE>Map<String, String> tagsWithStr = sofaTracerSpan.getTagsWithStr();<NEW_LINE>StatMapKey statKey = new StatMapKey();<NEW_LINE>statKey.addKey(CommonSpanTags.LOCAL_APP, tagsWithStr.get(CommonSpanTags.LOCAL_APP));<NEW_LINE>statKey.addKey("operationName", sofaTracerSpan.getOperationName());<NEW_LINE>statKey.addKey(CommonSpanTags.MSG_CHANNEL, tagsWithStr.get(CommonSpanTags.MSG_CHANNEL));<NEW_LINE>String resultCode = tagsWithStr.get(CommonSpanTags.RESULT_CODE);<NEW_LINE>boolean success = isWebHttpClientSuccess(resultCode);<NEW_LINE>statKey.setResult(success ? <MASK><NEW_LINE>// pressure mark<NEW_LINE>statKey.setLoadTest(TracerUtils.isLoadTest(sofaTracerSpan));<NEW_LINE>// end<NEW_LINE>statKey.setEnd(TracerUtils.getLoadTestMark(sofaTracerSpan));<NEW_LINE>// value the count and duration<NEW_LINE>long duration = sofaTracerSpan.getEndTime() - sofaTracerSpan.getStartTime();<NEW_LINE>long[] values = new long[] { 1, duration };<NEW_LINE>// reserve<NEW_LINE>this.addStat(statKey, values);<NEW_LINE>} | SofaTracerConstant.STAT_FLAG_SUCCESS : SofaTracerConstant.STAT_FLAG_FAILS); |
842,043 | private Table buildTable(RestRequest req, ClusterStateResponse state, NodesInfoResponse nodesInfo) {<NEW_LINE>DiscoveryNodes nodes = state.getState().nodes();<NEW_LINE>Table table = getTableWithHeader(req);<NEW_LINE>for (DiscoveryNode node : nodes) {<NEW_LINE>NodeInfo info = nodesInfo.getNodesMap().get(node.getId());<NEW_LINE>if (info == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>PluginsAndModules plugins = info.getInfo(PluginsAndModules.class);<NEW_LINE>if (plugins == null) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>for (PluginInfo pluginInfo : plugins.getPluginInfos()) {<NEW_LINE>table.startRow();<NEW_LINE>table.<MASK><NEW_LINE>table.addCell(node.getName());<NEW_LINE>table.addCell(pluginInfo.getName());<NEW_LINE>table.addCell(pluginInfo.getVersion());<NEW_LINE>table.addCell(pluginInfo.getDescription());<NEW_LINE>table.endRow();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return table;<NEW_LINE>} | addCell(node.getId()); |
1,076,935 | private static boolean daemonizeIfPossible() {<NEW_LINE>String osName = System.getProperty("os.name");<NEW_LINE>Libc.OpenPtyLibrary openPtyLibrary;<NEW_LINE>Platform platform = Platform.detect();<NEW_LINE>if (platform == Platform.LINUX) {<NEW_LINE>Libc.Constants.rTIOCSCTTY = Libc.Constants.LINUX_TIOCSCTTY;<NEW_LINE>Libc.Constants.rFDCLOEXEC = Libc.Constants.LINUX_FD_CLOEXEC;<NEW_LINE>Libc.Constants.rFGETFD = Libc.Constants.LINUX_F_GETFD;<NEW_LINE>Libc.Constants.rFSETFD = Libc.Constants.LINUX_F_SETFD;<NEW_LINE>openPtyLibrary = Native.loadLibrary("libutil", Libc.OpenPtyLibrary.class);<NEW_LINE>} else if (platform == Platform.MACOS) {<NEW_LINE>Libc.Constants.rTIOCSCTTY = Libc.Constants.DARWIN_TIOCSCTTY;<NEW_LINE>Libc.Constants<MASK><NEW_LINE>Libc.Constants.rFGETFD = Libc.Constants.DARWIN_F_GETFD;<NEW_LINE>Libc.Constants.rFSETFD = Libc.Constants.DARWIN_F_SETFD;<NEW_LINE>openPtyLibrary = Native.loadLibrary(com.sun.jna.Platform.C_LIBRARY_NAME, Libc.OpenPtyLibrary.class);<NEW_LINE>} else {<NEW_LINE>LOG.info("not enabling process killing on nailgun exit: unknown OS %s", osName);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Making ourselves a session leader with setsid disconnects us from our controlling terminal<NEW_LINE>int ret = Libc.INSTANCE.setsid();<NEW_LINE>if (ret < 0) {<NEW_LINE>LOG.warn("cannot enable background process killing: %s", Native.getLastError());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>LOG.info("enabling background process killing for buckd");<NEW_LINE>IntByReference master = new IntByReference();<NEW_LINE>IntByReference slave = new IntByReference();<NEW_LINE>if (openPtyLibrary.openpty(master, slave, Pointer.NULL, Pointer.NULL, Pointer.NULL) != 0) {<NEW_LINE>throw new RuntimeException("Failed to open pty");<NEW_LINE>}<NEW_LINE>// Deliberately leak the file descriptors for the lifetime of this process; NuProcess can<NEW_LINE>// sometimes leak file descriptors to children, so make sure these FDs are marked close-on-exec.<NEW_LINE>markFdCloseOnExec(master.getValue());<NEW_LINE>markFdCloseOnExec(slave.getValue());<NEW_LINE>// Make the pty our controlling terminal; works because we disconnected above with setsid.<NEW_LINE>if (Libc.INSTANCE.ioctl(slave.getValue(), Pointer.createConstant(Libc.Constants.rTIOCSCTTY), 0) == -1) {<NEW_LINE>throw new RuntimeException("Failed to set pty");<NEW_LINE>}<NEW_LINE>LOG.info("enabled background process killing for buckd");<NEW_LINE>return true;<NEW_LINE>} | .rFDCLOEXEC = Libc.Constants.DARWIN_FD_CLOEXEC; |
757,934 | private void loadNode112() {<NEW_LINE>UaObjectTypeNode node = new UaObjectTypeNode(this.context, Identifiers.OperationLimitsType, new QualifiedName(0, "OperationLimitsType"), new LocalizedText("en", "OperationLimitsType"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), false);<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerRead.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerHistoryReadData.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerHistoryReadEvents.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerWrite.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerHistoryUpdateData.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerHistoryUpdateEvents.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerMethodCall.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerBrowse.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerRegisterNodes.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerTranslateBrowsePathsToNodeIds.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxNodesPerNodeManagement<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasProperty, Identifiers.OperationLimitsType_MaxMonitoredItemsPerCall.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OperationLimitsType, Identifiers.HasSubtype, Identifiers.FolderType.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), true)); |
1,407,693 | public J visitLambda(Lambda lambda, PrintOutputCapture<P> p) {<NEW_LINE>visitSpace(lambda.getPrefix(), Space.Location.LAMBDA_PREFIX, p);<NEW_LINE>visitMarkers(lambda.getMarkers(), p);<NEW_LINE>visitSpace(lambda.getParameters().getPrefix(), <MASK><NEW_LINE>visitMarkers(lambda.getParameters().getMarkers(), p);<NEW_LINE>if (lambda.getParameters().isParenthesized()) {<NEW_LINE>p.append('(');<NEW_LINE>visitRightPadded(lambda.getParameters().getPadding().getParams(), JRightPadded.Location.LAMBDA_PARAM, ",", p);<NEW_LINE>p.append(')');<NEW_LINE>} else {<NEW_LINE>visitRightPadded(lambda.getParameters().getPadding().getParams(), JRightPadded.Location.LAMBDA_PARAM, ",", p);<NEW_LINE>}<NEW_LINE>visitSpace(lambda.getArrow(), Space.Location.LAMBDA_ARROW_PREFIX, p);<NEW_LINE>p.append("->");<NEW_LINE>visit(lambda.getBody(), p);<NEW_LINE>return lambda;<NEW_LINE>} | Space.Location.LAMBDA_PARAMETERS_PREFIX, p); |
988,978 | private void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException {<NEW_LINE>// ensure that filter is only applied once per request<NEW_LINE>if (request.getAttribute(FILTER_APPLIED) != null) {<NEW_LINE>chain.doFilter(request, response);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>request.setAttribute(FILTER_APPLIED, Boolean.TRUE);<NEW_LINE>if (this.forceEagerSessionCreation) {<NEW_LINE>HttpSession session = request.getSession();<NEW_LINE>if (this.logger.isDebugEnabled() && session.isNew()) {<NEW_LINE>this.logger.debug(LogMessage.format("Created session %s eagerly", session.getId()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>HttpRequestResponseHolder holder = new HttpRequestResponseHolder(request, response);<NEW_LINE>SecurityContext contextBeforeChainExecution = this.repo.loadContext(holder);<NEW_LINE>try {<NEW_LINE>SecurityContextHolder.setContext(contextBeforeChainExecution);<NEW_LINE>if (contextBeforeChainExecution.getAuthentication() == null) {<NEW_LINE>logger.debug("Set SecurityContextHolder to empty SecurityContext");<NEW_LINE>} else {<NEW_LINE>if (this.logger.isDebugEnabled()) {<NEW_LINE>this.logger.debug(LogMessage.format("Set SecurityContextHolder to %s", contextBeforeChainExecution));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>chain.doFilter(holder.getRequest(), holder.getResponse());<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>// Crucial removal of SecurityContextHolder contents before anything else.<NEW_LINE>SecurityContextHolder.clearContext();<NEW_LINE>this.repo.saveContext(contextAfterChainExecution, holder.getRequest(), holder.getResponse());<NEW_LINE>request.removeAttribute(FILTER_APPLIED);<NEW_LINE>this.logger.debug("Cleared SecurityContextHolder to complete request");<NEW_LINE>}<NEW_LINE>} | SecurityContext contextAfterChainExecution = SecurityContextHolder.getContext(); |
898,661 | private void init() throws IOException {<NEW_LINE>if (running) {<NEW_LINE>counter = new AtomicLong(getCommitFrequency());<NEW_LINE>Directory directory = getDirectory(application);<NEW_LINE>IndexWriterConfig config = new IndexWriterConfig(analyzer);<NEW_LINE>config.<MASK><NEW_LINE>writer = new IndexWriter(directory, config);<NEW_LINE>long end = System.currentTimeMillis();<NEW_LINE>long start = System.currentTimeMillis() - 24 * 60 * 60 * 1000;<NEW_LINE>maxConcurrent = Long.parseLong(queryMaxRecord(application, DubboKeeperMonitorService.CONCURRENT, SortField.Type.LONG, start, end));<NEW_LINE>maxElapsed = Long.parseLong(queryMaxRecord(application, DubboKeeperMonitorService.ELAPSED, SortField.Type.LONG, start, end));<NEW_LINE>maxFault = Integer.parseInt(queryMaxRecord(application, DubboKeeperMonitorService.FAILURE, SortField.Type.INT, start, end));<NEW_LINE>maxSuccess = Integer.parseInt(queryMaxRecord(application, DubboKeeperMonitorService.SUCCESS, SortField.Type.INT, start, end));<NEW_LINE>}<NEW_LINE>} | setOpenMode(IndexWriterConfig.OpenMode.CREATE_OR_APPEND); |
794,531 | protected Void doInBackground() throws Exception {<NEW_LINE>addPropertyChangeListener(new PropertyChangeListener() {<NEW_LINE><NEW_LINE>public void propertyChange(PropertyChangeEvent evt) {<NEW_LINE>if ("progress".equals(evt.getPropertyName())) {<NEW_LINE>progressBar.setValue((<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>long totalSize = 0;<NEW_LINE>for (File copyable : copyItems) {<NEW_LINE>totalSize += Util.calcSize(copyable);<NEW_LINE>}<NEW_LINE>long progress = 0;<NEW_LINE>setProgress(0);<NEW_LINE>for (File copyable : copyItems) {<NEW_LINE>if (copyable.isDirectory()) {<NEW_LINE>copyDir(copyable, new File(newFolder, copyable.getName()), progress, totalSize);<NEW_LINE>progress += Util.calcSize(copyable);<NEW_LINE>} else {<NEW_LINE>copyFile(copyable, new File(newFolder, copyable.getName()), progress, totalSize);<NEW_LINE>if (Util.calcSize(copyable) < 512 * 1024) {<NEW_LINE>// If the file length > 0.5MB, the copyFile() function has<NEW_LINE>// been redesigned to change progress every 0.5MB so that<NEW_LINE>// the progress bar doesn't stagnate during that time<NEW_LINE>progress += Util.calcSize(copyable);<NEW_LINE>setProgress((int) (progress * 100L / totalSize));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>saving.set(false);<NEW_LINE>return null;<NEW_LINE>} | Integer) evt.getNewValue()); |
1,007,393 | public BufferedImage intelligentResize(File incomingImage, int width, int height, int resampleOption) {<NEW_LINE>final String hash = DigestUtils.sha256Hex(incomingImage.getAbsolutePath());<NEW_LINE>Dimension originalSize = getWidthHeight(incomingImage);<NEW_LINE>width = Math.min(maxSize, width);<NEW_LINE>height = <MASK><NEW_LINE>// resample huge images to a maxSize (prevents OOM)<NEW_LINE>if ((originalSize.width > maxSize || originalSize.height > maxSize)) {<NEW_LINE>final Map<String, String[]> params = ImmutableMap.of("subsample_w", new String[] { String.valueOf(maxSize) }, "subsample_h", new String[] { String.valueOf(maxSize) }, "subsample_hash", new String[] { hash }, "filter", new String[] { "subsample" });<NEW_LINE>incomingImage = new SubSampleImageFilter().runFilter(incomingImage, params);<NEW_LINE>}<NEW_LINE>return this.resizeImage(incomingImage, width, height, resampleOption);<NEW_LINE>} | Math.min(maxSize, height); |
1,314,770 | public void focusGained(FocusEvent e) {<NEW_LINE>if (m_combo == null || m_combo.getEditor() == null)<NEW_LINE>return;<NEW_LINE>if ((e.getSource() != m_combo && e.getSource() != m_combo.getEditor().getEditorComponent()) || e.isTemporary() || m_haveFocus || m_lookup == null)<NEW_LINE>return;<NEW_LINE>// avoid repeated query<NEW_LINE>if (m_lookup.isValidated() && m_lookup.isLoaded()) {<NEW_LINE>m_haveFocus = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// prevents calling focus gained twice<NEW_LINE>m_haveFocus = true;<NEW_LINE>// prevents actionPerformed<NEW_LINE>m_settingFocus = true;<NEW_LINE>//<NEW_LINE><MASK><NEW_LINE>log.config(m_columnName + " - Start Count=" + m_combo.getItemCount() + ", Selected=" + obj);<NEW_LINE>// log.fine( "VLookupHash=" + this.hashCode());<NEW_LINE>boolean popupVisible = m_combo.isPopupVisible();<NEW_LINE>// only validated & active<NEW_LINE>m_lookup.fillComboBox(isMandatory(), true, true, false);<NEW_LINE>if (popupVisible) {<NEW_LINE>// refresh<NEW_LINE>m_combo.hidePopup();<NEW_LINE>m_combo.showPopup();<NEW_LINE>}<NEW_LINE>log.config(m_columnName + " - Update Count=" + m_combo.getItemCount() + ", Selected=" + m_lookup.getSelectedItem());<NEW_LINE>m_lookup.setSelectedItem(obj);<NEW_LINE>log.config(m_columnName + " - Selected Count=" + m_combo.getItemCount() + ", Selected=" + m_lookup.getSelectedItem());<NEW_LINE>//<NEW_LINE>m_settingFocus = false;<NEW_LINE>} | Object obj = m_lookup.getSelectedItem(); |
1,016,269 | public EvaluationMetrics unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>EvaluationMetrics evaluationMetrics = new EvaluationMetrics();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return 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("TransformType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>evaluationMetrics.setTransformType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("FindMatchesMetrics", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>evaluationMetrics.setFindMatchesMetrics(FindMatchesMetricsJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return evaluationMetrics;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
572,040 | public Object apply(final ActionContext ctx, final Object caller, final Object[] sources) throws FrameworkException {<NEW_LINE>if (sources != null && sources.length == 1) {<NEW_LINE>if (sources[0] == null) {<NEW_LINE>return "";<NEW_LINE>}<NEW_LINE>boolean useBuffer = false;<NEW_LINE>RenderContext innerCtx = null;<NEW_LINE>if (ctx.isRenderContext()) {<NEW_LINE>innerCtx = new RenderContext((RenderContext) ctx);<NEW_LINE>useBuffer = true;<NEW_LINE>} else {<NEW_LINE>innerCtx = new RenderContext(ctx.getSecurityContext());<NEW_LINE>useBuffer = false;<NEW_LINE>}<NEW_LINE>if (sources[0] instanceof DOMNode) {<NEW_LINE>((DOMNode) sources[0]).render(innerCtx, 0);<NEW_LINE>} else if (sources[0] instanceof Collection) {<NEW_LINE>for (final Object obj : (Collection) sources[0]) {<NEW_LINE>if (obj instanceof DOMNode) {<NEW_LINE>((DOMNode) obj).render(innerCtx, 0);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logger.warn("Error: Parameter 1 is neither node nor collection. Parameters: {}", getParametersAsString(sources));<NEW_LINE>}<NEW_LINE>if (useBuffer) {<NEW_LINE>// output was written to RenderContext async buffer<NEW_LINE>return null;<NEW_LINE>} else {<NEW_LINE>// output needs to be returned as a function result<NEW_LINE>return StringUtils.join(innerCtx.getBuffer().getQueue(), "");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>logParameterError(caller, <MASK><NEW_LINE>}<NEW_LINE>return usage(ctx.isJavaScriptContext());<NEW_LINE>} | sources, ctx.isJavaScriptContext()); |
630,114 | private static void validateFieldValue(SameCountryValidator vatValidator, Errors errors, String prefixForLambda, TicketFieldConfiguration fieldConf, List<String> values, int i) {<NEW_LINE>String formValue = values.get(i);<NEW_LINE>if (fieldConf.isMaxLengthDefined()) {<NEW_LINE>validateMaxLength(formValue, prefixForLambda + ADDITIONAL_PREFIX + fieldConf.getName() + "][" + i + "]", "error.tooLong", fieldConf.getMaxLength(), errors);<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotBlank(formValue) && fieldConf.isMinLengthDefined() && StringUtils.length(formValue) < fieldConf.getMinLength()) {<NEW_LINE>errors.rejectValue(prefixForLambda + ADDITIONAL_PREFIX + fieldConf.getName() + "][" + i + "]", "error.tooShort", new Object[] { fieldConf.getMinLength() }, null);<NEW_LINE>}<NEW_LINE>if (!fieldConf.getRestrictedValues().isEmpty()) {<NEW_LINE>validateRestrictedValue(formValue, prefixForLambda + ADDITIONAL_PREFIX + fieldConf.getName() + "][" + i + "]", "error.restrictedValue", fieldConf.getRestrictedValues(), errors);<NEW_LINE>}<NEW_LINE>if (fieldConf.isRequired() && fieldConf.getCount() == 1 && StringUtils.isBlank(formValue)) {<NEW_LINE>errors.rejectValue(prefixForLambda + ADDITIONAL_PREFIX + fieldConf.getName() + "][" + i + "]", ErrorsCode.EMPTY_FIELD);<NEW_LINE>}<NEW_LINE>if (fieldConf.hasDisabledValues() && fieldConf.getDisabledValues().contains(formValue)) {<NEW_LINE>errors.rejectValue(prefixForLambda + ADDITIONAL_PREFIX + fieldConf.getName() + "][" + i + <MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (fieldConf.isEuVat() && !vatValidator.test(formValue)) {<NEW_LINE>errors.rejectValue(prefixForLambda + ADDITIONAL_PREFIX + fieldConf.getName() + "][" + i + "]", ErrorsCode.STEP_2_INVALID_VAT);<NEW_LINE>}<NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>errors.rejectValue(prefixForLambda + ADDITIONAL_PREFIX + fieldConf.getName() + "][" + i + "]", ErrorsCode.VIES_IS_DOWN);<NEW_LINE>}<NEW_LINE>} | "]", "error.disabledValue", null, null); |
1,768,604 | // Private methods ---------------------------------------------------------<NEW_LINE>private void updatePackages() {<NEW_LINE>final Object item = createdLocationComboBox.getSelectedItem();<NEW_LINE>if (!(item instanceof SourceGroupSupport.SourceGroupProxy)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>WAIT_MODEL.setSelectedItem(createdPackageComboBox.getEditor().getItem());<NEW_LINE>createdPackageComboBox.setModel(WAIT_MODEL);<NEW_LINE>if (updatePackagesTask != null) {<NEW_LINE>updatePackagesTask.cancel();<NEW_LINE>}<NEW_LINE>updatePackagesTask = new RequestProcessor("ComboUpdatePackages").post(new // NOI18N<NEW_LINE>Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>final ComboBoxModel model = ((SourceGroupSupport.<MASK><NEW_LINE>SwingUtilities.invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>model.setSelectedItem(createdPackageComboBox.getEditor().getItem());<NEW_LINE>createdPackageComboBox.setModel(model);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | SourceGroupProxy) item).getPackagesComboBoxModel(); |
1,034,399 | public void handle(final Callback[] callbacks) throws IOException, UnsupportedCallbackException {<NEW_LINE>for (final Callback callback : callbacks) {<NEW_LINE>if (callback instanceof NameCallback) {<NEW_LINE><MASK><NEW_LINE>nc.setName(getUserName());<NEW_LINE>} else if (callback instanceof ObjectCallback) {<NEW_LINE>final ObjectCallback oc = (ObjectCallback) callback;<NEW_LINE>oc.setObject(getCredential());<NEW_LINE>} else if (callback instanceof PasswordCallback) {<NEW_LINE>final PasswordCallback pc = (PasswordCallback) callback;<NEW_LINE>pc.setPassword(((String) getCredential()).toCharArray());<NEW_LINE>} else if (callback instanceof TextOutputCallback) {<NEW_LINE>final TextOutputCallback toc = (TextOutputCallback) callback;<NEW_LINE>switch(toc.getMessageType()) {<NEW_LINE>case TextOutputCallback.ERROR:<NEW_LINE>log.error(toc.getMessage());<NEW_LINE>break;<NEW_LINE>case TextOutputCallback.WARNING:<NEW_LINE>log.warn(toc.getMessage());<NEW_LINE>break;<NEW_LINE>case TextOutputCallback.INFORMATION:<NEW_LINE>log.info(toc.getMessage());<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new IOException("Unsupported message type: " + toc.getMessageType());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// We ignore unknown callback types - e.g. Jetty implementation might pass us Jetty specific<NEW_LINE>// stuff which we can't deal with<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | final NameCallback nc = (NameCallback) callback; |
331,373 | public void onClick(View v) {<NEW_LINE>try {<NEW_LINE>switch(v.getId()) {<NEW_LINE>case R.id.web:<NEW_LINE>Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.WEB_SITE);<NEW_LINE>AlohaHelper.logClick(AlohaHelper.Settings.WEB_SITE);<NEW_LINE>startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(Constants.Url.WEB_SITE)));<NEW_LINE>break;<NEW_LINE>case R.id.facebook:<NEW_LINE>Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.FACEBOOK);<NEW_LINE>AlohaHelper.logClick(AlohaHelper.Settings.FACEBOOK);<NEW_LINE>Utils.showFacebookPage(getActivity());<NEW_LINE>break;<NEW_LINE>case R.id.twitter:<NEW_LINE>Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.TWITTER);<NEW_LINE>AlohaHelper.logClick(AlohaHelper.Settings.TWITTER);<NEW_LINE>Utils.showTwitterPage(getActivity());<NEW_LINE>break;<NEW_LINE>case R.id.rate:<NEW_LINE>Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.RATE);<NEW_LINE>AlohaHelper.logClick(AlohaHelper.Settings.RATE);<NEW_LINE>Utils.openAppInMarket(getActivity(), BuildConfig.REVIEW_URL);<NEW_LINE>break;<NEW_LINE>case R.id.share:<NEW_LINE>Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.TELL_FRIEND);<NEW_LINE>AlohaHelper.logClick(AlohaHelper.Settings.TELL_FRIEND);<NEW_LINE>ShareOption.AnyShareOption.ANY.share(getActivity(), getString(R.string.tell_friends_text<MASK><NEW_LINE>break;<NEW_LINE>case R.id.copyright:<NEW_LINE>Statistics.INSTANCE.trackEvent(Statistics.EventName.Settings.COPYRIGHT);<NEW_LINE>AlohaHelper.logClick(AlohaHelper.Settings.COPYRIGHT);<NEW_LINE>getSettingsActivity().replaceFragment(CopyrightFragment.class, getString(R.string.copyright), null);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} catch (ActivityNotFoundException e) {<NEW_LINE>AlohaHelper.logException(e);<NEW_LINE>}<NEW_LINE>} | ), R.string.tell_friends); |
34,292 | public // hbase_rest("http://example. com:8000/table/scanner/","POST/GET/PUT/DELETE","UTF-8","xml or json","Accept: text/xml","Content-Type: text/xml")<NEW_LINE>Object calculate(Context ctx) {<NEW_LINE>m_ctx = ctx;<NEW_LINE>IParam param = this.param;<NEW_LINE>try {<NEW_LINE>if (param.getType() == ';') {<NEW_LINE>ArrayList<Expression> list1 = new ArrayList<Expression>();<NEW_LINE>ArrayList<Expression> list2 = new ArrayList<Expression>();<NEW_LINE>param.getSub<MASK><NEW_LINE>param.getSub(1).getAllLeafExpression(list2);<NEW_LINE>IParam param0 = param.getSub(0);<NEW_LINE>IParam param00 = param0.getSub(0);<NEW_LINE>if (param00.isLeaf()) {<NEW_LINE>url = param00.getLeafExpression().calculate(ctx).toString();<NEW_LINE>} else {<NEW_LINE>url = param00.getSub(0).getLeafExpression().calculate(ctx).toString();<NEW_LINE>charset = param00.getSub(1).getLeafExpression().calculate(ctx).toString();<NEW_LINE>}<NEW_LINE>method = param0.getSub(1).getLeafExpression().calculate(ctx).toString();<NEW_LINE>if (param0.getSubSize() > 2)<NEW_LINE>content = param0.getSub(2).getLeafExpression().calculate(ctx).toString();<NEW_LINE>IParam param1 = param.getSub(1);<NEW_LINE>if (param1.isLeaf()) {<NEW_LINE>headers.add(param1.getLeafExpression().calculate(ctx).toString());<NEW_LINE>} else {<NEW_LINE>for (int i = 0; i < param1.getSubSize(); i++) headers.add(param1.getSub(i).getLeafExpression().calculate(ctx).toString());<NEW_LINE>}<NEW_LINE>} else if (param.getType() == ',') {<NEW_LINE>IParam param00 = param.getSub(0);<NEW_LINE>if (param00.isLeaf()) {<NEW_LINE>url = param00.getLeafExpression().calculate(ctx).toString();<NEW_LINE>} else {<NEW_LINE>url = param00.getSub(0).getLeafExpression().calculate(ctx).toString();<NEW_LINE>charset = param00.getSub(1).getLeafExpression().calculate(ctx).toString();<NEW_LINE>}<NEW_LINE>method = param.getSub(1).getLeafExpression().calculate(ctx).toString();<NEW_LINE>if (param.getSubSize() > 2)<NEW_LINE>content = param.getSub(2).getLeafExpression().calculate(ctx).toString();<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>MessageManager mm = EngineMessage.get();<NEW_LINE>e.printStackTrace();<NEW_LINE>throw new RQException("influx rest param error" + mm.getMessage(Integer.toString(param.getSubSize())));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (url.indexOf("https:") >= 0)<NEW_LINE>return Http4SPL.downLoadFromHttps(url, charset, method, content, headers);<NEW_LINE>else<NEW_LINE>return Http4SPL.downLoadFromHttp(url, charset, method, content, headers);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// TODO Auto-generated catch block<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | (0).getAllLeafExpression(list1); |
287,298 | private static void pruneOperationsAndErrors(ServiceModel serviceModel) {<NEW_LINE>Map<String, Shape> shapes = serviceModel.getShapes();<NEW_LINE>Map<String, Operation> operations = copy(serviceModel.getOperations());<NEW_LINE>serviceModel.getOperations().forEach((operationName, operation) -> {<NEW_LINE>// Remove operation if Input shape has been pruned<NEW_LINE>if (operation.getInput() != null) {<NEW_LINE>String inputShape = operation.getInput().getShape();<NEW_LINE>if (!shapes.containsKey(inputShape)) {<NEW_LINE>operations.remove(operationName);<NEW_LINE>log("Pruned operation [%s] with input shape [%s]", operationName, inputShape);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Remove operation if Output shape has been pruned<NEW_LINE>if (operation.getOutput() != null) {<NEW_LINE>String outputShape = operation<MASK><NEW_LINE>if (!shapes.containsKey(outputShape)) {<NEW_LINE>operations.remove(operationName);<NEW_LINE>log("Pruned operation [%s] with output shape [%s]", operationName, outputShape);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Remove any errors that have had their shape pruned<NEW_LINE>List<ErrorMap> errors = copy(operation.getErrors());<NEW_LINE>operation.getErrors().forEach(error -> {<NEW_LINE>String errorShape = error.getShape();<NEW_LINE>if (!shapes.containsKey(errorShape)) {<NEW_LINE>errors.remove(error);<NEW_LINE>log("Pruned error [%s] from operation [%s]", errorShape, operationName);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>operation.setErrors(errors);<NEW_LINE>});<NEW_LINE>serviceModel.setOperations(operations);<NEW_LINE>} | .getOutput().getShape(); |
943,702 | public void write(org.apache.thrift.protocol.TProtocol prot, TTransaction struct) throws org.apache.thrift.TException {<NEW_LINE>org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;<NEW_LINE>java.util.BitSet optionals = new java.util.BitSet();<NEW_LINE>if (struct.isSetSampledNewCount()) {<NEW_LINE>optionals.set(0);<NEW_LINE>}<NEW_LINE>if (struct.isSetSampledContinuationCount()) {<NEW_LINE>optionals.set(1);<NEW_LINE>}<NEW_LINE>if (struct.isSetUnsampledNewCount()) {<NEW_LINE>optionals.set(2);<NEW_LINE>}<NEW_LINE>if (struct.isSetUnsampledContinuationCount()) {<NEW_LINE>optionals.set(3);<NEW_LINE>}<NEW_LINE>if (struct.isSetSkippedNewCount()) {<NEW_LINE>optionals.set(4);<NEW_LINE>}<NEW_LINE>if (struct.isSetSkippedContinuationCount()) {<NEW_LINE>optionals.set(5);<NEW_LINE>}<NEW_LINE>oprot.writeBitSet(optionals, 6);<NEW_LINE>if (struct.isSetSampledNewCount()) {<NEW_LINE>oprot.writeI64(struct.sampledNewCount);<NEW_LINE>}<NEW_LINE>if (struct.isSetSampledContinuationCount()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (struct.isSetUnsampledNewCount()) {<NEW_LINE>oprot.writeI64(struct.unsampledNewCount);<NEW_LINE>}<NEW_LINE>if (struct.isSetUnsampledContinuationCount()) {<NEW_LINE>oprot.writeI64(struct.unsampledContinuationCount);<NEW_LINE>}<NEW_LINE>if (struct.isSetSkippedNewCount()) {<NEW_LINE>oprot.writeI64(struct.skippedNewCount);<NEW_LINE>}<NEW_LINE>if (struct.isSetSkippedContinuationCount()) {<NEW_LINE>oprot.writeI64(struct.skippedContinuationCount);<NEW_LINE>}<NEW_LINE>} | oprot.writeI64(struct.sampledContinuationCount); |
1,780,763 | public void generateStoreSaveValueIfNecessary(CodeStream codeStream) {<NEW_LINE>// push receiver<NEW_LINE>codeStream.aload_0();<NEW_LINE>// push the 2 parameters of "setResult(Object, Class)"<NEW_LINE>if (this.expression == null || this.expression.resolvedType == TypeBinding.VOID) {<NEW_LINE>// expressionType == VoidBinding if code snippet is the expression "System.out.println()"<NEW_LINE>// push null<NEW_LINE>codeStream.aconst_null();<NEW_LINE>// void.class<NEW_LINE>codeStream.generateClassLiteralAccessForType(TypeBinding.VOID, null);<NEW_LINE>} else {<NEW_LINE>// swap with expression<NEW_LINE>int valueTypeID = this.expression.resolvedType.id;<NEW_LINE>if (valueTypeID == T_long || valueTypeID == T_double) {<NEW_LINE>codeStream.dup_x2();<NEW_LINE>codeStream.pop();<NEW_LINE>} else {<NEW_LINE>codeStream.swap();<NEW_LINE>}<NEW_LINE>// generate wrapper if needed<NEW_LINE>if (this.expression.resolvedType.isBaseType() && this.expression.resolvedType != TypeBinding.NULL) {<NEW_LINE>codeStream.generateBoxingConversion(this.expression.resolvedType.id);<NEW_LINE>}<NEW_LINE>// generate the expression type<NEW_LINE>codeStream.generateClassLiteralAccessForType(<MASK><NEW_LINE>}<NEW_LINE>// generate the invoke virtual to "setResult(Object,Class)"<NEW_LINE>codeStream.invoke(Opcodes.OPC_invokevirtual, this.setResultMethod, null);<NEW_LINE>} | this.expression.resolvedType, null); |
582,691 | private synchronized void initAllocators(OStorage storage) {<NEW_LINE>// Syncrhonized will be replaced when the schema operations will go through the coordinator<NEW_LINE>int clusters = storage.getClusters();<NEW_LINE>Collection<? extends OCluster<MASK><NEW_LINE>ArrayList<AtomicLong> newAllocators = new ArrayList<>(clusters);<NEW_LINE>Map<String, Integer> newNames = new HashMap<>();<NEW_LINE>for (OCluster cluster : clusterInstances) {<NEW_LINE>try {<NEW_LINE>Integer exits = names.get(cluster.getName());<NEW_LINE>if (newAllocators.size() <= cluster.getId()) {<NEW_LINE>for (int i = cluster.getId() - newAllocators.size(); i >= 0; i--) {<NEW_LINE>newAllocators.add(null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (exits != null) {<NEW_LINE>newAllocators.set(cluster.getId(), allocators.get(exits));<NEW_LINE>} else {<NEW_LINE>long next = cluster.getLastPosition() + 1;<NEW_LINE>newAllocators.set(cluster.getId(), new AtomicLong(next));<NEW_LINE>}<NEW_LINE>newNames.put(cluster.getName(), cluster.getId());<NEW_LINE>} catch (IOException e) {<NEW_LINE>OLogManager.instance().error(this, "error resolving last position", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>allocators = newAllocators;<NEW_LINE>names = newNames;<NEW_LINE>} | > clusterInstances = storage.getClusterInstances(); |
88,785 | protected double doFirstDerivative(double xValue) {<NEW_LINE>ArgChecker.isTrue(xValue > 0, "Value should be stricly positive");<NEW_LINE>int lowerIndex = lowerBoundIndex(xValue, xValues);<NEW_LINE>int index;<NEW_LINE>// check if x-value is at the last node<NEW_LINE>if (lowerIndex == dataSize - 1) {<NEW_LINE>index = dataSize - 2;<NEW_LINE>} else {<NEW_LINE>index = lowerIndex;<NEW_LINE>}<NEW_LINE>double x1 = xValues[index];<NEW_LINE>double y1 = yValues[index];<NEW_LINE>int higherIndex = index + 1;<NEW_LINE>double x2 = xValues[higherIndex];<NEW_LINE>double y2 = yValues[higherIndex];<NEW_LINE>if ((y1 < EPS) || (y2 < EPS)) {<NEW_LINE>throw new UnsupportedOperationException("node sensitivity not implemented when one node is 0 value");<NEW_LINE>}<NEW_LINE>double w = (x2 - xValue) / (x2 - x1);<NEW_LINE><MASK><NEW_LINE>double xy22 = x2 * y2 * y2;<NEW_LINE>double xy2 = w * xy21 + (1 - w) * xy22;<NEW_LINE>return 0.5 * (-Math.sqrt(xy2 / xValue) + (-xy21 + xy22) / (x2 - x1) / Math.sqrt(xy2 / xValue)) / xValue;<NEW_LINE>} | double xy21 = x1 * y1 * y1; |
1,019,896 | private List<ResourceUsage> resourceUsageFromSnapshots(Plan plan, List<ResourceSnapshot> snapshots) {<NEW_LINE>snapshots.sort(Comparator.comparing(ResourceSnapshot::getTimestamp));<NEW_LINE>return IntStream.range(0, snapshots.size()).mapToObj(idx -> {<NEW_LINE>var a = snapshots.get(idx);<NEW_LINE>var b = (idx + 1) < snapshots.size() ? snapshots.get(idx + 1) : null;<NEW_LINE>var start = a.getTimestamp();<NEW_LINE>var end = Optional.ofNullable(b).map(ResourceSnapshot::getTimestamp).orElse(start.plusSeconds(120));<NEW_LINE>var d = BigDecimal.valueOf(Duration.between(start, end).toMillis());<NEW_LINE>return new ResourceUsage(a.getApplicationId(), a.getZoneId(), plan, BigDecimal.valueOf(a.getCpuCores()).multiply(d), BigDecimal.valueOf(a.getMemoryGb()).multiply(d), BigDecimal.valueOf(a.getDiskGb()).multiply(d));<NEW_LINE>}).<MASK><NEW_LINE>} | collect(Collectors.toList()); |
306,072 | public FrequentItemsetsResult run(final Relation<BitVector> relation) {<NEW_LINE>// TODO: implement with resizable arrays, to not need dim.<NEW_LINE>final int dim = RelationUtil.dimensionality(relation);<NEW_LINE>final VectorFieldTypeInformation<BitVector> meta = RelationUtil.assumeVectorField(relation);<NEW_LINE>// Compute absolute minsupport<NEW_LINE>final int minsupp = <MASK><NEW_LINE>LOG.verbose("Build 1-dimensional transaction lists.");<NEW_LINE>Duration ctime = LOG.newDuration(STAT + "eclat.transposition.time").begin();<NEW_LINE>DBIDs[] idx = buildIndex(relation, dim, minsupp);<NEW_LINE>LOG.statistics(ctime.end());<NEW_LINE>FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Building frequent itemsets", idx.length, LOG) : null;<NEW_LINE>Duration etime = LOG.newDuration(STAT + "eclat.extraction.time").begin();<NEW_LINE>final List<Itemset> solution = new ArrayList<>();<NEW_LINE>for (int i = 0; i < idx.length; i++) {<NEW_LINE>LOG.incrementProcessed(prog);<NEW_LINE>extractItemsets(idx, i, minsupp, solution);<NEW_LINE>}<NEW_LINE>LOG.ensureCompleted(prog);<NEW_LINE>Collections.sort(solution);<NEW_LINE>LOG.statistics(etime.end());<NEW_LINE>LOG.statistics(new LongStatistic(STAT + "frequent-itemsets", solution.size()));<NEW_LINE>FrequentItemsetsResult result = new FrequentItemsetsResult(solution, meta, relation.size());<NEW_LINE>Metadata.of(result).setLongName("Eclat");<NEW_LINE>return result;<NEW_LINE>} | getMinimumSupport(relation.size()); |
1,109,148 | public static ListItemsResponse unmarshall(ListItemsResponse listItemsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listItemsResponse.setRequestId(_ctx.stringValue("ListItemsResponse.requestId"));<NEW_LINE>Result result = new Result();<NEW_LINE>Total total = new Total();<NEW_LINE>total.setInstanceRecommendItem(_ctx.longValue("ListItemsResponse.result.total.instanceRecommendItem"));<NEW_LINE>total.setQueryCount(_ctx.longValue("ListItemsResponse.result.total.queryCount"));<NEW_LINE>total.setSceneRecommendItem(_ctx.longValue("ListItemsResponse.result.total.sceneRecommendItem"));<NEW_LINE>total.setSceneWeightItem(_ctx.longValue("ListItemsResponse.result.total.sceneWeightItem"));<NEW_LINE>total.setTotalCount(_ctx.longValue("ListItemsResponse.result.total.totalCount"));<NEW_LINE>total.setWeightItem(_ctx.longValue("ListItemsResponse.result.total.weightItem"));<NEW_LINE>result.setTotal(total);<NEW_LINE>List<DetailItem> detail = new ArrayList<DetailItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListItemsResponse.result.detail.Length"); i++) {<NEW_LINE>DetailItem detailItem = new DetailItem();<NEW_LINE>detailItem.setAuthor(_ctx.stringValue("ListItemsResponse.result.detail[" + i + "].author"));<NEW_LINE>detailItem.setBrandId(_ctx.stringValue("ListItemsResponse.result.detail[" + i + "].brandId"));<NEW_LINE>detailItem.setCategoryPath(_ctx.stringValue("ListItemsResponse.result.detail[" + i + "].categoryPath"));<NEW_LINE>detailItem.setChannel(_ctx.stringValue("ListItemsResponse.result.detail[" + i + "].channel"));<NEW_LINE>detailItem.setDuration(_ctx.stringValue("ListItemsResponse.result.detail[" + i + "].duration"));<NEW_LINE>detailItem.setExpireTime(_ctx.stringValue("ListItemsResponse.result.detail[" + i + "].expireTime"));<NEW_LINE>detailItem.setItemId(_ctx.stringValue("ListItemsResponse.result.detail[" + i + "].itemId"));<NEW_LINE>detailItem.setItemType(_ctx.stringValue("ListItemsResponse.result.detail[" + i + "].itemType"));<NEW_LINE>detailItem.setPubTime(_ctx.stringValue("ListItemsResponse.result.detail[" + i + "].pubTime"));<NEW_LINE>detailItem.setShopId(_ctx.stringValue<MASK><NEW_LINE>detailItem.setStatus(_ctx.stringValue("ListItemsResponse.result.detail[" + i + "].status"));<NEW_LINE>detailItem.setTitle(_ctx.stringValue("ListItemsResponse.result.detail[" + i + "].title"));<NEW_LINE>detail.add(detailItem);<NEW_LINE>}<NEW_LINE>result.setDetail(detail);<NEW_LINE>listItemsResponse.setResult(result);<NEW_LINE>return listItemsResponse;<NEW_LINE>} | ("ListItemsResponse.result.detail[" + i + "].shopId")); |
629,607 | private static List<WindowHandler> createWindowHandlers() {<NEW_LINE>List<WindowHandler> windowHandlers = new ArrayList<WindowHandler>();<NEW_LINE>windowHandlers.add(new AcceptIncomingConnectionDialogHandler());<NEW_LINE>windowHandlers.add(new BlindTradingWarningDialogHandler());<NEW_LINE>windowHandlers.add(new ExitSessionFrameHandler());<NEW_LINE>windowHandlers.add(new LoginFrameHandler());<NEW_LINE>windowHandlers.add(new GatewayLoginFrameHandler());<NEW_LINE>windowHandlers.add(new MainWindowFrameHandler());<NEW_LINE>windowHandlers.add(new GatewayMainWindowFrameHandler());<NEW_LINE>windowHandlers.add(new NewerVersionDialogHandler());<NEW_LINE>windowHandlers.add(new NewerVersionFrameHandler());<NEW_LINE>windowHandlers.add(new NotCurrentlyAvailableDialogHandler());<NEW_LINE>windowHandlers.add(new TipOfTheDayDialogHandler());<NEW_LINE>windowHandlers.add(new NSEComplianceFrameHandler());<NEW_LINE>windowHandlers.add(new PasswordExpiryWarningFrameHandler());<NEW_LINE>windowHandlers.add(new GlobalConfigurationDialogHandler());<NEW_LINE>windowHandlers.add(new TradesFrameHandler());<NEW_LINE>windowHandlers.add(new ExistingSessionDetectedDialogHandler());<NEW_LINE>windowHandlers.add(new ApiChangeConfirmationDialogHandler());<NEW_LINE>windowHandlers.add(new SplashFrameHandler());<NEW_LINE>windowHandlers.add(new SecurityCodeDialogHandler());<NEW_LINE>windowHandlers.add(new ReloginDialogHandler());<NEW_LINE>windowHandlers.add(new NonBrokerageAccountDialogHandler());<NEW_LINE>windowHandlers.add(new ExitConfirmationDialogHandler());<NEW_LINE>windowHandlers.add(new TradingLoginHandoffDialogHandler());<NEW_LINE>windowHandlers.add(new LoginFailedDialogHandler());<NEW_LINE>windowHandlers.add(new TooManyFailedLoginAttemptsDialogHandler());<NEW_LINE>windowHandlers<MASK><NEW_LINE>windowHandlers.add(new BidAskLastSizeDisplayUpdateDialogHandler());<NEW_LINE>windowHandlers.add(new LoginErrorDialogHandler());<NEW_LINE>return windowHandlers;<NEW_LINE>} | .add(new ShutdownProgressDialogHandler()); |
588,249 | public BufferedImage filter(BufferedImage bi) {<NEW_LINE>if (bi.getSampleModel().getDataType() != DataBuffer.TYPE_INT) {<NEW_LINE>bi = convertType(bi, BufferedImage.TYPE_INT_ARGB);<NEW_LINE>}<NEW_LINE>BufferedImage dstImg = new BufferedImage(bi.getWidth(), bi.getHeight(<MASK><NEW_LINE>// Grayscale, Contrast<NEW_LINE>bi = getGrayScale(bi);<NEW_LINE>bi = applyBrightnessAndContrast(bi, 0, 15);<NEW_LINE>// Copy Image: more red,more yellow(= less blue)<NEW_LINE>initPixelsArray(bi);<NEW_LINE>int[] changedPixels = changeColor();<NEW_LINE>BufferedImage changedColor = new BufferedImage(bi.getWidth(), bi.getHeight(), bi.getType());<NEW_LINE>changedColor.setRGB(0, 0, bi.getWidth(), bi.getHeight(), changedPixels, 0, bi.getWidth());<NEW_LINE>// Blending Mode: Soft Light, 50%<NEW_LINE>Graphics2D gdst = dstImg.createGraphics();<NEW_LINE>gdst.drawImage(bi, 0, 0, null);<NEW_LINE>gdst.setComposite(BlendComposite.getInstance(BlendingMode.SCREEN, 0.6f));<NEW_LINE>gdst.drawImage(changedColor, 0, 0, bi.getWidth(), bi.getHeight(), null);<NEW_LINE>return dstImg;<NEW_LINE>} | ), bi.getType()); |
964,305 | public final Object decode(CachedData d) {<NEW_LINE>byte[] compositeData = d.getData();<NEW_LINE>if (compositeData.length <= 4)<NEW_LINE>throw new MemcachedDecodeException("There are no four bytes before value for TokyoTyrantTranscoder");<NEW_LINE>byte[] flagBytes = new byte[4];<NEW_LINE>byte[] realData = new <MASK><NEW_LINE>System.arraycopy(compositeData, 0, flagBytes, 0, 4);<NEW_LINE>System.arraycopy(compositeData, 4, realData, 0, compositeData.length - 4);<NEW_LINE>int flag = serializingTranscoder.getTranscoderUtils().decodeInt(flagBytes);<NEW_LINE>d.setFlag(flag);<NEW_LINE>if ((flag & SerializingTranscoder.COMPRESSED) != 0) {<NEW_LINE>realData = serializingTranscoder.decompress(realData);<NEW_LINE>}<NEW_LINE>flag = flag & SerializingTranscoder.SPECIAL_MASK;<NEW_LINE>return serializingTranscoder.decode0(d, realData, flag);<NEW_LINE>} | byte[compositeData.length - 4]; |
1,052,536 | private HiveConf configure() throws Exception {<NEW_LINE>String scratchDir = NTFSLocalFileSystem.SCRATCH_DIR;<NEW_LINE>File scratchDirFile = new File(scratchDir);<NEW_LINE>TestUtils.delete(scratchDirFile);<NEW_LINE>Configuration cfg = new Configuration();<NEW_LINE>HiveConf conf = new HiveConf(cfg, HiveConf.class);<NEW_LINE>conf.addToRestrictList("columns.comments");<NEW_LINE>refreshConfig(conf);<NEW_LINE>HdpBootstrap.hackHadoopStagingOnWin();<NEW_LINE>// work-around for NTFS FS<NEW_LINE>// set permissive permissions since otherwise, on some OS it fails<NEW_LINE>if (TestUtils.isWindows()) {<NEW_LINE>conf.set("fs.file.impl", NTFSLocalFileSystem.class.getName());<NEW_LINE>conf.set("hive.scratch.dir.permission", "650");<NEW_LINE>conf.setVar(ConfVars.SCRATCHDIRPERMISSION, "650");<NEW_LINE>conf.set("hive.server2.enable.doAs", "false");<NEW_LINE>conf.set("hive.execution.engine", "mr");<NEW_LINE>// conf.set("hadoop.bin.path", getClass().getClassLoader().getResource("hadoop.cmd").getPath());<NEW_LINE>System.setProperty("path.separator", ";");<NEW_LINE>conf.setVar(HiveConf.ConfVars.HIVE_AUTHENTICATOR_MANAGER, <MASK><NEW_LINE>} else {<NEW_LINE>conf.set("hive.scratch.dir.permission", "777");<NEW_LINE>conf.setVar(ConfVars.SCRATCHDIRPERMISSION, "777");<NEW_LINE>scratchDirFile.mkdirs();<NEW_LINE>// also set the permissions manually since Hive doesn't do it...<NEW_LINE>scratchDirFile.setWritable(true, false);<NEW_LINE>}<NEW_LINE>conf.set("hive.aux.jars.path", "");<NEW_LINE>conf.set("hive.added.jars.path", "");<NEW_LINE>conf.set("hive.added.files.path", "");<NEW_LINE>conf.set("hive.added.archives.path", "");<NEW_LINE>conf.set("fs.default.name", "file:///");<NEW_LINE>// clear mapred.job.tracker - Hadoop defaults to 'local' if not defined. Hive however expects this to be set to 'local' - if it's not, it does a remote execution (i.e. no child JVM)<NEW_LINE>Field field = Configuration.class.getDeclaredField("properties");<NEW_LINE>field.setAccessible(true);<NEW_LINE>Properties props = (Properties) field.get(conf);<NEW_LINE>props.remove("mapred.job.tracker");<NEW_LINE>props.remove("mapreduce.framework.name");<NEW_LINE>props.setProperty("fs.default.name", "file:///");<NEW_LINE>// intercept SessionState to clean the threadlocal<NEW_LINE>Field tss = SessionState.class.getDeclaredField("tss");<NEW_LINE>tss.setAccessible(true);<NEW_LINE>// tss.set(null, new InterceptingThreadLocal());<NEW_LINE>return new HiveConf(conf);<NEW_LINE>} | DummyHiveAuthenticationProvider.class.getName()); |
439,871 | public Object visit(ASTAnyTypeDeclaration node, Object data) {<NEW_LINE>if (!MetricsUtil.supportsAll(node, NOAM, NOPA, WMC, WOC)) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>boolean isDataClass = interfaceRevealsData(node) && classRevealsDataAndLacksComplexity(node);<NEW_LINE>if (isDataClass) {<NEW_LINE>double woc = MetricsUtil.computeMetric(WOC, node);<NEW_LINE>int nopa = (int) MetricsUtil.computeMetric(NOPA, node);<NEW_LINE>int noam = (int) MetricsUtil.computeMetric(NOAM, node);<NEW_LINE>int wmc = (int) MetricsUtil.computeMetric(WMC, node);<NEW_LINE>addViolation(data, node, new Object[] { node.getSimpleName(), StringUtil.percentageString(woc, 3), nopa, noam, wmc });<NEW_LINE>}<NEW_LINE>return super.visit(node, data);<NEW_LINE>} | super.visit(node, data); |
436,770 | private static ConstructingObjectParser<Hyperparameters, Void> createParser(boolean ignoreUnknownFields) {<NEW_LINE>ConstructingObjectParser<Hyperparameters, Void> parser = new ConstructingObjectParser<>("classification_hyperparameters", ignoreUnknownFields, a -> new Hyperparameters((String) a[0], (double) a[1], (double) a[2], (double) a[3], (double) a[4], (double) a[5], (double) a[6], (double) a[7], (int) a[8], (int) a[9], (int) a[10], (int) a[11], (int) a[12], (double) a[13], (double) a[14]));<NEW_LINE>parser.declareString(constructorArg(), CLASS_ASSIGNMENT_OBJECTIVE);<NEW_LINE>parser.declareDouble(constructorArg(), ALPHA);<NEW_LINE>parser.declareDouble(constructorArg(), DOWNSAMPLE_FACTOR);<NEW_LINE>parser.declareDouble(constructorArg(), ETA);<NEW_LINE>parser.declareDouble(constructorArg(), ETA_GROWTH_RATE_PER_TREE);<NEW_LINE>parser.declareDouble(constructorArg(), FEATURE_BAG_FRACTION);<NEW_LINE>parser.declareDouble(constructorArg(), GAMMA);<NEW_LINE>parser.declareDouble(constructorArg(), LAMBDA);<NEW_LINE>parser.declareInt(constructorArg(), MAX_ATTEMPTS_TO_ADD_TREE);<NEW_LINE>parser.declareInt(constructorArg(), MAX_OPTIMIZATION_ROUNDS_PER_HYPERPARAMETER);<NEW_LINE>parser.declareInt(constructorArg(), MAX_TREES);<NEW_LINE>parser.<MASK><NEW_LINE>parser.declareInt(constructorArg(), NUM_SPLITS_PER_FEATURE);<NEW_LINE>parser.declareDouble(constructorArg(), SOFT_TREE_DEPTH_LIMIT);<NEW_LINE>parser.declareDouble(constructorArg(), SOFT_TREE_DEPTH_TOLERANCE);<NEW_LINE>return parser;<NEW_LINE>} | declareInt(constructorArg(), NUM_FOLDS); |
1,359,379 | public ImportCertificateResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ImportCertificateResult importCertificateResult = new ImportCertificateResult();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return importCertificateResult;<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("CertificateArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>importCertificateResult.setCertificateArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return importCertificateResult;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
841,210 | private void createAnonymousTypeLabel(CompletionProposal proposal, CompletionItem item) {<NEW_LINE>char[] declaringTypeSignature = proposal.getDeclarationSignature();<NEW_LINE>declaringTypeSignature = Signature.getTypeErasure(declaringTypeSignature);<NEW_LINE>String name = new String<MASK><NEW_LINE>item.setInsertText(name);<NEW_LINE>StringBuilder buf = new StringBuilder();<NEW_LINE>buf.append(name);<NEW_LINE>buf.append('(');<NEW_LINE>appendUnboundedParameterList(buf, proposal);<NEW_LINE>buf.append(')');<NEW_LINE>// $NON-NLS-1$<NEW_LINE>buf.append(" ");<NEW_LINE>// TODO: consider externalization<NEW_LINE>buf.append("Anonymous Inner Type");<NEW_LINE>item.setLabel(buf.toString());<NEW_LINE>if (proposal.getRequiredProposals() != null) {<NEW_LINE>char[] signatureQualifier = Signature.getSignatureQualifier(declaringTypeSignature);<NEW_LINE>if (signatureQualifier.length > 0) {<NEW_LINE>item.setDetail(String.valueOf(signatureQualifier) + "." + name);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setDeclarationSignature(item, String.valueOf(declaringTypeSignature));<NEW_LINE>} | (Signature.getSignatureSimpleName(declaringTypeSignature)); |
1,020,551 | public static DescribeAntChainMembersV2Response unmarshall(DescribeAntChainMembersV2Response describeAntChainMembersV2Response, UnmarshallerContext _ctx) {<NEW_LINE>describeAntChainMembersV2Response.setRequestId(_ctx.stringValue("DescribeAntChainMembersV2Response.RequestId"));<NEW_LINE>describeAntChainMembersV2Response.setHttpStatusCode(_ctx.stringValue("DescribeAntChainMembersV2Response.HttpStatusCode"));<NEW_LINE>describeAntChainMembersV2Response.setSuccess(_ctx.booleanValue("DescribeAntChainMembersV2Response.Success"));<NEW_LINE>describeAntChainMembersV2Response.setResultMessage(_ctx.stringValue("DescribeAntChainMembersV2Response.ResultMessage"));<NEW_LINE>describeAntChainMembersV2Response.setCode(_ctx.stringValue("DescribeAntChainMembersV2Response.Code"));<NEW_LINE>describeAntChainMembersV2Response.setMessage(_ctx.stringValue("DescribeAntChainMembersV2Response.Message"));<NEW_LINE>describeAntChainMembersV2Response.setResultCode<MASK><NEW_LINE>Result result = new Result();<NEW_LINE>Pagination pagination = new Pagination();<NEW_LINE>pagination.setPageSize(_ctx.integerValue("DescribeAntChainMembersV2Response.Result.Pagination.PageSize"));<NEW_LINE>pagination.setPageNumber(_ctx.integerValue("DescribeAntChainMembersV2Response.Result.Pagination.PageNumber"));<NEW_LINE>pagination.setTotalCount(_ctx.integerValue("DescribeAntChainMembersV2Response.Result.Pagination.TotalCount"));<NEW_LINE>result.setPagination(pagination);<NEW_LINE>List<MembersItem> members = new ArrayList<MembersItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeAntChainMembersV2Response.Result.Members.Length"); i++) {<NEW_LINE>MembersItem membersItem = new MembersItem();<NEW_LINE>membersItem.setStatus(_ctx.stringValue("DescribeAntChainMembersV2Response.Result.Members[" + i + "].Status"));<NEW_LINE>membersItem.setMemberId(_ctx.stringValue("DescribeAntChainMembersV2Response.Result.Members[" + i + "].MemberId"));<NEW_LINE>membersItem.setRole(_ctx.stringValue("DescribeAntChainMembersV2Response.Result.Members[" + i + "].Role"));<NEW_LINE>membersItem.setMemberName(_ctx.stringValue("DescribeAntChainMembersV2Response.Result.Members[" + i + "].MemberName"));<NEW_LINE>membersItem.setJoinTime(_ctx.longValue("DescribeAntChainMembersV2Response.Result.Members[" + i + "].JoinTime"));<NEW_LINE>members.add(membersItem);<NEW_LINE>}<NEW_LINE>result.setMembers(members);<NEW_LINE>describeAntChainMembersV2Response.setResult(result);<NEW_LINE>return describeAntChainMembersV2Response;<NEW_LINE>} | (_ctx.stringValue("DescribeAntChainMembersV2Response.ResultCode")); |
423,153 | public void createMenuItems(Bundle savedInstanceState) {<NEW_LINE>final OsmandApplication app = getMyApplication();<NEW_LINE>Context context = getContext();<NEW_LINE>if (context == null || app == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (savedInstanceState != null) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>Bundle args = getArguments();<NEW_LINE>if (args != null) {<NEW_LINE>pluginId = args.getString(PLUGIN_ID_KEY);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>OsmandPlugin plugin = OsmandPlugin.getPlugin(pluginId);<NEW_LINE>if (plugin == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BaseBottomSheetItem titleItem = new TitleItem.Builder().setTitle(getString(R.string.new_plugin_added)).setLayoutId(R.layout.bottom_sheet_item_title_big).create();<NEW_LINE>items.add(titleItem);<NEW_LINE>Typeface typeface = FontCache.getRobotoMedium(getContext());<NEW_LINE>SpannableString pluginTitleSpan = new SpannableString(plugin.getName());<NEW_LINE>pluginTitleSpan.setSpan(new CustomTypefaceSpan(typeface), 0, pluginTitleSpan.length(), 0);<NEW_LINE>Drawable pluginIcon = plugin.getLogoResource();<NEW_LINE>if (pluginIcon.getConstantState() != null) {<NEW_LINE>pluginIcon = pluginIcon.getConstantState().newDrawable().mutate();<NEW_LINE>}<NEW_LINE>pluginIcon = UiUtilities.tintDrawable(pluginIcon, ColorUtilities.getDefaultIconColor(app, nightMode));<NEW_LINE>BaseBottomSheetItem pluginTitle = new SimpleBottomSheetItem.Builder().setTitle(pluginTitleSpan).setTitleColorId(ColorUtilities.getActiveColorId(nightMode)).setIcon(pluginIcon).setLayoutId(R.layout.bottom_sheet_item_simple_56dp).create();<NEW_LINE>items.add(pluginTitle);<NEW_LINE>descrItem = (BottomSheetItemTitleWithDescrAndButton) new BottomSheetItemTitleWithDescrAndButton.Builder().setButtonTitle(getString(R.string.show_full_description)).setOnButtonClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>descriptionExpanded = !descriptionExpanded;<NEW_LINE>descrItem.setButtonText(getString(descriptionExpanded ? R.string.hide_full_description : R.string.show_full_description));<NEW_LINE>descrItem.setDescriptionMaxLines(descriptionExpanded ? Integer.MAX_VALUE : COLLAPSED_DESCRIPTION_LINES);<NEW_LINE>setupHeightAndBackground(getView());<NEW_LINE>}<NEW_LINE>}).setDescriptionLinksClickable(true).setDescription(plugin.getDescription()).setDescriptionMaxLines(COLLAPSED_DESCRIPTION_LINES).setLayoutId(R.layout.bottom_sheet_item_with_expandable_descr).create();<NEW_LINE>items.add(descrItem);<NEW_LINE>List<ApplicationMode> addedAppModes = plugin.getAddedAppModes();<NEW_LINE>if (!addedAppModes.isEmpty()) {<NEW_LINE>createAddedAppModesItems(addedAppModes);<NEW_LINE>}<NEW_LINE>List<IndexItem> suggestedMaps = plugin.getSuggestedMaps();<NEW_LINE>if (!suggestedMaps.isEmpty()) {<NEW_LINE>createSuggestedMapsItems(suggestedMaps);<NEW_LINE>}<NEW_LINE>} | pluginId = savedInstanceState.getString(PLUGIN_ID_KEY); |
1,115,815 | public <K, V> void replace(Cache<K, V> cache, K key, V value, long lifespan, TimeUnit lifespanUnit) {<NEW_LINE>log.tracev(<MASK><NEW_LINE>Object taskKey = getTaskKey(cache, key);<NEW_LINE>CacheTask current = tasks.get(taskKey);<NEW_LINE>if (current != null) {<NEW_LINE>if (current instanceof CacheTaskWithValue) {<NEW_LINE>((CacheTaskWithValue<V>) current).setValue(value);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>tasks.put(taskKey, new CacheTaskWithValue<V>(value) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void execute() {<NEW_LINE>decorateCache(cache).replace(key, value, lifespan, lifespanUnit);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public String toString() {<NEW_LINE>return String.format("CacheTaskWithValue: Operation 'replace' for key %s, lifespan %d TimeUnit %s", key, lifespan, lifespanUnit);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | "Adding cache operation: {0} on {1}", CacheOperation.REPLACE, key); |
1,826,097 | public void run() {<NEW_LINE>response.setContentType(MediaType.PLAIN_TEXT_UTF_8);<NEW_LINE>try {<NEW_LINE>int totalNumOfWipedEntities = 0;<NEW_LINE>DateTime wipeOutTime = clock.nowUtc().minusMonths(minMonthsBeforeWipeOut);<NEW_LINE>logger.atInfo().log("About to wipe out all PII of contact history entities prior to %s.", wipeOutTime);<NEW_LINE>int numOfWipedEntities = 0;<NEW_LINE>do {<NEW_LINE>numOfWipedEntities = jpaTm().transact(() -> wipeOutContactHistoryData(getNextContactHistoryEntitiesWithPiiBatch(wipeOutTime)));<NEW_LINE>totalNumOfWipedEntities += numOfWipedEntities;<NEW_LINE>} while (numOfWipedEntities > 0);<NEW_LINE>String msg = <MASK><NEW_LINE>logger.atInfo().log(msg);<NEW_LINE>response.setPayload(msg);<NEW_LINE>response.setStatus(SC_OK);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.atSevere().withCause(e).log("Exception thrown during the process of wiping out contact history PII.");<NEW_LINE>response.setStatus(SC_INTERNAL_SERVER_ERROR);<NEW_LINE>response.setPayload(String.format("Exception thrown during the process of wiping out contact history PII with cause" + ": %s", e));<NEW_LINE>}<NEW_LINE>} | String.format("Done. Wiped out PII of %d ContactHistory entities in total.", totalNumOfWipedEntities); |
1,788,523 | private void initializeViews() {<NEW_LINE>int width = isTabletMode <MASK><NEW_LINE>int height = isTabletMode ? LayoutParams.MATCH_PARENT : LayoutParams.WRAP_CONTENT;<NEW_LINE>LayoutParams params = new LayoutParams(width, height);<NEW_LINE>setLayoutParams(params);<NEW_LINE>setOrientation(isTabletMode ? HORIZONTAL : VERTICAL);<NEW_LINE>View rootView = inflate(getContext(), isTabletMode ? R.layout.bb_bottom_bar_item_container_tablet : R.layout.bb_bottom_bar_item_container, this);<NEW_LINE>rootView.setLayoutParams(params);<NEW_LINE>backgroundOverlay = rootView.findViewById(R.id.bb_bottom_bar_background_overlay);<NEW_LINE>outerContainer = (ViewGroup) rootView.findViewById(R.id.bb_bottom_bar_outer_container);<NEW_LINE>tabContainer = (ViewGroup) rootView.findViewById(R.id.bb_bottom_bar_item_container);<NEW_LINE>shadowView = findViewById(R.id.bb_bottom_bar_shadow);<NEW_LINE>} | ? LayoutParams.WRAP_CONTENT : LayoutParams.MATCH_PARENT; |
655,724 | public Void visitBlock(BlockTree bt, Void p) {<NEW_LINE>List<CatchTree> catches = createCatches(info, make, thandles, statement);<NEW_LINE>// #89379: if inside a constructor, do not wrap the "super"/"this" call:<NEW_LINE>// please note that the "super" or "this" call is supposed to be always<NEW_LINE>// in the constructor body<NEW_LINE>BlockTree toUse = bt;<NEW_LINE>StatementTree toKeep = null;<NEW_LINE>Tree parent = getCurrentPath()<MASK><NEW_LINE>if (parent.getKind() == Kind.METHOD && bt.getStatements().size() > 0) {<NEW_LINE>MethodTree mt = (MethodTree) parent;<NEW_LINE>if (mt.getReturnType() == null) {<NEW_LINE>toKeep = bt.getStatements().get(0);<NEW_LINE>toUse = make.Block(bt.getStatements().subList(1, bt.getStatements().size()), false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!streamAlike) {<NEW_LINE>info.rewrite(bt, createBlock(bt.isStatic(), toKeep, make.Try(toUse, catches, null)));<NEW_LINE>} else {<NEW_LINE>VariableTree originalDeclaration = (VariableTree) statement.getLeaf();<NEW_LINE>VariableTree declaration = make.Variable(make.Modifiers(EnumSet.noneOf(Modifier.class)), originalDeclaration.getName(), originalDeclaration.getType(), make.Identifier("null"));<NEW_LINE>StatementTree assignment = make.ExpressionStatement(make.Assignment(make.Identifier(originalDeclaration.getName()), originalDeclaration.getInitializer()));<NEW_LINE>BlockTree finallyTree = make.Block(Collections.singletonList(createFinallyCloseBlockStatement(originalDeclaration)), false);<NEW_LINE>info.rewrite(originalDeclaration, assignment);<NEW_LINE>info.rewrite(bt, createBlock(bt.isStatic(), toKeep, declaration, make.Try(toUse, catches, finallyTree)));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | .getParentPath().getLeaf(); |
1,485,423 | private String doEval(String name, ModelItem modelItem, StringToObjectMap objects) {<NEW_LINE>String engineId = SoapUIScriptEngineRegistry.getScriptEngineId(modelItem);<NEW_LINE>synchronized (this) {<NEW_LINE>if (!scriptEnginePools.containsKey(engineId)) {<NEW_LINE>scriptEnginePools.put(engineId, new ScriptEnginePool(engineId));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ScriptEnginePool scriptEnginePool = scriptEnginePools.get(engineId);<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>scriptEngine.setScript(name);<NEW_LINE>for (Map.Entry<String, Object> entry : objects.entrySet()) {<NEW_LINE>scriptEngine.setVariable(entry.getKey(), entry.getValue());<NEW_LINE>}<NEW_LINE>Object result = scriptEngine.run();<NEW_LINE>return result == null ? null : result.toString();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>log.error("Error evaluating script", e);<NEW_LINE>return e.getMessage();<NEW_LINE>} finally {<NEW_LINE>scriptEngine.clearVariables();<NEW_LINE>scriptEnginePool.returnScriptEngine(scriptEngine);<NEW_LINE>}<NEW_LINE>} | SoapUIScriptEngine scriptEngine = scriptEnginePool.getScriptEngine(); |
811,651 | public ApiResponse handleApiAction(String name, JSONObject params) throws ApiException {<NEW_LINE>log.debug("handleApiAction " + name + " " + params.toString());<NEW_LINE>Context context;<NEW_LINE>switch(name) {<NEW_LINE>case ACTION_SET_AUTHORIZATION_METHOD:<NEW_LINE>context = <MASK><NEW_LINE>String headerRegex = params.optString(PARAM_HEADER_REGEX, null);<NEW_LINE>String bodyRegex = params.optString(PARAM_BODY_REGEX, null);<NEW_LINE>LogicalOperator logicalOperator = ApiUtils.getOptionalEnumParam(params, PARAM_LOGICAL_OPERATOR, LogicalOperator.class);<NEW_LINE>if (logicalOperator == null) {<NEW_LINE>logicalOperator = LogicalOperator.AND;<NEW_LINE>}<NEW_LINE>int statusCode = params.optInt(PARAM_STATUS_CODE, BasicAuthorizationDetectionMethod.NO_STATUS_CODE);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Setting basic authorization detection to: %s / %s / %d / %s", headerRegex, bodyRegex, statusCode, logicalOperator));<NEW_LINE>}<NEW_LINE>BasicAuthorizationDetectionMethod method = new BasicAuthorizationDetectionMethod(statusCode, headerRegex, bodyRegex, logicalOperator);<NEW_LINE>context.setAuthorizationDetectionMethod(method);<NEW_LINE>return ApiResponseElement.OK;<NEW_LINE>default:<NEW_LINE>throw new ApiException(Type.BAD_ACTION);<NEW_LINE>}<NEW_LINE>} | ApiUtils.getContextByParamId(params, PARAM_CONTEXT_ID); |
1,137,798 | ActionResult<Wo> execute(EffectivePerson effectivePerson, String flag, String applicationFlag) throws Exception {<NEW_LINE>ActionResult<Wo> result = new ActionResult<>();<NEW_LINE>try (EntityManagerContainer emc = EntityManagerContainerFactory.instance().create()) {<NEW_LINE>Wo wo = new Wo();<NEW_LINE>CacheCategory cacheCategory = new CacheCategory(Script.class);<NEW_LINE>CacheKey cacheKey = new CacheKey(this.getClass(), flag, applicationFlag);<NEW_LINE>Optional<?> optional = CacheManager.get(cacheCategory, cacheKey);<NEW_LINE>if (optional.isPresent()) {<NEW_LINE>wo = (Wo) optional.get();<NEW_LINE>} else {<NEW_LINE>Business business = new Business(emc);<NEW_LINE>Application application = business.application().pick(applicationFlag);<NEW_LINE>if (null == application) {<NEW_LINE>throw new ExceptionApplicationNotExist(applicationFlag);<NEW_LINE>}<NEW_LINE>List<Script> list = new ArrayList<>();<NEW_LINE>for (Script o : business.script().listScriptNestedWithApplicationWithUniqueName(application, flag)) {<NEW_LINE>list.add(o);<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder("");<NEW_LINE>List<String> imported = new ArrayList<>();<NEW_LINE>for (Script o : list) {<NEW_LINE>sb.append(o.getText());<NEW_LINE>sb.append(System.lineSeparator());<NEW_LINE>imported.add(o.getId());<NEW_LINE>if (StringUtils.isNotEmpty(o.getName())) {<NEW_LINE>imported.add(o.getName());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotEmpty(o.getAlias())) {<NEW_LINE>imported.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>wo.setImportedList(imported);<NEW_LINE>wo.setText(sb.toString());<NEW_LINE>wo.setApplication(application.getId());<NEW_LINE>wo.setAppName(application.getName());<NEW_LINE>wo.setAppAlias(application.getAlias());<NEW_LINE>CacheManager.put(cacheCategory, cacheKey, wo);<NEW_LINE>}<NEW_LINE>result.setData(wo);<NEW_LINE>return result;<NEW_LINE>}<NEW_LINE>} | add(o.getAlias()); |
123,964 | private static MysqlVariable newSetItem(String key, SQLExpr valueExpr) throws SQLException {<NEW_LINE>switch(key.toLowerCase()) {<NEW_LINE>case "xa":<NEW_LINE>return new MysqlVariable("xa", SetItemUtil.getBooleanVal(key.toLowerCase(), valueExpr), VariableType.XA);<NEW_LINE>case "trace":<NEW_LINE>return new MysqlVariable("trace", SetItemUtil.getBooleanVal(key.toLowerCase(), valueExpr), VariableType.TRACE);<NEW_LINE>case "autocommit":<NEW_LINE>return new MysqlVariable("autocommit", SetItemUtil.getBooleanVal(key.toLowerCase(), valueExpr), VariableType.AUTOCOMMIT);<NEW_LINE>case "collation_connection":<NEW_LINE>return new MysqlVariable("collation_connection", SetItemUtil.getCollationVal(valueExpr), VariableType.COLLATION_CONNECTION);<NEW_LINE>case "character_set_client":<NEW_LINE>return new MysqlVariable("character_set_client", SetItemUtil.getCharsetClientVal(valueExpr), VariableType.CHARACTER_SET_CLIENT);<NEW_LINE>case "character_set_results":<NEW_LINE>return new MysqlVariable("character_set_results", SetItemUtil.getCharsetResultsVal(valueExpr), VariableType.CHARACTER_SET_RESULTS);<NEW_LINE>case "character_set_connection":<NEW_LINE>return new MysqlVariable("character_set_connection", SetItemUtil.getCharsetConnectionVal(valueExpr), VariableType.CHARACTER_SET_CONNECTION);<NEW_LINE>case "character set":<NEW_LINE>return new MysqlVariable(key, SetItemUtil.getCharsetVal(valueExpr), VariableType.CHARSET);<NEW_LINE>case "names":<NEW_LINE>return new MysqlVariable(key, SetItemUtil.getNamesVal(valueExpr), VariableType.NAMES);<NEW_LINE>case VersionUtil.TRANSACTION_ISOLATION:<NEW_LINE>case VersionUtil.TX_ISOLATION:<NEW_LINE>return new MysqlVariable(key, SetItemUtil.getIsolationVal(valueExpr), VariableType.TX_ISOLATION);<NEW_LINE>case VersionUtil.TRANSACTION_READ_ONLY:<NEW_LINE>case VersionUtil.TX_READ_ONLY:<NEW_LINE>return new MysqlVariable(key, SetItemUtil.getBooleanVal(key.toLowerCase()<MASK><NEW_LINE>default:<NEW_LINE>if (key.startsWith("@@")) {<NEW_LINE>return newSetItem(key.substring(2), valueExpr);<NEW_LINE>} else if (key.startsWith("@")) {<NEW_LINE>return new MysqlVariable(key.toUpperCase(), null, VariableType.USER_VARIABLES);<NEW_LINE>}<NEW_LINE>return new MysqlVariable(key, SetItemUtil.parseVariablesValue(valueExpr), VariableType.SYSTEM_VARIABLES);<NEW_LINE>}<NEW_LINE>} | , valueExpr), VariableType.TX_READ_ONLY); |
1,496,354 | public static void start(String[] args) {<NEW_LINE>// create logger<NEW_LINE>final Logger logger = LoggerFactory.getLogger(Server.class);<NEW_LINE>// initialize the parameter parser<NEW_LINE>// Note that the parameter parser should always be the first line to execute.<NEW_LINE>// Because, here we need to parse the parameters needed for startup.<NEW_LINE>ParameterParser parameterParser = new ParameterParser(args);<NEW_LINE>// initialize the metrics<NEW_LINE>MetricsManager.get().init();<NEW_LINE>System.setProperty(ConfigurationKeys.STORE_MODE, parameterParser.getStoreMode());<NEW_LINE>ThreadPoolExecutor workingThreads = new ThreadPoolExecutor(NettyServerConfig.getMinServerPoolSize(), NettyServerConfig.getMaxServerPoolSize(), NettyServerConfig.getKeepAliveTime(), TimeUnit.SECONDS, new LinkedBlockingQueue<>(NettyServerConfig.getMaxTaskQueueSize()), new NamedThreadFactory("ServerHandlerThread", NettyServerConfig.getMaxServerPoolSize()), new ThreadPoolExecutor.CallerRunsPolicy());<NEW_LINE>NettyRemotingServer nettyRemotingServer = new NettyRemotingServer(workingThreads);<NEW_LINE>UUIDGenerator.init(parameterParser.getServerNode());<NEW_LINE>// log store mode : file, db, redis<NEW_LINE>SessionHolder.init(parameterParser.getSessionStoreMode());<NEW_LINE>LockerManagerFactory.init(parameterParser.getLockStoreMode());<NEW_LINE>DefaultCoordinator coordinator = DefaultCoordinator.getInstance(nettyRemotingServer);<NEW_LINE>coordinator.init();<NEW_LINE>nettyRemotingServer.setHandler(coordinator);<NEW_LINE>// let ServerRunner do destroy instead ShutdownHook, see https://github.com/seata/seata/issues/4028<NEW_LINE>ServerRunner.addDisposable(coordinator);<NEW_LINE>// 127.0.0.1 and 0.0.0.0 are not valid here.<NEW_LINE>if (NetUtil.isValidIp(parameterParser.getHost(), false)) {<NEW_LINE>XID.setIpAddress(parameterParser.getHost());<NEW_LINE>} else {<NEW_LINE>String preferredNetworks = ConfigurationFactory.getInstance().getConfig(REGISTRY_PREFERED_NETWORKS);<NEW_LINE>if (StringUtils.isNotBlank(preferredNetworks)) {<NEW_LINE>XID.setIpAddress(NetUtil.getLocalIp(<MASK><NEW_LINE>} else {<NEW_LINE>XID.setIpAddress(NetUtil.getLocalIp());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>nettyRemotingServer.init();<NEW_LINE>} | preferredNetworks.split(REGEX_SPLIT_CHAR))); |
1,568,197 | public void checkOut(int id, String stationName, int t) {<NEW_LINE>LinkedList<StationAndTime> list = travelerMap.get(id);<NEW_LINE>StationAndTime stationAndTime = list.getLast();<NEW_LINE>String startToEndStation = stationAndTime<MASK><NEW_LINE>int duration = t - stationAndTime.getTime();<NEW_LINE>if (!averageTimeMap.containsKey(startToEndStation)) {<NEW_LINE>averageTimeMap.put(startToEndStation, new double[] { duration, 1 });<NEW_LINE>} else {<NEW_LINE>double[] pair = averageTimeMap.get(startToEndStation);<NEW_LINE>double newAverage = (double) (pair[0] * pair[1] + duration) / (double) (pair[1] + 1);<NEW_LINE>averageTimeMap.put(startToEndStation, new double[] { newAverage, pair[1] + 1 });<NEW_LINE>}<NEW_LINE>} | .getStation() + "->" + stationName; |
1,151,027 | public boolean save(IMiniTable miniTable, String trxName) {<NEW_LINE>log.info("");<NEW_LINE>int M_RMA_ID = Env.getContextAsInt(Env.getCtx(), getGridTab().getWindowNo(), "M_RMA_ID");<NEW_LINE>// Integer bpId = (Integer)bPartnerField.getValue();<NEW_LINE>MRMA rma = new MRMA(Env.<MASK><NEW_LINE>// update BP<NEW_LINE>// rma.setC_BPartner_ID(bpId);<NEW_LINE>for (int i = 0; i < miniTable.getRowCount(); i++) {<NEW_LINE>if (((Boolean) miniTable.getValueAt(i, 0)).booleanValue()) {<NEW_LINE>// 5-Movement Qty<NEW_LINE>BigDecimal d = (BigDecimal) miniTable.getValueAt(i, 5);<NEW_LINE>// 1-Line<NEW_LINE>KeyNamePair pp = (KeyNamePair) miniTable.getValueAt(i, 1);<NEW_LINE>int inOutLineId = pp.getKey();<NEW_LINE>MRMALine rmaLine = new MRMALine(rma.getCtx(), 0, rma.get_TrxName());<NEW_LINE>rmaLine.setM_RMA_ID(M_RMA_ID);<NEW_LINE>rmaLine.setM_InOutLine_ID(inOutLineId);<NEW_LINE>rmaLine.setQty(d);<NEW_LINE>rmaLine.setAD_Org_ID(rma.getAD_Org_ID());<NEW_LINE>if (!rmaLine.save()) {<NEW_LINE>throw new IllegalStateException("Could not create RMA Line");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>rma.saveEx();<NEW_LINE>return true;<NEW_LINE>} | getCtx(), M_RMA_ID, trxName); |
331,556 | public void transformJson(HistoryJobEntity job, ObjectNode historicalData, CommandContext commandContext) {<NEW_LINE>HistoricIdentityLinkService historicIdentityLinkService = cmmnEngineConfiguration<MASK><NEW_LINE>HistoricIdentityLinkEntity historicIdentityLinkEntity = historicIdentityLinkService.createHistoricIdentityLink();<NEW_LINE>historicIdentityLinkEntity.setId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_ID));<NEW_LINE>historicIdentityLinkEntity.setGroupId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_GROUP_ID));<NEW_LINE>historicIdentityLinkEntity.setScopeId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_SCOPE_ID));<NEW_LINE>historicIdentityLinkEntity.setSubScopeId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_SUB_SCOPE_ID));<NEW_LINE>historicIdentityLinkEntity.setScopeType(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_SCOPE_TYPE));<NEW_LINE>historicIdentityLinkEntity.setScopeDefinitionId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_SCOPE_DEFINITION_ID));<NEW_LINE>historicIdentityLinkEntity.setTaskId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_TASK_ID));<NEW_LINE>historicIdentityLinkEntity.setProcessInstanceId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_PROCESS_INSTANCE_ID));<NEW_LINE>historicIdentityLinkEntity.setType(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_IDENTITY_LINK_TYPE));<NEW_LINE>historicIdentityLinkEntity.setUserId(getStringFromJson(historicalData, CmmnAsyncHistoryConstants.FIELD_USER_ID));<NEW_LINE>historicIdentityLinkService.insertHistoricIdentityLink(historicIdentityLinkEntity, false);<NEW_LINE>} | .getIdentityLinkServiceConfiguration().getHistoricIdentityLinkService(); |
819,000 | public static void reloadConfigParams(PluginConfig cfg) {<NEW_LINE>final String PREFIX = "StartStopManager_";<NEW_LINE>iRankType = cfg.getUnsafeIntParameter(PREFIX + "iRankType");<NEW_LINE>minPeersToBoostNoSeeds = cfg.getUnsafeIntParameter(PREFIX + "iMinPeersToBoostNoSeeds");<NEW_LINE>minSpeedForActiveDL = cfg.getUnsafeIntParameter(PREFIX + "iMinSpeedForActiveDL");<NEW_LINE>minSpeedForActiveSeeding = cfg.getUnsafeIntParameter(PREFIX + "iMinSpeedForActiveSeeding");<NEW_LINE>iRankTypeSeedFallback = cfg.getUnsafeIntParameter(PREFIX + "iRankTypeSeedFallback");<NEW_LINE>bPreferLargerSwarms = <MASK><NEW_LINE>minTimeAlive = cfg.getUnsafeIntParameter(PREFIX + "iMinSeedingTime") * 1000;<NEW_LINE>bAutoStart0Peers = cfg.getUnsafeBooleanParameter(PREFIX + "bAutoStart0Peers");<NEW_LINE>// Ignore torrent if seed count is at least..<NEW_LINE>iIgnoreSeedCount = cfg.getUnsafeIntParameter(PREFIX + "iIgnoreSeedCount");<NEW_LINE>bIgnore0Peers = cfg.getUnsafeBooleanParameter(PREFIX + "bIgnore0Peers");<NEW_LINE>iIgnoreShareRatio = (int) (1000 * cfg.getUnsafeFloatParameter("Stop Ratio"));<NEW_LINE>iIgnoreShareRatio_SeedStart = cfg.getUnsafeIntParameter(PREFIX + "iIgnoreShareRatioSeedStart");<NEW_LINE>iIgnoreRatioPeers = cfg.getUnsafeIntParameter("Stop Peers Ratio", 0);<NEW_LINE>iIgnoreRatioPeers_SeedStart = cfg.getUnsafeIntParameter(PREFIX + "iIgnoreRatioPeersSeedStart", 0);<NEW_LINE>numPeersAsFullCopy = cfg.getUnsafeIntParameter("StartStopManager_iNumPeersAsFullCopy");<NEW_LINE>iFakeFullCopySeedStart = cfg.getUnsafeIntParameter("StartStopManager_iFakeFullCopySeedStart");<NEW_LINE>minQueueingShareRatio = cfg.getUnsafeIntParameter(PREFIX + "iFirstPriority_ShareRatio");<NEW_LINE>iFirstPriorityType = cfg.getUnsafeIntParameter(PREFIX + "iFirstPriority_Type");<NEW_LINE>iFirstPrioritySeedingMinutes = cfg.getUnsafeIntParameter(PREFIX + "iFirstPriority_SeedingMinutes");<NEW_LINE>iFirstPriorityActiveMinutes = cfg.getUnsafeIntParameter(PREFIX + "iFirstPriority_DLMinutes");<NEW_LINE>// Ignore FP<NEW_LINE>iFirstPriorityIgnoreSPRatio = cfg.getUnsafeIntParameter(PREFIX + "iFirstPriority_ignoreSPRatio");<NEW_LINE>bFirstPriorityIgnore0Peer = cfg.getUnsafeBooleanParameter(PREFIX + "bFirstPriority_ignore0Peer");<NEW_LINE>iFirstPriorityIgnoreIdleMinutes = cfg.getUnsafeIntParameter(PREFIX + "iFirstPriority_ignoreIdleMinutes");<NEW_LINE>iTimed_MinSeedingTimeWithPeers = cfg.getUnsafeIntParameter(PREFIX + "iTimed_MinSeedingTimeWithPeers") * 1000;<NEW_LINE>} | cfg.getUnsafeBooleanParameter(PREFIX + "bPreferLargerSwarms"); |
356,955 | public MediaStreamAttributesRequest unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>MediaStreamAttributesRequest mediaStreamAttributesRequest = new MediaStreamAttributesRequest();<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("fmtp", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>mediaStreamAttributesRequest.setFmtp(FmtpRequestJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("lang", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>mediaStreamAttributesRequest.setLang(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return mediaStreamAttributesRequest;<NEW_LINE>} | ().unmarshall(context)); |
616,152 | public void write(Object value) throws Exception {<NEW_LINE>Preconditions.checkArgument(value != null, "Null values are not allowed.");<NEW_LINE>LevelDBTypeInfo ti = getTypeInfo(value.getClass());<NEW_LINE>try (WriteBatch batch = db().createWriteBatch()) {<NEW_LINE>byte[] <MASK><NEW_LINE>synchronized (ti) {<NEW_LINE>Object existing;<NEW_LINE>try {<NEW_LINE>existing = get(ti.naturalIndex().entityKey(null, value), value.getClass());<NEW_LINE>} catch (NoSuchElementException e) {<NEW_LINE>existing = null;<NEW_LINE>}<NEW_LINE>PrefixCache cache = new PrefixCache(value);<NEW_LINE>byte[] naturalKey = ti.naturalIndex().toKey(ti.naturalIndex().getValue(value));<NEW_LINE>for (LevelDBTypeInfo.Index idx : ti.indices()) {<NEW_LINE>byte[] prefix = cache.getPrefix(idx);<NEW_LINE>idx.add(batch, value, existing, data, naturalKey, prefix);<NEW_LINE>}<NEW_LINE>db().write(batch);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | data = serializer.serialize(value); |
458,164 | public void run(RegressionEnvironment env) {<NEW_LINE>String text = "@name('s0') select irstream * from SupportMarketDataBean#length(3)#weighted_avg(price, volume)";<NEW_LINE>env.compileDeployAddListenerMileZero(text, "s0");<NEW_LINE>env.sendEventBean(makeBean(10, 1000));<NEW_LINE>env.assertPropsNV("s0", new Object[][] { { "average", 10d } }, new Object[][] { { "average", Double.NaN } });<NEW_LINE>env.milestone(1);<NEW_LINE>env.sendEventBean(makeBean(11, 2000));<NEW_LINE>env.assertPropsNV("s0", new Object[][] { { "average", 10.666666666666666 } }, new Object[][] { { "average", 10.0 } });<NEW_LINE>env.milestone(2);<NEW_LINE>env.sendEventBean<MASK><NEW_LINE>env.assertPropsNV("s0", new Object[][] { { "average", 10.61111111111111 } }, new Object[][] { { "average", 10.666666666666666 } });<NEW_LINE>env.milestone(3);<NEW_LINE>// test iterator<NEW_LINE>env.assertPropsPerRowIterator("s0", new String[] { "average" }, new Object[][] { { 10.61111111111111 } });<NEW_LINE>env.sendEventBean(makeBean(9.5, 600));<NEW_LINE>env.assertPropsNV("s0", new Object[][] { { "average", 10.597560975609756 } }, new Object[][] { { "average", 10.61111111111111 } });<NEW_LINE>env.milestone(4);<NEW_LINE>env.undeployAll();<NEW_LINE>} | (makeBean(10.5, 1500)); |
1,123,322 | protected BeanDefinitionBuilder configureDefaultAuditHandlerAttributes(AuditingConfiguration configuration, BeanDefinitionBuilder builder) {<NEW_LINE>if (StringUtils.hasText(configuration.getAuditorAwareRef())) {<NEW_LINE>builder.addPropertyValue(AUDITOR_AWARE, createLazyInitTargetSourceBeanDefinition(configuration.getAuditorAwareRef()));<NEW_LINE>} else {<NEW_LINE>builder.setAutowireMode(AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE);<NEW_LINE>}<NEW_LINE>builder.addPropertyValue(SET_DATES, configuration.isSetDates());<NEW_LINE>builder.addPropertyValue(MODIFY_ON_CREATE, configuration.isModifyOnCreate());<NEW_LINE>if (StringUtils.hasText(configuration.getDateTimeProviderRef())) {<NEW_LINE>builder.addPropertyReference(<MASK><NEW_LINE>} else {<NEW_LINE>builder.addPropertyValue(DATE_TIME_PROVIDER, CurrentDateTimeProvider.INSTANCE);<NEW_LINE>}<NEW_LINE>builder.setRole(AbstractBeanDefinition.ROLE_INFRASTRUCTURE);<NEW_LINE>return builder;<NEW_LINE>} | DATE_TIME_PROVIDER, configuration.getDateTimeProviderRef()); |
725,509 | public static List<Cmd> createDiffCmds(@Nonnull Model<Object> listModel, @Nonnull Object[] oldElements, @Nonnull Object[] newElements) {<NEW_LINE>Diff.Change change = null;<NEW_LINE>try {<NEW_LINE>change = Diff.buildChanges(oldElements, newElements);<NEW_LINE>} catch (FilesTooBigForDiffException e) {<NEW_LINE>// should not occur<NEW_LINE>}<NEW_LINE>if (change == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>List<Cmd> commands = new ArrayList<>();<NEW_LINE>int inserted = 0;<NEW_LINE>int deleted = 0;<NEW_LINE>while (change != null) {<NEW_LINE>if (change.deleted > 0) {<NEW_LINE>final int start = change.line0 + inserted - deleted;<NEW_LINE>commands.add(new RemoveCmd<>(listModel, start, start + change.deleted - 1));<NEW_LINE>}<NEW_LINE>if (change.inserted > 0) {<NEW_LINE>List<Object> elements = new ArrayList<>(Arrays.asList(newElements).subList(change.line1, change.line1 + change.inserted));<NEW_LINE>commands.add(new InsertCmd<>(listModel, change.line0 <MASK><NEW_LINE>}<NEW_LINE>deleted += change.deleted;<NEW_LINE>inserted += change.inserted;<NEW_LINE>change = change.link;<NEW_LINE>}<NEW_LINE>return commands;<NEW_LINE>} | + inserted - deleted, elements)); |
456,113 | // ----- private methods -----<NEW_LINE>private void applyAce(final AccessControllable node, final Ace toAdd, final boolean revoke) throws FrameworkException {<NEW_LINE>final String principalId = toAdd.getPrincipalId();<NEW_LINE>final List<String> permissions = toAdd.getPermissions();<NEW_LINE>final Principal principal = CMISObjectWrapper.translateUsernameToPrincipal(principalId);<NEW_LINE>if (principal != null) {<NEW_LINE>for (final String permissionString : permissions) {<NEW_LINE>final Permission <MASK><NEW_LINE>if (permission != null) {<NEW_LINE>if (revoke) {<NEW_LINE>node.revoke(permission, principal);<NEW_LINE>} else {<NEW_LINE>node.grant(permission, principal);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new CmisInvalidArgumentException("Permission with ID " + permissionString + " does not exist");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new CmisObjectNotFoundException("Principal with ID " + principalId + " does not exist");<NEW_LINE>}<NEW_LINE>} | permission = Permissions.valueOf(permissionString); |
427,668 | public static DeltaTableName from(String tableName) {<NEW_LINE>Matcher match = TABLE_PATTERN.matcher(tableName);<NEW_LINE>if (!match.matches()) {<NEW_LINE>throw new PrestoException(NOT_SUPPORTED, "Invalid Delta table name: " + tableName + ", Expected table name form 'tableName[@v<snapshotId>][@t<snapshotAsOfTimestamp>]'. " + "The table can have either a particular snapshot identifier or a timestamp of the snapshot. " + "If timestamp is given the latest snapshot of the table that was generated at or before the given timestamp is read");<NEW_LINE>}<NEW_LINE>String tableNameOrPath = match.group(TABLE_GROUP_NAME);<NEW_LINE>String snapshotValue = match.group(SNAPSHOT_ID_GROUP_NAME);<NEW_LINE>Optional<Long> snapshot = Optional.empty();<NEW_LINE>if (snapshotValue != null) {<NEW_LINE>snapshot = Optional.of(Long.parseLong(snapshotValue));<NEW_LINE>}<NEW_LINE>Optional<Long> timestampMillisUtc = Optional.empty();<NEW_LINE>String timestampValue = match.group(TIMESTAMP_GROUP_NAME);<NEW_LINE>if (timestampValue != null) {<NEW_LINE>try {<NEW_LINE>timestampMillisUtc = Optional.of(LocalDateTime.from(TIMESTAMP_PARSER.parse(timestampValue)).toInstant(UTC).toEpochMilli());<NEW_LINE>} catch (IllegalArgumentException | DateTimeParseException exception) {<NEW_LINE>throw new PrestoException(NOT_SUPPORTED, format("Invalid Delta table name: %s, given snapshot timestamp (%s) format is not valid. " + "Expected timestamp format 'YYYY-MM-DD HH:mm:ss'", tableName, timestampValue), exception);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (snapshot.isPresent() && timestampMillisUtc.isPresent()) {<NEW_LINE>throw new PrestoException(NOT_SUPPORTED, "Invalid Delta table name: " + tableName + ", Table suffix contains both snapshot id and timestamp of snapshot to read. " + "Only one of them is supported.");<NEW_LINE>}<NEW_LINE>return new <MASK><NEW_LINE>} | DeltaTableName(tableNameOrPath, snapshot, timestampMillisUtc); |
1,339,616 | private void generateSendMailMethod(FileObject fileObject, final String className, String sessionVariableName, String sessionGetter) throws IOException {<NEW_LINE>List<MethodModel.Variable> parameters = Arrays.asList(new MethodModel.Variable[] { MethodModel.Variable.create("java.lang.String", "email"), MethodModel.Variable.create("java.lang.String", "subject"), MethodModel.Variable.create("java.lang.String", "body") });<NEW_LINE>List<String> exceptions = Arrays.asList(new String[] { javax.naming.NamingException.class.getName(), "javax.mail.MessagingException" });<NEW_LINE>final MethodModel methodModel = MethodModel.create(_RetoucheUtil.uniqueMemberName(fileObject, className, "sendMail", "mailResource"), "void", getSendCode(sessionVariableName, sessionGetter), parameters, exceptions, Collections.singleton(Modifier.PRIVATE));<NEW_LINE>JavaSource javaSource = JavaSource.forFileObject(fileObject);<NEW_LINE>javaSource.runModificationTask(new Task<WorkingCopy>() {<NEW_LINE><NEW_LINE>public void run(WorkingCopy workingCopy) throws IOException {<NEW_LINE>workingCopy.<MASK><NEW_LINE>TypeElement typeElement = workingCopy.getElements().getTypeElement(className);<NEW_LINE>MethodTree methodTree = MethodModelSupport.createMethodTree(workingCopy, methodModel);<NEW_LINE>methodTree = (MethodTree) GeneratorUtilities.get(workingCopy).importFQNs(methodTree);<NEW_LINE>ClassTree classTree = workingCopy.getTrees().getTree(typeElement);<NEW_LINE>ClassTree newClassTree = workingCopy.getTreeMaker().addClassMember(classTree, methodTree);<NEW_LINE>workingCopy.rewrite(classTree, newClassTree);<NEW_LINE>}<NEW_LINE>}).commit();<NEW_LINE>} | toPhase(JavaSource.Phase.ELEMENTS_RESOLVED); |
951,492 | public static void main(String[] args) throws IOException {<NEW_LINE>String resolverPath = null;<NEW_LINE>String handlerJarPaths = null;<NEW_LINE>String handlerClassNames = null;<NEW_LINE>String inputDir = null;<NEW_LINE>try {<NEW_LINE>final CommandLineParser parser = new GnuParser();<NEW_LINE>CommandLine cl = parser.parse(_options, args);<NEW_LINE>if (cl.hasOption('h')) {<NEW_LINE>help();<NEW_LINE>System.exit(0);<NEW_LINE>}<NEW_LINE>String[] cliArgs = cl.getArgs();<NEW_LINE>if (cliArgs.length != 1) {<NEW_LINE>_log.error("Wrong argument given");<NEW_LINE>help();<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>resolverPath = RestLiToolsUtils.readArgFromFileIfNeeded(cl.getOptionValue('r'));<NEW_LINE>;<NEW_LINE>handlerJarPaths = cl.getOptionValue('j');<NEW_LINE>handlerClassNames = cl.getOptionValue('c');<NEW_LINE>inputDir = cliArgs[0];<NEW_LINE>} catch (ParseException e) {<NEW_LINE>_log.error("Invalid arguments: " + e.getMessage());<NEW_LINE>help();<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>List<SchemaAnnotationHandler> handlers = null;<NEW_LINE>try {<NEW_LINE>handlers = <MASK><NEW_LINE>} catch (IllegalStateException e) {<NEW_LINE>_log.error(e.getMessage());<NEW_LINE>throw new IllegalStateException("ValidateSchemaAnnotation task failed");<NEW_LINE>}<NEW_LINE>boolean hasError = false;<NEW_LINE>List<String> schemaWithFailures = new ArrayList<>();<NEW_LINE>List<DataSchema> namedDataSchema = parseSchemas(resolverPath, inputDir);<NEW_LINE>for (DataSchema dataSchema : namedDataSchema) {<NEW_LINE>SchemaAnnotationProcessor.SchemaAnnotationProcessResult result = SchemaAnnotationProcessor.process(handlers, dataSchema, new SchemaAnnotationProcessor.AnnotationProcessOption());<NEW_LINE>// If any of the nameDataSchema failed to be processed, log error and throw exception<NEW_LINE>if (result.hasError()) {<NEW_LINE>String schemaName = ((NamedDataSchema) dataSchema).getFullName();<NEW_LINE>_log.error("Annotation processing for data schema [{}] failed, detailed error: \n", schemaName);<NEW_LINE>_log.error(result.getErrorMsgs());<NEW_LINE>schemaWithFailures.add(schemaName);<NEW_LINE>hasError = true;<NEW_LINE>} else {<NEW_LINE>_log.info("Successfully resolved and validated data schema [{}]", ((NamedDataSchema) dataSchema).getFullName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hasError) {<NEW_LINE>_log.error("ValidateSchemaAnnotation task failed due to failure in following schemas [{}]", schemaWithFailures);<NEW_LINE>// Throw exception at the end if any of<NEW_LINE>throw new IllegalStateException("ValidateSchemaAnnotation task failed");<NEW_LINE>}<NEW_LINE>} | ClassJarPathUtil.getAnnotationHandlers(handlerJarPaths, handlerClassNames); |
1,128,438 | private void onOK() {<NEW_LINE>int index;<NEW_LINE>try {<NEW_LINE>index = Integer.parseInt(this.textIndex.getText());<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>index = 0;<NEW_LINE>}<NEW_LINE>MethodParameterSetting twigPath = new MethodParameterSetting(this.textCallTo.getText(), this.textMethodName.getText(), index, (String) this.comboProvider.getSelectedItem());<NEW_LINE>twigPath.setContributorName((String) comboContributor.getSelectedItem());<NEW_LINE>if (textContributorData.isEnabled()) {<NEW_LINE>twigPath.setContributorData(textContributorData.getText());<NEW_LINE>}<NEW_LINE>twigPath.setReferenceProviderName((String) comboProvider.getSelectedItem());<NEW_LINE>// re-add old item to not use public setter wor twigpaths<NEW_LINE>// update ?<NEW_LINE>if (this.methodParameterSetting != null) {<NEW_LINE>int row = this.<MASK><NEW_LINE>this.tableView.getListTableModel().removeRow(row);<NEW_LINE>this.tableView.getListTableModel().insertRow(row, twigPath);<NEW_LINE>this.tableView.setRowSelectionInterval(row, row);<NEW_LINE>} else {<NEW_LINE>int row = this.tableView.getRowCount();<NEW_LINE>this.tableView.getListTableModel().addRow(twigPath);<NEW_LINE>this.tableView.setRowSelectionInterval(row, row);<NEW_LINE>}<NEW_LINE>dispose();<NEW_LINE>} | tableView.getSelectedRows()[0]; |
1,666,706 | public static <T> T addEnum(Class<T> cl, String name, List<Class<?>> ctorTypes, List<Object> ctorParams) {<NEW_LINE>try {<NEW_LINE>Unsafe.ensureClassInitialized(cl);<NEW_LINE>Field field = getValuesField(cl);<NEW_LINE>Object base = Unsafe.staticFieldBase(field);<NEW_LINE>long offset = Unsafe.staticFieldOffset(field);<NEW_LINE>T[] arr = (T[]) Unsafe.getObject(base, offset);<NEW_LINE>T[] newArr = (T[]) Array.newInstance(<MASK><NEW_LINE>System.arraycopy(arr, 0, newArr, 0, arr.length);<NEW_LINE>T newInstance = makeEnum(cl, name, arr.length, ctorTypes, ctorParams);<NEW_LINE>newArr[arr.length] = newInstance;<NEW_LINE>Unsafe.putObject(base, offset, newArr);<NEW_LINE>reset(cl);<NEW_LINE>return newInstance;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | cl, arr.length + 1); |
1,007,897 | public void clearRange(long startAddress, long bytesToClear) {<NEW_LINE>if (bytesToClear == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long endAddress = startAddress + bytesToClear;<NEW_LINE>assert endAddress <= <MASK><NEW_LINE>int blockNumber = (int) (startAddress / CHUNK_SIZE);<NEW_LINE>int firstBlockBytesToClear = (int) Math.min((((long) (blockNumber + 1) * CHUNK_SIZE) - startAddress), bytesToClear);<NEW_LINE>Chunk firstBlock = getChunk(startAddress);<NEW_LINE>firstBlock.clear(startAddress, firstBlockBytesToClear);<NEW_LINE>startAddress += firstBlockBytesToClear;<NEW_LINE>bytesToClear -= firstBlockBytesToClear;<NEW_LINE>while (bytesToClear > CHUNK_SIZE) {<NEW_LINE>Chunk nextBlock = getChunk(startAddress);<NEW_LINE>nextBlock.clear(startAddress, CHUNK_SIZE);<NEW_LINE>startAddress += CHUNK_SIZE;<NEW_LINE>bytesToClear -= CHUNK_SIZE;<NEW_LINE>}<NEW_LINE>if (bytesToClear > 0) {<NEW_LINE>Chunk nextBlock = getChunk(startAddress);<NEW_LINE>nextBlock.clear(startAddress, (int) bytesToClear);<NEW_LINE>}<NEW_LINE>} | (long) this.fChunksUsed * CHUNK_SIZE; |
1,044,660 | public static byte[] fromBigDecimal(BigDecimal i) {<NEW_LINE>BigInteger bi = i.unscaledValue();<NEW_LINE>byte[] tmp = bi.toByteArray();<NEW_LINE><MASK><NEW_LINE>if ((scale <= 0x3F) && (scale > -0x3F)) {<NEW_LINE>// 6 bits are sufficient to encode<NEW_LINE>// scale unsigned<NEW_LINE>// encode sign<NEW_LINE>byte[] b = new byte[1 + tmp.length];<NEW_LINE>b[0] = (byte) ((scale >= 0) ? 0x0 : 0x40);<NEW_LINE>b[0] |= (byte) (scale & 0x3F);<NEW_LINE>System.arraycopy(tmp, 0, b, 1, tmp.length);<NEW_LINE>return b;<NEW_LINE>}<NEW_LINE>byte[] b = new byte[5 + tmp.length];<NEW_LINE>// set bit 0<NEW_LINE>b[0] = (byte) 0x80;<NEW_LINE>fromInt(scale, b, 1);<NEW_LINE>System.arraycopy(tmp, 0, b, 5, tmp.length);<NEW_LINE>return b;<NEW_LINE>} | int scale = i.scale(); |
225,900 | public Page<Task> tasks(Pageable pageable, GetTasksPayload getTasksPayload) {<NEW_LINE>TaskQuery taskQuery = taskService.createTaskQuery();<NEW_LINE>if (getTasksPayload == null) {<NEW_LINE>getTasksPayload = TaskPayloadBuilder.tasks().build();<NEW_LINE>}<NEW_LINE>String authenticatedUserId = securityManager.getAuthenticatedUserId();<NEW_LINE>if (authenticatedUserId != null && !authenticatedUserId.isEmpty()) {<NEW_LINE>List<String> userGroups = securityManager.getAuthenticatedUserGroups();<NEW_LINE>getTasksPayload.setAssigneeId(authenticatedUserId);<NEW_LINE>getTasksPayload.setGroups(userGroups);<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("You need an authenticated user to perform a task query");<NEW_LINE>}<NEW_LINE>taskQuery = taskQuery.or().taskCandidateOrAssigned(getTasksPayload.getAssigneeId(), getTasksPayload.getGroups()).taskOwner(authenticatedUserId).endOr();<NEW_LINE>if (getTasksPayload.getProcessInstanceId() != null) {<NEW_LINE>taskQuery = taskQuery.processInstanceId(getTasksPayload.getProcessInstanceId());<NEW_LINE>}<NEW_LINE>if (getTasksPayload.getParentTaskId() != null) {<NEW_LINE>taskQuery = taskQuery.taskParentTaskId(getTasksPayload.getParentTaskId());<NEW_LINE>}<NEW_LINE>List<Task> tasks = taskConverter.from(taskQuery.listPage(pageable.getStartIndex()<MASK><NEW_LINE>return new PageImpl<>(tasks, Math.toIntExact(taskQuery.count()));<NEW_LINE>} | , pageable.getMaxItems())); |
1,473,069 | public boolean apply(Game game, Ability source) {<NEW_LINE>// In the case that the enchantment is blinked<NEW_LINE>Permanent enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);<NEW_LINE>if (enchantment == null) {<NEW_LINE>// It was not blinked, use the standard method<NEW_LINE>enchantment = game.getPermanentOrLKIBattlefield(source.getSourceId());<NEW_LINE>}<NEW_LINE>if (enchantment != null) {<NEW_LINE>Player enchantedPlayer = game.getPlayer(enchantment.getAttachedTo());<NEW_LINE>if (enchantedPlayer != null) {<NEW_LINE>Set<UUID> players = new HashSet<>();<NEW_LINE>for (UUID attacker : game.getCombat().getAttackers()) {<NEW_LINE>UUID defender = game.getCombat().getDefenderId(attacker);<NEW_LINE>if (defender.equals(enchantedPlayer.getId()) && game.getPlayer(source.getControllerId()).hasOpponent(game.getPermanent(attacker).getControllerId(), game)) {<NEW_LINE>players.add(game.getPermanent(attacker).getControllerId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>players.<MASK><NEW_LINE>for (UUID player : players) {<NEW_LINE>game.getPlayer(player);<NEW_LINE>Effect effect = new GainLifeTargetEffect(2);<NEW_LINE>effect.setTargetPointer(new FixedTarget(player));<NEW_LINE>effect.apply(game, source);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | add(source.getControllerId()); |
1,676,775 | public void shutdownCleanup() {<NEW_LINE>Utils.setConfigBoolean("file.overwrite", configOverwriteCheckbox.isSelected());<NEW_LINE>Utils.setConfigInteger("threads.size", Integer.parseInt(configThreadsText.getText()));<NEW_LINE>Utils.setConfigInteger("download.retries", Integer.parseInt(configRetriesText.getText()));<NEW_LINE>Utils.setConfigInteger("download.timeout", Integer.parseInt(configTimeoutText.getText()));<NEW_LINE>Utils.setConfigBoolean("clipboard.autorip", ClipboardUtils.getClipboardAutoRip());<NEW_LINE>Utils.setConfigBoolean("auto.update", configAutoupdateCheckbox.isSelected());<NEW_LINE>Utils.setConfigString("log.level", configLogLevelCombobox.getSelectedItem().toString());<NEW_LINE>Utils.setConfigBoolean("play.sound", configPlaySound.isSelected());<NEW_LINE>Utils.setConfigBoolean("download.save_order", configSaveOrderCheckbox.isSelected());<NEW_LINE>Utils.setConfigBoolean("download.show_popup", configShowPopup.isSelected());<NEW_LINE>Utils.setConfigBoolean("log.save", configSaveLogs.isSelected());<NEW_LINE>Utils.setConfigBoolean("urls_only.save", configSaveURLsOnly.isSelected());<NEW_LINE>Utils.setConfigBoolean("album_titles.save", configSaveAlbumTitles.isSelected());<NEW_LINE>Utils.setConfigBoolean(<MASK><NEW_LINE>Utils.setConfigBoolean("descriptions.save", configSaveDescriptions.isSelected());<NEW_LINE>Utils.setConfigBoolean("prefer.mp4", configPreferMp4.isSelected());<NEW_LINE>saveWindowPosition(mainFrame);<NEW_LINE>saveHistory();<NEW_LINE>Utils.saveConfig();<NEW_LINE>} | "clipboard.autorip", configClipboardAutorip.isSelected()); |
184,327 | private CompletableFuture<List<Map<String, Object>>> executeAsPartOfBatch(DataFetchingEnvironment environment, List<BoundQuery> queries, Exception buildException, OperationDefinition operation) {<NEW_LINE>int selections = environment.getOperationDefinition().getSelectionSet().getSelections().size();<NEW_LINE>StargateGraphqlContext context = environment.getContext();<NEW_LINE>StargateGraphqlContext.BatchContext batchContext = context.getBatchContext();<NEW_LINE>if (environment.getArgument("options") != null && !batchContext.setParameters(buildParameters(environment))) {<NEW_LINE>buildException = new GraphQLException("options can only de defined once in an @atomic mutation selection");<NEW_LINE>}<NEW_LINE>if (buildException != null) {<NEW_LINE>batchContext.setExecutionResult(buildException);<NEW_LINE>} else if (batchContext.add(queries) == selections) {<NEW_LINE>// All the statements were added successfully and this is the last selection<NEW_LINE>batchContext.setExecutionResult(context.getDataStore().batch(batchContext.getQueries(), __ -> batchContext.getParameters()));<NEW_LINE>}<NEW_LINE>List<Map<String, Object>> values = environment.getArgument("values");<NEW_LINE>if (containsDirective(operation, ASYNC_DIRECTIVE)) {<NEW_LINE>// does not wait for the batch execution result, return the accepted response for all values<NEW_LINE>// immediately<NEW_LINE>return toListOfMutationResultsAccepted(values);<NEW_LINE>} else {<NEW_LINE>return batchContext.getExecutionFuture().thenApply(rows <MASK><NEW_LINE>}<NEW_LINE>} | -> toBatchResults(rows, values)); |
1,254,610 | // ===================================================================================<NEW_LINE>// Source<NEW_LINE>// ======<NEW_LINE>@Override<NEW_LINE>public Map<String, Object> toSource() {<NEW_LINE>Map<String, Object> sourceMap = new HashMap<>();<NEW_LINE>if (createdBy != null) {<NEW_LINE>addFieldToSource(sourceMap, "createdBy", createdBy);<NEW_LINE>}<NEW_LINE>if (createdTime != null) {<NEW_LINE>addFieldToSource(sourceMap, "createdTime", createdTime);<NEW_LINE>}<NEW_LINE>if (excludedPaths != null) {<NEW_LINE>addFieldToSource(sourceMap, "excludedPaths", excludedPaths);<NEW_LINE>}<NEW_LINE>if (includedPaths != null) {<NEW_LINE>addFieldToSource(sourceMap, "includedPaths", includedPaths);<NEW_LINE>}<NEW_LINE>if (name != null) {<NEW_LINE>addFieldToSource(sourceMap, "name", name);<NEW_LINE>}<NEW_LINE>if (permissions != null) {<NEW_LINE>addFieldToSource(sourceMap, "permissions", permissions);<NEW_LINE>}<NEW_LINE>if (sortOrder != null) {<NEW_LINE>addFieldToSource(sourceMap, "sortOrder", sortOrder);<NEW_LINE>}<NEW_LINE>if (updatedBy != null) {<NEW_LINE>addFieldToSource(sourceMap, "updatedBy", updatedBy);<NEW_LINE>}<NEW_LINE>if (updatedTime != null) {<NEW_LINE>addFieldToSource(sourceMap, "updatedTime", updatedTime);<NEW_LINE>}<NEW_LINE>if (value != null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>if (virtualHost != null) {<NEW_LINE>addFieldToSource(sourceMap, "virtualHost", virtualHost);<NEW_LINE>}<NEW_LINE>return sourceMap;<NEW_LINE>} | addFieldToSource(sourceMap, "value", value); |
636,383 | public static boolean isWildFlyServlet(File serverPath) {<NEW_LINE>// NOI18N<NEW_LINE>assert serverPath != null : "Can't determine version with null server path";<NEW_LINE>String productConf = getProductConf(serverPath);<NEW_LINE>if (productConf != null) {<NEW_LINE>File productConfFile = new File(productConf);<NEW_LINE>if (productConfFile.exists() && productConfFile.canRead()) {<NEW_LINE>try (FileReader reader = new FileReader(productConf)) {<NEW_LINE>Properties props = new Properties();<NEW_LINE>props.load(reader);<NEW_LINE>String slot = props.getProperty("slot");<NEW_LINE>if (slot != null) {<NEW_LINE>File manifestFile = new File(serverPath, getModulesBase(serverPath.getAbsolutePath()) + "org.jboss.as.product".replace('.', separatorChar) + separatorChar + slot + separatorChar + "dir" + separatorChar + "META-INF" + separatorChar + "MANIFEST.MF");<NEW_LINE>InputStream stream = new FileInputStream(manifestFile);<NEW_LINE><MASK><NEW_LINE>String productName = manifest.getMainAttributes().getValue("JBoss-Product-Release-Name");<NEW_LINE>if (productName == null || productName.isEmpty()) {<NEW_LINE>productName = manifest.getMainAttributes().getValue("JBoss-Project-Release-Name");<NEW_LINE>}<NEW_LINE>return productName != null && (productName.contains("WildFly Web Lite") || productName.contains("WildFly Servlet"));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.log(Level.INFO, "Can't determine version", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | Manifest manifest = new Manifest(stream); |
1,276,778 | private List<URL> reverseSourceRootsInOrder(CompilationInfo info, URL thisSourceRoot, FileObject thisSourceRootFO, Map<URL, List<URL>> sourceDeps, Map<URL, List<URL>> binaryDeps, Map<URL, List<URL>> rootPeers, boolean interactive) {<NEW_LINE>if (reverseSourceRootsInOrderOverride != null) {<NEW_LINE>return reverseSourceRootsInOrderOverride;<NEW_LINE>}<NEW_LINE>final Set<URL> sourceRootsSet = new HashSet<>();<NEW_LINE>if (sourceDeps.containsKey(thisSourceRoot)) {<NEW_LINE>sourceRootsSet.addAll(findReverseSourceRoots(thisSourceRoot, sourceDeps, rootPeers, info.getFileObject()));<NEW_LINE>}<NEW_LINE>for (URL binary : findBinaryRootsForSourceRoot(thisSourceRootFO, binaryDeps)) {<NEW_LINE>final List<URL> deps = binaryDeps.get(binary);<NEW_LINE>if (deps != null) {<NEW_LINE>sourceRootsSet.addAll(deps);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<URL> sourceRoots;<NEW_LINE>try {<NEW_LINE>sourceRoots = new LinkedList<URL>(Utilities.topologicalSort(sourceDeps<MASK><NEW_LINE>} catch (TopologicalSortException ex) {<NEW_LINE>if (interactive) {<NEW_LINE>Exceptions.attachLocalizedMessage(ex, NbBundle.getMessage(GoToImplementation.class, "ERR_CycleInDependencies"));<NEW_LINE>Exceptions.printStackTrace(ex);<NEW_LINE>} else {<NEW_LINE>LOG.log(Level.FINE, null, ex);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>sourceRoots.retainAll(sourceRootsSet);<NEW_LINE>Collections.reverse(sourceRoots);<NEW_LINE>return sourceRoots;<NEW_LINE>} | .keySet(), sourceDeps)); |
466,120 | private static Optional<ClusterStateReason> clusterDownReason(final ClusterState state, final Params params) {<NEW_LINE>final ContentCluster cluster = params.cluster;<NEW_LINE>final long upStorageCount = countAvailableNodesOfType(NodeType.STORAGE, cluster, state);<NEW_LINE>final long upDistributorCount = countAvailableNodesOfType(NodeType.DISTRIBUTOR, cluster, state);<NEW_LINE>// There's a 1-1 relationship between distributors and storage nodes, so don't need to<NEW_LINE>// keep track of separate node counts for computing availability ratios.<NEW_LINE>final long nodeCount = cluster.getConfiguredNodes().size();<NEW_LINE>if (upStorageCount < params.minStorageNodesUp) {<NEW_LINE>return Optional.of(ClusterStateReason.TOO_FEW_STORAGE_NODES_AVAILABLE);<NEW_LINE>}<NEW_LINE>if (upDistributorCount < params.minDistributorNodesUp) {<NEW_LINE>return Optional.of(ClusterStateReason.TOO_FEW_DISTRIBUTOR_NODES_AVAILABLE);<NEW_LINE>}<NEW_LINE>if (params.minRatioOfStorageNodesUp * nodeCount > upStorageCount) {<NEW_LINE>return <MASK><NEW_LINE>}<NEW_LINE>if (params.minRatioOfDistributorNodesUp * nodeCount > upDistributorCount) {<NEW_LINE>return Optional.of(ClusterStateReason.TOO_LOW_AVAILABLE_DISTRIBUTOR_NODE_RATIO);<NEW_LINE>}<NEW_LINE>return Optional.empty();<NEW_LINE>} | Optional.of(ClusterStateReason.TOO_LOW_AVAILABLE_STORAGE_NODE_RATIO); |
1,698,963 | public void apply(final Traversal.Admin<?, ?> traversal) {<NEW_LINE>if (traversal.getEngine().isComputer())<NEW_LINE>return;<NEW_LINE>final Step<?, ?> startStep = traversal.getStartStep();<NEW_LINE>if (startStep instanceof GraphStep) {<NEW_LINE>final GraphStep<?> originalGraphStep = (GraphStep) startStep;<NEW_LINE>if (originalGraphStep.getIds() == null || originalGraphStep.getIds().length == 0) {<NEW_LINE>// Try to optimize for index calls<NEW_LINE>final TitanGraphStep<?> titanGraphStep = new TitanGraphStep<>(originalGraphStep);<NEW_LINE>TraversalHelper.replaceStep(startStep<MASK><NEW_LINE>HasStepFolder.foldInHasContainer(titanGraphStep, traversal);<NEW_LINE>HasStepFolder.foldInOrder(titanGraphStep, traversal, traversal, titanGraphStep.returnsVertex());<NEW_LINE>HasStepFolder.foldInRange(titanGraphStep, traversal);<NEW_LINE>} else {<NEW_LINE>// Make sure that any provided "start" elements are instantiated in the current transaction<NEW_LINE>Object[] ids = originalGraphStep.getIds();<NEW_LINE>ElementUtils.verifyArgsMustBeEitherIdorElement(ids);<NEW_LINE>if (ids[0] instanceof Element) {<NEW_LINE>// GraphStep constructor ensures that the entire array is elements<NEW_LINE>final Object[] elementIds = new Object[ids.length];<NEW_LINE>for (int i = 0; i < ids.length; i++) {<NEW_LINE>elementIds[i] = ((Element) ids[i]).id();<NEW_LINE>}<NEW_LINE>originalGraphStep.setIteratorSupplier(() -> (Iterator) (originalGraphStep.returnsVertex() ? originalGraphStep.getTraversal().getGraph().get().vertices(elementIds) : originalGraphStep.getTraversal().getGraph().get().edges(elementIds)));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | , (Step) titanGraphStep, traversal); |
1,218,395 | private boolean handleStart(PFSProvider pfsElement) {<NEW_LINE>print("GL Handle 'Start' command:", EMsgType.INFO);<NEW_LINE>if (writeUsb(CMD_GLUC)) {<NEW_LINE>print(" [Prefix]", EMsgType.FAIL);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>print(" [Prefix]", EMsgType.PASS);<NEW_LINE>if (writeUsb(CMD_NSPData)) {<NEW_LINE>print(" [Command]", EMsgType.FAIL);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (writeUsb(pfsElement.getBytesCountOfNca())) {<NEW_LINE>print(" [Sub-files count]", EMsgType.FAIL);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>print(" [Sub-files count]", EMsgType.PASS);<NEW_LINE>int ncaCount = pfsElement.getIntCountOfNca();<NEW_LINE>print(" [Information for " + ncaCount + " sub-files]", EMsgType.INFO);<NEW_LINE>for (int i = 0; i < ncaCount; i++) {<NEW_LINE>print("File #" + i, EMsgType.INFO);<NEW_LINE>if (writeUsb(pfsElement.getNca(i).getNcaFileNameLength())) {<NEW_LINE>print(" [1/4] Name length", EMsgType.FAIL);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>print(" [1/4] Name length", EMsgType.PASS);<NEW_LINE>if (writeUsb(pfsElement.getNca(i).getNcaFileName())) {<NEW_LINE>print(" [2/4] Name", EMsgType.FAIL);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>print(" [2/4] Name", EMsgType.PASS);<NEW_LINE>if (writeUsb(ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(pfsElement.getBodySize() + pfsElement.getNca(i).getNcaOffset()).array())) {<NEW_LINE>// offset. real.<NEW_LINE>print(" [3/4] Offset", EMsgType.FAIL);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>print(" [3/4] Offset", EMsgType.PASS);<NEW_LINE>if (writeUsb(ByteBuffer.allocate(8).order(ByteOrder.LITTLE_ENDIAN).putLong(pfsElement.getNca(i).getNcaSize()).array())) {<NEW_LINE>// size<NEW_LINE>print(" [4/4] Size", EMsgType.FAIL);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>print(" [4/4] Size", EMsgType.PASS);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | print(" [Command]", EMsgType.PASS); |
81,474 | protected void dropCorruptMarkerFiles(Terminal terminal, Path path, Directory directory, boolean clean) throws IOException {<NEW_LINE>if (clean) {<NEW_LINE>confirm("This shard has been marked as corrupted but no corruption can now be detected.\n" + "This may indicate an intermittent hardware problem. The corruption marker can be \n" + "removed, but there is a risk that data has been undetectably lost.\n\n" + "Are you taking a risk of losing documents and proceed with removing a corrupted marker ?", terminal);<NEW_LINE>}<NEW_LINE>String[<MASK><NEW_LINE>boolean found = false;<NEW_LINE>for (String file : files) {<NEW_LINE>if (file.startsWith(Store.CORRUPTED_MARKER_NAME_PREFIX)) {<NEW_LINE>directory.deleteFile(file);<NEW_LINE>terminal.println("Deleted corrupt marker " + file + " from " + path);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ] files = directory.listAll(); |
254,668 | public void paintTrack(Graphics g) {<NEW_LINE>boolean enabled = slider.isEnabled();<NEW_LINE>float tw = UIScale.scale((float) trackWidth);<NEW_LINE>float arc = tw;<NEW_LINE>RoundRectangle2D coloredTrack = null;<NEW_LINE>RoundRectangle2D track;<NEW_LINE>if (slider.getOrientation() == JSlider.HORIZONTAL) {<NEW_LINE>float y = trackRect.y + (trackRect.height - tw) / 2f;<NEW_LINE>if (enabled && isRoundThumb()) {<NEW_LINE>if (slider.getComponentOrientation().isLeftToRight()) {<NEW_LINE>int cw = thumbRect.x + (thumbRect.width / 2) - trackRect.x;<NEW_LINE>coloredTrack = new RoundRectangle2D.Float(trackRect.x, y, cw, tw, arc, arc);<NEW_LINE>track = new RoundRectangle2D.Float(trackRect.x + cw, y, trackRect.width - cw, tw, arc, arc);<NEW_LINE>} else {<NEW_LINE>int cw = trackRect.x + trackRect.width - thumbRect.x - (thumbRect.width / 2);<NEW_LINE>coloredTrack = new RoundRectangle2D.Float(trackRect.x + trackRect.width - cw, y, <MASK><NEW_LINE>track = new RoundRectangle2D.Float(trackRect.x, y, trackRect.width - cw, tw, arc, arc);<NEW_LINE>}<NEW_LINE>} else<NEW_LINE>track = new RoundRectangle2D.Float(trackRect.x, y, trackRect.width, tw, arc, arc);<NEW_LINE>} else {<NEW_LINE>float x = trackRect.x + (trackRect.width - tw) / 2f;<NEW_LINE>if (enabled && isRoundThumb()) {<NEW_LINE>int ch = thumbRect.y + (thumbRect.height / 2) - trackRect.y;<NEW_LINE>track = new RoundRectangle2D.Float(x, trackRect.y, tw, ch, arc, arc);<NEW_LINE>coloredTrack = new RoundRectangle2D.Float(x, trackRect.y + ch, tw, trackRect.height - ch, arc, arc);<NEW_LINE>} else<NEW_LINE>track = new RoundRectangle2D.Float(x, trackRect.y, tw, trackRect.height, arc, arc);<NEW_LINE>}<NEW_LINE>if (coloredTrack != null) {<NEW_LINE>if (slider.getInverted()) {<NEW_LINE>RoundRectangle2D temp = track;<NEW_LINE>track = coloredTrack;<NEW_LINE>coloredTrack = temp;<NEW_LINE>}<NEW_LINE>g.setColor(getTrackValueColor());<NEW_LINE>((Graphics2D) g).fill(coloredTrack);<NEW_LINE>}<NEW_LINE>g.setColor(enabled ? getTrackColor() : disabledTrackColor);<NEW_LINE>((Graphics2D) g).fill(track);<NEW_LINE>} | cw, tw, arc, arc); |
626,520 | public List<MetricsConfigBean> fromJson(String payload) {<NEW_LINE>if (StringUtils.isEmpty(payload)) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>List<MetricsConfigBean> configs = new ArrayList<>();<NEW_LINE>JsonParser parser = new JsonParser();<NEW_LINE>JsonObject jsonObj = (JsonObject) parser.parse(payload);<NEW_LINE>JsonArray <MASK><NEW_LINE>for (int i = 0; i < arrayOfUrls.size(); i++) {<NEW_LINE>JsonObject urlObj = arrayOfUrls.get(i).getAsJsonObject();<NEW_LINE>MetricsConfigBean urlConfig = new MetricsConfigBean();<NEW_LINE>urlConfig.setSpecs(new ArrayList<>());<NEW_LINE>urlConfig.setTitle(urlObj.get("title").getAsString());<NEW_LINE>urlConfig.setUrl(urlObj.get("url").getAsString());<NEW_LINE>JsonArray arrayOfSpecs = urlObj.get("specs").getAsJsonArray();<NEW_LINE>for (int j = 0; j < arrayOfSpecs.size(); j++) {<NEW_LINE>JsonObject specObj = arrayOfSpecs.get(j).getAsJsonObject();<NEW_LINE>MetricsSpecBean spec = new MetricsSpecBean();<NEW_LINE>spec.setColor(specObj.get("color").getAsString());<NEW_LINE>spec.setMax(Double.parseDouble(specObj.get("max").getAsString()));<NEW_LINE>spec.setMin(Double.parseDouble(specObj.get("min").getAsString()));<NEW_LINE>urlConfig.getSpecs().add(spec);<NEW_LINE>}<NEW_LINE>configs.add(urlConfig);<NEW_LINE>}<NEW_LINE>return configs;<NEW_LINE>} | arrayOfUrls = jsonObj.getAsJsonArray("urlMetricsData"); |
1,124,405 | public JSONObject serviceImpl(Query post, HttpServletResponse response, Authorization rights, JSONObjectWithDefault permissions) throws APIException {<NEW_LINE>if (post.isLocalhostAccess() && OS.canExecUnix && post.get("upgrade", "").equals("true")) {<NEW_LINE>// it's a hack to add this here, this may disappear anytime<NEW_LINE>Caretaker.upgrade();<NEW_LINE>}<NEW_LINE>post.setResponse(response, "application/javascript");<NEW_LINE>// generate json<NEW_LINE>Runtime runtime = Runtime.getRuntime();<NEW_LINE>JSONObject json = new JSONObject(true);<NEW_LINE>JSONObject system = null;<NEW_LINE>JSONObject index = null;<NEW_LINE>try {<NEW_LINE>system = getConfig(runtime);<NEW_LINE>index = getIndexConfig();<NEW_LINE>} catch (Exception e) {<NEW_LINE>DAO.trace(e);<NEW_LINE>}<NEW_LINE>JSONObject client_info = new JSONObject(true);<NEW_LINE>client_info.put("RemoteHost", post.getClientHost());<NEW_LINE>client_info.put("IsLocalhost", post.isLocalhostAccess() ? "true" : "false");<NEW_LINE>JSONObject request_header = new JSONObject(true);<NEW_LINE>Enumeration<String> he = post.getRequest().getHeaderNames();<NEW_LINE>while (he.hasMoreElements()) {<NEW_LINE>String h = he.nextElement();<NEW_LINE>request_header.put(h, post.getRequest().getHeader(h));<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>json.put("system", system);<NEW_LINE>json.put("index", index);<NEW_LINE>json.put("client_info", client_info);<NEW_LINE>String commitHash = System.getenv("COMMIT_HASH");<NEW_LINE>String commitComment = System.getenv("COMMIT_COMMENT");<NEW_LINE>if (commitComment != null)<NEW_LINE>commitComment = commitComment.replaceAll("^[ \n]+", "").replaceAll("[ \n]+$", "");<NEW_LINE>JSONObject commit = new JSONObject(true);<NEW_LINE>commit.put("hash", commitHash);<NEW_LINE>commit.put("comment", commitComment);<NEW_LINE>json.put("commit", commit);<NEW_LINE>json.put("stream_enabled", DAO.getConfig("stream.enabled", false));<NEW_LINE>return json;<NEW_LINE>} | client_info.put("request_header", request_header); |
288,572 | public void run() {<NEW_LINE>try {<NEW_LINE>while (true && !Thread.interrupted()) {<NEW_LINE>if (!this.subscribedTopics.isEmpty()) {<NEW_LINE>this.consumerSubscriptionRebalance();<NEW_LINE>}<NEW_LINE>final ConsumerRecords<String, String> records = this.consumer.poll(10000);<NEW_LINE>final Record recordToProcess = null;<NEW_LINE>for (final ConsumerRecord<String, String> record : records) {<NEW_LINE>try {<NEW_LINE>final String payload = record.value();<NEW_LINE>final Set<String> matchedList = this.depInstances.regexInTopic(<MASK><NEW_LINE>if (!matchedList.isEmpty()) {<NEW_LINE>this.triggerDependencies(matchedList, record);<NEW_LINE>}<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>log.error("failure when parsing record " + recordToProcess, ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!this.subscribedTopics.isEmpty()) {<NEW_LINE>this.consumerSubscriptionRebalance();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>log.error("failure when consuming kafka events", ex);<NEW_LINE>} finally {<NEW_LINE>// Failed to send SSL Close message.<NEW_LINE>this.consumer.close();<NEW_LINE>log.info("kafka consumer closed...");<NEW_LINE>}<NEW_LINE>} | record.topic(), payload); |
902,213 | synchronized void replaceProgress(int id, int progressMax, int progress, boolean indeterminate, String message) {<NEW_LINE>Entry oldEntry = allActiveMessages.get(id);<NEW_LINE>if (oldEntry == null) {<NEW_LINE>Log.w(TAG, "Failed to replace notification, it was not found");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (message == null) {<NEW_LINE>message = oldEntry.contentText;<NEW_LINE>}<NEW_LINE>Entry newEntry = new Entry(oldEntry.title, message, oldEntry.channelId, oldEntry.iconRes, oldEntry.id, progressMax, progress, indeterminate);<NEW_LINE>if (oldEntry.equals(newEntry)) {<NEW_LINE>Log.d(TAG, String<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Log.i(TAG, String.format("handleReplace() %s", newEntry));<NEW_LINE>allActiveMessages.put(newEntry.id, newEntry);<NEW_LINE>updateNotification();<NEW_LINE>} | .format("handleReplace() skip, no change %s", newEntry)); |
309,827 | final GetBranchResult executeGetBranch(GetBranchRequest getBranchRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getBranchRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetBranchRequest> request = null;<NEW_LINE>Response<GetBranchResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetBranchRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getBranchRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Amplify");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetBranch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetBranchResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetBranchResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
1,571,296 | private void initToolWindowListeners() {<NEW_LINE>myProject.getMessageBus().connect().subscribe(RunManagerListener.TOPIC, new RunManagerListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void runConfigurationAdded(@Nonnull RunnerAndConfigurationSettings settings) {<NEW_LINE>updateDashboardIfNeeded(settings);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void runConfigurationRemoved(@Nonnull RunnerAndConfigurationSettings settings) {<NEW_LINE>updateDashboardIfNeeded(settings);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void runConfigurationChanged(@Nonnull RunnerAndConfigurationSettings settings) {<NEW_LINE>updateDashboardIfNeeded(settings);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>MessageBusConnection connection = myProject.getMessageBus().connect(myProject);<NEW_LINE>connection.subscribe(ExecutionManager.EXECUTION_TOPIC, new ExecutionListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void processStarted(@Nonnull String executorId, @Nonnull ExecutionEnvironment env, @Nonnull final ProcessHandler handler) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void processTerminated(@Nonnull String executorId, @Nonnull ExecutionEnvironment env, @Nonnull ProcessHandler handler, int exitCode) {<NEW_LINE>updateDashboardIfNeeded(env.getRunnerAndConfigurationSettings());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>connection.subscribe(RunDashboardManager.DASHBOARD_TOPIC, new DashboardListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void contentChanged(boolean withStructure) {<NEW_LINE>updateDashboard(withStructure);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>connection.subscribe(DumbService.DUMB_MODE, new DumbService.DumbModeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void enteredDumbMode() {<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void exitDumbMode() {<NEW_LINE>updateDashboard(false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | updateDashboardIfNeeded(env.getRunnerAndConfigurationSettings()); |
350,517 | // @see com.biglybt.ui.swt.views.table.TableCellSWTPaintListener#cellPaint(org.eclipse.swt.graphics.GC, com.biglybt.ui.swt.views.table.TableCellSWT)<NEW_LINE>@Override<NEW_LINE>public void cellPaint(GC gcImage, TableCellSWT cell) {<NEW_LINE>int percentDone = getPercentDone(cell);<NEW_LINE>Rectangle bounds = cell.getBounds();<NEW_LINE>int yOfs = (bounds.height - 13) / 2;<NEW_LINE>int x1 = bounds.width - borderWidth - 2;<NEW_LINE>int y1 = bounds.height - 3 - yOfs;<NEW_LINE>if (x1 < 10 || y1 < 3) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int textYofs = 0;<NEW_LINE>if (y1 >= 28) {<NEW_LINE>yOfs = 2;<NEW_LINE>y1 = 16;<NEW_LINE>// textYofs = yOfs;<NEW_LINE>}<NEW_LINE>mapCellLastPercentDone.put(cell, new Integer(percentDone));<NEW_LINE>ImageLoader imageLoader = ImageLoader.getInstance();<NEW_LINE>Image imgEnd = imageLoader.getImage("dl_bar_end");<NEW_LINE>Image img0 = imageLoader.getImage("dl_bar_0");<NEW_LINE>Image img1 = imageLoader.getImage(percentDone < 1000 ? "dl_bar_1" : "dl_bar_1g");<NEW_LINE>// draw begining and end<NEW_LINE>if (!imgEnd.isDisposed()) {<NEW_LINE>gcImage.drawImage(imgEnd, bounds.x, bounds.y + yOfs);<NEW_LINE>gcImage.drawImage(imgEnd, bounds.x + x1 + 1, bounds.y + yOfs);<NEW_LINE>}<NEW_LINE>// draw border<NEW_LINE>// Color fg = gcImage.getForeground();<NEW_LINE>// gcImage.setForeground(Colors.grey);<NEW_LINE>// gcImage.drawRectangle(bounds.x, bounds.y + yOfs, x1 + 1, y1 + 1);<NEW_LINE>// gcImage.setForeground(fg);<NEW_LINE>int limit = (x1 * percentDone) / 1000;<NEW_LINE>if (!img1.isDisposed() && limit > 0) {<NEW_LINE><MASK><NEW_LINE>gcImage.drawImage(img1, 0, 0, imgBounds.width, imgBounds.height, bounds.x + 1, bounds.y + yOfs, limit, imgBounds.height);<NEW_LINE>}<NEW_LINE>if (percentDone < 1000 && !img0.isDisposed()) {<NEW_LINE>Rectangle imgBounds = img0.getBounds();<NEW_LINE>gcImage.drawImage(img0, 0, 0, imgBounds.width, imgBounds.height, bounds.x + limit + 1, bounds.y + yOfs, x1 - limit, imgBounds.height);<NEW_LINE>}<NEW_LINE>imageLoader.releaseImage("dl_bar_end");<NEW_LINE>imageLoader.releaseImage("dl_bar_0");<NEW_LINE>imageLoader.releaseImage("dl_bar_1");<NEW_LINE>// gcImage.setBackground(Colors.blues[Colors.BLUES_DARKEST]);<NEW_LINE>// gcImage.fillRectangle(bounds.x + 1, bounds.y + 1 + yOfs, limit, y1);<NEW_LINE>// if (limit < x1) {<NEW_LINE>// gcImage.setBackground(Colors.blues[Colors.BLUES_LIGHTEST]);<NEW_LINE>// gcImage.fillRectangle(bounds.x + limit + 1, bounds.y + 1 + yOfs, x1<NEW_LINE>// - limit, y1);<NEW_LINE>// }<NEW_LINE>if (textColor == null) {<NEW_LINE>textColor = ColorCache.getColor(gcImage.getDevice(), "#005ACF");<NEW_LINE>}<NEW_LINE>// if (textYofs == 0) {<NEW_LINE>// if (fontText == null) {<NEW_LINE>// fontText = Utils.getFontWithHeight(gcImage.getFont(), gcImage, y1);<NEW_LINE>// }<NEW_LINE>// gcImage.setFont(fontText);<NEW_LINE>gcImage.setForeground(textColor);<NEW_LINE>// }<NEW_LINE>String sPercent = DisplayFormatters.formatPercentFromThousands(percentDone);<NEW_LINE>GCStringPrinter.printString(gcImage, sPercent, new Rectangle(bounds.x + 4, bounds.y + yOfs, bounds.width - 4, 13), true, false, SWT.CENTER);<NEW_LINE>} | Rectangle imgBounds = img1.getBounds(); |
1,813,174 | public CodegenExpression make(CodegenMethodScope parent, CodegenClassScope classScope) {<NEW_LINE>CodegenMethod method = parent.makeChild(QueryPlanIndexItem.EPTYPE, this.getClass(), classScope);<NEW_LINE>EventPropertyGetterSPI[] propertyGetters = EventTypeUtility.getGetters(eventType, hashProps);<NEW_LINE>EPType[] propertyTypes = EventTypeUtility.getPropertyTypesEPType(eventType, hashProps);<NEW_LINE>CodegenExpression valueGetter = MultiKeyCodegen.codegenGetterMayMultiKey(eventType, propertyGetters, propertyTypes, hashTypes, hashMultiKeyClasses, method, classScope);<NEW_LINE>CodegenExpression rangeGetters;<NEW_LINE>if (rangeProps.length == 0) {<NEW_LINE>rangeGetters = newArrayByLength(EventPropertyValueGetter.EPTYPE, constant(0));<NEW_LINE>} else {<NEW_LINE>CodegenMethod makeMethod = parent.makeChild(EventPropertyValueGetter.EPTYPEARRAY, this.getClass(), classScope);<NEW_LINE>makeMethod.getBlock().declareVar(EventPropertyValueGetter.EPTYPEARRAY, "getters", newArrayByLength(EventPropertyValueGetter.EPTYPE, constant(rangeProps.length)));<NEW_LINE>for (int i = 0; i < rangeProps.length; i++) {<NEW_LINE>EventPropertyGetterSPI getter = ((EventTypeSPI) eventType).getGetterSPI(rangeProps[i]);<NEW_LINE>EPType getterType = eventType.getPropertyEPType(rangeProps[i]);<NEW_LINE>EPTypeClass coercionType = rangeTypes == null ? null : rangeTypes[i];<NEW_LINE>CodegenExpression eval = EventTypeUtility.codegenGetterWCoerce(getter, getterType, coercionType, method, this.getClass(), classScope);<NEW_LINE>makeMethod.getBlock().assignArrayElement(ref("getters"), constant(i), eval);<NEW_LINE>}<NEW_LINE>makeMethod.getBlock().methodReturn(ref("getters"));<NEW_LINE>rangeGetters = localMethod(makeMethod);<NEW_LINE>}<NEW_LINE>CodegenExpression multiKeyTransform = MultiKeyCodegen.<MASK><NEW_LINE>method.getBlock().methodReturn(newInstance(QueryPlanIndexItem.EPTYPE, constant(hashProps), constant(hashTypes), valueGetter, multiKeyTransform, hashMultiKeyClasses == null ? constantNull() : hashMultiKeyClasses.getExprMKSerde(method, classScope), constant(rangeProps), constant(rangeTypes), rangeGetters, DataInputOutputSerdeForge.codegenArray(rangeSerdes, method, classScope, null), constant(unique), advancedIndexProvisionDesc == null ? constantNull() : advancedIndexProvisionDesc.codegenMake(method, classScope), stateMgmtSettings.toExpression()));<NEW_LINE>return localMethod(method);<NEW_LINE>} | codegenMultiKeyFromArrayTransform(hashMultiKeyClasses, method, classScope); |
1,841,360 | public void initPermissionColoredColumn(final Table propertyPermissionsTable) {<NEW_LINE>propertyPermissionsTable.addGeneratedColumn("permissionsInfo", new Table.ColumnGenerator<MultiplePermissionTarget>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Component generateCell(MultiplePermissionTarget target) {<NEW_LINE>Label label = AppConfig.getFactory().createComponent(Label.class);<NEW_LINE>JLabel jLabel = (JLabel) DesktopComponentsHelper.unwrap(label);<NEW_LINE>int i = 0;<NEW_LINE>StringBuilder builder = new StringBuilder("<html>");<NEW_LINE>Iterator<AttributeTarget> iterator = target.getPermissions().iterator();<NEW_LINE>while (iterator.hasNext() && i < MultiplePermissionTarget.SHOW_PERMISSIONS_COUNT) {<NEW_LINE>AttributeTarget attributeTarget = iterator.next();<NEW_LINE><MASK><NEW_LINE>if (permissionVariant != AttributePermissionVariant.NOTSET) {<NEW_LINE>if (i < MultiplePermissionTarget.SHOW_PERMISSIONS_COUNT - 1) {<NEW_LINE>if (i > 0)<NEW_LINE>builder.append(", ");<NEW_LINE>builder.append("<font color=\"").append(permissionVariant.getColor()).append("\">").append(attributeTarget.getId()).append("</font>");<NEW_LINE>} else {<NEW_LINE>builder.append(", ...");<NEW_LINE>}<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>builder.append("</html>");<NEW_LINE>jLabel.setText(builder.toString());<NEW_LINE>return label;<NEW_LINE>}<NEW_LINE>}, Label.class);<NEW_LINE>} | AttributePermissionVariant permissionVariant = attributeTarget.getPermissionVariant(); |
1,267,217 | public List<Map<String, Object>> executeFix() throws DotDataException, DotRuntimeException {<NEW_LINE>Logger.info(FixTask00080DeleteOrphanedContentTypeFields.class, "Beginning DeleteOrphanedContentTypeFields");<NEW_LINE>List<Map<String, Object>> returnValue = new ArrayList<Map<String, Object>>();<NEW_LINE>if (!FixAssetsProcessStatus.getRunning()) {<NEW_LINE>HibernateUtil.startTransaction();<NEW_LINE>int total = 0;<NEW_LINE>try {<NEW_LINE>FixAssetsProcessStatus.startProgress();<NEW_LINE>FixAssetsProcessStatus.setDescription("task 80: DeleteOrphanedContentTypeFields");<NEW_LINE>DotConnect dc = new DotConnect();<NEW_LINE>dc.setSQL(VERIFICATION_QUERY);<NEW_LINE>modifiedData = dc.loadResults();<NEW_LINE>total = modifiedData != null ? modifiedData.size() : 0;<NEW_LINE>FixAssetsProcessStatus.setTotal(total);<NEW_LINE>getModifiedData();<NEW_LINE>if (total > 0) {<NEW_LINE>try {<NEW_LINE>HibernateUtil.startTransaction();<NEW_LINE>MaintenanceUtil.deleteOrphanContentTypeFields();<NEW_LINE>HibernateUtil.closeAndCommitTransaction();<NEW_LINE>// Set the number of records that were fixed<NEW_LINE>FixAssetsProcessStatus.setErrorsFixed(modifiedData.size());<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.error(this, "Unable to clean orphaned content type fields.", e);<NEW_LINE>HibernateUtil.rollbackTransaction();<NEW_LINE>modifiedData.clear();<NEW_LINE>}<NEW_LINE>FixAudit Audit = new FixAudit();<NEW_LINE>Audit.setTableName("field");<NEW_LINE>Audit.setDatetime(new Date());<NEW_LINE>Audit.setRecordsAltered(total);<NEW_LINE>Audit.setAction("task 80: DeleteOrphanedContentTypeFields");<NEW_LINE>HibernateUtil.save(Audit);<NEW_LINE>HibernateUtil.closeAndCommitTransaction();<NEW_LINE>MaintenanceUtil.flushCache();<NEW_LINE>returnValue.add(FixAssetsProcessStatus.getFixAssetsMap());<NEW_LINE>Logger.<MASK><NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.debug(FixTask00080DeleteOrphanedContentTypeFields.class, "There was a problem during DeleteOrphanedContentTypeFields", e);<NEW_LINE>HibernateUtil.rollbackTransaction();<NEW_LINE>FixAssetsProcessStatus.setActual(-1);<NEW_LINE>} finally {<NEW_LINE>FixAssetsProcessStatus.stopProgress();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return returnValue;<NEW_LINE>} | debug(FixTask00080DeleteOrphanedContentTypeFields.class, "Ending DeleteOrphanedContentTypeFields"); |
1,670,192 | private void changeRole(PrimaryTerm term) {<NEW_LINE>threadContext.execute(() -> {<NEW_LINE>if (term.term() > currentTerm) {<NEW_LINE>log.debug("Term changed: {}", term);<NEW_LINE>currentTerm = term.term();<NEW_LINE>primary = term.primary() != null ? term.primary().memberId() : null;<NEW_LINE>backups = term.backups(descriptor.backups()).stream().map(GroupMember::memberId).collect(Collectors.toList());<NEW_LINE>if (Objects.equals(primary, clusterMembershipService.getLocalMember().id())) {<NEW_LINE>if (this.role == null) {<NEW_LINE>this.role = new PrimaryRole(this);<NEW_LINE>log.debug("{} transitioning to {}", clusterMembershipService.getLocalMember().id(), Role.PRIMARY);<NEW_LINE>} else if (this.role.role() != Role.PRIMARY) {<NEW_LINE>this.role.close();<NEW_LINE>this.role = new PrimaryRole(this);<NEW_LINE>log.debug("{} transitioning to {}", clusterMembershipService.getLocalMember().id(), Role.PRIMARY);<NEW_LINE>}<NEW_LINE>} else if (backups.contains(clusterMembershipService.getLocalMember().id())) {<NEW_LINE>if (this.role == null) {<NEW_LINE>this.role = new BackupRole(this);<NEW_LINE>log.debug("{} transitioning to {}", clusterMembershipService.getLocalMember().id(), Role.BACKUP);<NEW_LINE>} else if (this.role.role() != Role.BACKUP) {<NEW_LINE>this.role.close();<NEW_LINE>this.role = new BackupRole(this);<NEW_LINE>log.debug("{} transitioning to {}", clusterMembershipService.getLocalMember().id(), Role.BACKUP);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (this.role == null) {<NEW_LINE>this<MASK><NEW_LINE>log.debug("{} transitioning to {}", clusterMembershipService.getLocalMember().id(), Role.NONE);<NEW_LINE>} else if (this.role.role() != Role.NONE) {<NEW_LINE>this.role.close();<NEW_LINE>this.role = new NoneRole(this);<NEW_LINE>log.debug("{} transitioning to {}", clusterMembershipService.getLocalMember().id(), Role.NONE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | .role = new NoneRole(this); |
1,784,337 | public okhttp3.Call addAPIMonetizationCall(String apiId, APIMonetizationInfoDTO apIMonetizationInfoDTO, final ApiCallback _callback) throws ApiException {<NEW_LINE>Object localVarPostBody = apIMonetizationInfoDTO;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/apis/{apiId}/monetize".replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.toString()));<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = 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>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = { "application/json" };<NEW_LINE>final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>String[] localVarAuthNames = new String[] { "OAuth2Security" };<NEW_LINE>return localVarApiClient.buildCall(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, <MASK><NEW_LINE>} | localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.