idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,592,743
final RejectGrantResult executeRejectGrant(RejectGrantRequest rejectGrantRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(rejectGrantRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<RejectGrantRequest> request = null;<NEW_LINE>Response<RejectGrantResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new RejectGrantRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(rejectGrantRequest));<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, "License Manager");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "RejectGrant");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<RejectGrantResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new RejectGrantResultJsonUnmarshaller());<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,463,245
public String rollback(EnvironBean envBean, String toDeployId, String description, String operator) throws Exception {<NEW_LINE>DeployBean toDeployBean;<NEW_LINE>if (toDeployId == null) {<NEW_LINE>toDeployBean = getLastSucceededDeploy(envBean);<NEW_LINE>if (toDeployBean == null) {<NEW_LINE>throw new DeployInternalException(String.format("Could not find last succeeded deploy for env %s/%s", envBean.getEnv_name(), envBean.getStage_name()));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>toDeployBean = getDeploySafely(toDeployId);<NEW_LINE>}<NEW_LINE>DeployBean deployBean = new DeployBean();<NEW_LINE>deployBean.setEnv_id(envBean.getEnv_id());<NEW_LINE>deployBean.setBuild_id(toDeployBean.getBuild_id());<NEW_LINE>deployBean.setDescription(description);<NEW_LINE>deployBean.setDeploy_type(DeployType.ROLLBACK);<NEW_LINE>deployBean.setOperator(operator);<NEW_LINE>deployBean.setAlias(toDeployId);<NEW_LINE><MASK><NEW_LINE>return internalDeploy(envBean, deployBean);<NEW_LINE>}
disableAutoPromote(envBean, operator, false);
377,810
public final void annotationArguments() throws RecognitionException, TokenStreamException {<NEW_LINE>returnAST = null;<NEW_LINE>ASTPair currentAST = new ASTPair();<NEW_LINE>AST annotationArguments_AST = null;<NEW_LINE>AST v_AST = null;<NEW_LINE>if ((_tokenSet_47.member(LA(1))) && (_tokenSet_48.member(LA(2)))) {<NEW_LINE>annotationMemberValueInitializer();<NEW_LINE>v_AST = (AST) returnAST;<NEW_LINE><MASK><NEW_LINE>if (inputState.guessing == 0) {<NEW_LINE>annotationArguments_AST = (AST) currentAST.root;<NEW_LINE>Token itkn = new Token(IDENT, "value");<NEW_LINE>AST i;<NEW_LINE>i = (AST) astFactory.make((new ASTArray(1)).add(create(IDENT, "value", itkn, itkn)));<NEW_LINE>annotationArguments_AST = (AST) astFactory.make((new ASTArray(3)).add(create(ANNOTATION_MEMBER_VALUE_PAIR, "ANNOTATION_MEMBER_VALUE_PAIR", LT(1), LT(1))).add(i).add(v_AST));<NEW_LINE>currentAST.root = annotationArguments_AST;<NEW_LINE>currentAST.child = annotationArguments_AST != null && annotationArguments_AST.getFirstChild() != null ? annotationArguments_AST.getFirstChild() : annotationArguments_AST;<NEW_LINE>currentAST.advanceChildToEnd();<NEW_LINE>}<NEW_LINE>annotationArguments_AST = (AST) currentAST.root;<NEW_LINE>} else if ((_tokenSet_49.member(LA(1))) && (_tokenSet_50.member(LA(2)))) {<NEW_LINE>annotationMemberValuePairs();<NEW_LINE>astFactory.addASTChild(currentAST, returnAST);<NEW_LINE>annotationArguments_AST = (AST) currentAST.root;<NEW_LINE>} else {<NEW_LINE>throw new NoViableAltException(LT(1), getFilename());<NEW_LINE>}<NEW_LINE>returnAST = annotationArguments_AST;<NEW_LINE>}
astFactory.addASTChild(currentAST, returnAST);
914,596
private Type createInterfaceType(DeclaredType declaredType, TypeElement typeElement, boolean deep) {<NEW_LINE>// entity type<NEW_LINE>for (Class<? extends Annotation> entityAnn : entityAnnotations) {<NEW_LINE>if (typeElement.getAnnotation(entityAnn) != null) {<NEW_LINE>return createType(typeElement, TypeCategory.ENTITY, declaredType.getTypeArguments(), deep);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Iterator<? extends TypeMirror> i = declaredType.getTypeArguments().iterator();<NEW_LINE>if (isAssignable(declaredType, mapType)) {<NEW_LINE>return createMapType(i, deep);<NEW_LINE>} else if (isAssignable(declaredType, listType)) {<NEW_LINE>return createCollectionType(<MASK><NEW_LINE>} else if (isAssignable(declaredType, setType)) {<NEW_LINE>return createCollectionType(Types.SET, i, deep);<NEW_LINE>} else if (isAssignable(declaredType, collectionType)) {<NEW_LINE>return createCollectionType(Types.COLLECTION, i, deep);<NEW_LINE>} else {<NEW_LINE>String name = typeElement.getQualifiedName().toString();<NEW_LINE>return createType(typeElement, TypeCategory.get(name), declaredType.getTypeArguments(), deep);<NEW_LINE>}<NEW_LINE>}
Types.LIST, i, deep);
602,923
public TemplateError unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>TemplateError templateError = new TemplateError();<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("Type", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>templateError.setType(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Message", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>templateError.setMessage(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 templateError;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,747,483
public static ListResourcesResponse unmarshall(ListResourcesResponse listResourcesResponse, UnmarshallerContext _ctx) {<NEW_LINE>listResourcesResponse.setRequestId(_ctx.stringValue("ListResourcesResponse.RequestId"));<NEW_LINE>Data data = new Data();<NEW_LINE>List<ResourceItem> items = new ArrayList<ResourceItem>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListResourcesResponse.Data.Items.Length"); i++) {<NEW_LINE>ResourceItem resourceItem = new ResourceItem();<NEW_LINE>resourceItem.setAppId(_ctx.stringValue("ListResourcesResponse.Data.Items[" + i + "].AppId"));<NEW_LINE>resourceItem.setContent(_ctx.mapValue("ListResourcesResponse.Data.Items[" + i + "].Content"));<NEW_LINE>resourceItem.setCreateTime(_ctx.stringValue("ListResourcesResponse.Data.Items[" + i + "].CreateTime"));<NEW_LINE>resourceItem.setDescription(_ctx.stringValue("ListResourcesResponse.Data.Items[" + i + "].Description"));<NEW_LINE>resourceItem.setModifiedTime(_ctx.stringValue<MASK><NEW_LINE>resourceItem.setModuleId(_ctx.stringValue("ListResourcesResponse.Data.Items[" + i + "].ModuleId"));<NEW_LINE>resourceItem.setResourceName(_ctx.stringValue("ListResourcesResponse.Data.Items[" + i + "].ResourceName"));<NEW_LINE>resourceItem.setResourceId(_ctx.stringValue("ListResourcesResponse.Data.Items[" + i + "].ResourceId"));<NEW_LINE>resourceItem.setRevision(_ctx.integerValue("ListResourcesResponse.Data.Items[" + i + "].Revision"));<NEW_LINE>resourceItem.setSchemaVersion(_ctx.stringValue("ListResourcesResponse.Data.Items[" + i + "].SchemaVersion"));<NEW_LINE>resourceItem.setResourceType(_ctx.stringValue("ListResourcesResponse.Data.Items[" + i + "].ResourceType"));<NEW_LINE>items.add(resourceItem);<NEW_LINE>}<NEW_LINE>data.setItems(items);<NEW_LINE>listResourcesResponse.setData(data);<NEW_LINE>return listResourcesResponse;<NEW_LINE>}
("ListResourcesResponse.Data.Items[" + i + "].ModifiedTime"));
810,391
private void assembleImage() {<NEW_LINE>final BufferedImage rawImage = getRawImage();<NEW_LINE>// New image template<NEW_LINE>ninePatchImage = ImageUtils.createCompatibleImage(rawImage.getWidth() + 2, rawImage.getHeight() + 2, Transparency.TRANSLUCENT);<NEW_LINE>final Graphics2D g2d = ninePatchImage.createGraphics();<NEW_LINE>g2d.drawImage(rawImage, 1, 1, null);<NEW_LINE>g2d.dispose();<NEW_LINE>// Color to fill with marks<NEW_LINE>final int rgb = Color.BLACK.getRGB();<NEW_LINE>// todo Replace pixel filling with line painting to speedup assembling process in times<NEW_LINE>// Stretch<NEW_LINE>final <MASK><NEW_LINE>for (int i = 0; i < rawImage.getWidth(); i++) {<NEW_LINE>if (hf[i]) {<NEW_LINE>ninePatchImage.setRGB(i + 1, 0, rgb);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final boolean[] vf = getVerticalFilledPixels();<NEW_LINE>for (int i = 0; i < rawImage.getHeight(); i++) {<NEW_LINE>if (vf[i]) {<NEW_LINE>ninePatchImage.setRGB(0, i + 1, rgb);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// Content<NEW_LINE>final Insets margin = ninePatchIcon.getMargin();<NEW_LINE>for (int i = margin.left; i < rawImage.getWidth() - margin.right; i++) {<NEW_LINE>ninePatchImage.setRGB(i + 1, ninePatchImage.getHeight() - 1, rgb);<NEW_LINE>}<NEW_LINE>for (int i = margin.top; i < rawImage.getHeight() - margin.bottom; i++) {<NEW_LINE>ninePatchImage.setRGB(ninePatchImage.getWidth() - 1, i + 1, rgb);<NEW_LINE>}<NEW_LINE>}
boolean[] hf = getHorizontalFilledPixels();
1,627,059
private boolean validateObjLit(Node objlit, Node parent) {<NEW_LINE>if (objlit == null || !objlit.isObjectLit()) {<NEW_LINE>reportErrorOnContext(parent);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>for (Node key = objlit.getFirstChild(); key != null; key = key.getNext()) {<NEW_LINE>if (key.isMemberFunctionDef()) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (key.isComputedProp()) {<NEW_LINE>// report using computed property name<NEW_LINE>compiler.report(JSError.make(objlit, GOOG_CLASS_ES6_COMPUTED_PROP_NAMES_NOT_SUPPORTED));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (key.isStringKey() && key.getFirstChild().isArrowFunction()) {<NEW_LINE>// report using arrow function<NEW_LINE>compiler.report(JSError<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!key.isStringKey() || key.isQuotedString()) {<NEW_LINE>reportErrorOnContext(parent);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
.make(objlit, GOOG_CLASS_ES6_ARROW_FUNCTION_NOT_SUPPORTED));
861,524
private Mono<Response<SimInner>> updateTagsWithResponseAsync(String resourceGroupName, String simName, TagsObject parameters, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.<MASK><NEW_LINE>}<NEW_LINE>if (this.client.getSubscriptionId() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getSubscriptionId() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (simName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter simName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (parameters == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));<NEW_LINE>} else {<NEW_LINE>parameters.validate();<NEW_LINE>}<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.updateTags(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, simName, parameters, accept, context);<NEW_LINE>}
error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
1,460,908
final TestTypeResult executeTestType(TestTypeRequest testTypeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(testTypeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<TestTypeRequest> request = null;<NEW_LINE>Response<TestTypeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new TestTypeRequestMarshaller().marshall(super.beforeMarshalling(testTypeRequest));<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, "CloudFormation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TestType");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<TestTypeResult> responseHandler = new StaxResponseHandler<TestTypeResult>(new TestTypeResultStaxUnmarshaller());<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());
225,946
private static JSModuleRecord createSyntheticJSONModule(JSRealm realm, Source source, Object hostDefined) {<NEW_LINE>final TruffleString exportName = Strings.DEFAULT;<NEW_LINE>JSFrameDescriptor frameDescBuilder = new JSFrameDescriptor(Undefined.instance);<NEW_LINE>JSFrameSlot slot = frameDescBuilder.addFrameSlot(exportName);<NEW_LINE>FrameDescriptor frameDescriptor = frameDescBuilder.toFrameDescriptor();<NEW_LINE>List<ExportEntry> localExportEntries = Collections.singletonList(ExportEntry.exportSpecifier(exportName));<NEW_LINE>Module moduleNode = new Module(Collections.emptyList(), Collections.emptyList(), localExportEntries, Collections.emptyList(), Collections.emptyList(), null, null);<NEW_LINE>JavaScriptRootNode rootNode = new JavaScriptRootNode(realm.getContext().getLanguage(), source.createUnavailableSection(), frameDescriptor) {<NEW_LINE><NEW_LINE>private final int defaultSlot = slot.getIndex();<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Object execute(VirtualFrame frame) {<NEW_LINE>JSModuleRecord module = (JSModuleRecord) JSArguments.getUserArgument(frame.getArguments(), 0);<NEW_LINE>if (module.getEnvironment() == null) {<NEW_LINE>assert module.getStatus() == Status.Linking;<NEW_LINE>module.setEnvironment(frame.materialize());<NEW_LINE>} else {<NEW_LINE>assert module<MASK><NEW_LINE>setSyntheticModuleExport(module);<NEW_LINE>}<NEW_LINE>return Undefined.instance;<NEW_LINE>}<NEW_LINE><NEW_LINE>private void setSyntheticModuleExport(JSModuleRecord module) {<NEW_LINE>module.getEnvironment().setObject(defaultSlot, module.getHostDefined());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>CallTarget callTarget = rootNode.getCallTarget();<NEW_LINE>JSFunctionData functionData = JSFunctionData.create(realm.getContext(), callTarget, callTarget, 0, Strings.EMPTY_STRING, false, false, true, true);<NEW_LINE>final JSModuleData parseModule = new JSModuleData(moduleNode, source, functionData, frameDescriptor);<NEW_LINE>return new JSModuleRecord(parseModule, realm.getModuleLoader(), hostDefined);<NEW_LINE>}
.getStatus() == Status.Evaluating;
1,328,895
public void save(Context ctx, SharedPreferences prefs) {<NEW_LINE>SharedPreferences.Editor edit = prefs.edit();<NEW_LINE>edit.putString("osmdroid.basePath", getOsmdroidBasePath().getAbsolutePath());<NEW_LINE>edit.putString("osmdroid.cachePath", getOsmdroidTileCache().getAbsolutePath());<NEW_LINE>edit.putBoolean("osmdroid.DebugMode", isDebugMode());<NEW_LINE>edit.putBoolean("osmdroid.DebugDownloading", isDebugMapTileDownloader());<NEW_LINE>edit.putBoolean("osmdroid.DebugMapView", isDebugMapView());<NEW_LINE>edit.putBoolean("osmdroid.DebugTileProvider", isDebugTileProviders());<NEW_LINE>edit.putBoolean("osmdroid.HardwareAcceleration", isMapViewHardwareAccelerated());<NEW_LINE>edit.<MASK><NEW_LINE>edit.putString("osmdroid.userAgentValue", getUserAgentValue());<NEW_LINE>save(prefs, edit, mAdditionalHttpRequestProperties, "osmdroid.additionalHttpRequestProperty.");<NEW_LINE>edit.putLong("osmdroid.gpsWaitTime", gpsWaitTime);<NEW_LINE>edit.putInt("osmdroid.cacheMapTileCount", cacheMapTileCount);<NEW_LINE>edit.putInt("osmdroid.tileDownloadThreads", tileDownloadThreads);<NEW_LINE>edit.putInt("osmdroid.tileFileSystemThreads", tileFileSystemThreads);<NEW_LINE>edit.putInt("osmdroid.tileDownloadMaxQueueSize", tileDownloadMaxQueueSize);<NEW_LINE>edit.putInt("osmdroid.tileFileSystemMaxQueueSize", tileFileSystemMaxQueueSize);<NEW_LINE>edit.putLong("osmdroid.ExpirationExtendedDuration", expirationAdder);<NEW_LINE>if (expirationOverride != null)<NEW_LINE>edit.putLong("osmdroid.ExpirationOverride", expirationOverride);<NEW_LINE>// TODO save other fields?<NEW_LINE>edit.putInt("osmdroid.ZoomSpeedDefault", animationSpeedDefault);<NEW_LINE>edit.putInt("osmdroid.animationSpeedShort", animationSpeedShort);<NEW_LINE>edit.putBoolean("osmdroid.mapViewRecycler", mapViewRecycler);<NEW_LINE>edit.putInt("osmdroid.cacheTileOvershoot", cacheTileOvershoot);<NEW_LINE>commit(edit);<NEW_LINE>}
putBoolean("osmdroid.TileDownloaderFollowRedirects", isMapTileDownloaderFollowRedirects());
1,340,279
private void addStaticFieldsIfPresentAndThenAllVars(@NotNull final XCompositeNode node, @Nullable final BoundVariable thisVar, @NotNull final ElementList<BoundVariable> vars) {<NEW_LINE>if (thisVar == null) {<NEW_LINE>addVars(node, vars);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final Object thisVarValue = thisVar.getValue();<NEW_LINE>if (!(thisVarValue instanceof InstanceRef)) {<NEW_LINE>addVars(node, vars);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// InstanceRef<NEW_LINE>final ClassRef classRef = ((<MASK><NEW_LINE>myDebugProcess.getVmServiceWrapper().getObject(myIsolateId, classRef.getId(), new GetObjectConsumer() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void received(Obj classObj) {<NEW_LINE>final SmartList<FieldRef> staticFields = new SmartList<>();<NEW_LINE>for (FieldRef fieldRef : ((ClassObj) classObj).getFields()) {<NEW_LINE>if (fieldRef.isStatic()) {<NEW_LINE>staticFields.add(fieldRef);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!staticFields.isEmpty()) {<NEW_LINE>final XValueChildrenList list = new XValueChildrenList();<NEW_LINE>list.addTopGroup(new DartStaticFieldsGroup(myDebugProcess, myIsolateId, ((ClassObj) classObj).getName(), staticFields));<NEW_LINE>node.addChildren(list, false);<NEW_LINE>}<NEW_LINE>addVars(node, vars);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void received(Sentinel sentinel) {<NEW_LINE>node.setErrorMessage(sentinel.getValueAsString());<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onError(RPCError error) {<NEW_LINE>node.setErrorMessage(error.getMessage());<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
InstanceRef) thisVarValue).getClassRef();
141,108
public void updateTask(TaskModel taskModel) {<NEW_LINE>try {<NEW_LINE>if (taskModel.getStatus() != null) {<NEW_LINE>if (!taskModel.getStatus().isTerminal() || (taskModel.getStatus().isTerminal() && taskModel.getUpdateTime() == 0)) {<NEW_LINE>taskModel.setUpdateTime(System.currentTimeMillis());<NEW_LINE>}<NEW_LINE>if (taskModel.getStatus().isTerminal() && taskModel.getEndTime() == 0) {<NEW_LINE>taskModel.setEndTime(System.currentTimeMillis());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>externalizeTaskData(taskModel);<NEW_LINE>executionDAO.updateTask(taskModel);<NEW_LINE>if (!properties.isAsyncIndexingEnabled()) {<NEW_LINE>indexDAO.indexTask(new TaskSummary(taskModel.toTask()));<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>String errorMsg = String.format("Error updating task: %s in workflow: %s", taskModel.getTaskId(), taskModel.getWorkflowInstanceId());<NEW_LINE><MASK><NEW_LINE>throw new ApplicationException(ApplicationException.Code.BACKEND_ERROR, errorMsg, e);<NEW_LINE>}<NEW_LINE>}
LOGGER.error(errorMsg, e);
393,086
public static void collapseReferent(SemanticGraph sg) {<NEW_LINE>// find typed deps of form ref(gov, dep)<NEW_LINE>// put them in a List for processing<NEW_LINE>List<SemanticGraphEdge> refs = new ArrayList<>(sg.findAllRelns("ref"));<NEW_LINE>SemanticGraph sgCopy = sg.makeSoftCopy();<NEW_LINE>// now substitute target of referent where possible<NEW_LINE>for (SemanticGraphEdge ref : refs) {<NEW_LINE>// take the relative word<NEW_LINE><MASK><NEW_LINE>// take the antecedent<NEW_LINE>IndexedWord ant = ref.getGovernor();<NEW_LINE>for (Iterator<SemanticGraphEdge> iter = sgCopy.incomingEdgeIterator(dep); iter.hasNext(); ) {<NEW_LINE>SemanticGraphEdge edge = iter.next();<NEW_LINE>// the last condition below maybe shouldn't be necessary, but it has<NEW_LINE>// helped stop things going haywire a couple of times (it stops the<NEW_LINE>// creation of a unit cycle that probably leaves something else<NEW_LINE>// disconnected) [cdm Jan 2010]<NEW_LINE>if (!edge.getRelation().getShortName().equals("ref") && !edge.getGovernor().equals(ant)) {<NEW_LINE>sg.removeEdge(edge);<NEW_LINE>GrammaticalRelation reln = edge.getRelation();<NEW_LINE>if (edge.getRelation().getShortName().equals("obj")) {<NEW_LINE>reln = RELATIVE_OBJECT;<NEW_LINE>} else if (edge.getRelation().getShortName().equals("nsubj")) {<NEW_LINE>reln = RELATIVE_NOMINAL_SUBJECT;<NEW_LINE>} else if (edge.getRelation().getShortName().equals("nsubj:pass")) {<NEW_LINE>reln = RELATIVE_NOMINAL_PASSIVE_SUBJECT;<NEW_LINE>}<NEW_LINE>sg.addEdge(edge.getGovernor(), ant, reln, RELCL_EDGE_WEIGHT, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
IndexedWord dep = ref.getDependent();
421,971
public ApplicationCodeConfigurationUpdate unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ApplicationCodeConfigurationUpdate applicationCodeConfigurationUpdate = new ApplicationCodeConfigurationUpdate();<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("CodeContentTypeUpdate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>applicationCodeConfigurationUpdate.setCodeContentTypeUpdate(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("CodeContentUpdate", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>applicationCodeConfigurationUpdate.setCodeContentUpdate(CodeContentUpdateJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>}<NEW_LINE>} else if (token == END_ARRAY || token == END_OBJECT) {<NEW_LINE>if (context.getLastParsedParentElement() == null || context.getLastParsedParentElement().equals(currentParentElement)) {<NEW_LINE>if (context.getCurrentDepth() <= originalDepth)<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>token = context.nextToken();<NEW_LINE>}<NEW_LINE>return applicationCodeConfigurationUpdate;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,830,885
public void ignoreFolder(String deviceId, String folderId, String folderLabel) {<NEW_LINE>synchronized (mConfigLock) {<NEW_LINE>for (Device device : mConfig.devices) {<NEW_LINE>if (deviceId.equals(device.deviceID)) {<NEW_LINE>for (IgnoredFolder ignoredFolder : device.ignoredFolders) {<NEW_LINE>if (folderId.equals(ignoredFolder.id)) {<NEW_LINE>// Folder already ignored.<NEW_LINE>Log.d(TAG, "Folder [" + folderId + "] already ignored on device [" + deviceId + "]");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>IgnoredFolder ignoredFolder = new IgnoredFolder();<NEW_LINE>ignoredFolder.id = folderId;<NEW_LINE>ignoredFolder.label = folderLabel;<NEW_LINE>ignoredFolder.time = dateString(new Date());<NEW_LINE><MASK><NEW_LINE>if (BuildConfig.DEBUG) {<NEW_LINE>Log.v(TAG, "device.ignoredFolders = " + new Gson().toJson(device.ignoredFolders));<NEW_LINE>}<NEW_LINE>sendConfig();<NEW_LINE>Log.d(TAG, "Ignored folder [" + folderId + "] announced by device [" + deviceId + "]");<NEW_LINE>// Given deviceId handled.<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
device.ignoredFolders.add(ignoredFolder);
1,538,992
public ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) throws IOException {<NEW_LINE>ClientHttpRequest request = super.createRequest(uri, httpMethod);<NEW_LINE>TimeoutConfig config = timeoutConfig.get();<NEW_LINE>if (config == null) {<NEW_LINE>return request;<NEW_LINE>}<NEW_LINE>timeoutConfig.remove();<NEW_LINE>try {<NEW_LINE>Field httpContextField = request.getClass().getDeclaredField("httpContext");<NEW_LINE>httpContextField.setAccessible(true);<NEW_LINE>HttpContext httpContext = (HttpContext) httpContextField.get(request);<NEW_LINE>RequestConfig requestConfig = (RequestConfig) httpContext.getAttribute("http.request-config");<NEW_LINE>Field connectTimeoutField = requestConfig.getClass().getDeclaredField("connectTimeout");<NEW_LINE>connectTimeoutField.setAccessible(true);<NEW_LINE>connectTimeoutField.set(requestConfig, config.connectTimeout);<NEW_LINE>Field socketTimeoutField = requestConfig.getClass().getDeclaredField("socketTimeout");<NEW_LINE>socketTimeoutField.setAccessible(true);<NEW_LINE>socketTimeoutField.set(requestConfig, config.readTimeout);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>throw new <MASK><NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
IOException(t.getCause());
859,028
// -------------------------------------------------------------------------<NEW_LINE>// Send Event methods<NEW_LINE>// -------------------------------------------------------------------------<NEW_LINE>@Override<NEW_LINE>public void sendConnectionClosedEvent(Object handle) throws ResourceException {<NEW_LINE>// Create the event only if needed, and outside of the synchronized block. [d133293]<NEW_LINE>AdapterConnectionEvent event = new AdapterConnectionEvent(this, ConnectionEvent.CONNECTION_CLOSED, null, handle);<NEW_LINE><MASK><NEW_LINE>synchronized (this) {<NEW_LINE>// There are some valid cases in our test bucket where the 'handle in use' list will be null, and in these instances,<NEW_LINE>// we must no-op the .remove(), or else we'll get a NullPointer<NEW_LINE>//<NEW_LINE>// The 'handles in use' list gets nulled out when the Server calls the .destroy() method on this object, and<NEW_LINE>// that will happen when the 'connection error event' gets fired.<NEW_LINE>//<NEW_LINE>// We have at least two instances in the testing where we fire a 'connection error event', and then follow that up with<NEW_LINE>// a second action that will cause us to use the 'handles in use' list...but of course at this point its been nulled out,<NEW_LINE>// so we have to skip that action or we'll get the NulPointer.<NEW_LINE>if (handlesInUse != null) {<NEW_LINE>handlesInUse.remove(handle);<NEW_LINE>} else {<NEW_LINE>svLogger.info("The 'handles in use' list is null...NOT attempting to remove the Handle from it.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < numListeners; i++) {<NEW_LINE>ivEventListeners[i].connectionClosed(event);<NEW_LINE>}<NEW_LINE>}
svLogger.info("Sending CONNECTION CLOSED event for: " + handle);
1,175,970
public void execute(RequestContext requestContext) {<NEW_LINE>StringBuilder sBuilder = new StringBuilder(512);<NEW_LINE>try {<NEW_LINE>HttpServletRequest req = requestContext.getReq();<NEW_LINE>if (this.master.isStopped()) {<NEW_LINE>throw new Exception("Sever is stopping...");<NEW_LINE>}<NEW_LINE>MetaDataService defMetaDataService = this.master.getMetaDataService();<NEW_LINE>if (!defMetaDataService.isSelfMaster()) {<NEW_LINE>throw new StandbyException("Please send your request to the master Node.");<NEW_LINE>}<NEW_LINE>String type = req.getParameter("type");<NEW_LINE>if ("consumer".equals(type)) {<NEW_LINE>getConsumerListInfo(req, sBuilder);<NEW_LINE>} else if ("sub_info".equals(type)) {<NEW_LINE>getConsumerSubInfo(req, sBuilder);<NEW_LINE>} else if ("producer".equals(type)) {<NEW_LINE>getProducerListInfo(req, sBuilder);<NEW_LINE>} else if ("broker".equals(type)) {<NEW_LINE>innGetBrokerInfo(req, sBuilder, true);<NEW_LINE>} else if ("newBroker".equals(type)) {<NEW_LINE><MASK><NEW_LINE>} else if ("topic_pub".equals(type)) {<NEW_LINE>getTopicPubInfo(req, sBuilder);<NEW_LINE>} else if ("unbalance_group".equals(type)) {<NEW_LINE>getUnbalanceGroupInfo(sBuilder);<NEW_LINE>} else {<NEW_LINE>sBuilder.append("Unsupported request type : ").append(type);<NEW_LINE>}<NEW_LINE>requestContext.put("sb", sBuilder.toString());<NEW_LINE>} catch (Exception e) {<NEW_LINE>requestContext.put("sb", "Bad request from client. " + e.getMessage());<NEW_LINE>}<NEW_LINE>}
innGetBrokerInfo(req, sBuilder, false);
1,484,185
public void partialUpdate() {<NEW_LINE>// Here's a channel with some custom field data that might be useful<NEW_LINE>ChannelClient channelClient = client.channel("messaging", "general");<NEW_LINE>List<String> members = Arrays.asList("thierry", "tommaso");<NEW_LINE>Map<String, String> channelDetail = new HashMap<>();<NEW_LINE>channelDetail.put("topic", "Plants and Animals");<NEW_LINE>channelDetail.put("rating", "pg");<NEW_LINE>Map<String, Integer> userId = new HashMap<>();<NEW_LINE>userId.put("user_id", 123);<NEW_LINE>Map<String, Object> extraData = new HashMap<>();<NEW_LINE>extraData.put("source", "user");<NEW_LINE>extraData.put("source_detail", userId);<NEW_LINE>extraData.put("channel_detail", channelDetail);<NEW_LINE>channelClient.create(members, extraData).execute();<NEW_LINE>// let's change the source of this channel<NEW_LINE>Map<String, Object> setField = Collections.singletonMap("source", "system");<NEW_LINE>channelClient.updatePartial(setField, <MASK><NEW_LINE>// since it's system generated we no longer need source_detail<NEW_LINE>List<String> unsetField = Collections.singletonList("source_detail");<NEW_LINE>channelClient.updatePartial(emptyMap(), unsetField).execute();<NEW_LINE>// and finally update one of the nested fields in the channel_detail<NEW_LINE>Map<String, Object> setNestedField = Collections.singletonMap("channel_detail.topic", "Nature");<NEW_LINE>channelClient.updatePartial(setNestedField, emptyList()).execute();<NEW_LINE>// and maybe we decide we no longer need a rating<NEW_LINE>List<String> unsetNestedField = Collections.singletonList("channel_detail.rating");<NEW_LINE>channelClient.updatePartial(emptyMap(), unsetNestedField).execute();<NEW_LINE>}
emptyList()).execute();
875,560
protected void apply(RelOptRuleCall call, Project project, TableScan scan) {<NEW_LINE>final RelOptTable table = scan.getTable();<NEW_LINE>assert table.unwrap(ProjectableFilterableTable.class) != null;<NEW_LINE>final List<Integer> selectedColumns = new ArrayList<>();<NEW_LINE>project.getProjects().forEach(proj -> {<NEW_LINE>proj.accept(new RexVisitorImpl<Void>(true) {<NEW_LINE><NEW_LINE>public Void visitInputRef(RexInputRef inputRef) {<NEW_LINE>if (!selectedColumns.contains(inputRef.getIndex())) {<NEW_LINE>selectedColumns.add(inputRef.getIndex());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>});<NEW_LINE>final List<RexNode> filtersPushDown;<NEW_LINE>final List<Integer> projectsPushDown;<NEW_LINE>if (scan instanceof Bindables.BindableTableScan) {<NEW_LINE>final Bindables.BindableTableScan <MASK><NEW_LINE>filtersPushDown = bindableScan.filters;<NEW_LINE>projectsPushDown = selectedColumns.stream().map(col -> bindableScan.projects.get(col)).collect(Collectors.toList());<NEW_LINE>} else {<NEW_LINE>filtersPushDown = ImmutableList.of();<NEW_LINE>projectsPushDown = selectedColumns;<NEW_LINE>}<NEW_LINE>final List<String> aliases = new ArrayList<>();<NEW_LINE>List<String> col_names = table.getRowType().getFieldNames();<NEW_LINE>int count_cols = 0;<NEW_LINE>for (Pair<RexNode, String> value : project.getNamedProjects()) {<NEW_LINE>// We want to mantain column names when no aliases where provided<NEW_LINE>// If we have in the future issues with aliases we can review:<NEW_LINE>// PR related to this -> https://github.com/BlazingDB/blazingsql/pull/1400<NEW_LINE>// Issue related to this -> https://github.com/BlazingDB/blazingsql/issues/1393<NEW_LINE>if (value.right.length() > 1 && value.right.substring(0, 2).equals("$f") && count_cols < projectsPushDown.size()) {<NEW_LINE>aliases.add(col_names.get(projectsPushDown.get(count_cols)));<NEW_LINE>} else {<NEW_LINE>aliases.add(value.right);<NEW_LINE>}<NEW_LINE>count_cols++;<NEW_LINE>}<NEW_LINE>BindableTableScan newScan = BindableTableScan.create(scan.getCluster(), scan.getTable(), filtersPushDown, projectsPushDown, aliases);<NEW_LINE>Mapping mapping = Mappings.target(selectedColumns, scan.getRowType().getFieldCount());<NEW_LINE>final List<RexNode> newProjectRexNodes = ImmutableList.copyOf(RexUtil.apply(mapping, project.getProjects()));<NEW_LINE>if (RexUtil.isIdentity(newProjectRexNodes, newScan.getRowType())) {<NEW_LINE>call.transformTo(newScan);<NEW_LINE>} else {<NEW_LINE>call.transformTo(call.builder().push(newScan).project(newProjectRexNodes, aliases).build());<NEW_LINE>}<NEW_LINE>}
bindableScan = (Bindables.BindableTableScan) scan;
41,369
private static ShexRecord parseShapeMapEntry(JsonObject obj) {<NEW_LINE>// Just enough to parse the maps in the validation test suite.<NEW_LINE>// Full:<NEW_LINE>// node: an RDF node, or a triple pattern which is used to select RDF nodes.<NEW_LINE>// shape: ShEx shapeExprLabel or the string "START" for the start shape expression.<NEW_LINE>// status: [default="conformant"] "nonconformant" or "conformant".<NEW_LINE>// reason: [optional] a string stating a reason for failure or success.<NEW_LINE>// appInfo: [optional] an application-specific JSON-LD structure<NEW_LINE>try {<NEW_LINE>String uri = getStrOrNull(obj, "node");<NEW_LINE>if (uri == null)<NEW_LINE>throw new ShexException("Missing: required field: \"node\"");<NEW_LINE>String shapeURI = getStrOrNull(obj, "shape");<NEW_LINE>if (shapeURI == null)<NEW_LINE>throw new ShexException("Missing: required field: \"shape\"");<NEW_LINE>// String status = getStrOrNull(obj, "status");<NEW_LINE>// String reason = getStrOrNull(obj, "reason");<NEW_LINE>// String appInfo = getStrOrNull(obj, "appInfo");<NEW_LINE>Node nodeFocus = NodeFactory.createURI(uri);<NEW_LINE>Node nodeShape = NodeFactory.createURI(shapeURI);<NEW_LINE>return new ShexRecord(nodeFocus, nodeShape);<NEW_LINE>} catch (JsonException ex) {<NEW_LINE>throw new ShexException("Failed to parse shape map entry: " <MASK><NEW_LINE>}<NEW_LINE>}
+ JSON.toStringFlat(obj));
1,818,132
public Message managerPages(HttpServletRequest req, @RequestBody JsonNode jsonNode) {<NEW_LINE>Message message = null;<NEW_LINE>try {<NEW_LINE>String userName = ModuleUserUtils.getOperationUser(req);<NEW_LINE>if (StringUtils.isEmpty(userName)) {<NEW_LINE>throw new UDFException("username is empty!");<NEW_LINE>}<NEW_LINE>String udfName = jsonNode.get("udfName") == null ? null : jsonNode.get("udfName").textValue();<NEW_LINE>String udfType = jsonNode.get("udfType").textValue();<NEW_LINE>String createUser = jsonNode.get("createUser") == null ? null : jsonNode.get("createUser").textValue();<NEW_LINE>int curPage = jsonNode.get("curPage").intValue();<NEW_LINE>int pageSize = jsonNode.get("pageSize").intValue();<NEW_LINE>Collection<Integer> udfTypes = null;<NEW_LINE>if (!StringUtils.isEmpty(udfType)) {<NEW_LINE>udfTypes = Arrays.stream(udfType.split(",")).map(Integer::parseInt).<MASK><NEW_LINE>}<NEW_LINE>PageInfo<UDFAddVo> pageInfo = udfService.getManagerPages(udfName, udfTypes, userName, curPage, pageSize);<NEW_LINE>message = Message.ok();<NEW_LINE>message.data("infoList", pageInfo.getList());<NEW_LINE>message.data("totalPage", pageInfo.getPages());<NEW_LINE>message.data("total", pageInfo.getTotal());<NEW_LINE>} catch (Throwable e) {<NEW_LINE>logger.error("Failed to get udf infoList: ", e);<NEW_LINE>message = Message.error(e.getMessage());<NEW_LINE>}<NEW_LINE>return message;<NEW_LINE>}
collect(Collectors.toList());
1,346,273
private // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents<NEW_LINE>void initComponents() {<NEW_LINE>customizer = <MASK><NEW_LINE>resizingCheckBox = new javax.swing.JCheckBox();<NEW_LINE>reorderingCheckBox = new javax.swing.JCheckBox();<NEW_LINE>FormListener formListener = new FormListener();<NEW_LINE>// NOI18N<NEW_LINE>resizingCheckBox.setText(org.openide.util.NbBundle.getMessage(JTableHeaderEditor.class, "TableHeaderEditor_Resizing"));<NEW_LINE>resizingCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));<NEW_LINE>resizingCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));<NEW_LINE>resizingCheckBox.addActionListener(formListener);<NEW_LINE>// NOI18N<NEW_LINE>reorderingCheckBox.setText(org.openide.util.NbBundle.getMessage(JTableHeaderEditor.class, "TableHeaderEditor_Reordering"));<NEW_LINE>reorderingCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));<NEW_LINE>reorderingCheckBox.setMargin(new java.awt.Insets(0, 0, 0, 0));<NEW_LINE>reorderingCheckBox.addActionListener(formListener);<NEW_LINE>javax.swing.GroupLayout customizerLayout = new javax.swing.GroupLayout(customizer);<NEW_LINE>customizer.setLayout(customizerLayout);<NEW_LINE>customizerLayout.setHorizontalGroup(customizerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(customizerLayout.createSequentialGroup().addContainerGap().addGroup(customizerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(resizingCheckBox).addComponent(reorderingCheckBox)).addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));<NEW_LINE>customizerLayout.setVerticalGroup(customizerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(customizerLayout.createSequentialGroup().addContainerGap().addComponent(resizingCheckBox).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(reorderingCheckBox).addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));<NEW_LINE>}
new javax.swing.JPanel();
295,886
public HazelcastInstance hazelcastInstance(JHipsterProperties jHipsterProperties) {<NEW_LINE>log.debug("Configuring Hazelcast");<NEW_LINE>Config config = new Config();<NEW_LINE>config.setInstanceName("dealerapp");<NEW_LINE>// The serviceId is by default the application's name, see Spring Boot's eureka.instance.appname property<NEW_LINE>String serviceId = discoveryClient.getLocalServiceInstance().getServiceId();<NEW_LINE>log.debug("Configuring Hazelcast clustering for instanceId: {}", serviceId);<NEW_LINE>// In development, everything goes through 127.0.0.1, with a different port<NEW_LINE>if (env.acceptsProfiles(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)) {<NEW_LINE>log.debug("Application is running with the \"dev\" profile, Hazelcast " + "cluster will only work with localhost instances");<NEW_LINE>System.setProperty("hazelcast.local.localAddress", "127.0.0.1");<NEW_LINE>config.getNetworkConfig().setPort(serverProperties.getPort() + 5701);<NEW_LINE>config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);<NEW_LINE>config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true);<NEW_LINE>for (ServiceInstance instance : discoveryClient.getInstances(serviceId)) {<NEW_LINE>String clusterMember = "127.0.0.1:" + (instance.getPort() + 5701);<NEW_LINE><MASK><NEW_LINE>config.getNetworkConfig().getJoin().getTcpIpConfig().addMember(clusterMember);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// Production configuration, one host per instance all using port 5701<NEW_LINE>config.getNetworkConfig().setPort(5701);<NEW_LINE>config.getNetworkConfig().getJoin().getMulticastConfig().setEnabled(false);<NEW_LINE>config.getNetworkConfig().getJoin().getTcpIpConfig().setEnabled(true);<NEW_LINE>for (ServiceInstance instance : discoveryClient.getInstances(serviceId)) {<NEW_LINE>String clusterMember = instance.getHost() + ":5701";<NEW_LINE>log.debug("Adding Hazelcast (prod) cluster member " + clusterMember);<NEW_LINE>config.getNetworkConfig().getJoin().getTcpIpConfig().addMember(clusterMember);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>config.getMapConfigs().put("default", initializeDefaultMapConfig());<NEW_LINE>config.getMapConfigs().put("com.dealer.app.domain.*", initializeDomainMapConfig(jHipsterProperties));<NEW_LINE>return Hazelcast.newHazelcastInstance(config);<NEW_LINE>}
log.debug("Adding Hazelcast (dev) cluster member " + clusterMember);
951,158
private void handleNoRouteLetter(Message msg) {<NEW_LINE>setThreadLoggingContext(msg);<NEW_LINE>if (msg instanceof APIIsReadyToGoMsg) {<NEW_LINE>APIIsReadyToGoReply reply = new APIIsReadyToGoReply();<NEW_LINE>reply.setManagementNodeId(Platform.getManagementServerId());<NEW_LINE>reply.setError(err(SysErrors.NOT_READY_ERROR, "management node[uuid:%s] is no ready", Platform.getManagementServerId()));<NEW_LINE>reply(msg, reply);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String err = null;<NEW_LINE>if (msg instanceof MessageReply) {<NEW_LINE>replyErrorByMessageType(msg, err(SysErrors.NO_ROUTE_ERROR, "No route found for the reply[%s], the service[id:%s] waiting for this reply may have been quit. %s", msg.getClass().getName(), msg.getServiceId(), wire.dumpMessage(msg)));<NEW_LINE>} else {<NEW_LINE>replyErrorByMessageType(msg, err(SysErrors.NO_ROUTE_ERROR, "No route found for the message[%s], the service[id:%s] may not be running. Checking Spring xml to make sure you have loaded it. Message dump:\n %s", msg.getClass().getName(), msg.getServiceId(), <MASK><NEW_LINE>}<NEW_LINE>}
wire.dumpMessage(msg)));
1,009,188
public void testSLLFutureThrowApplicationException() throws Exception {<NEW_LINE>String results = "false";<NEW_LINE>long currentThreadId = 0;<NEW_LINE>ExceptionStatelessLocal bean = lookupSLLBean();<NEW_LINE>// update results with bean creation<NEW_LINE>assertNotNull("Async Stateless Bean created successfully", bean);<NEW_LINE>// call bean asynchronous method using Future<V> object to receive results<NEW_LINE>Future<String> future = bean.test_fireAndThrowApplicationException();<NEW_LINE>try {<NEW_LINE>svLogger.info("Retrieving results");<NEW_LINE>results = future.get();<NEW_LINE>fail("Did not catch expected ExecutionException : " + results);<NEW_LINE>} catch (ExecutionException ee) {<NEW_LINE>// exception received as expected<NEW_LINE>svLogger.info("caught expected ExecutionException");<NEW_LINE>assertTrue("Nested exception is an AsyncApplicationException", ee.getCause() instanceof AsyncApplicationException);<NEW_LINE>// get current thread Id for comparison to bean method thread id<NEW_LINE>currentThreadId = Thread.currentThread().getId();<NEW_LINE><MASK><NEW_LINE>svLogger.info("Bean threadId = " + ExceptionStatelessLocalFutureBean.beanThreadId);<NEW_LINE>// update results with current and bean method thread id comparison<NEW_LINE>assertThat("Async Stateless Bean method completed on separate thread", ExceptionStatelessLocalFutureBean.beanThreadId, is(not(currentThreadId)));<NEW_LINE>}<NEW_LINE>}
svLogger.info("Test threadId = " + currentThreadId);
236,260
static SearchExecutionContext wrap(SearchExecutionContext delegate) {<NEW_LINE>return new SearchExecutionContext(delegate) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public IndexReader getIndexReader() {<NEW_LINE>// The reader that matters in this context is not the reader of the shard but<NEW_LINE>// the reader of the MemoryIndex. We just use `null` for simplicity.<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public BitSetProducer bitsetFilter(Query query) {<NEW_LINE>return context -> {<NEW_LINE>final IndexReaderContext topLevelContext = ReaderUtil.getTopLevelContext(context);<NEW_LINE>final IndexSearcher searcher = new IndexSearcher(topLevelContext);<NEW_LINE>searcher.setQueryCache(null);<NEW_LINE>final Weight weight = searcher.createWeight(searcher.rewrite(query), ScoreMode.COMPLETE_NO_SCORES, 1f);<NEW_LINE>final Scorer s = weight.scorer(context);<NEW_LINE>if (s != null) {<NEW_LINE>return new BitDocIdSet(BitSet.of(s.iterator(), context.reader().maxDoc())).bits();<NEW_LINE>} else {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>public <IFD extends IndexFieldData<?>> IFD getForField(MappedFieldType fieldType) {<NEW_LINE>IndexFieldData.Builder builder = fieldType.fielddataBuilder(delegate.getFullyQualifiedIndex().getName(), delegate::lookup);<NEW_LINE>IndexFieldDataCache <MASK><NEW_LINE>CircuitBreakerService circuitBreaker = new NoneCircuitBreakerService();<NEW_LINE>return (IFD) builder.build(cache, circuitBreaker);<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
cache = new IndexFieldDataCache.None();
450,538
public boolean addDex(Dex dex) {<NEW_LINE>Map<String, List<Dex>> tempMethodTreeMap = new HashMap<>(methodTreeMap);<NEW_LINE>Map<String, List<Dex>> tempFieldTreeMap = new HashMap<>(fieldTreeMap);<NEW_LINE>for (MethodId methodId : dex.methodIds()) {<NEW_LINE>if (tempMethodTreeMap.containsKey(methodId.toString())) {<NEW_LINE>tempMethodTreeMap.get(methodId.toString()).add(dex);<NEW_LINE>} else {<NEW_LINE>List<Dex> dexes = new ArrayList<>();<NEW_LINE>dexes.add(dex);<NEW_LINE>tempMethodTreeMap.put(methodId.toString(), dexes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (FieldId fieldId : dex.fieldIds()) {<NEW_LINE>if (tempFieldTreeMap.containsKey(fieldId.toString())) {<NEW_LINE>tempFieldTreeMap.get(fieldId.toString()).add(dex);<NEW_LINE>} else {<NEW_LINE>List<Dex> dexes = new ArrayList<>();<NEW_LINE>dexes.add(dex);<NEW_LINE>tempFieldTreeMap.put(fieldId.toString(), dexes);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// fields = fields+dex.fieldIds().size();<NEW_LINE>// if (fields > MAX_FIELD_IDS){<NEW_LINE>// return false;<NEW_LINE>// }<NEW_LINE>// methods = methods+dex.methodIds().size();<NEW_LINE>// if (methods > MAX_METHOD_IDS){<NEW_LINE>// return false;<NEW_LINE>// }<NEW_LINE>if (dex.methodIds().size() > MAX_METHOD_IDS_FIRSTDEX || dex.fieldIds().size() > MAX_FIELD_IDS) {<NEW_LINE>throw new DexIndexOverflowException("field or method ID not in [0, 0xffff]: " + "tempMethods size:" + dex.methodIds().size() + "tempFields size:" + dex.<MASK><NEW_LINE>}<NEW_LINE>if (tempMethodTreeMap.size() > MAX_METHOD_IDS || tempFieldTreeMap.size() > MAX_FIELD_IDS) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>fieldTreeMap = new HashMap<>(tempFieldTreeMap);<NEW_LINE>methodTreeMap = new HashMap<>(tempMethodTreeMap);<NEW_LINE>dexs.add(dex);<NEW_LINE>tempFieldTreeMap.clear();<NEW_LINE>tempMethodTreeMap.clear();<NEW_LINE>return true;<NEW_LINE>}
fieldIds().size());
1,271,200
public Future<?> execute(TestDescriptor testDescriptor, EngineExecutionListener executionListener) {<NEW_LINE>Preconditions.notNull(testDescriptor, "testDescriptor must not be null");<NEW_LINE>Preconditions.notNull(executionListener, "executionListener must not be null");<NEW_LINE>executionListener.dynamicTestRegistered(testDescriptor);<NEW_LINE>Set<ExclusiveResource> exclusiveResources = NodeUtils.asNode(testDescriptor).getExclusiveResources();<NEW_LINE>if (!exclusiveResources.isEmpty()) {<NEW_LINE>executionListener.executionStarted(testDescriptor);<NEW_LINE>String message = "Dynamic test descriptors must not declare exclusive resources: " + exclusiveResources;<NEW_LINE>executionListener.executionFinished(testDescriptor, failed(new JUnitException(message)));<NEW_LINE>return completedFuture(null);<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>NodeTestTask<C> nodeTestTask = new NodeTestTask<>(taskContext.withListener(executionListener), testDescriptor, () -> unfinishedTasks.remove(uniqueId));<NEW_LINE>nodeTestTask.setParentContext(context);<NEW_LINE>unfinishedTasks.put(uniqueId, DynamicTaskState.unscheduled());<NEW_LINE>Future<Void> future = taskContext.getExecutorService().submit(nodeTestTask);<NEW_LINE>unfinishedTasks.computeIfPresent(uniqueId, (__, state) -> DynamicTaskState.scheduled(future));<NEW_LINE>return future;<NEW_LINE>}<NEW_LINE>}
UniqueId uniqueId = testDescriptor.getUniqueId();
937,398
public static void main(String[] args) {<NEW_LINE>if ((args.length > 2) || (args.length == 0)) {<NEW_LINE>System.err.println("command parameters: action[data|eval] [path to the (gold) evaluation dataset]");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String action = args[0];<NEW_LINE>if ((action == null) || (action.length() == 0) || (!action.equals("data")) && (!action.equals("eval"))) {<NEW_LINE>System.err.println("Action to be performed not correctly set, should be [data|eval]");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String inputPath = args[1];<NEW_LINE>if ((inputPath == null) || (inputPath.length() == 0)) {<NEW_LINE>System.err.println("Path to evaluation (gold) XML data is not correctly set");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>File thePath = new File(inputPath);<NEW_LINE>if (!thePath.exists()) {<NEW_LINE>System.err.println("Path to evaluation (gold) XML data does not exist");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!thePath.isDirectory()) {<NEW_LINE>System.err.println("Path to evaluation (gold) XML data is not a directory");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>if (action.equals("data")) {<NEW_LINE>EvaluationDOIMatching data = new EvaluationDOIMatching(inputPath);<NEW_LINE>data.buildEvaluationDataset();<NEW_LINE>} else if (action.equals("eval")) {<NEW_LINE>EvaluationDOIMatching eval = new EvaluationDOIMatching(inputPath);<NEW_LINE><MASK><NEW_LINE>System.out.println(report);<NEW_LINE>}<NEW_LINE>System.out.println(Engine.getCntManager());<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>}<NEW_LINE>// to be sure jvm stops<NEW_LINE>System.exit(0);<NEW_LINE>}
String report = eval.evaluation();
279,988
public ImportInstanceTaskDetails unmarshall(StaxUnmarshallerContext context) throws Exception {<NEW_LINE>ImportInstanceTaskDetails importInstanceTaskDetails = new ImportInstanceTaskDetails();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>if (context.isStartOfDocument())<NEW_LINE>targetDepth += 1;<NEW_LINE>while (true) {<NEW_LINE>int xmlEvent = context.nextEvent();<NEW_LINE>if (xmlEvent == XmlPullParser.END_DOCUMENT)<NEW_LINE>return importInstanceTaskDetails;<NEW_LINE>if (xmlEvent == XmlPullParser.START_TAG) {<NEW_LINE>if (context.testExpression("volumes/item", targetDepth)) {<NEW_LINE>importInstanceTaskDetails.getVolumes().add(ImportInstanceVolumeDetailItemStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("instanceId", targetDepth)) {<NEW_LINE>importInstanceTaskDetails.setInstanceId(StringStaxUnmarshaller.getInstance<MASK><NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("platform", targetDepth)) {<NEW_LINE>importInstanceTaskDetails.setPlatform(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (context.testExpression("description", targetDepth)) {<NEW_LINE>importInstanceTaskDetails.setDescription(StringStaxUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>} else if (xmlEvent == XmlPullParser.END_TAG) {<NEW_LINE>if (context.getCurrentDepth() < originalDepth) {<NEW_LINE>return importInstanceTaskDetails;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
().unmarshall(context));
817,443
private void loadNode422() throws IOException, SAXException {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.CertificateGroupFolderType_DefaultUserTokenGroup_TrustList_GetPosition_OutputArguments, new QualifiedName(0, "OutputArguments"), new LocalizedText("en", "OutputArguments"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.Argument, 1, new UInteger[] { org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UInteger.valueOf(0) }, UByte.valueOf(1), UByte.valueOf<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultUserTokenGroup_TrustList_GetPosition_OutputArguments, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultUserTokenGroup_TrustList_GetPosition_OutputArguments, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CertificateGroupFolderType_DefaultUserTokenGroup_TrustList_GetPosition_OutputArguments, Identifiers.HasProperty, Identifiers.CertificateGroupFolderType_DefaultUserTokenGroup_TrustList_GetPosition.expanded(), false));<NEW_LINE>StringBuilder sb = new StringBuilder();<NEW_LINE>sb.append("<ListOfExtensionObject xmlns=\"http://opcfoundation.org/UA/2008/02/Types.xsd\"><ExtensionObject><TypeId><Identifier>i=297</Identifier> </TypeId><Body><Argument><Name>Position</Name><DataType><Identifier>i=9</Identifier> </DataType><ValueRank>-1</ValueRank><ArrayDimensions/> </Argument> </Body> </ExtensionObject> </ListOfExtensionObject>");<NEW_LINE>String xml = sb.toString();<NEW_LINE>OpcUaXmlStreamDecoder decoder = new OpcUaXmlStreamDecoder(context.getServer().getSerializationContext()).setInput(new StringReader(xml));<NEW_LINE>Object o = decoder.readVariantValue();<NEW_LINE>DataValue value = new DataValue(new Variant(o));<NEW_LINE>node.setValue(value);<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
(1), 0.0, false);
408,246
public void run() {<NEW_LINE>Object result = null;<NEW_LINE>try {<NEW_LINE>if (args == null || args.length == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>ArrayList<Object> argsList = new ArrayList<>();<NEW_LINE>for (Object arg : args) {<NEW_LINE>argsList.add(arg);<NEW_LINE>}<NEW_LINE>if (params != null) {<NEW_LINE>ArrayMap map = new ArrayMap(4);<NEW_LINE>map.put(KEY_PARAMS, params);<NEW_LINE>argsList.add(map);<NEW_LINE>}<NEW_LINE>WXHashMap<String, Object> task = new WXHashMap<>();<NEW_LINE>task.put(KEY_METHOD, method);<NEW_LINE>task.put(KEY_ARGS, argsList);<NEW_LINE>Object[] tasks = { task };<NEW_LINE>WXJSObject[] jsArgs = { new WXJSObject(WXJSObject.String, instanceId), WXWsonJSONSwitch.toWsonOrJsonWXJSObject(tasks) };<NEW_LINE>ResultCallback<MASK><NEW_LINE>if (eventCallback != null) {<NEW_LINE>resultCallback = new ResultCallback<byte[]>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onReceiveResult(byte[] result) {<NEW_LINE>JSONArray arrayResult = (JSONArray) WXWsonJSONSwitch.parseWsonOrJSON(result);<NEW_LINE>if (arrayResult != null && arrayResult.size() > 0) {<NEW_LINE>eventCallback.onCallback(arrayResult.get(0));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}<NEW_LINE>invokeExecJSWithCallback(String.valueOf(instanceId), null, METHOD_CALL_JS, jsArgs, resultCallback, true);<NEW_LINE>jsArgs[0] = null;<NEW_LINE>} catch (Exception e) {<NEW_LINE>WXLogUtils.e("asyncCallJSEventWithResult", e);<NEW_LINE>}<NEW_LINE>}
<byte[]> resultCallback = null;
1,652,214
private void writeRow(final PrintStream out, final Object[] row) {<NEW_LINE>boolean needsPadding = false;<NEW_LINE>for (int i = 0; i < row.length; i++) {<NEW_LINE>if (needsPadding)<NEW_LINE>out.printf(" ");<NEW_LINE>needsPadding = true;<NEW_LINE>final Object obj = row[i];<NEW_LINE>final String value;<NEW_LINE>final GATKReportColumn info = columnInfo.get(i);<NEW_LINE>if (obj == null)<NEW_LINE>value = "null";<NEW_LINE>else if (info.getDataType().equals(GATKReportDataType.Unknown) && (obj instanceof Double || obj instanceof Float))<NEW_LINE>value = String.format("%.8f", obj);<NEW_LINE>else {<NEW_LINE>if (obj instanceof Double || obj instanceof Float) {<NEW_LINE>value = Double.isFinite(Double.parseDouble(obj.toString())) ? String.format(info.getFormat(), <MASK><NEW_LINE>} else {<NEW_LINE>value = String.format(info.getFormat(), obj);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.printf(info.getColumnFormat().getValueFormat(), value);<NEW_LINE>}<NEW_LINE>out.println();<NEW_LINE>}
obj) : obj.toString();
858,588
public DaoMethodOutcome update(T theResource, String theMatchUrl, boolean thePerformIndexing, boolean theForceUpdateVersion, RequestDetails theRequest, @Nonnull TransactionDetails theTransactionDetails) {<NEW_LINE>if (theResource == null) {<NEW_LINE>String msg = getContext().getLocalizer().getMessage(BaseStorageDao.class, "missingBody");<NEW_LINE>throw new InvalidRequestException(Msg.code(986) + msg);<NEW_LINE>}<NEW_LINE>if (!theResource.getIdElement().hasIdPart() && isBlank(theMatchUrl)) {<NEW_LINE>String <MASK><NEW_LINE>String msg = myFhirContext.getLocalizer().getMessage(BaseStorageDao.class, "updateWithNoId", type);<NEW_LINE>throw new InvalidRequestException(Msg.code(987) + msg);<NEW_LINE>}<NEW_LINE>String id = theResource.getIdElement().getValue();<NEW_LINE>Runnable onRollback = () -> theResource.getIdElement().setValue(id);<NEW_LINE>// Execute the update in a retryable transaction<NEW_LINE>return myTransactionService.execute(theRequest, theTransactionDetails, tx -> doUpdate(theResource, theMatchUrl, thePerformIndexing, theForceUpdateVersion, theRequest, theTransactionDetails), onRollback);<NEW_LINE>}
type = myFhirContext.getResourceType(theResource);
362,508
private boolean mergeProjectRequiredProperties(Artifact artifact) throws IOException {<NEW_LINE>SortedProperties projectProps = getProjectProperties();<NEW_LINE>SortedProperties libProps = getLibraryRequiredProperties(artifact);<NEW_LINE>String javaVersion = (String) projectProps.getProperty("codename1.arg.java.version", "8");<NEW_LINE>String javaVersionLib = (String) libProps.get("codename1.arg.java.version");<NEW_LINE>if (javaVersionLib != null) {<NEW_LINE>int v1 = 5;<NEW_LINE>if (javaVersion != null) {<NEW_LINE>v1 = Integer.parseInt(javaVersion);<NEW_LINE>}<NEW_LINE>int v2 = Integer.parseInt(javaVersionLib);<NEW_LINE>// if the lib java version is bigger, this library cannot be used<NEW_LINE>if (v1 < v2) {<NEW_LINE>throw new BuildException("Cannot use a cn1lib with java version " + "greater then the project java version");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// merge and save<NEW_LINE>SortedProperties merged = projectProps;<NEW_LINE>// merged.putAll(projectProps);<NEW_LINE><MASK><NEW_LINE>boolean changed = false;<NEW_LINE>while (keys.hasMoreElements()) {<NEW_LINE>String key = (String) keys.nextElement();<NEW_LINE>if (!merged.containsKey(key)) {<NEW_LINE>merged.put(key, libProps.getProperty(key));<NEW_LINE>changed = true;<NEW_LINE>} else {<NEW_LINE>// if this property already exists with a different value the<NEW_LINE>// install will fail<NEW_LINE>if (!merged.get(key).equals(libProps.getProperty(key))) {<NEW_LINE>throw new BuildException("Property " + key + " has a conflict");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return changed;<NEW_LINE>}
Enumeration keys = libProps.propertyNames();
1,343,368
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {<NEW_LINE>final BindResult<SpringDocConfigProperties> result = Binder.get(environment).<MASK><NEW_LINE>if (result.isBound()) {<NEW_LINE>SpringDocConfigProperties springDocGroupConfig = result.get();<NEW_LINE>List<GroupedOpenApi> groupedOpenApis = springDocGroupConfig.getGroupConfigs().stream().map(elt -> {<NEW_LINE>GroupedOpenApi.Builder builder = GroupedOpenApi.builder();<NEW_LINE>if (!CollectionUtils.isEmpty(elt.getPackagesToScan()))<NEW_LINE>builder.packagesToScan(elt.getPackagesToScan().toArray(new String[0]));<NEW_LINE>if (!CollectionUtils.isEmpty(elt.getPathsToMatch()))<NEW_LINE>builder.pathsToMatch(elt.getPathsToMatch().toArray(new String[0]));<NEW_LINE>if (!CollectionUtils.isEmpty(elt.getProducesToMatch()))<NEW_LINE>builder.producesToMatch(elt.getProducesToMatch().toArray(new String[0]));<NEW_LINE>if (!CollectionUtils.isEmpty(elt.getConsumesToMatch()))<NEW_LINE>builder.consumesToMatch(elt.getConsumesToMatch().toArray(new String[0]));<NEW_LINE>if (!CollectionUtils.isEmpty(elt.getHeadersToMatch()))<NEW_LINE>builder.headersToMatch(elt.getHeadersToMatch().toArray(new String[0]));<NEW_LINE>if (!CollectionUtils.isEmpty(elt.getPathsToExclude()))<NEW_LINE>builder.pathsToExclude(elt.getPathsToExclude().toArray(new String[0]));<NEW_LINE>if (!CollectionUtils.isEmpty(elt.getPackagesToExclude()))<NEW_LINE>builder.packagesToExclude(elt.getPackagesToExclude().toArray(new String[0]));<NEW_LINE>if (StringUtils.isNotEmpty(elt.getDisplayName()))<NEW_LINE>builder.displayName(elt.getDisplayName());<NEW_LINE>return builder.group(elt.getGroup()).build();<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>groupedOpenApis.forEach(elt -> beanFactory.registerSingleton(elt.getGroup(), elt));<NEW_LINE>}<NEW_LINE>initBeanFactoryPostProcessor(beanFactory);<NEW_LINE>}
bind(SPRINGDOC_PREFIX, SpringDocConfigProperties.class);
1,594,411
private void createYamlContentsGroup(Composite composite) {<NEW_LINE>yamlGroup = new Group(composite, SWT.NONE);<NEW_LINE>yamlGroup.setText("YAML Content");<NEW_LINE>yamlGroup.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());<NEW_LINE>yamlGroup.setLayout(new GridLayout());<NEW_LINE>fileYamlComposite = new Composite(yamlGroup, SWT.NONE);<NEW_LINE>fileYamlComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());<NEW_LINE>GridLayout layout = new GridLayout(3, false);<NEW_LINE>layout.marginWidth = 0;<NEW_LINE>fileYamlComposite.setLayout(layout);<NEW_LINE>fileLabel = new Label(fileYamlComposite, SWT.WRAP);<NEW_LINE>fileLabel.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).span(3, SWT.DEFAULT).create());<NEW_LINE>model.getFileLabel().addListener(new UIValueListener<String>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>protected void uiGotValue(LiveExpression<String> exp, String value) {<NEW_LINE>if (!fileLabel.isDisposed()) {<NEW_LINE>fileLabel.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>model.getFileYamlEditor().setContext(CONTEXT_DEPLOYMENT_PROPERTIES_DIALOG);<NEW_LINE>try {<NEW_LINE>model.getFileYamlEditor().createControl(fileYamlComposite);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>Log.log(e);<NEW_LINE>}<NEW_LINE>model.getFileYamlEditor().getViewer().getControl().setLayoutData(GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, 200).create());<NEW_LINE>model.fileYamlEditorControlCreated();<NEW_LINE>manualYamlComposite = new Composite(yamlGroup, SWT.NONE);<NEW_LINE>manualYamlComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());<NEW_LINE>layout = new GridLayout();<NEW_LINE>layout.marginWidth = 0;<NEW_LINE>manualYamlComposite.setLayout(layout);<NEW_LINE>Label manualYamlDescriptionLabel = new Label(manualYamlComposite, SWT.WRAP);<NEW_LINE>manualYamlDescriptionLabel.setText(model.isManualManifestReadOnly() ? "Preview of the contents of the auto-generated deployment manifest:" : "Edit deployment manifest contents:");<NEW_LINE>manualYamlDescriptionLabel.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());<NEW_LINE>model.getManualYamlEditor().setContext(CONTEXT_DEPLOYMENT_PROPERTIES_DIALOG);<NEW_LINE>try {<NEW_LINE>model.getManualYamlEditor().createControl(manualYamlComposite);<NEW_LINE>} catch (CoreException e) {<NEW_LINE>Log.log(e);<NEW_LINE>}<NEW_LINE>model.getManualYamlEditor().getViewer().getControl().setLayoutData(GridDataFactory.fillDefaults().grab(true, true).hint(SWT.DEFAULT, 200).create());<NEW_LINE>ProjectionViewer manualYamlViewer = model.getManualYamlEditor().getViewer();<NEW_LINE>if (model.isManualManifestReadOnly()) {<NEW_LINE>manualYamlViewer.setEditable(false);<NEW_LINE>manualYamlViewer.getTextWidget().setCaret(null);<NEW_LINE>manualYamlViewer.getTextWidget().setCursor(getShell().getDisplay().getSystemCursor(SWT.CURSOR_ARROW));<NEW_LINE>}<NEW_LINE>model.manualYamlEditorControlCreated();<NEW_LINE>model.getFileYamlEditor().getViewer().getTextWidget().setFont(JFaceResources.getTextFont());<NEW_LINE>manualYamlViewer.getTextWidget().setFont(JFaceResources.getTextFont());<NEW_LINE>}
setText(exp.getValue());
676,813
private //<NEW_LINE>boolean applyPropertyMappings(ResultSetWrapper rsw, ResultMap resultMap, MetaObject metaObject, ResultLoaderMap lazyLoader, String columnPrefix) throws SQLException {<NEW_LINE>final List<String> mappedColumnNames = rsw.getMappedColumnNames(resultMap, columnPrefix);<NEW_LINE>boolean foundValues = false;<NEW_LINE>final List<ResultMapping> propertyMappings = resultMap.getPropertyResultMappings();<NEW_LINE>for (ResultMapping propertyMapping : propertyMappings) {<NEW_LINE>String column = prependPrefix(propertyMapping.getColumn(), columnPrefix);<NEW_LINE>if (propertyMapping.getNestedResultMapId() != null) {<NEW_LINE>// the user added a column attribute to a nested result map, ignore it<NEW_LINE>column = null;<NEW_LINE>}<NEW_LINE>if (propertyMapping.isCompositeResult() || (column != null && mappedColumnNames.contains(column.toUpperCase(Locale.ENGLISH))) || propertyMapping.getResultSet() != null) {<NEW_LINE>Object value = getPropertyMappingValue(rsw.getResultSet(), <MASK><NEW_LINE>// issue #541 make property optional<NEW_LINE>final String property = propertyMapping.getProperty();<NEW_LINE>if (property == null) {<NEW_LINE>continue;<NEW_LINE>} else if (value == DEFERRED) {<NEW_LINE>foundValues = true;<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (value != null) {<NEW_LINE>foundValues = true;<NEW_LINE>}<NEW_LINE>if (value != null || (configuration.isCallSettersOnNulls() && !metaObject.getSetterType(property).isPrimitive())) {<NEW_LINE>// gcode issue #377, call setter on nulls (value is not 'found')<NEW_LINE>metaObject.setValue(property, value);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return foundValues;<NEW_LINE>}
metaObject, propertyMapping, lazyLoader, columnPrefix);
121,390
private File createJapiCmpBaseDir(PluginParameters pluginParameters) throws MojoFailureException {<NEW_LINE>if (pluginParameters.getProjectBuildDirParam().isPresent()) {<NEW_LINE>try {<NEW_LINE>File projectBuildDirParam = pluginParameters.getProjectBuildDirParam().get();<NEW_LINE>if (projectBuildDirParam != null) {<NEW_LINE>File jApiCmpBuildDir = new File(projectBuildDirParam.getCanonicalPath() + File.separator + "japicmp");<NEW_LINE><MASK><NEW_LINE>if (mkdirs || jApiCmpBuildDir.isDirectory() && jApiCmpBuildDir.canWrite()) {<NEW_LINE>return jApiCmpBuildDir;<NEW_LINE>}<NEW_LINE>throw new MojoFailureException(String.format("Failed to create directory '%s'.", jApiCmpBuildDir.getAbsolutePath()));<NEW_LINE>} else {<NEW_LINE>throw new MojoFailureException("Maven parameter projectBuildDir is not set.");<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new MojoFailureException("Failed to create output directory: " + e.getMessage(), e);<NEW_LINE>}<NEW_LINE>} else if (pluginParameters.getOutputDirectory().isPresent()) {<NEW_LINE>String outputDirectory = pluginParameters.getOutputDirectory().get();<NEW_LINE>if (outputDirectory != null) {<NEW_LINE>File outputDirFile = new File(outputDirectory);<NEW_LINE>boolean mkdirs = outputDirFile.mkdirs();<NEW_LINE>if (mkdirs || outputDirFile.isDirectory() && outputDirFile.canWrite()) {<NEW_LINE>return outputDirFile;<NEW_LINE>}<NEW_LINE>throw new MojoFailureException(String.format("Failed to create directory '%s'.", outputDirFile.getAbsolutePath()));<NEW_LINE>} else {<NEW_LINE>throw new MojoFailureException("Maven parameter outputDirectory is not set.");<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new MojoFailureException("None of the two parameters projectBuildDir and outputDirectory are present");<NEW_LINE>}<NEW_LINE>}
boolean mkdirs = jApiCmpBuildDir.mkdirs();
809,429
private void checkSize(StringBuilder unparsedSize, CharSequence literal, StringBuilder extract, boolean isFirst, boolean isLast) throws DatatypeException {<NEW_LINE>String size;<NEW_LINE>trimWhitespace(unparsedSize);<NEW_LINE>if (unparsedSize.length() == 0) {<NEW_LINE>errEmpty(isFirst, isLast, extract);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (')' == unparsedSize.charAt(unparsedSize.length() - 1)) {<NEW_LINE>checkCalc(unparsedSize, extract, isLast);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int sizeValueStart = lastSpaceIndex(unparsedSize);<NEW_LINE>size = unparsedSize.substring(lastSpaceIndex(unparsedSize), unparsedSize.length());<NEW_LINE>try {<NEW_LINE>if (Float.parseFloat(size) == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>}<NEW_LINE>String units = getUnits(size);<NEW_LINE>String num = size.substring(0, size.length() - units.length());<NEW_LINE>boolean sizeIsLessThanZero = false;<NEW_LINE>try {<NEW_LINE>CSS_NUMBER_TOKEN.checkValid(num);<NEW_LINE>if (Float.parseFloat(num) < 0) {<NEW_LINE>sizeIsLessThanZero = true;<NEW_LINE>}<NEW_LINE>} catch (DatatypeException e) {<NEW_LINE>errFromOtherDatatype(<MASK><NEW_LINE>} catch (NumberFormatException e) {<NEW_LINE>errNotNumber(num, extract);<NEW_LINE>}<NEW_LINE>if (sizeIsLessThanZero) {<NEW_LINE>errNotPositive(size, extract);<NEW_LINE>}<NEW_LINE>if (!LENGTH_UNITS.contains(units)) {<NEW_LINE>errNotUnits(units, extract);<NEW_LINE>}<NEW_LINE>unparsedSize.setLength(sizeValueStart);<NEW_LINE>trimTrailingWhitespace(unparsedSize);<NEW_LINE>if (unparsedSize.length() == 0) {<NEW_LINE>if (!isLast) {<NEW_LINE>errNoMediaCondition(unparsedSize, extract);<NEW_LINE>}<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>MEDIA_CONDITION.checkValid(unparsedSize);<NEW_LINE>} catch (DatatypeException e) {<NEW_LINE>errFromOtherDatatype(e.getMessage(), extract);<NEW_LINE>}<NEW_LINE>}
e.getMessage(), extract);
413,015
private void invalidate(Node node) {<NEW_LINE>for (int i = 0, n = node.parts.size; i < n; ++i) {<NEW_LINE>NodePart part = node.parts.get(i);<NEW_LINE>ArrayMap<Node, Matrix4> bindPose = part.invBoneBindTransforms;<NEW_LINE>if (bindPose != null) {<NEW_LINE>for (int j = 0; j < bindPose.size; ++j) {<NEW_LINE>bindPose.keys[j] = getNode(bindPose.keys[j].id);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!materials.contains(part.material, true)) {<NEW_LINE>final int midx = materials.indexOf(part.material, false);<NEW_LINE>if (midx < 0)<NEW_LINE>materials.add(part.material = <MASK><NEW_LINE>else<NEW_LINE>part.material = materials.get(midx);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0, n = node.getChildCount(); i < n; ++i) {<NEW_LINE>invalidate(node.getChild(i));<NEW_LINE>}<NEW_LINE>}
part.material.copy());
1,786,565
public void call(SourceUnit source, GeneratorContext context, ClassNode classNode) throws CompilationFailedException {<NEW_LINE>ImportCustomizer importCustomizer = new SmartImportCustomizer(source);<NEW_LINE>List<ClassNode> classNodes = source<MASK><NEW_LINE>ClassNode mainClassNode = MainClass.get(classNodes);<NEW_LINE>// Additional auto configuration<NEW_LINE>for (CompilerAutoConfiguration autoConfiguration : GroovyCompiler.this.compilerAutoConfigurations) {<NEW_LINE>if (classNodes.stream().anyMatch(autoConfiguration::matches)) {<NEW_LINE>if (GroovyCompiler.this.configuration.isGuessImports()) {<NEW_LINE>autoConfiguration.applyImports(importCustomizer);<NEW_LINE>importCustomizer.call(source, context, classNode);<NEW_LINE>}<NEW_LINE>if (classNode.equals(mainClassNode)) {<NEW_LINE>autoConfiguration.applyToMainClass(GroovyCompiler.this.loader, GroovyCompiler.this.configuration, context, source, classNode);<NEW_LINE>}<NEW_LINE>autoConfiguration.apply(GroovyCompiler.this.loader, GroovyCompiler.this.configuration, context, source, classNode);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>importCustomizer.call(source, context, classNode);<NEW_LINE>}
.getAST().getClasses();
825,575
public Request<ModifyInstanceCreditSpecificationRequest> marshall(ModifyInstanceCreditSpecificationRequest modifyInstanceCreditSpecificationRequest) {<NEW_LINE>if (modifyInstanceCreditSpecificationRequest == null) {<NEW_LINE>throw new SdkClientException("Invalid argument passed to marshall(...)");<NEW_LINE>}<NEW_LINE>Request<ModifyInstanceCreditSpecificationRequest> request = new DefaultRequest<MASK><NEW_LINE>request.addParameter("Action", "ModifyInstanceCreditSpecification");<NEW_LINE>request.addParameter("Version", "2016-11-15");<NEW_LINE>request.setHttpMethod(HttpMethodName.POST);<NEW_LINE>if (modifyInstanceCreditSpecificationRequest.getClientToken() != null) {<NEW_LINE>request.addParameter("ClientToken", StringUtils.fromString(modifyInstanceCreditSpecificationRequest.getClientToken()));<NEW_LINE>}<NEW_LINE>com.amazonaws.internal.SdkInternalList<InstanceCreditSpecificationRequest> modifyInstanceCreditSpecificationRequestInstanceCreditSpecificationsList = (com.amazonaws.internal.SdkInternalList<InstanceCreditSpecificationRequest>) modifyInstanceCreditSpecificationRequest.getInstanceCreditSpecifications();<NEW_LINE>if (!modifyInstanceCreditSpecificationRequestInstanceCreditSpecificationsList.isEmpty() || !modifyInstanceCreditSpecificationRequestInstanceCreditSpecificationsList.isAutoConstruct()) {<NEW_LINE>int instanceCreditSpecificationsListIndex = 1;<NEW_LINE>for (InstanceCreditSpecificationRequest modifyInstanceCreditSpecificationRequestInstanceCreditSpecificationsListValue : modifyInstanceCreditSpecificationRequestInstanceCreditSpecificationsList) {<NEW_LINE>if (modifyInstanceCreditSpecificationRequestInstanceCreditSpecificationsListValue.getInstanceId() != null) {<NEW_LINE>request.addParameter("InstanceCreditSpecification." + instanceCreditSpecificationsListIndex + ".InstanceId", StringUtils.fromString(modifyInstanceCreditSpecificationRequestInstanceCreditSpecificationsListValue.getInstanceId()));<NEW_LINE>}<NEW_LINE>if (modifyInstanceCreditSpecificationRequestInstanceCreditSpecificationsListValue.getCpuCredits() != null) {<NEW_LINE>request.addParameter("InstanceCreditSpecification." + instanceCreditSpecificationsListIndex + ".CpuCredits", StringUtils.fromString(modifyInstanceCreditSpecificationRequestInstanceCreditSpecificationsListValue.getCpuCredits()));<NEW_LINE>}<NEW_LINE>instanceCreditSpecificationsListIndex++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return request;<NEW_LINE>}
<ModifyInstanceCreditSpecificationRequest>(modifyInstanceCreditSpecificationRequest, "AmazonEC2");
331,803
private void switchType(boolean writable) {<NEW_LINE>int index = findMatchingComboItem();<NEW_LINE>if (index == -1) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String s = typeComboBox.getSelectedItem().toString();<NEW_LINE>int last = s.indexOf("<");<NEW_LINE>String suffix = last == -1 ? "" : s.substring(last);<NEW_LINE>if (writable) {<NEW_LINE>typeComboBox.setModel(new DefaultComboBoxModel(WRITABLE_PROPS));<NEW_LINE>typeComboBox.setSelectedIndex(index);<NEW_LINE>} else {<NEW_LINE>typeComboBox.setModel(new DefaultComboBoxModel(READONLY_PROPS));<NEW_LINE>typeComboBox.setSelectedIndex(index);<NEW_LINE>}<NEW_LINE>if (last != -1) {<NEW_LINE>String newType = typeComboBox<MASK><NEW_LINE>int idx = newType.indexOf("<?>");<NEW_LINE>if (idx != -1) {<NEW_LINE>newType = newType.substring(0, idx) + suffix;<NEW_LINE>}<NEW_LINE>typeComboBox.setSelectedItem(newType);<NEW_LINE>}<NEW_LINE>}
.getSelectedItem().toString();
1,429,043
public static <T> void groupAndRuns(List<? extends T> values, BiPredicate<T, T> func, java.util.function.Consumer<List<? extends T>> consumer) {<NEW_LINE>if (values.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (values.size() == 1) {<NEW_LINE>consumer.accept(values);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>T <MASK><NEW_LINE>int startIndex = -1;<NEW_LINE>for (int i = 1; i < values.size(); i++) {<NEW_LINE>T event = values.get(i);<NEW_LINE>try {<NEW_LINE>if (func.test(prev, event)) {<NEW_LINE>if (startIndex == -1) {<NEW_LINE>// start from prev if not group index<NEW_LINE>startIndex = i - 1;<NEW_LINE>} else {<NEW_LINE>// nothing group already started<NEW_LINE>}<NEW_LINE>} else if (i == 1) {<NEW_LINE>// second value not equal first - eat first as single group<NEW_LINE>consumer.accept(Collections.singletonList(prev));<NEW_LINE>startIndex = i;<NEW_LINE>} else if (startIndex == -1) {<NEW_LINE>// if group not started - start fake group<NEW_LINE>// it will eat by groupper, or return as prev<NEW_LINE>startIndex = i;<NEW_LINE>} else {<NEW_LINE>// finish group and start fake<NEW_LINE>List<? extends T> subList = values.subList(startIndex, i);<NEW_LINE>consumer.accept(subList);<NEW_LINE>startIndex = i;<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>prev = event;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (startIndex != -1) {<NEW_LINE>List<? extends T> list = values.subList(startIndex, values.size());<NEW_LINE>consumer.accept(list);<NEW_LINE>}<NEW_LINE>}
prev = values.get(0);
279,946
private void handleInvoices(final I_C_Printing_Queue queueItem, final I_C_Invoice invoice) {<NEW_LINE>queueItem.setBill_BPartner_ID(invoice.getC_BPartner_ID());<NEW_LINE>queueItem.setBill_User_ID(invoice.getAD_User_ID());<NEW_LINE>queueItem.setBill_Location_ID(invoice.getC_BPartner_Location_ID());<NEW_LINE>queueItem.setC_BPartner_ID(invoice.getC_BPartner_ID());<NEW_LINE>queueItem.setC_BPartner_Location_ID(invoice.getC_BPartner_Location_ID());<NEW_LINE>final IBPartnerDAO bpartnerDAO = Services.get(IBPartnerDAO.class);<NEW_LINE>final I_C_BPartner partner = bpartnerDAO.getById(invoice.getC_BPartner_ID());<NEW_LINE>final <MASK><NEW_LINE>if (documentCopies > 0) {<NEW_LINE>// updating to the partner's preference<NEW_LINE>queueItem.setCopies(documentCopies);<NEW_LINE>}<NEW_LINE>logger.debug("Setting columns of C_Printing_Queue {} from C_Invoice {}: [Bill_BPartner_ID={}, Bill_Location_ID={}, C_BPartner_ID={}, C_BPartner_Location_ID={}, Copies={}]", queueItem, invoice, invoice.getC_BPartner_ID(), invoice.getC_BPartner_Location_ID(), invoice.getC_BPartner_ID(), invoice.getC_BPartner_Location_ID(), queueItem.getCopies());<NEW_LINE>}
int documentCopies = partner.getDocumentCopies();
810,457
/*/////////////////////////////////////////////////////////////////////////<NEW_LINE>// Fragment Views<NEW_LINE>/////////////////////////////////////////////////////////////////////////*/<NEW_LINE>@Override<NEW_LINE>protected void initViews(final View rootView, final Bundle savedInstanceState) {<NEW_LINE>super.initViews(rootView, savedInstanceState);<NEW_LINE>inputButton = rootView.findViewById(R.id.input_button);<NEW_LINE>inputText = rootView.findViewById(R.id.input_text);<NEW_LINE>infoTextView = rootView.findViewById(R.id.info_text_view);<NEW_LINE>// TODO: Support services that can import from more than one source<NEW_LINE>// (show the option to the user)<NEW_LINE>if (supportedSources.contains(CHANNEL_URL)) {<NEW_LINE>inputButton.setText(R.string.import_title);<NEW_LINE><MASK><NEW_LINE>inputText.setHint(ServiceHelper.getImportInstructionsHint(currentServiceId));<NEW_LINE>} else {<NEW_LINE>inputButton.setText(R.string.import_file_title);<NEW_LINE>}<NEW_LINE>if (instructionsString != 0) {<NEW_LINE>if (TextUtils.isEmpty(relatedUrl)) {<NEW_LINE>setInfoText(getString(instructionsString));<NEW_LINE>} else {<NEW_LINE>setInfoText(getString(instructionsString, relatedUrl));<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>setInfoText("");<NEW_LINE>}<NEW_LINE>final ActionBar supportActionBar = activity.getSupportActionBar();<NEW_LINE>if (supportActionBar != null) {<NEW_LINE>supportActionBar.setDisplayShowTitleEnabled(true);<NEW_LINE>setTitle(getString(R.string.import_title));<NEW_LINE>}<NEW_LINE>}
inputText.setVisibility(View.VISIBLE);
1,776,294
public static IndexMetadata readFrom(StreamInput in) throws IOException {<NEW_LINE>Builder builder = new Builder(in.readString());<NEW_LINE>builder.version(in.readLong());<NEW_LINE>builder.mappingVersion(in.readVLong());<NEW_LINE>builder.settingsVersion(in.readVLong());<NEW_LINE>builder.<MASK><NEW_LINE>builder.state(State.fromId(in.readByte()));<NEW_LINE>builder.settings(readSettingsFromStream(in));<NEW_LINE>builder.primaryTerms(in.readVLongArray());<NEW_LINE>int mappingsSize = in.readVInt();<NEW_LINE>for (int i = 0; i < mappingsSize; i++) {<NEW_LINE>MappingMetadata mappingMd = new MappingMetadata(in);<NEW_LINE>builder.putMapping(mappingMd);<NEW_LINE>}<NEW_LINE>int aliasesSize = in.readVInt();<NEW_LINE>for (int i = 0; i < aliasesSize; i++) {<NEW_LINE>AliasMetadata aliasMd = new AliasMetadata(in);<NEW_LINE>builder.putAlias(aliasMd);<NEW_LINE>}<NEW_LINE>int customSize = in.readVInt();<NEW_LINE>for (int i = 0; i < customSize; i++) {<NEW_LINE>String key = in.readString();<NEW_LINE>DiffableStringMap custom = new DiffableStringMap(in);<NEW_LINE>builder.putCustom(key, custom);<NEW_LINE>}<NEW_LINE>int inSyncAllocationIdsSize = in.readVInt();<NEW_LINE>for (int i = 0; i < inSyncAllocationIdsSize; i++) {<NEW_LINE>int key = in.readVInt();<NEW_LINE>Set<String> allocationIds = DiffableUtils.StringSetValueSerializer.getInstance().read(in, key);<NEW_LINE>builder.putInSyncAllocationIds(key, allocationIds);<NEW_LINE>}<NEW_LINE>return builder.build();<NEW_LINE>}
setRoutingNumShards(in.readInt());
1,090,923
static void checkIfClusterNameInDataPaths(ClusterName clusterName, Path[] dataFiles) throws NodeValidationException {<NEW_LINE>final List<Path> existingPathsWithClusterName = Arrays.stream(dataFiles).map(p -> p.resolve(clusterName.value())).filter(Files::exists).<MASK><NEW_LINE>if (existingPathsWithClusterName.isEmpty() == false) {<NEW_LINE>final List<String> clusterPathStrings = existingPathsWithClusterName.stream().map(Path::toString).collect(Collectors.toList());<NEW_LINE>final List<String> dataPathStrings = existingPathsWithClusterName.stream().map(Path::getParent).map(Path::toString).collect(Collectors.toList());<NEW_LINE>throw new NodeValidationException("Cluster name [" + clusterName.value() + "] subdirectory exists in data paths [" + String.join(",", clusterPathStrings) + "]. " + "All data under these paths must be moved up one directory to paths [" + String.join(",", dataPathStrings) + "]");<NEW_LINE>}<NEW_LINE>}
collect(Collectors.toList());
544,637
private GraphObject extractActiveElement(final DOMNode node, final Set<String> dataKeys, final String parentId, final ActiveElementState state, final int depth) {<NEW_LINE>final PropertyKey<String> actionKey = StructrApp.key(DOMElement.class, "data-structr-action");<NEW_LINE>final PropertyKey<String> hrefKey = StructrApp.key(Link.class, "_html_href");<NEW_LINE>final PropertyKey<String> contentKey = StructrApp.key(Content.class, "content");<NEW_LINE>final GraphObjectMap activeElement = new GraphObjectMap();<NEW_LINE>activeElement.put(GraphObject.id, node.getUuid());<NEW_LINE>activeElement.put(GraphObject.type, node.getType());<NEW_LINE>activeElement.put(StructrApp.key(DOMElement.class, "dataKey"), StringUtils.join(dataKeys, ","));<NEW_LINE>activeElement.put(contentKey, node.getProperty(contentKey));<NEW_LINE>switch(state) {<NEW_LINE>case Button:<NEW_LINE>activeElement.put(actionProperty, node.getProperty(actionKey));<NEW_LINE>break;<NEW_LINE>case Link:<NEW_LINE>activeElement.put(actionProperty<MASK><NEW_LINE>break;<NEW_LINE>case Query:<NEW_LINE>extractQueries(activeElement, node);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>activeElement.put(stateProperty, state.name());<NEW_LINE>activeElement.put(recursionDepthProperty, depth);<NEW_LINE>activeElement.put(parentIdProperty, parentId);<NEW_LINE>return activeElement;<NEW_LINE>}
, node.getProperty(hrefKey));
453,504
public <AT> AT retrieveValue(final ResultSet rs, final int columnIndex, final Class<AT> returnType) throws SQLException {<NEW_LINE>final AT value;<NEW_LINE>if (returnType.isAssignableFrom(BigDecimal.class)) {<NEW_LINE>value = (AT) rs.getBigDecimal(columnIndex);<NEW_LINE>} else if (returnType.isAssignableFrom(Double.class) || returnType == double.class) {<NEW_LINE>value = (AT) Double.valueOf(rs.getDouble(columnIndex));<NEW_LINE>} else if (returnType.isAssignableFrom(Integer.class) || returnType == int.class) {<NEW_LINE>value = (AT) Integer.valueOf(rs.getInt(columnIndex));<NEW_LINE>} else if (returnType.isAssignableFrom(Timestamp.class)) {<NEW_LINE>value = (AT) rs.getTimestamp(columnIndex);<NEW_LINE>} else if (returnType.isAssignableFrom(Date.class)) {<NEW_LINE>final Timestamp ts = rs.getTimestamp(columnIndex);<NEW_LINE>value = (AT) ts;<NEW_LINE>} else if (returnType.isAssignableFrom(LocalDateTime.class)) {<NEW_LINE>final Timestamp ts = rs.getTimestamp(columnIndex);<NEW_LINE>value = (AT) TimeUtil.asLocalDateTime(ts);<NEW_LINE>} else if (returnType.isAssignableFrom(LocalDate.class)) {<NEW_LINE>final Timestamp ts = rs.getTimestamp(columnIndex);<NEW_LINE>value = (<MASK><NEW_LINE>} else if (returnType.isAssignableFrom(Boolean.class) || returnType == boolean.class) {<NEW_LINE>value = (AT) StringUtils.toBoolean(rs.getString(columnIndex), Boolean.FALSE);<NEW_LINE>} else if (returnType.isAssignableFrom(String.class)) {<NEW_LINE>value = (AT) rs.getString(columnIndex);<NEW_LINE>} else if (RepoIdAware.class.isAssignableFrom(returnType)) {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>final Class<? extends RepoIdAware> repoIdAwareType = (Class<? extends RepoIdAware>) returnType;<NEW_LINE>value = (AT) RepoIdAwares.ofRepoIdOrNull(rs.getInt(columnIndex), repoIdAwareType);<NEW_LINE>} else {<NEW_LINE>value = (AT) rs.getObject(columnIndex);<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>}
AT) TimeUtil.asLocalDate(ts);
75,490
public EntityHistoryModelDao<M, E> map(final int index, final ResultSet r, final StatementContext ctx) throws SQLException {<NEW_LINE>final UUID id = getUUID(r, "id");<NEW_LINE>final long targetRecordId = r.getLong("target_record_id");<NEW_LINE>final String changeType = r.getString("change_type");<NEW_LINE>final DateTime createdDate = getDateTime(r, "created_date");<NEW_LINE>// preserve history record id, as it is needed to reference it with audit log<NEW_LINE>final long historyRecordId = r.getLong("history_record_id");<NEW_LINE>final M entityModelDao = entityMapper.map(index, r, ctx);<NEW_LINE>// Hack -- remove the id as it is the history id, not the entity id<NEW_LINE>((EntityModelDaoBase) entityModelDao).setId(null);<NEW_LINE>// Hack -- similarly, populate the right record_id<NEW_LINE>((EntityModelDaoBase<MASK><NEW_LINE>// Hack -- account is special<NEW_LINE>if (entityModelDao.getAccountRecordId() == null) {<NEW_LINE>((EntityModelDaoBase) entityModelDao).setAccountRecordId(targetRecordId);<NEW_LINE>}<NEW_LINE>return new EntityHistoryModelDao(id, entityModelDao, targetRecordId, ChangeType.valueOf(changeType), historyRecordId, createdDate);<NEW_LINE>}
) entityModelDao).setRecordId(targetRecordId);
878,188
private boolean readKeysFromBuckets(OAtomicOperation atomicOperation) throws IOException {<NEW_LINE>OCacheEntry cacheEntry = loadPageForRead(<MASK><NEW_LINE>try {<NEW_LINE>CellBTreeSingleValueBucketV3<K> bucket = new CellBTreeSingleValueBucketV3<>(cacheEntry);<NEW_LINE>if (lastLSN == null || bucket.getLSN().equals(lastLSN)) {<NEW_LINE>while (true) {<NEW_LINE>if (itemIndex < 0) {<NEW_LINE>pageIndex = (int) bucket.getLeftSibling();<NEW_LINE>if (pageIndex < 0) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>releasePageFromRead(atomicOperation, cacheEntry);<NEW_LINE>cacheEntry = loadPageForRead(atomicOperation, fileId, pageIndex, false);<NEW_LINE>bucket = new CellBTreeSingleValueBucketV3<>(cacheEntry);<NEW_LINE>final int bucketSize = bucket.size();<NEW_LINE>itemIndex = bucketSize - 1;<NEW_LINE>}<NEW_LINE>lastLSN = bucket.getLSN();<NEW_LINE>for (; itemIndex >= 0 && dataCache.size() < SPLITERATOR_CACHE_SIZE; itemIndex--) {<NEW_LINE>@SuppressWarnings("ObjectAllocationInLoop")<NEW_LINE>CellBTreeSingleValueBucketV3.CellBTreeEntry<K> entry = bucket.getEntry(itemIndex, keySerializer);<NEW_LINE>if (fromKey != null) {<NEW_LINE>if (fromKeyInclusive) {<NEW_LINE>if (comparator.compare(entry.key, fromKey) < 0) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>} else if (comparator.compare(entry.key, fromKey) <= 0) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// noinspection ObjectAllocationInLoop<NEW_LINE>dataCache.add(new ORawPair<>(entry.key, entry.value));<NEW_LINE>}<NEW_LINE>if (dataCache.size() >= SPLITERATOR_CACHE_SIZE) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>releasePageFromRead(atomicOperation, cacheEntry);<NEW_LINE>}<NEW_LINE>return false;<NEW_LINE>}
atomicOperation, fileId, pageIndex, false);
1,482,019
private CachedChecker createChecker(@NotNull final ConfigurationLocation location, @Nullable final Module module) {<NEW_LINE>final ListPropertyResolver propertyResolver;<NEW_LINE>try {<NEW_LINE>location.ensurePropertiesAreUpToDate(checkstyleProjectService.underlyingClassLoader());<NEW_LINE>final Map<String, String> properties = removeEmptyProperties(location.getProperties());<NEW_LINE>propertyResolver = new ListPropertyResolver(addEclipseCsProperties(location, module, properties));<NEW_LINE>} catch (IOException e) {<NEW_LINE>LOG.info("CheckStyle properties could not be loaded: " + location.getLocation(), e);<NEW_LINE>return blockAndShowMessage(location, module, e, "checkstyle.file-io-failed", location.getLocation());<NEW_LINE>}<NEW_LINE>final ClassLoader loaderOfCheckedCode = <MASK><NEW_LINE>if (LOG.isDebugEnabled()) {<NEW_LINE>LOG.debug("Call to create new checker with properties:\n" + dumpProperties(propertyResolver) + "With plugin classloader:" + ClassLoaderDumper.dumpClassLoader(loaderOfCheckedCode));<NEW_LINE>}<NEW_LINE>final Object workerResult = executeWorker(location, module, propertyResolver, loaderOfCheckedCode);<NEW_LINE>if (workerResult instanceof CheckstyleToolException) {<NEW_LINE>return blockAndShowMessageFromException(location, module, (CheckstyleToolException) workerResult);<NEW_LINE>} else if (workerResult instanceof IOException) {<NEW_LINE>IOException ioExceptionResult = (IOException) workerResult;<NEW_LINE>LOG.info("CheckStyle configuration could not be loaded: " + location.getLocation(), ioExceptionResult);<NEW_LINE>return blockAndShowMessage(location, module, ioExceptionResult, "checkstyle.file-not-found", location.getLocation());<NEW_LINE>} else if (workerResult instanceof Throwable) {<NEW_LINE>return blockAndShowException(location, module, (Throwable) workerResult);<NEW_LINE>}<NEW_LINE>return (CachedChecker) workerResult;<NEW_LINE>}
moduleClassPathBuilder().build(module);
318,736
private void initView() {<NEW_LINE>mRemoteUserIdList = new ArrayList<>();<NEW_LINE>mRemoteVideoList = new ArrayList<>();<NEW_LINE>mImageBack = findViewById(R.id.iv_back);<NEW_LINE>mTextTitle = findViewById(R.id.tv_room_number);<NEW_LINE>mButtonStartPush = findViewById(R.id.btn_start_push);<NEW_LINE>mEditRoomId = findViewById(R.id.et_room_id);<NEW_LINE>mEditUserId = <MASK><NEW_LINE>mSeekBlurLevel = findViewById(R.id.sb_blur_level);<NEW_LINE>mTextBlurLevel = findViewById(R.id.tv_blur_level);<NEW_LINE>mTXCloudPreviewView = findViewById(R.id.txcvv_main_local);<NEW_LINE>mRemoteVideoList.add((TXCloudVideoView) findViewById(R.id.txcvv_video_remote1));<NEW_LINE>mRemoteVideoList.add((TXCloudVideoView) findViewById(R.id.txcvv_video_remote2));<NEW_LINE>mRemoteVideoList.add((TXCloudVideoView) findViewById(R.id.txcvv_video_remote3));<NEW_LINE>mRemoteVideoList.add((TXCloudVideoView) findViewById(R.id.txcvv_video_remote4));<NEW_LINE>mRemoteVideoList.add((TXCloudVideoView) findViewById(R.id.txcvv_video_remote5));<NEW_LINE>mRemoteVideoList.add((TXCloudVideoView) findViewById(R.id.txcvv_video_remote6));<NEW_LINE>mImageBack.setOnClickListener(this);<NEW_LINE>mButtonStartPush.setOnClickListener(this);<NEW_LINE>String time = String.valueOf(System.currentTimeMillis());<NEW_LINE>String userId = time.substring(time.length() - 8);<NEW_LINE>mEditUserId.setText(userId);<NEW_LINE>mTextTitle.setText(getString(R.string.thirdbeauty_room_id) + ":" + mEditRoomId.getText().toString());<NEW_LINE>}
findViewById(R.id.et_user_id);
1,809,409
public static DescribeMonitorValuesResponse unmarshall(DescribeMonitorValuesResponse describeMonitorValuesResponse, UnmarshallerContext context) {<NEW_LINE>describeMonitorValuesResponse.setRequestId(context.stringValue("DescribeMonitorValuesResponse.RequestId"));<NEW_LINE>describeMonitorValuesResponse.setDate(context.stringValue("DescribeMonitorValuesResponse.Date"));<NEW_LINE>List<OcsInstanceMonitor> instanceIds = new ArrayList<OcsInstanceMonitor>();<NEW_LINE>for (int i = 0; i < context.lengthValue("DescribeMonitorValuesResponse.InstanceIds.Length"); i++) {<NEW_LINE>OcsInstanceMonitor ocsInstanceMonitor = new OcsInstanceMonitor();<NEW_LINE>ocsInstanceMonitor.setInstanceId(context.stringValue("DescribeMonitorValuesResponse.InstanceIds[" + i + "].InstanceId"));<NEW_LINE>List<OcsMonitorKey> monitorKeys = new ArrayList<OcsMonitorKey>();<NEW_LINE>for (int j = 0; j < context.lengthValue("DescribeMonitorValuesResponse.InstanceIds[" + i + "].MonitorKeys.Length"); j++) {<NEW_LINE>OcsMonitorKey ocsMonitorKey = new OcsMonitorKey();<NEW_LINE>ocsMonitorKey.setMonitorKey(context.stringValue("DescribeMonitorValuesResponse.InstanceIds[" + i <MASK><NEW_LINE>ocsMonitorKey.setValue(context.stringValue("DescribeMonitorValuesResponse.InstanceIds[" + i + "].MonitorKeys[" + j + "].Value"));<NEW_LINE>ocsMonitorKey.setUnit(context.stringValue("DescribeMonitorValuesResponse.InstanceIds[" + i + "].MonitorKeys[" + j + "].Unit"));<NEW_LINE>monitorKeys.add(ocsMonitorKey);<NEW_LINE>}<NEW_LINE>ocsInstanceMonitor.setMonitorKeys(monitorKeys);<NEW_LINE>instanceIds.add(ocsInstanceMonitor);<NEW_LINE>}<NEW_LINE>describeMonitorValuesResponse.setInstanceIds(instanceIds);<NEW_LINE>return describeMonitorValuesResponse;<NEW_LINE>}
+ "].MonitorKeys[" + j + "].MonitorKey"));
77,899
public void run(RegressionEnvironment env) {<NEW_LINE>EPCompiled type = env.compile("@name('s0') @public @buseventtype create schema MyEvent(p string)");<NEW_LINE>EPCompiled selectMyEvent = env.compile("@name('s0') select * from MyEvent", new RegressionPath().add(type));<NEW_LINE>EPCompiled selectSB = env.compile("@name('s0') select * from SupportBean");<NEW_LINE>EPCompiled selectSBParameterized = env.compile("@name('s0') select * from SupportBean(theString = ?::string)");<NEW_LINE>env.compileDeploy("@name('s1') select * from SupportBean");<NEW_LINE>// dependency not found<NEW_LINE>String msg = "A precondition is not satisfied: Required dependency event type 'MyEvent' cannot be found";<NEW_LINE>tryInvalidRollout(env, msg, 1, EPDeployPreconditionException.class, selectSB, selectMyEvent);<NEW_LINE>tryInvalidRollout(env, msg, 0, EPDeployPreconditionException.class, selectMyEvent);<NEW_LINE>tryInvalidRollout(env, msg, 2, EPDeployPreconditionException.class, selectSB, selectSB, selectMyEvent);<NEW_LINE>tryInvalidRollout(env, msg, 1, EPDeployPreconditionException.class, selectSB, selectMyEvent, selectSB, selectSB);<NEW_LINE>// already defined<NEW_LINE>tryInvalidRollout(env, "Event type by name 'MyEvent' already registered", 1, EPDeployException.class, type, type);<NEW_LINE>// duplicate deployment id<NEW_LINE>tryInvalidRollout(env, "Deployment id 'a' occurs multiple times in the rollout", 1, EPDeployException.class, new EPDeploymentRolloutCompiled(selectSB, new DeploymentOptions().setDeploymentId("a")), new EPDeploymentRolloutCompiled(selectSB, new DeploymentOptions(<MASK><NEW_LINE>// deployment id exists<NEW_LINE>tryInvalidRollout(env, "Deployment by id '" + env.deploymentId("s1") + "' already exists", 1, EPDeployDeploymentExistsException.class, new EPDeploymentRolloutCompiled(selectSB, new DeploymentOptions().setDeploymentId("a")), new EPDeploymentRolloutCompiled(selectSB, new DeploymentOptions().setDeploymentId(env.deploymentId("s1"))));<NEW_LINE>// substitution param problem<NEW_LINE>tryInvalidRollout(env, "Substitution parameters have not been provided: Statement 's0' has 1 substitution parameters", 1, EPDeploySubstitutionParameterException.class, selectSB, selectSBParameterized);<NEW_LINE>env.undeployAll();<NEW_LINE>}
).setDeploymentId("a")));
140,234
public String removeExecutionHistory(String age, String maxPeriod) {<NEW_LINE>if (StringUtils.isEmpty(age)) {<NEW_LINE>throw new IllegalArgumentException("Age cannot be empty");<NEW_LINE>}<NEW_LINE>List<UUID> list;<NEW_LINE>Transaction tx = persistence.createTransaction();<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>String jpql = "select e.id from sys$ScheduledExecution e where e.startTime < ?1";<NEW_LINE>if (StringUtils.isNotEmpty(maxPeriod)) {<NEW_LINE>jpql += " and e.task.period <= ?2";<NEW_LINE>}<NEW_LINE>jpql += " order by e.startTime";<NEW_LINE>Query query = em.createQuery(jpql);<NEW_LINE>Date startDate = DateUtils.addHours(timeSource.currentTimestamp(), -Integer.parseInt(age));<NEW_LINE>query.setParameter(1, startDate);<NEW_LINE>if (StringUtils.isNotEmpty(maxPeriod)) {<NEW_LINE>query.setParameter(2, Integer.parseInt(maxPeriod) * 3600);<NEW_LINE>}<NEW_LINE>list = query.getResultList();<NEW_LINE>tx.commit();<NEW_LINE>} finally {<NEW_LINE>tx.end();<NEW_LINE>}<NEW_LINE>for (int i = 0; i < list.size(); i += 100) {<NEW_LINE>final List<UUID> subList = list.subList(i, Math.min(i + 100, list.size()));<NEW_LINE>persistence.createTransaction().execute(new Transaction.Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run(EntityManager em) {<NEW_LINE>Query query = em.createQuery("delete from sys$ScheduledExecution e where e.id in ?1");<NEW_LINE>query.setParameter(1, subList);<NEW_LINE>query.executeUpdate();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>return "Deleted " + list.size();<NEW_LINE>}
EntityManager em = persistence.getEntityManager();
1,117,537
// Basic test of untimed invokeAny. Submit a group of tasks, of which one raises an exception,<NEW_LINE>// another runs for a long time, and another completes successfully within a short time.<NEW_LINE>// The result of the one that completed successfully should be returned,<NEW_LINE>// and the duration of the invokeAny method should show that it only waited for the first successful task.<NEW_LINE>@Test<NEW_LINE>public void testInvokeAny1Successful() throws Exception {<NEW_LINE>PolicyExecutor executor = provider.create("testInvokeAny1Successful");<NEW_LINE>CountDownLatch beginLatchForBlocker = new CountDownLatch(1);<NEW_LINE>CountDownLatch blocker = new CountDownLatch(1);<NEW_LINE>CountDownLatch unused = new CountDownLatch(0);<NEW_LINE>List<Callable<Boolean>> tasks = new ArrayList<Callable<Boolean>>();<NEW_LINE>// block for longer than the timeout<NEW_LINE>tasks.add(new CountDownTask(beginLatchForBlocker, blocker, TIMEOUT_NS * 2));<NEW_LINE>// intentionally cause NullPointerException<NEW_LINE>tasks.add(new CountDownTask(unused, null, 0));<NEW_LINE>// should succeed<NEW_LINE>tasks.add(new CountDownTask(unused, beginLatchForBlocker, TIMEOUT_NS));<NEW_LINE>long start = System.nanoTime();<NEW_LINE>assertTrue(executor.invokeAny(tasks));<NEW_LINE>long duration = System.nanoTime() - start;<NEW_LINE>assertTrue(duration + "ns", duration < TIMEOUT_NS);<NEW_LINE>List<Runnable> canceledFromQueue = executor.shutdownNow();<NEW_LINE>assertEquals(<MASK><NEW_LINE>}
0, canceledFromQueue.size());
1,490,623
public final RegexExpressionContext regexExpression() throws RecognitionException {<NEW_LINE>RegexExpressionContext _localctx = new RegexExpressionContext(_ctx, getState());<NEW_LINE><MASK><NEW_LINE>int _la;<NEW_LINE>try {<NEW_LINE>enterOuterAlt(_localctx, 1);<NEW_LINE>{<NEW_LINE>setState(113);<NEW_LINE>match(AT);<NEW_LINE>setState(122);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>switch(getInterpreter().adaptivePredict(_input, 12, _ctx)) {<NEW_LINE>case 1:<NEW_LINE>{<NEW_LINE>setState(114);<NEW_LINE>match(DOT);<NEW_LINE>setState(115);<NEW_LINE>property();<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>{<NEW_LINE>setState(117);<NEW_LINE>_errHandler.sync(this);<NEW_LINE>_la = _input.LA(1);<NEW_LINE>if (_la == DOT) {<NEW_LINE>{<NEW_LINE>setState(116);<NEW_LINE>match(DOT);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>setState(119);<NEW_LINE>match(LBRACK);<NEW_LINE>setState(120);<NEW_LINE>match(StringLiteral);<NEW_LINE>setState(121);<NEW_LINE>match(RBRACK);<NEW_LINE>}<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>setState(124);<NEW_LINE>match(MATCHES_REGEX_OPEN);<NEW_LINE>setState(125);<NEW_LINE>match(REGEX);<NEW_LINE>setState(126);<NEW_LINE>match(MATCHES_REGEX_CLOSE);<NEW_LINE>}<NEW_LINE>} catch (RecognitionException re) {<NEW_LINE>_localctx.exception = re;<NEW_LINE>_errHandler.reportError(this, re);<NEW_LINE>_errHandler.recover(this, re);<NEW_LINE>} finally {<NEW_LINE>exitRule();<NEW_LINE>}<NEW_LINE>return _localctx;<NEW_LINE>}
enterRule(_localctx, 16, RULE_regexExpression);
236,056
public List<JvmGcBo> decodeValues(Buffer valueBuffer, AgentStatDecodingContext decodingContext) {<NEW_LINE>final String agentId = decodingContext.getAgentId();<NEW_LINE>final long baseTimestamp = decodingContext.getBaseTimestamp();<NEW_LINE>final long timestampDelta = decodingContext.getTimestampDelta();<NEW_LINE>final long initialTimestamp = baseTimestamp + timestampDelta;<NEW_LINE>final JvmGcType gcType = JvmGcType.<MASK><NEW_LINE>int numValues = valueBuffer.readVInt();<NEW_LINE>List<Long> startTimestamps = this.codec.decodeValues(valueBuffer, UnsignedLongEncodingStrategy.REPEAT_COUNT, numValues);<NEW_LINE>List<Long> timestamps = this.codec.decodeTimestamps(initialTimestamp, valueBuffer, numValues);<NEW_LINE>// decode headers<NEW_LINE>final byte[] header = valueBuffer.readPrefixedBytes();<NEW_LINE>AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);<NEW_LINE>JvmGcCodecDecoder decoder = new JvmGcCodecDecoder(codec);<NEW_LINE>decoder.decode(valueBuffer, headerDecoder, numValues);<NEW_LINE>List<JvmGcBo> jvmGcBos = new ArrayList<>(numValues);<NEW_LINE>for (int i = 0; i < numValues; i++) {<NEW_LINE>JvmGcBo jvmGcBo = decoder.getValue(i);<NEW_LINE>jvmGcBo.setAgentId(agentId);<NEW_LINE>jvmGcBo.setStartTimestamp(startTimestamps.get(i));<NEW_LINE>jvmGcBo.setTimestamp(timestamps.get(i));<NEW_LINE>jvmGcBo.setGcType(gcType);<NEW_LINE>jvmGcBos.add(jvmGcBo);<NEW_LINE>}<NEW_LINE>return jvmGcBos;<NEW_LINE>}
getTypeByCode(valueBuffer.readVInt());
1,026,004
private void recusivelyGenerateSparkObjects(final Iterator<Object> parquetObjects, final DataType fieldType, final ArrayList<Object> recordBuilder) throws SerialisationException {<NEW_LINE>if (fieldType instanceof StructType) {<NEW_LINE>final ArrayList<Object> nestedRecordBuilder = new ArrayList<>();<NEW_LINE>for (final String field : ((StructType) fieldType).fieldNames()) {<NEW_LINE>final DataType innerDataType = ((StructType) fieldType).<MASK><NEW_LINE>recusivelyGenerateSparkObjects(parquetObjects, innerDataType, nestedRecordBuilder);<NEW_LINE>}<NEW_LINE>final Object[] rowObjects = new Object[nestedRecordBuilder.size()];<NEW_LINE>nestedRecordBuilder.toArray(rowObjects);<NEW_LINE>recordBuilder.add(new GenericRowWithSchema(rowObjects, (StructType) fieldType));<NEW_LINE>} else {<NEW_LINE>// must be a primitive type<NEW_LINE>final Object parquetObject = parquetObjects.next();<NEW_LINE>if (parquetObject instanceof Map) {<NEW_LINE>recordBuilder.add(scala.collection.JavaConversions.mapAsScalaMap((Map<Object, Object>) parquetObject));<NEW_LINE>} else {<NEW_LINE>recordBuilder.add(parquetObject);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
apply(field).dataType();
760,710
private Applications fetchRemoteRegistry(boolean delta) {<NEW_LINE>logger.info("Getting instance registry info from the eureka server : {} , delta : {}", this.remoteRegionURL, delta);<NEW_LINE>if (shouldUseExperimentalTransport()) {<NEW_LINE>try {<NEW_LINE>EurekaHttpResponse<Applications> httpResponse = delta ? eurekaHttpClient.getDelta() : eurekaHttpClient.getApplications();<NEW_LINE><MASK><NEW_LINE>if (httpStatus >= 200 && httpStatus < 300) {<NEW_LINE>logger.debug("Got the data successfully : {}", httpStatus);<NEW_LINE>return httpResponse.getEntity();<NEW_LINE>}<NEW_LINE>logger.warn("Cannot get the data from {} : {}", this.remoteRegionURL, httpStatus);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.error("Can't get a response from {}", this.remoteRegionURL, t);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>ClientResponse response = null;<NEW_LINE>try {<NEW_LINE>String urlPath = delta ? "apps/delta" : "apps/";<NEW_LINE>response = discoveryApacheClient.resource(this.remoteRegionURL + urlPath).accept(MediaType.APPLICATION_JSON_TYPE).get(ClientResponse.class);<NEW_LINE>int httpStatus = response.getStatus();<NEW_LINE>if (httpStatus >= 200 && httpStatus < 300) {<NEW_LINE>logger.debug("Got the data successfully : {}", httpStatus);<NEW_LINE>return response.getEntity(Applications.class);<NEW_LINE>}<NEW_LINE>logger.warn("Cannot get the data from {} : {}", this.remoteRegionURL, httpStatus);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>logger.error("Can't get a response from {}", this.remoteRegionURL, t);<NEW_LINE>} finally {<NEW_LINE>closeResponse(response);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
int httpStatus = httpResponse.getStatusCode();
1,070,793
private void saveUploadedFile(OwnCloudClient client) {<NEW_LINE>OCFile file = mFile;<NEW_LINE>if (file.fileExists()) {<NEW_LINE>file = getStorageManager().getFileById(file.getFileId());<NEW_LINE>}<NEW_LINE>long syncDate = System.currentTimeMillis();<NEW_LINE>file.setLastSyncDateForData(syncDate);<NEW_LINE>// new PROPFIND to keep data consistent with server<NEW_LINE>// in theory, should return the same we already have<NEW_LINE>// TODO from the appropriate OC server version, get data from last PUT response headers, instead<NEW_LINE>// TODO of a new PROPFIND; the latter may fail, specially for chunked uploads<NEW_LINE>ReadRemoteFileOperation operation = new ReadRemoteFileOperation(getRemotePath());<NEW_LINE>RemoteOperationResult<RemoteFile> result = operation.execute(client);<NEW_LINE>if (result.isSuccess()) {<NEW_LINE>updateOCFile(<MASK><NEW_LINE>file.setLastSyncDateForProperties(syncDate);<NEW_LINE>} else {<NEW_LINE>Timber.e("Error reading properties of file after successful upload; this is gonna hurt...");<NEW_LINE>}<NEW_LINE>if (mWasRenamed) {<NEW_LINE>OCFile oldFile = getStorageManager().getFileByPath(mOldFile.getRemotePath());<NEW_LINE>if (oldFile != null) {<NEW_LINE>oldFile.setStoragePath(null);<NEW_LINE>getStorageManager().saveFile(oldFile);<NEW_LINE>getStorageManager().saveConflict(oldFile, null);<NEW_LINE>}<NEW_LINE>// else: it was just an automatic renaming due to a name<NEW_LINE>// coincidence; nothing else is needed, the storagePath is right<NEW_LINE>// in the instance returned by mCurrentUpload.getFile()<NEW_LINE>}<NEW_LINE>file.setNeedsUpdateThumbnail(true);<NEW_LINE>getStorageManager().saveFile(file);<NEW_LINE>getStorageManager().saveConflict(file, null);<NEW_LINE>}
file, result.getData());
668,244
public void processFlushQuery(ControlAreYouFlushed flushQuery) throws SIResourceException {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "processFlushQuery", new Object[] { flushQuery });<NEW_LINE>SIBUuid12 streamID = flushQuery.getGuaranteedStreamUUID();<NEW_LINE>try {<NEW_LINE>// synchronize to give a consistent view of the flushed state<NEW_LINE>synchronized (this) {<NEW_LINE>SIBUuid8 requestor = flushQuery.getGuaranteedSourceMessagingEngineUUID();<NEW_LINE>if (isFlushed(streamID)) {<NEW_LINE>// It's flushed. Send a message saying as much.<NEW_LINE>downControl.sendFlushedMessage(requestor, streamID);<NEW_LINE>} else {<NEW_LINE>// Not flushed. Send a message saying as much.<NEW_LINE>downControl.sendNotFlushedMessage(requestor, streamID, flushQuery.getRequestID());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (SIResourceException e) {<NEW_LINE>// FFDC<NEW_LINE>FFDCFilter.processException(e, "com.ibm.ws.sib.processor.gd.InternalOutputStreamManager.processFlushQuery", "1:516:1.48.1.1", this);<NEW_LINE>SibTr.exception(tc, e);<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "processFlushQuery", e);<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE><MASK><NEW_LINE>}
SibTr.exit(tc, "processFlushQuery");
1,079,838
public int write(ByteBuffer buf) throws IOException {<NEW_LINE>Objects.requireNonNull(buf);<NEW_LINE>writeLock.lock();<NEW_LINE>try {<NEW_LINE>boolean blocking = isBlocking();<NEW_LINE>int n = 0;<NEW_LINE>try {<NEW_LINE>beginWrite(blocking);<NEW_LINE>n = IO_UTIL_ACCESS.write(fd<MASK><NEW_LINE>if (n == IOStatus.UNAVAILABLE && blocking) {<NEW_LINE>do {<NEW_LINE>RdmaNet.poll(fd, Net.POLLOUT, -1);<NEW_LINE>n = IO_UTIL_ACCESS.write(fd, buf, -1, nd);<NEW_LINE>} while (n == IOStatus.UNAVAILABLE && isOpen());<NEW_LINE>}<NEW_LINE>} finally {<NEW_LINE>endWrite(blocking, n > 0);<NEW_LINE>if (n <= 0 && isOutputClosed)<NEW_LINE>throw new AsynchronousCloseException();<NEW_LINE>}<NEW_LINE>return IOStatus.normalize(n);<NEW_LINE>} finally {<NEW_LINE>writeLock.unlock();<NEW_LINE>}<NEW_LINE>}
, buf, -1, nd);
1,781,762
public static int CRC(final int poly, final int init, @NonNull final byte[] data, final int offset, final int length, final boolean refin, final boolean refout, final int xorout) {<NEW_LINE>int crc = init;<NEW_LINE>for (int i = offset; i < offset + length && i < data.length; ++i) {<NEW_LINE>final byte b = data[i];<NEW_LINE>for (int j = 0; j < 8; j++) {<NEW_LINE>final int k = refin ? 7 - j : j;<NEW_LINE>final boolean bit = ((b >> (7 - k) & 1) == 1);<NEW_LINE>final boolean c15 = ((crc >> 15 & 1) == 1);<NEW_LINE>crc <<= 1;<NEW_LINE>if (c15 ^ bit)<NEW_LINE>crc ^= poly;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (refout) {<NEW_LINE>return (Integer.reverse(crc) >>> 16) ^ xorout;<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
return (crc ^ xorout) & 0xFFFF;
876,985
// shares lots of code with inot; candidate for refactoring<NEW_LINE>@Override<NEW_LINE>public Container not(final int firstOfRange, final int lastOfRange) {<NEW_LINE>// TODO: may need to convert to a RunContainer<NEW_LINE>if (firstOfRange >= lastOfRange) {<NEW_LINE>// empty range<NEW_LINE>return clone();<NEW_LINE>}<NEW_LINE>// determine the span of array indices to be affected<NEW_LINE>int startIndex = Util.unsignedBinarySearch(content, 0, cardinality, (char) firstOfRange);<NEW_LINE>if (startIndex < 0) {<NEW_LINE>startIndex = -startIndex - 1;<NEW_LINE>}<NEW_LINE>int lastIndex = Util.unsignedBinarySearch(content, 0, cardinality, (char) (lastOfRange - 1));<NEW_LINE>if (lastIndex < 0) {<NEW_LINE>lastIndex = -lastIndex - 2;<NEW_LINE>}<NEW_LINE>final int currentValuesInRange = lastIndex - startIndex + 1;<NEW_LINE>final int spanToBeFlipped = lastOfRange - firstOfRange;<NEW_LINE>final int newValuesInRange = spanToBeFlipped - currentValuesInRange;<NEW_LINE>final int cardinalityChange = newValuesInRange - currentValuesInRange;<NEW_LINE>final int newCardinality = cardinality + cardinalityChange;<NEW_LINE>if (newCardinality > DEFAULT_MAX_SIZE) {<NEW_LINE>return toBitmapContainer().not(firstOfRange, lastOfRange);<NEW_LINE>}<NEW_LINE>ArrayContainer answer = new ArrayContainer(newCardinality);<NEW_LINE>// copy stuff before the active area<NEW_LINE>System.arraycopy(content, 0, <MASK><NEW_LINE>int outPos = startIndex;<NEW_LINE>// item at inPos always >= valInRange<NEW_LINE>int inPos = startIndex;<NEW_LINE>int valInRange = firstOfRange;<NEW_LINE>for (; valInRange < lastOfRange && inPos <= lastIndex; ++valInRange) {<NEW_LINE>if ((char) valInRange != content[inPos]) {<NEW_LINE>answer.content[outPos++] = (char) valInRange;<NEW_LINE>} else {<NEW_LINE>++inPos;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (; valInRange < lastOfRange; ++valInRange) {<NEW_LINE>answer.content[outPos++] = (char) valInRange;<NEW_LINE>}<NEW_LINE>// content after the active range<NEW_LINE>for (int i = lastIndex + 1; i < cardinality; ++i) {<NEW_LINE>answer.content[outPos++] = content[i];<NEW_LINE>}<NEW_LINE>answer.cardinality = newCardinality;<NEW_LINE>return answer;<NEW_LINE>}
answer.content, 0, startIndex);
148,619
private static void simulateLookUpBufferAddress(LevelZeroContext context, LevelZeroDevice device) {<NEW_LINE>LevelZeroCommandQueue commandQueue = LevelZeroUtils.createCommandQueue(device, context);<NEW_LINE>LevelZeroCommandList commandList = LevelZeroUtils.createCommandList(device, context, commandQueue.getCommandQueueDescription().getOrdinal());<NEW_LINE>final int elements = 1;<NEW_LINE>final int bufferSize = elements * 8;<NEW_LINE>ZeDeviceMemAllocDesc deviceMemAllocDesc = new ZeDeviceMemAllocDesc();<NEW_LINE>deviceMemAllocDesc.setFlags(ZeDeviceMemAllocFlags.ZE_DEVICE_MEM_ALLOC_FLAG_BIAS_CACHED);<NEW_LINE>deviceMemAllocDesc.setOrdinal(0);<NEW_LINE>long[] output = new long[elements];<NEW_LINE>deviceHeapBuffer = new LevelZeroByteBuffer();<NEW_LINE>int result = context.zeMemAllocDevice(context.getDefaultContextPtr(), deviceMemAllocDesc, DEVICE_HEAP_SIZE, 1, device.getDeviceHandlerPtr(), deviceHeapBuffer);<NEW_LINE>LevelZeroUtils.errorLog("zeMemAllocDevice", result);<NEW_LINE>LevelZeroKernel levelZeroKernel = LevelZeroUtils.compileSPIRVKernel(device, context, "lookUp", "/tmp/lookUpBufferAddress.spv");<NEW_LINE>LevelZeroUtils.dispatchLookUpBuffer(commandList, commandQueue, levelZeroKernel, deviceHeapBuffer, output, bufferSize);<NEW_LINE>result = commandList.zeCommandListReset(commandList.getCommandListHandlerPtr());<NEW_LINE>errorLog("zeCommandListReset", result);<NEW_LINE>// Run 2nd Kernel: Execute-Copy<NEW_LINE>ByteBuffer stack = ByteBuffer.allocate(32);<NEW_LINE>stack.order(ByteOrder.LITTLE_ENDIAN);<NEW_LINE>stack.putLong(777);<NEW_LINE>stack.putLong(888);<NEW_LINE>stack.putLong(999);<NEW_LINE>stack.putLong(output[0] + 80L);<NEW_LINE>// Copy Host -> Device<NEW_LINE>result = commandList.zeCommandListAppendMemoryCopyWithOffset(commandList.getCommandListHandlerPtr(), deviceHeapBuffer, stack.array(), stack.position(), 0, 0, null, 0, null);<NEW_LINE>LevelZeroUtils.errorLog("zeCommandListAppendMemoryCopyWithOffset", result);<NEW_LINE>result = commandList.zeCommandListAppendBarrier(commandList.getCommandListHandlerPtr(<MASK><NEW_LINE>LevelZeroUtils.errorLog("zeCommandListAppendBarrier", result);<NEW_LINE>LevelZeroKernel kernelCopy = LevelZeroUtils.compileSPIRVKernel(device, context, "copyTest", "/tmp/example.spv");<NEW_LINE>long[] output2 = new long[128];<NEW_LINE>dispatchCopyKernel(commandList, commandQueue, kernelCopy, output2, 128 * Sizeof.LONG.getNumBytes(), stack);<NEW_LINE>// Free resources<NEW_LINE>errorLog("zeMemFree", result);<NEW_LINE>result = context.zeMemFree(context.getDefaultContextPtr(), deviceHeapBuffer);<NEW_LINE>errorLog("zeMemFree", result);<NEW_LINE>result = context.zeCommandListDestroy(commandList.getCommandListHandler());<NEW_LINE>errorLog("zeCommandListDestroy", result);<NEW_LINE>result = context.zeCommandQueueDestroy(commandQueue.getCommandQueueHandle());<NEW_LINE>errorLog("zeCommandQueueDestroy", result);<NEW_LINE>}
), null, 0, null);
1,814,852
public void pluginComponentAdded(PluginComponentEvent event) {<NEW_LINE>PluginComponentFactory factory = event.getPluginComponentFactory();<NEW_LINE>if (!factory.getContainer().equals(Container.CONTAINER_CONTACT_RIGHT_BUTTON_MENU))<NEW_LINE>return;<NEW_LINE>Object constraints = UIServiceImpl.getBorderLayoutConstraintsFromContainer(factory.getConstraints());<NEW_LINE>PluginComponent c = factory.getPluginComponentInstance(this);<NEW_LINE>if (c.getComponent() == null)<NEW_LINE>return;<NEW_LINE>int ix = factory.getPositionIndex();<NEW_LINE>if (constraints == null) {<NEW_LINE>if (ix != -1)<NEW_LINE>this.add((Component) c.getComponent(), ix);<NEW_LINE>else<NEW_LINE>this.add((<MASK><NEW_LINE>} else {<NEW_LINE>if (ix != -1)<NEW_LINE>this.add((Component) c.getComponent(), constraints, ix);<NEW_LINE>else<NEW_LINE>this.add((Component) c.getComponent(), constraints);<NEW_LINE>}<NEW_LINE>c.setCurrentContact(metaContact);<NEW_LINE>this.repaint();<NEW_LINE>}
Component) c.getComponent());
1,385,452
public static <T extends Runnable> List<T> readParallel(int concurrency, int batchSize, BatchNodeIterable idMapping, ParallelGraphImporter<T> importer, ExecutorService executor) {<NEW_LINE>Collection<PrimitiveIntIterable> iterators = idMapping.batchIterables(batchSize);<NEW_LINE>int threads = iterators.size();<NEW_LINE>if (!canRunInParallel(executor) || threads == 1) {<NEW_LINE>int nodeOffset = 0;<NEW_LINE>List<T> tasks = new ArrayList<>(threads);<NEW_LINE>for (PrimitiveIntIterable iterator : iterators) {<NEW_LINE>final T task = importer.newImporter(nodeOffset, iterator);<NEW_LINE>tasks.add(task);<NEW_LINE>task.run();<NEW_LINE>nodeOffset += batchSize;<NEW_LINE>}<NEW_LINE>return tasks;<NEW_LINE>} else {<NEW_LINE>List<T> tasks <MASK><NEW_LINE>int nodeOffset = 0;<NEW_LINE>for (PrimitiveIntIterable iterator : iterators) {<NEW_LINE>tasks.add(importer.newImporter(nodeOffset, iterator));<NEW_LINE>nodeOffset += batchSize;<NEW_LINE>}<NEW_LINE>runWithConcurrency(concurrency, tasks, executor);<NEW_LINE>return tasks;<NEW_LINE>}<NEW_LINE>}
= new ArrayList<>(threads);
152,350
public GateioMarketInfoWrapper deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {<NEW_LINE>Map<CurrencyPair, GateioMarketInfo> marketInfoMap = new HashMap<>();<NEW_LINE>ObjectCodec oc = jp.getCodec();<NEW_LINE>JsonNode marketsNodeWrapper = oc.readTree(jp);<NEW_LINE>JsonNode marketNodeList = marketsNodeWrapper.path("pairs");<NEW_LINE>if (marketNodeList.isArray()) {<NEW_LINE>for (JsonNode marketNode : marketNodeList) {<NEW_LINE>Iterator<Map.Entry<String, JsonNode>> iter = marketNode.fields();<NEW_LINE>if (iter.hasNext()) {<NEW_LINE>Entry<String, JsonNode> entry = iter.next();<NEW_LINE>CurrencyPair currencyPair = GateioAdapters.adaptCurrencyPair(entry.getKey());<NEW_LINE>JsonNode marketInfoData = entry.getValue();<NEW_LINE>int decimalPlaces = marketInfoData.path("decimal_places").asInt();<NEW_LINE>BigDecimal minAmount = new BigDecimal(marketInfoData.path("min_amount").asText());<NEW_LINE>BigDecimal fee = new BigDecimal(marketInfoData.path<MASK><NEW_LINE>GateioMarketInfo marketInfoObject = new GateioMarketInfo(currencyPair, decimalPlaces, minAmount, fee);<NEW_LINE>marketInfoMap.put(currencyPair, marketInfoObject);<NEW_LINE>} else {<NEW_LINE>throw new ExchangeException("Invalid market info response received from Gateio." + marketsNodeWrapper);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>throw new ExchangeException("Invalid market info response received from Gateio." + marketsNodeWrapper);<NEW_LINE>}<NEW_LINE>return new GateioMarketInfoWrapper(marketInfoMap);<NEW_LINE>}
("fee").asText());
1,405,933
public String report() {<NEW_LINE>if (true)<NEW_LINE>return "-";<NEW_LINE>StringBuffer parameter = new StringBuffer("?");<NEW_LINE>if (// don't report<NEW_LINE>getRecord_ID() == 0)<NEW_LINE>return "ID=0";<NEW_LINE>if (// new<NEW_LINE>getRecord_ID() == 1) {<NEW_LINE>parameter.append("ISSUE=");<NEW_LINE>HashMap htOut = get_HashMap();<NEW_LINE>try // deserializing in create<NEW_LINE>{<NEW_LINE>ByteArrayOutputStream bOut = new ByteArrayOutputStream();<NEW_LINE>ObjectOutput oOut = new ObjectOutputStream(bOut);<NEW_LINE>oOut.writeObject(htOut);<NEW_LINE>oOut.flush();<NEW_LINE>String hexString = Secure.convertToHexString(bOut.toByteArray());<NEW_LINE>parameter.append(hexString);<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.severe(e.getLocalizedMessage());<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>} else // existing<NEW_LINE>{<NEW_LINE>try {<NEW_LINE>parameter.append("RECORDID=").append(getRecord_ID());<NEW_LINE>parameter.append("&DBADDRESS=").append(URLEncoder.encode(getDBAddress(), "UTF-8"));<NEW_LINE>parameter.append("&COMMENTS=").append(URLEncoder.encode(getComments(), "UTF-8"));<NEW_LINE>} catch (Exception e) {<NEW_LINE>log.severe(e.getLocalizedMessage());<NEW_LINE>return "Update-" + e.getLocalizedMessage();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>InputStreamReader in = null;<NEW_LINE>String target = "http://dev1/wstore/issueReportServlet";<NEW_LINE>try // Send GET Request<NEW_LINE>{<NEW_LINE>StringBuffer urlString = new StringBuffer(target).append(parameter);<NEW_LINE>URL url = new URL(urlString.toString());<NEW_LINE>URLConnection uc = url.openConnection();<NEW_LINE>in = new InputStreamReader(uc.getInputStream());<NEW_LINE>} catch (Exception e) {<NEW_LINE>String msg = "Cannot connect to http://" + target;<NEW_LINE>if (e instanceof FileNotFoundException || e instanceof ConnectException)<NEW_LINE>msg += "\nServer temporarily down - Please try again later";<NEW_LINE>else {<NEW_LINE>msg += "\nCheck connection - " + e.getLocalizedMessage();<NEW_LINE>log.log(Level.FINE, msg);<NEW_LINE>}<NEW_LINE>return msg;<NEW_LINE>}<NEW_LINE>return readResponse(in);<NEW_LINE>}
return "New-" + e.getLocalizedMessage();
1,367,554
public void open(Map<String, Object> config, SinkContext sinkContext) throws Exception {<NEW_LINE><MASK><NEW_LINE>jdbcUrl = jdbcSinkConfig.getJdbcUrl();<NEW_LINE>if (jdbcSinkConfig.getJdbcUrl() == null) {<NEW_LINE>throw new IllegalArgumentException("Required jdbc Url not set.");<NEW_LINE>}<NEW_LINE>Properties properties = new Properties();<NEW_LINE>String username = jdbcSinkConfig.getUserName();<NEW_LINE>String password = jdbcSinkConfig.getPassword();<NEW_LINE>if (username != null) {<NEW_LINE>properties.setProperty("user", username);<NEW_LINE>}<NEW_LINE>if (password != null) {<NEW_LINE>properties.setProperty("password", password);<NEW_LINE>}<NEW_LINE>Class.forName(JdbcUtils.getDriverClassName(jdbcSinkConfig.getJdbcUrl()));<NEW_LINE>connection = DriverManager.getConnection(jdbcSinkConfig.getJdbcUrl(), properties);<NEW_LINE>connection.setAutoCommit(false);<NEW_LINE>log.info("Opened jdbc connection: {}, autoCommit: {}", jdbcUrl, connection.getAutoCommit());<NEW_LINE>tableName = jdbcSinkConfig.getTableName();<NEW_LINE>tableId = JdbcUtils.getTableId(connection, tableName);<NEW_LINE>// Init PreparedStatement include insert, delete, update<NEW_LINE>initStatement();<NEW_LINE>int timeoutMs = jdbcSinkConfig.getTimeoutMs();<NEW_LINE>batchSize = jdbcSinkConfig.getBatchSize();<NEW_LINE>incomingList = Lists.newArrayList();<NEW_LINE>swapList = Lists.newArrayList();<NEW_LINE>isFlushing = new AtomicBoolean(false);<NEW_LINE>flushExecutor = Executors.newScheduledThreadPool(1);<NEW_LINE>flushExecutor.scheduleAtFixedRate(this::flush, timeoutMs, timeoutMs, TimeUnit.MILLISECONDS);<NEW_LINE>}
jdbcSinkConfig = JdbcSinkConfig.load(config);
53,810
public void updatePlugins(final boolean force) {<NEW_LINE>// do nothing if updates are disabled<NEW_LINE>if (mUpdateInterval == 0 && !force)<NEW_LINE>return;<NEW_LINE>// check last script update<NEW_LINE>final long lastUpdated = mPrefs.getLong("pref_last_plugin_update", 0);<NEW_LINE>final long now = System.currentTimeMillis();<NEW_LINE>// return if no update wanted<NEW_LINE>if ((now - lastUpdated < mUpdateInterval) && !force)<NEW_LINE>return;<NEW_LINE>// get the plugin preferences<NEW_LINE>final TreeMap<String, ?> all_prefs = new TreeMap<String, Object>(mPrefs.getAll());<NEW_LINE>// iterate through all plugins<NEW_LINE>for (final Map.Entry<String, ?> entry : all_prefs.entrySet()) {<NEW_LINE>final <MASK><NEW_LINE>if (plugin.endsWith(".user.js") && entry.getValue().toString().equals("true")) {<NEW_LINE>if (plugin.startsWith(PLUGINS_PATH)) {<NEW_LINE>new UpdateScript(mActivity).execute(plugin);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>mPrefs.edit().putLong("pref_last_plugin_update", now).commit();<NEW_LINE>}
String plugin = entry.getKey();
152,091
public ServerRequestInterceptor createServerRequestInterceptor(ORBInitInfo info, Codec codec) {<NEW_LINE>ServerRequestInterceptor ret = null;<NEW_LINE>try {<NEW_LINE>if (!penv.getProcessType().isServer()) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (altSecFactory != null || (interceptorFactory != null && createAlternateSecurityInterceptorFactory())) {<NEW_LINE>ret = altSecFactory.getServerRequestInterceptor(codec);<NEW_LINE>} else {<NEW_LINE>ret = getServerInterceptorInstance(codec);<NEW_LINE>}<NEW_LINE>// also register the IOR Interceptor here<NEW_LINE>if (info instanceof com.sun.corba.ee.spi.legacy.interceptor.ORBInitInfoExt) {<NEW_LINE>com.sun.corba.ee.spi.legacy.interceptor.ORBInitInfoExt infoExt = (com.sun.corba.ee.spi<MASK><NEW_LINE>IORInterceptor secIOR = getSecIORInterceptorInstance(codec, infoExt.getORB());<NEW_LINE>info.add_ior_interceptor(secIOR);<NEW_LINE>}<NEW_LINE>} catch (DuplicateName ex) {<NEW_LINE>_logger.log(Level.SEVERE, null, ex);<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
.legacy.interceptor.ORBInitInfoExt) info;
929,838
public void runInternal() {<NEW_LINE>int partitionId = getPartitionId();<NEW_LINE>Indexes indexes = mapContainer.getIndexes(partitionId);<NEW_LINE>InternalIndex index = indexes.addOrGetIndex(config);<NEW_LINE>if (index.hasPartitionIndexed(partitionId)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>SerializationService serializationService = getNodeEngine().getSerializationService();<NEW_LINE>index.beginPartitionUpdate();<NEW_LINE>CacheDeserializedValues cacheDeserializedValues = mapContainer.getMapConfig().getCacheDeserializedValues();<NEW_LINE>CachedQueryEntry<?, ?> cachedEntry = cacheDeserializedValues == NEVER ? new CachedQueryEntry<>(serializationService, mapContainer.getExtractors()) : null;<NEW_LINE>recordStore.forEach((dataKey, record) -> {<NEW_LINE>Object value = Records.getValueOrCachedValue(record, serializationService);<NEW_LINE>QueryableEntry<?, ?> queryEntry = mapContainer.newQueryEntry(dataKey, value);<NEW_LINE>queryEntry.setRecord(record);<NEW_LINE>CachedQueryEntry<?, ?> newEntry = cachedEntry == null ? (CachedQueryEntry<?, ?>) queryEntry : cachedEntry.init(dataKey, value);<NEW_LINE>index.putEntry(newEntry, null, <MASK><NEW_LINE>}, false);<NEW_LINE>index.markPartitionAsIndexed(partitionId);<NEW_LINE>}
queryEntry, Index.OperationSource.USER);
906,177
public void eval(Context context) {<NEW_LINE>Object object = context.parent == null ? context<MASK><NEW_LINE>if (object instanceof java.util.List) {<NEW_LINE>List list = (List) object;<NEW_LINE>if (list.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// lazy init for graalvm<NEW_LINE>if (random == null) {<NEW_LINE>random = new Random();<NEW_LINE>}<NEW_LINE>int randomIndex = Math.abs(random.nextInt()) % list.size();<NEW_LINE>context.value = list.get(randomIndex);<NEW_LINE>context.eval = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (object instanceof Object[]) {<NEW_LINE>Object[] array = (Object[]) object;<NEW_LINE>if (array.length == 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// lazy init for graalvm<NEW_LINE>if (random == null) {<NEW_LINE>random = new Random();<NEW_LINE>}<NEW_LINE>int randomIndex = random.nextInt() % array.length;<NEW_LINE>context.value = array[randomIndex];<NEW_LINE>context.eval = true;<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>throw new JSONException("TODO");<NEW_LINE>}
.root : context.parent.value;
426,996
private void sortConstructorsIntoLists(JApiClass jApiClass, Map<String, CtConstructor> oldConstructorsMap, Map<String, CtConstructor> newConstructorsMap) {<NEW_LINE>MethodDescriptorParser methodDescriptorParser = new MethodDescriptorParser();<NEW_LINE>for (CtConstructor ctMethod : oldConstructorsMap.values()) {<NEW_LINE>String longName = ctMethod.getLongName();<NEW_LINE>methodDescriptorParser.parse(ctMethod.getSignature());<NEW_LINE>CtConstructor foundMethod = newConstructorsMap.get(longName);<NEW_LINE>if (foundMethod == null) {<NEW_LINE>JApiConstructor jApiConstructor = new JApiConstructor(jApiClass, ctMethod.getName(), JApiChangeStatus.REMOVED, Optional.of(ctMethod), Optional.<CtConstructor>absent(), jarArchiveComparator);<NEW_LINE>addParametersToMethod(methodDescriptorParser, jApiConstructor);<NEW_LINE>if (includeConstructor(jApiConstructor)) {<NEW_LINE>constructors.add(jApiConstructor);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>JApiConstructor jApiConstructor = new JApiConstructor(jApiClass, ctMethod.getName(), JApiChangeStatus.UNCHANGED, Optional.of(ctMethod), Optional.of(foundMethod), jarArchiveComparator);<NEW_LINE>addParametersToMethod(methodDescriptorParser, jApiConstructor);<NEW_LINE>if (includeConstructor(jApiConstructor)) {<NEW_LINE>constructors.add(jApiConstructor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (CtConstructor ctMethod : newConstructorsMap.values()) {<NEW_LINE>String longName = ctMethod.getLongName();<NEW_LINE>methodDescriptorParser.<MASK><NEW_LINE>CtConstructor foundMethod = oldConstructorsMap.get(longName);<NEW_LINE>if (foundMethod == null) {<NEW_LINE>JApiConstructor jApiConstructor = new JApiConstructor(jApiClass, ctMethod.getName(), JApiChangeStatus.NEW, Optional.<CtConstructor>absent(), Optional.of(ctMethod), jarArchiveComparator);<NEW_LINE>addParametersToMethod(methodDescriptorParser, jApiConstructor);<NEW_LINE>if (includeConstructor(jApiConstructor)) {<NEW_LINE>constructors.add(jApiConstructor);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
parse(ctMethod.getSignature());
1,667,958
public static Builder fromEnv() throws DockerCertificateException {<NEW_LINE>final String endpoint = DockerHost.endpointFromEnv();<NEW_LINE>final Path dockerCertPath = Paths.get(Iterables.find(Arrays.asList(DockerHost.certPathFromEnv(), DockerHost.configPathFromEnv(), DockerHost.defaultCertPath()), Predicates.notNull()));<NEW_LINE>final Builder builder = new Builder();<NEW_LINE>final Optional<DockerCertificatesStore> certs = DockerCertificates.builder().dockerCertPath(dockerCertPath).build();<NEW_LINE>if (endpoint.startsWith(UNIX_SCHEME + "://")) {<NEW_LINE>builder.uri(endpoint);<NEW_LINE>} else if (endpoint.startsWith(NPIPE_SCHEME + "://")) {<NEW_LINE>builder.uri(endpoint);<NEW_LINE>} else {<NEW_LINE>final String stripped = endpoint.replaceAll(".*://", "");<NEW_LINE>final HostAndPort hostAndPort = HostAndPort.fromString(stripped);<NEW_LINE>final <MASK><NEW_LINE>final String scheme = certs.isPresent() ? "https" : "http";<NEW_LINE>final int port = hostAndPort.getPortOrDefault(DockerHost.defaultPort());<NEW_LINE>final String address = isNullOrEmpty(hostText) ? DockerHost.defaultAddress() : hostText;<NEW_LINE>builder.uri(scheme + "://" + address + ":" + port);<NEW_LINE>}<NEW_LINE>if (certs.isPresent()) {<NEW_LINE>builder.dockerCertificates(certs.get());<NEW_LINE>}<NEW_LINE>return builder;<NEW_LINE>}
String hostText = hostAndPort.getHost();
699,744
public static PRCurve generatePRCurve(boolean[] yPos, double[] yScore) {<NEW_LINE>TPFP tpfp = generateTPFPs(yPos, yScore);<NEW_LINE>ArrayList<Double> precisions = new ArrayList<>(tpfp.falsePos.size());<NEW_LINE>ArrayList<Double> recalls = new ArrayList<>(<MASK><NEW_LINE>ArrayList<Double> thresholds = new ArrayList<>(tpfp.falsePos.size());<NEW_LINE>for (int i = 0; i < tpfp.falsePos.size(); i++) {<NEW_LINE>double curFalsePos = tpfp.falsePos.get(i);<NEW_LINE>double curTruePos = tpfp.truePos.get(i);<NEW_LINE>double precision = 0.0;<NEW_LINE>double recall = 0.0;<NEW_LINE>if (curTruePos != 0) {<NEW_LINE>precision = curTruePos / (curTruePos + curFalsePos);<NEW_LINE>recall = curTruePos / tpfp.totalPos;<NEW_LINE>}<NEW_LINE>precisions.add(precision);<NEW_LINE>recalls.add(recall);<NEW_LINE>thresholds.add(tpfp.thresholds.get(i));<NEW_LINE>// Break out if we've achieved full recall.<NEW_LINE>if (curTruePos == tpfp.totalPos) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Collections.reverse(precisions);<NEW_LINE>Collections.reverse(recalls);<NEW_LINE>Collections.reverse(thresholds);<NEW_LINE>precisions.add(1.0);<NEW_LINE>recalls.add(0.0);<NEW_LINE>return new PRCurve(Util.toPrimitiveDouble(precisions), Util.toPrimitiveDouble(recalls), Util.toPrimitiveDouble(thresholds));<NEW_LINE>}
tpfp.falsePos.size());
158,160
public int decode(DecodingContext context, ByteBufferView buffer) {<NEW_LINE>byte[] payload = new byte[buffer.remaining()];<NEW_LINE>buffer.get(payload);<NEW_LINE>try (BEParser parser = new BEParser(payload)) {<NEW_LINE>BEMap m = parser.readMap();<NEW_LINE>int length = m.getContent().length;<NEW_LINE>UtMetadata.Type messageType = getMessageType(m);<NEW_LINE>int pieceIndex = getPieceIndex(m);<NEW_LINE>switch(messageType) {<NEW_LINE>case REQUEST:<NEW_LINE>{<NEW_LINE>context.setMessage(UtMetadata.request(pieceIndex));<NEW_LINE>return length;<NEW_LINE>}<NEW_LINE>case DATA:<NEW_LINE>{<NEW_LINE>byte[] data = Arrays.copyOfRange(payload, length, payload.length);<NEW_LINE>context.setMessage(UtMetadata.data(pieceIndex, getTotalSize(m), data));<NEW_LINE>return payload.length;<NEW_LINE>}<NEW_LINE>case REJECT:<NEW_LINE>{<NEW_LINE>context.setMessage(UtMetadata.reject(pieceIndex));<NEW_LINE>return length;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>{<NEW_LINE>throw new IllegalStateException(<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
"Unknown message type: " + messageType.name());
305,730
public OUpdateStatement copy() {<NEW_LINE>OUpdateStatement result = null;<NEW_LINE>try {<NEW_LINE>result = getClass().getConstructor(Integer.TYPE).newInstance(-1);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(e);<NEW_LINE>}<NEW_LINE>result.target = target == null ? null : target.copy();<NEW_LINE>result.operations = operations == null ? null : operations.stream().map(x -> x.copy()).collect(Collectors.toList());<NEW_LINE>result.upsert = upsert;<NEW_LINE>result.returnBefore = returnBefore;<NEW_LINE>result.returnAfter = returnAfter;<NEW_LINE>result.returnProjection = returnProjection == null ? null : returnProjection.copy();<NEW_LINE>result.whereClause = whereClause == null <MASK><NEW_LINE>result.lockRecord = lockRecord;<NEW_LINE>result.limit = limit == null ? null : limit.copy();<NEW_LINE>result.timeout = timeout == null ? null : timeout.copy();<NEW_LINE>return result;<NEW_LINE>}
? null : whereClause.copy();
780,186
void processArguments() throws Exception {<NEW_LINE>super.processArguments();<NEW_LINE>boolean usesSetters = (null != tenant || <MASK><NEW_LINE>boolean usesFqfn = (null != fqfn);<NEW_LINE>// Throw an exception if --fqfn is set alongside any combination of --tenant, --namespace, and --name<NEW_LINE>if (usesFqfn && usesSetters) {<NEW_LINE>throw new RuntimeException("You must specify either a Fully Qualified Function Name (FQFN) " + "or tenant, namespace, and function name");<NEW_LINE>} else if (usesFqfn) {<NEW_LINE>// If the --fqfn flag is used, parse tenant, namespace, and name using that flag<NEW_LINE>String[] fqfnParts = fqfn.split("/");<NEW_LINE>if (fqfnParts.length != 3) {<NEW_LINE>throw new RuntimeException("Fully qualified function names (FQFNs) must be of the form tenant/namespace/name");<NEW_LINE>}<NEW_LINE>tenant = fqfnParts[0];<NEW_LINE>namespace = fqfnParts[1];<NEW_LINE>functionName = fqfnParts[2];<NEW_LINE>} else {<NEW_LINE>if (tenant == null) {<NEW_LINE>tenant = PUBLIC_TENANT;<NEW_LINE>}<NEW_LINE>if (namespace == null) {<NEW_LINE>namespace = DEFAULT_NAMESPACE;<NEW_LINE>}<NEW_LINE>if (null == functionName) {<NEW_LINE>throw new RuntimeException("You must specify a name for the function or a Fully Qualified Function Name (FQFN)");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
null != namespace || null != functionName);
655,732
public String put(String key, long contentLength, UploadStreamProvider payload) throws IOException {<NEW_LINE>checkArgument(key != null, "key is null");<NEW_LINE>ObjectMetadata meta = new ObjectMetadata();<NEW_LINE>meta.setContentLength(contentLength);<NEW_LINE>try {<NEW_LINE>return uploadRetryExecutor().onRetry((exception, retryCount, retryLimit, retryWait) -> {<NEW_LINE>logger.warn("Retrying uploading file bucket " + bucket + " key " + key + " error: " + exception);<NEW_LINE>}).retryIf((exception) -> {<NEW_LINE>if (exception instanceof IOException || exception instanceof InterruptedException) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}).runInterruptible(() -> {<NEW_LINE>try (InputStream in = payload.open()) {<NEW_LINE>PutObjectRequest req = new PutObjectRequest(<MASK><NEW_LINE>UploadResult result = transferManager.upload(req).waitForUploadResult();<NEW_LINE>return result.getETag();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>throw ThrowablesUtil.propagate(ex);<NEW_LINE>} catch (RetryGiveupException ex) {<NEW_LINE>Throwable cause = ex.getCause();<NEW_LINE>ThrowablesUtil.propagateIfInstanceOf(cause, IOException.class);<NEW_LINE>throw ThrowablesUtil.propagate(cause);<NEW_LINE>}<NEW_LINE>}
bucket, key, in, meta);
1,310,667
public void run(MessageReply reply) {<NEW_LINE>if (reply.isSuccess()) {<NEW_LINE>logger.info(String.format("Deleted volume %s in Trash.", inv.getInstallPath()));<NEW_LINE>IncreasePrimaryStorageCapacityMsg imsg = new IncreasePrimaryStorageCapacityMsg();<NEW_LINE>imsg.setPrimaryStorageUuid(self.getUuid());<NEW_LINE>imsg.setDiskSize(inv.getSize());<NEW_LINE>bus.makeTargetServiceIdByResourceUuid(imsg, PrimaryStorageConstant.SERVICE_ID, self.getUuid());<NEW_LINE>bus.send(imsg);<NEW_LINE>trash.removeFromDb(trashId);<NEW_LINE>logger.info(String.format("Returned space[size:%s] to PS %s after volume migration", inv.getSize(), self.getUuid()));<NEW_LINE>result.setSize(inv.getSize());<NEW_LINE>result.setResourceUuids(CollectionDSL.list(inv.getResourceUuid()));<NEW_LINE>completion.success(result);<NEW_LINE>} else {<NEW_LINE>logger.warn(String.format("Failed to delete volume %s in Trash, because: %s", inv.getInstallPath(), reply.getError().getDetails()));<NEW_LINE>if ("LocalStorage".equals(self.getType()) && inv.getHostUuid() == null) {<NEW_LINE>// to compatible old version(they did not record hostUuid)<NEW_LINE>result.setSize(0L);<NEW_LINE>result.setResourceUuids(CollectionDSL.list(inv.getResourceUuid()));<NEW_LINE>trash.removeFromDb(trashId);<NEW_LINE>completion.success(result);<NEW_LINE>} else {<NEW_LINE>completion.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
fail(reply.getError());
1,217,325
public static void mergeDesignMatrices(final List<AltSiteRecord> altDesignMatrix, List<AltSiteRecord> altDesignMatrixRevComp) {<NEW_LINE>if (altDesignMatrix.isEmpty() && altDesignMatrixRevComp.isEmpty()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Order matters here. Assumes that all elements in the list have the same reference context<NEW_LINE>Utils.validateArg(altDesignMatrix.isEmpty() || F1R2FilterConstants.CANONICAL_KMERS.contains(altDesignMatrix.get(0).getReferenceContext()), "altDesignMatrix must have the canonical representation");<NEW_LINE>final Optional<String> refContext = altDesignMatrix.isEmpty() ? Optional.empty() : Optional.of(altDesignMatrix.get(0).getReferenceContext());<NEW_LINE>final Optional<String> revCompContext = altDesignMatrixRevComp.isEmpty() ? Optional.empty() : Optional.of(altDesignMatrixRevComp.get(0).getReferenceContext());<NEW_LINE>// If the matrices aren't empty, their reference context much be the reverse complement of each other<NEW_LINE>if (refContext.isPresent() && revCompContext.isPresent()) {<NEW_LINE>Utils.validateArg(refContext.get().equals(SequenceUtil.reverseComplement(revCompContext.get())), "ref context and its rev comp don't match");<NEW_LINE>}<NEW_LINE>altDesignMatrix.addAll(altDesignMatrixRevComp.stream().map(AltSiteRecord::getReverseComplementOfRecord).collect<MASK><NEW_LINE>}
(Collectors.toList()));
1,773,486
public void log(TraceComponent tc) {<NEW_LINE>Tr.debug(tc, MessageFormat.format("Delayed Class [ {0} ]", getHashText()));<NEW_LINE>Tr.debug(tc, MessageFormat.format(" classInfo [ {0} ]", ((classInfo != null) ? classInfo.getHashText() : null)));<NEW_LINE>Tr.debug(tc, MessageFormat.format(" isArtificial [ {0} ]", Boolean.valueOf(isArtificial)));<NEW_LINE>// only write out the remainder of the messages if 'all' trace is enabled<NEW_LINE>if (!tc.isDumpEnabled()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isModifiersSet [ {0} ]", Boolean.valueOf(isModifiersSet)));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" modifiers [ {0} ]", Integer.valueOf(modifiers)));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" packageName [ {0} ]", packageName));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" packageInfo [ {0} ]", ((packageInfo != null) ? packageInfo.getHashText() : null)));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isJavaClass [ {0} ]", Boolean.valueOf(isJavaClass)));<NEW_LINE>if (interfaceNames != null) {<NEW_LINE>for (String interfaceName : interfaceNames) {<NEW_LINE>Tr.dump(tc, MessageFormat.format(" [ {0} ]", interfaceName));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isInterface [ {0} ]", isInterface));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isAnnotationClass [ {0} ]", isAnnotationClass));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" superclassName [ {0} ]", superclassName));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" superclass [ {0} ]", ((superclass != null) ? superclass.getHashText() : null)));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isEmptyDeclaredFields [ {0} ]", isEmptyDeclaredFields));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isEmptyDeclaredConstructors [ {0} ]", isEmptyDeclaredConstructors));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isEmptyDeclaredMethods [ {0} ]", isEmptyDeclaredMethods));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isEmptyMethods [ {0} ]", isEmptyMethods));<NEW_LINE>Tr.dump(tc, MessageFormat<MASK><NEW_LINE>Tr.dump(tc, MessageFormat.format(" isAnnotationPresent [ {0} ]", isAnnotationPresent));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isFieldAnnotationPresent [ {0} ]", isFieldAnnotationPresent));<NEW_LINE>Tr.dump(tc, MessageFormat.format(" isMethodAnnotationPresent [ {0} ]", isMethodAnnotationPresent));<NEW_LINE>// Don't log the underlying non-delayed class.<NEW_LINE>// Don't log the annotations.<NEW_LINE>}
.format(" isDeclaredAnnotationPresent [ {0} ]", isDeclaredAnnotationPresent));
1,573,820
public TranslationData load(ResourceUrn urn, List<AssetDataFile> inputs) throws IOException {<NEW_LINE>if (inputs.size() != 1) {<NEW_LINE>throw new IOException("Failed to load translation data '" + urn + "': " + inputs);<NEW_LINE>}<NEW_LINE>AssetDataFile file = inputs.get(0);<NEW_LINE>Locale locale = localeFromFilename(file.getFilename());<NEW_LINE>Name projName = <MASK><NEW_LINE>ResourceUrn projUrn = new ResourceUrn(urn.getModuleName(), projName);<NEW_LINE>TranslationData data = new TranslationData(projUrn, locale);<NEW_LINE>try (InputStreamReader isr = new InputStreamReader(file.openStream(), Charsets.UTF_8)) {<NEW_LINE>Map<String, String> entry = gson.fromJson(isr, MAP_TOKEN.getType());<NEW_LINE>data.addAll(entry);<NEW_LINE>} catch (JsonParseException e) {<NEW_LINE>throw new IOException("Could not parse file '" + file + "'", e);<NEW_LINE>}<NEW_LINE>return data;<NEW_LINE>}
basenameFromFilename(file.getFilename());
1,079,002
public SModelMergerPluginConfiguration convertToSObject(ModelMergerPluginConfiguration input) {<NEW_LINE>if (input == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>SModelMergerPluginConfiguration result = new SModelMergerPluginConfiguration();<NEW_LINE>result.setOid(input.getOid());<NEW_LINE>result.setUuid(input.getUuid());<NEW_LINE>result.setRid(input.getRid());<NEW_LINE>result.setName(input.getName());<NEW_LINE>result.<MASK><NEW_LINE>result.setDescription(input.getDescription());<NEW_LINE>PluginDescriptor pluginDescriptorVal = input.getPluginDescriptor();<NEW_LINE>result.setPluginDescriptorId(pluginDescriptorVal == null ? -1 : pluginDescriptorVal.getOid());<NEW_LINE>ObjectType settingsVal = input.getSettings();<NEW_LINE>result.setSettingsId(settingsVal == null ? -1 : settingsVal.getOid());<NEW_LINE>UserSettings userSettingsVal = input.getUserSettings();<NEW_LINE>result.setUserSettingsId(userSettingsVal == null ? -1 : userSettingsVal.getOid());<NEW_LINE>return result;<NEW_LINE>}
setEnabled(input.getEnabled());
1,119,161
public void onReceive(Context context, Intent intent) {<NEW_LINE><MASK><NEW_LINE>ConvData convData = new ConvData(intent);<NEW_LINE>PendingIntent openConv = intent.getParcelableExtra("openConvPendingIntent");<NEW_LINE>NotificationCompat.Builder repliedNotification = new NotificationCompat.Builder(context, KeybasePushNotificationListenerService.CHAT_CHANNEL_ID).setContentIntent(openConv).setTimeoutAfter(1000).setSmallIcon(R.drawable.ic_notif);<NEW_LINE>NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context);<NEW_LINE>String messageBody = getMessageText(intent);<NEW_LINE>if (messageBody != null) {<NEW_LINE>try {<NEW_LINE>WithBackgroundActive withBackgroundActive = () -> Keybase.handlePostTextReply(convData.convID, convData.tlfName, convData.lastMsgId, messageBody);<NEW_LINE>withBackgroundActive.whileActive(context);<NEW_LINE>repliedNotification.setContentText("Replied");<NEW_LINE>} catch (Exception e) {<NEW_LINE>repliedNotification.setContentText("Couldn't send reply");<NEW_LINE>NativeLogger.error("Failed to send quick reply", e);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>repliedNotification.setContentText("Couldn't send reply - Failed to read input.");<NEW_LINE>NativeLogger.error("Message Body in quick reply was null");<NEW_LINE>}<NEW_LINE>notificationManager.notify(convData.convID, 0, repliedNotification.build());<NEW_LINE>}
MainActivity.setupKBRuntime(context, false);
1,470,159
private static void printResult(RenderingRuleSearchRequest searchRequest, PrintStream out) {<NEW_LINE>if (searchRequest.isFound()) {<NEW_LINE>out.print(" Found : ");<NEW_LINE>for (RenderingRuleProperty rp : searchRequest.getProperties()) {<NEW_LINE>if (rp.isOutputProperty() && searchRequest.isSpecified(rp)) {<NEW_LINE>out.print(" " + rp.getAttrName() + "= ");<NEW_LINE>if (rp.isString()) {<NEW_LINE>out.print("\"" + searchRequest.getStringPropertyValue(rp) + "\"");<NEW_LINE>} else if (rp.isFloat()) {<NEW_LINE>out.print(searchRequest.getFloatPropertyValue(rp));<NEW_LINE>} else if (rp.isColor()) {<NEW_LINE>out.print<MASK><NEW_LINE>} else if (rp.isIntParse()) {<NEW_LINE>out.print(searchRequest.getIntPropertyValue(rp));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>out.println("Not found");<NEW_LINE>}<NEW_LINE>}
(searchRequest.getColorStringPropertyValue(rp));
669,199
private void buildMenu(Shell parent) {<NEW_LINE>// The Main Menu<NEW_LINE>menuBar = parent.getDisplay().getMenuBar();<NEW_LINE>if (menuBar == null) {<NEW_LINE>menuBar = new <MASK><NEW_LINE>parent.setMenuBar(menuBar);<NEW_LINE>} else {<NEW_LINE>Utils.disposeSWTObjects((Object[]) menuBar.getItems());<NEW_LINE>}<NEW_LINE>addFileMenu();<NEW_LINE>// addViewMenu();<NEW_LINE>addSimpleViewMenu();<NEW_LINE>addCommunityMenu();<NEW_LINE>addToolsMenu();<NEW_LINE>if (COConfigurationManager.getBooleanParameter("show_torrents_menu")) {<NEW_LINE>addTorrentMenu();<NEW_LINE>}<NEW_LINE>if (!Constants.isWindows) {<NEW_LINE>addWindowMenu();<NEW_LINE>}<NEW_LINE>// ===== Debug menu (development only)====<NEW_LINE>if (com.biglybt.core.util.Constants.isCVSVersion()) {<NEW_LINE>final Menu menuDebug = com.biglybt.ui.swt.mainwindow.DebugMenuHelper.createDebugMenuItem(menuBar);<NEW_LINE>menuDebug.addMenuListener(new MenuListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void menuShown(MenuEvent e) {<NEW_LINE>MenuItem[] items = menuDebug.getItems();<NEW_LINE>Utils.disposeSWTObjects(items);<NEW_LINE>DebugMenuHelper.createDebugMenuItem(menuDebug);<NEW_LINE>MenuFactory.addSeparatorMenuItem(menuDebug);<NEW_LINE>MenuItem menuItem = new MenuItem(menuDebug, SWT.PUSH);<NEW_LINE>menuItem.setText("Log Views");<NEW_LINE>menuItem.setEnabled(false);<NEW_LINE>PluginsMenuHelper.buildPluginLogsMenu(menuDebug);<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void menuHidden(MenuEvent e) {<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>addV3HelpMenu();<NEW_LINE>MenuFactory.updateEnabledStates(menuBar);<NEW_LINE>}
Menu(parent, SWT.BAR);
108,973
public static int[][][][] swallowCopy(int[][][][] arr) {<NEW_LINE>int s0 = arr.length;<NEW_LINE>int[][][][] copy = new int[s0][][][];<NEW_LINE>for (int i = s0 - 1; i >= 0; i--) {<NEW_LINE>int s1 = arr[i].length;<NEW_LINE>copy[i] = new int[s1][][];<NEW_LINE>for (int j = s1 - 1; j >= 0; j--) {<NEW_LINE>int s2 = arr[i][j].length;<NEW_LINE>copy[i][j] = new int[s2][];<NEW_LINE>for (int k = s2 - 1; k >= 0; k--) {<NEW_LINE>int s3 = arr[i]<MASK><NEW_LINE>copy[i][j][k] = new int[s3];<NEW_LINE>System.arraycopy(arr[i][j][k], 0, copy[i][j][k], 0, s3);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return copy;<NEW_LINE>}
[j][k].length;
1,255,518
public void initialize(Context context) {<NEW_LINE>QuizQuestion q1 = new QuizQuestion(1, context.getString(R.string.quiz_question_string), URL_FOR_SELFIE, false, context.getString(R.string.selfie_answer));<NEW_LINE>quiz.add(q1);<NEW_LINE>QuizQuestion q2 = new QuizQuestion(2, context.getString(R.string.quiz_question_string), URL_FOR_TAJ_MAHAL, true, context.getString(R.string.taj_mahal_answer));<NEW_LINE>quiz.add(q2);<NEW_LINE>QuizQuestion q3 = new QuizQuestion(3, context.getString(R.string.quiz_question_string), URL_FOR_BLURRY_IMAGE, false, context.getString<MASK><NEW_LINE>quiz.add(q3);<NEW_LINE>QuizQuestion q4 = new QuizQuestion(4, context.getString(R.string.quiz_screenshot_question), URL_FOR_SCREENSHOT, false, context.getString(R.string.screenshot_answer));<NEW_LINE>quiz.add(q4);<NEW_LINE>QuizQuestion q5 = new QuizQuestion(5, context.getString(R.string.quiz_question_string), URL_FOR_EVENT, true, context.getString(R.string.construction_event_answer));<NEW_LINE>quiz.add(q5);<NEW_LINE>}
(R.string.blurry_image_answer));
896,650
private Optional<Money> computeFreightRate(final I_C_Order salesOrder) {<NEW_LINE>if (!salesOrder.isSOTrx()) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>if (salesOrder.getC_BPartner_ID() <= 0) {<NEW_LINE>// order is not yet completely set up<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final FreightCostContext freightCostContext = extractFreightCostContext(salesOrder);<NEW_LINE>if (freightCostService.checkIfFree(freightCostContext)) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final FreightCostRule freightCostRule = freightCostContext.getFreightCostRule();<NEW_LINE>if (freightCostRule == FreightCostRule.FlatShippingFee) {<NEW_LINE>final OrderId orderId = OrderId.ofRepoIdOrNull(salesOrder.getC_Order_ID());<NEW_LINE>final Money shipmentValueAmt = orderId != null ? computeShipmentValueAmt(orderId).orElse(null) : null;<NEW_LINE>if (shipmentValueAmt == null) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>final FreightCost freightCost = freightCostService.findBestMatchingFreightCost(freightCostContext);<NEW_LINE>final Money freightRate = freightCost.getFreightRate(freightCostContext.getShipperId(), freightCostContext.getShipToCountryId(), freightCostContext.getDate(), shipmentValueAmt);<NEW_LINE>return Optional.of(freightRate);<NEW_LINE>} else if (freightCostRule == FreightCostRule.FixPrice) {<NEW_LINE>// get the 'freightcost' product and return its price<NEW_LINE>final FreightCost freightCost = freightCostService.findBestMatchingFreightCost(freightCostContext);<NEW_LINE>final Money freightAmt = freightCostContext.getManualFreightAmt();<NEW_LINE>if (freightAmt != null) {<NEW_LINE>return Optional.of(freightAmt);<NEW_LINE>}<NEW_LINE>final IEditablePricingContext pricingContext = pricingBL.createInitialContext(freightCost.getOrgId().getRepoId(), freightCost.getFreightCostProductId().getRepoId(), freightCostContext.getShipToBPartnerId().getRepoId(), 0, BigDecimal.ONE, SOTrx.SALES.toBoolean());<NEW_LINE>final CountryId countryId = getCountryIdOrNull(salesOrder);<NEW_LINE>pricingContext.setCountryId(countryId);<NEW_LINE>pricingContext.setFailIfNotCalculated();<NEW_LINE>pricingContext.setPricingSystemId(PricingSystemId.ofRepoIdOrNull(salesOrder.getM_PricingSystem_ID()));<NEW_LINE>pricingContext.setPriceListId(PriceListId.ofRepoIdOrNull<MASK><NEW_LINE>pricingContext.setCurrencyId(CurrencyId.ofRepoId(salesOrder.getC_Currency_ID()));<NEW_LINE>final IPricingResult pricingResult = pricingBL.calculatePrice(pricingContext);<NEW_LINE>final Money freightRate = Money.of(pricingResult.getPriceStd(), pricingResult.getCurrencyId());<NEW_LINE>return Optional.of(freightRate);<NEW_LINE>} else {<NEW_LINE>logger.debug("Freigt cost is not computed because of FreightCostRule={}", freightCostRule);<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>}
(salesOrder.getM_PriceList_ID()));
689,269
private FList<TextRange> matchBySubstring(@Nonnull String name) {<NEW_LINE>boolean infix = isPatternChar(0, '*');<NEW_LINE>char[] patternWithoutWildChar = filterWildcard(myPattern);<NEW_LINE>if (name.length() < patternWithoutWildChar.length) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (infix) {<NEW_LINE>int index = StringUtil.indexOfIgnoreCase(name, new CharArrayCharSequence(patternWithoutWildChar, 0<MASK><NEW_LINE>if (index >= 0) {<NEW_LINE>return FList.<TextRange>emptyList().prepend(TextRange.from(index, patternWithoutWildChar.length - 1));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (CharArrayUtil.regionMatches(patternWithoutWildChar, 0, patternWithoutWildChar.length, name)) {<NEW_LINE>return FList.<TextRange>emptyList().prepend(new TextRange(0, patternWithoutWildChar.length));<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
, patternWithoutWildChar.length), 0);