idx
int32
46
1.86M
input
stringlengths
321
6.6k
target
stringlengths
9
1.24k
855,291
JSONObject writeItemsToJson(@NonNull JSONObject json) {<NEW_LINE>JSONArray jsonArray = new JSONArray();<NEW_LINE>if (!items.isEmpty()) {<NEW_LINE>try {<NEW_LINE>for (OsmNotesPoint point : items) {<NEW_LINE>JSONObject jsonObject = new JSONObject();<NEW_LINE>jsonObject.put(TEXT_KEY, point.getText());<NEW_LINE>jsonObject.put(LAT_KEY, point.getLatitude());<NEW_LINE>jsonObject.put(LON_KEY, point.getLongitude());<NEW_LINE>jsonObject.put(<MASK><NEW_LINE>jsonObject.put(ACTION_KEY, OsmPoint.stringAction.get(point.getAction()));<NEW_LINE>jsonArray.put(jsonObject);<NEW_LINE>}<NEW_LINE>json.put("items", jsonArray);<NEW_LINE>} catch (JSONException e) {<NEW_LINE>warnings.add(app.getString(R.string.settings_item_write_error, String.valueOf(getType())));<NEW_LINE>SettingsHelper.LOG.error("Failed write to json", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return json;<NEW_LINE>}
AUTHOR_KEY, point.getAuthor());
868,302
private void scanCompositeDatatype(Class<? extends ICompositeType> theClass, DatatypeDef theDatatypeDefinition) {<NEW_LINE>ourLog.debug("Scanning datatype class: {}", theClass.getName());<NEW_LINE>RuntimeCompositeDatatypeDefinition elementDef;<NEW_LINE>if (theClass.equals(ExtensionDt.class)) {<NEW_LINE>elementDef = new RuntimeExtensionDtDefinition(theDatatypeDefinition, theClass, true, myContext, myClassToElementDefinitions);<NEW_LINE>// } else if (IBaseMetaType.class.isAssignableFrom(theClass)) {<NEW_LINE>// resourceDef = new RuntimeMetaDefinition(theDatatypeDefinition, theClass, isStandardType(theClass));<NEW_LINE>} else {<NEW_LINE>elementDef = new RuntimeCompositeDatatypeDefinition(theDatatypeDefinition, theClass, isStandardType(theClass), myContext, myClassToElementDefinitions);<NEW_LINE>}<NEW_LINE><MASK><NEW_LINE>myNameToElementDefinitions.put(elementDef.getName().toLowerCase(), elementDef);<NEW_LINE>elementDef.populateScanAlso(myScanAlso);<NEW_LINE>}
myClassToElementDefinitions.put(theClass, elementDef);
640,690
public Predicate toPredicate(Root<JobDetail> root, CriteriaQuery<?> query, CriteriaBuilder cb) {<NEW_LINE>List<Predicate> list = new ArrayList<Predicate>();<NEW_LINE>In<Object> in = cb.in(root.get("organ"));<NEW_LINE>list.add(cb.equal(root.get("orgi").as(String.class), user.getOrgi()));<NEW_LINE>list.add(cb.equal(root.get("tasktype").as(String.class), MainContext.TaskType.BATCH.toString()));<NEW_LINE>if (organList.size() > 0) {<NEW_LINE>for (String id : organList) {<NEW_LINE>in.value(id);<NEW_LINE>}<NEW_LINE>} else {<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>list.add(in);<NEW_LINE>Predicate[] p = new Predicate[list.size()];<NEW_LINE>return cb.and(list.toArray(p));<NEW_LINE>}
in.value(Constants.CSKEFU_SYSTEM_NO_DAT);
1,215,617
private Map<String, List<GeneralStateTestCaseEipSpec>> generate(final BlockHeader blockHeader, final ReferenceTestWorldState initialWorldState, final Map<String, List<PostSection>> postSections, final StateTestVersionedTransaction versionedTransaction) {<NEW_LINE>BlockHeader safeHeader = blockHeader;<NEW_LINE>initialWorldState.persist(null);<NEW_LINE>final Map<String, List<GeneralStateTestCaseEipSpec>> res = new LinkedHashMap<>(postSections.size());<NEW_LINE>for (final Map.Entry<String, List<PostSection>> entry : postSections.entrySet()) {<NEW_LINE>final <MASK><NEW_LINE>if (eip.equalsIgnoreCase(MainnetProtocolSpecs.LONDON_FORK_NAME) && !blockHeader.getBaseFee().isPresent()) {<NEW_LINE>// for legacy state tests running in London, this value depends on<NEW_LINE>// the test filler's (retesteth's) default baseFee, currently 0x0a (10)<NEW_LINE>safeHeader = new ReferenceTestEnv(blockHeader.getCoinbase().toShortHexString(), blockHeader.getDifficulty().toShortHexString(), UInt256.valueOf(blockHeader.getGasLimit()).toShortHexString(), UInt256.valueOf(blockHeader.getNumber()).toShortHexString(), "0x0a", UInt256.valueOf(blockHeader.getTimestamp()).toShortHexString());<NEW_LINE>}<NEW_LINE>final List<PostSection> post = entry.getValue();<NEW_LINE>final List<GeneralStateTestCaseEipSpec> specs = new ArrayList<>(post.size());<NEW_LINE>for (final PostSection p : post) {<NEW_LINE>final Supplier<Transaction> txSupplier = () -> versionedTransaction.get(p.indexes);<NEW_LINE>specs.add(new GeneralStateTestCaseEipSpec(eip, txSupplier, initialWorldState, p.rootHash, p.logsHash, safeHeader, p.indexes.data, p.indexes.gas, p.indexes.value));<NEW_LINE>}<NEW_LINE>res.put(eip, specs);<NEW_LINE>}<NEW_LINE>return res;<NEW_LINE>}
String eip = entry.getKey();
1,217,893
final GetPolicyResult executeGetPolicy(GetPolicyRequest getPolicyRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getPolicyRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE><MASK><NEW_LINE>Request<GetPolicyRequest> request = null;<NEW_LINE>Response<GetPolicyResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetPolicyRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(getPolicyRequest));<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, "Lambda");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetPolicy");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetPolicyResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetPolicyResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
1,238,722
public boolean eIsSet(int featureID) {<NEW_LINE>switch(featureID) {<NEW_LINE>case ModelPackage.MBRICKLET_LINEAR_POTI__LOGGER:<NEW_LINE>return LOGGER_EDEFAULT == null ? logger != null : !LOGGER_EDEFAULT.equals(logger);<NEW_LINE>case ModelPackage.MBRICKLET_LINEAR_POTI__UID:<NEW_LINE>return UID_EDEFAULT == null ? uid != null : !UID_EDEFAULT.equals(uid);<NEW_LINE>case ModelPackage.MBRICKLET_LINEAR_POTI__POLL:<NEW_LINE>return poll != POLL_EDEFAULT;<NEW_LINE>case ModelPackage.MBRICKLET_LINEAR_POTI__ENABLED_A:<NEW_LINE>return ENABLED_A_EDEFAULT == null ? enabledA != null <MASK><NEW_LINE>case ModelPackage.MBRICKLET_LINEAR_POTI__TINKERFORGE_DEVICE:<NEW_LINE>return tinkerforgeDevice != null;<NEW_LINE>case ModelPackage.MBRICKLET_LINEAR_POTI__IP_CONNECTION:<NEW_LINE>return IP_CONNECTION_EDEFAULT == null ? ipConnection != null : !IP_CONNECTION_EDEFAULT.equals(ipConnection);<NEW_LINE>case ModelPackage.MBRICKLET_LINEAR_POTI__CONNECTED_UID:<NEW_LINE>return CONNECTED_UID_EDEFAULT == null ? connectedUid != null : !CONNECTED_UID_EDEFAULT.equals(connectedUid);<NEW_LINE>case ModelPackage.MBRICKLET_LINEAR_POTI__POSITION:<NEW_LINE>return position != POSITION_EDEFAULT;<NEW_LINE>case ModelPackage.MBRICKLET_LINEAR_POTI__DEVICE_IDENTIFIER:<NEW_LINE>return deviceIdentifier != DEVICE_IDENTIFIER_EDEFAULT;<NEW_LINE>case ModelPackage.MBRICKLET_LINEAR_POTI__NAME:<NEW_LINE>return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);<NEW_LINE>case ModelPackage.MBRICKLET_LINEAR_POTI__BRICKD:<NEW_LINE>return basicGetBrickd() != null;<NEW_LINE>case ModelPackage.MBRICKLET_LINEAR_POTI__CALLBACK_PERIOD:<NEW_LINE>return callbackPeriod != CALLBACK_PERIOD_EDEFAULT;<NEW_LINE>case ModelPackage.MBRICKLET_LINEAR_POTI__TF_CONFIG:<NEW_LINE>return tfConfig != null;<NEW_LINE>case ModelPackage.MBRICKLET_LINEAR_POTI__SENSOR_VALUE:<NEW_LINE>return sensorValue != null;<NEW_LINE>case ModelPackage.MBRICKLET_LINEAR_POTI__DEVICE_TYPE:<NEW_LINE>return DEVICE_TYPE_EDEFAULT == null ? deviceType != null : !DEVICE_TYPE_EDEFAULT.equals(deviceType);<NEW_LINE>}<NEW_LINE>return super.eIsSet(featureID);<NEW_LINE>}
: !ENABLED_A_EDEFAULT.equals(enabledA);
314,123
public Client filter(Client client) {<NEW_LINE>ReadOnlyClient pseudoClient = new ReadOnlyClient(client);<NEW_LINE>// create all pseudo accounts<NEW_LINE>Map<Account, ReadOnlyAccount> account2pseudo = new HashMap<>();<NEW_LINE>Function<Account, ReadOnlyAccount> computeReadOnlyAccount = a -> {<NEW_LINE>ReadOnlyAccount pa = new ReadOnlyAccount(a);<NEW_LINE>pseudoClient.internalAddAccount(pa);<NEW_LINE>return pa;<NEW_LINE>};<NEW_LINE>accounts.stream().forEach(a -> account2pseudo.put(a, computeReadOnlyAccount.apply(a)));<NEW_LINE>// create all pseudo portfolios<NEW_LINE>Map<Portfolio, ReadOnlyPortfolio> portfolio2pseudo = new HashMap<>();<NEW_LINE>portfolios.stream().forEach(p -> {<NEW_LINE>ReadOnlyAccount pseudoAccount = account2pseudo.computeIfAbsent(<MASK><NEW_LINE>ReadOnlyPortfolio pseudoPortfolio = new ReadOnlyPortfolio(p);<NEW_LINE>pseudoPortfolio.setReferenceAccount(pseudoAccount);<NEW_LINE>pseudoClient.internalAddPortfolio(pseudoPortfolio);<NEW_LINE>portfolio2pseudo.put(p, pseudoPortfolio);<NEW_LINE>});<NEW_LINE>Set<Security> usedSecurities = new HashSet<>();<NEW_LINE>// keep track of transactions processed for a portfolio where the<NEW_LINE>// reference account is not included in the filter (otherwise if<NEW_LINE>// multiple portfolio share the same reference account, transactions are<NEW_LINE>// included multiple times)<NEW_LINE>Set<AccountTransaction> processedSecurityTx = new HashSet<>();<NEW_LINE>for (Portfolio portfolio : portfolios) {<NEW_LINE>adaptPortfolioTransactions(portfolio, portfolio2pseudo, account2pseudo, usedSecurities);<NEW_LINE>if (!accounts.contains(portfolio.getReferenceAccount()))<NEW_LINE>collectSecurityRelevantTx(portfolio, account2pseudo.get(portfolio.getReferenceAccount()), usedSecurities, processedSecurityTx);<NEW_LINE>}<NEW_LINE>for (Account account : accounts) adaptAccountTransactions(account, account2pseudo, usedSecurities);<NEW_LINE>for (Security security : usedSecurities) pseudoClient.internalAddSecurity(security);<NEW_LINE>return pseudoClient;<NEW_LINE>}
p.getReferenceAccount(), computeReadOnlyAccount);
1,710,576
private static void compareWithJdk(Mode mode) {<NEW_LINE>MersenneTwister rand = new MersenneTwister(12345);<NEW_LINE>int toolong = 0;<NEW_LINE>for (int i = 0; i < 1000000; i++) {<NEW_LINE>double value = Double.longBitsToDouble(rand.nextLong());<NEW_LINE>String a = Double.toString(value);<NEW_LINE>// All of the longer strings from the JDK end in E{16,17,18}.<NEW_LINE>// if (a.endsWith("E16") || a.endsWith("E17") || a.endsWith("E18")) {<NEW_LINE>// continue;<NEW_LINE>// }<NEW_LINE>// We're nice and compare with the CONSERVATIVE rounding mode here.<NEW_LINE>String b = RyuDouble.doubleToString(value, RoundingMode.CONSERVATIVE);<NEW_LINE>if (a.length() > b.length()) {<NEW_LINE>if (toolong < 20 || mode == Mode.CSV) {<NEW_LINE>// Only print the first 20.<NEW_LINE>printComparison(value, <MASK><NEW_LINE>}<NEW_LINE>toolong++;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (mode != Mode.CSV) {<NEW_LINE>System.out.println("Jdk: " + toolong + " / " + 100000 + " are longer");<NEW_LINE>}<NEW_LINE>}
b, a, mode, "Jdk");
428,686
public static void main(String[] args) throws IOException {<NEW_LINE>PrintWriter out;<NEW_LINE>String rules;<NEW_LINE>if (args.length > 0) {<NEW_LINE>rules = args[0];<NEW_LINE>} else {<NEW_LINE>rules = "edu/stanford/nlp/ling/tokensregex/demo/rules/colors.rules.txt";<NEW_LINE>}<NEW_LINE>if (args.length > 2) {<NEW_LINE>out = new PrintWriter(args[2]);<NEW_LINE>} else {<NEW_LINE>out = new PrintWriter(System.out);<NEW_LINE>}<NEW_LINE>Properties properties = new Properties();<NEW_LINE>properties.setProperty("annotators", "tokenize,ssplit,pos,lemma,ner,tokensregexdemo");<NEW_LINE>properties.setProperty("customAnnotatorClass.tokensregexdemo", "edu.stanford.nlp.pipeline.TokensRegexAnnotator");<NEW_LINE>properties.setProperty("tokensregexdemo.rules", rules);<NEW_LINE>StanfordCoreNLP pipeline = new StanfordCoreNLP(properties);<NEW_LINE>Annotation annotation;<NEW_LINE>if (args.length > 1) {<NEW_LINE>annotation = new Annotation(IOUtils.slurpFileNoExceptions(args[1]));<NEW_LINE>} else {<NEW_LINE>annotation = new Annotation("Both blue and light blue are nice colors.");<NEW_LINE>}<NEW_LINE>pipeline.annotate(annotation);<NEW_LINE>// An Annotation is a Map and you can get and use the various analyses individually.<NEW_LINE>// The toString() method on an Annotation just prints the text of the Annotation<NEW_LINE>// But you can see what is in it with other methods like toShorterString()<NEW_LINE>out.println();<NEW_LINE>out.println("The top level annotation");<NEW_LINE>out.<MASK><NEW_LINE>out.println();<NEW_LINE>List<CoreMap> sentences = annotation.get(CoreAnnotations.SentencesAnnotation.class);<NEW_LINE>for (CoreMap sentence : sentences) {<NEW_LINE>// NOTE: Depending on what tokensregex rules are specified, there are other annotations<NEW_LINE>// that are of interest other than just the tokens and what we print out here<NEW_LINE>for (CoreLabel token : sentence.get(CoreAnnotations.TokensAnnotation.class)) {<NEW_LINE>// Print out words, lemma, ne, and normalized ne<NEW_LINE>String word = token.get(CoreAnnotations.TextAnnotation.class);<NEW_LINE>String lemma = token.get(CoreAnnotations.LemmaAnnotation.class);<NEW_LINE>String pos = token.get(CoreAnnotations.PartOfSpeechAnnotation.class);<NEW_LINE>String ne = token.get(CoreAnnotations.NamedEntityTagAnnotation.class);<NEW_LINE>String normalized = token.get(CoreAnnotations.NormalizedNamedEntityTagAnnotation.class);<NEW_LINE>out.println("token: " + "word=" + word + ", lemma=" + lemma + ", pos=" + pos + ", ne=" + ne + ", normalized=" + normalized);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>out.flush();<NEW_LINE>}
println(annotation.toShorterString());
208,305
public final void actionPerformed(@Nonnull final AnActionEvent event) {<NEW_LINE>final <MASK><NEW_LINE>final HierarchyBrowserBaseEx browser = (HierarchyBrowserBaseEx) dataContext.getData(myBrowserDataKey);<NEW_LINE>if (browser == null)<NEW_LINE>return;<NEW_LINE>final PsiElement selectedElement = browser.getSelectedElement();<NEW_LINE>if (selectedElement == null || !browser.isApplicableElement(selectedElement))<NEW_LINE>return;<NEW_LINE>final String currentViewType = browser.myCurrentViewType;<NEW_LINE>Disposer.dispose(browser);<NEW_LINE>final HierarchyProvider provider = BrowseHierarchyActionBase.findProvider(myProviderLanguageExtension, selectedElement, selectedElement.getContainingFile(), event.getDataContext());<NEW_LINE>final HierarchyBrowser newBrowser = BrowseHierarchyActionBase.createAndAddToPanel(selectedElement.getProject(), provider, selectedElement);<NEW_LINE>ApplicationManager.getApplication().invokeLater(new Runnable() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void run() {<NEW_LINE>((HierarchyBrowserBaseEx) newBrowser).changeView(correctViewType(browser, currentViewType));<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
DataContext dataContext = event.getDataContext();
1,020,607
protected void onCreate(Bundle savedInstanceState) {<NEW_LINE>super.onCreate(savedInstanceState);<NEW_LINE>setContentView(R.layout.games_info);<NEW_LINE>WindowManager.LayoutParams lp = new WindowManager.LayoutParams();<NEW_LINE>lp.copyFrom(getWindow().getAttributes());<NEW_LINE>lp.width = WindowManager.LayoutParams.MATCH_PARENT;<NEW_LINE>lp.height = WindowManager.LayoutParams.WRAP_CONTENT;<NEW_LINE><MASK><NEW_LINE>String packageName = getIntent().getStringExtra(EXTRA_GAME_PACACKE_NAME);<NEW_LINE>// receive package info<NEW_LINE>PackageManager packageManager = getPackageManager();<NEW_LINE>ApplicationInfo applicationInfo;<NEW_LINE>try {<NEW_LINE>applicationInfo = packageManager.getApplicationInfo(packageName, 0);<NEW_LINE>} catch (PackageManager.NameNotFoundException e) {<NEW_LINE>Log.w(TAG, e);<NEW_LINE>finish();<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>CharSequence appLabel = packageManager.getApplicationLabel(applicationInfo);<NEW_LINE>Drawable appIcon = packageManager.getApplicationIcon(applicationInfo);<NEW_LINE>((ImageView) findViewById(R.id.app_icon)).setImageDrawable(appIcon);<NEW_LINE>((TextView) findViewById(R.id.title)).setText(getString(R.string.games_info_title, appLabel));<NEW_LINE>findViewById(android.R.id.button1).setOnClickListener(new View.OnClickListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void onClick(View v) {<NEW_LINE>finish();<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
getWindow().setAttributes(lp);
921,581
public void handle(JsonNode packet) {<NEW_LINE>long channelId = packet.get("channel_id").asLong();<NEW_LINE>// if the message isn't from a server (or ephemeral)<NEW_LINE>// See https://github.com/discord/discord-api-docs/issues/2248<NEW_LINE>if (!packet.hasNonNull("guild_id")) {<NEW_LINE>// Check for EPHEMERAL messages as they do NOT include a guild_id when the EPHEMERAL flag is set.<NEW_LINE>if (packet.hasNonNull("flags") && (packet.get("flags").asInt() & MessageFlag.EPHEMERAL.getId()) > 0) {<NEW_LINE>Optional<ServerTextChannel> serverTextChannel = api.getServerTextChannelById(channelId);<NEW_LINE>if (serverTextChannel.isPresent()) {<NEW_LINE>handle(serverTextChannel.get(), packet);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Optional<ServerThreadChannel> serverThreadChannel = api.getServerThreadChannelById(channelId);<NEW_LINE>if (serverThreadChannel.isPresent()) {<NEW_LINE>handle(serverThreadChannel.get(), packet);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>UserImpl author = new UserImpl(api, packet.get("author"), (MemberImpl) null, null);<NEW_LINE>PrivateChannelImpl privateChannel = PrivateChannelImpl.getOrCreatePrivateChannel(api, channelId, author.getId(), author);<NEW_LINE>handle(privateChannel, packet);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Optional<TextChannel> <MASK><NEW_LINE>if (optionalChannel.isPresent()) {<NEW_LINE>handle(optionalChannel.get(), packet);<NEW_LINE>} else {<NEW_LINE>LoggerUtil.logMissingChannel(logger, channelId);<NEW_LINE>}<NEW_LINE>}
optionalChannel = api.getTextChannelById(channelId);
86,085
public void editRow(int row, Object[] values) {<NEW_LINE>CommonDDBean ref = getEjbRef(row);<NEW_LINE>if (ref instanceof EjbRef) {<NEW_LINE>EjbRef param = (EjbRef) ref;<NEW_LINE>param.setEjbRefName((String) values[0]);<NEW_LINE>param.setEjbRefType((String) values[1]);<NEW_LINE>param.setHome((String) values[3]);<NEW_LINE>param.setRemote((String) values[4]);<NEW_LINE>String ejbLink = (String) values[5];<NEW_LINE>param.setEjbLink(ejbLink.length() > 0 ? ejbLink : null);<NEW_LINE>String desc = (String) values[6];<NEW_LINE>param.setDescription(desc.length(<MASK><NEW_LINE>fireTableRowsUpdated(row, row);<NEW_LINE>} else {<NEW_LINE>EjbLocalRef param = (EjbLocalRef) ref;<NEW_LINE>param.setEjbRefName((String) values[0]);<NEW_LINE>param.setEjbRefType((String) values[1]);<NEW_LINE>param.setLocalHome((String) values[3]);<NEW_LINE>param.setLocal((String) values[4]);<NEW_LINE>String ejbLink = (String) values[5];<NEW_LINE>param.setEjbLink(ejbLink.length() > 0 ? ejbLink : null);<NEW_LINE>String desc = (String) values[6];<NEW_LINE>param.setDescription(desc.length() > 0 ? desc : null);<NEW_LINE>fireTableRowsUpdated(row, row);<NEW_LINE>}<NEW_LINE>}
) > 0 ? desc : null);
807,159
private PResult handleStringMetaData(final PStringMetaData stringMetaData) {<NEW_LINE>if (logger.isDebugEnabled()) {<NEW_LINE>logger.debug("Handle PStringMetaData={}", MessageFormatUtils.debugLog(stringMetaData));<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final Header agentInfo = ServerContext.getAgentInfo();<NEW_LINE>final String agentId = agentInfo.getAgentId();<NEW_LINE>final <MASK><NEW_LINE>final String stringValue = stringMetaData.getStringValue();<NEW_LINE>final StringMetaDataBo stringMetaDataBo = new StringMetaDataBo(agentId, agentStartTime, stringMetaData.getStringId(), stringValue);<NEW_LINE>stringMetaDataService.insert(stringMetaDataBo);<NEW_LINE>return PResult.newBuilder().setSuccess(true).build();<NEW_LINE>} catch (Exception e) {<NEW_LINE>logger.warn("Failed to handle stringMetaData={}", MessageFormatUtils.debugLog(stringMetaData), e);<NEW_LINE>// Avoid detailed error messages.<NEW_LINE>return PResult.newBuilder().setSuccess(false).setMessage("Internal Server Error").build();<NEW_LINE>}<NEW_LINE>}
long agentStartTime = agentInfo.getAgentStartTime();
799,324
public void testServletSubmitsManagedTaskThatLooksUpBMTBean(HttpServletRequest request, HttpServletResponse response) throws Exception {<NEW_LINE><MASK><NEW_LINE>Future<?> future = executor.submit(new Callable<Void>() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Void call() throws Exception {<NEW_LINE>Runnable ejbRunnable = (Runnable) new InitialContext().lookup("java:global/concurrent/ConcurrentBMTBean!java.lang.Runnable");<NEW_LINE>ejbRunnable.run();<NEW_LINE>ConcurrentBMT ejb = (ConcurrentBMT) new InitialContext().lookup("java:global/concurrent/ConcurrentBMTBean!ejb.ConcurrentBMT");<NEW_LINE>tran.begin();<NEW_LINE>try {<NEW_LINE>Object txKeyBefore = tranSyncRegistry.getTransactionKey();<NEW_LINE>Object ejbTxKey = ejb.getTransactionKey();<NEW_LINE>if (ejbTxKey != null)<NEW_LINE>throw new Exception("Transaction " + ejbTxKey + " found when invoking BMT bean method. Transaction on invoking thread was " + txKeyBefore);<NEW_LINE>ejbRunnable.run();<NEW_LINE>Object txKeyAfter = tranSyncRegistry.getTransactionKey();<NEW_LINE>if (!txKeyBefore.equals(txKeyAfter))<NEW_LINE>throw new Exception("Original transaction " + txKeyBefore + " not resumed on thread. Instead " + txKeyAfter);<NEW_LINE>} finally {<NEW_LINE>tran.commit();<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>try {<NEW_LINE>future.get();<NEW_LINE>} finally {<NEW_LINE>future.cancel(true);<NEW_LINE>}<NEW_LINE>}
PrintWriter out = response.getWriter();
54,942
public void run(final FlowTrigger trigger, Map data) {<NEW_LINE>VirtualRouterStruct s = new VirtualRouterStruct();<NEW_LINE>s.setInherentSystemTags(list(VirtualRouterSystemTags.DEDICATED_ROLE_VR.getTagFormat(), VirtualRouterSystemTags<MASK><NEW_LINE>s.setVirtualRouterVmSelector(new VirtualRouterVmSelector() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public VirtualRouterVmVO select(List<VirtualRouterVmVO> vrs) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>});<NEW_LINE>s.setL3Network(l3);<NEW_LINE>s.setNotGatewayForGuestL3Network(true);<NEW_LINE>acquireVirtualRouterVm(s, new ReturnValueCompletion<VirtualRouterVmInventory>(trigger) {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void success(VirtualRouterVmInventory returnValue) {<NEW_LINE>vr = returnValue;<NEW_LINE>new VirtualRouterRoleManager().makeLoadBalancerRole(vr.getUuid());<NEW_LINE>trigger.next();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void fail(ErrorCode errorCode) {<NEW_LINE>trigger.fail(errorCode);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.VR_LB_ROLE.getTagFormat()));
490,031
protected void runOneIteration() {<NEW_LINE>try {<NEW_LINE>LaunchingTasks launchingTasks = new LaunchingTasks(facadeService.getEligibleJobContext());<NEW_LINE>List<TaskRequest> taskRequests = launchingTasks.getPendingTasks();<NEW_LINE>if (!taskRequests.isEmpty()) {<NEW_LINE>AppConstraintEvaluator.getInstance().loadAppRunningState();<NEW_LINE>}<NEW_LINE>Collection<VMAssignmentResult> vmAssignmentResults = taskScheduler.scheduleOnce(taskRequests, LeasesQueue.getInstance().drainTo()).getResultMap().values();<NEW_LINE>List<TaskContext> taskContextsList = new LinkedList<>();<NEW_LINE>Map<List<Protos.OfferID>, List<Protos.TaskInfo>> offerIdTaskInfoMap = new HashMap<>();<NEW_LINE>for (VMAssignmentResult each : vmAssignmentResults) {<NEW_LINE>List<VirtualMachineLease> leasesUsed = each.getLeasesUsed();<NEW_LINE>List<Protos.TaskInfo> taskInfoList = new ArrayList<>(each.getTasksAssigned().size() * 10);<NEW_LINE>taskInfoList.addAll(getTaskInfoList(launchingTasks.getIntegrityViolationJobs(vmAssignmentResults), each, leasesUsed.get(0).hostname(), leasesUsed.get(0).getOffer()));<NEW_LINE>for (Protos.TaskInfo taskInfo : taskInfoList) {<NEW_LINE>taskContextsList.add(TaskContext.from(taskInfo.getTaskId().getValue()));<NEW_LINE>}<NEW_LINE>offerIdTaskInfoMap.put(getOfferIDs(leasesUsed), taskInfoList);<NEW_LINE>}<NEW_LINE>for (TaskContext each : taskContextsList) {<NEW_LINE>facadeService.addRunning(each);<NEW_LINE>jobTracingEventBus.post(createJobStatusTraceEvent(each));<NEW_LINE>}<NEW_LINE>facadeService.removeLaunchTasksFromQueue(taskContextsList);<NEW_LINE>for (Entry<List<OfferID>, List<TaskInfo>> each : offerIdTaskInfoMap.entrySet()) {<NEW_LINE>schedulerDriver.launchTasks(each.getKey(), each.getValue());<NEW_LINE>}<NEW_LINE>// CHECKSTYLE:OFF<NEW_LINE>} catch (Throwable throwable) {<NEW_LINE>// CHECKSTYLE:ON<NEW_LINE><MASK><NEW_LINE>} finally {<NEW_LINE>AppConstraintEvaluator.getInstance().clearAppRunningState();<NEW_LINE>}<NEW_LINE>}
log.error("Launch task error", throwable);
1,605,082
private List<HandlerMethodArgumentResolver> buildArgumentResolvers(boolean listCapable) {<NEW_LINE>List<HandlerMethodArgumentResolver> <MASK><NEW_LINE>resolvers.add(new PayloadExpressionArgumentResolver());<NEW_LINE>resolvers.add(new NullAwarePayloadArgumentResolver(this.argumentResolverMessageConverter));<NEW_LINE>resolvers.add(new PayloadsArgumentResolver());<NEW_LINE>if (listCapable) {<NEW_LINE>resolvers.add(new CollectionArgumentResolver(true));<NEW_LINE>}<NEW_LINE>resolvers.add(new MapArgumentResolver());<NEW_LINE>for (HandlerMethodArgumentResolver resolver : resolvers) {<NEW_LINE>if (resolver instanceof BeanFactoryAware) {<NEW_LINE>((BeanFactoryAware) resolver).setBeanFactory(this.beanFactory);<NEW_LINE>}<NEW_LINE>if (resolver instanceof InitializingBean) {<NEW_LINE>try {<NEW_LINE>((InitializingBean) resolver).afterPropertiesSet();<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new BeanInitializationException("Cannot initialize 'HandlerMethodArgumentResolver'", ex);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return resolvers;<NEW_LINE>}
resolvers = new ArrayList<>();
1,417,351
public void delete(final QualifiedName name, final List<String> partitionIds) {<NEW_LINE>validateDeletes(name, partitionIds != null ? partitionIds.size() : 0);<NEW_LINE>final MetacatRequestContext metacatRequestContext = MetacatContextManager.getContext();<NEW_LINE>registry.distributionSummary(this.partitionDeleteDistSummary.withTags(name.parts())).<MASK><NEW_LINE>if (!tableService.exists(name)) {<NEW_LINE>throw new TableNotFoundException(name);<NEW_LINE>}<NEW_LINE>if (!partitionIds.isEmpty()) {<NEW_LINE>final PartitionsSaveRequestDto dto = new PartitionsSaveRequestDto();<NEW_LINE>dto.setPartitionIdsForDeletes(partitionIds);<NEW_LINE>eventBus.post(new MetacatDeleteTablePartitionPreEvent(name, metacatRequestContext, this, dto));<NEW_LINE>final ConnectorPartitionService service = connectorManager.getPartitionService(name);<NEW_LINE>// Get the partitions before calling delete<NEW_LINE>final GetPartitionsRequestDto requestDto = new GetPartitionsRequestDto(null, partitionIds, false, true);<NEW_LINE>final ConnectorRequestContext connectorRequestContext = converterUtil.toConnectorContext(metacatRequestContext);<NEW_LINE>final List<PartitionInfo> partitionInfos = service.getPartitions(connectorRequestContext, name, converterUtil.toPartitionListRequest(requestDto, null, null), this.getTableInfo(name));<NEW_LINE>List<HasMetadata> partitions = Lists.newArrayList();<NEW_LINE>List<PartitionDto> partitionDtos = Lists.newArrayList();<NEW_LINE>if (partitionInfos != null) {<NEW_LINE>partitionDtos = partitionInfos.stream().map(converterUtil::toPartitionDto).collect(Collectors.toList());<NEW_LINE>partitions = new ArrayList<>(partitions);<NEW_LINE>}<NEW_LINE>log.info("Deleting partitions with names {} for {}", partitionIds, name);<NEW_LINE>service.deletePartitions(connectorRequestContext, name, partitionIds, this.getTableInfo(name));<NEW_LINE>// delete metadata<NEW_LINE>log.info("Deleting user metadata for partitions with names {} for {}", partitionIds, name);<NEW_LINE>if (!partitions.isEmpty()) {<NEW_LINE>deleteMetadatas(metacatRequestContext.getUserName(), partitions);<NEW_LINE>}<NEW_LINE>eventBus.post(new MetacatDeleteTablePartitionPostEvent(name, metacatRequestContext, this, partitionDtos));<NEW_LINE>}<NEW_LINE>}
record(partitionIds.size());
1,068,132
public void sendAsync(String brokerAddr, Datagram request, long responseTimeout, ResponseFuture.Callback callback) throws ClientSendException {<NEW_LINE>final Channel channel = getOrCreateChannel(brokerAddr);<NEW_LINE>final ResponseFuture responseFuture = clientHandler.<MASK><NEW_LINE>request.getHeader().setOpaque(responseFuture.getOpaque());<NEW_LINE>try {<NEW_LINE>channel.writeAndFlush(request).addListener(new ChannelFutureListener() {<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public void operationComplete(ChannelFuture future) {<NEW_LINE>if (future.isSuccess()) {<NEW_LINE>responseFuture.setSendOk(true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>clientHandler.removeResponse(channel, responseFuture);<NEW_LINE>responseFuture.completeBySendFail(future.cause());<NEW_LINE>LOGGER.error("send request to broker failed.", future.cause());<NEW_LINE>try {<NEW_LINE>responseFuture.executeCallbackOnlyOnce();<NEW_LINE>} catch (Throwable e) {<NEW_LINE>LOGGER.error("execute callback when send error exception", e);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>clientHandler.removeResponse(channel, responseFuture);<NEW_LINE>responseFuture.completeBySendFail(e);<NEW_LINE>LOGGER.warn("send request fail. brokerAddr={}", brokerAddr);<NEW_LINE>throw new ClientSendException(SendErrorCode.WRITE_CHANNEL_FAIL, RemoteHelper.parseChannelRemoteAddress(channel), e);<NEW_LINE>}<NEW_LINE>}
newResponse(channel, responseTimeout, callback);
273,181
// NOI18N<NEW_LINE>@Hint(displayName = "#DN_org.netbeans.modules.java.hints.ClassStructure.noopMethodInAbstractClass", description = "#DESC_org.netbeans.modules.java.hints.ClassStructure.noopMethodInAbstractClass", category = "class_structure", enabled = false, suppressWarnings = { "NoopMethodInAbstractClass" }, options = Options.QUERY)<NEW_LINE>@TriggerTreeKind(Kind.METHOD)<NEW_LINE>public static ErrorDescription noopMethodInAbstractClass(HintContext context) {<NEW_LINE>final MethodTree mth = (MethodTree) context.getPath().getLeaf();<NEW_LINE>final Tree parent = context.getPath().getParentPath().getLeaf();<NEW_LINE>if (TreeUtilities.CLASS_TREE_KINDS.contains(parent.getKind()) && ((ClassTree) parent).getModifiers().getFlags().contains(Modifier.ABSTRACT)) {<NEW_LINE>final BlockTree body = mth.getBody();<NEW_LINE>if (body != null && body.getStatements().isEmpty()) {<NEW_LINE>// NOI18N<NEW_LINE>return ErrorDescriptionFactory.forName(context, mth, NbBundle.getMessage(ClassStructure.class, "MSG_NoopMethodInAbstractClass"<MASK><NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
, mth.getName()));
1,079,046
private void generateFieldsBuilderConstructor(JDefinedClass builderClass, JDefinedClass concreteBuilderClass, JDefinedClass instanceClass, JMethod instanceConstructor) {<NEW_LINE>// Locate the instance field since we'll need it to assign a value<NEW_LINE>JFieldVar instanceField = reflectionHelper.searchClassAndSuperClassesForField("instance", builderClass);<NEW_LINE>// Create a new method to be the builder constructor we're defining<NEW_LINE>JMethod builderConstructor = builderClass.constructor(JMod.PUBLIC);<NEW_LINE>builderConstructor.annotate(SuppressWarnings.class).param("value", "unchecked");<NEW_LINE>JBlock constructorBlock = builderConstructor.body();<NEW_LINE>// The builder constructor should have the exact same parameters as the instanceConstructor<NEW_LINE>for (JVar param : instanceConstructor.params()) {<NEW_LINE>builderConstructor.param(param.type(), param.name());<NEW_LINE>}<NEW_LINE>// Determine if we need to invoke the super() method for our parent builder<NEW_LINE>JClass parentClass = builderClass._extends();<NEW_LINE>if (!(parentClass.isPrimitive() || reflectionHelper.isFinal(parentClass) || Objects.equals(parentClass.fullName(), "java.lang.Object"))) {<NEW_LINE>constructorBlock.invoke("super");<NEW_LINE>}<NEW_LINE>// The constructor invocation will also need all the parameters passed through<NEW_LINE>JInvocation <MASK><NEW_LINE>for (JVar param : instanceConstructor.params()) {<NEW_LINE>instanceConstructorInvocation.arg(param);<NEW_LINE>}<NEW_LINE>// Only initialize the instance if the object being constructed is actually this class<NEW_LINE>// if it's a subtype then ignore the instance initialization since the subclass will initialize it<NEW_LINE>constructorBlock.directStatement("// Skip initialization when called from subclass");<NEW_LINE>JInvocation comparison = JExpr._this().invoke("getClass").invoke("equals").arg(JExpr.dotclass(concreteBuilderClass));<NEW_LINE>JConditional ifNotSubclass = constructorBlock._if(comparison);<NEW_LINE>ifNotSubclass._then().assign(JExpr._this().ref(instanceField), JExpr.cast(instanceField.type(), instanceConstructorInvocation));<NEW_LINE>generateFieldsConcreteBuilderConstructor(builderClass, concreteBuilderClass, instanceConstructor);<NEW_LINE>}
instanceConstructorInvocation = JExpr._new(instanceClass);
1,379,118
public RerouteExplanation execute(RoutingAllocation allocation, boolean explain) {<NEW_LINE>final DiscoveryNode discoNode;<NEW_LINE>try {<NEW_LINE>discoNode = allocation.nodes().resolveNode(node);<NEW_LINE>} catch (IllegalArgumentException e) {<NEW_LINE>return explainOrThrowRejectedCommand(explain, allocation, e);<NEW_LINE>}<NEW_LINE>final RoutingNodes routingNodes = allocation.routingNodes();<NEW_LINE>RoutingNode routingNode = routingNodes.node(discoNode.getId());<NEW_LINE>if (routingNode == null) {<NEW_LINE>return explainOrThrowMissingRoutingNode(allocation, explain, discoNode);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>allocation.routingTable().shardRoutingTable(index, shardId).primaryShard();<NEW_LINE>} catch (IndexNotFoundException | ShardNotFoundException e) {<NEW_LINE>return explainOrThrowRejectedCommand(explain, allocation, e);<NEW_LINE>}<NEW_LINE>ShardRouting shardRouting = null;<NEW_LINE>for (ShardRouting shard : allocation.routingNodes().unassigned()) {<NEW_LINE>if (shard.getIndexName().equals(index) && shard.getId() == shardId && shard.primary()) {<NEW_LINE>shardRouting = shard;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (shardRouting == null) {<NEW_LINE>return explainOrThrowRejectedCommand(explain, allocation, "primary [" + index + "][" + shardId + "] is already assigned");<NEW_LINE>}<NEW_LINE>if (acceptDataLoss == false) {<NEW_LINE>String dataLossWarning = "allocating an empty primary for [" + index + "][" + shardId + "] can result in data loss. Please " + "confirm by setting the accept_data_loss parameter to true";<NEW_LINE>return explainOrThrowRejectedCommand(explain, allocation, dataLossWarning);<NEW_LINE>}<NEW_LINE>if (shardRouting.recoverySource().getType() != RecoverySource.Type.EXISTING_STORE) {<NEW_LINE>return explainOrThrowRejectedCommand(explain, allocation, "trying to allocate an existing primary shard [" + <MASK><NEW_LINE>}<NEW_LINE>initializeUnassignedShard(allocation, routingNodes, routingNode, shardRouting, null, RecoverySource.ExistingStoreRecoverySource.FORCE_STALE_PRIMARY_INSTANCE);<NEW_LINE>return new RerouteExplanation(this, allocation.decision(Decision.YES, name() + " (allocation command)", "ignore deciders"));<NEW_LINE>}
index + "][" + shardId + "], while no such shard has ever been active");
1,778,712
public Object invoke(MethodInvocation methodInvocation) throws Throwable {<NEW_LINE>EntityManager em = emProvider.get();<NEW_LINE>// obtain a cached finder descriptor (or create a new one)<NEW_LINE>JpaFinderProxy.FinderDescriptor finderDescriptor = getFinderDescriptor(methodInvocation);<NEW_LINE>Object result = null;<NEW_LINE>// execute as query (named params or otherwise)<NEW_LINE>Query jpaQuery = finderDescriptor.createQuery(em);<NEW_LINE>if (finderDescriptor.isBindAsRawParameters) {<NEW_LINE>bindQueryRawParameters(jpaQuery, finderDescriptor, methodInvocation.getArguments());<NEW_LINE>} else {<NEW_LINE>bindQueryNamedParameters(jpaQuery, <MASK><NEW_LINE>}<NEW_LINE>// depending upon return type, decorate or return the result as is<NEW_LINE>if (JpaFinderProxy.ReturnType.PLAIN.equals(finderDescriptor.returnType)) {<NEW_LINE>result = jpaQuery.getSingleResult();<NEW_LINE>} else if (JpaFinderProxy.ReturnType.COLLECTION.equals(finderDescriptor.returnType)) {<NEW_LINE>result = getAsCollection(finderDescriptor, jpaQuery.getResultList());<NEW_LINE>} else if (JpaFinderProxy.ReturnType.ARRAY.equals(finderDescriptor.returnType)) {<NEW_LINE>result = jpaQuery.getResultList().toArray();<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
finderDescriptor, methodInvocation.getArguments());
1,506,547
final CreateNotificationRuleResult executeCreateNotificationRule(CreateNotificationRuleRequest createNotificationRuleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createNotificationRuleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateNotificationRuleRequest> request = null;<NEW_LINE>Response<CreateNotificationRuleResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new CreateNotificationRuleRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createNotificationRuleRequest));<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, "codestar notifications");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateNotificationRule");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<CreateNotificationRuleResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateNotificationRuleResultJsonUnmarshaller());<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);
798,214
final GetDeploymentResult executeGetDeployment(GetDeploymentRequest getDeploymentRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(getDeploymentRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<GetDeploymentRequest> request = null;<NEW_LINE>Response<GetDeploymentResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new GetDeploymentRequestProtocolMarshaller(protocolFactory).marshall<MASK><NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "ApiGatewayV2");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDeployment");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<GetDeploymentResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new GetDeploymentResultJsonUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
(super.beforeMarshalling(getDeploymentRequest));
969,830
public static void changeServerPorts(LibertyServer server, int httpPort, int httpsPort) throws Exception {<NEW_LINE>ServerConfiguration config = server.getServerConfiguration();<NEW_LINE>HttpEndpoint http = config.getHttpEndpoints().getById("defaultHttpEndpoint");<NEW_LINE>if (http == null) {<NEW_LINE>http = new HttpEndpoint();<NEW_LINE>http.setId("defaultHttpEndpoint");<NEW_LINE>http.setHttpPort(Integer.toString(httpPort));<NEW_LINE>http.setHttpsPort(Integer.toString(httpsPort));<NEW_LINE>config.getHttpEndpoints().add(http);<NEW_LINE>} else if (Integer.parseInt(http.getHttpPort()) == httpPort && Integer.parseInt(http.getHttpsPort()) == httpsPort) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>http.setHttpPort(Integer.toString(httpPort));<NEW_LINE>http.setHttpsPort(Integer.toString(httpsPort));<NEW_LINE>if (server.isStarted()) {<NEW_LINE>// Set the mark to the current end of log<NEW_LINE>setMarkToEndOfAllLogs(server);<NEW_LINE>// Save the config and wait for message that was a result of the config change<NEW_LINE>server.updateServerConfiguration(config);<NEW_LINE>assertNotNull("FAIL: Didn't get expected config update log messages.", server.waitForConfigUpdateInLogUsingMark(null, false));<NEW_LINE>String regex = "Updated server information.*" + "httpPort=" + (httpPort == -1 ? 0 : httpPort) + ", httpsPort=" + (httpsPort <MASK><NEW_LINE>server.waitForStringInTrace(regex, TIMEOUT);<NEW_LINE>} else {<NEW_LINE>server.updateServerConfiguration(config);<NEW_LINE>}<NEW_LINE>}
== -1 ? 0 : httpsPort);
1,409,108
public Object apply(ActionContext ctx, Object caller, Object[] sources) throws FrameworkException {<NEW_LINE>assertArrayHasMinLengthAndAllElementsNotNull(sources, 1);<NEW_LINE>String baseUrl = null;<NEW_LINE>String userParameter = null;<NEW_LINE>Boolean runWithXserver = false;<NEW_LINE>String xServerSettings = null;<NEW_LINE>final String page = sources[0].toString();<NEW_LINE>if (sources.length >= 2) {<NEW_LINE>userParameter = sources[1].toString();<NEW_LINE>}<NEW_LINE>if (sources.length >= 3) {<NEW_LINE>baseUrl = sources[2].toString();<NEW_LINE>}<NEW_LINE>if (sources.length >= 4) {<NEW_LINE>runWithXserver = (Boolean) sources[3];<NEW_LINE>}<NEW_LINE>if (sources.length >= 5) {<NEW_LINE>xServerSettings = sources[4].toString();<NEW_LINE>}<NEW_LINE>if (baseUrl == null || baseUrl.length() == 0) {<NEW_LINE>baseUrl = ActionContext.getBaseUrl(ctx.getSecurityContext().getRequest()) + "/";<NEW_LINE>}<NEW_LINE>Principal currentUser = ctx.getSecurityContext().getUser(false);<NEW_LINE>List<Param> parameterList = new ArrayList<Param>();<NEW_LINE>if (currentUser instanceof SuperUser) {<NEW_LINE>parameterList.add(new Param("--custom-header X-User superadmin --custom-header X-Password " + Settings.SuperUserPassword.getValue()));<NEW_LINE>parameterList.add(new Param("--custom-header-propagation"));<NEW_LINE>} else {<NEW_LINE>final HttpSession session = ctx.getSecurityContext().getSession();<NEW_LINE>final String sessionId = (session instanceof Session) ? ((Session) session).getExtendedId() : session.getId();<NEW_LINE>parameterList.add(new Param("--cookie JSESSIONID " + sessionId));<NEW_LINE>}<NEW_LINE>if (userParameter != null) {<NEW_LINE>parameterList.add(new Param(userParameter));<NEW_LINE>}<NEW_LINE>final ByteArrayOutputStream baos = new ByteArrayOutputStream();<NEW_LINE>try {<NEW_LINE>if (!runWithXserver) {<NEW_LINE>return convertPageToPdfWithoutXServer(baseUrl, page, parameterList, baos);<NEW_LINE>} else {<NEW_LINE>return convertPageToPdfWithXServer(baseUrl, <MASK><NEW_LINE>}<NEW_LINE>} catch (final Throwable t) {<NEW_LINE>logger.warn("Could not convert page {}{} to pdf... retrying with xvfb...", baseUrl, page);<NEW_LINE>return convertPageToPdfWithXServer(baseUrl, page, parameterList, baos, xServerSettings);<NEW_LINE>}<NEW_LINE>}
page, parameterList, baos, xServerSettings);
481,194
public Response<Void> deleteByIdWithResponse(String id, String ifMatch, Context context) {<NEW_LINE>String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");<NEW_LINE>if (resourceGroupName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));<NEW_LINE>}<NEW_LINE>String serviceName = Utils.getValueFromIdByName(id, "service");<NEW_LINE>if (serviceName == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.format("The resource ID '%s' is not valid. Missing path segment 'service'.", id)));<NEW_LINE>}<NEW_LINE>String versionSetId = Utils.getValueFromIdByName(id, "apiVersionSets");<NEW_LINE>if (versionSetId == null) {<NEW_LINE>throw LOGGER.logExceptionAsError(new IllegalArgumentException(String.<MASK><NEW_LINE>}<NEW_LINE>return this.deleteWithResponse(resourceGroupName, serviceName, versionSetId, ifMatch, context);<NEW_LINE>}
format("The resource ID '%s' is not valid. Missing path segment 'apiVersionSets'.", id)));
386,198
private void jbInit() throws Exception {<NEW_LINE>bPartnerLabel.setText(Msg.getElement(Env.getCtx(), "C_BPartner_ID"));<NEW_LINE>CPanel parameterPanel = dialog.getParameterPanel();<NEW_LINE>parameterPanel.setLayout(new BorderLayout());<NEW_LINE>CPanel parameterStdPanel = new CPanel(new GridBagLayout());<NEW_LINE>parameterPanel.add(parameterStdPanel, BorderLayout.CENTER);<NEW_LINE>parameterStdPanel.add(bPartnerLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));<NEW_LINE>if (bPartnerField != null)<NEW_LINE>parameterStdPanel.add(bPartnerField, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, <MASK><NEW_LINE>}
5), 0, 0));
1,491,948
public okhttp3.Call placeOrderCall(Order body, final ApiCallback _callback) throws ApiException {<NEW_LINE>String basePath = null;<NEW_LINE>// Operation Servers<NEW_LINE>String[] localBasePaths = new String[] {};<NEW_LINE>// Determine Base Path to Use<NEW_LINE>if (localCustomBaseUrl != null) {<NEW_LINE>basePath = localCustomBaseUrl;<NEW_LINE>} else if (localBasePaths.length > 0) {<NEW_LINE>basePath = localBasePaths[localHostIndex];<NEW_LINE>} else {<NEW_LINE>basePath = null;<NEW_LINE>}<NEW_LINE>Object localVarPostBody = body;<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/store/order";<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new HashMap<String, Object>();<NEW_LINE>final String[] localVarAccepts = { "application/xml", "application/json" };<NEW_LINE>final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>if (localVarAccept != null) {<NEW_LINE>localVarHeaderParams.put("Accept", localVarAccept);<NEW_LINE>}<NEW_LINE>final String[] localVarContentTypes = {};<NEW_LINE>final String <MASK><NEW_LINE>if (localVarContentType != null) {<NEW_LINE>localVarHeaderParams.put("Content-Type", localVarContentType);<NEW_LINE>}<NEW_LINE>String[] localVarAuthNames = new String[] {};<NEW_LINE>return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback);<NEW_LINE>}
localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes);
573,425
private void dragChart(MouseEvent e) {<NEW_LINE>double deltaPxX = e.getX() - mouseDownStartX;<NEW_LINE>double deltaPxY = e.getY() - mouseDownStartY;<NEW_LINE>double deltaX = deltaPxX * mouseDownValPerPxX;<NEW_LINE>double deltaY = deltaPxY * mouseDownValPerPxY.get(0);<NEW_LINE>if (Double.isNaN(mouseDownMinX) || Double.isNaN(mouseDownMaxX) || Double.isNaN(mouseDownMinY.get(0)) || Double.isNaN(mouseDownMaxY.get(0)) || Double.isNaN(deltaX) || Double.isNaN(deltaY) || Double.isInfinite(mouseDownMinX) || Double.isInfinite(mouseDownMaxX) || Double.isInfinite(mouseDownMinY.get(0)) || Double.isInfinite(mouseDownMaxY.get(0)) || Double.isInfinite(deltaX) || Double.isInfinite(deltaY)) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>zoom(mouseDownMinX - deltaX, mouseDownMaxX - deltaX, mouseDownMinY.get(0) + deltaY, mouseDownMaxY.get(0) + deltaY);<NEW_LINE>setVariableWidthXAxisFormat();<NEW_LINE>// do moving for right Y axes<NEW_LINE>for (int i = 0; i < rightYAxis.size(); i++) {<NEW_LINE>AAxis <MASK><NEW_LINE>double deltaYRight = deltaPxY * mouseDownValPerPxY.get(i + 1);<NEW_LINE>zoom(axis, axis.translateValueToPx(mouseDownMinY.get(i + 1) + deltaYRight), axis.translateValueToPx(mouseDownMaxY.get(i + 1) + deltaYRight));<NEW_LINE>}<NEW_LINE>}
axis = rightYAxis.get(i);
984,449
public Void visitBinary(BinaryTree binaryTree, Void unused) {<NEW_LINE>ExpressionTree left = unwrap(binaryTree.getLeftOperand());<NEW_LINE>ExpressionTree right = unwrap(binaryTree.getRightOperand());<NEW_LINE>if (IS_ENABLED.matches(left, state) && sameLoggerAtSameLevel(logInvocation, left, state)) {<NEW_LINE>// `isEnabled` on left. Replace binary condition with just the right side.<NEW_LINE>this.fix = Optional.of(SuggestedFix.replace(binaryTree, state.getSourceForNode(binaryTree.getRightOperand())));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (IS_ENABLED.matches(right, state) && sameLoggerAtSameLevel(logInvocation, right, state)) {<NEW_LINE>// `isEnabled` on right. Replace binary condition with just the left side.<NEW_LINE>this.fix = Optional.of(SuggestedFix.replace(binaryTree, state.getSourceForNode(binaryTree.getLeftOperand())));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>return <MASK><NEW_LINE>}
super.visitBinary(binaryTree, null);
807,768
public boolean add(final E e) {<NEW_LINE>boolean result = false;<NEW_LINE>final OneOrMore<E> values = backingMap.get(e);<NEW_LINE>// Skip the item if we are deduplicating and the item already exists<NEW_LINE>boolean skipItem = (deduplicate && null != values && values.contains(e));<NEW_LINE>if (!skipItem) {<NEW_LINE>if (null != limit && size >= limit) {<NEW_LINE>// Check the item against the last item.<NEW_LINE>final Map.Entry<E, OneOrMore<E>> last = backingMap.lastEntry();<NEW_LINE>if (0 < comparator.compare(last.getKey(), e)) {<NEW_LINE>if (1 < last.getValue().size()) {<NEW_LINE>last.getValue().removeAnyItem();<NEW_LINE>} else {<NEW_LINE>backingMap.<MASK><NEW_LINE>}<NEW_LINE>size--;<NEW_LINE>} else {<NEW_LINE>skipItem = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (!skipItem) {<NEW_LINE>if (null == values) {<NEW_LINE>backingMap.put(e, new OneOrMore<>(deduplicate, e));<NEW_LINE>size++;<NEW_LINE>result = true;<NEW_LINE>} else if (values.add(e)) {<NEW_LINE>size++;<NEW_LINE>result = true;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
remove(last.getKey());
649,647
public Answer cloneVolumeFromBaseTemplate(final CopyCommand cmd) {<NEW_LINE>final Connection conn = hypervisorResource.getConnection();<NEW_LINE>final DataTO srcData = cmd.getSrcTO();<NEW_LINE>final DataTO destData = cmd.getDestTO();<NEW_LINE>final VolumeObjectTO volume = (VolumeObjectTO) destData;<NEW_LINE>VDI vdi = null;<NEW_LINE>try {<NEW_LINE>VDI tmpltvdi = null;<NEW_LINE>tmpltvdi = getVDIbyUuid(conn, srcData.getPath());<NEW_LINE>vdi = tmpltvdi.createClone(conn, new HashMap<String, String>());<NEW_LINE>Long virtualSize = vdi.getVirtualSize(conn);<NEW_LINE>if (volume.getSize() > virtualSize) {<NEW_LINE>s_logger.debug("Overriding provided template's size with new size " + toHumanReadableSize(volume.getSize()) + " for volume: " + volume.getName());<NEW_LINE>vdi.resize(conn, volume.getSize());<NEW_LINE>} else {<NEW_LINE>s_logger.debug("Using templates disk size of " + toHumanReadableSize(virtualSize) + " for volume: " + volume.getName() + " since size passed was " + toHumanReadableSize<MASK><NEW_LINE>}<NEW_LINE>vdi.setNameLabel(conn, volume.getName());<NEW_LINE>VDI.Record vdir;<NEW_LINE>vdir = vdi.getRecord(conn);<NEW_LINE>s_logger.debug("Successfully created VDI: Uuid = " + vdir.uuid);<NEW_LINE>final VolumeObjectTO newVol = new VolumeObjectTO();<NEW_LINE>newVol.setName(vdir.nameLabel);<NEW_LINE>newVol.setSize(vdir.virtualSize);<NEW_LINE>newVol.setPath(vdir.uuid);<NEW_LINE>return new CopyCmdAnswer(newVol);<NEW_LINE>} catch (final Exception e) {<NEW_LINE>s_logger.warn("Unable to create volume; Pool=" + destData + "; Disk: ", e);<NEW_LINE>return new CopyCmdAnswer(e.toString());<NEW_LINE>}<NEW_LINE>}
(volume.getSize()));
945,258
private void readObject(ObjectInputStream in) throws ClassNotFoundException, IOException {<NEW_LINE>boolean hasValue = in.readBoolean();<NEW_LINE>String vString = in.readUTF();<NEW_LINE>projectName = hasValue ? vString : null;<NEW_LINE>hasValue = in.readBoolean();<NEW_LINE>int vInteger = in.readInt();<NEW_LINE>tabSize = hasValue ? vInteger : null;<NEW_LINE>hasValue = in.readBoolean();<NEW_LINE>long vLong = in.readLong();<NEW_LINE>analyzerGuruVersion = hasValue ? vLong : null;<NEW_LINE>if (analyzersVersions == null) {<NEW_LINE>analyzersVersions = new HashMap<>();<NEW_LINE>}<NEW_LINE>int analyzerCount = in.readInt();<NEW_LINE>for (int i = 0; i < analyzerCount; ++i) {<NEW_LINE>vString = in.readUTF();<NEW_LINE>vLong = in.readLong();<NEW_LINE>analyzersVersions.put(vString, vLong);<NEW_LINE>}<NEW_LINE>if (indexedSymlinks == null) {<NEW_LINE>indexedSymlinks = new HashMap<>();<NEW_LINE>}<NEW_LINE>int symlinkCount = in.readInt();<NEW_LINE>for (int i = 0; i < symlinkCount; ++i) {<NEW_LINE>String absolute = in.readUTF();<NEW_LINE>String canonical = in.readUTF();<NEW_LINE>boolean isLocal = in.readBoolean();<NEW_LINE>IndexedSymlink indexed = new IndexedSymlink(absolute, canonical, isLocal);<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
indexedSymlinks.put(canonical, indexed);
1,369,591
private static void handleUnchecked(Permissions collection, PatternBuilder patternBuilder, String urlPatternSpec) {<NEW_LINE>String httpMethodSpec = null;<NEW_LINE>BitSet noAuthMethods = patternBuilder.getNoAuthMethods();<NEW_LINE>if (!patternBuilder.otherConstraint.isAuthConstrained()) {<NEW_LINE><MASK><NEW_LINE>methods.andNot(noAuthMethods);<NEW_LINE>if (!methods.isEmpty()) {<NEW_LINE>httpMethodSpec = "!" + MethodValue.getActions(methods);<NEW_LINE>}<NEW_LINE>} else if (!noAuthMethods.isEmpty()) {<NEW_LINE>httpMethodSpec = MethodValue.getActions(noAuthMethods);<NEW_LINE>} else {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>collection.add(new WebResourcePermission(urlPatternSpec, httpMethodSpec));<NEW_LINE>if (logger.isLoggable(FINE)) {<NEW_LINE>logger.fine("JACC: constraint capture: adding unchecked (for authorization) methods: " + httpMethodSpec);<NEW_LINE>}<NEW_LINE>}
BitSet methods = patternBuilder.getMethodSet();
1,678,906
public Result<List<Map<String, Object>>> apiHistory(@QueryParameter("id") String apiId) {<NEW_LINE>//<NEW_LINE>List<Map<FieldDef, String>> //<NEW_LINE>releaseList = //<NEW_LINE>this.dataAccessLayer.//<NEW_LINE>listObjectBy(//<NEW_LINE>EntityDef.RELEASE, DatawayUtils.conditionByApiId(apiId));<NEW_LINE>releaseList = (releaseList == null) ? Collections.emptyList() : releaseList;<NEW_LINE>//<NEW_LINE>SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");<NEW_LINE>//<NEW_LINE>List<Map<String, Object>> //<NEW_LINE>dataList = releaseList.parallelStream().filter(releaseItem -> {<NEW_LINE>if (releaseItem == null) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>ApiStatusEnum statusEnum = ApiStatusEnum.typeOf(releaseItem.get(FieldDef.STATUS));<NEW_LINE>return statusEnum != null && statusEnum != ApiStatusEnum.Delete;<NEW_LINE>}).map((Function<Map<FieldDef, String>, Map<String, Object>>) releaseItem -> {<NEW_LINE>return new HashMap<String, Object>() {<NEW_LINE><NEW_LINE>{<NEW_LINE>put("historyId", releaseItem.get(FieldDef.ID));<NEW_LINE>put("status", ApiStatusEnum.typeOf(releaseItem.get(FieldDef.<MASK><NEW_LINE>put("time", dateFormat.format(new Date(Long.parseLong(releaseItem.get(FieldDef.RELEASE_TIME)))));<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}).collect(Collectors.toList());<NEW_LINE>return Result.of(dataList);<NEW_LINE>}
STATUS)).typeNum());
1,254,235
protected MachineRecipe findNextRecipe(BlockMenu menu) {<NEW_LINE>if (!hasFreeSlot(menu)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>for (int slot : getInputSlots()) {<NEW_LINE>ItemStack item = menu.getItemInSlot(slot);<NEW_LINE>if (SlimefunUtils.isItemSimilar(item, gravel, true, false)) {<NEW_LINE>ItemStack output = goldPan.getRandomOutput();<NEW_LINE>MachineRecipe recipe = new MachineRecipe(3 / getSpeed(), new ItemStack[] { gravel }, new ItemStack[] { output });<NEW_LINE>if (output.getType() != Material.AIR && menu.fits(output, getOutputSlots())) {<NEW_LINE>menu.consumeItem(slot);<NEW_LINE>return recipe;<NEW_LINE>}<NEW_LINE>} else if (SlimefunUtils.isItemSimilar(item, soulSand, true, false)) {<NEW_LINE>ItemStack output = netherGoldPan.getRandomOutput();<NEW_LINE>MachineRecipe recipe = new MachineRecipe(4 / getSpeed(), new ItemStack[] { soulSand }, <MASK><NEW_LINE>if (output.getType() != Material.AIR && menu.fits(output, getOutputSlots())) {<NEW_LINE>menu.consumeItem(slot);<NEW_LINE>return recipe;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return null;<NEW_LINE>}
new ItemStack[] { output });
1,226,519
public void run() {<NEW_LINE>if (skipRunningTask()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>MembershipChangeSchedule schedule = getMembershipChangeSchedule();<NEW_LINE>if (schedule == null) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (logger.isFineEnabled()) {<NEW_LINE>logger.fine("Handling " + schedule);<NEW_LINE>}<NEW_LINE>List<CPGroupMembershipChange> changes = schedule.getChanges();<NEW_LINE>CountDownLatch latch = new CountDownLatch(changes.size());<NEW_LINE>Map<CPGroupId, BiTuple<Long, Long>> <MASK><NEW_LINE>for (CPGroupMembershipChange change : changes) {<NEW_LINE>applyOnRaftGroup(latch, changedGroups, change);<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>latch.await();<NEW_LINE>completeMembershipChanges(changedGroups);<NEW_LINE>} catch (InterruptedException e) {<NEW_LINE>logger.warning("Membership changes interrupted while executing " + schedule + ". completed: " + changedGroups, e);<NEW_LINE>Thread.currentThread().interrupt();<NEW_LINE>}<NEW_LINE>}
changedGroups = new ConcurrentHashMap<>();
1,153,104
public ModelApiResponse uploadFileWithRequiredFile(Long petId, File requiredFile, String additionalMetadata) throws ApiException {<NEW_LINE>Object localVarPostBody = null;<NEW_LINE>// verify the required parameter 'petId' is set<NEW_LINE>if (petId == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFileWithRequiredFile");<NEW_LINE>}<NEW_LINE>// verify the required parameter 'requiredFile' is set<NEW_LINE>if (requiredFile == null) {<NEW_LINE>throw new ApiException(400, "Missing the required parameter 'requiredFile' when calling uploadFileWithRequiredFile");<NEW_LINE>}<NEW_LINE>// create path and map variables<NEW_LINE>String localVarPath = "/fake/{petId}/uploadImageWithRequiredFile".replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString()));<NEW_LINE>// query params<NEW_LINE>List<Pair> localVarQueryParams = new ArrayList<Pair>();<NEW_LINE>List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>();<NEW_LINE>Map<String, String> localVarHeaderParams = new HashMap<String, String>();<NEW_LINE>Map<String, String> localVarCookieParams = new HashMap<String, String>();<NEW_LINE>Map<String, Object> localVarFormParams = new <MASK><NEW_LINE>if (additionalMetadata != null)<NEW_LINE>localVarFormParams.put("additionalMetadata", additionalMetadata);<NEW_LINE>if (requiredFile != null)<NEW_LINE>localVarFormParams.put("requiredFile", requiredFile);<NEW_LINE>final String[] localVarAccepts = { "application/json" };<NEW_LINE>final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);<NEW_LINE>final String[] localVarContentTypes = { "multipart/form-data" };<NEW_LINE>final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);<NEW_LINE>String[] localVarAuthNames = new String[] { "petstore_auth" };<NEW_LINE>TypeReference<ModelApiResponse> localVarReturnType = new TypeReference<ModelApiResponse>() {<NEW_LINE>};<NEW_LINE>return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);<NEW_LINE>}
HashMap<String, Object>();
1,752,840
boolean validateSharedSettingsPath() {<NEW_LINE>String sharedSettingsPath = sharedSettingsTextField.getText().trim();<NEW_LINE>// Automatically valid if shared settings aren't selected<NEW_LINE>if (!sharedConfigCheckbox.isSelected()) {<NEW_LINE>return true;<NEW_LINE>}<NEW_LINE>if (sharedSettingsPath.isEmpty()) {<NEW_LINE>sharedSettingsErrorTextField.setVisible(true);<NEW_LINE>sharedSettingsErrorTextField.setText(NbBundle.getMessage<MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!isFolderPathValid(sharedSettingsPath)) {<NEW_LINE>sharedSettingsErrorTextField.setVisible(true);<NEW_LINE>sharedSettingsErrorTextField.setText(NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.PathInvalid"));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (false == permissionsAppropriate(sharedSettingsPath)) {<NEW_LINE>sharedSettingsErrorTextField.setVisible(true);<NEW_LINE>sharedSettingsErrorTextField.setText(NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.CannotAccess") + " " + sharedSettingsPath + " " + NbBundle.getMessage(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.CheckPermissions", System.getProperty("user.name")));<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>sharedSettingsErrorTextField.setText("");<NEW_LINE>return true;<NEW_LINE>}
(AutoIngestSettingsPanel.class, "AutoIngestSettingsPanel.EmptySettingsDirectory"));
1,684,869
int implRead(char[] cbuf, int off, int end) throws IOException {<NEW_LINE>// In order to handle surrogate pairs, this method requires that<NEW_LINE>// the invoker attempt to read at least two characters. Saving the<NEW_LINE>// extra character, if any, at a higher level is easier than trying<NEW_LINE>// to deal with it here.<NEW_LINE>assert (end - off > 1);<NEW_LINE>CharBuffer cb = CharBuffer.wrap(<MASK><NEW_LINE>if (cb.position() != 0)<NEW_LINE>// Ensure that cb[0] == cbuf[off]<NEW_LINE>cb = cb.slice();<NEW_LINE>boolean eof = false;<NEW_LINE>for (; ; ) {<NEW_LINE>CoderResult cr = decoder.decode(bb, cb, eof);<NEW_LINE>if (cr.isUnderflow()) {<NEW_LINE>if (eof)<NEW_LINE>break;<NEW_LINE>if (!cb.hasRemaining())<NEW_LINE>break;<NEW_LINE>if ((cb.position() > 0) && !inReady())<NEW_LINE>// Block at most once<NEW_LINE>break;<NEW_LINE>int n = readBytes();<NEW_LINE>if (n < 0) {<NEW_LINE>eof = true;<NEW_LINE>if ((cb.position() == 0) && (!bb.hasRemaining()))<NEW_LINE>break;<NEW_LINE>decoder.reset();<NEW_LINE>}<NEW_LINE>continue;<NEW_LINE>}<NEW_LINE>if (cr.isOverflow()) {<NEW_LINE>assert cb.position() > 0;<NEW_LINE>break;<NEW_LINE>}<NEW_LINE>cr.throwException();<NEW_LINE>}<NEW_LINE>if (eof) {<NEW_LINE>// ## Need to flush decoder<NEW_LINE>decoder.reset();<NEW_LINE>}<NEW_LINE>if (cb.position() == 0) {<NEW_LINE>if (eof)<NEW_LINE>return -1;<NEW_LINE>assert false;<NEW_LINE>}<NEW_LINE>return cb.position();<NEW_LINE>}
cbuf, off, end - off);
628,632
private void writeName(Writer code, StructInfo target, String readValue, String writerName, boolean external) throws IOException {<NEW_LINE>if (target.enumConstantNameSource != null) {<NEW_LINE>String constantNameType = extractReturnType(target.enumConstantNameSource);<NEW_LINE>StructInfo info = context.structs.get(constantNameType);<NEW_LINE>OptimizedConverter converter = <MASK><NEW_LINE>String value = readValue + "." + target.enumConstantNameSource;<NEW_LINE>if (info != null && info.converter != null) {<NEW_LINE>code.append(info.converter.fullName).append(".").append(info.converter.writer).append(".write(writer, ").append(value).append(");\n");<NEW_LINE>} else if (converter != null) {<NEW_LINE>code.append(converter.nonNullableEncoder("writer", value)).append(";\n");<NEW_LINE>} else {<NEW_LINE>code.append(writerName).append(".write(writer, ").append(external ? readValue : value).append(");\n");<NEW_LINE>}<NEW_LINE>} else if (isAllSimple(target)) {<NEW_LINE>code.append("{ writer.writeByte((byte)'\"'); writer.writeAscii(").append(readValue).append(".name()); writer.writeByte((byte)'\"'); }\n");<NEW_LINE>} else {<NEW_LINE>code.append("writer.writeString(value.name());\n");<NEW_LINE>}<NEW_LINE>}
context.inlinedConverters.get(constantNameType);
811,322
public void generateProjectBuildScript(String projectName, InitSettings settings, BuildScriptBuilder buildScriptBuilder) {<NEW_LINE>buildScriptBuilder.repositories().mavenCentral("Use Maven Central for resolving dependencies.");<NEW_LINE>String pluginId = settings.getPackageName() + ".greeting";<NEW_LINE>String pluginClassName = StringUtils.capitalize(GUtil.toCamelCase(settings.getProjectName())) + "Plugin";<NEW_LINE>buildScriptBuilder.fileComment("This generated file contains a sample Gradle plugin project to get you started.").fileComment("For more details take a look at the Writing Custom Plugins chapter in the Gradle").fileComment("User Manual available at " + documentationRegistry.getDocumentationFor("custom_plugins"));<NEW_LINE>buildScriptBuilder.plugin("Apply the Java Gradle plugin development plugin to add support for developing Gradle plugins", "java-gradle-plugin");<NEW_LINE>buildScriptBuilder.block(null, "gradlePlugin", b -> b.containerElement("Define the plugin", "plugins", "greeting", null, g -> {<NEW_LINE>g.propertyAssignment(null, "id", pluginId, true);<NEW_LINE>g.propertyAssignment(null, "implementationClass", withPackage(settings, pluginClassName), true);<NEW_LINE>}));<NEW_LINE>final BuildScriptBuilder.Expression functionalTestSourceSet;<NEW_LINE>if (settings.isUseTestSuites()) {<NEW_LINE>configureDefaultTestSuite(buildScriptBuilder, settings.getTestFramework(), libraryVersionProvider);<NEW_LINE>addTestSuite("functionalTest", buildScriptBuilder, settings.getTestFramework(), libraryVersionProvider);<NEW_LINE>functionalTestSourceSet = buildScriptBuilder.containerElementExpression("sourceSets", "functionalTest");<NEW_LINE>} else {<NEW_LINE>functionalTestSourceSet = buildScriptBuilder.createContainerElement("Add a source set for the functional test suite", "sourceSets", "functionalTest", "functionalTestSourceSet");<NEW_LINE>BuildScriptBuilder.Expression functionalTestConfiguration = buildScriptBuilder.containerElementExpression("configurations", "functionalTestImplementation");<NEW_LINE>BuildScriptBuilder.Expression testConfiguration = buildScriptBuilder.containerElementExpression("configurations", "testImplementation");<NEW_LINE>buildScriptBuilder.methodInvocation(null, functionalTestConfiguration, "extendsFrom", testConfiguration);<NEW_LINE>BuildScriptBuilder.Expression functionalTest = buildScriptBuilder.taskRegistration("Add a task to run the functional tests", "functionalTest", "Test", b -> {<NEW_LINE>b.propertyAssignment(null, "testClassesDirs", buildScriptBuilder.propertyExpression(functionalTestSourceSet, "output.classesDirs"), true);<NEW_LINE>b.propertyAssignment(null, "classpath", buildScriptBuilder.propertyExpression(functionalTestSourceSet, "runtimeClasspath"), true);<NEW_LINE>if (getTestFrameworks().contains(BuildInitTestFramework.SPOCK) || getTestFrameworks().contains(BuildInitTestFramework.JUNIT_JUPITER)) {<NEW_LINE>b.methodInvocation(null, "useJUnitPlatform");<NEW_LINE>}<NEW_LINE>});<NEW_LINE>buildScriptBuilder.taskMethodInvocation("Run the functional tests as part of `check`", "check", "Task", "dependsOn", functionalTest);<NEW_LINE>if (getTestFrameworks().contains(BuildInitTestFramework.SPOCK) || getTestFrameworks().contains(BuildInitTestFramework.JUNIT_JUPITER)) {<NEW_LINE>buildScriptBuilder.taskMethodInvocation("Use JUnit Jupiter for unit tests.", "test", "Test", "useJUnitPlatform");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>buildScriptBuilder.<MASK><NEW_LINE>}
methodInvocation(null, "gradlePlugin.testSourceSets", functionalTestSourceSet);
1,598,275
public DebeziumSourceFunction<T> build() {<NEW_LINE>Properties props = new Properties();<NEW_LINE>props.setProperty("connector.class", PostgresConnector.class.getCanonicalName());<NEW_LINE><MASK><NEW_LINE>// hard code server name, because we don't need to distinguish it, docs:<NEW_LINE>// Logical name that identifies and provides a namespace for the particular PostgreSQL<NEW_LINE>// database server/cluster being monitored. The logical name should be unique across<NEW_LINE>// all other connectors, since it is used as a prefix for all Kafka topic names coming<NEW_LINE>// from this connector. Only alphanumeric characters and underscores should be used.<NEW_LINE>props.setProperty("database.server.name", "postgres_cdc_source");<NEW_LINE>props.setProperty("database.hostname", checkNotNull(hostname));<NEW_LINE>props.setProperty("database.dbname", checkNotNull(database));<NEW_LINE>props.setProperty("database.user", checkNotNull(username));<NEW_LINE>props.setProperty("database.password", checkNotNull(password));<NEW_LINE>props.setProperty("database.port", String.valueOf(port));<NEW_LINE>props.setProperty("slot.name", slotName);<NEW_LINE>// we have to enable heartbeat for PG to make sure DebeziumChangeConsumer#handleBatch<NEW_LINE>// is invoked after job restart<NEW_LINE>props.setProperty("heartbeat.interval.ms", String.valueOf(DEFAULT_HEARTBEAT_MS));<NEW_LINE>if (schemaList != null) {<NEW_LINE>props.setProperty("schema.whitelist", String.join(",", schemaList));<NEW_LINE>}<NEW_LINE>if (tableList != null) {<NEW_LINE>props.setProperty("table.whitelist", String.join(",", tableList));<NEW_LINE>}<NEW_LINE>if (dbzProperties != null) {<NEW_LINE>props.putAll(dbzProperties);<NEW_LINE>}<NEW_LINE>return new DebeziumSourceFunction<>(deserializer, props, null, Validator.getDefaultValidator(), inlongMetric);<NEW_LINE>}
props.setProperty("plugin.name", pluginName);
559,961
public static JPopupMenu createPopup(TaskListTable table) {<NEW_LINE>JPopupMenu popup = new JPopupMenu();<NEW_LINE>// show source<NEW_LINE>Task t = table.getSelectedTask();<NEW_LINE>if (null != t) {<NEW_LINE>popup.add(getDefaultAction(t));<NEW_LINE>popup.addSeparator();<NEW_LINE>// task's custom actions<NEW_LINE>Action[] actions = Accessor.getActions(t);<NEW_LINE>if (null != actions) {<NEW_LINE>for (Action a : actions) {<NEW_LINE>if (null != a) {<NEW_LINE>popup.add(a);<NEW_LINE>} else {<NEW_LINE>popup.addSeparator();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (actions.length > 0 && actions[actions.length - 1] != null) {<NEW_LINE>popup.addSeparator();<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>// scope<NEW_LINE>// NOI18N<NEW_LINE>JMenu scopeMenu = new JMenu(NbBundle.getMessage(Util.class, "LBL_Scope"));<NEW_LINE>ScanningScopeList scopeList = ScanningScopeList.getDefault();<NEW_LINE>for (TaskScanningScope scope : scopeList.getTaskScanningScopes()) {<NEW_LINE>JRadioButtonMenuItem item = new <MASK><NEW_LINE>item.setSelected(scope.equals(TaskManagerImpl.getInstance().getScope()));<NEW_LINE>scopeMenu.add(item);<NEW_LINE>}<NEW_LINE>popup.add(scopeMenu);<NEW_LINE>// filter<NEW_LINE>// NOI18N<NEW_LINE>JMenu filterMenu = new JMenu(NbBundle.getMessage(Util.class, "LBL_Filter"));<NEW_LINE>FiltersMenuButton.fillMenu(null, filterMenu);<NEW_LINE>popup.add(filterMenu);<NEW_LINE>popup.addSeparator();<NEW_LINE>// refresh<NEW_LINE>popup.add(new RefreshAction());<NEW_LINE>popup.addSeparator();<NEW_LINE>// list options<NEW_LINE>JMenu sortMenu = createSortMenu(table);<NEW_LINE>popup.add(sortMenu);<NEW_LINE>return popup;<NEW_LINE>}
JRadioButtonMenuItem(new SwitchScopeAction(scope));
1,855,267
public static void main(String[] args) {<NEW_LINE>// eagerly initialized multiton<NEW_LINE>LOGGER.info("Printing out eagerly initialized multiton contents");<NEW_LINE>LOGGER.info("KHAMUL={}", Nazgul.getInstance(NazgulName.KHAMUL));<NEW_LINE>LOGGER.info("MURAZOR={}", Nazgul.getInstance(NazgulName.MURAZOR));<NEW_LINE>LOGGER.info("DWAR={}", Nazgul.getInstance(NazgulName.DWAR));<NEW_LINE>LOGGER.info("JI_INDUR={}", Nazgul.getInstance(NazgulName.JI_INDUR));<NEW_LINE>LOGGER.info("AKHORAHIL={}", Nazgul.getInstance(NazgulName.AKHORAHIL));<NEW_LINE>LOGGER.info("HOARMURATH={}", Nazgul.getInstance(NazgulName.HOARMURATH));<NEW_LINE>LOGGER.info("ADUNAPHEL={}", Nazgul.getInstance(NazgulName.ADUNAPHEL));<NEW_LINE>LOGGER.info("REN={}", Nazgul.getInstance(NazgulName.REN));<NEW_LINE>LOGGER.info("UVATHA={}", Nazgul.getInstance(NazgulName.UVATHA));<NEW_LINE>// enum multiton<NEW_LINE>LOGGER.info("Printing out enum-based multiton contents");<NEW_LINE>LOGGER.info("KHAMUL={}", NazgulEnum.KHAMUL);<NEW_LINE>LOGGER.info("MURAZOR={}", NazgulEnum.MURAZOR);<NEW_LINE>LOGGER.info("DWAR={}", NazgulEnum.DWAR);<NEW_LINE>LOGGER.info("JI_INDUR={}", NazgulEnum.JI_INDUR);<NEW_LINE>LOGGER.info("AKHORAHIL={}", NazgulEnum.AKHORAHIL);<NEW_LINE>LOGGER.info("HOARMURATH={}", NazgulEnum.HOARMURATH);<NEW_LINE>LOGGER.info("ADUNAPHEL={}", NazgulEnum.ADUNAPHEL);<NEW_LINE>LOGGER.info("REN={}", NazgulEnum.REN);<NEW_LINE>LOGGER.<MASK><NEW_LINE>}
info("UVATHA={}", NazgulEnum.UVATHA);
1,003,793
public boolean addEntry(File file) {<NEW_LINE>if (file == null) {<NEW_LINE>log.warning("No File");<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (!file.exists() || file.isDirectory() || !file.canRead()) {<NEW_LINE>log.warning("not added - " + file + ", Exists=" + file.exists() + ", Directory=" + file.isDirectory());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>log.fine("addEntry - " + file);<NEW_LINE>//<NEW_LINE>String name = file.getName();<NEW_LINE>// Validate Mime Type<NEW_LINE>if (!MimeType.isValidMimeType(name)) {<NEW_LINE>log.severe("Invalid Mime Type for " + name + " only is allowed " + MimeType.getAllowedFileTypes());<NEW_LINE>log.severe("Restricted files " + MimeType.getRestrictedFileTypes());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>byte[] data = null;<NEW_LINE>// F3P: BF [2992291] modified to be able to close streams in "finally" block<NEW_LINE>FileInputStream fis = null;<NEW_LINE>ByteArrayOutputStream os = null;<NEW_LINE>try {<NEW_LINE>fis = new FileInputStream(file);<NEW_LINE>os = new ByteArrayOutputStream();<NEW_LINE>// 8kB<NEW_LINE>byte[] buffer = new byte[1024 * 8];<NEW_LINE>int length = -1;<NEW_LINE>while ((length = fis.read(buffer)) != -1) os.write(buffer, 0, length);<NEW_LINE>data = os.toByteArray();<NEW_LINE>} catch (IOException ioe) {<NEW_LINE>log.log(Level.SEVERE, "(file)", ioe);<NEW_LINE>} finally {<NEW_LINE>if (fis != null) {<NEW_LINE>try {<NEW_LINE>fis.close();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>log.log(Level.SEVERE, "(file)", ex);<NEW_LINE>}<NEW_LINE>;<NEW_LINE>}<NEW_LINE>if (os != null) {<NEW_LINE>try {<NEW_LINE>os.close();<NEW_LINE>} catch (IOException ex) {<NEW_LINE>log.log(<MASK><NEW_LINE>}<NEW_LINE>;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return addEntry(name, data);<NEW_LINE>}
Level.SEVERE, "(file)", ex);
1,502,570
final CreateServiceLinkedRoleResult executeCreateServiceLinkedRole(CreateServiceLinkedRoleRequest createServiceLinkedRoleRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(createServiceLinkedRoleRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<CreateServiceLinkedRoleRequest> request = null;<NEW_LINE>Response<CreateServiceLinkedRoleResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new CreateServiceLinkedRoleRequestMarshaller().marshall(super.beforeMarshalling(createServiceLinkedRoleRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "IAM");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateServiceLinkedRole");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<CreateServiceLinkedRoleResult> responseHandler = new StaxResponseHandler<<MASK><NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
CreateServiceLinkedRoleResult>(new CreateServiceLinkedRoleResultStaxUnmarshaller());
954,569
final PutThirdPartyJobFailureResultResult executePutThirdPartyJobFailureResult(PutThirdPartyJobFailureResultRequest putThirdPartyJobFailureResultRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(putThirdPartyJobFailureResultRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<PutThirdPartyJobFailureResultRequest> request = null;<NEW_LINE>Response<PutThirdPartyJobFailureResultResult> response = null;<NEW_LINE>try {<NEW_LINE><MASK><NEW_LINE>try {<NEW_LINE>request = new PutThirdPartyJobFailureResultRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putThirdPartyJobFailureResultRequest));<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, "CodePipeline");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutThirdPartyJobFailureResult");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<PutThirdPartyJobFailureResultResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutThirdPartyJobFailureResultResultJsonUnmarshaller());<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);
332,401
public FilterResult apply(String fileName, InputStream stream) throws IOException {<NEW_LINE>if (stream == null) {<NEW_LINE>return new FilterResult(null, false);<NEW_LINE>}<NEW_LINE>// Allow replacement of certain values in css<NEW_LINE>if (fileName.endsWith(CSS)) {<NEW_LINE>String applicationName = applicationConfig.name.orElse(appArtifact.getArtifactId());<NEW_LINE>String applicationVersion = applicationConfig.version.orElse(appArtifact.getVersion());<NEW_LINE>byte[] oldContentBytes = stream.readAllBytes();<NEW_LINE>String oldContents = new String(oldContentBytes);<NEW_LINE>String contents = <MASK><NEW_LINE>String header = replaceHeaderVars(applicationConfig.uiHeader.orElse(""), applicationName, applicationVersion);<NEW_LINE>contents = contents.replace("{applicationHeader}", header);<NEW_LINE>boolean changed = contents.length() != oldContents.length() || !contents.equals(oldContents);<NEW_LINE>if (changed) {<NEW_LINE>return new FilterResult(new ByteArrayInputStream(contents.getBytes()), true);<NEW_LINE>} else {<NEW_LINE>return new FilterResult(new ByteArrayInputStream(oldContentBytes), false);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return new FilterResult(stream, false);<NEW_LINE>}
replaceHeaderVars(oldContents, applicationName, applicationVersion);
1,189,403
public CompletableFuture<Void> writeRegistersNamed(Map<String, byte[]> values) {<NEW_LINE>return model.gateFuture(thread.listRegisters().thenCompose(regs -> {<NEW_LINE>return requestElements(false);<NEW_LINE>}).thenCompose(__ -> {<NEW_LINE>Map<String, ? extends TargetObject> regs = getCachedElements();<NEW_LINE>Map<DbgRegister, BigInteger> <MASK><NEW_LINE>for (Map.Entry<String, byte[]> ent : values.entrySet()) {<NEW_LINE>String regname = ent.getKey();<NEW_LINE>DbgModelTargetRegister reg = (DbgModelTargetRegister) regs.get(regname);<NEW_LINE>if (reg == null) {<NEW_LINE>throw new DebuggerRegisterAccessException("No such register: " + regname);<NEW_LINE>}<NEW_LINE>BigInteger val = new BigInteger(1, ent.getValue());<NEW_LINE>toWrite.put(reg.getRegister(), val);<NEW_LINE>}<NEW_LINE>return thread.writeRegisters(toWrite);<NEW_LINE>// TODO: Should probably filter only effective and normalized writes in the callback<NEW_LINE>}).thenAccept(__ -> {<NEW_LINE>listeners.fire.registersUpdated(getProxy(), values);<NEW_LINE>}));<NEW_LINE>}
toWrite = new LinkedHashMap<>();
377,717
public void deleteTaxClass(Long id, MerchantStore store, Language language) {<NEW_LINE>Validate.notNull(id, "TaxClass id cannot be null");<NEW_LINE>Validate.notNull(store, "MerchantStore cannot be null");<NEW_LINE>Validate.notNull(store.getCode(), "MerchantStore code cannot be null");<NEW_LINE>try {<NEW_LINE>TaxClass <MASK><NEW_LINE>if (model == null) {<NEW_LINE>throw new ResourceNotFoundException("TaxClass not found [" + id + "] for store [" + store.getCode() + "]");<NEW_LINE>} else {<NEW_LINE>if (!model.getMerchantStore().getCode().equals(store.getCode())) {<NEW_LINE>throw new UnauthorizedException("MerchantStore [" + store.getCode() + "] cannot delete tax class [" + id + "]");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>taxClassService.delete(model);<NEW_LINE>} catch (ServiceException e) {<NEW_LINE>LOGGER.error("Error while getting taxClasse [" + id + "] for store [" + store.getCode() + "]", e);<NEW_LINE>throw new ServiceRuntimeException("Error while getting taxClasse [" + id + "] for store [" + store.getCode() + "]", e);<NEW_LINE>}<NEW_LINE>}
model = taxClassService.getById(id);
694,499
protected double outsideDistance(final DistanceStyle distanceStyle, final double x, final double y, final double z) {<NEW_LINE>final double topDistance = distanceStyle.computeDistance(planetModel, topPlane, x, y, z, leftPlane, rightPlane);<NEW_LINE>final double leftDistance = distanceStyle.computeDistance(planetModel, leftPlane, x, <MASK><NEW_LINE>final double rightDistance = distanceStyle.computeDistance(planetModel, rightPlane, x, y, z, leftPlane, topPlane);<NEW_LINE>final double ULHCDistance = distanceStyle.computeDistance(ULHC, x, y, z);<NEW_LINE>final double URHCDistance = distanceStyle.computeDistance(URHC, x, y, z);<NEW_LINE>return Math.min(Math.min(topDistance, Math.min(leftDistance, rightDistance)), Math.min(ULHCDistance, URHCDistance));<NEW_LINE>}
y, z, rightPlane, topPlane);
1,318,670
public static ActiveAggregateConfigRulesResponse unmarshall(ActiveAggregateConfigRulesResponse activeAggregateConfigRulesResponse, UnmarshallerContext _ctx) {<NEW_LINE>activeAggregateConfigRulesResponse.setRequestId(_ctx.stringValue("ActiveAggregateConfigRulesResponse.RequestId"));<NEW_LINE>OperateRuleResult operateRuleResult = new OperateRuleResult();<NEW_LINE>List<OperateRuleItem> operateRuleItemList <MASK><NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ActiveAggregateConfigRulesResponse.OperateRuleResult.OperateRuleItemList.Length"); i++) {<NEW_LINE>OperateRuleItem operateRuleItem = new OperateRuleItem();<NEW_LINE>operateRuleItem.setErrorCode(_ctx.stringValue("ActiveAggregateConfigRulesResponse.OperateRuleResult.OperateRuleItemList[" + i + "].ErrorCode"));<NEW_LINE>operateRuleItem.setSuccess(_ctx.booleanValue("ActiveAggregateConfigRulesResponse.OperateRuleResult.OperateRuleItemList[" + i + "].Success"));<NEW_LINE>operateRuleItem.setConfigRuleId(_ctx.stringValue("ActiveAggregateConfigRulesResponse.OperateRuleResult.OperateRuleItemList[" + i + "].ConfigRuleId"));<NEW_LINE>operateRuleItemList.add(operateRuleItem);<NEW_LINE>}<NEW_LINE>operateRuleResult.setOperateRuleItemList(operateRuleItemList);<NEW_LINE>activeAggregateConfigRulesResponse.setOperateRuleResult(operateRuleResult);<NEW_LINE>return activeAggregateConfigRulesResponse;<NEW_LINE>}
= new ArrayList<OperateRuleItem>();
1,049,639
UnmodifiableIterator<Entry<K, V>> entryIterator() {<NEW_LINE>return new UnmodifiableIterator<Entry<K, V>>() {<NEW_LINE><NEW_LINE>final Iterator<? extends Entry<K, ? extends ImmutableCollection<V>>> asMapItr = map.entrySet().iterator();<NEW_LINE><NEW_LINE>@CheckForNull<NEW_LINE>K currentKey = null;<NEW_LINE><NEW_LINE>Iterator<V> valueItr = Iterators.emptyIterator();<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public boolean hasNext() {<NEW_LINE>return valueItr.hasNext() || asMapItr.hasNext();<NEW_LINE>}<NEW_LINE><NEW_LINE>@Override<NEW_LINE>public Entry<K, V> next() {<NEW_LINE>if (!valueItr.hasNext()) {<NEW_LINE>Entry<K, ? extends ImmutableCollection<V>> entry = asMapItr.next();<NEW_LINE>currentKey = entry.getKey();<NEW_LINE>valueItr = entry<MASK><NEW_LINE>}<NEW_LINE>return immutableEntry(requireNonNull(currentKey), valueItr.next());<NEW_LINE>}<NEW_LINE>};<NEW_LINE>}
.getValue().iterator();
687,328
private HttpPipeline createHttpPipeline() {<NEW_LINE>Configuration buildConfiguration = (configuration == null) ? Configuration.getGlobalConfiguration() : configuration;<NEW_LINE>if (httpLogOptions == null) {<NEW_LINE>httpLogOptions = new HttpLogOptions();<NEW_LINE>}<NEW_LINE>if (clientOptions == null) {<NEW_LINE>clientOptions = new ClientOptions();<NEW_LINE>}<NEW_LINE>List<HttpPipelinePolicy> policies = new ArrayList<>();<NEW_LINE>String clientName = properties.getOrDefault(SDK_NAME, "UnknownName");<NEW_LINE>String clientVersion = properties.getOrDefault(SDK_VERSION, "UnknownVersion");<NEW_LINE>String applicationId = CoreUtils.getApplicationId(clientOptions, httpLogOptions);<NEW_LINE>policies.add(new UserAgentPolicy(applicationId, clientName, clientVersion, buildConfiguration));<NEW_LINE>HttpHeaders headers = new HttpHeaders();<NEW_LINE>clientOptions.getHeaders().forEach(header -> headers.set(header.getName(), header.getValue()));<NEW_LINE>if (headers.getSize() > 0) {<NEW_LINE>policies.add(new AddHeadersPolicy(headers));<NEW_LINE>}<NEW_LINE>HttpPolicyProviders.addBeforeRetryPolicies(policies);<NEW_LINE>policies.add(retryPolicy == null ? new RetryPolicy() : retryPolicy);<NEW_LINE>policies.add(new CookiePolicy());<NEW_LINE>if (tokenCredential != null) {<NEW_LINE>policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, DEFAULT_SCOPES));<NEW_LINE>}<NEW_LINE>policies.addAll(this.pipelinePolicies);<NEW_LINE>HttpPolicyProviders.addAfterRetryPolicies(policies);<NEW_LINE>policies.<MASK><NEW_LINE>HttpPipeline httpPipeline = new HttpPipelineBuilder().policies(policies.toArray(new HttpPipelinePolicy[0])).httpClient(httpClient).build();<NEW_LINE>return httpPipeline;<NEW_LINE>}
add(new HttpLoggingPolicy(httpLogOptions));
1,652,775
private RefundInvoiceCandidate createSingleRefundCandidate(@NonNull final AssignableInvoiceCandidate assignableCandidate, @NonNull final RefundContract refundContract, @NonNull final List<RefundConfig> refundConfigs) {<NEW_LINE>final I_C_Invoice_Candidate assignableInvoiceCandidateRecord = load(assignableCandidate.getId().getRepoId(), I_C_Invoice_Candidate.class);<NEW_LINE>final I_C_Invoice_Candidate refundInvoiceCandidateRecord = Services.get(IInvoiceCandBL.class).splitCandidate(assignableInvoiceCandidateRecord);<NEW_LINE>final I_C_ILCandHandler handlerRecord = Services.get(IInvoiceCandidateHandlerDAO.class).retrieveForClassOneOnly(Env.getCtx(), FlatrateTerm_Handler.class);<NEW_LINE>refundInvoiceCandidateRecord.setC_ILCandHandler(handlerRecord);<NEW_LINE>refundInvoiceCandidateRecord.setC_Order(null);<NEW_LINE>refundInvoiceCandidateRecord.setC_OrderLine(null);<NEW_LINE>refundInvoiceCandidateRecord.setRecord_ID(refundContract.getId().getRepoId());<NEW_LINE>refundInvoiceCandidateRecord.setAD_Table_ID(getTableId(I_C_Flatrate_Term.class));<NEW_LINE>refundInvoiceCandidateRecord.setPriceActual(ZERO);<NEW_LINE>refundInvoiceCandidateRecord.setPriceEntered(ZERO);<NEW_LINE>refundInvoiceCandidateRecord.setQtyOrdered(ONE);<NEW_LINE>refundInvoiceCandidateRecord.setQtyDelivered(ONE);<NEW_LINE>refundInvoiceCandidateRecord.setInvoiceRule(X_C_Invoice_Candidate.INVOICERULE_CustomerScheduleAfterDelivery);<NEW_LINE>refundInvoiceCandidateRecord.setInvoiceRule_Override(null);<NEW_LINE>refundInvoiceCandidateRecord.setDateToInvoice_Override(null);<NEW_LINE>final NextInvoiceDate nextRefundInvoiceDate = refundContract.computeNextInvoiceDate(assignableCandidate.getInvoiceableFrom());<NEW_LINE>refundInvoiceCandidateRecord.setC_InvoiceSchedule_ID(nextRefundInvoiceDate.getInvoiceSchedule().getId().getRepoId());<NEW_LINE>final Timestamp dateToInvoiceFromInvoiceSchedule = asTimestamp(nextRefundInvoiceDate.getDateToInvoice());<NEW_LINE>refundInvoiceCandidateRecord.setDateOrdered(dateToInvoiceFromInvoiceSchedule);<NEW_LINE>refundInvoiceCandidateRecord.setDeliveryDate(dateToInvoiceFromInvoiceSchedule);<NEW_LINE>final RefundInvoiceType refundInvoiceType = extractSingleElement(refundConfigs, RefundConfig::getRefundInvoiceType);<NEW_LINE>try {<NEW_LINE>final DocTypeId docTypeId = computeDocType(assignableInvoiceCandidateRecord, refundInvoiceType);<NEW_LINE>refundInvoiceCandidateRecord.<MASK><NEW_LINE>} catch (final RuntimeException e) {<NEW_LINE>throw AdempiereException.wrapIfNeeded(e).appendParametersToMessage().setParameter("invoiceCandidate", assignableCandidate).setParameter("refundConfigs", refundConfigs).setParameter("assignableInvoiceCandidateRecord", assignableInvoiceCandidateRecord);<NEW_LINE>}<NEW_LINE>saveRecord(refundInvoiceCandidateRecord);<NEW_LINE>invalidateNewRefundRecordIfNeeded(refundInvoiceCandidateRecord);<NEW_LINE>final RefundInvoiceCandidate refundInvoiceCandidate = ofNullableRefundRecord(refundInvoiceCandidateRecord).get();<NEW_LINE>final RefundInvoiceCandidate resultCandidate = refundInvoiceCandidate.toBuilder().clearRefundConfigs().refundConfigs(refundConfigs).build();<NEW_LINE>return resultCandidate;<NEW_LINE>}
setC_DocTypeInvoice_ID(docTypeId.getRepoId());
22,308
private void processObject(final ProcessingReport report, final FullData input) throws ProcessingException {<NEW_LINE>final SchemaTree tree = input.getSchema();<NEW_LINE>final JsonTree instance = input.getInstance();<NEW_LINE>final JsonNode schema = tree.getNode();<NEW_LINE>final JsonNode node = instance.getNode();<NEW_LINE>final JsonNode digest = ObjectSchemaDigester.getInstance().digest(schema);<NEW_LINE>final ObjectSchemaSelector selector = new ObjectSchemaSelector(digest);<NEW_LINE>final List<String> fields = Lists.newArrayList(node.fieldNames());<NEW_LINE>Collections.sort(fields);<NEW_LINE>FullData data;<NEW_LINE>JsonTree newInstance;<NEW_LINE>for (final String field : fields) {<NEW_LINE>newInstance = instance.append(JsonPointer.of(field));<NEW_LINE><MASK><NEW_LINE>for (final JsonPointer ptr : selector.selectSchemas(field)) {<NEW_LINE>data = data.withSchema(tree.append(ptr));<NEW_LINE>process(report, data);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}
data = input.withInstance(newInstance);
823,292
private void configureCommonWebAnnotation(TargetConfig targetConfig, AnnotationInfo webAnnotation, String targetConfigType) {<NEW_LINE>AnnotationValue asyncSupportedValue = webAnnotation.getValue("asyncSupported");<NEW_LINE>boolean asyncSupported = (null == asyncSupportedValue ? false : asyncSupportedValue.getBooleanValue());<NEW_LINE>configureAsyncSupported(targetConfig, asyncSupported, targetConfigType);<NEW_LINE>AnnotationValue displayNameValue = webAnnotation.getValue("displayName");<NEW_LINE>configureDisplayName(targetConfig, displayNameValue != null ? displayNameValue.getStringValue() : null);<NEW_LINE>AnnotationValue descriptionValue = webAnnotation.getValue("description");<NEW_LINE>configureDescription(targetConfig, descriptionValue != null ? descriptionValue.getStringValue() : null);<NEW_LINE>AnnotationValue smallIconValue = webAnnotation.getValue("smallIcon");<NEW_LINE>configureSmallIcon(targetConfig, smallIconValue != null ? <MASK><NEW_LINE>AnnotationValue largeIconValue = webAnnotation.getValue("largeIcon");<NEW_LINE>configureLargeIcon(targetConfig, largeIconValue != null ? largeIconValue.getStringValue() : null);<NEW_LINE>AnnotationValue initParamsValue = webAnnotation.getValue("initParams");<NEW_LINE>final List<? extends AnnotationValue> initParamList;<NEW_LINE>final Map<String, ConfigItem<String>> initParamMap;<NEW_LINE>if (initParamsValue != null) {<NEW_LINE>initParamList = initParamsValue.getArrayValue();<NEW_LINE>initParamMap = configurator.getConfigItemMap(targetConfigType + ".init-param");<NEW_LINE>} else {<NEW_LINE>initParamList = Collections.emptyList();<NEW_LINE>initParamMap = null;<NEW_LINE>}<NEW_LINE>for (AnnotationValue initParam : initParamList) {<NEW_LINE>AnnotationInfo initParamAnnotation = initParam.getAnnotationValue();<NEW_LINE>String initParamName = initParamAnnotation.getValue("name").getStringValue();<NEW_LINE>String initParamValue = initParamAnnotation.getValue("value").getStringValue();<NEW_LINE>configureInitParam(targetConfig, initParamMap, initParamName, initParamValue, targetConfigType);<NEW_LINE>}<NEW_LINE>}
smallIconValue.getStringValue() : null);
1,693,439
public static Set<Geocache> loadCaches(final Collection<String> geocodes, final EnumSet<LoadFlag> loadFlags) {<NEW_LINE>if (CollectionUtils.isEmpty(geocodes)) {<NEW_LINE>return new HashSet<>();<NEW_LINE>}<NEW_LINE>final Set<Geocache> result = new HashSet<<MASK><NEW_LINE>final Set<String> remaining = new HashSet<>(geocodes);<NEW_LINE>if (loadFlags.contains(LoadFlag.CACHE_BEFORE)) {<NEW_LINE>for (final String geocode : geocodes) {<NEW_LINE>final Geocache cache = cacheCache.getCacheFromCache(geocode);<NEW_LINE>if (cache != null) {<NEW_LINE>result.add(cache);<NEW_LINE>remaining.remove(cache.getGeocode());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (loadFlags.contains(LoadFlag.DB_MINIMAL) || loadFlags.contains(LoadFlag.ATTRIBUTES) || loadFlags.contains(LoadFlag.WAYPOINTS) || loadFlags.contains(LoadFlag.SPOILERS) || loadFlags.contains(LoadFlag.LOGS) || loadFlags.contains(LoadFlag.INVENTORY) || loadFlags.contains(LoadFlag.OFFLINE_LOG)) {<NEW_LINE>final Set<Geocache> cachesFromDB = loadCachesFromGeocodes(remaining, loadFlags);<NEW_LINE>result.addAll(cachesFromDB);<NEW_LINE>for (final Geocache cache : cachesFromDB) {<NEW_LINE>remaining.remove(cache.getGeocode());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (loadFlags.contains(LoadFlag.CACHE_AFTER)) {<NEW_LINE>for (final String geocode : new HashSet<>(remaining)) {<NEW_LINE>final Geocache cache = cacheCache.getCacheFromCache(geocode);<NEW_LINE>if (cache != null) {<NEW_LINE>result.add(cache);<NEW_LINE>remaining.remove(cache.getGeocode());<NEW_LINE>}<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (CollectionUtils.isNotEmpty(remaining)) {<NEW_LINE>Log.d("DataStore.loadCaches(" + remaining.toString() + ") returned no results");<NEW_LINE>}<NEW_LINE>return result;<NEW_LINE>}
>(geocodes.size());
151,969
public boolean isGrayscale(Bitmap bitmap) {<NEW_LINE>int height = bitmap.getHeight();<NEW_LINE>int width = bitmap.getWidth();<NEW_LINE>// shrink to a more manageable (yet hopefully no more or less colorful) size<NEW_LINE>if (height > COMPACT_BITMAP_SIZE || width > COMPACT_BITMAP_SIZE) {<NEW_LINE>if (mTempCompactBitmap == null) {<NEW_LINE>mTempCompactBitmap = Bitmap.createBitmap(COMPACT_BITMAP_SIZE, COMPACT_BITMAP_SIZE, Config.ARGB_8888);<NEW_LINE>mTempCompactBitmapCanvas = new Canvas(mTempCompactBitmap);<NEW_LINE>mTempCompactBitmapPaint = new Paint(Paint.ANTI_ALIAS_FLAG);<NEW_LINE>mTempCompactBitmapPaint.setFilterBitmap(true);<NEW_LINE>}<NEW_LINE>mTempMatrix.reset();<NEW_LINE>mTempMatrix.setScale((float) COMPACT_BITMAP_SIZE / width, (float) COMPACT_BITMAP_SIZE / height, 0, 0);<NEW_LINE>// select all, erase<NEW_LINE>mTempCompactBitmapCanvas.drawColor(0, PorterDuff.Mode.SRC);<NEW_LINE>mTempCompactBitmapCanvas.drawBitmap(bitmap, mTempMatrix, mTempCompactBitmapPaint);<NEW_LINE>bitmap = mTempCompactBitmap;<NEW_LINE>width = height = COMPACT_BITMAP_SIZE;<NEW_LINE>}<NEW_LINE>final int size = height * width;<NEW_LINE>ensureBufferSize(size);<NEW_LINE>bitmap.getPixels(mTempBuffer, 0, width, <MASK><NEW_LINE>for (int i = 0; i < size; i++) {<NEW_LINE>if (!isGrayscale(mTempBuffer[i])) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
0, 0, width, height);
1,469,339
private void renderSword(@Nonnull EnumFacing facing, @Nonnull ItemStack sword, float swingProgress, boolean leftHand) {<NEW_LINE>// rotate to facing direction<NEW_LINE>GlStateManager.translate(0.5f, 0, 0.5f);<NEW_LINE>float offset = 270f;<NEW_LINE>if (facing.getFrontOffsetX() != 0) {<NEW_LINE>offset *= -1;<NEW_LINE>}<NEW_LINE>GlStateManager.rotate((facing.getHorizontalIndex() * 90F) + offset, 0F, 1F, 0F);<NEW_LINE>GlStateManager.translate(-0.5f, 0, -0.5F);<NEW_LINE>// rotate swing progress<NEW_LINE>GlStateManager.pushMatrix();<NEW_LINE>if (swingProgress > 0) {<NEW_LINE>float f6 = MathHelper.sin(swingProgress * swingProgress * (float) Math.PI);<NEW_LINE>float f7 = MathHelper.sin(MathHelper.sqrt(swingProgress) * (float) Math.PI);<NEW_LINE>GlStateManager.rotate(f6 * 5.0F, 1.0F, 0.0F, 0.0F);<NEW_LINE>GlStateManager.rotate(-f7 * 30.0F, 0.0F, 0.0F, 1.0F);<NEW_LINE>}<NEW_LINE>// translate to side of jar<NEW_LINE>GlStateManager.translate(13.6f / 16f, 0.6f, (leftHand ? 1.5f : 14.5f) / 16f);<NEW_LINE>// scale to size<NEW_LINE>GlStateManager.pushMatrix();<NEW_LINE>float scale = 0.75f;<NEW_LINE>GlStateManager.scale(scale, scale, scale);<NEW_LINE>// Adjust rotation so axe is facing the correct way<NEW_LINE>GlStateManager.rotate(180, 0, 1, 0);<NEW_LINE>GlStateManager.rotate(90, 0, 0, 1);<NEW_LINE>Minecraft.getMinecraft().getRenderItem().<MASK><NEW_LINE>// cleanup<NEW_LINE>GlStateManager.popMatrix();<NEW_LINE>GlStateManager.popMatrix();<NEW_LINE>}
renderItem(sword, TransformType.NONE);
1,836,900
public static ListMapRouteDetailsResponse unmarshall(ListMapRouteDetailsResponse listMapRouteDetailsResponse, UnmarshallerContext _ctx) {<NEW_LINE>listMapRouteDetailsResponse.setRequestId(_ctx.stringValue("ListMapRouteDetailsResponse.RequestId"));<NEW_LINE>listMapRouteDetailsResponse.setCode(_ctx.stringValue("ListMapRouteDetailsResponse.Code"));<NEW_LINE>listMapRouteDetailsResponse.setMessage(_ctx.stringValue("ListMapRouteDetailsResponse.Message"));<NEW_LINE>listMapRouteDetailsResponse.setPageNumber(_ctx.longValue("ListMapRouteDetailsResponse.PageNumber"));<NEW_LINE>listMapRouteDetailsResponse.setPageSize(_ctx.longValue("ListMapRouteDetailsResponse.PageSize"));<NEW_LINE>listMapRouteDetailsResponse.setTotalCount<MASK><NEW_LINE>List<Datas> data = new ArrayList<Datas>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("ListMapRouteDetailsResponse.Data.Length"); i++) {<NEW_LINE>Datas datas = new Datas();<NEW_LINE>datas.setDestination(_ctx.stringValue("ListMapRouteDetailsResponse.Data[" + i + "].Destination"));<NEW_LINE>datas.setOrigin(_ctx.stringValue("ListMapRouteDetailsResponse.Data[" + i + "].Origin"));<NEW_LINE>datas.setRoute(_ctx.stringValue("ListMapRouteDetailsResponse.Data[" + i + "].Route"));<NEW_LINE>datas.setType(_ctx.stringValue("ListMapRouteDetailsResponse.Data[" + i + "].Type"));<NEW_LINE>data.add(datas);<NEW_LINE>}<NEW_LINE>listMapRouteDetailsResponse.setData(data);<NEW_LINE>return listMapRouteDetailsResponse;<NEW_LINE>}
(_ctx.longValue("ListMapRouteDetailsResponse.TotalCount"));
877,324
public P convert(T thriftObj) {<NEW_LINE>Descriptor protoDesc = protoObj_.getDescriptorForType();<NEW_LINE>Map<? extends org.apache.thrift.TFieldIdEnum, FieldMetaData> fieldMap = FieldMetaData.getStructMetaDataMap(thriftObj.getClass());<NEW_LINE>for (Map.Entry<? extends TFieldIdEnum, FieldMetaData> e : fieldMap.entrySet()) {<NEW_LINE>final TFieldIdEnum tFieldIdEnum = e.getKey();<NEW_LINE>final FieldValueMetaData thriftMetadata = e.getValue().valueMetaData;<NEW_LINE>FieldDescriptor protoFieldDesc = protoDesc.findFieldByName(tFieldIdEnum.getFieldName());<NEW_LINE>if (protoFieldDesc == null) {<NEW_LINE>throw new RuntimeException("Field " + tFieldIdEnum.getFieldName() + " not found in " + protoObj_.getClass().getCanonicalName());<NEW_LINE>} else if (!typesMatch(protoFieldDesc, thriftMetadata)) {<NEW_LINE>throw new RuntimeException("Field " + tFieldIdEnum.getFieldName() + " type does not match: " + "thrift " + thriftMetadata.type + "vs " + protoFieldDesc.getType());<NEW_LINE>}<NEW_LINE>Object <MASK><NEW_LINE>if (protoFieldDesc.getType() == Type.BYTES) {<NEW_LINE>protoBuilder_.setField(protoFieldDesc, (ByteString.copyFrom((byte[]) fieldValue)));<NEW_LINE>} else {<NEW_LINE>protoBuilder_.setField(protoFieldDesc, fieldValue);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return (P) protoBuilder_.build();<NEW_LINE>}
fieldValue = thriftObj.getFieldValue(tFieldIdEnum);
1,146,732
public Path resolveSourcePath(SourcePath sourcePath) {<NEW_LINE>if (sourcePath instanceof PathSourcePath) {<NEW_LINE>return projectFilesystem.relativize(pathSourcePathResolverAdapter.getAbsolutePath(sourcePath)).getPath();<NEW_LINE>}<NEW_LINE>Preconditions.checkArgument(sourcePath instanceof BuildTargetSourcePath);<NEW_LINE>BuildTargetSourcePath buildTargetSourcePath = (BuildTargetSourcePath) sourcePath;<NEW_LINE>BuildTarget buildTarget = buildTargetSourcePath.getTarget();<NEW_LINE>TargetNode<?> node = targetGraph.get(buildTarget);<NEW_LINE>Optional<TargetNode<ExportFileDescriptionArg>> exportFileNode = TargetNodes.castArg(node, ExportFileDescriptionArg.class);<NEW_LINE>if (!exportFileNode.isPresent()) {<NEW_LINE>BuildRuleResolver <MASK><NEW_LINE>Path output = resolver.getSourcePathResolver().getAbsolutePath(sourcePath);<NEW_LINE>if (output == null) {<NEW_LINE>throw new HumanReadableException("The target '%s' does not have an output.", node.getBuildTarget());<NEW_LINE>}<NEW_LINE>return projectFilesystem.relativize(output).getPath();<NEW_LINE>}<NEW_LINE>Optional<SourcePath> src = exportFileNode.get().getConstructorArg().getSrc();<NEW_LINE>if (!src.isPresent()) {<NEW_LINE>Path output = getCellPathForTarget(buildTarget).resolve(buildTarget.getCellRelativeBasePath().getPath().toPath(projectFilesystem.getFileSystem())).resolve(buildTarget.getShortNameAndFlavorPostfix());<NEW_LINE>return projectFilesystem.relativize(output).getPath();<NEW_LINE>}<NEW_LINE>return resolveSourcePath(src.get());<NEW_LINE>}
resolver = actionGraphBuilderForNode.apply(node);
116,058
private void generatePatternBitmap() {<NEW_LINE>if (getBounds().width() <= 0 || getBounds().height() <= 0) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>bitmap = Bitmap.createBitmap(getBounds().width(), getBounds().height(), Config.ARGB_8888);<NEW_LINE><MASK><NEW_LINE>Rect r = new Rect();<NEW_LINE>boolean verticalStartWhite = true;<NEW_LINE>for (int i = 0; i <= numRectanglesVertical; i++) {<NEW_LINE>boolean isWhite = verticalStartWhite;<NEW_LINE>for (int j = 0; j <= numRectanglesHorizontal; j++) {<NEW_LINE>r.top = i * rectangleSize;<NEW_LINE>r.left = j * rectangleSize;<NEW_LINE>r.bottom = r.top + rectangleSize;<NEW_LINE>r.right = r.left + rectangleSize;<NEW_LINE>canvas.drawRect(r, isWhite ? paintWhite : paintGray);<NEW_LINE>isWhite = !isWhite;<NEW_LINE>}<NEW_LINE>verticalStartWhite = !verticalStartWhite;<NEW_LINE>}<NEW_LINE>}
Canvas canvas = new Canvas(bitmap);
967,776
private static boolean defineOwnPropertyIndex(JSDynamicObject thisObj, Number numericIndex, PropertyDescriptor desc) {<NEW_LINE>long index = validIntegerIndex(thisObj, numericIndex);<NEW_LINE>if (index == -1) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (desc.isAccessorDescriptor()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (desc.hasConfigurable() && !desc.getConfigurable()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (desc.hasEnumerable() && !desc.getEnumerable()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (desc.hasWritable() && !desc.getWritable()) {<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>if (desc.hasValue()) {<NEW_LINE>// IntegerIndexedElementSet<NEW_LINE><MASK><NEW_LINE>Object numValue = convertValue(thisObj, value);<NEW_LINE>if (!JSArrayBufferView.hasDetachedBuffer(thisObj)) {<NEW_LINE>assert index >= 0 && index < JSArrayBufferView.typedArrayGetLength(thisObj);<NEW_LINE>JSArrayBufferView.typedArrayGetArrayType(thisObj).setElement(thisObj, index, numValue, true);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>}
Object value = desc.getValue();
1,583,873
Configuration toConfigurationNode(int instanceNumber, String subnetId, ConvertedConfiguration awsConfiguration, Region region, Warnings warnings) {<NEW_LINE>Subnet subnet = region.getSubnets().get(subnetId);<NEW_LINE>if (subnet == null) {<NEW_LINE>warnings.redFlag(String.format("Subnet \"%s\" for Elasticsearch domain \"%s\" not found", subnetId, _domainName));<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Configuration cfgNode = Utils.newAwsConfiguration(getNodeName(instanceNumber, _arn, _vpcEndpoint), "aws", DeviceModel.AWS_ELASTICSEARCH_DOMAIN);<NEW_LINE>cfgNode.getVendorFamily().getAws().setVpcId(_vpcId);<NEW_LINE>cfgNode.getVendorFamily().getAws().setRegion(region.getName());<NEW_LINE>cfgNode.getVendorFamily().<MASK><NEW_LINE>cfgNode.setHumanName(_domainName);<NEW_LINE>// TODO: a better way to get IPs in the subnet, use the network interface data or DNS queries<NEW_LINE>String instancesIfaceName = subnetId;<NEW_LINE>Ip instancesIfaceIp = subnet.getNextIp();<NEW_LINE>ConcreteInterfaceAddress instancesIfaceAddress = ConcreteInterfaceAddress.create(instancesIfaceIp, subnet.getCidrBlock().getPrefixLength());<NEW_LINE>Utils.newInterface(instancesIfaceName, cfgNode, instancesIfaceAddress, "To subnet " + subnetId);<NEW_LINE>Utils.addLayer1Edge(awsConfiguration, cfgNode.getHostname(), instancesIfaceName, Subnet.nodeName(subnet.getId()), Subnet.instancesInterfaceName(subnet.getId()));<NEW_LINE>Ip defaultGatewayAddress = subnet.computeInstancesIfaceIp();<NEW_LINE>StaticRoute defaultRoute = StaticRoute.builder().setAdministrativeCost(Route.DEFAULT_STATIC_ROUTE_ADMIN).setMetric(Route.DEFAULT_STATIC_ROUTE_COST).setNextHopIp(defaultGatewayAddress).setNetwork(Prefix.ZERO).build();<NEW_LINE>cfgNode.getDefaultVrf().getStaticRoutes().add(defaultRoute);<NEW_LINE>return cfgNode;<NEW_LINE>}
getAws().setSubnetId(subnetId);
919,226
public void init(ServletConfig servletConfig, JaxRsProviderFactoryService providerFactoryService) throws ServletException {<NEW_LINE>super.init(servletConfig, providerFactoryService);<NEW_LINE>LibertyJaxRsServerFactoryBean jaxRsServerFactory = new LibertyJaxRsServerFactoryBean(endpointInfo, <MASK><NEW_LINE>if (features != null && !features.isEmpty()) {<NEW_LINE>jaxRsServerFactory.setFeatures(features);<NEW_LINE>}<NEW_LINE>jaxRsServerFactory.doInit();<NEW_LINE>ClassLoader origClassLoader = jaxRsServerFactory.getBus().getExtension(ClassLoader.class);<NEW_LINE>jaxRsServerFactory.getBus().setExtension(null, ClassLoader.class);<NEW_LINE>server = jaxRsServerFactory.create();<NEW_LINE>jaxRsServerFactory.getBus().setExtension(origClassLoader, ClassLoader.class);<NEW_LINE>configureEndpointInfoProperties(endpointInfo, server.getEndpoint().getEndpointInfo());<NEW_LINE>server.start();<NEW_LINE>destination = (AbstractHTTPDestination) server.getDestination();<NEW_LINE>}
jaxRsModuleMetaData, beanCustomizers, servletConfig, providerFactoryService);
672,672
public void execute(AdminCommandContext adminCommandContext) {<NEW_LINE>ActionReport actionReport = adminCommandContext.getActionReport();<NEW_LINE>// Get the Node Object and validate<NEW_LINE>Node node = nodes.getNode(nodeName);<NEW_LINE>if (node == null) {<NEW_LINE>actionReport.failure(logger, "No nodeName found with given name: " + nodeName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>if (!node.getType().equals("DOCKER")) {<NEW_LINE>actionReport.failure(logger, "Node is not of type DOCKER, nodeName is of type: " + node.getType());<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Get the DAS hostname and port and validate<NEW_LINE>String dasHost = "";<NEW_LINE>String dasPort = "";<NEW_LINE>for (Server server : servers.getServer()) {<NEW_LINE>if (server.isDas()) {<NEW_LINE>dasHost = server.getAdminHost();<NEW_LINE>dasPort = Integer.<MASK><NEW_LINE>break;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (dasHost == null || dasHost.trim().isEmpty() || dasPort.trim().isEmpty()) {<NEW_LINE>actionReport.failure(logger, "Could not retrieve DAS host address or port");<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Get the instance that we've got registered in the domain.xml to grab its config<NEW_LINE>Server server = servers.getServer(instanceName);<NEW_LINE>if (server == null) {<NEW_LINE>actionReport.failure(logger, "No instance registered in domain with name: " + instanceName);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>// Pull the image if it hasn't been downloaded or built yet<NEW_LINE>pullImage(node);<NEW_LINE>createContainer(adminCommandContext, actionReport, node, server, dasHost, dasPort);<NEW_LINE>}
toString(server.getAdminPort());
1,303,567
protected boolean validate(final String uri) {<NEW_LINE>if (uri.indexOf("://") != -1) {<NEW_LINE>final Protocol protocol = factory.forName(uri.substring(0, uri.indexOf("://")));<NEW_LINE>if (null == protocol) {<NEW_LINE>console.printf("Unknown protocol in URI %s%n", uri);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>final Host host = new HostParser(factory).get(uri);<NEW_LINE>switch(host.getProtocol().getType()) {<NEW_LINE>case file:<NEW_LINE>case b2:<NEW_LINE>case s3:<NEW_LINE>case googlestorage:<NEW_LINE>case swift:<NEW_LINE>case azure:<NEW_LINE>case googledrive:<NEW_LINE>case dropbox:<NEW_LINE>case onedrive:<NEW_LINE>break;<NEW_LINE>default:<NEW_LINE>if (StringUtils.isBlank(host.getHostname())) {<NEW_LINE>console.printf("Missing hostname in URI %s%n", uri);<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>if (StringUtils.isBlank(host.getDefaultPath())) {<NEW_LINE><MASK><NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>return true;<NEW_LINE>} catch (HostParserException e) {<NEW_LINE>console.printf(e.getDetail());<NEW_LINE>return false;<NEW_LINE>}<NEW_LINE>}
console.printf("Missing path in URI %s%n", uri);
1,567,063
protected void performContextAction(final Node[] nodes) {<NEW_LINE>if (!Subversion.getInstance().checkClientAvailable()) {<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>Context ctx = getContext(nodes);<NEW_LINE>final File[] roots = SvnUtils.getActionRoots(ctx);<NEW_LINE>if (roots == null || roots.length == 0)<NEW_LINE>return;<NEW_LINE>File[] files = Subversion.getInstance().getStatusCache().listFiles(ctx, FileInformation.STATUS_LOCAL_CHANGE);<NEW_LINE>File interestingFile;<NEW_LINE>if (roots.length == 1) {<NEW_LINE>interestingFile = roots[0];<NEW_LINE>} else {<NEW_LINE>interestingFile = SvnUtils.getPrimaryFile(roots[0]);<NEW_LINE>}<NEW_LINE>final SVNUrl repositoryUrl;<NEW_LINE>final SVNUrl fileUrl;<NEW_LINE>try {<NEW_LINE>// XXX<NEW_LINE>repositoryUrl = SvnUtils.getRepositoryRootUrl(interestingFile);<NEW_LINE>fileUrl = SvnUtils.getRepositoryUrl(interestingFile);<NEW_LINE>} catch (SVNClientException ex) {<NEW_LINE>SvnClientExceptionHandler.notifyException(ex, true, true);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>final RepositoryFile repositoryFile = new RepositoryFile(repositoryUrl, fileUrl, SVNRevision.HEAD);<NEW_LINE>final RequestProcessor rp = createRequestProcessor(ctx);<NEW_LINE>final <MASK><NEW_LINE>final CreateCopy createCopy = new CreateCopy(repositoryFile, interestingFile, hasChanges);<NEW_LINE>performCopy(createCopy, rp, nodes, roots);<NEW_LINE>}
boolean hasChanges = files.length > 0;
1,504,713
// Interpolate a color between values, potentially<NEW_LINE>int interpColor(float where) {<NEW_LINE>if (colors.size() == 0)<NEW_LINE>return 0;<NEW_LINE>if (colors.size() == 1)<NEW_LINE>return colors.get(0);<NEW_LINE>float pos = where * colors.size();<NEW_LINE>int aIdx = (int) Math.floor(pos);<NEW_LINE>int bIdx = (int) Math.ceil(pos);<NEW_LINE>if (bIdx >= colors.size())<NEW_LINE>bIdx = colors.size() - 1;<NEW_LINE>if (aIdx >= colors.size())<NEW_LINE>aIdx = colors.size() - 1;<NEW_LINE>float t = pos - aIdx;<NEW_LINE>int a = colors.get(aIdx);<NEW_LINE>int b = colors.get(bIdx);<NEW_LINE>int[] aVals = new int[4];<NEW_LINE>int[] bVals = new int[4];<NEW_LINE>aVals[0] = Color.red(a);<NEW_LINE>aVals[1] = Color.green(a);<NEW_LINE>aVals[2] = Color.blue(a);<NEW_LINE>aVals[3] = Color.alpha(4);<NEW_LINE>bVals[0] = Color.red(b);<NEW_LINE>bVals[1] = Color.green(b);<NEW_LINE>bVals[2] = Color.blue(b);<NEW_LINE>bVals[3] = Color.alpha(b);<NEW_LINE>int[<MASK><NEW_LINE>for (int ii = 0; ii < 4; ii++) iVals[ii] = (int) ((bVals[ii] - aVals[ii]) * t + aVals[ii]);<NEW_LINE>return Color.argb(iVals[3], iVals[0], iVals[1], iVals[2]);<NEW_LINE>}
] iVals = new int[4];
347,896
public KeyValue unmarshall(JsonUnmarshallerContext context) throws Exception {<NEW_LINE>KeyValue keyValue = new KeyValue();<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("Key", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>keyValue.setKey(context.getUnmarshaller(String.class).unmarshall(context));<NEW_LINE>}<NEW_LINE>if (context.testExpression("Value", targetDepth)) {<NEW_LINE>context.nextToken();<NEW_LINE>keyValue.setValue(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 keyValue;<NEW_LINE>}
String currentParentElement = context.getCurrentParentElement();
304,534
private void benchmarkSelected(String id, String selectedDevices, double refElapsed, double refElapsedMedian, double refFirstIteration) {<NEW_LINE>final String[] devices = selectedDevices.split(",");<NEW_LINE>for (String device : devices) {<NEW_LINE>final String[] indicies = device.split(":");<NEW_LINE>final int driverIndex = Integer.parseInt(indicies[0]);<NEW_LINE>final int deviceIndex = Integer<MASK><NEW_LINE>final BenchmarkDriver deviceTest = getTornadoDriver();<NEW_LINE>final TornadoDriver driver = TornadoRuntime.getTornadoRuntime().getDriver(driverIndex);<NEW_LINE>final TornadoDevice tornadoDevice = driver.getDevice(deviceIndex);<NEW_LINE>deviceTest.benchmark(tornadoDevice, TORNADO_PROFILER);<NEW_LINE>System.out.printf("bm=%-15s, device=%-5s, %s, speedupAvg=%.4f, speedupMedian=%.4f, speedupFirstIteration=%.4f, CV=%.4f, deviceName=%s\n", id, driverIndex + ":" + deviceIndex, deviceTest.getPreciseSummary(), refElapsed / deviceTest.getAverage(), refElapsedMedian / deviceTest.getMedian(), refFirstIteration / deviceTest.getFirstIteration(), deviceTest.getCV(), driver.getDevice(deviceIndex));<NEW_LINE>}<NEW_LINE>}
.parseInt(indicies[1]);
144,680
public static RecalibrationReport apply(final JavaPairRDD<GATKRead, Iterable<GATKVariant>> readsWithVariants, final SAMFileHeader header, final String referenceFileName, final RecalibrationArgumentCollection recalArgs) {<NEW_LINE>JavaRDD<RecalibrationTables> unmergedTables = readsWithVariants.mapPartitions(readsWithVariantsIterator -> {<NEW_LINE>String pathOnExecutor = SparkFiles.get(referenceFileName);<NEW_LINE>ReferenceDataSource referenceDataSource = new ReferenceFileSource(IOUtils.getPath(pathOnExecutor));<NEW_LINE>final BaseRecalibrationEngine bqsr = new BaseRecalibrationEngine(recalArgs, header);<NEW_LINE>bqsr.logCovariatesUsed();<NEW_LINE>Utils.stream(readsWithVariantsIterator).forEach(t -> bqsr.processRead(t._1, referenceDataSource, t._2));<NEW_LINE>return Iterators.<MASK><NEW_LINE>});<NEW_LINE>final RecalibrationTables emptyRecalibrationTable = new RecalibrationTables(new StandardCovariateList(recalArgs, header));<NEW_LINE>final RecalibrationTables combinedTables = unmergedTables.treeAggregate(emptyRecalibrationTable, RecalibrationTables::inPlaceCombine, RecalibrationTables::inPlaceCombine, Math.max(1, (int) (Math.log(unmergedTables.partitions().size()) / Math.log(2))));<NEW_LINE>BaseRecalibrationEngine.finalizeRecalibrationTables(combinedTables);<NEW_LINE>final QuantizationInfo quantizationInfo = new QuantizationInfo(combinedTables, recalArgs.QUANTIZING_LEVELS);<NEW_LINE>final StandardCovariateList covariates = new StandardCovariateList(recalArgs, header);<NEW_LINE>return RecalUtils.createRecalibrationReport(recalArgs.generateReportTable(covariates.covariateNames()), quantizationInfo.generateReportTable(), RecalUtils.generateReportTables(combinedTables, covariates));<NEW_LINE>}
singletonIterator(bqsr.getRecalibrationTables());
1,237,919
private static void drawAddress(Graphics2D g, int xpos, int ypos, int nrAddressBits) {<NEW_LINE>GraphicsUtil.switchToWidth(g, 1);<NEW_LINE>GraphicsUtil.drawText(g, "0", xpos + 22, ypos + 10, GraphicsUtil.H_LEFT, GraphicsUtil.V_CENTER);<NEW_LINE>GraphicsUtil.drawText(g, Integer.toString(nrAddressBits - 1), xpos + 22, ypos + 30, GraphicsUtil.H_LEFT, GraphicsUtil.V_CENTER);<NEW_LINE>GraphicsUtil.drawText(g, "A", xpos + 50, ypos + 20, GraphicsUtil.H_LEFT, GraphicsUtil.V_CENTER);<NEW_LINE>g.drawLine(xpos + 40, ypos + 5, xpos + 45, ypos + 10);<NEW_LINE>g.drawLine(xpos + 45, ypos + 10, xpos + 45, ypos + 17);<NEW_LINE>g.drawLine(xpos + 45, ypos + 17, xpos + 48, ypos + 20);<NEW_LINE>g.drawLine(xpos + 48, ypos + 20, xpos + 45, ypos + 23);<NEW_LINE>g.drawLine(xpos + 45, ypos + 23, xpos + 45, ypos + 30);<NEW_LINE>g.drawLine(xpos + 40, ypos + 35, <MASK><NEW_LINE>final var size = Long.toString((1 << nrAddressBits) - 1);<NEW_LINE>final var font = g.getFont();<NEW_LINE>final var fm = g.getFontMetrics(font);<NEW_LINE>final var StrSize = fm.stringWidth(size);<NEW_LINE>g.drawLine(xpos + 60, ypos + 20, xpos + 60 + StrSize, ypos + 20);<NEW_LINE>GraphicsUtil.drawText(g, "0", xpos + 60 + (StrSize / 2), ypos + 19, GraphicsUtil.H_CENTER, GraphicsUtil.V_BOTTOM);<NEW_LINE>GraphicsUtil.drawText(g, size, xpos + 60 + (StrSize / 2), ypos + 21, GraphicsUtil.H_CENTER, GraphicsUtil.V_TOP);<NEW_LINE>}
xpos + 45, ypos + 30);
1,475,299
final SetActiveReceiptRuleSetResult executeSetActiveReceiptRuleSet(SetActiveReceiptRuleSetRequest setActiveReceiptRuleSetRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(setActiveReceiptRuleSetRequest);<NEW_LINE><MASK><NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<SetActiveReceiptRuleSetRequest> request = null;<NEW_LINE>Response<SetActiveReceiptRuleSetResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new SetActiveReceiptRuleSetRequestMarshaller().marshall(super.beforeMarshalling(setActiveReceiptRuleSetRequest));<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, "SES");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "SetActiveReceiptRuleSet");<NEW_LINE>request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);<NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>StaxResponseHandler<SetActiveReceiptRuleSetResult> responseHandler = new StaxResponseHandler<SetActiveReceiptRuleSetResult>(new SetActiveReceiptRuleSetResultStaxUnmarshaller());<NEW_LINE>response = invoke(request, responseHandler, executionContext);<NEW_LINE>return response.getAwsResponse();<NEW_LINE>} finally {<NEW_LINE>endClientExecution(awsRequestMetrics, request, response);<NEW_LINE>}<NEW_LINE>}
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
1,635,092
public CommandDataVersions generateCustomCommandData(Player player) {<NEW_LINE>if (!this.testPermission(player)) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>CommandData customData = this.commandData.clone();<NEW_LINE>if (getAliases().length > 0) {<NEW_LINE>List<String> aliases = new ArrayList<>(Arrays.asList(getAliases()));<NEW_LINE>if (!aliases.contains(this.name)) {<NEW_LINE>aliases.add(this.name);<NEW_LINE>}<NEW_LINE>customData.aliases = new CommandEnum(this.name + "Aliases", aliases);<NEW_LINE>}<NEW_LINE>customData.description = player.getServer().getLanguage().translateString(this.getDescription());<NEW_LINE>this.commandParameters.forEach((key, par) -> {<NEW_LINE>CommandOverload overload = new CommandOverload();<NEW_LINE>overload.input.parameters = par;<NEW_LINE>customData.overloads.put(key, overload);<NEW_LINE>});<NEW_LINE>if (customData.overloads.size() == 0)<NEW_LINE>customData.overloads.put<MASK><NEW_LINE>CommandDataVersions versions = new CommandDataVersions();<NEW_LINE>versions.versions.add(customData);<NEW_LINE>return versions;<NEW_LINE>}
("default", new CommandOverload());
707,790
private IQueryFilter<I_M_Tour_Instance> createTourInstanceMatcher(final ITourInstanceQueryParams params) {<NEW_LINE>Check.assumeNotNull(params, "params not null");<NEW_LINE>final IQueryBL queryBL = <MASK><NEW_LINE>final ICompositeQueryFilter<I_M_Tour_Instance> filters = queryBL.createCompositeQueryFilter(I_M_Tour_Instance.class);<NEW_LINE>//<NEW_LINE>// Filter: Tour<NEW_LINE>final I_M_Tour tour = params.getM_Tour();<NEW_LINE>if (tour != null) {<NEW_LINE>final int tourId = tour.getM_Tour_ID();<NEW_LINE>Check.assume(tourId > 0, "Tour shall be saved: {}", tour);<NEW_LINE>filters.addEqualsFilter(I_M_Tour_Instance.COLUMN_M_Tour_ID, tourId);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Filter: DeliveryDate<NEW_LINE>final Date deliveryDate = params.getDeliveryDate();<NEW_LINE>if (deliveryDate != null) {<NEW_LINE>filters.addEqualsFilter(I_M_Tour_Instance.COLUMN_DeliveryDate, deliveryDate);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Filter: Processed<NEW_LINE>final Boolean processed = params.getProcessed();<NEW_LINE>if (processed != null) {<NEW_LINE>filters.addEqualsFilter(I_M_Tour_Instance.COLUMN_Processed, processed);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Filter: Generic Tour Instance (i.e. M_ShipperTransportation_ID is null)<NEW_LINE>final Boolean genericTourInstanceObj = params.getGenericTourInstance();<NEW_LINE>if (genericTourInstanceObj == null) {<NEW_LINE>// skip generic tour instance filtering<NEW_LINE>} else if (genericTourInstanceObj == true) {<NEW_LINE>filters.addEqualsFilter(I_M_Tour_Instance.COLUMN_M_ShipperTransportation_ID, null);<NEW_LINE>} else // genericTourInstance == false<NEW_LINE>{<NEW_LINE>filters.addNotEqualsFilter(I_M_Tour_Instance.COLUMN_M_ShipperTransportation_ID, null);<NEW_LINE>}<NEW_LINE>//<NEW_LINE>// Filter by M_ShipperTransportation_ID<NEW_LINE>if (params.getM_ShipperTransportation_ID() > 0) {<NEW_LINE>Check.assume(!Boolean.TRUE.equals(genericTourInstanceObj), "When filtering by M_ShipperTransportation_ID, genericTourInstance shall not be true: {}", params);<NEW_LINE>filters.addEqualsFilter(I_M_Tour_Instance.COLUMN_M_ShipperTransportation_ID, params.getM_ShipperTransportation_ID());<NEW_LINE>}<NEW_LINE>return filters;<NEW_LINE>}
Services.get(IQueryBL.class);
405,047
public static void main(final String[] args) {<NEW_LINE>BasicNetwork network = new BasicNetwork();<NEW_LINE>network.addLayer(new BasicLayer(null, true, 2));<NEW_LINE>network.addLayer(new BasicLayer(new ActivationSigmoid(), true, 5));<NEW_LINE>network.addLayer(new BasicLayer(new ActivationSigmoid(), false, 1));<NEW_LINE>network.finalizeStructure();<NEW_LINE>network.reset();<NEW_LINE>List<BasicData> trainingData = <MASK><NEW_LINE>// train the neural network<NEW_LINE>final BackPropagation train = new BackPropagation(network, trainingData, 0.7, 0.9);<NEW_LINE>int epoch = 1;<NEW_LINE>do {<NEW_LINE>train.iteration();<NEW_LINE>System.out.println("Epoch #" + epoch + " Error:" + train.getLastError());<NEW_LINE>epoch++;<NEW_LINE>} while (train.getLastError() > 0.01);<NEW_LINE>// test the neural network<NEW_LINE>System.out.println("Neural Network Results:");<NEW_LINE>for (int i = 0; i < XOR_INPUT.length; i++) {<NEW_LINE>double[] output = network.computeRegression(XOR_INPUT[i]);<NEW_LINE>System.out.println(Arrays.toString(XOR_INPUT[i]) + ", actual=" + Arrays.toString(output) + ",ideal=" + Arrays.toString(XOR_IDEAL[i]));<NEW_LINE>}<NEW_LINE>}
BasicData.combineXY(XOR_INPUT, XOR_IDEAL);
1,524,333
public static void PP_Order_BOMLine(MPPOrderBOMLine obl) {<NEW_LINE>String trxName = obl.get_TrxName();<NEW_LINE><MASK><NEW_LINE>//<NEW_LINE>String typeMRP = MPPMRP.TYPEMRP_Demand;<NEW_LINE>BigDecimal qty = obl.getQtyRequired().subtract(obl.getQtyDelivered());<NEW_LINE>if (obl.isCoProduct() || obl.isByProduct()) {<NEW_LINE>typeMRP = MPPMRP.TYPEMRP_Supply;<NEW_LINE>qty = qty.negate();<NEW_LINE>}<NEW_LINE>//<NEW_LINE>MPPMRP mrp = getQuery(obl, null, ORDERTYPE_ManufacturingOrder).firstOnly();<NEW_LINE>if (mrp == null) {<NEW_LINE>mrp = new MPPMRP(ctx, 0, trxName);<NEW_LINE>mrp.setPP_Order_BOMLine_ID(obl.getPP_Order_BOMLine_ID());<NEW_LINE>}<NEW_LINE>MPPOrder o = obl.getParent();<NEW_LINE>mrp.setAD_Org_ID(obl.getAD_Org_ID());<NEW_LINE>mrp.setTypeMRP(typeMRP);<NEW_LINE>mrp.setPP_Order(o);<NEW_LINE>mrp.setM_Warehouse_ID(obl.getM_Warehouse_ID());<NEW_LINE>mrp.setM_Product_ID(obl.getM_Product_ID());<NEW_LINE>mrp.setQty(qty);<NEW_LINE>mrp.saveEx();<NEW_LINE>}
Properties ctx = obl.getCtx();
378,952
private DateTimeResolutionResult parseEachUnit(String text) {<NEW_LINE>DateTimeResolutionResult ret = new DateTimeResolutionResult();<NEW_LINE>// handle "daily", "weekly"<NEW_LINE>Optional<Match> matched = Arrays.stream(RegExpUtility.getMatches(this.config.getPeriodicRegex(), text)).findFirst();<NEW_LINE>if (matched.isPresent()) {<NEW_LINE>MatchedTimexResult result = this.config.getMatchedDailyTimex(text);<NEW_LINE>if (!result.getResult()) {<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>ret.setTimex(result.getTimex());<NEW_LINE>ret.setFutureValue("Set: " + ret.getTimex());<NEW_LINE>ret.setPastValue("Set: " + ret.getTimex());<NEW_LINE>ret.setSuccess(true);<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>// Handle "each month"<NEW_LINE>ConditionalMatch exactMatch = RegexExtension.matchExact(this.config.getEachUnitRegex(), text, true);<NEW_LINE>if (exactMatch.getSuccess()) {<NEW_LINE>String sourceUnit = exactMatch.getMatch().get().getGroup("unit").value;<NEW_LINE>if (!StringUtility.isNullOrEmpty(sourceUnit) && this.config.getUnitMap().containsKey(sourceUnit)) {<NEW_LINE>MatchedTimexResult result = this.config.getMatchedUnitTimex(sourceUnit);<NEW_LINE>if (!result.getResult()) {<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>// Handle "every other month"<NEW_LINE>Optional<Match> match = Arrays.stream(RegExpUtility.getMatches(this.config.getEachUnitRegex(), text)).findFirst();<NEW_LINE>if (exactMatch.getMatch().get().getGroup("other").value != "") {<NEW_LINE>result.setTimex(result.getTimex().replace("1", "2"));<NEW_LINE>}<NEW_LINE>ret.setTimex(result.getTimex());<NEW_LINE>ret.setFutureValue("Set: " + ret.getTimex());<NEW_LINE>ret.setPastValue(<MASK><NEW_LINE>ret.setSuccess(true);<NEW_LINE>return ret;<NEW_LINE>}<NEW_LINE>}<NEW_LINE>return ret;<NEW_LINE>}
"Set: " + ret.getTimex());
674,993
public Map<String, Map<String, AttributeAdapter>> attributeAdaptersForFunction() {<NEW_LINE>Map<String, Map<String, AttributeAdapter>> ret = new HashMap<>();<NEW_LINE>Map<String, AttributeAdapter> tfMappings = new LinkedHashMap<>();<NEW_LINE>val fields = DifferentialFunctionClassHolder.getInstance().getFieldsForFunction(this);<NEW_LINE>// TF uses [kH, kW, inC, outC] always for weights<NEW_LINE>tfMappings.put("kH", new NDArrayShapeAdapter(0));<NEW_LINE>tfMappings.put("kW", new NDArrayShapeAdapter(1));<NEW_LINE>tfMappings.put("sH", new ConditionalFieldValueIntIndexArrayAdapter("NCHW", 2, 1, fields.get("dataFormat")));<NEW_LINE>tfMappings.put("sW", new ConditionalFieldValueIntIndexArrayAdapter("NCHW", 3, 2, fields.get("dataFormat")));<NEW_LINE>tfMappings.put("dH", new ConditionalFieldValueIntIndexArrayAdapter("NCHW", 2, 1, fields.get("dataFormat")));<NEW_LINE>tfMappings.put("dW", new ConditionalFieldValueIntIndexArrayAdapter("NCHW", 3, 2, fields.get("dataFormat")));<NEW_LINE>tfMappings.put("isSameMode", new StringEqualsAdapter("SAME"));<NEW_LINE>Map<String, AttributeAdapter> <MASK><NEW_LINE>onnxMappings.put("kH", new SizeThresholdIntArrayIntIndexAdapter(0, 2, 0));<NEW_LINE>onnxMappings.put("kW", new SizeThresholdIntArrayIntIndexAdapter(1, 2, 0));<NEW_LINE>onnxMappings.put("dH", new SizeThresholdIntArrayIntIndexAdapter(0, 2, 0));<NEW_LINE>onnxMappings.put("dW", new SizeThresholdIntArrayIntIndexAdapter(1, 2, 0));<NEW_LINE>onnxMappings.put("sH", new SizeThresholdIntArrayIntIndexAdapter(0, 2, 0));<NEW_LINE>onnxMappings.put("sW", new SizeThresholdIntArrayIntIndexAdapter(1, 2, 0));<NEW_LINE>onnxMappings.put("isSameMode", new StringEqualsAdapter("SAME"));<NEW_LINE>ret.put(tensorflowName(), tfMappings);<NEW_LINE>ret.put(onnxName(), onnxMappings);<NEW_LINE>return ret;<NEW_LINE>}
onnxMappings = new HashMap<>();
263,165
public float evaluate(int indexA, int indexB, float t) {<NEW_LINE>m_sweepA.getTransform(xfa, t);<NEW_LINE>m_sweepB.getTransform(xfb, t);<NEW_LINE>switch(m_type) {<NEW_LINE>case POINTS:<NEW_LINE>{<NEW_LINE>localPointA.set(m_proxyA.getVertex(indexA));<NEW_LINE>localPointB.set(m_proxyB.getVertex(indexB));<NEW_LINE>Transform.mulToOutUnsafe(xfa, localPointA, pointA);<NEW_LINE>Transform.mulToOutUnsafe(xfb, localPointB, pointB);<NEW_LINE>float separation = Vec2.dot(pointB.subLocal(pointA), m_axis);<NEW_LINE>return separation;<NEW_LINE>}<NEW_LINE>case FACE_A:<NEW_LINE>{<NEW_LINE>Rot.mulToOutUnsafe(<MASK><NEW_LINE>Transform.mulToOutUnsafe(xfa, m_localPoint, pointA);<NEW_LINE>localPointB.set(m_proxyB.getVertex(indexB));<NEW_LINE>Transform.mulToOutUnsafe(xfb, localPointB, pointB);<NEW_LINE>float separation = Vec2.dot(pointB.subLocal(pointA), normal);<NEW_LINE>return separation;<NEW_LINE>}<NEW_LINE>case FACE_B:<NEW_LINE>{<NEW_LINE>Rot.mulToOutUnsafe(xfb.q, m_axis, normal);<NEW_LINE>Transform.mulToOutUnsafe(xfb, m_localPoint, pointB);<NEW_LINE>localPointA.set(m_proxyA.getVertex(indexA));<NEW_LINE>Transform.mulToOutUnsafe(xfa, localPointA, pointA);<NEW_LINE>float separation = Vec2.dot(pointA.subLocal(pointB), normal);<NEW_LINE>return separation;<NEW_LINE>}<NEW_LINE>default:<NEW_LINE>assert (false);<NEW_LINE>return 0f;<NEW_LINE>}<NEW_LINE>}
xfa.q, m_axis, normal);
1,496,461
private static void decode11(DataInput in, long[] tmp, long[] longs) throws IOException {<NEW_LINE>in.readLongs(tmp, 0, 22);<NEW_LINE>shiftLongs(tmp, 22, longs, 0, 5, MASK16_11);<NEW_LINE>for (int iter = 0, tmpIdx = 0, longsIdx = 22; iter < 2; ++iter, tmpIdx += 11, longsIdx += 5) {<NEW_LINE>long l0 = (tmp[tmpIdx + 0] & MASK16_5) << 6;<NEW_LINE>l0 |= (tmp[tmpIdx + 1] & MASK16_5) << 1;<NEW_LINE>l0 |= (tmp[tmpIdx + 2] >>> 4) & MASK16_1;<NEW_LINE>longs[longsIdx + 0] = l0;<NEW_LINE>long l1 = (tmp[tmpIdx + 2] & MASK16_4) << 7;<NEW_LINE>l1 |= (tmp[tmpIdx + 3] & MASK16_5) << 2;<NEW_LINE>l1 |= (tmp[tmpIdx + 4] >>> 3) & MASK16_2;<NEW_LINE>longs[longsIdx + 1] = l1;<NEW_LINE>long l2 = (tmp[tmpIdx + 4] & MASK16_3) << 8;<NEW_LINE>l2 |= (tmp[tmpIdx + 5] & MASK16_5) << 3;<NEW_LINE>l2 |= (tmp[tmpIdx + 6] >>> 2) & MASK16_3;<NEW_LINE>longs[longsIdx + 2] = l2;<NEW_LINE>long l3 = (tmp[tmpIdx + 6] & MASK16_2) << 9;<NEW_LINE>l3 |= (tmp[tmpIdx + 7] & MASK16_5) << 4;<NEW_LINE>l3 |= (tmp[tmpIdx + 8] >>> 1) & MASK16_4;<NEW_LINE>longs[longsIdx + 3] = l3;<NEW_LINE>long l4 = (tmp[tmpIdx + 8] & MASK16_1) << 10;<NEW_LINE>l4 |= (tmp[tmpIdx + 9] & MASK16_5) << 5;<NEW_LINE>l4 |= (tmp[tmpIdx + 10] & MASK16_5) << 0;<NEW_LINE><MASK><NEW_LINE>}<NEW_LINE>}
longs[longsIdx + 4] = l4;
1,062,293
final UpdateUserPoolDomainResult executeUpdateUserPoolDomain(UpdateUserPoolDomainRequest updateUserPoolDomainRequest) {<NEW_LINE>ExecutionContext executionContext = createExecutionContext(updateUserPoolDomainRequest);<NEW_LINE>AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();<NEW_LINE>awsRequestMetrics.startEvent(Field.ClientExecuteTime);<NEW_LINE>Request<UpdateUserPoolDomainRequest> request = null;<NEW_LINE>Response<UpdateUserPoolDomainResult> response = null;<NEW_LINE>try {<NEW_LINE>awsRequestMetrics.startEvent(Field.RequestMarshallTime);<NEW_LINE>try {<NEW_LINE>request = new UpdateUserPoolDomainRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateUserPoolDomainRequest));<NEW_LINE>// Binds the request metrics to the current request.<NEW_LINE>request.setAWSRequestMetrics(awsRequestMetrics);<NEW_LINE>request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);<NEW_LINE>request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());<NEW_LINE>request.addHandlerContext(HandlerContextKey.SERVICE_ID, "Cognito Identity Provider");<NEW_LINE>request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateUserPoolDomain");<NEW_LINE>request.<MASK><NEW_LINE>} finally {<NEW_LINE>awsRequestMetrics.endEvent(Field.RequestMarshallTime);<NEW_LINE>}<NEW_LINE>HttpResponseHandler<AmazonWebServiceResponse<UpdateUserPoolDomainResult>> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateUserPoolDomainResultJsonUnmarshaller());<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.ADVANCED_CONFIG, advancedConfig);
623,145
public static boolean isDatabaseOK(Properties ctx) {<NEW_LINE>// Validate UUID supported<NEW_LINE>DB.validateSupportedUUIDFromDB();<NEW_LINE>// Check Version<NEW_LINE>String version = "?";<NEW_LINE>String sql = "SELECT Version FROM AD_System";<NEW_LINE>PreparedStatement pstmt = null;<NEW_LINE>ResultSet rs = null;<NEW_LINE>try {<NEW_LINE>pstmt = prepareStatement(sql, null);<NEW_LINE>rs = pstmt.executeQuery();<NEW_LINE>if (rs.next())<NEW_LINE>version = rs.getString(1);<NEW_LINE>} catch (SQLException e) {<NEW_LINE>log.log(Level.SEVERE, "Problem with AD_System Table - Run system.sql script - " + e.toString());<NEW_LINE>return false;<NEW_LINE>} finally {<NEW_LINE>close(rs);<NEW_LINE>close(pstmt);<NEW_LINE>rs = null;<NEW_LINE>pstmt = null;<NEW_LINE>}<NEW_LINE>log.info("DB_Version=" + version);<NEW_LINE>// Identical DB version<NEW_LINE>if (Adempiere.DB_VERSION.equals(version))<NEW_LINE>return true;<NEW_LINE>String AD_Message = "DatabaseVersionError";<NEW_LINE>String title = org.compiere.Adempiere.getName() + " " + Msg.getMsg(ctx, AD_Message, true);<NEW_LINE>// Code assumes Database version {0}, but Database has Version {1}.<NEW_LINE>// complete message<NEW_LINE>String msg = Msg.getMsg(ctx, AD_Message);<NEW_LINE>msg = MessageFormat.format(msg, new Object[] { Adempiere.DB_VERSION, version });<NEW_LINE>Object[] options = { "Migrate" };<NEW_LINE>JOptionPane.showOptionDialog(null, msg, title, JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE, UIManager.getIcon("OptionPane.errorIcon"), options, options[0]);<NEW_LINE>JOptionPane.showMessageDialog(null, <MASK><NEW_LINE>Env.exitEnv(1);<NEW_LINE>return false;<NEW_LINE>}
"Start RUN_Migrate (in utils)\nSee: http://wiki.adempiere.net/maintain", title, JOptionPane.INFORMATION_MESSAGE);
1,181,453
/* (non-Javadoc)<NEW_LINE>* @see org.apache.jmeter.visualizers.request.RequestView#init()<NEW_LINE>*/<NEW_LINE>@Override<NEW_LINE>public void init() {<NEW_LINE>paneRaw = new JPanel(new BorderLayout(0, 5));<NEW_LINE>sampleDataField = JSyntaxTextArea.<MASK><NEW_LINE>sampleDataField.setEditable(false);<NEW_LINE>sampleDataField.setLineWrap(true);<NEW_LINE>sampleDataField.setWrapStyleWord(true);<NEW_LINE>JPanel requestAndSearchPanel = new JPanel(new BorderLayout());<NEW_LINE>requestAndSearchPanel.add(new JSyntaxSearchToolBar(sampleDataField).getToolBar(), BorderLayout.NORTH);<NEW_LINE>requestAndSearchPanel.add(JTextScrollPane.getInstance(sampleDataField), BorderLayout.CENTER);<NEW_LINE>headerData = JSyntaxTextArea.getInstance(20, 80, true);<NEW_LINE>headerData.setEditable(false);<NEW_LINE>headerData.setLineWrap(true);<NEW_LINE>headerData.setWrapStyleWord(true);<NEW_LINE>JPanel headerAndSearchPanel = new JPanel(new BorderLayout());<NEW_LINE>headerAndSearchPanel.add(new JSyntaxSearchToolBar(headerData).getToolBar(), BorderLayout.NORTH);<NEW_LINE>headerAndSearchPanel.add(JTextScrollPane.getInstance(headerData), BorderLayout.CENTER);<NEW_LINE>JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);<NEW_LINE>tabbedPane.addTab(JMeterUtils.getResString("view_results_request_body"), new JScrollPane(requestAndSearchPanel));<NEW_LINE>tabbedPane.addTab(JMeterUtils.getResString("view_results_request_headers"), new JScrollPane(headerAndSearchPanel));<NEW_LINE>paneRaw.add(GuiUtils.makeScrollPane(tabbedPane));<NEW_LINE>}
getInstance(20, 80, true);
1,694,511
public FieldList deserialize(JsonElement jsonElement, Type type, JsonDeserializationContext jsonDeserializationContext) throws JsonParseException {<NEW_LINE>JsonArray fieldsArray = jsonElement.getAsJsonArray();<NEW_LINE>for (JsonElement fieldElement : fieldsArray) {<NEW_LINE>JsonObject fieldObject = fieldElement.getAsJsonObject();<NEW_LINE>// Field class stores types as LegacySQLTypeName instead of StandardSQLTypeName<NEW_LINE>if (fieldObject.has("type")) {<NEW_LINE>// Convert standard type to legacy type<NEW_LINE>StandardSQLTypeName standardType = StandardSQLTypeName.valueOf(fieldObject.get("type").getAsString());<NEW_LINE>LegacySQLTypeName <MASK><NEW_LINE>// Insert LegacySQLTypeName object so it can be used for type<NEW_LINE>JsonObject typeObject = new JsonObject();<NEW_LINE>typeObject.addProperty("constant", legacyType.name());<NEW_LINE>fieldObject.add("type", typeObject);<NEW_LINE>}<NEW_LINE>// Field class uses subFields instead of fields for STRUCT/RECORD type<NEW_LINE>if (fieldObject.has("fields")) {<NEW_LINE>fieldObject.add("subFields", fieldObject.get("fields"));<NEW_LINE>fieldObject.remove("fields");<NEW_LINE>}<NEW_LINE>}<NEW_LINE>Field[] fields = jsonDeserializationContext.deserialize(fieldsArray, Field[].class);<NEW_LINE>return FieldList.of(fields);<NEW_LINE>}
legacyType = LegacySQLTypeName.legacySQLTypeName(standardType);
591,540
public static GalenActionGenerateArguments parse(String[] args) {<NEW_LINE>args = ArgumentsUtils.processSystemProperties(args);<NEW_LINE>Options options = new Options();<NEW_LINE>options.addOption("e", "export", true, "Path to generated spec file");<NEW_LINE>options.addOption("G", "no-galen-extras", false, "Disable galen-extras expressions");<NEW_LINE>CommandLineParser parser = new PosixParser();<NEW_LINE>CommandLine cmd;<NEW_LINE>try {<NEW_LINE>cmd = <MASK><NEW_LINE>} catch (MissingArgumentException e) {<NEW_LINE>throw new IllegalArgumentException("Missing value for " + e.getOption().getLongOpt(), e);<NEW_LINE>} catch (Exception ex) {<NEW_LINE>throw new RuntimeException(ex);<NEW_LINE>}<NEW_LINE>GalenActionGenerateArguments arguments = new GalenActionGenerateArguments();<NEW_LINE>arguments.setExport(cmd.getOptionValue("e"));<NEW_LINE>arguments.setUseGalenExtras(!cmd.hasOption("G"));<NEW_LINE>if (cmd.getArgs() == null || cmd.getArgs().length < 1) {<NEW_LINE>throw new IllegalArgumentException("Missing page dump file");<NEW_LINE>}<NEW_LINE>arguments.setPath(cmd.getArgs()[0]);<NEW_LINE>return arguments;<NEW_LINE>}
parser.parse(options, args);
1,045,595
private static // to the boundary of the merged component when a local maximum is encountered at index<NEW_LINE>void mergeComponents(final List<Component> components, final int[] colors, final int leftColor, final int rightColor, final int index) {<NEW_LINE>final int indexToKeep;<NEW_LINE>final int indexToMerge;<NEW_LINE>if (components.get(leftColor).minValue < components.get(rightColor).minValue) {<NEW_LINE>indexToKeep = leftColor;<NEW_LINE>indexToMerge = rightColor;<NEW_LINE>} else if (components.get(leftColor).minValue > components.get(rightColor).minValue) {<NEW_LINE>indexToKeep = rightColor;<NEW_LINE>indexToMerge = leftColor;<NEW_LINE>} else if (leftColor < rightColor) {<NEW_LINE>// if values are equal, sort by index<NEW_LINE>indexToKeep = leftColor;<NEW_LINE>indexToMerge = rightColor;<NEW_LINE>} else {<NEW_LINE>indexToKeep = rightColor;<NEW_LINE>indexToMerge = leftColor;<NEW_LINE>}<NEW_LINE>colors[components.get(indexToMerge).leftIndex] = indexToKeep;<NEW_LINE>colors[components.get<MASK><NEW_LINE>if (components.get(indexToKeep).minIndex > components.get(indexToMerge).minIndex) {<NEW_LINE>components.get(indexToKeep).leftIndex = components.get(indexToMerge).leftIndex;<NEW_LINE>} else {<NEW_LINE>components.get(indexToKeep).rightIndex = components.get(indexToMerge).rightIndex;<NEW_LINE>}<NEW_LINE>// local maximum takes color of component to left by convention<NEW_LINE>colors[index] = colors[index - 1];<NEW_LINE>}
(indexToMerge).rightIndex] = indexToKeep;
1,804,492
private static Provider csvLineToProvider(Map<String, String> line) {<NEW_LINE>Provider d = new Provider();<NEW_LINE>// using remove instead of get here so that we can iterate over the remaining keys later<NEW_LINE>d.id = line.remove("id");<NEW_LINE>d.npi = toProviderNPI(d.id, loaded);<NEW_LINE>d.name = line.remove("name");<NEW_LINE>if (d.name == null || d.name.isEmpty()) {<NEW_LINE>d.name = d.id;<NEW_LINE>}<NEW_LINE>String base = d.id + d.name;<NEW_LINE>d.uuid = UUID.nameUUIDFromBytes(base.getBytes()).toString();<NEW_LINE>d.locationUuid = UUID.nameUUIDFromBytes(new StringBuilder(base).reverse().toString().getBytes()).toString();<NEW_LINE>d.address = line.remove("address");<NEW_LINE>d.<MASK><NEW_LINE>d.state = line.remove("state");<NEW_LINE>d.zip = line.remove("zip");<NEW_LINE>d.phone = line.remove("phone");<NEW_LINE>d.rawType = line.remove("type");<NEW_LINE>d.ownership = line.remove("ownership");<NEW_LINE>try {<NEW_LINE>d.quality = Integer.parseInt(line.remove("quality"));<NEW_LINE>} catch (Exception e) {<NEW_LINE>// Swallow invalid format data<NEW_LINE>d.quality = 0;<NEW_LINE>}<NEW_LINE>try {<NEW_LINE>double lat = Double.parseDouble(line.remove("LAT"));<NEW_LINE>double lon = Double.parseDouble(line.remove("LON"));<NEW_LINE>d.coordinates.setLocation(lon, lat);<NEW_LINE>} catch (Exception e) {<NEW_LINE>d.coordinates.setLocation(0.0, 0.0);<NEW_LINE>}<NEW_LINE>return d;<NEW_LINE>}
city = line.remove("city");
844,869
static Property modelRefToProperty(springfox.documentation.schema.ModelReference modelRef) {<NEW_LINE>if (modelRef == null || "void".equalsIgnoreCase(modelRef.getType())) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>Property responseProperty;<NEW_LINE>if (modelRef.isCollection()) {<NEW_LINE>responseProperty = springfox.documentation.swagger2.mappers.Properties.property(modelRef);<NEW_LINE>} else if (modelRef.isMap()) {<NEW_LINE>responseProperty = new MapProperty(springfox.documentation.swagger2.mappers.Properties.property(modelRef.itemModel().orElseThrow(() -> <MASK><NEW_LINE>} else {<NEW_LINE>responseProperty = springfox.documentation.swagger2.mappers.Properties.property(modelRef.getType());<NEW_LINE>}<NEW_LINE>maybeAddAllowableValues(responseProperty, modelRef.getAllowableValues());<NEW_LINE>return responseProperty;<NEW_LINE>}
new IllegalStateException("ModelRef that is a map should have an itemModel"))));
1,418,461
private void loadPrev5min() {<NEW_LINE>Iterator<Integer> serverIds = serverObjMap<MASK><NEW_LINE>final List<Pack> result = new ArrayList<Pack>();<NEW_LINE>while (serverIds.hasNext()) {<NEW_LINE>int serverId = serverIds.next();<NEW_LINE>TcpProxy tcp = TcpProxy.getTcpProxy(serverId);<NEW_LINE>try {<NEW_LINE>MapPack param = new MapPack();<NEW_LINE>long etime = TimeUtil.getCurrentTime();<NEW_LINE>long stime = etime - DateUtil.MILLIS_PER_MINUTE * 5;<NEW_LINE>param.put("stime", stime);<NEW_LINE>param.put("etime", etime);<NEW_LINE>param.put("counter", counter);<NEW_LINE>param.put("objHash", serverObjMap.get(serverId));<NEW_LINE>tcp.process(RequestCmd.COUNTER_PAST_TIME_GROUP, param, new INetReader() {<NEW_LINE><NEW_LINE>public void process(DataInputX in) throws IOException {<NEW_LINE>Pack p = in.readPack();<NEW_LINE>result.add(p);<NEW_LINE>}<NEW_LINE>});<NEW_LINE>} catch (Exception e) {<NEW_LINE>e.printStackTrace();<NEW_LINE>} finally {<NEW_LINE>TcpProxy.putTcpProxy(tcp);<NEW_LINE>}<NEW_LINE>}<NEW_LINE>final Map<Long, Double> valueMap = ScouterUtil.getLoadTotalMap(counter, result, mode, TimeTypeEnum.REALTIME);<NEW_LINE>ExUtil.exec(canvas, new Runnable() {<NEW_LINE><NEW_LINE>public void run() {<NEW_LINE>CircularBufferDataProvider provider = (CircularBufferDataProvider) trace.getDataProvider();<NEW_LINE>provider.clearTrace();<NEW_LINE>Set<Long> timeSet = valueMap.keySet();<NEW_LINE>for (long time : timeSet) {<NEW_LINE>provider.addSample(new Sample(CastUtil.cdouble(time), CastUtil.cdouble(valueMap.get(time))));<NEW_LINE>}<NEW_LINE>}<NEW_LINE>});<NEW_LINE>}
.keySet().iterator();
1,191,012
protected void handleListenerSetup(final AsyncResult<DatagramSocket> listenResult, final CompletableFuture<InetSocketAddress> addressFuture) {<NEW_LINE>if (listenResult.failed()) {<NEW_LINE>Throwable cause = listenResult.cause();<NEW_LINE>LOG.error("An exception occurred when starting the peer discovery agent", cause);<NEW_LINE>if (cause instanceof BindException || cause instanceof SocketException) {<NEW_LINE>cause = new PeerDiscoveryServiceException(String.format("Failed to bind Ethereum UDP discovery listener to %s:%d: %s", config.getBindHost(), config.getBindPort(), cause.getMessage()));<NEW_LINE>}<NEW_LINE>addressFuture.completeExceptionally(cause);<NEW_LINE>return;<NEW_LINE>}<NEW_LINE>this.socket = listenResult.result();<NEW_LINE>// TODO: when using wildcard hosts (0.0.0.0), we need to handle multiple addresses by<NEW_LINE>// selecting<NEW_LINE>// the correct 'announce' address.<NEW_LINE>final String effectiveHost = socket.localAddress().host();<NEW_LINE>final int effectivePort = socket.localAddress().port();<NEW_LINE>LOG.info("Started peer discovery agent successfully, on effective host={} and port={}", effectiveHost, effectivePort);<NEW_LINE>socket.exceptionHandler(this::handleException);<NEW_LINE>socket.handler(this::handlePacket);<NEW_LINE>final InetSocketAddress address = new InetSocketAddress(socket.localAddress().host(), socket.<MASK><NEW_LINE>addressFuture.complete(address);<NEW_LINE>}
localAddress().port());
63,190
public static PartClauseItem convertToPartClauseItem(PartitionInfo partInfo, RelDataType relRowType, RexNode partPred, PartPruneStepBuildingContext stepContext) {<NEW_LINE>if (partPred == null) {<NEW_LINE>return null;<NEW_LINE>}<NEW_LINE>if (!(partPred instanceof RexCall)) {<NEW_LINE>PartClauseItem item = checkIfAlwaysTrueOrFalseExpr(partPred);<NEW_LINE>return item;<NEW_LINE>}<NEW_LINE>RexCall partPredInfo = (RexCall) partPred;<NEW_LINE>PartClauseItem clauseItem;<NEW_LINE>SqlKind kind = partPred.getKind();<NEW_LINE>if (kind == SqlKind.OR) {<NEW_LINE>clauseItem = convertOrExprToPartClauseItem(<MASK><NEW_LINE>} else if (kind == SqlKind.AND) {<NEW_LINE>clauseItem = convertAndExprToPartClauseItem(partInfo, relRowType, partPredInfo, stepContext);<NEW_LINE>} else {<NEW_LINE>clauseItem = convertBoolExprToPartClauseItem(partInfo, relRowType, partPredInfo, stepContext);<NEW_LINE>}<NEW_LINE>return clauseItem;<NEW_LINE>}
partInfo, relRowType, partPredInfo, stepContext);
1,332,078
public static DescribeGroupedTagsResponse unmarshall(DescribeGroupedTagsResponse describeGroupedTagsResponse, UnmarshallerContext _ctx) {<NEW_LINE>describeGroupedTagsResponse.setRequestId(_ctx.stringValue("DescribeGroupedTagsResponse.RequestId"));<NEW_LINE>describeGroupedTagsResponse.setSuccess(_ctx.booleanValue("DescribeGroupedTagsResponse.Success"));<NEW_LINE>describeGroupedTagsResponse.setCount(_ctx.integerValue("DescribeGroupedTagsResponse.Count"));<NEW_LINE>describeGroupedTagsResponse.setHttpStatusCode(_ctx.integerValue("DescribeGroupedTagsResponse.HttpStatusCode"));<NEW_LINE>List<GroupedFiled> groupedFileds = new ArrayList<GroupedFiled>();<NEW_LINE>for (int i = 0; i < _ctx.lengthValue("DescribeGroupedTagsResponse.GroupedFileds.Length"); i++) {<NEW_LINE>GroupedFiled groupedFiled = new GroupedFiled();<NEW_LINE>groupedFiled.setName(_ctx.stringValue<MASK><NEW_LINE>groupedFiled.setTagId(_ctx.integerValue("DescribeGroupedTagsResponse.GroupedFileds[" + i + "].TagId"));<NEW_LINE>groupedFiled.setCount(_ctx.stringValue("DescribeGroupedTagsResponse.GroupedFileds[" + i + "].Count"));<NEW_LINE>groupedFileds.add(groupedFiled);<NEW_LINE>}<NEW_LINE>describeGroupedTagsResponse.setGroupedFileds(groupedFileds);<NEW_LINE>return describeGroupedTagsResponse;<NEW_LINE>}
("DescribeGroupedTagsResponse.GroupedFileds[" + i + "].Name"));