idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
767,172
static ChangeSet merge(@Nullable ChangeSet first, ChangeSet second) {<NEW_LINE>final ChangeSet mergedChangeSet = acquireChangeSet(null, false);<NEW_LINE>final int firstCount = first != null ? first.mFinalCount : 0;<NEW_LINE>final int secondCount = second != null ? second.mFinalCount : 0;<NEW_LINE>final List<Change> mergedChanged = mergedChangeSet.mChanges;<NEW_LINE>final ChangeSetStats firstStats = first != null ? first.getChangeSetStats() : null;<NEW_LINE>final ChangeSetStats secondStats = second != null ? second.getChangeSetStats() : null;<NEW_LINE>if (first != null) {<NEW_LINE>for (Change change : first.mChanges) {<NEW_LINE>mergedChanged.add(change);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (second != null) {<NEW_LINE>for (Change change : second.mChanges) {<NEW_LINE>mergedChanged.add(Change<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>mergedChangeSet.mFinalCount = firstCount + secondCount;<NEW_LINE>mergedChangeSet.mChangeSetStats = ChangeSetStats.merge(firstStats, secondStats);<NEW_LINE>return mergedChangeSet;<NEW_LINE>}
.offset(change, firstCount));
784,177
public ResponseEntity<BigDecimal> fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws RestClientException {<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>final MultiValueMap<String, String> localVarQueryParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final HttpHeaders localVarHeaderParams = new HttpHeaders();<NEW_LINE>final MultiValueMap<String, String> localVarCookieParams = new LinkedMultiValueMap<String, String>();<NEW_LINE>final MultiValueMap<String, Object> localVarFormParams = new LinkedMultiValueMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "*/*" };<NEW_LINE>final List<MediaType> <MASK><NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final MediaType localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>ParameterizedTypeReference<BigDecimal> localReturnType = new ParameterizedTypeReference<BigDecimal>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI("/fake/outer/number", HttpMethod.POST, Collections.<String, Object>emptyMap(), localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localReturnType);<NEW_LINE>}
localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
105,189
protected void showCurrentFormat(LatLon l) {<NEW_LINE>final EditText latEdit = view.findViewById(R.id.LatitudeEdit);<NEW_LINE>final EditText lonEdit = view.findViewById(R.id.LongitudeEdit);<NEW_LINE>switch(currentFormat) {<NEW_LINE>case PointDescription.UTM_FORMAT:<NEW_LINE>{<NEW_LINE>view.findViewById(R.id.easting_row).setVisibility(View.VISIBLE);<NEW_LINE>view.findViewById(R.id.northing_row).setVisibility(View.VISIBLE);<NEW_LINE>view.findViewById(R.id.zone_row).setVisibility(View.VISIBLE);<NEW_LINE>view.findViewById(R.id.lat_row).setVisibility(View.GONE);<NEW_LINE>view.findViewById(R.id.lon_row).setVisibility(View.GONE);<NEW_LINE>view.findViewById(R.id.mgrs_row).setVisibility(View.GONE);<NEW_LINE>final EditText northingEdit = view.findViewById(R.id.NorthingEdit);<NEW_LINE>final EditText eastingEdit = view.findViewById(R.id.EastingEdit);<NEW_LINE>final EditText zoneEdit = view.findViewById(R.id.ZoneEdit);<NEW_LINE>UTMPoint pnt = new UTMPoint(new LatLonPoint(l.getLatitude(), l.getLongitude()));<NEW_LINE>zoneEdit.setText(pnt.zone_number + "" + pnt.zone_letter);<NEW_LINE>northingEdit.setText(((long) pnt.northing) + "");<NEW_LINE>eastingEdit.setText(((long) pnt.easting) + "");<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>case PointDescription.MGRS_FORMAT:<NEW_LINE>{<NEW_LINE>view.findViewById(R.id.easting_row).setVisibility(View.GONE);<NEW_LINE>view.findViewById(R.id.northing_row).setVisibility(View.GONE);<NEW_LINE>view.findViewById(R.id.zone_row).setVisibility(View.GONE);<NEW_LINE>view.findViewById(R.id.lat_row).setVisibility(View.GONE);<NEW_LINE>view.findViewById(R.id.lon_row).setVisibility(View.GONE);<NEW_LINE>view.findViewById(R.id.mgrs_row).setVisibility(View.VISIBLE);<NEW_LINE>final EditText mgrsEdit = ((EditText) view.findViewById(R.id.MGRSEdit));<NEW_LINE>MGRSPoint pnt = new MGRSPoint(new LatLonPoint(l.getLatitude()<MASK><NEW_LINE>mgrsEdit.setText(pnt.toFlavoredString(5));<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>view.findViewById(R.id.easting_row).setVisibility(View.GONE);<NEW_LINE>view.findViewById(R.id.northing_row).setVisibility(View.GONE);<NEW_LINE>view.findViewById(R.id.zone_row).setVisibility(View.GONE);<NEW_LINE>view.findViewById(R.id.lat_row).setVisibility(View.VISIBLE);<NEW_LINE>view.findViewById(R.id.lon_row).setVisibility(View.VISIBLE);<NEW_LINE>view.findViewById(R.id.mgrs_row).setVisibility(View.GONE);<NEW_LINE>latEdit.setText(LocationConvert.convert(MapUtils.checkLatitude(l.getLatitude()), currentFormat));<NEW_LINE>lonEdit.setText(LocationConvert.convert(MapUtils.checkLongitude(l.getLongitude()), currentFormat));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
, l.getLongitude()));
1,101,323
public static boolean isOneToOneMapping(@Nonnull Project ideProject, @Nonnull DataNode<ProjectData> externalProject) {<NEW_LINE>String linkedExternalProjectPath = null;<NEW_LINE>for (ExternalSystemManager<?, ?, ?, ?, ?> manager : ExternalSystemApiUtil.getAllManagers()) {<NEW_LINE>ProjectSystemId externalSystemId = manager.getSystemId();<NEW_LINE>AbstractExternalSystemSettings systemSettings = ExternalSystemApiUtil.getSettings(ideProject, externalSystemId);<NEW_LINE>Collection projectsSettings = systemSettings.getLinkedProjectsSettings();<NEW_LINE>int linkedProjectsNumber = projectsSettings.size();<NEW_LINE>if (linkedProjectsNumber > 1) {<NEW_LINE>// More than one external project of the same external system type is linked to the given ide project.<NEW_LINE>return false;<NEW_LINE>} else if (linkedProjectsNumber == 1) {<NEW_LINE>if (linkedExternalProjectPath == null) {<NEW_LINE>// More than one external project of different external system types is linked to the current ide project.<NEW_LINE>linkedExternalProjectPath = ((ExternalProjectSettings) projectsSettings.iterator().next()).getExternalProjectPath();<NEW_LINE>} else {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ProjectData projectData = externalProject.getData();<NEW_LINE>if (linkedExternalProjectPath != null && !linkedExternalProjectPath.equals(projectData.getLinkedExternalProjectPath())) {<NEW_LINE>// New external project is being linked.<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>Set<String> externalModulePaths = ContainerUtilRt.newHashSet();<NEW_LINE>for (DataNode<ModuleData> moduleNode : ExternalSystemApiUtil.findAll(externalProject, ProjectKeys.MODULE)) {<NEW_LINE>externalModulePaths.add(moduleNode.<MASK><NEW_LINE>}<NEW_LINE>externalModulePaths.remove(linkedExternalProjectPath);<NEW_LINE>for (Module module : ModuleManager.getInstance(ideProject).getModules()) {<NEW_LINE>String path = ExternalSystemApiUtil.getExtensionSystemOption(module, ExternalSystemConstants.LINKED_PROJECT_PATH_KEY);<NEW_LINE>if (!StringUtil.isEmpty(path) && !externalModulePaths.remove(path)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return externalModulePaths.isEmpty();<NEW_LINE>}
getData().getLinkedExternalProjectPath());
527,280
final CreateWirelessGatewayTaskResult executeCreateWirelessGatewayTask(CreateWirelessGatewayTaskRequest createWirelessGatewayTaskRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createWirelessGatewayTaskRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateWirelessGatewayTaskRequest> request = null;<NEW_LINE>Response<CreateWirelessGatewayTaskResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateWirelessGatewayTaskRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createWirelessGatewayTaskRequest));<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, "IoT Wireless");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateWirelessGatewayTask");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateWirelessGatewayTaskResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateWirelessGatewayTaskResultJsonUnmarshaller());<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,274,211
private void updateItems() {<NEW_LINE>List<ListItem> items = new ArrayList<>();<NEW_LINE>items.add(new ListItem(ItemType.CARD_TOP_DIVIDER, null));<NEW_LINE>items.add(new ListItem(ItemType.HEADER, getString(<MASK><NEW_LINE>items.addAll(createWidgetsList());<NEW_LINE>items.add(new ListItem(ItemType.CARD_DIVIDER, null));<NEW_LINE>items.add(new ListItem(ItemType.HEADER, getString(R.string.shared_string_actions)));<NEW_LINE>items.add(new ListItem(ItemType.BUTTON, new ButtonInfo(getString(R.string.reset_to_default), R.drawable.ic_action_reset, v -> resetChanges())));<NEW_LINE>items.add(new ListItem(ItemType.BUTTON, new ButtonInfo(getString(R.string.copy_from_other_profile), R.drawable.ic_action_copy, v -> copyFromProfile())));<NEW_LINE>items.add(new ListItem(ItemType.CARD_BOTTOM_DIVIDER, null));<NEW_LINE>items.add(new ListItem(ItemType.SPACE, getResources().getDimensionPixelSize(R.dimen.bottom_space_height)));<NEW_LINE>adapter.setItems(items);<NEW_LINE>}
R.string.shared_string_visible_widgets)));
878,840
@UnitOfWork<NEW_LINE>@ApiOperation(value = "Get user information", notes = "Get user information", response = UserModel.class)<NEW_LINE>@Timed<NEW_LINE>public Response adminGetUser(@ApiParam(hidden = true) @SecurityCheck(Role.ADMIN) User user, @ApiParam(value = "user id", required = true) @PathParam("id") Long id) {<NEW_LINE>Preconditions.checkNotNull(id);<NEW_LINE>User u = userDAO.findById(id);<NEW_LINE>UserModel userModel = new UserModel();<NEW_LINE>userModel.setId(u.getId());<NEW_LINE>userModel.setName(u.getName());<NEW_LINE>userModel.<MASK><NEW_LINE>userModel.setEnabled(!u.isDisabled());<NEW_LINE>userModel.setAdmin(userRoleDAO.findAll(u).stream().anyMatch(r -> r.getRole() == Role.ADMIN));<NEW_LINE>return Response.ok(userModel).build();<NEW_LINE>}
setEmail(u.getEmail());
674,217
public static void validateJsonObject(JsonObject jsonObj) throws IOException {<NEW_LINE>if (jsonObj == null) {<NEW_LINE>if (FileSchemaTestClass.openapiRequiredFields.isEmpty()) {<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>// has required fields<NEW_LINE>throw new IllegalArgumentException(String.format("The required field(s) %s in FileSchemaTestClass is not found in the empty JSON string", FileSchemaTestClass.openapiRequiredFields.toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// validate the optional field `file`<NEW_LINE>if (jsonObj.getAsJsonObject("file") != null) {<NEW_LINE>ModelFile.validateJsonObject(jsonObj.getAsJsonObject("file"));<NEW_LINE>}<NEW_LINE>JsonArray jsonArrayfiles = jsonObj.getAsJsonArray("files");<NEW_LINE>// validate the optional field `files` (array)<NEW_LINE>if (jsonArrayfiles != null) {<NEW_LINE>for (int i = 0; i < jsonArrayfiles.size(); i++) {<NEW_LINE>ModelFile.validateJsonObject(jsonArrayfiles.get<MASK><NEW_LINE>}<NEW_LINE>;<NEW_LINE>}<NEW_LINE>}
(i).getAsJsonObject());
399,982
public ServiceNameAndResourceType unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ServiceNameAndResourceType serviceNameAndResourceType = new ServiceNameAndResourceType();<NEW_LINE><MASK><NEW_LINE>String currentParentElement = context.getCurrentParentElement();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("resourceType", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>serviceNameAndResourceType.setResourceType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("serviceName", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>serviceNameAndResourceType.setServiceName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("resourceRegionScope", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>serviceNameAndResourceType.setResourceRegionScope(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 serviceNameAndResourceType;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,504,141
public Project findProjectByConnectionIdOrJdbcUrl(UUID connectionId, String jdbcUrl) throws LiquibaseHubException {<NEW_LINE>final AtomicReference<UUID> organizationId = new AtomicReference<>(getOrganization().getId());<NEW_LINE>String searchParam = null;<NEW_LINE>if (connectionId != null) {<NEW_LINE>searchParam = "connections.id:\"" + connectionId.toString() + "\"";<NEW_LINE>} else if (jdbcUrl != null) {<NEW_LINE>searchParam = "connections.jdbcUrl:\"" + jdbcUrl + "\"";<NEW_LINE>} else {<NEW_LINE>throw new LiquibaseHubException("connectionId or jdbcUrl should be specified");<NEW_LINE>}<NEW_LINE>Map<String, String> parameters = new LinkedHashMap<>();<NEW_LINE><MASK><NEW_LINE>final Map<String, List<Map>> response = http.doGet("/api/v1/organizations/" + organizationId.toString() + "/projects", parameters, Map.class);<NEW_LINE>List<Project> returnList = transformProjectResponseToList(response);<NEW_LINE>if (returnList.size() > 1) {<NEW_LINE>Scope.getCurrentScope().getLog(getClass()).warning(String.format("JDBC URL: %s was associated with multiple projects.", jdbcUrl));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (returnList.isEmpty()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return returnList.get(0);<NEW_LINE>}
parameters.put("search", searchParam);
1,639,771
public static void print(PrintWriter w, boolean server) {<NEW_LINE>InputStream in = null;<NEW_LINE>try {<NEW_LINE>String scouter_logo = System.getProperty("scouter.logo", "scouter.logo");<NEW_LINE>in = Logo.class.getResourceAsStream(scouter_logo);<NEW_LINE>if (in == null)<NEW_LINE>return;<NEW_LINE>BufferedReader reader = new BufferedReader(new InputStreamReader(in));<NEW_LINE>String line = reader.readLine();<NEW_LINE>while (line != null) {<NEW_LINE>if (server) {<NEW_LINE>w.println(new ParamText(line).getText<MASK><NEW_LINE>} else {<NEW_LINE>w.println(new ParamText(line).getText(Version.getAgentFullVersion()));<NEW_LINE>}<NEW_LINE>line = reader.readLine();<NEW_LINE>}<NEW_LINE>w.flush();<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>FileUtil.close(in);<NEW_LINE>}<NEW_LINE>}
(Version.getServerFullVersion()));
337,010
final ListGroupPoliciesResult executeListGroupPolicies(ListGroupPoliciesRequest listGroupPoliciesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listGroupPoliciesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListGroupPoliciesRequest> request = null;<NEW_LINE>Response<ListGroupPoliciesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListGroupPoliciesRequestMarshaller().marshall(super.beforeMarshalling(listGroupPoliciesRequest));<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, "IAM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListGroupPolicies");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ListGroupPoliciesResult> responseHandler = new StaxResponseHandler<ListGroupPoliciesResult>(new ListGroupPoliciesResultStaxUnmarshaller());<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);
936,208
public static void convolve3(Kernel2D_S32 kernel, GrayS32 src, GrayS32 dest, int divisor, @Nullable GrowArray<DogArray_I32> workspaces) {<NEW_LINE>workspaces = BoofMiscOps.checkDeclare(workspaces, DogArray_I32::new);<NEW_LINE>// CONCURRENT_REMOVE_LINE<NEW_LINE>final DogArray_I32 work = workspaces.grow();<NEW_LINE>final int[] dataSrc = src.data;<NEW_LINE>final int[] dataDst = dest.data;<NEW_LINE>final int width = src.getWidth();<NEW_LINE>final int height = src.getHeight();<NEW_LINE>final int halfDivisor = divisor / 2;<NEW_LINE>final int kernelRadius = kernel.getRadius();<NEW_LINE>final int kernelWidth = 2 * kernelRadius + 1;<NEW_LINE>// CONCURRENT_BELOW BoofConcurrency.loopBlocks(kernelRadius, height-kernelRadius, kernelWidth, workspaces, (work, y0, y1)->{<NEW_LINE>final int y0 = kernelRadius, y1 = height - kernelRadius;<NEW_LINE>int[] totalRow = BoofMiscOps.checkDeclare(work, src.width, false);<NEW_LINE>for (int y = y0; y < y1; y++) {<NEW_LINE>// first time through the value needs to be set<NEW_LINE>int k1 = kernel.data[0];<NEW_LINE>int k2 = kernel.data[1];<NEW_LINE>int k3 = kernel.data[2];<NEW_LINE>int indexSrcRow = src.startIndex + (y - kernelRadius) * src.stride - kernelRadius;<NEW_LINE>for (int x = kernelRadius; x < width - kernelRadius; x++) {<NEW_LINE>int indexSrc = indexSrcRow + x;<NEW_LINE>int total = 0;<NEW_LINE>total += (<MASK><NEW_LINE>total += (dataSrc[indexSrc++]) * k2;<NEW_LINE>total += (dataSrc[indexSrc]) * k3;<NEW_LINE>totalRow[x] = total;<NEW_LINE>}<NEW_LINE>// rest of the convolution rows are an addition<NEW_LINE>for (int i = 1; i < 3; i++) {<NEW_LINE>indexSrcRow = src.startIndex + (y + i - kernelRadius) * src.stride - kernelRadius;<NEW_LINE>k1 = kernel.data[i * 3 + 0];<NEW_LINE>k2 = kernel.data[i * 3 + 1];<NEW_LINE>k3 = kernel.data[i * 3 + 2];<NEW_LINE>for (int x = kernelRadius; x < width - kernelRadius; x++) {<NEW_LINE>int indexSrc = indexSrcRow + x;<NEW_LINE>int total = 0;<NEW_LINE>total += (dataSrc[indexSrc++]) * k1;<NEW_LINE>total += (dataSrc[indexSrc++]) * k2;<NEW_LINE>total += (dataSrc[indexSrc]) * k3;<NEW_LINE>totalRow[x] += total;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int indexDst = dest.startIndex + y * dest.stride + kernelRadius;<NEW_LINE>for (int x = kernelRadius; x < width - kernelRadius; x++) {<NEW_LINE>dataDst[indexDst++] = ((totalRow[x] + halfDivisor) / divisor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// CONCURRENT_INLINE });<NEW_LINE>}
dataSrc[indexSrc++]) * k1;
369,215
private Message<?> enhanceHeadersAndSaveAttributes(Message<?> message, ConsumerRecord<K, V> record) {<NEW_LINE>Message<?> messageToReturn = message;<NEW_LINE>if (message.getHeaders() instanceof KafkaMessageHeaders) {<NEW_LINE>Map<String, Object> rawHeaders = ((KafkaMessageHeaders) message.getHeaders()).getRawHeaders();<NEW_LINE>if (KafkaMessageDrivenChannelAdapter.this.retryTemplate != null) {<NEW_LINE>AtomicInteger deliveryAttempt = new AtomicInteger(((RetryContext) ATTRIBUTES_HOLDER.get()).getRetryCount() + 1);<NEW_LINE>rawHeaders.put(IntegrationMessageHeaderAccessor.DELIVERY_ATTEMPT, deliveryAttempt);<NEW_LINE>} else if (KafkaMessageDrivenChannelAdapter.this.containerDeliveryAttemptPresent) {<NEW_LINE>Header header = record.headers().lastHeader(KafkaHeaders.DELIVERY_ATTEMPT);<NEW_LINE>rawHeaders.put(IntegrationMessageHeaderAccessor.DELIVERY_ATTEMPT, new AtomicInteger(ByteBuffer.wrap(header.value()).getInt()));<NEW_LINE>}<NEW_LINE>if (KafkaMessageDrivenChannelAdapter.this.bindSourceRecord) {<NEW_LINE>rawHeaders.put(IntegrationMessageHeaderAccessor.SOURCE_DATA, record);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>MessageBuilder<?> builder = MessageBuilder.fromMessage(message);<NEW_LINE>if (KafkaMessageDrivenChannelAdapter.this.retryTemplate != null) {<NEW_LINE>AtomicInteger deliveryAttempt = new AtomicInteger(((RetryContext) ATTRIBUTES_HOLDER.get()).getRetryCount() + 1);<NEW_LINE>builder.<MASK><NEW_LINE>} else if (KafkaMessageDrivenChannelAdapter.this.containerDeliveryAttemptPresent) {<NEW_LINE>Header header = record.headers().lastHeader(KafkaHeaders.DELIVERY_ATTEMPT);<NEW_LINE>builder.setHeader(IntegrationMessageHeaderAccessor.DELIVERY_ATTEMPT, new AtomicInteger(ByteBuffer.wrap(header.value()).getInt()));<NEW_LINE>}<NEW_LINE>if (KafkaMessageDrivenChannelAdapter.this.bindSourceRecord) {<NEW_LINE>builder.setHeader(IntegrationMessageHeaderAccessor.SOURCE_DATA, record);<NEW_LINE>}<NEW_LINE>messageToReturn = builder.build();<NEW_LINE>}<NEW_LINE>setAttributesIfNecessary(record, messageToReturn, false);<NEW_LINE>return messageToReturn;<NEW_LINE>}
setHeader(IntegrationMessageHeaderAccessor.DELIVERY_ATTEMPT, deliveryAttempt);
710,398
public void visit(BLangSimpleVarRef varRefExpr) {<NEW_LINE>if (varRefExpr.symbol == null) {<NEW_LINE>result = varRefExpr;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>BSymbol ownerSymbol = varRefExpr.symbol.owner;<NEW_LINE>if (((ownerSymbol.tag & SymTag.PACKAGE) == SymTag.PACKAGE || (ownerSymbol.tag & SymTag.SERVICE) == SymTag.SERVICE) && (varRefExpr.symbol.tag & SymTag.CONSTANT) == SymTag.CONSTANT) {<NEW_LINE>BConstantSymbol constSymbol = (BConstantSymbol) varRefExpr.symbol;<NEW_LINE>// If the var ref is a const-ref of value type, then replace the ref<NEW_LINE>// from a simple literal<NEW_LINE>BType literalType = Types.getReferredType(constSymbol.literalType);<NEW_LINE>if (literalType.tag <= TypeTags.BOOLEAN || literalType.tag == TypeTags.NIL) {<NEW_LINE>BLangConstRef constRef = ASTBuilderUtil.createBLangConstRef(varRefExpr.pos, literalType, constSymbol.value.value);<NEW_LINE>constRef.variableName = varRefExpr.variableName;<NEW_LINE>constRef.symbol = constSymbol;<NEW_LINE>constRef.pkgAlias = varRefExpr.pkgAlias;<NEW_LINE>if (varRefExpr.impConversionExpr != null) {<NEW_LINE>BLangTypeConversionExpr implConversionExpr = (BLangTypeConversionExpr) TreeBuilder.createTypeConversionNode();<NEW_LINE>implConversionExpr.expr = constRef;<NEW_LINE>implConversionExpr.pos = varRefExpr.impConversionExpr.pos;<NEW_LINE>implConversionExpr.setBType(<MASK><NEW_LINE>implConversionExpr.targetType = varRefExpr.impConversionExpr.targetType;<NEW_LINE>constRef.impConversionExpr = implConversionExpr;<NEW_LINE>} else {<NEW_LINE>types.setImplicitCastExpr(constRef, constRef.getBType(), varRefExpr.getBType());<NEW_LINE>}<NEW_LINE>result = constRef;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>result = varRefExpr;<NEW_LINE>}
varRefExpr.impConversionExpr.getBType());
1,815,893
public void marshall(NetworkFirewallInternetTrafficNotInspectedViolation networkFirewallInternetTrafficNotInspectedViolation, ProtocolMarshaller protocolMarshaller) {<NEW_LINE>if (networkFirewallInternetTrafficNotInspectedViolation == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>protocolMarshaller.marshall(networkFirewallInternetTrafficNotInspectedViolation.getSubnetId(), SUBNETID_BINDING);<NEW_LINE>protocolMarshaller.marshall(networkFirewallInternetTrafficNotInspectedViolation.getSubnetAvailabilityZone(), SUBNETAVAILABILITYZONE_BINDING);<NEW_LINE>protocolMarshaller.marshall(networkFirewallInternetTrafficNotInspectedViolation.getRouteTableId(), ROUTETABLEID_BINDING);<NEW_LINE>protocolMarshaller.marshall(networkFirewallInternetTrafficNotInspectedViolation.getViolatingRoutes(), VIOLATINGROUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(networkFirewallInternetTrafficNotInspectedViolation.getIsRouteTableUsedInDifferentAZ(), ISROUTETABLEUSEDINDIFFERENTAZ_BINDING);<NEW_LINE>protocolMarshaller.marshall(networkFirewallInternetTrafficNotInspectedViolation.getCurrentFirewallSubnetRouteTable(), CURRENTFIREWALLSUBNETROUTETABLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(networkFirewallInternetTrafficNotInspectedViolation.getExpectedFirewallEndpoint(), EXPECTEDFIREWALLENDPOINT_BINDING);<NEW_LINE>protocolMarshaller.marshall(networkFirewallInternetTrafficNotInspectedViolation.getFirewallSubnetId(), FIREWALLSUBNETID_BINDING);<NEW_LINE>protocolMarshaller.marshall(networkFirewallInternetTrafficNotInspectedViolation.getExpectedFirewallSubnetRoutes(), EXPECTEDFIREWALLSUBNETROUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(<MASK><NEW_LINE>protocolMarshaller.marshall(networkFirewallInternetTrafficNotInspectedViolation.getInternetGatewayId(), INTERNETGATEWAYID_BINDING);<NEW_LINE>protocolMarshaller.marshall(networkFirewallInternetTrafficNotInspectedViolation.getCurrentInternetGatewayRouteTable(), CURRENTINTERNETGATEWAYROUTETABLE_BINDING);<NEW_LINE>protocolMarshaller.marshall(networkFirewallInternetTrafficNotInspectedViolation.getExpectedInternetGatewayRoutes(), EXPECTEDINTERNETGATEWAYROUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(networkFirewallInternetTrafficNotInspectedViolation.getActualInternetGatewayRoutes(), ACTUALINTERNETGATEWAYROUTES_BINDING);<NEW_LINE>protocolMarshaller.marshall(networkFirewallInternetTrafficNotInspectedViolation.getVpcId(), VPCID_BINDING);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>}
networkFirewallInternetTrafficNotInspectedViolation.getActualFirewallSubnetRoutes(), ACTUALFIREWALLSUBNETROUTES_BINDING);
1,693,533
private void fillResource() {<NEW_LINE>ListItem listItem = fieldResourceType.getSelectedItem();<NEW_LINE>if (listItem == null)<NEW_LINE>return;<NEW_LINE>// Get Resource Type<NEW_LINE>KeyNamePair pp = new KeyNamePair((Integer) listItem.getValue(<MASK><NEW_LINE>int S_ResourceType_ID = pp.getKey();<NEW_LINE>KeyNamePair defaultValue = null;<NEW_LINE>// Load Resources<NEW_LINE>m_loading = true;<NEW_LINE>fieldResource.getChildren().clear();<NEW_LINE>String sql = "SELECT S_Resource_ID, Name FROM S_Resource WHERE S_ResourceType_ID=? ORDER BY 2";<NEW_LINE>try {<NEW_LINE>PreparedStatement pstmt = DB.prepareStatement(sql, null);<NEW_LINE>pstmt.setInt(1, S_ResourceType_ID);<NEW_LINE>ResultSet rs = pstmt.executeQuery();<NEW_LINE>while (rs.next()) {<NEW_LINE>pp = new KeyNamePair(rs.getInt(1), rs.getString(2));<NEW_LINE>if (m_mAssignment.getS_Resource_ID() == pp.getKey())<NEW_LINE>defaultValue = pp;<NEW_LINE>fieldResource.appendItem(pp.getName(), pp.getKey());<NEW_LINE>}<NEW_LINE>rs.close();<NEW_LINE>pstmt.close();<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, sql, e);<NEW_LINE>}<NEW_LINE>if (defaultValue != null) {<NEW_LINE>int cnt = fieldResource.getItemCount();<NEW_LINE>for (int i = 0; i < cnt; i++) {<NEW_LINE>ListItem li = fieldResource.getItemAtIndex(i);<NEW_LINE>Integer key = (Integer) li.getValue();<NEW_LINE>if (key.intValue() == defaultValue.getKey()) {<NEW_LINE>fieldResource.setSelectedItem(li);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (fieldResource.getItemCount() > 0) {<NEW_LINE>fieldResource.setSelectedIndex(0);<NEW_LINE>}<NEW_LINE>m_loading = false;<NEW_LINE>}
), listItem.getLabel());
806,137
public boolean apply(MethodInfo methodInfo) {<NEW_LINE>// Any method explicitly annotated is trusted to behave as advertised.<NEW_LINE>Optional<Nullness> fromAnnotations = NullnessAnnotations.<MASK><NEW_LINE>if (fromAnnotations.isPresent()) {<NEW_LINE>return fromAnnotations.get() == NONNULL;<NEW_LINE>}<NEW_LINE>if (methodInfo.method().equals("valueOf") && CLASSES_WITH_NON_NULLABLE_VALUE_OF_METHODS.contains(methodInfo.clazz())) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (methodInfo.isPrimitive()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (methodInfo.isKnownNonNullReturning()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (CLASSES_WITH_NON_NULLABLE_RETURNS.contains(methodInfo.clazz())) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>MemberName searchMemberName = new MemberName(methodInfo.clazz(), methodInfo.method());<NEW_LINE>if (METHODS_WITH_NON_NULLABLE_RETURNS.contains(searchMemberName)) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
fromAnnotations(methodInfo.annotations());
1,202,511
private Symbol createSymbol(String name, SymbolType type, Address address, Namespace parentNamespace, SourceType source) throws DuplicateNameException, InvalidInputException {<NEW_LINE>Symbol symbol = null;<NEW_LINE>if (type == SymbolType.LABEL) {<NEW_LINE>if (address.isExternalAddress()) {<NEW_LINE>// FIXME Should this be passing the Namespace?<NEW_LINE>ExternalManagerDB extMgr = (ExternalManagerDB) toProgram.getExternalManager();<NEW_LINE>ExternalLocation addExtLocation = extMgr.addExtLocation(parentNamespace.getName(), name, address, source);<NEW_LINE>return addExtLocation.getSymbol();<NEW_LINE>}<NEW_LINE>symbol = toSymbolTable.createLabel(address, name, parentNamespace, source);<NEW_LINE>} else // else if (type == SymbolType.EXTERNAL) {<NEW_LINE>// ExternalManagerDB extMgr = (ExternalManagerDB) toProgram.getExternalManager();<NEW_LINE>// extMgr.addExtLocation(parentNamespace.getName(), name, address, source);<NEW_LINE>// symbol = toSymbolTable.getSymbol(name, parentNamespace);<NEW_LINE>// }<NEW_LINE>if (type == SymbolType.CLASS) {<NEW_LINE>GhidraClass newGhidraClass = toSymbolTable.createClass(parentNamespace, name, source);<NEW_LINE>symbol = newGhidraClass.getSymbol();<NEW_LINE>} else if (type == SymbolType.NAMESPACE) {<NEW_LINE>Namespace newNamespace = toSymbolTable.createNameSpace(parentNamespace, name, source);<NEW_LINE>symbol = newNamespace.getSymbol();<NEW_LINE>} else if (type == SymbolType.LIBRARY) {<NEW_LINE>ExternalManager fromExtMgr = fromProgram.getExternalManager();<NEW_LINE>String path = fromExtMgr.getExternalLibraryPath(name);<NEW_LINE>ExternalManagerDB extMgr = (ExternalManagerDB) toProgram.getExternalManager();<NEW_LINE>extMgr.setExternalPath(name, path, source == SourceType.USER_DEFINED);<NEW_LINE>symbol = toSymbolTable.getLibrarySymbol(name);<NEW_LINE>} else if (type == SymbolType.FUNCTION) {<NEW_LINE><MASK><NEW_LINE>AddressSetView body = fromFunctionMgr.getFunctionAt(address).getBody();<NEW_LINE>FunctionManager functionMgr = toProgram.getFunctionManager();<NEW_LINE>try {<NEW_LINE>functionMgr.createFunction(name, parentNamespace, address, body, source);<NEW_LINE>} catch (OverlappingFunctionException e) {<NEW_LINE>throw new InvalidInputException(e.getMessage());<NEW_LINE>}<NEW_LINE>symbol = toSymbolTable.getSymbol(name, address, parentNamespace);<NEW_LINE>}<NEW_LINE>return symbol;<NEW_LINE>}
FunctionManager fromFunctionMgr = fromProgram.getFunctionManager();
893,254
protected Object checkAndConvertAssignment(String localName, Object value, QueryProfileRegistry registry) {<NEW_LINE>// no type checking<NEW_LINE>if (type == null)<NEW_LINE>return value;<NEW_LINE>FieldDescription fieldDescription = type.getField(localName);<NEW_LINE>if (fieldDescription == null) {<NEW_LINE>if (type.isStrict())<NEW_LINE>throw new IllegalInputException("'" + localName + "' is not declared in " + type + ", and the type is strict");<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>if (registry == null && (fieldDescription.getType() instanceof QueryProfileFieldType))<NEW_LINE>throw new IllegalInputException("A registry was not passed: Query profile references is not supported");<NEW_LINE>Object convertedValue = fieldDescription.getType(<MASK><NEW_LINE>if (convertedValue == null)<NEW_LINE>throw new IllegalInputException("'" + value + "' is not a " + fieldDescription.getType().toInstanceDescription());<NEW_LINE>return convertedValue;<NEW_LINE>}
).convertFrom(value, registry);
737,013
final CreateHsmResult executeCreateHsm(CreateHsmRequest createHsmRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createHsmRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateHsmRequest> request = null;<NEW_LINE>Response<CreateHsmResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateHsmRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createHsmRequest));<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, "CloudHSM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateHsm");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateHsmResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateHsmResultJsonUnmarshaller());<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);
608,461
// When allowNullResultSetForExecuteQuery is configured to 1 (YES), DB2 executeQuery can return a NULL.<NEW_LINE>// Verify that WAS JDBC statement wrappers can properly handle the NULL result set.<NEW_LINE>@Test<NEW_LINE>public void testNullResultOfExecuteQuery() throws Exception {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>con.createStatement().execute("CREATE OR REPLACE PROCEDURE insertNewEntry (IN NEWID SMALLINT, IN NEWVAL NVARCHAR(40))" + " BEGIN" + " INSERT INTO MYTABLE VALUES(NEWID, NEWVAL);" + " END");<NEW_LINE>CallableStatement cs = con.prepareCall("CALL insertNewEntry(?, ?)");<NEW_LINE>cs.setInt(1, 1);<NEW_LINE>cs.setString(2, "first");<NEW_LINE>ResultSet result = cs.executeQuery();<NEW_LINE>assertNull(result);<NEW_LINE>cs.close();<NEW_LINE>} finally {<NEW_LINE>con.close();<NEW_LINE>}<NEW_LINE>}
Connection con = ds_db2.getConnection();
1,538,273
public void parse(String result, Object data) {<NEW_LINE>JsonObject jobj = JsonParser.parseString(result).getAsJsonObject();<NEW_LINE>if (jobj.has("type")) {<NEW_LINE>String type = jobj.get("type").getAsString();<NEW_LINE>if (type.equals("error")) {<NEW_LINE>String desc = jobj.get("description").getAsString();<NEW_LINE>manager.getEventListeners().fire.consoleOutput(desc + "\n", 0);<NEW_LINE><MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (jobj.has("payload")) {<NEW_LINE>Object object = jobj.get("payload");<NEW_LINE>if (!(object instanceof JsonPrimitive)) {<NEW_LINE>manager.getEventListeners().fire.consoleOutput(object + " not a String\n", 0);<NEW_LINE>Msg.error(this, object);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String value = ((JsonPrimitive) object).getAsString();<NEW_LINE>if (!value.startsWith("{")) {<NEW_LINE>manager.getEventListeners().fire.consoleOutput(object + "\n", 0);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>JsonElement res = JsonParser.parseString(value);<NEW_LINE>if (res instanceof JsonObject) {<NEW_LINE>JsonObject keyValue = (JsonObject) res;<NEW_LINE>JsonElement element = keyValue.get("key");<NEW_LINE>if (element != null) {<NEW_LINE>res = keyValue.get("value");<NEW_LINE>String key = element.getAsString();<NEW_LINE>if (!key.equals(name)) {<NEW_LINE>manager.getEventListeners().fire.consoleOutput(res + "\n", 0);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>manager.getEventListeners().fire.consoleOutput(object + "\n", 0);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>manager.getEventListeners().fire.consoleOutput(object + "\n", 0);<NEW_LINE>}<NEW_LINE>if (res.equals("[]")) {<NEW_LINE>Msg.error(this, "nothing returned for " + this);<NEW_LINE>}<NEW_LINE>if (res instanceof JsonArray) {<NEW_LINE>JsonArray arr = (JsonArray) res;<NEW_LINE>for (JsonElement l : arr) {<NEW_LINE>parseSpecifics(l);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>parseSpecifics(res);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>cleanup();<NEW_LINE>}
Msg.error(this, desc);
65,021
public void stop() {<NEW_LINE>stopping = true;<NEW_LINE>taskExecutor.shutdown();<NEW_LINE>List<ListenableFuture<Void>> <MASK><NEW_LINE>synchronized (tasks) {<NEW_LINE>for (ThreadingTaskRunnerWorkItem taskWorkItem : tasks.values()) {<NEW_LINE>shutdownFutures.add(scheduleTaskShutdown(taskWorkItem));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>controlThreadExecutor.shutdown();<NEW_LINE>try {<NEW_LINE>ListenableFuture<List<Void>> shutdownFuture = Futures.successfulAsList(shutdownFutures);<NEW_LINE>shutdownFuture.get();<NEW_LINE>} catch (Exception e) {<NEW_LINE>LOGGER.error(e, "Encountered exception when stopping all tasks.");<NEW_LINE>}<NEW_LINE>final DateTime start = DateTimes.nowUtc();<NEW_LINE>final long gracefulShutdownMillis = taskConfig.getGracefulShutdownTimeout().toStandardDuration().getMillis();<NEW_LINE>LOGGER.info("Waiting up to %,dms for shutdown.", gracefulShutdownMillis);<NEW_LINE>if (gracefulShutdownMillis > 0) {<NEW_LINE>try {<NEW_LINE>final boolean terminated = controlThreadExecutor.awaitTermination(gracefulShutdownMillis, TimeUnit.MILLISECONDS);<NEW_LINE>final long elapsed = System.currentTimeMillis() - start.getMillis();<NEW_LINE>if (terminated) {<NEW_LINE>LOGGER.info("Finished stopping in %,dms.", elapsed);<NEW_LINE>} else {<NEW_LINE>final Set<String> stillRunning;<NEW_LINE>synchronized (tasks) {<NEW_LINE>stillRunning = ImmutableSet.copyOf(tasks.keySet());<NEW_LINE>}<NEW_LINE>LOGGER.makeAlert("Failed to stop task threads").addData("stillRunning", stillRunning).addData("elapsed", elapsed).emit();<NEW_LINE>LOGGER.warn("Executor failed to stop after %,dms, not waiting for it! Tasks still running: [%s]", elapsed, Joiner.on("; ").join(stillRunning));<NEW_LINE>}<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>LOGGER.warn(e, "Interrupted while waiting for executor to finish.");<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>LOGGER.warn("Ran out of time, not waiting for executor to finish!");<NEW_LINE>}<NEW_LINE>appenderatorsManager.shutdown();<NEW_LINE>}
shutdownFutures = new ArrayList<>();
1,718,795
final RemoveRoleFromDBClusterResult executeRemoveRoleFromDBCluster(RemoveRoleFromDBClusterRequest removeRoleFromDBClusterRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(removeRoleFromDBClusterRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<RemoveRoleFromDBClusterRequest> request = null;<NEW_LINE>Response<RemoveRoleFromDBClusterResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RemoveRoleFromDBClusterRequestMarshaller().marshall(super.beforeMarshalling(removeRoleFromDBClusterRequest));<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, "Neptune");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RemoveRoleFromDBCluster");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<RemoveRoleFromDBClusterResult> responseHandler = new StaxResponseHandler<RemoveRoleFromDBClusterResult>(new RemoveRoleFromDBClusterResultStaxUnmarshaller());<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,008,883
synchronized void updateRemoteCluster(String clusterAlias, Settings newSettings, ActionListener<Void> listener) {<NEW_LINE>if (LOCAL_CLUSTER_GROUP_KEY.equals(clusterAlias)) {<NEW_LINE>throw new IllegalArgumentException("remote clusters must not have the empty string as its key");<NEW_LINE>}<NEW_LINE>RemoteClusterConnection remote = this.remoteClusters.get(clusterAlias);<NEW_LINE>if (RemoteConnectionStrategy.isConnectionEnabled(clusterAlias, newSettings) == false) {<NEW_LINE>try {<NEW_LINE>IOUtils.close(remote);<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.warn("failed to close remote cluster connections for cluster: " + clusterAlias, e);<NEW_LINE>}<NEW_LINE>remoteClusters.remove(clusterAlias);<NEW_LINE>listener.onResponse(null);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (remote == null) {<NEW_LINE>// this is a new cluster we have to add a new representation<NEW_LINE>Settings finalSettings = Settings.builder().put(this.settings, false).put(newSettings, false).build();<NEW_LINE>remote = new RemoteClusterConnection(finalSettings, clusterAlias, transportService);<NEW_LINE>remoteClusters.put(clusterAlias, remote);<NEW_LINE>remote.ensureConnected(listener);<NEW_LINE>} else if (remote.shouldRebuildConnection(newSettings)) {<NEW_LINE>// Changes to connection configuration. Must tear down existing connection<NEW_LINE>try {<NEW_LINE>IOUtils.close(remote);<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.<MASK><NEW_LINE>}<NEW_LINE>remoteClusters.remove(clusterAlias);<NEW_LINE>Settings finalSettings = Settings.builder().put(this.settings, false).put(newSettings, false).build();<NEW_LINE>remote = new RemoteClusterConnection(finalSettings, clusterAlias, transportService);<NEW_LINE>remoteClusters.put(clusterAlias, remote);<NEW_LINE>remote.ensureConnected(listener);<NEW_LINE>} else {<NEW_LINE>// No changes to connection configuration.<NEW_LINE>listener.onResponse(null);<NEW_LINE>}<NEW_LINE>}
warn("failed to close remote cluster connections for cluster: " + clusterAlias, e);
1,369,439
protected static // }<NEW_LINE>String calculateExtraClassPath(Class<?> cls, Path... paths) throws Exception {<NEW_LINE>List<String> jars = new ArrayList<>();<NEW_LINE>jars.addAll(calculateExtraClassPathDefault());<NEW_LINE>Module module = cls.getAnnotation(Module.class);<NEW_LINE>for (String str : module.storeJars()) {<NEW_LINE>File file = new File(Config.dir_store_jars(), str + ".jar");<NEW_LINE>if (file.exists()) {<NEW_LINE>jars.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String str : module.customJars()) {<NEW_LINE>File file = new File(Config.dir_custom_jars(), str + ".jar");<NEW_LINE>if (file.exists()) {<NEW_LINE>jars.add(file.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (String str : module.dynamicJars()) {<NEW_LINE>File file = new File(Config.dir_dynamic_jars(), str + ".jar");<NEW_LINE>if (file.exists()) {<NEW_LINE>jars.add(file.getAbsolutePath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (Path path : paths) {<NEW_LINE>if (Files.exists(path) && Files.isDirectory(path)) {<NEW_LINE>try (Stream<Path> stream = Files.walk(path, FileVisitOption.FOLLOW_LINKS)) {<NEW_LINE>stream.filter(Files::isRegularFile).filter(p -> p.toAbsolutePath().toString().toLowerCase().endsWith(".jar")).forEach(p -> jars.add(p.toAbsolutePath().toString()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return StringUtils.join(jars, ";");<NEW_LINE>}
add(file.getAbsolutePath());
1,206,086
public void handleOrderVoided(@NonNull final VoidOrderAndRelatedDocsRequest request) {<NEW_LINE>final IDocumentBL documentBL = <MASK><NEW_LINE>final IPair<RecordsToHandleKey, List<ITableRecordReference>> recordsToHandle = request.getRecordsToHandle();<NEW_LINE>final List<I_C_Order> orderRecordsToHandle = TableRecordReference.getModels(recordsToHandle.getRight(), I_C_Order.class);<NEW_LINE>for (final I_C_Order orderRecord : orderRecordsToHandle) {<NEW_LINE>// update the old orders' documentno<NEW_LINE>final String documentNo = setVoidedOrderNewDocumenTNo(request.getVoidedOrderDocumentNoPrefix(), orderRecord, 1);<NEW_LINE>final I_C_Order copiedOrderRecord = newInstance(I_C_Order.class);<NEW_LINE>InterfaceWrapperHelper.copyValues(orderRecord, copiedOrderRecord);<NEW_LINE>copiedOrderRecord.setDocumentNo(documentNo);<NEW_LINE>saveRecord(copiedOrderRecord);<NEW_LINE>// copy-with-details, set orderRecord's previous DocumentNo<NEW_LINE>CopyRecordFactory.getCopyRecordSupport(I_C_Order.Table_Name).setParentPO(LegacyAdapters.convertToPO(copiedOrderRecord)).setBase(true).copyRecord(LegacyAdapters.convertToPO(orderRecord), ITrx.TRXNAME_ThreadInherited);<NEW_LINE>documentBL.processEx(orderRecord, IDocument.ACTION_Void);<NEW_LINE>saveRecord(orderRecord);<NEW_LINE>}<NEW_LINE>}
Services.get(IDocumentBL.class);
1,624,084
public List<Pair<ApiType, MetricsType>> execute() throws KubectlException {<NEW_LINE>switch(metricName) {<NEW_LINE>case "cpu":<NEW_LINE>case "memory":<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>try {<NEW_LINE>CoreV1Api api = new CoreV1Api(apiClient);<NEW_LINE>if (apiTypeClass.equals(V1Node.class)) {<NEW_LINE>return (List<Pair<ApiType, MetricsType>>) topNodes(api, apiClient, metricName);<NEW_LINE>} else if (apiTypeClass.equals(V1Pod.class)) {<NEW_LINE>return (List<Pair<ApiType, MetricsType>>) topPods(api, apiClient, metricName);<NEW_LINE>} else {<NEW_LINE>throw new KubectlException("Can not perform top for " + apiTypeClass.getName());<NEW_LINE>}<NEW_LINE>} catch (ApiException | IOException ex) {<NEW_LINE>throw new KubectlException(ex);<NEW_LINE>}<NEW_LINE>}
throw new KubectlException("Unknown metric: " + metricName);
689,759
public static double uncenteredCorrelation(double[] x, double[] y) {<NEW_LINE>final int xdim = x<MASK><NEW_LINE>if (xdim != ydim) {<NEW_LINE>throw new IllegalArgumentException("Invalid arguments: number vectors differ in dimensionality.");<NEW_LINE>}<NEW_LINE>double sumXX = 0., sumYY = 0., sumXY = 0.;<NEW_LINE>for (int i = 0; i < xdim; i++) {<NEW_LINE>final double xv = x[i], yv = y[i];<NEW_LINE>sumXX += xv * xv;<NEW_LINE>sumYY += yv * yv;<NEW_LINE>sumXY += xv * yv;<NEW_LINE>}<NEW_LINE>// One or both series were constant:<NEW_LINE>if (!(sumXX > 0. && sumYY > 0.)) {<NEW_LINE>return (sumXX == sumYY) ? 1. : 0.;<NEW_LINE>}<NEW_LINE>return sumXY / Math.sqrt(sumXX * sumYY);<NEW_LINE>}
.length, ydim = y.length;
660,720
private void filterCardsType(int modifiers, String actionCommand) {<NEW_LINE>// ALT or CTRL button was pushed<NEW_LINE>if ((modifiers & ActionEvent.ALT_MASK) == ActionEvent.ALT_MASK || (modifiers & ActionEvent.CTRL_MASK) == ActionEvent.CTRL_MASK) {<NEW_LINE>boolean invert = (modifiers & ActionEvent.ALT_MASK) == ActionEvent.ALT_MASK;<NEW_LINE>tbArifiacts.setSelected(inverter(invert, tbArifiacts.getActionCommand(), actionCommand));<NEW_LINE>tbCreatures.setSelected(inverter(invert, tbCreatures.getActionCommand(), actionCommand));<NEW_LINE>tbEnchantments.setSelected(inverter(invert, tbEnchantments.getActionCommand(), actionCommand));<NEW_LINE>tbInstants.setSelected(inverter(invert, tbInstants.getActionCommand(), actionCommand));<NEW_LINE>tbLand.setSelected(inverter(invert, tbLand.getActionCommand(), actionCommand));<NEW_LINE>tbPlaneswalkers.setSelected(inverter(invert, tbPlaneswalkers.getActionCommand(), actionCommand));<NEW_LINE>tbSorceries.setSelected(inverter(invert, tbSorceries<MASK><NEW_LINE>}<NEW_LINE>filterCards();<NEW_LINE>}
.getActionCommand(), actionCommand));
1,776,014
public Answer execute(VmwareHostService hostService, CreatePrivateTemplateFromVolumeCommand cmd) {<NEW_LINE>String secondaryStoragePoolURL = cmd.getSecondaryStorageUrl();<NEW_LINE>String volumePath = cmd.getVolumePath();<NEW_LINE>Long accountId = cmd.getAccountId();<NEW_LINE>Long templateId = cmd.getTemplateId();<NEW_LINE>String details = null;<NEW_LINE>VmwareContext context = hostService.getServiceContext(cmd);<NEW_LINE>try {<NEW_LINE>VmwareHypervisorHost hyperHost = hostService.getHyperHost(context, cmd);<NEW_LINE>VirtualMachineMO vmMo = hyperHost.findVmOnHyperHost(cmd.getVmName());<NEW_LINE>if (vmMo == null) {<NEW_LINE>if (s_logger.isDebugEnabled()) {<NEW_LINE>s_logger.debug("Unable to find the owner VM for CreatePrivateTemplateFromVolumeCommand on host " + hyperHost.getHyperHostName() + ", try within datacenter");<NEW_LINE>}<NEW_LINE>vmMo = hyperHost.findVmOnPeerHyperHost(cmd.getVmName());<NEW_LINE>if (vmMo == null) {<NEW_LINE>String msg = "Unable to find the owner VM for volume operation. vm: " + cmd.getVmName();<NEW_LINE>s_logger.error(msg);<NEW_LINE>throw new Exception(msg);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Ternary<String, Long, Long> result = createTemplateFromVolume(vmMo, accountId, templateId, cmd.getUniqueName(), secondaryStoragePoolURL, volumePath, hostService.getWorkerName(context, cmd, 0, null), cmd.getNfsVersion());<NEW_LINE>return new CreatePrivateTemplateAnswer(cmd, true, null, result.first(), result.third(), result.second(), cmd.<MASK><NEW_LINE>} catch (Throwable e) {<NEW_LINE>return new CreatePrivateTemplateAnswer(cmd, false, hostService.createLogMessageException(e, cmd));<NEW_LINE>}<NEW_LINE>}
getUniqueName(), ImageFormat.OVA);
1,576,936
public ImageStateChangeReason unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ImageStateChangeReason imageStateChangeReason = new ImageStateChangeReason();<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("Code", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>imageStateChangeReason.setCode(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Message", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>imageStateChangeReason.setMessage(context.getUnmarshaller(String.<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 imageStateChangeReason;<NEW_LINE>}
class).unmarshall(context));
1,027,740
public void initialize(@NonNull View view) {<NEW_LINE>LinearProgressIndicator linearIndicator = view.findViewById(R.id.linear_indicator);<NEW_LINE>CircularProgressIndicator circularIndicator = view.findViewById(R.id.circular_indicator);<NEW_LINE>EditText progressInput = view.<MASK><NEW_LINE>Button updateButton = view.findViewById(R.id.update_button);<NEW_LINE>SwitchMaterial determinateSwitch = view.findViewById(R.id.determinate_mode_switch);<NEW_LINE>updateButton.setOnClickListener(v -> {<NEW_LINE>int progress;<NEW_LINE>try {<NEW_LINE>progress = Integer.parseInt(progressInput.getEditableText().toString());<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>progress = 0;<NEW_LINE>progressInput.setText("0");<NEW_LINE>}<NEW_LINE>linearIndicator.setProgressCompat(progress, true);<NEW_LINE>circularIndicator.setProgressCompat(progress, true);<NEW_LINE>determinateSwitch.setChecked(true);<NEW_LINE>});<NEW_LINE>determinateSwitch.setOnCheckedChangeListener((v, isChecked) -> {<NEW_LINE>linearIndicator.setIndeterminate(!isChecked);<NEW_LINE>circularIndicator.setIndeterminate(!isChecked);<NEW_LINE>});<NEW_LINE>}
findViewById(R.id.progress_input);
1,650,574
public void removeMainLeafEntry(final int entryIndex, final int keySize) {<NEW_LINE>final int entryPosition = getIntValue(POSITIONS_ARRAY_OFFSET + entryIndex * OIntegerSerializer.INT_SIZE);<NEW_LINE>final int entriesCount = getIntValue(entryPosition + ENTRIES_COUNT_OFFSET);<NEW_LINE>final long mId = getLongValue(entryPosition + M_ID_OFFSET);<NEW_LINE>final ORID value;<NEW_LINE>if (entriesCount == 0) {<NEW_LINE>value = null;<NEW_LINE>} else {<NEW_LINE>final int <MASK><NEW_LINE>final long clusterPosition = getLongValue(entryPosition + CLUSTER_POSITION_OFFSET);<NEW_LINE>value = new ORecordId(clusterId, clusterPosition);<NEW_LINE>}<NEW_LINE>final byte[] key = getBinaryValue(entryPosition + KEY_OFFSET, keySize);<NEW_LINE>removeMainLeafEntry(entryIndex, entryPosition, keySize);<NEW_LINE>addPageOperation(new CellBTreeMultiValueV2BucketRemoveMainLeafEntryPO(entryIndex, key, value, mId));<NEW_LINE>}
clusterId = getShortValue(entryPosition + CLUSTER_ID_OFFSET);
1,001,378
private void processCommandEnable(String commandLine, boolean enable) {<NEW_LINE>try {<NEW_LINE>CommandLine cmd = CMD_PARSER.parse(enableFeatureOptions(), commandLine.split(" "));<NEW_LINE>if (cmd.getArgList().size() != 1 || !cmd.hasOption("f")) {<NEW_LINE>logWarn("Invalid command, expecting enable/disable -f <featureName>");<NEW_LINE>} else {<NEW_LINE>String featureName = cmd.getOptionValue('f');<NEW_LINE>if (!currentFF4J.getFeatureStore().exist(featureName)) {<NEW_LINE>logWarn("Feature [" + featureName + "] not found");<NEW_LINE>} else if (enable) {<NEW_LINE>currentFF4J.getFeatureStore().enable(featureName);<NEW_LINE>logInfo(FEATURE + featureName + " is now enabled");<NEW_LINE>} else {<NEW_LINE>currentFF4J.<MASK><NEW_LINE>logInfo(FEATURE + featureName + " is now disabled");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (ParseException moe) {<NEW_LINE>error(moe, ERROR_DURING_CONNECT_COMMAND);<NEW_LINE>}<NEW_LINE>}
getFeatureStore().disable(featureName);
1,139,934
final DisassociateWebsiteAuthorizationProviderResult executeDisassociateWebsiteAuthorizationProvider(DisassociateWebsiteAuthorizationProviderRequest disassociateWebsiteAuthorizationProviderRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(disassociateWebsiteAuthorizationProviderRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DisassociateWebsiteAuthorizationProviderRequest> request = null;<NEW_LINE>Response<DisassociateWebsiteAuthorizationProviderResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DisassociateWebsiteAuthorizationProviderRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(disassociateWebsiteAuthorizationProviderRequest));<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, "WorkLink");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DisassociateWebsiteAuthorizationProvider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DisassociateWebsiteAuthorizationProviderResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DisassociateWebsiteAuthorizationProviderResultJsonUnmarshaller());<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);
294,028
private void updateFlexibleSpaceText(final int scrollY) {<NEW_LINE>ViewHelper.setTranslationY(mFlexibleSpaceView, -scrollY);<NEW_LINE>int adjustedScrollY = (int) ScrollUtils.getFloat(scrollY, 0, mFlexibleSpaceHeight);<NEW_LINE>// Special logic for WebView.<NEW_LINE>adjustTopMargin(mWebViewContainer, adjustedScrollY <= mFlexibleSpaceHeight ? 0 : mFlexibleSpaceHeight + getActionBarSize());<NEW_LINE>float maxScale = (float) (mFlexibleSpaceHeight - mToolbarView.getHeight()) / mToolbarView.getHeight();<NEW_LINE>float scale = maxScale * ((float) mFlexibleSpaceHeight - adjustedScrollY) / mFlexibleSpaceHeight;<NEW_LINE>ViewHelper.setPivotX(mTitleView, 0);<NEW_LINE>ViewHelper.setPivotY(mTitleView, 0);<NEW_LINE>ViewHelper.setScaleX(mTitleView, 1 + scale);<NEW_LINE>ViewHelper.<MASK><NEW_LINE>int maxTitleTranslationY = mToolbarView.getHeight() + mFlexibleSpaceHeight - (int) (mTitleView.getHeight() * (1 + scale));<NEW_LINE>int titleTranslationY = (int) (maxTitleTranslationY * ((float) mFlexibleSpaceHeight - adjustedScrollY) / mFlexibleSpaceHeight);<NEW_LINE>ViewHelper.setTranslationY(mTitleView, titleTranslationY);<NEW_LINE>}
setScaleY(mTitleView, 1 + scale);
1,482,454
private static int appendArrayTypeSignatureForAnchor(char[] string, int start, StringBuffer buffer, boolean isVarArgs) {<NEW_LINE>int length = string.length;<NEW_LINE>// need a minimum 2 char<NEW_LINE>if (start >= length - 1) {<NEW_LINE>throw raiseIllegalSignatureException(string, start);<NEW_LINE>}<NEW_LINE>char c = string[start];<NEW_LINE>if (c != Signature.C_ARRAY) {<NEW_LINE>throw raiseUnexpectedCharacterException(string, start, c);<NEW_LINE>}<NEW_LINE>int index = start;<NEW_LINE>c = string[++index];<NEW_LINE>while (c == Signature.C_ARRAY) {<NEW_LINE>// need a minimum 2 char<NEW_LINE>if (index >= length - 1) {<NEW_LINE>throw raiseIllegalSignatureException(string, start);<NEW_LINE>}<NEW_LINE>c = string[++index];<NEW_LINE>}<NEW_LINE>int e = appendTypeSignatureForAnchor(string, index, buffer, false);<NEW_LINE>for (int i = 1, dims = index - start; i < dims; i++) {<NEW_LINE>buffer.append('[').append(']');<NEW_LINE>}<NEW_LINE>if (isVarArgs) {<NEW_LINE>buffer.append('.').append('.').append('.');<NEW_LINE>} else {<NEW_LINE>buffer.append<MASK><NEW_LINE>}<NEW_LINE>return e;<NEW_LINE>}
('[').append(']');
1,093,730
final ListDatasetImportJobsResult executeListDatasetImportJobs(ListDatasetImportJobsRequest listDatasetImportJobsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listDatasetImportJobsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ListDatasetImportJobsRequest> request = null;<NEW_LINE>Response<ListDatasetImportJobsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListDatasetImportJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDatasetImportJobsRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "forecast");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDatasetImportJobs");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListDatasetImportJobsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDatasetImportJobsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,628,747
public SingularSortedMap2<A, B> build() {<NEW_LINE>java.util.SortedMap<java.lang.Object, java.lang.Object> rawTypes = new java.util.TreeMap<java.lang.Object, java.lang.Object>();<NEW_LINE>if (this.rawTypes$key != null)<NEW_LINE>for (int $i = 0; $i < (this.rawTypes$key == null ? 0 : this.rawTypes$key.size()); $i++) rawTypes.put(this.rawTypes$key.get($i), this.rawTypes$value.get($i));<NEW_LINE>rawTypes = java.util.Collections.unmodifiableSortedMap(rawTypes);<NEW_LINE>java.util.SortedMap<Integer, Float> integers = new java.util.TreeMap<Integer, Float>();<NEW_LINE>if (this.integers$key != null)<NEW_LINE>for (int $i = 0; $i < (this.integers$key == null ? 0 : this.integers$key.size()); $i++) integers.put(this.integers$key.get($i), this.integers$value.get($i));<NEW_LINE>integers = java.util.Collections.unmodifiableSortedMap(integers);<NEW_LINE>java.util.SortedMap<A, B> generics = new java.util.<MASK><NEW_LINE>if (this.generics$key != null)<NEW_LINE>for (int $i = 0; $i < (this.generics$key == null ? 0 : this.generics$key.size()); $i++) generics.put(this.generics$key.get($i), this.generics$value.get($i));<NEW_LINE>generics = java.util.Collections.unmodifiableSortedMap(generics);<NEW_LINE>java.util.SortedMap<Number, String> extendsGenerics = new java.util.TreeMap<Number, String>();<NEW_LINE>if (this.extendsGenerics$key != null)<NEW_LINE>for (int $i = 0; $i < (this.extendsGenerics$key == null ? 0 : this.extendsGenerics$key.size()); $i++) extendsGenerics.put(this.extendsGenerics$key.get($i), this.extendsGenerics$value.get($i));<NEW_LINE>extendsGenerics = java.util.Collections.unmodifiableSortedMap(extendsGenerics);<NEW_LINE>return new SingularSortedMap2<A, B>(rawTypes, integers, generics, extendsGenerics);<NEW_LINE>}
TreeMap<A, B>();
1,696,031
private static void processStream(InputStream is, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>BufferedImage image;<NEW_LINE>try {<NEW_LINE>image = ImageIO.read(is);<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Many possible failures from JAI, so just catch anything as a failure<NEW_LINE>log.info(e.toString());<NEW_LINE>errorResponse(request, response, "badimage");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (image == null) {<NEW_LINE>errorResponse(request, response, "badimage");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>int height = image.getHeight();<NEW_LINE>int width = image.getWidth();<NEW_LINE>if (height <= 1 || width <= 1) {<NEW_LINE>log.info("Dimensions too small: " + width + 'x' + height);<NEW_LINE>errorResponse(request, response, "badimage");<NEW_LINE>return;<NEW_LINE>} else if (height * width > MAX_PIXELS) {<NEW_LINE>log.info("Dimensions too large: " + width + 'x' + height);<NEW_LINE>errorResponse(request, response, HttpServletResponse.SC_REQUEST_ENTITY_TOO_LARGE, "badimage");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>image.flush();<NEW_LINE>}<NEW_LINE>}
processImage(image, request, response);
806,962
private synchronized void merge(Device device, EnumSet<Option> options, ConfigurationChanges diffs) throws ConfigurationException {<NEW_LINE>if (!configurationExists())<NEW_LINE>throw new ConfigurationNotFoundException();<NEW_LINE>String deviceDN = deviceRef(device.getDeviceName());<NEW_LINE>Device prev = loadDevice(deviceDN);<NEW_LINE>ArrayList<String> destroyDNs = new ArrayList<>();<NEW_LINE>try {<NEW_LINE>boolean register = options != null && options.contains(Option.REGISTER);<NEW_LINE>boolean preserveVendorData = options != null && options.contains(Option.PRESERVE_VENDOR_DATA);<NEW_LINE>if (register) {<NEW_LINE>registerDiff(prev, device, destroyDNs);<NEW_LINE>}<NEW_LINE>ConfigurationChanges.ModifiedObject ldapObj = ConfigurationChanges.addModifiedObject(diffs, deviceDN, ConfigurationChanges.ChangeType.U);<NEW_LINE>modifyAttributes(deviceDN, storeDiffs(ldapObj, prev, device, new ArrayList<<MASK><NEW_LINE>ConfigurationChanges.removeLastIfEmpty(diffs, ldapObj);<NEW_LINE>mergeChilds(diffs, prev, device, deviceDN, preserveVendorData);<NEW_LINE>destroyDNs.clear();<NEW_LINE>if (register) {<NEW_LINE>markForUnregister(prev, device, destroyDNs);<NEW_LINE>}<NEW_LINE>if (options == null || !options.contains(Option.PRESERVE_CERTIFICATE))<NEW_LINE>updateCertificates(prev, device);<NEW_LINE>} catch (NameNotFoundException e) {<NEW_LINE>throw new ConfigurationNotFoundException(e);<NEW_LINE>} catch (NamingException e) {<NEW_LINE>throw new ConfigurationException(e);<NEW_LINE>} catch (CertificateException e) {<NEW_LINE>throw new ConfigurationException(e);<NEW_LINE>} finally {<NEW_LINE>unregister(destroyDNs);<NEW_LINE>}<NEW_LINE>}
ModificationItem>(), preserveVendorData));
75,363
public GradientValue_F32 compute(int x, int y) {<NEW_LINE>int horizontalOffset = x - r - 1;<NEW_LINE>int indexSrc1 = input.startIndex + (y - r - 1) * input.stride + horizontalOffset;<NEW_LINE>int indexSrc2 = indexSrc1 + r * input.stride;<NEW_LINE>int indexSrc3 = indexSrc2 + input.stride;<NEW_LINE>int indexSrc4 = indexSrc3 + r * input.stride;<NEW_LINE>float p0 = input.data[indexSrc1];<NEW_LINE>float p1 = input.data[indexSrc1 + r];<NEW_LINE>float p2 = input.data[indexSrc1 + r + 1];<NEW_LINE>float p3 = input.data[indexSrc1 + w];<NEW_LINE>float p11 = input.data[indexSrc2];<NEW_LINE>float p4 = input.data[indexSrc2 + w];<NEW_LINE>float p10 = input.data[indexSrc3];<NEW_LINE>float p5 = input.data[indexSrc3 + w];<NEW_LINE>float <MASK><NEW_LINE>float p8 = input.data[indexSrc4 + r];<NEW_LINE>float p7 = input.data[indexSrc4 + r + 1];<NEW_LINE>float p6 = input.data[indexSrc4 + w];<NEW_LINE>float left = p8 - p9 - p1 + p0;<NEW_LINE>float right = p6 - p7 - p3 + p2;<NEW_LINE>float top = p4 - p11 - p3 + p0;<NEW_LINE>float bottom = p6 - p9 - p5 + p10;<NEW_LINE>ret.x = right - left;<NEW_LINE>ret.y = bottom - top;<NEW_LINE>return ret;<NEW_LINE>}
p9 = input.data[indexSrc4];
1,006,710
public JanusGraphVertex addVertex(Object... keyValues) {<NEW_LINE>ElementHelper.legalPropertyKeyValueArray(keyValues);<NEW_LINE>final Optional<Object> idValue = ElementHelper.getIdValue(keyValues);<NEW_LINE>if (idValue.isPresent() && !((StandardJanusGraph) getGraph()).getConfiguration().allowVertexIdSetting())<NEW_LINE>throw Vertex.Exceptions.userSuppliedIdsNotSupported();<NEW_LINE>Object labelValue = null;<NEW_LINE>for (int i = 0; i < keyValues.length; i = i + 2) {<NEW_LINE>if (keyValues[i].equals(T.label)) {<NEW_LINE>labelValue = keyValues[i + 1];<NEW_LINE>Preconditions.checkArgument(labelValue instanceof VertexLabel || labelValue instanceof String, "Expected a string or VertexLabel as the vertex label argument, but got: %s", labelValue);<NEW_LINE>if (labelValue instanceof String)<NEW_LINE>ElementHelper.validateLabel((String) labelValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>VertexLabel label = BaseVertexLabel.DEFAULT_VERTEXLABEL;<NEW_LINE>if (labelValue != null) {<NEW_LINE>label = (labelValue instanceof VertexLabel) ? (VertexLabel) labelValue : getOrCreateVertexLabel((String) labelValue);<NEW_LINE>}<NEW_LINE>final Long id = idValue.map(Number.class::cast).map(Number::longValue).orElse(null);<NEW_LINE>final JanusGraphVertex <MASK><NEW_LINE>org.janusgraph.graphdb.util.ElementHelper.attachProperties(vertex, keyValues);<NEW_LINE>return vertex;<NEW_LINE>}
vertex = addVertex(id, label);
1,140,709
public void complete() {<NEW_LINE>// Read existing annotation list and verify each class still has this annotation<NEW_LINE>try (BufferedReader reader = this.createReader()) {<NEW_LINE>if (reader != null) {<NEW_LINE>reader.lines().forEach(canonicalName -> {<NEW_LINE>if (!locations.contains(canonicalName)) {<NEW_LINE>TypeElement element = this.processingEnv.getElementUtils().getTypeElement(canonicalName);<NEW_LINE>if (element != null && element.getKind() == ElementKind.CLASS && contains(element.getAnnotationMirrors(), this.annotationClassName)) {<NEW_LINE>locations.add(canonicalName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>if (!locations.isEmpty()) {<NEW_LINE>try (BufferedWriter writer = this.createWriter()) {<NEW_LINE>for (String location : this.locations) {<NEW_LINE>writer.write(location);<NEW_LINE>writer.newLine();<NEW_LINE>}<NEW_LINE>} catch (IOException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>this.processingEnv.getMessager().printMessage(Diagnostic.Kind.<MASK><NEW_LINE>}<NEW_LINE>this.processingEnv.getMessager().printMessage(Diagnostic.Kind.NOTE, "Completed processing for " + this.annotationClassName);<NEW_LINE>}
NOTE, "Did not find any classes annotated with " + this.annotationClassName);
1,682,173
private boolean performRepoTest() {<NEW_LINE>boolean testCreateTarget = options.isCreateTarget();<NEW_LINE>StorageTestResult testResult = transferManager.test(testCreateTarget);<NEW_LINE>logger.log(<MASK><NEW_LINE>if (testResult.isTargetExists() && testResult.isTargetCanWrite() && !testResult.isRepoFileExists()) {<NEW_LINE>logger.log(Level.INFO, "--> OKAY: Target exists and is writable, but repo doesn't exist. We're good to go!");<NEW_LINE>return true;<NEW_LINE>} else if (testCreateTarget && !testResult.isTargetExists() && testResult.isTargetCanCreate()) {<NEW_LINE>logger.log(Level.INFO, "--> OKAY: Target does not exist, but can be created. We're good to go!");<NEW_LINE>return true;<NEW_LINE>} else {<NEW_LINE>logger.log(Level.INFO, "--> NOT OKAY: Invalid target/repo state. Operation cannot be continued.");<NEW_LINE>result.setResultCode(InitResultCode.NOK_TEST_FAILED);<NEW_LINE>result.setTestResult(testResult);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
Level.INFO, "Storage test result ist " + testResult);
1,046,091
protected void translateCore(final ITranslationEnvironment environment, final IInstruction instruction, final List<ReilInstruction> instructions) throws InternalTranslationException {<NEW_LINE>final IOperandTreeNode registerOperand1 = instruction.getOperands().get(0).getRootNode().getChildren().get(0);<NEW_LINE>final IOperandTreeNode shifter = instruction.getOperands().get(1).getRootNode();<NEW_LINE>final String targetRegister = (registerOperand1.getValue());<NEW_LINE>final OperandSize bt = OperandSize.BYTE;<NEW_LINE>final OperandSize dw = OperandSize.DWORD;<NEW_LINE>long baseOffset = (instruction.getAddress().toLong() * 0x100) + instructions.size();<NEW_LINE>// compute <shifter_operand><NEW_LINE>final Pair<String, String> shifterPair = AddressingModeOneGenerator.generate(baseOffset, <MASK><NEW_LINE>baseOffset = (instruction.getAddress().toLong() * 0x100) + instructions.size();<NEW_LINE>final String shifterOperand = shifterPair.first();<NEW_LINE>final String shifterCarryOut = shifterPair.second();<NEW_LINE>instructions.add(ReilHelpers.createStr(baseOffset++, dw, shifterOperand, dw, targetRegister));<NEW_LINE>if (instruction.getMnemonic().endsWith("S") && (instruction.getMnemonic().length() != 5)) {<NEW_LINE>// match the case where we have to set flags this does not handle the S == 1 and Rd == R15<NEW_LINE>// case !!!<NEW_LINE>final String tmpVar3 = environment.getNextVariableString();<NEW_LINE>// N Flag Rd[31]<NEW_LINE>instructions.add(ReilHelpers.createBsh(baseOffset++, dw, targetRegister, dw, String.valueOf(-31L), bt, tmpVar3));<NEW_LINE>instructions.add(ReilHelpers.createAnd(baseOffset++, bt, tmpVar3, bt, String.valueOf(1L), bt, "N"));<NEW_LINE>// Z Flag if Rd == 0 then 1 else 0<NEW_LINE>instructions.add(ReilHelpers.createBisz(baseOffset++, dw, targetRegister, bt, "Z"));<NEW_LINE>// C Flag shifter_carryout<NEW_LINE>instructions.add(ReilHelpers.createStr(baseOffset++, bt, shifterCarryOut, bt, "C"));<NEW_LINE>}<NEW_LINE>}
environment, instruction, instructions, shifter);
1,835,119
private static void addUserIdentityOptions(Options opts) {<NEW_LINE>OptionGroup group = new OptionGroup();<NEW_LINE>group.addOption(Option.builder().hasArg().argName("name").desc(rb.getString("user")).longOpt("user").build());<NEW_LINE>opts.addOption(Option.builder().hasArg().argName("assertion").desc(rb.getString("user-saml")).longOpt("user-saml").build());<NEW_LINE>opts.addOption(Option.builder().hasArg().argName("token").desc(rb.getString("user-jwt")).longOpt("user-jwt").build());<NEW_LINE>opts.addOptionGroup(group);<NEW_LINE>opts.addOption(Option.builder().hasArg().argName("password").desc(rb.getString("user-pass")).longOpt<MASK><NEW_LINE>opts.addOption(null, "user-rsp", false, rb.getString("user-rsp"));<NEW_LINE>}
("user-pass").build());
171,004
private void openNotebook(final FileSystemItem rnbFile, final SourceColumn targetColumn, final ResultCallback<EditingTarget, ServerError> resultCallback) {<NEW_LINE>// construct path to .Rmd<NEW_LINE>final String rnbPath = rnbFile.getPath();<NEW_LINE>final String rmdPath = FilePathUtils.filePathSansExtension(rnbPath) + ".Rmd";<NEW_LINE>final FileSystemItem rmdFile = FileSystemItem.createFile(rmdPath);<NEW_LINE>// if we already have associated .Rmd file open, then just edit it<NEW_LINE>// TODO: should we perform conflict resolution here as well?<NEW_LINE>if (openFileAlreadyOpen(rmdFile, resultCallback))<NEW_LINE>return;<NEW_LINE>// extract Rmd File from rnb file, and open that instead<NEW_LINE>extractRmdFile(rnbFile, new ResultCallback<SourceDocumentResult, ServerError>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onSuccess(SourceDocumentResult doc) {<NEW_LINE>openNotebook(rmdFile, doc, targetColumn, resultCallback);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onFailure(ServerError error) {<NEW_LINE>globalDisplay_.showErrorMessage(constants_.notebookOpenFailed(), constants_.notebookCouldNotBeOpenedMessage<MASK><NEW_LINE>resultCallback.onFailure(error);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
(error.getMessage()));
1,476,225
public void executeQueryPhase(ShardSearchRequest request, SearchShardTask task, ActionListener<SearchPhaseResult> listener) {<NEW_LINE>assert request.canReturnNullResponseIfMatchNoDocs() == false || request.numberOfShards() > 1 : "empty responses require more than one shard";<NEW_LINE>final IndexShard shard = getShard(request);<NEW_LINE>rewriteAndFetchShardRequest(shard, request, listener.delegateFailure((l, orig) -> {<NEW_LINE>// check if we can shortcut the query phase entirely.<NEW_LINE>if (orig.canReturnNullResponseIfMatchNoDocs()) {<NEW_LINE>assert orig.scroll() == null;<NEW_LINE>final CanMatchShardResponse canMatchResp;<NEW_LINE>try {<NEW_LINE>ShardSearchRequest clone = new ShardSearchRequest(orig);<NEW_LINE><MASK><NEW_LINE>} catch (Exception exc) {<NEW_LINE>l.onFailure(exc);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (canMatchResp.canMatch() == false) {<NEW_LINE>l.onResponse(QuerySearchResult.nullInstance());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ensureAfterSeqNoRefreshed(shard, orig, () -> executeQueryPhase(orig, task), l);<NEW_LINE>}));<NEW_LINE>}
canMatchResp = canMatch(clone, false);
593,066
protected void initInput() {<NEW_LINE>onKeyDown(KeyCode.F, () -> {<NEW_LINE>getGameWorld().removeEntity(e1);<NEW_LINE>runOnce(() -> {<NEW_LINE>getGameWorld().addEntity(e1);<NEW_LINE>}, Duration.seconds(0.1));<NEW_LINE>});<NEW_LINE>onKeyDown(KeyCode.G, () -> {<NEW_LINE>// should be fine, reusable<NEW_LINE>getGameWorld().removeEntity(e2);<NEW_LINE>runOnce(() -> {<NEW_LINE>getGameWorld().addEntity(e2);<NEW_LINE>}, Duration.seconds(0.1));<NEW_LINE>});<NEW_LINE>onKeyDown(KeyCode.T, () -> {<NEW_LINE>getGameWorld().getEntitiesCopy().forEach(Entity::removeFromWorld);<NEW_LINE>});<NEW_LINE>onKeyDown(KeyCode.H, () -> {<NEW_LINE>// should be fine, reusable<NEW_LINE>spawn("e", <MASK><NEW_LINE>});<NEW_LINE>}
getInput().getMousePositionWorld());
1,576,712
private static void buildFieldStatistics(XContentBuilder builder, Terms curTerms) throws IOException {<NEW_LINE>long sumDocFreq = curTerms.getSumDocFreq();<NEW_LINE>int docCount = curTerms.getDocCount();<NEW_LINE>long sumTotalTermFrequencies = curTerms.getSumTotalTermFreq();<NEW_LINE>if (docCount >= 0) {<NEW_LINE>assert ((sumDocFreq >= 0)) : "docCount >= 0 but sumDocFreq ain't!";<NEW_LINE>assert ((sumTotalTermFrequencies >= 0)) : "docCount >= 0 but sumTotalTermFrequencies ain't!";<NEW_LINE>builder.startObject(FieldStrings.FIELD_STATISTICS);<NEW_LINE>builder.field(FieldStrings.SUM_DOC_FREQ, sumDocFreq);<NEW_LINE>builder.<MASK><NEW_LINE>builder.field(FieldStrings.SUM_TTF, sumTotalTermFrequencies);<NEW_LINE>builder.endObject();<NEW_LINE>} else if (docCount == -1) {<NEW_LINE>// this should only be -1 if the field<NEW_LINE>// statistics were not requested at all. In<NEW_LINE>// this case all 3 values should be -1<NEW_LINE>assert ((sumDocFreq == -1)) : "docCount was -1 but sumDocFreq ain't!";<NEW_LINE>assert ((sumTotalTermFrequencies == -1)) : "docCount was -1 but sumTotalTermFrequencies ain't!";<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException("Something is wrong with the field statistics of the term vector request: Values are " + "\n" + FieldStrings.SUM_DOC_FREQ + " " + sumDocFreq + "\n" + FieldStrings.DOC_COUNT + " " + docCount + "\n" + FieldStrings.SUM_TTF + " " + sumTotalTermFrequencies);<NEW_LINE>}<NEW_LINE>}
field(FieldStrings.DOC_COUNT, docCount);
597,676
private void buildQuery(SearchRequestBuilder searchReq, ParseResult info) {<NEW_LINE>String[] types = new String[info.getSources().size()];<NEW_LINE>for (int i = 0; i < info.getSources().size(); i++) types[i] = info.getSources().<MASK><NEW_LINE>SearchRequestBuilder req = searchReq.setTypes(types);<NEW_LINE>// add filters and aggregations<NEW_LINE>if (info.getAggregation() != null) {<NEW_LINE>// when aggregating the query must be a query and not a filter<NEW_LINE>if (info.getQuery() != null)<NEW_LINE>req.setQuery(info.getQuery());<NEW_LINE>req.addAggregation(info.getAggregation());<NEW_LINE>// ordering does not work on aggregations (has to be done in client)<NEW_LINE>} else if (info.getQuery() != null) {<NEW_LINE>if (// use query instead of filter to get a score<NEW_LINE>info.getRequestScore())<NEW_LINE>// use query instead of filter to get a score<NEW_LINE>req.setQuery(info.getQuery());<NEW_LINE>else<NEW_LINE>req.setPostFilter(info.getQuery());<NEW_LINE>// add order<NEW_LINE>for (OrderBy ob : info.getSorts()) {<NEW_LINE>req.addSort(ob.getField(), ob.getOrder());<NEW_LINE>}<NEW_LINE>} else<NEW_LINE>req.setQuery(QueryBuilders.matchAllQuery());<NEW_LINE>int fetchSize = Utils.getIntProp(props, Utils.PROP_FETCH_SIZE, 10000);<NEW_LINE>int limit = determineLimit(info.getLimit());<NEW_LINE>// add limit and determine to use scroll<NEW_LINE>if (info.getAggregation() != null) {<NEW_LINE>req = req.setSize(0);<NEW_LINE>} else if (limit > 0 && limit < fetchSize) {<NEW_LINE>req.setSize(limit);<NEW_LINE>} else if (info.getSorts().isEmpty()) {<NEW_LINE>// scrolling does not work well with sort<NEW_LINE>req.setSize(fetchSize);<NEW_LINE>req.addSort("_doc", SortOrder.ASC);<NEW_LINE>req.setScroll(new TimeValue(Utils.getIntProp(props, Utils.PROP_SCROLL_TIMEOUT_SEC, 60) * 1000));<NEW_LINE>}<NEW_LINE>// use query cache when this was indicated in FROM clause<NEW_LINE>if (info.getUseCache())<NEW_LINE>req.setRequestCache(true);<NEW_LINE>req.setTimeout(TimeValue.timeValueMillis(Utils.getIntProp(props, Utils.PROP_QUERY_TIMEOUT_MS, 10000)));<NEW_LINE>}
get(i).getSource();
1,457,644
private void createFiles(long numFiles, List<String> args) throws Exception {<NEW_LINE>List<String> newArgs = new ArrayList<>(args);<NEW_LINE>updateArgValue(newArgs, "--operation", Operation.CREATE_FILE.toString());<NEW_LINE>updateArgValue(newArgs, "--warmup", "0s");<NEW_LINE>updateArgValue(newArgs, "--threads", "128");<NEW_LINE>updateArgValue(newArgs, "--stop-count", Long.toString(numFiles));<NEW_LINE><MASK><NEW_LINE>LOG.info(String.format("Preparing %d files. args: %s", numFiles, String.join(" ", newArgs)));<NEW_LINE>Benchmark b = new StressMasterBench();<NEW_LINE>String result = b.run(newArgs.toArray(new String[0]));<NEW_LINE>MasterBenchSummary summary = JsonSerializable.fromJson(result, new MasterBenchSummary[0]);<NEW_LINE>if (!summary.collectErrorsFromAllNodes().isEmpty()) {<NEW_LINE>throw new IllegalStateException(String.format("Could not create files for operation (%s). error: %s", mParameters.mOperation, summary.collectErrorsFromAllNodes().iterator().next()));<NEW_LINE>}<NEW_LINE>}
updateArgValue(newArgs, "--target-throughput", "10000");
562,835
private static void declareOverloadsClamp() {<NEW_LINE>final String name = "clamp";<NEW_LINE>declareFunction(FLOAT, name, FLOAT, "val", FLOAT, "min", FLOAT, "max");<NEW_LINE>declareFunction(FLOAT2, name, FLOAT2, "val", FLOAT2, "min", FLOAT2, "max");<NEW_LINE>declareFunction(FLOAT3, name, FLOAT3, "val", FLOAT3, "min", FLOAT3, "max");<NEW_LINE>declareFunction(FLOAT4, name, FLOAT4, "val", FLOAT4, "min", FLOAT4, "max");<NEW_LINE>declareFunction(FLOAT2, name, FLOAT2, "val", FLOAT, "min", FLOAT, "max");<NEW_LINE>declareFunction(FLOAT3, name, FLOAT3, "val", <MASK><NEW_LINE>declareFunction(FLOAT4, name, FLOAT4, "val", FLOAT, "min", FLOAT, "max");<NEW_LINE>}
FLOAT, "min", FLOAT, "max");
171,478
// Save internal schema<NEW_LINE>private void saveInternalSchema(HoodieTable table, String instantTime, HoodieCommitMetadata metadata) {<NEW_LINE>TableSchemaResolver schemaUtil = new TableSchemaResolver(table.getMetaClient());<NEW_LINE>String historySchemaStr = schemaUtil.getTableHistorySchemaStrFromCommitMetadata().orElse("");<NEW_LINE>FileBasedInternalSchemaStorageManager schemasManager = new FileBasedInternalSchemaStorageManager(table.getMetaClient());<NEW_LINE>if (!historySchemaStr.isEmpty()) {<NEW_LINE>InternalSchema internalSchema = InternalSchemaUtils.searchSchema(Long.parseLong(instantTime), SerDeHelper.parseSchemas(historySchemaStr));<NEW_LINE>Schema avroSchema = HoodieAvroUtils.createHoodieWriteSchema(new Schema.Parser().parse(config.getSchema()));<NEW_LINE>InternalSchema evolvedSchema = AvroSchemaEvolutionUtils.evolveSchemaFromNewAvroSchema(avroSchema, internalSchema);<NEW_LINE>if (evolvedSchema.equals(internalSchema)) {<NEW_LINE>metadata.addMetadata(SerDeHelper.LATEST_SCHEMA<MASK><NEW_LINE>// TODO save history schema by metaTable<NEW_LINE>schemasManager.persistHistorySchemaStr(instantTime, historySchemaStr);<NEW_LINE>} else {<NEW_LINE>evolvedSchema.setSchemaId(Long.parseLong(instantTime));<NEW_LINE>String newSchemaStr = SerDeHelper.toJson(evolvedSchema);<NEW_LINE>metadata.addMetadata(SerDeHelper.LATEST_SCHEMA, newSchemaStr);<NEW_LINE>schemasManager.persistHistorySchemaStr(instantTime, SerDeHelper.inheritSchemas(evolvedSchema, historySchemaStr));<NEW_LINE>}<NEW_LINE>// update SCHEMA_KEY<NEW_LINE>metadata.addMetadata(SCHEMA_KEY, AvroInternalSchemaConverter.convert(evolvedSchema, avroSchema.getName()).toString());<NEW_LINE>}<NEW_LINE>}
, SerDeHelper.toJson(evolvedSchema));
1,354,919
private JPanel createButtonPanel() {<NEW_LINE>CancelOkListener listener = new CancelOkListener();<NEW_LINE>JButton button_ok = new JButton(okButton);<NEW_LINE>button_ok.setActionCommand(okButton);<NEW_LINE>button_ok.addActionListener(listener);<NEW_LINE>JButton button_cancel = new JButton(cancelButton);<NEW_LINE>button_cancel.setActionCommand(cancelButton);<NEW_LINE>button_cancel.addActionListener(listener);<NEW_LINE>JPanel buttonPanel = new JPanel();<NEW_LINE>buttonPanel.setLayout(new BoxLayout(buttonPanel, BoxLayout.X_AXIS));<NEW_LINE>buttonPanel.add(Box.createHorizontalGlue());<NEW_LINE>buttonPanel.add(button_cancel);<NEW_LINE>buttonPanel.add(Box.createRigidArea(new <MASK><NEW_LINE>buttonPanel.add(button_ok);<NEW_LINE>buttonPanel.add(Box.createHorizontalGlue());<NEW_LINE>buttonPanel.setAlignmentX(Component.LEFT_ALIGNMENT);<NEW_LINE>return buttonPanel;<NEW_LINE>}
Dimension(20, 0)));
196,584
/*<NEW_LINE>* (non-Javadoc)<NEW_LINE>*<NEW_LINE>* @see org.openhab.binding.digitalSTROM2.internal.client.job.SensorJob#execute(org.openhab.binding.digitalSTROM2.<NEW_LINE>* internal.client.DigitalSTROMAPI, java.lang.String)<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void execute(DigitalSTROMAPI digitalSTROM, String token) {<NEW_LINE>int sensorValue = digitalSTROM.getDeviceSensorValue(token, this.device.getDSID(), null, this.sensorIndex);<NEW_LINE>logger.info(this.device.getName() + " DeviceSensorValue : " + this.sensorIndex + " " + this.sensorIndex.ordinal() + " " + this.sensorIndex.getIndex() + " " + sensorValue + ", DSID: " + this.device.getDSID().getValue());<NEW_LINE>switch(this.sensorIndex) {<NEW_LINE>case TEMPERATURE_INDOORS:<NEW_LINE>this.device.setTemperatureSensorValue(sensorValue);<NEW_LINE>break;<NEW_LINE>case RELATIVE_HUMIDITY_INDOORS:<NEW_LINE><MASK><NEW_LINE>break;<NEW_LINE>case TEMPERATURE_OUTDOORS:<NEW_LINE>this.device.setTemperatureSensorValue(sensorValue);<NEW_LINE>break;<NEW_LINE>case RELATIVE_HUMIDITY_OUTDOORS:<NEW_LINE>this.device.setTemperatureSensorValue(sensorValue);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}
this.device.setHumiditySensorValue(sensorValue);
1,370,583
public static com.liferay.portal.model.Address updateAddress(java.lang.String addressId, java.lang.String description, java.lang.String street1, java.lang.String street2, java.lang.String city, java.lang.String state, java.lang.String zip, java.lang.String country, java.lang.String phone, java.lang.String fax, java.lang.String cell) throws com.liferay.portal.PortalException, com.liferay.portal.SystemException {<NEW_LINE>try {<NEW_LINE>AddressManager addressManager = AddressManagerFactory.getManager();<NEW_LINE>return addressManager.updateAddress(addressId, description, street1, street2, city, state, zip, country, phone, fax, cell);<NEW_LINE>} catch (com.liferay.portal.PortalException pe) {<NEW_LINE>throw pe;<NEW_LINE>} catch (com.liferay.portal.SystemException se) {<NEW_LINE>throw se;<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new com.<MASK><NEW_LINE>}<NEW_LINE>}
liferay.portal.SystemException(e);
710,848
final CreateHumanTaskUiResult executeCreateHumanTaskUi(CreateHumanTaskUiRequest createHumanTaskUiRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createHumanTaskUiRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateHumanTaskUiRequest> request = null;<NEW_LINE>Response<CreateHumanTaskUiResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateHumanTaskUiRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createHumanTaskUiRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "SageMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateHumanTaskUi");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateHumanTaskUiResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateHumanTaskUiResultJsonUnmarshaller());<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);
586,141
// TODO move this? It's shared by all the OHLC classes<NEW_LINE>public static void populateData(Date startDate, double startPrice, int count, List<Date> xData, List<Double> openData, List<Double> highData, List<Double> lowData, List<Double> closeData) {<NEW_LINE>Calendar cal = Calendar.getInstance();<NEW_LINE>cal.setTime(startDate);<NEW_LINE>double data = startPrice;<NEW_LINE>for (int i = 1; i <= count; i++) {<NEW_LINE>// add 1 day<NEW_LINE>// startDate = new Date(startDate.getTime() + (1 * 1000 * 60 * 60 * 24));<NEW_LINE>// xData.add(startDate);<NEW_LINE>cal.add(Calendar.DATE, 1);<NEW_LINE>xData.add(cal.getTime());<NEW_LINE>double previous = data;<NEW_LINE>data = getNewClose(data, startPrice);<NEW_LINE>openData.add(previous);<NEW_LINE>highData.add(getHigh(Math.max(previous, data), startPrice));<NEW_LINE>lowData.add(getLow(Math.min(<MASK><NEW_LINE>closeData.add(data);<NEW_LINE>}<NEW_LINE>}
previous, data), startPrice));
62,998
public void routeSystemInfoAndExecuteSQL(String stmt, SchemaUtil.SchemaInfo schemaInfo, int sqlType) {<NEW_LINE>ShardingUserConfig user = (ShardingUserConfig) (DbleServer.getInstance().getConfig().getUsers().get(service.getUser()));<NEW_LINE>if (user == null || !user.getSchemas().contains(schemaInfo.getSchema())) {<NEW_LINE>service.writeErrMessage("42000", "Access denied for user '" + service.getUser() + "' to database '" + schemaInfo.getSchema() + "'", ErrorCode.ER_DBACCESS_DENIED_ERROR);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>RouteResultset rrs = new RouteResultset(stmt, sqlType);<NEW_LINE>try {<NEW_LINE>String noShardingNode = RouterUtil.isNoSharding(schemaInfo.getSchemaConfig(), schemaInfo.getTable());<NEW_LINE>if (noShardingNode != null) {<NEW_LINE>RouterUtil.routeToSingleNode(rrs, noShardingNode, Sets.newHashSet(schemaInfo.getSchema() + "." + schemaInfo.getTable()));<NEW_LINE>} else {<NEW_LINE>if (schemaInfo.getSchemaConfig().getTables().get(schemaInfo.getTable()) == null) {<NEW_LINE>// check view<NEW_LINE>ShowCreateView.response(service, schemaInfo.getSchema(), schemaInfo.getTable());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>RouterUtil.routeToRandomNode(rrs, schemaInfo.getSchemaConfig(), schemaInfo.getTable());<NEW_LINE>}<NEW_LINE>service.getSession2().execute(rrs);<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
service.executeException(e, stmt);
1,506,010
public ListSuitesResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ListSuitesResult listSuitesResult = new ListSuitesResult();<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 listSuitesResult;<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("suites", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listSuitesResult.setSuites(new ListUnmarshaller<Suite>(SuiteJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("nextToken", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>listSuitesResult.setNextToken(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 listSuitesResult;<NEW_LINE>}
JsonToken token = context.getCurrentToken();
889,435
public static PullMatchedBizDataResponse unmarshall(PullMatchedBizDataResponse pullMatchedBizDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>pullMatchedBizDataResponse.setRequestId(_ctx.stringValue("PullMatchedBizDataResponse.RequestId"));<NEW_LINE>pullMatchedBizDataResponse.setErrorCode(_ctx.stringValue("PullMatchedBizDataResponse.ErrorCode"));<NEW_LINE>pullMatchedBizDataResponse.setErrorMessage(_ctx.stringValue("PullMatchedBizDataResponse.ErrorMessage"));<NEW_LINE>pullMatchedBizDataResponse.setMessage(_ctx.stringValue("PullMatchedBizDataResponse.Message"));<NEW_LINE>pullMatchedBizDataResponse.setCode(_ctx.stringValue("PullMatchedBizDataResponse.Code"));<NEW_LINE>pullMatchedBizDataResponse.setDynamicCode(_ctx.stringValue("PullMatchedBizDataResponse.DynamicCode"));<NEW_LINE>pullMatchedBizDataResponse.setSuccess(_ctx.booleanValue("PullMatchedBizDataResponse.Success"));<NEW_LINE>pullMatchedBizDataResponse.setDynamicMessage(_ctx.stringValue("PullMatchedBizDataResponse.DynamicMessage"));<NEW_LINE>List<MatchedBizData> matchedDataList = new ArrayList<MatchedBizData>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("PullMatchedBizDataResponse.MatchedDataList.Length"); i++) {<NEW_LINE>MatchedBizData matchedBizData = new MatchedBizData();<NEW_LINE>matchedBizData.setStartTimestamp(_ctx.longValue("PullMatchedBizDataResponse.MatchedDataList[" + i + "].StartTimestamp"));<NEW_LINE>matchedBizData.setStoreId(_ctx.longValue("PullMatchedBizDataResponse.MatchedDataList[" + i + "].StoreId"));<NEW_LINE>matchedBizData.setDeviceId(_ctx.stringValue<MASK><NEW_LINE>matchedBizData.setEndTimestamp(_ctx.longValue("PullMatchedBizDataResponse.MatchedDataList[" + i + "].EndTimestamp"));<NEW_LINE>matchedBizData.setRecordId(_ctx.stringValue("PullMatchedBizDataResponse.MatchedDataList[" + i + "].RecordId"));<NEW_LINE>matchedBizData.setBizDataType(_ctx.stringValue("PullMatchedBizDataResponse.MatchedDataList[" + i + "].BizDataType"));<NEW_LINE>matchedBizData.setUkId(_ctx.longValue("PullMatchedBizDataResponse.MatchedDataList[" + i + "].UkId"));<NEW_LINE>matchedBizData.setAttirbute(_ctx.stringValue("PullMatchedBizDataResponse.MatchedDataList[" + i + "].Attirbute"));<NEW_LINE>matchedBizData.setDeviceType(_ctx.stringValue("PullMatchedBizDataResponse.MatchedDataList[" + i + "].DeviceType"));<NEW_LINE>matchedDataList.add(matchedBizData);<NEW_LINE>}<NEW_LINE>pullMatchedBizDataResponse.setMatchedDataList(matchedDataList);<NEW_LINE>return pullMatchedBizDataResponse;<NEW_LINE>}
("PullMatchedBizDataResponse.MatchedDataList[" + i + "].DeviceId"));
473,127
public void execute(TransformerImpl transformer) throws TransformerException {<NEW_LINE>if (transformer.isRecursiveAttrSet(this)) {<NEW_LINE>throw new TransformerException(// "xsl:attribute-set '"+m_qname.m_localpart+<NEW_LINE>XSLMessages.// "xsl:attribute-set '"+m_qname.m_localpart+<NEW_LINE>createMessage(// "xsl:attribute-set '"+m_qname.m_localpart+<NEW_LINE>XSLTErrorResources.ER_XSLATTRSET_USED_ITSELF, new Object[] { m_qname.getLocalPart() }));<NEW_LINE>}<NEW_LINE>transformer.pushElemAttributeSet(this);<NEW_LINE>super.execute(transformer);<NEW_LINE>ElemAttribute <MASK><NEW_LINE>while (null != attr) {<NEW_LINE>attr.execute(transformer);<NEW_LINE>attr = (ElemAttribute) attr.getNextSiblingElem();<NEW_LINE>}<NEW_LINE>transformer.popElemAttributeSet();<NEW_LINE>}
attr = (ElemAttribute) getFirstChildElem();
1,807,357
private Model internalBuildModel(WSDLDocument document) {<NEW_LINE>numPasses++;<NEW_LINE>// build the jaxbModel to be used latter<NEW_LINE>buildJAXBModel(document);<NEW_LINE>QName modelName = new QName(document.getDefinitions().getTargetNamespaceURI(), document.getDefinitions().getName() == null ? "model" : document.getDefinitions().getName());<NEW_LINE>Model model = new Model(modelName, document.getDefinitions());<NEW_LINE>model.setJAXBModel(<MASK><NEW_LINE>// This fails with the changed classname (WSDLModeler to WSDLModeler11 etc.)<NEW_LINE>// with this source comaptibility change the WSDL Modeler class name is changed. Right now hardcoding the<NEW_LINE>// modeler class name to the same one being checked in WSDLGenerator.<NEW_LINE>model.setProperty(ModelProperties.PROPERTY_MODELER_NAME, ModelProperties.WSDL_MODELER_NAME);<NEW_LINE>_javaExceptions = new HashMap<String, JavaException>();<NEW_LINE>_bindingNameToPortMap = new HashMap<QName, Port>();<NEW_LINE>// grab target namespace<NEW_LINE>model.setTargetNamespaceURI(document.getDefinitions().getTargetNamespaceURI());<NEW_LINE>setDocumentationIfPresent(model, document.getDefinitions().getDocumentation());<NEW_LINE>boolean hasServices = document.getDefinitions().services().hasNext();<NEW_LINE>if (hasServices) {<NEW_LINE>for (Iterator iter = document.getDefinitions().services(); iter.hasNext(); ) {<NEW_LINE>processService((com.sun.tools.internal.ws.wsdl.document.Service) iter.next(), model, document);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// emit a warning if there are no service definitions<NEW_LINE>warning(model.getEntity(), ModelerMessages.WSDLMODELER_WARNING_NO_SERVICE_DEFINITIONS_FOUND());<NEW_LINE>}<NEW_LINE>return model;<NEW_LINE>}
getJAXBModelBuilder().getJAXBModel());
583,704
final DeleteReportDefinitionResult executeDeleteReportDefinition(DeleteReportDefinitionRequest deleteReportDefinitionRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteReportDefinitionRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<DeleteReportDefinitionRequest> request = null;<NEW_LINE>Response<DeleteReportDefinitionResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteReportDefinitionRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteReportDefinitionRequest));<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, "ApplicationCostProfiler");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteReportDefinition");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<DeleteReportDefinitionResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteReportDefinitionResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
701,331
public RelDataType deriveSumType(RelDataTypeFactory typeFactory, RelDataType argumentType) {<NEW_LINE>if (argumentType instanceof BasicSqlType) {<NEW_LINE>SqlTypeName type = deriveSumType(argumentType.getSqlTypeName());<NEW_LINE>if (type == BIGINT) {<NEW_LINE>// special-case for BIGINT - we use BIGINT(64) instead of the default BIGINT(63) because<NEW_LINE>// BIGINT + BIGINT can overflow.<NEW_LINE>return HazelcastIntegerType.create(Long.SIZE, argumentType.isNullable());<NEW_LINE>}<NEW_LINE>if (type.allowsPrec() && argumentType.getPrecision() != RelDataType.PRECISION_NOT_SPECIFIED) {<NEW_LINE>int precision = typeFactory.getTypeSystem().getMaxPrecision(type);<NEW_LINE>if (type.allowsScale()) {<NEW_LINE>return typeFactory.createTypeWithNullability(typeFactory.createSqlType(type, precision, argumentType.getScale()), argumentType.isNullable());<NEW_LINE>} else {<NEW_LINE>return typeFactory.createTypeWithNullability(typeFactory.createSqlType(type, precision<MASK><NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>return typeFactory.createTypeWithNullability(typeFactory.createSqlType(type), argumentType.isNullable());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return argumentType;<NEW_LINE>}
), argumentType.isNullable());
1,019,586
protected void checkForItemRequirements(Offer offer, CandidatePromotionItems candidates, OfferItemCriteria criteria, List<PromotableOrderItem> promotableOrderItems, boolean isQualifier) {<NEW_LINE>boolean matchFound = false;<NEW_LINE><MASK><NEW_LINE>int matchedQuantity = 0;<NEW_LINE>if (criteriaQuantity > 0) {<NEW_LINE>// If matches are found, add the candidate items to a list and store it with the itemCriteria<NEW_LINE>// for this promotion.<NEW_LINE>for (PromotableOrderItem item : promotableOrderItems) {<NEW_LINE>if (couldOrderItemMeetOfferRequirement(criteria, item)) {<NEW_LINE>if (isQualifier) {<NEW_LINE>candidates.addQualifier(criteria, item);<NEW_LINE>} else {<NEW_LINE>candidates.addTarget(criteria, item);<NEW_LINE>addChildOrderItemsToCandidates(offer, candidates, criteria, promotableOrderItems, item);<NEW_LINE>}<NEW_LINE>matchedQuantity += item.getQuantity();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>matchFound = (matchedQuantity >= criteriaQuantity);<NEW_LINE>}<NEW_LINE>if (isQualifier) {<NEW_LINE>candidates.setMatchedQualifier(matchFound);<NEW_LINE>} else {<NEW_LINE>candidates.setMatchedTarget(matchFound);<NEW_LINE>}<NEW_LINE>}
int criteriaQuantity = criteria.getQuantity();
203,910
public void addToBatch(BatchStatement batch, CqlColumnListMutationImpl<?, ?> colListMutation, boolean useCaching) {<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append(INSERT_INTO).append(keyspace + "." + cfDef.getName());<NEW_LINE>sb.append(OPEN_PARA);<NEW_LINE>// Init the object array for the bind values<NEW_LINE>int size = colListMutation.getMutationList().size() + 1;<NEW_LINE>Object[] values = new Object[size];<NEW_LINE>int index = 0;<NEW_LINE>// Add in the primary key<NEW_LINE>sb.append(cfDef.getPartitionKeyColumnDefinition().getName()).append(COMMA);<NEW_LINE>values[index++] = colListMutation.getRowKey();<NEW_LINE>for (CqlColumnMutationImpl<?, ?> colMutation : colListMutation.getMutationList()) {<NEW_LINE>sb.append(colMutation.columnName);<NEW_LINE>values[index++] = colMutation.columnValue;<NEW_LINE>if (index < size) {<NEW_LINE>sb.append(COMMA);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(VALUES);<NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>if (i < (size - 1)) {<NEW_LINE>sb.append(BIND_MARKER);<NEW_LINE>} else {<NEW_LINE>sb.append(LAST_BIND_MARKER);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>sb.append(CLOSE_PARA);<NEW_LINE>appendWriteOptions(sb, colListMutation.getDefaultTtl(<MASK><NEW_LINE>String query = sb.toString();<NEW_LINE>if (Logger.isDebugEnabled()) {<NEW_LINE>Logger.debug("Query: " + query);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>PreparedStatement pStatement = session.prepare(query);<NEW_LINE>batch.add(pStatement.bind(values));<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>}
), colListMutation.getTimestamp());
601,542
private CallTree selectInRootNodeList(final NodeList rootNodeList, boolean bestMatchingState) {<NEW_LINE>// in root list<NEW_LINE>if (rootNodeList.size() == 1) {<NEW_LINE>logger.info("Select root span in top node list");<NEW_LINE>final Node node = rootNodeList.get(0);<NEW_LINE>if (bestMatchingState) {<NEW_LINE>traceState.complete();<NEW_LINE>} else {<NEW_LINE>traceState.progress();<NEW_LINE>}<NEW_LINE>return node.getSpanCallTree();<NEW_LINE>}<NEW_LINE>// find focus<NEW_LINE>final NodeList focusNodeList = rootNodeList.filter(this.focusFilter);<NEW_LINE>if (focusNodeList.size() == 1) {<NEW_LINE>logger.info("Select root & focus span in top node list");<NEW_LINE>final Node <MASK><NEW_LINE>traceState.progress();<NEW_LINE>return node.getSpanCallTree();<NEW_LINE>} else if (focusNodeList.size() > 1) {<NEW_LINE>logger.info("Select first root & focus span in top node list");<NEW_LINE>final Node node = focusNodeList.get(0);<NEW_LINE>traceState.progress();<NEW_LINE>return node.getSpanCallTree();<NEW_LINE>}<NEW_LINE>// not found focus<NEW_LINE>logger.info("Select first root span in top node list, not found focus span");<NEW_LINE>final Node node = rootNodeList.get(0);<NEW_LINE>traceState.progress();<NEW_LINE>return node.getSpanCallTree();<NEW_LINE>}
node = focusNodeList.get(0);
1,745,066
public CorpUser update(@Nonnull String urn, @Nonnull CorpUserUpdateInput input, @Nonnull QueryContext context) throws Exception {<NEW_LINE>if (isAuthorizedToUpdate(urn, input, context)) {<NEW_LINE>// Get existing editable info to merge with<NEW_LINE>Optional<CorpUserEditableInfo> existingCorpUserEditableInfo = _entityClient.getVersionedAspect(urn, Constants.CORP_USER_EDITABLE_INFO_NAME, 0L, CorpUserEditableInfo.class, context.getAuthentication());<NEW_LINE>// Create the MCP<NEW_LINE>final MetadataChangeProposal proposal = new MetadataChangeProposal();<NEW_LINE>proposal.setEntityUrn<MASK><NEW_LINE>proposal.setEntityType(Constants.CORP_USER_ENTITY_NAME);<NEW_LINE>proposal.setAspectName(Constants.CORP_USER_EDITABLE_INFO_NAME);<NEW_LINE>proposal.setAspect(GenericRecordUtils.serializeAspect(mapCorpUserEditableInfo(input, existingCorpUserEditableInfo)));<NEW_LINE>proposal.setChangeType(ChangeType.UPSERT);<NEW_LINE>_entityClient.ingestProposal(proposal, context.getAuthentication());<NEW_LINE>return load(urn, context).getData();<NEW_LINE>}<NEW_LINE>throw new AuthorizationException("Unauthorized to perform this action. Please contact your DataHub administrator.");<NEW_LINE>}
(Urn.createFromString(urn));
737,234
public static void validateNoSpecialsGroupByExpressions(ExprNode[] groupByNodes) throws ExprValidationException {<NEW_LINE>ExprNodeSubselectDeclaredDotVisitor visitorSubselects = new ExprNodeSubselectDeclaredDotVisitor();<NEW_LINE>ExprNodeGroupingVisitorWParent visitorGrouping = new ExprNodeGroupingVisitorWParent();<NEW_LINE>List<ExprAggregateNode> aggNodesInGroupBy = new ArrayList<ExprAggregateNode>(1);<NEW_LINE>for (ExprNode groupByNode : groupByNodes) {<NEW_LINE>// no subselects<NEW_LINE>groupByNode.accept(visitorSubselects);<NEW_LINE>if (visitorSubselects.getSubselects().size() > 0) {<NEW_LINE>throw new ExprValidationException("Subselects not allowed within group-by");<NEW_LINE>}<NEW_LINE>// no special grouping-clauses<NEW_LINE>groupByNode.accept(visitorGrouping);<NEW_LINE>if (!visitorGrouping.getGroupingIdNodes().isEmpty()) {<NEW_LINE>throw ExprGroupingIdNode.makeException("grouping_id");<NEW_LINE>}<NEW_LINE>if (!visitorGrouping.getGroupingNodes().isEmpty()) {<NEW_LINE>throw ExprGroupingIdNode.makeException("grouping");<NEW_LINE>}<NEW_LINE>// no aggregations allowed<NEW_LINE><MASK><NEW_LINE>if (!aggNodesInGroupBy.isEmpty()) {<NEW_LINE>throw new ExprValidationException("Group-by expressions cannot contain aggregate functions");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
ExprAggregateNodeUtil.getAggregatesBottomUp(groupByNode, aggNodesInGroupBy);
1,416,747
private <R> OperationResult<R> execDualKeyspaceOperation(final KeyspaceOperation<R> ksOperation) throws ConnectionException {<NEW_LINE>final KeyspacePair pair = ksPair.get();<NEW_LINE>final Execution<R> exec1 = new SimpleSyncExec<R>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public OperationResult<R> execute() throws ConnectionException {<NEW_LINE>return ksOperation.exec(pair.getPrimaryKS());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>final Execution<R> exec2 = new SimpleSyncExec<R>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public OperationResult<R> execute() throws ConnectionException {<NEW_LINE>return ksOperation.exec(pair.getSecondaryKS());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>WriteMetadata writeMd = new WriteMetadata(pair.getDualKSMetadata(), null, null);<NEW_LINE>return executionStrategy.wrapExecutions(exec1, exec2, Collections.singletonList<MASK><NEW_LINE>}
(writeMd)).execute();
838,718
private static boolean matchHostName(String hostName, String pattern) {<NEW_LINE>checkArgument(hostName.length() != 0 && !hostName.startsWith(".") && !hostName.endsWith("."), "Invalid host name");<NEW_LINE>checkArgument(pattern.length() != 0 && !pattern.startsWith(".") && !pattern.endsWith("."), "Invalid pattern/domain name");<NEW_LINE>hostName = hostName.toLowerCase(Locale.US);<NEW_LINE>pattern = pattern.toLowerCase(Locale.US);<NEW_LINE>// hostName and pattern are now in lower case -- domain names are case-insensitive.<NEW_LINE>if (!pattern.contains("*")) {<NEW_LINE>// Not a wildcard pattern -- hostName and pattern must match exactly.<NEW_LINE>return hostName.equals(pattern);<NEW_LINE>}<NEW_LINE>// Wildcard pattern<NEW_LINE>if (pattern.length() == 1) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>int index = pattern.indexOf('*');<NEW_LINE>// At most one asterisk (*) is allowed.<NEW_LINE>if (pattern.indexOf('*', index + 1) != -1) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// Asterisk can only match prefix or suffix.<NEW_LINE>if (index != 0 && index != pattern.length() - 1) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>// HostName must be at least as long as the pattern because asterisk has to<NEW_LINE>// match one or more characters.<NEW_LINE>if (hostName.length() < pattern.length()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (index == 0 && hostName.endsWith(pattern.substring(1))) {<NEW_LINE>// Prefix matching fails.<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>// Pattern matches hostname if suffix matching succeeds.<NEW_LINE>return index == pattern.length() - 1 && hostName.startsWith(pattern.substring(0, pattern<MASK><NEW_LINE>}
.length() - 1));
1,653,548
public void andNot(BitVector set) {<NEW_LINE>// a & !a is false<NEW_LINE>if (this == set) {<NEW_LINE>// all falses result in an empty BitSet<NEW_LINE>clear();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// trim the second set to avoid extra work<NEW_LINE>trimToSize(array);<NEW_LINE><MASK><NEW_LINE>// truth table<NEW_LINE>//<NEW_LINE>// case | a | b | !b | a & !b | change?<NEW_LINE>// 1 | false | false | true | false | a is already false<NEW_LINE>// 2 | false | true | false | false | a is already false<NEW_LINE>// 3 | true | false | true | true | a is already true<NEW_LINE>// 4 | true | true | false | false | set a to false<NEW_LINE>//<NEW_LINE>// we only need to change something in case 4<NEW_LINE>// whenever b is true, a should be false, so iterate over set b<NEW_LINE>int index = 0;<NEW_LINE>while ((index = nextSetWord(set.array, index)) != -1) {<NEW_LINE>setWord(array, index, getWord(array, index) & ~set.array.get(index));<NEW_LINE>if (++index >= length) {<NEW_LINE>// nothing further will affect anything<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
int length = array.length();
1,295,566
private Message createCycleDependenciesMessage(ListMultimap<Thread, Key<?>> locksCycle, @Nullable Message proxyCreationError) {<NEW_LINE>// this is the main thing that we'll show in an error message,<NEW_LINE>// current thread is populate by Guice<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>Formatter fmt = new Formatter(sb);<NEW_LINE>fmt.format("Encountered circular dependency spanning several threads.");<NEW_LINE>if (proxyCreationError != null) {<NEW_LINE>fmt.format(" %s", proxyCreationError.getMessage());<NEW_LINE>}<NEW_LINE>fmt.format("%n");<NEW_LINE>for (Thread lockedThread : locksCycle.keySet()) {<NEW_LINE>List<Key<?>> lockedKeys = locksCycle.get(lockedThread);<NEW_LINE><MASK><NEW_LINE>for (Key<?> lockedKey : lockedKeys) {<NEW_LINE>fmt.format("%s%n", Errors.convert(lockedKey));<NEW_LINE>}<NEW_LINE>for (StackTraceElement traceElement : lockedThread.getStackTrace()) {<NEW_LINE>fmt.format("\tat %s%n", traceElement);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>fmt.close();<NEW_LINE>return new Message(Thread.currentThread(), sb.toString());<NEW_LINE>}
fmt.format("%s is holding locks the following singletons in the cycle:%n", lockedThread);
1,810,515
private static void basicInfo(List<String> textRecord, Person person, long endTime) {<NEW_LINE>String name = (String) person.attributes.get(Person.NAME);<NEW_LINE>textRecord.add(name);<NEW_LINE>// "underline" the characters in the name<NEW_LINE>textRecord.add(name.replaceAll("[A-Za-z0-9 ]", "="));<NEW_LINE>String race = (String) person.attributes.get(Person.RACE);<NEW_LINE>String ethnicity = (String) person.attributes.get(Person.ETHNICITY);<NEW_LINE>String displayEthnicity;<NEW_LINE>if (ethnicity.equals("hispanic")) {<NEW_LINE>displayEthnicity = "Hispanic";<NEW_LINE>} else {<NEW_LINE>displayEthnicity = "Non-Hispanic";<NEW_LINE>}<NEW_LINE>textRecord.add("Race: " + WordUtils.capitalize(race));<NEW_LINE>textRecord.add("Ethnicity: " + displayEthnicity);<NEW_LINE>textRecord.add("Gender: " + person.attributes.get(Person.GENDER));<NEW_LINE>String birthdate = dateFromTimestamp((long) person.attributes<MASK><NEW_LINE>textRecord.add("Birth Date: " + birthdate);<NEW_LINE>}
.get(Person.BIRTHDATE));
131,150
public static int stringtoUTF8Bytes(String str, byte[] buffer) {<NEW_LINE>int index = 0;<NEW_LINE>for (int i = 0; i < str.length(); i++) {<NEW_LINE>char strChar = str.charAt(i);<NEW_LINE>if ((strChar & 0xFF80) == 0) {<NEW_LINE>// (00000000 00000000 - 00000000 01111111) -> 0xxxxxxx<NEW_LINE>buffer[index++] = (byte) (strChar & 0x00FF);<NEW_LINE>} else if ((strChar & 0xF800) == 0) {<NEW_LINE>// (00000000 10000000 - 00000111 11111111) -> 110xxxxx 10xxxxxx<NEW_LINE>buffer[index++] = (byte) ((strChar >> 6) | 0x00c0);<NEW_LINE>buffer[index++] = (byte) ((strChar & 0x003F) | 0x0080);<NEW_LINE>} else {<NEW_LINE>// (00001000 00000000 - 11111111 11111111) -> 1110xxxx 10xxxxxx 10xxxxxx<NEW_LINE>buffer[index++] = (byte) ((strChar >> 12) | 0x00e0);<NEW_LINE>buffer[index++] = (byte) (((strChar >> <MASK><NEW_LINE>buffer[index++] = (byte) ((strChar & 0x003F) | 0x0080);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return index;<NEW_LINE>}
6) & 0x003F) | 0x0080);
1,053,545
public ResponseContainerAssets deleteAssets(String userId, String serverCapability, String serverCapabilityGUID, String identifier) throws AnalyticsModelingCheckedException, UserNotAuthorizedException {<NEW_LINE>String methodName = "deleteAssets";<NEW_LINE>ctx.initializeSoftwareServerCapability(userId, serverCapability, serverCapabilityGUID);<NEW_LINE>resolver = new IdentifierResolver(ctx, null);<NEW_LINE>List<String> guids = new ArrayList<>();<NEW_LINE>try {<NEW_LINE>List<EntityDetail> assets = getArtifactAssets(identifier);<NEW_LINE>SoftwareServerCapability ssc = ctx.getServerSoftwareCapability();<NEW_LINE>for (EntityDetail asset : assets) {<NEW_LINE>guids.add(asset.getGUID());<NEW_LINE>String qName = ctx.getStringProperty(Constants.QUALIFIED_NAME, asset.getProperties(), methodName);<NEW_LINE>List<EntityDetail> entities = resolver.getSchemaAttributes(qName, methodName);<NEW_LINE>for (EntityDetail entity : entities) {<NEW_LINE>ctx.getRepositoryHandler().removeEntity(userId, ssc.getGUID(), ssc.getSource(), entity.getGUID(), Constants.GUID, entity.getType().getTypeDefGUID(), entity.getType().getTypeDefName(<MASK><NEW_LINE>}<NEW_LINE>assetHandler.deleteBeanInRepository(userId, ssc.getGUID(), ssc.getSource(), asset.getGUID(), Constants.PARAM_NAME_ASSET_GUID, asset.getType().getTypeDefGUID(), asset.getType().getTypeDefName(), null, null, methodName);<NEW_LINE>}<NEW_LINE>} catch (InvalidParameterException | PropertyServerException ex) {<NEW_LINE>throw new AnalyticsModelingCheckedException(AnalyticsModelingErrorCode.FAILED_DELETE_ARTIFACT.getMessageDefinition(userId, identifier, ex.getLocalizedMessage()), this.getClass().getSimpleName(), methodName, ex);<NEW_LINE>}<NEW_LINE>ResponseContainerAssets ret = new ResponseContainerAssets();<NEW_LINE>ret.setAssetsList(guids);<NEW_LINE>return ret;<NEW_LINE>}
), null, null, methodName);
884,352
public int orangesRotting(int[][] grid) {<NEW_LINE>int m = grid.length, n = grid[0].length;<NEW_LINE>Queue<int[]> queue = new LinkedList<>();<NEW_LINE>int fresh = 0;<NEW_LINE>for (int i = 0; i < m; i += 1) {<NEW_LINE>for (int j = 0; j < n; j += 1) {<NEW_LINE>if (grid[i][j] == 2)<NEW_LINE>queue.offer(new int[] { i, j });<NEW_LINE>else if (grid[i][j] == 1)<NEW_LINE>fresh += 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>int count = 0;<NEW_LINE>int[][] dirs = { { 1, 0 }, { -1, 0 }, { 0, 1 }, { 0, -1 } };<NEW_LINE>while (!queue.isEmpty() && fresh != 0) {<NEW_LINE>count += 1;<NEW_LINE>int sz = queue.size();<NEW_LINE>for (int i = 0; i < sz; i += 1) {<NEW_LINE>int[] rotten = queue.poll();<NEW_LINE>int r = rotten[0<MASK><NEW_LINE>for (int[] dir : dirs) {<NEW_LINE>int x = r + dir[0], y = c + dir[1];<NEW_LINE>if (0 <= x && x < m && 0 <= y && y < n && grid[x][y] == 1) {<NEW_LINE>grid[x][y] = 2;<NEW_LINE>queue.offer(new int[] { x, y });<NEW_LINE>fresh -= 1;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return fresh == 0 ? count : -1;<NEW_LINE>}
], c = rotten[1];
1,551,550
private long processPending() {<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("processPending> {}", pending.values());<NEW_LINE>long now = TimeUnit.NANOSECONDS.toMillis(System.nanoTime());<NEW_LINE>long wait = Long.MAX_VALUE;<NEW_LINE>// pending map is maintained in LRU order<NEW_LINE>for (PathWatchEvent event : new ArrayList<>(pending.values())) {<NEW_LINE>Path path = event.getPath();<NEW_LINE>// for directories, wait until parent is quiet<NEW_LINE>if (pending.containsKey(path.getParent()))<NEW_LINE>continue;<NEW_LINE>// if the path is quiet move to events<NEW_LINE>if (event.isQuiet(now, getUpdateQuietTimeMillis())) {<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("isQuiet {}", event);<NEW_LINE>pending.remove(path);<NEW_LINE>events.add(event);<NEW_LINE>} else {<NEW_LINE>long msToCheck = event.<MASK><NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("pending {} {}", event, msToCheck);<NEW_LINE>if (msToCheck < wait)<NEW_LINE>wait = msToCheck;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (LOG.isDebugEnabled())<NEW_LINE>LOG.debug("processPending< {}", pending.values());<NEW_LINE>return wait == Long.MAX_VALUE ? -1 : wait;<NEW_LINE>}
toQuietCheck(now, getUpdateQuietTimeMillis());
1,694,463
public synchronized void createTable(ConnectorSession session, Table table, PrincipalPrivileges principalPrivileges, Optional<Path> currentPath, boolean ignoreExisting, PartitionStatistics statistics) {<NEW_LINE>setShared();<NEW_LINE>// When creating a table, it should never have partition actions. This is just a sanity check.<NEW_LINE>checkNoPartitionAction(table.getDatabaseName(), table.getTableName());<NEW_LINE>Action<TableAndMore> oldTableAction = tableActions.get(table.getSchemaTableName());<NEW_LINE>TableAndMore tableAndMore = new TableAndMore(table, Optional.of(principalPrivileges), currentPath, Optional.empty(), ignoreExisting, statistics, statistics);<NEW_LINE>if (oldTableAction == null) {<NEW_LINE>HdfsContext context = new HdfsContext(session, table.getDatabaseName(), table.getTableName(), table.getStorage().getLocation(), true);<NEW_LINE>tableActions.put(table.getSchemaTableName(), new Action<>(ActionType.ADD, tableAndMore, context));<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>switch(oldTableAction.getType()) {<NEW_LINE>case DROP:<NEW_LINE>throw new PrestoException(TRANSACTION_CONFLICT, "Dropping and then recreating the same table in a transaction is not supported");<NEW_LINE>case ADD:<NEW_LINE>case ALTER:<NEW_LINE>case INSERT_EXISTING:<NEW_LINE>throw new <MASK><NEW_LINE>default:<NEW_LINE>throw new IllegalStateException("Unknown action type");<NEW_LINE>}<NEW_LINE>}
TableAlreadyExistsException(table.getSchemaTableName());
752,803
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {<NEW_LINE>View root = UiUtilities.getInflater(inflater.getContext(), nightMode).inflate(R.layout.fragment_terrain, container, false);<NEW_LINE>showHideTopShadow(root);<NEW_LINE>TextView emptyStateDescriptionTv = root.findViewById(R.id.empty_state_description);<NEW_LINE>TextView slopeReadMoreTv = root.findViewById(R.id.slope_read_more_tv);<NEW_LINE>TextView titleTv = root.findViewById(R.id.title_tv);<NEW_LINE>downloadDescriptionTv = root.findViewById(R.id.download_description_tv);<NEW_LINE>transparencyValueTv = root.<MASK><NEW_LINE>legendBottomDivider = root.findViewById(R.id.legend_bottom_divider);<NEW_LINE>transparencySlider = root.findViewById(R.id.transparency_slider);<NEW_LINE>titleBottomDivider = root.findViewById(R.id.titleBottomDivider);<NEW_LINE>legendTopDivider = root.findViewById(R.id.legend_top_divider);<NEW_LINE>contentContainer = root.findViewById(R.id.content_container);<NEW_LINE>legendContainer = root.findViewById(R.id.legend_container);<NEW_LINE>switchCompat = root.findViewById(R.id.switch_compat);<NEW_LINE>descriptionTv = root.findViewById(R.id.description);<NEW_LINE>emptyState = root.findViewById(R.id.empty_state);<NEW_LINE>stateTv = root.findViewById(R.id.state_tv);<NEW_LINE>iconIv = root.findViewById(R.id.icon_iv);<NEW_LINE>zoomSlider = root.findViewById(R.id.zoom_slider);<NEW_LINE>minZoomTv = root.findViewById(R.id.zoom_value_min);<NEW_LINE>maxZoomTv = root.findViewById(R.id.zoom_value_max);<NEW_LINE>customRadioButton = root.findViewById(R.id.custom_radio_buttons);<NEW_LINE>TextView hillshadeBtn = root.findViewById(R.id.left_button);<NEW_LINE>TextView slopeBtn = root.findViewById(R.id.right_button);<NEW_LINE>downloadContainer = root.findViewById(R.id.download_container);<NEW_LINE>downloadTopDivider = root.findViewById(R.id.download_container_top_divider);<NEW_LINE>downloadBottomDivider = root.findViewById(R.id.download_container_bottom_divider);<NEW_LINE>observableListView = root.findViewById(R.id.list_view);<NEW_LINE>titleTv.setText(R.string.shared_string_terrain);<NEW_LINE>String wikiString = getString(R.string.shared_string_wikipedia);<NEW_LINE>String readMoreText = String.format(getString(R.string.slope_read_more), wikiString);<NEW_LINE>String emptyStateText = getString(R.string.terrain_empty_state_text) + "\n" + PLUGIN_URL;<NEW_LINE>setupClickableText(slopeReadMoreTv, readMoreText, wikiString, SLOPES_WIKI_URL, false);<NEW_LINE>setupClickableText(emptyStateDescriptionTv, emptyStateText, PLUGIN_URL, PLUGIN_URL, true);<NEW_LINE>switchCompat.setChecked(terrainEnabled);<NEW_LINE>hillshadeBtn.setOnClickListener(this);<NEW_LINE>hillshadeBtn.setText(R.string.shared_string_hillshade);<NEW_LINE>switchCompat.setOnClickListener(this);<NEW_LINE>slopeBtn.setOnClickListener(this);<NEW_LINE>slopeBtn.setText(R.string.shared_string_slope);<NEW_LINE>UiUtilities.setupSlider(transparencySlider, nightMode, colorProfile);<NEW_LINE>UiUtilities.setupSlider(zoomSlider, nightMode, colorProfile, true);<NEW_LINE>transparencySlider.addOnChangeListener(transparencySliderChangeListener);<NEW_LINE>zoomSlider.addOnChangeListener(zoomSliderChangeListener);<NEW_LINE>transparencySlider.setValueTo(100);<NEW_LINE>transparencySlider.setValueFrom(0);<NEW_LINE>zoomSlider.setValueTo(TERRAIN_MAX_ZOOM);<NEW_LINE>zoomSlider.setValueFrom(TERRAIN_MIN_ZOOM);<NEW_LINE>UiUtilities.setupCompoundButton(switchCompat, nightMode, UiUtilities.CompoundButtonType.PROFILE_DEPENDENT);<NEW_LINE>updateUiMode();<NEW_LINE>return root;<NEW_LINE>}
findViewById(R.id.transparency_value_tv);
139,179
private DemangledObject parseFunctionOrVariable(String demangled) {<NEW_LINE>FunctionSignatureParts signatureParts = new FunctionSignatureParts(demangled);<NEW_LINE>if (!signatureParts.isValidFunction()) {<NEW_LINE>return parseVariable(demangled);<NEW_LINE>}<NEW_LINE>DemangledFunction function = new DemangledFunction(mangledSource, demangled, null);<NEW_LINE>String simpleName = signatureParts.getName();<NEW_LINE>if (simpleName.endsWith(LAMBDA_START)) {<NEW_LINE>//<NEW_LINE>// For lambdas, the signature parser will set the name to '{lambda', with the parameters<NEW_LINE>// following that text in the original string. We want the name to be the full lambda<NEW_LINE>// text, without spaces.<NEW_LINE>//<NEW_LINE>String prefix = signatureParts.getRawParameterPrefix();<NEW_LINE>// strip off '{lambda'<NEW_LINE>int lambdaStart = prefix.length() - LAMBDA_START.length();<NEW_LINE>String lambdaText = demangled.substring(lambdaStart);<NEW_LINE>LambdaName lambdaName = getLambdaName(lambdaText);<NEW_LINE>String uniqueName = lambdaName.getFullText();<NEW_LINE>String escapedLambda = removeBadSpaces(uniqueName);<NEW_LINE>simpleName = simpleName.replace(LAMBDA_START, escapedLambda);<NEW_LINE>function = new DemangledLambda(mangledSource, demangled, null);<NEW_LINE>function.<MASK><NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Function Parts: name, params, return type, modifiers<NEW_LINE>//<NEW_LINE>setNameAndNamespace(function, simpleName);<NEW_LINE>for (DemangledDataType parameter : signatureParts.getParameters()) {<NEW_LINE>function.addParameter(parameter);<NEW_LINE>}<NEW_LINE>String returnType = signatureParts.getReturnType();<NEW_LINE>setReturnType(demangled, function, returnType);<NEW_LINE>if (demangled.endsWith(CONST)) {<NEW_LINE>function.setConst(true);<NEW_LINE>}<NEW_LINE>return function;<NEW_LINE>}
setBackupPlateComment(lambdaName.getFullText());
601,619
/*<NEW_LINE>* This block of code ensures that the correct contact header is specified when running in a<NEW_LINE>* multi-home environment. We always need to be sure to specify the interface for the contact that<NEW_LINE>* the initial request was received on.<NEW_LINE>*/<NEW_LINE>private boolean createAndSetMultihomeContactHeader() throws IllegalArgumentException, SipParseException {<NEW_LINE>boolean created = false;<NEW_LINE>// First check to see if there are multiple interfaces for the given transport. If not, we can allow<NEW_LINE>// the base implementation of createAndSetContactHeader to handle this request.<NEW_LINE>SipServletRequest request = getRequest();<NEW_LINE>String transport = request.getTransport();<NEW_LINE>// This if block will be skipped if the server is stand alone.<NEW_LINE>if (SipProxyInfo.getInstance().getNumberOfInterfaces(transport) > 1) {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "addContactHeader", "Multi-home response detected. Pulling contact header from received on interface");<NEW_LINE>}<NEW_LINE>// Here we grab the interface that the initial request was received on. This is the interface we will need to<NEW_LINE>// use for the outgoing contact.<NEW_LINE>SipURI receivedOnInterfaceURI = SipProxyInfo.getInstance().extractReceivedOnInterface(request);<NEW_LINE>if (receivedOnInterfaceURI != null) {<NEW_LINE>String host = receivedOnInterfaceURI.getHost();<NEW_LINE>int port = receivedOnInterfaceURI.getPort();<NEW_LINE>SipURL sipUrl = getAddressFactory().createSipURL(host);<NEW_LINE>sipUrl.setPort(port);<NEW_LINE>sipUrl.setTransport(transport);<NEW_LINE>setContactScheme(sipUrl);<NEW_LINE>// we get the address for the contact header<NEW_LINE>NameAddress address = getAddressFactory().createNameAddress(sipUrl);<NEW_LINE>// we create the contact header from the address<NEW_LINE>ContactHeader contactHeader = getHeadersFactory().createContactHeader(address);<NEW_LINE>// we set the header in the given message<NEW_LINE>Message res = getMessage();<NEW_LINE><MASK><NEW_LINE>created = true;<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "addContactHeader", "Response contact: " + contactHeader.toString());<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>if (c_logger.isTraceDebugEnabled()) {<NEW_LINE>c_logger.traceDebug(this, "addContactHeader", "Failed to find receivedOnInterfaceURI");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return created;<NEW_LINE>}
res.setHeader(contactHeader, true);
1,306,262
private static Pair<PsiElement, CharTable> doFindWhiteSpaceNode(@Nonnull PsiFile file, int offset) {<NEW_LINE>ASTNode astNode = SourceTreeToPsiMap.psiElementToTree(file);<NEW_LINE>if (!(astNode instanceof FileElement)) {<NEW_LINE>return new Pair<>(null, null);<NEW_LINE>}<NEW_LINE>PsiElement elementAt = InjectedLanguageManager.getInstance(file.getProject()).findInjectedElementAt(file, offset);<NEW_LINE>final CharTable charTable = ((<MASK><NEW_LINE>if (elementAt == null) {<NEW_LINE>elementAt = findElementInTreeWithFormatterEnabled(file, offset);<NEW_LINE>}<NEW_LINE>if (elementAt == null) {<NEW_LINE>return new Pair<>(null, charTable);<NEW_LINE>}<NEW_LINE>ASTNode node = elementAt.getNode();<NEW_LINE>if (node == null || node.getElementType() != TokenType.WHITE_SPACE) {<NEW_LINE>return new Pair<>(null, charTable);<NEW_LINE>}<NEW_LINE>return Pair.create(elementAt, charTable);<NEW_LINE>}
FileElement) astNode).getCharTable();
955,919
final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(untagResourceRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UntagResourceRequest> request = null;<NEW_LINE>Response<UntagResourceResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));<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, "RoboMaker");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UntagResourceResult>> 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 UntagResourceResultJsonUnmarshaller());
1,809,329
final ListQueryExecutionsResult executeListQueryExecutions(ListQueryExecutionsRequest listQueryExecutionsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(listQueryExecutionsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<ListQueryExecutionsRequest> request = null;<NEW_LINE>Response<ListQueryExecutionsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ListQueryExecutionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listQueryExecutionsRequest));<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, "Athena");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListQueryExecutions");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<ListQueryExecutionsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListQueryExecutionsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,576,042
public // f200337<NEW_LINE>// f200337<NEW_LINE>void // f200337<NEW_LINE>put(// f200337<NEW_LINE>QueueData queueData, short msgBatch) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(this, tc, "put", new Object[] { queueData, "" + msgBatch });<NEW_LINE>synchronized (this) {<NEW_LINE>if (!ordered && batchesReady == 1) {<NEW_LINE>// A non-ordered async consumer proxy queue only caches one batch at a time. Therefore<NEW_LINE>// if we are trying to put messages on when there is a batch already ready, we<NEW_LINE>// messed up.<NEW_LINE>SIErrorException e = new SIErrorException(nls.getFormattedMessage<MASK><NEW_LINE>FFDCFilter.processException(e, CLASS_NAME + ".put", CommsConstants.ASYNCHPQ_PUT_01, this);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>queue.addLast(queueData);<NEW_LINE>// If the data added to the queue was not a chunked message, then we have received an<NEW_LINE>// entire message - so update counters etc<NEW_LINE>if (!queueData.isChunkedMessage()) {<NEW_LINE>notifyMessageReceived(queueData.isLastInBatch());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(this, tc, "Put has completed: " + this);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(this, tc, "put");<NEW_LINE>}
("ASYNC_BATCH_ALREADY_READY_SICO1031", null, null));
330,824
private CssParsingResult parseResources(List<URL> resources, ResourceContext context, TreeLogger logger) throws UnableToCompleteException {<NEW_LINE>List<SourceCode> sourceCodes = new ArrayList<>(resources.size());<NEW_LINE>ImmutableMap.Builder<String, String> constantNameMappingBuilder = ImmutableMap.builder();<NEW_LINE>// assert that we only support either gss or css on one resource.<NEW_LINE>boolean css = ensureEitherCssOrGss(resources, logger);<NEW_LINE>if (css && gssOptions.isAutoConversionOff()) {<NEW_LINE>logger.log(Type.ERROR, "Your ClientBundle is referencing css files instead of gss. " + "You will need to either convert these files to gss using the " + "converter tool or turn on auto convertion in your gwt.xml file. " + "Note: Autoconversion will be removed in the next version of GWT, " + "you will need to move to gss." + "Add this line to your gwt.xml file to temporary avoid this:" + "<set-configuration-property name=\"CssResource.conversionMode\"" + " value=\"strict\" /> " + "Details on how to migrate to GSS can be found at: http://goo.gl/tEQnmJ");<NEW_LINE>throw new UnableToCompleteException();<NEW_LINE>}<NEW_LINE>if (css) {<NEW_LINE>String concatenatedCss = concatCssFiles(resources, logger);<NEW_LINE>ConversionResult result = convertToGss(concatenatedCss, context, logger);<NEW_LINE>if (shouldEmitVariables) {<NEW_LINE>write(result.defNameMapping.keySet());<NEW_LINE>}<NEW_LINE>String gss = result.gss;<NEW_LINE>String name = "[auto-converted gss files from : " + resources + "]";<NEW_LINE>sourceCodes.add(new SourceCode(name, gss));<NEW_LINE>constantNameMappingBuilder.putAll(result.defNameMapping);<NEW_LINE>} else {<NEW_LINE>for (URL stylesheet : resources) {<NEW_LINE>sourceCodes.add(readUrlContent(stylesheet, logger));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>CssTree tree;<NEW_LINE>try {<NEW_LINE>tree = new GssParser(sourceCodes).parse();<NEW_LINE>} catch (GssParserException e) {<NEW_LINE>logger.log(TreeLogger.ERROR, "Unable to parse CSS", e);<NEW_LINE>throw new UnableToCompleteException();<NEW_LINE>}<NEW_LINE>// create more explicit nodes<NEW_LINE>finalizeTree(tree);<NEW_LINE>checkErrors();<NEW_LINE>// collect boolean conditions that have to be mapped to configuration properties<NEW_LINE>BooleanConditionCollector booleanConditionCollector = new BooleanConditionCollector(tree.getMutatingVisitController());<NEW_LINE>booleanConditionCollector.runPass();<NEW_LINE>// collect permutations axis used in conditionals.<NEW_LINE>PermutationsCollector permutationsCollector = new PermutationsCollector(tree.getMutatingVisitController());<NEW_LINE>permutationsCollector.runPass();<NEW_LINE>return new CssParsingResult(tree, permutationsCollector.getPermutationAxes(), booleanConditionCollector.getBooleanConditions(<MASK><NEW_LINE>}
), constantNameMappingBuilder.build());
451,553
final UpdateLinkAttributesResult executeUpdateLinkAttributes(UpdateLinkAttributesRequest updateLinkAttributesRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateLinkAttributesRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateLinkAttributesRequest> request = null;<NEW_LINE>Response<UpdateLinkAttributesResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateLinkAttributesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateLinkAttributesRequest));<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, "CloudDirectory");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateLinkAttributes");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateLinkAttributesResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateLinkAttributesResultJsonUnmarshaller());<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);
1,737,384
private void showUploadConfirmationDialog(@NonNull FragmentActivity activity, @NonNull String actionButton, @Nullable SelectionModeListener listener) {<NEW_LINE>long[] size = new long[1];<NEW_LINE>List<SelectableItem<GpxInfo>> items = new ArrayList<>();<NEW_LINE>for (GpxInfo gpxInfo : selectedItems) {<NEW_LINE>SelectableItem<GpxInfo> item = new SelectableItem<>();<NEW_LINE>item.setObject(gpxInfo);<NEW_LINE>item.setTitle(gpxInfo.getName());<NEW_LINE>item.setIconId(R.drawable.ic_notification_track);<NEW_LINE>items.add(item);<NEW_LINE>size[0] += gpxInfo.getSize();<NEW_LINE>}<NEW_LINE>List<SelectableItem<GpxInfo>> selectedItems = new ArrayList<>(items);<NEW_LINE>FragmentManager manager = activity.getSupportFragmentManager();<NEW_LINE>UploadMultipleGPXBottomSheet dialog = UploadMultipleGPXBottomSheet.showInstance(manager, items, selectedItems);<NEW_LINE>if (dialog != null) {<NEW_LINE>dialog.setDialogStateListener(new DialogStateListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onDialogCreated() {<NEW_LINE>dialog.setTitle(actionButton);<NEW_LINE>dialog.setApplyButtonTitle(getString(R.string.shared_string_continue));<NEW_LINE>String total = getString(R.string.shared_string_total);<NEW_LINE>dialog.setTitleDescription(getString(R.string.ltr_or_rtl_combine_via_colon, total, AndroidUtils.formatSize(app, size[0])));<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onCloseDialog() {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>dialog.setOnApplySelectionListener(selItems -> {<NEW_LINE>List<GpxInfo> <MASK><NEW_LINE>for (SelectableItem<GpxInfo> item : selItems) {<NEW_LINE>gpxInfos.add(item.getObject());<NEW_LINE>}<NEW_LINE>if (listener != null) {<NEW_LINE>listener.onItemsSelected(gpxInfos);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>}
gpxInfos = new ArrayList<>();
742,752
final UpdatePackageResult executeUpdatePackage(UpdatePackageRequest updatePackageRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updatePackageRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdatePackageRequest> request = null;<NEW_LINE>Response<UpdatePackageResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdatePackageRequestProtocolMarshaller(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, "OpenSearch");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdatePackage");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdatePackageResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdatePackageResultJsonUnmarshaller());<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(updatePackageRequest));
1,502,018
public ChangeProgressStage unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ChangeProgressStage changeProgressStage = new ChangeProgressStage();<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("Name", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>changeProgressStage.setName(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Status", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>changeProgressStage.setStatus(context.getUnmarshaller(String.<MASK><NEW_LINE>}<NEW_LINE>if (context.testExpression("Description", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>changeProgressStage.setDescription(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("LastUpdated", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>changeProgressStage.setLastUpdated(DateJsonUnmarshallerFactory.getInstance("unixTimestamp").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 changeProgressStage;<NEW_LINE>}
class).unmarshall(context));
1,178,198
protected static void handleDrop(TranscodeTarget target, TranscodeProfile profile, Object payload, int transcode_requirement) {<NEW_LINE>if (payload instanceof String[]) {<NEW_LINE>String[] files = (String[]) payload;<NEW_LINE>for (String file : files) {<NEW_LINE>File f = new File(file);<NEW_LINE>if (f.isFile()) {<NEW_LINE>addFile(target, profile, transcode_requirement, f);<NEW_LINE>} else {<NEW_LINE>addDirectory(target, profile, transcode_requirement, f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (payload instanceof String) {<NEW_LINE>String stuff = (String) payload;<NEW_LINE>if (stuff.startsWith("DownloadManager\n") || stuff.startsWith("DiskManagerFileInfo\n")) {<NEW_LINE>String[] bits = RegExUtil.PAT_SPLIT_SLASH_N.split(stuff);<NEW_LINE>for (int i = 1; i < bits.length; i++) {<NEW_LINE>String hash_str = bits[i];<NEW_LINE>int pos = hash_str.indexOf(';');<NEW_LINE>try {<NEW_LINE>if (pos == -1) {<NEW_LINE>byte[] hash = Base32.decode(bits[i]);<NEW_LINE>addDownload(<MASK><NEW_LINE>} else {<NEW_LINE>String[] files = hash_str.split(";");<NEW_LINE>byte[] hash = Base32.decode(files[0].trim());<NEW_LINE>DiskManagerFileInfo[] dm_files = CoreFactory.getSingleton().getPluginManager().getDefaultPluginInterface().getShortCuts().getDownload(hash).getDiskManagerFileInfo();<NEW_LINE>for (int j = 1; j < files.length; j++) {<NEW_LINE>DiskManagerFileInfo dm_file = dm_files[Integer.parseInt(files[j].trim())];<NEW_LINE>addFile(target, profile, transcode_requirement, dm_file);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable e) {<NEW_LINE>Debug.out("Failed to get download for hash " + bits[1]);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (stuff.startsWith("TranscodeFile\n")) {<NEW_LINE>String[] bits = RegExUtil.PAT_SPLIT_SLASH_N.split(stuff);<NEW_LINE>for (int i = 1; i < bits.length; i++) {<NEW_LINE>File f = new File(bits[i]);<NEW_LINE>if (f.isFile()) {<NEW_LINE>addFile(target, profile, transcode_requirement, f);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (stuff.startsWith("http:") || stuff.startsWith("https://")) {<NEW_LINE>addURL(target, profile, transcode_requirement, stuff);<NEW_LINE>}<NEW_LINE>} else if (payload instanceof FixedURLTransfer.URLType) {<NEW_LINE>String url = ((FixedURLTransfer.URLType) payload).linkURL;<NEW_LINE>if (url != null) {<NEW_LINE>addURL(target, profile, transcode_requirement, url);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
target, profile, transcode_requirement, hash);
62,044
public void stop() {<NEW_LINE>if (!(this.workerState.changeStateDestroying())) {<NEW_LINE>CommonState state = this.workerState.getCurrentState();<NEW_LINE>logger.info("{} already {}.", this.getClass().getSimpleName(), state);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>logger.info("{} destroying started.", this.getClass().getSimpleName());<NEW_LINE>if (clusterConnectionManager != null) {<NEW_LINE>clusterConnectionManager.stop();<NEW_LINE>}<NEW_LINE>final boolean <MASK><NEW_LINE>if (!stopOffer) {<NEW_LINE>logger.warn("Insert stopTask failed.");<NEW_LINE>}<NEW_LINE>while (this.workerThread.isAlive()) {<NEW_LINE>this.workerThread.interrupt();<NEW_LINE>try {<NEW_LINE>this.workerThread.join(3000L);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>this.workerState.changeStateStopped();<NEW_LINE>logger.info("{} destroying completed.", this.getClass().getSimpleName());<NEW_LINE>}
stopOffer = queue.offer(stopTask);
1,148,920
public static XYRectangle fromPointDistance(final float x, final float y, final float radius) {<NEW_LINE>checkVal(x);<NEW_LINE>checkVal(y);<NEW_LINE>if (radius < 0) {<NEW_LINE>throw new IllegalArgumentException("radius must be bigger than 0, got " + radius);<NEW_LINE>}<NEW_LINE>if (Float.isFinite(radius) == false) {<NEW_LINE>throw new IllegalArgumentException("radius must be finite, got " + radius);<NEW_LINE>}<NEW_LINE>// LUCENE-9243: We round up the bounding box to avoid<NEW_LINE>// numerical errors.<NEW_LINE>float distanceBox = Math.nextUp(radius);<NEW_LINE>float minX = Math.max(-Float.MAX_VALUE, x - distanceBox);<NEW_LINE>float maxX = Math.min(Float.MAX_VALUE, x + distanceBox);<NEW_LINE>float minY = Math.max(-Float.MAX_VALUE, y - distanceBox);<NEW_LINE>float maxY = Math.min(Float.MAX_VALUE, y + distanceBox);<NEW_LINE>return new XYRectangle(<MASK><NEW_LINE>}
minX, maxX, minY, maxY);
1,708,088
public void fetch() {<NEW_LINE>Bukkit.getScheduler().runTaskAsynchronously(plugin, () -> {<NEW_LINE>try {<NEW_LINE>HttpsURLConnection con = (HttpsURLConnection) new URL("https://api.spigotmc.org/legacy/update.php?resource=" + RESOURCE_ID).openConnection();<NEW_LINE>con.setRequestMethod("GET");<NEW_LINE>spigotVersion = new BufferedReader(new InputStreamReader(con.getInputStream())).readLine();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>plugin.<MASK><NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (spigotVersion == null || spigotVersion.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>updateAvailable = spigotIsNewer();<NEW_LINE>if (!updateAvailable) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Bukkit.getScheduler().runTask(plugin, () -> {<NEW_LINE>plugin.getLogger().info("An update for PlaceholderAPI (v" + getSpigotVersion() + ") is available at:");<NEW_LINE>plugin.getLogger().info("https://www.spigotmc.org/resources/placeholderapi." + RESOURCE_ID + "/");<NEW_LINE>Bukkit.getPluginManager().registerEvents(this, plugin);<NEW_LINE>});<NEW_LINE>});<NEW_LINE>}
getLogger().info("Failed to check for updates on spigot.");