idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
266,908 | protected boolean isCommonTableSettingsChanged(Element columnsElem) {<NEW_LINE>if (columnsElem == null) {<NEW_LINE>if (defaultSettings != null) {<NEW_LINE>columnsElem = defaultSettings.getRootElement().element("columns");<NEW_LINE>if (columnsElem == null) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>List<Element> settingsColumnList = columnsElem.elements("columns");<NEW_LINE>if (settingsColumnList.size() != component.getVisibleColumns().length) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>Object[] visibleColumns = component.getVisibleColumns();<NEW_LINE>for (int i = 0; i < visibleColumns.length; i++) {<NEW_LINE>Object columnId = visibleColumns[i];<NEW_LINE>Element settingsColumn = settingsColumnList.get(i);<NEW_LINE>String settingsColumnId = settingsColumn.attributeValue("id");<NEW_LINE>if (columnId.toString().equals(settingsColumnId)) {<NEW_LINE>int columnWidth = component.getColumnWidth(columnId);<NEW_LINE>String <MASK><NEW_LINE>int settingColumnWidth = settingsColumnWidth == null ? -1 : Integer.parseInt(settingsColumnWidth);<NEW_LINE>if (columnWidth != settingColumnWidth) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>boolean columnVisible = !component.isColumnCollapsed(columnId);<NEW_LINE>boolean settingsColumnVisible = Boolean.parseBoolean(settingsColumn.attributeValue("visible"));<NEW_LINE>if (columnVisible != settingsColumnVisible) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | settingsColumnWidth = settingsColumn.attributeValue("width"); |
317,463 | private Mono<Response<FeatureResultInner>> registerWithResponseAsync(String resourceProviderNamespace, String featureName, 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 (resourceProviderNamespace == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceProviderNamespace is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (featureName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter featureName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String accept = "application/json, text/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.register(this.client.getEndpoint(), resourceProviderNamespace, featureName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
800,465 | public void execute(DelegateExecution execution) throws Exception {<NEW_LINE>Date now = new Date();<NEW_LINE>List<String> serializable = new ArrayList<String>();<NEW_LINE>serializable.add("seven");<NEW_LINE>serializable.add("eight");<NEW_LINE>serializable.add("nine");<NEW_LINE>List<Date> dateList = new ArrayList<Date>();<NEW_LINE>dateList.add(new Date());<NEW_LINE>dateList.add(new Date());<NEW_LINE>dateList.add(new Date());<NEW_LINE>List<CockpitVariable> cockpitVariableList = new ArrayList<CockpitVariable>();<NEW_LINE>cockpitVariableList.add(new CockpitVariable("foo", "bar"));<NEW_LINE>cockpitVariableList.add(new CockpitVariable("foo2", "bar"));<NEW_LINE>cockpitVariableList.add(new CockpitVariable("foo3", "bar"));<NEW_LINE>byte[] bytes = "someAnotherBytes".getBytes();<NEW_LINE>FailingSerializable failingSerializable = new FailingSerializable();<NEW_LINE>Map<String, Integer> mapVariable = new HashMap<String, Integer>();<NEW_LINE>Map<String, Object> variables = new HashMap<String, Object>();<NEW_LINE>variables.put("shortVar", (short) 789);<NEW_LINE>variables.put("longVar", 555555L);<NEW_LINE>variables.put("integerVar", 963852);<NEW_LINE>variables.put("floatVar", 55.55);<NEW_LINE>variables.put("doubleVar", 6123.2025);<NEW_LINE>variables.put("trueBooleanVar", true);<NEW_LINE>variables.put("falseBooleanVar", false);<NEW_LINE>variables.put("stringVar", "fanta");<NEW_LINE>variables.put("dateVar", now);<NEW_LINE>variables.put("serializableCollection", serializable);<NEW_LINE>variables.put("bytesVar", bytes);<NEW_LINE>variables.put("value1", "blub");<NEW_LINE>int random = (int) (Math.random() * 100);<NEW_LINE>variables.put("random", random);<NEW_LINE>variables.put("failingSerializable", failingSerializable);<NEW_LINE>variables.put("mapVariable", mapVariable);<NEW_LINE><MASK><NEW_LINE>variables.put("cockpitVariableList", cockpitVariableList);<NEW_LINE>execution.setVariablesLocal(variables);<NEW_LINE>// set JSON variable<NEW_LINE>JsonSerialized jsonSerialized = new JsonSerialized();<NEW_LINE>jsonSerialized.setFoo("bar");<NEW_LINE>execution.setVariable("jsonSerializable", objectValue(jsonSerialized).serializationDataFormat("application/json"));<NEW_LINE>// set JAXB variable<NEW_LINE>JaxBSerialized jaxBSerialized = new JaxBSerialized();<NEW_LINE>jaxBSerialized.setFoo("bar");<NEW_LINE>execution.setVariable("xmlSerializable", objectValue(jaxBSerialized).serializationDataFormat("application/xml"));<NEW_LINE>} | variables.put("dateList", dateList); |
183,190 | void deprioritizeJob(AutoIngestJob job) throws AutoIngestMonitorException {<NEW_LINE>synchronized (jobsLock) {<NEW_LINE>AutoIngestJob jobToDeprioritize = null;<NEW_LINE>for (AutoIngestJob pendingJob : getPendingJobs()) {<NEW_LINE>if (pendingJob.equals(job)) {<NEW_LINE>jobToDeprioritize = job;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (null != jobToDeprioritize) {<NEW_LINE>String manifestNodePath = job.getManifest().getFilePath().toString();<NEW_LINE>try {<NEW_LINE>AutoIngestJobNodeData nodeData = new AutoIngestJobNodeData(coordinationService.getNodeData(CoordinationService.CategoryNode.MANIFESTS, manifestNodePath));<NEW_LINE>nodeData.setPriority(DEFAULT_PRIORITY);<NEW_LINE>coordinationService.setNodeData(CoordinationService.CategoryNode.MANIFESTS, manifestNodePath, nodeData.toArray());<NEW_LINE>} catch (AutoIngestJobNodeData.InvalidDataException | CoordinationServiceException | InterruptedException ex) {<NEW_LINE>throw new AutoIngestMonitorException("Error removing priority for job " + <MASK><NEW_LINE>}<NEW_LINE>jobToDeprioritize.setPriority(DEFAULT_PRIORITY);<NEW_LINE>jobsSnapshot.addOrReplacePendingJob(jobToDeprioritize);<NEW_LINE>final String caseName = job.getManifest().getCaseName();<NEW_LINE>final String dataSourceName = jobToDeprioritize.getManifest().getDataSourceFileName();<NEW_LINE>new Thread(() -> {<NEW_LINE>eventPublisher.publishRemotely(new AutoIngestCasePrioritizedEvent(LOCAL_HOST_NAME, caseName, AutoIngestManager.getSystemUserNameProperty(), AutoIngestCasePrioritizedEvent.EventType.JOB_DEPRIORITIZED, dataSourceName));<NEW_LINE>}).start();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | job.toString(), ex); |
1,374,404 | public void LAPACK_zhegvx(IntBuffer arg0, String arg1, String arg2, String arg3, IntBuffer arg4, DoubleBuffer arg5, IntBuffer arg6, DoubleBuffer arg7, IntBuffer arg8, DoubleBuffer arg9, DoubleBuffer arg10, IntBuffer arg11, IntBuffer arg12, DoubleBuffer arg13, IntBuffer arg14, DoubleBuffer arg15, DoubleBuffer arg16, IntBuffer arg17, DoubleBuffer arg18, IntBuffer arg19, DoubleBuffer arg20, IntBuffer arg21, IntBuffer arg22, IntBuffer arg23) {<NEW_LINE>LAPACK_zhegvx(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, arg17, arg18, arg19, <MASK><NEW_LINE>} | arg20, arg21, arg22, arg23); |
909,353 | private void decorate(Element el, Component cmp) {<NEW_LINE>String classAttr = el.getAttribute("class");<NEW_LINE>if (classAttr != null && classAttr.length() > 0) {<NEW_LINE>String[] tags = Util.split(classAttr, " ");<NEW_LINE>$(cmp).addTags(tags);<NEW_LINE>}<NEW_LINE>String uiid = el.getAttribute("uiid");<NEW_LINE>if (uiid != null && uiid.length() > 0) {<NEW_LINE>cmp.setUIID(uiid);<NEW_LINE>}<NEW_LINE>String id = el.getAttribute("id");<NEW_LINE>if (id != null && id.length() > 0) {<NEW_LINE>index.put(id, cmp);<NEW_LINE>}<NEW_LINE>String name = el.getAttribute("name");<NEW_LINE>if (name != null && name.length() > 0) {<NEW_LINE>cmp.setName(name);<NEW_LINE>}<NEW_LINE>String flags = el.getAttribute("flags");<NEW_LINE>if (flags != null && flags.indexOf("safeArea") >= 0 && (cmp instanceof Container)) {<NEW_LINE>((Container<MASK><NEW_LINE>}<NEW_LINE>} | ) cmp).setSafeArea(true); |
870,792 | final ListClustersResult executeListClusters(ListClustersRequest listClustersRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listClustersRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListClustersRequest> request = null;<NEW_LINE>Response<ListClustersResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListClustersRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Route53 Recovery Control Config");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListClusters");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListClustersResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListClustersResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | (super.beforeMarshalling(listClustersRequest)); |
110,489 | private void preProcessClass(ClassNode cls) {<NEW_LINE>ClassInfo classInfo = cls.getClassInfo();<NEW_LINE>String pkgFullName = classInfo.getPackage();<NEW_LINE>PackageNode pkg = getPackageNode(pkgFullName, true);<NEW_LINE>processPackageFull(pkg, pkgFullName);<NEW_LINE>String alias = deobfPresets.getForCls(classInfo);<NEW_LINE>if (alias != null) {<NEW_LINE>clsMap.put(classInfo, new DeobfClsInfo(this, cls, pkg, alias));<NEW_LINE>} else {<NEW_LINE>if (!clsMap.containsKey(classInfo)) {<NEW_LINE><MASK><NEW_LINE>boolean badName = shouldRename(clsShortName) || (args.isRenameValid() && reservedClsNames.contains(clsShortName));<NEW_LINE>makeClsAlias(cls, badName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (ClassNode innerCls : cls.getInnerClasses()) {<NEW_LINE>preProcessClass(innerCls);<NEW_LINE>}<NEW_LINE>} | String clsShortName = classInfo.getShortName(); |
434,711 | protected List<FunctionSymbol> filterLangLibMethods(List<FunctionSymbol> functions, BType internalType) {<NEW_LINE>Types types = Types.getInstance(this.context);<NEW_LINE>List<FunctionSymbol> filteredFunctions = new ArrayList<>();<NEW_LINE>for (FunctionSymbol function : functions) {<NEW_LINE>List<ParameterSymbol> functionParams = function.typeDescriptor()<MASK><NEW_LINE>if (functionParams.isEmpty()) {<NEW_LINE>// If the function-type-descriptor doesn't have params, then, check for the rest-param<NEW_LINE>Optional<ParameterSymbol> restParamOptional = function.typeDescriptor().restParam();<NEW_LINE>if (restParamOptional.isPresent()) {<NEW_LINE>BArrayType restArrayType = (BArrayType) ((AbstractTypeSymbol) restParamOptional.get().typeDescriptor()).getBType();<NEW_LINE>if (types.isAssignable(internalType, restArrayType.eType)) {<NEW_LINE>filteredFunctions.add(function);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ParameterSymbol firstParam = functionParams.get(0);<NEW_LINE>BType firstParamType = ((AbstractTypeSymbol) firstParam.typeDescriptor()).getBType();<NEW_LINE>if (types.isAssignable(internalType, firstParamType)) {<NEW_LINE>filteredFunctions.add(function);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return filteredFunctions;<NEW_LINE>} | .params().get(); |
1,629,034 | public void execute(CachedClassLoader cachedClassLoader) {<NEW_LINE>ClassLoader classLoader = cachedClassLoader.getClassLoader();<NEW_LINE>Object antBuilder = newInstanceOf("org.gradle.api.internal.project.ant.BasicAntBuilder");<NEW_LINE>Object antLogger = newInstanceOf("org.gradle.api.internal.project.ant.AntLoggingAdapter");<NEW_LINE>// This looks ugly, very ugly, but that is apparently what Ant does itself<NEW_LINE>ClassLoader originalLoader = Thread.currentThread().getContextClassLoader();<NEW_LINE>Thread.<MASK><NEW_LINE>try {<NEW_LINE>configureAntBuilder(antBuilder, antLogger);<NEW_LINE>// Ideally, we'd delegate directly to the AntBuilder, but its Closure class is different to our caller's<NEW_LINE>// Closure class, so the AntBuilder's methodMissing() doesn't work. It just converts our Closures to String<NEW_LINE>// because they are not an instanceof its Closure class.<NEW_LINE>Object delegate = new AntBuilderDelegate(antBuilder, classLoader);<NEW_LINE>ClosureBackedAction.execute(delegate, antClosure);<NEW_LINE>} finally {<NEW_LINE>Thread.currentThread().setContextClassLoader(originalLoader);<NEW_LINE>disposeBuilder(antBuilder, antLogger);<NEW_LINE>}<NEW_LINE>} | currentThread().setContextClassLoader(classLoader); |
1,220,863 | final CreateFlowDefinitionResult executeCreateFlowDefinition(CreateFlowDefinitionRequest createFlowDefinitionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createFlowDefinitionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateFlowDefinitionRequest> request = null;<NEW_LINE>Response<CreateFlowDefinitionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateFlowDefinitionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createFlowDefinitionRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateFlowDefinition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateFlowDefinitionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new CreateFlowDefinitionResultJsonUnmarshaller()); |
339,340 | private boolean writeDictionaryRowGroup(Block dictionary, int valueCount, IntBigArray dictionaryIndexes, int maxDirectBytes) {<NEW_LINE>int[][] segments = dictionaryIndexes.getSegments();<NEW_LINE>for (int i = 0; valueCount > 0 && i < segments.length; i++) {<NEW_LINE>int[] segment = segments[i];<NEW_LINE>int positionCount = Math.min(valueCount, segment.length);<NEW_LINE>Block block = new DictionaryBlock(positionCount, dictionary, segment);<NEW_LINE>while (block != null) {<NEW_LINE>int chunkPositionCount = block.getPositionCount();<NEW_LINE>Block chunk = <MASK><NEW_LINE>// avoid chunk with huge logical size<NEW_LINE>while (chunkPositionCount > 1 && chunk.getLogicalSizeInBytes() > DIRECT_CONVERSION_CHUNK_MAX_LOGICAL_BYTES) {<NEW_LINE>chunkPositionCount /= 2;<NEW_LINE>chunk = chunk.getRegion(0, chunkPositionCount);<NEW_LINE>}<NEW_LINE>directColumnWriter.writeBlock(chunk);<NEW_LINE>if (directColumnWriter.getBufferedBytes() > maxDirectBytes) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// slice block to only unconverted rows<NEW_LINE>if (chunkPositionCount < block.getPositionCount()) {<NEW_LINE>block = block.getRegion(chunkPositionCount, block.getPositionCount() - chunkPositionCount);<NEW_LINE>} else {<NEW_LINE>block = null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>valueCount -= positionCount;<NEW_LINE>}<NEW_LINE>checkState(valueCount == 0);<NEW_LINE>return true;<NEW_LINE>} | block.getRegion(0, chunkPositionCount); |
1,809,739 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.<MASK><NEW_LINE>if (player == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Cards cards = new CardsImpl(player.getLibrary().getTopCards(game, 3));<NEW_LINE>if (cards.isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>TargetCard target = new TargetCardInLibrary();<NEW_LINE>player.choose(outcome, cards, target, game);<NEW_LINE>Card card = game.getCard(target.getFirstTarget());<NEW_LINE>if (card != null) {<NEW_LINE>player.moveCards(card, Zone.EXILED, source, game);<NEW_LINE>card.setFaceDown(true, game);<NEW_LINE>card.addCounters(CounterType.HATCHLING.createInstance(), source, game);<NEW_LINE>}<NEW_LINE>cards.retainZone(Zone.LIBRARY, game);<NEW_LINE>player.putCardsOnBottomOfLibrary(cards, game, source, true);<NEW_LINE>return true;<NEW_LINE>} | getPlayer(source.getControllerId()); |
1,396,844 | private static PyObject loadBuiltin(String name) {<NEW_LINE>final String MSG = "import {0} # builtin";<NEW_LINE>if (name == "sys") {<NEW_LINE>logger.log(Level.CONFIG, MSG, name);<NEW_LINE>return Py.<MASK><NEW_LINE>}<NEW_LINE>if (name == "__builtin__") {<NEW_LINE>logger.log(Level.CONFIG, MSG, new Object[] { name, name });<NEW_LINE>return new PyModule("__builtin__", Py.getSystemState().builtins);<NEW_LINE>}<NEW_LINE>String mod = PySystemState.getBuiltin(name);<NEW_LINE>if (mod != null) {<NEW_LINE>Class<?> c = Py.findClassEx(mod, "builtin module");<NEW_LINE>if (c != null) {<NEW_LINE>logger.log(Level.CONFIG, "import {0} # builtin {1}", new Object[] { name, mod });<NEW_LINE>try {<NEW_LINE>if (PyObject.class.isAssignableFrom(c)) {<NEW_LINE>// xxx ok?<NEW_LINE>return PyType.fromClass(c);<NEW_LINE>}<NEW_LINE>return createFromClass(name, c);<NEW_LINE>} catch (NoClassDefFoundError e) {<NEW_LINE>throw Py.ImportError("Cannot import " + name + ", missing class " + c.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | java2py(Py.getSystemState()); |
1,099,211 | public void start(String[] args) {<NEW_LINE>int exitCode = 0;<NEW_LINE>try {<NEW_LINE>suppressIllegalAccessWarning();<NEW_LINE>if (Main.isTesting) {<NEW_LINE>System.out.println("Process ID: " + this.getProcessId());<NEW_LINE>}<NEW_LINE>ProcessState.getInstance(this).addState(ProcessState.PROCESS_STATE.INIT, null);<NEW_LINE>try {<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>init();<NEW_LINE>} catch (Exception e) {<NEW_LINE>ProcessState.getInstance(this).addState(ProcessState.PROCESS_STATE.INIT_FAILURE, e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>ProcessState.getInstance(this).addState(ProcessState.PROCESS_STATE.STARTED, null);<NEW_LINE>putMainThreadToSleep();<NEW_LINE>ProcessState.getInstance(this).addState(ProcessState.PROCESS_STATE.SHUTTING_DOWN, null);<NEW_LINE>stopApp();<NEW_LINE>Logging.info(this, "Goodbye");<NEW_LINE>} catch (Exception e) {<NEW_LINE>ProcessState.getInstance(this).addState(ProcessState.PROCESS_STATE.SHUTTING_DOWN, null);<NEW_LINE>stopApp();<NEW_LINE>Logging.error(this, "What caused the crash: " + e.getMessage(), true, e);<NEW_LINE>exitCode = 1;<NEW_LINE>}<NEW_LINE>ProcessState.getInstance(this).addState(ProcessState.PROCESS_STATE.STOPPED, null);<NEW_LINE>} finally {<NEW_LINE>synchronized (shutdownHookLock) {<NEW_LINE>programEnded = true;<NEW_LINE>shutdownHookLock.notifyAll();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (exitCode != 0 && !Main.isTesting) {<NEW_LINE>System.exit(exitCode);<NEW_LINE>}<NEW_LINE>} | CLIOptions.load(this, args); |
565,491 | public CreateApplicationResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>CreateApplicationResult createApplicationResult = new CreateApplicationResult();<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 createApplicationResult;<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("ApplicationDetail", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>createApplicationResult.setApplicationDetail(ApplicationDetailJsonUnmarshaller.getInstance<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return createApplicationResult;<NEW_LINE>} | ().unmarshall(context)); |
1,792,996 | private static void compareValueCollection(Collection<Object> expected, Collection<Object> actual) {<NEW_LINE>assertEquals(expected.size(), actual.size());<NEW_LINE>assertEquals(expected.isEmpty(), actual.isEmpty());<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(expected.toArray(), actual.toArray());<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(iteratorToArray(expected.iterator()), iteratorToArray(actual.iterator()));<NEW_LINE>for (Object value : expected) {<NEW_LINE>assertTrue(actual.contains(value));<NEW_LINE>}<NEW_LINE>assertFalse(actual.contains("DUMMY"));<NEW_LINE>assertTrue(actual.containsAll(expected));<NEW_LINE>assertFalse(actual.containsAll(Arrays.asList("DUMMY")));<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(expected.toArray(), actual.toArray());<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(expected.toArray(new Object[0]), actual.toArray(new Object[0]));<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(expected.toArray(new Object[1]), actual.toArray(new Object[1]));<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(expected.toArray(new Object[expected.size()]), actual.toArray(new Object[actual.size()]));<NEW_LINE>EPAssertionUtil.assertEqualsExactOrder(expected.toArray(new Object[100]), actual.toArray<MASK><NEW_LINE>tryInvalidModify(actual, a -> a.clear());<NEW_LINE>tryInvalidModify(actual, a -> a.add("DUMMY"));<NEW_LINE>tryInvalidModify(actual, a -> a.remove("DUMMY"));<NEW_LINE>tryInvalidModify(actual, a -> a.removeAll(Arrays.asList()));<NEW_LINE>tryInvalidModify(actual, a -> a.addAll(Arrays.asList()));<NEW_LINE>tryInvalidModify(actual, a -> a.retainAll(Arrays.asList()));<NEW_LINE>tryInvalidModify(actual, a -> a.removeIf(x -> true));<NEW_LINE>} | (new Object[100])); |
1,459,507 | private static void addAvailableFixesForGroups(@Nonnull HighlightInfo info, @Nonnull Editor editor, @Nonnull PsiFile file, @Nonnull List<? super HighlightInfo.IntentionActionDescriptor> outList, int group, int offset) {<NEW_LINE>if (info.quickFixActionMarkers == null)<NEW_LINE>return;<NEW_LINE>if (group != -1 && group != info.getGroup())<NEW_LINE>return;<NEW_LINE>boolean fixRangeIsNotEmpty = !info<MASK><NEW_LINE>Editor injectedEditor = null;<NEW_LINE>PsiFile injectedFile = null;<NEW_LINE>for (Pair<HighlightInfo.IntentionActionDescriptor, RangeMarker> pair : info.quickFixActionMarkers) {<NEW_LINE>HighlightInfo.IntentionActionDescriptor actionInGroup = pair.first;<NEW_LINE>RangeMarker range = pair.second;<NEW_LINE>if (!range.isValid() || fixRangeIsNotEmpty && isEmpty(range))<NEW_LINE>continue;<NEW_LINE>if (DumbService.isDumb(file.getProject()) && !DumbService.isDumbAware(actionInGroup.getAction())) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>int start = range.getStartOffset();<NEW_LINE>int end = range.getEndOffset();<NEW_LINE>final Project project = file.getProject();<NEW_LINE>if (start > offset || offset > end) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>Editor editorToUse;<NEW_LINE>PsiFile fileToUse;<NEW_LINE>if (info.isFromInjection()) {<NEW_LINE>if (injectedEditor == null) {<NEW_LINE>injectedFile = InjectedLanguageUtil.findInjectedPsiNoCommit(file, offset);<NEW_LINE>injectedEditor = InjectedLanguageUtil.getInjectedEditorForInjectedFile(editor, injectedFile);<NEW_LINE>}<NEW_LINE>editorToUse = injectedFile == null ? editor : injectedEditor;<NEW_LINE>fileToUse = injectedFile == null ? file : injectedFile;<NEW_LINE>} else {<NEW_LINE>editorToUse = editor;<NEW_LINE>fileToUse = file;<NEW_LINE>}<NEW_LINE>if (actionInGroup.getAction().isAvailable(project, editorToUse, fileToUse)) {<NEW_LINE>outList.add(actionInGroup);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | .getFixTextRange().isEmpty(); |
1,326,514 | private static Option createOption(String type, Character shortName, String longName, String displayName, String description) {<NEW_LINE>Option o = null;<NEW_LINE>if (shortName == null) {<NEW_LINE>shortName = Option.NO_SHORT_NAME;<NEW_LINE>}<NEW_LINE>switch(Type.valueOf(type)) {<NEW_LINE>case withoutArgument:<NEW_LINE>o = Option.withoutArgument(shortName, longName);<NEW_LINE>break;<NEW_LINE>case requiredArgument:<NEW_LINE>o = Option.requiredArgument(shortName, longName);<NEW_LINE>break;<NEW_LINE>case optionalArgument:<NEW_LINE>o = <MASK><NEW_LINE>break;<NEW_LINE>case additionalArguments:<NEW_LINE>o = Option.additionalArguments(shortName, longName);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>assert false;<NEW_LINE>}<NEW_LINE>if (displayName != null) {<NEW_LINE>// NOI18N<NEW_LINE>String[] arr = fixBundles(displayName.split("#", 2));<NEW_LINE>o = Option.displayName(o, arr[0], arr[1]);<NEW_LINE>}<NEW_LINE>if (description != null) {<NEW_LINE>// NOI18N<NEW_LINE>String[] arr = fixBundles(description.split("#", 2));<NEW_LINE>o = Option.shortDescription(o, arr[0], arr[1]);<NEW_LINE>}<NEW_LINE>return o;<NEW_LINE>} | Option.optionalArgument(shortName, longName); |
1,035,758 | private ExecutableNode planExecution(ExpressionContext expression) {<NEW_LINE>switch(expression.getType()) {<NEW_LINE>case LITERAL:<NEW_LINE>return new ConstantExecutionNode(expression.getLiteral());<NEW_LINE>case IDENTIFIER:<NEW_LINE>String columnName = expression.getIdentifier();<NEW_LINE>ColumnExecutionNode columnExecutionNode = new ColumnExecutionNode(columnName, _arguments.size());<NEW_LINE>_arguments.add(columnName);<NEW_LINE>return columnExecutionNode;<NEW_LINE>case FUNCTION:<NEW_LINE>FunctionContext function = expression.getFunction();<NEW_LINE>List<ExpressionContext> arguments = function.getArguments();<NEW_LINE>int numArguments = arguments.size();<NEW_LINE>ExecutableNode[] childNodes = new ExecutableNode[numArguments];<NEW_LINE>for (int i = 0; i < numArguments; i++) {<NEW_LINE>childNodes[i] = planExecution<MASK><NEW_LINE>}<NEW_LINE>String functionName = function.getFunctionName();<NEW_LINE>FunctionInfo functionInfo = FunctionRegistry.getFunctionInfo(functionName, numArguments);<NEW_LINE>if (functionInfo == null) {<NEW_LINE>if (FunctionRegistry.containsFunction(functionName)) {<NEW_LINE>throw new IllegalStateException(String.format("Unsupported function: %s with %d parameters", functionName, numArguments));<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException(String.format("Unsupported function: %s not found", functionName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new FunctionExecutionNode(functionInfo, childNodes);<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException();<NEW_LINE>}<NEW_LINE>} | (arguments.get(i)); |
493,569 | /*<NEW_LINE>* Sensor side<NEW_LINE>*/<NEW_LINE>public void onStart() {<NEW_LINE>// create thread<NEW_LINE>monitorSessionThread = new MonitorSessionThread(this, host, port, passwd);<NEW_LINE>// start first bus scan 30 secs later<NEW_LINE>m_last_bus_scan = new Date((new Date()).getTime() - (1000 * m_bus_scan_interval_secs) + (1000 * m_first_scan_delay_secs));<NEW_LINE>// start thread<NEW_LINE>monitorSessionThread.start();<NEW_LINE>logger.info("Connected to [{}:{}], Rescan bus every [{}] seconds, first scan over [{}] seconds, max. heating zones: [{}], Shutter run time [{}] msecs", host, port, m_bus_scan_interval_secs, (((new Date()).getTime() - m_last_bus_scan.getTime()) <MASK><NEW_LINE>// start the processing thread<NEW_LINE>start();<NEW_LINE>} | / 1000), m_heating_zones, m_shutter_run_msecs); |
1,373,845 | public Request<UpdateChannelReadMarkerRequest> marshall(UpdateChannelReadMarkerRequest updateChannelReadMarkerRequest) {<NEW_LINE>if (updateChannelReadMarkerRequest == null) {<NEW_LINE>throw new AmazonClientException("Invalid argument passed to marshall(UpdateChannelReadMarkerRequest)");<NEW_LINE>}<NEW_LINE>Request<UpdateChannelReadMarkerRequest> request = new DefaultRequest<UpdateChannelReadMarkerRequest>(updateChannelReadMarkerRequest, "AmazonChimeSDKMessaging");<NEW_LINE>request.setHttpMethod(HttpMethodName.PUT);<NEW_LINE>if (updateChannelReadMarkerRequest.getChimeBearer() != null) {<NEW_LINE>request.addHeader("x-amz-chime-bearer", StringUtils.fromString(updateChannelReadMarkerRequest.getChimeBearer()));<NEW_LINE>}<NEW_LINE>String uriResourcePath = "/channels/{channelArn}/readMarker";<NEW_LINE>uriResourcePath = uriResourcePath.replace("{channelArn}", (updateChannelReadMarkerRequest.getChannelArn() == null) ? "" : StringUtils.fromString(updateChannelReadMarkerRequest.getChannelArn()));<NEW_LINE>request.setResourcePath(uriResourcePath);<NEW_LINE>String encodedUriResourcePath = "/channels/{channelArn}/readMarker";<NEW_LINE>encodedUriResourcePath = encodedUriResourcePath.replace("{channelArn}", (updateChannelReadMarkerRequest.getChannelArn() == null) ? "" : Uri.encode(StringUtils.fromString(<MASK><NEW_LINE>request.setEncodedResourcePath(encodedUriResourcePath);<NEW_LINE>request.addHeader("Content-Length", "0");<NEW_LINE>request.setContent(new ByteArrayInputStream(new byte[0]));<NEW_LINE>if (!request.getHeaders().containsKey("Content-Type")) {<NEW_LINE>request.addHeader("Content-Type", "application/x-amz-json-1.0");<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | updateChannelReadMarkerRequest.getChannelArn()))); |
1,580,443 | public void actionPerformed(ActionEvent event) {<NEW_LINE>Queue<PageFlowSceneElement> deleteNodesList = new LinkedList<PageFlowSceneElement>();<NEW_LINE>// Workaround: Temporarily Wrapping Collection because of Issue: 100127<NEW_LINE>Set<Object> selectedObjects = new HashSet<Object>(scene.getSelectedObjects());<NEW_LINE>LOG.fine("Selected Objects: " + selectedObjects);<NEW_LINE>LOG.finest("Scene: \n" + "Nodes: " + scene.getNodes() + "\n" + "Edges: " + scene.getEdges() + "\n" + "Pins: " + scene.getPins());<NEW_LINE>Set<Object> nonEdgeSelectedObjects <MASK><NEW_LINE>for (Object selectedObj : selectedObjects) {<NEW_LINE>if (selectedObj instanceof PageFlowSceneElement) {<NEW_LINE>if (scene.isEdge(selectedObj)) {<NEW_LINE>assert !scene.isPin(selectedObj);<NEW_LINE>selectedEdges.add((NavigationCaseEdge) selectedObj);<NEW_LINE>} else {<NEW_LINE>assert scene.isNode(selectedObj) || scene.isPin(selectedObj);<NEW_LINE>selectedNonEdges.add((PageFlowSceneElement) selectedObj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = new HashSet<Object>(); |
957,782 | public List<Map<String, Object>> read(String segmentId, String sqlTmpl, Object[] values) throws IOException {<NEW_LINE>String readUrl = readUrl(segmentId);<NEW_LINE>String[] sqlValues <MASK><NEW_LINE>for (int i = 0; i < values.length; i++) {<NEW_LINE>sqlValues[i] = sqlValue(values[i]);<NEW_LINE>}<NEW_LINE>String sql = String.format(sqlTmpl, (Object[]) sqlValues);<NEW_LINE>HttpURLConnection connection;<NEW_LINE>try {<NEW_LINE>connection = httpRequest("POST", readUrl, SQL_MIMETYPE, sql, TEN_MINUTES_MS);<NEW_LINE>if (connection.getResponseCode() != 200) {<NEW_LINE>throw new TroughException("unexpected response " + connection.getResponseCode() + " " + connection.getResponseMessage() + ": " + responsePayload(connection) + " from " + readUrl + " to query: " + sql);<NEW_LINE>}<NEW_LINE>Object result = new JSONParser().parse(new InputStreamReader(connection.getInputStream(), "UTF-8"));<NEW_LINE>return (List<Map<String, Object>>) result;<NEW_LINE>} catch (IOException e) {<NEW_LINE>synchronized (readUrlCache) {<NEW_LINE>readUrlCache.remove(segmentId);<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>} catch (ParseException e) {<NEW_LINE>synchronized (readUrlCache) {<NEW_LINE>readUrlCache.remove(segmentId);<NEW_LINE>}<NEW_LINE>throw new TroughException("problem parsing json response from " + readUrl, e);<NEW_LINE>}<NEW_LINE>} | = new String[values.length]; |
590,152 | protected Ternary visitFunctionCall(FunctionCall fc, TranslationContext context) {<NEW_LINE>if (!ignoreWindows && fc.getWindow().isPresent())<NEW_LINE>throw new TranslationException("Window functions not allowed in aggregates", fc);<NEW_LINE>if (this.isGroupedBy(fc)) {<NEW_LINE>this.decomposition.addNode(fc);<NEW_LINE>return Ternary.Yes;<NEW_LINE>}<NEW_LINE>String name = Utilities.<MASK><NEW_LINE>Ternary result = Ternary.Maybe;<NEW_LINE>boolean isAggregate = SqlSemantics.semantics.isAggregateFunction(name);<NEW_LINE>if (isAggregate) {<NEW_LINE>this.decomposition.addNode(fc);<NEW_LINE>}<NEW_LINE>for (Expression e : fc.getArguments()) {<NEW_LINE>Ternary arg = this.process(e, context);<NEW_LINE>if (isAggregate && arg == Ternary.Yes)<NEW_LINE>throw new TranslationException("Nested aggregation", fc);<NEW_LINE>result = this.combine(fc, result, arg);<NEW_LINE>}<NEW_LINE>if (isAggregate)<NEW_LINE>return Ternary.Yes;<NEW_LINE>return result;<NEW_LINE>} | convertQualifiedName(fc.getName()); |
69,408 | public EdgeLabel readEdgeLabel(HugeGraph graph, BackendEntry backendEntry) {<NEW_LINE>if (backendEntry == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>TableBackendEntry entry = this.convertEntry(backendEntry);<NEW_LINE>Number id = schemaColumn(entry, HugeKeys.ID);<NEW_LINE>String name = schemaColumn(entry, HugeKeys.NAME);<NEW_LINE>Frequency frequency = schemaEnum(entry, <MASK><NEW_LINE>Number sourceLabel = schemaColumn(entry, HugeKeys.SOURCE_LABEL);<NEW_LINE>Number targetLabel = schemaColumn(entry, HugeKeys.TARGET_LABEL);<NEW_LINE>Object sortKeys = schemaColumn(entry, HugeKeys.SORT_KEYS);<NEW_LINE>Object nullableKeys = schemaColumn(entry, HugeKeys.NULLABLE_KEYS);<NEW_LINE>Object properties = schemaColumn(entry, HugeKeys.PROPERTIES);<NEW_LINE>Object indexLabels = schemaColumn(entry, HugeKeys.INDEX_LABELS);<NEW_LINE>SchemaStatus status = schemaEnum(entry, HugeKeys.STATUS, SchemaStatus.class);<NEW_LINE>Number ttl = schemaColumn(entry, HugeKeys.TTL);<NEW_LINE>Number ttlStartTime = schemaColumn(entry, HugeKeys.TTL_START_TIME);<NEW_LINE>EdgeLabel edgeLabel = new EdgeLabel(graph, this.toId(id), name);<NEW_LINE>edgeLabel.frequency(frequency);<NEW_LINE>edgeLabel.sourceLabel(this.toId(sourceLabel));<NEW_LINE>edgeLabel.targetLabel(this.toId(targetLabel));<NEW_LINE>edgeLabel.properties(this.toIdArray(properties));<NEW_LINE>edgeLabel.sortKeys(this.toIdArray(sortKeys));<NEW_LINE>edgeLabel.nullableKeys(this.toIdArray(nullableKeys));<NEW_LINE>edgeLabel.indexLabels(this.toIdArray(indexLabels));<NEW_LINE>edgeLabel.status(status);<NEW_LINE>edgeLabel.ttl(ttl.longValue());<NEW_LINE>edgeLabel.ttlStartTime(this.toId(ttlStartTime));<NEW_LINE>this.readEnableLabelIndex(edgeLabel, entry);<NEW_LINE>this.readUserdata(edgeLabel, entry);<NEW_LINE>return edgeLabel;<NEW_LINE>} | HugeKeys.FREQUENCY, Frequency.class); |
363,386 | public final DeleteResponse<T> delete(String updatedBy, String id, boolean recursive, boolean internal) throws IOException {<NEW_LINE>// Validate entity<NEW_LINE>String json = dao.findJsonById(id, Include.NON_DELETED);<NEW_LINE>if (json == null) {<NEW_LINE>if (!internal) {<NEW_LINE>throw EntityNotFoundException.byMessage(CatalogExceptionMessage<MASK><NEW_LINE>} else {<NEW_LINE>// Maybe already deleted<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>T original = JsonUtils.readValue(json, entityClass);<NEW_LINE>setFields(original, putFields);<NEW_LINE>// If an entity being deleted contains other **non-deleted** children entities, it can't be deleted<NEW_LINE>List<EntityReference> contains = daoCollection.relationshipDAO().findTo(id, entityType, Relationship.CONTAINS.ordinal());<NEW_LINE>if (!contains.isEmpty()) {<NEW_LINE>if (!recursive) {<NEW_LINE>throw new IllegalArgumentException(entityType + " is not empty");<NEW_LINE>}<NEW_LINE>// Soft delete all the contained entities<NEW_LINE>for (EntityReference entityReference : contains) {<NEW_LINE>LOG.info("Recursively deleting {} {}", entityReference.getType(), entityReference.getId());<NEW_LINE>Entity.deleteEntity(updatedBy, entityReference.getType(), entityReference.getId(), true, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String changeType;<NEW_LINE>T updated = JsonUtils.readValue(json, entityClass);<NEW_LINE>EntityInterface<T> entityInterface = getEntityInterface(updated);<NEW_LINE>entityInterface.setUpdateDetails(updatedBy, System.currentTimeMillis());<NEW_LINE>if (supportsSoftDelete) {<NEW_LINE>entityInterface.setDeleted(true);<NEW_LINE>EntityUpdater updater = getUpdater(original, updated, Operation.SOFT_DELETE);<NEW_LINE>updater.update();<NEW_LINE>changeType = RestUtil.ENTITY_SOFT_DELETED;<NEW_LINE>} else {<NEW_LINE>// Hard delete<NEW_LINE>dao.delete(id);<NEW_LINE>daoCollection.relationshipDAO().deleteAll(id, entityType);<NEW_LINE>changeType = RestUtil.ENTITY_DELETED;<NEW_LINE>}<NEW_LINE>return new DeleteResponse<>(updated, changeType);<NEW_LINE>} | .entityNotFound(entityType, id)); |
1,412,192 | protected Folder _editWebAsset(ActionRequest req, ActionResponse res, PortletConfig config, ActionForm form, User user, String webKey) throws Exception {<NEW_LINE>// wraps request to get session object<NEW_LINE>ActionRequestImpl reqImpl = (ActionRequestImpl) req;<NEW_LINE>HttpServletRequest httpReq = reqImpl.getHttpServletRequest();<NEW_LINE>WebAsset webAsset = (WebAsset) req.getAttribute(webKey);<NEW_LINE>// Checking permissions<NEW_LINE><MASK><NEW_LINE>if (InodeUtils.isSet(webAsset.getInode())) {<NEW_LINE>// calls the asset factory edit<NEW_LINE>boolean editAsset = WebAssetFactory.editAsset(webAsset, user.getUserId());<NEW_LINE>if (!editAsset) {<NEW_LINE>User userMod = null;<NEW_LINE>try {<NEW_LINE>userMod = APILocator.getUserAPI().loadUserById(webAsset.getModUser(), APILocator.getUserAPI().getSystemUser(), false);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>if (ex instanceof NoSuchUserException) {<NEW_LINE>try {<NEW_LINE>userMod = APILocator.getUserAPI().getSystemUser();<NEW_LINE>} catch (DotDataException e) {<NEW_LINE>Logger.error(this, e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (userMod != null) {<NEW_LINE>webAsset.setModUser(userMod.getUserId());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Company comp = PublicCompanyFactory.getDefaultCompany();<NEW_LINE>String message = LanguageUtil.get(comp.getCompanyId(), user.getLocale(), "message." + webAsset.getType() + ".edit.locked");<NEW_LINE>message += " (" + userMod.getEmailAddress() + ")";<NEW_LINE>SessionMessages.add(httpReq, "custommessage", message);<NEW_LINE>} catch (Exception e) {<NEW_LINE>SessionMessages.add(httpReq, "message", "message." + webAsset.getType() + ".edit.locked");<NEW_LINE>}<NEW_LINE>throw (new ActionException(WebKeys.EDIT_ASSET_EXCEPTION));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Folder parentFolder = new Folder();<NEW_LINE>String parent = req.getParameter("parent");<NEW_LINE>if (!(WebAssetFactory.isAbstractAsset(webAsset))) {<NEW_LINE>if (InodeUtils.isSet(webAsset.getInode())) {<NEW_LINE>parentFolder = APILocator.getFolderAPI().findParentFolder(webAsset, user, false);<NEW_LINE>} else if (UtilMethods.isSet(parent)) {<NEW_LINE>parentFolder = APILocator.getFolderAPI().find(parent, user, false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>req.setAttribute(webKey, webAsset);<NEW_LINE>BeanUtils.copyProperties(form, req.getAttribute(webKey));<NEW_LINE>return parentFolder;<NEW_LINE>} | _checkUserPermissions(webAsset, user, PERMISSION_READ); |
264,177 | public void updateCompass(boolean isNight) {<NEW_LINE>float mapRotate = mapView.getRotate();<NEW_LINE>if (mapRotate != cachedRotate) {<NEW_LINE>cachedRotate = mapRotate;<NEW_LINE>// Apply animation to image view<NEW_LINE>compassHud.iv.invalidate();<NEW_LINE>}<NEW_LINE>boolean showCompass = shouldShowCompass();<NEW_LINE>compassHud.updateVisibility(showCompass);<NEW_LINE>// don't update icon if compass is hidden<NEW_LINE>if (!showCompass)<NEW_LINE>return;<NEW_LINE>if (settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_NONE) {<NEW_LINE>compassHud.setIconResId(isNight ? R.drawable.ic_compass_niu_white : R.drawable.ic_compass_niu);<NEW_LINE>compassHud.iv.setContentDescription(getString(R.string.rotate_map_none_opt));<NEW_LINE>} else if (settings.ROTATE_MAP.get() == OsmandSettings.ROTATE_MAP_BEARING) {<NEW_LINE>compassHud.setIconResId(isNight ? R.drawable.ic_compass_bearing_white : R.drawable.ic_compass_bearing);<NEW_LINE>compassHud.iv.setContentDescription(getString(R.string.rotate_map_bearing_opt));<NEW_LINE>} else {<NEW_LINE>compassHud.setIconResId(isNight ? R.drawable.<MASK><NEW_LINE>compassHud.iv.setContentDescription(getString(R.string.rotate_map_compass_opt));<NEW_LINE>}<NEW_LINE>} | ic_compass_white : R.drawable.ic_compass); |
1,790,443 | public final void onNext(@Nullable final T t) {<NEW_LINE>final Subscriber<? super T> subscriber = subscriber();<NEW_LINE>if (subscriber == null) {<NEW_LINE>getOrCreateSignalQueue(8).add(wrapNull(t));<NEW_LINE>drainSignalQueueSupplier(null, this::subscriber);<NEW_LINE>} else if (hasSignalsQueued()) {<NEW_LINE>getOrCreateSignalQueue(8).add(wrapNull(t));<NEW_LINE>drainSignalQueue(subscriber);<NEW_LINE>} else if (tryAcquireLock(emittingLockUpdater, this)) {<NEW_LINE>// The queue is empty, and we acquired the lock so we can try to directly deliver to target<NEW_LINE>// (assuming there is request(n) demand).<NEW_LINE>if (sourceEmitted < requested) {<NEW_LINE>try {<NEW_LINE>// We ignore overflow here because once we get to this extreme, we won't be able to account for<NEW_LINE>// more data anyways.<NEW_LINE>sourceEmittedUpdater.getAndIncrement(this);<NEW_LINE>subscriber.onNext(t);<NEW_LINE>} finally {<NEW_LINE>if (releaseLock(emittingLockUpdater, this)) {<NEW_LINE>updateRequestN();<NEW_LINE>} else {<NEW_LINE>drainSignalQueue(subscriber);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>releaseLock(emittingLockUpdater, this);<NEW_LINE>getOrCreateSignalQueue(8)<MASK><NEW_LINE>drainSignalQueue(subscriber);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>getOrCreateSignalQueue(8).add(wrapNull(t));<NEW_LINE>drainSignalQueue(subscriber);<NEW_LINE>}<NEW_LINE>} | .add(wrapNull(t)); |
1,813,352 | private RtAppInstanceDOExample buildExample(RtAppInstanceQueryCondition condition) {<NEW_LINE>RtAppInstanceDOExample example = new RtAppInstanceDOExample();<NEW_LINE>RtAppInstanceDOExample.Criteria criteria = example.createCriteria();<NEW_LINE>if (StringUtils.isNotBlank(condition.getAppInstanceId())) {<NEW_LINE>criteria.andAppInstanceIdEqualTo(condition.getAppInstanceId());<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotBlank(condition.getAppId())) {<NEW_LINE>if (condition.getAppId().contains(",")) {<NEW_LINE>criteria.andAppIdIn(Arrays.asList(condition.getAppId().split(",")));<NEW_LINE>} else {<NEW_LINE>criteria.andAppIdEqualTo(condition.getAppId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (condition.getClusterId() != null) {<NEW_LINE>if (condition.getClusterId().contains(",")) {<NEW_LINE>criteria.andClusterIdIn(Arrays.asList(condition.getClusterId().split(",")));<NEW_LINE>} else {<NEW_LINE>criteria.andClusterIdEqualTo(condition.getClusterId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (condition.getNamespaceId() != null) {<NEW_LINE>if (condition.getNamespaceId().contains(",")) {<NEW_LINE>criteria.andNamespaceIdIn(Arrays.asList(condition.getNamespaceId().split(",")));<NEW_LINE>} else {<NEW_LINE>criteria.andNamespaceIdEqualTo(condition.getNamespaceId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (condition.getStageId() != null) {<NEW_LINE>if (condition.getStageId().contains(",")) {<NEW_LINE>criteria.andStageIdIn(Arrays.asList(condition.getStageId().split(",")));<NEW_LINE>} else {<NEW_LINE>criteria.andStageIdEqualTo(condition.getStageId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (StringUtils.isNotBlank(condition.getStatus())) {<NEW_LINE>criteria.andStatusEqualTo(condition.getStatus());<NEW_LINE>}<NEW_LINE>if (condition.getVisit() != null) {<NEW_LINE>criteria.andVisitEqualTo(condition.getVisit());<NEW_LINE>}<NEW_LINE>if (condition.getUpgrade() != null) {<NEW_LINE>criteria.andUpgradeEqualTo(condition.getUpgrade());<NEW_LINE>}<NEW_LINE>if (condition.getReverse() != null && condition.getReverse()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>return example;<NEW_LINE>} | example.setOrderByClause(DefaultConstant.ORDER_BY_ID_DESC); |
1,530,102 | public static DescribeBackupPlansResponse unmarshall(DescribeBackupPlansResponse describeBackupPlansResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeBackupPlansResponse.setRequestId(_ctx.stringValue("DescribeBackupPlansResponse.RequestId"));<NEW_LINE>describeBackupPlansResponse.setSuccess(_ctx.booleanValue("DescribeBackupPlansResponse.Success"));<NEW_LINE>describeBackupPlansResponse.setCode(_ctx.stringValue("DescribeBackupPlansResponse.Code"));<NEW_LINE>describeBackupPlansResponse.setMessage(_ctx.stringValue("DescribeBackupPlansResponse.Message"));<NEW_LINE>describeBackupPlansResponse.setTotalCount(_ctx.longValue("DescribeBackupPlansResponse.TotalCount"));<NEW_LINE>describeBackupPlansResponse.setPageSize(_ctx.integerValue("DescribeBackupPlansResponse.PageSize"));<NEW_LINE>describeBackupPlansResponse.setPageNumber<MASK><NEW_LINE>List<BackupPlan> backupPlans = new ArrayList<BackupPlan>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeBackupPlansResponse.BackupPlans.Length"); i++) {<NEW_LINE>BackupPlan backupPlan = new BackupPlan();<NEW_LINE>backupPlan.setVaultId(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].VaultId"));<NEW_LINE>backupPlan.setBackupSourceGroupId(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].BackupSourceGroupId"));<NEW_LINE>backupPlan.setPlanId(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].PlanId"));<NEW_LINE>backupPlan.setPlanName(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].PlanName"));<NEW_LINE>backupPlan.setSourceType(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].SourceType"));<NEW_LINE>backupPlan.setBackupType(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].BackupType"));<NEW_LINE>backupPlan.setSchedule(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].Schedule"));<NEW_LINE>backupPlan.setRetention(_ctx.longValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].Retention"));<NEW_LINE>backupPlan.setClusterId(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].ClusterId"));<NEW_LINE>backupPlan.setDisabled(_ctx.booleanValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].Disabled"));<NEW_LINE>backupPlan.setCreatedTime(_ctx.longValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].CreatedTime"));<NEW_LINE>backupPlan.setUpdatedTime(_ctx.longValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].UpdatedTime"));<NEW_LINE>backupPlan.setFileSystemId(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].FileSystemId"));<NEW_LINE>backupPlan.setCreateTime(_ctx.longValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].CreateTime"));<NEW_LINE>backupPlan.setBucket(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].Bucket"));<NEW_LINE>backupPlan.setPrefix(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].Prefix"));<NEW_LINE>backupPlan.setInstanceId(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].InstanceId"));<NEW_LINE>backupPlan.setDetail(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].Detail"));<NEW_LINE>backupPlan.setClientId(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].ClientId"));<NEW_LINE>backupPlan.setSpeedLimit(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].SpeedLimit"));<NEW_LINE>backupPlan.setOptions(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].Options"));<NEW_LINE>backupPlan.setInclude(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].Include"));<NEW_LINE>backupPlan.setExclude(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].Exclude"));<NEW_LINE>backupPlan.setDataSourceId(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].DataSourceId"));<NEW_LINE>List<String> paths = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].Paths.Length"); j++) {<NEW_LINE>paths.add(_ctx.stringValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].Paths[" + j + "]"));<NEW_LINE>}<NEW_LINE>backupPlan.setPaths(paths);<NEW_LINE>TrialInfo trialInfo = new TrialInfo();<NEW_LINE>trialInfo.setTrialStartTime(_ctx.longValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].TrialInfo.TrialStartTime"));<NEW_LINE>trialInfo.setTrialExpireTime(_ctx.longValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].TrialInfo.TrialExpireTime"));<NEW_LINE>trialInfo.setKeepAfterTrialExpiration(_ctx.booleanValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].TrialInfo.KeepAfterTrialExpiration"));<NEW_LINE>trialInfo.setTrialVaultReleaseTime(_ctx.longValue("DescribeBackupPlansResponse.BackupPlans[" + i + "].TrialInfo.TrialVaultReleaseTime"));<NEW_LINE>backupPlan.setTrialInfo(trialInfo);<NEW_LINE>backupPlans.add(backupPlan);<NEW_LINE>}<NEW_LINE>describeBackupPlansResponse.setBackupPlans(backupPlans);<NEW_LINE>return describeBackupPlansResponse;<NEW_LINE>} | (_ctx.integerValue("DescribeBackupPlansResponse.PageNumber")); |
568,291 | private static XmlElement parse(XMLStreamReader reader, String refAttr, Map<String, XmlElement> refs) {<NEW_LINE>try {<NEW_LINE>// parse start element<NEW_LINE>String elementName = parseElementName(reader);<NEW_LINE>ImmutableMap<String, String> attrs = parseAttributes(reader);<NEW_LINE>// parse children or content<NEW_LINE>ImmutableList.Builder<XmlElement> childBuilder = ImmutableList.builder();<NEW_LINE>String content = "";<NEW_LINE><MASK><NEW_LINE>while (event != XMLStreamConstants.END_ELEMENT) {<NEW_LINE>switch(event) {<NEW_LINE>// parse child when start element found<NEW_LINE>case XMLStreamConstants.START_ELEMENT:<NEW_LINE>childBuilder.add(parse(reader, refAttr, refs));<NEW_LINE>break;<NEW_LINE>// append content when characters found<NEW_LINE>// since XMLStreamReader has IS_COALESCING=true means there should only be one content call<NEW_LINE>case XMLStreamConstants.CHARACTERS:<NEW_LINE>case XMLStreamConstants.CDATA:<NEW_LINE>content += reader.getText();<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>event = reader.next();<NEW_LINE>}<NEW_LINE>ImmutableList<XmlElement> children = childBuilder.build();<NEW_LINE>XmlElement parsed = children.isEmpty() ? XmlElement.ofContent(elementName, attrs, content) : XmlElement.ofChildren(elementName, attrs, children);<NEW_LINE>String ref = attrs.get(refAttr);<NEW_LINE>if (ref != null) {<NEW_LINE>refs.put(ref, parsed);<NEW_LINE>}<NEW_LINE>return parsed;<NEW_LINE>} catch (XMLStreamException ex) {<NEW_LINE>throw new IllegalArgumentException(ex);<NEW_LINE>}<NEW_LINE>} | int event = reader.next(); |
1,713,680 | private Mono<Response<Flux<ByteBuffer>>> deleteWithResponseAsync(String resourceGroupName, String applicationDefinitionName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (applicationDefinitionName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter applicationDefinitionName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.delete(this.client.getEndpoint(), resourceGroupName, applicationDefinitionName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context);<NEW_LINE>} | error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null.")); |
1,472,925 | private EventBus createEventBus(@NonNull final Topic topic, @NonNull final MeterRegistry meterRegistry) {<NEW_LINE>final MicrometerEventBusStatsCollector statsCollector = createMicrometerEventBusStatsCollector(topic, meterRegistry);<NEW_LINE>// Create the event bus<NEW_LINE>final EventBus eventBus = new EventBus(topic.getName(), createExecutorOrNull(topic), statsCollector);<NEW_LINE>// Bind the EventBus to remote endpoint (only if the system is enabled).<NEW_LINE>// If is not enabled we will use only local event buses,<NEW_LINE>// because if we would return null or fail here a lot of BLs could fail.<NEW_LINE>if (Type.REMOTE.equals(topic.getType())) {<NEW_LINE>if (!EventBusConfig.isEnabled()) {<NEW_LINE><MASK><NEW_LINE>} else if (remoteEndpoint.bindIfNeeded(eventBus)) {<NEW_LINE>eventBus.setTypeRemote();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Add our global listeners<NEW_LINE>final Set<IEventListener> globalListeners = globalEventListeners.get(topic);<NEW_LINE>for (final IEventListener globalListener : globalListeners) {<NEW_LINE>eventBus.subscribe(globalListener);<NEW_LINE>}<NEW_LINE>return eventBus;<NEW_LINE>} | logger.warn("Remote events are disabled via EventBusConstants. Creating local-only eventBus for topic={}", topic); |
1,638,990 | public static ErrorPropertiesDialog newInstance(final RRError error) {<NEW_LINE>final ErrorPropertiesDialog dialog = new ErrorPropertiesDialog(error);<NEW_LINE>final Bundle args = new Bundle();<NEW_LINE>args.putString("title", error.title);<NEW_LINE>args.putString("message", error.message);<NEW_LINE>if (error.t != null) {<NEW_LINE>final StringBuilder sb = new StringBuilder(1024);<NEW_LINE>BugReportActivity.appendException(sb, error.t, 10);<NEW_LINE>args.putString("t", sb.toString());<NEW_LINE>}<NEW_LINE>if (error.httpStatus != null) {<NEW_LINE>args.putString("httpStatus", error.httpStatus.toString());<NEW_LINE>}<NEW_LINE>if (error.url != null) {<NEW_LINE>args.putString("url", error.url);<NEW_LINE>}<NEW_LINE>if (error.response != null) {<NEW_LINE>args.putString("response", <MASK><NEW_LINE>}<NEW_LINE>dialog.setArguments(args);<NEW_LINE>return dialog;<NEW_LINE>} | error.response.toString()); |
1,554,879 | private void apply() {<NEW_LINE>this._trace = getBoolean("_trace", false);<NEW_LINE>this.net_collector_ip_port_id_pws = getValue("net_collector_ip_port_id_pws", "127.0.0.1:6100:admin:admin");<NEW_LINE>this.net_webapp_tcp_client_pool_size = getInt("net_webapp_tcp_client_pool_size", 100);<NEW_LINE>this.net_webapp_tcp_client_pool_timeout = getInt("net_webapp_tcp_client_pool_timeout", 15000);<NEW_LINE>this.net_http_api_auth_ip_enabled = getBoolean("net_http_api_auth_ip_enabled", false);<NEW_LINE>this.net_http_api_auth_ip_header_key = getValue("net_http_api_auth_ip_header_key", "");<NEW_LINE>this.net_http_api_auth_session_enabled = getBoolean("net_http_api_auth_session_enabled", false);<NEW_LINE>this.net_http_api_session_timeout = getInt("net_http_api_session_timeout", 3600 * 24);<NEW_LINE>this.net_http_api_auth_bearer_token_enabled = getBoolean("net_http_api_auth_bearer_token_enabled", false);<NEW_LINE>this.net_http_api_gzip_enabled = getBoolean("net_http_api_gzip_enabled", true);<NEW_LINE>this.<MASK><NEW_LINE>this.allowIpExact = Stream.of(net_http_api_allow_ips.split(",")).collect(Collectors.toSet());<NEW_LINE>if (allowIpExact.size() > 0) {<NEW_LINE>this.allowIpMatch = this.allowIpExact.stream().filter(v -> v.contains("*")).map(StrMatch::new).collect(Collectors.toList());<NEW_LINE>} else {<NEW_LINE>this.allowIpMatch = Collections.emptyList();<NEW_LINE>}<NEW_LINE>this.net_http_port = getInt("net_http_port", NetConstants.WEBAPP_HTTP_PORT);<NEW_LINE>this.net_http_extweb_dir = getValue("net_http_extweb_dir", "./extweb");<NEW_LINE>this.net_http_api_swagger_enabled = getBoolean("net_http_api_swagger_enabled", false);<NEW_LINE>this.net_http_api_swagger_host_ip = getValue("net_http_api_swagger_host_ip", "");<NEW_LINE>this.net_http_api_cors_allow_origin = getValue("net_http_api_cors_allow_origin", "*");<NEW_LINE>this.net_http_api_cors_allow_credentials = getValue("net_http_api_cors_allow_credentials", "true");<NEW_LINE>this.log_dir = getValue("log_dir", "./logs");<NEW_LINE>this.log_keep_days = getInt("log_keep_days", 30);<NEW_LINE>this.temp_dir = getValue("temp_dir", "./tempdata");<NEW_LINE>} | net_http_api_allow_ips = getValue("net_http_api_allow_ips", "localhost,127.0.0.1,0:0:0:0:0:0:0:1,::1"); |
776,614 | private static void addGstreamerPathsToEnv() {<NEW_LINE>if (System.getProperty("jna.nosys") == null) {<NEW_LINE>System.setProperty("jna.nosys", "true");<NEW_LINE>}<NEW_LINE>Path gstreamerPath = InstalledFileLocator.getDefault().locate("gstreamer", Installer.class.getPackage().getName(), false).toPath();<NEW_LINE>if (gstreamerPath == null) {<NEW_LINE>logger.log(Level.SEVERE, "Failed to find GStreamer.");<NEW_LINE>} else {<NEW_LINE>String arch = "x86_64";<NEW_LINE>if (!PlatformUtil.is64BitJVM()) {<NEW_LINE>arch = "x86";<NEW_LINE>}<NEW_LINE>Path gstreamerBasePath = Paths.get(gstreamerPath.<MASK><NEW_LINE>Path gstreamerBinPath = Paths.get(gstreamerBasePath.toString(), "bin");<NEW_LINE>Path gstreamerLibPath = Paths.get(gstreamerBasePath.toString(), "lib", "gstreamer-1.0");<NEW_LINE>// Update the PATH environment variable to contain the GStreamer<NEW_LINE>// lib and bin paths.<NEW_LINE>Kernel32 k32 = Kernel32.INSTANCE;<NEW_LINE>String path = System.getenv("PATH");<NEW_LINE>if (StringUtils.isBlank(path)) {<NEW_LINE>k32.SetEnvironmentVariable("PATH", gstreamerLibPath.toString());<NEW_LINE>} else {<NEW_LINE>k32.SetEnvironmentVariable("PATH", gstreamerBinPath.toString() + File.pathSeparator + gstreamerLibPath.toString() + path);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | toString(), "1.0", arch); |
1,265,776 | public long handle(Emulator<?> emulator) {<NEW_LINE>EditableArm32RegisterContext context = emulator.getContext();<NEW_LINE>UnidbgPointer object = context.getPointerArg(1);<NEW_LINE>UnidbgPointer jmethodID = context.getPointerArg(2);<NEW_LINE>UnidbgPointer va_list = context.getPointerArg(3);<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("CallLongMethodV object=" + object + ", jmethodID=" + jmethodID + ", va_list=" + va_list);<NEW_LINE>}<NEW_LINE>DvmObject<?> dvmObject = getObject(object.toIntPeer());<NEW_LINE>DvmClass dvmClass = dvmObject == null ? null : dvmObject.getObjectType();<NEW_LINE>DvmMethod dvmMethod = dvmClass == null ? null : dvmClass.getMethod(jmethodID.toIntPeer());<NEW_LINE>if (dvmMethod == null) {<NEW_LINE>throw new BackendException();<NEW_LINE>} else {<NEW_LINE>VaList vaList = new VaList32(emulator, DalvikVM.this, va_list, dvmMethod);<NEW_LINE>long ret = dvmMethod.callLongMethodV(dvmObject, vaList);<NEW_LINE>if (verbose) {<NEW_LINE>System.out.printf("JNIEnv->CallLongMethodV(%s, %s(%s) => 0x%xL) was called from %s%n", dvmObject, dvmMethod.methodName, vaList.formatArgs(), <MASK><NEW_LINE>}<NEW_LINE>context.setR1((int) (ret >> 32));<NEW_LINE>return (ret & 0xffffffffL);<NEW_LINE>}<NEW_LINE>} | ret, context.getLRPointer()); |
1,394,203 | ConfidenceInterval computeConfidenceInterval(double alpha, double alphaNum) {<NEW_LINE>// Setting alphaDen such that (1 - alpha) = (1 - alphaNum) * (1 - alphaDen).<NEW_LINE>double alphaDen = (alpha - alphaNum) / (1 - alphaNum);<NEW_LINE>ConfidenceInterval confIntNum = normalizedSum.computeConfidenceInterval(alphaNum);<NEW_LINE>ConfidenceInterval confIntDen = count.computeConfidenceInterval(alphaDen);<NEW_LINE>// Ensuring that the lower and upper bounds of the denominator are consistent with how<NEW_LINE>// computeResult() processes the denominator.<NEW_LINE>confIntDen = ConfidenceInterval.create(max(1.0, confIntDen.lowerBound()), max(1.0, confIntDen.upperBound()));<NEW_LINE>double meanLowerBound;<NEW_LINE>double meanUpperBound;<NEW_LINE>if (confIntNum.lowerBound() >= 0.0) {<NEW_LINE>meanLowerBound = confIntNum.lowerBound() / confIntDen.upperBound();<NEW_LINE>} else {<NEW_LINE>meanLowerBound = confIntNum.lowerBound() / confIntDen.lowerBound();<NEW_LINE>}<NEW_LINE>if (confIntNum.upperBound() >= 0.0) {<NEW_LINE>meanUpperBound = confIntNum.upperBound() / confIntDen.lowerBound();<NEW_LINE>} else {<NEW_LINE>meanUpperBound = confIntNum.upperBound() / confIntDen.upperBound();<NEW_LINE>}<NEW_LINE>// Ensuring that the lower and upper bounds of the mean are consistent with how computeResult()<NEW_LINE>// processes the mean.<NEW_LINE>meanLowerBound = clamp(meanLowerBound + midpoint);<NEW_LINE><MASK><NEW_LINE>return ConfidenceInterval.create(meanLowerBound, meanUpperBound);<NEW_LINE>} | meanUpperBound = clamp(meanUpperBound + midpoint); |
159,908 | final CreateStateMachineResult executeCreateStateMachine(CreateStateMachineRequest createStateMachineRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createStateMachineRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateStateMachineRequest> request = null;<NEW_LINE>Response<CreateStateMachineResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateStateMachineRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createStateMachineRequest));<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, "SFN");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateStateMachine");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateStateMachineResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new CreateStateMachineResultJsonUnmarshaller()); |
1,296,898 | public OMixedIndexRIDContainer deserializeFromByteBufferObject(ByteBuffer buffer) {<NEW_LINE>buffer.position(buffer.position() + OIntegerSerializer.INT_SIZE);<NEW_LINE>final long fileId = buffer.getLong();<NEW_LINE>final int embeddedSize = buffer.getInt();<NEW_LINE>final Set<ORID> hashSet = new HashSet<>();<NEW_LINE>for (int i = 0; i < embeddedSize; i++) {<NEW_LINE>final ORID orid = OCompactedLinkSerializer.INSTANCE.deserializeFromByteBufferObject(buffer).getIdentity();<NEW_LINE>hashSet.add(orid);<NEW_LINE>}<NEW_LINE>final long pageIndex = buffer.getLong();<NEW_LINE>final <MASK><NEW_LINE>final OIndexRIDContainerSBTree tree;<NEW_LINE>if (pageIndex == -1) {<NEW_LINE>tree = null;<NEW_LINE>} else {<NEW_LINE>final ODatabaseDocumentInternal db = ODatabaseRecordThreadLocal.instance().get();<NEW_LINE>tree = new OIndexRIDContainerSBTree(fileId, new OBonsaiBucketPointer(pageIndex, offset), (OAbstractPaginatedStorage) db.getStorage());<NEW_LINE>}<NEW_LINE>return new OMixedIndexRIDContainer(fileId, hashSet, tree);<NEW_LINE>} | int offset = buffer.getInt(); |
73,445 | protected boolean initialize(Object element) {<NEW_LINE>if (!(element instanceof IFile)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>origFile = (IFile) element;<NEW_LINE>if (!origFile.exists()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>IJavaProject javaProject = UmletPluginUtils.getJavaProject(origFile.getProject());<NEW_LINE>if (javaProject == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if ("uxf".equals(origFile.getFileExtension())) {<NEW_LINE>mgr.add(new UpdateImgReferencesProcessor(javaProject) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected IFile calculateImgDestination(IFile img, ICompilationUnit referencingCompilationUnit) {<NEW_LINE>IFile uxfFile = UmletPluginUtils.getUxfDiagramForImgFile(img);<NEW_LINE>if (origFile.equals(uxfFile)) {<NEW_LINE>return origFile.getParent().getFile(new Path(getArguments().getNewName()).removeFileExtension().addFileExtension(img.getFileExtension()));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>mgr.add(new RenamePngProcessor(origFile) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected String getTargetname(IFile pngFile, IFile affectedDiagram) {<NEW_LINE>return new Path(getArguments().getNewName()).removeFileExtension().addFileExtension(pngFile.getFileExtension()).lastSegment();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if ("png".equals(origFile.getFileExtension())) {<NEW_LINE>IFile correspondingUxf = UmletPluginUtils.getUxfDiagramForImgFile(origFile);<NEW_LINE>if (!correspondingUxf.exists()) {<NEW_LINE>// only refactor if uxf file exists<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// update references to the renamed png<NEW_LINE>mgr.add(new UpdateImgReferencesProcessor(javaProject) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected IFile calculateImgDestination(IFile img, ICompilationUnit referencingCompilationUnit) {<NEW_LINE>if (origFile.equals(img)) {<NEW_LINE>return origFile.getParent().getFile(new Path(getArguments().getNewName()));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// update the corresponding .uxf file<NEW_LINE>mgr.add(new RenameResourceChange(correspondingUxf.getFullPath(), new Path(getArguments().getNewName()).removeFileExtension().addFileExtension(correspondingUxf.getFileExtension(<MASK><NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | )).lastSegment())); |
1,767,120 | private void createServerSection(Composite parent) {<NEW_LINE>Font font = parent.getFont();<NEW_LINE>Group group = new Group(parent, SWT.FLAT);<NEW_LINE>group.setText(Messages.LaunchBrowserSettingsTab_Server);<NEW_LINE>group.setFont(font);<NEW_LINE>// CHECKSTYLE:OFF<NEW_LINE>GridData gd = new GridData(SWT.FILL, 20, true, false);<NEW_LINE>group.setLayoutData(gd);<NEW_LINE>FormLayout form = new FormLayout();<NEW_LINE>group.setLayout(form);<NEW_LINE>FormData data;<NEW_LINE>form.marginTop = 10;<NEW_LINE>form.marginBottom = 10;<NEW_LINE>form.marginLeft = 10;<NEW_LINE>form.marginRight = 10;<NEW_LINE>// the left offset of the items placed in the<NEW_LINE>int column1Offset = 0;<NEW_LINE>// first column<NEW_LINE>// the left offset of the items placed in the<NEW_LINE>int column3Offset = 135;<NEW_LINE>// second column<NEW_LINE>rbInternalServer = new Button(group, SWT.RADIO);<NEW_LINE>rbInternalServer.setText(Messages.LaunchBrowserSettingsTab_UseBuiltInWebServer);<NEW_LINE>data = new FormData();<NEW_LINE>data.left = new FormAttachment(0, column1Offset);<NEW_LINE>rbInternalServer.setLayoutData(data);<NEW_LINE>rbCustomServer = new Button(group, SWT.RADIO);<NEW_LINE>rbCustomServer.setText(Messages.LaunchBrowserSettingsTab_UseExternalWebServer);<NEW_LINE>data = new FormData();<NEW_LINE>data.top = new FormAttachment(rbInternalServer, 10, SWT.BOTTOM);<NEW_LINE>data.left = new FormAttachment(0, column1Offset);<NEW_LINE>rbCustomServer.setLayoutData(data);<NEW_LINE>fbaseUrlText = new Text(group, SWT.SINGLE | SWT.BORDER);<NEW_LINE>data = new FormData();<NEW_LINE>data.top = new FormAttachment(rbCustomServer, 10, SWT.BOTTOM);<NEW_LINE>data.left = new FormAttachment(0, column3Offset);<NEW_LINE>data.right <MASK><NEW_LINE>fbaseUrlText.setLayoutData(data);<NEW_LINE>Label baseUrlLabel = new Label(group, SWT.NONE);<NEW_LINE>baseUrlLabel.setText(Messages.LaunchBrowserSettingsTab_BaseURL);<NEW_LINE>baseUrlLabel.setAlignment(SWT.RIGHT);<NEW_LINE>data = new FormData();<NEW_LINE>data.right = new FormAttachment(fbaseUrlText, -8, SWT.LEFT);<NEW_LINE>data.top = new FormAttachment(fbaseUrlText, 0, SWT.TOP);<NEW_LINE>baseUrlLabel.setLayoutData(data);<NEW_LINE>// CHECKSTYLE:ON<NEW_LINE>} | = new FormAttachment(100, 0); |
1,108,269 | public static boolean validateSignature(Transaction transaction, byte[] hash, AccountStore accountStore, DynamicPropertiesStore dynamicPropertiesStore) throws PermissionException, SignatureException, SignatureFormatException {<NEW_LINE>Transaction.Contract contract = transaction.getRawData().getContractList().get(0);<NEW_LINE>int permissionId = contract.getPermissionId();<NEW_LINE>byte<MASK><NEW_LINE>AccountCapsule account = accountStore.get(owner);<NEW_LINE>Permission permission = null;<NEW_LINE>if (account == null) {<NEW_LINE>if (permissionId == 0) {<NEW_LINE>permission = AccountCapsule.getDefaultPermission(ByteString.copyFrom(owner));<NEW_LINE>}<NEW_LINE>if (permissionId == 2) {<NEW_LINE>permission = AccountCapsule.createDefaultActivePermission(ByteString.copyFrom(owner), dynamicPropertiesStore);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>permission = account.getPermissionById(permissionId);<NEW_LINE>}<NEW_LINE>if (permission == null) {<NEW_LINE>throw new PermissionException("permission isn't exit");<NEW_LINE>}<NEW_LINE>checkPermission(permissionId, permission, contract);<NEW_LINE>long weight = checkWeight(permission, transaction.getSignatureList(), hash, null);<NEW_LINE>if (weight >= permission.getThreshold()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | [] owner = getOwner(contract); |
1,773,486 | public void log(TraceComponent tc) {<NEW_LINE>Tr.debug(tc, MessageFormat.format("Delayed Class [ {0} ]", getHashText()));<NEW_LINE>Tr.debug(tc, MessageFormat.format(" classInfo [ {0} ]", ((classInfo != null) ? classInfo.getHashText() : null)));<NEW_LINE>Tr.debug(tc, MessageFormat.format(" isArtificial [ {0} ]", Boolean.valueOf(isArtificial)));<NEW_LINE>// only write out the remainder of the messages if 'all' trace is enabled<NEW_LINE>if (!tc.isDumpEnabled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isModifiersSet [ {0} ]", Boolean.valueOf(isModifiersSet)));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" modifiers [ {0} ]", Integer.valueOf(modifiers)));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" packageName [ {0} ]", packageName));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" packageInfo [ {0} ]", ((packageInfo != null) ? packageInfo.getHashText() : null)));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isJavaClass [ {0} ]", Boolean.valueOf(isJavaClass)));<NEW_LINE>if (interfaceNames != null) {<NEW_LINE>for (String interfaceName : interfaceNames) {<NEW_LINE>Tr.dump(tc, MessageFormat.format(" [ {0} ]", interfaceName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isInterface [ {0} ]", isInterface));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isAnnotationClass [ {0} ]", isAnnotationClass));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" superclassName [ {0} ]", superclassName));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" superclass [ {0} ]", ((superclass != null) ? superclass.getHashText() : null)));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isEmptyDeclaredFields [ {0} ]", isEmptyDeclaredFields));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isEmptyDeclaredConstructors [ {0} ]", isEmptyDeclaredConstructors));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isEmptyDeclaredMethods [ {0} ]", isEmptyDeclaredMethods));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isEmptyMethods [ {0} ]", isEmptyMethods));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isDeclaredAnnotationPresent [ {0} ]", isDeclaredAnnotationPresent));<NEW_LINE>Tr.dump(tc, MessageFormat<MASK><NEW_LINE>Tr.dump(tc, MessageFormat.format(" isFieldAnnotationPresent [ {0} ]", isFieldAnnotationPresent));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isMethodAnnotationPresent [ {0} ]", isMethodAnnotationPresent));<NEW_LINE>// Don't log the underlying non-delayed class.<NEW_LINE>// Don't log the annotations.<NEW_LINE>} | .format(" isAnnotationPresent [ {0} ]", isAnnotationPresent)); |
873,017 | private void handleStubDefinition(NodeTraversal t, Node exprResult) {<NEW_LINE>if (!t.inGlobalHoistScope()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>boolean isExternStub = exprResult.isFromExterns();<NEW_LINE>boolean isTypedefStub = isTypedefStubDeclaration(exprResult);<NEW_LINE>// recognize @typedefs only if using this pass for typechecking via<NEW_LINE>// collectProvidedNames. We don't want rewriting to depend on @typedef annotations.<NEW_LINE>boolean isValidTypedefStubDefinition = isTypedefStub && !this.hasRewritingOccurred;<NEW_LINE>if (isValidTypedefStubDefinition || isExternStub) {<NEW_LINE>if (exprResult.getFirstChild().isQualifiedName()) {<NEW_LINE>String name = exprResult.getFirstChild().getQualifiedName();<NEW_LINE>ProvidedName <MASK><NEW_LINE>if (pn != null) {<NEW_LINE>pn.addDefinition(exprResult, t.getChunk());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (isTypedefStub) {<NEW_LINE>checkNestedTypedefProvide(exprResult);<NEW_LINE>}<NEW_LINE>} | pn = providedNames.get(name); |
1,380,566 | public void execute(Collection<Change> changes, String commitMessage) {<NEW_LINE>if (changes.size() > 0 && !ChangesUtil.hasFileChanges(changes)) {<NEW_LINE>WaitForProgressToShow.runOrInvokeLaterAboveProgress(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>Messages.showErrorDialog(myProject, VcsBundle.message("shelve.changes.only.directories")<MASK><NEW_LINE>}<NEW_LINE>}, null, myProject);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final ShelvedChangeList list = ShelveChangesManager.getInstance(myProject).shelveChanges(changes, commitMessage, true);<NEW_LINE>ShelvedChangesViewManager.getInstance(myProject).activateView(list);<NEW_LINE>Change[] changesArray = changes.toArray(new Change[changes.size()]);<NEW_LINE>// todo better under lock<NEW_LINE>ChangeList changeList = ChangesUtil.getChangeListIfOnlyOne(myProject, changesArray);<NEW_LINE>if (changeList instanceof LocalChangeList) {<NEW_LINE>LocalChangeList localChangeList = (LocalChangeList) changeList;<NEW_LINE>if (localChangeList.getChanges().size() == changes.size() && !localChangeList.isReadOnly() && (!localChangeList.isDefault())) {<NEW_LINE>ChangeListManager.getInstance(myProject).removeChangeList(localChangeList.getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (final Exception ex) {<NEW_LINE>LOG.info(ex);<NEW_LINE>WaitForProgressToShow.runOrInvokeLaterAboveProgress(new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>Messages.showErrorDialog(myProject, VcsBundle.message("create.patch.error.title", ex.getMessage()), CommonBundle.getErrorTitle());<NEW_LINE>}<NEW_LINE>}, ModalityState.NON_MODAL, myProject);<NEW_LINE>}<NEW_LINE>} | , VcsBundle.message("shelve.changes.action")); |
1,531,631 | private void processParseTag(Tag parseTag) {<NEW_LINE>for (Tag child : parseTag.getChildren()) {<NEW_LINE>String tagName = child.getName();<NEW_LINE>Map<String, String<MASK><NEW_LINE>switch(tagName) {<NEW_LINE>case TAG_INLINE_FAIL:<NEW_LINE>{<NEW_LINE>String reason = attrs.get(ATTR_REASON);<NEW_LINE>reason = StringUtil.replaceXMLEntities(reason);<NEW_LINE>if (reasonCountMap.containsKey(reason)) {<NEW_LINE>int count = reasonCountMap.get(reason);<NEW_LINE>reasonCountMap.put(reason, count + 1);<NEW_LINE>} else {<NEW_LINE>reasonCountMap.put(reason, 1);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case TAG_PARSE:<NEW_LINE>{<NEW_LINE>processParseTag(child);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case TAG_PHASE:<NEW_LINE>{<NEW_LINE>String phaseName = attrs.get(ATTR_NAME);<NEW_LINE>if (S_PARSE_HIR.equals(phaseName)) {<NEW_LINE>processParseTag(child);<NEW_LINE>} else {<NEW_LINE>logger.warn("Don't know how to handle phase {}", phaseName);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>handleOther(child);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > attrs = child.getAttributes(); |
738,010 | public void run() {<NEW_LINE>long taskExecuteTime = System.currentTimeMillis();<NEW_LINE>Package res = new Package();<NEW_LINE>try {<NEW_LINE>if (!eventMeshTCPServer.getEventMeshTCPConfiguration().eventMeshServerRegistryEnable) {<NEW_LINE>throw new Exception("registry enable config is false, not support");<NEW_LINE>}<NEW_LINE>UserAgent user = <MASK><NEW_LINE>validateUserAgent(user);<NEW_LINE>String group = getGroupOfClient(user);<NEW_LINE>EventMeshRecommendStrategy eventMeshRecommendStrategy = new EventMeshRecommendImpl(eventMeshTCPServer);<NEW_LINE>String eventMeshRecommendResult = eventMeshRecommendStrategy.calculateRecommendEventMesh(group, user.getPurpose());<NEW_LINE>res.setHeader(new Header(RECOMMEND_RESPONSE, OPStatus.SUCCESS.getCode(), OPStatus.SUCCESS.getDesc(), pkg.getHeader().getSeq()));<NEW_LINE>res.setBody(eventMeshRecommendResult);<NEW_LINE>} catch (Exception e) {<NEW_LINE>messageLogger.error("RecommendTask failed|address={}|errMsg={}", ctx.channel().remoteAddress(), e);<NEW_LINE>res.setHeader(new Header(RECOMMEND_RESPONSE, OPStatus.FAIL.getCode(), e.toString(), pkg.getHeader().getSeq()));<NEW_LINE>} finally {<NEW_LINE>writeAndFlush(res, startTime, taskExecuteTime, session.getContext(), session);<NEW_LINE>// session.write2Client(res);<NEW_LINE>}<NEW_LINE>} | (UserAgent) pkg.getBody(); |
721,839 | // already requested in calling method<NEW_LINE>@SuppressWarnings("MissingPermission")<NEW_LINE>public void deleteCalendar(String calendarName) {<NEW_LINE>try {<NEW_LINE>Uri evuri = CalendarContract.Calendars.CONTENT_URI;<NEW_LINE>final ContentResolver contentResolver = cordova.getActivity().getContentResolver();<NEW_LINE>Cursor result = contentResolver.query(evuri, new String[] { CalendarContract.Calendars._ID, CalendarContract.Calendars.NAME, CalendarContract.Calendars.CALENDAR_DISPLAY_NAME <MASK><NEW_LINE>if (result != null) {<NEW_LINE>while (result.moveToNext()) {<NEW_LINE>if (result.getString(1) != null && result.getString(1).equals(calendarName) || result.getString(2) != null && result.getString(2).equals(calendarName)) {<NEW_LINE>long calid = result.getLong(0);<NEW_LINE>Uri deleteUri = ContentUris.withAppendedId(evuri, calid);<NEW_LINE>contentResolver.delete(deleteUri, null, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result.close();<NEW_LINE>}<NEW_LINE>// also delete previously crashing calendars, see https://github.com/EddyVerbruggen/Calendar-PhoneGap-Plugin/issues/241<NEW_LINE>deleteCrashingCalendars(contentResolver);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>System.err.println(t.getMessage());<NEW_LINE>t.printStackTrace();<NEW_LINE>}<NEW_LINE>} | }, null, null, null); |
793,752 | public void marshall(CreateEnvironmentRequest createEnvironmentRequest, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (createEnvironmentRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(createEnvironmentRequest.getCluster(), CLUSTER_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(createEnvironmentRequest.getDeploymentMethod(), DEPLOYMENTMETHOD_BINDING);<NEW_LINE>protocolMarshaller.marshall(createEnvironmentRequest.getEnvironmentName(), ENVIRONMENTNAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(createEnvironmentRequest.getEnvironmentType(), ENVIRONMENTTYPE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createEnvironmentRequest.getInstanceGroup(), INSTANCEGROUP_BINDING);<NEW_LINE>protocolMarshaller.marshall(createEnvironmentRequest.getRole(), ROLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(createEnvironmentRequest.getTaskDefinition(), TASKDEFINITION_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | createEnvironmentRequest.getDeploymentConfiguration(), DEPLOYMENTCONFIGURATION_BINDING); |
444,598 | public Request<ListAttachedUserPoliciesRequest> marshall(ListAttachedUserPoliciesRequest listAttachedUserPoliciesRequest) {<NEW_LINE>if (listAttachedUserPoliciesRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ListAttachedUserPoliciesRequest> request = new DefaultRequest<MASK><NEW_LINE>request.addParameter("Action", "ListAttachedUserPolicies");<NEW_LINE>request.addParameter("Version", "2010-05-08");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (listAttachedUserPoliciesRequest.getUserName() != null) {<NEW_LINE>request.addParameter("UserName", StringUtils.fromString(listAttachedUserPoliciesRequest.getUserName()));<NEW_LINE>}<NEW_LINE>if (listAttachedUserPoliciesRequest.getPathPrefix() != null) {<NEW_LINE>request.addParameter("PathPrefix", StringUtils.fromString(listAttachedUserPoliciesRequest.getPathPrefix()));<NEW_LINE>}<NEW_LINE>if (listAttachedUserPoliciesRequest.getMarker() != null) {<NEW_LINE>request.addParameter("Marker", StringUtils.fromString(listAttachedUserPoliciesRequest.getMarker()));<NEW_LINE>}<NEW_LINE>if (listAttachedUserPoliciesRequest.getMaxItems() != null) {<NEW_LINE>request.addParameter("MaxItems", StringUtils.fromInteger(listAttachedUserPoliciesRequest.getMaxItems()));<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | <ListAttachedUserPoliciesRequest>(listAttachedUserPoliciesRequest, "AmazonIdentityManagement"); |
743,940 | public void apply(Skeleton skeleton, float lastTime, float time, @Null Array<Event> events, float alpha, MixBlend blend, MixDirection direction) {<NEW_LINE>Bone bone = skeleton.bones.get(boneIndex);<NEW_LINE>if (!bone.active)<NEW_LINE>return;<NEW_LINE><MASK><NEW_LINE>if (time < frames[0]) {<NEW_LINE>// Time is before first frame.<NEW_LINE>switch(blend) {<NEW_LINE>case setup:<NEW_LINE>bone.scaleX = bone.data.scaleX;<NEW_LINE>return;<NEW_LINE>case first:<NEW_LINE>bone.scaleX += (bone.data.scaleX - bone.scaleX) * alpha;<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>float x = getCurveValue(time) * bone.data.scaleX;<NEW_LINE>if (alpha == 1) {<NEW_LINE>if (blend == add)<NEW_LINE>bone.scaleX += x - bone.data.scaleX;<NEW_LINE>else<NEW_LINE>bone.scaleX = x;<NEW_LINE>} else {<NEW_LINE>// Mixing out uses sign of setup or current pose, else use sign of key.<NEW_LINE>float bx;<NEW_LINE>if (direction == out) {<NEW_LINE>switch(blend) {<NEW_LINE>case setup:<NEW_LINE>bx = bone.data.scaleX;<NEW_LINE>bone.scaleX = bx + (Math.abs(x) * Math.signum(bx) - bx) * alpha;<NEW_LINE>break;<NEW_LINE>case first:<NEW_LINE>case replace:<NEW_LINE>bx = bone.scaleX;<NEW_LINE>bone.scaleX = bx + (Math.abs(x) * Math.signum(bx) - bx) * alpha;<NEW_LINE>break;<NEW_LINE>case add:<NEW_LINE>bone.scaleX += (x - bone.data.scaleX) * alpha;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>switch(blend) {<NEW_LINE>case setup:<NEW_LINE>bx = Math.abs(bone.data.scaleX) * Math.signum(x);<NEW_LINE>bone.scaleX = bx + (x - bx) * alpha;<NEW_LINE>break;<NEW_LINE>case first:<NEW_LINE>case replace:<NEW_LINE>bx = Math.abs(bone.scaleX) * Math.signum(x);<NEW_LINE>bone.scaleX = bx + (x - bx) * alpha;<NEW_LINE>break;<NEW_LINE>case add:<NEW_LINE>bone.scaleX += (x - bone.data.scaleX) * alpha;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | float[] frames = this.frames; |
181,981 | public T visitObjectKeyValue(ObjectKeyValueContext ctx) {<NEW_LINE>TerminalNode fieldKeyTerm = ctx.STRING();<NEW_LINE>String fieldKey = fixString(fieldKeyTerm);<NEW_LINE>StringToken fieldKeyToken = code(new StringToken(fieldKey), fieldKeyTerm);<NEW_LINE>//<NEW_LINE>ObjectVariable objectVariable = (ObjectVariable) this.instStack.peek();<NEW_LINE>AnyObjectContext polymericObject = ctx.anyObject();<NEW_LINE>if (polymericObject != null) {<NEW_LINE>polymericObject.accept(this);<NEW_LINE>Variable valueExp = (Variable<MASK><NEW_LINE>objectVariable.addField(fieldKeyToken, valueExp);<NEW_LINE>} else {<NEW_LINE>EnterRouteVariable enterRoute = code(new EnterRouteVariable(RouteType.Expr, null), fieldKeyTerm);<NEW_LINE>NameRouteVariable nameRoute = code(new NameRouteVariable(enterRoute, fieldKeyToken), fieldKeyTerm);<NEW_LINE>objectVariable.addField(fieldKeyToken, nameRoute);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | ) this.instStack.pop(); |
237,955 | private void destroyUnusedInvokers(Map<String, Invoker<T>> oldUrlInvokerMap, Map<String, Invoker<T>> newUrlInvokerMap) {<NEW_LINE>if (newUrlInvokerMap == null || newUrlInvokerMap.size() == 0) {<NEW_LINE>destroyAllInvokers();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (oldUrlInvokerMap == null || oldUrlInvokerMap.size() == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, Invoker<T>> entry : oldUrlInvokerMap.entrySet()) {<NEW_LINE>Invoker<T> invoker = entry.getValue();<NEW_LINE>if (invoker != null) {<NEW_LINE>try {<NEW_LINE>invoker.destroyAll();<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("destroy invoker[" + invoker.getUrl() + "] success. ");<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("destroy invoker[" + invoker.getUrl() + "] failed. " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.info(<MASK><NEW_LINE>} | oldUrlInvokerMap.size() + " deprecated invokers deleted."); |
947,954 | public Expression visitGstringPath(final GstringPathContext ctx) {<NEW_LINE>VariableExpression variableExpression = new VariableExpression(this.visitIdentifier(ctx.identifier()));<NEW_LINE>if (asBoolean(ctx.GStringPathPart())) {<NEW_LINE>Expression propertyExpression = // GRECLIPSE add<NEW_LINE>ctx.GStringPathPart().stream().map(e -> configureAST((Expression) new ConstantExpression(e.getText().substring(1)), e)).peek(expression -> {<NEW_LINE>expression.setStart(expression.getStart() + 1);<NEW_LINE>int[] row_col = locationSupport.getRowCol(expression.getStart());<NEW_LINE>expression<MASK><NEW_LINE>expression.setColumnNumber(row_col[1]);<NEW_LINE>}).// GRECLIPSE end<NEW_LINE>reduce(configureAST(variableExpression, ctx.identifier()), (r, e) -> {<NEW_LINE>PropertyExpression pe = configureAST(new PropertyExpression(r, e), e);<NEW_LINE>pe.setStart(pe.getObjectExpression().getStart());<NEW_LINE>pe.setLineNumber(pe.getObjectExpression().getLineNumber());<NEW_LINE>pe.setColumnNumber(pe.getObjectExpression().getColumnNumber());<NEW_LINE>return pe;<NEW_LINE>});<NEW_LINE>// GRECLIPSE end<NEW_LINE>return propertyExpression;<NEW_LINE>// GRECLIPSE end<NEW_LINE>}<NEW_LINE>return variableExpression;<NEW_LINE>// GRECLIPSE end<NEW_LINE>} | .setLineNumber(row_col[0]); |
657,817 | private static void copyToRemoteFolder(String fileName, String localFolder, File remoteFolder, boolean missingFileOk) throws SharedConfigurationException {<NEW_LINE>logger.log(Level.INFO, "Uploading {0} to {1}", new Object[] { fileName, remoteFolder.getAbsolutePath() });<NEW_LINE>File localFile = new File(localFolder, fileName);<NEW_LINE>if (!localFile.exists()) {<NEW_LINE>Path deleteRemote = Paths.get(remoteFolder.toString(), fileName);<NEW_LINE>try {<NEW_LINE>if (deleteRemote.toFile().exists()) {<NEW_LINE>deleteRemote.toFile().delete();<NEW_LINE>}<NEW_LINE>} catch (SecurityException ex) {<NEW_LINE>logger.log(<MASK><NEW_LINE>throw new SharedConfigurationException("Shared configuration file " + deleteRemote.toString() + " could not be deleted.");<NEW_LINE>}<NEW_LINE>if (!missingFileOk) {<NEW_LINE>logger.log(Level.SEVERE, "Local configuration file {0} does not exist", localFile.getAbsolutePath());<NEW_LINE>throw new SharedConfigurationException("Local configuration file " + localFile.getAbsolutePath() + " does not exist");<NEW_LINE>} else {<NEW_LINE>logger.log(Level.INFO, "Local configuration file {0} does not exist", localFile.getAbsolutePath());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>FileUtils.copyFileToDirectory(localFile, remoteFolder);<NEW_LINE>} catch (IOException ex) {<NEW_LINE>throw new SharedConfigurationException(String.format("Failed to copy %s to %s", localFile.getAbsolutePath(), remoteFolder.getAbsolutePath()), ex);<NEW_LINE>}<NEW_LINE>} | Level.SEVERE, "Shared configuration {0} does not exist on local node, but unable to remove remote copy", fileName); |
751,695 | public void fileSessionDataStore() {<NEW_LINE>// tag::filesessiondatastore[]<NEW_LINE>// create a context<NEW_LINE>WebAppContext app1 = new WebAppContext();<NEW_LINE>app1.setContextPath("/app1");<NEW_LINE>// First, we create a DefaultSessionCache<NEW_LINE>DefaultSessionCache cache = new <MASK><NEW_LINE>cache.setEvictionPolicy(SessionCache.NEVER_EVICT);<NEW_LINE>cache.setFlushOnResponseCommit(true);<NEW_LINE>cache.setInvalidateOnShutdown(false);<NEW_LINE>cache.setRemoveUnloadableSessions(true);<NEW_LINE>cache.setSaveOnCreate(true);<NEW_LINE>// Now, we configure a FileSessionDataStore<NEW_LINE>FileSessionDataStore store = new FileSessionDataStore();<NEW_LINE>store.setStoreDir(new File("/tmp/sessions"));<NEW_LINE>store.setGracePeriodSec(3600);<NEW_LINE>store.setSavePeriodSec(0);<NEW_LINE>// Tell the cache to use the store<NEW_LINE>cache.setSessionDataStore(store);<NEW_LINE>// Tell the contex to use the cache/store combination<NEW_LINE>app1.getSessionHandler().setSessionCache(cache);<NEW_LINE>// end::filesessiondatastore[]<NEW_LINE>} | DefaultSessionCache(app1.getSessionHandler()); |
56,319 | public SendChannelMessageResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>SendChannelMessageResult sendChannelMessageResult = new SendChannelMessageResult();<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 sendChannelMessageResult;<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("ChannelArn", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sendChannelMessageResult.setChannelArn(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("MessageId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sendChannelMessageResult.setMessageId(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Status", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>sendChannelMessageResult.setStatus(ChannelMessageStatusStructureJsonUnmarshaller.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 sendChannelMessageResult;<NEW_LINE>} | class).unmarshall(context)); |
1,808,812 | public Table history(@ShellOption(value = { "", "--name" }, help = "the name of the stream", valueProvider = StreamNameValueProvider.class) String name) {<NEW_LINE>Collection<Release> releases = streamOperations().history(name);<NEW_LINE>LinkedHashMap<String, Object> <MASK><NEW_LINE>headers.put("version", "Version");<NEW_LINE>headers.put("info.lastDeployed", "Last updated");<NEW_LINE>headers.put("info.status.statusCode", "Status");<NEW_LINE>headers.put("pkg.metadata.name", "Package Name");<NEW_LINE>headers.put("pkg.metadata.version", "Package Version");<NEW_LINE>headers.put("info.description", "Description");<NEW_LINE>TableModel model = new BeanListTableModel<>(releases, headers);<NEW_LINE>TableBuilder tableBuilder = new TableBuilder(model);<NEW_LINE>DataFlowTables.applyStyle(tableBuilder);<NEW_LINE>return tableBuilder.build();<NEW_LINE>} | headers = new LinkedHashMap<>(); |
1,014,630 | private void forwardResults(BatchIterator<Row> it, boolean isLast) {<NEW_LINE>multiBucketBuilder.build(buckets);<NEW_LINE>AtomicInteger numActiveRequests = new <MASK><NEW_LINE>for (int i = 0; i < downstreams.size(); i++) {<NEW_LINE>Downstream downstream = downstreams.get(i);<NEW_LINE>if (downstream.needsMoreData == false) {<NEW_LINE>countdownAndMaybeContinue(it, numActiveRequests, true);<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (traceEnabled) {<NEW_LINE>LOGGER.trace("forwardResults targetNode={} jobId={} targetPhase={}/{} bucket={} isLast={}", downstream.nodeId, jobId, targetPhaseId, inputId, bucketIdx, isLast);<NEW_LINE>}<NEW_LINE>distributedResultAction.pushResult(downstream.nodeId, new DistributedResultRequest(jobId, targetPhaseId, inputId, bucketIdx, buckets[i], isLast), new ActionListener<>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onResponse(DistributedResultResponse response) {<NEW_LINE>downstream.needsMoreData = response.needMore();<NEW_LINE>countdownAndMaybeContinue(it, numActiveRequests, false);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(Exception e) {<NEW_LINE>failure = e;<NEW_LINE>downstream.needsMoreData = false;<NEW_LINE>// continue because it's necessary to send something to downstreams still waiting for data<NEW_LINE>countdownAndMaybeContinue(it, numActiveRequests, false);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | AtomicInteger(downstreams.size()); |
73,357 | public void execute() {<NEW_LINE>CallContext.current().setEventDetails("Vm Id: " + this._uuidMgr.getUuid(VirtualMachine.class, getVmId()) + " Nic Id: " + this._uuidMgr.getUuid(Nic.class, getNicId()));<NEW_LINE>UserVm result = _userVmService.updateDefaultNicForVirtualMachine(this);<NEW_LINE>ArrayList<VMDetails> dc = new ArrayList<VMDetails>();<NEW_LINE>dc.add(VMDetails.valueOf("nics"));<NEW_LINE>EnumSet<VMDetails> details = EnumSet.copyOf(dc);<NEW_LINE>if (result != null) {<NEW_LINE>UserVmResponse response = _responseGenerator.createUserVmResponse(getResponseView(), "virtualmachine", details<MASK><NEW_LINE>response.setResponseName(getCommandName());<NEW_LINE>setResponseObject(response);<NEW_LINE>} else {<NEW_LINE>throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to set default nic for VM. Refer to server logs for details.");<NEW_LINE>}<NEW_LINE>} | , result).get(0); |
1,512,237 | protected boolean canUseGlyphRendering(FontKey fontKey, boolean awtIgnoreMissingFont) {<NEW_LINE>Map<Attribute, Object> fontAttributes = new HashMap<>();<NEW_LINE>fontKey.fontAttribute.putAttributes(fontAttributes);<NEW_LINE>fontAttributes.put(TextAttribute.SIZE, 10f);<NEW_LINE>int style = 0;<NEW_LINE>if (fontKey.italic) {<NEW_LINE>style |= java.awt.Font.ITALIC;<NEW_LINE>fontAttributes.put(TextAttribute.POSTURE, TextAttribute.POSTURE_OBLIQUE);<NEW_LINE>}<NEW_LINE>if (fontKey.bold) {<NEW_LINE>style |= java.awt.Font.BOLD;<NEW_LINE>fontAttributes.put(TextAttribute.WEIGHT, TextAttribute.WEIGHT_BOLD);<NEW_LINE>}<NEW_LINE>Font pdfFont = pdfProducer.<MASK><NEW_LINE>BaseFont baseFont = pdfFont.getBaseFont();<NEW_LINE>if (baseFont.getFontType() != BaseFont.FONT_TYPE_TTUNI || baseFont.isFontSpecific()) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("pdf font for " + fontKey + " has type " + baseFont.getFontType() + ", symbol " + baseFont.isFontSpecific() + ", cannot use glyph rendering");<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>java.awt.Font awtFont = pdfProducer.getContext().getFontUtil().getAwtFontFromBundles(fontKey.fontAttribute, style, 10f, fontKey.locale, awtIgnoreMissingFont);<NEW_LINE>if (awtFont == null) {<NEW_LINE>awtFont = new java.awt.Font(fontAttributes);<NEW_LINE>}<NEW_LINE>String awtFontName = awtFont.getFontName();<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(fontKey + " resolved to awt font " + awtFontName);<NEW_LINE>}<NEW_LINE>// we need the fonts to be identical.<NEW_LINE>// it would be safer to only allow fonts from extensions,<NEW_LINE>// but for now we are just checking the font names.<NEW_LINE>// we need to compare full names because we can't get the base name from awt.<NEW_LINE>String[][] pdfFontNames = baseFont.getFullFontName();<NEW_LINE>boolean nameMatch = false;<NEW_LINE>for (String[] nameArray : pdfFontNames) {<NEW_LINE>if (nameArray.length >= 4) {<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(fontKey + " resolved to pdf font " + nameArray[3]);<NEW_LINE>}<NEW_LINE>if (awtFontName.equals(nameArray[3])) {<NEW_LINE>nameMatch = true;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return nameMatch;<NEW_LINE>} | getFont(fontAttributes, fontKey.locale); |
1,476,683 | public com.alibaba.otter.node.etl.model.protobuf.BatchProto.RowBatch buildPartial() {<NEW_LINE>com.alibaba.otter.node.etl.model.protobuf.BatchProto.RowBatch result = new com.alibaba.otter.node.etl.model.<MASK><NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>if (identityBuilder_ == null) {<NEW_LINE>result.identity_ = identity_;<NEW_LINE>} else {<NEW_LINE>result.identity_ = identityBuilder_.build();<NEW_LINE>}<NEW_LINE>if (rowsBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>rows_ = java.util.Collections.unmodifiableList(rows_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>}<NEW_LINE>result.rows_ = rows_;<NEW_LINE>} else {<NEW_LINE>result.rows_ = rowsBuilder_.build();<NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>} | protobuf.BatchProto.RowBatch(this); |
165,173 | final DeleteTapeArchiveResult executeDeleteTapeArchive(DeleteTapeArchiveRequest deleteTapeArchiveRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteTapeArchiveRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteTapeArchiveRequest> request = null;<NEW_LINE>Response<DeleteTapeArchiveResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new DeleteTapeArchiveRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteTapeArchiveRequest));<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, "Storage Gateway");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteTapeArchive");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteTapeArchiveResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteTapeArchiveResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
591,602 | public int write(float[] buffer, int offset, int numSamples) {<NEW_LINE>if (numSamples > mData.length) {<NEW_LINE>throw new IllegalArgumentException("Tried to write more than maxSamples.");<NEW_LINE>}<NEW_LINE>if ((mCursor + numSamples) > mData.length) {<NEW_LINE>// Wraps so write in two parts.<NEW_LINE><MASK><NEW_LINE>System.arraycopy(buffer, offset, mData, mCursor, numWrite1);<NEW_LINE>offset += numWrite1;<NEW_LINE>int numWrite2 = numSamples - numWrite1;<NEW_LINE>System.arraycopy(buffer, offset, mData, 0, numWrite2);<NEW_LINE>mCursor = numWrite2;<NEW_LINE>} else {<NEW_LINE>System.arraycopy(buffer, offset, mData, mCursor, numSamples);<NEW_LINE>mCursor += numSamples;<NEW_LINE>if (mCursor == mData.length) {<NEW_LINE>mCursor = 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mNumValidSamples += numSamples;<NEW_LINE>if (mNumValidSamples > mData.length) {<NEW_LINE>mNumValidSamples = mData.length;<NEW_LINE>}<NEW_LINE>return numSamples;<NEW_LINE>} | int numWrite1 = mData.length - mCursor; |
414,987 | public ListTemplatesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListTemplatesResult listTemplatesResult = new ListTemplatesResult();<NEW_LINE>listTemplatesResult.setStatus(context.getHttpResponse().getStatusCode());<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 listTemplatesResult;<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("TemplateSummaryList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listTemplatesResult.setTemplateSummaryList(new ListUnmarshaller<TemplateSummary>(TemplateSummaryJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("NextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listTemplatesResult.setNextToken(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("RequestId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listTemplatesResult.setRequestId(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 listTemplatesResult;<NEW_LINE>} | int originalDepth = context.getCurrentDepth(); |
1,269,241 | public ScanningMode enter(CtElement element) {<NEW_LINE>final CtTypeReference<?> typeRef = (CtTypeReference<?>) element;<NEW_LINE><MASK><NEW_LINE>if (targetSuperTypes.contains(qName)) {<NEW_LINE>while (!currentSubTypes.isEmpty()) {<NEW_LINE>final CtTypeReference<?> currentTypeRef = currentSubTypes.pop();<NEW_LINE>String currentQName = currentTypeRef.getQualifiedName();<NEW_LINE>if (!targetSuperTypes.contains(currentQName)) {<NEW_LINE>targetSuperTypes.add(currentQName);<NEW_LINE>outputConsumer.accept((T) currentTypeRef.getTypeDeclaration());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// we do not have to go deeper into super inheritance hierarchy. Skip visiting of further super types<NEW_LINE>// but continue visiting of siblings (do not terminate query)<NEW_LINE>return ScanningMode.SKIP_ALL;<NEW_LINE>}<NEW_LINE>if (allVisitedTypeNames.add(qName) == false) {<NEW_LINE>return ScanningMode.SKIP_ALL;<NEW_LINE>}<NEW_LINE>currentSubTypes.push(typeRef);<NEW_LINE>return ScanningMode.NORMAL;<NEW_LINE>} | String qName = typeRef.getQualifiedName(); |
1,764,090 | public static ListProductByTagsResponse unmarshall(ListProductByTagsResponse listProductByTagsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listProductByTagsResponse.setRequestId(_ctx.stringValue("ListProductByTagsResponse.RequestId"));<NEW_LINE>listProductByTagsResponse.setSuccess<MASK><NEW_LINE>listProductByTagsResponse.setErrorMessage(_ctx.stringValue("ListProductByTagsResponse.ErrorMessage"));<NEW_LINE>listProductByTagsResponse.setCode(_ctx.stringValue("ListProductByTagsResponse.Code"));<NEW_LINE>List<ProductInfo> productInfos = new ArrayList<ProductInfo>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListProductByTagsResponse.ProductInfos.Length"); i++) {<NEW_LINE>ProductInfo productInfo = new ProductInfo();<NEW_LINE>productInfo.setProductName(_ctx.stringValue("ListProductByTagsResponse.ProductInfos[" + i + "].ProductName"));<NEW_LINE>productInfo.setProductKey(_ctx.stringValue("ListProductByTagsResponse.ProductInfos[" + i + "].ProductKey"));<NEW_LINE>productInfo.setCreateTime(_ctx.longValue("ListProductByTagsResponse.ProductInfos[" + i + "].CreateTime"));<NEW_LINE>productInfo.setDescription(_ctx.stringValue("ListProductByTagsResponse.ProductInfos[" + i + "].Description"));<NEW_LINE>productInfo.setNodeType(_ctx.integerValue("ListProductByTagsResponse.ProductInfos[" + i + "].NodeType"));<NEW_LINE>productInfos.add(productInfo);<NEW_LINE>}<NEW_LINE>listProductByTagsResponse.setProductInfos(productInfos);<NEW_LINE>return listProductByTagsResponse;<NEW_LINE>} | (_ctx.booleanValue("ListProductByTagsResponse.Success")); |
910,629 | private void runJITWatch() throws IOException {<NEW_LINE>JITWatchConfig config = logParser.getConfig();<NEW_LINE>List<String> sourceLocations = new ArrayList<>(config.getSourceLocations());<NEW_LINE>List<String> classLocations = new ArrayList<>(config.getConfiguredClassLocations());<NEW_LINE>String sandboxSourceDirString = SANDBOX_SOURCE_DIR.toString();<NEW_LINE><MASK><NEW_LINE>boolean configChanged = false;<NEW_LINE>if (!sourceLocations.contains(sandboxSourceDirString)) {<NEW_LINE>configChanged = true;<NEW_LINE>sourceLocations.add(sandboxSourceDirString);<NEW_LINE>}<NEW_LINE>if (!classLocations.contains(sandboxClassDirString)) {<NEW_LINE>configChanged = true;<NEW_LINE>classLocations.add(sandboxClassDirString);<NEW_LINE>}<NEW_LINE>File jdkSrcZip = FileUtil.getJDKSourceZip();<NEW_LINE>if (jdkSrcZip != null) {<NEW_LINE>String jdkSourceZipString = jdkSrcZip.toPath().toString();<NEW_LINE>if (!sourceLocations.contains(jdkSourceZipString)) {<NEW_LINE>configChanged = true;<NEW_LINE>sourceLocations.add(jdkSourceZipString);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>config.setSourceLocations(sourceLocations);<NEW_LINE>config.setClassLocations(classLocations);<NEW_LINE>if (configChanged) {<NEW_LINE>config.saveConfig();<NEW_LINE>}<NEW_LINE>logListener.handleLogEntry("Parsing JIT log: " + sandboxLogFile.toString());<NEW_LINE>logParser.processLogFile(sandboxLogFile, sandboxStage);<NEW_LINE>logListener.handleLogEntry("Parsing complete");<NEW_LINE>} | String sandboxClassDirString = SANDBOX_CLASS_DIR.toString(); |
954,382 | public static Trades adaptBleutradeMarketHistory(List<BleutradeTrade> bleutradeTrades, CurrencyPair currencyPair) {<NEW_LINE>List<Trade> trades = new ArrayList<>();<NEW_LINE>for (BleutradeTrade bleutradeTrade : bleutradeTrades) {<NEW_LINE>Trade.Builder builder = new Trade.Builder();<NEW_LINE>builder.currencyPair(currencyPair);<NEW_LINE>builder.<MASK><NEW_LINE>builder.timestamp(BleutradeUtils.toDate(bleutradeTrade.getTimeStamp()));<NEW_LINE>builder.originalAmount(bleutradeTrade.getQuantity());<NEW_LINE>builder.type(bleutradeTrade.getOrderType().equals("BUY") ? OrderType.BID : OrderType.ASK);<NEW_LINE>trades.add(builder.build());<NEW_LINE>}<NEW_LINE>return new Trades(trades, TradeSortType.SortByTimestamp);<NEW_LINE>} | price(bleutradeTrade.getPrice()); |
1,161,730 | public void connect(IGenericType type, IType typeHandle, IType superclassHandle, IType[] superinterfaceHandles) {<NEW_LINE>if (typeHandle == null)<NEW_LINE>return;<NEW_LINE>if (TypeHierarchy.DEBUG) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.// $NON-NLS-1$<NEW_LINE>println("Connecting: " + ((JavaElement) typeHandle).toStringWithAncestors());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.// $NON-NLS-1$<NEW_LINE>println(" to superclass: " + (// $NON-NLS-1$<NEW_LINE>superclassHandle == null ? "<None>" : ((JavaElement) superclassHandle).toStringWithAncestors()));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.print(" and superinterfaces:");<NEW_LINE>if (superinterfaceHandles == null || superinterfaceHandles.length == 0) {<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.println(" <None>");<NEW_LINE>} else {<NEW_LINE>System.out.println();<NEW_LINE>for (int i = 0, length = superinterfaceHandles.length; i < length; i++) {<NEW_LINE>if (superinterfaceHandles[i] == null)<NEW_LINE>continue;<NEW_LINE>// $NON-NLS-1$<NEW_LINE>System.out.// $NON-NLS-1$<NEW_LINE>println(" " + ((JavaElement) superinterfaceHandles[i]).toStringWithAncestors());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// now do the caching<NEW_LINE>switch(TypeDeclaration.kind(type.getModifiers())) {<NEW_LINE>case TypeDeclaration.CLASS_DECL:<NEW_LINE>case TypeDeclaration.ENUM_DECL:<NEW_LINE>if (superclassHandle == null) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>this.hierarchy.cacheSuperclass(typeHandle, superclassHandle);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case TypeDeclaration.INTERFACE_DECL:<NEW_LINE>case TypeDeclaration.ANNOTATION_TYPE_DECL:<NEW_LINE>case TypeDeclaration.RECORD_DECL:<NEW_LINE>// https://bugs.eclipse.org/bugs/show_bug.cgi?id=329663<NEW_LINE>if (this.hierarchy.typeToSuperInterfaces.get(typeHandle) == null)<NEW_LINE>this.hierarchy.addInterface(typeHandle);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (superinterfaceHandles == null) {<NEW_LINE>superinterfaceHandles = TypeHierarchy.NO_TYPE;<NEW_LINE>}<NEW_LINE>this.hierarchy.cacheSuperInterfaces(typeHandle, superinterfaceHandles);<NEW_LINE>// record flags<NEW_LINE>this.hierarchy.cacheFlags(typeHandle, type.getModifiers());<NEW_LINE>} | this.hierarchy.addRootClass(typeHandle); |
503,183 | private PaymentMethodCreateParams extractPaymentMethodCreateParams(final ReadableMap options) {<NEW_LINE>ReadableMap cardParams = getMapOrNull(options, "card");<NEW_LINE>ReadableMap billingDetailsParams = getMapOrNull(options, "billingDetails");<NEW_LINE>ReadableMap metadataParams = getMapOrNull(options, "metadata");<NEW_LINE>PaymentMethodCreateParams.Card card = null;<NEW_LINE>PaymentMethod.BillingDetails billingDetails = null;<NEW_LINE>Address address = null;<NEW_LINE>Map<String, String> metadata = new HashMap<>();<NEW_LINE>if (metadataParams != null) {<NEW_LINE>ReadableMapKeySetIterator iter = metadataParams.keySetIterator();<NEW_LINE>while (iter.hasNextKey()) {<NEW_LINE>String key = iter.nextKey();<NEW_LINE>metadata.put(key<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (billingDetailsParams != null) {<NEW_LINE>ReadableMap addressParams = getMapOrNull(billingDetailsParams, "address");<NEW_LINE>if (addressParams != null) {<NEW_LINE>address = new Address.Builder().setCity(getStringOrNull(addressParams, "city")).setCountry(getStringOrNull(addressParams, "country")).setLine1(getStringOrNull(addressParams, "line1")).setLine2(getStringOrNull(addressParams, "line2")).setPostalCode(getStringOrNull(addressParams, "postalCode")).setState(getStringOrNull(addressParams, "state")).build();<NEW_LINE>}<NEW_LINE>billingDetails = new PaymentMethod.BillingDetails.Builder().setAddress(address).setEmail(getStringOrNull(billingDetailsParams, "email")).setName(getStringOrNull(billingDetailsParams, "name")).setPhone(getStringOrNull(billingDetailsParams, "phone")).build();<NEW_LINE>}<NEW_LINE>if (cardParams != null) {<NEW_LINE>String token = getStringOrNull(cardParams, "token");<NEW_LINE>if (token != null) {<NEW_LINE>card = PaymentMethodCreateParams.Card.create(token);<NEW_LINE>} else {<NEW_LINE>card = new PaymentMethodCreateParams.Card.Builder().setCvc(cardParams.getString("cvc")).setExpiryMonth(cardParams.getInt("expMonth")).setExpiryYear(cardParams.getInt("expYear")).setNumber(cardParams.getString("number")).build();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return PaymentMethodCreateParams.create(card, billingDetails, metadata);<NEW_LINE>} | , metadataParams.getString(key)); |
1,583,731 | public boolean upload(Sketch data, Uploader uploader, String suggestedClassName, boolean usingProgrammer, boolean noUploadPort, List<String> warningsAccumulator) throws Exception {<NEW_LINE>if (uploader == null)<NEW_LINE>uploader = getUploaderByPreferences(noUploadPort);<NEW_LINE>boolean success = false;<NEW_LINE>if (uploader.requiresAuthorization() && !PreferencesData.has(uploader.getAuthorizationKey())) {<NEW_LINE>BaseNoGui.showError(tr("Authorization required"), tr("No authorization data found"), null);<NEW_LINE>}<NEW_LINE>boolean useNewWarningsAccumulator = false;<NEW_LINE>if (warningsAccumulator == null) {<NEW_LINE><MASK><NEW_LINE>useNewWarningsAccumulator = true;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>success = uploader.uploadUsingPreferences(data.getFolder(), data.getBuildPath().getAbsolutePath(), suggestedClassName, usingProgrammer, warningsAccumulator);<NEW_LINE>} finally {<NEW_LINE>if (uploader.requiresAuthorization() && !success) {<NEW_LINE>PreferencesData.remove(uploader.getAuthorizationKey());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (useNewWarningsAccumulator) {<NEW_LINE>for (String warning : warningsAccumulator) {<NEW_LINE>System.out.print(tr("Warning"));<NEW_LINE>System.out.print(": ");<NEW_LINE>System.out.println(warning);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return success;<NEW_LINE>} | warningsAccumulator = new LinkedList<>(); |
1,849,836 | private DataSource createDataSource() {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>String message = String.format("Datasource[name=%s, Driver=%s] created,connection url:%s", name, dataSourceConfigure.getDriverClass(), dataSourceConfigure.getConnectionUrl());<NEW_LINE>PoolProperties poolProperties = poolPropertiesHelper.convert(dataSourceConfigure);<NEW_LINE>preHandleValidator(poolProperties, clusterConnValidator);<NEW_LINE>DalTomcatDataSource ds = new DalTomcatDataSource(poolProperties, clusterConnValidator);<NEW_LINE>LOGGER.logTransaction(DalLogTypes.DAL_DATASOURCE, String.format(DATASOURCE_CREATE_DATASOURCE, name), message, startTime);<NEW_LINE>LOGGER.info(message);<NEW_LINE>return ds;<NEW_LINE>} catch (Throwable e) {<NEW_LINE>String message = String.format("Error creating datasource for %s", name);<NEW_LINE>LOGGER.logTransaction(DalLogTypes.DAL_DATASOURCE, String.format(DATASOURCE_CREATE_DATASOURCE, name), message, e, startTime);<NEW_LINE>LOGGER.error(message, e);<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | long startTime = System.currentTimeMillis(); |
1,010,024 | private static void tryOperator(RegressionEnvironment env, RegressionPath path, AtomicInteger milestone, String operator, Object[][] testdata) {<NEW_LINE>env.compileDeploy("@name('s0') context EverySupportBean " + "select theString as c0,intPrimitive as c1,context.sb.p00 as c2 " + "from SupportBean(" + operator + ")", path);<NEW_LINE>env.addListener("s0");<NEW_LINE>// initiate<NEW_LINE>env.sendEventBean(new SupportBean_S0(10, "S01"));<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>for (int i = 0; i < testdata.length; i++) {<NEW_LINE>SupportBean bean = new SupportBean();<NEW_LINE>Object testValue = testdata[i][0];<NEW_LINE>if (testValue instanceof Integer) {<NEW_LINE>bean.setIntBoxed((Integer) testValue);<NEW_LINE>} else {<NEW_LINE>bean.setShortBoxed((Short) testValue);<NEW_LINE>}<NEW_LINE>boolean expected = (Boolean<MASK><NEW_LINE>env.sendEventBean(bean);<NEW_LINE>env.assertListenerInvokedFlag("s0", expected, "Failed at " + i);<NEW_LINE>}<NEW_LINE>env.undeployModuleContaining("s0");<NEW_LINE>} | ) testdata[i][1]; |
540,149 | protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed) {<NEW_LINE>if (isStartEditingEvent(e, false)) {<NEW_LINE>// It is an action which is supposed to start cell editing, but it is not<NEW_LINE>// typing any character. Such actions are F2, Insert and Ctrl+T in the Gantt chart.<NEW_LINE>// We want to select all existing text but do not clear it.<NEW_LINE>putClientProperty("GPTreeTableBase.selectAll", true);<NEW_LINE>putClientProperty("GPTreeTableBase.clearText", false);<NEW_LINE>} else {<NEW_LINE>putClientProperty("GPTreeTableBase.selectAll", false);<NEW_LINE>putClientProperty("GPTreeTableBase.clearText", true);<NEW_LINE>// Otherwise let's check if it is a character and ctrl/meta is not pressed.<NEW_LINE>if (e.getKeyChar() != KeyEvent.CHAR_UNDEFINED && !e.isMetaDown() && !e.isControlDown()) {<NEW_LINE>// In this case we want to clear existing text.<NEW_LINE>putClientProperty("GPTreeTableBase.clearText", true);<NEW_LINE>} else {<NEW_LINE>putClientProperty("GPTreeTableBase.clearText", false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (e.getKeyChar() == '>' && ((ks.getModifiers() | KeyEvent.CTRL_DOWN_MASK) > 0)) {<NEW_LINE>return super.processKeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_GREATER, ks.getModifiers()), e, condition, pressed);<NEW_LINE>}<NEW_LINE>if (e.getKeyChar() == '<' && ((ks.getModifiers() | KeyEvent.CTRL_DOWN_MASK) > 0)) {<NEW_LINE>return super.processKeyBinding(KeyStroke.getKeyStroke(KeyEvent.VK_LESS, ks.getModifiers()<MASK><NEW_LINE>}<NEW_LINE>// See also overridden method editCellAt.<NEW_LINE>return super.processKeyBinding(ks, e, condition, pressed);<NEW_LINE>} | ), e, condition, pressed); |
1,204,485 | public void delete(OAtomicOperation atomicOperation) {<NEW_LINE>executeInsideComponentOperation(atomicOperation, operation -> {<NEW_LINE>final Lock lock = FILE_LOCK_MANAGER.acquireExclusiveLock(fileId);<NEW_LINE>try {<NEW_LINE>final long size = size();<NEW_LINE>if (size > 0) {<NEW_LINE>throw new NotEmptyComponentCanNotBeRemovedException("Ridbag " + getName() + ":" + rootBucketPointer.getPageIndex() + ":" + rootBucketPointer.<MASK><NEW_LINE>}<NEW_LINE>final Queue<OBonsaiBucketPointer> subTreesToDelete = new LinkedList<>();<NEW_LINE>subTreesToDelete.add(rootBucketPointer);<NEW_LINE>recycleSubTrees(subTreesToDelete, atomicOperation);<NEW_LINE>final OCacheEntry sysCacheEntry = loadPageForWrite(atomicOperation, fileId, SYS_BUCKET.getPageIndex(), false, true);<NEW_LINE>try {<NEW_LINE>final OSysBucket sysBucket = new OSysBucket(sysCacheEntry);<NEW_LINE>sysBucket.decrementTreesCount();<NEW_LINE>} finally {<NEW_LINE>releasePageFromWrite(atomicOperation, sysCacheEntry);<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>lock.unlock();<NEW_LINE>}<NEW_LINE>atomicOperation.addDeletedRidBag(rootBucketPointer);<NEW_LINE>});<NEW_LINE>} | getPageOffset() + " can not be removed, because it is not empty. Its size is " + size); |
515,389 | private Map<String, ViewWidgetPosition> migrateWidgetPositions(Dashboard dashboard, Map<String, Set<String>> migratedWidgetIds, Set<ViewWidget> viewWidgets) {<NEW_LINE>return dashboard.widgetPositions().entrySet().stream().flatMap(entry -> {<NEW_LINE>final WidgetPosition widgetPosition = entry.getValue();<NEW_LINE>final Set<String> viewWidgetIds = migratedWidgetIds.<MASK><NEW_LINE>if (viewWidgetIds == null) {<NEW_LINE>return Stream.empty();<NEW_LINE>}<NEW_LINE>final Set<ViewWidget> newViewWidgets = viewWidgetIds.stream().map(viewWidgetId -> viewWidgets.stream().filter(viewWidget -> viewWidget.id().equals(viewWidgetId)).findFirst().orElse(null)).filter(Objects::nonNull).collect(Collectors.toSet());<NEW_LINE>final Optional<Widget> dashboardWidget = dashboard.widgets().stream().filter(widget -> widget.id().equals(entry.getKey())).findFirst();<NEW_LINE>return dashboardWidget.map(widget -> widget.config().toViewWidgetPositions(newViewWidgets, widgetPosition).entrySet().stream()).orElse(Stream.empty());<NEW_LINE>}).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));<NEW_LINE>} | get(entry.getKey()); |
1,068,988 | private void handleMultiBlobRemove(HttpServletResponse response, InputStream is, BlobStore blobStore, String containerName) throws IOException, S3Exception {<NEW_LINE>DeleteMultipleObjectsRequest dmor = mapper.<MASK><NEW_LINE>if (dmor.objects == null) {<NEW_LINE>throw new S3Exception(S3ErrorCode.MALFORMED_X_M_L);<NEW_LINE>}<NEW_LINE>Collection<String> blobNames = new ArrayList<>();<NEW_LINE>for (DeleteMultipleObjectsRequest.S3Object s3Object : dmor.objects) {<NEW_LINE>blobNames.add(s3Object.key);<NEW_LINE>}<NEW_LINE>blobStore.removeBlobs(containerName, blobNames);<NEW_LINE>response.setCharacterEncoding(UTF_8);<NEW_LINE>try (Writer writer = response.getWriter()) {<NEW_LINE>response.setContentType(XML_CONTENT_TYPE);<NEW_LINE>XMLStreamWriter xml = xmlOutputFactory.createXMLStreamWriter(writer);<NEW_LINE>xml.writeStartDocument();<NEW_LINE>xml.writeStartElement("DeleteResult");<NEW_LINE>xml.writeDefaultNamespace(AWS_XMLNS);<NEW_LINE>if (!dmor.quiet) {<NEW_LINE>for (String blobName : blobNames) {<NEW_LINE>xml.writeStartElement("Deleted");<NEW_LINE>writeSimpleElement(xml, "Key", blobName);<NEW_LINE>xml.writeEndElement();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// TODO: emit error stanza<NEW_LINE>xml.writeEndElement();<NEW_LINE>xml.flush();<NEW_LINE>} catch (XMLStreamException xse) {<NEW_LINE>throw new IOException(xse);<NEW_LINE>}<NEW_LINE>} | readValue(is, DeleteMultipleObjectsRequest.class); |
166,140 | public String buildAddressString(final I_C_Location location, final boolean isLocalAddress, @Nullable final String bPartnerBlock, @Nullable final String userBlock) {<NEW_LINE>final CountryId countryId = CountryId.ofRepoId(location.getC_Country_ID());<NEW_LINE>final I_C_Country country = countriesRepo.getById(countryId);<NEW_LINE>String inStr = getDisplaySequence(country, isLocalAddress);<NEW_LINE>final StringBuilder outStr = new StringBuilder();<NEW_LINE>final List<String> bracketsTxt = extractBracketsString(inStr);<NEW_LINE>// treat brackets cases first if exists<NEW_LINE>for (final String s : bracketsTxt) {<NEW_LINE>Check.assume(s.startsWith("(") || s<MASK><NEW_LINE>Check.assume(s.endsWith(")") || s.endsWith("\\)"), "Expected brackets or escaped brackets!");<NEW_LINE>String in = s;<NEW_LINE>final StringBuilder out = new StringBuilder();<NEW_LINE>if (s.startsWith("(")) {<NEW_LINE>// take out brackets<NEW_LINE>in = in.substring(1, s.length() - 1);<NEW_LINE>replaceAddrToken(location, in, out, bPartnerBlock, userBlock, true);<NEW_LINE>} else if (s.startsWith("\\(")) {<NEW_LINE>// take out escaped chars<NEW_LINE>in = in.substring(1, in.length() - 2).concat(")");<NEW_LINE>replaceAddrToken(location, in, out, bPartnerBlock, userBlock, false);<NEW_LINE>}<NEW_LINE>// take the plus space<NEW_LINE>if (out.length() == 0) {<NEW_LINE>inStr = inStr.replace(s.concat(" "), out.toString());<NEW_LINE>} else {<NEW_LINE>if (out.lastIndexOf("\n") == out.length() - 1) {<NEW_LINE>inStr = inStr.replace(s + " ", out.toString());<NEW_LINE>} else {<NEW_LINE>inStr = inStr.replace(s, out.toString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// old behavior<NEW_LINE>// variables in brackets already parsed<NEW_LINE>replaceAddrToken(location, inStr, outStr, bPartnerBlock, userBlock, false);<NEW_LINE>return StringUtils.replace(outStr.toString().trim(), "\\n", "\n");<NEW_LINE>} | .startsWith("\\("), "Expected brackets or escaped brackets!"); |
1,561,456 | public final ZqlsContext zqls() throws RecognitionException {<NEW_LINE>ZqlsContext _localctx = new ZqlsContext(_ctx, getState());<NEW_LINE>enterRule(_localctx, 0, RULE_zqls);<NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(98);<NEW_LINE>zql();<NEW_LINE>setState(103);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>while (_la == T__0) {<NEW_LINE>{<NEW_LINE>{<NEW_LINE>setState(99);<NEW_LINE>match(T__0);<NEW_LINE>setState(100);<NEW_LINE>zql();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(105);<NEW_LINE>_errHandler.sync(this);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>setState(106);<NEW_LINE>match(EOF);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>} | _la = _input.LA(1); |
78,390 | protected Object doNativeAOT(LLVMFunctionDescriptor descriptor, Object[] arguments, @Cached("createToNativeNodes()") LLVMNativeConvertNode[] toNative, @Cached("createFromNativeNode()") LLVMNativeConvertNode fromNative, @Cached("isPointerReturnType()") boolean isPointerReturnType, @CachedLibrary(limit = "1") SignatureLibrary signatureLibrary, @CachedLibrary(limit = "1") NativePointerLibrary nativePointerLibrary, @Cached @SuppressWarnings("unused") ResolveFunctionNode resolve) {<NEW_LINE>try {<NEW_LINE>Object signature = getNativeCtxExt().createSignature(signatureSource);<NEW_LINE>Object nativeFunction = descriptor.<MASK><NEW_LINE>Object[] nativeArgs = prepareNativeArguments(arguments, toNative);<NEW_LINE>Object returnValue = signatureLibrary.call(signature, nativeFunction, nativeArgs);<NEW_LINE>if (isPointerReturnType && nativePointerLibrary.isPointer(returnValue)) {<NEW_LINE>// By using the raw long value we can avoid using interop in the subsequent<NEW_LINE>// conversion<NEW_LINE>returnValue = nativePointerLibrary.asPointer(returnValue);<NEW_LINE>}<NEW_LINE>return fromNative.executeConvert(returnValue);<NEW_LINE>} catch (ArityException | UnsupportedTypeException | UnsupportedMessageException e) {<NEW_LINE>throw CompilerDirectives.shouldNotReachHere(e);<NEW_LINE>}<NEW_LINE>} | getFunctionCode().getNativeFunction(resolve); |
239,267 | public void enterFileNameWithPathWhichExists() throws IOException {<NEW_LINE>ViewInteraction radioButton = onView(allOf(withId(R.id.radioNewFile), withText("Select new file"), withParent(withId(R.id.radioGroup)), isDisplayed()));<NEW_LINE>radioButton.perform(click());<NEW_LINE>ViewInteraction checkBox = onView(allOf(withId(R.id.checkAllowExistingFile), withText("Allow selection of existing (new) file"), isDisplayed()));<NEW_LINE>checkBox.perform(click());<NEW_LINE>ViewInteraction button = onView(allOf(withId(R.id.button_sd), withText("Pick SD-card"), isDisplayed()));<NEW_LINE>button.perform(click());<NEW_LINE>ViewInteraction recyclerView = onView(allOf(withId(android.R.id.list), isDisplayed()));<NEW_LINE>// Refresh view (into dir, and out again)<NEW_LINE>recyclerView.perform(actionOnItemAtPosition(1, click()));<NEW_LINE>recyclerView.perform(actionOnItemAtPosition(0, click()));<NEW_LINE>// Click on test dir<NEW_LINE>recyclerView.perform(actionOnItemAtPosition(1, click()));<NEW_LINE>// Enter path in filename<NEW_LINE>ViewInteraction appCompatEditText = onView(allOf(withId(R.id.nnf_text_filename), withParent(allOf(withId(R.id.nnf_newfile_button_container), withParent(withId(R.id.nnf_buttons_container)))), isDisplayed()));<NEW_LINE>// new file name<NEW_LINE>appCompatEditText<MASK><NEW_LINE>// Click ok<NEW_LINE>ViewInteraction appCompatImageButton = onView(allOf(withId(R.id.nnf_button_ok_newfile), withParent(allOf(withId(R.id.nnf_newfile_button_container), withParent(withId(R.id.nnf_buttons_container)))), isDisplayed()));<NEW_LINE>appCompatImageButton.perform(click());<NEW_LINE>// Should have returned<NEW_LINE>ViewInteraction textView = onView(withId(R.id.text));<NEW_LINE>textView.check(matches(withText("/storage/emulated/0/000000_nonsense-tests/B-dir/file-3.txt")));<NEW_LINE>} | .perform(replaceText("B-dir/file-3.txt")); |
1,814,782 | private Mono<PagedResponse<RestorableDroppedSqlPoolInner>> listByWorkspaceSinglePageAsync(String resourceGroupName, String workspaceName, 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.<MASK><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>final String apiVersion = "2021-06-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByWorkspace(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), resourceGroupName, workspaceName, accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null));<NEW_LINE>} | error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); |
1,596,610 | public static boolean hasJsr330(Project project) {<NEW_LINE>SourceGroup[] sourceGroups = ProjectUtils.getSources(project).getSourceGroups(JavaProjectConstants.SOURCES_TYPE_JAVA);<NEW_LINE>if (sourceGroups.length == 0) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>boolean hasInject = false;<NEW_LINE>boolean hasQualifier = false;<NEW_LINE>for (SourceGroup sourceGroup : sourceGroups) {<NEW_LINE>boolean injectFound = hasResource(sourceGroup, ClassPath.COMPILE, AnnotationUtil.INJECT_FQN) || hasResource(sourceGroup, <MASK><NEW_LINE>if (injectFound) {<NEW_LINE>hasInject = true;<NEW_LINE>}<NEW_LINE>boolean qualifierFound = hasResource(sourceGroup, ClassPath.COMPILE, AnnotationUtil.QUALIFIER_FQN) || hasResource(sourceGroup, ClassPath.SOURCE, AnnotationUtil.QUALIFIER_FQN);<NEW_LINE>if (qualifierFound) {<NEW_LINE>hasQualifier = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return hasInject && hasQualifier;<NEW_LINE>} | ClassPath.SOURCE, AnnotationUtil.INJECT_FQN); |
1,023,047 | protected void processPskSecretResult(PskSecretResult pskSecretResult) throws HandshakeException {<NEW_LINE>if (!pskRequestPending) {<NEW_LINE>throw new IllegalStateException("psk secret not pending!");<NEW_LINE>}<NEW_LINE>pskRequestPending = false;<NEW_LINE>try {<NEW_LINE>ensureUndestroyed();<NEW_LINE>DTLSSession session = getSession();<NEW_LINE>String hostName = sniEnabled ? session.getHostName() : null;<NEW_LINE>PskPublicInformation pskIdentity = pskSecretResult.getPskPublicInformation();<NEW_LINE><MASK><NEW_LINE>if (newPskSecret != null) {<NEW_LINE>if (hostName != null) {<NEW_LINE>LOGGER.trace("client [{}] uses PSK identity [{}] for server [{}]", peerToLog, pskIdentity, hostName);<NEW_LINE>} else {<NEW_LINE>LOGGER.trace("client [{}] uses PSK identity [{}]", peerToLog, pskIdentity);<NEW_LINE>}<NEW_LINE>PreSharedKeyIdentity pskPrincipal;<NEW_LINE>if (sniEnabled) {<NEW_LINE>pskPrincipal = new PreSharedKeyIdentity(hostName, pskIdentity.getPublicInfoAsString());<NEW_LINE>} else {<NEW_LINE>pskPrincipal = new PreSharedKeyIdentity(pskIdentity.getPublicInfoAsString());<NEW_LINE>}<NEW_LINE>session.setPeerIdentity(pskPrincipal);<NEW_LINE>if (PskSecretResult.ALGORITHM_PSK.equals(newPskSecret.getAlgorithm())) {<NEW_LINE>Mac hmac = session.getCipherSuite().getThreadLocalPseudoRandomFunctionMac();<NEW_LINE>SecretKey premasterSecret = PseudoRandomFunction.generatePremasterSecretFromPSK(otherSecret, newPskSecret);<NEW_LINE>SecretKey masterSecret = PseudoRandomFunction.generateMasterSecret(hmac, premasterSecret, masterSecretSeed, session.useExtendedMasterSecret());<NEW_LINE>SecretUtil.destroy(premasterSecret);<NEW_LINE>SecretUtil.destroy(newPskSecret);<NEW_LINE>newPskSecret = masterSecret;<NEW_LINE>}<NEW_LINE>setCustomArgument(pskSecretResult);<NEW_LINE>applyMasterSecret(newPskSecret);<NEW_LINE>SecretUtil.destroy(newPskSecret);<NEW_LINE>processMasterSecret();<NEW_LINE>} else {<NEW_LINE>AlertMessage alert = new AlertMessage(AlertLevel.FATAL, AlertDescription.UNKNOWN_PSK_IDENTITY);<NEW_LINE>if (hostName != null) {<NEW_LINE>throw new HandshakeException(String.format("No pre-shared key found for [virtual host: %s, identity: %s]", hostName, pskIdentity), alert);<NEW_LINE>} else {<NEW_LINE>throw new HandshakeException(String.format("No pre-shared key found for [identity: %s]", pskIdentity), alert);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>SecretUtil.destroy(otherSecret);<NEW_LINE>otherSecret = null;<NEW_LINE>}<NEW_LINE>} | SecretKey newPskSecret = pskSecretResult.getSecret(); |
758,159 | public boolean applyPFRules(Network network, List<PortForwardingRule> rules) throws ResourceUnavailableException {<NEW_LINE>if (!canHandle(network, Service.PortForwarding)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<NiciraNvpDeviceVO> devices = niciraNvpDao.listByPhysicalNetwork(network.getPhysicalNetworkId());<NEW_LINE>if (devices.isEmpty()) {<NEW_LINE>s_logger.error("No NiciraNvp Controller on physical network " + network.getPhysicalNetworkId());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>NiciraNvpDeviceVO niciraNvpDevice = devices.get(0);<NEW_LINE>HostVO niciraNvpHost = hostDao.findById(niciraNvpDevice.getHostId());<NEW_LINE>NiciraNvpRouterMappingVO routermapping = niciraNvpRouterMappingDao.<MASK><NEW_LINE>if (routermapping == null) {<NEW_LINE>s_logger.error("No logical router uuid found for network " + network.getDisplayText());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<PortForwardingRuleTO> portForwardingRules = new ArrayList<PortForwardingRuleTO>();<NEW_LINE>for (PortForwardingRule rule : rules) {<NEW_LINE>IpAddress sourceIp = networkModel.getIp(rule.getSourceIpAddressId());<NEW_LINE>Vlan vlan = vlanDao.findById(sourceIp.getVlanId());<NEW_LINE>PortForwardingRuleTO ruleTO = new PortForwardingRuleTO(rule, vlan.getVlanTag(), sourceIp.getAddress().addr());<NEW_LINE>portForwardingRules.add(ruleTO);<NEW_LINE>}<NEW_LINE>ConfigurePortForwardingRulesOnLogicalRouterCommand cmd = new ConfigurePortForwardingRulesOnLogicalRouterCommand(routermapping.getLogicalRouterUuid(), portForwardingRules);<NEW_LINE>ConfigurePortForwardingRulesOnLogicalRouterAnswer answer = (ConfigurePortForwardingRulesOnLogicalRouterAnswer) agentMgr.easySend(niciraNvpHost.getId(), cmd);<NEW_LINE>return answer.getResult();<NEW_LINE>} | findByNetworkId(network.getId()); |
425,056 | private Map<String, DataSource> mergeEffectiveDataSources(final Map<String, DataSourceProperties> persistedDataSourcePropsMap, final Map<String, DataSource> localConfiguredDataSources) {<NEW_LINE>Map<String, DataSource> result = new LinkedHashMap<>(<MASK><NEW_LINE>for (Entry<String, DataSourceProperties> entry : persistedDataSourcePropsMap.entrySet()) {<NEW_LINE>String dataSourceName = entry.getKey();<NEW_LINE>DataSourceProperties persistedDataSourceProps = entry.getValue();<NEW_LINE>DataSource localConfiguredDataSource = localConfiguredDataSources.get(dataSourceName);<NEW_LINE>if (null == localConfiguredDataSource) {<NEW_LINE>result.put(dataSourceName, DataSourcePoolCreator.create(persistedDataSourceProps));<NEW_LINE>} else if (DataSourcePropertiesCreator.create(localConfiguredDataSource).equals(persistedDataSourceProps)) {<NEW_LINE>result.put(dataSourceName, localConfiguredDataSource);<NEW_LINE>} else {<NEW_LINE>result.put(dataSourceName, DataSourcePoolCreator.create(persistedDataSourceProps));<NEW_LINE>new DataSourcePoolDestroyer(localConfiguredDataSource).asyncDestroy();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | persistedDataSourcePropsMap.size(), 1); |
992,238 | public static void main(String[] args) {<NEW_LINE>for (int i = 0; i < 1000; i++) {<NEW_LINE>int size = AssortedMethods.randomIntInRange(5, 20);<NEW_LINE>int[] array = getSortedArray(size);<NEW_LINE>int v2 = magicFast(array);<NEW_LINE>if (v2 == -1 && magicSlow(array) != -1) {<NEW_LINE>int v1 = magicSlow(array);<NEW_LINE>System.out.println("Incorrect value: index = -1, actual = " + v1 + " " + i);<NEW_LINE>System.out.println(AssortedMethods.arrayToString(array));<NEW_LINE>break;<NEW_LINE>} else if (v2 > -1 && array[v2] != v2) {<NEW_LINE>System.out.println("Incorrect values: index= " + v2 <MASK><NEW_LINE>System.out.println(AssortedMethods.arrayToString(array));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | + ", value " + array[v2]); |
1,851,098 | protected List<SendingMessage> splitEmail(EmailInfo info, @Nullable Integer attemptsCount, @Nullable Date deadline) {<NEW_LINE>List<SendingMessage> sendingMessageList = new ArrayList<>();<NEW_LINE>if (info.isSendInOneMessage()) {<NEW_LINE>if (StringUtils.isNotBlank(info.getAddresses())) {<NEW_LINE>SendingMessage sendingMessage = convertToSendingMessage(info.getAddresses(), info.getFrom(), info.getCc(), info.getBcc(), info.getCaption(), info.getBody(), info.getBodyContentType(), info.getHeaders(), info.getAttachments(), attemptsCount, deadline);<NEW_LINE>sendingMessageList.add(sendingMessage);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>String[] splitAddresses = info.<MASK><NEW_LINE>for (String address : splitAddresses) {<NEW_LINE>address = address.trim();<NEW_LINE>if (StringUtils.isNotBlank(address)) {<NEW_LINE>SendingMessage sendingMessage = convertToSendingMessage(address, info.getFrom(), null, null, info.getCaption(), info.getBody(), info.getBodyContentType(), info.getHeaders(), info.getAttachments(), attemptsCount, deadline);<NEW_LINE>sendingMessageList.add(sendingMessage);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return sendingMessageList;<NEW_LINE>} | getAddresses().split("[,;]"); |
494,830 | protected void taskOperation(ForecastJobAction.Request request, JobTask task, ActionListener<ForecastJobAction.Response> listener) {<NEW_LINE>jobManager.getJob(task.getJobId(), ActionListener.wrap(job -> {<NEW_LINE>validate(job, request);<NEW_LINE>ForecastParams.Builder paramsBuilder = ForecastParams.builder();<NEW_LINE>if (request.getDuration() != null) {<NEW_LINE>paramsBuilder.duration(request.getDuration());<NEW_LINE>}<NEW_LINE>if (request.getExpiresIn() != null) {<NEW_LINE>paramsBuilder.<MASK><NEW_LINE>}<NEW_LINE>Long adjustedLimit = getAdjustedMemoryLimit(job, request.getMaxModelMemory(), auditor);<NEW_LINE>if (adjustedLimit != null) {<NEW_LINE>paramsBuilder.maxModelMemory(adjustedLimit);<NEW_LINE>}<NEW_LINE>// tmp storage might be null, we do not log here, because it might not be<NEW_LINE>// required<NEW_LINE>Path tmpStorage = nativeStorageProvider.tryGetLocalTmpStorage(task.getDescription(), FORECAST_LOCAL_STORAGE_LIMIT);<NEW_LINE>if (tmpStorage != null) {<NEW_LINE>paramsBuilder.tmpStorage(tmpStorage.toString());<NEW_LINE>}<NEW_LINE>if (cppMinAvailableDiskSpaceBytes >= 0) {<NEW_LINE>paramsBuilder.minAvailableDiskSpace(cppMinAvailableDiskSpaceBytes);<NEW_LINE>}<NEW_LINE>ForecastParams params = paramsBuilder.build();<NEW_LINE>processManager.forecastJob(task, params, e -> {<NEW_LINE>if (e == null) {<NEW_LINE>getForecastRequestStats(request.getJobId(), params.getForecastId(), listener);<NEW_LINE>} else {<NEW_LINE>listener.onFailure(e);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}, listener::onFailure));<NEW_LINE>} | expiresIn(request.getExpiresIn()); |
180,400 | public void updateUI(int page) {<NEW_LINE>if (dc == null || viewPager == null || viewPager.getAdapter() == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (page <= viewPager.getAdapter().getCount() - 1) {<NEW_LINE>viewPager.setCurrentItem(page, false);<NEW_LINE>}<NEW_LINE>Info info = OutlineHelper.getForamtingInfo(dc, false);<NEW_LINE>maxSeek.setText(info.textPage);<NEW_LINE>currentSeek.setText(info.textMax);<NEW_LINE><MASK><NEW_LINE>currentSeek.setContentDescription(dc.getString(R.string.m_current_page) + " " + info.textMax);<NEW_LINE>maxSeek.setContentDescription(dc.getString(R.string.m_total_pages) + " " + info.textPage);<NEW_LINE>seekBar.setProgress(page);<NEW_LINE>if (dc != null) {<NEW_LINE>dc.currentPage = page;<NEW_LINE>}<NEW_LINE>pagesTime.setText(UiSystemUtils.getSystemTime(this));<NEW_LINE>pagesTime1.setText(UiSystemUtils.getSystemTime(this));<NEW_LINE>int myLevel = UiSystemUtils.getPowerLevel(this);<NEW_LINE>pagesPower.setText(myLevel + "%");<NEW_LINE>if (myLevel == -1) {<NEW_LINE>pagesPower.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>if (TxtUtils.isNotEmpty(dc.getCurrentChapter())) {<NEW_LINE>chapterView.setText(dc.getCurrentChapter());<NEW_LINE>chapterView.setVisibility(View.VISIBLE);<NEW_LINE>} else {<NEW_LINE>chapterView.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>LOG.d("_PAGE", "Update UI", page);<NEW_LINE>dc.saveCurrentPage();<NEW_LINE>if (dc.floatingBookmark != null) {<NEW_LINE>dc.floatingBookmark.p = dc.getPercentage();<NEW_LINE>floatingBookmarkTextView.setText("{" + dc.getCurentPageFirst1() + "}");<NEW_LINE>floatingBookmarkTextView.setVisibility(View.VISIBLE);<NEW_LINE>BookmarksData.get().add(dc.floatingBookmark);<NEW_LINE>showPagesHelper();<NEW_LINE>} else {<NEW_LINE>floatingBookmarkTextView.setVisibility(View.GONE);<NEW_LINE>}<NEW_LINE>} | pagesCountIndicator.setText(info.chText); |
1,208,203 | public JobSummary unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>if (!reader.isContainer()) {<NEW_LINE>reader.skipValue();<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>JobSummary jobSummary = new JobSummary();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("jobArn")) {<NEW_LINE>jobSummary.setJobArn(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("jobId")) {<NEW_LINE>jobSummary.setJobId(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("thingGroupId")) {<NEW_LINE>jobSummary.setThingGroupId(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("targetSelection")) {<NEW_LINE>jobSummary.setTargetSelection(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("status")) {<NEW_LINE>jobSummary.setStatus(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("createdAt")) {<NEW_LINE>jobSummary.setCreatedAt(DateJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("lastUpdatedAt")) {<NEW_LINE>jobSummary.setLastUpdatedAt(DateJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("completedAt")) {<NEW_LINE>jobSummary.setCompletedAt(DateJsonUnmarshaller.getInstance<MASK><NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return jobSummary;<NEW_LINE>} | ().unmarshall(context)); |
1,176,182 | public CompletableFuture<Hover> hover(HoverParams params) {<NEW_LINE>// shortcut: if the projects are not yet initialized, return empty:<NEW_LINE>if (server.openedProjects().getNow(null) == null) {<NEW_LINE>return CompletableFuture.completedFuture(null);<NEW_LINE>}<NEW_LINE>String uri = params<MASK><NEW_LINE>FileObject file = fromURI(uri);<NEW_LINE>Document doc = server.getOpenedDocuments().getDocument(uri);<NEW_LINE>if (file == null || !(doc instanceof LineDocument)) {<NEW_LINE>return CompletableFuture.completedFuture(null);<NEW_LINE>}<NEW_LINE>return org.netbeans.api.lsp.Hover.getContent(doc, Utils.getOffset((LineDocument) doc, params.getPosition())).thenApply(content -> {<NEW_LINE>if (content != null) {<NEW_LINE>MarkupContent markup = new MarkupContent();<NEW_LINE>markup.setKind("markdown");<NEW_LINE>markup.setValue(html2MD(content));<NEW_LINE>return new Hover(markup);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>});<NEW_LINE>} | .getTextDocument().getUri(); |
861,954 | public void toNewVersionForTableGroup(String tableName, boolean allowTwoVersion) {<NEW_LINE>boolean isPartDb = DbInfoManager.<MASK><NEW_LINE>GmsTableMetaManager gtm = (GmsTableMetaManager) OptimizerContext.getContext(schemaName).getLatestSchemaManager();<NEW_LINE>if (!isPartDb) {<NEW_LINE>tonewversion(tableName);<NEW_LINE>} else {<NEW_LINE>final TableGroupInfoManager tgm = OptimizerContext.getContext(schemaName).getTableGroupInfoManager();<NEW_LINE>final TableMeta tableMeta = gtm.getTableWithNull(tableName);<NEW_LINE>if (tableMeta == null || tableMeta.getPartitionInfo() == null) {<NEW_LINE>tonewversion(tableName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long tableGroupId = tableMeta.getPartitionInfo().getTableGroupId();<NEW_LINE>TableGroupConfig tgConfig = tgm.getTableGroupConfigById(tableGroupId);<NEW_LINE>if (tgConfig != null) {<NEW_LINE>List<String> tableNames = GeneralUtil.emptyIfNull(tgConfig.getTables()).stream().map(TablePartRecordInfoContext::getTableName).collect(Collectors.toList());<NEW_LINE>toNewVersionInTrx(tableNames, allowTwoVersion);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getInstance().isNewPartitionDb(schemaName); |
546,869 | public Decision canAllocate(ShardRouting shardRouting, RoutingAllocation allocation) {<NEW_LINE>if (allocation.ignoreDisable()) {<NEW_LINE>return allocation.decision(Decision.YES, NAME, "explicitly ignoring any disabling of allocation due to manual allocation commands via the reroute API");<NEW_LINE>}<NEW_LINE>final IndexMetaData indexMetaData = allocation.metaData().getIndexSafe(shardRouting.index());<NEW_LINE>final Allocation enable;<NEW_LINE>final boolean usedIndexSetting;<NEW_LINE>if (INDEX_ROUTING_ALLOCATION_ENABLE_SETTING.exists(indexMetaData.getSettings())) {<NEW_LINE>enable = INDEX_ROUTING_ALLOCATION_ENABLE_SETTING.get(indexMetaData.getSettings());<NEW_LINE>usedIndexSetting = true;<NEW_LINE>} else {<NEW_LINE>enable = this.enableAllocation;<NEW_LINE>usedIndexSetting = false;<NEW_LINE>}<NEW_LINE>switch(enable) {<NEW_LINE>case ALL:<NEW_LINE>return allocation.decision(Decision.YES, NAME, "all allocations are allowed");<NEW_LINE>case NONE:<NEW_LINE>return allocation.decision(Decision.NO, NAME, "no allocations are allowed due to %s", setting(enable, usedIndexSetting));<NEW_LINE>case NEW_PRIMARIES:<NEW_LINE>if (shardRouting.primary() && shardRouting.active() == false && shardRouting.recoverySource().getType() != RecoverySource.Type.EXISTING_STORE) {<NEW_LINE>return allocation.decision(<MASK><NEW_LINE>} else {<NEW_LINE>return allocation.decision(Decision.NO, NAME, "non-new primary allocations are forbidden due to %s", setting(enable, usedIndexSetting));<NEW_LINE>}<NEW_LINE>case PRIMARIES:<NEW_LINE>if (shardRouting.primary()) {<NEW_LINE>return allocation.decision(Decision.YES, NAME, "primary allocations are allowed");<NEW_LINE>} else {<NEW_LINE>return allocation.decision(Decision.NO, NAME, "replica allocations are forbidden due to %s", setting(enable, usedIndexSetting));<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unknown allocation option");<NEW_LINE>}<NEW_LINE>} | Decision.YES, NAME, "new primary allocations are allowed"); |
1,045,018 | private void loadNode36() throws IOException, SAXException {<NEW_LINE>DataTypeDescriptionTypeNode node = new DataTypeDescriptionTypeNode(this.context, Identifiers.OpcUa_XmlSchema_EndpointConfiguration, new QualifiedName(0, "EndpointConfiguration"), new LocalizedText("en", "EndpointConfiguration"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.String, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.OpcUa_XmlSchema_EndpointConfiguration, Identifiers.HasTypeDefinition, Identifiers.DataTypeDescriptionType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.OpcUa_XmlSchema_EndpointConfiguration, Identifiers.HasComponent, Identifiers.OpcUa_XmlSchema.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<String xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\">//xs:element[@name='EndpointConfiguration']</String>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<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>} | (1), 0.0, false); |
30,347 | // Process HeronDataTuple and insert it into cache<NEW_LINE>protected void copyDataOutBound(int sourceTaskId, boolean isLocalSpout, TopologyAPI.StreamId streamId, HeronTuples.HeronDataTuple tuple, List<Integer> outTasks) {<NEW_LINE>boolean firstIteration = true;<NEW_LINE>boolean isAnchored = tuple.getRootsCount() > 0;<NEW_LINE>for (Integer outTask : outTasks) {<NEW_LINE>long tupleKey = tupleCache.addDataTuple(sourceTaskId, <MASK><NEW_LINE>if (isAnchored) {<NEW_LINE>// Anchored tuple<NEW_LINE>if (isLocalSpout) {<NEW_LINE>// This is from a local spout. We need to maintain xors<NEW_LINE>if (firstIteration) {<NEW_LINE>xorManager.create(sourceTaskId, tuple.getRoots(0).getKey(), tupleKey);<NEW_LINE>} else {<NEW_LINE>xorManager.anchor(sourceTaskId, tuple.getRoots(0).getKey(), tupleKey);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Anchored emits from local bolt<NEW_LINE>for (HeronTuples.RootId rootId : tuple.getRootsList()) {<NEW_LINE>HeronTuples.AckTuple t = HeronTuples.AckTuple.newBuilder().addRoots(rootId).setAckedtuple(tupleKey).build();<NEW_LINE>tupleCache.addEmitTuple(sourceTaskId, rootId.getTaskid(), t);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>firstIteration = false;<NEW_LINE>}<NEW_LINE>} | outTask, streamId, tuple, isAnchored); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.