idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
642,088 | final StartIncidentResult executeStartIncident(StartIncidentRequest startIncidentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(startIncidentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StartIncidentRequest> request = null;<NEW_LINE>Response<StartIncidentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StartIncidentRequestProtocolMarshaller(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, "SSM Incidents");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartIncident");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StartIncidentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartIncidentResultJsonUnmarshaller());<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(startIncidentRequest)); |
67,289 | public static boolean parseMongoClientSettings(Element element, BeanDefinitionBuilder mongoClientBuilder) {<NEW_LINE>Element settingsElement = <MASK><NEW_LINE>if (settingsElement == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>BeanDefinitionBuilder clientOptionsDefBuilder = BeanDefinitionBuilder.genericBeanDefinition(MongoClientSettingsFactoryBean.class);<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "application-name", "applicationName");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "read-preference", "readPreference");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "read-concern", "readConcern");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "write-concern", "writeConcern");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "retry-reads", "retryReads");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "retry-writes", "retryWrites");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "uuid-representation", "uUidRepresentation");<NEW_LINE>// SocketSettings<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "socket-connect-timeout", "socketConnectTimeoutMS");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "socket-read-timeout", "socketReadTimeoutMS");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "socket-receive-buffer-size", "socketReceiveBufferSize");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "socket-send-buffer-size", "socketSendBufferSize");<NEW_LINE>// Server Settings<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "server-heartbeat-frequency", "serverHeartbeatFrequencyMS");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "server-min-heartbeat-frequency", "serverMinHeartbeatFrequencyMS");<NEW_LINE>// Cluster Settings<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "cluster-srv-host", "clusterSrvHost");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "cluster-hosts", "clusterHosts");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "cluster-connection-mode", "clusterConnectionMode");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "cluster-type", "custerRequiredClusterType");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "cluster-local-threshold", "clusterLocalThresholdMS");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "cluster-server-selection-timeout", "clusterServerSelectionTimeoutMS");<NEW_LINE>// Connection Pool Settings<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "connection-pool-max-size", "poolMaxSize");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "connection-pool-min-size", "poolMinSize");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "connection-pool-max-wait-time", "poolMaxWaitTimeMS");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "connection-pool-max-connection-life-time", "poolMaxConnectionLifeTimeMS");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "connection-pool-max-connection-idle-time", "poolMaxConnectionIdleTimeMS");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "connection-pool-maintenance-initial-delay", "poolMaintenanceInitialDelayMS");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "connection-pool-maintenance-frequency", "poolMaintenanceFrequencyMS");<NEW_LINE>// SSL Settings<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "ssl-enabled", "sslEnabled");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "ssl-invalid-host-name-allowed", "sslInvalidHostNameAllowed");<NEW_LINE>setPropertyValue(clientOptionsDefBuilder, settingsElement, "ssl-provider", "sslProvider");<NEW_LINE>// Field level encryption<NEW_LINE>setPropertyReference(clientOptionsDefBuilder, settingsElement, "encryption-settings-ref", "autoEncryptionSettings");<NEW_LINE>// ServerAPI<NEW_LINE>if (StringUtils.hasText(settingsElement.getAttribute("server-api-version"))) {<NEW_LINE>MongoServerApiFactoryBean serverApiFactoryBean = new MongoServerApiFactoryBean();<NEW_LINE>serverApiFactoryBean.setVersion(settingsElement.getAttribute("server-api-version"));<NEW_LINE>try {<NEW_LINE>clientOptionsDefBuilder.addPropertyValue("serverApi", serverApiFactoryBean.getObject());<NEW_LINE>} catch (Exception exception) {<NEW_LINE>throw new BeanDefinitionValidationException("Non parsable server-api.", exception);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>setPropertyReference(clientOptionsDefBuilder, settingsElement, "server-api-ref", "serverApi");<NEW_LINE>}<NEW_LINE>// and the rest<NEW_LINE>mongoClientBuilder.addPropertyValue("mongoClientSettings", clientOptionsDefBuilder.getBeanDefinition());<NEW_LINE>return true;<NEW_LINE>} | DomUtils.getChildElementByTagName(element, "client-settings"); |
1,060,822 | public void onRun() throws Exception {<NEW_LINE>if (!SignalStore.account().isFcmEnabled())<NEW_LINE>return;<NEW_LINE>Log.i(TAG, "Reregistering FCM...");<NEW_LINE>int result = GoogleApiAvailability.<MASK><NEW_LINE>if (result != ConnectionResult.SUCCESS) {<NEW_LINE>notifyFcmFailure();<NEW_LINE>} else {<NEW_LINE>Optional<String> token = FcmUtil.getToken();<NEW_LINE>if (token.isPresent()) {<NEW_LINE>String oldToken = SignalStore.account().getFcmToken();<NEW_LINE>if (!token.get().equals(oldToken)) {<NEW_LINE>int oldLength = oldToken != null ? oldToken.length() : -1;<NEW_LINE>Log.i(TAG, "Token changed. oldLength: " + oldLength + " newLength: " + token.get().length());<NEW_LINE>} else {<NEW_LINE>Log.i(TAG, "Token didn't change.");<NEW_LINE>}<NEW_LINE>ApplicationDependencies.getSignalServiceAccountManager().setGcmId(token);<NEW_LINE>SignalStore.account().setFcmToken(token.get());<NEW_LINE>} else {<NEW_LINE>throw new RetryLaterException(new IOException("Failed to retrieve a token."));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | getInstance().isGooglePlayServicesAvailable(context); |
1,441,509 | public static void main(String[] args) throws Exception {<NEW_LINE>CommandLine commandLine = parseCommandLine(args);<NEW_LINE>String zkUrl = commandLine.getOptionValue(ZOOKEEPER);<NEW_LINE>String topic = commandLine.getOptionValue(TOPIC);<NEW_LINE>int numMessages = Integer.parseInt(commandLine.getOptionValue(NUM_MESSAGES));<NEW_LINE>Random random = new Random();<NEW_LINE>Properties props = OperatorUtil.createKafkaProducerProperties(zkUrl, SecurityProtocol.PLAINTEXT);<NEW_LINE>KafkaProducer<byte[], byte[]> kafkaProducer = new KafkaProducer<>(props);<NEW_LINE>byte[<MASK><NEW_LINE>byte[] data = new byte[1024];<NEW_LINE>for (int i = 0; i < numMessages; i++) {<NEW_LINE>for (int j = 0; j < data.length; j++) {<NEW_LINE>data[j] = (byte) random.nextInt();<NEW_LINE>}<NEW_LINE>ProducerRecord<byte[], byte[]> producerRecord = new ProducerRecord<>(topic, 0, System.currentTimeMillis(), key, data);<NEW_LINE>Future<RecordMetadata> future = kafkaProducer.send(producerRecord);<NEW_LINE>future.get();<NEW_LINE>if (i % 100 == 0) {<NEW_LINE>System.out.println("Have wrote " + i + " messages to kafka");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>kafkaProducer.close();<NEW_LINE>} | ] key = new byte[16]; |
290,935 | public Document apply(Document document, Parameters parameters) {<NEW_LINE>Info apiInfo = parameters.openAPI.getInfo();<NEW_LINE>document.setAttribute("openapi", parameters.<MASK><NEW_LINE>addDocumentTitle(document, apiInfo);<NEW_LINE>addAuthorInfo(document, apiInfo);<NEW_LINE>addVersionInfo(document, apiInfo);<NEW_LINE>applyOverviewDocumentExtension(new Context(OverviewDocumentExtension.Position.DOCUMENT_BEFORE, document));<NEW_LINE>Document subDocument = new DocumentImpl(document);<NEW_LINE>Section overviewDoc = new SectionImpl(subDocument, "section", new HashMap<>(), new ArrayList<>(), null, new ArrayList<>(), 1, "", new ArrayList<>(), null, null, "", "", false, false);<NEW_LINE>applyOverviewDocumentExtension(new Context(OverviewDocumentExtension.Position.DOCUMENT_BEGIN, subDocument));<NEW_LINE>overviewDoc.setTitle(labels.getLabel(SECTION_TITLE_OVERVIEW));<NEW_LINE>appendDescription(overviewDoc, apiInfo.getDescription());<NEW_LINE>appendTermsOfServiceInfo(overviewDoc, apiInfo);<NEW_LINE>appendLicenseInfo(overviewDoc, apiInfo);<NEW_LINE>subDocument.append(overviewDoc);<NEW_LINE>applyOverviewDocumentExtension(new Context(OverviewDocumentExtension.Position.DOCUMENT_END, subDocument));<NEW_LINE>document.append(subDocument);<NEW_LINE>externalDocumentationComponent.apply(document, parameters.openAPI.getExternalDocs());<NEW_LINE>tagsComponent.apply(document, parameters.openAPI.getTags());<NEW_LINE>applyOverviewDocumentExtension(new Context(OverviewDocumentExtension.Position.DOCUMENT_AFTER, document));<NEW_LINE>return document;<NEW_LINE>} | openAPI.getOpenapi(), true); |
1,343,893 | public List<List<Integer>> Hashmap(int[] nums, int target) {<NEW_LINE>Arrays.sort(nums);<NEW_LINE>Set<List<Integer>> ts = new HashSet();<NEW_LINE>HashMap<Integer, Integer> hm = new HashMap<>();<NEW_LINE>for (int i = 0; i < nums.length; i++) {<NEW_LINE>hm.put(nums[i], i);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < nums.length; i++) {<NEW_LINE>for (int j = i + 1; j < nums.length; j++) {<NEW_LINE>int t = target - nums[i] - nums[j];<NEW_LINE>if (hm.containsKey(t) && hm.get(t) > j) {<NEW_LINE>List<Integer> temp = new ArrayList<>();<NEW_LINE>temp.add(nums[i]);<NEW_LINE>temp<MASK><NEW_LINE>temp.add(t);<NEW_LINE>ts.add(temp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new ArrayList(ts);<NEW_LINE>} | .add(nums[j]); |
510,107 | public static JsonNode convertJsonFormat(JSONObject json) {<NEW_LINE>ObjectNode ret = JsonNodeFactory.instance.objectNode();<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>Iterator<String> iterator = json.keys();<NEW_LINE>while (iterator.hasNext()) {<NEW_LINE>String key = iterator.next();<NEW_LINE>Object value;<NEW_LINE>try {<NEW_LINE>value = json.get(key);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>if (json.isNull(key))<NEW_LINE>ret.putNull(key);<NEW_LINE>else if (value instanceof String)<NEW_LINE>ret.put(key, (String) value);<NEW_LINE>else if (value instanceof Integer)<NEW_LINE>ret.put(key, (Integer) value);<NEW_LINE>else if (value instanceof Long)<NEW_LINE>ret.put(key, (Long) value);<NEW_LINE>else if (value instanceof Double)<NEW_LINE>ret.put(key, (Double) value);<NEW_LINE>else if (value instanceof Boolean)<NEW_LINE>ret.put(key, (Boolean) value);<NEW_LINE>else if (value instanceof JSONObject)<NEW_LINE>ret.set(key, <MASK><NEW_LINE>else if (value instanceof JSONArray)<NEW_LINE>ret.set(key, convertJsonFormat((JSONArray) value));<NEW_LINE>else<NEW_LINE>throw new RuntimeException("not prepared for converting instance of class " + value.getClass());<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | convertJsonFormat((JSONObject) value)); |
1,614,957 | private void initializeResources() {<NEW_LINE>chatId = getIntent().getIntExtra(CHAT_ID_EXTRA, 0);<NEW_LINE>contactId = getIntent(<MASK><NEW_LINE>chatIsMultiUser = false;<NEW_LINE>chatIsDeviceTalk = false;<NEW_LINE>chatIsMailingList = false;<NEW_LINE>chatIsBroadcast = false;<NEW_LINE>fromChat = getIntent().getBooleanExtra(FROM_CHAT, false);<NEW_LINE>if (contactId != 0) {<NEW_LINE>chatId = dcContext.getChatIdByContactId(contactId);<NEW_LINE>} else if (chatId != 0) {<NEW_LINE>DcChat dcChat = dcContext.getChat(chatId);<NEW_LINE>chatIsMultiUser = dcChat.isMultiUser();<NEW_LINE>chatIsDeviceTalk = dcChat.isDeviceTalk();<NEW_LINE>chatIsMailingList = dcChat.isMailingList();<NEW_LINE>chatIsBroadcast = dcChat.isBroadcast();<NEW_LINE>if (!chatIsMultiUser) {<NEW_LINE>final int[] members = dcContext.getChatContacts(chatId);<NEW_LINE>contactId = members.length >= 1 ? members[0] : 0;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!isGlobalProfile() && !isSelfProfile() && !chatIsMailingList) {<NEW_LINE>tabs.add(TAB_SETTINGS);<NEW_LINE>}<NEW_LINE>tabs.add(TAB_GALLERY);<NEW_LINE>tabs.add(TAB_DOCS);<NEW_LINE>// tabs.add(TAB_LINKS);<NEW_LINE>// if(Prefs.isLocationStreamingEnabled(this)) {<NEW_LINE>// tabs.add(TAB_MAP);<NEW_LINE>// }<NEW_LINE>this.viewPager = ViewUtil.findById(this, R.id.pager);<NEW_LINE>this.toolbar = ViewUtil.findById(this, R.id.toolbar);<NEW_LINE>this.tabLayout = ViewUtil.findById(this, R.id.tab_layout);<NEW_LINE>} | ).getIntExtra(CONTACT_ID_EXTRA, 0); |
1,081,369 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player controller = game.<MASK><NEW_LINE>Card aura = game.getCard(source.getFirstTarget());<NEW_LINE>if (controller == null || aura == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>FilterControlledCreaturePermanent FILTER = new FilterControlledCreaturePermanent("Choose a creature you control");<NEW_LINE>TargetControlledPermanent target = new TargetControlledPermanent(FILTER);<NEW_LINE>target.setNotTarget(true);<NEW_LINE>if (controller.choose(Outcome.PutCardInPlay, target, source, game)) {<NEW_LINE>Permanent permanent = game.getPermanent(target.getFirstTarget());<NEW_LINE>if (permanent != null && !permanent.cantBeAttachedBy(aura, source, game, false)) {<NEW_LINE>game.getState().setValue("attachTo:" + aura.getId(), permanent);<NEW_LINE>controller.moveCards(aura, Zone.BATTLEFIELD, source, game);<NEW_LINE>return permanent.addAttachment(aura.getId(), source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | getPlayer(source.getControllerId()); |
1,570,109 | private void callGraphDFS(int s) {<NEW_LINE>int t;<NEW_LINE>CgEdge p;<NEW_LINE>vis_cg[s] = low_cg[s] = pre_cnt++;<NEW_LINE>queue_cg.addLast(s);<NEW_LINE>p = call_graph[s];<NEW_LINE>while (p != null) {<NEW_LINE>t = p.t;<NEW_LINE>if (vis_cg[t] == 0) {<NEW_LINE>callGraphDFS(t);<NEW_LINE>low_cg[s] = Math.min(low_cg[s], low_cg[t]);<NEW_LINE>} else {<NEW_LINE>low_cg[s] = Math.min(low_cg[s], vis_cg[t]);<NEW_LINE>}<NEW_LINE>p = p.next;<NEW_LINE>}<NEW_LINE>if (low_cg[s] < vis_cg[s]) {<NEW_LINE>scc_size[s] = 1;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>scc_size[s] = queue_cg.size();<NEW_LINE>do {<NEW_LINE>t = queue_cg.getLast();<NEW_LINE>queue_cg.removeLast();<NEW_LINE>rep_cg[t] = s;<NEW_LINE>low_cg[t] += n_func;<NEW_LINE>} while (s != t);<NEW_LINE>scc_size[<MASK><NEW_LINE>if (scc_size[s] > max_scc_size) {<NEW_LINE>max_scc_size = scc_size[s];<NEW_LINE>max_scc_id = s;<NEW_LINE>}<NEW_LINE>} | s] -= queue_cg.size(); |
1,467,549 | public void onMatch(RelOptRuleCall call) {<NEW_LINE>LogicalTableFunctionScan <MASK><NEW_LINE>int wmIndex = orderingColumnFieldIndex(scan);<NEW_LINE>WatermarkLogicalRel wmRel = new WatermarkLogicalRel(scan.getCluster(), OptUtils.toLogicalConvention(scan.getTraitSet()), Iterables.getOnlyElement(Util.toList(scan.getInputs(), OptUtils::toLogicalInput)), toEventTimePolicyProvider(scan), wmIndex);<NEW_LINE>if (wmIndex < 0) {<NEW_LINE>call.transformTo(wmRel);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>WatermarkedFields watermarkedFields = watermarkedFieldByIndex(wmRel, wmIndex);<NEW_LINE>if (watermarkedFields == null || watermarkedFields.isEmpty()) {<NEW_LINE>call.transformTo(wmRel);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map.Entry<Integer, RexNode> watermarkedField = watermarkedFields.findFirst();<NEW_LINE>if (watermarkedField == null) {<NEW_LINE>call.transformTo(wmRel);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>DropLateItemsLogicalRel dropLateItemsRel = new DropLateItemsLogicalRel(scan.getCluster(), OptUtils.toLogicalConvention(scan.getTraitSet()), wmRel, watermarkedField.getValue());<NEW_LINE>call.transformTo(dropLateItemsRel);<NEW_LINE>} | scan = call.rel(0); |
945,552 | protected void parseLightArray(BitSet mask, BitSet emptyMask, DataTypeProvider provider, BiConsumer<ChunkSection, byte[]> c, Function<ChunkSection, byte[]> get) {<NEW_LINE>for (int sectionY = getMinSection(); sectionY <= (getMaxSection() + 1) && (!mask.isEmpty() || !emptyMask.isEmpty()); sectionY++) {<NEW_LINE>ChunkSection s = getChunkSection(sectionY);<NEW_LINE>if (s == null) {<NEW_LINE>s = createNewChunkSection((byte) sectionY, Palette.empty());<NEW_LINE>s.setBlocks(new long[256]);<NEW_LINE>setChunkSection(sectionY, s);<NEW_LINE>}<NEW_LINE>// Mask tells us if a section is present or not<NEW_LINE>if (!mask.get(sectionY - getMinSection())) {<NEW_LINE>if (!emptyMask.get(sectionY - getMinSection())) {<NEW_LINE>c.accept(s, new byte[2048]);<NEW_LINE>}<NEW_LINE>emptyMask.set(<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>mask.set(sectionY - getMinSection(), false);<NEW_LINE>int skyLength = provider.readVarInt();<NEW_LINE>byte[] data = provider.readByteArray(skyLength);<NEW_LINE>c.accept(s, data);<NEW_LINE>}<NEW_LINE>} | sectionY - getMinSection(), false); |
1,639,693 | public void connecting05(Vertx vertx) {<NEW_LINE>// Pool options<NEW_LINE>PgConnectOptions options = new PgConnectOptions().setPort(5432).setHost("the-host").setDatabase("the-db").setUser("user").setPassword("secret");<NEW_LINE>// Connect to Postgres<NEW_LINE>PgConnection.connect(vertx, options).compose(conn -> {<NEW_LINE>System.out.println("Connected");<NEW_LINE>// All operations execute on the same connection<NEW_LINE>return conn.query("SELECT * FROM users WHERE id='julien'").execute().compose(res -> conn.query("SELECT * FROM users WHERE id='emad'").execute()).onComplete(ar -> {<NEW_LINE>// Close the connection<NEW_LINE>conn.close();<NEW_LINE>});<NEW_LINE>}).onComplete(res -> {<NEW_LINE>if (res.succeeded()) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>System.out.println("Could not connect: " + res.cause().getMessage());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | System.out.println("Done"); |
259,146 | private void loadNode186() {<NEW_LINE>TransitionTypeNode node = new TransitionTypeNode(this.context, Identifiers.ProgramStateMachineType_ReadyToRunning, new QualifiedName(0, "ReadyToRunning"), new LocalizedText("en", "ReadyToRunning"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), UByte.valueOf(0));<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_ReadyToRunning, Identifiers.HasProperty, Identifiers.ProgramStateMachineType_ReadyToRunning_TransitionNumber.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_ReadyToRunning, Identifiers.FromState, Identifiers.ProgramStateMachineType_Ready.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_ReadyToRunning, Identifiers.ToState, Identifiers.ProgramStateMachineType_Running<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_ReadyToRunning, Identifiers.HasCause, Identifiers.ProgramStateMachineType_Start.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_ReadyToRunning, Identifiers.HasEffect, Identifiers.ProgramTransitionEventType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_ReadyToRunning, Identifiers.HasTypeDefinition, Identifiers.TransitionType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.ProgramStateMachineType_ReadyToRunning, Identifiers.HasComponent, Identifiers.ProgramStateMachineType.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>} | .expanded(), true)); |
1,638,462 | public String findOrphanDescriptors() {<NEW_LINE>com.haulmont.cuba.core.app.filestorage.FileStorage fileStorage;<NEW_LINE>FileStorageAPI fileStorageAPI = AppBeans.get(FileStorageAPI.class);<NEW_LINE>if (fileStorageAPI instanceof com.haulmont.cuba.core.app.filestorage.FileStorage) {<NEW_LINE>fileStorage = (com.haulmont.cuba.core.app.filestorage.FileStorage) fileStorageAPI;<NEW_LINE>} else {<NEW_LINE>return "<not supported>";<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>if (roots.length == 0)<NEW_LINE>return "No storage directories defined";<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>Transaction tx = persistence.createTransaction();<NEW_LINE>try {<NEW_LINE>EntityManager em = persistence.getEntityManager();<NEW_LINE>TypedQuery<FileDescriptor> query = em.createQuery("select fd from sys$FileDescriptor fd", FileDescriptor.class);<NEW_LINE>List<FileDescriptor> fileDescriptors = query.getResultList();<NEW_LINE>for (FileDescriptor fileDescriptor : fileDescriptors) {<NEW_LINE>File dir = fileStorage.getStorageDir(roots[0], fileDescriptor);<NEW_LINE>File file = new File(dir, com.haulmont.cuba.core.app.filestorage.FileStorage.getFileName(fileDescriptor));<NEW_LINE>if (!file.exists()) {<NEW_LINE>sb.append(fileDescriptor.getId()).append(", ").append(fileDescriptor.getName()).append(", ").append(fileDescriptor.getCreateDate()).append("\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>tx.commit();<NEW_LINE>} catch (Exception e) {<NEW_LINE>return ExceptionUtils.getStackTrace(e);<NEW_LINE>} finally {<NEW_LINE>tx.end();<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>} | File[] roots = getStorageRoots(); |
1,347,391 | private void tryAddRendererToVideoTrack() {<NEW_LINE>if (!rendererAttached && videoTrack != null && ViewCompat.isAttachedToWindow(this)) {<NEW_LINE>EglBase.Context sharedContext = EglUtils.getRootEglBaseContext();<NEW_LINE>if (sharedContext == null) {<NEW_LINE>// If SurfaceViewRenderer#init() is invoked, it will throw a<NEW_LINE>// RuntimeException which will very likely kill the application.<NEW_LINE>Log.e(TAG, "Failed to render a VideoTrack!");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>surfaceViewRendererInstances++;<NEW_LINE><MASK><NEW_LINE>} catch (Exception e) {<NEW_LINE>Logging.e(TAG, "Failed to initialize surfaceViewRenderer on instance " + surfaceViewRendererInstances, e);<NEW_LINE>surfaceViewRendererInstances--;<NEW_LINE>}<NEW_LINE>// XXX If WebRTCModule#mediaStreamTrackRelease has already been<NEW_LINE>// invoked on videoTrack, then it is no longer safe to call addSink<NEW_LINE>// on the instance, it will throw IllegalStateException.<NEW_LINE>try {<NEW_LINE>videoTrack.addSink(surfaceViewRenderer);<NEW_LINE>} catch (Throwable tr) {<NEW_LINE>// Releasing streams happens in the WebRTC thread, thus we might (briefly) hold<NEW_LINE>// a reference to a released stream.<NEW_LINE>Log.e(TAG, "Failed to add renderer", tr);<NEW_LINE>surfaceViewRenderer.release();<NEW_LINE>surfaceViewRendererInstances--;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>rendererAttached = true;<NEW_LINE>}<NEW_LINE>} | surfaceViewRenderer.init(sharedContext, rendererEvents); |
668,399 | public void backToLocationImpl(int zoom, boolean forceZoom) {<NEW_LINE>if (mapView != null) {<NEW_LINE><MASK><NEW_LINE>Location lastKnownLocation = locationProvider.getLastKnownLocation();<NEW_LINE>Location lastStaleKnownLocation = locationProvider.getLastStaleKnownLocation();<NEW_LINE>Location location = lastKnownLocation != null ? lastKnownLocation : lastStaleKnownLocation;<NEW_LINE>if (!isMapLinkedToLocation()) {<NEW_LINE>setMapLinkedToLocation(true);<NEW_LINE>if (location != null) {<NEW_LINE>AnimateDraggingMapThread thread = mapView.getAnimatedDraggingThread();<NEW_LINE>int fZoom = mapView.getZoom() < zoom && (forceZoom || app.getSettings().AUTO_ZOOM_MAP.get()) ? zoom : mapView.getZoom();<NEW_LINE>movingToMyLocation = true;<NEW_LINE>thread.startMoving(location.getLatitude(), location.getLongitude(), fZoom, false, () -> movingToMyLocation = false);<NEW_LINE>}<NEW_LINE>mapView.refreshMap();<NEW_LINE>}<NEW_LINE>if (location == null) {<NEW_LINE>// Hardy, 2019-12-15: Inject A-GPS data if backToLocationImpl fails with no fix:<NEW_LINE>if (app.getSettings().isInternetConnectionAvailable(true)) {<NEW_LINE>locationProvider.redownloadAGPS();<NEW_LINE>app.showToastMessage(app.getString(R.string.unknown_location) + "\n\n" + app.getString(R.string.agps_data_last_downloaded, (new SimpleDateFormat("yyyy-MM-dd HH:mm")).format(app.getSettings().AGPS_DATA_LAST_TIME_DOWNLOADED.get())));<NEW_LINE>} else {<NEW_LINE>app.showToastMessage(R.string.unknown_location);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | OsmAndLocationProvider locationProvider = app.getLocationProvider(); |
1,617,049 | protected void addGuiElements() {<NEW_LINE>super.addGuiElements();<NEW_LINE>addRenderableWidget(new GuiHorizontalPowerBar(this, tile.getEnergyContainer(), 115, 75)).warning(WarningType.NOT_ENOUGH_ENERGY, tile.getWarningCheck(RecipeError.NOT_ENOUGH_ENERGY));<NEW_LINE>addRenderableWidget(new GuiEnergyTab(this, tile.getEnergyContainer(), tile::getActive));<NEW_LINE>addRenderableWidget(new GuiGasGauge(() -> tile.gasTank, () -> tile.getGasTanks(null), GaugeType.STANDARD, this, 131, 13)).warning(WarningType.NO_SPACE_IN_OUTPUT, tile<MASK><NEW_LINE>addRenderableWidget(new GuiProgress(tile::getScaledProgress, ProgressType.LARGE_RIGHT, this, 64, 40).jeiCategory(tile)).warning(WarningType.INPUT_DOESNT_PRODUCE_OUTPUT, tile.getWarningCheck(RecipeError.INPUT_DOESNT_PRODUCE_OUTPUT));<NEW_LINE>} | .getWarningCheck(RecipeError.NOT_ENOUGH_OUTPUT_SPACE)); |
303,679 | public void addContextSnapshot(ContextOp op, ArrayList<com.ibm.wsspi.threadcontext.ThreadContext> contextSnapshots) {<NEW_LINE>com.ibm.wsspi.threadcontext.ThreadContext snapshot;<NEW_LINE>com.ibm.wsspi.threadcontext.ThreadContextProvider classloaderProvider = classloaderContextProviderRef.getServiceWithException();<NEW_LINE>if (op == ContextOp.PROPAGATED)<NEW_LINE>snapshot = classloaderProvider.captureThreadContext(EMPTY_MAP, EMPTY_MAP);<NEW_LINE>else<NEW_LINE><MASK><NEW_LINE>contextSnapshots.add(snapshot);<NEW_LINE>com.ibm.wsspi.threadcontext.ThreadContextProvider jeeMetadataProvider = jeeMetadataContextProviderRef.getService();<NEW_LINE>if (op == ContextOp.PROPAGATED)<NEW_LINE>snapshot = jeeMetadataProvider.captureThreadContext(EMPTY_MAP, EMPTY_MAP);<NEW_LINE>else<NEW_LINE>snapshot = jeeMetadataProvider.createDefaultThreadContext(EMPTY_MAP);<NEW_LINE>contextSnapshots.add(snapshot);<NEW_LINE>} | snapshot = classloaderProvider.createDefaultThreadContext(EMPTY_MAP); |
1,320,984 | public void compute(double x, double y, Point3D_F64 out) {<NEW_LINE>// Undo projection on to pixels and into normalized image coordinates<NEW_LINE>pinholePtoN.compute(x, y, norm);<NEW_LINE>// norm now is the observed distorted coordinates<NEW_LINE>// Compute initial estimate of r, phi, and theta, norm=X_d (in paper)<NEW_LINE>double r = norm.norm();<NEW_LINE>double phi = Math.atan2(norm.y, norm.x);<NEW_LINE>double theta = computeTheta(r);<NEW_LINE>if (model.isAsymmetricModel()) {<NEW_LINE>newtonsMethodUpdateThetaphi(theta, phi, r);<NEW_LINE>phi = updatedphi;<NEW_LINE>theta = updatedTheta;<NEW_LINE>}<NEW_LINE>if (theta == Double.MAX_VALUE) {<NEW_LINE>// It failed, so who give it a value that seems "reasonable" for failing and return<NEW_LINE>out.setTo(0.0, 0.0, 0.0);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// go from angles to sphere point vector<NEW_LINE>double sintheta = Math.sin(theta);<NEW_LINE>out.x = sintheta * (double) Math.cos(phi);<NEW_LINE>out.y = sintheta * (double) Math.sin(phi);<NEW_LINE>out.<MASK><NEW_LINE>} | z = Math.cos(theta); |
181,479 | public boolean add(int bitIndex) {<NEW_LINE>boolean set = contains(bitIndex);<NEW_LINE>if (!set) {<NEW_LINE>if (myBase < 0) {<NEW_LINE>myBase = roundToNearest(bitIndex);<NEW_LINE>} else if (bitIndex < myBase) {<NEW_LINE>int newBase = roundToNearest(bitIndex);<NEW_LINE>int wordDiff = (myBase - newBase) >> SHIFT;<NEW_LINE>long[] n = new long[wordDiff + myBitMask.length];<NEW_LINE>System.arraycopy(myBitMask, 0, n, wordDiff, myBitMask.length);<NEW_LINE>myBitMask = n;<NEW_LINE>myBase = newBase;<NEW_LINE>myLastUsedSlot += wordDiff;<NEW_LINE>}<NEW_LINE>++myBitsSet;<NEW_LINE>bitIndex -= myBase;<NEW_LINE>int wordIndex = bitIndex >> SHIFT;<NEW_LINE>if (wordIndex >= myBitMask.length) {<NEW_LINE>long[] n = new long[Math.max(calcCapacity(myBitMask.length), wordIndex + 1)];<NEW_LINE>System.arraycopy(myBitMask, 0, <MASK><NEW_LINE>myBitMask = n;<NEW_LINE>}<NEW_LINE>myBitMask[wordIndex] |= 1L << (bitIndex & MASK);<NEW_LINE>myLastUsedSlot = Math.max(myLastUsedSlot, wordIndex);<NEW_LINE>}<NEW_LINE>return !set;<NEW_LINE>} | n, 0, myBitMask.length); |
1,131,939 | protected PdfPTable exportTable(FacesContext context, DataTable table, ExportConfiguration config) {<NEW_LINE>int columnsCount = getColumnsCount(table);<NEW_LINE>PdfPTable pdfTable = new PdfPTable(columnsCount);<NEW_LINE>ExporterOptions options = config.getOptions();<NEW_LINE>if (options != null) {<NEW_LINE>applyFont(options.getFontName(<MASK><NEW_LINE>applyFacetOptions(options);<NEW_LINE>applyCellOptions(options);<NEW_LINE>} else {<NEW_LINE>applyFont(FontFactory.TIMES, config.getEncodingType());<NEW_LINE>}<NEW_LINE>if (config.getOnTableRender() != null) {<NEW_LINE>config.getOnTableRender().invoke(context.getELContext(), new Object[] { pdfTable, table });<NEW_LINE>}<NEW_LINE>if (config.isExportHeader()) {<NEW_LINE>addTableFacets(context, table, pdfTable, ColumnType.HEADER);<NEW_LINE>boolean headerGroup = addColumnGroup(table, pdfTable, ColumnType.HEADER);<NEW_LINE>if (!headerGroup) {<NEW_LINE>addColumnFacets(table, pdfTable, ColumnType.HEADER);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (config.isPageOnly()) {<NEW_LINE>exportPageOnly(context, table, pdfTable);<NEW_LINE>} else if (config.isSelectionOnly()) {<NEW_LINE>exportSelectionOnly(context, table, pdfTable);<NEW_LINE>} else {<NEW_LINE>exportAll(context, table, pdfTable);<NEW_LINE>}<NEW_LINE>if (config.isExportFooter()) {<NEW_LINE>addColumnGroup(table, pdfTable, ColumnType.FOOTER);<NEW_LINE>if (table.hasFooterColumn()) {<NEW_LINE>addColumnFacets(table, pdfTable, ColumnType.FOOTER);<NEW_LINE>}<NEW_LINE>addTableFacets(context, table, pdfTable, ColumnType.FOOTER);<NEW_LINE>}<NEW_LINE>table.setRowIndex(-1);<NEW_LINE>return pdfTable;<NEW_LINE>} | ), config.getEncodingType()); |
902,949 | final DeleteProtectionGroupResult executeDeleteProtectionGroup(DeleteProtectionGroupRequest deleteProtectionGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteProtectionGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteProtectionGroupRequest> request = null;<NEW_LINE>Response<DeleteProtectionGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteProtectionGroupRequestProtocolMarshaller(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, "Shield");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteProtectionGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteProtectionGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteProtectionGroupResultJsonUnmarshaller());<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(deleteProtectionGroupRequest)); |
1,714,902 | public void Start() {<NEW_LINE>// Need to check if we have RECORD_AUDIO and WRITE_EXTERNAL permissions<NEW_LINE>String uri = FileUtil.resolveFileName(form, savedRecording, form.DefaultFileScope());<NEW_LINE>if (!havePermission) {<NEW_LINE>final SoundRecorder me = this;<NEW_LINE>final String[] neededPermissions;<NEW_LINE>if (FileUtil.needsPermission(form, uri)) {<NEW_LINE>neededPermissions = new <MASK><NEW_LINE>} else {<NEW_LINE>neededPermissions = new String[] { RECORD_AUDIO };<NEW_LINE>}<NEW_LINE>form.runOnUiThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>form.askPermission(new BulkPermissionRequest(me, "Start", neededPermissions) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onGranted() {<NEW_LINE>me.havePermission = true;<NEW_LINE>me.Start();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (controller != null) {<NEW_LINE>Log.i(TAG, "Start() called, but already recording to " + controller.file);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Log.i(TAG, "Start() called");<NEW_LINE>if (FileUtil.isExternalStorageUri(form, uri) && !Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {<NEW_LINE>form.dispatchErrorOccurredEvent(this, "Start", ErrorMessages.ERROR_MEDIA_EXTERNAL_STORAGE_NOT_AVAILABLE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>controller = new RecordingController(savedRecording);<NEW_LINE>} catch (PermissionException e) {<NEW_LINE>form.dispatchPermissionDeniedEvent(this, "Start", e);<NEW_LINE>return;<NEW_LINE>} catch (Throwable t) {<NEW_LINE>form.dispatchErrorOccurredEvent(this, "Start", ErrorMessages.ERROR_SOUND_RECORDER_CANNOT_CREATE, t.getMessage());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>controller.start();<NEW_LINE>} catch (Throwable t) {<NEW_LINE>// I'm commenting the next line out because stop can throw an error, and<NEW_LINE>// it's not clear to me how to handle that.<NEW_LINE>// controller.stop();<NEW_LINE>controller = null;<NEW_LINE>form.dispatchErrorOccurredEvent(this, "Start", ErrorMessages.ERROR_SOUND_RECORDER_CANNOT_CREATE, t.getMessage());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StartedRecording();<NEW_LINE>} | String[] { RECORD_AUDIO, WRITE_EXTERNAL_STORAGE }; |
1,671,835 | private void superPostConstruct(InvocationContext inv) {<NEW_LINE>try {<NEW_LINE>Object resultsObject = getResultsObject(inv);<NEW_LINE>addPostConstruct(resultsObject, CLASS_NAME, "superPostConstruct");<NEW_LINE>// Validate and update context data.<NEW_LINE>Map<String, Object> map = inv.getContextData();<NEW_LINE>String data;<NEW_LINE>if (map.containsKey("PostConstruct")) {<NEW_LINE>data = (String) map.get("PostConstruct");<NEW_LINE>data = data + ":" + CLASS_NAME;<NEW_LINE>} else {<NEW_LINE>data = CLASS_NAME;<NEW_LINE>}<NEW_LINE>map.put("PostConstruct", data);<NEW_LINE>setPostContructContextData(resultsObject, data);<NEW_LINE>// Verify around invoke does not see any context data from lifecycle<NEW_LINE>// callback events.<NEW_LINE>if (map.containsKey("PostActivate")) {<NEW_LINE>throw new IllegalStateException("PostActivate context data shared with PostConstruct interceptor");<NEW_LINE>} else if (map.containsKey("AroundInvoke")) {<NEW_LINE>throw new IllegalStateException("AroundInvoke context data shared with PostConstruct interceptor");<NEW_LINE>} else if (map.containsKey("PrePassivate")) {<NEW_LINE>throw new IllegalStateException("PrePassivate context data shared with PostConstruct interceptor");<NEW_LINE>} else if (map.containsKey("PreDestroy")) {<NEW_LINE>throw new IllegalStateException("PreDestroy context data shared with PostConstruct interceptor");<NEW_LINE>}<NEW_LINE>// Verify same InvocationContext passed to each PostConstruct<NEW_LINE>// interceptor method.<NEW_LINE>InvocationContext ctxData;<NEW_LINE>if (map.containsKey("InvocationContext")) {<NEW_LINE>ctxData = (InvocationContext) map.get("InvocationContext");<NEW_LINE>if (inv != ctxData) {<NEW_LINE>throw new IllegalStateException("Same InvocationContext not passed to each PostConstruct interceptor");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>inv.proceed();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new EJBException("unexpected Throwable", e);<NEW_LINE>}<NEW_LINE>} | map.put("InvocationContext", inv); |
849,325 | public void testRxObservableInvoker_get3WithGenericType(Map<String, String> param, StringBuilder ret) {<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE>final String threadName = "jaxrs21Thread";<NEW_LINE>ThreadFactory jaxrs21ThreadFactory = Executors.defaultThreadFactory();<NEW_LINE>Thread jaxrs21Thread = jaxrs21ThreadFactory.newThread(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>String runThreadName = Thread.currentThread().getName();<NEW_LINE>if (!(runThreadName.equals(threadName))) {<NEW_LINE>throw new RuntimeException("testRxObservableInvoker_get3WithGenericType: incorrect thread name");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>jaxrs21Thread.setName(threadName);<NEW_LINE>ExecutorService executorService = Executors.newSingleThreadExecutor(jaxrs21ThreadFactory);<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder().executorService(executorService);<NEW_LINE>Client c = cb.build();<NEW_LINE>c.register(RxObservableInvokerProvider.class);<NEW_LINE>WebTarget t = c.target("http://" + serverIP + ":" + serverPort + "/jaxrs21bookstore/JAXRS21bookstore2/rxget3");<NEW_LINE>Builder builder = t.request();<NEW_LINE>builder.accept("application/xml");<NEW_LINE>GenericType<List<JAXRS21Book>> genericResponseType = new GenericType<List<JAXRS21Book>>() {<NEW_LINE>};<NEW_LINE>rx.Observable<List<JAXRS21Book>> observable = builder.rx(RxObservableInvoker.class).get(genericResponseType);<NEW_LINE>final Holder<List<JAXRS21Book>> holder = new Holder<List<JAXRS21Book>>();<NEW_LINE>final CountDownLatch countDownLatch = new CountDownLatch(1);<NEW_LINE>observable.subscribe(v -> {<NEW_LINE>// OnNext<NEW_LINE>holder.value = v;<NEW_LINE>countDownLatch.countDown();<NEW_LINE>}, throwable -> {<NEW_LINE>// OnError<NEW_LINE>throw new RuntimeException("testRxObservableInvoker_get3WithGenericType: onError " + throwable.getStackTrace());<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>if (!(countDownLatch.await(complexTimeout, TimeUnit.SECONDS))) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>List<JAXRS21Book> response = holder.value;<NEW_LINE>ret.append(response != null);<NEW_LINE>c.close();<NEW_LINE>} | throw new RuntimeException("testRxObservableInvoker_get3WithGenericType: Response took too long. Waited " + complexTimeout); |
217,581 | public Response<Void> deleteByIdWithResponse(String id, Context context) {<NEW_LINE>String resourceGroupName = <MASK><NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String workspaceName = Utils.getValueFromIdByName(id, "workspaces");<NEW_LINE>if (workspaceName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'workspaces'.", id)));<NEW_LINE>}<NEW_LINE>String sourceControlId = Utils.getValueFromIdByName(id, "sourcecontrols");<NEW_LINE>if (sourceControlId == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'sourcecontrols'.", id)));<NEW_LINE>}<NEW_LINE>return this.deleteWithResponse(resourceGroupName, workspaceName, sourceControlId, context);<NEW_LINE>} | Utils.getValueFromIdByName(id, "resourceGroups"); |
1,179,215 | private CustomerReturnLineCandidate buildCustomerReturnLineCandidate(@NonNull final JsonCreateCustomerReturnInfo customerReturnInfo, @NonNull final CustomerReturnRestService.ReturnProductInfoProvider returnProductInfoProvider) {<NEW_LINE>final OrgId orgId = returnProductInfoProvider.getOrgId(customerReturnInfo.getOrgCode());<NEW_LINE>// 1. try to get the corresponding originShipmentLine<NEW_LINE>final I_M_InOutLine originShipmentLine = getShipmentLine(customerReturnInfo.getShipmentScheduleId());<NEW_LINE>// 2. try to get the sales order<NEW_LINE>final I_C_Order salesOrder = getSalesOrder(orgId, originShipmentLine, customerReturnInfo.getShipmentDocumentNumber());<NEW_LINE>// 3. determine bPartner and bPartner location<NEW_LINE>final BPartnerLocationId bPartnerLocationId = getBPartnerLocation(orgId, originShipmentLine, salesOrder);<NEW_LINE>// 4. build the create attribute instance requests<NEW_LINE>final List<CreateAttributeInstanceReq> createAttributeInstanceReqList = customerReturnInfo.getAttributes() != null ? attributeSetHelper.toCreateAttributeInstanceReqList(customerReturnInfo.getAttributes()) : null;<NEW_LINE>// 5. build the actual candidate<NEW_LINE>final OrderId orderId = salesOrder != null ? OrderId.ofRepoId(salesOrder.getC_Order_ID()) : null;<NEW_LINE>final InOutLineId originShipmentLineId = originShipmentLine != null ? InOutLineId.ofRepoId(<MASK><NEW_LINE>final ProductId productId = returnProductInfoProvider.getProductId(customerReturnInfo.getProductSearchKey());<NEW_LINE>final I_C_UOM stockingUOM = returnProductInfoProvider.getStockingUOM(customerReturnInfo.getProductSearchKey());<NEW_LINE>final ReturnedGoodsWarehouseType returnedGoodsWarehouseType = Check.isNotBlank(customerReturnInfo.getReturnedGoodsWarehouseType()) ? ReturnedGoodsWarehouseType.ofCode(customerReturnInfo.getReturnedGoodsWarehouseType()) : ReturnedGoodsWarehouseType.getDefault();<NEW_LINE>return CustomerReturnLineCandidate.builder().orgId(orgId).bPartnerLocationId(bPartnerLocationId).orderId(orderId).originalShipmentInOutLineId(originShipmentLineId).productId(productId).returnedQty(Quantity.of(customerReturnInfo.getMovementQuantity(), stockingUOM)).movementDate(customerReturnInfo.getMovementDate()).dateReceived(toZonedDateTime(orgId, customerReturnInfo.getDateReceived())).createAttributeInstanceReqs(createAttributeInstanceReqList).externalResourceURL(customerReturnInfo.getExternalResourceURL()).externalId(customerReturnInfo.getExternalId()).returnedGoodsWarehouseType(returnedGoodsWarehouseType).build();<NEW_LINE>} | originShipmentLine.getM_InOutLine_ID()) : null; |
467,811 | private int displayOptions(String name, String mainClass) {<NEW_LINE>PhaseOptionsDialog dialog <MASK><NEW_LINE>addEclipseDefsToDialog(dialog);<NEW_LINE>setMainClassInDialog(dialog, mainClass);<NEW_LINE>if (getEditDefs() != null) {<NEW_LINE>Iterator it = getEditDefs().keySet().iterator();<NEW_LINE>while (it.hasNext()) {<NEW_LINE>Object next = it.next();<NEW_LINE>String key = (String) next;<NEW_LINE>String val = (String) getEditDefs().get(key);<NEW_LINE>if ((val.equals("true")) || (val.equals("false"))) {<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>dialog.addToDefList(key, new Boolean(val));<NEW_LINE>} else {<NEW_LINE>dialog.addToDefList(key, val);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>dialog.setConfigName(name);<NEW_LINE>dialog.setCanRun(false);<NEW_LINE>dialog.open();<NEW_LINE>if (dialog.getReturnCode() == Dialog.OK) {<NEW_LINE>// save main class<NEW_LINE>saveMainClass(name, dialog.getSootMainClass());<NEW_LINE>}<NEW_LINE>return dialog.getReturnCode();<NEW_LINE>// saved - should show up in tree<NEW_LINE>} | = new PhaseOptionsDialog(getShell()); |
1,568,903 | protected void encodeHeaderRowWithoutColumn(FacesContext context, HeaderRow row, DataTable table, boolean expandable, boolean expanded) throws IOException {<NEW_LINE>ResponseWriter writer = context.getResponseWriter();<NEW_LINE>String style = row.getStyle();<NEW_LINE>String styleClass = row.getStyleClass();<NEW_LINE>Integer rowspan = row.getRowspan();<NEW_LINE>Integer colspan = row.getColspan();<NEW_LINE>writer.startElement("td", null);<NEW_LINE>if (style != null) {<NEW_LINE>writer.writeAttribute("style", style, null);<NEW_LINE>}<NEW_LINE>if (styleClass != null) {<NEW_LINE>writer.writeAttribute("class", styleClass, null);<NEW_LINE>}<NEW_LINE>if (rowspan != null) {<NEW_LINE>writer.writeAttribute("rowspan", rowspan, null);<NEW_LINE>}<NEW_LINE>if (colspan == null) {<NEW_LINE>colspan = table.getColumnsCount();<NEW_LINE>}<NEW_LINE>writer.writeAttribute("colspan", colspan, null);<NEW_LINE>if (expandable) {<NEW_LINE>encodeToggleIcon(context, expanded);<NEW_LINE>}<NEW_LINE>String field = row.getField();<NEW_LINE>Object value = LangUtils.isNotBlank(field) ? UIColumn.createValueExpressionFromField(context, table.getVar(), field).getValue(context.getELContext(<MASK><NEW_LINE>writer.writeText(value, null);<NEW_LINE>writer.endElement("td");<NEW_LINE>} | )) : row.getGroupBy(); |
1,670,139 | public void apply(Node n, Region r) {<NEW_LINE>ForceAtlas2LayoutData nLayout = n.getLayoutData();<NEW_LINE>// Get the distance<NEW_LINE>double xDist = n.x() - r.getMassCenterX();<NEW_LINE>double yDist = n.y() - r.getMassCenterY();<NEW_LINE>double distance = (float) Math.sqrt(xDist * xDist + yDist * yDist);<NEW_LINE>if (distance > 0) {<NEW_LINE>// NB: factor = force / distance<NEW_LINE>double factor = coefficient * nLayout.mass * r.getMass() / distance / distance;<NEW_LINE>nLayout.dx += xDist * factor;<NEW_LINE>nLayout.dy += yDist * factor;<NEW_LINE>} else if (distance < 0) {<NEW_LINE>double factor = -coefficient * nLayout.mass <MASK><NEW_LINE>nLayout.dx += xDist * factor;<NEW_LINE>nLayout.dy += yDist * factor;<NEW_LINE>}<NEW_LINE>} | * r.getMass() / distance; |
1,046,826 | final DeleteModelResult executeDeleteModel(DeleteModelRequest deleteModelRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteModelRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteModelRequest> request = null;<NEW_LINE>Response<DeleteModelResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteModelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteModelRequest));<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, "FraudDetector");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteModel");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteModelResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteModelResultJsonUnmarshaller());<NEW_LINE>response = <MASK><NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | invoke(request, responseHandler, executionContext); |
387,531 | private void writeDataFlowConfig(Document document, Element parentElement) {<NEW_LINE>Element dataFlowConfigTag = document.createElement(XMLConstants.TAG_DATA_FLOW_CONFIGURATION);<NEW_LINE>parentElement.appendChild(dataFlowConfigTag);<NEW_LINE>PathConfiguration pathConfig = config.getPathConfiguration();<NEW_LINE>SolverConfiguration solverConfig = config.getSolverConfiguration();<NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_MAX_JOIN_POINT_ABSTRACTIONS, Integer.toString(solverConfig.getMaxJoinPointAbstractions()));<NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_MAX_CALLEES_PER_CALL_SITE, Integer.toString(solverConfig.getMaxCalleesPerCallSite()));<NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_IMPLICIT_FLOW_MODE, config.getImplicitFlowMode().toString());<NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_STATIC_FIELD_TRACKING_MODE, config.getStaticFieldTrackingMode().toString());<NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_ENABLE_EXCEPTIONS, Boolean.toString(config.getEnableExceptionTracking()));<NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_ENABLE_ARRAYS, Boolean.toString(config.getEnableArrayTracking()));<NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_ENABLE_REFLECTION, Boolean.toString(config.getEnableReflection()));<NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_FLOW_SENSITIVE_ALIASING, Boolean.toString<MASK><NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_LOG_SOURCES_AND_SINKS, Boolean.toString(config.getLogSourcesAndSinks()));<NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_ENABLE_ARRAY_SIZE_TAINTING, Boolean.toString(config.getEnableArraySizeTainting()));<NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_PATH_RECONSTRUCTION_MODE, pathConfig.getPathReconstructionMode().toString());<NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_PATH_AGNOSTIC_RESULTS, Boolean.toString(InfoflowConfiguration.getPathAgnosticResults()));<NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_MAX_CALLSTACK_SIZE, Integer.toString(pathConfig.getMaxCallStackSize()));<NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_MAX_PATH_LENGTH, Integer.toString(pathConfig.getMaxPathLength()));<NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_MAX_PATHS_PER_ABSTRACTION, Integer.toString(pathConfig.getMaxPathsPerAbstraction()));<NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_DATA_FLOW_TIMEOUT, Long.toString(config.getDataFlowTimeout()));<NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_PATH_RECONSTRUCTION_TIMEOUT, Long.toString(pathConfig.getPathReconstructionTimeout()));<NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_PATH_RECONSTRUCTION_BATCH_SIZE, Integer.toString(pathConfig.getPathReconstructionBatchSize()));<NEW_LINE>appendSimpleTag(document, dataFlowConfigTag, XMLConstants.TAG_WRITE_OUTPUT_FILES, Boolean.toString(config.getWriteOutputFiles()));<NEW_LINE>} | (config.getFlowSensitiveAliasing())); |
563,356 | private List<ValidationEvent> validateBlobTargetsArePayloads(Model model) {<NEW_LINE>List<ValidationEvent> <MASK><NEW_LINE>ServiceIndex serviceIndex = ServiceIndex.of(model);<NEW_LINE>Walker walker = new Walker(model);<NEW_LINE>final Set<ServiceShape> servicesWithPayloadSupportingProtocols = model.getServiceShapes().stream().filter(service -> serviceIndex.getProtocols(service).values().stream().map(trait -> model.expectShape(trait.toShapeId())).map(traitShape -> traitShape.expectTrait(ProtocolDefinitionTrait.class)).anyMatch(protocol -> protocol.getTraits().contains(HttpPayloadTrait.ID))).collect(Collectors.toSet());<NEW_LINE>for (ServiceShape service : servicesWithPayloadSupportingProtocols) {<NEW_LINE>walker.walkShapes(service).stream().filter(Shape::isMemberShape).map(shape -> shape.asMemberShape().get()).filter(memberShape -> !memberShape.hasTrait(HttpPayloadTrait.ID)).filter(memberShape -> model.expectShape(memberShape.getTarget()).isBlobShape()).filter(memberShape -> model.expectShape(memberShape.getTarget()).hasTrait(StreamingTrait.ID)).forEach(memberShape -> events.add(error(memberShape, String.format("Member `%s` referencing " + "@streaming shape `%s` must have the @httpPayload trait, " + "as service `%s` has a protocol that supports @httpPayload.", memberShape.toShapeId(), memberShape.getTarget(), service.toShapeId()))));<NEW_LINE>}<NEW_LINE>return events;<NEW_LINE>} | events = new ArrayList<>(); |
275,633 | public byte[] decode(String attr, Hashtable<String, Integer> labelToPc) {<NEW_LINE>if (Options.v().verbose()) {<NEW_LINE>logger.debug("[] JasminAttribute decode...");<NEW_LINE>}<NEW_LINE>List<byte[]> attributeHunks = new LinkedList<byte[]>();<NEW_LINE><MASK><NEW_LINE>boolean isLabel = attr.startsWith("%");<NEW_LINE>StringTokenizer st = new StringTokenizer(attr, "%");<NEW_LINE>while (st.hasMoreTokens()) {<NEW_LINE>String token = st.nextToken();<NEW_LINE>if (isLabel) {<NEW_LINE>Integer pc = labelToPc.get(token);<NEW_LINE>if (pc == null) {<NEW_LINE>throw new RuntimeException("PC is null, the token is " + token);<NEW_LINE>}<NEW_LINE>int pcvalue = pc;<NEW_LINE>if (pcvalue > 65535) {<NEW_LINE>throw new RuntimeException("PC great than 65535, the token is " + token + " : " + pcvalue);<NEW_LINE>}<NEW_LINE>attributeHunks.add(new byte[] { (byte) (pcvalue & 0x0FF), (byte) ((pcvalue >> 8) & 0x0FF) });<NEW_LINE>attributeSize += 2;<NEW_LINE>tablesize++;<NEW_LINE>} else {<NEW_LINE>byte[] hunk = Base64.decode(token.toCharArray());<NEW_LINE>attributeSize += hunk.length;<NEW_LINE>attributeHunks.add(hunk);<NEW_LINE>}<NEW_LINE>isLabel = !isLabel;<NEW_LINE>} | int attributeSize = 0, tablesize = 0; |
364,168 | final CreateDataflowEndpointGroupResult executeCreateDataflowEndpointGroup(CreateDataflowEndpointGroupRequest createDataflowEndpointGroupRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createDataflowEndpointGroupRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateDataflowEndpointGroupRequest> request = null;<NEW_LINE>Response<CreateDataflowEndpointGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateDataflowEndpointGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createDataflowEndpointGroupRequest));<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, "GroundStation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateDataflowEndpointGroup");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateDataflowEndpointGroupResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateDataflowEndpointGroupResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
460,962 | public void visit(BLangBinaryExpr binaryExpr) {<NEW_LINE>BLangExpression lhsExpr = binaryExpr.lhsExpr;<NEW_LINE>BLangExpression rhsExpr = binaryExpr.rhsExpr;<NEW_LINE>OperatorKind opKind = binaryExpr.opKind;<NEW_LINE>if (opKind == OperatorKind.EQUAL || opKind == OperatorKind.NOT_EQUAL) {<NEW_LINE>// eg a == 5, a == (), a == ONE, a == b : One side should be a variable and other side should be an expr<NEW_LINE>narrowTypeForEqualOrNotEqual(binaryExpr, lhsExpr, rhsExpr);<NEW_LINE>// eg 5 == a, () == a, ONE == a, b == a<NEW_LINE>narrowTypeForEqualOrNotEqual(binaryExpr, rhsExpr, lhsExpr);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Map<BVarSymbol, NarrowedTypes> t1 = getNarrowedTypes(lhsExpr, env);<NEW_LINE>Map<BVarSymbol, NarrowedTypes> t2 = getNarrowedTypes(rhsExpr, env);<NEW_LINE>Set<BVarSymbol> updatedSymbols = new LinkedHashSet<>(t1.keySet());<NEW_LINE>updatedSymbols.<MASK><NEW_LINE>if (opKind == OperatorKind.AND || opKind == OperatorKind.OR) {<NEW_LINE>for (BVarSymbol symbol : updatedSymbols) {<NEW_LINE>binaryExpr.narrowedTypeInfo.put(getOriginalVarSymbol(symbol), getNarrowedTypesForBinaryOp(t1, t2, getOriginalVarSymbol(symbol), binaryExpr.opKind));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | addAll(t2.keySet()); |
251,422 | protected String doIt() throws Exception {<NEW_LINE><MASK><NEW_LINE>getSelectionKeys().forEach(customBrowseId -> {<NEW_LINE>MBrowseCustom fromCustomBrowse = new MBrowseCustom(getCtx(), customBrowseId, get_TrxName());<NEW_LINE>MBrowseCustom toCustomBrowse = new MBrowseCustom(getCtx(), 0, get_TrxName());<NEW_LINE>// Copy all<NEW_LINE>PO.copyValues(fromCustomBrowse, toCustomBrowse);<NEW_LINE>if (getTable_ID() == I_ASP_Level.Table_ID) {<NEW_LINE>toCustomBrowse.setASP_Level_ID(getRecord_ID());<NEW_LINE>} else if (getTable_ID() == I_AD_Role.Table_ID) {<NEW_LINE>toCustomBrowse.setAD_Role_ID(getRecord_ID());<NEW_LINE>} else if (getTable_ID() == I_AD_User.Table_ID) {<NEW_LINE>toCustomBrowse.setAD_User_ID(getRecord_ID());<NEW_LINE>}<NEW_LINE>toCustomBrowse.saveEx();<NEW_LINE>// Copy fields<NEW_LINE>List<MBrowseFieldCustom> fromFieldList = fromCustomBrowse.getFields();<NEW_LINE>List<MBrowseFieldCustom> toFieldList = toCustomBrowse.getFields();<NEW_LINE>if (fromFieldList != null && fromFieldList.size() != 0) {<NEW_LINE>// Set default to old parameters<NEW_LINE>toFieldList.forEach(parameter -> {<NEW_LINE>parameter.setIsDisplayed(false);<NEW_LINE>parameter.saveEx();<NEW_LINE>});<NEW_LINE>// Set<NEW_LINE>fromFieldList.forEach(fromField -> {<NEW_LINE>Optional<MBrowseFieldCustom> maybeCustomField = toFieldList.stream().filter(toField -> toField.getAD_Browse_Field_ID() == fromField.getAD_Browse_Field_ID()).findFirst();<NEW_LINE>if (maybeCustomField.isPresent()) {<NEW_LINE>MBrowseFieldCustom fieldToOverwrite = maybeCustomField.get();<NEW_LINE>fieldToOverwrite.overwriteValuesFromCustomField(fromField);<NEW_LINE>fieldToOverwrite.saveEx();<NEW_LINE>counter.incrementAndGet();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return "@Update@: " + counter.get();<NEW_LINE>} | AtomicInteger counter = new AtomicInteger(0); |
517,027 | public static Story fromBookmark(Cursor cursor) {<NEW_LINE>Long internalId = cursor.getLong(HNewsContract.BookmarkEntry.COLUMN_ID);<NEW_LINE>Long id = cursor.getLong(HNewsContract.BookmarkEntry.COLUMN_ITEM_ID);<NEW_LINE>String type = cursor.getString(HNewsContract.BookmarkEntry.COLUMN_TYPE);<NEW_LINE>String by = cursor.getString(HNewsContract.BookmarkEntry.COLUMN_BY);<NEW_LINE>String url = cursor.getString(HNewsContract.BookmarkEntry.COLUMN_URL);<NEW_LINE>String title = cursor.<MASK><NEW_LINE>Long timestamp = cursor.getLong(HNewsContract.BookmarkEntry.COLUMN_TIMESTAMP);<NEW_LINE>String filter = cursor.getString(HNewsContract.BookmarkEntry.COLUMN_FILTER);<NEW_LINE>int bookmark = HNewsContract.TRUE_BOOLEAN;<NEW_LINE>return new Story(internalId, by, id, type, (long) 0, 0, title, url, 0, timestamp, 0, bookmark, 0, 0, filter);<NEW_LINE>} | getString(HNewsContract.BookmarkEntry.COLUMN_TITLE); |
1,695,253 | private void blacklistWorkerIfNeeded(TaskStatus taskStatus, WorkerHolder workerHolder) {<NEW_LINE>synchronized (blackListedWorkers) {<NEW_LINE>if (taskStatus.isSuccess()) {<NEW_LINE>workerHolder.resetContinuouslyFailedTasksCount();<NEW_LINE>if (blackListedWorkers.remove(workerHolder.getWorker().getHost()) != null) {<NEW_LINE>workerHolder.setBlacklistedUntil(null);<NEW_LINE>log.info("[%s] removed from blacklist because a task finished with SUCCESS", workerHolder.getWorker());<NEW_LINE>}<NEW_LINE>} else if (taskStatus.isFailure()) {<NEW_LINE>workerHolder.incrementContinuouslyFailedTasksCount();<NEW_LINE>}<NEW_LINE>if (workerHolder.getContinuouslyFailedTasksCount() > config.getMaxRetriesBeforeBlacklist() && blackListedWorkers.size() <= workers.size() * (config.getMaxPercentageBlacklistWorkers() / 100.0) - 1) {<NEW_LINE>workerHolder.setBlacklistedUntil(DateTimes.nowUtc().plus<MASK><NEW_LINE>if (blackListedWorkers.put(workerHolder.getWorker().getHost(), workerHolder) == null) {<NEW_LINE>log.info("Blacklisting [%s] until [%s] after [%,d] failed tasks in a row.", workerHolder.getWorker(), workerHolder.getBlacklistedUntil(), workerHolder.getContinuouslyFailedTasksCount());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | (config.getWorkerBlackListBackoffTime())); |
601,203 | public Set<String> list(boolean global) throws CoreException {<NEW_LINE>IStatus status;<NEW_LINE>if (global) {<NEW_LINE>status = runInBackground(GLOBAL_ARG, PARSEABLE_ARG, LIST);<NEW_LINE>} else {<NEW_LINE>status = runInBackground(PARSEABLE_ARG, LIST);<NEW_LINE>}<NEW_LINE>String output;<NEW_LINE>if (!status.isOK()) {<NEW_LINE>if (status.getCode() == 1 && status instanceof ProcessStatus) {<NEW_LINE>ProcessStatus ps = (ProcessStatus) status;<NEW_LINE>output = ps.getStdOut();<NEW_LINE>// TODO What else can we do to validate that this output is OK?<NEW_LINE>} else {<NEW_LINE>throw new CoreException(new Status(IStatus.ERROR, JSCorePlugin.PLUGIN_ID, MessageFormat.format(Messages.NodePackageManager_FailedListingError, status)));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>output = status.getMessage();<NEW_LINE>}<NEW_LINE>// Need to parse the output!<NEW_LINE>String[] lines = StringUtil.LINE_SPLITTER.split(output);<NEW_LINE>List<IPath> paths = CollectionsUtil.map(CollectionsUtil.newSet(lines), new IMap<String, IPath>() {<NEW_LINE><NEW_LINE>public IPath map(String item) {<NEW_LINE>return Path.fromOSString(item);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Set<String> installed = new HashSet<String>(paths.size());<NEW_LINE>for (IPath path : paths) {<NEW_LINE>try {<NEW_LINE>// The paths we get are locations on disk. We can tell a module's name by looking for a path<NEW_LINE>// that is a child of 'node_modules', i.e. "/usr/local/lib/node_modules/alloy"<NEW_LINE><MASK><NEW_LINE>if (count >= 2 && NODE_MODULES.equals(path.segment(count - 2))) {<NEW_LINE>installed.add(path.lastSegment());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>// There is a chance that npm throw warnings if there are any partial installations<NEW_LINE>// and npm might fail while trying to parse those warnings.<NEW_LINE>if (// $NON-NLS-1$<NEW_LINE>!path.toOSString().contains("npm WARN")) {<NEW_LINE>throw new CoreException(new Status(IStatus.ERROR, JSCorePlugin.PLUGIN_ID, e.getMessage()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return installed;<NEW_LINE>} | int count = path.segmentCount(); |
1,632,349 | public static <In extends ImageBase<In>, Out extends ImageBase<Out>, K extends Kernel1D> void vertical(K kernel, In input, Out output) {<NEW_LINE>switch(input.getImageType().getFamily()) {<NEW_LINE>case GRAY -><NEW_LINE>{<NEW_LINE>if (input instanceof GrayF32) {<NEW_LINE>ConvolveImageNoBorder.vertical((Kernel1D_F32) kernel, (GrayF32) input, (GrayF32) output);<NEW_LINE>} else if (input instanceof GrayU8) {<NEW_LINE>if (GrayI16.class.isAssignableFrom(output.getClass()))<NEW_LINE>ConvolveImageNoBorder.vertical((Kernel1D_S32) kernel, (GrayU8) input, (GrayI16) output);<NEW_LINE>else<NEW_LINE>ConvolveImageNoBorder.vertical((Kernel1D_S32) kernel, (GrayU8) input, (GrayS32) output);<NEW_LINE>} else if (input instanceof GrayS16) {<NEW_LINE>ConvolveImageNoBorder.vertical((Kernel1D_S32) kernel, (GrayS16) input, (GrayI16) output);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown image type: " + input.getClass().getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>case INTERLEAVED -><NEW_LINE>{<NEW_LINE>if (output instanceof InterleavedF32) {<NEW_LINE>ConvolveImageNoBorder.vertical((Kernel1D_F32) kernel, (InterleavedF32) input, (InterleavedF32) output);<NEW_LINE>} else if (input instanceof InterleavedU8) {<NEW_LINE>if (InterleavedI16.class.isAssignableFrom(output.getClass()))<NEW_LINE>ConvolveImageNoBorder.vertical((Kernel1D_S32) kernel, (InterleavedU8<MASK><NEW_LINE>else<NEW_LINE>ConvolveImageNoBorder.vertical((Kernel1D_S32) kernel, (InterleavedU8) input, (InterleavedS32) output);<NEW_LINE>} else if (input instanceof InterleavedS16) {<NEW_LINE>ConvolveImageNoBorder.vertical((Kernel1D_S32) kernel, (InterleavedS16) input, (InterleavedI16) output);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("Unknown image type: " + input.getClass().getName());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>case PLANAR -><NEW_LINE>{<NEW_LINE>Planar inp = (Planar) input;<NEW_LINE>Planar outp = (Planar) output;<NEW_LINE>for (int i = 0; i < inp.getNumBands(); i++) {<NEW_LINE>vertical(kernel, inp.getBand(i), outp.getBand(i));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>default -><NEW_LINE>throw new IllegalArgumentException("Unknown image family");<NEW_LINE>}<NEW_LINE>} | ) input, (InterleavedI16) output); |
849,141 | final ListUserHierarchyGroupsResult executeListUserHierarchyGroups(ListUserHierarchyGroupsRequest listUserHierarchyGroupsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listUserHierarchyGroupsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListUserHierarchyGroupsRequest> request = null;<NEW_LINE>Response<ListUserHierarchyGroupsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListUserHierarchyGroupsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listUserHierarchyGroupsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Connect");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListUserHierarchyGroups");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListUserHierarchyGroupsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListUserHierarchyGroupsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint); |
3,644 | public void actionPerformed(@Nonnull AnActionEvent e) {<NEW_LINE>List<ComponentManagerImpl> areas = new ArrayList<>();<NEW_LINE>areas.add((ComponentManagerImpl) Application.get());<NEW_LINE>final Project project = e.getData(CommonDataKeys.PROJECT);<NEW_LINE>if (project != null) {<NEW_LINE>areas.add((ComponentManagerImpl) project);<NEW_LINE>final Module[] modules = ModuleManager.getInstance(project).getModules();<NEW_LINE>if (modules.length > 0) {<NEW_LINE>areas.add((ComponentManagerImpl) modules[0]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>System.out.print(areas.size() + " extension areas: ");<NEW_LINE>for (ComponentManager area : areas) {<NEW_LINE>System.out.print(area + " ");<NEW_LINE>}<NEW_LINE>System.out.println("\n");<NEW_LINE>List<ExtensionPoint> points = new ArrayList<>();<NEW_LINE>for (ComponentManagerImpl area : areas) {<NEW_LINE>points.addAll(Arrays.asList(area.getExtensionPoints()));<NEW_LINE>}<NEW_LINE>System.out.println(points.size() + " extension points: ");<NEW_LINE>for (ExtensionPoint point : points) {<NEW_LINE>System.out.println(" " + point.getName());<NEW_LINE>}<NEW_LINE>List<Object> extensions = new ArrayList<>();<NEW_LINE>for (ExtensionPoint point : points) {<NEW_LINE>extensions.addAll(point.getExtensionList());<NEW_LINE>}<NEW_LINE>System.out.println("\n" + <MASK><NEW_LINE>for (Object extension : extensions) {<NEW_LINE>if (extension instanceof Configurable) {<NEW_LINE>System.out.println("!!!! Configurable extension found. Kill it !!!");<NEW_LINE>}<NEW_LINE>System.out.println(extension);<NEW_LINE>}<NEW_LINE>} | extensions.size() + " extensions:"); |
1,340,915 | private boolean tryPropertyOfSuperClass(final PropertyExpression pexp, final String propertyName) {<NEW_LINE>ClassNode classNode = controller.getClassNode();<NEW_LINE>if (!controller.getCompileStack().isLHS()) {<NEW_LINE>// TODO: "is"<NEW_LINE>String <MASK><NEW_LINE>callX(pexp.getObjectExpression(), methodName).visit(this);<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>FieldNode fieldNode = classNode.getSuperClass().getField(propertyName);<NEW_LINE>if (fieldNode == null) {<NEW_LINE>throw new RuntimeParserException("Failed to find field[" + propertyName + "] of " + classNode.getName() + "'s super class", pexp);<NEW_LINE>}<NEW_LINE>if (fieldNode.isFinal()) {<NEW_LINE>throw new RuntimeParserException("Cannot modify final field[" + propertyName + "] of " + classNode.getName() + "'s super class", pexp);<NEW_LINE>}<NEW_LINE>MethodNode setter = classNode.getSuperClass().getSetterMethod(getSetterName(propertyName));<NEW_LINE>MethodNode getter = classNode.getSuperClass().getGetterMethod("get" + capitalize(propertyName));<NEW_LINE>if (fieldNode.isPrivate() && (setter == null || getter == null || !setter.getDeclaringClass().equals(getter.getDeclaringClass()))) {<NEW_LINE>throw new RuntimeParserException("Cannot access private field[" + propertyName + "] of " + classNode.getName() + "'s super class", pexp);<NEW_LINE>}<NEW_LINE>OperandStack operandStack = controller.getOperandStack();<NEW_LINE>operandStack.doAsType(fieldNode.getType());<NEW_LINE>MethodVisitor mv = controller.getMethodVisitor();<NEW_LINE>mv.visitVarInsn(ALOAD, 0);<NEW_LINE>operandStack.push(classNode);<NEW_LINE>operandStack.swap();<NEW_LINE>String owner = BytecodeHelper.getClassInternalName(classNode.getSuperClass().getName());<NEW_LINE>String desc = BytecodeHelper.getTypeDescription(fieldNode.getType());<NEW_LINE>if (fieldNode.isPublic() || fieldNode.isProtected()) {<NEW_LINE>mv.visitFieldInsn(PUTFIELD, owner, propertyName, desc);<NEW_LINE>} else {<NEW_LINE>mv.visitMethodInsn(INVOKESPECIAL, owner, setter.getName(), BytecodeHelper.getMethodDescriptor(setter), false);<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} | methodName = "get" + capitalize(propertyName); |
1,728,227 | private void doCopy(URL sourceUrl, InputStream is, File temp, int contentLength) throws IOException {<NEW_LINE>OutputStream os = null;<NEW_LINE>int read = 0;<NEW_LINE>int totalRead = 0;<NEW_LINE>try {<NEW_LINE>os = new BufferedOutputStream(new FileOutputStream(temp));<NEW_LINE>byte[] bytes = new byte[1024];<NEW_LINE>while ((read = is.read(bytes)) != -1) {<NEW_LINE>os.<MASK><NEW_LINE>totalRead += read;<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>err.log(Level.INFO, "Writing content of URL " + sourceUrl + " failed.", ex);<NEW_LINE>throw ex;<NEW_LINE>} finally {<NEW_LINE>try {<NEW_LINE>is.close();<NEW_LINE>if (os != null) {<NEW_LINE>os.flush();<NEW_LINE>os.close();<NEW_LINE>}<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>err.log(Level.INFO, "Closing streams failed.", ioe);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (contentLength != -1 && contentLength != totalRead) {<NEW_LINE>err.log(Level.INFO, "Content length was reported as " + contentLength + " bytes, but read " + totalRead + " bytes from " + sourceUrl);<NEW_LINE>throw new IOException("Unexpected closed connection to " + sourceUrl);<NEW_LINE>}<NEW_LINE>if (totalRead == 0 && !allowZeroLength) {<NEW_LINE>err.log(Level.INFO, "Connection content length was " + contentLength + " bytes (read " + totalRead + "bytes), expected file size can`t be that size - likely server with file at " + sourceUrl + " is temporary down");<NEW_LINE>throw new IOException("Zero sized file reported at " + sourceUrl);<NEW_LINE>}<NEW_LINE>err.log(Level.FINE, "Read " + totalRead + " bytes from file at " + sourceUrl);<NEW_LINE>} | write(bytes, 0, read); |
1,504,869 | public void run(RegressionEnvironment env) {<NEW_LINE>String text = "@name('s0') select * from SupportRecogBean#keepall " + "match_recognize (" + " partition by value" + " measures A.theString as a_string " + " pattern (A B) " + " define " + " A as (A.theString = 'A')," + " B as (B.theString = 'B')" + ")";<NEW_LINE>env.compileDeploy(text).addListener("s0");<NEW_LINE>for (int i = 0; i < 5 * RowRecogPartitionStateRepoGroup.INITIAL_COLLECTION_MIN; i++) {<NEW_LINE>env.sendEventBean(new SupportRecogBean("A", i));<NEW_LINE>env.sendEventBean(new SupportRecogBean("B", i));<NEW_LINE>env.assertListenerInvoked("s0");<NEW_LINE>}<NEW_LINE>env.milestone(0);<NEW_LINE>for (int i = 0; i < 5 * RowRecogPartitionStateRepoGroup.INITIAL_COLLECTION_MIN; i++) {<NEW_LINE>env.sendEventBean(new SupportRecogBean("A", i + 100000));<NEW_LINE>}<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>for (int i = 0; i < 5 * RowRecogPartitionStateRepoGroup.INITIAL_COLLECTION_MIN; i++) {<NEW_LINE>env.sendEventBean(new SupportRecogBean<MASK><NEW_LINE>env.assertListenerInvoked("s0");<NEW_LINE>}<NEW_LINE>env.undeployAll();<NEW_LINE>} | ("B", i + 100000)); |
959,438 | private static void uploadFile(UnitClient uc, File file, String dstPathName, boolean isMove, boolean isY) throws Exception {<NEW_LINE>// if (file.isDirectory()) {<NEW_LINE>// File[] subFiles = file.listFiles();<NEW_LINE>// for (int i = 0; i < subFiles.length; i++) {<NEW_LINE>// File subFile = subFiles[i];<NEW_LINE>// uploadFile(uc, subFile, dstPathName<NEW_LINE>// + File.separator + subFile.getName());<NEW_LINE>// }<NEW_LINE>// return;<NEW_LINE>// }<NEW_LINE>int type = getFileType(file);<NEW_LINE>if (type > 0) {<NEW_LINE>uploadCtxFile(uc, file, dstPathName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Request req;<NEW_LINE>// if(dstPartition==-1){<NEW_LINE>// req = new Request(Request.PARTITION_UPLOAD_DFX);<NEW_LINE>// req.setAttr(Request.UPLOAD_DFX_RelativePath, dstPathName);<NEW_LINE>// req.setAttr(Request.UPLOAD_DFX_LastModified, new Long(file.lastModified()));<NEW_LINE>// }else{<NEW_LINE>req = new Request(Request.PARTITION_UPLOAD);<NEW_LINE>req.<MASK><NEW_LINE>req.setAttr(Request.UPLOAD_LastModified, new Long(file.lastModified()));<NEW_LINE>req.setAttr(Request.UPLOAD_IsMove, isMove);<NEW_LINE>req.setAttr(Request.UPLOAD_IsY, isY);<NEW_LINE>// }<NEW_LINE>uc.write(req);<NEW_LINE>Response res = (Response) uc.read();<NEW_LINE>if (res.getException() != null) {<NEW_LINE>throw res.getException();<NEW_LINE>}<NEW_LINE>boolean isNeedUpdate = (Boolean) res.getResult();<NEW_LINE>if (!isNeedUpdate) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>FileInputStream fis = new FileInputStream(file);<NEW_LINE>byte[] fileBuf = RemoteFileProxyManager.read(fis, Env.FILE_BUFSIZE);<NEW_LINE>uc.write(fileBuf);<NEW_LINE>while (fileBuf != null) {<NEW_LINE>// Request.EOF) {<NEW_LINE>fileBuf = RemoteFileProxyManager.read(fis, Env.FILE_BUFSIZE);<NEW_LINE>uc.write(fileBuf);<NEW_LINE>}<NEW_LINE>fis.close();<NEW_LINE>res = (Response) uc.read();<NEW_LINE>if (res.getException() != null)<NEW_LINE>throw res.getException();<NEW_LINE>Logger.debug("upload: " + file.getAbsolutePath() + " OK.");<NEW_LINE>} | setAttr(Request.UPLOAD_DstPath, dstPathName); |
686,983 | private static SSLContext createSSLContext() throws RuntimeException {<NEW_LINE>try {<NEW_LINE>String keyPass = getServerConfig().getKeyPass();<NEW_LINE>if (keyPass == null) {<NEW_LINE>Map<String, Object> secretConfig = Config.getInstance().getJsonMapConfig(SECRET_CONFIG_NAME);<NEW_LINE>keyPass = (String) secretConfig.get(SecretConstants.SERVER_KEY_PASS);<NEW_LINE>}<NEW_LINE>KeyManager[] keyManagers = buildKeyManagers(loadKeyStore(), keyPass.toCharArray());<NEW_LINE>TrustManager[] trustManagers;<NEW_LINE>if (getServerConfig().isEnableTwoWayTls()) {<NEW_LINE>trustManagers = buildTrustManagers(loadTrustStore());<NEW_LINE>} else {<NEW_LINE>trustManagers = buildTrustManagers(null);<NEW_LINE>}<NEW_LINE>SSLContext sslContext;<NEW_LINE>sslContext = SSLContext.getInstance("TLSv1");<NEW_LINE>sslContext.init(keyManagers, trustManagers, null);<NEW_LINE>return sslContext;<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>throw new RuntimeException("Unable to create SSLContext", e);<NEW_LINE>}<NEW_LINE>} | logger.error("Unable to create SSLContext", e); |
1,079,371 | public void run(RegressionEnvironment env) {<NEW_LINE>String epl = "@name('s0') expression myindex {pointregionquadtree(0, 0, 100, 100)}" + "select p.id as c0 from pattern [every p=SupportSpatialPoint -> every SupportSpatialAABB(point(p.px, p.py, filterindex:myindex).inside(rectangle(x, y, width, height)))]";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>env.milestone(0);<NEW_LINE>sendPoint(env, "P0", 10, 10);<NEW_LINE>sendPoint(env, "P1", 60, 60);<NEW_LINE>sendPoint(env, "P2", 60, 10);<NEW_LINE>sendPoint(env, "P3", 10, 60);<NEW_LINE>sendPoint(<MASK><NEW_LINE>env.assertThat(() -> assertEquals(6, SupportFilterServiceHelper.getFilterSvcCountApprox(env)));<NEW_LINE>assertRectanglesManyRow(env, BOXES, "P0,P4", "P2", "P3", "P1", "P1");<NEW_LINE>env.milestone(1);<NEW_LINE>env.assertThat(() -> assertEquals(6, SupportFilterServiceHelper.getFilterSvcCountApprox(env)));<NEW_LINE>assertRectanglesManyRow(env, BOXES, "P0,P4", "P2", "P3", "P1", "P1");<NEW_LINE>env.undeployAll();<NEW_LINE>env.assertThat(() -> assertEquals(0, SupportFilterServiceHelper.getFilterSvcCountApprox(env)));<NEW_LINE>} | env, "P4", 10, 10); |
1,821,996 | public void updateAmountCost() {<NEW_LINE>if (movementQuantity.signum() > 0) {<NEW_LINE>costDetail.setCostAmt(costDetail.getAmt().subtract(costDetail.getCostAdjustment()));<NEW_LINE>costDetail.setCostAmtLL(costDetail.getAmtLL().subtract(costDetail.getCostAdjustmentLL()));<NEW_LINE>} else if (movementQuantity.signum() < 0) {<NEW_LINE>costDetail.setCostAmt(costDetail.getAmt().add(adjustCost));<NEW_LINE>costDetail.setCostAmtLL(costDetail.getAmtLL().add(adjustCostLowerLevel));<NEW_LINE>}<NEW_LINE>costDetail.setCumulatedQty(getNewAccumulatedQuantity(lastCostDetail));<NEW_LINE>costDetail.setCumulatedAmt(getNewAccumulatedAmount(lastCostDetail));<NEW_LINE>costDetail.setCumulatedAmtLL(getNewAccumulatedAmountLowerLevel(lastCostDetail));<NEW_LINE>costDetail.setCurrentCostPrice(currentCostPrice);<NEW_LINE>costDetail.setCurrentCostPriceLL(currentCostPriceLowerLevel);<NEW_LINE>// set the id for model<NEW_LINE>final String idColumnName = CostEngine.getIDColumnName(model);<NEW_LINE>costDetail.set_ValueOfColumn(idColumnName, CostEngine.getIDColumn(model));<NEW_LINE>if (model instanceof MInOutLine) {<NEW_LINE>MInOutLine ioLine = (MInOutLine) model;<NEW_LINE>costDetail.setC_OrderLine_ID(ioLine.getC_OrderLine_ID());<NEW_LINE>// IMPORTANT : reset possible provision purchase cost processed<NEW_LINE>costDetail.setC_InvoiceLine_ID(0);<NEW_LINE>}<NEW_LINE>if (model instanceof MMatchInv && costDetail.getM_InOutLine_ID() == 0) {<NEW_LINE>MMatchInv iMatch = (MMatchInv) model;<NEW_LINE>costDetail.setM_InOutLine_ID(iMatch.getM_InOutLine_ID());<NEW_LINE>}<NEW_LINE>if (model instanceof MMatchPO && costDetail.getM_InOutLine_ID() == 0) {<NEW_LINE>MMatchPO poMatch = (MMatchPO) model;<NEW_LINE>costDetail.setM_InOutLine_ID(poMatch.getM_InOutLine_ID());<NEW_LINE>}<NEW_LINE>if (model instanceof MLandedCostAllocation) {<NEW_LINE>MLandedCostAllocation allocation = (MLandedCostAllocation) model;<NEW_LINE>costDetail.<MASK><NEW_LINE>costDetail.setC_InvoiceLine_ID(allocation.getC_InvoiceLine_ID());<NEW_LINE>costDetail.setC_LandedCostAllocation_ID(allocation.getC_LandedCostAllocation_ID());<NEW_LINE>costDetail.setProcessed(false);<NEW_LINE>}<NEW_LINE>costDetail.saveEx();<NEW_LINE>} | setM_InOutLine_ID(allocation.getM_InOutLine_ID()); |
1,691,573 | static void write(Manifest manifest, OutputStream out) throws IOException {<NEW_LINE>CharsetEncoder encoder = Charsets.UTF_8.newEncoder();<NEW_LINE>ByteBuffer buffer = ByteBuffer.allocate(LINE_LENGTH_LIMIT);<NEW_LINE>String version = manifest.mainAttributes.getValue(Attributes.Name.MANIFEST_VERSION);<NEW_LINE>if (version != null) {<NEW_LINE>writeEntry(out, Attributes.Name.MANIFEST_VERSION, version, encoder, buffer);<NEW_LINE>Iterator<?> entries = manifest.mainAttributes.keySet().iterator();<NEW_LINE>while (entries.hasNext()) {<NEW_LINE>Attributes.Name name = (Attributes.Name) entries.next();<NEW_LINE>if (!name.equals(Attributes.Name.MANIFEST_VERSION)) {<NEW_LINE>writeEntry(out, name, manifest.mainAttributes.getValue(name), encoder, buffer);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.write(LINE_SEPARATOR);<NEW_LINE>Iterator<String> i = manifest.getEntries().keySet().iterator();<NEW_LINE>while (i.hasNext()) {<NEW_LINE>String key = i.next();<NEW_LINE>writeEntry(out, NAME_ATTRIBUTE, key, encoder, buffer);<NEW_LINE>Attributes attrib = manifest.entries.get(key);<NEW_LINE>Iterator<?> entries = attrib.keySet().iterator();<NEW_LINE>while (entries.hasNext()) {<NEW_LINE>Attributes.Name name = (Attributes.Name) entries.next();<NEW_LINE>writeEntry(out, name, attrib.getValue<MASK><NEW_LINE>}<NEW_LINE>out.write(LINE_SEPARATOR);<NEW_LINE>}<NEW_LINE>} | (name), encoder, buffer); |
1,750,935 | public int insertRule(final String rule, final Object position) {<NEW_LINE>final int positionInt;<NEW_LINE>if (position == null) {<NEW_LINE>positionInt = 0;<NEW_LINE>} else if (Undefined.isUndefined(position)) {<NEW_LINE>if (getBrowserVersion().hasFeature(JS_GROUPINGRULE_INSERTRULE_INDEX_OPTIONAL)) {<NEW_LINE>positionInt = 0;<NEW_LINE>} else {<NEW_LINE>throw <MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>positionInt = ScriptRuntime.toInt32(position);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>initCssRules();<NEW_LINE>getGroupingRule().insertRule(rule, fixIndex(positionInt));<NEW_LINE>refreshCssRules();<NEW_LINE>return positionInt;<NEW_LINE>} catch (final DOMException e) {<NEW_LINE>// in case of error try with an empty rule<NEW_LINE>final int pos = rule.indexOf('{');<NEW_LINE>if (pos > -1) {<NEW_LINE>final String newRule = rule.substring(0, pos) + "{}";<NEW_LINE>try {<NEW_LINE>getGroupingRule().insertRule(newRule, fixIndex(positionInt));<NEW_LINE>refreshCssRules();<NEW_LINE>return positionInt;<NEW_LINE>} catch (final DOMException ex) {<NEW_LINE>throw Context.throwAsScriptRuntimeEx(ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>throw Context.throwAsScriptRuntimeEx(e);<NEW_LINE>}<NEW_LINE>} | ScriptRuntime.typeError("Failed to execute 'insertRule' on 'CSSGroupingRule':" + " 2 arguments required, but only 1 present."); |
596,630 | private Map<ParameterServerId, PSMatricesSaveContext> split(int requestId, ModelSaveContext saveContext) {<NEW_LINE>List<MatrixSaveContext> matricesContext = saveContext.getMatricesContext();<NEW_LINE>Map<ParameterServerId, List<PSMatrixSaveContext>> psIdToContextsMap = new HashMap<>();<NEW_LINE>int size = matricesContext.size();<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>Map<ParameterServerId, PSMatrixSaveContext> psIdToContextMap = split(matricesContext.get(i));<NEW_LINE>for (Map.Entry<ParameterServerId, PSMatrixSaveContext> matrixEntry : psIdToContextMap.entrySet()) {<NEW_LINE>List<PSMatrixSaveContext> contexts = psIdToContextsMap.get(matrixEntry.getKey());<NEW_LINE>if (contexts == null) {<NEW_LINE>contexts = new ArrayList<>();<NEW_LINE>psIdToContextsMap.put(matrixEntry.getKey(), contexts);<NEW_LINE>}<NEW_LINE>contexts.add(matrixEntry.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Map<ParameterServerId, PSMatricesSaveContext> ret = new HashMap<>(psIdToContextsMap.size());<NEW_LINE>int subRequestId = 0;<NEW_LINE>for (Map.Entry<ParameterServerId, List<PSMatrixSaveContext>> modelEntry : psIdToContextsMap.entrySet()) {<NEW_LINE>Path psPath = new Path(new Path(new Path(saveContext.getTmpSavePath()), ModelFilesConstent.resultDirName), modelEntry.getKey().toString());<NEW_LINE>List<PSMatrixSaveContext> psMatrixContexts = modelEntry.getValue();<NEW_LINE>for (PSMatrixSaveContext matrixContext : psMatrixContexts) {<NEW_LINE>matrixContext.setSavePath(new Path(psPath, context.getMatrixMetaManager().getMatrix(matrixContext.getMatrixId()).getName<MASK><NEW_LINE>}<NEW_LINE>ret.put(modelEntry.getKey(), new PSMatricesSaveContext(requestId, subRequestId++, modelEntry.getValue()));<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | ()).toString()); |
1,160,262 | long findCib(long in_dsa) {<NEW_LINE>try {<NEW_LINE>long cibh_ptr_cib = 0;<NEW_LINE>long ceecaaerrcm = caa.ceecaaerrcm();<NEW_LINE>long cibhptr = ceexhcomTemplate.getHcom_cibh(inputStream, ceecaaerrcm);<NEW_LINE>while (cibhptr != 0) {<NEW_LINE>boolean cibh_in_use = CeexcibhTemplate.getCibh_in_use(inputStream, cibhptr) != 0;<NEW_LINE>cibh_ptr_cib = CeexcibhTemplate.getCibh_ptr_cib(inputStream, cibhptr);<NEW_LINE>long cib_sv1 = CeexcibTemplate.getCib_sv1(inputStream, cibh_ptr_cib);<NEW_LINE>if (cibh_in_use && cib_sv1 == in_dsa)<NEW_LINE>break;<NEW_LINE>cibhptr = CeexcibhTemplate.getCibh_back(inputStream, cibhptr);<NEW_LINE>}<NEW_LINE>if (cibhptr == 0) {<NEW_LINE>return 0;<NEW_LINE>} else {<NEW_LINE>log.fine("found a cib: " + hex(cibh_ptr_cib));<NEW_LINE>return cibh_ptr_cib;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | throw new Error("oops: " + e); |
1,200,539 | public void coGroup(Iterable<Tuple4<Integer, Long, T1, PriorityQueue<Tuple2<Long, Float>>>> records, Iterable<Tuple3<Integer, Long, T2>> targets, Collector<Tuple4<Integer, Long, T1, PriorityQueue<Tuple2<Long, Float>>>> out) throws Exception {<NEW_LINE>if (records == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (targets == null) {<NEW_LINE>records.forEach(out::collect);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>long t0 = System.currentTimeMillis();<NEW_LINE>bulkScoreFunction.addTargets(targets);<NEW_LINE>double tScore = 0.;<NEW_LINE>double tEnqueue = 0.;<NEW_LINE>int numRecords = 0;<NEW_LINE>int numTargets = 0;<NEW_LINE>for (Tuple4<Integer, Long, T1, PriorityQueue<Tuple2<Long, Float>>> record : records) {<NEW_LINE>long tt0 = System.currentTimeMillis();<NEW_LINE>numRecords++;<NEW_LINE>List<Tuple2<Long, Float>> scores = bulkScoreFunction.scoreAll(record.f1, record.f2);<NEW_LINE>numTargets = scores.size();<NEW_LINE>long tt1 = System.currentTimeMillis();<NEW_LINE>PriorityQueue<Tuple2<Long, Float>> priorQueue = record.f3;<NEW_LINE>for (int i = 0; i < scores.size(); i++) {<NEW_LINE>float score = scores.get(i).f1;<NEW_LINE>Long targetId = scores.get(i).f0;<NEW_LINE>if (priorQueue.size() < k) {<NEW_LINE>priorQueue.add(Tuple2.of(targetId, score));<NEW_LINE>} else {<NEW_LINE>boolean replace = (order == Order.DESCENDING && score > priorQueue.peek().f1 || order == Order.ASCENDING && score < priorQueue.peek().f1);<NEW_LINE>if (replace) {<NEW_LINE>priorQueue.poll();<NEW_LINE>priorQueue.add(Tuple2.of(targetId, score));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>long tt2 = System.currentTimeMillis();<NEW_LINE>tScore += 0.001 * (tt1 - tt0);<NEW_LINE>tEnqueue += 0.001 * (tt2 - tt1);<NEW_LINE>out.collect(record);<NEW_LINE>}<NEW_LINE>long t1 = System.currentTimeMillis();<NEW_LINE>LOG.info("Done local cross in {}s, # records {}, # targets {}", (t1 - t0) * 0.001, numRecords, numTargets);<NEW_LINE>LOG.<MASK><NEW_LINE>} | info("Wall time: score {}s, enqueue {}s", tScore, tEnqueue); |
664,996 | Mono<Response<BlockBlobItem>> uploadFromUrlWithResponse(BlobUploadFromUrlOptions options, Context context) {<NEW_LINE><MASK><NEW_LINE>BlobRequestConditions destinationRequestConditions = options.getDestinationRequestConditions() == null ? new BlobRequestConditions() : options.getDestinationRequestConditions();<NEW_LINE>BlobRequestConditions sourceRequestConditions = options.getSourceRequestConditions() == null ? new BlobRequestConditions() : options.getSourceRequestConditions();<NEW_LINE>context = context == null ? Context.NONE : context;<NEW_LINE>String sourceAuth = options.getSourceAuthorization() == null ? null : options.getSourceAuthorization().toString();<NEW_LINE>try {<NEW_LINE>new URL(options.getSourceUrl());<NEW_LINE>} catch (MalformedURLException ex) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException("'sourceUrl' is not a valid url.", ex));<NEW_LINE>}<NEW_LINE>// TODO (kasobol-msft) add metadata back (https://github.com/Azure/azure-sdk-for-net/issues/15969)<NEW_LINE>return this.azureBlobStorage.getBlockBlobs().putBlobFromUrlWithResponseAsync(containerName, blobName, 0, options.getSourceUrl(), null, null, null, destinationRequestConditions.getLeaseId(), options.getTier(), destinationRequestConditions.getIfModifiedSince(), destinationRequestConditions.getIfUnmodifiedSince(), destinationRequestConditions.getIfMatch(), destinationRequestConditions.getIfNoneMatch(), destinationRequestConditions.getTagsConditions(), sourceRequestConditions.getIfModifiedSince(), sourceRequestConditions.getIfUnmodifiedSince(), sourceRequestConditions.getIfMatch(), sourceRequestConditions.getIfNoneMatch(), sourceRequestConditions.getTagsConditions(), null, options.getContentMd5(), tagsToString(options.getTags()), options.isCopySourceBlobProperties(), sourceAuth, options.getCopySourceTags(), options.getHeaders(), getCustomerProvidedKey(), encryptionScope, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)).map(rb -> {<NEW_LINE>BlockBlobsPutBlobFromUrlHeaders hd = rb.getDeserializedHeaders();<NEW_LINE>BlockBlobItem item = new BlockBlobItem(hd.getETag(), hd.getLastModified(), hd.getContentMD5(), hd.isXMsRequestServerEncrypted(), hd.getXMsEncryptionKeySha256(), hd.getXMsEncryptionScope(), hd.getXMsVersionId());<NEW_LINE>return new SimpleResponse<>(rb, item);<NEW_LINE>});<NEW_LINE>} | StorageImplUtils.assertNotNull("options", options); |
1,633,669 | Mono<DecryptResult> decryptInternal(EncryptionAlgorithm algorithm, byte[] ciphertext, Context context, JsonWebKey jsonWebKey) {<NEW_LINE>keyPair = getKeyPair(jsonWebKey);<NEW_LINE>// Interpret the requested algorithm<NEW_LINE>Algorithm baseAlgorithm = AlgorithmResolver.DEFAULT.get(algorithm.toString());<NEW_LINE>if (baseAlgorithm == null) {<NEW_LINE>if (serviceCryptoAvailable()) {<NEW_LINE>return serviceClient.decrypt(algorithm, ciphertext, context);<NEW_LINE>}<NEW_LINE>return Mono.error(new NoSuchAlgorithmException(algorithm.toString()));<NEW_LINE>} else if (!(baseAlgorithm instanceof AsymmetricEncryptionAlgorithm)) {<NEW_LINE>return Mono.error(new NoSuchAlgorithmException<MASK><NEW_LINE>}<NEW_LINE>if (keyPair.getPrivate() == null) {<NEW_LINE>if (serviceCryptoAvailable()) {<NEW_LINE>return serviceClient.decrypt(algorithm, ciphertext, context);<NEW_LINE>}<NEW_LINE>return Mono.error(new IllegalArgumentException("Private portion of the key not available to perform decrypt operation"));<NEW_LINE>}<NEW_LINE>AsymmetricEncryptionAlgorithm algo = (AsymmetricEncryptionAlgorithm) baseAlgorithm;<NEW_LINE>ICryptoTransform transform;<NEW_LINE>try {<NEW_LINE>transform = algo.createDecryptor(keyPair);<NEW_LINE>return Mono.just(new DecryptResult(transform.doFinal(ciphertext), algorithm, jsonWebKey.getId()));<NEW_LINE>} catch (InvalidKeyException | NoSuchAlgorithmException | NoSuchPaddingException | IllegalBlockSizeException | BadPaddingException e) {<NEW_LINE>return Mono.error(e);<NEW_LINE>}<NEW_LINE>} | (algorithm.toString())); |
51,618 | public void processView(EventBean[] newData, EventBean[] oldData, boolean isGenerateSynthetic) {<NEW_LINE>// apply to aggregates<NEW_LINE>Object[] groupKeysPerLevel = new Object[processor.getGroupByRollupDesc().getLevels().length];<NEW_LINE>EventBean[] eventsPerStream;<NEW_LINE>if (newData != null) {<NEW_LINE>for (EventBean aNewData : newData) {<NEW_LINE>eventsPerStream = new EventBean[] { aNewData };<NEW_LINE>Object groupKeyComplete = processor.generateGroupKeySingle(eventsPerStream, true);<NEW_LINE>for (AggregationGroupByRollupLevel level : processor.getGroupByRollupDesc().getLevels()) {<NEW_LINE>Object groupKey = level.computeSubkey(groupKeyComplete);<NEW_LINE>groupKeysPerLevel[level.getLevelNumber()] = groupKey;<NEW_LINE>outputLimitGroupRepsPerLevel[level.getLevelNumber()].put(groupKey, eventsPerStream);<NEW_LINE>if (processor.isSelectRStream() && !groupRepsOutputLastUnordRStream[level.getLevelNumber()].containsKey(groupKey)) {<NEW_LINE>processor.generateOutputBatchedMapUnsorted(false, groupKey, level, eventsPerStream, true, isGenerateSynthetic, groupRepsOutputLastUnordRStream[level.getLevelNumber()]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>processor.getAggregationService().applyEnter(eventsPerStream, groupKeysPerLevel, processor.getExprEvaluatorContext());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (oldData != null) {<NEW_LINE>for (EventBean anOldData : oldData) {<NEW_LINE>eventsPerStream = new EventBean[] { anOldData };<NEW_LINE>Object groupKeyComplete = processor.generateGroupKeySingle(eventsPerStream, false);<NEW_LINE>for (AggregationGroupByRollupLevel level : processor.getGroupByRollupDesc().getLevels()) {<NEW_LINE>Object groupKey = level.computeSubkey(groupKeyComplete);<NEW_LINE>groupKeysPerLevel[level.getLevelNumber()] = groupKey;<NEW_LINE>outputLimitGroupRepsPerLevel[level.getLevelNumber()].put(groupKey, eventsPerStream);<NEW_LINE>if (processor.isSelectRStream() && !groupRepsOutputLastUnordRStream[level.getLevelNumber()].containsKey(groupKey)) {<NEW_LINE>processor.generateOutputBatchedMapUnsorted(false, groupKey, level, eventsPerStream, false, isGenerateSynthetic, groupRepsOutputLastUnordRStream<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>processor.getAggregationService().applyLeave(eventsPerStream, groupKeysPerLevel, processor.getExprEvaluatorContext());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | [level.getLevelNumber()]); |
1,254,211 | public boolean isEntailed(KnowledgeBase kb, Sentence alpha) {<NEW_LINE>// clauses <- the set of clauses in the CNF representation<NEW_LINE>// of KB & ~alpha<NEW_LINE>Set<Clause> clauses = convertKBAndNotAlphaIntoCNF(kb, alpha);<NEW_LINE>// new <- {}<NEW_LINE>Set<Clause> newClauses = new LinkedHashSet<>();<NEW_LINE>// loop do<NEW_LINE>while (true) {<NEW_LINE>// for each pair of clauses C_i, C_j in clauses do<NEW_LINE>List<Clause> clausesList <MASK><NEW_LINE>for (int i = 0; i < clausesList.size() - 1; i++) {<NEW_LINE>Clause ci = clausesList.get(i);<NEW_LINE>for (int j = i + 1; j < clausesList.size(); j++) {<NEW_LINE>Clause cj = clausesList.get(j);<NEW_LINE>// resolvents <- PL-RESOLVE(C_i, C_j)<NEW_LINE>Set<Clause> resolvents = plResolve(ci, cj);<NEW_LINE>// if resolvents contains the empty clause then return true<NEW_LINE>if (resolvents.contains(Clause.EMPTY)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// new <- new U resolvents<NEW_LINE>newClauses.addAll(resolvents);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// if new is subset of clauses then return false<NEW_LINE>if (clauses.containsAll(newClauses)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// clauses <- clauses U new<NEW_LINE>clauses.addAll(newClauses);<NEW_LINE>}<NEW_LINE>} | = new ArrayList<>(clauses); |
1,137,260 | final UpdateSubscriptionDefinitionResult executeUpdateSubscriptionDefinition(UpdateSubscriptionDefinitionRequest updateSubscriptionDefinitionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateSubscriptionDefinitionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateSubscriptionDefinitionRequest> request = null;<NEW_LINE>Response<UpdateSubscriptionDefinitionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateSubscriptionDefinitionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateSubscriptionDefinitionRequest));<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, "Greengrass");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateSubscriptionDefinition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateSubscriptionDefinitionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateSubscriptionDefinitionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
911,938 | public boolean apply(Game game, Ability source) {<NEW_LINE>MageObject sourceObject = source.getSourceObject(game);<NEW_LINE>if (sourceObject != null) {<NEW_LINE>DiscardTargetCost cost = new DiscardTargetCost(new TargetCardInHand(3, 3, new FilterCard()));<NEW_LINE>for (UUID playerId : game.getState().getPlayerList(source.getControllerId())) {<NEW_LINE>Player <MASK><NEW_LINE>cost.clearPaid();<NEW_LINE>if (player != null && cost.canPay(source, source, player.getId(), game) && player.chooseUse(outcome, "Discard three cards to counter " + sourceObject.getIdName() + '?', source, game)) {<NEW_LINE>if (cost.pay(source, game, source, playerId, false, null)) {<NEW_LINE>game.informPlayers(player.getLogName() + " discards 3 cards to counter " + sourceObject.getIdName() + '.');<NEW_LINE>Spell spell = game.getStack().getSpell(source.getSourceId());<NEW_LINE>if (spell != null) {<NEW_LINE>game.getStack().counter(spell.getId(), source, game);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | player = game.getPlayer(playerId); |
740,831 | private static WebApplicationModel generate90() {<NEW_LINE>org.netbeans.modules.j2ee.weblogic9.dd.web90.WeblogicWebApp webLogicWebApp = new org.netbeans.modules.j2ee.weblogic9.dd.web90.WeblogicWebApp();<NEW_LINE>// NOI18N<NEW_LINE>webLogicWebApp.createAttribute("xmlns:j2ee", "xmlns:j2ee", AttrProp.CDATA | <MASK><NEW_LINE>// NOI18N<NEW_LINE>webLogicWebApp.setAttributeValue("xmlns:j2ee", "http://java.sun.com/xml/ns/j2ee");<NEW_LINE>// NOI18N<NEW_LINE>webLogicWebApp.setAttributeValue("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");<NEW_LINE>// NOI18N<NEW_LINE>webLogicWebApp.setAttributeValue("xsi:schemaLocation", "http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd");<NEW_LINE>return new WebApplicationModel(webLogicWebApp);<NEW_LINE>} | AttrProp.IMPLIED, null, null); |
977,364 | private boolean sameScalar(ScalarValue want, JsonArray parent, int index) throws Exception {<NEW_LINE>trace("comparing array scalar element " + index);<NEW_LINE>String regexp = want.getRegexp();<NEW_LINE>if (want instanceof StringValue) {<NEW_LINE>return sameString(((StringValue) want).getValue(), regexp, parent.getString(index));<NEW_LINE>}<NEW_LINE>if (want instanceof LongValue) {<NEW_LINE>return sameString(longToString(((LongValue) want).getValue()), regexp, longToString(parent.getJsonNumber(index).longValue()));<NEW_LINE>}<NEW_LINE>if (want instanceof IntValue) {<NEW_LINE>return sameString(intToString(((IntValue) want).getValue()), regexp, intToString(parent.getInt(index)));<NEW_LINE>}<NEW_LINE>if (want instanceof DoubleValue) {<NEW_LINE>return sameString(doubleToString(((DoubleValue) want).getValue()), regexp, doubleToString(parent.getJsonNumber(<MASK><NEW_LINE>}<NEW_LINE>if (want instanceof BooleanValue) {<NEW_LINE>return sameString(booleanToString(((BooleanValue) want).getValue()), regexp, booleanToString(parent.getBoolean(index)));<NEW_LINE>}<NEW_LINE>throw new AssertionError(want + " is not a valid scalar type. Valid types are string, long, int, double, boolean");<NEW_LINE>} | index).doubleValue())); |
1,790,786 | protected static Bitmap createScaledBitmap(Bitmap src, int dstWidth, int dstHeight, boolean filter) {<NEW_LINE>if (dstWidth == src.getWidth() && dstHeight == src.getHeight() && !filter) {<NEW_LINE>// Return the original.<NEW_LINE>return src;<NEW_LINE>}<NEW_LINE>if (dstWidth <= 0 || dstHeight <= 0) {<NEW_LINE>throw new IllegalArgumentException("width and height must be > 0");<NEW_LINE>}<NEW_LINE>Bitmap scaledBitmap = ReflectionHelpers.callConstructor(Bitmap.class);<NEW_LINE>ShadowBitmap shadowBitmap = Shadow.extract(scaledBitmap);<NEW_LINE>ShadowBitmap <MASK><NEW_LINE>shadowBitmap.appendDescription(shadowSrcBitmap.getDescription());<NEW_LINE>shadowBitmap.appendDescription(" scaled to " + dstWidth + " x " + dstHeight);<NEW_LINE>if (filter) {<NEW_LINE>shadowBitmap.appendDescription(" with filter " + filter);<NEW_LINE>}<NEW_LINE>shadowBitmap.createdFromBitmap = src;<NEW_LINE>shadowBitmap.scaledFromBitmap = src;<NEW_LINE>shadowBitmap.createdFromFilter = filter;<NEW_LINE>shadowBitmap.width = dstWidth;<NEW_LINE>shadowBitmap.height = dstHeight;<NEW_LINE>shadowBitmap.config = src.getConfig();<NEW_LINE>shadowBitmap.mutable = true;<NEW_LINE>if (shadowBitmap.config == null) {<NEW_LINE>shadowBitmap.config = Config.ARGB_8888;<NEW_LINE>}<NEW_LINE>if (!ImageUtil.scaledBitmap(src, scaledBitmap, filter)) {<NEW_LINE>shadowBitmap.bufferedImage = new BufferedImage(dstWidth, dstHeight, BufferedImage.TYPE_INT_ARGB);<NEW_LINE>shadowBitmap.setPixelsInternal(new int[shadowBitmap.getHeight() * shadowBitmap.getWidth()], 0, 0, 0, 0, shadowBitmap.getWidth(), shadowBitmap.getHeight());<NEW_LINE>}<NEW_LINE>if (RuntimeEnvironment.getApiLevel() >= O) {<NEW_LINE>shadowBitmap.colorSpace = shadowSrcBitmap.colorSpace;<NEW_LINE>}<NEW_LINE>return scaledBitmap;<NEW_LINE>} | shadowSrcBitmap = Shadow.extract(src); |
1,224,606 | public void open() {<NEW_LINE>box = new VuzeMessageBox("", "", null, 0);<NEW_LINE>box.setSubTitle(MessageText.getString("dlg.player.install.subtitle"));<NEW_LINE>box.addResourceBundle(PlayerInstallWindow.class, SkinPropertiesImpl.PATH_SKIN_DEFS, "skin3_dlg_register");<NEW_LINE>box.setIconResource("image.player.dlg.header");<NEW_LINE>this.progressText = MessageText.getString("dlg.player.install.description");<NEW_LINE>box.setListener(new VuzeMessageBoxListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void shellReady(Shell shell, SWTSkinObjectContainer soExtra) {<NEW_LINE>SWTSkin skin = soExtra.getSkin();<NEW_LINE>skin.createSkinObject("dlg.register.install", "dlg.register.install", soExtra);<NEW_LINE>SWTSkinObjectContainer soProgressBar = (SWTSkinObjectContainer) skin.getSkinObject("progress-bar");<NEW_LINE>if (soProgressBar != null) {<NEW_LINE>progressBar = new ProgressBar(soProgressBar.getComposite(), SWT.HORIZONTAL);<NEW_LINE>progressBar.setMinimum(0);<NEW_LINE>progressBar.setMaximum(100);<NEW_LINE>progressBar.setLayoutData(Utils.getFilledFormData());<NEW_LINE>}<NEW_LINE>soInstallPct = (<MASK><NEW_LINE>soProgressText = (SWTSkinObjectText) skin.getSkinObject("progress-text");<NEW_LINE>if (soProgressText != null && progressText != null) {<NEW_LINE>soProgressText.setText(progressText);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>box.open(new UserPrompterResultListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void prompterClosed(int result) {<NEW_LINE>installer.setListener(null);<NEW_LINE>installer.cancel();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | SWTSkinObjectText) skin.getSkinObject("install-pct"); |
1,163,734 | public static HikariDataSource createPooledDataSource(MySqlSourceConfig sourceConfig) {<NEW_LINE>final HikariConfig config = new HikariConfig();<NEW_LINE>String hostName = sourceConfig.getHostname();<NEW_LINE>int port = sourceConfig.getPort();<NEW_LINE>Properties jdbcProperties = sourceConfig.getJdbcProperties();<NEW_LINE>config.setPoolName(CONNECTION_POOL_PREFIX + hostName + ":" + port);<NEW_LINE>config.setJdbcUrl(formatJdbcUrl(hostName, port, jdbcProperties));<NEW_LINE>config.setUsername(sourceConfig.getUsername());<NEW_LINE>config.<MASK><NEW_LINE>config.setMinimumIdle(MINIMUM_POOL_SIZE);<NEW_LINE>config.setMaximumPoolSize(sourceConfig.getConnectionPoolSize());<NEW_LINE>config.setConnectionTimeout(sourceConfig.getConnectTimeout().toMillis());<NEW_LINE>config.addDataSourceProperty(SERVER_TIMEZONE_KEY, sourceConfig.getServerTimeZone());<NEW_LINE>config.setDriverClassName(sourceConfig.getDbzConfiguration().getString(MySqlConnectorConfig.JDBC_DRIVER));<NEW_LINE>// optional optimization configurations for pooled DataSource<NEW_LINE>config.addDataSourceProperty("cachePrepStmts", "true");<NEW_LINE>config.addDataSourceProperty("prepStmtCacheSize", "250");<NEW_LINE>config.addDataSourceProperty("prepStmtCacheSqlLimit", "2048");<NEW_LINE>return new HikariDataSource(config);<NEW_LINE>} | setPassword(sourceConfig.getPassword()); |
1,188,409 | public ServiceResponse serviceImpl(Query call, HttpServletResponse response, Authorization rights, final JsonObjectWithDefault permissions) throws APIException {<NEW_LINE>JSONObject commit;<NEW_LINE>JSONObject json = new JSONObject(true);<NEW_LINE>json.put("accepted", false);<NEW_LINE>JSONArray commitsArray;<NEW_LINE>commitsArray = new JSONArray();<NEW_LINE>// Add to git<NEW_LINE>try {<NEW_LINE>Iterable<RevCommit> logs = SkillTransactions.getGitLog(false, null);<NEW_LINE>int i = 0;<NEW_LINE>for (RevCommit rev : logs) {<NEW_LINE>commit = new JSONObject();<NEW_LINE>commit.put("commitRev", rev);<NEW_LINE>commit.put("commitName", rev.getName());<NEW_LINE>commit.put("commitID", rev.getId().getName());<NEW_LINE>commit.put("commit_message", rev.getShortMessage());<NEW_LINE>commitsArray.put(i, commit);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>json.put("commitsArray", commitsArray);<NEW_LINE>} catch (IOException | GitAPIException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>return new ServiceResponse(json);<NEW_LINE>} | json.put("accepted", true); |
507,574 | public void init() {<NEW_LINE>try {<NEW_LINE>SipAccountIDImpl accountID = (SipAccountIDImpl) sipProvider.getAccountID();<NEW_LINE>if (!accountID.isXiVOEnable())<NEW_LINE>return;<NEW_LINE>boolean useSipCredentials = accountID.isClistOptionUseSipCredentials();<NEW_LINE>String serverAddress = accountID.getClistOptionServerUri();<NEW_LINE>String username = <MASK><NEW_LINE>Address userAddress = sipProvider.parseAddressString(username);<NEW_LINE>if (useSipCredentials) {<NEW_LINE>username = ((SipUri) userAddress.getURI()).getUser();<NEW_LINE>} else {<NEW_LINE>username = accountID.getClistOptionUser();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>connect(serverAddress);<NEW_LINE>} catch (Throwable ex) {<NEW_LINE>showError(ex, null, null);<NEW_LINE>logger.error("Error connecting to server", ex);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Thread thread = new Thread(this, this.getClass().getName());<NEW_LINE>thread.setDaemon(true);<NEW_LINE>thread.start();<NEW_LINE>if (!login(username)) {<NEW_LINE>showError(null, null, "Unauthorized. Cannot login.");<NEW_LINE>logger.error("Cannot login.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.error("Error init clist from xivo server");<NEW_LINE>}<NEW_LINE>} | accountID.getAccountPropertyString(ProtocolProviderFactory.USER_ID); |
786,314 | private void saveState() {<NEW_LINE>if (chunks.size() < 1)<NEW_LINE>return;<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>sb.append(this.length + "\n");<NEW_LINE>sb.append(downloaded + "\n");<NEW_LINE>sb.append(((long) this.totalDuration) + "\n");<NEW_LINE>sb.append(items.size() + "\n");<NEW_LINE>System.out.println("url saved of size: " + items.size());<NEW_LINE>for (int i = 0; i < items.size(); i++) {<NEW_LINE>String url = items.get(i).getUrl();<NEW_LINE>System.out.println("Saveing url: " + url);<NEW_LINE>sb.append(url + "\n");<NEW_LINE>}<NEW_LINE>sb.append(chunks.size() + "\n");<NEW_LINE>for (int i = 0; i < chunks.size(); i++) {<NEW_LINE>Segment seg = chunks.get(i);<NEW_LINE>sb.append(seg.getId() + "\n");<NEW_LINE>if (seg.isFinished()) {<NEW_LINE>sb.append(seg.getLength() + "\n");<NEW_LINE>sb.append(seg.getStartOffset() + "\n");<NEW_LINE>sb.append(seg.getDownloaded() + "\n");<NEW_LINE>} else {<NEW_LINE>sb.append("-1\n");<NEW_LINE>sb.append(<MASK><NEW_LINE>sb.append(seg.getDownloaded() + "\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!StringUtils.isNullOrEmptyOrBlank(lastModified)) {<NEW_LINE>sb.append(this.lastModified + "\n");<NEW_LINE>}<NEW_LINE>// if this is true that means it can have info about encrypted segments<NEW_LINE>sb.append(keyMap != null);<NEW_LINE>if (keyMap != null) {<NEW_LINE>for (HlsPlaylistItem item : items) {<NEW_LINE>boolean hasKey = !StringUtils.isNullOrEmptyOrBlank(item.getKeyUrl());<NEW_LINE>sb.append(hasKey);<NEW_LINE>if (hasKey) {<NEW_LINE>sb.append(item.getKeyUrl() + "\n");<NEW_LINE>}<NEW_LINE>boolean hasIV = !StringUtils.isNullOrEmptyOrBlank(item.getIV());<NEW_LINE>sb.append(hasIV);<NEW_LINE>if (hasIV) {<NEW_LINE>sb.append(item.getIV() + "\n");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(keyMap.size() + "\n");<NEW_LINE>for (Map.Entry<String, byte[]> ent : keyMap.entrySet()) {<NEW_LINE>sb.append(ent.getKey() + "\n");<NEW_LINE>sb.append(Base64.getEncoder().encodeToString(ent.getValue()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>File tmp = new File(folder, System.currentTimeMillis() + ".tmp");<NEW_LINE>File out = new File(folder, "state.txt");<NEW_LINE>FileOutputStream fs = new FileOutputStream(tmp);<NEW_LINE>fs.write(sb.toString().getBytes());<NEW_LINE>fs.close();<NEW_LINE>out.delete();<NEW_LINE>tmp.renameTo(out);<NEW_LINE>} catch (Exception e) {<NEW_LINE>Logger.log(e);<NEW_LINE>}<NEW_LINE>} | seg.getStartOffset() + "\n"); |
955,447 | public Project createProject(AntProjectHelper helper) throws IOException {<NEW_LINE>ClassLoader l = Lookup.getDefault().lookup(ClassLoader.class);<NEW_LINE>if (l == null) {<NEW_LINE>l = Thread.currentThread().getContextClassLoader();<NEW_LINE>}<NEW_LINE>if (l == null) {<NEW_LINE>l = AntBasedGenericType.class.getClassLoader();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Class<?> clazz = l.loadClass(className);<NEW_LINE>if (methodName != null) {<NEW_LINE>Method m = clazz.getDeclaredMethod(methodName, AntProjectHelper.class);<NEW_LINE>return (Project) <MASK><NEW_LINE>} else {<NEW_LINE>Constructor c = clazz.getConstructor(AntProjectHelper.class);<NEW_LINE>return (Project) c.newInstance(helper);<NEW_LINE>}<NEW_LINE>} catch (InvocationTargetException ex) {<NEW_LINE>if (ex.getTargetException() instanceof IOException) {<NEW_LINE>throw (IOException) ex.getTargetException();<NEW_LINE>}<NEW_LINE>if (ex.getTargetException() instanceof RuntimeException) {<NEW_LINE>throw (RuntimeException) ex.getTargetException();<NEW_LINE>}<NEW_LINE>throw new IllegalArgumentException(ex);<NEW_LINE>} catch (RuntimeException ex) {<NEW_LINE>throw ex;<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new IllegalArgumentException(ex);<NEW_LINE>}<NEW_LINE>} | m.invoke(null, helper); |
590,108 | private List<String> generateDropStatementsForRoutines() throws SQLException {<NEW_LINE>// #2193: PostgreSQL 11 removed the 'proisagg' column and replaced it with 'prokind'.<NEW_LINE>String isAggregate = database.getVersion().isAtLeast("11") ? "pg_proc.prokind = 'a'" : "pg_proc.proisagg";<NEW_LINE>// PROCEDURE is only available from PostgreSQL 11<NEW_LINE>String isProcedure = database.getVersion().isAtLeast("11") ? "pg_proc.prokind = 'p'" : "FALSE";<NEW_LINE>List<Map<String, String>> rows = // Search for all functions<NEW_LINE>jdbcTemplate.// Search for all functions<NEW_LINE>queryForList(// that don't depend on an extension<NEW_LINE>"SELECT proname, oidvectortypes(proargtypes) AS args, " + isAggregate + " as agg, " + isProcedure + " as proc " + "FROM pg_proc INNER JOIN pg_namespace ns ON (pg_proc.pronamespace = ns.oid) " + "LEFT JOIN pg_depend dep ON dep.objid = pg_proc.oid AND dep.deptype = 'e' " + "WHERE ns.nspname = ? AND dep.objid IS NULL", name);<NEW_LINE>List<String> statements = new ArrayList<>();<NEW_LINE>for (Map<String, String> row : rows) {<NEW_LINE>String type = "FUNCTION";<NEW_LINE>if (isTrue(row.get("agg"))) {<NEW_LINE>type = "AGGREGATE";<NEW_LINE>} else if (isTrue(row.get("proc"))) {<NEW_LINE>type = "PROCEDURE";<NEW_LINE>}<NEW_LINE>statements.add("DROP " + type + " IF EXISTS " + database.quote(name, row.get("proname")) + "(" + row<MASK><NEW_LINE>}<NEW_LINE>return statements;<NEW_LINE>} | .get("args") + ") CASCADE"); |
911,567 | public void reset() {<NEW_LINE>emissionEstimator = new <MASK><NEW_LINE>transitionEstimator = new Multinomial.LaplaceEstimator[numStates()];<NEW_LINE>emissionMultinomial = new Multinomial[numStates()];<NEW_LINE>transitionMultinomial = new Multinomial[numStates()];<NEW_LINE>Alphabet transitionAlphabet = getTransitionAlphabet();<NEW_LINE>for (int i = 0; i < numStates(); i++) {<NEW_LINE>emissionEstimator[i] = new Multinomial.LaplaceEstimator(inputAlphabet);<NEW_LINE>transitionEstimator[i] = new Multinomial.LaplaceEstimator(transitionAlphabet);<NEW_LINE>emissionMultinomial[i] = new Multinomial(getUniformArray(inputAlphabet.size()), inputAlphabet);<NEW_LINE>transitionMultinomial[i] = new Multinomial(getUniformArray(transitionAlphabet.size()), transitionAlphabet);<NEW_LINE>}<NEW_LINE>initialMultinomial = new Multinomial(getUniformArray(transitionAlphabet.size()), transitionAlphabet);<NEW_LINE>initialEstimator = new Multinomial.LaplaceEstimator(transitionAlphabet);<NEW_LINE>} | Multinomial.LaplaceEstimator[numStates()]; |
562,307 | private Forwarding parseForwarding(String conf) throws JSchException {<NEW_LINE>String[] tmp = conf.split(" ");<NEW_LINE>if (tmp.length > 1) {<NEW_LINE>// "[bind_address:]port host:hostport"<NEW_LINE>Vector foo = new Vector();<NEW_LINE>for (int i = 0; i < tmp.length; i++) {<NEW_LINE>if (tmp[i].length() == 0)<NEW_LINE>continue;<NEW_LINE>foo.addElement(tmp[i].trim());<NEW_LINE>}<NEW_LINE>// join<NEW_LINE>StringBuffer sb = new StringBuffer();<NEW_LINE>for (int i = 0; i < foo.size(); i++) {<NEW_LINE>sb.append((String) (foo.elementAt(i)));<NEW_LINE>if (i + 1 < foo.size())<NEW_LINE>sb.append(":");<NEW_LINE>}<NEW_LINE>conf = sb.toString();<NEW_LINE>}<NEW_LINE>String org = conf;<NEW_LINE>Forwarding f = new Forwarding();<NEW_LINE>try {<NEW_LINE>if (conf.lastIndexOf(":") == -1)<NEW_LINE>throw new JSchException("parseForwarding: " + org);<NEW_LINE>f.hostport = Integer.parseInt(conf.substring(conf.lastIndexOf(":") + 1));<NEW_LINE>conf = conf.substring(0, conf.lastIndexOf(":"));<NEW_LINE>if (conf.lastIndexOf(":") == -1)<NEW_LINE>throw new JSchException("parseForwarding: " + org);<NEW_LINE>f.host = conf.substring(conf<MASK><NEW_LINE>conf = conf.substring(0, conf.lastIndexOf(":"));<NEW_LINE>if (conf.lastIndexOf(":") != -1) {<NEW_LINE>f.port = Integer.parseInt(conf.substring(conf.lastIndexOf(":") + 1));<NEW_LINE>conf = conf.substring(0, conf.lastIndexOf(":"));<NEW_LINE>if (conf.length() == 0 || conf.equals("*"))<NEW_LINE>conf = "0.0.0.0";<NEW_LINE>if (conf.equals("localhost"))<NEW_LINE>conf = "127.0.0.1";<NEW_LINE>f.bind_address = conf;<NEW_LINE>} else {<NEW_LINE>f.port = Integer.parseInt(conf);<NEW_LINE>f.bind_address = "127.0.0.1";<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>throw new JSchException("parseForwarding: " + e.toString());<NEW_LINE>}<NEW_LINE>return f;<NEW_LINE>} | .lastIndexOf(":") + 1); |
1,072,818 | private void processCvsProject(Project p) {<NEW_LINE>JButton installButton = new JButton();<NEW_LINE>// NOI18N<NEW_LINE>Mnemonics.setLocalizedText(installButton, NbBundle.getMessage(CvsInstallDialog.class, "CvsInstallDialog.downloadButton.text"));<NEW_LINE>CvsInstallDialog panel = new CvsInstallDialog();<NEW_LINE>DialogDescriptor dd = new // NOI18N<NEW_LINE>// NOI18N<NEW_LINE>DialogDescriptor(// NOI18N<NEW_LINE>panel, NbBundle.getMessage(CvsInstallDialog.class, "CvsInstallDialog.title"), true, new Object[] { installButton, DialogDescriptor.CANCEL_OPTION }, installButton, DialogDescriptor.DEFAULT_ALIGN, null, null);<NEW_LINE>Dialog dialog = DialogDisplayer.getDefault().createDialog(dd);<NEW_LINE>dialog.setVisible(true);<NEW_LINE>// no more dialog in the future<NEW_LINE>downloadWindowDisplayed = true;<NEW_LINE>if (listener != null) {<NEW_LINE>OpenProjects.getDefault().removePropertyChangeListener(listener);<NEW_LINE>listener = null;<NEW_LINE>}<NEW_LINE>// handle result<NEW_LINE>if (panel.cbDoNotAsk.isSelected()) {<NEW_LINE>CvsInstallerModuleConfig.getInstance().setIgnored(true);<NEW_LINE>}<NEW_LINE>if (dd.getValue() == installButton) {<NEW_LINE>// install CVS support<NEW_LINE>if (installCvsSupport()) {<NEW_LINE>// and uninstall me<NEW_LINE>doFinish();<NEW_LINE>} else {<NEW_LINE>// huh? probably a connection issue? user canceled the download or did not accept the license?<NEW_LINE>CvsInstallerModuleConfig.getInstance().setIgnored(false);<NEW_LINE>DialogDisplayer.getDefault().notifyLater(new // NOI18N<NEW_LINE>// NOI18N<NEW_LINE>NotifyDescriptor.Message(NbBundle.getMessage(CvsInstaller.class, <MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "CvsInstaller.installFailed"), NotifyDescriptor.ERROR_MESSAGE)); |
1,806,806 | public void renderItemOverlay(Graphics2D graphics, int itemId, WidgetItem widgetItem) {<NEW_LINE>final String group = plugin.getTag(itemId);<NEW_LINE>if (group != null) {<NEW_LINE>final Color color = plugin.getGroupNameColor(group);<NEW_LINE>if (color != null) {<NEW_LINE><MASK><NEW_LINE>if (config.showTagOutline()) {<NEW_LINE>final BufferedImage outline = itemManager.getItemOutline(itemId, widgetItem.getQuantity(), color);<NEW_LINE>graphics.drawImage(outline, (int) bounds.getX(), (int) bounds.getY(), null);<NEW_LINE>}<NEW_LINE>if (config.showTagFill()) {<NEW_LINE>final Image image = getFillImage(color, widgetItem.getId(), widgetItem.getQuantity());<NEW_LINE>graphics.drawImage(image, (int) bounds.getX(), (int) bounds.getY(), null);<NEW_LINE>}<NEW_LINE>if (config.showTagUnderline()) {<NEW_LINE>int heightOffSet = (int) bounds.getY() + (int) bounds.getHeight() + 2;<NEW_LINE>graphics.setColor(color);<NEW_LINE>graphics.drawLine((int) bounds.getX(), heightOffSet, (int) bounds.getX() + (int) bounds.getWidth(), heightOffSet);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | Rectangle bounds = widgetItem.getCanvasBounds(); |
2,382 | public int testClockwise() {<NEW_LINE>if (points.size() < 3) {<NEW_LINE>return 0;<NEW_LINE>}<NEW_LINE>final int size = points.size();<NEW_LINE>// Count the number of positive and negative oriented angles<NEW_LINE>int c = 0;<NEW_LINE>// TODO: faster when using an iterator?<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>// Three consecutive points<NEW_LINE>final int j = (i + 1) % size;<NEW_LINE>final int k = (i + 2) % size;<NEW_LINE>final double dxji = points.get(j)[0] - points<MASK><NEW_LINE>final double dykj = points.get(k)[1] - points.get(j)[1];<NEW_LINE>final double dyji = points.get(j)[1] - points.get(i)[1];<NEW_LINE>final double dxkj = points.get(k)[0] - points.get(j)[0];<NEW_LINE>final double z = (dxji * dykj) - (dyji * dxkj);<NEW_LINE>if (z < 0) {<NEW_LINE>c--;<NEW_LINE>} else if (z > 0) {<NEW_LINE>c++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (c > 0) ? -1 : (c < 0) ? +1 : 0;<NEW_LINE>} | .get(i)[0]; |
1,734,013 | public boolean attachCluster(DataStore datastore, ClusterScope scope) {<NEW_LINE>PrimaryDataStoreInfo primaryDataStoreInfo = (PrimaryDataStoreInfo) datastore;<NEW_LINE>// check if there is at least one host up in this cluster<NEW_LINE>List<HostVO> allHosts = _resourceMgr.listAllUpAndEnabledHosts(Host.Type.Routing, primaryDataStoreInfo.getClusterId(), primaryDataStoreInfo.getPodId(), primaryDataStoreInfo.getDataCenterId());<NEW_LINE>if (allHosts.isEmpty()) {<NEW_LINE>storagePoolDao.expunge(primaryDataStoreInfo.getId());<NEW_LINE>throw new CloudRuntimeException(<MASK><NEW_LINE>}<NEW_LINE>List<HostVO> poolHosts = new ArrayList<HostVO>();<NEW_LINE>for (HostVO host : allHosts) {<NEW_LINE>try {<NEW_LINE>_storageMgr.connectHostToSharedPool(host.getId(), primaryDataStoreInfo.getId());<NEW_LINE>poolHosts.add(host);<NEW_LINE>} catch (Exception e) {<NEW_LINE>s_logger.warn("Unable to establish a connection between " + host + " and " + primaryDataStoreInfo, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (poolHosts.isEmpty()) {<NEW_LINE>s_logger.warn("No host can access storage pool '" + primaryDataStoreInfo + "' on cluster '" + primaryDataStoreInfo.getClusterId() + "'.");<NEW_LINE>storagePoolDao.expunge(primaryDataStoreInfo.getId());<NEW_LINE>throw new CloudRuntimeException("Failed to access storage pool");<NEW_LINE>}<NEW_LINE>dataStoreHelper.attachCluster(datastore);<NEW_LINE>return true;<NEW_LINE>// throw new UnsupportedOperationException("Only Zone-wide scope is supported<NEW_LINE>// with the Datera Storage driver");<NEW_LINE>} | "No host up to associate a storage pool with in cluster " + primaryDataStoreInfo.getClusterId()); |
1,299,913 | public static QueryEdgeInstanceDeviceByDriverResponse unmarshall(QueryEdgeInstanceDeviceByDriverResponse queryEdgeInstanceDeviceByDriverResponse, UnmarshallerContext _ctx) {<NEW_LINE>queryEdgeInstanceDeviceByDriverResponse.setRequestId(_ctx.stringValue("QueryEdgeInstanceDeviceByDriverResponse.RequestId"));<NEW_LINE>queryEdgeInstanceDeviceByDriverResponse.setSuccess(_ctx.booleanValue("QueryEdgeInstanceDeviceByDriverResponse.Success"));<NEW_LINE>queryEdgeInstanceDeviceByDriverResponse.setCode(_ctx.stringValue("QueryEdgeInstanceDeviceByDriverResponse.Code"));<NEW_LINE>queryEdgeInstanceDeviceByDriverResponse.setErrorMessage<MASK><NEW_LINE>Data data = new Data();<NEW_LINE>data.setTotal(_ctx.integerValue("QueryEdgeInstanceDeviceByDriverResponse.Data.Total"));<NEW_LINE>data.setPageSize(_ctx.integerValue("QueryEdgeInstanceDeviceByDriverResponse.Data.PageSize"));<NEW_LINE>data.setCurrentPage(_ctx.integerValue("QueryEdgeInstanceDeviceByDriverResponse.Data.CurrentPage"));<NEW_LINE>List<Device> deviceList = new ArrayList<Device>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("QueryEdgeInstanceDeviceByDriverResponse.Data.DeviceList.Length"); i++) {<NEW_LINE>Device device = new Device();<NEW_LINE>device.setIotId(_ctx.stringValue("QueryEdgeInstanceDeviceByDriverResponse.Data.DeviceList[" + i + "].IotId"));<NEW_LINE>deviceList.add(device);<NEW_LINE>}<NEW_LINE>data.setDeviceList(deviceList);<NEW_LINE>queryEdgeInstanceDeviceByDriverResponse.setData(data);<NEW_LINE>return queryEdgeInstanceDeviceByDriverResponse;<NEW_LINE>} | (_ctx.stringValue("QueryEdgeInstanceDeviceByDriverResponse.ErrorMessage")); |
702,957 | // helper routine to print out usage<NEW_LINE>public void usage() {<NEW_LINE>System.out.println("Usage: " + myName() + " [option]*");<NEW_LINE>System.out.println(" where [option] can be:");<NEW_LINE>System.out.println(" -help | -? Action: show this help");<NEW_LINE>System.out.println(" -Xrealtime use in real time environment");<NEW_LINE>System.out.println(" -cacheName <name> specify name of shared cache (Use %%u to substitute username)");<NEW_LINE>System.out.println(" -cacheDir <dir> set the location of the JVM cache files");<NEW_LINE>System.out.println(" -listAllCaches Action: list all existing shared class caches");<NEW_LINE>System.out.println(" -printStats Action: print cache statistics");<NEW_LINE>System.out.println(" -printAllStats Action: print more verbose cache statistics");<NEW_LINE>System.out.println(" -destroy Action: destroy the named (or default) cache");<NEW_LINE>System.out.println(" -destroyAll Action: destroy all caches");<NEW_LINE>if (realTimeEnvironment()) {<NEW_LINE>System.out.println(" -populate Action: Create a new cache and populate it");<NEW_LINE>System.out.println(" -searchPath <path> specify the directory in which to find files if no files specified (default is .)");<NEW_LINE>System.out.println(" only one -searchPath option can be specified");<NEW_LINE>System.out.println(" -classpath <class path> specify the classpath that will be used at runtime to access this cache");<NEW_LINE>System.out.println(" the -classpath option is required");<NEW_LINE>System.out.println(" -[no]recurse [do not] recurse into subdirectories to find files to convert (default do not recurse)");<NEW_LINE>System.out.println(" -[no]grow if specified cache exists already, [do not] add to it (default no grow)");<NEW_LINE>System.out.println(" if -grow is not selected, specified cache will be removed if present");<NEW_LINE>System.out.println(" -verbose print out progress messages for each jar");<NEW_LINE>System.out.println(" -noisy print out progress messages for each class in each jar");<NEW_LINE>System.out.println(" -quiet suppress all output");<NEW_LINE>System.out.println(" -[no]aot also perform AOT compilation on methods after storing classes into cache (default is aot)");<NEW_LINE>// System.out.println(" -classFilter <pattern> only classes listed in file will be stored into cache");<NEW_LINE>System.out.println(" -aotFilter <signature> only matching methods will be AOT compiled and stored into cache");<NEW_LINE>System.out.println(" e.g. -aotFilter {mypackage/myclass.mymethod(I)I} compiles only mymethod(I)I");<NEW_LINE>System.out.println(" e.g. -aotFilter {mypackage/myclass.mymethod*} compiles any mymethod");<NEW_LINE>System.out.println(" e.g. -aotFilter {mypackage/myclass.*} compiles all methods from myclass");<NEW_LINE><MASK><NEW_LINE>System.out.println(" (input file must have been created by -Xjit:verbose={precompile},vlog=<file>)");<NEW_LINE>System.out.println(" -printvmargs print VM arguments needed to access populated cache at runtime");<NEW_LINE>System.out.println(" [jar file]*.[jar][zip] explicit list of jar files to populate into cache");<NEW_LINE>System.out.println(" if no files are specified, all files.[jar][zip] in the searchPath will be converted.");<NEW_LINE>}<NEW_LINE>System.out.println("Exactly one action option must be specified\n");<NEW_LINE>} | System.out.println(" -aotFilterFile <file> only methods matching those in file will be AOT compiled and stored into cache"); |
346,339 | public BDD bddAclLines(List<BDD> lineBdds, List<LineAction> actions) {<NEW_LINE>checkArgument(lineBdds.size() == actions.size(), "Line BDDs and line actions must be 1:1.");<NEW_LINE>BDD result = _factory.zero();<NEW_LINE>LineAction currentAction = LineAction.PERMIT;<NEW_LINE>List<BDD> lineBddsWithCurrentAction = new LinkedList<>();<NEW_LINE>Iterator<BDD> bddIter = Lists.reverse(lineBdds).iterator();<NEW_LINE>Iterator<LineAction> actionIter = Lists.reverse(actions).iterator();<NEW_LINE>while (bddIter.hasNext()) {<NEW_LINE>LineAction lineAction = actionIter.next();<NEW_LINE>// The line action is going to change. Combine lineBddsWithCurrentAction into result<NEW_LINE>if (lineAction != currentAction) {<NEW_LINE>if (currentAction == LineAction.PERMIT) {<NEW_LINE>// matched by any of the permit lines, or permitted by the rest of the acl.<NEW_LINE>lineBddsWithCurrentAction.add(result);<NEW_LINE>result = or(lineBddsWithCurrentAction);<NEW_LINE>} else {<NEW_LINE>// permitted by the rest of the acl and not matched by any of the deny lines.<NEW_LINE>result = result.diffWith(or(lineBddsWithCurrentAction));<NEW_LINE>}<NEW_LINE>currentAction = lineAction;<NEW_LINE>lineBddsWithCurrentAction.clear();<NEW_LINE>}<NEW_LINE>// Start a new batch of lines with the new action.<NEW_LINE><MASK><NEW_LINE>lineBddsWithCurrentAction.add(lineBdd);<NEW_LINE>}<NEW_LINE>// Reached the start of the ACL. Combine the last batch of lines into the result.<NEW_LINE>if (currentAction == LineAction.PERMIT) {<NEW_LINE>lineBddsWithCurrentAction.add(result);<NEW_LINE>result = or(lineBddsWithCurrentAction);<NEW_LINE>} else {<NEW_LINE>result = result.diffWith(or(lineBddsWithCurrentAction));<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | BDD lineBdd = bddIter.next(); |
1,181,114 | private JComponent buildWadlContentTab() {<NEW_LINE>partTabs = new JTabbedPane();<NEW_LINE>partTabs.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);<NEW_LINE>rootNode = new DefaultMutableTreeNode(restService.getName());<NEW_LINE>treeModel = new DefaultTreeModel(rootNode);<NEW_LINE>tree = new JTree(treeModel);<NEW_LINE>tree.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));<NEW_LINE>tree.setExpandsSelectedPaths(true);<NEW_LINE>tree.addTreeSelectionListener(new InternalTreeSelectionListener());<NEW_LINE>tree.addMouseListener(new MouseAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void mouseClicked(MouseEvent arg0) {<NEW_LINE>if (arg0.getClickCount() > 1) {<NEW_LINE>TreePath selectionPath = tree.getSelectionPath();<NEW_LINE>if (selectionPath != null) {<NEW_LINE>DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) selectionPath.getLastPathComponent();<NEW_LINE>Object userObject = treeNode.getUserObject();<NEW_LINE>if (userObject instanceof InspectItem) {<NEW_LINE>InspectItem item = (InspectItem) userObject;<NEW_LINE>if (item != null && item.selector != null) {<NEW_LINE>item.selector.selectNode(item);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>JScrollPane scrollPane = new JScrollPane(tree);<NEW_LINE>UISupport.addPreviewCorner(scrollPane, true);<NEW_LINE>JSplitPane split = UISupport.createHorizontalSplit(scrollPane, UISupport.createTabPanel(partTabs, true));<NEW_LINE>split.setDividerLocation(250);<NEW_LINE>split.setResizeWeight(0.3);<NEW_LINE>initTreeModel(restService);<NEW_LINE>JPanel panel = <MASK><NEW_LINE>panel.add(split, BorderLayout.CENTER);<NEW_LINE>panel.add(buildWadlTabToolbar(), BorderLayout.PAGE_START);<NEW_LINE>statusBar = new JEditorStatusBar();<NEW_LINE>panel.add(statusBar, BorderLayout.PAGE_END);<NEW_LINE>setPreferredSize(new Dimension(600, 500));<NEW_LINE>return panel;<NEW_LINE>} | new JPanel(new BorderLayout()); |
1,018,089 | public Credentials fetch() {<NEW_LINE>String filename = this.filename;<NEW_LINE>if (filename == null) {<NEW_LINE>filename = getProperty("AWS_SHARED_CREDENTIALS_FILE");<NEW_LINE>}<NEW_LINE>if (filename == null) {<NEW_LINE>filename = Paths.get(System.getProperty("user.home"), ".aws", "credentials").toString();<NEW_LINE>}<NEW_LINE>String profile = this.profile;<NEW_LINE>if (profile == null) {<NEW_LINE>profile = getProperty("AWS_PROFILE");<NEW_LINE>}<NEW_LINE>if (profile == null) {<NEW_LINE>profile = "default";<NEW_LINE>}<NEW_LINE>try (InputStream is = new FileInputStream(filename)) {<NEW_LINE>Map<String, Properties> result = unmarshal(new InputStreamReader(is, StandardCharsets.UTF_8));<NEW_LINE>Properties values = result.get(profile);<NEW_LINE>if (values == null) {<NEW_LINE>throw new ProviderException("Profile " + profile + " does not exist in AWS credential file");<NEW_LINE>}<NEW_LINE>String accessKey = values.getProperty("aws_access_key_id");<NEW_LINE>String secretKey = values.getProperty("aws_secret_access_key");<NEW_LINE>String sessionToken = values.getProperty("aws_session_token");<NEW_LINE>if (accessKey == null) {<NEW_LINE>throw new ProviderException("Access key does not exist in profile " + profile + " in AWS credential file");<NEW_LINE>}<NEW_LINE>if (secretKey == null) {<NEW_LINE>throw new ProviderException("Secret key does not exist in profile " + profile + " in AWS credential file");<NEW_LINE>}<NEW_LINE>return new Credentials(accessKey, secretKey, sessionToken, null);<NEW_LINE>} catch (IOException e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | throw new ProviderException("Unable to read AWS credential file", e); |
56,210 | private static <T extends IPart> ColoredItemDefinition<ColoredPartItem<T>> constructColoredDefinition(String nameSuffix, String idSuffix, Class<T> partClass, Function<ColoredPartItem<T>, T> factory) {<NEW_LINE>PartModels.registerModels<MASK><NEW_LINE>var definition = new ColoredItemDefinition<ColoredPartItem<T>>();<NEW_LINE>for (AEColor color : AEColor.values()) {<NEW_LINE>var id = color.registryPrefix + '_' + idSuffix;<NEW_LINE>var name = color.englishName + " " + nameSuffix;<NEW_LINE>var itemDef = item(name, AppEng.makeId(id), props -> new ColoredPartItem<>(props, partClass, factory, color));<NEW_LINE>definition.add(color, AppEng.makeId(id), itemDef);<NEW_LINE>}<NEW_LINE>COLORED_PARTS.add(definition);<NEW_LINE>return definition;<NEW_LINE>} | (PartModelsHelper.createModels(partClass)); |
1,194,277 | public void marshall(Stage stage, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (stage == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(stage.getDeploymentId(), DEPLOYMENTID_BINDING);<NEW_LINE>protocolMarshaller.marshall(stage.getClientCertificateId(), CLIENTCERTIFICATEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(stage.getStageName(), STAGENAME_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(stage.getCacheClusterEnabled(), CACHECLUSTERENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(stage.getCacheClusterSize(), CACHECLUSTERSIZE_BINDING);<NEW_LINE>protocolMarshaller.marshall(stage.getCacheClusterStatus(), CACHECLUSTERSTATUS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stage.getMethodSettings(), METHODSETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stage.getVariables(), VARIABLES_BINDING);<NEW_LINE>protocolMarshaller.marshall(stage.getDocumentationVersion(), DOCUMENTATIONVERSION_BINDING);<NEW_LINE>protocolMarshaller.marshall(stage.getAccessLogSettings(), ACCESSLOGSETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stage.getCanarySettings(), CANARYSETTINGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stage.getTracingEnabled(), TRACINGENABLED_BINDING);<NEW_LINE>protocolMarshaller.marshall(stage.getWebAclArn(), WEBACLARN_BINDING);<NEW_LINE>protocolMarshaller.marshall(stage.getTags(), TAGS_BINDING);<NEW_LINE>protocolMarshaller.marshall(stage.getCreatedDate(), CREATEDDATE_BINDING);<NEW_LINE>protocolMarshaller.marshall(stage.getLastUpdatedDate(), LASTUPDATEDDATE_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} | stage.getDescription(), DESCRIPTION_BINDING); |
1,023,994 | public static void attach(final Registry registry, final ThreadPoolExecutor threadPool, final String threadPoolName) {<NEW_LINE>Preconditions.checkNotNull(registry, "registry");<NEW_LINE>Preconditions.checkNotNull(threadPool, "threadPool");<NEW_LINE>final String idValue;<NEW_LINE>if (threadPoolName == null || threadPoolName.isEmpty()) {<NEW_LINE>idValue = DEFAULT_ID;<NEW_LINE>} else {<NEW_LINE>idValue = threadPoolName;<NEW_LINE>}<NEW_LINE>final Tag idTag = new BasicTag(ID_TAG_NAME, idValue);<NEW_LINE>PolledMeter.using(registry).withName(TASK_COUNT).withTag(idTag).monitorMonotonicCounter(threadPool, ThreadPoolExecutor::getTaskCount);<NEW_LINE>PolledMeter.using(registry).withName(COMPLETED_TASK_COUNT).withTag(idTag).monitorMonotonicCounter(threadPool, ThreadPoolExecutor::getCompletedTaskCount);<NEW_LINE>PolledMeter.using(registry).withName(CURRENT_THREADS_BUSY).withTag(idTag).monitorValue(threadPool, ThreadPoolExecutor::getActiveCount);<NEW_LINE>PolledMeter.using(registry).withName(MAX_THREADS).withTag(idTag).monitorValue(threadPool, ThreadPoolExecutor::getMaximumPoolSize);<NEW_LINE>PolledMeter.using(registry).withName(POOL_SIZE).withTag(idTag).<MASK><NEW_LINE>PolledMeter.using(registry).withName(CORE_POOL_SIZE).withTag(idTag).monitorValue(threadPool, ThreadPoolExecutor::getCorePoolSize);<NEW_LINE>PolledMeter.using(registry).withName(QUEUE_SIZE).withTag(idTag).monitorValue(threadPool, tp -> tp.getQueue().size());<NEW_LINE>// Handler is not allowed to be null, checked internally to thread pool<NEW_LINE>Counter rejected = registry.counter(registry.createId(REJECTED_TASK_COUNT).withTag(idTag));<NEW_LINE>RejectedExecutionHandler handler = threadPool.getRejectedExecutionHandler();<NEW_LINE>RejectedExecutionHandler monitoredHandler = (Runnable r, ThreadPoolExecutor exec) -> {<NEW_LINE>rejected.increment();<NEW_LINE>handler.rejectedExecution(r, exec);<NEW_LINE>};<NEW_LINE>threadPool.setRejectedExecutionHandler(monitoredHandler);<NEW_LINE>} | monitorValue(threadPool, ThreadPoolExecutor::getPoolSize); |
678,686 | protected void internalWrite(Server server, Query query, ImmutableList<Result> results) throws Exception {<NEW_LINE>for (Result result : results) {<NEW_LINE>log.debug("Query result: [{}]", result);<NEW_LINE>if (isNumeric(result.getValue())) {<NEW_LINE>Map<String, Object> map = new HashMap<>();<NEW_LINE>map.put("serverAlias", server.getAlias());<NEW_LINE>map.put("server", server.getHost());<NEW_LINE>map.put("port", server.getPort());<NEW_LINE>map.put("objDomain", result.getObjDomain());<NEW_LINE>map.put("className", result.getClassName());<NEW_LINE>map.put("typeName", result.getTypeName());<NEW_LINE>map.put("attributeName", result.getAttributeName());<NEW_LINE>map.put("valuePath", Joiner.on('/').join(result.getValuePath()));<NEW_LINE>map.put("keyAlias", result.getKeyAlias());<NEW_LINE>map.put("value", Double.parseDouble(result.getValue().toString()));<NEW_LINE>map.put(<MASK><NEW_LINE>log.debug("Insert into Elastic: Index: [{}] Type: [{}] Map: [{}]", indexName, ELASTIC_TYPE_NAME, map);<NEW_LINE>Index index = new Index.Builder(map).index(indexName).type(ELASTIC_TYPE_NAME).build();<NEW_LINE>JestResult addToIndex = jestClient.execute(index);<NEW_LINE>if (!addToIndex.isSucceeded()) {<NEW_LINE>throw new ElasticWriterException(String.format("Unable to write entry to elastic: %s", addToIndex.getErrorMessage()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.warn("Unable to submit non-numeric value to Elastic: [{}] from result [{}]", result.getValue(), result);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | "timestamp", result.getEpoch()); |
1,195,840 | public static void restartWithTheme(Activity activity, int theme, boolean force) {<NEW_LINE>if (theme < _START_RESOURCES_ID && theme > 0) {<NEW_LINE>if (ThemeManager._THEME_MODIFIER > 0) {<NEW_LINE>theme |= ThemeManager._THEME_MODIFIER;<NEW_LINE>}<NEW_LINE>theme &= ThemeManager._THEME_MASK;<NEW_LINE>}<NEW_LINE>if (force || ThemeManager.getTheme(activity) != theme) {<NEW_LINE>Intent intent = new Intent(activity.getIntent());<NEW_LINE>intent.setClass(activity, activity.getClass());<NEW_LINE>intent.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);<NEW_LINE>intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);<NEW_LINE>if (theme > 0) {<NEW_LINE>intent.putExtra(ThemeManager._THEME_TAG, theme);<NEW_LINE>}<NEW_LINE>intent.putExtra(<MASK><NEW_LINE>intent.putExtra(KEY_CREATED_BY_THEME_MANAGER, true);<NEW_LINE>if (activity.isRestricted()) {<NEW_LINE>Application app = Application.getLastInstance();<NEW_LINE>if (app != null && !app.isRestricted()) {<NEW_LINE>intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);<NEW_LINE>app.superStartActivity(intent, -1, null);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (!activity.isFinishing()) {<NEW_LINE>activity.finish();<NEW_LINE>activity.overridePendingTransition(0, 0);<NEW_LINE>}<NEW_LINE>if (activity != null) {<NEW_LINE>activity.superStartActivity(intent, -1, null);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | KEY_INSTANCE_STATE, activity.saveInstanceState()); |
1,576,810 | protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>String url = getIntent().getStringExtra(EXTRA_URL);<NEW_LINE>if (TextUtils.isEmpty(url)) {<NEW_LINE>finish();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>setTitle(url);<NEW_LINE><MASK><NEW_LINE>final NestedScrollView scrollView = (NestedScrollView) findViewById(R.id.nested_scroll_view);<NEW_LINE>Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);<NEW_LINE>toolbar.setOnClickListener(v -> scrollView.smoothScrollTo(0, 0));<NEW_LINE>setSupportActionBar(toolbar);<NEW_LINE>getSupportActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_HOME | ActionBar.DISPLAY_HOME_AS_UP | ActionBar.DISPLAY_SHOW_TITLE);<NEW_LINE>getSupportActionBar().setSubtitle(R.string.offline);<NEW_LINE>final ProgressBar progressBar = (ProgressBar) findViewById(R.id.progress);<NEW_LINE>final WebView webView = (WebView) findViewById(R.id.web_view);<NEW_LINE>webView.setBackgroundColor(Color.TRANSPARENT);<NEW_LINE>webView.setWebViewClient(new AdBlockWebViewClient(Preferences.adBlockEnabled(this)) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onPageFinished(WebView view, String url) {<NEW_LINE>setTitle(view.getTitle());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>webView.setWebChromeClient(new CacheableWebView.ArchiveClient() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onProgressChanged(WebView view, int newProgress) {<NEW_LINE>super.onProgressChanged(view, newProgress);<NEW_LINE>progressBar.setVisibility(View.VISIBLE);<NEW_LINE>progressBar.setProgress(newProgress);<NEW_LINE>if (newProgress == 100) {<NEW_LINE>progressBar.setVisibility(View.GONE);<NEW_LINE>webView.setBackgroundColor(Color.WHITE);<NEW_LINE>webView.setVisibility(View.VISIBLE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>AppUtils.toggleWebViewZoom(webView.getSettings(), true);<NEW_LINE>webView.loadUrl(url);<NEW_LINE>} | setContentView(R.layout.activity_offline_web); |
1,298,722 | protected void updateUUIDOfContainers() {<NEW_LINE>final Map<String, Integer> UUIDByContainermap = new HashMap<>();<NEW_LINE>this.getBody().getRows().forEach(row -> row.getColumns().stream().forEach(column -> column.getContainers().stream().forEach(containerUUID -> {<NEW_LINE>final String containerID = containerUUID.getIdentifier();<NEW_LINE>int value = UUIDByContainermap.getOrDefault(containerID, 0);<NEW_LINE>UUIDByContainermap.put(containerID, ++value);<NEW_LINE>containerUUID.setUuid(UUIDByContainermap.get(containerID).toString());<NEW_LINE>})));<NEW_LINE>if (this.getSidebar() != null) {<NEW_LINE>this.getSidebar().getContainers().stream().forEach(containerUUID -> {<NEW_LINE>final String containerID = containerUUID.getIdentifier();<NEW_LINE>int value = <MASK><NEW_LINE>UUIDByContainermap.put(containerID, ++value);<NEW_LINE>containerUUID.setUuid(UUIDByContainermap.get(containerID).toString());<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} | UUIDByContainermap.getOrDefault(containerID, 0); |
240,182 | private void decodeEscapes(BitReader _in, ICStream ics, int[][] scaleFactors) throws AACException {<NEW_LINE>final ICSInfo info = ics.getInfo();<NEW_LINE>final int windowGroupCount = info.getWindowGroupCount();<NEW_LINE>final int maxSFB = info.getMaxSFB();<NEW_LINE>// ics.getSectionData().getSfbCB();<NEW_LINE>final int[][] sfbCB = { {} };<NEW_LINE>final int escapesLen = _in.readNBit(8);<NEW_LINE>boolean noiseUsed = false;<NEW_LINE>int sfb, val;<NEW_LINE>for (int g = 0; g < windowGroupCount; g++) {<NEW_LINE>for (sfb = 0; sfb < maxSFB; sfb++) {<NEW_LINE>if (sfbCB[g][sfb] == HCB.NOISE_HCB && !noiseUsed)<NEW_LINE>noiseUsed = true;<NEW_LINE>else if (Math.abs(sfbCB[g][sfb]) == ESCAPE_FLAG) {<NEW_LINE>val = decodeHuffmanEscape(_in);<NEW_LINE>if (sfbCB[g][sfb] == -ESCAPE_FLAG)<NEW_LINE>scaleFactors<MASK><NEW_LINE>else<NEW_LINE>scaleFactors[g][sfb] += val;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | [g][sfb] -= val; |
1,629,869 | public Map<String, ?> call(String callString, StatementParameters parameters, final DalHints hints, final DalTaskContext dalTaskContext) throws SQLException {<NEW_LINE>ConnectionAction<Map<String, ?>> action = new ConnectionAction<Map<String, ?>>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Map<String, ?> execute() throws Exception {<NEW_LINE>List<StatementParameter> resultParameters = new ArrayList<StatementParameter>();<NEW_LINE>List<StatementParameter> callParameters = new ArrayList<StatementParameter>();<NEW_LINE>resultParameters.addAll(parameters.getResultParameters());<NEW_LINE>for (StatementParameter parameter : parameters.values()) {<NEW_LINE>if (parameter.isOutParameter()) {<NEW_LINE>callParameters.add(parameter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (hints.is(DalHintEnum.retrieveAllSpResults) && resultParameters.size() > 0)<NEW_LINE>throw new DalException("Dal hint 'autoRetrieveAllResults' should only be used when there is no special result parameter specified");<NEW_LINE>conn = getConnection(hints, this);<NEW_LINE>callableStatement = createCallableStatement(conn, callString, parameters, hints);<NEW_LINE>beginExecute();<NEW_LINE>boolean retVal = executeCall(callableStatement, entry);<NEW_LINE><MASK><NEW_LINE>endExecute();<NEW_LINE>Map<String, Object> returnedResults = new LinkedHashMap<String, Object>();<NEW_LINE>if (retVal || updateCount != -1) {<NEW_LINE>returnedResults.putAll(extractReturnedResults(callableStatement, resultParameters, updateCount, hints));<NEW_LINE>}<NEW_LINE>returnedResults.putAll(extractOutputParameters(callableStatement, callParameters));<NEW_LINE>return returnedResults;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>action.populateSp(callString, parameters, dalTaskContext);<NEW_LINE>return doInConnection(action, hints);<NEW_LINE>} | int updateCount = callableStatement.getUpdateCount(); |
1,649,483 | public List<List<SegmentHeader>> findRollupCandidates(String schemaName, ByteString schemaChecksum, String cubeName, String measureName, String rolapStarFactTableName, BitKey constrainedColsBitKey, Map<String, Comparable> coordinates, List<String> compoundPredicates) {<NEW_LINE>final List factKey = makeFactKey(schemaName, schemaChecksum, <MASK><NEW_LINE>final FactInfo factInfo = factMap.get(factKey);<NEW_LINE>if (factInfo == null) {<NEW_LINE>return Collections.emptyList();<NEW_LINE>}<NEW_LINE>// Iterate over all dimensionalities that are a superset of the desired<NEW_LINE>// columns and for which a segment is known to exist.<NEW_LINE>//<NEW_LINE>// It helps that getAncestors returns dimensionalities with fewer bits<NEW_LINE>// set first. These will contain fewer cells, and therefore be less<NEW_LINE>// effort to roll up.<NEW_LINE>final List<List<SegmentHeader>> list = new ArrayList<List<SegmentHeader>>();<NEW_LINE>final List<BitKey> ancestors = factInfo.bitkeyPoset.getAncestors(constrainedColsBitKey);<NEW_LINE>for (BitKey bitKey : ancestors) {<NEW_LINE>final List bitkeyKey = makeBitkeyKey(schemaName, schemaChecksum, cubeName, rolapStarFactTableName, bitKey, measureName, compoundPredicates);<NEW_LINE>final List<SegmentHeader> headers = bitkeyMap.get(bitkeyKey);<NEW_LINE>assert headers != null : "bitkeyPoset / bitkeyMap inconsistency";<NEW_LINE>// For columns that are still present after roll up, make sure that<NEW_LINE>// the required value is in the range covered by the segment.<NEW_LINE>// Of the columns that are being aggregated away, are all of<NEW_LINE>// them wildcarded? If so, this segment is a match. If not, we<NEW_LINE>// will need to combine with other segments later.<NEW_LINE>findRollupCandidatesAmong(coordinates, list, headers);<NEW_LINE>}<NEW_LINE>return list;<NEW_LINE>} | cubeName, rolapStarFactTableName, measureName, compoundPredicates); |
1,593,271 | public boolean applies(Ability abilityToModify, Ability source, Game game) {<NEW_LINE>if (!(abilityToModify instanceof SpellAbility)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!game.getOpponents(source.getControllerId()).contains(abilityToModify.getControllerId())) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Set<UUID> allTargets;<NEW_LINE>if (game.getStack().getStackObject(abilityToModify.getId()) != null) {<NEW_LINE>// real cast<NEW_LINE>allTargets = CardUtil.getAllSelectedTargets(abilityToModify, game);<NEW_LINE>} else {<NEW_LINE>// playable<NEW_LINE>allTargets = <MASK><NEW_LINE>// can target without cost increase<NEW_LINE>if (allTargets.stream().map(game::getPermanent).filter(Objects::nonNull).anyMatch(permanent -> !filter.match(permanent, source.getControllerId(), source, game))) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return allTargets.stream().map(game::getPermanent).filter(Objects::nonNull).anyMatch(permanent -> filter.match(permanent, source.getControllerId(), source, game));<NEW_LINE>} | CardUtil.getAllPossibleTargets(abilityToModify, game); |
444,304 | public static DescribeAffectedMaliciousFileImagesResponse unmarshall(DescribeAffectedMaliciousFileImagesResponse describeAffectedMaliciousFileImagesResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeAffectedMaliciousFileImagesResponse.setRequestId(_ctx.stringValue("DescribeAffectedMaliciousFileImagesResponse.RequestId"));<NEW_LINE>PageInfo pageInfo = new PageInfo();<NEW_LINE>pageInfo.setCount(_ctx.integerValue("DescribeAffectedMaliciousFileImagesResponse.PageInfo.Count"));<NEW_LINE>pageInfo.setPageSize(_ctx.integerValue("DescribeAffectedMaliciousFileImagesResponse.PageInfo.PageSize"));<NEW_LINE>pageInfo.setTotalCount(_ctx.integerValue("DescribeAffectedMaliciousFileImagesResponse.PageInfo.TotalCount"));<NEW_LINE>pageInfo.setCurrentPage(_ctx.integerValue("DescribeAffectedMaliciousFileImagesResponse.PageInfo.CurrentPage"));<NEW_LINE>describeAffectedMaliciousFileImagesResponse.setPageInfo(pageInfo);<NEW_LINE>List<AffectedMaliciousFileImage> affectedMaliciousFileImagesResponse = new ArrayList<AffectedMaliciousFileImage>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeAffectedMaliciousFileImagesResponse.AffectedMaliciousFileImagesResponse.Length"); i++) {<NEW_LINE>AffectedMaliciousFileImage affectedMaliciousFileImage = new AffectedMaliciousFileImage();<NEW_LINE>affectedMaliciousFileImage.setLayer(_ctx.stringValue("DescribeAffectedMaliciousFileImagesResponse.AffectedMaliciousFileImagesResponse[" + i + "].Layer"));<NEW_LINE>affectedMaliciousFileImage.setFirstScanTimestamp(_ctx.longValue("DescribeAffectedMaliciousFileImagesResponse.AffectedMaliciousFileImagesResponse[" + i + "].FirstScanTimestamp"));<NEW_LINE>affectedMaliciousFileImage.setLatestScanTimestamp(_ctx.longValue<MASK><NEW_LINE>affectedMaliciousFileImage.setLatestVerifyTimestamp(_ctx.longValue("DescribeAffectedMaliciousFileImagesResponse.AffectedMaliciousFileImagesResponse[" + i + "].LatestVerifyTimestamp"));<NEW_LINE>affectedMaliciousFileImage.setMaliciousMd5(_ctx.stringValue("DescribeAffectedMaliciousFileImagesResponse.AffectedMaliciousFileImagesResponse[" + i + "].MaliciousMd5"));<NEW_LINE>affectedMaliciousFileImage.setStatus(_ctx.integerValue("DescribeAffectedMaliciousFileImagesResponse.AffectedMaliciousFileImagesResponse[" + i + "].Status"));<NEW_LINE>affectedMaliciousFileImage.setLevel(_ctx.stringValue("DescribeAffectedMaliciousFileImagesResponse.AffectedMaliciousFileImagesResponse[" + i + "].Level"));<NEW_LINE>affectedMaliciousFileImage.setImageUuid(_ctx.stringValue("DescribeAffectedMaliciousFileImagesResponse.AffectedMaliciousFileImagesResponse[" + i + "].ImageUuid"));<NEW_LINE>affectedMaliciousFileImage.setFilePath(_ctx.stringValue("DescribeAffectedMaliciousFileImagesResponse.AffectedMaliciousFileImagesResponse[" + i + "].FilePath"));<NEW_LINE>affectedMaliciousFileImage.setDigest(_ctx.stringValue("DescribeAffectedMaliciousFileImagesResponse.AffectedMaliciousFileImagesResponse[" + i + "].Digest"));<NEW_LINE>affectedMaliciousFileImage.setRepoRegionId(_ctx.stringValue("DescribeAffectedMaliciousFileImagesResponse.AffectedMaliciousFileImagesResponse[" + i + "].RepoRegionId"));<NEW_LINE>affectedMaliciousFileImage.setRepoInstanceId(_ctx.stringValue("DescribeAffectedMaliciousFileImagesResponse.AffectedMaliciousFileImagesResponse[" + i + "].RepoInstanceId"));<NEW_LINE>affectedMaliciousFileImage.setRepoId(_ctx.stringValue("DescribeAffectedMaliciousFileImagesResponse.AffectedMaliciousFileImagesResponse[" + i + "].RepoId"));<NEW_LINE>affectedMaliciousFileImage.setRepoName(_ctx.stringValue("DescribeAffectedMaliciousFileImagesResponse.AffectedMaliciousFileImagesResponse[" + i + "].RepoName"));<NEW_LINE>affectedMaliciousFileImage.setNamespace(_ctx.stringValue("DescribeAffectedMaliciousFileImagesResponse.AffectedMaliciousFileImagesResponse[" + i + "].Namespace"));<NEW_LINE>affectedMaliciousFileImage.setTag(_ctx.stringValue("DescribeAffectedMaliciousFileImagesResponse.AffectedMaliciousFileImagesResponse[" + i + "].Tag"));<NEW_LINE>affectedMaliciousFileImagesResponse.add(affectedMaliciousFileImage);<NEW_LINE>}<NEW_LINE>describeAffectedMaliciousFileImagesResponse.setAffectedMaliciousFileImagesResponse(affectedMaliciousFileImagesResponse);<NEW_LINE>return describeAffectedMaliciousFileImagesResponse;<NEW_LINE>} | ("DescribeAffectedMaliciousFileImagesResponse.AffectedMaliciousFileImagesResponse[" + i + "].LatestScanTimestamp")); |
613,094 | private Optional<ShardingConditionValue> generate(final Comparable<?> comparable, final Column column, final String operator) {<NEW_LINE>String columnName = column.getName();<NEW_LINE><MASK><NEW_LINE>switch(operator) {<NEW_LINE>case EQUAL:<NEW_LINE>return Optional.of(new ListShardingConditionValue<>(columnName, tableName, Lists.newArrayList(comparable)));<NEW_LINE>case GREATER_THAN:<NEW_LINE>return Optional.of(new RangeShardingConditionValue<>(columnName, tableName, Range.greaterThan(comparable)));<NEW_LINE>case LESS_THAN:<NEW_LINE>return Optional.of(new RangeShardingConditionValue<>(columnName, tableName, Range.lessThan(comparable)));<NEW_LINE>case AT_MOST:<NEW_LINE>return Optional.of(new RangeShardingConditionValue<>(columnName, tableName, Range.atMost(comparable)));<NEW_LINE>case AT_LEAST:<NEW_LINE>return Optional.of(new RangeShardingConditionValue<>(columnName, tableName, Range.atLeast(comparable)));<NEW_LINE>default:<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>} | String tableName = column.getTableName(); |
1,122,905 | private List<ShipmentSchedule> loadShipmentSchedulesToExport(@NonNull final QueryLimit limit) {<NEW_LINE>final ShipmentScheduleQuery shipmentScheduleQuery = ShipmentScheduleQuery.builder().canBeExportedFrom(SystemTime.asInstant()).onlyIfAllFromOrderExportable(true).exportStatus(APIExportStatus.Pending).includeWithQtyToDeliverZero(true).fromCompleteOrderOrNullOrder(true).orderByOrderId(true).build();<NEW_LINE>final List<ShipmentSchedule> shipmentSchedulesOrderedByOrderId = shipmentScheduleRepository.getBy(shipmentScheduleQuery);<NEW_LINE>final List<ShipmentSchedule> schedulesToBeExported = new ArrayList<>();<NEW_LINE>// add possible shipmentSchedule which don't reference an order<NEW_LINE>int counter = 0;<NEW_LINE>for (final ShipmentSchedule schedule : shipmentSchedulesOrderedByOrderId) {<NEW_LINE>if (schedule.getOrderAndLineId() == null && counter < limit.toInt() - 1) {<NEW_LINE>schedulesToBeExported.add(schedule);<NEW_LINE>counter++;<NEW_LINE>} else {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>logger.info("loadShipmentSchedulesToExport - Added {} shipmentSchedules that have no C_Order_ID", schedulesToBeExported.size());<NEW_LINE>if (counter >= limit.toInt()) {<NEW_LINE>return schedulesToBeExported;<NEW_LINE>}<NEW_LINE>// add shipmentSchedules which reference an oder<NEW_LINE>final List<ShipmentSchedule> nonNullOrderShipmentSchedules = shipmentSchedulesOrderedByOrderId.stream().filter(sched -> sched.getOrderAndLineId() != null).collect(ImmutableList.toImmutableList());<NEW_LINE>final ImmutableListMultimap<OrderId, ShipmentSchedule> schedulesForOrderIds = Multimaps.index(nonNullOrderShipmentSchedules, sched -> sched.getOrderAndLineId().getOrderId());<NEW_LINE>int ordersLeftToExport = limit.toInt() - counter;<NEW_LINE>final ImmutableSet<OrderId> orderIds = schedulesForOrderIds.keySet();<NEW_LINE>logger.info("loadShipmentSchedulesToExport - the exportable shipmentSchedules have {} different C_Order_IDs; ordersLeftToExport={}", orderIds.size(), ordersLeftToExport);<NEW_LINE>final UnmodifiableIterator<OrderId> orderIdIterator = orderIds.iterator();<NEW_LINE>while (orderIdIterator.hasNext() && ordersLeftToExport > 0) {<NEW_LINE>final OrderId currentOrderId = orderIdIterator.next();<NEW_LINE>final ImmutableList<ShipmentSchedule> <MASK><NEW_LINE>schedulesToBeExported.addAll(shipmentSchedules);<NEW_LINE>logger.info("loadShipmentSchedulesToExport - Added {} shipmentSchedules for C_Order_ID={} to the schedulesToBeExported", shipmentSchedules.size(), currentOrderId.getRepoId());<NEW_LINE>ordersLeftToExport--;<NEW_LINE>}<NEW_LINE>return schedulesToBeExported;<NEW_LINE>} | shipmentSchedules = schedulesForOrderIds.get(currentOrderId); |
1,354,907 | public void addTables(Set<Table> tables) {<NEW_LINE>if (!canAddAllTables(tables)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (closureEnabled) {<NEW_LINE>if (wantedTables.addAll(tables)) {<NEW_LINE>Set<Table> refTables <MASK><NEW_LINE>Set<Table> addedTables = new HashSet<Table>(tables);<NEW_LINE>addedTables.addAll(refTables);<NEW_LINE>selectedTables.addAll(addedTables);<NEW_LINE>referencedTables.addAll(refTables);<NEW_LINE>availableTables.removeAll(addedTables);<NEW_LINE>Set<Table> joinTables = removeDisabledTables(getJoinTablesTransitively(addedTables));<NEW_LINE>// if some of the join tables are already selected, we don't want<NEW_LINE>// to add them once more and especially we want to avoid adding<NEW_LINE>// already selected tables as referenced tables -- that would be incorrect<NEW_LINE>joinTables.removeAll(selectedTables);<NEW_LINE>selectedTables.addAll(joinTables);<NEW_LINE>referencedTables.addAll(joinTables);<NEW_LINE>availableTables.removeAll(joinTables);<NEW_LINE>changeSupport.fireChange();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>wantedTables.addAll(tables);<NEW_LINE>selectedTables.addAll(tables);<NEW_LINE>availableTables.removeAll(tables);<NEW_LINE>changeSupport.fireChange();<NEW_LINE>}<NEW_LINE>} | = removeDisabledTables(getReferencedTablesTransitively(tables)); |
1,645,475 | public Query parseJson(String queryName, ObjectNode fullQuery) throws QueryException {<NEW_LINE>Query query = new Query(queryName, packageMetaData);<NEW_LINE>query.setOriginalJson(fullQuery);<NEW_LINE>int version = LATEST_VERSION;<NEW_LINE>if (fullQuery.has("version")) {<NEW_LINE>version = fullQuery.get("version").asInt();<NEW_LINE>}<NEW_LINE>if (version != LATEST_VERSION) {<NEW_LINE>throw new QueryException("Only version " + LATEST_VERSION + " supported by this version of BIMserver");<NEW_LINE>}<NEW_LINE>query.setVersion(version);<NEW_LINE>query.setDoubleBuffer(fullQuery.has("doublebuffer") ? fullQuery.get("doublebuffer").asBoolean() : true);<NEW_LINE>if (fullQuery.has("defines")) {<NEW_LINE>JsonNode defines = fullQuery.get("defines");<NEW_LINE>if (defines instanceof ObjectNode) {<NEW_LINE>parseDefines(query, (ObjectNode) fullQuery.get("defines"));<NEW_LINE>} else {<NEW_LINE>throw new QueryException("\"defines\" must be of type object");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (fullQuery.has("specialQueryType")) {<NEW_LINE>query.setSpecialQueryType(SpecialQueryType.valueOf(fullQuery.get(<MASK><NEW_LINE>}<NEW_LINE>if (fullQuery.has("loaderSettings")) {<NEW_LINE>query.setGeometrySettings((ObjectNode) fullQuery.get("loaderSettings"));<NEW_LINE>}<NEW_LINE>if (fullQuery.has("queries")) {<NEW_LINE>JsonNode queriesNode = fullQuery.get("queries");<NEW_LINE>if (queriesNode instanceof ArrayNode) {<NEW_LINE>ArrayNode queries = (ArrayNode) fullQuery.get("queries");<NEW_LINE>if (queries.size() == 0) {<NEW_LINE>}<NEW_LINE>for (int i = 0; i < queries.size(); i++) {<NEW_LINE>parseJsonQuery(query, (ObjectNode) queries.get(i));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new QueryException("\"queries\" must be of type array");<NEW_LINE>}<NEW_LINE>} else if (fullQuery.has("query")) {<NEW_LINE>JsonNode queryNode = fullQuery.get("query");<NEW_LINE>if (queryNode instanceof ObjectNode) {<NEW_LINE>parseJsonQuery(query, (ObjectNode) fullQuery.get("query"));<NEW_LINE>} else {<NEW_LINE>throw new QueryException("\"query\" must be of type object");<NEW_LINE>}<NEW_LINE>} else if (!fullQuery.has("defines")) {<NEW_LINE>parseJsonQuery(query, fullQuery);<NEW_LINE>}<NEW_LINE>return query;<NEW_LINE>} | "specialQueryType").asText())); |
1,425,415 | // "In 3 days/weeks/months/years" = "3 days/weeks/months/years from now"<NEW_LINE>public List<Token> extractRelativeDurationDateWithInPrefix(String text, List<ExtractResult> durationEr, LocalDateTime reference) {<NEW_LINE>List<Token> <MASK><NEW_LINE>List<Token> durations = new ArrayList<>();<NEW_LINE>for (ExtractResult durationExtraction : durationEr) {<NEW_LINE>Optional<Match> match = Arrays.stream(RegExpUtility.getMatches(config.getDateUnitRegex(), durationExtraction.getText())).findFirst();<NEW_LINE>if (match.isPresent()) {<NEW_LINE>int start = durationExtraction.getStart() != null ? durationExtraction.getStart() : 0;<NEW_LINE>int end = start + (durationExtraction.getLength() != null ? durationExtraction.getLength() : 0);<NEW_LINE>durations.add(new Token(start, end));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Token duration : durations) {<NEW_LINE>String beforeStr = text.substring(0, duration.getStart()).toLowerCase();<NEW_LINE>String afterStr = text.substring(duration.getStart() + duration.getLength()).toLowerCase();<NEW_LINE>if (StringUtility.isNullOrWhiteSpace(beforeStr) && StringUtility.isNullOrWhiteSpace(afterStr)) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>ConditionalMatch match = RegexExtension.matchEnd(config.getInConnectorRegex(), beforeStr, true);<NEW_LINE>if (match.getSuccess() && match.getMatch().isPresent()) {<NEW_LINE>int startToken = match.getMatch().get().index;<NEW_LINE>Optional<Match> rangeUnitMatch = Arrays.stream(RegExpUtility.getMatches(config.getRangeUnitRegex(), text.substring(duration.getStart(), duration.getStart() + duration.getLength()))).findFirst();<NEW_LINE>if (rangeUnitMatch.isPresent()) {<NEW_LINE>tokens.add(new Token(startToken, duration.getEnd()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return tokens;<NEW_LINE>} | tokens = new ArrayList<>(); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.