idx int32 46 1.86M | input stringlengths 321 6.6k | target stringlengths 9 1.24k |
|---|---|---|
1,221,487 | private void readState(GetField fields) throws IOException {<NEW_LINE>// get caller principal<NEW_LINE>callerPrincipal = (WSPrincipal) fields.get(CALLER_PRINCIPAL, null);<NEW_LINE>// get boolean marking if subjects are equal<NEW_LINE>subjectsAreEqual = <MASK><NEW_LINE>// only deserialize invocation principal if it's different from the caller<NEW_LINE>if (!subjectsAreEqual) {<NEW_LINE>// get invocation principal<NEW_LINE>invocationPrincipal = (WSPrincipal) fields.get(INVOCATION_PRINCIPAL, null);<NEW_LINE>} else {<NEW_LINE>invocationPrincipal = callerPrincipal;<NEW_LINE>}<NEW_LINE>jaasLoginContextEntry = (String) fields.get(JAAS_LOGIN_CONTEXT, null);<NEW_LINE>callerSubjectCacheKey = (String) fields.get(CALLER_SUBJECT_CACHE_KEY, null);<NEW_LINE>invocationSubjectCacheKey = (String) fields.get(INVOCATION_SUBJECT_CACHE_KEY, null);<NEW_LINE>} | fields.get(SUBJECTS_ARE_EQUAL, false); |
1,364,440 | Expression implementSafe(final RexToLixTranslator translator, final RexCall call, final List<Expression> argValueList) {<NEW_LINE>final SqlOperator op = call.getOperator();<NEW_LINE>final Expression root = translator.getRoot();<NEW_LINE>if (op == CURRENT_USER || op == SESSION_USER || op == USER) {<NEW_LINE>return Expressions.call(BuiltInMethod.USER.method, root);<NEW_LINE>} else if (op == SYSTEM_USER) {<NEW_LINE>return Expressions.call(BuiltInMethod.SYSTEM_USER.method, root);<NEW_LINE>} else if (op == CURRENT_PATH || op == CURRENT_ROLE || op == CURRENT_CATALOG) {<NEW_LINE>// By default, the CURRENT_ROLE and CURRENT_CATALOG functions return the<NEW_LINE>// empty string because a role or a catalog has to be set explicitly.<NEW_LINE>return Expressions.constant("");<NEW_LINE>} else if (op == CURRENT_TIMESTAMP) {<NEW_LINE>return Expressions.call(BuiltInMethod.CURRENT_TIMESTAMP.method, root);<NEW_LINE>} else if (op == CURRENT_TIME) {<NEW_LINE>return Expressions.call(BuiltInMethod.CURRENT_TIME.method, root);<NEW_LINE>} else if (op == CURRENT_DATE) {<NEW_LINE>return Expressions.call(<MASK><NEW_LINE>} else // else if (op == LOCALTIMESTAMP) {<NEW_LINE>// return Expressions.call(BuiltInMethod.LOCAL_TIMESTAMP.method, root);<NEW_LINE>// }<NEW_LINE>if (op == LOCALTIME) {<NEW_LINE>return Expressions.call(BuiltInMethod.LOCAL_TIME.method, root);<NEW_LINE>} else {<NEW_LINE>throw new AssertionError("unknown function " + op);<NEW_LINE>}<NEW_LINE>} | BuiltInMethod.CURRENT_DATE.method, root); |
633,219 | private void releaseChannel(final Channel channel, final Promise<Void> promise) {<NEW_LINE>checkState(channel.eventLoop().inEventLoop());<NEW_LINE>final ChannelPool pool = channel.attr(POOL_KEY).getAndSet(null);<NEW_LINE>final boolean acquired = this.<MASK><NEW_LINE>if (acquired && pool == this) {<NEW_LINE>try {<NEW_LINE>if (this.releaseHealthCheck) {<NEW_LINE>this.doChannelHealthCheckOnRelease(channel, promise);<NEW_LINE>} else {<NEW_LINE>if (this.executor.inEventLoop()) {<NEW_LINE>this.releaseAndOfferChannel(channel, promise);<NEW_LINE>} else {<NEW_LINE>this.executor.submit(() -> this.releaseAndOfferChannel(channel, promise));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable cause) {<NEW_LINE>if (this.executor.inEventLoop()) {<NEW_LINE>this.closeChannelAndFail(channel, cause, promise);<NEW_LINE>} else {<NEW_LINE>this.executor.submit(() -> this.closeChannelAndFail(channel, cause, promise));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final IllegalStateException error = new IllegalStateException(lenientFormat("%s cannot be released because it was not acquired by this pool: %s", RntbdObjectMapper.toJson(channel), this));<NEW_LINE>if (this.executor.inEventLoop()) {<NEW_LINE>this.closeChannelAndFail(channel, error, promise);<NEW_LINE>} else {<NEW_LINE>this.executor.submit(() -> this.closeChannelAndFail(channel, error, promise));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | acquiredChannels.get(channel) != null; |
1,149,205 | public double rayCast(Ray2D ray) {<NEW_LINE>double result = Double.POSITIVE_INFINITY;<NEW_LINE>for (int i = 0; i < edges.length; i++) {<NEW_LINE>if (!ray.getDirection().isParallel(edges[i])) {<NEW_LINE>final double divisor = (ray.getDirection().getX() * edges[i].getX() - ray.getDirection().getX() * edges[i].getY());<NEW_LINE>final double len1 = (vertexes[i].getY() * edges[i].getX() - ray.getStart().getY() * edges[i].getX() - vertexes[i].getX() * edges[i].getY() + ray.getStart().getX() * edges[i<MASK><NEW_LINE>if (len1 > 0) {<NEW_LINE>final double len2 = (ray.getDirection().getY() * ray.getStart().getX() - ray.getDirection().getY() * vertexes[i].getX() - ray.getDirection().getX() * ray.getStart().getY() + ray.getDirection().getX() * vertexes[i].getY()) / divisor;<NEW_LINE>if (len2 >= 0 && len2 <= 1)<NEW_LINE>result = result > len1 ? len1 : result;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>final Vector2D startVec = ray.getStart().vec(vertexes[i]);<NEW_LINE>if (ray.getDirection().isAbsoluteParallel(startVec)) {<NEW_LINE>return startVec.length();<NEW_LINE>} else {<NEW_LINE>final Point2D endVertex = isClosed && i == edges.length - 1 ? vertexes[0] : vertexes[i + 1];<NEW_LINE>final Vector2D endVec = ray.getStart().vec(endVertex);<NEW_LINE>if (ray.getDirection().isAbsoluteParallel(endVec)) {<NEW_LINE>return endVec.length();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result * ray.getDirection().length();<NEW_LINE>} | ].getY()) / divisor; |
1,757,494 | final StopRxNormInferenceJobResult executeStopRxNormInferenceJob(StopRxNormInferenceJobRequest stopRxNormInferenceJobRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(stopRxNormInferenceJobRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<StopRxNormInferenceJobRequest> request = null;<NEW_LINE>Response<StopRxNormInferenceJobResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new StopRxNormInferenceJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopRxNormInferenceJobRequest));<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, "ComprehendMedical");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopRxNormInferenceJob");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<StopRxNormInferenceJobResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new StopRxNormInferenceJobResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} | endClientExecution(awsRequestMetrics, request, response); |
486,356 | public void closeOpenWindows() {<NEW_LINE>if (infoWindow != null) {<NEW_LINE>if (infoWindow.isVisible()) {<NEW_LINE>infoWindow.setVisible(false);<NEW_LINE>add(panelInfos, infoTabIndex);<NEW_LINE>updateInfoTab();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (warningsWindow != null) {<NEW_LINE>if (warningsWindow.isVisible()) {<NEW_LINE>warningsWindow.setVisible(false);<NEW_LINE>add(panelWarnings, warningsTabIndex);<NEW_LINE>setTitleAt(warningsTabIndex, "Warnings (" + warningsList.getCountNr() + ")");<NEW_LINE>clearDrcTrace();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (errorsWindow != null)<NEW_LINE>if (errorsWindow.isVisible()) {<NEW_LINE>errorsWindow.setVisible(false);<NEW_LINE>add(panelErrors, errorsTabIndex);<NEW_LINE>setTitleAt(errorsTabIndex, "Errors (" + <MASK><NEW_LINE>clearDrcTrace();<NEW_LINE>}<NEW_LINE>if (consoleWindow != null)<NEW_LINE>if (consoleWindow.isVisible()) {<NEW_LINE>consoleWindow.setVisible(false);<NEW_LINE>add(panelConsole, consoleTabIndex);<NEW_LINE>updateConsoleTab();<NEW_LINE>}<NEW_LINE>} | errorsList.getCountNr() + ")"); |
498,672 | public void submitRequests() {<NEW_LINE>// ==========================================================================//<NEW_LINE>// ================= Submit a Spot Instance Request =====================//<NEW_LINE>// ==========================================================================//<NEW_LINE>// Initializes a Spot Instance Request<NEW_LINE>RequestSpotInstancesRequest requestRequest = new RequestSpotInstancesRequest();<NEW_LINE>// Request 1 x t1.micro instance with a bid price of $0.03.<NEW_LINE>requestRequest.setSpotPrice("0.03");<NEW_LINE>requestRequest.setInstanceCount(Integer.valueOf(1));<NEW_LINE>// Setup the specifications of the launch. This includes the instance type (e.g. t1.micro)<NEW_LINE>// and the latest Amazon Linux AMI id available. Note, you should always use the latest<NEW_LINE>// Amazon Linux AMI id or another of your choosing.<NEW_LINE>LaunchSpecification launchSpecification = new LaunchSpecification();<NEW_LINE>launchSpecification.setImageId("ami-8c1fece5");<NEW_LINE>launchSpecification.setInstanceType("t1.micro");<NEW_LINE>// Add the security group to the request.<NEW_LINE>ArrayList<String> securityGroups = new ArrayList<String>();<NEW_LINE>securityGroups.add("GettingStartedGroup");<NEW_LINE>launchSpecification.setSecurityGroups(securityGroups);<NEW_LINE>// Add the launch specifications to the request.<NEW_LINE>requestRequest.setLaunchSpecification(launchSpecification);<NEW_LINE>// Call the RequestSpotInstance API.<NEW_LINE>RequestSpotInstancesResult requestResult = ec2.requestSpotInstances(requestRequest);<NEW_LINE>List<SpotInstanceRequest<MASK><NEW_LINE>// Setup an arraylist to collect all of the request ids we want to watch hit the running<NEW_LINE>// state.<NEW_LINE>spotInstanceRequestIds = new ArrayList<String>();<NEW_LINE>// Add all of the request ids to the hashset, so we can determine when they hit the<NEW_LINE>// active state.<NEW_LINE>for (SpotInstanceRequest requestResponse : requestResponses) {<NEW_LINE>System.out.println("Created Spot Request: " + requestResponse.getSpotInstanceRequestId());<NEW_LINE>spotInstanceRequestIds.add(requestResponse.getSpotInstanceRequestId());<NEW_LINE>}<NEW_LINE>} | > requestResponses = requestResult.getSpotInstanceRequests(); |
1,272,721 | public void testMultiIndexRead() throws Exception {<NEW_LINE>testRuns++;<NEW_LINE>RestUtils.postData(index + <MASK><NEW_LINE>RestUtils.postData(index + "/bar", "{\"message\" : \"Goodbye World\",\"message_date\" : \"2014-05-25\"}".getBytes());<NEW_LINE>RestUtils.refresh(index);<NEW_LINE>String target = "_all/foo";<NEW_LINE>TopologyBuilder builder = new TopologyBuilder();<NEW_LINE>builder.setSpout("es-spout", new TestSpout(new EsSpout(target)));<NEW_LINE>builder.setBolt("test-bolt", new CapturingBolt()).shuffleGrouping("es-spout");<NEW_LINE>MultiIndexSpoutStormSuite.run(index + "multi", builder.createTopology(), COMPONENT_HAS_COMPLETED);<NEW_LINE>assumeTrue(COMPONENT_HAS_COMPLETED.is(2));<NEW_LINE>COMPONENT_HAS_COMPLETED.waitFor(1, TimeValue.timeValueSeconds(10));<NEW_LINE>String results = RestUtils.get(target + "/_search?");<NEW_LINE>assertThat(results, containsString("Hello"));<NEW_LINE>assertThat(CapturingBolt.CAPTURED.size(), greaterThanOrEqualTo(testRuns));<NEW_LINE>} | "/foo", "{\"message\" : \"Hello World\",\"message_date\" : \"2014-05-25\"}".getBytes()); |
379,967 | public void onPresentProofClicked(View v) {<NEW_LINE>try {<NEW_LINE>int connectionHandle = ConnectionApi.connectionDeserialize(connection).get();<NEW_LINE>// Check agency for a proof request<NEW_LINE>String requests = DisclosedProofApi.proofGetRequests(connectionHandle).get();<NEW_LINE>// Create a Disclosed proof object from proof request<NEW_LINE>LinkedHashMap<String, Object> request = JsonPath.read(requests, "$.[0]");<NEW_LINE>int proofHandle = DisclosedProofApi.proofCreateWithRequest("1", JsonPath.parse(request).jsonString()).get();<NEW_LINE>// Query for credentials in the wallet that satisfy the proof request<NEW_LINE>String credentials = DisclosedProofApi.proofRetrieveCredentials(proofHandle).get();<NEW_LINE>// Use the first available credentials to satisfy the proof request<NEW_LINE>DocumentContext ctx = JsonPath.parse(credentials);<NEW_LINE>LinkedHashMap<String, Object> attrs = ctx.read("$.attrs");<NEW_LINE>for (String key : attrs.keySet()) {<NEW_LINE>LinkedHashMap<String, Object> attr = JsonPath.read(attrs.get(key), "$.[0]");<NEW_LINE>ctx.set("$.attrs." + key, JsonPath.parse("{\"credential\":null}").json());<NEW_LINE>ctx.set("$.attrs." + key + ".credential", attr);<NEW_LINE>}<NEW_LINE>// Generate and send the proof<NEW_LINE>DisclosedProofApi.proofGenerate(proofHandle, ctx.jsonString(), "{}").get();<NEW_LINE>DisclosedProofApi.proofSend(proofHandle, connectionHandle).get();<NEW_LINE>int state = DisclosedProofApi.proofUpdateState(proofHandle).get();<NEW_LINE>while (state != 4) {<NEW_LINE>try {<NEW_LINE>Thread.sleep(1 * 1000);<NEW_LINE>} catch (InterruptedException ie) {<NEW_LINE>Thread<MASK><NEW_LINE>}<NEW_LINE>state = DisclosedProofApi.proofUpdateState(proofHandle).get();<NEW_LINE>}<NEW_LINE>String serializedProof = DisclosedProofApi.proofSerialize(proofHandle).get();<NEW_LINE>Log.d(TAG, "Serialized proof: " + serializedProof);<NEW_LINE>DisclosedProofApi.proofRelease(proofHandle);<NEW_LINE>} catch (VcxException | ExecutionException | InterruptedException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>} | .currentThread().interrupt(); |
940,505 | private void checkForNewDevices() {<NEW_LINE>logger.debug("Refreshing Bluetooth device list...");<NEW_LINE>Set<String> newAddresses = new HashSet<>();<NEW_LINE>List<tinyb.BluetoothDevice> tinybDevices = adapter.getDevices();<NEW_LINE>logger.debug("Found {} Bluetooth devices.", tinybDevices.size());<NEW_LINE>synchronized (tinybDeviceCache) {<NEW_LINE>tinybDeviceCache.clear();<NEW_LINE>tinybDevices.stream().forEach(d -> tinybDeviceCache.put(d.getAddress(), d));<NEW_LINE>}<NEW_LINE>for (tinyb.BluetoothDevice tinybDevice : tinybDevices) {<NEW_LINE>synchronized (devices) {<NEW_LINE>newAddresses.add(tinybDevice.getAddress());<NEW_LINE>BlueZBluetoothDevice device = (BlueZBluetoothDevice) devices.get(tinybDevice.getAddress());<NEW_LINE>if (device == null) {<NEW_LINE>createAndRegisterBlueZDevice(tinybDevice);<NEW_LINE>} else {<NEW_LINE>device.updateTinybDevice(tinybDevice);<NEW_LINE>notifyDiscoveryListeners(device);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// clean up orphaned entries<NEW_LINE>synchronized (devices) {<NEW_LINE>Set<String<MASK><NEW_LINE>for (String address : oldAdresses) {<NEW_LINE>if (!newAddresses.contains(address)) {<NEW_LINE>devices.remove(address);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | > oldAdresses = devices.keySet(); |
954,427 | public void callOnStateEntry(String stateMachineId, StateContext<S, E> stateContext) {<NEW_LINE>if (!StringUtils.hasText(stateMachineId)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>List<StateMachineHandler<? extends Annotation, S, E>> handlersList = new ArrayList<StateMachineHandler<? extends Annotation<MASK><NEW_LINE>String cacheKey = OnStateEntry.class.getName() + "_" + stateMachineId;<NEW_LINE>List<CacheEntry> list = getCacheEntries(cacheKey);<NEW_LINE>if (list == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (CacheEntry entry : list) {<NEW_LINE>if (annotationHandlerSourceTargetMatch((String[]) AnnotationUtils.getValue(entry.metaAnnotation, "source"), (String[]) AnnotationUtils.getValue(entry.metaAnnotation, "target"), entry.annotation, stateContext.getSource(), stateContext.getTarget())) {<NEW_LINE>handlersList.add(entry.handler);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>getStateMachineHandlerResults(handlersList, stateContext);<NEW_LINE>} | , S, E>>(); |
552,679 | public RemoveThingFromThingGroupResult removeThingFromThingGroup(RemoveThingFromThingGroupRequest removeThingFromThingGroupRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(removeThingFromThingGroupRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RemoveThingFromThingGroupRequest> request = null;<NEW_LINE>Response<RemoveThingFromThingGroupResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RemoveThingFromThingGroupRequestMarshaller().marshall(removeThingFromThingGroupRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<RemoveThingFromThingGroupResult, JsonUnmarshallerContext> unmarshaller = new RemoveThingFromThingGroupResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<RemoveThingFromThingGroupResult> responseHandler = new JsonResponseHandler<RemoveThingFromThingGroupResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(<MASK><NEW_LINE>}<NEW_LINE>} | awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); |
360,397 | private boolean isUpdateMode(StateInstance stateInstance, ProcessContext context) {<NEW_LINE>DefaultStateMachineConfig stateMachineConfig = (DefaultStateMachineConfig) context.getVariable(DomainConstants.VAR_NAME_STATEMACHINE_CONFIG);<NEW_LINE>StateInstruction instruction = context.getInstruction(StateInstruction.class);<NEW_LINE>ServiceTaskStateImpl state = (ServiceTaskStateImpl) instruction.getState(context);<NEW_LINE>StateMachine stateMachine = stateInstance<MASK><NEW_LINE>if (StringUtils.hasLength(stateInstance.getStateIdRetriedFor())) {<NEW_LINE>if (null != state.isRetryPersistModeUpdate()) {<NEW_LINE>return state.isRetryPersistModeUpdate();<NEW_LINE>} else if (null != stateMachine.isRetryPersistModeUpdate()) {<NEW_LINE>return stateMachine.isRetryPersistModeUpdate();<NEW_LINE>}<NEW_LINE>return stateMachineConfig.isSagaRetryPersistModeUpdate();<NEW_LINE>} else if (StringUtils.hasLength(stateInstance.getStateIdCompensatedFor())) {<NEW_LINE>// find if this compensate has been executed<NEW_LINE>for (int i = 0; i < stateInstance.getStateMachineInstance().getStateList().size(); i++) {<NEW_LINE>StateInstance aStateInstance = stateInstance.getStateMachineInstance().getStateList().get(i);<NEW_LINE>if (aStateInstance.isForCompensation() && aStateInstance.getName().equals(stateInstance.getName())) {<NEW_LINE>if (null != state.isCompensatePersistModeUpdate()) {<NEW_LINE>return state.isCompensatePersistModeUpdate();<NEW_LINE>} else if (null != stateMachine.isCompensatePersistModeUpdate()) {<NEW_LINE>return stateMachine.isCompensatePersistModeUpdate();<NEW_LINE>}<NEW_LINE>return stateMachineConfig.isSagaCompensatePersistModeUpdate();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>} | .getStateMachineInstance().getStateMachine(); |
1,618,942 | CompletableFuture<Void> completeJob(MasterContext masterContext, Throwable error, long completionTime) {<NEW_LINE>return submitToCoordinatorThread(() -> {<NEW_LINE>// the order of operations is important.<NEW_LINE>List<RawJobMetrics> jobMetrics = masterContext.jobConfig().isStoreMetricsAfterJobCompletion() ? masterContext.jobContext<MASK><NEW_LINE>jobRepository.completeJob(masterContext, jobMetrics, error, completionTime);<NEW_LINE>if (removeMasterContext(masterContext)) {<NEW_LINE>completeObservables(masterContext.jobRecord().getOwnedObservables(), error);<NEW_LINE>logger.fine(masterContext.jobIdString() + " is completed");<NEW_LINE>(error == null ? jobCompletedSuccessfully : jobCompletedWithFailure).inc();<NEW_LINE>} else {<NEW_LINE>MasterContext existing = masterContexts.get(masterContext.jobId());<NEW_LINE>if (existing != null) {<NEW_LINE>logger.severe("Different master context found to complete " + masterContext.jobIdString() + ", master context execution " + idToString(existing.executionId()));<NEW_LINE>} else {<NEW_LINE>logger.severe("No master context found to complete " + masterContext.jobIdString());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>unscheduleJobTimeout(masterContext.jobId());<NEW_LINE>});<NEW_LINE>} | ().jobMetrics() : null; |
1,162,625 | public List<Writable> transformRawStringsToInputList(List<String> values) {<NEW_LINE>List<Writable> ret = new ArrayList<>();<NEW_LINE>if (values.size() != initialSchema.numColumns())<NEW_LINE>throw new IllegalArgumentException(String.format("Number of values %d does not match the number of input columns %d for schema", values.size(), initialSchema.numColumns()));<NEW_LINE>for (int i = 0; i < values.size(); i++) {<NEW_LINE>switch(initialSchema.getType(i)) {<NEW_LINE>case String:<NEW_LINE>ret.add(new Text(values.get(i)));<NEW_LINE>break;<NEW_LINE>case Integer:<NEW_LINE>ret.add(new IntWritable(Integer.parseInt(values.get(i))));<NEW_LINE>break;<NEW_LINE>case Double:<NEW_LINE>ret.add(new DoubleWritable(Double.parseDouble(values.get(i))));<NEW_LINE>break;<NEW_LINE>case Float:<NEW_LINE>ret.add(new FloatWritable(Float.parseFloat(values<MASK><NEW_LINE>break;<NEW_LINE>case Categorical:<NEW_LINE>ret.add(new Text(values.get(i)));<NEW_LINE>break;<NEW_LINE>case Boolean:<NEW_LINE>ret.add(new BooleanWritable(Boolean.parseBoolean(values.get(i))));<NEW_LINE>break;<NEW_LINE>case Time:<NEW_LINE>break;<NEW_LINE>case Long:<NEW_LINE>ret.add(new LongWritable(Long.parseLong(values.get(i))));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>} | .get(i)))); |
1,804,029 | private void initComponents() {<NEW_LINE>// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents<NEW_LINE>label4 = new JLabel();<NEW_LINE>label1 = new JLabel();<NEW_LINE>triStateCheckBox1 = new FlatTriStateCheckBox();<NEW_LINE>triStateLabel1 = new JLabel();<NEW_LINE>label2 = new JLabel();<NEW_LINE>svgIconsPanel = new JPanel();<NEW_LINE>label3 = new JLabel();<NEW_LINE>separator1 = new JSeparator();<NEW_LINE>label5 = new JLabel();<NEW_LINE>label6 = new JLabel();<NEW_LINE>rainbowIcon = new JLabel();<NEW_LINE>label7 = new JLabel();<NEW_LINE>redToggleButton = new JToggleButton();<NEW_LINE>brighterToggleButton = new JToggleButton();<NEW_LINE>// ======== this ========<NEW_LINE>setLayout(new // columns<NEW_LINE>MigLayout(// columns<NEW_LINE>"insets dialog,hidemode 3", // rows<NEW_LINE>"[]" + "[]" + "[left]", "[]para" + "[]" + "[]" + "[]" + "[]" + "[]" + "[]" + "[]"));<NEW_LINE>// ---- label4 ----<NEW_LINE>label4.setText("Note: Components on this page require the flatlaf-extras library.");<NEW_LINE>add(label4, "cell 0 0 3 1");<NEW_LINE>// ---- label1 ----<NEW_LINE>label1.setText("TriStateCheckBox:");<NEW_LINE>add(label1, "cell 0 1");<NEW_LINE>// ---- triStateCheckBox1 ----<NEW_LINE>triStateCheckBox1.setText("Three States");<NEW_LINE>triStateCheckBox1.addActionListener(e -> triStateCheckBox1Changed());<NEW_LINE>add(triStateCheckBox1, "cell 1 1");<NEW_LINE>// ---- triStateLabel1 ----<NEW_LINE>triStateLabel1.setText("text");<NEW_LINE>triStateLabel1.setEnabled(false);<NEW_LINE>add(triStateLabel1, "cell 2 1,gapx 30");<NEW_LINE>// ---- label2 ----<NEW_LINE>label2.setText("SVG Icons:");<NEW_LINE>add(label2, "cell 0 2");<NEW_LINE>// ======== svgIconsPanel ========<NEW_LINE>{<NEW_LINE>svgIconsPanel.setLayout(new // columns<NEW_LINE>MigLayout(// columns<NEW_LINE>"insets 0,hidemode 3", // rows<NEW_LINE>"[fill]", "[grow,center]"));<NEW_LINE>}<NEW_LINE>add(svgIconsPanel, "cell 1 2 2 1");<NEW_LINE>// ---- label3 ----<NEW_LINE>label3.setText("The icons may change colors when switching to another theme.");<NEW_LINE>add(label3, "cell 1 3 2 1");<NEW_LINE>add(separator1, "cell 1 4 2 1,growx");<NEW_LINE>// ---- label5 ----<NEW_LINE>label5.setText("Color filters can be also applied to icons. Globally or for each instance.");<NEW_LINE>add(label5, "cell 1 5 2 1");<NEW_LINE>// ---- label6 ----<NEW_LINE>label6.setText("Rainbow color filter");<NEW_LINE>add(label6, "cell 1 6 2 1");<NEW_LINE>add(rainbowIcon, "cell 1 6 2 1");<NEW_LINE>// ---- label7 ----<NEW_LINE>label7.setText("Global icon color filter");<NEW_LINE>add(label7, "cell 1 7 2 1");<NEW_LINE>// ---- redToggleButton ----<NEW_LINE>redToggleButton.setText("Toggle RED");<NEW_LINE>redToggleButton.addActionListener(e -> redChanged());<NEW_LINE>add(redToggleButton, "cell 1 7 2 1");<NEW_LINE>// ---- brighterToggleButton ----<NEW_LINE>brighterToggleButton.setText("Toggle brighter");<NEW_LINE>brighterToggleButton.<MASK><NEW_LINE>add(brighterToggleButton, "cell 1 7 2 1");<NEW_LINE>// JFormDesigner - End of component initialization //GEN-END:initComponents<NEW_LINE>} | addActionListener(e -> brighterChanged()); |
170,749 | protected Control createDialogArea(Composite parent) {<NEW_LINE>Composite composite = (Composite) super.createDialogArea(parent);<NEW_LINE>Font font = parent.getFont();<NEW_LINE>Label label = new Label(composite, SWT.NONE);<NEW_LINE>label.setText(Messages.DetailFormatterDialog_QualifiedTypeName);<NEW_LINE>GridDataFactory.swtDefaults().applyTo(label);<NEW_LINE>label.setFont(font);<NEW_LINE>Composite container = new Composite(composite, SWT.NONE);<NEW_LINE>GridDataFactory.fillDefaults().grab(true, false).applyTo(container);<NEW_LINE>container.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).create());<NEW_LINE>typeName = new Text(container, SWT.SINGLE | SWT.BORDER);<NEW_LINE>GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(typeName);<NEW_LINE>typeName.setEditable(editTypeName);<NEW_LINE>typeName.setText(formatter.getTypeName());<NEW_LINE>typeName.setFont(font);<NEW_LINE>Button searchButton = new Button(container, SWT.PUSH);<NEW_LINE>GridDataFactory.swtDefaults().align(SWT.RIGHT, SWT.CENTER).hint(Math.max(convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH), searchButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true).x), SWT.DEFAULT).applyTo(searchButton);<NEW_LINE>searchButton.setText(StringUtil.ellipsify(Messages.DetailFormatterDialog_SelectNType));<NEW_LINE>searchButton.setEnabled(editTypeName);<NEW_LINE>searchButton.setFont(font);<NEW_LINE>label = new Label(composite, SWT.NONE);<NEW_LINE>label.setText(Messages.DetailFormatterDialog_DetailFormatterCodeSnippet);<NEW_LINE>GridDataFactory.swtDefaults().applyTo(label);<NEW_LINE>label.setFont(font);<NEW_LINE>snippetViewer = new SourceViewer(composite, null, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);<NEW_LINE>GridDataFactory.fillDefaults().grab(true, true).hint(convertWidthInCharsToPixels(80), convertHeightInCharsToPixels(10)).applyTo(snippetViewer.getControl());<NEW_LINE>enabled = new Button(composite, SWT.CHECK | SWT.LEFT);<NEW_LINE>enabled.setText(Messages.DetailFormatterDialog_Enable);<NEW_LINE>GridDataFactory.<MASK><NEW_LINE>enabled.setFont(font);<NEW_LINE>typeName.addModifyListener(new ModifyListener() {<NEW_LINE><NEW_LINE>public void modifyText(ModifyEvent e) {<NEW_LINE>checkValues();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>searchButton.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>selectType();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>snippetViewer.setInput(this);<NEW_LINE>snippetViewer.setEditable(true);<NEW_LINE>snippetViewer.setDocument(new Document(formatter.getSnippet()));<NEW_LINE>snippetViewer.getDocument().addDocumentListener(new IDocumentListener() {<NEW_LINE><NEW_LINE>public void documentAboutToBeChanged(DocumentEvent event) {<NEW_LINE>}<NEW_LINE><NEW_LINE>public void documentChanged(DocumentEvent event) {<NEW_LINE>checkValues();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>if (formatter.getTypeName().length() > 0) {<NEW_LINE>snippetViewer.getControl().setFocus();<NEW_LINE>}<NEW_LINE>enabled.setSelection(formatter.isEnabled());<NEW_LINE>checkValues();<NEW_LINE>PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, IDebugHelpContextIds.EDIT_DETAIL_FORMATTER_DIALOG);<NEW_LINE>return composite;<NEW_LINE>} | swtDefaults().applyTo(enabled); |
1,379,891 | void solveElastic(final TimeStep step) {<NEW_LINE><MASK><NEW_LINE>for (int k = 0; k < m_triadCount; k++) {<NEW_LINE>final Triad triad = m_triadBuffer[k];<NEW_LINE>if ((triad.flags & ParticleType.b2_elasticParticle) != 0) {<NEW_LINE>int a = triad.indexA;<NEW_LINE>int b = triad.indexB;<NEW_LINE>int c = triad.indexC;<NEW_LINE>final Vec2 oa = triad.pa;<NEW_LINE>final Vec2 ob = triad.pb;<NEW_LINE>final Vec2 oc = triad.pc;<NEW_LINE>final Vec2 pa = m_positionBuffer.data[a];<NEW_LINE>final Vec2 pb = m_positionBuffer.data[b];<NEW_LINE>final Vec2 pc = m_positionBuffer.data[c];<NEW_LINE>final float px = 1f / 3 * (pa.x + pb.x + pc.x);<NEW_LINE>final float py = 1f / 3 * (pa.y + pb.y + pc.y);<NEW_LINE>float rs = Vec2.cross(oa, pa) + Vec2.cross(ob, pb) + Vec2.cross(oc, pc);<NEW_LINE>float rc = Vec2.dot(oa, pa) + Vec2.dot(ob, pb) + Vec2.dot(oc, pc);<NEW_LINE>float r2 = rs * rs + rc * rc;<NEW_LINE>float invR = r2 == 0 ? Float.MAX_VALUE : MathUtils.sqrt(1f / r2);<NEW_LINE>rs *= invR;<NEW_LINE>rc *= invR;<NEW_LINE>final float strength = elasticStrength * triad.strength;<NEW_LINE>final float roax = rc * oa.x - rs * oa.y;<NEW_LINE>final float roay = rs * oa.x + rc * oa.y;<NEW_LINE>final float robx = rc * ob.x - rs * ob.y;<NEW_LINE>final float roby = rs * ob.x + rc * ob.y;<NEW_LINE>final float rocx = rc * oc.x - rs * oc.y;<NEW_LINE>final float rocy = rs * oc.x + rc * oc.y;<NEW_LINE>final Vec2 va = m_velocityBuffer.data[a];<NEW_LINE>final Vec2 vb = m_velocityBuffer.data[b];<NEW_LINE>final Vec2 vc = m_velocityBuffer.data[c];<NEW_LINE>va.x += strength * (roax - (pa.x - px));<NEW_LINE>va.y += strength * (roay - (pa.y - py));<NEW_LINE>vb.x += strength * (robx - (pb.x - px));<NEW_LINE>vb.y += strength * (roby - (pb.y - py));<NEW_LINE>vc.x += strength * (rocx - (pc.x - px));<NEW_LINE>vc.y += strength * (rocy - (pc.y - py));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | float elasticStrength = step.inv_dt * m_elasticStrength; |
588,129 | void updateFontMenuItems() {<NEW_LINE>if (initialFontMenuItemCount < 0)<NEW_LINE>initialFontMenuItemCount = fontMenu.getItemCount();<NEW_LINE>else {<NEW_LINE>// remove old font items<NEW_LINE>for (int i = fontMenu.getItemCount() - 1; i >= initialFontMenuItemCount; i--) fontMenu.remove(i);<NEW_LINE>}<NEW_LINE>// get current font<NEW_LINE>Font <MASK><NEW_LINE>String currentFamily = currentFont.getFamily();<NEW_LINE>String currentSize = Integer.toString(currentFont.getSize());<NEW_LINE>// add font families<NEW_LINE>fontMenu.addSeparator();<NEW_LINE>ArrayList<String> families = new ArrayList<>(Arrays.asList("Arial", "Cantarell", "Comic Sans MS", "Courier New", "DejaVu Sans", "Dialog", "Liberation Sans", "Monospaced", "Noto Sans", "Roboto", "SansSerif", "Segoe UI", "Serif", "Tahoma", "Ubuntu", "Verdana"));<NEW_LINE>if (!families.contains(currentFamily))<NEW_LINE>families.add(currentFamily);<NEW_LINE>families.sort(String.CASE_INSENSITIVE_ORDER);<NEW_LINE>ButtonGroup familiesGroup = new ButtonGroup();<NEW_LINE>for (String family : families) {<NEW_LINE>if (Arrays.binarySearch(availableFontFamilyNames, family) < 0)<NEW_LINE>// not available<NEW_LINE>continue;<NEW_LINE>JCheckBoxMenuItem item = new JCheckBoxMenuItem(family);<NEW_LINE>item.setSelected(family.equals(currentFamily));<NEW_LINE>item.addActionListener(this::fontFamilyChanged);<NEW_LINE>fontMenu.add(item);<NEW_LINE>familiesGroup.add(item);<NEW_LINE>}<NEW_LINE>// add font sizes<NEW_LINE>fontMenu.addSeparator();<NEW_LINE>ArrayList<String> sizes = new ArrayList<>(Arrays.asList("10", "11", "12", "14", "16", "18", "20", "24", "28"));<NEW_LINE>if (!sizes.contains(currentSize))<NEW_LINE>sizes.add(currentSize);<NEW_LINE>sizes.sort(String.CASE_INSENSITIVE_ORDER);<NEW_LINE>ButtonGroup sizesGroup = new ButtonGroup();<NEW_LINE>for (String size : sizes) {<NEW_LINE>JCheckBoxMenuItem item = new JCheckBoxMenuItem(size);<NEW_LINE>item.setSelected(size.equals(currentSize));<NEW_LINE>item.addActionListener(this::fontSizeChanged);<NEW_LINE>fontMenu.add(item);<NEW_LINE>sizesGroup.add(item);<NEW_LINE>}<NEW_LINE>// enabled/disable items<NEW_LINE>boolean enabled = UIManager.getLookAndFeel() instanceof FlatLaf;<NEW_LINE>for (Component item : fontMenu.getMenuComponents()) item.setEnabled(enabled);<NEW_LINE>} | currentFont = UIManager.getFont("Label.font"); |
666,578 | public JasperPrint fill(Map<String, Object> parameterValues) throws JRException {<NEW_LINE>// FIXMEBOOK copied from JRBaseFiller<NEW_LINE>if (parameterValues == null) {<NEW_LINE>parameterValues = new HashMap<>();<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Fill " + fillerId + ": filling report");<NEW_LINE>}<NEW_LINE>setParametersToContext(parameterValues);<NEW_LINE>fillingThread = Thread.currentThread();<NEW_LINE>JRResourcesFillUtil.ResourcesFillContext resourcesContext = JRResourcesFillUtil.setResourcesFillContext(parameterValues);<NEW_LINE>boolean success = false;<NEW_LINE>try {<NEW_LINE>createBoundElemementMaps();<NEW_LINE>setParameters(parameterValues);<NEW_LINE>setBookmarkHelper();<NEW_LINE>// loadStyles();<NEW_LINE>jasperPrint.setName(jasperReport.getName());<NEW_LINE>jasperPrint.setPageWidth(jasperReport.getPageWidth());<NEW_LINE>jasperPrint.setPageHeight(jasperReport.getPageHeight());<NEW_LINE>jasperPrint.setTopMargin(jasperReport.getTopMargin());<NEW_LINE>jasperPrint.setLeftMargin(jasperReport.getLeftMargin());<NEW_LINE>jasperPrint.setBottomMargin(jasperReport.getBottomMargin());<NEW_LINE>jasperPrint.setRightMargin(jasperReport.getRightMargin());<NEW_LINE>jasperPrint.setOrientation(jasperReport.getOrientationValue());<NEW_LINE>jasperPrint.setFormatFactoryClass(jasperReport.getFormatFactoryClass());<NEW_LINE>jasperPrint.setLocaleCode(JRDataUtils.getLocaleCode(getLocale()));<NEW_LINE>jasperPrint.setTimeZoneId(JRDataUtils<MASK><NEW_LINE>propertiesUtil.transferProperties(mainDataset, jasperPrint, JasperPrint.PROPERTIES_PRINT_TRANSFER_PREFIX);<NEW_LINE>fillReport();<NEW_LINE>if (bookmarkHelper != null) {<NEW_LINE>jasperPrint.setBookmarks(bookmarkHelper.getRootBookmarks());<NEW_LINE>}<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug("Fill " + fillerId + ": ended");<NEW_LINE>}<NEW_LINE>success = true;<NEW_LINE>return jasperPrint;<NEW_LINE>} finally {<NEW_LINE>mainDataset.closeDatasource();<NEW_LINE>mainDataset.disposeParameterContributors();<NEW_LINE>if (success && parent == null) {<NEW_LINE>// commit the cached data<NEW_LINE>fillContext.cacheDone();<NEW_LINE>}<NEW_LINE>delayedActions.dispose();<NEW_LINE>fillingThread = null;<NEW_LINE>// kill the subreport filler threads<NEW_LINE>// killSubfillerThreads();<NEW_LINE>if (parent == null) {<NEW_LINE>fillContext.dispose();<NEW_LINE>}<NEW_LINE>JRResourcesFillUtil.revertResourcesFillContext(resourcesContext);<NEW_LINE>}<NEW_LINE>} | .getTimeZoneId(getTimeZone())); |
1,754,781 | public Object instanceCreate() throws IOException, ClassNotFoundException {<NEW_LINE>try {<NEW_LINE>Document doc = XMLUtil.parse(new InputSource(obj.getPrimaryFile().toURL().toString()), true, false, XMLUtil.defaultErrorHandler(), EntityCatalog.getDefault());<NEW_LINE><MASK><NEW_LINE>if (!el.getNodeName().equals("helpsetref")) {<NEW_LINE>// NOI18N<NEW_LINE>throw new IOException();<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>String url = el.getAttribute("url");<NEW_LINE>if (url == null || url.isEmpty()) {<NEW_LINE>throw new IOException("no url attr on <helpsetref>! doc.class=" + doc.getClass().getName() + " doc.documentElement=" + el);<NEW_LINE>}<NEW_LINE>// NOI18N<NEW_LINE>String mergeS = el.getAttribute("merge");<NEW_LINE>boolean merge = mergeS.isEmpty() || Boolean.valueOf(mergeS);<NEW_LINE>// Make sure nbdocs: protocol is ready:<NEW_LINE>// DO NOT DELETE THIS LINE<NEW_LINE>Object ignore = NbDocsStreamHandler.class;<NEW_LINE>HelpSet hs = new HelpSet(Lookup.getDefault().lookup(ClassLoader.class), new URL(url));<NEW_LINE>hs.setKeyData(HELPSET_MERGE_CONTEXT, HELPSET_MERGE_ATTR, merge);<NEW_LINE>return hs;<NEW_LINE>} catch (IOException x) {<NEW_LINE>throw x;<NEW_LINE>} catch (Exception x) {<NEW_LINE>throw new IOException(x);<NEW_LINE>}<NEW_LINE>} | Element el = doc.getDocumentElement(); |
1,000,847 | public ExpenseType unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ExpenseType expenseType = new ExpenseType();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Text", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>expenseType.setText(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Confidence", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>expenseType.setConfidence(context.getUnmarshaller(Float.<MASK><NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return expenseType;<NEW_LINE>} | class).unmarshall(context)); |
305,568 | private void applyDefaultContentTypes(CodegenOperation op) {<NEW_LINE>if (op.bodyParam != null && !op.hasConsumes) {<NEW_LINE>CodegenParameter bodyParam = op.bodyParam;<NEW_LINE>String mediaType;<NEW_LINE>if (bodyParam.isContainer || bodyParam.isModel || bodyParam.isFreeFormObject)<NEW_LINE>mediaType = "application/json";<NEW_LINE>else if (bodyParam.isBinary || bodyParam.isFile)<NEW_LINE>mediaType = "application/octet-stream";<NEW_LINE>else<NEW_LINE>mediaType = "text/plain";<NEW_LINE>Map<String, String> contentType = new HashMap<>();<NEW_LINE>contentType.put("mediaType", mediaType);<NEW_LINE>if (op.consumes == null)<NEW_LINE>op.consumes = new ArrayList<>();<NEW_LINE>op.consumes.add(contentType);<NEW_LINE>op.hasConsumes = true;<NEW_LINE>}<NEW_LINE>if (!"void".equals(op.returnType) && !op.hasProduces) {<NEW_LINE>String mediaType;<NEW_LINE>if (op.returnContainer != null || !op.returnTypeIsPrimitive)<NEW_LINE>mediaType = "application/json";<NEW_LINE>else<NEW_LINE>mediaType = "text/plain";<NEW_LINE>Map<String, String> contentType = new HashMap<>();<NEW_LINE>contentType.put("mediaType", mediaType);<NEW_LINE>if (op.produces == null)<NEW_LINE>op.produces = new ArrayList<>();<NEW_LINE><MASK><NEW_LINE>op.hasProduces = true;<NEW_LINE>}<NEW_LINE>} | op.produces.add(contentType); |
472,163 | private AutowiredArguments resolveArguments(RegisteredBean registeredBean, Method method) {<NEW_LINE>String beanName = registeredBean.getBeanName();<NEW_LINE>Class<?> beanClass = registeredBean.getBeanClass();<NEW_LINE>ConfigurableBeanFactory beanFactory = registeredBean.getBeanFactory();<NEW_LINE>Assert.isInstanceOf(AutowireCapableBeanFactory.class, beanFactory);<NEW_LINE>AutowireCapableBeanFactory autowireCapableBeanFactory = (AutowireCapableBeanFactory) beanFactory;<NEW_LINE>int argumentCount = method.getParameterCount();<NEW_LINE>Object[] arguments = new Object[argumentCount];<NEW_LINE>Set<String> autowiredBeanNames = new LinkedHashSet<>(argumentCount);<NEW_LINE>TypeConverter typeConverter = beanFactory.getTypeConverter();<NEW_LINE>for (int i = 0; i < argumentCount; i++) {<NEW_LINE>MethodParameter parameter = new MethodParameter(method, i);<NEW_LINE>DependencyDescriptor descriptor = new DependencyDescriptor(parameter, this.required);<NEW_LINE>descriptor.setContainingClass(beanClass);<NEW_LINE>String shortcut = (this.shortcuts != null) ? this.shortcuts[i] : null;<NEW_LINE>if (shortcut != null) {<NEW_LINE>descriptor = new ShortcutDependencyDescriptor(descriptor, shortcut, parameter.getParameterType());<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Object argument = autowireCapableBeanFactory.resolveDependency(descriptor, beanName, autowiredBeanNames, typeConverter);<NEW_LINE>if (argument == null && !this.required) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>arguments[i] = argument;<NEW_LINE>} catch (BeansException ex) {<NEW_LINE>throw new UnsatisfiedDependencyException(null, beanName, new InjectionPoint(parameter), ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>return AutowiredArguments.of(arguments);<NEW_LINE>} | registerDependentBeans(beanFactory, beanName, autowiredBeanNames); |
840,580 | private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>jLabel1 = new javax.swing.JLabel();<NEW_LINE>jScrollPane1 = new javax.swing.JScrollPane();<NEW_LINE>jLabel1.setText(text);<NEW_LINE>filesList.setModel(new javax.swing.AbstractListModel() {<NEW_LINE><NEW_LINE>String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };<NEW_LINE><NEW_LINE>public int getSize() {<NEW_LINE>return strings.length;<NEW_LINE>}<NEW_LINE><NEW_LINE>public Object getElementAt(int i) {<NEW_LINE>return strings[i];<NEW_LINE>}<NEW_LINE>});<NEW_LINE>filesList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);<NEW_LINE>jScrollPane1.setViewportView(filesList);<NEW_LINE>javax.swing.GroupLayout layout = new <MASK><NEW_LINE>this.setLayout(layout);<NEW_LINE>layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 606, Short.MAX_VALUE).addComponent(jLabel1)).addContainerGap()));<NEW_LINE>layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addComponent(jLabel1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 109, Short.MAX_VALUE).addContainerGap()));<NEW_LINE>} | javax.swing.GroupLayout(this); |
1,222,899 | final GetDomainPermissionsPolicyResult executeGetDomainPermissionsPolicy(GetDomainPermissionsPolicyRequest getDomainPermissionsPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDomainPermissionsPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDomainPermissionsPolicyRequest> request = null;<NEW_LINE>Response<GetDomainPermissionsPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetDomainPermissionsPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getDomainPermissionsPolicyRequest));<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, "codeartifact");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDomainPermissionsPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDomainPermissionsPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDomainPermissionsPolicyResultJsonUnmarshaller());<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); |
444,778 | private void fillTableRows(File dir, String reqURI, PrintWriter out) {<NEW_LINE>File[] files = dir.listFiles();<NEW_LINE>int fc = 0;<NEW_LINE>Date date;<NEW_LINE>// for each file, output a table row<NEW_LINE>while (fc < files.length) {<NEW_LINE>if (files[fc].isDirectory()) {<NEW_LINE>// it's a directory...make sure it's not a configuration dir<NEW_LINE>if (files[fc].getName().equalsIgnoreCase("META-INF") || files[fc].getName().equalsIgnoreCase("WEB-INF")) {<NEW_LINE>fc++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>date = new Date(files[fc].lastModified());<NEW_LINE><MASK><NEW_LINE>printDirectory(out, reqURI, files[fc].getName(), lastModifiedDateString);<NEW_LINE>} else {<NEW_LINE>// it's a file...make sure it's not a jsp type<NEW_LINE>if (files[fc].getName().endsWith(".jsp") || files[fc].getName().endsWith(".jsv") || files[fc].getName().endsWith(".jsw")) {<NEW_LINE>fc++;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>date = new Date(files[fc].lastModified());<NEW_LINE>String lastModifiedDateString = date.toString();<NEW_LINE>printFile(out, reqURI, files[fc].getName(), files[fc].length(), lastModifiedDateString);<NEW_LINE>}<NEW_LINE>// increment file counter for while<NEW_LINE>fc++;<NEW_LINE>}<NEW_LINE>} | String lastModifiedDateString = date.toString(); |
1,748,851 | ResourceResponse<Document> updateContainerDeletionEntry(short containerId, short accountId, BiConsumer<Document, AtomicBoolean> updateFields) throws DocumentClientException {<NEW_LINE>// Read the existing record<NEW_LINE>String id = CosmosContainerDeletionEntry.generateContainerDeletionEntryId(accountId, containerId);<NEW_LINE>String docLink = getContainerDeletionEntryDocumentLink(id);<NEW_LINE>RequestOptions options = getRequestOptions(id);<NEW_LINE>ResourceResponse<Document> readResponse = executeCosmosAction(() -> asyncDocumentClient.readDocument(docLink, options).toBlocking().single(), azureMetrics.continerDeletionEntryReadTime);<NEW_LINE>Document doc = readResponse.getResource();<NEW_LINE>AtomicBoolean fieldsChanged = new AtomicBoolean(false);<NEW_LINE>updateFields.accept(doc, fieldsChanged);<NEW_LINE>if (!fieldsChanged.get()) {<NEW_LINE>logger.debug("No change in value for container deletion entry {}", doc.toJson());<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>// For testing conflict handling<NEW_LINE>if (updateCallback != null) {<NEW_LINE>try {<NEW_LINE>updateCallback.call();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>logger.error("Error in update callback", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Set condition to ensure we don't clobber a concurrent update<NEW_LINE>AccessCondition accessCondition = new AccessCondition();<NEW_LINE>accessCondition.<MASK><NEW_LINE>options.setAccessCondition(accessCondition);<NEW_LINE>try {<NEW_LINE>return executeCosmosAction(() -> asyncDocumentClient.replaceDocument(doc, options).toBlocking().single(), azureMetrics.documentUpdateTime);<NEW_LINE>} catch (DocumentClientException e) {<NEW_LINE>if (e.getStatusCode() == HttpConstants.StatusCodes.PRECONDITION_FAILED) {<NEW_LINE>azureMetrics.blobUpdateConflictCount.inc();<NEW_LINE>}<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>} | setCondition(doc.getETag()); |
1,112,477 | public ImmutableSetMultimap<String, String> describe(Glob destinationFiles) {<NEW_LINE>ImmutableSetMultimap.Builder<String, String> builder = new ImmutableSetMultimap.Builder<String, String>().put("type", getType()).put("url", repoUrl).put("fetch", fetch).put("push", push).put("primaryBranchMigrationMode", "" + primaryBranchMigrationMode);<NEW_LINE>builder.putAll(writerHook.describe());<NEW_LINE>if (!destinationFiles.roots().isEmpty() && !destinationFiles.roots().contains("")) {<NEW_LINE>builder.putAll("root", destinationFiles.roots());<NEW_LINE>}<NEW_LINE>if (partialFetch) {<NEW_LINE>builder.put("partialFetch"<MASK><NEW_LINE>}<NEW_LINE>if (tagName != null) {<NEW_LINE>builder.put("tagName", tagName);<NEW_LINE>}<NEW_LINE>if (tagMsg != null) {<NEW_LINE>builder.put("tagMsg", tagMsg);<NEW_LINE>}<NEW_LINE>if (checker != null) {<NEW_LINE>builder.put("checker", checker.getClass().getName());<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>} | , Boolean.toString(partialFetch)); |
135,767 | public // to set vars passed up to ClassLoader.definePackage.<NEW_LINE>Package definePackage(String name, Manifest manifest, URL sealBase) throws IllegalArgumentException {<NEW_LINE>Attributes mA = manifest.getMainAttributes();<NEW_LINE>String specTitle = mA.getValue(Name.SPECIFICATION_TITLE);<NEW_LINE>String specVersion = mA.getValue(Name.SPECIFICATION_VERSION);<NEW_LINE>String specVendor = mA.getValue(Name.SPECIFICATION_VENDOR);<NEW_LINE>String implTitle = mA.getValue(Name.IMPLEMENTATION_TITLE);<NEW_LINE>String implVersion = mA.getValue(Name.IMPLEMENTATION_VERSION);<NEW_LINE>String implVendor = <MASK><NEW_LINE>String sealedString = mA.getValue(Name.SEALED);<NEW_LINE>Boolean sealed = (sealedString == null ? Boolean.FALSE : sealedString.equalsIgnoreCase("true"));<NEW_LINE>// now overwrite global attributes with the specific attributes<NEW_LINE>// replace all dots with slash and add trailing slash<NEW_LINE>String unixName = name.replaceAll("\\.", "/") + "/";<NEW_LINE>mA = manifest.getAttributes(unixName);<NEW_LINE>if (mA != null) {<NEW_LINE>String s = mA.getValue(Name.SPECIFICATION_TITLE);<NEW_LINE>if (s != null)<NEW_LINE>specTitle = s;<NEW_LINE>s = mA.getValue(Name.SPECIFICATION_VERSION);<NEW_LINE>if (s != null)<NEW_LINE>specVersion = s;<NEW_LINE>s = mA.getValue(Name.SPECIFICATION_VENDOR);<NEW_LINE>if (s != null)<NEW_LINE>specVendor = s;<NEW_LINE>s = mA.getValue(Name.IMPLEMENTATION_TITLE);<NEW_LINE>if (s != null)<NEW_LINE>implTitle = s;<NEW_LINE>s = mA.getValue(Name.IMPLEMENTATION_VERSION);<NEW_LINE>if (s != null)<NEW_LINE>implVersion = s;<NEW_LINE>s = mA.getValue(Name.IMPLEMENTATION_VENDOR);<NEW_LINE>if (s != null)<NEW_LINE>implVendor = s;<NEW_LINE>s = mA.getValue(Name.SEALED);<NEW_LINE>if (s != null)<NEW_LINE>sealed = s.equalsIgnoreCase("true");<NEW_LINE>}<NEW_LINE>if (!sealed)<NEW_LINE>sealBase = null;<NEW_LINE>return definePackage(name, specTitle, specVersion, specVendor, implTitle, implVersion, implVendor, sealBase);<NEW_LINE>} | mA.getValue(Name.IMPLEMENTATION_VENDOR); |
732,471 | private static Span.TimeEvents toTimeEventsProto(TimedEvents<Annotation> annotationTimedEvents, TimedEvents<io.opencensus.trace.MessageEvent> messageEventTimedEvents) {<NEW_LINE>Span.TimeEvents.Builder timeEventsBuilder <MASK><NEW_LINE>timeEventsBuilder.setDroppedAnnotationsCount(annotationTimedEvents.getDroppedEventsCount());<NEW_LINE>for (TimedEvent<Annotation> annotation : annotationTimedEvents.getEvents()) {<NEW_LINE>timeEventsBuilder.addTimeEvent(toTimeAnnotationProto(annotation));<NEW_LINE>}<NEW_LINE>timeEventsBuilder.setDroppedMessageEventsCount(messageEventTimedEvents.getDroppedEventsCount());<NEW_LINE>for (TimedEvent<io.opencensus.trace.MessageEvent> networkEvent : messageEventTimedEvents.getEvents()) {<NEW_LINE>timeEventsBuilder.addTimeEvent(toTimeMessageEventProto(networkEvent));<NEW_LINE>}<NEW_LINE>return timeEventsBuilder.build();<NEW_LINE>} | = Span.TimeEvents.newBuilder(); |
628,365 | final CreateContactResult executeCreateContact(CreateContactRequest createContactRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createContactRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateContactRequest> request = null;<NEW_LINE>Response<CreateContactResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateContactRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createContactRequest));<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, "Alexa For Business");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateContact");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateContactResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateContactResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
1,761,293 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>Spell spell = (Spell) this.getValue("spellCast");<NEW_LINE>if (player == null || spell == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>List<Predicate<Permanent>> predicates = spell.getSpellAbility().getModes().values().stream().map(Mode::getTargets).flatMap(Collection::stream).map(Target::getTargets).flatMap(Collection::stream).map(game::getPermanent).filter(Objects::nonNull).map(MageItem::getId).map(PermanentIdPredicate::new).collect(Collectors.toList());<NEW_LINE>if (predicates.isEmpty()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>FilterPermanent filter = new FilterControlledPermanent("a permanent you control targeted by that spell");<NEW_LINE>filter.add(Predicates.or(predicates));<NEW_LINE>filter.add(Predicates.not(new MageObjectReferencePredicate(new MageObjectReference(source))));<NEW_LINE><MASK><NEW_LINE>target.setNotTarget(true);<NEW_LINE>player.choose(outcome, target, source, game);<NEW_LINE>return new CreateTokenCopyTargetEffect().setTargetPointer(new FixedTarget(target.getFirstTarget(), game)).apply(game, source);<NEW_LINE>} | TargetPermanent target = new TargetPermanent(filter); |
602,820 | public static String convertToAlphaNumericFormat(String timeZoneId) {<NEW_LINE>java.util.TimeZone zone = java.util.TimeZone.getTimeZone(timeZoneId);<NEW_LINE>int offset = zone.getRawOffset() / 1000;<NEW_LINE>int hour = offset / 3600;<NEW_LINE>int min = Math.abs(<MASK><NEW_LINE>DateFormat dfm = new SimpleDateFormat("z");<NEW_LINE>dfm.setTimeZone(zone);<NEW_LINE>boolean hasDaylight = zone.useDaylightTime();<NEW_LINE>String first = dfm.format(new GregorianCalendar(2010, 1, 1).getTime()).substring(0, 3);<NEW_LINE>String second = dfm.format(new GregorianCalendar(2011, 6, 6).getTime()).substring(0, 3);<NEW_LINE>int mid = hour * -1;<NEW_LINE>String result = first + Integer.toString(mid);<NEW_LINE>if (min != 0) {<NEW_LINE>result = result + ":" + Integer.toString(min);<NEW_LINE>}<NEW_LINE>if (hasDaylight) {<NEW_LINE>result += second;<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>} | (offset % 3600) / 60); |
155,775 | public DelimitedLineTokenizer build() {<NEW_LINE>Assert.notNull(this.fieldSetFactory, "A FieldSetFactory is required.");<NEW_LINE>Assert.notEmpty(this.names, "A list of field names is required");<NEW_LINE>DelimitedLineTokenizer tokenizer = new DelimitedLineTokenizer();<NEW_LINE>tokenizer.setNames(this.names.toArray(new String[this.names.size()]));<NEW_LINE>if (StringUtils.hasLength(this.delimiter)) {<NEW_LINE>tokenizer.setDelimiter(this.delimiter);<NEW_LINE>}<NEW_LINE>if (this.quoteCharacter != null) {<NEW_LINE>tokenizer.setQuoteCharacter(this.quoteCharacter);<NEW_LINE>}<NEW_LINE>if (!this.includedFields.isEmpty()) {<NEW_LINE>Set<Integer> deDupedFields = new HashSet<>(<MASK><NEW_LINE>deDupedFields.addAll(this.includedFields);<NEW_LINE>deDupedFields.remove(null);<NEW_LINE>int[] fields = new int[deDupedFields.size()];<NEW_LINE>Iterator<Integer> iterator = deDupedFields.iterator();<NEW_LINE>for (int i = 0; i < fields.length; i++) {<NEW_LINE>fields[i] = iterator.next();<NEW_LINE>}<NEW_LINE>tokenizer.setIncludedFields(fields);<NEW_LINE>}<NEW_LINE>tokenizer.setFieldSetFactory(this.fieldSetFactory);<NEW_LINE>tokenizer.setStrict(this.strict);<NEW_LINE>try {<NEW_LINE>tokenizer.afterPropertiesSet();<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new IllegalStateException("Unable to initialize DelimitedLineTokenizer", e);<NEW_LINE>}<NEW_LINE>return tokenizer;<NEW_LINE>} | this.includedFields.size()); |
1,341,048 | public LaunchTemplateElasticInferenceAcceleratorResponse unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>LaunchTemplateElasticInferenceAcceleratorResponse launchTemplateElasticInferenceAcceleratorResponse = new LaunchTemplateElasticInferenceAcceleratorResponse();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>XMLEvent xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent.isEndDocument())<NEW_LINE>return launchTemplateElasticInferenceAcceleratorResponse;<NEW_LINE>if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) {<NEW_LINE>if (context.testExpression("type", targetDepth)) {<NEW_LINE>launchTemplateElasticInferenceAcceleratorResponse.setType(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("count", targetDepth)) {<NEW_LINE>launchTemplateElasticInferenceAcceleratorResponse.setCount(IntegerStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent.isEndElement()) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return launchTemplateElasticInferenceAcceleratorResponse;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | ().unmarshall(context)); |
1,846,670 | public Request<ListStacksRequest> marshall(ListStacksRequest listStacksRequest) {<NEW_LINE>if (listStacksRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ListStacksRequest> request = new DefaultRequest<ListStacksRequest>(listStacksRequest, "AmazonCloudFormation");<NEW_LINE><MASK><NEW_LINE>request.addParameter("Version", "2010-05-15");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (listStacksRequest.getNextToken() != null) {<NEW_LINE>request.addParameter("NextToken", StringUtils.fromString(listStacksRequest.getNextToken()));<NEW_LINE>}<NEW_LINE>if (listStacksRequest.getStackStatusFilters().isEmpty() && !((com.amazonaws.internal.SdkInternalList<String>) listStacksRequest.getStackStatusFilters()).isAutoConstruct()) {<NEW_LINE>request.addParameter("StackStatusFilter", "");<NEW_LINE>}<NEW_LINE>if (!listStacksRequest.getStackStatusFilters().isEmpty() || !((com.amazonaws.internal.SdkInternalList<String>) listStacksRequest.getStackStatusFilters()).isAutoConstruct()) {<NEW_LINE>com.amazonaws.internal.SdkInternalList<String> stackStatusFiltersList = (com.amazonaws.internal.SdkInternalList<String>) listStacksRequest.getStackStatusFilters();<NEW_LINE>int stackStatusFiltersListIndex = 1;<NEW_LINE>for (String stackStatusFiltersListValue : stackStatusFiltersList) {<NEW_LINE>if (stackStatusFiltersListValue != null) {<NEW_LINE>request.addParameter("StackStatusFilter.member." + stackStatusFiltersListIndex, StringUtils.fromString(stackStatusFiltersListValue));<NEW_LINE>}<NEW_LINE>stackStatusFiltersListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>} | request.addParameter("Action", "ListStacks"); |
580,986 | public ApplicationType createApplicationTypeFor(Application app, Jvm jvm, String mainClass) {<NEW_LINE>if (isNetBeans(jvm, mainClass)) {<NEW_LINE>String branding = getBranding(jvm);<NEW_LINE>if (VISUALVM_ID.equals(branding)) {<NEW_LINE>return new VisualVMApplicationType(app);<NEW_LINE>}<NEW_LINE>Set<<MASK><NEW_LINE>for (String cluster : clusters) {<NEW_LINE>if (NBCLUSTER_PATTERN.matcher(cluster).matches()) {<NEW_LINE>return new NetBeansApplicationType(app, jvm, clusters);<NEW_LINE>}<NEW_LINE>if (NB_CLUSTER.equals(cluster)) {<NEW_LINE>return new NetBeansApplicationType(app, jvm, clusters);<NEW_LINE>}<NEW_LINE>if (VISUALVM_ID.equals(cluster)) {<NEW_LINE>return new VisualVMApplicationType(app);<NEW_LINE>}<NEW_LINE>if (BUILD_CLUSTER.equals(cluster)) {<NEW_LINE>// NetBeans platform application was executed<NEW_LINE>// directly from IDE or from ant script.<NEW_LINE>// Check if it is VisualVM on Windows - on other platforms<NEW_LINE>// VisualVM is recognized via branding<NEW_LINE>if (jvm.getJvmArgs().contains(VISUALVM_BUILD_WIN_ID)) {<NEW_LINE>return new VisualVMApplicationType(app);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (clusters.isEmpty() && branding == null) {<NEW_LINE>return new NetBeans3xApplicationType(app, jvm);<NEW_LINE>}<NEW_LINE>return new NetBeansBasedApplicationType(app, jvm, clusters, branding);<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>} | String> clusters = computeClusters(jvm); |
1,150,838 | public DataFetcher<Iterable<Object>> stopsByBbox() {<NEW_LINE>return environment -> {<NEW_LINE>var args = new LegacyGraphQLTypes.LegacyGraphQLQueryTypeStopsByBboxArgs(environment.getArguments());<NEW_LINE>Envelope envelope = new Envelope(new Coordinate(args.getLegacyGraphQLMinLon(), args.getLegacyGraphQLMinLat()), new Coordinate(args.getLegacyGraphQLMaxLon(), args.getLegacyGraphQLMaxLat()));<NEW_LINE>Stream<Stop> stopStream = getRoutingService(environment).getStopSpatialIndex().query(envelope).stream().filter(transitStopVertex -> envelope.contains(transitStopVertex.getCoordinate())).map(TransitStopVertex::getStop);<NEW_LINE>if (args.getLegacyGraphQLFeeds() != null) {<NEW_LINE>List<String> feedIds = Lists.newArrayList(args.getLegacyGraphQLFeeds());<NEW_LINE>stopStream = stopStream.filter(stop -> feedIds.contains(stop.getId().getFeedId()));<NEW_LINE>}<NEW_LINE>return stopStream.<MASK><NEW_LINE>};<NEW_LINE>} | collect(Collectors.toList()); |
116,319 | public void renderHTML(PrintWriter writer, Map<String, String> params) {<NEW_LINE>try {<NEW_LINE>double jvmUpTimeInSeconds = ManagementFactory.getRuntimeMXBean().getUptime() / 1000.0;<NEW_LINE>String version = getVersion();<NEW_LINE>writer.print("<div>");<NEW_LINE>writer.print("<p> Version: " + version + ", Uptime: " + jvmUpTimeInSeconds + " seconds </p>");<NEW_LINE>writer.print("</div>");<NEW_LINE>Collection<KafkaClusterManager> clusterManagers = DoctorKMain.doctorK.getClusterManagers();<NEW_LINE>writer.print("<div> ");<NEW_LINE>writer.print("<table class=\"table table-responsive\"> ");<NEW_LINE>writer.print("<th> ClusterName </th> <th> Size </th> <th> Under-replicated Partitions</th>");<NEW_LINE>writer.print("<th> Maintenance Mode </th>");<NEW_LINE>writer.print("<tbody>");<NEW_LINE>Map<String, String> clustersHtml = new TreeMap<>();<NEW_LINE>for (KafkaClusterManager clusterManager : clusterManagers) {<NEW_LINE>String clusterName = clusterManager.getClusterName();<NEW_LINE>String htmlStr;<NEW_LINE>htmlStr = "<tr> <td> <a href=\"/servlet/clusterinfo?name=" + clusterName + "\">" + clusterName + "</a>" + " </td> <td> " + ((clusterManager.getCluster() != null) ? clusterManager.getClusterSize() : "no brokerstats") + " </td> <td> <a href=\"/servlet/urp?cluster=" + clusterName + "\">" + clusterManager.getUnderReplicatedPartitions().size() + "</a> </td>" + "<td>" + clusterManager.isMaintenanceModeEnabled() + " </td> </tr>";<NEW_LINE>clustersHtml.put(clusterName, htmlStr);<NEW_LINE>}<NEW_LINE>for (Map.Entry<String, String> entry : clustersHtml.entrySet()) {<NEW_LINE>writer.print(entry.getValue());<NEW_LINE>}<NEW_LINE>writer.print("</tbody> </table>");<NEW_LINE>writer.print("</div>");<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>writer.println(e);<NEW_LINE>}<NEW_LINE>} | LOG.error("Exception in getting info", e); |
1,460,371 | public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>if (player == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Set<String> toSelect = new HashSet<>();<NEW_LINE>while (toSelect.size() < 3) {<NEW_LINE>toSelect.add(RandomUtil.randomFromCollection(spellbook));<NEW_LINE>}<NEW_LINE>Choice choice = new ChoiceImpl(true, ChoiceHintType.CARD);<NEW_LINE>choice.setMessage("Choose a card to draft");<NEW_LINE>choice.setChoices(toSelect);<NEW_LINE>player.choose(outcome, choice, game);<NEW_LINE>String cardName = choice.getChoice();<NEW_LINE>if (cardName == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>CardInfo cardInfo = CardRepository.instance.findCards(new CardCriteria().nameExact(cardName)).stream().findFirst().orElse(null);<NEW_LINE>if (cardInfo == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Set<Card> <MASK><NEW_LINE>cards.add(cardInfo.getCard());<NEW_LINE>game.loadCards(cards, player.getId());<NEW_LINE>player.moveCards(cards, Zone.HAND, source, game);<NEW_LINE>return true;<NEW_LINE>} | cards = new HashSet<>(); |
48,104 | protected Node[] createNodes(Object subbean) {<NEW_LINE>try {<NEW_LINE>if (subbean instanceof BeanContextSupport) {<NEW_LINE>BeanContextSupport bcs = (BeanContextSupport) subbean;<NEW_LINE>if (bean.contains(bcs.getBeanContextPeer()) && (bcs != bcs.getBeanContextPeer())) {<NEW_LINE>// sometimes a BeanContextSupport occures in the list of<NEW_LINE>// beans children even there is its peer. we think that<NEW_LINE>// it is desirable to hide the context if the peer is<NEW_LINE>// also present<NEW_LINE>return new Node[0];<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Node n = factory.createNode(subbean);<NEW_LINE>// #7925: deleting from BeanChildren has no effect<NEW_LINE>synchronized (nodes2Beans) {<NEW_LINE>nodes2Beans.put(n, new Reference<?>[] { new WeakReference<BeanContext>(bean), new WeakReference<Object>(subbean) });<NEW_LINE>}<NEW_LINE>n.addNodeListener(contextL);<NEW_LINE><MASK><NEW_LINE>} catch (IntrospectionException ex) {<NEW_LINE>Logger.getLogger(BeanChildren.class.getName()).log(Level.WARNING, null, ex);<NEW_LINE>return new Node[0];<NEW_LINE>}<NEW_LINE>} | return new Node[] { n }; |
1,347,249 | protected void checkIatTime(Long iatSeconds, Date currentDate, long lSkewSeconds) throws OAuth20Exception {<NEW_LINE><MASK><NEW_LINE>if (iatSeconds == null) {<NEW_LINE>if (!bJwtIatRequired)<NEW_LINE>// IAT is optional<NEW_LINE>return;<NEW_LINE>// If JWT has specified the maxJwtLifetimeMinutesAllowed attribute<NEW_LINE>// then the jwt token has to provided iat claim<NEW_LINE>// This is not in the spec.<NEW_LINE>Tr.error(tc, "JWT_TOKEN_IAT_NEEDED_ERR");<NEW_LINE>// no exp claim in the jwt token<NEW_LINE>throw new InvalidGrantException(formatMessage("JWT_TOKEN_IAT_NEEDED_ERR"), null);<NEW_LINE>}<NEW_LINE>// get max jwt lifetime minutes<NEW_LINE>long lMaxJwtLifetimeSecondAllowed = _jwtGrantTypeHandlerConfig.getJwtTokenMaxLifetime();<NEW_LINE>// MilliSecond<NEW_LINE>long lIat = iatSeconds.longValue() * 1000;<NEW_LINE>Date iatDate = new Date(lIat);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {<NEW_LINE>Tr.debug(tc, "JWT token iat : " + iatDate);<NEW_LINE>}<NEW_LINE>// If iat is specified, we will check it against the MaxJwtLifetimeMinutesAllowed<NEW_LINE>// The default values on the MaxJwtLifetimeMinutesAllowed is<NEW_LINE>Date earlierDate = new Date(currentDate.getTime() - (lMaxJwtLifetimeSecondAllowed * 1000));<NEW_LINE>if (iatDate.before(earlierDate)) {<NEW_LINE>// the issue-at-time should not be earilier than (currenttime minus MaxLifetime)<NEW_LINE>Tr.error(tc, "JWT_TOKEN_MAX_LIFETIME_ERR", iatDate.toString(), lMaxJwtLifetimeSecondAllowed);<NEW_LINE>throw new InvalidGrantException(formatMessage("JWT_TOKEN_MAX_LIFETIME_ERR", iatDate.toString(), lMaxJwtLifetimeSecondAllowed), (Throwable) null);<NEW_LINE>}<NEW_LINE>// Let's check if the token is issued in a future time(iat)<NEW_LINE>// If so, let's fail it<NEW_LINE>Date currentSkewDate = new Date(currentDate.getTime() + (lSkewSeconds * 1000));<NEW_LINE>if (iatDate.after(currentSkewDate)) {<NEW_LINE>// iat at future time<NEW_LINE>Tr.error(tc, "JWT_TOKEN_IAT_FUTURE_ERR", iatDate.toString(), currentSkewDate.toString());<NEW_LINE>throw new InvalidGrantException(formatMessage("JWT_TOKEN_FUTURE_TOKEN_ERR", iatDate.toString()), (Throwable) null);<NEW_LINE>}<NEW_LINE>} | boolean bJwtIatRequired = _jwtGrantTypeHandlerConfig.isJwtIatRequired(); |
1,544,298 | public CreateEntityRecognizerResult createEntityRecognizer(CreateEntityRecognizerRequest createEntityRecognizerRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createEntityRecognizerRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<CreateEntityRecognizerRequest> request = null;<NEW_LINE>Response<CreateEntityRecognizerResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateEntityRecognizerRequestMarshaller().marshall(createEntityRecognizerRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>Unmarshaller<CreateEntityRecognizerResult, JsonUnmarshallerContext> unmarshaller = new CreateEntityRecognizerResultJsonUnmarshaller();<NEW_LINE>JsonResponseHandler<CreateEntityRecognizerResult> responseHandler = new JsonResponseHandler<CreateEntityRecognizerResult>(unmarshaller);<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>} | awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
892,792 | public int run(final String[] strings) throws Exception {<NEW_LINE>LOGGER.info("Ensuring table {} exists", store.getTableName());<NEW_LINE>TableUtils.ensureTableExists(store);<NEW_LINE>// Hadoop configuration<NEW_LINE>final Configuration conf = getConf();<NEW_LINE>final FileSystem <MASK><NEW_LINE>checkHdfsDirectories(failurePath, fs);<NEW_LINE>// Remove the _SUCCESS file to prevent warning in Accumulo<NEW_LINE>LOGGER.info("Removing file {}/_SUCCESS", inputPath);<NEW_LINE>fs.delete(new Path(inputPath + "/_SUCCESS"), false);<NEW_LINE>// Set all permissions<NEW_LINE>if (options == null || !Boolean.parseBoolean(options.get(AccumuloProperties.HDFS_SKIP_PERMISSIONS))) {<NEW_LINE>IngestUtils.setDirectoryPermsForAccumulo(fs, new Path(inputPath));<NEW_LINE>}<NEW_LINE>// Import the files<NEW_LINE>LOGGER.info("Importing files in {} to table {}", inputPath, store.getTableName());<NEW_LINE>store.getConnection().tableOperations().importDirectory(store.getTableName(), inputPath, failurePath, false);<NEW_LINE>return SUCCESS_RESPONSE;<NEW_LINE>} | fs = FileSystem.get(conf); |
1,798,085 | Expr atom() {<NEW_LINE>Tok tok = peek();<NEW_LINE>switch(tok.sym) {<NEW_LINE>case LPAREN:<NEW_LINE>move();<NEW_LINE>Expr expr = expr();<NEW_LINE>match(Sym.RPAREN);<NEW_LINE>return expr;<NEW_LINE>case ID:<NEW_LINE>move();<NEW_LINE>return new Id(tok.value());<NEW_LINE>case STR:<NEW_LINE>move();<NEW_LINE>return new Const(tok.<MASK><NEW_LINE>case INT:<NEW_LINE>case LONG:<NEW_LINE>case FLOAT:<NEW_LINE>case DOUBLE:<NEW_LINE>move();<NEW_LINE>return new Const(tok.sym, ((NumTok) tok).getNumberValue());<NEW_LINE>case TRUE:<NEW_LINE>move();<NEW_LINE>return Const.TRUE;<NEW_LINE>case FALSE:<NEW_LINE>move();<NEW_LINE>return Const.FALSE;<NEW_LINE>case NULL:<NEW_LINE>move();<NEW_LINE>return Const.NULL;<NEW_LINE>case COMMA:<NEW_LINE>case SEMICOLON:<NEW_LINE>// support "c ?? ? a : b"<NEW_LINE>case QUESTION:<NEW_LINE>// support "a.b ?? && expr"<NEW_LINE>case AND:<NEW_LINE>// support "a.b ?? && expr"<NEW_LINE>case OR:<NEW_LINE>// support "a.b ?? && expr"<NEW_LINE>case EQUAL:<NEW_LINE>// support "a.b ?? && expr"<NEW_LINE>case NOTEQUAL:<NEW_LINE>// support "(a.b ??)"<NEW_LINE>case RPAREN:<NEW_LINE>// support "[start .. end ??]"<NEW_LINE>case RBRACK:<NEW_LINE>// support "{key : value ??}"<NEW_LINE>case RBRACE:<NEW_LINE>// support "[start ?? .. end]"<NEW_LINE>case RANGE:<NEW_LINE>// support "c ? a ?? : b"<NEW_LINE>case COLON:<NEW_LINE>case EOF:<NEW_LINE>return null;<NEW_LINE>default:<NEW_LINE>throw new ParseException("Expression error: can not match the symbol \"" + tok.value() + "\"", location);<NEW_LINE>}<NEW_LINE>} | sym, tok.value()); |
233,055 | final GetQueueResult executeGetQueue(GetQueueRequest getQueueRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getQueueRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetQueueRequest> request = null;<NEW_LINE>Response<GetQueueResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetQueueRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getQueueRequest));<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, "MediaConvert");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetQueue");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetQueueResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new GetQueueResultJsonUnmarshaller()); |
551,385 | public void scan() {<NEW_LINE>if (myLocalFileSystemRefreshWorker != null) {<NEW_LINE>myLocalFileSystemRefreshWorker.scan();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>NewVirtualFile root = myRefreshQueue.pullFirst();<NEW_LINE>NewVirtualFileSystem fs = root.getFileSystem();<NEW_LINE>if (root.isDirectory()) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>PersistentFS persistence = PersistentFS.getInstance();<NEW_LINE>FileAttributes attributes = fs.getAttributes(root);<NEW_LINE>if (attributes == null) {<NEW_LINE>myHelper.scheduleDeletion(root);<NEW_LINE>root.markClean();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (fs instanceof LocalFileSystemBase) {<NEW_LINE>DirectoryAccessChecker.refresh();<NEW_LINE>}<NEW_LINE>checkAndScheduleChildRefresh(fs, persistence, root.getParent(), root, attributes);<NEW_LINE>if (root.isDirty()) {<NEW_LINE>if (myRefreshQueue.isEmpty()) {<NEW_LINE>queueDirectory(root);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>processQueue(fs, persistence);<NEW_LINE>} catch (RefreshCancelledException e) {<NEW_LINE>LOG.trace("refresh cancelled");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | fs = PersistentFS.replaceWithNativeFS(fs); |
678,896 | void restoreSessions() {<NEW_LINE>if (systemContext.isLocalCacheType()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>log.debug("[{}] Restoring sessions from cache", deviceId);<NEW_LINE>DeviceSessionsCacheEntry sessionsDump = null;<NEW_LINE>try {<NEW_LINE>sessionsDump = DeviceSessionsCacheEntry.parseFrom(systemContext.getDeviceSessionCacheService<MASK><NEW_LINE>} catch (InvalidProtocolBufferException e) {<NEW_LINE>log.warn("[{}] Failed to decode device sessions from cache", deviceId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (sessionsDump.getSessionsCount() == 0) {<NEW_LINE>log.debug("[{}] No session information found", deviceId);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// TODO: Take latest max allowed sessions size from cache<NEW_LINE>for (SessionSubscriptionInfoProto sessionSubscriptionInfoProto : sessionsDump.getSessionsList()) {<NEW_LINE>SessionInfoProto sessionInfoProto = sessionSubscriptionInfoProto.getSessionInfo();<NEW_LINE>UUID sessionId = getSessionId(sessionInfoProto);<NEW_LINE>SessionInfo sessionInfo = new SessionInfo(SessionType.ASYNC, sessionInfoProto.getNodeId());<NEW_LINE>SubscriptionInfoProto subInfo = sessionSubscriptionInfoProto.getSubscriptionInfo();<NEW_LINE>SessionInfoMetaData sessionMD = new SessionInfoMetaData(sessionInfo, subInfo.getLastActivityTime());<NEW_LINE>sessions.put(sessionId, sessionMD);<NEW_LINE>if (subInfo.getAttributeSubscription()) {<NEW_LINE>attributeSubscriptions.put(sessionId, sessionInfo);<NEW_LINE>sessionMD.setSubscribedToAttributes(true);<NEW_LINE>}<NEW_LINE>if (subInfo.getRpcSubscription()) {<NEW_LINE>rpcSubscriptions.put(sessionId, sessionInfo);<NEW_LINE>sessionMD.setSubscribedToRPC(true);<NEW_LINE>}<NEW_LINE>log.debug("[{}] Restored session: {}", deviceId, sessionMD);<NEW_LINE>}<NEW_LINE>log.debug("[{}] Restored sessions: {}, rpc subscriptions: {}, attribute subscriptions: {}", deviceId, sessions.size(), rpcSubscriptions.size(), attributeSubscriptions.size());<NEW_LINE>} | ().get(deviceId)); |
1,389,861 | public void deleteMessagesId(Integer id) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'id' is set<NEW_LINE>if (id == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'id' when calling deleteMessagesId");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/messages/{id}".replaceAll("\\{" + "id" + "\\}", apiClient.escapeString(id.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = {};<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String <MASK><NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);<NEW_LINE>} | localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); |
740,479 | public List<? extends Resource> children() throws IOException, HttpException, NotAuthorizedException, BadRequestException {<NEW_LINE>List<Resource> children = cache.get(this);<NEW_LINE>if (children == null) {<NEW_LINE>children = new ArrayList<Resource>();<NEW_LINE>String thisHref = href();<NEW_LINE>if (log.isTraceEnabled()) {<NEW_LINE>log.trace("load children for: " + thisHref);<NEW_LINE>}<NEW_LINE>List<Response> responses = host().<MASK><NEW_LINE>if (responses != null) {<NEW_LINE>for (Response resp : responses) {<NEW_LINE>if (!resp.href.equals(this.href())) {<NEW_LINE>try {<NEW_LINE>Resource r = Resource.fromResponse(this, resp, cache);<NEW_LINE>if (!r.href().equals(thisHref)) {<NEW_LINE>children.add(r);<NEW_LINE>}<NEW_LINE>this.notifyOnChildAdded(r);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.error("couldnt process record", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>log.trace("null responses");<NEW_LINE>}<NEW_LINE>cache.put(this, children);<NEW_LINE>}<NEW_LINE>return children;<NEW_LINE>} | doPropFind(encodedUrl(), 1); |
841,438 | public static DescribeImageLibResponse unmarshall(DescribeImageLibResponse describeImageLibResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeImageLibResponse.setRequestId(_ctx.stringValue("DescribeImageLibResponse.RequestId"));<NEW_LINE>describeImageLibResponse.setTotalCount(_ctx.integerValue("DescribeImageLibResponse.TotalCount"));<NEW_LINE>List<ImageLib> imageLibList = new ArrayList<ImageLib>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeImageLibResponse.ImageLibList.Length"); i++) {<NEW_LINE>ImageLib imageLib = new ImageLib();<NEW_LINE>imageLib.setImageCount(_ctx.integerValue("DescribeImageLibResponse.ImageLibList[" + i + "].ImageCount"));<NEW_LINE>imageLib.setModifiedTime(_ctx.stringValue("DescribeImageLibResponse.ImageLibList[" + i + "].ModifiedTime"));<NEW_LINE>imageLib.setCode(_ctx.stringValue("DescribeImageLibResponse.ImageLibList[" + i + "].Code"));<NEW_LINE>imageLib.setName(_ctx.stringValue("DescribeImageLibResponse.ImageLibList[" + i + "].Name"));<NEW_LINE>imageLib.setId(_ctx.integerValue("DescribeImageLibResponse.ImageLibList[" + i + "].Id"));<NEW_LINE>imageLib.setSource(_ctx.stringValue("DescribeImageLibResponse.ImageLibList[" + i + "].Source"));<NEW_LINE>imageLib.setCategory(_ctx.stringValue("DescribeImageLibResponse.ImageLibList[" + i + "].Category"));<NEW_LINE>imageLib.setServiceModule(_ctx.stringValue("DescribeImageLibResponse.ImageLibList[" + i + "].ServiceModule"));<NEW_LINE>imageLib.setScene(_ctx.stringValue<MASK><NEW_LINE>imageLib.setEnable(_ctx.stringValue("DescribeImageLibResponse.ImageLibList[" + i + "].Enable"));<NEW_LINE>List<String> bizTypes = new ArrayList<String>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("DescribeImageLibResponse.ImageLibList[" + i + "].BizTypes.Length"); j++) {<NEW_LINE>bizTypes.add(_ctx.stringValue("DescribeImageLibResponse.ImageLibList[" + i + "].BizTypes[" + j + "]"));<NEW_LINE>}<NEW_LINE>imageLib.setBizTypes(bizTypes);<NEW_LINE>imageLibList.add(imageLib);<NEW_LINE>}<NEW_LINE>describeImageLibResponse.setImageLibList(imageLibList);<NEW_LINE>return describeImageLibResponse;<NEW_LINE>} | ("DescribeImageLibResponse.ImageLibList[" + i + "].Scene")); |
1,520,702 | static void make_encode_method_for_exported(ClassWriter cw, String className, int arity) {<NEW_LINE>MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "encode", "(" + Type.getDescriptor(EOutputStream.class) + ")V", null, null);<NEW_LINE>mv.visitCode();<NEW_LINE>mv.visitVarInsn(ALOAD, 1);<NEW_LINE>mv.visitVarInsn(ALOAD, 0);<NEW_LINE>mv.visitFieldInsn(GETFIELD, className, "module_name", EATOM_DESC);<NEW_LINE>mv.visitVarInsn(ALOAD, 0);<NEW_LINE>mv.visitFieldInsn(<MASK><NEW_LINE>mv.visitLdcInsn(new Integer(arity));<NEW_LINE>mv.visitMethodInsn(INVOKEVIRTUAL, Type.getInternalName(EOutputStream.class), "write_external_fun", "(" + EATOM_DESC + EATOM_DESC + "I)V");<NEW_LINE>mv.visitInsn(RETURN);<NEW_LINE>mv.visitMaxs(4, 1);<NEW_LINE>mv.visitEnd();<NEW_LINE>} | GETFIELD, className, "function_name", EATOM_DESC); |
649,961 | private void readPatterns(Reader r) throws IOException {<NEW_LINE>BufferedReader buf = new BufferedReader(r);<NEW_LINE>for (; ; ) {<NEW_LINE>String line = buf.readLine();<NEW_LINE>if (line == null) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>line = line.trim();<NEW_LINE>if (line.length() == 0 || line.startsWith("#")) {<NEW_LINE>// NOI18N<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (line.startsWith("include ")) {<NEW_LINE>// NOI18N<NEW_LINE>line = line.substring(8);<NEW_LINE>if (line.length() > 0) {<NEW_LINE>includePatterns.addAll(parsePattern(line));<NEW_LINE>}<NEW_LINE>} else if (line.startsWith("exclude ")) {<NEW_LINE>// NOI18N<NEW_LINE>line = line.substring(8);<NEW_LINE>if (line.length() > 0) {<NEW_LINE>excludePatterns.addAll(parsePattern(line));<NEW_LINE>}<NEW_LINE>} else if (line.startsWith("translate ")) {<NEW_LINE>// NOI18N<NEW_LINE><MASK><NEW_LINE>if (line.length() > 0) {<NEW_LINE>String[] translations = line.split("\\|");<NEW_LINE>for (String translation : translations) {<NEW_LINE>String originalPath = translation.substring(0, translation.indexOf("=>"));<NEW_LINE>String newPath = translation.substring(translation.lastIndexOf("=>") + 2);<NEW_LINE>if (translatePatterns.containsKey(originalPath)) {<NEW_LINE>// NOI18N<NEW_LINE>// NOI18N<NEW_LINE>LOGGER.// NOI18N<NEW_LINE>log(// NOI18N<NEW_LINE>Level.INFO, "Translation already exists: {0}. Ignoring new translation: {1}", new Object[] { originalPath.concat("=>").concat(translatePatterns.get(originalPath)), originalPath.concat("=>").concat(newPath) });<NEW_LINE>} else {<NEW_LINE>translatePatterns.put(originalPath, newPath);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// NOI18N<NEW_LINE>throw new java.io.IOException("Wrong line: " + line);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | line = line.substring(10); |
1,702,767 | final DescribeACLsResult executeDescribeACLs(DescribeACLsRequest describeACLsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(describeACLsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DescribeACLsRequest> request = null;<NEW_LINE>Response<DescribeACLsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DescribeACLsRequestProtocolMarshaller(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, "MemoryDB");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeACLs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DescribeACLsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeACLsResultJsonUnmarshaller());<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(describeACLsRequest)); |
1,772,918 | Mono<Response<Void>> deleteWithResponse(Boolean recursive, DataLakeRequestConditions requestConditions, Context context) {<NEW_LINE>requestConditions = requestConditions == <MASK><NEW_LINE>LeaseAccessConditions lac = new LeaseAccessConditions().setLeaseId(requestConditions.getLeaseId());<NEW_LINE>ModifiedAccessConditions mac = new ModifiedAccessConditions().setIfMatch(requestConditions.getIfMatch()).setIfNoneMatch(requestConditions.getIfNoneMatch()).setIfModifiedSince(requestConditions.getIfModifiedSince()).setIfUnmodifiedSince(requestConditions.getIfUnmodifiedSince());<NEW_LINE>context = context == null ? Context.NONE : context;<NEW_LINE>return this.dataLakeStorage.getPaths().deleteWithResponseAsync(null, null, recursive, null, lac, mac, context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE)).map(response -> new SimpleResponse<>(response, null));<NEW_LINE>} | null ? new DataLakeRequestConditions() : requestConditions; |
247,087 | private static void addDeployParamLibrariesForModule(StringBuilder sb, String moduleId, String deploymentLibs, ServiceLocator habitat) {<NEW_LINE>if (moduleId.indexOf('#') != -1) {<NEW_LINE>moduleId = moduleId.substring(0, moduleId.indexOf('#'));<NEW_LINE>}<NEW_LINE>if (deploymentLibs == null) {<NEW_LINE>ApplicationInfo appInfo = habitat.<ApplicationRegistry>getService(ApplicationRegistry.class).get(moduleId);<NEW_LINE>if (appInfo == null) {<NEW_LINE>// this might be an internal container app,<NEW_LINE>// like _default_web_app, ignore.<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>deploymentLibs = appInfo.getLibraries();<NEW_LINE>}<NEW_LINE>final URL[] libs = getDeployParamLibrariesAsURLs(deploymentLibs, habitat);<NEW_LINE>if (libs != null) {<NEW_LINE>for (final URL u : libs) {<NEW_LINE>sb.<MASK><NEW_LINE>sb.append(File.pathSeparator);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | append(u.getPath()); |
139,687 | private OsAccountUpdateResult updateOsAccountCore(OsAccount osAccount, String address, String loginName, CaseDbTransaction trans) throws TskCoreException {<NEW_LINE>OsAccountUpdateStatus updateStatusCode = OsAccountUpdateStatus.NO_CHANGE;<NEW_LINE>OsAccount updatedAccount;<NEW_LINE>try {<NEW_LINE>CaseDbConnection connection = trans.getConnection();<NEW_LINE>// if a new non-null addr is provided and the account already has an address, and they are not the same, throw an exception<NEW_LINE>if (!StringUtils.isBlank(address) && !address.equalsIgnoreCase(WindowsAccountUtils.WINDOWS_NULL_SID) && !StringUtils.isBlank(osAccount.getAddr().orElse(null)) && !address.equalsIgnoreCase(osAccount.getAddr().orElse(""))) {<NEW_LINE>throw new TskCoreException(String.format("Account (%d) already has an address (%s), address cannot be updated.", osAccount.getId(), osAccount.getAddr().orElse("NULL")));<NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(osAccount.getAddr().orElse(null)) && !StringUtils.isBlank(address) && !address.equalsIgnoreCase(WindowsAccountUtils.WINDOWS_NULL_SID)) {<NEW_LINE>updateAccountColumn(osAccount.getId(), "addr", address, connection);<NEW_LINE>updateStatusCode = OsAccountUpdateStatus.UPDATED;<NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(osAccount.getLoginName().orElse(null)) && !StringUtils.isBlank(loginName)) {<NEW_LINE>updateAccountColumn(osAccount.getId(), "login_name", loginName, connection);<NEW_LINE>updateStatusCode = OsAccountUpdateStatus.UPDATED;<NEW_LINE>}<NEW_LINE>// if nothing is changed, return<NEW_LINE>if (updateStatusCode == OsAccountUpdateStatus.NO_CHANGE) {<NEW_LINE>return new OsAccountUpdateResult(updateStatusCode, osAccount);<NEW_LINE>}<NEW_LINE>// update signature if needed, based on the most current addr/loginName<NEW_LINE>OsAccount currAccount = getOsAccountByObjectId(osAccount.getId(), connection);<NEW_LINE>String newAddress = currAccount.getAddr().orElse(null);<NEW_LINE>String newLoginName = currAccount.getLoginName().orElse(null);<NEW_LINE>String newSignature = getOsAccountSignature(newAddress, newLoginName);<NEW_LINE>updateAccountSignature(osAccount.getId(), newSignature, connection);<NEW_LINE>// get the updated account from database<NEW_LINE>updatedAccount = getOsAccountByObjectId(<MASK><NEW_LINE>// register the updated account with the transaction to fire off an event<NEW_LINE>trans.registerChangedOsAccount(updatedAccount);<NEW_LINE>return new OsAccountUpdateResult(updateStatusCode, updatedAccount);<NEW_LINE>} catch (SQLException ex) {<NEW_LINE>throw new TskCoreException(String.format("Error updating account with unique id = %s, account id = %d", osAccount.getAddr().orElse("Unknown"), osAccount.getId()), ex);<NEW_LINE>}<NEW_LINE>} | osAccount.getId(), connection); |
887,077 | public static void convolve(Kernel2D_F32 kernel, GrayF32 src, GrayF32 dst, ImageBorder_F32 bsrc) {<NEW_LINE>dst.reshape(src.width, src.height);<NEW_LINE>// if( BOverrideConvolveImageNormalized.invokeNativeConvolve(kernel,src,dst) )<NEW_LINE>// return;<NEW_LINE>bsrc.setImage(src);<NEW_LINE>if (kernel.width >= src.width || kernel.width >= src.height) {<NEW_LINE>ConvolveNormalizedNaive_SB.convolve(<MASK><NEW_LINE>} else {<NEW_LINE>if (Math.abs(kernel.computeSum() - 1.0f) > 1e-4f) {<NEW_LINE>Kernel2D_F32 k = kernel.copy();<NEW_LINE>KernelMath.normalizeSumToOne(k);<NEW_LINE>kernel = k;<NEW_LINE>}<NEW_LINE>ConvolveImageNoBorder.convolve(kernel, src, dst);<NEW_LINE>ConvolveJustBorder_General_SB.convolve(kernel, bsrc, dst);<NEW_LINE>}<NEW_LINE>} | kernel, src, dst, bsrc); |
222,829 | private long parseSize(String string) {<NEW_LINE>// See https://github.com/qbittorrent/qBittorrent/wiki<NEW_LINE>if (string.equals("Unknown"))<NEW_LINE>return -1;<NEW_LINE>// Sizes are given in "1,023.3 MiB"-like string format<NEW_LINE>String[] parts = string.split(" ");<NEW_LINE>double number;<NEW_LINE>try {<NEW_LINE>number = Double.parseDouble(normalizeNumber(parts[0]));<NEW_LINE>} catch (Exception e) {<NEW_LINE>return -1L;<NEW_LINE>}<NEW_LINE>if (parts.length <= 1) {<NEW_LINE>// Interpret as bytes, as no qualifier was given<NEW_LINE>return (long) number;<NEW_LINE>}<NEW_LINE>// Returns size in B-based long<NEW_LINE>switch(parts[1]) {<NEW_LINE>case "TiB":<NEW_LINE>return (long) (number * 1024L * 1024L * 1024L * 1024L);<NEW_LINE>case "GiB":<NEW_LINE>return (long) (<MASK><NEW_LINE>case "MiB":<NEW_LINE>return (long) (number * 1024L * 1024L);<NEW_LINE>case "KiB":<NEW_LINE>return (long) (number * 1024L);<NEW_LINE>}<NEW_LINE>return (long) number;<NEW_LINE>} | number * 1024L * 1024L * 1024L); |
773,603 | protected void parse() {<NEW_LINE>showTabNames = getBoolean(SHOW_TEXT_ICONS, true);<NEW_LINE>processImages = getInt(PROCESS_IMAGES, 0);<NEW_LINE>// No default<NEW_LINE>configLocale = getString(LOCALE, null);<NEW_LINE>locale = getString(LOCALE, DEFAULT_LOCALE);<NEW_LINE>useSystemsLocaleForFormat = getBoolean(USE_SYSTEMS_LOCALE_FOR_FORMAT_KEY, true);<NEW_LINE>displayOption = getInt(DISPLAY_OPTION, 1);<NEW_LINE>responsePanelPosition = getString(RESPONSE_PANEL_POS_KEY, WorkbenchPanel.ResponsePanelPosition.TABS_SIDE_BY_SIDE.name());<NEW_LINE>brkPanelViewOption = getInt(BRK_PANEL_VIEW_OPTION, 0);<NEW_LINE>showMainToolbar = getInt(SHOW_MAIN_TOOLBAR_OPTION, 1);<NEW_LINE>advancedViewEnabled = getInt(ADVANCEDUI_OPTION, 0);<NEW_LINE>wmUiHandlingEnabled = getInt(WMUIHANDLING_OPTION, 0);<NEW_LINE>askOnExitEnabled = getInt(ASKONEXIT_OPTION, 1);<NEW_LINE><MASK><NEW_LINE>mode = getString(MODE_OPTION, Mode.standard.name());<NEW_LINE>outputTabTimeStampingEnabled = getBoolean(OUTPUT_TAB_TIMESTAMPING_OPTION, false);<NEW_LINE>outputTabTimeStampFormat = getString(OUTPUT_TAB_TIMESTAMP_FORMAT, DEFAULT_TIME_STAMP_FORMAT);<NEW_LINE>showLocalConnectRequests = getBoolean(SHOW_LOCAL_CONNECT_REQUESTS, false);<NEW_LINE>showSplashScreen = getBoolean(SPLASHSCREEN_OPTION, true);<NEW_LINE>for (FontUtils.FontType fontType : FontUtils.FontType.values()) {<NEW_LINE>fontNames.put(fontType, getString(getFontNameConfKey(fontType), ""));<NEW_LINE>fontSizes.put(fontType, getInt(getFontSizeConfKey(fontType), -1));<NEW_LINE>}<NEW_LINE>scaleImages = getBoolean(SCALE_IMAGES, true);<NEW_LINE>showDevWarning = getBoolean(SHOW_DEV_WARNING, true);<NEW_LINE>lookAndFeelInfo = new LookAndFeelInfo(getString(LOOK_AND_FEEL, DEFAULT_LOOK_AND_FEEL.getName()), getString(LOOK_AND_FEEL_CLASS, DEFAULT_LOOK_AND_FEEL.getClassName()));<NEW_LINE>allowAppIntegrationInContainers = getBoolean(ALLOW_APP_INTEGRATION_IN_CONTAINERS, false);<NEW_LINE>this.confirmRemoveProxyExcludeRegex = getBoolean(CONFIRM_REMOVE_PROXY_EXCLUDE_REGEX_KEY, false);<NEW_LINE>this.confirmRemoveScannerExcludeRegex = getBoolean(CONFIRM_REMOVE_SCANNER_EXCLUDE_REGEX_KEY, false);<NEW_LINE>this.confirmRemoveSpiderExcludeRegex = getBoolean(CONFIRM_REMOVE_SPIDER_EXCLUDE_REGEX_KEY, false);<NEW_LINE>} | warnOnTabDoubleClick = getBoolean(WARN_ON_TAB_DOUBLE_CLICK_OPTION, true); |
1,205,295 | public static String summarizeTraceEvents(TraceEvent[] events) {<NEW_LINE>Pair<Long, Map<String, OpStats>> p = aggregateTraceEvents(events);<NEW_LINE>final Map<String, OpStats> stats = p.getSecond();<NEW_LINE>long allOpsUs = p.getFirst();<NEW_LINE>// Summarize by op type:<NEW_LINE>List<String> l = new ArrayList<>(stats.keySet());<NEW_LINE>Collections.sort(l, new Comparator<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public int compare(String o1, String o2) {<NEW_LINE>return -Long.compare(stats.get(o1).getSumUs(), stats.get(o2).getSumUs());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>// Work out longest name and op name:<NEW_LINE>int longestName = 30;<NEW_LINE>int longestOpName = 30;<NEW_LINE>for (String s : l) {<NEW_LINE>longestName = Math.max(longestName, s.length() + 1);<NEW_LINE>longestOpName = Math.max(longestOpName, stats.get(s).getOpName().length() + 1);<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>String headerFormat = "%-" + longestName + "s%-" + longestOpName + "s%-10s%-10s%-10s%-10s%-10s%-10s\n";<NEW_LINE>sb.append(String.format(headerFormat, "Op Name", "Op", "Count", "Total uS", "%", "Min", "Max", "Std"));<NEW_LINE>String format = "%-" + longestName + "s%-" + longestOpName + "s%-10d%-10d%-10.2f%-10d%-10d%-10.2f\n";<NEW_LINE>for (String s : l) {<NEW_LINE>OpStats st = stats.get(s);<NEW_LINE>double pc = (100.0 * st.getSumUs()) / allOpsUs;<NEW_LINE>INDArray arr = st.getTimesUs().array();<NEW_LINE>long min = arr<MASK><NEW_LINE>long max = arr.maxNumber().longValue();<NEW_LINE>double std = arr.stdNumber().doubleValue();<NEW_LINE>sb.append(String.format(format, s, st.getOpName(), st.getCount(), st.getSumUs(), pc, min, max, std));<NEW_LINE>}<NEW_LINE>return sb.toString();<NEW_LINE>} | .minNumber().longValue(); |
1,608,876 | public static ListFlowJobResponse unmarshall(ListFlowJobResponse listFlowJobResponse, UnmarshallerContext _ctx) {<NEW_LINE>listFlowJobResponse.setRequestId(_ctx.stringValue("ListFlowJobResponse.RequestId"));<NEW_LINE>listFlowJobResponse.setPageNumber(_ctx.integerValue("ListFlowJobResponse.PageNumber"));<NEW_LINE>listFlowJobResponse.setPageSize(_ctx.integerValue("ListFlowJobResponse.PageSize"));<NEW_LINE>listFlowJobResponse.setTotal(_ctx.integerValue("ListFlowJobResponse.Total"));<NEW_LINE>List<Job> jobList = new ArrayList<Job>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListFlowJobResponse.JobList.Length"); i++) {<NEW_LINE>Job job = new Job();<NEW_LINE>job.setId(_ctx.stringValue("ListFlowJobResponse.JobList[" + i + "].Id"));<NEW_LINE>job.setGmtCreate(_ctx.longValue("ListFlowJobResponse.JobList[" + i + "].GmtCreate"));<NEW_LINE>job.setGmtModified(_ctx.longValue("ListFlowJobResponse.JobList[" + i + "].GmtModified"));<NEW_LINE>job.setName(_ctx.stringValue("ListFlowJobResponse.JobList[" + i + "].Name"));<NEW_LINE>job.setType(_ctx.stringValue("ListFlowJobResponse.JobList[" + i + "].Type"));<NEW_LINE>job.setDescription(_ctx.stringValue("ListFlowJobResponse.JobList[" + i + "].Description"));<NEW_LINE>job.setFailAct(_ctx.stringValue("ListFlowJobResponse.JobList[" + i + "].FailAct"));<NEW_LINE>job.setMaxRetry(_ctx.integerValue("ListFlowJobResponse.JobList[" + i + "].MaxRetry"));<NEW_LINE>job.setRetryInterval(_ctx.longValue("ListFlowJobResponse.JobList[" + i + "].RetryInterval"));<NEW_LINE>job.setParams(_ctx.stringValue("ListFlowJobResponse.JobList[" + i + "].Params"));<NEW_LINE>job.setParamConf(_ctx.stringValue<MASK><NEW_LINE>job.setCustomVariables(_ctx.stringValue("ListFlowJobResponse.JobList[" + i + "].CustomVariables"));<NEW_LINE>job.setEnvConf(_ctx.stringValue("ListFlowJobResponse.JobList[" + i + "].EnvConf"));<NEW_LINE>job.setRunConf(_ctx.stringValue("ListFlowJobResponse.JobList[" + i + "].RunConf"));<NEW_LINE>job.setMonitorConf(_ctx.stringValue("ListFlowJobResponse.JobList[" + i + "].MonitorConf"));<NEW_LINE>job.setCategoryId(_ctx.stringValue("ListFlowJobResponse.JobList[" + i + "].CategoryId"));<NEW_LINE>job.setMode(_ctx.stringValue("ListFlowJobResponse.JobList[" + i + "].mode"));<NEW_LINE>job.setAdhoc(_ctx.stringValue("ListFlowJobResponse.JobList[" + i + "].Adhoc"));<NEW_LINE>job.setAlertConf(_ctx.stringValue("ListFlowJobResponse.JobList[" + i + "].AlertConf"));<NEW_LINE>job.setLastInstanceDetail(_ctx.stringValue("ListFlowJobResponse.JobList[" + i + "].LastInstanceDetail"));<NEW_LINE>List<Resource> resourceList = new ArrayList<Resource>();<NEW_LINE>for (int j = 0; j < _ctx.lengthValue("ListFlowJobResponse.JobList[" + i + "].ResourceList.Length"); j++) {<NEW_LINE>Resource resource = new Resource();<NEW_LINE>resource.setPath(_ctx.stringValue("ListFlowJobResponse.JobList[" + i + "].ResourceList[" + j + "].Path"));<NEW_LINE>resource.setAlias(_ctx.stringValue("ListFlowJobResponse.JobList[" + i + "].ResourceList[" + j + "].Alias"));<NEW_LINE>resourceList.add(resource);<NEW_LINE>}<NEW_LINE>job.setResourceList(resourceList);<NEW_LINE>jobList.add(job);<NEW_LINE>}<NEW_LINE>listFlowJobResponse.setJobList(jobList);<NEW_LINE>return listFlowJobResponse;<NEW_LINE>} | ("ListFlowJobResponse.JobList[" + i + "].ParamConf")); |
165,832 | public TimerCanceledEventAttributes unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>TimerCanceledEventAttributes timerCanceledEventAttributes = new TimerCanceledEventAttributes();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE><MASK><NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("timerId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>timerCanceledEventAttributes.setTimerId(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("startedEventId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>timerCanceledEventAttributes.setStartedEventId(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("decisionTaskCompletedEventId", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>timerCanceledEventAttributes.setDecisionTaskCompletedEventId(context.getUnmarshaller(Long.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return timerCanceledEventAttributes;<NEW_LINE>} | JsonToken token = context.getCurrentToken(); |
1,159,567 | public void updatePosition(PlaybackPositionEvent event) {<NEW_LINE>if (controller == null || txtvPosition == null || txtvLength == null || sbPosition == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>TimeSpeedConverter converter = new TimeSpeedConverter(controller.getCurrentPlaybackSpeedMultiplier());<NEW_LINE>int currentPosition = converter.convert(event.getPosition());<NEW_LINE>int duration = converter.convert(event.getDuration());<NEW_LINE>int remainingTime = converter.convert(Math.max(event.getDuration() - event.getPosition(), 0));<NEW_LINE>currentChapterIndex = ChapterUtils.getCurrentChapterIndex(controller.getMedia(), currentPosition);<NEW_LINE>Log.d(TAG, "currentPosition " <MASK><NEW_LINE>if (currentPosition == PlaybackService.INVALID_TIME || duration == PlaybackService.INVALID_TIME) {<NEW_LINE>Log.w(TAG, "Could not react to position observer update because of invalid time");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>txtvPosition.setText(Converter.getDurationStringLong(currentPosition));<NEW_LINE>showTimeLeft = UserPreferences.shouldShowRemainingTime();<NEW_LINE>if (showTimeLeft) {<NEW_LINE>txtvLength.setText(((remainingTime > 0) ? "-" : "") + Converter.getDurationStringLong(remainingTime));<NEW_LINE>} else {<NEW_LINE>txtvLength.setText(Converter.getDurationStringLong(duration));<NEW_LINE>}<NEW_LINE>if (!sbPosition.isPressed()) {<NEW_LINE>float progress = ((float) event.getPosition()) / event.getDuration();<NEW_LINE>sbPosition.setProgress((int) (progress * sbPosition.getMax()));<NEW_LINE>}<NEW_LINE>} | + Converter.getDurationStringLong(currentPosition)); |
1,661,812 | public VehicleRentalVehicle mapFreeVehicleStatus(GBFSBike vehicle) {<NEW_LINE>if ((vehicle.getStationId() == null || vehicle.getStationId().isBlank()) && vehicle.getLon() != null && vehicle.getLat() != null) {<NEW_LINE>VehicleRentalVehicle rentalVehicle = new VehicleRentalVehicle();<NEW_LINE>rentalVehicle.id = new FeedScopedId(system.systemId, vehicle.getBikeId());<NEW_LINE>rentalVehicle.system = system;<NEW_LINE>rentalVehicle.name = new <MASK><NEW_LINE>rentalVehicle.longitude = vehicle.getLon();<NEW_LINE>rentalVehicle.latitude = vehicle.getLat();<NEW_LINE>rentalVehicle.vehicleType = vehicleTypes == null ? RentalVehicleType.getDefaultType(system.systemId) : vehicleTypes.get(vehicle.getVehicleTypeId());<NEW_LINE>rentalVehicle.isReserved = vehicle.getIsReserved() != null ? vehicle.getIsReserved() : false;<NEW_LINE>rentalVehicle.isDisabled = vehicle.getIsDisabled() != null ? vehicle.getIsDisabled() : false;<NEW_LINE>rentalVehicle.lastReported = vehicle.getLastReported() != null ? Instant.ofEpochSecond((long) (double) vehicle.getLastReported()).atZone(system.timezone.toZoneId()) : null;<NEW_LINE>rentalVehicle.currentRangeMeters = vehicle.getCurrentRangeMeters();<NEW_LINE>rentalVehicle.pricingPlanId = vehicle.getPricingPlanId();<NEW_LINE>GBFSRentalUris rentalUris = vehicle.getRentalUris();<NEW_LINE>if (rentalUris != null) {<NEW_LINE>String androidUri = rentalUris.getAndroid();<NEW_LINE>String iosUri = rentalUris.getIos();<NEW_LINE>String webUri = rentalUris.getWeb();<NEW_LINE>rentalVehicle.rentalUris = new VehicleRentalStationUris(androidUri, iosUri, webUri);<NEW_LINE>}<NEW_LINE>return rentalVehicle;<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>} | NonLocalizedString(vehicle.getBikeId()); |
152,829 | public Response conformance() throws IOException {<NEW_LINE>setUpPostConstruct();<NEW_LINE>Builder request = getRequest(<MASK><NEW_LINE>IRestfulResponse response = request.build().getResponse();<NEW_LINE>response.addHeader(Constants.HEADER_CORS_ALLOW_ORIGIN, "*");<NEW_LINE>IBaseResource conformance;<NEW_LINE>FhirVersionEnum fhirContextVersion = super.getFhirContext().getVersion().getVersion();<NEW_LINE>switch(fhirContextVersion) {<NEW_LINE>case R4:<NEW_LINE>conformance = myR4CapabilityStatement;<NEW_LINE>break;<NEW_LINE>case DSTU3:<NEW_LINE>conformance = myDstu3CapabilityStatement;<NEW_LINE>break;<NEW_LINE>case DSTU2_1:<NEW_LINE>conformance = myDstu2_1Conformance;<NEW_LINE>break;<NEW_LINE>case DSTU2_HL7ORG:<NEW_LINE>conformance = myDstu2Hl7OrgConformance;<NEW_LINE>break;<NEW_LINE>case DSTU2:<NEW_LINE>conformance = myDstu2Conformance;<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new ConfigurationException(Msg.code(592) + "Unsupported Fhir version: " + fhirContextVersion);<NEW_LINE>}<NEW_LINE>if (conformance != null) {<NEW_LINE>Set<SummaryEnum> summaryMode = Collections.emptySet();<NEW_LINE>return (Response) response.streamResponseAsResource(conformance, false, summaryMode, Constants.STATUS_HTTP_200_OK, null, true, false);<NEW_LINE>}<NEW_LINE>return (Response) response.returnResponse(null, Constants.STATUS_HTTP_500_INTERNAL_ERROR, true, null, getResourceType().getSimpleName());<NEW_LINE>} | RequestTypeEnum.OPTIONS, RestOperationTypeEnum.METADATA); |
935,704 | public static Message.CompareType parseCompareType(Predicate predicate, BiPredicate<?, ?> biPredicate) {<NEW_LINE>if (predicate instanceof RegexPredicate) {<NEW_LINE>return Message.CompareType.REGEX;<NEW_LINE>} else if (predicate instanceof StringPredicate) {<NEW_LINE>MatchType matchType = StringPredicate.class.<MASK><NEW_LINE>return Message.CompareType.valueOf(StringUtils.upperCase(matchType.name()));<NEW_LINE>} else if (predicate instanceof ListPredicate) {<NEW_LINE>ListMatchType listMatchType = ListPredicate.class.cast(predicate).getMatchType();<NEW_LINE>return Message.CompareType.valueOf(StringUtils.upperCase(listMatchType.name()));<NEW_LINE>} else if (biPredicate instanceof Compare) {<NEW_LINE>Compare compare = Compare.class.cast(biPredicate);<NEW_LINE>return Message.CompareType.valueOf(StringUtils.upperCase(compare.name()));<NEW_LINE>} else if (biPredicate instanceof Contains) {<NEW_LINE>Contains contains = Contains.class.cast(biPredicate);<NEW_LINE>return Message.CompareType.valueOf(StringUtils.upperCase(contains.name()));<NEW_LINE>} else {<NEW_LINE>throw new UnsupportedOperationException(biPredicate.toString());<NEW_LINE>}<NEW_LINE>} | cast(predicate).getMatchType(); |
90,829 | public void run(RegressionEnvironment env) {<NEW_LINE>String[] fields = "myrate,myqtyrate".split(",");<NEW_LINE>String epl = "@name('s0') select RATE(longPrimitive) as myrate, RATE(longPrimitive, intPrimitive) as myqtyrate from SupportBean#length(3)";<NEW_LINE>env.compileDeploy(epl).addListener("s0");<NEW_LINE>sendEvent(env, 1000, 10);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { null, null });<NEW_LINE>env.milestone(0);<NEW_LINE><MASK><NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { null, null });<NEW_LINE>sendEvent(env, 1300, 0);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { null, null });<NEW_LINE>env.milestone(1);<NEW_LINE>sendEvent(env, 1500, 14);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 3 * 1000 / 500d, 14 * 1000 / 500d });<NEW_LINE>env.milestone(2);<NEW_LINE>sendEvent(env, 2000, 11);<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { 3 * 1000 / 800d, 25 * 1000 / 800d });<NEW_LINE>env.tryInvalidCompile("select rate(longPrimitive) as myrate from SupportBean", "Failed to validate select-clause expression 'rate(longPrimitive)': The rate aggregation function in the timestamp-property notation requires data windows [select rate(longPrimitive) as myrate from SupportBean]");<NEW_LINE>env.tryInvalidCompile("select rate(current_timestamp) as myrate from SupportBean#time(20)", "Failed to validate select-clause expression 'rate(current_timestamp())': The rate aggregation function does not allow the current runtime timestamp as a parameter [select rate(current_timestamp) as myrate from SupportBean#time(20)]");<NEW_LINE>env.tryInvalidCompile("select rate(theString) as myrate from SupportBean#time(20)", "Failed to validate select-clause expression 'rate(theString)': The rate aggregation function requires a property or expression returning a non-constant long-type value as the first parameter in the timestamp-property notation [select rate(theString) as myrate from SupportBean#time(20)]");<NEW_LINE>env.undeployAll();<NEW_LINE>} | sendEvent(env, 1200, 0); |
1,459,477 | private static void writeEntry(String name, Set<String> written, ZipOutputStream zos, File f) throws IOException, FileNotFoundException {<NEW_LINE>if (!written.add(name)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int idx = name.lastIndexOf('/', name.length() - 2);<NEW_LINE>if (idx != -1) {<NEW_LINE>writeEntry(name.substring(0, idx + 1), written, zos, f.getParentFile());<NEW_LINE>}<NEW_LINE>ZipEntry ze = new ZipEntry(name);<NEW_LINE>ze.setTime(f.lastModified());<NEW_LINE>if (name.endsWith("/")) {<NEW_LINE>ze.setMethod(ZipEntry.STORED);<NEW_LINE>ze.setSize(0);<NEW_LINE>ze.setCrc(0);<NEW_LINE>zos.putNextEntry(ze);<NEW_LINE>} else {<NEW_LINE>InputStream is = new FileInputStream(f);<NEW_LINE>ze.setMethod(ZipEntry.DEFLATED);<NEW_LINE>ze.<MASK><NEW_LINE>CRC32 crc = new CRC32();<NEW_LINE>try {<NEW_LINE>copyStreams(is, null, crc);<NEW_LINE>} finally {<NEW_LINE>is.close();<NEW_LINE>}<NEW_LINE>ze.setCrc(crc.getValue());<NEW_LINE>zos.putNextEntry(ze);<NEW_LINE>InputStream zis = new FileInputStream(f);<NEW_LINE>try {<NEW_LINE>copyStreams(zis, zos, null);<NEW_LINE>} finally {<NEW_LINE>zis.close();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | setSize(f.length()); |
541,165 | public void parse(String webAppRoot, String xpath, XMLParseHandler handler, XMLNodeType... xmlNodeTypes) {<NEW_LINE>// 1. select descriptor collector<NEW_LINE>DescriptorCollector dc = selectDescriptorCollector(xpath);<NEW_LINE>// 2. load descriptor files<NEW_LINE>this.load(webAppRoot);<NEW_LINE>// 3. select node list<NEW_LINE>List<NodeList> cfgs = this.selectXMLNodeSet(xpath);<NEW_LINE>Set<Short> set <MASK><NEW_LINE>for (XMLNodeType t : xmlNodeTypes) {<NEW_LINE>set.add(t.getIndex());<NEW_LINE>}<NEW_LINE>for (NodeList nl : cfgs) {<NEW_LINE>for (int i = 0; i < nl.getLength(); i++) {<NEW_LINE>Node node = nl.item(i);<NEW_LINE>short type = node.getNodeType();<NEW_LINE>if (set.contains(type)) {<NEW_LINE>if (!handler.parse(dc, node)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | = new HashSet<Short>(); |
893,238 | Connection compute() {<NEW_LINE>Connection connection;<NEW_LINE>try {<NEW_LINE>connection = (builder.addresses == null) ? builder.connectionFactory.newConnection() : builder.<MASK><NEW_LINE>declareQueueIfMissing(connection);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UncheckedIOException("Unable to establish connection to RabbitMQ server: " + e.getMessage(), e);<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>throw new RuntimeException("Timeout establishing connection to RabbitMQ server: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>Collector collector = builder.delegate.build();<NEW_LINE>CollectorMetrics metrics = builder.metrics;<NEW_LINE>for (int i = 0; i < builder.concurrency; i++) {<NEW_LINE>String consumerTag = "zipkin-rabbitmq." + i;<NEW_LINE>try {<NEW_LINE>// this sets up a channel for each consumer thread.<NEW_LINE>// We don't track channels, as the connection will close its channels implicitly<NEW_LINE>Channel channel = connection.createChannel();<NEW_LINE>RabbitMQSpanConsumer consumer = new RabbitMQSpanConsumer(channel, collector, metrics);<NEW_LINE>channel.basicConsume(builder.queue, true, consumerTag, consumer);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new IllegalStateException("Failed to start RabbitMQ consumer " + consumerTag, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return connection;<NEW_LINE>} | connectionFactory.newConnection(builder.addresses); |
1,207,856 | private Parameter bodyParameter(RequestParameter source, ModelNamesRegistry namesRegistry) {<NEW_LINE>Model schema = toSchema(source, namesRegistry);<NEW_LINE>if (schema != null && source.getScalarExample() != null) {<NEW_LINE>schema.setExample(String.valueOf(source.getScalarExample().getValue()));<NEW_LINE>}<NEW_LINE>BodyParameter parameter = new BodyParameter().description(source.getDescription()).name(source.getName()).schema(schema);<NEW_LINE>parameter.setIn(source.getIn().getIn());<NEW_LINE>parameter.setRequired(source.getRequired());<NEW_LINE>parameter.getVendorExtensions().putAll(VENDOR_EXTENSIONS_MAPPER.mapExtensions(source.getExtensions()));<NEW_LINE>for (Example example : source.getExamples()) {<NEW_LINE>if (example.getValue() != null) {<NEW_LINE>// Form parameters only support a single example<NEW_LINE>parameter.example(example.getMediaType().orElse("default"), String.valueOf<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return parameter;<NEW_LINE>} | (example.getValue())); |
29,651 | public BaseRowTypeInfo buildOutRowTypeInfo(List<FieldInfo> sideJoinFieldInfo, HashBasedTable<String, String, String> mappingTable) {<NEW_LINE>// TypeInformation[] sideOutTypes = new TypeInformation[sideJoinFieldInfo.size()];<NEW_LINE>LogicalType[] sideOutTypes = new <MASK><NEW_LINE>String[] sideOutNames = new String[sideJoinFieldInfo.size()];<NEW_LINE>for (int i = 0; i < sideJoinFieldInfo.size(); i++) {<NEW_LINE>FieldInfo fieldInfo = sideJoinFieldInfo.get(i);<NEW_LINE>String tableName = fieldInfo.getTable();<NEW_LINE>String fieldName = fieldInfo.getFieldName();<NEW_LINE>String mappingFieldName = mappingTable.get(tableName, fieldName);<NEW_LINE>Preconditions.checkNotNull(mappingFieldName, fieldInfo + " not mapping any field! it may be frame bug");<NEW_LINE>sideOutTypes[i] = fieldInfo.getLogicalType();<NEW_LINE>sideOutNames[i] = mappingFieldName;<NEW_LINE>}<NEW_LINE>return new BaseRowTypeInfo(sideOutTypes, sideOutNames);<NEW_LINE>} | LogicalType[sideJoinFieldInfo.size()]; |
971,962 | public JSONObject jsonSerialize() {<NEW_LINE>JSONObject json = new JSONObject();<NEW_LINE>JsonUtil.<MASK><NEW_LINE>JsonUtil.putIfNotNull(json, KEY_SCOPE, mScope);<NEW_LINE>if (mConfig != null) {<NEW_LINE>JsonUtil.put(json, KEY_CONFIG, mConfig.toJson());<NEW_LINE>}<NEW_LINE>if (mAuthorizationException != null) {<NEW_LINE>JsonUtil.put(json, KEY_AUTHORIZATION_EXCEPTION, mAuthorizationException.toJson());<NEW_LINE>}<NEW_LINE>if (mLastAuthorizationResponse != null) {<NEW_LINE>JsonUtil.put(json, KEY_LAST_AUTHORIZATION_RESPONSE, mLastAuthorizationResponse.jsonSerialize());<NEW_LINE>}<NEW_LINE>if (mLastTokenResponse != null) {<NEW_LINE>JsonUtil.put(json, KEY_LAST_TOKEN_RESPONSE, mLastTokenResponse.jsonSerialize());<NEW_LINE>}<NEW_LINE>if (mLastRegistrationResponse != null) {<NEW_LINE>JsonUtil.put(json, KEY_LAST_REGISTRATION_RESPONSE, mLastRegistrationResponse.jsonSerialize());<NEW_LINE>}<NEW_LINE>return json;<NEW_LINE>} | putIfNotNull(json, KEY_REFRESH_TOKEN, mRefreshToken); |
937,958 | public HttpClient build(AdapterHttpClientConfig adapterConfig) {<NEW_LINE>// disable cookie cache as we don't want sticky sessions for load balancing<NEW_LINE>disableCookieCache(true);<NEW_LINE>String truststorePath = adapterConfig.getTruststore();<NEW_LINE>if (truststorePath != null) {<NEW_LINE><MASK><NEW_LINE>String truststorePassword = adapterConfig.getTruststorePassword();<NEW_LINE>try {<NEW_LINE>this.truststore = KeystoreUtil.loadKeyStore(truststorePath, truststorePassword);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Failed to load truststore", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String clientKeystore = adapterConfig.getClientKeystore();<NEW_LINE>if (clientKeystore != null) {<NEW_LINE>clientKeystore = EnvUtil.replace(clientKeystore);<NEW_LINE>String clientKeystorePassword = adapterConfig.getClientKeystorePassword();<NEW_LINE>try {<NEW_LINE>KeyStore clientCertKeystore = KeystoreUtil.loadKeyStore(clientKeystore, clientKeystorePassword);<NEW_LINE>keyStore(clientCertKeystore, clientKeystorePassword);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException("Failed to load keystore", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int size = 10;<NEW_LINE>if (adapterConfig.getConnectionPoolSize() > 0)<NEW_LINE>size = adapterConfig.getConnectionPoolSize();<NEW_LINE>HttpClientBuilder.HostnameVerificationPolicy policy = HttpClientBuilder.HostnameVerificationPolicy.WILDCARD;<NEW_LINE>if (adapterConfig.isAllowAnyHostname())<NEW_LINE>policy = HttpClientBuilder.HostnameVerificationPolicy.ANY;<NEW_LINE>connectionPoolSize(size);<NEW_LINE>hostnameVerification(policy);<NEW_LINE>if (adapterConfig.isDisableTrustManager()) {<NEW_LINE>disableTrustManager();<NEW_LINE>} else {<NEW_LINE>trustStore(truststore);<NEW_LINE>}<NEW_LINE>configureProxyForAuthServerIfProvided(adapterConfig);<NEW_LINE>if (socketTimeout == -1 && adapterConfig.getSocketTimeout() > 0) {<NEW_LINE>socketTimeout(adapterConfig.getSocketTimeout(), TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>if (establishConnectionTimeout == -1 && adapterConfig.getConnectionTimeout() > 0) {<NEW_LINE>establishConnectionTimeout(adapterConfig.getConnectionTimeout(), TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>if (connectionTTL == -1 && adapterConfig.getConnectionTTL() > 0) {<NEW_LINE>connectionTTL(adapterConfig.getConnectionTTL(), TimeUnit.MILLISECONDS);<NEW_LINE>}<NEW_LINE>return build();<NEW_LINE>} | truststorePath = EnvUtil.replace(truststorePath); |
1,067,618 | public DimensionContribution unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>DimensionContribution dimensionContribution = new DimensionContribution();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("DimensionName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dimensionContribution.setDimensionName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("DimensionValueContributionList", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>dimensionContribution.setDimensionValueContributionList(new ListUnmarshaller<DimensionValueContribution>(DimensionValueContributionJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return dimensionContribution;<NEW_LINE>} | String currentParentElement = context.getCurrentParentElement(); |
693,074 | private void _load() {<NEW_LINE>World w;<NEW_LINE>try {<NEW_LINE>FileInputStream fis = new FileInputStream(currTest.getFilename());<NEW_LINE>w = currTest.getDeserializer().deserializeWorld(fis);<NEW_LINE>fis.close();<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE><MASK><NEW_LINE>if (errorHandler != null)<NEW_LINE>errorHandler.serializationError(e, "File not found exception while loading: " + currTest.getFilename());<NEW_LINE>return;<NEW_LINE>} catch (UnsupportedObjectException e) {<NEW_LINE>log.error("Error deserializing object", e);<NEW_LINE>if (errorHandler != null)<NEW_LINE>errorHandler.serializationError(e, "Error deserializing the object: " + e.toString());<NEW_LINE>return;<NEW_LINE>} catch (IOException e) {<NEW_LINE>log.error("Exception while reading world", e);<NEW_LINE>if (errorHandler != null)<NEW_LINE>errorHandler.serializationError(e, "Error while reading world: " + e.toString());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>log.debug("Deserialized world from " + currTest.getFilename());<NEW_LINE>currTest.init(w, true);<NEW_LINE>} | log.error("File not found error while loading", e); |
1,828,664 | public void execute(@Named(IServiceConstants.ACTIVE_PART) MPart part, @Named(IServiceConstants.ACTIVE_SHELL) Shell shell, @Named(E4Workbench.INSTANCE_LOCATION) Location instanceLocation) {<NEW_LINE>FileDialog dialog = new FileDialog(shell, SWT.SAVE);<NEW_LINE>dialog.setOverwrite(true);<NEW_LINE>// $NON-NLS-1$<NEW_LINE>dialog.setFileName(MessageFormat.format("pp-error-{0}.log", LocalDate.now().toString()));<NEW_LINE>// $NON-NLS-1$<NEW_LINE>dialog.setFilterPath(System.getProperty("user.home"));<NEW_LINE><MASK><NEW_LINE>if (path == null)<NEW_LINE>return;<NEW_LINE>// $NON-NLS-1$<NEW_LINE>File logfile = new File(instanceLocation.getURL().getFile(), ".metadata/.log");<NEW_LINE>if (!logfile.exists()) {<NEW_LINE>MessageDialog.openError(shell, Messages.LabelError, MessageFormat.format(Messages.MsgErrorOpeningFile, logfile.getAbsoluteFile()));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>Files.copy(logfile.toPath(), new File(path).toPath(), StandardCopyOption.REPLACE_EXISTING);<NEW_LINE>} catch (IOException e) {<NEW_LINE>PortfolioPlugin.log(e);<NEW_LINE>MessageDialog.openError(shell, Messages.LabelError, e.getMessage());<NEW_LINE>}<NEW_LINE>} | String path = dialog.open(); |
920,826 | final CreateSipMediaApplicationCallResult executeCreateSipMediaApplicationCall(CreateSipMediaApplicationCallRequest createSipMediaApplicationCallRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createSipMediaApplicationCallRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateSipMediaApplicationCallRequest> request = null;<NEW_LINE>Response<CreateSipMediaApplicationCallResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateSipMediaApplicationCallRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createSipMediaApplicationCallRequest));<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, "Chime");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateSipMediaApplicationCall");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateSipMediaApplicationCallResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>} | false), new CreateSipMediaApplicationCallResultJsonUnmarshaller()); |
509,774 | protected IRODSFileSystem configure(final IRODSFileSystem client) {<NEW_LINE>final SettableJargonProperties properties = new SettableJargonProperties(client.getJargonProperties());<NEW_LINE>properties.setEncoding(host.getEncoding());<NEW_LINE>final <MASK><NEW_LINE>final int timeout = ConnectionTimeoutFactory.get(preferences).getTimeout() * 1000;<NEW_LINE>properties.setIrodsSocketTimeout(timeout);<NEW_LINE>properties.setIrodsParallelSocketTimeout(timeout);<NEW_LINE>properties.setGetBufferSize(preferences.getInteger("connection.chunksize"));<NEW_LINE>properties.setPutBufferSize(preferences.getInteger("connection.chunksize"));<NEW_LINE>if (log.isDebugEnabled()) {<NEW_LINE>log.debug(String.format("Configure client %s with properties %s", client, properties));<NEW_LINE>}<NEW_LINE>client.getIrodsSession().setJargonProperties(properties);<NEW_LINE>client.getIrodsSession().setX509TrustManager(trust);<NEW_LINE>return client;<NEW_LINE>} | PreferencesReader preferences = new HostPreferences(host); |
497,049 | private void serveSwaggerUiHtml(ServletRequestDetails theRequestDetails, HttpServletResponse theResponse) throws IOException {<NEW_LINE>CapabilityStatement cs = getCapabilityStatement(theRequestDetails);<NEW_LINE>String baseUrl = removeTrailingSlash(cs.getImplementation().getUrl());<NEW_LINE>theResponse.setStatus(200);<NEW_LINE>theResponse.setContentType(Constants.CT_HTML);<NEW_LINE>HttpServletRequest servletRequest = theRequestDetails.getServletRequest();<NEW_LINE>ServletContext servletContext = servletRequest.getServletContext();<NEW_LINE>WebContext context = new WebContext(servletRequest, theResponse, servletContext);<NEW_LINE>context.setVariable(REQUEST_DETAILS, theRequestDetails);<NEW_LINE>context.setVariable("DESCRIPTION", cs.getImplementation().getDescription());<NEW_LINE>context.setVariable("SERVER_NAME", cs.getSoftware().getName());<NEW_LINE>context.setVariable("SERVER_VERSION", cs.getSoftware().getVersion());<NEW_LINE>context.setVariable("BASE_URL", cs.getImplementation().getUrl());<NEW_LINE>context.setVariable("BANNER_IMAGE_URL", getBannerImage());<NEW_LINE>context.setVariable("OPENAPI_DOCS", baseUrl + "/api-docs");<NEW_LINE>context.setVariable("FHIR_VERSION", cs.getFhirVersion().toCode());<NEW_LINE>context.setVariable("FHIR_VERSION_CODENAME", FhirVersionEnum.forVersionString(cs.getFhirVersion().toCode()).name());<NEW_LINE>String copyright = cs.getCopyright();<NEW_LINE>if (isNotBlank(copyright)) {<NEW_LINE>copyright = myFlexmarkRenderer.render(myFlexmarkParser.parse(copyright));<NEW_LINE>context.setVariable("COPYRIGHT_HTML", copyright);<NEW_LINE>}<NEW_LINE>List<String> pageNames = new ArrayList<>();<NEW_LINE>Map<String, Integer> resourceToCount = new HashMap<>();<NEW_LINE>cs.getRestFirstRep().getResource().stream().forEach(t -> {<NEW_LINE>String type = t.getType();<NEW_LINE>pageNames.add(type);<NEW_LINE>Extension countExtension = t.getExtensionByUrl(ExtensionConstants.CONF_RESOURCE_COUNT);<NEW_LINE>if (countExtension != null) {<NEW_LINE>IPrimitiveType<? extends Number> countExtensionValue = (IPrimitiveType<? extends Number>) countExtension.getValueAsPrimitive();<NEW_LINE>if (countExtensionValue != null && countExtensionValue.hasValue()) {<NEW_LINE>resourceToCount.put(type, countExtensionValue.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>pageNames.sort((o1, o2) -> {<NEW_LINE>Integer count1 = resourceToCount.get(o1);<NEW_LINE>Integer count2 = resourceToCount.get(o2);<NEW_LINE>if (count1 != null && count2 != null) {<NEW_LINE>return count2 - count1;<NEW_LINE>}<NEW_LINE>if (count1 != null) {<NEW_LINE>return -1;<NEW_LINE>}<NEW_LINE>if (count2 != null) {<NEW_LINE>return 1;<NEW_LINE>}<NEW_LINE>return o1.compareTo(o2);<NEW_LINE>});<NEW_LINE>pageNames.add(0, PAGE_ALL);<NEW_LINE>pageNames.add(1, PAGE_SYSTEM);<NEW_LINE>context.setVariable("PAGE_NAMES", pageNames);<NEW_LINE>context.setVariable("PAGE_NAME_TO_COUNT", resourceToCount);<NEW_LINE>String page = extractPageName(theRequestDetails, PAGE_SYSTEM);<NEW_LINE>context.setVariable("PAGE", page);<NEW_LINE>populateOIDCVariables(theRequestDetails, context);<NEW_LINE>String outcome = myTemplateEngine.process("index.html", context);<NEW_LINE>theResponse.getWriter().write(outcome);<NEW_LINE>theResponse.getWriter().close();<NEW_LINE>} | getValue().intValue()); |
215,548 | public void translate(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>TranslationHelpers.checkTranslationArguments(<MASK><NEW_LINE>final List<? extends IOperandTree> operands = instruction.getOperands();<NEW_LINE>final String rs = operands.get(0).getRootNode().getChildren().get(0).getValue();<NEW_LINE>final IOperandTreeNode target = operands.get(1).getRootNode().getChildren().get(0);<NEW_LINE>final long baseOffset = ReilHelpers.toReilAddress(instruction.getAddress()).toLong();<NEW_LINE>long offset = baseOffset;<NEW_LINE>final OperandSize dw = OperandSize.DWORD;<NEW_LINE>final String isolatedSign = environment.getNextVariableString();<NEW_LINE>instructions.add(ReilHelpers.createAnd(offset++, dw, rs, dw, String.valueOf(0x80000000L), dw, isolatedSign));<NEW_LINE>Helpers.generateDelayBranch(instructions, offset, dw, isolatedSign, dw, target);<NEW_LINE>} | environment, instruction, instructions, "bltz"); |
33,642 | SetBuilderImpl<E> add(E e) {<NEW_LINE>checkNotNull(e);<NEW_LINE><MASK><NEW_LINE>int i0 = Hashing.smear(eHash);<NEW_LINE>int mask = hashTable.length - 1;<NEW_LINE>for (int i = i0; i - i0 < maxRunBeforeFallback; i++) {<NEW_LINE>int index = i & mask;<NEW_LINE>Object tableEntry = hashTable[index];<NEW_LINE>if (tableEntry == null) {<NEW_LINE>addDedupedElement(e);<NEW_LINE>hashTable[index] = e;<NEW_LINE>hashCode += eHash;<NEW_LINE>// rebuilds table if necessary<NEW_LINE>ensureTableCapacity(distinct);<NEW_LINE>return this;<NEW_LINE>} else if (tableEntry.equals(e)) {<NEW_LINE>// not a new element, ignore<NEW_LINE>return this;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// we fell out of the loop due to a long run; fall back to JDK impl<NEW_LINE>return new JdkBackedSetBuilderImpl<E>(this).add(e);<NEW_LINE>} | int eHash = e.hashCode(); |
1,195,148 | public void renderSlotHighlights(@Nonnull IoMode mode) {<NEW_LINE>Map<Slot, Point> slotLocations = getInventory().getSlotLocations();<NEW_LINE>for (Slot slot : slotLocations.keySet()) {<NEW_LINE>if (slot instanceof EnderSlot) {<NEW_LINE>Type type = ((<MASK><NEW_LINE>if (mode == IoMode.PULL) {<NEW_LINE>if (type == EnderInventory.Type.INPUT || type == EnderInventory.Type.INOUT) {<NEW_LINE>renderSlotHighlight(slot, PULL_COLOR);<NEW_LINE>}<NEW_LINE>} else if (mode == IoMode.PUSH) {<NEW_LINE>if (type == EnderInventory.Type.OUTPUT || type == EnderInventory.Type.INOUT) {<NEW_LINE>renderSlotHighlight(slot, PUSH_COLOR);<NEW_LINE>}<NEW_LINE>} else if (mode == IoMode.PUSH_PULL) {<NEW_LINE>if (type == EnderInventory.Type.INPUT) {<NEW_LINE>renderSlotHighlight(slot, PULL_COLOR);<NEW_LINE>} else if (type == EnderInventory.Type.OUTPUT) {<NEW_LINE>renderSlotHighlight(slot, PUSH_COLOR);<NEW_LINE>} else if (type == EnderInventory.Type.INOUT) {<NEW_LINE>renderSplitHighlight(slot);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | EnderSlot) slot).getType(); |
1,049,088 | public // The caller need to hold the table write lock<NEW_LINE>void modifyTableReplicaAllocation(Database db, OlapTable table, Map<String, String> properties) throws UserException {<NEW_LINE>Preconditions.checkArgument(table.isWriteLockHeldByCurrentThread());<NEW_LINE>String defaultReplicationNumName = "default." + PropertyAnalyzer.PROPERTIES_REPLICATION_NUM;<NEW_LINE>PartitionInfo partitionInfo = table.getPartitionInfo();<NEW_LINE>if (partitionInfo.getType() == PartitionType.RANGE || partitionInfo.getType() == PartitionType.LIST) {<NEW_LINE>throw new DdlException("This is a partitioned table, you should specify partitions" + " with MODIFY PARTITION clause." + " If you want to set default replication number, please use '" + defaultReplicationNumName + "' instead of '" + PropertyAnalyzer.PROPERTIES_REPLICATION_NUM + "' to escape misleading.");<NEW_LINE>}<NEW_LINE>String partitionName = table.getName();<NEW_LINE>Partition partition = table.getPartition(partitionName);<NEW_LINE>if (partition == null) {<NEW_LINE>throw new DdlException("Partition does not exist. name: " + partitionName);<NEW_LINE>}<NEW_LINE>ReplicaAllocation replicaAlloc = <MASK><NEW_LINE>Env.getCurrentSystemInfo().checkReplicaAllocation(db.getClusterName(), replicaAlloc);<NEW_LINE>Preconditions.checkState(!replicaAlloc.isNotSet());<NEW_LINE>boolean isInMemory = partitionInfo.getIsInMemory(partition.getId());<NEW_LINE>DataProperty newDataProperty = partitionInfo.getDataProperty(partition.getId());<NEW_LINE>partitionInfo.setReplicaAllocation(partition.getId(), replicaAlloc);<NEW_LINE>// set table's default replication number.<NEW_LINE>Map<String, String> tblProperties = Maps.newHashMap();<NEW_LINE>tblProperties.put("default." + PropertyAnalyzer.PROPERTIES_REPLICATION_ALLOCATION, replicaAlloc.toCreateStmt());<NEW_LINE>table.setReplicaAllocation(tblProperties);<NEW_LINE>// log<NEW_LINE>ModifyPartitionInfo info = new ModifyPartitionInfo(db.getId(), table.getId(), partition.getId(), newDataProperty, replicaAlloc, isInMemory, partitionInfo.getStoragePolicy(partition.getId()), tblProperties);<NEW_LINE>editLog.logModifyPartition(info);<NEW_LINE>LOG.debug("modify partition[{}-{}-{}] replica allocation to {}", db.getId(), table.getId(), partition.getName(), replicaAlloc.toCreateStmt());<NEW_LINE>} | PropertyAnalyzer.analyzeReplicaAllocation(properties, ""); |
254,903 | protected void testClassLevelRolesAllowedUserInRole(final String baseUri, boolean userRoleFromAppBnd) throws Exception {<NEW_LINE>LOG.entering(clz, "entered testClassLevelRolesAllowedUserInRole");<NEW_LINE>String url = baseUri + "/ClassRolesAllowed";<NEW_LINE>// create the resource instance to interact with<NEW_LINE>LOG.info("testClassLevelRolesAllowedUserInRole about to invoke the resource: " + url);<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder();<NEW_LINE>cb.register(new BasicAuthFilter(userRoleFromAppBnd ? "user1a" : "user1", "user1pwd"));<NEW_LINE>Client c = cb.build();<NEW_LINE>WebTarget t = c.target(url);<NEW_LINE>Response response = t.request().accept("text/plain").get();<NEW_LINE>assertEquals(200, response.getStatus());<NEW_LINE>assertEquals("remotely accessible only to users in Role1", response.readEntity(String.class));<NEW_LINE>c.close();<NEW_LINE>LOG.info("testClassLevelRolesAllowedUserInRole SUCCEEDED");<NEW_LINE><MASK><NEW_LINE>} | LOG.exiting(clz, "exiting testClassLevelRolesAllowedUserInRole exiting"); |
572,668 | public Composite createPreferenceComposite(Composite parent, final IBuildParticipantWorkingCopy participant) {<NEW_LINE>Composite master = new Composite(parent, SWT.NONE);<NEW_LINE>master.setLayout(GridLayoutFactory.fillDefaults().create());<NEW_LINE>GridDataFactory fillHoriz = GridDataFactory.fillDefaults().grab(true, false);<NEW_LINE>// Options<NEW_LINE>Group group = new Group(master, SWT.BORDER);<NEW_LINE>group.setText(Messages.JSParserValidatorPreferenceCompositeFactory_OptionsGroup);<NEW_LINE>group.setLayout(new GridLayout());<NEW_LINE>group.setLayoutData(fillHoriz.create());<NEW_LINE>Composite pairs = new Composite(group, SWT.NONE);<NEW_LINE>pairs.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).create());<NEW_LINE>Label label = new Label(pairs, SWT.WRAP);<NEW_LINE>label.setText(Messages.JSParserValidatorPreferenceCompositeFactory_MissingSemicolons);<NEW_LINE>Combo combo = new Combo(pairs, SWT.READ_ONLY | SWT.SINGLE);<NEW_LINE>for (IProblem.Severity severity : IProblem.Severity.values()) {<NEW_LINE>combo.add(severity.label());<NEW_LINE>combo.setData(<MASK><NEW_LINE>}<NEW_LINE>String severityValue = participant.getPreferenceString(IPreferenceConstants.PREF_MISSING_SEMICOLON_SEVERITY);<NEW_LINE>combo.setText(IProblem.Severity.create(severityValue).label());<NEW_LINE>combo.addSelectionListener(new SelectionAdapter() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void widgetSelected(SelectionEvent e) {<NEW_LINE>Combo c = ((Combo) e.widget);<NEW_LINE>int index = c.getSelectionIndex();<NEW_LINE>String text = c.getItem(index);<NEW_LINE>IProblem.Severity s = (Severity) c.getData(text);<NEW_LINE>participant.setPreference(IPreferenceConstants.PREF_MISSING_SEMICOLON_SEVERITY, s.id());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>fillHoriz.applyTo(pairs);<NEW_LINE>// Filters<NEW_LINE>Composite filtersGroup = new ValidatorFiltersPreferenceComposite(master, participant);<NEW_LINE>filtersGroup.setLayoutData(fillHoriz.grab(true, true).hint(SWT.DEFAULT, 150).create());<NEW_LINE>return master;<NEW_LINE>} | severity.label(), severity); |
1,026,314 | public MessageBody unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>MessageBody messageBody = new MessageBody();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("Message", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>messageBody.setMessage(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("RequestID", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>messageBody.setRequestID(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return messageBody;<NEW_LINE>} | class).unmarshall(context)); |
758,084 | public static void checkMissingRBACInfo() {<NEW_LINE>PolicyMatcher matcher = new PolicyMatcher();<NEW_LINE>List<String> missingInPermission = new ArrayList<>();<NEW_LINE>List<String> missingInRole = new ArrayList<>();<NEW_LINE>APIMessage.apiMessageClasses.forEach(clz -> {<NEW_LINE>if (clz.isAnnotationPresent(Deprecated.class) || clz.isAnnotationPresent(SuppressCredentialCheck.class)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String clzName = clz.getName();<NEW_LINE>boolean has = permissions.parallelStream().anyMatch(p -> p.normalAPIs.stream().anyMatch(s -> matcher.match(s, clzName)) || p.adminOnlyAPIs.stream().anyMatch(s -> matcher.match(s, clzName)));<NEW_LINE>if (!has) {<NEW_LINE>missingInPermission.add(clzName);<NEW_LINE>}<NEW_LINE>has = roles.parallelStream().anyMatch(r -> r.allowedActions.parallelStream().anyMatch(ac -> matcher.match(ac, clzName)) || r.excludedActions.parallelStream().anyMatch(ac -> matcher.<MASK><NEW_LINE>// admin api won't belong to any role<NEW_LINE>if (!has && !isAdminOnlyAPI(clzName)) {<NEW_LINE>missingInRole.add(clzName);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>Collections.sort(missingInPermission);<NEW_LINE>Collections.sort(missingInRole);<NEW_LINE>if (missingInPermission.isEmpty() && missingInRole.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>if (!missingInPermission.isEmpty()) {<NEW_LINE>sb.append(String.format("Below APIs:\n %s not referred in any RBACInfo's permission\n", StringUtils.join(missingInPermission, "\n")));<NEW_LINE>}<NEW_LINE>if (!missingInRole.isEmpty()) {<NEW_LINE>sb.append(String.format("Below APIs:\n %s not referred in any RBACInfo's role\n", StringUtils.join(missingInRole, "\n")));<NEW_LINE>}<NEW_LINE>throw new CloudRuntimeException(sb.toString());<NEW_LINE>} | match(ac, clzName))); |
419,773 | final SetUserPoolMfaConfigResult executeSetUserPoolMfaConfig(SetUserPoolMfaConfigRequest setUserPoolMfaConfigRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(setUserPoolMfaConfigRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SetUserPoolMfaConfigRequest> request = null;<NEW_LINE>Response<SetUserPoolMfaConfigResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SetUserPoolMfaConfigRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(setUserPoolMfaConfigRequest));<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, "Cognito Identity Provider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SetUserPoolMfaConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<SetUserPoolMfaConfigResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new SetUserPoolMfaConfigResultJsonUnmarshaller());<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); |
1,228,277 | public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {<NEW_LINE>if (request.getRestApiVersion() == RestApiVersion.V_7 && request.hasParam(INCLUDE_TYPE_NAME_PARAMETER)) {<NEW_LINE>deprecationLogger.compatibleCritical("get_index_template_include_type_name", TYPES_DEPRECATION_MESSAGE);<NEW_LINE>}<NEW_LINE>final String[] names = Strings.splitStringByCommaToArray(request.param("name"));<NEW_LINE>final GetIndexTemplatesRequest getIndexTemplatesRequest = new GetIndexTemplatesRequest(names);<NEW_LINE>getIndexTemplatesRequest.local(request.paramAsBoolean("local", getIndexTemplatesRequest.local()));<NEW_LINE>getIndexTemplatesRequest.masterNodeTimeout(request.paramAsTime("master_timeout", getIndexTemplatesRequest.masterNodeTimeout()));<NEW_LINE>final boolean implicitAll = getIndexTemplatesRequest.names().length == 0;<NEW_LINE>return channel -> client.admin().indices().getTemplates(getIndexTemplatesRequest, new RestToXContentListener<>(channel) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected RestStatus getStatus(final GetIndexTemplatesResponse response) {<NEW_LINE>final boolean templateExists = response.getIndexTemplates().isEmpty() == false;<NEW_LINE>return (<MASK><NEW_LINE>}<NEW_LINE>});<NEW_LINE>} | templateExists || implicitAll) ? OK : NOT_FOUND; |
334,674 | public void addAdvancedMsgListener(MethodCall call, final MethodChannel.Result result) {<NEW_LINE>final String listenerUuid = CommonUtil.getParam(call, result, "listenerUuid");<NEW_LINE>listenerUuidList.add(listenerUuid);<NEW_LINE>final V2TIMAdvancedMsgListener advacedMessageListener = new V2TIMAdvancedMsgListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRecvNewMessage(V2TIMMessage msg) {<NEW_LINE>makeAddAdvancedMsgListenerEventData("onRecvNewMessage", CommonUtil.convertV2TIMMessageToMap(msg), listenerUuid);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRecvC2CReadReceipt(List<V2TIMMessageReceipt> receiptList) {<NEW_LINE>List<Object> list = new LinkedList<Object>();<NEW_LINE>for (int i = 0; i < receiptList.size(); i++) {<NEW_LINE>list.add(CommonUtil.convertV2TIMMessageReceiptToMap(receiptList.get(i)));<NEW_LINE>}<NEW_LINE>makeAddAdvancedMsgListenerEventData("onRecvC2CReadReceipt", list, listenerUuid);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRecvMessageRevoked(String msgID) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onRecvMessageModified(V2TIMMessage msg) {<NEW_LINE>makeAddAdvancedMsgListenerEventData("onRecvMessageModified", CommonUtil.convertV2TIMMessageToMap(msg), listenerUuid);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>advancedMessageListenerList.put(listenerUuid, advacedMessageListener);<NEW_LINE>V2TIMManager.getMessageManager().addAdvancedMsgListener(advacedMessageListener);<NEW_LINE>result.success("add advance msg listener success");<NEW_LINE>} | makeAddAdvancedMsgListenerEventData("onRecvMessageRevoked", msgID, listenerUuid); |
1,045,709 | public void generalHighlightRun(final Spannable spannable) {<NEW_LINE>final String text = spannable.toString();<NEW_LINE>_highlightingFactorBasedOnFilesize = Math.max(1, Math.min(Math.max(text.length() - 9000, 10000) / 10000, 4));<NEW_LINE>_profiler.restart("General Highlighter");<NEW_LINE>if (_preCalcTabWidth > 0) {<NEW_LINE>_profiler.restart("Tabulator width");<NEW_LINE>createReplacementSpanForMatches(spannable, Pattern.compile("\t"), _preCalcTabWidth);<NEW_LINE>}<NEW_LINE>if (_highlightLinks && (text.contains("http://") || text.contains("https://"))) {<NEW_LINE>_profiler.restart("Link Color");<NEW_LINE>createColorSpanForMatches(<MASK><NEW_LINE>_profiler.restart("Link Size");<NEW_LINE>createRelativeSizeSpanForMatches(spannable, Patterns.WEB_URL, 0.85f);<NEW_LINE>_profiler.restart("Link Italic");<NEW_LINE>createStyleSpanForMatches(spannable, Patterns.WEB_URL, Typeface.ITALIC);<NEW_LINE>}<NEW_LINE>if (_highlightHexcolor) {<NEW_LINE>_profiler.restart("RGB Color underline");<NEW_LINE>createColoredUnderlineSpanForMatches(spannable, HexColorCodeUnderlineSpan.PATTERN, new HexColorCodeUnderlineSpan(), 1);<NEW_LINE>}<NEW_LINE>} | spannable, Patterns.WEB_URL, 0xff1ea3fd); |
805,314 | public static <T extends ImageGray<T>> boolean isInside(T ii, double X, double Y, int radiusRegions, double kernelSize, double scale, double c, double s) {<NEW_LINE>int c_x = (int) Math.round(X);<NEW_LINE>int c_y = (int) Math.round(Y);<NEW_LINE>int kernelSizeInt = (int) Math.ceil(kernelSize * scale);<NEW_LINE>int kernelRadius = kernelSizeInt <MASK><NEW_LINE>// find the radius of the whole area being sampled<NEW_LINE>int radius = (int) Math.ceil(radiusRegions * scale);<NEW_LINE>// integral image convolutions sample the pixel before the region starts<NEW_LINE>// which is why the extra minus one is there<NEW_LINE>int kernelPaddingMinus = radius + kernelRadius + 1;<NEW_LINE>int kernelPaddingPlus = radius + kernelRadius;<NEW_LINE>// take in account the rotation<NEW_LINE>if (c != 0 || s != 0) {<NEW_LINE>double xx = Math.abs(c * kernelPaddingMinus - s * kernelPaddingMinus);<NEW_LINE>double yy = Math.abs(s * kernelPaddingMinus + c * kernelPaddingMinus);<NEW_LINE>double delta = xx > yy ? xx - kernelPaddingMinus : yy - kernelPaddingMinus;<NEW_LINE>kernelPaddingMinus += (int) Math.ceil(delta);<NEW_LINE>kernelPaddingPlus += (int) Math.ceil(delta);<NEW_LINE>}<NEW_LINE>// compute the new bounds and see if its inside<NEW_LINE>int x0 = c_x - kernelPaddingMinus;<NEW_LINE>if (x0 < 0)<NEW_LINE>return false;<NEW_LINE>int x1 = c_x + kernelPaddingPlus;<NEW_LINE>if (x1 >= ii.width)<NEW_LINE>return false;<NEW_LINE>int y0 = c_y - kernelPaddingMinus;<NEW_LINE>if (y0 < 0)<NEW_LINE>return false;<NEW_LINE>int y1 = c_y + kernelPaddingPlus;<NEW_LINE>return y1 < ii.height;<NEW_LINE>} | / 2 + (kernelSizeInt % 2); |
1,439,844 | public void validateSystemTagInCreateMessage(APICreateMessage cmsg) {<NEW_LINE><MASK><NEW_LINE>int hostnameCount = 0;<NEW_LINE>for (String sysTag : msg.getSystemTags()) {<NEW_LINE>if (VmSystemTags.HOSTNAME.isMatch(sysTag)) {<NEW_LINE>if (++hostnameCount > 1) {<NEW_LINE>throw new ApiMessageInterceptionException(argerr("only one hostname system tag is allowed, but %s got", hostnameCount));<NEW_LINE>}<NEW_LINE>String hostname = VmSystemTags.HOSTNAME.getTokenByTag(sysTag, VmSystemTags.HOSTNAME_TOKEN);<NEW_LINE>validateHostname(sysTag, hostname);<NEW_LINE>List<String> l3NetworkUuids = msg.getL3NetworkUuids();<NEW_LINE>l3NetworkUuids.forEach(it -> validateHostNameOnDefaultL3Network(sysTag, hostname, it));<NEW_LINE>} else if (VmSystemTags.STATIC_IP.isMatch(sysTag)) {<NEW_LINE>validateStaticIp(sysTag);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} | final NewVmInstanceMessage msg = (NewVmInstanceMessage) cmsg; |
625,489 | private void parseBytes(byte[] weightBytes) {<NEW_LINE>// 10 ~ 99<NEW_LINE>int bodyage = (int) (weightBytes[17]);<NEW_LINE>// kg<NEW_LINE>float weight = (float) (((weightBytes[2] & 0xFF) << 8) | (weightBytes[3] & 0xFF)) / 100.0f;<NEW_LINE>// %<NEW_LINE>float fat = (float) (((weightBytes[4] & 0xFF) << 8) | (weightBytes[5] & 0xFF)) / 10.0f;<NEW_LINE>// %<NEW_LINE>float water = (float) (((weightBytes[8] & 0xFF) << 8) | (weightBytes[9] & 0xFF)) / 10.0f;<NEW_LINE>// %<NEW_LINE>float muscle = (float) (((weightBytes[10] & 0xFF) << 8) | (weightBytes[11] & 0xFF)) / 10.0f;<NEW_LINE>// %<NEW_LINE>float bone = (float) (((weightBytes[12] & 0xFF) << 8) | (weightBytes[<MASK><NEW_LINE>// kcal<NEW_LINE>float calorie = (float) (((weightBytes[14] & 0xFF) << 8) | (weightBytes[15] & 0xFF));<NEW_LINE>ScaleMeasurement scaleBtData = new ScaleMeasurement();<NEW_LINE>scaleBtData.setWeight(weight);<NEW_LINE>scaleBtData.setFat(fat);<NEW_LINE>scaleBtData.setMuscle(muscle);<NEW_LINE>scaleBtData.setWater(water);<NEW_LINE>scaleBtData.setBone(bone);<NEW_LINE>scaleBtData.setDateTime(new Date());<NEW_LINE>addScaleMeasurement(scaleBtData);<NEW_LINE>} | 13] & 0xFF)) / 10.0f; |
1,544,159 | public static void serialize(final DateTime value, final JsonWriter sw) {<NEW_LINE>final int year = value.getYear();<NEW_LINE>if (year < 0) {<NEW_LINE>throw new SerializationException("Negative dates are not supported.");<NEW_LINE>} else if (year > 9999) {<NEW_LINE>sw.writeByte(JsonWriter.QUOTE);<NEW_LINE>sw.writeAscii(value.toString());<NEW_LINE>sw.writeByte(JsonWriter.QUOTE);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final byte[] buf = sw.ensureCapacity(32);<NEW_LINE>final int pos = sw.size();<NEW_LINE>buf[pos] = '"';<NEW_LINE>NumberConverter.write4(year, buf, pos + 1);<NEW_LINE>buf[pos + 5] = '-';<NEW_LINE>NumberConverter.write2(value.getMonthOfYear(), buf, pos + 6);<NEW_LINE>buf[pos + 8] = '-';<NEW_LINE>NumberConverter.write2(value.getDayOfMonth(), buf, pos + 9);<NEW_LINE>buf[pos + 11] = 'T';<NEW_LINE>NumberConverter.write2(value.getHourOfDay(), buf, pos + 12);<NEW_LINE>buf[pos + 14] = ':';<NEW_LINE>NumberConverter.write2(value.getMinuteOfHour(), buf, pos + 15);<NEW_LINE>buf[pos + 17] = ':';<NEW_LINE>NumberConverter.write2(value.getSecondOfMinute(), buf, pos + 18);<NEW_LINE>final int milis = value.getMillisOfSecond();<NEW_LINE>final int offset;<NEW_LINE>if (milis != 0) {<NEW_LINE><MASK><NEW_LINE>final int hi = milis / 100;<NEW_LINE>final int lo = milis - hi * 100;<NEW_LINE>buf[pos + 21] = (byte) (hi + 48);<NEW_LINE>if (lo != 0) {<NEW_LINE>NumberConverter.write2(lo, buf, pos + 22);<NEW_LINE>offset = 24 + writeTimezone(buf, pos + 24, value, sw);<NEW_LINE>} else {<NEW_LINE>offset = 22 + writeTimezone(buf, pos + 22, value, sw);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>offset = 20 + writeTimezone(buf, pos + 20, value, sw);<NEW_LINE>}<NEW_LINE>sw.advance(offset);<NEW_LINE>} | buf[pos + 20] = '.'; |
1,727,367 | public boolean isRelocationSourceOf(ShardRouting other) {<NEW_LINE>boolean b = this.allocationId != null && other.allocationId != null && other.state == ShardRoutingState.INITIALIZING && other.allocationId.getId().equals(this.allocationId.getRelocationId());<NEW_LINE>assert b == false || this.state == ShardRoutingState.RELOCATING : "ShardRouting is a relocation source but shard state isn't relocating. This [" + this + "], other [" + other + "]";<NEW_LINE>assert b == false || this.allocationId.getId().equals(other.allocationId.getRelocationId()) : "ShardRouting is a relocation source but the allocation id isn't equal to other.allocationId.getRelocationId. This [" + this + "], other [" + other + "]";<NEW_LINE>assert b == false || this.currentNodeId().equals(other.relocatingNodeId) : "ShardRouting is a relocation source but current node isn't equal to other's relocating node. This [" <MASK><NEW_LINE>assert b == false || other.currentNodeId().equals(this.relocatingNodeId) : "ShardRouting is a relocation source but relocating node isn't equal to other's current node. This [" + this + "], other [" + other + "]";<NEW_LINE>assert b == false || this.shardId.equals(other.shardId) : "ShardRouting is a relocation source but both indexRoutings are not of the same shard. This [" + this + "], target [" + other + "]";<NEW_LINE>assert b == false || this.primary == other.primary : "ShardRouting is a relocation source but primary flag is different. This [" + this + "], target [" + other + "]";<NEW_LINE>return b;<NEW_LINE>} | + this + "], other [" + other + "]"; |
1,626,886 | /*<NEW_LINE>public Map<RPCCall, Float> calculateFlightProbabilities(List<RPCCall> calls) {<NEW_LINE>Collections.sort(calls,timeoutComp);<NEW_LINE>long[] rtts = sortedRtts;<NEW_LINE>Map<RPCCall, Float> result = new HashMap<>(calls.size());<NEW_LINE><NEW_LINE>int prevRttIdx = 0;<NEW_LINE><NEW_LINE>for(RPCCall c : calls)<NEW_LINE>{<NEW_LINE>while(prevRttIdx < rtts.length && rtts[prevRttIdx] < c.getRTT())<NEW_LINE>prevRttIdx++;<NEW_LINE>result.put(c, 1.0f * prevRttIdx / rtts.length);<NEW_LINE>}<NEW_LINE><NEW_LINE>return result;<NEW_LINE>}*/<NEW_LINE>public void reset() {<NEW_LINE>updateCount = 0;<NEW_LINE>timeoutBaseline = timeoutCeiling = DHTConstants.RPC_CALL_TIMEOUT_MAX;<NEW_LINE>Arrays.fill(<MASK><NEW_LINE>} | bins, 1.0f / bins.length); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.