idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
1,652,370
private void updateItemData(TableItem item, DataTransferPipe pipe) {<NEW_LINE>if (isInvalidDataTransferNode(pipe.getProducer())) {<NEW_LINE><MASK><NEW_LINE>item.setText(0, DTUIMessages.stream_consumer_page_settings_item_text_none);<NEW_LINE>} else {<NEW_LINE>item.setImage(0, DBeaverIcons.getImage(getProducerProcessor().getIcon()));<NEW_LINE>item.setText(0, String.valueOf(pipe.getProducer().getObjectName()));<NEW_LINE>}<NEW_LINE>if (isInvalidDataTransferNode(pipe.getConsumer())) {<NEW_LINE>item.setImage(1, null);<NEW_LINE>item.setText(1, DTUIMessages.stream_consumer_page_settings_item_text_none);<NEW_LINE>} else {<NEW_LINE>item.setImage(1, DBeaverIcons.getImage(getWizard().getSettings().getConsumer().getIcon()));<NEW_LINE>item.setText(1, String.valueOf(pipe.getConsumer().getObjectName()));<NEW_LINE>}<NEW_LINE>}
item.setImage(0, null);
456,558
private PlaylistContainerResource enumeratePlaylists(String userId) throws IOException, SpotifyWebApiException {<NEW_LINE>List<MusicPlaylist> <MASK><NEW_LINE>int offset = 0;<NEW_LINE>Paging<PlaylistSimplified> playlists;<NEW_LINE>do {<NEW_LINE>int finalOffset = offset;<NEW_LINE>monitor.debug(() -> format("Fetching playlists with offset %s", finalOffset));<NEW_LINE>playlists = spotifyApi.getListOfUsersPlaylists(userId).offset(offset).build().execute();<NEW_LINE>for (PlaylistSimplified playlist : playlists.getItems()) {<NEW_LINE>monitor.debug(() -> format("Got playlist %s: %s (id: %s)", playlist.getId(), playlist.getName(), playlist.getHref()));<NEW_LINE>results.add(new MusicPlaylist(playlist.getHref(), playlist.getName(), fetchPlaylist(playlist.getId())));<NEW_LINE>}<NEW_LINE>offset += playlists.getItems().length;<NEW_LINE>} while (!Strings.isNullOrEmpty(playlists.getNext()) && playlists.getItems().length > 0);<NEW_LINE>return new PlaylistContainerResource(results);<NEW_LINE>}
results = new ArrayList<>();
882,379
public static String formatLogMessage(final int indent, final String message, final Object... arguments) {<NEW_LINE>final StringBuilder logMessage = new StringBuilder();<NEW_LINE>final StringBuilder[] formattedArguments = indentAndToString(indent + 1, arguments);<NEW_LINE>final String[] messageParts = message.split("\\{}");<NEW_LINE>for (int messagePartIndex = 0; messagePartIndex < messageParts.length; messagePartIndex++) {<NEW_LINE>logMessage.append(INDENTS.get(indent)).append(messageParts[messagePartIndex]);<NEW_LINE>if (formattedArguments.length > 0 && formattedArguments.length > messagePartIndex) {<NEW_LINE>logMessage<MASK><NEW_LINE>}<NEW_LINE>if (messagePartIndex < messageParts.length - 1) {<NEW_LINE>logMessage.append(NEW_LINE);<NEW_LINE>if (!messageParts[messagePartIndex + 1].startsWith(" ")) {<NEW_LINE>logMessage.append(" ");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return logMessage.toString();<NEW_LINE>}
.append(formattedArguments[messagePartIndex]);
1,718,293
private BAttachedFunction createResourceFunction(BLangFunction funcNode, BInvokableSymbol funcSymbol, BInvokableType funcType) {<NEW_LINE>BLangResourceFunction resourceFunction = (BLangResourceFunction) funcNode;<NEW_LINE>Name accessor = names.fromIdNode(resourceFunction.methodName);<NEW_LINE>List<Name> resourcePath = resourceFunction.resourcePath.stream().map(names::fromIdNode).collect(Collectors.toList());<NEW_LINE>List<BVarSymbol> pathParamSymbols = resourceFunction.pathParams.stream().map(p -> {<NEW_LINE>p.symbol.kind = SymbolKind.PATH_PARAMETER;<NEW_LINE>return p.symbol;<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>BVarSymbol restPathParamSym = null;<NEW_LINE>if (resourceFunction.restPathParam != null) {<NEW_LINE>restPathParamSym = resourceFunction.restPathParam.symbol;<NEW_LINE>restPathParamSym.kind = SymbolKind.PATH_REST_PARAMETER;<NEW_LINE>}<NEW_LINE>return new BResourceFunction(names.fromIdNode(funcNode.name), funcSymbol, funcType, resourcePath, accessor, <MASK><NEW_LINE>}
pathParamSymbols, restPathParamSym, funcNode.pos);
723,573
public synchronized byte[] exportCollection() {<NEW_LINE>// returns null if the collection is empty<NEW_LINE>// experimental; supervise CPU load<NEW_LINE>sort();<NEW_LINE>// uniq();<NEW_LINE>// trim();<NEW_LINE>// on case the collection is sorted<NEW_LINE>assert this.sortBound == this.chunkcount;<NEW_LINE>assert size() * this.rowdef.objectsize <= this.chunkcache.length : "this.size() = " + size() + ", objectsize = " + this.rowdef.objectsize + ", chunkcache.length = " + this.chunkcache.length;<NEW_LINE>final Row row = exportRow(size() * this.rowdef.objectsize);<NEW_LINE>final Row.Entry entry = row.newEntry();<NEW_LINE>assert (this.sortBound <= this.chunkcount) : "sortBound = " + this.sortBound + ", chunkcount = " + this.chunkcount;<NEW_LINE>assert (this.chunkcount <= this.chunkcache.length / this.rowdef.objectsize) : "chunkcount = " + this.chunkcount + ", chunkcache.length = " + this.chunkcache.length + ", rowdef.objectsize = " + this.rowdef.objectsize;<NEW_LINE>entry.setCol(exp_chunkcount, this.chunkcount);<NEW_LINE>entry.setCol(exp_last_read, daysSince2000<MASK><NEW_LINE>entry.setCol(exp_last_wrote, daysSince2000(this.lastTimeWrote));<NEW_LINE>entry.setCol(exp_order_type, (this.rowdef.objectOrder == null) ? ASCII.getBytes("__") : ASCII.getBytes(this.rowdef.objectOrder.signature()));<NEW_LINE>entry.setCol(exp_order_bound, this.sortBound);<NEW_LINE>entry.setCol(exp_collection, this.chunkcache);<NEW_LINE>return entry.bytes();<NEW_LINE>}
(System.currentTimeMillis()));
649,592
public ObjectTypeKey unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>ObjectTypeKey objectTypeKey = new ObjectTypeKey();<NEW_LINE>int originalDepth = context.getCurrentDepth();<NEW_LINE><MASK><NEW_LINE>int targetDepth = originalDepth + 1;<NEW_LINE>JsonToken token = context.getCurrentToken();<NEW_LINE>if (token == null)<NEW_LINE>token = context.nextToken();<NEW_LINE>if (token == VALUE_NULL) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>while (true) {<NEW_LINE>if (token == null)<NEW_LINE>break;<NEW_LINE>if (token == FIELD_NAME || token == START_OBJECT) {<NEW_LINE>if (context.testExpression("StandardIdentifiers", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>objectTypeKey.setStandardIdentifiers(new ListUnmarshaller<String>(context.getUnmarshaller(String.class)).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("FieldNames", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>objectTypeKey.setFieldNames(new ListUnmarshaller<String>(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 objectTypeKey;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
591,549
public static Figure create(String title, String xTitle, double[] xData, String yTitle, double[] yData) {<NEW_LINE>Preconditions.checkArgument(xData.length != 0, "x Data array is empty");<NEW_LINE>Preconditions.checkArgument(yData.length != 0, "x Data array is empty");<NEW_LINE>if (xData.length != yData.length) {<NEW_LINE>double[] interpolatedData;<NEW_LINE>if (xData.length < yData.length) {<NEW_LINE>interpolatedData = interpolate(yData, xData.length);<NEW_LINE>yData = interpolatedData;<NEW_LINE>} else {<NEW_LINE>interpolatedData = interpolate(xData, yData.length);<NEW_LINE>xData = interpolatedData;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Arrays.sort(xData);<NEW_LINE>Arrays.sort(yData);<NEW_LINE>double min = Math.min(xData[0], yData[0]);<NEW_LINE>double max = Math.max(xData[xData.length - 1], yData[yData.length - 1]);<NEW_LINE>double[] line = { min, max };<NEW_LINE>// Draw the 45 degree line indicating equal distributions<NEW_LINE>ScatterTrace trace1 = ScatterTrace.builder(line, line).mode(ScatterTrace.Mode.LINE).<MASK><NEW_LINE>// Draw the actual data points<NEW_LINE>ScatterTrace trace2 = ScatterTrace.builder(xData, yData).name("distributions").build();<NEW_LINE>Layout layout = Layout.builder().title(title).xAxis(Axis.builder().title(xTitle).build()).yAxis(Axis.builder().title(yTitle).build()).height(700).width(900).build();<NEW_LINE>return new Figure(layout, trace1, trace2);<NEW_LINE>}
name("y = x").build();
1,549,224
public RestartRequirement onApply(UserPrefs rPrefs) {<NEW_LINE>RestartRequirement restartRequirement = super.onApply(rPrefs);<NEW_LINE>if (relaunchRequired_)<NEW_LINE>restartRequirement.setUiReloadRequired(true);<NEW_LINE>String themeName = flatTheme_.getValue();<NEW_LINE>if (!StringUtil.equals(themeName, userPrefs_.globalTheme().getGlobalValue())) {<NEW_LINE>userPrefs_.globalTheme().setGlobalValue(themeName, false);<NEW_LINE>}<NEW_LINE>double fontSize = Double.parseDouble(fontSize_.getValue());<NEW_LINE>userPrefs_.fontSizePoints().setGlobalValue(fontSize);<NEW_LINE>if (!StringUtil.equals(theme_.getValue(), userPrefs_.editorTheme().getGlobalValue())) {<NEW_LINE>userState_.theme().setGlobalValue(themeList_.get<MASK><NEW_LINE>userPrefs_.editorTheme().setGlobalValue(theme_.getValue(), false);<NEW_LINE>}<NEW_LINE>if (!StringUtil.equals(initialFontFace_, fontFace_.getValue())) {<NEW_LINE>String fontFace = fontFace_.getValue();<NEW_LINE>initialFontFace_ = fontFace;<NEW_LINE>if (Desktop.hasDesktopFrame()) {<NEW_LINE>// In desktop mode the font is stored in a per-machine file since<NEW_LINE>// the font list varies between machines.<NEW_LINE>Desktop.getFrame().setFixedWidthFont(fontFace);<NEW_LINE>} else {<NEW_LINE>if (StringUtil.equals(fontFace, DEFAULT_FONT_VALUE)) {<NEW_LINE>// User has chosen the default font face<NEW_LINE>userPrefs_.serverEditorFontEnabled().setGlobalValue(false);<NEW_LINE>} else {<NEW_LINE>// User has chosen a specific font<NEW_LINE>userPrefs_.serverEditorFontEnabled().setGlobalValue(true);<NEW_LINE>userPrefs_.serverEditorFont().setGlobalValue(fontFace);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>restartRequirement.setUiReloadRequired(true);<NEW_LINE>}<NEW_LINE>if (Desktop.hasDesktopFrame()) {<NEW_LINE>if (!StringUtil.equals(initialZoomLevel_, zoomLevel_.getValue())) {<NEW_LINE>double zoomLevel = Double.parseDouble(zoomLevel_.getValue());<NEW_LINE>initialZoomLevel_ = zoomLevel_.getValue();<NEW_LINE>Desktop.getFrame().setZoomLevel(zoomLevel);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return restartRequirement;<NEW_LINE>}
(theme_.getValue()));
220,950
private Answer executeRequest(UpdateBcfRouterCommand cmd, int numRetries) {<NEW_LINE>RouterData routerData = new RouterData(cmd.getTenantId());<NEW_LINE>List<AclData> acls = new ArrayList<AclData>();<NEW_LINE>acls.addAll(cmd.getAcls());<NEW_LINE>routerData.getRouter().getAcls().addAll(acls);<NEW_LINE>routerData.getRouter().addExternalGateway(cmd.getPublicIp());<NEW_LINE>try {<NEW_LINE>String hash = _bigswitchBcfApi.modifyRouter(cmd.getTenantId(), routerData);<NEW_LINE>return new BcfAnswer(cmd, true, "tenant " + cmd.getTenantId() + " router updated", hash);<NEW_LINE>} catch (BigSwitchBcfApiException e) {<NEW_LINE>if (e.is_topologySyncRequested()) {<NEW_LINE>cmd.setTopologySyncRequested(true);<NEW_LINE>return new BcfAnswer(cmd, true, "tenant " + <MASK><NEW_LINE>} else {<NEW_LINE>if (numRetries > 0) {<NEW_LINE>return retry(cmd, --numRetries);<NEW_LINE>} else {<NEW_LINE>return new BcfAnswer(cmd, e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (IllegalArgumentException e1) {<NEW_LINE>return new BcfAnswer(cmd, false, "Illegal argument in BCF router update");<NEW_LINE>}<NEW_LINE>}
cmd.getTenantId() + " router updated but topology sync required.");
889,478
public void saveAction(final WorkflowAction action) throws DotDataException, AlreadyExistException {<NEW_LINE>boolean isNew = true;<NEW_LINE>if (UtilMethods.isSet(action.getId())) {<NEW_LINE>isNew = !this.existsAction(action.getId());<NEW_LINE>} else {<NEW_LINE>action.setId(UUIDGenerator.generateUuid());<NEW_LINE>}<NEW_LINE>final String nextStep = this.getNextStep(action);<NEW_LINE>final DotConnect db = new DotConnect();<NEW_LINE>if (isNew) {<NEW_LINE>db.setSQL(sql.INSERT_ACTION);<NEW_LINE>db.addParam(action.getId());<NEW_LINE>db.addParam(action.getSchemeId());<NEW_LINE>db.addParam(action.getName());<NEW_LINE>db.addParam(action.getCondition());<NEW_LINE>db.addParam(nextStep);<NEW_LINE>db.addParam(action.getNextAssign());<NEW_LINE>db.addParam(action.getOrder());<NEW_LINE>db.addParam(action.isAssignable());<NEW_LINE>db.addParam(action.isCommentable());<NEW_LINE>db.addParam(action.getIcon());<NEW_LINE>db.addParam(action.isRoleHierarchyForAssign());<NEW_LINE>db.addParam(action.isRequiresCheckout());<NEW_LINE>db.addParam(WorkflowState.toCommaSeparatedString<MASK><NEW_LINE>db.loadResult();<NEW_LINE>} else {<NEW_LINE>db.setSQL(sql.UPDATE_ACTION);<NEW_LINE>db.addParam(action.getSchemeId());<NEW_LINE>db.addParam(action.getName());<NEW_LINE>db.addParam(action.getCondition());<NEW_LINE>db.addParam(nextStep);<NEW_LINE>db.addParam(action.getNextAssign());<NEW_LINE>db.addParam(action.getOrder());<NEW_LINE>db.addParam(action.isAssignable());<NEW_LINE>db.addParam(action.isCommentable());<NEW_LINE>db.addParam(action.getIcon());<NEW_LINE>db.addParam(action.isRoleHierarchyForAssign());<NEW_LINE>db.addParam(action.isRequiresCheckout());<NEW_LINE>db.addParam(WorkflowState.toCommaSeparatedString(action.getShowOn()));<NEW_LINE>db.addParam(action.getId());<NEW_LINE>db.loadResult();<NEW_LINE>}<NEW_LINE>final List<WorkflowStep> relatedProxiesSteps = this.findProxiesSteps(action);<NEW_LINE>relatedProxiesSteps.forEach(cache::removeActions);<NEW_LINE>final WorkflowScheme proxyScheme = new WorkflowScheme();<NEW_LINE>proxyScheme.setId(action.getSchemeId());<NEW_LINE>cache.removeActions(proxyScheme);<NEW_LINE>// update workflowScheme mod date<NEW_LINE>final WorkflowScheme scheme = findScheme(action.getSchemeId());<NEW_LINE>saveScheme(scheme);<NEW_LINE>}
(action.getShowOn()));
42,388
private static void quatToEuler(Quat4d quat, Tuple3d euler) {<NEW_LINE>double heading;<NEW_LINE>double attitude;<NEW_LINE>double bank;<NEW_LINE>double test = quat.x * quat.y + quat.z * quat.w;<NEW_LINE>if (test > 0.499) {<NEW_LINE>// singularity at north pole<NEW_LINE>heading = 2 * Math.atan2(quat.x, quat.w);<NEW_LINE>attitude = Math.PI / 2;<NEW_LINE>bank = 0;<NEW_LINE>} else if (test < -0.499) {<NEW_LINE>// singularity at south pole<NEW_LINE>heading = -2 * Math.atan2(quat.x, quat.w);<NEW_LINE>attitude = -Math.PI / 2;<NEW_LINE>bank = 0;<NEW_LINE>} else {<NEW_LINE>double sqx <MASK><NEW_LINE>double sqy = quat.y * quat.y;<NEW_LINE>double sqz = quat.z * quat.z;<NEW_LINE>heading = Math.atan2(2 * quat.y * quat.w - 2 * quat.x * quat.z, 1 - 2 * sqy - 2 * sqz);<NEW_LINE>attitude = Math.asin(2 * test);<NEW_LINE>bank = Math.atan2(2 * quat.x * quat.w - 2 * quat.y * quat.z, 1 - 2 * sqx - 2 * sqz);<NEW_LINE>}<NEW_LINE>euler.x = bank * 180 / Math.PI;<NEW_LINE>euler.y = heading * 180 / Math.PI;<NEW_LINE>euler.z = attitude * 180 / Math.PI;<NEW_LINE>}
= quat.x * quat.x;
1,541,891
private void readKeyFromFile(Uri uri) {<NEW_LINE>PubkeyBean pubkey = new PubkeyBean();<NEW_LINE>// find the exact file selected<NEW_LINE>pubkey.setNickname(uri.getLastPathSegment());<NEW_LINE>byte[] keyData;<NEW_LINE>try {<NEW_LINE>ContentResolver resolver = getContentResolver();<NEW_LINE>keyData = getBytesFromInputStream(resolver.openInputStream(uri), MAX_KEYFILE_SIZE);<NEW_LINE>} catch (IOException e) {<NEW_LINE>Toast.makeText(PubkeyListActivity.this, R.string.pubkey_import_parse_problem, Toast.LENGTH_LONG).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>KeyPair kp;<NEW_LINE>if ((kp = readPKCS8Key(keyData)) != null) {<NEW_LINE>String algorithm = convertAlgorithmName(kp.getPrivate().getAlgorithm());<NEW_LINE>pubkey.setType(algorithm);<NEW_LINE>pubkey.setPrivateKey(kp.getPrivate().getEncoded());<NEW_LINE>pubkey.setPublicKey(kp.<MASK><NEW_LINE>} else {<NEW_LINE>try {<NEW_LINE>PEMStructure struct = PEMDecoder.parsePEM(new String(keyData).toCharArray());<NEW_LINE>boolean encrypted = PEMDecoder.isPEMEncrypted(struct);<NEW_LINE>pubkey.setEncrypted(encrypted);<NEW_LINE>if (!encrypted) {<NEW_LINE>kp = PEMDecoder.decode(struct, null);<NEW_LINE>String algorithm = convertAlgorithmName(kp.getPrivate().getAlgorithm());<NEW_LINE>pubkey.setType(algorithm);<NEW_LINE>pubkey.setPrivateKey(kp.getPrivate().getEncoded());<NEW_LINE>pubkey.setPublicKey(kp.getPublic().getEncoded());<NEW_LINE>} else {<NEW_LINE>pubkey.setType(PubkeyDatabase.KEY_TYPE_IMPORTED);<NEW_LINE>pubkey.setPrivateKey(keyData);<NEW_LINE>}<NEW_LINE>} catch (IOException e) {<NEW_LINE>Log.e(TAG, "Problem parsing imported private key", e);<NEW_LINE>Toast.makeText(PubkeyListActivity.this, R.string.pubkey_import_parse_problem, Toast.LENGTH_LONG).show();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// write new value into database<NEW_LINE>PubkeyDatabase pubkeyDb = PubkeyDatabase.get(this);<NEW_LINE>pubkeyDb.savePubkey(pubkey);<NEW_LINE>updateList();<NEW_LINE>}
getPublic().getEncoded());
1,691,263
private void tokenizeComment() {<NEW_LINE>// all we need to do is find the end of the comment.<NEW_LINE>Matcher matcher = this.syntax.getRegexCommentClose().matcher(this.source);<NEW_LINE>boolean <MASK><NEW_LINE>if (!match) {<NEW_LINE>throw new ParserException(null, "Unclosed comment.", this.source.getLineNumber(), this.source.getFilename());<NEW_LINE>}<NEW_LINE>String comment = this.source.substring(matcher.start());<NEW_LINE>String reversedComment = new StringBuilder(comment).reverse().toString();<NEW_LINE>Matcher whitespaceTrimMatcher = this.syntax.getRegexLeadingWhitespaceTrim().matcher(reversedComment);<NEW_LINE>if (whitespaceTrimMatcher.lookingAt()) {<NEW_LINE>this.trimLeadingWhitespaceFromNextData = true;<NEW_LINE>}<NEW_LINE>// move cursor to end of comment (and closing delimiter)<NEW_LINE>this.source.advance(matcher.end());<NEW_LINE>this.popState();<NEW_LINE>}
match = matcher.find(0);
1,144,209
private void go() {<NEW_LINE>try {<NEW_LINE>System.out.println("----------Map Source and Sink ----------------");<NEW_LINE>// insert sequence 0..9 into map as (0,0) , (1,1) .... ( 9,9)<NEW_LINE>prepareSampleInput(jet, MAP_SOURCE);<NEW_LINE>// execute the pipeline<NEW_LINE>jet.newJob(mapSourceAndSink(MAP_SOURCE, MAP_SINK)).join();<NEW_LINE>// print contents of the sink map<NEW_LINE>dumpMap(jet, MAP_SINK);<NEW_LINE>System.out.println("----------------------------------------------");<NEW_LINE>System.out.println("--------------Map with Merging----------------");<NEW_LINE>// insert sequence 0..9 into map as (0,0) , (1,1) .... ( 9,9)<NEW_LINE>prepareSampleInput(jet, MAP_WITH_MERGING_SOURCE);<NEW_LINE>// execute the pipeline<NEW_LINE>jet.newJob(mapWithMerging(MAP_WITH_MERGING_SOURCE, MAP_WITH_MERGING_SINK)).join();<NEW_LINE>// print contents of the sink map<NEW_LINE>dumpMap(jet, MAP_WITH_MERGING_SINK);<NEW_LINE><MASK><NEW_LINE>System.out.println("------------Map with Updating ----------------");<NEW_LINE>// insert sequence 0..9 into map as (0,"0") , (1,"1") .... ( 9,"9")<NEW_LINE>prepareMapWithUpdatingSampleInput(jet, MAP_WITH_UPDATING_SOURCE_SINK);<NEW_LINE>// execute the pipeline<NEW_LINE>jet.newJob(mapWithUpdating(MAP_WITH_UPDATING_SOURCE_SINK)).join();<NEW_LINE>// print contents of the sink map<NEW_LINE>dumpMap(jet, MAP_WITH_UPDATING_SOURCE_SINK);<NEW_LINE>System.out.println("----------------------------------------------");<NEW_LINE>System.out.println("----------Map with EntryProcessor ------------");<NEW_LINE>// insert sequence 0..9 into map as (0,0) , (1,1) .... ( 9,9)<NEW_LINE>prepareSampleInput(jet, MAP_WITH_ENTRYPROCESSOR_SOURCE_SINK);<NEW_LINE>// execute the pipeline<NEW_LINE>jet.newJob(mapWithEntryProcessor(MAP_WITH_ENTRYPROCESSOR_SOURCE_SINK, MAP_WITH_ENTRYPROCESSOR_SOURCE_SINK)).join();<NEW_LINE>// print contents of the sink map<NEW_LINE>dumpMap(jet, MAP_WITH_ENTRYPROCESSOR_SOURCE_SINK);<NEW_LINE>System.out.println("----------------------------------------------");<NEW_LINE>} finally {<NEW_LINE>Jet.shutdownAll();<NEW_LINE>}<NEW_LINE>}
System.out.println("----------------------------------------------");
1,624,833
public final BeanDefinition parse(Element element, ParserContext parserContext) {<NEW_LINE>AbstractBeanDefinition definition = parseInternal(element, parserContext);<NEW_LINE>if (definition != null && !parserContext.isNested()) {<NEW_LINE>try {<NEW_LINE>String id = resolveId(element, definition, parserContext);<NEW_LINE>if (!StringUtils.hasText(id)) {<NEW_LINE>parserContext.getReaderContext().error("Id is required for element '" + parserContext.getDelegate().getLocalName(element) + "' when used as a top-level tag", element);<NEW_LINE>}<NEW_LINE>String[] aliases = null;<NEW_LINE>if (shouldParseNameAsAliases()) {<NEW_LINE>String name = element.getAttribute(NAME_ATTRIBUTE);<NEW_LINE>if (StringUtils.hasLength(name)) {<NEW_LINE>aliases = StringUtils.trimArrayElements(StringUtils.commaDelimitedListToStringArray(name));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>BeanDefinitionHolder holder = new BeanDefinitionHolder(definition, id, aliases);<NEW_LINE>registerBeanDefinition(holder, parserContext.getRegistry());<NEW_LINE>if (shouldFireEvents()) {<NEW_LINE>BeanComponentDefinition componentDefinition = new BeanComponentDefinition(holder);<NEW_LINE>postProcessComponentDefinition(componentDefinition);<NEW_LINE>parserContext.registerComponent(componentDefinition);<NEW_LINE>}<NEW_LINE>} catch (BeanDefinitionStoreException ex) {<NEW_LINE>String msg = ex.getMessage();<NEW_LINE>parserContext.getReaderContext().error((msg != null ? msg : ex<MASK><NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return definition;<NEW_LINE>}
.toString()), element);
349,783
public FlowInfo analyseCode(BlockScope currentScope, FlowContext flowContext, FlowInfo flowInfo) {<NEW_LINE>// here requires to generate a sequence of finally blocks invocations depending corresponding<NEW_LINE>// to each of the traversed try statements, so that execution will terminate properly.<NEW_LINE>// lookup the label, this should answer the returnContext<NEW_LINE>FlowContext targetContext = (this.label == null) ? flowContext.getTargetContextForDefaultBreak() : flowContext.getTargetContextForBreakLabel(this.label);<NEW_LINE>if (targetContext == null) {<NEW_LINE>if (this.label == null) {<NEW_LINE>currentScope.problemReporter().invalidBreak(this);<NEW_LINE>} else {<NEW_LINE>if (this.switchExpression == null)<NEW_LINE>currentScope.problemReporter().undefinedLabel(this);<NEW_LINE>}<NEW_LINE>// pretend it did not break since no actual target<NEW_LINE>return flowInfo;<NEW_LINE>}<NEW_LINE>if ((this.isImplicit || this.switchExpression != null) && this.expression != null) {<NEW_LINE>flowInfo = this.expression.analyseCode(currentScope, flowContext, flowInfo);<NEW_LINE>this.expression.checkNPEbyUnboxing(currentScope, flowContext, flowInfo);<NEW_LINE>if (flowInfo.reachMode() == FlowInfo.REACHABLE && currentScope.compilerOptions().isAnnotationBasedNullAnalysisEnabled)<NEW_LINE>checkAgainstNullAnnotation(currentScope, flowContext, flowInfo, this.expression);<NEW_LINE>}<NEW_LINE>targetContext.recordAbruptExit();<NEW_LINE>targetContext.expireNullCheckedFieldInfo();<NEW_LINE>this.initStateIndex = currentScope.methodScope().recordInitializationStates(flowInfo);<NEW_LINE>this.targetLabel = targetContext.breakLabel();<NEW_LINE>FlowContext traversedContext = flowContext;<NEW_LINE>int subCount = 0;<NEW_LINE>this.subroutines = new SubRoutineStatement[5];<NEW_LINE>do {<NEW_LINE>SubRoutineStatement sub;<NEW_LINE>if ((sub = traversedContext.subroutine()) != null) {<NEW_LINE>if (subCount == this.subroutines.length) {<NEW_LINE>// grow<NEW_LINE>System.arraycopy(this.subroutines, 0, (this.subroutines = new SubRoutineStatement[subCount * <MASK><NEW_LINE>}<NEW_LINE>this.subroutines[subCount++] = sub;<NEW_LINE>if (sub.isSubRoutineEscaping()) {<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>traversedContext.recordReturnFrom(flowInfo.unconditionalInits());<NEW_LINE>traversedContext.recordBreakTo(targetContext);<NEW_LINE>if (traversedContext instanceof InsideSubRoutineFlowContext) {<NEW_LINE>ASTNode node = traversedContext.associatedNode;<NEW_LINE>if (node instanceof TryStatement) {<NEW_LINE>TryStatement tryStatement = (TryStatement) node;<NEW_LINE>// collect inits<NEW_LINE>flowInfo.addInitializationsFrom(tryStatement.subRoutineInits);<NEW_LINE>}<NEW_LINE>} else if (traversedContext == targetContext) {<NEW_LINE>// only record break info once accumulated through subroutines, and only against target context<NEW_LINE>targetContext.recordBreakFrom(flowInfo);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>} while ((traversedContext = traversedContext.getLocalParent()) != null);<NEW_LINE>// resize subroutines<NEW_LINE>if (subCount != this.subroutines.length) {<NEW_LINE>System.arraycopy(this.subroutines, 0, (this.subroutines = new SubRoutineStatement[subCount]), 0, subCount);<NEW_LINE>}<NEW_LINE>return FlowInfo.DEAD_END;<NEW_LINE>}
2]), 0, subCount);
840,251
protected void terminatePlanItemInstance(PlanItemInstanceEntity planItemInstance, CommandContext commandContext) {<NEW_LINE>String currentPlanItemInstanceState = planItemInstance.getState();<NEW_LINE>Date currentTime = cmmnEngineConfiguration.getClock().getCurrentTime();<NEW_LINE>planItemInstance.setEndedTime(currentTime);<NEW_LINE>planItemInstance.setTerminatedTime(currentTime);<NEW_LINE>planItemInstance.setState(PlanItemInstanceState.TERMINATED);<NEW_LINE>PlanItemDefinition planItemDefinition = planItemInstance.getPlanItem().getPlanItemDefinition();<NEW_LINE>if (planItemDefinition instanceof HumanTask) {<NEW_LINE>if (PlanItemInstanceState.ACTIVE.equals(currentPlanItemInstanceState)) {<NEW_LINE>TaskService taskService = cmmnEngineConfiguration.getTaskServiceConfiguration().getTaskService();<NEW_LINE>List<TaskEntity> taskEntities = taskService.findTasksBySubScopeIdScopeType(planItemInstance.<MASK><NEW_LINE>if (taskEntities == null || taskEntities.isEmpty()) {<NEW_LINE>throw new FlowableException("No task entity found for plan item instance " + planItemInstance.getId());<NEW_LINE>}<NEW_LINE>// Should be only one<NEW_LINE>for (TaskEntity taskEntity : taskEntities) {<NEW_LINE>if (!taskEntity.isDeleted()) {<NEW_LINE>TaskHelper.deleteTask(taskEntity, "Change plan item state", false, false, cmmnEngineConfiguration);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else if (planItemDefinition instanceof Stage) {<NEW_LINE>deleteChildPlanItemInstances(planItemInstance, commandContext);<NEW_LINE>} else if (planItemDefinition instanceof ProcessTask) {<NEW_LINE>if (planItemInstance.getReferenceId() != null) {<NEW_LINE>cmmnEngineConfiguration.getProcessInstanceService().deleteProcessInstance(planItemInstance.getReferenceId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
getId(), ScopeTypes.CMMN);
104,924
public byte[] synthesizeSpeech(String text, GoogleTTSVoice voice, String codec) {<NEW_LINE>String[] format = getFormatForCodec(codec);<NEW_LINE>String fileNameInCache = getUniqueFilenameForText(text, voice.getTechnicalName());<NEW_LINE>File audioFileInCache = new File(cacheFolder, fileNameInCache + "." + format[1]);<NEW_LINE>try {<NEW_LINE>// check if in cache<NEW_LINE>if (audioFileInCache.exists()) {<NEW_LINE>logger.debug("Audio file {} was found in cache.", audioFileInCache.getName());<NEW_LINE>return Files.readAllBytes(audioFileInCache.toPath());<NEW_LINE>}<NEW_LINE>// if not in cache, get audio data and put to cache<NEW_LINE>byte[] audio = synthesizeSpeechByGoogle(text, voice, format[0]);<NEW_LINE>if (audio != null) {<NEW_LINE>saveAudioAndTextToFile(text, audioFileInCache, <MASK><NEW_LINE>}<NEW_LINE>return audio;<NEW_LINE>} catch (AuthenticationException | CommunicationException e) {<NEW_LINE>logger.warn("Error initializing Google Cloud TTS service: {}", e.getMessage());<NEW_LINE>oAuthService = null;<NEW_LINE>initialized = false;<NEW_LINE>voices.clear();<NEW_LINE>} catch (FileNotFoundException e) {<NEW_LINE>logger.warn("Could not write file {} to cache: {}", audioFileInCache, e.getMessage());<NEW_LINE>} catch (IOException e) {<NEW_LINE>logger.debug("An unexpected IOException occurred: {}", e.getMessage());<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
audio, voice.getTechnicalName());
1,717,712
public void endVisit(Block node) {<NEW_LINE>ASTNode parent = node.getParent();<NEW_LINE>List<Statement> statements = node.statements();<NEW_LINE>if (parent.getLength() == 0)<NEW_LINE>// this is a fake block created by parsing in statements mode<NEW_LINE>return;<NEW_LINE>String oneLineOption;<NEW_LINE>if (parent instanceof MethodDeclaration) {<NEW_LINE>MethodDeclaration method = (MethodDeclaration) parent;<NEW_LINE>oneLineOption = method.isCompactConstructor() ? this.options.keep_record_constructor_on_one_line : this.options.keep_method_body_on_one_line;<NEW_LINE>if (this.options.keep_simple_getter_setter_on_one_line) {<NEW_LINE>String name = method.getName().getIdentifier();<NEW_LINE>Type returnType = method.getReturnType2();<NEW_LINE>boolean returnsVoid = returnType instanceof PrimitiveType && ((PrimitiveType) returnType).getPrimitiveTypeCode() == PrimitiveType.VOID;<NEW_LINE>// $NON-NLS-1$<NEW_LINE>boolean // $NON-NLS-1$<NEW_LINE>isGetter = name.matches("(is|get)\\p{Lu}.*") && !method.isConstructor() && !returnsVoid && method.parameters().isEmpty() && statements.size() == 1 && statements.get(0) instanceof ReturnStatement;<NEW_LINE>// $NON-NLS-1$<NEW_LINE>boolean // $NON-NLS-1$<NEW_LINE>isSetter = name.matches("set\\p{Lu}.*") && !method.isConstructor() && returnsVoid && method.parameters().size() == 1 && statements.size() == 1 && statements.get(0) instanceof ExpressionStatement && ((ExpressionStatement) statements.get(0)).getExpression() instanceof Assignment;<NEW_LINE>if (isGetter || isSetter)<NEW_LINE>oneLineOption = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;<NEW_LINE>}<NEW_LINE>} else if (parent instanceof IfStatement && ((IfStatement) parent).getElseStatement() == null) {<NEW_LINE>oneLineOption = this.options.keep_if_then_body_block_on_one_line;<NEW_LINE>if (this.options.keep_guardian_clause_on_one_line) {<NEW_LINE>boolean isGuardian = statements.size() == 1 && (statements.get(0) instanceof ReturnStatement || statements.get(0) instanceof ThrowStatement);<NEW_LINE>// guard clause cannot start with a comment: https://bugs.eclipse.org/58565<NEW_LINE>int openBraceIndex = this.tm.firstIndexIn(node, TokenNameLBRACE);<NEW_LINE>isGuardian = isGuardian && !this.tm.get(openBraceIndex + 1).isComment();<NEW_LINE>if (isGuardian)<NEW_LINE>oneLineOption = DefaultCodeFormatterConstants.ONE_LINE_ALWAYS;<NEW_LINE>}<NEW_LINE>} else if (parent instanceof LambdaExpression) {<NEW_LINE>oneLineOption = this.options.keep_lambda_body_block_on_one_line;<NEW_LINE>} else if (parent instanceof ForStatement || parent instanceof EnhancedForStatement || parent instanceof WhileStatement) {<NEW_LINE>oneLineOption = this.options.keep_loop_body_block_on_one_line;<NEW_LINE>} else if (parent instanceof DoStatement) {<NEW_LINE>oneLineOption = this.options.keep_loop_body_block_on_one_line;<NEW_LINE>int openBraceIndex = this.tm.firstIndexIn(node, TokenNameLBRACE);<NEW_LINE>int closeBraceIndex = this.tm.lastIndexIn(node, TokenNameRBRACE);<NEW_LINE>Token whileToken = this.<MASK><NEW_LINE>int lastIndex = whileToken.getLineBreaksBefore() == 0 ? this.tm.lastIndexIn(parent, -1) : closeBraceIndex;<NEW_LINE>tryKeepOnOneLine(openBraceIndex, closeBraceIndex, lastIndex, statements, oneLineOption);<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>oneLineOption = this.options.keep_code_block_on_one_line;<NEW_LINE>}<NEW_LINE>tryKeepOnOneLine(node, null, statements, oneLineOption);<NEW_LINE>}
tm.firstTokenAfter(node, TokenNamewhile);
1,161,150
public static void assertPropsPerRow(EventBean[] actual, String[] propertyNames, Object[][] expected, String streamName) {<NEW_LINE>if (compareArraySize(expected, actual)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>for (int i = 0; i < expected.length; i++) {<NEW_LINE>Object[] propertiesThisRow = expected[i];<NEW_LINE>ScopeTestHelper.assertEquals("Number of properties expected mismatches for row " + i, propertyNames.length, propertiesThisRow.length);<NEW_LINE>for (int j = 0; j < propertiesThisRow.length; j++) {<NEW_LINE>String name = propertyNames[j];<NEW_LINE>Object value = propertiesThisRow[j];<NEW_LINE>Object eventProp = actual[i].get(name);<NEW_LINE>StringWriter writer = new StringWriter();<NEW_LINE>writer.append("Error asserting property named ");<NEW_LINE>writer.append(name);<NEW_LINE>writer.append(" for row ");<NEW_LINE>writer.append(Integer.toString(i));<NEW_LINE>if (streamName != null && streamName.trim().length() != 0) {<NEW_LINE>writer.append(" for stream ");<NEW_LINE>writer.append(streamName);<NEW_LINE>}<NEW_LINE>assertEqualsAllowArray(writer.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
toString(), value, eventProp);
544,098
private static void install() {<NEW_LINE>// don't install directory chooser if standard chooser is desired<NEW_LINE>if (isStandardChooserForced()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final UIDefaults uid = UIManager.getDefaults();<NEW_LINE>originalImpl = (Class<?>) uid.getUIClass(KEY);<NEW_LINE>Class<MASK><NEW_LINE>final String val = impl.getName();<NEW_LINE>// don't install dirchooser if quickfilechooser is present<NEW_LINE>if (!isQuickFileChooser(uid.get(KEY))) {<NEW_LINE>uid.put(KEY, val);<NEW_LINE>// To make it work in NetBeans too:<NEW_LINE>uid.put(val, impl);<NEW_LINE>}<NEW_LINE>// #61147: prevent NB from switching to a different UI later (under GTK):<NEW_LINE>uid.addPropertyChangeListener(pcl = new PropertyChangeListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void propertyChange(PropertyChangeEvent evt) {<NEW_LINE>String name = evt.getPropertyName();<NEW_LINE>Object className = uid.get(KEY);<NEW_LINE>if ((name.equals(KEY) || name.equals("UIDefaults")) && !val.equals(className) && !isQuickFileChooser(className)) {<NEW_LINE>originalImpl = (Class<?>) uid.getUIClass(KEY);<NEW_LINE>uid.put(KEY, val);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
<?> impl = DelegatingChooserUI.class;
1,462,249
public GetDevicePositionResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetDevicePositionResult getDevicePositionResult = new GetDevicePositionResult();<NEW_LINE>AwsJsonReader reader = context.getReader();<NEW_LINE>reader.beginObject();<NEW_LINE>while (reader.hasNext()) {<NEW_LINE>String name = reader.nextName();<NEW_LINE>if (name.equals("Accuracy")) {<NEW_LINE>getDevicePositionResult.setAccuracy(PositionalAccuracyJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("DeviceId")) {<NEW_LINE>getDevicePositionResult.setDeviceId(StringJsonUnmarshaller.getInstance().unmarshall(context));<NEW_LINE>} else if (name.equals("Position")) {<NEW_LINE>getDevicePositionResult.setPosition(new ListUnmarshaller<Double>(DoubleJsonUnmarshaller.getInstance(<MASK><NEW_LINE>} else if (name.equals("PositionProperties")) {<NEW_LINE>getDevicePositionResult.setPositionProperties(new MapUnmarshaller<String>(StringJsonUnmarshaller.getInstance()).unmarshall(context));<NEW_LINE>} else if (name.equals("ReceivedTime")) {<NEW_LINE>getDevicePositionResult.setReceivedTime(DateJsonUnmarshaller.getInstance(TimestampFormat.ISO_8601).unmarshall(context));<NEW_LINE>} else if (name.equals("SampleTime")) {<NEW_LINE>getDevicePositionResult.setSampleTime(DateJsonUnmarshaller.getInstance(TimestampFormat.ISO_8601).unmarshall(context));<NEW_LINE>} else {<NEW_LINE>reader.skipValue();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>reader.endObject();<NEW_LINE>return getDevicePositionResult;<NEW_LINE>}
)).unmarshall(context));
1,105,089
public void doTest() {<NEW_LINE>checkState(!<MASK><NEW_LINE>checkState(!run, "doTest should only be called once");<NEW_LINE>this.run = true;<NEW_LINE>Result result = compile();<NEW_LINE>for (Diagnostic<? extends JavaFileObject> diagnostic : diagnosticHelper.getDiagnostics()) {<NEW_LINE>if (diagnostic.getCode().contains("error.prone.crash")) {<NEW_LINE>fail(diagnostic.getMessage(Locale.ENGLISH));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (expectNoDiagnostics) {<NEW_LINE>List<Diagnostic<? extends JavaFileObject>> diagnostics = diagnosticHelper.getDiagnostics();<NEW_LINE>assertWithMessage(String.format("Expected no diagnostics produced, but found %d: %s", diagnostics.size(), diagnostics)).that(diagnostics.size()).isEqualTo(0);<NEW_LINE>assertWithMessage(String.format("Expected compilation result to be " + expectedResult.orElse(Result.OK) + ", but was %s. No diagnostics were emitted." + " OutputStream from Compiler follows.\n\n%s", result, outputStream)).that(result).isEqualTo(expectedResult.orElse(Result.OK));<NEW_LINE>} else {<NEW_LINE>for (JavaFileObject source : sources) {<NEW_LINE>try {<NEW_LINE>diagnosticHelper.assertHasDiagnosticOnAllMatchingLines(source, lookForCheckNameInDiagnostic);<NEW_LINE>} catch (IOException e) {<NEW_LINE>throw new UncheckedIOException(e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>assertWithMessage("Unused error keys: " + diagnosticHelper.getUnusedLookupKeys()).that(diagnosticHelper.getUnusedLookupKeys().isEmpty()).isTrue();<NEW_LINE>}<NEW_LINE>expectedResult.ifPresent(expected -> assertWithMessage(String.format("Expected compilation result %s, but was %s\n%s\n%s", expected, result, Joiner.on('\n').join(diagnosticHelper.getDiagnostics()), outputStream)).that(result).isEqualTo(expected));<NEW_LINE>}
sources.isEmpty(), "No source files to compile");
42,661
private void loadNode1194() {<NEW_LINE>PropertyTypeNode node = new PropertyTypeNode(this.context, Identifiers.CubeItemType_YAxisDefinition, new QualifiedName(0, "YAxisDefinition"), new LocalizedText("en", "YAxisDefinition"), LocalizedText.NULL_VALUE, UInteger.valueOf(0), UInteger.valueOf(0), new DataValue(Variant.NULL_VALUE), Identifiers.AxisInformation, -1, new UInteger[] {}, UByte.valueOf(1), UByte.valueOf(1), 0.0, false);<NEW_LINE>node.addReference(new Reference(Identifiers.CubeItemType_YAxisDefinition, Identifiers.HasTypeDefinition, Identifiers.PropertyType.expanded(), true));<NEW_LINE>node.addReference(new Reference(Identifiers.CubeItemType_YAxisDefinition, Identifiers.HasModellingRule, Identifiers.ModellingRule_Mandatory<MASK><NEW_LINE>node.addReference(new Reference(Identifiers.CubeItemType_YAxisDefinition, Identifiers.HasProperty, Identifiers.CubeItemType.expanded(), false));<NEW_LINE>this.nodeManager.addNode(node);<NEW_LINE>}
.expanded(), true));
283,845
private void generate15Client(boolean isJsr109Platform, ProgressHandle handle) throws IOException {<NEW_LINE>// !PW Get client support from project (from first page of wizard)<NEW_LINE>JAXWSClientSupport jaxWsClientSupport = null;<NEW_LINE>if (project != null) {<NEW_LINE>jaxWsClientSupport = JAXWSClientSupport.getJaxWsClientSupport(project.getProjectDirectory());<NEW_LINE>}<NEW_LINE>if (jaxWsClientSupport == null) {<NEW_LINE>// notify no client support<NEW_LINE>// String mes = MessageFormat.format (<NEW_LINE>// NbBundle.getMessage (WebServiceClientWizardIterator.class, "ERR_WebServiceClientSupportNotFound"),<NEW_LINE>// new Object [] {"Servlet Listener"}); //NOI18N<NEW_LINE>// NOI18N<NEW_LINE>String mes = NbBundle.getMessage(WebServiceClientWizardIterator.class, "ERR_NoWebServiceClientSupport");<NEW_LINE>NotifyDescriptor desc = new NotifyDescriptor.Message(mes, NotifyDescriptor.Message.ERROR_MESSAGE);<NEW_LINE>DialogDisplayer.getDefault().notify(desc);<NEW_LINE>handle.finish();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>String wsdlUrl = (String) wiz.getProperty(ClientWizardProperties.WSDL_DOWNLOAD_URL);<NEW_LINE>String filePath = (String) wiz.getProperty(ClientWizardProperties.WSDL_FILE_PATH);<NEW_LINE>Boolean useDispatch = (Boolean) wiz.getProperty(ClientWizardProperties.USEDISPATCH);<NEW_LINE>// if (wsdlUrl==null) wsdlUrl = "file:"+(filePath.startsWith("/")?filePath:"/"+filePath); //NOI18N<NEW_LINE>if (wsdlUrl == null) {<NEW_LINE>wsdlUrl = FileUtil.toFileObject(FileUtil.normalizeFile(new File(filePath))).toURL().toExternalForm();<NEW_LINE>}<NEW_LINE>String packageName = (String) <MASK><NEW_LINE>if (packageName != null && packageName.length() == 0)<NEW_LINE>packageName = null;<NEW_LINE>String clientName = jaxWsClientSupport.addServiceClient(getWsdlName(wsdlUrl), wsdlUrl, packageName, isJsr109Platform);<NEW_LINE>if (useDispatch) {<NEW_LINE>List clients = jaxWsClientSupport.getServiceClients();<NEW_LINE>for (Object c : clients) {<NEW_LINE>if (((Client) c).getName().equals(clientName)) {<NEW_LINE>((Client) c).setUseDispatch(useDispatch);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>JaxWsModel jaxWsModel = (JaxWsModel) project.getLookup().lookup(JaxWsModel.class);<NEW_LINE>jaxWsModel.write();<NEW_LINE>}<NEW_LINE>handle.finish();<NEW_LINE>}
wiz.getProperty(ClientWizardProperties.WSDL_PACKAGE_NAME);
1,363,404
public static void main(String[] args) {<NEW_LINE>final VcrServer vcrServer;<NEW_LINE>int exitCode = 0;<NEW_LINE>try {<NEW_LINE>InvocationOptions options = new InvocationOptions(args);<NEW_LINE>Properties properties = Utils.loadProps(options.serverPropsFilePath);<NEW_LINE><MASK><NEW_LINE>ClusterMapConfig clusterMapConfig = new ClusterMapConfig(verifiableProperties);<NEW_LINE>ClusterAgentsFactory clusterAgentsFactory = Utils.getObj(clusterMapConfig.clusterMapClusterAgentsFactory, clusterMapConfig, options.hardwareLayoutFilePath, options.partitionLayoutFilePath);<NEW_LINE>logger.info("Bootstrapping VcrServer");<NEW_LINE>vcrServer = new VcrServer(verifiableProperties, clusterAgentsFactory, new LoggingNotificationSystem(), null);<NEW_LINE>// attach shutdown handler to catch control-c<NEW_LINE>Runtime.getRuntime().addShutdownHook(new Thread() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>logger.info("Received shutdown signal. Shutting down VcrServer");<NEW_LINE>vcrServer.shutdown();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>vcrServer.startup();<NEW_LINE>vcrServer.awaitShutdown(Integer.MAX_VALUE);<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.error("Exception during bootstrap of VcrServer", e);<NEW_LINE>exitCode = 1;<NEW_LINE>}<NEW_LINE>logger.info("Exiting VcrMain");<NEW_LINE>System.exit(exitCode);<NEW_LINE>}
VerifiableProperties verifiableProperties = new VerifiableProperties(properties);
1,850,668
protected void processElement(IJavaElement element) throws JavaModelException {<NEW_LINE>ICompilationUnit cu = (ICompilationUnit) element;<NEW_LINE>// keep track of the import statements - if all are removed, delete<NEW_LINE>// the import container (and report it in the delta)<NEW_LINE>int numberOfImports = cu.getImports().length;<NEW_LINE>JavaElementDelta delta = new JavaElementDelta(cu);<NEW_LINE>IJavaElement[] cuElements = ((IRegion) this.childrenToRemove.get<MASK><NEW_LINE>for (int i = 0, length = cuElements.length; i < length; i++) {<NEW_LINE>IJavaElement e = cuElements[i];<NEW_LINE>if (e.exists()) {<NEW_LINE>deleteElement(e, cu);<NEW_LINE>delta.removed(e);<NEW_LINE>if (e.getElementType() == IJavaElement.IMPORT_DECLARATION) {<NEW_LINE>numberOfImports--;<NEW_LINE>if (numberOfImports == 0) {<NEW_LINE>delta.removed(cu.getImportContainer());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (delta.getAffectedChildren().length > 0) {<NEW_LINE>cu.save(getSubProgressMonitor(1), this.force);<NEW_LINE>if (!cu.isWorkingCopy()) {<NEW_LINE>// if unit is working copy, then save will have already fired the delta<NEW_LINE>addDelta(delta);<NEW_LINE>setAttribute(HAS_MODIFIED_RESOURCE_ATTR, TRUE);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
(cu)).getElements();
776,614
private static void addGstreamerPathsToEnv() {<NEW_LINE>if (System.getProperty("jna.nosys") == null) {<NEW_LINE>System.setProperty("jna.nosys", "true");<NEW_LINE>}<NEW_LINE>Path gstreamerPath = InstalledFileLocator.getDefault().locate("gstreamer", Installer.class.getPackage().getName(), false).toPath();<NEW_LINE>if (gstreamerPath == null) {<NEW_LINE>logger.log(Level.SEVERE, "Failed to find GStreamer.");<NEW_LINE>} else {<NEW_LINE>String arch = "x86_64";<NEW_LINE>if (!PlatformUtil.is64BitJVM()) {<NEW_LINE>arch = "x86";<NEW_LINE>}<NEW_LINE>Path gstreamerBasePath = Paths.get(gstreamerPath.toString(), "1.0", arch);<NEW_LINE>Path gstreamerBinPath = Paths.get(gstreamerBasePath.toString(), "bin");<NEW_LINE>Path gstreamerLibPath = Paths.get(gstreamerBasePath.<MASK><NEW_LINE>// Update the PATH environment variable to contain the GStreamer<NEW_LINE>// lib and bin paths.<NEW_LINE>Kernel32 k32 = Kernel32.INSTANCE;<NEW_LINE>String path = System.getenv("PATH");<NEW_LINE>if (StringUtils.isBlank(path)) {<NEW_LINE>k32.SetEnvironmentVariable("PATH", gstreamerLibPath.toString());<NEW_LINE>} else {<NEW_LINE>k32.SetEnvironmentVariable("PATH", gstreamerBinPath.toString() + File.pathSeparator + gstreamerLibPath.toString() + path);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
toString(), "lib", "gstreamer-1.0");
1,245,092
public void importCity(ActionRequest request, ActionResponse response) {<NEW_LINE>try {<NEW_LINE>List<ImportHistory> importHistoryList = null;<NEW_LINE>Map<String, Object> importCityMap = null;<NEW_LINE>MetaFile errorFile = null;<NEW_LINE>String typeSelect = (String) request.getContext().get("typeSelect");<NEW_LINE>if (CityRepository.TYPE_SELECT_GEONAMES.equals(typeSelect)) {<NEW_LINE>String importTypeSelect = (String) request.getContext().get("importTypeSelect");<NEW_LINE>switch(importTypeSelect) {<NEW_LINE>case CityRepository.IMPORT_TYPE_SELECT_AUTO:<NEW_LINE>String downloadFileName = (String) request.getContext().get("autoImportTypeSelect");<NEW_LINE>importCityMap = Beans.get(ImportCityService.class).importFromGeonamesAutoConfig(downloadFileName, typeSelect);<NEW_LINE>break;<NEW_LINE>case CityRepository.IMPORT_TYPE_SELECT_MANUAL:<NEW_LINE>Map<String, Object> map = (LinkedHashMap<String, Object>) request.getContext().get("metaFile");<NEW_LINE>importCityMap = Beans.get(ImportCityService.class).importFromGeonamesManualConfig(map, typeSelect);<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (importCityMap.containsKey("importHistoryList") && importCityMap.containsKey("errorFile")) {<NEW_LINE>importHistoryList = (List<ImportHistory>) importCityMap.get("importHistoryList");<NEW_LINE>errorFile = (MetaFile) importCityMap.get("errorFile");<NEW_LINE>if (errorFile != null) {<NEW_LINE>response.setFlash(I18n.get(IExceptionMessage.CITIES_IMPORT_FAILED));<NEW_LINE>response.setAttr("errorFile", "hidden", false);<NEW_LINE>response.setValue("errorFile", errorFile);<NEW_LINE>} else {<NEW_LINE>response.setAttr("$importHistoryList", "hidden", false);<NEW_LINE>response.setAttr("errorFile", "hidden", true);<NEW_LINE>response.setAttr("$importHistoryList", "value", importHistoryList);<NEW_LINE>response.setFlash(I18n.get(ITranslation.BASE_GEONAMES_CITY_IMPORT_COMPLETED));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
TraceBackService.trace(response, e);
130,369
private Object jpql(Business business, Statement statement, Runtime runtime) throws Exception {<NEW_LINE>Object data = null;<NEW_LINE>Class<? extends JpaObject> cls = this.clazz(business, statement);<NEW_LINE>EntityManager em;<NEW_LINE>if (StringUtils.equalsIgnoreCase(statement.getEntityCategory(), Statement.ENTITYCATEGORY_DYNAMIC) && StringUtils.equalsIgnoreCase(statement.getType(), Statement.TYPE_SELECT)) {<NEW_LINE>em = business.entityManagerContainer().get(DynamicBaseEntity.class);<NEW_LINE>} else {<NEW_LINE>em = business.entityManagerContainer().get(cls);<NEW_LINE>}<NEW_LINE>Query query = em.<MASK><NEW_LINE>for (Parameter<?> p : query.getParameters()) {<NEW_LINE>if (runtime.hasParameter(p.getName())) {<NEW_LINE>query.setParameter(p.getName(), runtime.getParameter(p.getName()));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (StringUtils.equalsIgnoreCase(statement.getType(), Statement.TYPE_SELECT)) {<NEW_LINE>if (isPageSql(statement.getData())) {<NEW_LINE>query.setFirstResult((runtime.page - 1) * runtime.size);<NEW_LINE>query.setMaxResults(runtime.size);<NEW_LINE>}<NEW_LINE>data = query.getResultList();<NEW_LINE>} else {<NEW_LINE>business.entityManagerContainer().beginTransaction(cls);<NEW_LINE>data = Integer.valueOf(query.executeUpdate());<NEW_LINE>business.entityManagerContainer().commit();<NEW_LINE>}<NEW_LINE>return data;<NEW_LINE>}
createQuery(statement.getData());
373,999
private void callClassModuleBuilder(String name, boolean is_singleton) {<NEW_LINE><MASK><NEW_LINE>int i = mg.newLocal(Types.RUBY_VALUE_TYPE);<NEW_LINE>mg.storeLocal(i);<NEW_LINE>String uniqueName = NameFactory.createClassnameForClassModuleBuilder(extra_, script_name_, name);<NEW_LINE>Type builder = Type.getType("L" + uniqueName + ";");<NEW_LINE>mg.newInstance(builder);<NEW_LINE>mg.dup();<NEW_LINE>mg.invokeConstructor(builder, CgUtil.CONSTRUCTOR);<NEW_LINE>mg.loadLocal(i);<NEW_LINE>mg.pushNull();<NEW_LINE>mg.pushNull();<NEW_LINE>mg.loadLocal(i);<NEW_LINE>mg.invokeVirtual(builder, CgUtil.getMethod("invoke", Types.RUBY_VALUE_TYPE, Types.RUBY_VALUE_TYPE, Types.RUBY_ARRAY_TYPE, Types.RUBY_BLOCK_TYPE, Types.RUBY_MODULE_TYPE));<NEW_LINE>switchToNewClassGenerator(new ClassGeneratorForClassModuleBuilder(uniqueName, script_name_, null, is_singleton));<NEW_LINE>}
MethodGenerator mg = cg_.getMethodGenerator();
42,341
public Pair<Boolean, String> updateSource(SourceRequest sourceRequest) {<NEW_LINE>final String path = HTTP_PATH + "/source/update";<NEW_LINE>final String url = formatUrl(path);<NEW_LINE>final String storage = GsonUtil.toJson(sourceRequest);<NEW_LINE>final RequestBody storageBody = RequestBody.create(MediaType.parse("application/json"), storage);<NEW_LINE>Request request = new Request.Builder().method("POST", storageBody).url(url).build();<NEW_LINE>Call call = httpClient.newCall(request);<NEW_LINE>try {<NEW_LINE>okhttp3.Response response = call.execute();<NEW_LINE>String body = response.body().string();<NEW_LINE>assertHttpSuccess(response, body, path);<NEW_LINE>Response <MASK><NEW_LINE>if (responseBody.getData() != null) {<NEW_LINE>return Pair.of(Boolean.valueOf(responseBody.getData().toString()), responseBody.getErrMsg());<NEW_LINE>} else {<NEW_LINE>return Pair.of(false, responseBody.getErrMsg());<NEW_LINE>}<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new RuntimeException(String.format("Inlong source update failed with ex:%s", e.getMessage()), e);<NEW_LINE>}<NEW_LINE>}
responseBody = InlongParser.parseResponse(body);
1,791,293
public void batchSizeLimited() {<NEW_LINE>ServiceBusMessage firstMessage = new ServiceBusMessage(BinaryData.fromBytes("message-1".getBytes(UTF_8)));<NEW_LINE>firstMessage.getApplicationProperties().put("telemetry", "latency");<NEW_LINE>ServiceBusMessage secondMessage = new ServiceBusMessage(BinaryData.fromBytes("message-2".getBytes(UTF_8)));<NEW_LINE>secondMessage.getApplicationProperties(<MASK><NEW_LINE>ServiceBusMessage thirdMessage = new ServiceBusMessage(BinaryData.fromBytes("message-3".getBytes(UTF_8)));<NEW_LINE>thirdMessage.getApplicationProperties().put("telemetry", "fps");<NEW_LINE>// BEGIN: com.azure.messaging.servicebus.servicebussenderclient.createMessageBatch#CreateMessageBatchOptions-int<NEW_LINE>List<ServiceBusMessage> telemetryMessages = Arrays.asList(firstMessage, secondMessage, thirdMessage);<NEW_LINE>// Setting `setMaximumSizeInBytes` when creating a batch, limits the size of that batch.<NEW_LINE>// In this case, all the batches created with these options are limited to 256 bytes.<NEW_LINE>CreateMessageBatchOptions options = new CreateMessageBatchOptions().setMaximumSizeInBytes(256);<NEW_LINE>ServiceBusMessageBatch currentBatch = sender.createMessageBatch(options);<NEW_LINE>// For each telemetry message, we try to add it to the current batch.<NEW_LINE>// When the batch is full, send it then create another batch to add more mesages to.<NEW_LINE>for (ServiceBusMessage message : telemetryMessages) {<NEW_LINE>if (!currentBatch.tryAddMessage(message)) {<NEW_LINE>sender.sendMessages(currentBatch);<NEW_LINE>currentBatch = sender.createMessageBatch(options);<NEW_LINE>// Add the message we couldn't before.<NEW_LINE>if (!currentBatch.tryAddMessage(message)) {<NEW_LINE>throw new IllegalArgumentException("Message is too large for an empty batch.");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// END: com.azure.messaging.servicebus.servicebussenderclient.createMessageBatch#CreateMessageBatchOptions-int<NEW_LINE>}
).put("telemetry", "cpu-temperature");
1,144,321
private void create(Properties ctx, TransformerHandler document, PO entity, boolean includeParents, List<String> excludedParentList, boolean isFromParent) throws SAXException {<NEW_LINE>int tableId = 0;<NEW_LINE>String tableName = null;<NEW_LINE>int recordId = 0;<NEW_LINE>if (entity != null) {<NEW_LINE>tableId = entity.get_Table_ID();<NEW_LINE>tableName = entity.get_TableName();<NEW_LINE>recordId = entity.get_ID();<NEW_LINE>} else {<NEW_LINE>tableId = Env.getContextAsInt(ctx, TABLE_ID_TAG);<NEW_LINE>recordId = Env.getContextAsInt(ctx, RECORD_ID_TAG);<NEW_LINE>}<NEW_LINE>if (tableId <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Instance PO<NEW_LINE>if (entity == null) {<NEW_LINE>entity = getCreatePO(ctx, tableId, recordId, null);<NEW_LINE>}<NEW_LINE>if (entity == null) {<NEW_LINE>entity = getCreatePO(<MASK><NEW_LINE>}<NEW_LINE>if (entity == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Validate if was processed<NEW_LINE>String key = entity.get_UUID();<NEW_LINE>if (list.contains(key)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>list.add(key);<NEW_LINE>// Create parents<NEW_LINE>if (includeParents) {<NEW_LINE>createParent(ctx, document, entity, excludedParentList);<NEW_LINE>}<NEW_LINE>AttributesImpl defaultAttributes = customValues.getAttributes();<NEW_LINE>AttributesImpl atts = createBinding(ctx, entity, defaultAttributes);<NEW_LINE>if (atts != null) {<NEW_LINE>document.startElement("", "", getTagName(entity), atts);<NEW_LINE>document.endElement("", "", getTagName(entity));<NEW_LINE>}<NEW_LINE>// Create translation<NEW_LINE>createTranslation(ctx, document, entity);<NEW_LINE>// Create Node<NEW_LINE>createTreeNode(ctx, document, entity);<NEW_LINE>if (!isFromParent) {<NEW_LINE>customValues.cleanValues();<NEW_LINE>}<NEW_LINE>}
ctx, tableName, recordId, null);
200,700
public void config(final OServerNetworkListener iListener, final OServer iServer, final Socket iSocket, final OContextConfiguration iConfiguration) throws IOException {<NEW_LINE>configuration = iConfiguration;<NEW_LINE>final boolean installDefaultCommands = iConfiguration.getValueAsBoolean(OGlobalConfiguration.NETWORK_HTTP_INSTALL_DEFAULT_COMMANDS);<NEW_LINE>if (installDefaultCommands)<NEW_LINE>registerStatelessCommands(iListener);<NEW_LINE>final String addHeaders = iConfiguration.getValueAsString("network.http.additionalResponseHeaders", null);<NEW_LINE>if (addHeaders != null)<NEW_LINE>additionalResponseHeaders = addHeaders.split(";");<NEW_LINE>// CREATE THE CLIENT CONNECTION<NEW_LINE>connection = iServer.getClientConnectionManager().connect(this);<NEW_LINE>server = iServer;<NEW_LINE>requestMaxContentLength = iConfiguration.getValueAsInteger(OGlobalConfiguration.NETWORK_HTTP_MAX_CONTENT_LENGTH);<NEW_LINE>socketTimeout = iConfiguration.getValueAsInteger(OGlobalConfiguration.NETWORK_SOCKET_TIMEOUT);<NEW_LINE>responseCharSet = iConfiguration.getValueAsString(OGlobalConfiguration.NETWORK_HTTP_CONTENT_CHARSET);<NEW_LINE>jsonResponseError = <MASK><NEW_LINE>sameSiteCookie = iConfiguration.getValueAsBoolean(OGlobalConfiguration.NETWORK_HTTP_SESSION_COOKIE_SAME_SITE);<NEW_LINE>channel = new OChannelTextServer(iSocket, iConfiguration);<NEW_LINE>channel.connected();<NEW_LINE>connection.getData().caller = channel.toString();<NEW_LINE>listeningAddress = getListeningAddress();<NEW_LINE>OServerPluginHelper.invokeHandlerCallbackOnSocketAccepted(server, this);<NEW_LINE>start();<NEW_LINE>}
iConfiguration.getValueAsBoolean(OGlobalConfiguration.NETWORK_HTTP_JSON_RESPONSE_ERROR);
796,813
final GetProvisionedConcurrencyConfigResult executeGetProvisionedConcurrencyConfig(GetProvisionedConcurrencyConfigRequest getProvisionedConcurrencyConfigRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getProvisionedConcurrencyConfigRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetProvisionedConcurrencyConfigRequest> request = null;<NEW_LINE>Response<GetProvisionedConcurrencyConfigResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetProvisionedConcurrencyConfigRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getProvisionedConcurrencyConfigRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Lambda");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetProvisionedConcurrencyConfig");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetProvisionedConcurrencyConfigResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetProvisionedConcurrencyConfigResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
676,641
private final char[] optimizedCurrentTokenSource4(char[] source, int startPosition) {<NEW_LINE>char[] src = source;<NEW_LINE>int start = startPosition;<NEW_LINE>char c0, c1 = src[start + 1], c2, c3 = src[start + 3];<NEW_LINE>int hash = (((c0 = src[start]) << 6) + (c2 = src[start + 2])) % TABLE_SIZE;<NEW_LINE>char[][] table = this.charArray_length[2][hash];<NEW_LINE>int i = this.newEntry4;<NEW_LINE>while (++i < INTERNAL_TABLE_SIZE) {<NEW_LINE>char[] charArray = table[i];<NEW_LINE>if ((c0 == charArray[0]) && (c1 == charArray[1]) && (c2 == charArray[2]) && (c3 == charArray[3]))<NEW_LINE>return charArray;<NEW_LINE>}<NEW_LINE>// ---------other side---------<NEW_LINE>i = -1;<NEW_LINE>int max = this.newEntry4;<NEW_LINE>while (++i <= max) {<NEW_LINE>char<MASK><NEW_LINE>if ((c0 == charArray[0]) && (c1 == charArray[1]) && (c2 == charArray[2]) && (c3 == charArray[3]))<NEW_LINE>return charArray;<NEW_LINE>}<NEW_LINE>// --------add the entry-------<NEW_LINE>if (++max >= INTERNAL_TABLE_SIZE)<NEW_LINE>max = 0;<NEW_LINE>char[] r;<NEW_LINE>System.arraycopy(src, start, r = new char[4], 0, 4);<NEW_LINE>return table[this.newEntry4 = max] = r;<NEW_LINE>}
[] charArray = table[i];
809,683
public void run(Collection<ITestRunListener> listeners) throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException, IOException {<NEW_LINE>final String runCaseCommandStr = String.format("uiautomator runtest %1$s %2$s", jarFile, buildArgsCommand());<NEW_LINE>Log.i(LOG_TAG, String.format("Running %1$s on %2$s", runCaseCommandStr, mRemoteDevice.getSerialNumber()));<NEW_LINE>mParser <MASK><NEW_LINE>try {<NEW_LINE>mRemoteDevice.executeShellCommand(runCaseCommandStr, mParser, mMaxTimeToOutputResponse);<NEW_LINE>} catch (IOException e) {<NEW_LINE>Log.w(LOG_TAG, String.format("IOException %1$s when running tests %2$s on %3$s", e.toString(), jarFile, mRemoteDevice.getSerialNumber()));<NEW_LINE>// rely on parser to communicate results to listeners<NEW_LINE>mParser.handleTestRunFailed(e.toString());<NEW_LINE>throw e;<NEW_LINE>} catch (ShellCommandUnresponsiveException e) {<NEW_LINE>Log.w(LOG_TAG, String.format("ShellCommandUnresponsiveException %1$s when running tests %2$s on %3$s", e.toString(), jarFile, mRemoteDevice.getSerialNumber()));<NEW_LINE>mParser.handleTestRunFailed(String.format("Failed to receive adb shell test output within %1$d ms. " + "Test may have timed out, or adb connection to device became unresponsive", mMaxTimeToOutputResponse));<NEW_LINE>throw e;<NEW_LINE>} catch (TimeoutException e) {<NEW_LINE>Log.w(LOG_TAG, String.format("TimeoutException when running tests %1$s on %2$s", jarFile, mRemoteDevice.getSerialNumber()));<NEW_LINE>mParser.handleTestRunFailed(e.toString());<NEW_LINE>throw e;<NEW_LINE>} catch (AdbCommandRejectedException e) {<NEW_LINE>Log.w(LOG_TAG, String.format("AdbCommandRejectedException %1$s when running tests %2$s on %3$s", e.toString(), jarFile, mRemoteDevice.getSerialNumber()));<NEW_LINE>mParser.handleTestRunFailed(e.toString());<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
= new InstrumentationResultParser(mRunName, listeners);
159,966
public void computeFullName(EbicsCertificate entity) {<NEW_LINE>StringBuilder fullName = new StringBuilder();<NEW_LINE>Option item = MetaStore.getSelectionItem("bankpayment.ebics.certificate.type.select", entity.getTypeSelect());<NEW_LINE>if (item != null) {<NEW_LINE>fullName.append(I18n.get(item.getTitle()));<NEW_LINE>}<NEW_LINE>LocalDate date = entity.getValidFrom();<NEW_LINE>if (date != null) {<NEW_LINE>fullName.append(":" + date.format(DateTimeFormatter.ofPattern("dd/MM/yyyy")));<NEW_LINE>date = entity.getValidTo();<NEW_LINE>if (date != null) {<NEW_LINE>fullName.append("-" + date.format(DateTimeFormatter.ofPattern("dd/MM/yyyy")));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>String issuer = entity.getIssuer();<NEW_LINE>if (issuer != null) {<NEW_LINE>fullName.append(":" + issuer);<NEW_LINE>}<NEW_LINE>entity.<MASK><NEW_LINE>}
setFullName(fullName.toString());
1,004,156
public /* (non-Javadoc)<NEW_LINE>* @see com.kkalice.adempiere.migrate.DBEngineInterface#sqlCreateSchema(com.kkalice.adempiere.migrate.Parameters, com.kkalice.adempiere.migrate.Logger, com.kkalice.adempiere.migrate.DBEngine, int, java.lang.String, java.lang.String, java.lang.String, java.lang.String)<NEW_LINE>*/<NEW_LINE>String sqlAdmin_createSchema(int step, String catalogName, String schemaName, String passwd) {<NEW_LINE>StringBuffer sql = new StringBuffer();<NEW_LINE>switch(step) {<NEW_LINE>case 0:<NEW_LINE>sql.append("CREATE USER ").append(schemaName).append(" IDENTIFIED BY ").append(passwd).append(" DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP PROFILE DEFAULT ACCOUNT UNLOCK");<NEW_LINE>break;<NEW_LINE>case 1:<NEW_LINE>sql.append("GRANT CONNECT TO ").append(schemaName);<NEW_LINE>break;<NEW_LINE>case 2:<NEW_LINE>sql.append<MASK><NEW_LINE>break;<NEW_LINE>case 3:<NEW_LINE>sql.append("GRANT RESOURCE TO ").append(schemaName);<NEW_LINE>break;<NEW_LINE>case 4:<NEW_LINE>sql.append("GRANT UNLIMITED TABLESPACE TO ").append(schemaName);<NEW_LINE>break;<NEW_LINE>case 5:<NEW_LINE>sql.append("ALTER USER ").append(schemaName).append(" DEFAULT ROLE CONNECT, RESOURCE, DBA");<NEW_LINE>break;<NEW_LINE>case 6:<NEW_LINE>sql.append("GRANT CREATE TABLE TO ").append(schemaName);<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>if (sql.length() > 0)<NEW_LINE>return sql.toString();<NEW_LINE>else<NEW_LINE>return null;<NEW_LINE>}
("GRANT DBA TO ").append(schemaName);
1,032,612
public Optional<ColumnOrderByItemSegment> convertToSQLSegment(final SqlNode sqlNode) {<NEW_LINE>if (!(sqlNode instanceof SqlIdentifier)) {<NEW_LINE>return Optional.empty();<NEW_LINE>}<NEW_LINE>SqlIdentifier sqlIdentifier = (SqlIdentifier) sqlNode;<NEW_LINE>if (sqlIdentifier.names.size() > 1) {<NEW_LINE>SqlIdentifier column = sqlIdentifier.getComponent(1);<NEW_LINE>SqlIdentifier owner = sqlIdentifier.getComponent(0);<NEW_LINE>ColumnSegment columnSegment = new ColumnSegment(getStartIndex(sqlIdentifier), getStopIndex(sqlIdentifier), new IdentifierValue<MASK><NEW_LINE>columnSegment.setOwner(new OwnerSegment(getStartIndex(owner), getStopIndex(owner), new IdentifierValue(owner.toString())));<NEW_LINE>return Optional.of(new ColumnOrderByItemSegment(columnSegment, OrderDirection.ASC));<NEW_LINE>}<NEW_LINE>ColumnSegment columnSegment = new ColumnSegment(getStartIndex(sqlIdentifier), getStopIndex(sqlIdentifier), new IdentifierValue(sqlIdentifier.names.get(0)));<NEW_LINE>return Optional.of(new ColumnOrderByItemSegment(columnSegment, OrderDirection.ASC));<NEW_LINE>}
(column.toString()));
1,409,026
private List<Pair<String, ResourceType>> populatePrefixes(Configuration configuration) {<NEW_LINE>List<Pair<String, ResourceType>> prefixes = new ArrayList<>();<NEW_LINE>prefixes.add(Pair.of(configuration.getSqlMigrationPrefix(), ResourceType.MIGRATION));<NEW_LINE>prefixes.add(Pair.of(configuration.getRepeatableSqlMigrationPrefix(), ResourceType.REPEATABLE_MIGRATION));<NEW_LINE>for (Event event : Event.values()) {<NEW_LINE>prefixes.add(Pair.of(event.getId<MASK><NEW_LINE>}<NEW_LINE>Comparator<Pair<String, ResourceType>> prefixComparator = (p1, p2) -> {<NEW_LINE>// Sort most-hard-to-match first; that is, in descending order of prefix length<NEW_LINE>return p2.getLeft().length() - p1.getLeft().length();<NEW_LINE>};<NEW_LINE>prefixes.sort(prefixComparator);<NEW_LINE>return prefixes;<NEW_LINE>}
(), ResourceType.CALLBACK));
1,534,157
protected void work() {<NEW_LINE>Map<TailFile, List<Map>> serverlogs = null;<NEW_LINE>try {<NEW_LINE>TailFile tf = (TailFile) this.get("tfevent");<NEW_LINE>this.setCurrenttfref((CopyOfProcessOfLogagent<MASK><NEW_LINE>// tfref = ((TaildirLogComponent) this.get("tfref"));<NEW_LINE>serverlogs = this.getCurrenttfref().tailFileProcessSeprate(tf, true);<NEW_LINE>for (Entry<TailFile, List<Map>> applogs : serverlogs.entrySet()) {<NEW_LINE>if (log.isDebugEnable()) {<NEW_LINE>log.debug(this, "### Logvalue ###: " + applogs.getValue());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!(serverlogs.isEmpty())) {<NEW_LINE>this.getCurrenttfref().sendLogDataBatch(serverlogs);<NEW_LINE>} else {<NEW_LINE>if (log.isDebugEnable()) {<NEW_LINE>log.debug(this, "serverlogs is emptry!!!");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} catch (Throwable t) {<NEW_LINE>log.err(this, "Unable to tail files.", t);<NEW_LINE>} finally {<NEW_LINE>if (null != serverlogs) {<NEW_LINE>serverlogs.clear();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
) this.get("tfref"));
1,537,830
public Map<String, Histogram> readChronicle() {<NEW_LINE>try (final ChronicleQueue q = createQueue()) {<NEW_LINE>final ExcerptTailer tailer = q.createTailer();<NEW_LINE>final WireParselet parselet = parselet();<NEW_LINE>final FieldNumberParselet fieldNumberParselet = (methodId, wire) -> parselet.accept(Long.toString(methodId), wire.read());<NEW_LINE>MessageHistory<MASK><NEW_LINE>try (final MethodReader mr = new VanillaMethodReader(tailer, true, parselet, fieldNumberParselet, null, parselet)) {<NEW_LINE>while (!Thread.currentThread().isInterrupted() && mr.readOne()) {<NEW_LINE>++counter;<NEW_LINE>if (this.progress && counter % 1_000_000L == 0) {<NEW_LINE>Jvm.debug().on(getClass(), "Progress: " + counter);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return histos;<NEW_LINE>}
.set(new VanillaMessageHistory());
254,748
private void handleEntityData(byte[] data, int size, long totalSize, long contentLength) throws IOException {<NEW_LINE>if (responseOut == null) {<NEW_LINE>if (responseFile != null) {<NEW_LINE>createFileResponseData(false);<NEW_LINE>} else if (contentLength > maxBufferSize) {<NEW_LINE>createFileResponseData(false);<NEW_LINE>} else {<NEW_LINE>long streamSize = contentLength > 0 ? contentLength : 512;<NEW_LINE>responseOut = new ByteArrayOutputStream((int) streamSize);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (totalSize > maxBufferSize && responseOut instanceof ByteArrayOutputStream) {<NEW_LINE>// Content length may not have been reported, dump the current stream<NEW_LINE>// to a file and re-open as a FileOutputStream w/ append<NEW_LINE>createFileResponseData(true);<NEW_LINE>}<NEW_LINE>responseOut.write(data, 0, size);<NEW_LINE>KrollDict callbackData = new KrollDict();<NEW_LINE>callbackData.put("totalCount", contentLength);<NEW_LINE><MASK><NEW_LINE>callbackData.put(TiC.PROPERTY_SIZE, size);<NEW_LINE>// return progress as -1 if it is outside the valid range<NEW_LINE>double progress = ((double) totalSize) / ((double) contentLength);<NEW_LINE>if (progress > 1 || progress < 0) {<NEW_LINE>progress = NetworkModule.PROGRESS_UNKNOWN;<NEW_LINE>}<NEW_LINE>callbackData.put("progress", progress);<NEW_LINE>dispatchCallback(TiC.PROPERTY_ONDATASTREAM, callbackData);<NEW_LINE>}
callbackData.put("totalSize", totalSize);
1,356,590
public ValueHolder<V> replace(K key, V value) throws StoreAccessException {<NEW_LINE>@SuppressWarnings("unchecked")<NEW_LINE>V[] old = (V<MASK><NEW_LINE>BiFunction<K, V, V> remappingFunction = (k, inCache) -> {<NEW_LINE>inCache = loadFromLoaderWriter(key, inCache);<NEW_LINE>if (inCache == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>cacheLoaderWriter.write(key, value);<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new StorePassThroughException(newCacheWritingException(e));<NEW_LINE>}<NEW_LINE>old[0] = inCache;<NEW_LINE>if (newValueAlreadyExpired(LOG, expiry, key, inCache, value)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return value;<NEW_LINE>};<NEW_LINE>delegate.getAndCompute(key, remappingFunction);<NEW_LINE>if (old[0] == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return new LoaderWriterValueHolder<>(old[0]);<NEW_LINE>}
[]) new Object[1];
1,379,444
public void delete(Set<String> declarationNames) throws InvokerException {<NEW_LINE>Map<Identifier, GlobalVariable> queuedGlobalVars = new HashMap<>();<NEW_LINE>Map<Identifier, String> queuedModuleDclns = new HashMap<>();<NEW_LINE>for (String declarationName : declarationNames) {<NEW_LINE>Identifier identifier = new Identifier(declarationName);<NEW_LINE>if (globalVars.containsKey(identifier)) {<NEW_LINE>queuedGlobalVars.put(identifier, globalVars.get(identifier));<NEW_LINE>} else if (moduleDclns.containsKey(identifier)) {<NEW_LINE>queuedModuleDclns.put(identifier, moduleDclns.get(identifier));<NEW_LINE>} else {<NEW_LINE>addErrorDiagnostic(declarationName + " is not defined.\n" + "Please enter names of declarations that are already defined.");<NEW_LINE>throw new InvokerException();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>queuedGlobalVars.keySet().forEach(globalVars::remove);<NEW_LINE>queuedModuleDclns.keySet(<MASK><NEW_LINE>processCurrentState();<NEW_LINE>} catch (InvokerException e) {<NEW_LINE>globalVars.putAll(queuedGlobalVars);<NEW_LINE>moduleDclns.putAll(queuedModuleDclns);<NEW_LINE>addErrorDiagnostic("Deleting declaration(s) failed.");<NEW_LINE>throw e;<NEW_LINE>}<NEW_LINE>}
).forEach(moduleDclns::remove);
706,163
public void write(final char[] cbuf, final int off, final int len) throws IOException {<NEW_LINE>if (thread == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (thread.isInterrupted()) {<NEW_LINE>content = null;<NEW_LINE>thread = null;<NEW_LINE>throw new InterruptedIOException();<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>content.insertChars(content.length() - 1, cbuf, off, len);<NEW_LINE>if (content.length() > nextMessageThreshold) {<NEW_LINE>nextMessageThreshold += nextMessageIncrement;<NEW_LINE>final String message = String.format("Rendering: %,9d chars", content.length());<NEW_LINE>SwingUtilities.invokeLater(() -> {<NEW_LINE>if (jtextArea.getDocument() == originalDocument) {<NEW_LINE>jtextArea.setText(message);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}<NEW_LINE>} catch (BadLocationException e1) {<NEW_LINE>thread.interrupt();<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
throw new IOException("Bad location in TextAreaWriter::write", e1);
1,609,669
public void onTestIgnored(@Nonnull final TestIgnoredEvent testIgnoredEvent) {<NEW_LINE>addToInvokeLater(() -> {<NEW_LINE>final String testName = testIgnoredEvent.getName();<NEW_LINE>if (testName == null) {<NEW_LINE>logProblem("TestIgnored event: no name");<NEW_LINE>}<NEW_LINE>String ignoreComment = testIgnoredEvent.getIgnoreComment();<NEW_LINE>final String stackTrace = testIgnoredEvent.getStacktrace();<NEW_LINE>final String fullTestName = getFullTestName(testName);<NEW_LINE>SMTestProxy testProxy = getProxyByFullTestName(fullTestName);<NEW_LINE>if (testProxy == null) {<NEW_LINE>final boolean debugMode = SMTestRunnerConnectionUtil.isInDebugMode();<NEW_LINE>logProblem("Test wasn't started! " + "TestIgnored event: name = {" + testName + "}, " + "message = {" + ignoreComment <MASK><NEW_LINE>if (debugMode) {<NEW_LINE>return;<NEW_LINE>} else {<NEW_LINE>// try to fix<NEW_LINE>// 1. report test opened<NEW_LINE>onTestStarted(new TestStartedEvent(testName, null));<NEW_LINE>// 2. report failure<NEW_LINE>testProxy = getProxyByFullTestName(fullTestName);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (testProxy == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>testProxy.setTestIgnored(ignoreComment, stackTrace);<NEW_LINE>// fire event<NEW_LINE>fireOnTestIgnored(testProxy);<NEW_LINE>});<NEW_LINE>}
+ "}. " + cannotFindFullTestNameMsg(fullTestName));
1,565,359
public static String calculatePathMD5(final Path path) throws IOException {<NEW_LINE>// This doesn't have as nice error messages as FileUtils, but it's close.<NEW_LINE>String fname = path.toUri().toString();<NEW_LINE>if (!Files.exists(path)) {<NEW_LINE>throw new FileNotFoundException("File '" + fname + "' does not exist");<NEW_LINE>}<NEW_LINE>if (Files.isDirectory(path)) {<NEW_LINE>throw new IOException("File '" + fname + "' exists but is a directory");<NEW_LINE>}<NEW_LINE>if (!Files.isRegularFile(path)) {<NEW_LINE>throw new IOException("File '" + fname + "' exists but is not a regular file");<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final MessageDigest md = MessageDigest.getInstance("MD5");<NEW_LINE>final byte[] buff = new byte[8192];<NEW_LINE>final InputStream <MASK><NEW_LINE>int bytesRead;<NEW_LINE>while ((bytesRead = is.read(buff)) > 0) {<NEW_LINE>md.update(buff, 0, bytesRead);<NEW_LINE>}<NEW_LINE>return Utils.MD5ToString(md.digest());<NEW_LINE>} catch (final NoSuchAlgorithmException e) {<NEW_LINE>throw new IllegalStateException("MD5 digest algorithm not present", e);<NEW_LINE>}<NEW_LINE>}
is = Files.newInputStream(path);
784,763
public void run(RegressionEnvironment env) {<NEW_LINE>EPStage stageA = env.stageService().getStage("ST");<NEW_LINE>env.compileDeploy("@name('s0') select * from SupportBean");<NEW_LINE>String deploymentId = env.deploymentId("s0");<NEW_LINE>stageIt(env, "ST", deploymentId);<NEW_LINE>try {<NEW_LINE>stageA.destroy();<NEW_LINE>fail();<NEW_LINE>} catch (EPException ex) {<NEW_LINE>assertEquals("Failed to destroy stage 'ST': The stage has existing deployments", ex.getMessage());<NEW_LINE>}<NEW_LINE>unstageIt(env, "ST", deploymentId);<NEW_LINE>stageA.destroy();<NEW_LINE>assertEquals("ST", stageA.getURI());<NEW_LINE>tryInvalidDestroyed((<MASK><NEW_LINE>tryInvalidDestroyed(() -> stageA.getDeploymentService());<NEW_LINE>tryInvalidDestroyed(() -> {<NEW_LINE>try {<NEW_LINE>stageA.stage(Collections.singletonList(deploymentId));<NEW_LINE>} catch (EPStageException ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>tryInvalidDestroyed(() -> {<NEW_LINE>try {<NEW_LINE>stageA.unstage(Collections.singletonList(deploymentId));<NEW_LINE>} catch (EPStageException ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>env.undeployAll();<NEW_LINE>}
) -> stageA.getEventService());
1,195,115
public io.kubernetes.client.proto.V1beta1Apiextensions.JSONSchemaPropsOrArray buildPartial() {<NEW_LINE>io.kubernetes.client.proto.V1beta1Apiextensions.JSONSchemaPropsOrArray result = new io.kubernetes.client.<MASK><NEW_LINE>int from_bitField0_ = bitField0_;<NEW_LINE>int to_bitField0_ = 0;<NEW_LINE>if (((from_bitField0_ & 0x00000001) == 0x00000001)) {<NEW_LINE>to_bitField0_ |= 0x00000001;<NEW_LINE>}<NEW_LINE>if (schemaBuilder_ == null) {<NEW_LINE>result.schema_ = schema_;<NEW_LINE>} else {<NEW_LINE>result.schema_ = schemaBuilder_.build();<NEW_LINE>}<NEW_LINE>if (jSONSchemasBuilder_ == null) {<NEW_LINE>if (((bitField0_ & 0x00000002) == 0x00000002)) {<NEW_LINE>jSONSchemas_ = java.util.Collections.unmodifiableList(jSONSchemas_);<NEW_LINE>bitField0_ = (bitField0_ & ~0x00000002);<NEW_LINE>}<NEW_LINE>result.jSONSchemas_ = jSONSchemas_;<NEW_LINE>} else {<NEW_LINE>result.jSONSchemas_ = jSONSchemasBuilder_.build();<NEW_LINE>}<NEW_LINE>result.bitField0_ = to_bitField0_;<NEW_LINE>onBuilt();<NEW_LINE>return result;<NEW_LINE>}
proto.V1beta1Apiextensions.JSONSchemaPropsOrArray(this);
449,506
private void runAssertion_A_Bstar(RegressionEnvironment env, AtomicInteger milestone, boolean allMatches) {<NEW_LINE>sendTimer(env, 0);<NEW_LINE>String[] fields = "a,b0,b1,b2".split(",");<NEW_LINE>String text = "@name('s0') select * from SupportRecogBean#keepall " + "match_recognize (" + " measures A.theString as a, B[0].theString as b0, B[1].theString as b1, B[2].theString as b2" + (allMatches ? " all matches" : "") + " pattern (A B*)" + " interval 10 seconds or terminated" + " define" + " A as A.theString like \"A%\"," + " B as B.theString like \"B%\"" + ")";<NEW_LINE>env.compileDeploy(text).addListener("s0");<NEW_LINE>// test output by terminated because of misfit event<NEW_LINE>env.sendEventBean(new SupportRecogBean("A1"));<NEW_LINE>env.sendEventBean(new SupportRecogBean("B1"));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>env.<MASK><NEW_LINE>if (!allMatches) {<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "A1", "B1", null, null });<NEW_LINE>} else {<NEW_LINE>env.assertListener("s0", listener -> {<NEW_LINE>EPAssertionUtil.assertPropsPerRowAnyOrder(listener.getAndResetLastNewData(), fields, new Object[][] { { "A1", "B1", null, null }, { "A1", null, null, null } });<NEW_LINE>});<NEW_LINE>}<NEW_LINE>env.milestoneInc(milestone);<NEW_LINE>sendTimer(env, 20000);<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>// test output by timer expiry<NEW_LINE>env.sendEventBean(new SupportRecogBean("A2"));<NEW_LINE>env.sendEventBean(new SupportRecogBean("B2"));<NEW_LINE>env.assertListenerNotInvoked("s0");<NEW_LINE>sendTimer(env, 29999);<NEW_LINE>sendTimer(env, 30000);<NEW_LINE>if (!allMatches) {<NEW_LINE>env.assertPropsNew("s0", fields, new Object[] { "A2", "B2", null, null });<NEW_LINE>} else {<NEW_LINE>env.assertListener("s0", listener -> {<NEW_LINE>EPAssertionUtil.assertPropsPerRowAnyOrder(listener.getAndResetLastNewData(), fields, new Object[][] { { "A2", "B2", null, null }, { "A2", null, null, null } });<NEW_LINE>});<NEW_LINE>}<NEW_LINE>// destroy<NEW_LINE>env.undeployAll();<NEW_LINE>}
sendEventBean(new SupportRecogBean("X1"));
1,548,892
public void deleteV2LoggingLevel(DeleteV2LoggingLevelRequest deleteV2LoggingLevelRequest) throws AmazonServiceException, AmazonClientException {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(deleteV2LoggingLevelRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<DeleteV2LoggingLevelRequest> request = null;<NEW_LINE>Response<Void> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new DeleteV2LoggingLevelRequestMarshaller().marshall(deleteV2LoggingLevelRequest);<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>JsonResponseHandler<Void> responseHandler = new JsonResponseHandler<Void>(null);<NEW_LINE>invoke(request, responseHandler, executionContext);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.ClientExecuteTime);<NEW_LINE>endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
1,681,394
public void testRxObservableInvoker_postReceiveTimeout(Map<String, String> param, StringBuilder ret) {<NEW_LINE>long timeout = messageTimeout;<NEW_LINE>if (isZOS()) {<NEW_LINE>timeout = zTimeout;<NEW_LINE>}<NEW_LINE>String serverIP = param.get("serverIP");<NEW_LINE>String serverPort = param.get("serverPort");<NEW_LINE>ClientBuilder cb = ClientBuilder.newBuilder();<NEW_LINE>// cb.property("com.ibm.ws.jaxrs.client.receive.timeout", TIMEOUT);<NEW_LINE>cb.readTimeout(TIMEOUT, TimeUnit.MILLISECONDS);<NEW_LINE>Client c = cb.build();<NEW_LINE>c.register(RxObservableInvokerProvider.class);<NEW_LINE>WebTarget t = c.target("http://" + serverIP + <MASK><NEW_LINE>Builder builder = t.request();<NEW_LINE>rx.Observable<Response> observable = builder.rx(RxObservableInvoker.class).post(Entity.xml(Long.toString(SLEEP)));<NEW_LINE>long startTime = System.currentTimeMillis();<NEW_LINE>final Holder<Response> holder = new Holder<Response>();<NEW_LINE>final CountDownLatch countDownLatch = new CountDownLatch(1);<NEW_LINE>observable.subscribe(v -> {<NEW_LINE>// OnNext<NEW_LINE>holder.value = v;<NEW_LINE>}, throwable -> {<NEW_LINE>if (throwable.getMessage().contains("SocketTimeoutException")) {<NEW_LINE>// OnError<NEW_LINE>ret.append("Timeout as expected");<NEW_LINE>} else {<NEW_LINE>ret.append("throwable");<NEW_LINE>throwable.printStackTrace();<NEW_LINE>}<NEW_LINE>countDownLatch.countDown();<NEW_LINE>}, // OnCompleted<NEW_LINE>() -> ret.append("OnCompleted"));<NEW_LINE>try {<NEW_LINE>if (!(countDownLatch.await(timeout, TimeUnit.SECONDS))) {<NEW_LINE>throw new RuntimeException("testRxObservableInvoker_postReceiveTimeout: Response took too long. Waited " + timeout);<NEW_LINE>}<NEW_LINE>} catch (InterruptedException ex) {<NEW_LINE>ex.printStackTrace();<NEW_LINE>}<NEW_LINE>long elapsed = System.currentTimeMillis() - startTime;<NEW_LINE>System.out.println("testRxObservableInvoker_postReceiveTimeout with TIMEOUT " + TIMEOUT + " OnError elapsed time " + elapsed);<NEW_LINE>c.close();<NEW_LINE>}
":" + serverPort + "/jaxrs21bookstore/JAXRS21bookstore2/post/" + SLEEP);
329,506
private static boolean check_ARB_vertex_attrib_64bit(FunctionProvider provider, PointerBuffer caps, Set<String> ext) {<NEW_LINE>if (!ext.contains("GL_ARB_vertex_attrib_64bit")) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int flag0 = ext.contains("GL_EXT_direct_state_access") ? 0 : Integer.MIN_VALUE;<NEW_LINE>return (checkFunctions(provider, caps, new int[] { 838, 839, 840, 841, 842, 843, 844, 845, 846, 847, flag0 + 1384 }, "glVertexAttribL1d", "glVertexAttribL2d", "glVertexAttribL3d", "glVertexAttribL4d", "glVertexAttribL1dv", "glVertexAttribL2dv", "glVertexAttribL3dv", "glVertexAttribL4dv", "glVertexAttribLPointer", "glGetVertexAttribLdv", "glVertexArrayVertexAttribLOffsetEXT")<MASK><NEW_LINE>}
) || reportMissing("GL", "GL_ARB_vertex_attrib_64bit");
614,448
public void select(int mode) {<NEW_LINE>if (searchPoint == null) {<NEW_LINE>Toast.makeText(getActivity(), R.string.please_select_address, Toast.LENGTH_SHORT).show();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>AddressInformation ai = new AddressInformation();<NEW_LINE>PointDescription pointDescription = ai.getHistoryName();<NEW_LINE>if (!Algorithms.isEmpty(street2) && !Algorithms.isEmpty(street)) {<NEW_LINE>ai = AddressInformation.<MASK><NEW_LINE>pointDescription.setName(street2);<NEW_LINE>pointDescription.setTypeName(getRegionName() + ", " + city);<NEW_LINE>} else if (!Algorithms.isEmpty(building)) {<NEW_LINE>ai = AddressInformation.buildBuilding(getActivity(), osmandSettings);<NEW_LINE>pointDescription.setName(street + ", " + building);<NEW_LINE>pointDescription.setTypeName(getRegionName() + ", " + city);<NEW_LINE>} else if (!Algorithms.isEmpty(street)) {<NEW_LINE>ai = AddressInformation.buildStreet(getActivity(), osmandSettings);<NEW_LINE>pointDescription.setName(street);<NEW_LINE>pointDescription.setTypeName(getRegionName() + ", " + city);<NEW_LINE>} else if (!Algorithms.isEmpty(city)) {<NEW_LINE>ai = AddressInformation.buildCity(getActivity(), osmandSettings);<NEW_LINE>pointDescription.setName(city);<NEW_LINE>pointDescription.setTypeName(getRegionName());<NEW_LINE>}<NEW_LINE>if (mode == SELECT_POINT) {<NEW_LINE>Intent intent = getActivity().getIntent();<NEW_LINE>intent.putExtra(SELECT_ADDRESS_POINT_INTENT_KEY, ai.objectName);<NEW_LINE>intent.putExtra(SELECT_ADDRESS_POINT_LAT, searchPoint.getLatitude());<NEW_LINE>intent.putExtra(SELECT_ADDRESS_POINT_LON, searchPoint.getLongitude());<NEW_LINE>getActivity().setResult(SELECT_ADDRESS_POINT_RESULT_OK, intent);<NEW_LINE>getActivity().finish();<NEW_LINE>} else {<NEW_LINE>if (mode == SHOW_ON_MAP) {<NEW_LINE>osmandSettings.setMapLocationToShow(searchPoint.getLatitude(), searchPoint.getLongitude(), ai.zoom, pointDescription);<NEW_LINE>MapActivity.launchMapActivityMoveToTop(getActivity());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
build2StreetIntersection(getActivity(), osmandSettings);
1,134,928
public static void createProblem(@Nonnull PsiElement elt, @Nonnull HighlightInfo info, TextRange range, @javax.annotation.Nullable ProblemGroup problemGroup, @Nonnull InspectionManager manager, @Nonnull ProblemDescriptionsProcessor problemDescriptionsProcessor, @Nonnull GlobalInspectionContext globalContext) {<NEW_LINE>List<LocalQuickFix> fixes <MASK><NEW_LINE>if (info.quickFixActionRanges != null) {<NEW_LINE>for (Pair<HighlightInfo.IntentionActionDescriptor, TextRange> actionRange : info.quickFixActionRanges) {<NEW_LINE>final IntentionAction action = actionRange.getFirst().getAction();<NEW_LINE>if (action instanceof LocalQuickFix) {<NEW_LINE>fixes.add((LocalQuickFix) action);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>ProblemDescriptor descriptor = manager.createProblemDescriptor(elt, range, createInspectionMessage(StringUtil.notNullize(info.getDescription())), HighlightInfo.convertType(info.type), false, fixes.isEmpty() ? null : fixes.toArray(new LocalQuickFix[fixes.size()]));<NEW_LINE>descriptor.setProblemGroup(problemGroup);<NEW_LINE>problemDescriptionsProcessor.addProblemElement(GlobalInspectionContextUtil.retrieveRefElement(elt, globalContext), descriptor);<NEW_LINE>}
= new ArrayList<LocalQuickFix>();
1,597,586
private void drawStrokes(Canvas canvas) {<NEW_LINE>if (mReversed) {<NEW_LINE>canvas.translate(mBounds.width(), 0);<NEW_LINE>canvas.scale(-1, 1);<NEW_LINE>}<NEW_LINE>float prevValue = 0f;<NEW_LINE><MASK><NEW_LINE>if (mMirrorMode)<NEW_LINE>boundsWidth /= 2;<NEW_LINE>int width = boundsWidth + mSeparatorLength + mSectionsCount;<NEW_LINE>int centerY = mBounds.centerY();<NEW_LINE>float xSectionWidth = 1f / mSectionsCount;<NEW_LINE>float startX;<NEW_LINE>float endX;<NEW_LINE>float firstX = 0;<NEW_LINE>float lastX = 0;<NEW_LINE>float prev;<NEW_LINE>float end;<NEW_LINE>float spaceLength;<NEW_LINE>float xOffset;<NEW_LINE>float ratioSectionWidth;<NEW_LINE>float sectionWidth;<NEW_LINE>float drawLength;<NEW_LINE>int currentIndexColor = mColorsIndex;<NEW_LINE>if (mStartSection == mCurrentSections && mCurrentSections == mSectionsCount) {<NEW_LINE>firstX = canvas.getWidth();<NEW_LINE>}<NEW_LINE>for (int i = 0; i <= mCurrentSections; ++i) {<NEW_LINE>xOffset = xSectionWidth * i + mCurrentOffset;<NEW_LINE>prev = Math.max(0f, xOffset - xSectionWidth);<NEW_LINE>ratioSectionWidth = Math.abs(mInterpolator.getInterpolation(prev) - mInterpolator.getInterpolation(Math.min(xOffset, 1f)));<NEW_LINE>sectionWidth = (int) (width * ratioSectionWidth);<NEW_LINE>if (sectionWidth + prev < width)<NEW_LINE>spaceLength = Math.min(sectionWidth, mSeparatorLength);<NEW_LINE>else<NEW_LINE>spaceLength = 0f;<NEW_LINE>drawLength = sectionWidth > spaceLength ? sectionWidth - spaceLength : 0;<NEW_LINE>end = prevValue + drawLength;<NEW_LINE>if (end > prevValue && i >= mStartSection) {<NEW_LINE>float xFinishingOffset = mInterpolator.getInterpolation(Math.min(mFinishingOffset, 1f));<NEW_LINE>startX = Math.max(xFinishingOffset * width, Math.min(boundsWidth, prevValue));<NEW_LINE>endX = Math.min(boundsWidth, end);<NEW_LINE>drawLine(canvas, boundsWidth, startX, centerY, endX, centerY, currentIndexColor);<NEW_LINE>if (i == mStartSection) {<NEW_LINE>// first loop<NEW_LINE>firstX = startX - mSeparatorLength;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (i == mCurrentSections) {<NEW_LINE>// because we want to keep the separator effect<NEW_LINE>lastX = prevValue + sectionWidth;<NEW_LINE>}<NEW_LINE>prevValue = end + spaceLength;<NEW_LINE>currentIndexColor = incrementColor(currentIndexColor);<NEW_LINE>}<NEW_LINE>drawBackgroundIfNeeded(canvas, firstX, lastX);<NEW_LINE>}
int boundsWidth = mBounds.width();
1,294,844
public static INDArray predict(String filepath) throws IOException {<NEW_LINE>File file = new File(filepath);<NEW_LINE>if (!file.exists()) {<NEW_LINE>file = new File(filepath);<NEW_LINE>}<NEW_LINE>BufferedImage img = ImageIO.read(file);<NEW_LINE>double[] data = new double[28 * 28];<NEW_LINE>for (int i = 0; i < 28; i++) {<NEW_LINE>for (int j = 0; j < 28; j++) {<NEW_LINE>Color color = new Color(img.getRGB(i, j));<NEW_LINE><MASK><NEW_LINE>int g = color.getGreen();<NEW_LINE>int b = color.getBlue();<NEW_LINE>double greyScale = (r + g + b) / 3;<NEW_LINE>greyScale /= 255.;<NEW_LINE>data[i * 28 + j] = greyScale;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>INDArray arr = Nd4j.create(data).reshape(-1, 28 * 28);<NEW_LINE>Map<String, INDArray> placeholder = new HashMap<>();<NEW_LINE>placeholder.put("input", arr);<NEW_LINE>INDArray output = sd.outputSingle(placeholder, "output");<NEW_LINE>System.out.println(Arrays.toString(output.reshape(10).toDoubleVector()));<NEW_LINE>return output;<NEW_LINE>}
int r = color.getRed();
1,188,931
private Mono<PagedResponse<SecurityPartnerProviderInner>> listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) {<NEW_LINE>if (this.client.getEndpoint() == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>return Mono.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));<NEW_LINE>}<NEW_LINE>if (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>final String apiVersion = "2021-05-01";<NEW_LINE>final String accept = "application/json";<NEW_LINE>context = this.client.mergeContext(context);<NEW_LINE>return service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion, this.client.getSubscriptionId(), accept, context).map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue()<MASK><NEW_LINE>}
.nextLink(), null));
1,190,962
public void tableChanged(TableModelEvent evt) {<NEW_LINE>// NOI18N<NEW_LINE>if (debug)<NEW_LINE>log("tableChanged");<NEW_LINE>RequestData rd = monitorData.getRequestData();<NEW_LINE>// The query panel depends on the value of the<NEW_LINE>// method attribute.<NEW_LINE>String method = rd.getAttributeValue(EditPanel.METHOD);<NEW_LINE>String newMethod = (String) requestTable.getValueAt(1, 1);<NEW_LINE>if (method != null && !method.equals(newMethod)) {<NEW_LINE>rd.setAttributeValue(EditPanel.METHOD, newMethod);<NEW_LINE>if (method.equals(EditPanel.GET) && newMethod.equals(EditPanel.POST)) {<NEW_LINE>// Set the query string to null if we got<NEW_LINE>// parameters from it, o/w leave it as is<NEW_LINE>try {<NEW_LINE>// NOI18N<NEW_LINE>String // NOI18N<NEW_LINE>queryString = rd.getAttributeValue("queryString");<NEW_LINE>Hashtable ht = javax.servlet.http.HttpUtils.parseQueryString(queryString);<NEW_LINE>// NOI18N<NEW_LINE>rd.setAttributeValue("queryString", "");<NEW_LINE>} catch (Exception ex) {<NEW_LINE>}<NEW_LINE>} else if (method.equals(EditPanel.POST) && newMethod.equals(EditPanel.GET)) {<NEW_LINE>Util.addParametersToQuery(rd);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Set the rest...<NEW_LINE>//<NEW_LINE>String uri = (String) <MASK><NEW_LINE>uri = uri.trim();<NEW_LINE>String protocol = (String) requestTable.getValueAt(2, 1);<NEW_LINE>protocol = protocol.trim();<NEW_LINE>// NOI18N<NEW_LINE>rd.setAttributeValue("uri", uri);<NEW_LINE>// NOI18N<NEW_LINE>rd.setAttributeValue("protocol", protocol);<NEW_LINE>}
requestTable.getValueAt(0, 1);
38,009
/*<NEW_LINE>* Computes the paths of projects and jars that the hierarchy on the given type could contain.<NEW_LINE>* This is a super set of the project and jar paths once the hierarchy is computed.<NEW_LINE>*/<NEW_LINE>private IPath[] computeProjectsAndJars(IType type) throws JavaModelException {<NEW_LINE>HashSet set = new HashSet();<NEW_LINE>IPackageFragmentRoot root = (IPackageFragmentRoot) type.getPackageFragment().getParent();<NEW_LINE>if (root.isArchive()) {<NEW_LINE>// add the root<NEW_LINE>set.add(root.getPath());<NEW_LINE>// add all projects that reference this archive and their dependents<NEW_LINE>IPath rootPath = root.getPath();<NEW_LINE>IJavaModel model = JavaModelManager.getJavaModelManager().getJavaModel();<NEW_LINE>IJavaProject[] projects = model.getJavaProjects();<NEW_LINE>HashSet visited = new HashSet();<NEW_LINE>for (int i = 0; i < projects.length; i++) {<NEW_LINE>JavaProject project = (JavaProject) projects[i];<NEW_LINE>IClasspathEntry entry = project.getClasspathEntryFor(rootPath);<NEW_LINE>if (entry != null) {<NEW_LINE>// add the project and its binary pkg fragment roots<NEW_LINE>IPackageFragmentRoot[] roots = project.getAllPackageFragmentRoots();<NEW_LINE>set.add(project.getPath());<NEW_LINE>for (int k = 0; k < roots.length; k++) {<NEW_LINE>IPackageFragmentRoot pkgFragmentRoot = roots[k];<NEW_LINE>if (pkgFragmentRoot.getKind() == IPackageFragmentRoot.K_BINARY) {<NEW_LINE>set.<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>// add the dependent projects<NEW_LINE>computeDependents(project, set, visited);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// add all the project's pkg fragment roots<NEW_LINE>IJavaProject project = (IJavaProject) root.getParent();<NEW_LINE>IPackageFragmentRoot[] roots = project.getAllPackageFragmentRoots();<NEW_LINE>for (int i = 0; i < roots.length; i++) {<NEW_LINE>IPackageFragmentRoot pkgFragmentRoot = roots[i];<NEW_LINE>if (pkgFragmentRoot.getKind() == IPackageFragmentRoot.K_BINARY) {<NEW_LINE>set.add(pkgFragmentRoot.getPath());<NEW_LINE>} else {<NEW_LINE>set.add(pkgFragmentRoot.getParent().getPath());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// add the dependent projects<NEW_LINE>computeDependents(project, set, new HashSet());<NEW_LINE>}<NEW_LINE>IPath[] result = new IPath[set.size()];<NEW_LINE>set.toArray(result);<NEW_LINE>return result;<NEW_LINE>}
add(pkgFragmentRoot.getPath());
627,582
public static FindServiceStatisticalDataResponse unmarshall(FindServiceStatisticalDataResponse findServiceStatisticalDataResponse, UnmarshallerContext _ctx) {<NEW_LINE>findServiceStatisticalDataResponse.setRequestId(_ctx.stringValue("FindServiceStatisticalDataResponse.RequestId"));<NEW_LINE>findServiceStatisticalDataResponse.setCode(_ctx.integerValue("FindServiceStatisticalDataResponse.Code"));<NEW_LINE>findServiceStatisticalDataResponse.setMessage(_ctx.stringValue("FindServiceStatisticalDataResponse.Message"));<NEW_LINE>Data data = new Data();<NEW_LINE>data.setCurrentPage(_ctx.integerValue("FindServiceStatisticalDataResponse.Data.CurrentPage"));<NEW_LINE>data.setPageNumber(_ctx.integerValue("FindServiceStatisticalDataResponse.Data.PageNumber"));<NEW_LINE>data.setTotal(_ctx.longValue("FindServiceStatisticalDataResponse.Data.Total"));<NEW_LINE>List<ServiceStatisticData> monitorStatisticData = new ArrayList<ServiceStatisticData>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("FindServiceStatisticalDataResponse.Data.MonitorStatisticData.Length"); i++) {<NEW_LINE>ServiceStatisticData serviceStatisticData = new ServiceStatisticData();<NEW_LINE>serviceStatisticData.setAvgRt(_ctx.floatValue("FindServiceStatisticalDataResponse.Data.MonitorStatisticData[" + i + "].AvgRt"));<NEW_LINE>serviceStatisticData.setMaxRt(_ctx.floatValue("FindServiceStatisticalDataResponse.Data.MonitorStatisticData[" + i + "].MaxRt"));<NEW_LINE>serviceStatisticData.setMinRt(_ctx.floatValue<MASK><NEW_LINE>serviceStatisticData.setServiceName(_ctx.stringValue("FindServiceStatisticalDataResponse.Data.MonitorStatisticData[" + i + "].ServiceName"));<NEW_LINE>Total total = new Total();<NEW_LINE>total.setTotal(_ctx.longValue("FindServiceStatisticalDataResponse.Data.MonitorStatisticData[" + i + "].Total.Total"));<NEW_LINE>total.setErrorNum(_ctx.longValue("FindServiceStatisticalDataResponse.Data.MonitorStatisticData[" + i + "].Total.ErrorNum"));<NEW_LINE>serviceStatisticData.setTotal(total);<NEW_LINE>monitorStatisticData.add(serviceStatisticData);<NEW_LINE>}<NEW_LINE>data.setMonitorStatisticData(monitorStatisticData);<NEW_LINE>findServiceStatisticalDataResponse.setData(data);<NEW_LINE>return findServiceStatisticalDataResponse;<NEW_LINE>}
("FindServiceStatisticalDataResponse.Data.MonitorStatisticData[" + i + "].MinRt"));
611,398
private // WebSphere:feature=wasJmsServer,type=Topic,name=*<NEW_LINE>void displayJMSMBeans(MBeanServerConnection localEngine) throws IOException {<NEW_LINE>System.out.println("JMS MBeans [ " + getTest() + " ]");<NEW_LINE>// List all; do not filter the results<NEW_LINE>// throws IOException<NEW_LINE>Set<ObjectInstance> mbeans = localEngine.queryMBeans(null, null);<NEW_LINE>// [ com.ibm.ws.sib.admin.internal.JsQueue ] [ 1295428529 ]<NEW_LINE>// [ WebSphere:feature=wasJmsServer,type=Queue,name=_PSIMP.TDRECEIVER_0DF1DC7B8ADD27AF ]<NEW_LINE>for (ObjectInstance mbean : mbeans) {<NEW_LINE><MASK><NEW_LINE>if (!mbeanPrintString.contains("feature=wasJmsServer")) {<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>System.out.println("[ " + mbean.getClassName() + " ]" + " [ " + mbean.hashCode() + " ] [ " + mbean.getObjectName() + " ]");<NEW_LINE>System.out.println(" [ " + mbeanPrintString + " ]");<NEW_LINE>}<NEW_LINE>}
String mbeanPrintString = mbean.toString();
299,698
private void addPolicies(AbstractServiceFactoryBean factory, Server server, Class<?> cls) {<NEW_LINE>List<Policy> list = CastUtils.cast((List<?>) server.getEndpoint().getEndpointInfo().getInterface<MASK><NEW_LINE>if (list != null) {<NEW_LINE>addPolicies(factory, server.getEndpoint(), cls, list, Policy.Placement.BINDING);<NEW_LINE>}<NEW_LINE>if (cls == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Policy p = cls.getAnnotation(Policy.class);<NEW_LINE>Policies ps = cls.getAnnotation(Policies.class);<NEW_LINE>if (p != null || ps != null) {<NEW_LINE>list = new ArrayList<Policy>();<NEW_LINE>if (p != null) {<NEW_LINE>list.add(p);<NEW_LINE>}<NEW_LINE>if (ps != null) {<NEW_LINE>list.addAll(Arrays.asList(ps.value()));<NEW_LINE>}<NEW_LINE>addPolicies(factory, server.getEndpoint(), cls, list, Policy.Placement.SERVICE);<NEW_LINE>}<NEW_LINE>}
().removeProperty(EXTRA_POLICIES));
24,109
protected StateMachineContext<S, E> buildStateMachineContext(StateMachine<S, E> stateMachine) {<NEW_LINE>ExtendedState extendedState = new DefaultExtendedState();<NEW_LINE>extendedState.getVariables().putAll(stateMachine.getExtendedState().getVariables());<NEW_LINE>ArrayList<StateMachineContext<S, E>> childs = new ArrayList<StateMachineContext<S, E>>();<NEW_LINE>S id = null;<NEW_LINE>State<S, E> state = stateMachine.getState();<NEW_LINE>if (state.isSubmachineState()) {<NEW_LINE>StateMachine<S, E> submachine = ((AbstractState<S, E>) state).getSubmachine();<NEW_LINE>id = submachine.getState().getId();<NEW_LINE>childs.add(buildStateMachineContext(submachine));<NEW_LINE>} else if (state.isOrthogonal()) {<NEW_LINE>Collection<Region<S, E>> regions = ((AbstractState<S, E>) state).getRegions();<NEW_LINE>for (Region<S, E> r : regions) {<NEW_LINE>StateMachine<S, E> rsm = (StateMachine<S, E>) r;<NEW_LINE>childs.add(buildStateMachineContext(rsm));<NEW_LINE>}<NEW_LINE>id = state.getId();<NEW_LINE>} else {<NEW_LINE>id = state.getId();<NEW_LINE>}<NEW_LINE>// building history state mappings<NEW_LINE>Map<S, S> historyStates = new HashMap<S, S>();<NEW_LINE>PseudoState<S, E> historyState = ((AbstractStateMachine<S, E<MASK><NEW_LINE>if (historyState != null && ((HistoryPseudoState<S, E>) historyState).getState() != null) {<NEW_LINE>historyStates.put(null, ((HistoryPseudoState<S, E>) historyState).getState().getId());<NEW_LINE>}<NEW_LINE>Collection<State<S, E>> states = stateMachine.getStates();<NEW_LINE>for (State<S, E> ss : states) {<NEW_LINE>if (ss.isSubmachineState()) {<NEW_LINE>StateMachine<S, E> submachine = ((AbstractState<S, E>) ss).getSubmachine();<NEW_LINE>PseudoState<S, E> ps = ((AbstractStateMachine<S, E>) submachine).getHistoryState();<NEW_LINE>if (ps != null) {<NEW_LINE>State<S, E> pss = ((HistoryPseudoState<S, E>) ps).getState();<NEW_LINE>if (pss != null) {<NEW_LINE>historyStates.put(ss.getId(), pss.getId());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new DefaultStateMachineContext<S, E>(childs, id, null, null, extendedState, historyStates, stateMachine.getId());<NEW_LINE>}
>) stateMachine).getHistoryState();
729,145
final GetManagedPrefixListAssociationsResult executeGetManagedPrefixListAssociations(GetManagedPrefixListAssociationsRequest getManagedPrefixListAssociationsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getManagedPrefixListAssociationsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetManagedPrefixListAssociationsRequest> request = null;<NEW_LINE>Response<GetManagedPrefixListAssociationsResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetManagedPrefixListAssociationsRequestMarshaller().marshall(super.beforeMarshalling(getManagedPrefixListAssociationsRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetManagedPrefixListAssociations");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetManagedPrefixListAssociationsResult> responseHandler = new StaxResponseHandler<GetManagedPrefixListAssociationsResult>(new GetManagedPrefixListAssociationsResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
372,197
private static // of a Pinned sketch before compressing it. Hence the name Hybrid.<NEW_LINE>void compressHybridFlavor(final CompressedState target, final CpcSketch source) {<NEW_LINE>final <MASK><NEW_LINE>final PairTable srcPairTable = source.pairTable;<NEW_LINE>final int srcNumPairs = srcPairTable.getNumPairs();<NEW_LINE>final int[] srcPairArr = PairTable.unwrappingGetItems(srcPairTable, srcNumPairs);<NEW_LINE>introspectiveInsertionSort(srcPairArr, 0, srcNumPairs - 1);<NEW_LINE>final byte[] srcSlidingWindow = source.slidingWindow;<NEW_LINE>final int srcWindowOffset = source.windowOffset;<NEW_LINE>final long srcNumCoupons = source.numCoupons;<NEW_LINE>assert (srcSlidingWindow != null);<NEW_LINE>assert (srcWindowOffset == 0);<NEW_LINE>// because the window offset is zero<NEW_LINE>final long numPairs = srcNumCoupons - srcNumPairs;<NEW_LINE>assert numPairs < Integer.MAX_VALUE;<NEW_LINE>final int numPairsFromArray = (int) numPairs;<NEW_LINE>// for test<NEW_LINE>assert (numPairsFromArray + srcNumPairs) == srcNumCoupons;<NEW_LINE>final int[] allPairs = trickyGetPairsFromWindow(srcSlidingWindow, srcK, numPairsFromArray, srcNumPairs);<NEW_LINE>// note the overlapping subarray trick<NEW_LINE>PairTable.// note the overlapping subarray trick<NEW_LINE>merge(// note the overlapping subarray trick<NEW_LINE>srcPairArr, // note the overlapping subarray trick<NEW_LINE>0, // note the overlapping subarray trick<NEW_LINE>srcNumPairs, // note the overlapping subarray trick<NEW_LINE>allPairs, // note the overlapping subarray trick<NEW_LINE>srcNumPairs, // note the overlapping subarray trick<NEW_LINE>numPairsFromArray, // note the overlapping subarray trick<NEW_LINE>allPairs, 0);<NEW_LINE>// FOR TESTING If needed<NEW_LINE>// for (int i = 0; i < (source.numCoupons - 1); i++) {<NEW_LINE>// assert (Integer.compareUnsigned(allPairs[i], allPairs[i + 1]) < 0); }<NEW_LINE>compressTheSurprisingValues(target, source, allPairs, (int) srcNumCoupons);<NEW_LINE>}
int srcK = 1 << source.lgK;
1,214,423
public boolean apply(Game game, Ability source) {<NEW_LINE>Player player = game.getPlayer(source.getControllerId());<NEW_LINE>if (player == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>TargetPermanent target = new TargetPermanent(0, 1, StaticFilters.FILTER_CONTROLLED_ANOTHER_CREATURE, true);<NEW_LINE>player.choose(outcome, target, source, game);<NEW_LINE>Permanent permanent = game.<MASK><NEW_LINE>if (permanent == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>int power = permanent.getPower().getValue();<NEW_LINE>if (permanent.hasSubtype(SubType.GIANT, game)) {<NEW_LINE>power *= 2;<NEW_LINE>}<NEW_LINE>power = Math.max(power, 0);<NEW_LINE>if (!permanent.sacrifice(source, game)) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>ReflexiveTriggeredAbility ability = new ReflexiveTriggeredAbility(new DamageTargetEffect(power), false, rule);<NEW_LINE>ability.addTarget(new TargetAnyTarget());<NEW_LINE>game.fireReflexiveTriggeredAbility(ability, source);<NEW_LINE>return true;<NEW_LINE>}
getPermanent(target.getFirstTarget());
1,584,958
final GetWorkUnitsResult executeGetWorkUnits(GetWorkUnitsRequest getWorkUnitsRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getWorkUnitsRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetWorkUnitsRequest> request = null;<NEW_LINE>Response<GetWorkUnitsResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetWorkUnitsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getWorkUnitsRequest));<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, "LakeFormation");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetWorkUnits");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>URI endpointTraitHost = null;<NEW_LINE>if (!clientConfiguration.isDisableHostPrefixInjection()) {<NEW_LINE>String hostPrefix = "query-";<NEW_LINE>String resolvedHostPrefix = String.format("query-");<NEW_LINE>endpointTraitHost = UriResourcePathUtils.updateUriHost(endpoint, resolvedHostPrefix);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetWorkUnitsResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetWorkUnitsResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext, null, endpointTraitHost);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
1,537,076
public Node visit(String methodName, MethodDeclaration n) {<NEW_LINE>switch(methodName) {<NEW_LINE>case "createBundleURL":<NEW_LINE>// In RN 0.54 this method is overloaded; skip the convenience version<NEW_LINE>NodeList<Parameter> params = n.getParameters();<NEW_LINE>if (params.size() == 2 && params.get(0).getNameAsString().equals("mainModuleID") && params.get(1).getNameAsString().equals("type")) {<NEW_LINE>return n;<NEW_LINE>}<NEW_LINE>BlockStmt stmt = JavaParser.parseBlock(getCallMethodReflectionBlock("host.exp.exponent.ReactNativeStaticHelpers", "\"getBundleUrlForActivityId\", int.class, String.class, String.class, String.class, boolean.class, boolean.class", "null, mSettings.exponentActivityId, host, mainModuleID, type.typeID(), getDevMode(), getJSMinifyMode()", "return (String) ", "return null;"));<NEW_LINE>n.setBody(stmt);<NEW_LINE>n.getModifiers(<MASK><NEW_LINE>return n;<NEW_LINE>}<NEW_LINE>return n;<NEW_LINE>}
).remove(Modifier.STATIC);
1,604,318
protected // Opting for console command, as -data-write-register-values is buggy<NEW_LINE>String encode(String threadPart, String framePart) {<NEW_LINE>StringBuilder b = new StringBuilder();<NEW_LINE>b.append("-interpreter-exec");<NEW_LINE>b.append(threadPart);<NEW_LINE>b.append(framePart);<NEW_LINE>b.append(" console \"set");<NEW_LINE>boolean first = true;<NEW_LINE>for (Map.Entry<GdbRegister, BigInteger> ent : regVals.entrySet()) {<NEW_LINE>if (first) {<NEW_LINE>b.append(' ');<NEW_LINE>first = false;<NEW_LINE>} else {<NEW_LINE>b.append(',');<NEW_LINE>}<NEW_LINE>b.append('$');<NEW_LINE>GdbRegister reg = ent.getKey();<NEW_LINE>b.append(reg.getName());<NEW_LINE>BigInteger value = ent.getValue();<NEW_LINE>// if the register is 16 or fewer bytes, just use the name<NEW_LINE>if (reg.getSize() <= 16) {<NEW_LINE>b.append('=');<NEW_LINE>b.<MASK><NEW_LINE>} else // if the register is more than 16 bytes use gdb's struct syntax<NEW_LINE>// note: this only works for x64<NEW_LINE>{<NEW_LINE>b.append(".v");<NEW_LINE>b.append(reg.getSize());<NEW_LINE>b.append("_int8={");<NEW_LINE>encodeInt8Array(b, value, reg.getSize());<NEW_LINE>b.append('}');<NEW_LINE>}<NEW_LINE>}<NEW_LINE>b.append("\"");<NEW_LINE>return b.toString();<NEW_LINE>}
append(value.toString());
672,419
protected void download() throws SubscriptionException {<NEW_LINE>log("Downloading");<NEW_LINE>Map map = JSONUtils.decodeJSON(subs.getJSON());<NEW_LINE>Long engine_id = (Long) map.get("engine_id");<NEW_LINE>String search_term = (String) map.get("search_term");<NEW_LINE>String networks = (<MASK><NEW_LINE>Map filters = (Map) map.get("filters");<NEW_LINE>Engine engine = manager.getEngine(subs, map, false);<NEW_LINE>if (engine == null) {<NEW_LINE>throw (new SubscriptionException("Download failed, search engine " + engine_id + " not found"));<NEW_LINE>}<NEW_LINE>List sps = new ArrayList();<NEW_LINE>if (search_term != null) {<NEW_LINE>sps.add(new SearchParameter(SearchProvider.SP_SEARCH_TERM, search_term));<NEW_LINE>log(" Using search term '" + search_term + "' for engine " + engine.getString());<NEW_LINE>}<NEW_LINE>if (networks != null && networks.length() > 0) {<NEW_LINE>sps.add(new SearchParameter(SearchProvider.SP_NETWORKS, networks));<NEW_LINE>}<NEW_LINE>SubscriptionHistoryImpl history = (SubscriptionHistoryImpl) subs.getHistory();<NEW_LINE>long max_age_secs = history.getMaxAgeSecs();<NEW_LINE>if (max_age_secs > 0) {<NEW_LINE>sps.add(new SearchParameter(SearchProvider.SP_MAX_AGE_SECS, String.valueOf(max_age_secs)));<NEW_LINE>}<NEW_LINE>SearchParameter[] parameters = (SearchParameter[]) sps.toArray(new SearchParameter[sps.size()]);<NEW_LINE>try {<NEW_LINE>Map context = new HashMap();<NEW_LINE>context.put(Engine.SC_SOURCE, "subscription");<NEW_LINE>Result[] results = engine.search(parameters, context, -1, -1, null, null);<NEW_LINE>log(" Got " + results.length + " results");<NEW_LINE>SubscriptionResultFilterImpl result_filter = new SubscriptionResultFilterImpl(subs, filters);<NEW_LINE>results = result_filter.filter(results);<NEW_LINE>log(" Post-filter: " + results.length + " results");<NEW_LINE>SubscriptionResultImpl[] s_results = new SubscriptionResultImpl[results.length];<NEW_LINE>for (int i = 0; i < results.length; i++) {<NEW_LINE>SubscriptionResultImpl s_result = new SubscriptionResultImpl(history, results[i]);<NEW_LINE>s_results[i] = s_result;<NEW_LINE>}<NEW_LINE>SubscriptionResultImpl[] all_results = history.reconcileResults(engine, s_results);<NEW_LINE>checkAutoDownload(all_results);<NEW_LINE>history.setLastError(null, false);<NEW_LINE>} catch (Throwable e) {<NEW_LINE>log(" Download failed", e);<NEW_LINE>history.setLastError(Debug.getNestedExceptionMessage(e), e instanceof SearchLoginException);<NEW_LINE>throw (new SubscriptionException("Search failed", e));<NEW_LINE>}<NEW_LINE>}
String) map.get("networks");
797,271
private static void addBody(HttpURLConnection connection, File file, boolean requiresBody) throws IOException {<NEW_LINE>if (requiresBody) {<NEW_LINE>String filename = file.getName();<NEW_LINE>String formName = "file";<NEW_LINE>InputStream stream = new FileInputStream(file);<NEW_LINE>connection.setDoInput(true);<NEW_LINE>connection.setDoOutput(true);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>connection.setRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>connection.setRequestProperty("User-Agent", "OsmAnd");<NEW_LINE>final OutputStream ous = connection.getOutputStream();<NEW_LINE>ous.write(("--" + BOUNDARY + "\r\n").getBytes());<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>ous.write(("content-disposition: form-data; name=\"" + formName + "\"; filename=\"" + filename + "\"\r\n").getBytes());<NEW_LINE>// $NON-NLS-1$<NEW_LINE>ous.write(("Content-Type: application/octet-stream\r\n\r\n").getBytes());<NEW_LINE>BufferedInputStream bis = new BufferedInputStream(stream, 20 * 1024);<NEW_LINE>ous.flush();<NEW_LINE>Algorithms.streamCopy(bis, ous);<NEW_LINE>// $NON-NLS-1$ //$NON-NLS-2$<NEW_LINE>ous.write(("\r\n--" + BOUNDARY <MASK><NEW_LINE>ous.flush();<NEW_LINE>Algorithms.closeStream(bis);<NEW_LINE>}<NEW_LINE>}
+ "--\r\n").getBytes());
1,383,173
private Hashtable generateDependencies(Constructor[] constructors, Method[] methods, Field[] fields) {<NEW_LINE>String x, y;<NEW_LINE>Hashtable classRef = new Hashtable();<NEW_LINE>for (int i = 0; i < fields.length; i++) {<NEW_LINE>x = ClassTypeAlgorithm.TypeName(fields[i].getType().getName(), classRef);<NEW_LINE>}<NEW_LINE>for (int i = 0; i < constructors.length; i++) {<NEW_LINE>Class[] cx = constructors[i].getParameterTypes();<NEW_LINE>if (cx.length > 0) {<NEW_LINE>for (int j = 0; j < cx.length; j++) {<NEW_LINE>x = ClassTypeAlgorithm.TypeName(cx[j].getName(), classRef);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>for (int i = 0; i < methods.length; i++) {<NEW_LINE>x = ClassTypeAlgorithm.TypeName(methods[i].getReturnType(<MASK><NEW_LINE>Class[] cx = methods[i].getParameterTypes();<NEW_LINE>if (cx.length > 0) {<NEW_LINE>for (int j = 0; j < cx.length; j++) {<NEW_LINE>x = ClassTypeAlgorithm.TypeName(cx[j].getName(), classRef);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Class<?>[] xType = methods[i].getExceptionTypes();<NEW_LINE>for (int j = 0; j < xType.length; j++) {<NEW_LINE>x = ClassTypeAlgorithm.TypeName(xType[j].getName(), classRef);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return classRef;<NEW_LINE>}
).getName(), classRef);
493,305
protected void removeDefaultClusters() {<NEW_LINE>listener.onMessage("\nWARN: Exported database does not support manual index separation." + " Manual index cluster will be dropped.");<NEW_LINE>// In v4 new cluster for manual indexes has been implemented. To keep database consistent we<NEW_LINE>// should shift back all clusters and recreate cluster for manual indexes in the end.<NEW_LINE>database.dropCluster(OMetadataDefault.CLUSTER_MANUAL_INDEX_NAME);<NEW_LINE>final OSchema schema = database.getMetadata().getSchema();<NEW_LINE>if (schema.existsClass(OUser.CLASS_NAME))<NEW_LINE>schema.dropClass(OUser.CLASS_NAME);<NEW_LINE>if (schema.existsClass(ORole.CLASS_NAME))<NEW_LINE>schema.dropClass(ORole.CLASS_NAME);<NEW_LINE>if (schema.existsClass(OSecurityShared.RESTRICTED_CLASSNAME))<NEW_LINE>schema.dropClass(OSecurityShared.RESTRICTED_CLASSNAME);<NEW_LINE>if (schema.existsClass(OFunction.CLASS_NAME))<NEW_LINE>schema.dropClass(OFunction.CLASS_NAME);<NEW_LINE>if (schema.existsClass("ORIDs"))<NEW_LINE>schema.dropClass("ORIDs");<NEW_LINE>if (schema.existsClass(OClassTrigger.CLASSNAME))<NEW_LINE>schema.dropClass(OClassTrigger.CLASSNAME);<NEW_LINE><MASK><NEW_LINE>database.setDefaultClusterId(database.addCluster(OStorage.CLUSTER_DEFAULT_NAME));<NEW_LINE>// Starting from v4 schema has been moved to internal cluster.<NEW_LINE>// Create a stub at #2:0 to prevent cluster position shifting.<NEW_LINE>new ODocument().save(OStorage.CLUSTER_DEFAULT_NAME);<NEW_LINE>database.getSharedContext().getSecurity().create(database);<NEW_LINE>}
database.dropCluster(OStorage.CLUSTER_DEFAULT_NAME);
151,279
public void run(ReturnValueCompletion<Boolean> completion) {<NEW_LINE>try {<NEW_LINE>if (!forceRun && !isNeedRun()) {<NEW_LINE>completion.success(false);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>int port = new URI(restf.getBaseUrl()).getPort();<NEW_LINE>putArgument("pip_url", String.format("http://%s:%d/zstack/static/pypi/simple", restf.getHostName(), port));<NEW_LINE>putArgument("trusted_host", restf.getHostName());<NEW_LINE>putArgument("yum_server", String.format("%s:%d", restf.getHostName(), port));<NEW_LINE>putArgument("remote_user", username);<NEW_LINE>if (password != null && !password.isEmpty()) {<NEW_LINE>putArgument("remote_pass", password);<NEW_LINE>}<NEW_LINE>putArgument("remote_port", Integer.toString(sshPort));<NEW_LINE>logger.debug(String.format("starts to run ansible[%s]", playBookPath <MASK><NEW_LINE>new PrepareAnsible().setTargetIp(targetIp).prepare();<NEW_LINE>setupPublicKey();<NEW_LINE>callAnsible(completion);<NEW_LINE>} catch (SshException e) {<NEW_LINE>throw new OperationFailureException(operr("User name or password or port number may be problematic"));<NEW_LINE>} catch (Exception e) {<NEW_LINE>throw new CloudRuntimeException(e);<NEW_LINE>}<NEW_LINE>}
== null ? playBookName : playBookPath));
1,811,012
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {<NEW_LINE>GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);<NEW_LINE>bindGuiTexture();<NEW_LINE>drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);<NEW_LINE>RenderUtil.renderGuiTank(getTileEntity().inputTank, guiLeft + RECTANGLE_TANK.x, guiTop + RECTANGLE_TANK.y, zLevel, RECTANGLE_TANK.width, RECTANGLE_TANK.height);<NEW_LINE>renderFlowingFluid(getTileEntity().inputTank.getFluid(), guiLeft + 112, <MASK><NEW_LINE>bindGuiTexture();<NEW_LINE>GlStateManager.enableBlend();<NEW_LINE>drawTexturedModalRect(guiLeft + 112, guiTop + 28, 200, 0, 39, 56);<NEW_LINE>GlStateManager.disableBlend();<NEW_LINE>super.drawGuiContainerBackgroundLayer(par1, par2, par3);<NEW_LINE>}
guiTop + 28, 39, 56);
185,483
private Challenge dnsChallenge(final Authorization auth, final Integer wait) throws FrameworkException {<NEW_LINE>final Dns01Challenge challenge = auth.findChallenge(Dns01Challenge.TYPE);<NEW_LINE>if (challenge == null) {<NEW_LINE>error("No " + Dns01Challenge.TYPE + " challenge found, aborting.");<NEW_LINE>}<NEW_LINE>final String domain = auth.getIdentifier().getDomain();<NEW_LINE>final String hostname = "_acme-challenge." + domain + ".";<NEW_LINE>final String digest = challenge.getDigest();<NEW_LINE>final Object result = Actions.callWithSecurityContext("onAcmeChallenge", SecurityContext.getSuperUserInstance(), Map.of("type", "dns", "hostname", hostname, "digest", digest));<NEW_LINE>if (result == null) {<NEW_LINE>publishProgressMessage(CERTIFICATE_RETRIEVAL_STATUS, "Lifecycle method 'onAcmeChallenge' not found! Within the next " + waitForSeconds + " seconds, create a TXT record in your DNS for " + domain + " with the following data: Hostname = '" + hostname + "', Target = '" + digest + "'");<NEW_LINE>logger.info("Within the next " + <MASK><NEW_LINE>logger.info("{} IN TXT {}", hostname, digest);<NEW_LINE>logger.info("After " + waitForSeconds + " seconds, the certificate authority will probe the DNS record to authorize the challenge. If the record is not available, the authorization will fail.");<NEW_LINE>} else {<NEW_LINE>publishProgressMessage(CERTIFICATE_RETRIEVAL_STATUS, "Called lifecycle method onAcmeChallenge");<NEW_LINE>logger.info("DNS record (TXT) for domain " + domain + " has to be created with the following data:");<NEW_LINE>logger.info("{} IN TXT {}", hostname, digest);<NEW_LINE>}<NEW_LINE>return challenge;<NEW_LINE>}
waitForSeconds + " seconds, create a TXT record in your DNS for " + domain + " with the following data:");
1,468,386
public static FileInfo parseFilename(String filename) throws ParseException {<NEW_LINE>if (filename == null) {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>final String ext = ".json";<NEW_LINE>if (!filename.endsWith(ext)) {<NEW_LINE>throwBadFormat(filename);<NEW_LINE>}<NEW_LINE>filename = filename.substring(0, filename.length() - ext.length());<NEW_LINE>final String delim = "-";<NEW_LINE>String[] parts = filename.split(delim);<NEW_LINE>if (parts.length < 3) {<NEW_LINE>throwBadFormat(filename);<NEW_LINE>}<NEW_LINE>filename = TextUtils.join(delim, Arrays.copyOf(parts, parts.length - 2));<NEW_LINE>if (!filename.equals(FILENAME_PREFIX)) {<NEW_LINE>throwBadFormat(filename);<NEW_LINE>}<NEW_LINE>Date date = _dateFormat.parse(parts[parts.length - 2] + delim + parts[parts.length - 1]);<NEW_LINE>if (date == null) {<NEW_LINE>throwBadFormat(filename);<NEW_LINE>}<NEW_LINE>return new FileInfo(filename, date);<NEW_LINE>}
throw new ParseException("The filename must not be null", 0);
1,107,361
public DenseVector rightMultiply(SGDVector input) {<NEW_LINE>if (input.size() == dim1) {<NEW_LINE>double[<MASK><NEW_LINE>if (input instanceof DenseVector) {<NEW_LINE>// If it's dense we can use loops<NEW_LINE>for (int i = 0; i < dim1; i++) {<NEW_LINE>double curValue = input.get(i);<NEW_LINE>for (int j = 0; j < dim2; j++) {<NEW_LINE>output[j] += get(i, j) * curValue;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>// If it's sparse we iterate the tuples<NEW_LINE>for (VectorTuple tuple : input) {<NEW_LINE>for (int i = 0; i < output.length; i++) {<NEW_LINE>output[i] += values[tuple.index][i] * tuple.value;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new DenseVector(output);<NEW_LINE>} else {<NEW_LINE>throw new IllegalArgumentException("input.size() != dim1");<NEW_LINE>}<NEW_LINE>}
] output = new double[dim2];
538,800
protected Object doInvoke(Object... args) throws Exception {<NEW_LINE>try {<NEW_LINE>return getBridgedMethod().<MASK><NEW_LINE>} catch (IllegalArgumentException ex) {<NEW_LINE>assertTargetBean(getBridgedMethod(), getBean(), args);<NEW_LINE>String text = (ex.getMessage() != null ? ex.getMessage() : "Illegal argument");<NEW_LINE>throw new IllegalStateException(formatInvokeError(text, args), ex);<NEW_LINE>} catch (InvocationTargetException ex) {<NEW_LINE>// Unwrap for HandlerExceptionResolvers ...<NEW_LINE>Throwable targetException = ex.getTargetException();<NEW_LINE>if (targetException instanceof RuntimeException) {<NEW_LINE>throw (RuntimeException) targetException;<NEW_LINE>} else if (targetException instanceof Error) {<NEW_LINE>throw (Error) targetException;<NEW_LINE>} else if (targetException instanceof Exception) {<NEW_LINE>throw (Exception) targetException;<NEW_LINE>} else {<NEW_LINE>throw new IllegalStateException(formatInvokeError("Invocation failure", args), targetException);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
invoke(getBean(), args);
474,695
final GetIpamAddressHistoryResult executeGetIpamAddressHistory(GetIpamAddressHistoryRequest getIpamAddressHistoryRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getIpamAddressHistoryRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetIpamAddressHistoryRequest> request = null;<NEW_LINE>Response<GetIpamAddressHistoryResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new GetIpamAddressHistoryRequestMarshaller().marshall(super.beforeMarshalling(getIpamAddressHistoryRequest));<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, "EC2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetIpamAddressHistory");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<GetIpamAddressHistoryResult> responseHandler = new StaxResponseHandler<GetIpamAddressHistoryResult>(new GetIpamAddressHistoryResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
948,580
private final void consumeNonPersistentMessages(java.util.ArrayList consumeList) {<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.entry(tc, "consumeNonPersistentMessages", consumeList);<NEW_LINE>// use a local transaction to consume all these messages<NEW_LINE>LocalTransaction tran = parent.getLocalTransaction();<NEW_LINE>try {<NEW_LINE>Transaction msTran = parent.getMessageProcessor().resolveAndEnlistMsgStoreTransaction(tran);<NEW_LINE>int length = consumeList.size();<NEW_LINE>for (int i = 0; i < length; i++) {<NEW_LINE>AOValue value = (AOValue) consumeList.get(i);<NEW_LINE>dem.removeTimeoutEntry(value);<NEW_LINE>SIMPMessage <MASK><NEW_LINE>// PK67067 We may not find a message in the store for this tick, because<NEW_LINE>// it may have been removed using the SIBQueuePoint MBean<NEW_LINE>if (msgItem != null)<NEW_LINE>msgItem.remove(msTran, msgItem.getLockID());<NEW_LINE>}<NEW_LINE>tran.commit();<NEW_LINE>} catch (Exception e) {<NEW_LINE>FFDCFilter.processException(e, "com.ibm.ws.sib.processor.impl.AOStream.consumeNonPersistentMessages", "1:2792:1.80.3.24", this);<NEW_LINE>SibTr.exception(tc, e);<NEW_LINE>// No matter what happens above we try to commit the transaction as we're simply<NEW_LINE>// trying to get rid of these messages and there's no point keeping them in<NEW_LINE>// the case of a failure<NEW_LINE>try {<NEW_LINE>tran.commit();<NEW_LINE>} catch (SIException e2) {<NEW_LINE>// No FFDC code needed<NEW_LINE>// We really don't care about a problem in this commit<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())<NEW_LINE>SibTr.debug(tc, "commit failed " + e2);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())<NEW_LINE>SibTr.exit(tc, "consumeNonPersistentMessages");<NEW_LINE>}
msgItem = consumerDispatcher.getMessageByValue(value);
509,911
public ReadableVectorMatch match(final ReadableVectorMatch mask) {<NEW_LINE>final IndexedInts[] vector = selector.getRowVector();<NEW_LINE>final int[] selection = match.getSelection();<NEW_LINE>int numRows = 0;<NEW_LINE>for (int i = 0; i < mask.getSelectionSize(); i++) {<NEW_LINE>final int rowNum = mask.getSelection()[i];<NEW_LINE>final IndexedInts ints = vector[rowNum];<NEW_LINE>final int n = ints.size();<NEW_LINE>if (n == 0) {<NEW_LINE>// null should match empty rows in multi-value columns<NEW_LINE>if (matchNull) {<NEW_LINE>selection[numRows++] = rowNum;<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>for (int j = 0; j < n; j++) {<NEW_LINE>final int id = ints.get(j);<NEW_LINE>final boolean matches;<NEW_LINE>if (checkedIds.get(id)) {<NEW_LINE><MASK><NEW_LINE>} else {<NEW_LINE>matches = predicate.apply(selector.lookupName(id));<NEW_LINE>checkedIds.set(id);<NEW_LINE>if (matches) {<NEW_LINE>matchingIds.set(id);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (matches) {<NEW_LINE>selection[numRows++] = rowNum;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>match.setSelectionSize(numRows);<NEW_LINE>assert match.isValid(mask);<NEW_LINE>return match;<NEW_LINE>}
matches = matchingIds.get(id);
550,495
final ModifyVpcAttributeResult executeModifyVpcAttribute(ModifyVpcAttributeRequest modifyVpcAttributeRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(modifyVpcAttributeRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<ModifyVpcAttributeRequest> request = null;<NEW_LINE>Response<ModifyVpcAttributeResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new ModifyVpcAttributeRequestMarshaller().marshall(super.beforeMarshalling(modifyVpcAttributeRequest));<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, "EC2");<NEW_LINE>request.<MASK><NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<ModifyVpcAttributeResult> responseHandler = new StaxResponseHandler<ModifyVpcAttributeResult>(new ModifyVpcAttributeResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyVpcAttribute");
1,633,994
public void rgbToGreyKernelSmall() {<NEW_LINE>final int size = 256;<NEW_LINE>byte[] rgbBytes = new byte[size];<NEW_LINE>int[] greyInts = new int[size];<NEW_LINE>int[<MASK><NEW_LINE>Random r = new Random();<NEW_LINE>IntStream.range(0, rgbBytes.length).forEach(i -> {<NEW_LINE>rgbBytes[i] = (byte) -10;<NEW_LINE>});<NEW_LINE>TaskSchedule ts = new TaskSchedule("s0");<NEW_LINE>//<NEW_LINE>//<NEW_LINE>ts.streamIn(rgbBytes).//<NEW_LINE>task(//<NEW_LINE>"t0", //<NEW_LINE>Inlining::rgbToGreyKernelSmall, //<NEW_LINE>rgbBytes, //<NEW_LINE>greyInts).//<NEW_LINE>streamOut(greyInts).execute();<NEW_LINE>rgbToGreyKernelSmall(rgbBytes, seq);<NEW_LINE>for (int i = 0; i < seq.length; i++) {<NEW_LINE>Assert.assertEquals(seq[i], greyInts[i]);<NEW_LINE>}<NEW_LINE>}
] seq = new int[size];
1,189,383
// Task: parser string with text and show all indexes of all words<NEW_LINE>public static void main(String[] args) {<NEW_LINE>String INPUT_TEXT = "Hello World! Hello All! Hi World!";<NEW_LINE>// Parse text to words and index<NEW_LINE>List<String> words = Arrays.asList(INPUT_TEXT.split(" "));<NEW_LINE>// Create Multimap<NEW_LINE>MultiMap<String, Integer> multiMap = MultiValueMap.multiValueMap(new LinkedHashMap<String, Set>(), LinkedHashSet.class);<NEW_LINE>// Fill Multimap<NEW_LINE>int i = 0;<NEW_LINE>for (String word : words) {<NEW_LINE>multiMap.put(word, i);<NEW_LINE>i++;<NEW_LINE>}<NEW_LINE>// Print all words<NEW_LINE>// print {Hello=[0, 2], World!=[1, 5], All!=[3], Hi=[4]} - in predictable iteration order<NEW_LINE>System.out.println(multiMap);<NEW_LINE>// Print all unique words<NEW_LINE>// print [Hello, World!, All!, Hi] - in predictable iteration order<NEW_LINE>System.out.<MASK><NEW_LINE>// Print all indexes<NEW_LINE>// print [0, 2]<NEW_LINE>System.out.println("Hello = " + multiMap.get("Hello"));<NEW_LINE>// print [1, 5]<NEW_LINE>System.out.println("World = " + multiMap.get("World!"));<NEW_LINE>// print [3]<NEW_LINE>System.out.println("All = " + multiMap.get("All!"));<NEW_LINE>// print [4]<NEW_LINE>System.out.println("Hi = " + multiMap.get("Hi"));<NEW_LINE>// print null<NEW_LINE>System.out.println("Empty = " + multiMap.get("Empty"));<NEW_LINE>// Print count unique words<NEW_LINE>// print 4<NEW_LINE>System.out.println(multiMap.keySet().size());<NEW_LINE>}
println(multiMap.keySet());
973,900
private void deleteRecords(int AD_Client_ID, int AD_Org_ID, int S_Resource_ID, int M_Warehouse_ID) throws SQLException {<NEW_LINE>// Delete MRP records (Orders (SO,PO), Forecasts, Material Requisitions, Distribution Order):<NEW_LINE>{<NEW_LINE>List<Object> params = new ArrayList<Object>();<NEW_LINE>params.add(AD_Client_ID);<NEW_LINE>params.add(AD_Org_ID);<NEW_LINE>params.add(M_Warehouse_ID);<NEW_LINE>String whereClause = "OrderType IN ('FCT','POR', 'SOO', 'POO') AND AD_Client_ID=? AND AD_Org_ID=? AND M_Warehouse_ID=?";<NEW_LINE><MASK><NEW_LINE>commitEx();<NEW_LINE>// Delete Material Requisitions Document<NEW_LINE>whereClause = "DocStatus IN ('DR','CL') AND AD_Client_ID=? AND AD_Org_ID=? AND M_Warehouse_ID=?";<NEW_LINE>deletePO(MRequisition.Table_Name, whereClause, params);<NEW_LINE>commitEx();<NEW_LINE>params = new ArrayList<Object>();<NEW_LINE>params.add(AD_Client_ID);<NEW_LINE>params.add(AD_Org_ID);<NEW_LINE>params.add(M_Warehouse_ID);<NEW_LINE>whereClause = "DocStatus IN ('DR') AND AD_Client_ID=? AND AD_Org_ID=? AND M_Warehouse_ID=?";<NEW_LINE>// Delete Distribution Orders:<NEW_LINE>deletePO(MDDOrder.Table_Name, whereClause, params);<NEW_LINE>commitEx();<NEW_LINE>}<NEW_LINE>{<NEW_LINE>List<Object> params = new ArrayList<Object>();<NEW_LINE>params.add(AD_Client_ID);<NEW_LINE>params.add(AD_Org_ID);<NEW_LINE>params.add(S_Resource_ID);<NEW_LINE>params.add(M_Warehouse_ID);<NEW_LINE>String whereClause = "OrderType IN ('MOP') AND AD_Client_ID=? AND AD_Org_ID=? AND S_Resource_ID= ? AND M_Warehouse_ID=?";<NEW_LINE>executeUpdate("DELETE FROM PP_MRP WHERE " + whereClause, params);<NEW_LINE>commitEx();<NEW_LINE>// Delete Mfg. Orders:<NEW_LINE>whereClause = "DocStatus='DR' AND AD_Client_ID=? AND AD_Org_ID=? AND S_Resource_ID= ? AND M_Warehouse_ID=?";<NEW_LINE>deletePO(MPPOrder.Table_Name, whereClause, params);<NEW_LINE>commitEx();<NEW_LINE>params = new ArrayList<Object>();<NEW_LINE>params.add(AD_Client_ID);<NEW_LINE>params.add(AD_Org_ID);<NEW_LINE>whereClause = "OrderType IN ('DOO') AND AD_Client_ID=? AND AD_Org_ID=? ";<NEW_LINE>executeUpdate("DELETE FROM PP_MRP WHERE " + whereClause, params);<NEW_LINE>commitEx();<NEW_LINE>}<NEW_LINE>// Delete notes:<NEW_LINE>{<NEW_LINE>List<Object> params = new ArrayList<Object>();<NEW_LINE>params.add(AD_Client_ID);<NEW_LINE>params.add(AD_Org_ID);<NEW_LINE>String whereClause = "AD_Table_ID=" + MPPMRP.Table_ID + " AND AD_Client_ID=? AND AD_Org_ID=?";<NEW_LINE>executeUpdate("DELETE FROM AD_Note WHERE " + whereClause, params);<NEW_LINE>commitEx();<NEW_LINE>}<NEW_LINE>}
executeUpdate("DELETE FROM PP_MRP WHERE " + whereClause, params);
760,870
private FormulaNode parseExplicitVariable() {<NEW_LINE>if (!p.eat('$')) {<NEW_LINE>throw new FormulaException(UNEXPECTED_TOKEN, '$');<NEW_LINE>}<NEW_LINE>// might be var with {} around it<NEW_LINE>final boolean hasParen = p.eat('{');<NEW_LINE>final int posOpening = p.pos() - 1;<NEW_LINE>// first variable name char MUST be an alpha<NEW_LINE>if (!p.chIsIn(CHARS)) {<NEW_LINE>throw new FormulaException(UNEXPECTED_TOKEN, "alpha");<NEW_LINE>}<NEW_LINE>final StringBuilder sb = new StringBuilder();<NEW_LINE>while (p.chIsIn(CHARS_DIGITS)) {<NEW_LINE>sb.append(p.ch());<NEW_LINE>p.next();<NEW_LINE>}<NEW_LINE>final String parsed = sb.toString();<NEW_LINE>if (hasParen && !p.eat('}')) {<NEW_LINE>final FormulaException fe = new FormulaException(UNEXPECTED_TOKEN, "}");<NEW_LINE>markParseError(fe, posOpening, -1);<NEW_LINE>throw fe;<NEW_LINE>}<NEW_LINE>return new FormulaNode("var", null, (objs, vars, ri) -> {<NEW_LINE>final Value value = vars.call(parsed);<NEW_LINE>if (value != null) {<NEW_LINE>return value;<NEW_LINE>}<NEW_LINE>throw createMissingVarsException(vars);<NEW_LINE>}, (objs, vars, ri, error) -> {<NEW_LINE>final Value <MASK><NEW_LINE>if (value != null) {<NEW_LINE>return value.getAsString();<NEW_LINE>}<NEW_LINE>return TextUtils.setSpan("?" + parsed, createErrorSpan());<NEW_LINE>}, result -> result.add(parsed));<NEW_LINE>}
value = vars.call(parsed);
1,224,406
public void process() {<NEW_LINE>try {<NEW_LINE>final InputStream istream = this.getClass().getResourceAsStream("/iris.csv");<NEW_LINE>if (istream == null) {<NEW_LINE>System.out.println("Cannot access data set, make sure the resources are available.");<NEW_LINE>System.exit(1);<NEW_LINE>}<NEW_LINE>final DataSet ds = DataSet.load(istream);<NEW_LINE>// The following ranges are setup for the Iris data set. If you wish to normalize other files you will<NEW_LINE>// need to modify the below function calls other files.<NEW_LINE>ds.normalizeRange(0, 0, 1);<NEW_LINE>ds.normalizeRange(1, 0, 1);<NEW_LINE>ds.normalizeRange(2, 0, 1);<NEW_LINE>ds.normalizeRange(3, 0, 1);<NEW_LINE>final Map<String, Integer> species = ds.encodeEquilateral(4);<NEW_LINE>istream.close();<NEW_LINE>final List<BasicData> trainingData = ds.extractSupervised(<MASK><NEW_LINE>final RBFNetwork network = new RBFNetwork(4, 4, 2);<NEW_LINE>final ScoreFunction score = new ScoreRegressionData(trainingData);<NEW_LINE>final TrainGreedyRandom train = new TrainGreedyRandom(true, network, score);<NEW_LINE>performIterations(train, 100000, 0.01, true);<NEW_LINE>queryEquilateral(network, trainingData, species, 0, 1);<NEW_LINE>} catch (Throwable t) {<NEW_LINE>t.printStackTrace();<NEW_LINE>}<NEW_LINE>}
0, 4, 4, 2);
1,787,489
public GetAccessPreviewResult unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>GetAccessPreviewResult getAccessPreviewResult = new GetAccessPreviewResult();<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 getAccessPreviewResult;<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("accessPreview", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>getAccessPreviewResult.setAccessPreview(AccessPreviewJsonUnmarshaller.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 getAccessPreviewResult;<NEW_LINE>}
int originalDepth = context.getCurrentDepth();
1,008,503
public static WsdlTestSuite cloneToAnotherProject(WsdlTestSuite testSuite, String targetProjectName, String name, boolean move, String description) {<NEW_LINE>WorkspaceImpl workspace = testSuite.getProject().getWorkspace();<NEW_LINE>WsdlProject targetProject = (WsdlProject) workspace.getProjectByName(targetProjectName);<NEW_LINE>if (targetProject == null) {<NEW_LINE>targetProjectName = UISupport.prompt("Enter name for new Project", "Clone TestSuite", "");<NEW_LINE>if (targetProjectName == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>targetProject = workspace.createProject(targetProjectName, null);<NEW_LINE>} catch (SoapUIException e) {<NEW_LINE>UISupport.showErrorMessage(e);<NEW_LINE>}<NEW_LINE>if (targetProject == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Set<Interface> requiredInterfaces = getRequiredInterfaces(testSuite, targetProject);<NEW_LINE>if (requiredInterfaces.size() > 0) {<NEW_LINE>String msg = "Target project [" + targetProjectName + "] is missing required Interfaces;\r\n\r\n";<NEW_LINE>for (Interface iface : requiredInterfaces) {<NEW_LINE>msg += iface.getName() + " [" + iface.getTechnicalId() + "]\r\n";<NEW_LINE>}<NEW_LINE>msg += "\r\nShould these be cloned to the targetProject as well?";<NEW_LINE>Boolean result = UISupport.confirmOrCancel(msg, "Clone TestSuite");<NEW_LINE>if (result == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (result) {<NEW_LINE>for (Interface iface : requiredInterfaces) {<NEW_LINE>targetProject.importInterface((AbstractInterface<?<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>testSuite = targetProject.importTestSuite(testSuite, name, -1, !move, description);<NEW_LINE>UISupport.select(testSuite);<NEW_LINE>return testSuite;<NEW_LINE>}
>) iface, true, true);
1,629,624
public static JsonRequestBPartnerUpsertItem mapHospitalToUpsertRequest(@NonNull final Hospital hospital, @Nullable final String orgCode) {<NEW_LINE>final String hospitalExternalIdentifier = formatExternalId(hospital.getId());<NEW_LINE>final JsonRequestBPartner jsonRequestBPartner = new JsonRequestBPartner();<NEW_LINE>jsonRequestBPartner.setCompanyName(hospital.getCompanyName());<NEW_LINE>jsonRequestBPartner.setName(hospital.getName());<NEW_LINE>jsonRequestBPartner.setName2(hospital.getCompany());<NEW_LINE>jsonRequestBPartner.setName3(hospital.getAdditionalCompanyName());<NEW_LINE>jsonRequestBPartner.setCustomer(true);<NEW_LINE>jsonRequestBPartner.setPhone(hospital.getPhone());<NEW_LINE>jsonRequestBPartner.setCode(hospitalExternalIdentifier);<NEW_LINE>jsonRequestBPartner.setUrl(hospital.getWebsite());<NEW_LINE>final JsonRequestLocationUpsert upsertLocationsRequest;<NEW_LINE>{<NEW_LINE>// location<NEW_LINE>final JsonRequestLocation requestLocation = new JsonRequestLocation();<NEW_LINE>requestLocation.setCountryCode(GetPatientsRouteConstants.COUNTRY_CODE_DE);<NEW_LINE>requestLocation.setCity(hospital.getCity());<NEW_LINE>requestLocation.setPostal(hospital.getPostalCode());<NEW_LINE>requestLocation.setAddress1(hospital.getAddress());<NEW_LINE>requestLocation.setBillTo(true);<NEW_LINE>requestLocation.setBillToDefault(true);<NEW_LINE>requestLocation.setShipTo(true);<NEW_LINE>requestLocation.setShipToDefault(true);<NEW_LINE>upsertLocationsRequest = toJsonRequestLocationUpsert(hospital.getId(), requestLocation);<NEW_LINE>}<NEW_LINE>final JsonRequestContactUpsert requestContactUpsert;<NEW_LINE>{<NEW_LINE>// contact<NEW_LINE>final JsonRequestContact contact = new JsonRequestContact();<NEW_LINE>contact.setName(hospital.getName());<NEW_LINE>contact.setPhone(hospital.getPhone());<NEW_LINE>contact.setEmail(hospital.getEmail());<NEW_LINE>contact.setFax(hospital.getFax());<NEW_LINE>// contact.setLocationIdentifier(hospitalExternalIdentifier); todo<NEW_LINE>final JsonRequestContactUpsertItem contactUpsertItem = JsonRequestContactUpsertItem.builder().contactIdentifier(hospitalExternalIdentifier).contact(contact).build();<NEW_LINE>requestContactUpsert = JsonRequestContactUpsert.builder().requestItem(contactUpsertItem).build();<NEW_LINE>}<NEW_LINE>final JsonCompositeAlbertaBPartner compositeAlbertaBPartner;<NEW_LINE>{<NEW_LINE>// alberta composite<NEW_LINE><MASK><NEW_LINE>albertaBPartner.setTimestamp(asInstant(hospital.getTimestamp()));<NEW_LINE>compositeAlbertaBPartner = JsonCompositeAlbertaBPartner.builder().jsonAlbertaBPartner(albertaBPartner).role(JsonBPartnerRole.Hospital).build();<NEW_LINE>}<NEW_LINE>final JsonRequestComposite compositeUpsertItem = JsonRequestComposite.builder().orgCode(orgCode).bpartner(jsonRequestBPartner).locations(upsertLocationsRequest).contacts(requestContactUpsert).compositeAlbertaBPartner(compositeAlbertaBPartner).build();<NEW_LINE>return JsonRequestBPartnerUpsertItem.builder().bpartnerIdentifier(hospitalExternalIdentifier).bpartnerComposite(compositeUpsertItem).build();<NEW_LINE>}
final JsonAlbertaBPartner albertaBPartner = new JsonAlbertaBPartner();
813,046
public static void deletePath(String path, BrokerDesc brokerDesc) throws UserException {<NEW_LINE>TNetworkAddress address = getAddress(brokerDesc);<NEW_LINE>TFileBrokerService.Client client = borrowClient(address);<NEW_LINE>boolean failed = true;<NEW_LINE>try {<NEW_LINE>TBrokerDeletePathRequest tDeletePathRequest = new TBrokerDeletePathRequest(TBrokerVersion.VERSION_ONE, path, brokerDesc.getProperties());<NEW_LINE>TBrokerOperationStatus tOperationStatus = null;<NEW_LINE>try {<NEW_LINE>tOperationStatus = client.deletePath(tDeletePathRequest);<NEW_LINE>} catch (TException e) {<NEW_LINE>reopenClient(client);<NEW_LINE>tOperationStatus = client.deletePath(tDeletePathRequest);<NEW_LINE>}<NEW_LINE>if (tOperationStatus.getStatusCode() != TBrokerOperationStatusCode.OK) {<NEW_LINE>throw new UserException("Broker delete path failed. path=" + path + ", broker=" + address + ", msg=" + tOperationStatus.getMessage());<NEW_LINE>}<NEW_LINE>failed = false;<NEW_LINE>} catch (TException e) {<NEW_LINE>LOG.warn("Broker read path exception, path={}, address={}, exception={}", path, address, e);<NEW_LINE>throw new UserException("Broker read path exception. path=" + path + ",broker=" + address);<NEW_LINE>} finally {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
returnClient(client, address, failed);
618,266
private void updateWithCluster(ManagerService service, MySqlUpdateStatement update, ManagerWritableTable managerTable, LinkedHashMap<String, String> values, PacketResult packetResult) {<NEW_LINE>// cluster-lock<NEW_LINE>DistributeLock distributeLock;<NEW_LINE>ClusterHelper clusterHelper = ClusterHelper.getInstance(ClusterOperation.CONFIG);<NEW_LINE>distributeLock = clusterHelper.createDistributeLock(ClusterMetaUtil.getConfChangeLockPath());<NEW_LINE>if (!distributeLock.acquire()) {<NEW_LINE>packetResult.setSuccess(false);<NEW_LINE>packetResult.setErrorMsg("Other instance is reloading, please try again later.");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>LOGGER.info("update dble_information[{}]: added distributeLock {}", managerTable.getTableName(<MASK><NEW_LINE>try {<NEW_LINE>generalUpdate(service, update, managerTable, values, packetResult);<NEW_LINE>} finally {<NEW_LINE>distributeLock.release();<NEW_LINE>}<NEW_LINE>}
), ClusterMetaUtil.getConfChangeLockPath());
559,324
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {<NEW_LINE>String method = request.getParameter("testMethod");<NEW_LINE>System.out.println(">>> BEGIN: " + method);<NEW_LINE>System.out.println("Request URL: " + request.getRequestURL() + '?' + request.getQueryString());<NEW_LINE>PrintWriter writer = response.getWriter();<NEW_LINE>if (method != null && method.length() > 0) {<NEW_LINE>try {<NEW_LINE>// Use reflection to try invoking various test method signatures:<NEW_LINE>// 1) method(HttpServletRequest request, HttpServletResponse response)<NEW_LINE>// 2) method()<NEW_LINE>// 3) use custom method invocation by calling invokeTest(method, request, response)<NEW_LINE>try {<NEW_LINE>Method mthd = getClass().getMethod(method, HttpServletRequest.class, HttpServletResponse.class);<NEW_LINE>mthd.invoke(this, request, response);<NEW_LINE>} catch (NoSuchMethodException nsme) {<NEW_LINE>Method mthd = getClass().getMethod(method, (Class<?>[]) null);<NEW_LINE>mthd.invoke(this);<NEW_LINE>}<NEW_LINE>writer.println("SUCCESS");<NEW_LINE>} catch (Throwable t) {<NEW_LINE>if (t instanceof InvocationTargetException) {<NEW_LINE>t = t.getCause();<NEW_LINE>}<NEW_LINE>System.out.println("ERROR: " + t);<NEW_LINE>StringWriter sw = new StringWriter();<NEW_LINE>t.printStackTrace(new PrintWriter(sw));<NEW_LINE>System.err.print(sw);<NEW_LINE>writer.println("ERROR: Caught exception attempting to call test method " + method + " on servlet " + <MASK><NEW_LINE>t.printStackTrace(writer);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE>System.out.println("ERROR: expected testMethod parameter");<NEW_LINE>writer.println("ERROR: expected testMethod parameter");<NEW_LINE>}<NEW_LINE>writer.flush();<NEW_LINE>writer.close();<NEW_LINE>System.out.println("<<< END: " + method);<NEW_LINE>}
getClass().getName());
840,545
protected JRBaseFiller createBandSubfiller(final PartPrintOutput output) throws JRException {<NEW_LINE>BandReportFillerParent bandParent = new PartBandParent(output);<NEW_LINE>JRBaseFiller bandFiller;<NEW_LINE>JasperReport jasperReport = getReport();<NEW_LINE>switch(jasperReport.getPrintOrderValue()) {<NEW_LINE>case HORIZONTAL:<NEW_LINE>bandFiller = new JRHorizontalFiller(getJasperReportsContext(), jasperReportSource, bandParent);<NEW_LINE>break;<NEW_LINE>case VERTICAL:<NEW_LINE>bandFiller = new JRVerticalFiller(<MASK><NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>throw new JRRuntimeException(EXCEPTION_MESSAGE_KEY_UNKNOWN_REPORT_PRINT_ORDER, new Object[] { jasperReport.getPrintOrderValue() });<NEW_LINE>}<NEW_LINE>bandFiller.addFillListener(new FillListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void pageGenerated(JasperPrint jasperPrint, int pageIndex) {<NEW_LINE>// NOP<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void pageUpdated(JasperPrint jasperPrint, int pageIndex) {<NEW_LINE>output.pageUpdated(pageIndex);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>return bandFiller;<NEW_LINE>}
getJasperReportsContext(), jasperReportSource, bandParent);
1,414,818
public void load(SerializedField metadata, DrillBuf buffer) {<NEW_LINE>List<SerializedField> children = metadata.getChildList();<NEW_LINE>SerializedField offsetField = children.get(0);<NEW_LINE><MASK><NEW_LINE>int bufOffset = offsetField.getBufferLength();<NEW_LINE>for (int i = 1; i < children.size(); i++) {<NEW_LINE>SerializedField child = children.get(i);<NEW_LINE>MaterializedField fieldDef = MaterializedField.create(child);<NEW_LINE>ValueVector vector = getChild(fieldDef.getName());<NEW_LINE>if (vector == null) {<NEW_LINE>// if we arrive here, we didn't have a matching vector.<NEW_LINE>vector = BasicTypeHelper.getNewVector(fieldDef, allocator);<NEW_LINE>putChild(fieldDef.getName(), vector);<NEW_LINE>}<NEW_LINE>int vectorLength = child.getBufferLength();<NEW_LINE>vector.load(child, buffer.slice(bufOffset, vectorLength));<NEW_LINE>bufOffset += vectorLength;<NEW_LINE>}<NEW_LINE>assert bufOffset == buffer.writerIndex();<NEW_LINE>}
offsets.load(offsetField, buffer);